From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 00:17:10 2014 Return-Path: Delivered-To: svn-src-all@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 15BEA1D1; Sun, 26 Oct 2014 00:17:10 +0000 (UTC) Received: from mail-wi0-x230.google.com (mail-wi0-x230.google.com [IPv6:2a00:1450:400c:c05::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 094D0D7A; Sun, 26 Oct 2014 00:17:08 +0000 (UTC) Received: by mail-wi0-f176.google.com with SMTP id n3so3729377wiv.9 for ; Sat, 25 Oct 2014 17:17:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=IiK53L133t+gOtcIE+Q0teG2KjkOPayAi53a3xSN3cY=; b=aLVHkjF/HlGwcT3so+DhZkF2/LsQji1shDl/9SzLzUB6TCxoAbecNxl545XIPWQGoF +7f86V95fPRXGL2IyxGTwYts09Dp/Lfu9lH+Dd1Rc8FEjU86SIhw73uwGAaD8ioc/n5S wb95xfraUF2cHpa8sv8dzLvjobx12TdrG4UtgAITPOlLBi6pDXdB+irfF7wAcvTrZ7eK J9dDEYvbrW69WtcqdC+ei8Djpy1MP0t4C56APrhukKNEYqaUQbMdAK3X/5lzm3J/Mguo Va5A37gI0CxHSD2nEgjlGJR5/Adv2emImdnCk2BQ/WUfZZ/1SQulY90a3KrQzOJrJFMw GQ3Q== X-Received: by 10.180.90.34 with SMTP id bt2mr12793652wib.58.1414282627321; Sat, 25 Oct 2014 17:17:07 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id ex6sm10226788wjb.20.2014.10.25.17.17.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Oct 2014 17:17:06 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 26 Oct 2014 02:17:04 +0200 From: Baptiste Daroussin To: Andrey Chernov Subject: Re: svn commit: r273601 - head/lib/libc/gen Message-ID: <20141026001704.GA55021@ivaldir.etoilebsd.net> References: <201410241955.s9OJtnbm014234@svn.freebsd.org> <544B0930.8010004@freebsd.org> <544B1C34.1020204@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EeQfGwPcQSOJBaQU" Content-Disposition: inline In-Reply-To: <544B1C34.1020204@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, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 00:17:10 -0000 --EeQfGwPcQSOJBaQU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 25, 2014 at 07:42:44AM +0400, Andrey Chernov wrote: > On 25.10.2014 6:21, Andrey Chernov wrote: > > On 24.10.2014 23:55, John Baldwin wrote: > >> Author: jhb > >> Date: Fri Oct 24 19:55:49 2014 > >> New Revision: 273601 > >> URL: https://svnweb.freebsd.org/changeset/base/273601 > >> > >> Log: > >> Don't reference sem(4) from the POSIX semaphore pages. POSIX semaph= ores > >> were reimplemented using umtx in FreeBSD 9 and no longer use sem(4). > >=20 > > sem kernel module referenced in sem(4) uses the same uipc_sem.c file as > > kernel's P1003_1B_SEMAPHORES option, so they both use the same code and > > better be cross-linked since sem(4) explains how to turn it on. > >=20 >=20 > From the first glance I can't determine, is libc implementation better > than kernel one or not. BTW, firefox port still recommends sem_load=3D"YE= S" >=20 Firefox still recommands sem_load because we still support FreeBSD 8. regards, Bapt --EeQfGwPcQSOJBaQU Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlRMPYAACgkQ8kTtMUmk6ExlpACfVPHv8Kx17HEBlHneJsP+Pv23 a2gAnR7AzWndDB1FISugoPBgyE4i9U9S =WtYy -----END PGP SIGNATURE----- --EeQfGwPcQSOJBaQU-- From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 01:15:16 2014 Return-Path: Delivered-To: svn-src-all@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 E97AC855; Sun, 26 Oct 2014 01:15: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 CA3182AE; Sun, 26 Oct 2014 01:15: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 s9Q1FGxm041076; Sun, 26 Oct 2014 01:15:16 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q1FGDK041075; Sun, 26 Oct 2014 01:15:16 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260115.s9Q1FGDK041075@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 01:15:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273650 - stable/10/sys/arm/rockchip X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 01:15:17 -0000 Author: ian Date: Sun Oct 26 01:15:16 2014 New Revision: 273650 URL: https://svnweb.freebsd.org/changeset/base/273650 Log: MFC r257200, r259121, r261410, r265853: - Remove #include . - Add gpio parse routines according to sys/boot/fdt/dts/bindings-gpio.txt. - Follow r261352 by updating all drivers which are children of simplebus to check the status property in their probe routines. - Rename platform_gpio_init to be SoC specific, and make it static as it's only called from this file. This is mostly catching up on some old MFCs that were done before this file existed in the 10 branch. Modified: stable/10/sys/arm/rockchip/rk30xx_gpio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/rockchip/rk30xx_gpio.c ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_gpio.c Sat Oct 25 22:53:08 2014 (r273649) +++ stable/10/sys/arm/rockchip/rk30xx_gpio.c Sun Oct 26 01:15:16 2014 (r273650) @@ -86,6 +86,26 @@ struct rk30_gpio_softc { struct gpio_pin sc_gpio_pins[RK30_GPIO_PINS]; }; +static struct rk30_gpio_softc *rk30_gpio_sc = NULL; + +typedef int (*gpios_phandler_t)(phandle_t, pcell_t *, int); + +struct gpio_ctrl_entry { + const char *compat; + gpios_phandler_t handler; +}; + +int rk30_gpios_prop_handle(phandle_t ctrl, pcell_t *gpios, int len); +static int rk30_gpio_init(void); + +struct gpio_ctrl_entry gpio_controllers[] = { + { "rockchip,rk30xx-gpio", &rk30_gpios_prop_handle }, + { "rockchip,rk30xx-gpio", &rk30_gpios_prop_handle }, + { "rockchip,rk30xx-gpio", &rk30_gpios_prop_handle }, + { "rockchip,rk30xx-gpio", &rk30_gpios_prop_handle }, + { NULL, NULL } +}; + #define RK30_GPIO_LOCK(_sc) mtx_lock(&_sc->sc_mtx) #define RK30_GPIO_UNLOCK(_sc) mtx_unlock(&_sc->sc_mtx) #define RK30_GPIO_LOCK_ASSERT(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED) @@ -439,6 +459,9 @@ rk30_gpio_attach(device_t dev) int i, rid; phandle_t gpio; + if (rk30_gpio_sc) + return (ENXIO); + sc->sc_dev = dev; mtx_init(&sc->sc_mtx, "rk30 gpio", "gpio", MTX_DEF); @@ -483,6 +506,11 @@ rk30_gpio_attach(device_t dev) device_add_child(dev, "gpioc", device_get_unit(dev)); device_add_child(dev, "gpiobus", device_get_unit(dev)); + + rk30_gpio_sc = sc; + + rk30_gpio_init(); + return (bus_generic_attach(dev)); fail: @@ -528,3 +556,121 @@ static driver_t rk30_gpio_driver = { }; DRIVER_MODULE(rk30_gpio, simplebus, rk30_gpio_driver, rk30_gpio_devclass, 0, 0); + +int +rk30_gpios_prop_handle(phandle_t ctrl, pcell_t *gpios, int len) +{ + struct rk30_gpio_softc *sc; + pcell_t gpio_cells; + int inc, t, tuples, tuple_size; + int dir, flags, pin, i; + u_long gpio_ctrl, size; + + sc = rk30_gpio_sc; + if (sc == NULL) + return ENXIO; + + if (OF_getprop(ctrl, "#gpio-cells", &gpio_cells, sizeof(pcell_t)) < 0) + return (ENXIO); + + gpio_cells = fdt32_to_cpu(gpio_cells); + if (gpio_cells != 2) + return (ENXIO); + + tuple_size = gpio_cells * sizeof(pcell_t) + sizeof(phandle_t); + tuples = len / tuple_size; + + if (fdt_regsize(ctrl, &gpio_ctrl, &size)) + return (ENXIO); + + /* + * Skip controller reference, since controller's phandle is given + * explicitly (in a function argument). + */ + inc = sizeof(ihandle_t) / sizeof(pcell_t); + gpios += inc; + for (t = 0; t < tuples; t++) { + pin = fdt32_to_cpu(gpios[0]); + dir = fdt32_to_cpu(gpios[1]); + flags = fdt32_to_cpu(gpios[2]); + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + rk30_gpio_pin_configure(sc, &sc->sc_gpio_pins[i], flags); + + if (dir == 1) { + /* Input. */ + rk30_gpio_pin_set(sc->sc_dev, pin, RK30_GPIO_INPUT); + } else { + /* Output. */ + rk30_gpio_pin_set(sc->sc_dev, pin, RK30_GPIO_OUTPUT); + } + gpios += gpio_cells + inc; + } + + return (0); +} + +#define MAX_PINS_PER_NODE 5 +#define GPIOS_PROP_CELLS 4 + +static int +rk30_gpio_init(void) +{ + phandle_t child, parent, root, ctrl; + pcell_t gpios[MAX_PINS_PER_NODE * GPIOS_PROP_CELLS]; + struct gpio_ctrl_entry *e; + int len, rv; + + root = OF_finddevice("/"); + len = 0; + parent = root; + + /* Traverse through entire tree to find nodes with 'gpios' prop */ + for (child = OF_child(parent); child != 0; child = OF_peer(child)) { + + /* Find a 'leaf'. Start the search from this node. */ + while (OF_child(child)) { + parent = child; + child = OF_child(child); + } + if ((len = OF_getproplen(child, "gpios")) > 0) { + + if (len > sizeof(gpios)) + return (ENXIO); + + /* Get 'gpios' property. */ + OF_getprop(child, "gpios", &gpios, len); + + e = (struct gpio_ctrl_entry *)&gpio_controllers; + + /* Find and call a handler. */ + for (; e->compat; e++) { + /* + * First cell of 'gpios' property should + * contain a ref. to a node defining GPIO + * controller. + */ + ctrl = OF_xref_phandle(fdt32_to_cpu(gpios[0])); + + if (fdt_is_compatible(ctrl, e->compat)) + /* Call a handler. */ + if ((rv = e->handler(ctrl, + (pcell_t *)&gpios, len))) + return (rv); + } + } + + if (OF_peer(child) == 0) { + /* No more siblings. */ + child = parent; + parent = OF_parent(child); + } + } + return (0); +} From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 01:26:55 2014 Return-Path: Delivered-To: svn-src-all@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 2F0759F3; Sun, 26 Oct 2014 01:26: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 19BF238B; Sun, 26 Oct 2014 01:26: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 s9Q1Qtci047285; Sun, 26 Oct 2014 01:26:55 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q1QsU3047280; Sun, 26 Oct 2014 01:26:54 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260126.s9Q1QsU3047280@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 01:26:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273651 - stable/10/sys/arm/at91 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 01:26:55 -0000 Author: ian Date: Sun Oct 26 01:26:53 2014 New Revision: 273651 URL: https://svnweb.freebsd.org/changeset/base/273651 Log: MFC r270025: Implement the FDT static pinctl/pinmux spec for Atmel. Added: stable/10/sys/arm/at91/at91_pinctrl.c - copied unchanged from r270025, head/sys/arm/at91/at91_pinctrl.c Modified: stable/10/sys/arm/at91/at91_pio.c stable/10/sys/arm/at91/at91_piovar.h Directory Properties: stable/10/ (props changed) Copied: stable/10/sys/arm/at91/at91_pinctrl.c (from r270025, head/sys/arm/at91/at91_pinctrl.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/at91/at91_pinctrl.c Sun Oct 26 01:26:53 2014 (r273651, copy of r270025, head/sys/arm/at91/at91_pinctrl.c) @@ -0,0 +1,524 @@ +/*- + * Copyright (c) 2014 Warner Losh. 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 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 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 + +#define BUS_PASS_PINMUX (BUS_PASS_INTERRUPT + 1) + +struct pinctrl_range { + uint64_t bus; + uint64_t host; + uint64_t size; +}; + +struct pinctrl_softc { + device_t dev; + phandle_t node; + + struct pinctrl_range *ranges; + int nranges; + + pcell_t acells, scells; + int done_pinmux; +}; + +struct pinctrl_devinfo { + struct ofw_bus_devinfo obdinfo; + struct resource_list rl; +}; + +static int +at91_pinctrl_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "atmel,at91rm9200-pinctrl")) + return (ENXIO); + device_set_desc(dev, "pincontrol bus"); + return (0); +} + +/* XXX Make this a subclass of simplebus */ + +static struct pinctrl_devinfo * +at91_pinctrl_setup_dinfo(device_t dev, phandle_t node) +{ + struct pinctrl_softc *sc; + struct pinctrl_devinfo *ndi; + uint32_t *reg, *intr, icells; + uint64_t phys, size; + phandle_t iparent; + int i, j, k; + int nintr; + int nreg; + + sc = device_get_softc(dev); + + ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); + if (ofw_bus_gen_setup_devinfo(&ndi->obdinfo, node) != 0) { + free(ndi, M_DEVBUF); + return (NULL); + } + + resource_list_init(&ndi->rl); + nreg = OF_getencprop_alloc(node, "reg", sizeof(*reg), (void **)®); + if (nreg == -1) + nreg = 0; + if (nreg % (sc->acells + sc->scells) != 0) { +// if (bootverbose) + device_printf(dev, "Malformed reg property on <%s>\n", + ndi->obdinfo.obd_name); + nreg = 0; + } + + for (i = 0, k = 0; i < nreg; i += sc->acells + sc->scells, k++) { + phys = size = 0; + for (j = 0; j < sc->acells; j++) { + phys <<= 32; + phys |= reg[i + j]; + } + for (j = 0; j < sc->scells; j++) { + size <<= 32; + size |= reg[i + sc->acells + j]; + } + + resource_list_add(&ndi->rl, SYS_RES_MEMORY, k, + phys, phys + size - 1, size); + } + free(reg, M_OFWPROP); + + nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), + (void **)&intr); + if (nintr > 0) { + if (OF_searchencprop(node, "interrupt-parent", &iparent, + sizeof(iparent)) == -1) { + device_printf(dev, "No interrupt-parent found, " + "assuming direct parent\n"); + iparent = OF_parent(node); + } + if (OF_searchencprop(OF_xref_phandle(iparent), + "#interrupt-cells", &icells, sizeof(icells)) == -1) { + device_printf(dev, "Missing #interrupt-cells property, " + "assuming <1>\n"); + icells = 1; + } + if (icells < 1 || icells > nintr) { + device_printf(dev, "Invalid #interrupt-cells property " + "value <%d>, assuming <1>\n", icells); + icells = 1; + } + for (i = 0, k = 0; i < nintr; i += icells, k++) { + intr[i] = ofw_bus_map_intr(dev, iparent, icells, + &intr[i]); + resource_list_add(&ndi->rl, SYS_RES_IRQ, k, intr[i], + intr[i], 1); + } + free(intr, M_OFWPROP); + } + + return (ndi); +} + +static int +at91_pinctrl_fill_ranges(phandle_t node, struct pinctrl_softc *sc) +{ + int host_address_cells; + cell_t *base_ranges; + ssize_t nbase_ranges; + int err; + int i, j, k; + + err = OF_searchencprop(OF_parent(node), "#address-cells", + &host_address_cells, sizeof(host_address_cells)); + if (err <= 0) + return (-1); + + nbase_ranges = OF_getproplen(node, "ranges"); + if (nbase_ranges < 0) + return (-1); + sc->nranges = nbase_ranges / sizeof(cell_t) / + (sc->acells + host_address_cells + sc->scells); + if (sc->nranges == 0) + return (0); + + sc->ranges = malloc(sc->nranges * sizeof(sc->ranges[0]), + M_DEVBUF, M_WAITOK); + base_ranges = malloc(nbase_ranges, M_DEVBUF, M_WAITOK); + OF_getencprop(node, "ranges", base_ranges, nbase_ranges); + + for (i = 0, j = 0; i < sc->nranges; i++) { + sc->ranges[i].bus = 0; + for (k = 0; k < sc->acells; k++) { + sc->ranges[i].bus <<= 32; + sc->ranges[i].bus |= base_ranges[j++]; + } + sc->ranges[i].host = 0; + for (k = 0; k < host_address_cells; k++) { + sc->ranges[i].host <<= 32; + sc->ranges[i].host |= base_ranges[j++]; + } + sc->ranges[i].size = 0; + for (k = 0; k < sc->scells; k++) { + sc->ranges[i].size <<= 32; + sc->ranges[i].size |= base_ranges[j++]; + } + } + + free(base_ranges, M_DEVBUF); + return (sc->nranges); +} + +static int +at91_pinctrl_attach(device_t dev) +{ + struct pinctrl_softc *sc; + struct pinctrl_devinfo *di; + phandle_t node; + device_t cdev; + + sc = device_get_softc(dev); + node = ofw_bus_get_node(dev); + + sc->dev = dev; + sc->node = node; + + /* + * Some important numbers + */ + sc->acells = 2; + OF_getencprop(node, "#address-cells", &sc->acells, sizeof(sc->acells)); + sc->scells = 1; + OF_getencprop(node, "#size-cells", &sc->scells, sizeof(sc->scells)); + + if (at91_pinctrl_fill_ranges(node, sc) < 0) { + device_printf(dev, "could not get ranges\n"); + return (ENXIO); + } + + for (node = OF_child(node); node > 0; node = OF_peer(node)) { + if ((di = at91_pinctrl_setup_dinfo(dev, node)) == NULL) + continue; + cdev = device_add_child(dev, NULL, -1); + if (cdev == NULL) { + device_printf(dev, "<%s>: device_add_child failed\n", + di->obdinfo.obd_name); + resource_list_free(&di->rl); + ofw_bus_gen_destroy_devinfo(&di->obdinfo); + free(di, M_DEVBUF); + continue; + } + device_set_ivars(cdev, di); + } + + return (bus_generic_attach(dev)); +} + +static const struct ofw_bus_devinfo * +pinctrl_get_devinfo(device_t bus __unused, device_t child) +{ + struct pinctrl_devinfo *ndi; + + ndi = device_get_ivars(child); + return (&ndi->obdinfo); +} + +static struct resource * +pinctrl_alloc_resource(device_t bus, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct pinctrl_softc *sc; + struct pinctrl_devinfo *di; + struct resource_list_entry *rle; + int j; + + sc = device_get_softc(bus); + + /* + * Request for the default allocation with a given rid: use resource + * list stored in the local device info. + */ + if ((start == 0UL) && (end == ~0UL)) { + if ((di = device_get_ivars(child)) == NULL) + return (NULL); + + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + + rle = resource_list_find(&di->rl, type, *rid); + if (rle == NULL) { +// if (bootverbose) + device_printf(bus, "no default resources for " + "rid = %d, type = %d\n", *rid, type); + return (NULL); + } + start = rle->start; + end = rle->end; + count = rle->count; + } + + if (type == SYS_RES_MEMORY) { + /* Remap through ranges property */ + for (j = 0; j < sc->nranges; j++) { + if (start >= sc->ranges[j].bus && end < + sc->ranges[j].bus + sc->ranges[j].size) { + start -= sc->ranges[j].bus; + start += sc->ranges[j].host; + end -= sc->ranges[j].bus; + end += sc->ranges[j].host; + break; + } + } + if (j == sc->nranges && sc->nranges != 0) { +// if (bootverbose) + device_printf(bus, "Could not map resource " + "%#lx-%#lx\n", start, end); + + return (NULL); + } + } + + return (bus_generic_alloc_resource(bus, child, type, rid, start, end, + count, flags)); +} + +static int +pinctrl_print_res(struct pinctrl_devinfo *di) +{ + int rv; + + rv = 0; + rv += resource_list_print_type(&di->rl, "mem", SYS_RES_MEMORY, "%#lx"); + rv += resource_list_print_type(&di->rl, "irq", SYS_RES_IRQ, "%ld"); + return (rv); +} + +static void +pinctrl_probe_nomatch(device_t bus, device_t child) +{ + const char *name, *type, *compat; + +// if (!bootverbose) + return; + + name = ofw_bus_get_name(child); + type = ofw_bus_get_type(child); + compat = ofw_bus_get_compat(child); + + device_printf(bus, "<%s>", name != NULL ? name : "unknown"); + pinctrl_print_res(device_get_ivars(child)); + if (!ofw_bus_status_okay(child)) + printf(" disabled"); + if (type) + printf(" type %s", type); + if (compat) + printf(" compat %s", compat); + printf(" (no driver attached)\n"); +} + +static int +pinctrl_print_child(device_t bus, device_t child) +{ + int rv; + + rv = bus_print_child_header(bus, child); + rv += pinctrl_print_res(device_get_ivars(child)); + if (!ofw_bus_status_okay(child)) + rv += printf(" disabled"); + rv += bus_print_child_footer(bus, child); + return (rv); +} + +const char *periphs[] = {"gpio", "periph A", "periph B", "periph C", "periph D", "periph E" }; + +static void +pinctrl_walk_tree(device_t bus, phandle_t node) +{ + struct pinctrl_softc *sc; + char status[10]; + char name[32]; + phandle_t pinctrl[32], pins[32 * 4], scratch; + ssize_t len, npins; + int i, j; + + sc = device_get_softc(bus); + for (node = OF_child(node); node > 0; node = OF_peer(node)) { + pinctrl_walk_tree(bus, node); + memset(status, 0, sizeof(status)); + memset(name, 0, sizeof(name)); + OF_getprop(node, "status", status, sizeof(status)); + OF_getprop(node, "name", name, sizeof(name)); + if (strcmp(status, "okay") != 0) { +// printf("pinctrl: omitting node %s since it isn't active\n", name); + continue; + } + len = OF_getencprop(node, "pinctrl-0", pinctrl, sizeof(pinctrl)); + if (len <= 0) { +// printf("pinctrl: no pinctrl-0 property for node %s, omitting\n", name); + continue; + } + len /= sizeof(phandle_t); + printf("pinctrl: Found active node %s\n", name); + for (i = 0; i < len; i++) { + scratch = OF_xref_phandle(pinctrl[i]); + npins = OF_getencprop(scratch, "atmel,pins", pins, sizeof(pins)); + if (npins <= 0) { + printf("We're doing it wrong %s\n", name); + continue; + } + memset(name, 0, sizeof(name)); + OF_getprop(scratch, "name", name, sizeof(name)); + npins /= (4 * 4); + printf("----> need to cope with %d more pins for %s\n", npins, name); + for (j = 0; j < npins; j++) { + uint32_t unit = pins[j * 4]; + uint32_t pin = pins[j * 4 + 1]; + uint32_t periph = pins[j * 4 + 2]; + uint32_t flags = pins[j * 4 + 3]; + uint32_t pio = (0xfffffff & sc->ranges[0].bus) + 0x200 * unit; + printf("P%c%d %s %#x\n", unit + 'A', pin, periphs[periph], + flags); + switch (periph) { + case 0: + at91_pio_use_gpio(pio, 1u << pin); + at91_pio_gpio_pullup(pio, 1u << pin, !!(flags & 1)); + at91_pio_gpio_high_z(pio, 1u << pin, !!(flags & 2)); + at91_pio_gpio_set_deglitch(pio, 1u << pin, !!(flags & 4)); + // at91_pio_gpio_pulldown(pio, 1u << pin, !!(flags & 8)); + // at91_pio_gpio_dis_schmidt(pio, 1u << pin, !!(flags & 16)); + break; + case 1: + at91_pio_use_periph_a(pio, 1u << pin, flags); + break; + case 2: + at91_pio_use_periph_b(pio, 1u << pin, flags); + break; + } + } + } + } +} + +static void +pinctrl_new_pass(device_t bus) +{ + struct pinctrl_softc *sc; + phandle_t node; + + sc = device_get_softc(bus); + + bus_generic_new_pass(bus); + + if (sc->done_pinmux || bus_current_pass < BUS_PASS_PINMUX) + return; + sc->done_pinmux++; + + node = OF_peer(0); + if (node == -1) + return; + pinctrl_walk_tree(bus, node); +} + +static device_method_t at91_pinctrl_methods[] = { + DEVMETHOD(device_probe, at91_pinctrl_probe), + DEVMETHOD(device_attach, at91_pinctrl_attach), + + DEVMETHOD(bus_print_child, pinctrl_print_child), + DEVMETHOD(bus_probe_nomatch, pinctrl_probe_nomatch), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_alloc_resource, pinctrl_alloc_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), + DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), + DEVMETHOD(bus_new_pass, pinctrl_new_pass), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, pinctrl_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + DEVMETHOD_END +}; + +static driver_t at91_pinctrl_driver = { + "at91_pinctrl", + at91_pinctrl_methods, + sizeof(struct pinctrl_softc), +}; + +static devclass_t at91_pinctrl_devclass; + +EARLY_DRIVER_MODULE(at91_pinctrl, simplebus, at91_pinctrl_driver, at91_pinctrl_devclass, + NULL, NULL, BUS_PASS_BUS); + +/* + * dummy driver to force pass BUS_PASS_PINMUX to happen. + */ +static int +at91_pingroup_probe(device_t dev) +{ + return ENXIO; +} + +static device_method_t at91_pingroup_methods[] = { + DEVMETHOD(device_probe, at91_pingroup_probe), + + DEVMETHOD_END +}; + + +static driver_t at91_pingroup_driver = { + "at91_pingroup", + at91_pingroup_methods, + 0, +}; + +static devclass_t at91_pingroup_devclass; + +EARLY_DRIVER_MODULE(at91_pingroup, at91_pinctrl, at91_pingroup_driver, at91_pingroup_devclass, + NULL, NULL, BUS_PASS_PINMUX); Modified: stable/10/sys/arm/at91/at91_pio.c ============================================================================== --- stable/10/sys/arm/at91/at91_pio.c Sun Oct 26 01:15:16 2014 (r273650) +++ stable/10/sys/arm/at91/at91_pio.c Sun Oct 26 01:26:53 2014 (r273651) @@ -591,6 +591,17 @@ at91_pio_gpio_set_deglitch(uint32_t pio, } void +at91_pio_gpio_pullup(uint32_t pio, uint32_t data_mask, int do_pullup) +{ + uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); + + if (do_pullup) + PIO[PIO_PUER / 4] = data_mask; + else + PIO[PIO_PUDR / 4] = data_mask; +} + +void at91_pio_gpio_set_interrupt(uint32_t pio, uint32_t data_mask, int enable_interrupt) { @@ -611,12 +622,21 @@ at91_pio_gpio_clear_interrupt(uint32_t p return (PIO[PIO_ISR / 4]); } +static void +at91_pio_new_pass(device_t dev) +{ + + device_printf(dev, "Pass %d\n", bus_current_pass); +} + static device_method_t at91_pio_methods[] = { /* Device interface */ DEVMETHOD(device_probe, at91_pio_probe), DEVMETHOD(device_attach, at91_pio_attach), DEVMETHOD(device_detach, at91_pio_detach), + DEVMETHOD(bus_new_pass, at91_pio_new_pass), + DEVMETHOD_END }; @@ -626,10 +646,5 @@ static driver_t at91_pio_driver = { sizeof(struct at91_pio_softc), }; -#ifdef FDT -DRIVER_MODULE(at91_pio, simplebus, at91_pio_driver, at91_pio_devclass, NULL, - NULL); -#else -DRIVER_MODULE(at91_pio, atmelarm, at91_pio_driver, at91_pio_devclass, NULL, - NULL); -#endif +EARLY_DRIVER_MODULE(at91_pio, at91_pinctrl, at91_pio_driver, at91_pio_devclass, + NULL, NULL, BUS_PASS_INTERRUPT); Modified: stable/10/sys/arm/at91/at91_piovar.h ============================================================================== --- stable/10/sys/arm/at91/at91_piovar.h Sun Oct 26 01:15:16 2014 (r273650) +++ stable/10/sys/arm/at91/at91_piovar.h Sun Oct 26 01:26:53 2014 (r273651) @@ -45,5 +45,6 @@ void at91_pio_gpio_set_deglitch(uint32_t void at91_pio_gpio_set_interrupt(uint32_t pio, uint32_t data_mask, int enable_interrupt); uint32_t at91_pio_gpio_clear_interrupt(uint32_t pio); +void at91_pio_gpio_pullup(uint32_t pio, uint32_t data_mask, int do_pullup); #endif /* ARM_AT91_AT91_PIOVAR_H */ From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 01:30:51 2014 Return-Path: Delivered-To: svn-src-all@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 5DB83B3B; Sun, 26 Oct 2014 01:30: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 402213A1; Sun, 26 Oct 2014 01:30: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 s9Q1UpGE051253; Sun, 26 Oct 2014 01:30:51 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q1Uk2w051216; Sun, 26 Oct 2014 01:30:46 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260130.s9Q1Uk2w051216@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 01:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273652 - in stable/10/sys: arm/arm arm/at91 arm/freescale/vybrid arm/mv arm/rockchip dev/fdt dev/gpio dev/ofw dev/tsec mips/beri powerpc/ofw powerpc/powermac X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 01:30:51 -0000 Author: ian Date: Sun Oct 26 01:30:46 2014 New Revision: 273652 URL: https://svnweb.freebsd.org/changeset/base/273652 Log: MFC r270945: Rename OF_xref_phandle() to OF_node_from_xref() and add a new function that provides the inverse translation, OF_xref_from_node(). Modified: stable/10/sys/arm/arm/nexus.c stable/10/sys/arm/at91/at91_pinctrl.c stable/10/sys/arm/freescale/vybrid/vf_sai.c stable/10/sys/arm/mv/gpio.c stable/10/sys/arm/rockchip/rk30xx_gpio.c stable/10/sys/dev/fdt/fdt_common.c stable/10/sys/dev/fdt/simplebus.c stable/10/sys/dev/gpio/ofw_gpiobus.c stable/10/sys/dev/ofw/ofw_bus_subr.c stable/10/sys/dev/ofw/ofw_fdt.c stable/10/sys/dev/ofw/ofwbus.c stable/10/sys/dev/ofw/openfirm.c stable/10/sys/dev/ofw/openfirm.h stable/10/sys/dev/tsec/if_tsec_fdt.c stable/10/sys/mips/beri/beri_simplebus.c stable/10/sys/powerpc/ofw/ofw_pcibus.c stable/10/sys/powerpc/powermac/macio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/nexus.c ============================================================================== --- stable/10/sys/arm/arm/nexus.c Sun Oct 26 01:26:53 2014 (r273651) +++ stable/10/sys/arm/arm/nexus.c Sun Oct 26 01:30:46 2014 (r273652) @@ -341,7 +341,7 @@ nexus_ofw_map_intr(device_t dev, device_ phandle_t intr_offset; int i, rv, interrupt, trig, pol; - intr_offset = OF_xref_phandle(iparent); + intr_offset = OF_node_from_xref(iparent); for (i = 0; i < icells; i++) intr[i] = cpu_to_fdt32(intr[i]); Modified: stable/10/sys/arm/at91/at91_pinctrl.c ============================================================================== --- stable/10/sys/arm/at91/at91_pinctrl.c Sun Oct 26 01:26:53 2014 (r273651) +++ stable/10/sys/arm/at91/at91_pinctrl.c Sun Oct 26 01:30:46 2014 (r273652) @@ -136,7 +136,7 @@ at91_pinctrl_setup_dinfo(device_t dev, p "assuming direct parent\n"); iparent = OF_parent(node); } - if (OF_searchencprop(OF_xref_phandle(iparent), + if (OF_searchencprop(OF_node_from_xref(iparent), "#interrupt-cells", &icells, sizeof(icells)) == -1) { device_printf(dev, "Missing #interrupt-cells property, " "assuming <1>\n"); @@ -399,7 +399,7 @@ pinctrl_walk_tree(device_t bus, phandle_ len /= sizeof(phandle_t); printf("pinctrl: Found active node %s\n", name); for (i = 0; i < len; i++) { - scratch = OF_xref_phandle(pinctrl[i]); + scratch = OF_node_from_xref(pinctrl[i]); npins = OF_getencprop(scratch, "atmel,pins", pins, sizeof(pins)); if (npins <= 0) { printf("We're doing it wrong %s\n", name); Modified: stable/10/sys/arm/freescale/vybrid/vf_sai.c ============================================================================== --- stable/10/sys/arm/freescale/vybrid/vf_sai.c Sun Oct 26 01:26:53 2014 (r273651) +++ stable/10/sys/arm/freescale/vybrid/vf_sai.c Sun Oct 26 01:30:46 2014 (r273652) @@ -430,7 +430,7 @@ find_edma_controller(struct sc_info *sc) OF_getprop(node, "edma-mux-group", &dts_value, len); edma_mux_group = fdt32_to_cpu(dts_value); OF_getprop(node, "edma-controller", &dts_value, len); - edma_node = OF_xref_phandle(fdt32_to_cpu(dts_value)); + edma_node = OF_node_from_xref(fdt32_to_cpu(dts_value)); if ((len = OF_getproplen(edma_node, "device-id")) <= 0) { return (ENXIO); Modified: stable/10/sys/arm/mv/gpio.c ============================================================================== --- stable/10/sys/arm/mv/gpio.c Sun Oct 26 01:26:53 2014 (r273651) +++ stable/10/sys/arm/mv/gpio.c Sun Oct 26 01:30:46 2014 (r273652) @@ -641,7 +641,7 @@ platform_gpio_init(void) * contain a ref. to a node defining GPIO * controller. */ - ctrl = OF_xref_phandle(fdt32_to_cpu(gpios[0])); + ctrl = OF_node_from_xref(fdt32_to_cpu(gpios[0])); if (fdt_is_compatible(ctrl, e->compat)) /* Call a handler. */ Modified: stable/10/sys/arm/rockchip/rk30xx_gpio.c ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_gpio.c Sun Oct 26 01:26:53 2014 (r273651) +++ stable/10/sys/arm/rockchip/rk30xx_gpio.c Sun Oct 26 01:30:46 2014 (r273652) @@ -656,7 +656,7 @@ rk30_gpio_init(void) * contain a ref. to a node defining GPIO * controller. */ - ctrl = OF_xref_phandle(fdt32_to_cpu(gpios[0])); + ctrl = OF_node_from_xref(fdt32_to_cpu(gpios[0])); if (fdt_is_compatible(ctrl, e->compat)) /* Call a handler. */ Modified: stable/10/sys/dev/fdt/fdt_common.c ============================================================================== --- stable/10/sys/dev/fdt/fdt_common.c Sun Oct 26 01:26:53 2014 (r273651) +++ stable/10/sys/dev/fdt/fdt_common.c Sun Oct 26 01:30:46 2014 (r273652) @@ -510,7 +510,7 @@ fdt_intr_to_rl(device_t dev, phandle_t n "assuming direct parent\n"); iparent = OF_parent(node); } - if (OF_searchencprop(OF_xref_phandle(iparent), + if (OF_searchencprop(OF_node_from_xref(iparent), "#interrupt-cells", &icells, sizeof(icells)) == -1) { device_printf(dev, "Missing #interrupt-cells property, " "assuming <1>\n"); @@ -545,7 +545,7 @@ fdt_get_phyaddr(phandle_t node, device_t sizeof(phy_handle)) <= 0) return (ENXIO); - phy_node = OF_xref_phandle(phy_handle); + phy_node = OF_node_from_xref(phy_handle); if (OF_getprop(phy_node, "reg", (void *)&phy_reg, sizeof(phy_reg)) <= 0) Modified: stable/10/sys/dev/fdt/simplebus.c ============================================================================== --- stable/10/sys/dev/fdt/simplebus.c Sun Oct 26 01:26:53 2014 (r273651) +++ stable/10/sys/dev/fdt/simplebus.c Sun Oct 26 01:30:46 2014 (r273652) @@ -298,7 +298,7 @@ simplebus_setup_dinfo(device_t dev, phan "assuming direct parent\n"); iparent = OF_parent(node); } - if (OF_searchencprop(OF_xref_phandle(iparent), + if (OF_searchencprop(OF_node_from_xref(iparent), "#interrupt-cells", &icells, sizeof(icells)) == -1) { device_printf(dev, "Missing #interrupt-cells property, " "assuming <1>\n"); Modified: stable/10/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- stable/10/sys/dev/gpio/ofw_gpiobus.c Sun Oct 26 01:26:53 2014 (r273651) +++ stable/10/sys/dev/gpio/ofw_gpiobus.c Sun Oct 26 01:30:46 2014 (r273652) @@ -129,7 +129,7 @@ ofw_gpiobus_parse_gpios(struct gpiobus_s i++; continue; } - gpio = OF_xref_phandle(gpios[i]); + gpio = OF_node_from_xref(gpios[i]); /* Verify if we're attaching to the correct GPIO controller. */ if (!OF_hasprop(gpio, "gpio-controller") || gpio != ofw_bus_get_node(sc->sc_dev)) { @@ -168,7 +168,7 @@ ofw_gpiobus_parse_gpios(struct gpiobus_s continue; } - gpio = OF_xref_phandle(gpios[i]); + gpio = OF_node_from_xref(gpios[i]); /* Read gpio-cells property for this GPIO controller. */ if (OF_getencprop(gpio, "#gpio-cells", &cells, sizeof(cells)) < 0) { Modified: stable/10/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- stable/10/sys/dev/ofw/ofw_bus_subr.c Sun Oct 26 01:26:53 2014 (r273651) +++ stable/10/sys/dev/ofw/ofw_bus_subr.c Sun Oct 26 01:30:46 2014 (r273652) @@ -344,7 +344,7 @@ ofw_bus_search_intrmap(void *intr, int i i = imapsz; while (i > 0) { bcopy(mptr + physsz + intrsz, &parent, sizeof(parent)); - if (OF_searchencprop(OF_xref_phandle(parent), + if (OF_searchencprop(OF_node_from_xref(parent), "#interrupt-cells", &pintrsz, sizeof(pintrsz)) == -1) pintrsz = 1; /* default */ pintrsz *= sizeof(pcell_t); Modified: stable/10/sys/dev/ofw/ofw_fdt.c ============================================================================== --- stable/10/sys/dev/ofw/ofw_fdt.c Sun Oct 26 01:26:53 2014 (r273651) +++ stable/10/sys/dev/ofw/ofw_fdt.c Sun Oct 26 01:30:46 2014 (r273652) @@ -208,7 +208,7 @@ ofw_fdt_instance_to_package(ofw_t ofw, i { /* Where real OF uses ihandles in the tree, FDT uses xref phandles */ - return (OF_xref_phandle(instance)); + return (OF_node_from_xref(instance)); } /* Get the length of a property of a package. */ Modified: stable/10/sys/dev/ofw/ofwbus.c ============================================================================== --- stable/10/sys/dev/ofw/ofwbus.c Sun Oct 26 01:26:53 2014 (r273651) +++ stable/10/sys/dev/ofw/ofwbus.c Sun Oct 26 01:30:46 2014 (r273652) @@ -494,7 +494,7 @@ ofwbus_setup_dinfo(device_t dev, phandle "assuming nexus on <%s>\n", nodename); iparent = 0xffffffff; } - if (OF_searchencprop(OF_xref_phandle(iparent), + if (OF_searchencprop(OF_node_from_xref(iparent), "#interrupt-cells", &icells, sizeof(icells)) == -1) { device_printf(dev, "Missing #interrupt-cells property, " "assuming <1> on <%s>\n", nodename); Modified: stable/10/sys/dev/ofw/openfirm.c ============================================================================== --- stable/10/sys/dev/ofw/openfirm.c Sun Oct 26 01:26:53 2014 (r273651) +++ stable/10/sys/dev/ofw/openfirm.c Sun Oct 26 01:30:46 2014 (r273652) @@ -463,7 +463,7 @@ OF_child_xref_phandle(phandle_t parent, } phandle_t -OF_xref_phandle(phandle_t xref) +OF_node_from_xref(phandle_t xref) { phandle_t node; @@ -474,6 +474,20 @@ OF_xref_phandle(phandle_t xref) return (node); } +phandle_t +OF_xref_from_node(phandle_t node) +{ + phandle_t xref; + + if (OF_getencprop(node, "phandle", &xref, sizeof(xref)) == + -1 && OF_getencprop(node, "ibm,phandle", &xref, + sizeof(xref)) == -1 && OF_getencprop(node, + "linux,phandle", &xref, sizeof(xref)) == -1) + return (node); + + return (xref); +} + /* Call the method in the scope of a given instance. */ int OF_call_method(const char *method, ihandle_t instance, int nargs, int nreturns, Modified: stable/10/sys/dev/ofw/openfirm.h ============================================================================== --- stable/10/sys/dev/ofw/openfirm.h Sun Oct 26 01:26:53 2014 (r273651) +++ stable/10/sys/dev/ofw/openfirm.h Sun Oct 26 01:30:46 2014 (r273652) @@ -130,7 +130,8 @@ ssize_t OF_package_to_path(phandle_t no * real phandle. If one can't be found (or running on OF implementations * without this property), returns its input. */ -phandle_t OF_xref_phandle(phandle_t xref); +phandle_t OF_node_from_xref(phandle_t xref); +phandle_t OF_xref_from_node(phandle_t node); /* Device I/O functions */ ihandle_t OF_open(const char *path); Modified: stable/10/sys/dev/tsec/if_tsec_fdt.c ============================================================================== --- stable/10/sys/dev/tsec/if_tsec_fdt.c Sun Oct 26 01:26:53 2014 (r273651) +++ stable/10/sys/dev/tsec/if_tsec_fdt.c Sun Oct 26 01:30:46 2014 (r273652) @@ -168,7 +168,7 @@ tsec_fdt_attach(device_t dev) return (ENXIO); } - phy = OF_xref_phandle(phy); + phy = OF_node_from_xref(phy); OF_decode_addr(OF_parent(phy), 0, &sc->phy_bst, &sc->phy_bsh); OF_getencprop(phy, "reg", &sc->phyaddr, sizeof(sc->phyaddr)); Modified: stable/10/sys/mips/beri/beri_simplebus.c ============================================================================== --- stable/10/sys/mips/beri/beri_simplebus.c Sun Oct 26 01:26:53 2014 (r273651) +++ stable/10/sys/mips/beri/beri_simplebus.c Sun Oct 26 01:30:46 2014 (r273652) @@ -350,7 +350,7 @@ simplebus_get_interrupt_parent(device_t if (OF_getencprop(di->di_ofw.obd_node, "interrupt-parent", &iph, sizeof(iph)) > 0) { - ph = OF_xref_phandle(iph); + ph = OF_node_from_xref(iph); SLIST_FOREACH(ic, &fdt_ic_list_head, fdt_ics) { if (ic->iph == ph) { ip = ic->dev; Modified: stable/10/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- stable/10/sys/powerpc/ofw/ofw_pcibus.c Sun Oct 26 01:26:53 2014 (r273651) +++ stable/10/sys/powerpc/ofw/ofw_pcibus.c Sun Oct 26 01:30:46 2014 (r273652) @@ -212,7 +212,7 @@ ofw_pcibus_enum_devtree(device_t dev, u_ OF_getprop(child, "interrupt-parent", &iparent, sizeof(iparent)); if (iparent != 0) { - OF_getprop(OF_xref_phandle(iparent), + OF_getprop(OF_node_from_xref(iparent), "#interrupt-cells", &icells, sizeof(icells)); intr[0] = ofw_bus_map_intr(dev, iparent, @@ -329,7 +329,7 @@ ofw_pcibus_assign_interrupt(device_t dev iparent = -1; icells = 1; if (iparent != -1) - OF_getprop(OF_xref_phandle(iparent), "#interrupt-cells", + OF_getprop(OF_node_from_xref(iparent), "#interrupt-cells", &icells, sizeof(icells)); /* Modified: stable/10/sys/powerpc/powermac/macio.c ============================================================================== --- stable/10/sys/powerpc/powermac/macio.c Sun Oct 26 01:26:53 2014 (r273651) +++ stable/10/sys/powerpc/powermac/macio.c Sun Oct 26 01:30:46 2014 (r273652) @@ -217,7 +217,7 @@ macio_add_intr(phandle_t devnode, struct <= 0) panic("Interrupt but no interrupt parent!\n"); - if (OF_getprop(OF_xref_phandle(iparent), "#interrupt-cells", &icells, + if (OF_getprop(OF_node_from_xref(iparent), "#interrupt-cells", &icells, sizeof(icells)) <= 0) icells = 1; From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 01:41:55 2014 Return-Path: Delivered-To: svn-src-all@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 5FB14DAD; Sun, 26 Oct 2014 01:41: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 3222D780; Sun, 26 Oct 2014 01:41: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 s9Q1ftaI057853; Sun, 26 Oct 2014 01:41:55 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q1ft59057852; Sun, 26 Oct 2014 01:41:55 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201410260141.s9Q1ft59057852@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sun, 26 Oct 2014 01:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273653 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 01:41:55 -0000 Author: gjb Date: Sun Oct 26 01:41:54 2014 New Revision: 273653 URL: https://svnweb.freebsd.org/changeset/base/273653 Log: Fix a few issues with creating VOLUME_LABEL for the installation ISOs: - TYPE, BRANCH, and REVISION are only defined if OSRELEASE is not defined, so in situations where one might set OSRELEASE for an in-house ISO build, VOLUME_LABEL would be empty. - makefs(8) limits the volume label to 32 characters, which for the powerpc64 case, OSRELEASE expands to FreeBSD-11.0-CURRENT-powerpc-powerpc64. Even with removing the prefixing 'FreeBSD-', the string is 30 characters long, leaving zero room for suffixing the type of ISO media (BO for bootonly, CD for cdrom, and DVD for dvdrom). Resolve these by defining VOLUME_LABEL when defining OSRELEASE if unset. If OSRELEASE is defined by the builder, use the OSRELEASE from that definition as the VOLUME_LABEL. In addition, for cases where both TARGET and TARGET_ARCH are used for the VOLUME_LABEL, use TARGET_ARCH if it differs from TARGET. There are probably a few sharp edges here yet, but these problems are going to affect the powerpc/powerpc64 builds for 10.1-RELEASE, so the immediate concern is fixing the underlying problem at hand quickly, and less so about the elegance of the fix. MFC after: 3 days X-MFC-10.1: yes, asap Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Sun Oct 26 01:30:46 2014 (r273652) +++ head/release/Makefile Sun Oct 26 01:41:54 2014 (r273653) @@ -56,13 +56,17 @@ ${_V}!= eval $$(awk '/^${_V}=/{print}' $ .for _V in ${TARGET_ARCH} .if !empty(TARGET:M${_V}) OSRELEASE= ${TYPE}-${REVISION}-${BRANCH}-${TARGET} +VOLUME_LABEL= ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET} .else OSRELEASE= ${TYPE}-${REVISION}-${BRANCH}-${TARGET}-${TARGET_ARCH} +VOLUME_LABEL= ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET_ARCH} .endif .endfor .endif -VOLUME_LABEL= ${OSRELEASE:C/[-\.]/_/g:S/^$${TYPE}_//} +.if !defined(VOLUME_LABEL) || empty(VOLUME_LABEL) +VOLUME_LABEL= FreeBSD_Install +.endif .if !exists(${DOCDIR}) NODOC= true From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 01:47:56 2014 Return-Path: Delivered-To: svn-src-all@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 188A6F6A; Sun, 26 Oct 2014 01:47: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 0497279D; Sun, 26 Oct 2014 01:47: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 s9Q1ltj1059419; Sun, 26 Oct 2014 01:47:55 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q1ltCW059418; Sun, 26 Oct 2014 01:47:55 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410260147.s9Q1ltCW059418@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 26 Oct 2014 01:47:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273654 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 01:47:56 -0000 Author: mjg Date: Sun Oct 26 01:47:55 2014 New Revision: 273654 URL: https://svnweb.freebsd.org/changeset/base/273654 Log: Now that sysctl_root is only called with sysctl lock in shared mode, update its assertion to require that. Update comment missed in r273400: sysctl_xlock/unlock -> sysctl_xlock/xunlock Noted by: jhb Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Sun Oct 26 01:41:54 2014 (r273653) +++ head/sys/kern/kern_sysctl.c Sun Oct 26 01:47:55 2014 (r273654) @@ -77,7 +77,7 @@ static MALLOC_DEFINE(M_SYSCTLTMP, "sysct * The sysctllock protects the MIB tree. It also protects sysctl * contexts used with dynamic sysctls. The sysctl_register_oid() and * sysctl_unregister_oid() routines require the sysctllock to already - * be held, so the sysctl_lock() and sysctl_unlock() routines are + * be held, so the sysctl_xlock() and sysctl_xunlock() routines are * provided for the few places in the kernel which need to use that * API rather than using the dynamic API. Use of the dynamic API is * strongly encouraged for most code. @@ -96,6 +96,7 @@ static struct sx sysctlmemlock; #define SYSCTL_XLOCKED() sx_xlocked(&sysctllock) #define SYSCTL_ASSERT_LOCKED() sx_assert(&sysctllock, SA_LOCKED) #define SYSCTL_ASSERT_XLOCKED() sx_assert(&sysctllock, SA_XLOCKED) +#define SYSCTL_ASSERT_SLOCKED() sx_assert(&sysctllock, SA_SLOCKED) #define SYSCTL_INIT() sx_init(&sysctllock, "sysctl lock") #define SYSCTL_SLEEP(ch, wmesg, timo) \ sx_sleep(ch, &sysctllock, 0, wmesg, timo) @@ -1572,7 +1573,7 @@ sysctl_root(SYSCTL_HANDLER_ARGS) struct sysctl_oid *oid; int error, indx, lvl; - SYSCTL_ASSERT_LOCKED(); + SYSCTL_ASSERT_SLOCKED(); error = sysctl_find_oid(arg1, arg2, &oid, &indx, req); if (error) From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 01:57:49 2014 Return-Path: Delivered-To: svn-src-all@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 8E5D918D; Sun, 26 Oct 2014 01:57:49 +0000 (UTC) Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88EC085B; Sun, 26 Oct 2014 01:57:48 +0000 (UTC) Received: by mail-wi0-f169.google.com with SMTP id q5so3640091wiv.4 for ; Sat, 25 Oct 2014 18:57:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=gX7VvKB62yHOXwxNN+qbvMdM7Z6HvpOFLbPRtRhjAno=; b=kW+AqYZMXvKr9us1mzEYaVJpi4s6hU0tDiBa+00jJMC7RI0ycDQSpkkHih2oh8tCkv 5AD3JhBFirWVOvw4qAT1TjYrvjoOof0XNs3ho5rZsqIIVnAw+VrbP/iFsujQwhu1LPUD BtDow/V7RgA62RHrx1vWFyjLpFeCPQgtFEDRihp3Qd53/Ce+9030iZuarrFrfcQG71Bg NazCDLr+YY5jUEkSwZ0tFnnoZuCdEOjtFn3YIuTrwvCtXyz+9R+jswcKB+rV1nytcABs lrNa6H5bqor3F4UenIz4cYjdmrPmre0irPaHxCyzGXdu/lsa5BYUUFcMYRxuG7JM00bG NtrQ== X-Received: by 10.194.81.6 with SMTP id v6mr13863769wjx.39.1414288666905; Sat, 25 Oct 2014 18:57:46 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id ic4sm6723470wid.19.2014.10.25.18.57.45 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 25 Oct 2014 18:57:45 -0700 (PDT) Date: Sun, 26 Oct 2014 02:57:43 +0100 From: Mateusz Guzik To: John Baldwin Subject: Re: svn commit: r273401 - head/sys/kern Message-ID: <20141026015743.GE19066@dft-labs.eu> References: <201410211905.s9LJ5jDb032492@svn.freebsd.org> <201410231214.04027.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201410231214.04027.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 01:57:49 -0000 On Thu, Oct 23, 2014 at 12:14:03PM -0400, John Baldwin wrote: > On Tuesday, October 21, 2014 3:05:45 pm Mateusz Guzik wrote: > > Author: mjg > > Date: Tue Oct 21 19:05:44 2014 > > New Revision: 273401 > > URL: https://svnweb.freebsd.org/changeset/base/273401 > > > > Log: > > Implement shared locking for sysctl. > > A bit more detail in this message was warranted. We had some shared locking > in the past (r192125) but it was subsequently reverted (r216060). > > In particular, explaining how you fixed the part of 216060 that caused the > shared locking to be reverted would have answered Bjoern's earlier question as > well. It's important that log messages not only explain what they are doing, > but why they are doing so. (For exmaple, it would have been nice if 216060 > had explained why it was reverting the shared locking in its log message, but > it didn't. :( ) > > I think that you fixed the issues by a combination of using sysctl_lock/unlock > to handle shared vs exclusive locking for the caller and you used atomic ops > on the running count (previously the xlock allowed use of non-atomic ops on > the running count). > I agree that commit message is quite lacking in detail, in retrospect I should have written a thing or two. So yes, in short mutual exclusion between threads disabling sysctls and ones going through them is retained. And accuracy of the counter is ensured with the use of atomic ops. > sysctl_root() is now only called with a shared lock held, so you should change > its assertion accordingly. sysctl_register_oid() is still called with the > xlock held, so you can't remove the sysctl_lock() stuff from > sysctl_root_handler_locked() entirely. OTOH, there is a stale comment in > kern_sysctl.c about having a public sysctl_lock/unlock API that you can just > remove. Also, given that sysctl_lock/unlock are only used in > sysctl_root_handler_locked(), I would probably remove them and just inline > them in the one place they are needed. I addressed stuff in https://svnweb.freebsd.org/changeset/base/273654 , although the comment needed altering and not removing. I specifically added sysctl_lock/unlock so that next folk with similar usecse will not have to. So I'm not going to remove it, but if you really don't like it feel free to do it. > > Finally, getting pre-commit review is fairly easy these days with phabricator > and would allow you to have had all these things noted and addressed before it > went into the tree. > yeah, I actually do ask for review more often than not. :) -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 01:58:19 2014 Return-Path: Delivered-To: svn-src-all@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 0EDF02CD; Sun, 26 Oct 2014 01:58: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 E379D860; Sun, 26 Oct 2014 01:58: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 s9Q1wIxL065419; Sun, 26 Oct 2014 01:58:18 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q1wIcG065417; Sun, 26 Oct 2014 01:58:18 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260158.s9Q1wIcG065417@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 01:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273655 - stable/10/sys/dev/ofw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 01:58:19 -0000 Author: ian Date: Sun Oct 26 01:58:18 2014 New Revision: 273655 URL: https://svnweb.freebsd.org/changeset/base/273655 Log: MFC r270953, r270958, r270960, r271190, r271199, r271202: Create a mechanism for looking up a device_t associated with an ofw/fdt xref handle, and for registering that association. Also use the same data for faster translations between node and xref handles. Add OF_xref_from_device() so that there's no need to have an intermediate call to ofw_bus_get_node() to lookup info that's already in the xreflist. When registering an association between a device and an xref phandle, create an entry in the xref list if one doesn't already exist for the given handle. Modified: stable/10/sys/dev/ofw/openfirm.c stable/10/sys/dev/ofw/openfirm.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ofw/openfirm.c ============================================================================== --- stable/10/sys/dev/ofw/openfirm.c Sun Oct 26 01:47:55 2014 (r273654) +++ stable/10/sys/dev/ofw/openfirm.c Sun Oct 26 01:58:18 2014 (r273655) @@ -62,7 +62,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include +#include #include #include @@ -84,6 +87,106 @@ static ofw_t ofw_obj; static struct ofw_kobj ofw_kernel_obj; static struct kobj_ops ofw_kernel_kops; +struct xrefinfo { + phandle_t xref; + phandle_t node; + device_t dev; + SLIST_ENTRY(xrefinfo) next_entry; +}; + +static SLIST_HEAD(, xrefinfo) xreflist = SLIST_HEAD_INITIALIZER(xreflist); +static struct mtx xreflist_lock; +static boolean_t xref_init_done; + +#define FIND_BY_XREF 0 +#define FIND_BY_NODE 1 +#define FIND_BY_DEV 2 + +/* + * xref-phandle-device lookup helper routines. + * + * As soon as we are able to use malloc(), walk the node tree and build a list + * of info that cross-references node handles, xref handles, and device_t + * instances. This list exists primarily to allow association of a device_t + * with an xref handle, but it is also used to speed up translation between xref + * and node handles. Before malloc() is available we have to recursively search + * the node tree each time we want to translate between a node and xref handle. + * Afterwards we can do the translations by searching this much shorter list. + */ +static void +xrefinfo_create(phandle_t node) +{ + struct xrefinfo * xi; + phandle_t child, xref; + + /* + * Recursively descend from parent, looking for nodes with a property + * named either "phandle", "ibm,phandle", or "linux,phandle". For each + * such node found create an entry in the xreflist. + */ + for (child = OF_child(node); child != 0; child = OF_peer(child)) { + xrefinfo_create(child); + if (OF_getencprop(child, "phandle", &xref, sizeof(xref)) == + -1 && OF_getencprop(child, "ibm,phandle", &xref, + sizeof(xref)) == -1 && OF_getencprop(child, + "linux,phandle", &xref, sizeof(xref)) == -1) + continue; + xi = malloc(sizeof(*xi), M_OFWPROP, M_WAITOK | M_ZERO); + xi->node = child; + xi->xref = xref; + SLIST_INSERT_HEAD(&xreflist, xi, next_entry); + } +} + +static void +xrefinfo_init(void *unsed) +{ + + /* + * There is no locking during this init because it runs much earlier + * than any of the clients/consumers of the xref list data, but we do + * initialize the mutex that will be used for access later. + */ + mtx_init(&xreflist_lock, "OF xreflist lock", NULL, MTX_DEF); + xrefinfo_create(OF_peer(0)); + xref_init_done = true; +} +SYSINIT(xrefinfo, SI_SUB_KMEM, SI_ORDER_ANY, xrefinfo_init, NULL); + +static struct xrefinfo * +xrefinfo_find(phandle_t phandle, int find_by) +{ + struct xrefinfo *rv, *xi; + + rv = NULL; + mtx_lock(&xreflist_lock); + SLIST_FOREACH(xi, &xreflist, next_entry) { + if ((find_by == FIND_BY_XREF && phandle == xi->xref) || + (find_by == FIND_BY_NODE && phandle == xi->node) || + (find_by == FIND_BY_DEV && phandle == (uintptr_t)xi->dev)) { + rv = xi; + break; + } + } + mtx_unlock(&xreflist_lock); + return (rv); +} + +static struct xrefinfo * +xrefinfo_add(phandle_t node, phandle_t xref, device_t dev) +{ + struct xrefinfo *xi; + + xi = malloc(sizeof(*xi), M_OFWPROP, M_WAITOK); + xi->node = node; + xi->xref = xref; + xi->dev = dev; + mtx_lock(&xreflist_lock); + SLIST_INSERT_HEAD(&xreflist, xi, next_entry); + mtx_unlock(&xreflist_lock); + return (xi); +} + /* * OFW install routines. Highest priority wins, equal priority also * overrides allowing last-set to win. @@ -465,29 +568,87 @@ OF_child_xref_phandle(phandle_t parent, phandle_t OF_node_from_xref(phandle_t xref) { + struct xrefinfo *xi; phandle_t node; - node = OF_child_xref_phandle(OF_peer(0), xref); - if (node == -1) - return (xref); + if (xref_init_done) { + if ((xi = xrefinfo_find(xref, FIND_BY_XREF)) == NULL) + return (xref); + return (xi->node); + } + if ((node = OF_child_xref_phandle(OF_peer(0), xref)) == -1) + return (xref); return (node); } phandle_t OF_xref_from_node(phandle_t node) { + struct xrefinfo *xi; phandle_t xref; + if (xref_init_done) { + if ((xi = xrefinfo_find(node, FIND_BY_NODE)) == NULL) + return (node); + return (xi->xref); + } + if (OF_getencprop(node, "phandle", &xref, sizeof(xref)) == -1 && OF_getencprop(node, "ibm,phandle", &xref, sizeof(xref)) == -1 && OF_getencprop(node, "linux,phandle", &xref, sizeof(xref)) == -1) return (node); - return (xref); } +device_t +OF_device_from_xref(phandle_t xref) +{ + struct xrefinfo *xi; + + if (xref_init_done) { + if ((xi = xrefinfo_find(xref, FIND_BY_XREF)) == NULL) + return (NULL); + return (xi->dev); + } + panic("Attempt to find device before xreflist_init"); +} + +phandle_t +OF_xref_from_device(device_t dev) +{ + struct xrefinfo *xi; + + if (xref_init_done) { + if ((xi = xrefinfo_find((uintptr_t)dev, FIND_BY_DEV)) == NULL) + return (0); + return (xi->xref); + } + panic("Attempt to find xref before xreflist_init"); +} + +int +OF_device_register_xref(phandle_t xref, device_t dev) +{ + struct xrefinfo *xi; + + /* + * If the given xref handle doesn't already exist in the list then we + * add a list entry. In theory this can only happen on a system where + * nodes don't contain phandle properties and xref and node handles are + * synonymous, so the xref handle is added as the node handle as well. + */ + if (xref_init_done) { + if ((xi = xrefinfo_find(xref, FIND_BY_XREF)) == NULL) + xrefinfo_add(xref, xref, dev); + else + xi->dev = dev; + return (0); + } + panic("Attempt to register device before xreflist_init"); +} + /* Call the method in the scope of a given instance. */ int OF_call_method(const char *method, ihandle_t instance, int nargs, int nreturns, Modified: stable/10/sys/dev/ofw/openfirm.h ============================================================================== --- stable/10/sys/dev/ofw/openfirm.h Sun Oct 26 01:47:55 2014 (r273654) +++ stable/10/sys/dev/ofw/openfirm.h Sun Oct 26 01:58:18 2014 (r273655) @@ -133,6 +133,17 @@ ssize_t OF_package_to_path(phandle_t no phandle_t OF_node_from_xref(phandle_t xref); phandle_t OF_xref_from_node(phandle_t node); +/* + * When properties contain references to other nodes using xref handles it is + * often necessary to use interfaces provided by the driver for the referenced + * instance. These routines allow a driver that provides such an interface to + * register its association with an xref handle, and for other drivers to obtain + * the device_t associated with an xref handle. + */ +device_t OF_device_from_xref(phandle_t xref); +phandle_t OF_xref_from_device(device_t dev); +int OF_device_register_xref(phandle_t xref, device_t dev); + /* Device I/O functions */ ihandle_t OF_open(const char *path); void OF_close(ihandle_t instance); From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 02:09:59 2014 Return-Path: Delivered-To: svn-src-all@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 617794C5; Sun, 26 Oct 2014 02:09: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 334FC918; Sun, 26 Oct 2014 02:09: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 s9Q29xNI072035; Sun, 26 Oct 2014 02:09:59 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q29wHj072030; Sun, 26 Oct 2014 02:09:58 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260209.s9Q29wHj072030@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 02:09:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273656 - in stable/10/sys/arm/freescale: . imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 02:09:59 -0000 Author: ian Date: Sun Oct 26 02:09:58 2014 New Revision: 273656 URL: https://svnweb.freebsd.org/changeset/base/273656 Log: MFC r270955,r270956: make the imx6 octop and anatop drivers early attachers. Modified: stable/10/sys/arm/freescale/fsl_ocotp.c stable/10/sys/arm/freescale/imx/imx6_anatop.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/fsl_ocotp.c ============================================================================== --- stable/10/sys/arm/freescale/fsl_ocotp.c Sun Oct 26 01:58:18 2014 (r273655) +++ stable/10/sys/arm/freescale/fsl_ocotp.c Sun Oct 26 02:09:58 2014 (r273656) @@ -200,5 +200,6 @@ static driver_t ocotp_driver = { static devclass_t ocotp_devclass; -DRIVER_MODULE(ocotp, simplebus, ocotp_driver, ocotp_devclass, 0, 0); +EARLY_DRIVER_MODULE(ocotp, simplebus, ocotp_driver, ocotp_devclass, 0, 0, + BUS_PASS_CPU + BUS_PASS_ORDER_FIRST); Modified: stable/10/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_anatop.c Sun Oct 26 01:58:18 2014 (r273655) +++ stable/10/sys/arm/freescale/imx/imx6_anatop.c Sun Oct 26 02:09:58 2014 (r273656) @@ -88,6 +88,8 @@ static struct resource_spec imx6_anatop_ struct imx6_anatop_softc { device_t dev; struct resource *res[2]; + struct intr_config_hook + intr_setup_hook; uint32_t cpu_curmhz; uint32_t cpu_curmv; uint32_t cpu_minmhz; @@ -613,10 +615,22 @@ initialize_tempmon(struct imx6_anatop_so "Throttle CPU when exceeding this temperature"); } +static void +intr_setup(void *arg) +{ + struct imx6_anatop_softc *sc; + + sc = arg; + bus_setup_intr(sc->dev, sc->res[IRQRES], INTR_TYPE_MISC | INTR_MPSAFE, + tempmon_intr, NULL, sc, &sc->temp_intrhand); + config_intrhook_disestablish(&sc->intr_setup_hook); +} + static int imx6_anatop_detach(device_t dev) { + /* This device can never detach. */ return (EBUSY); } @@ -636,10 +650,9 @@ imx6_anatop_attach(device_t dev) goto out; } - err = bus_setup_intr(dev, sc->res[IRQRES], INTR_TYPE_MISC | INTR_MPSAFE, - tempmon_intr, NULL, sc, &sc->temp_intrhand); - if (err != 0) - goto out; + sc->intr_setup_hook.ich_func = intr_setup; + sc->intr_setup_hook.ich_arg = sc; + config_intrhook_establish(&sc->intr_setup_hook); SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), @@ -716,5 +729,6 @@ static driver_t imx6_anatop_driver = { static devclass_t imx6_anatop_devclass; -DRIVER_MODULE(imx6_anatop, simplebus, imx6_anatop_driver, imx6_anatop_devclass, 0, 0); +EARLY_DRIVER_MODULE(imx6_anatop, simplebus, imx6_anatop_driver, + imx6_anatop_devclass, 0, 0, BUS_PASS_CPU + BUS_PASS_ORDER_FIRST + 1); From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 02:19:04 2014 Return-Path: Delivered-To: svn-src-all@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 AA02B63F; Sun, 26 Oct 2014 02:19: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 8C9D09C8; Sun, 26 Oct 2014 02:19: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 s9Q2J4F3077858; Sun, 26 Oct 2014 02:19:04 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q2J3Q8077851; Sun, 26 Oct 2014 02:19:03 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260219.s9Q2J3Q8077851@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 02:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273657 - in stable/10/sys: conf dev/fdt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 02:19:04 -0000 Author: ian Date: Sun Oct 26 02:19:03 2014 New Revision: 273657 URL: https://svnweb.freebsd.org/changeset/base/273657 Log: MFC r270957, r270959: Create an interface for drivers to enable or disable their clocks as listed in the clocks=<...> properties of their FDT data. Added: stable/10/sys/dev/fdt/fdt_clock.c - copied, changed from r270957, head/sys/dev/fdt/fdt_clock.c stable/10/sys/dev/fdt/fdt_clock.h - copied unchanged from r270957, head/sys/dev/fdt/fdt_clock.h stable/10/sys/dev/fdt/fdt_clock_if.m - copied unchanged from r270957, head/sys/dev/fdt/fdt_clock_if.m Modified: stable/10/sys/conf/files Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Sun Oct 26 02:09:58 2014 (r273656) +++ stable/10/sys/conf/files Sun Oct 26 02:19:03 2014 (r273657) @@ -1371,6 +1371,8 @@ dev/fatm/if_fatm.c optional fatm pci dev/fb/fbd.c optional fbd | vt dev/fb/fb_if.m standard dev/fb/splash.c optional sc splash +dev/fdt/fdt_clock.c optional fdt +dev/fdt/fdt_clock_if.m optional fdt dev/fdt/fdt_common.c optional fdt dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static \ Copied and modified: stable/10/sys/dev/fdt/fdt_clock.c (from r270957, head/sys/dev/fdt/fdt_clock.c) ============================================================================== --- head/sys/dev/fdt/fdt_clock.c Tue Sep 2 03:23:05 2014 (r270957, copy source) +++ stable/10/sys/dev/fdt/fdt_clock.c Sun Oct 26 02:19:03 2014 (r273657) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -119,7 +120,7 @@ fdt_clock_get_info(device_t consumer, in * override anything it wants to). */ clocknum = clks[n + 1]; - memset(info, 0, sizeof(*info)); + bzero(info, sizeof(*info)); info->provider = clockdev; info->index = clocknum; info->name = ""; @@ -148,13 +149,13 @@ void fdt_clock_register_provider(device_t provider) { - OF_device_register_xref(OF_xref_from_node(provider), provider); + OF_device_register_xref(OF_xref_from_device(provider), provider); } void fdt_clock_unregister_provider(device_t provider) { - OF_device_register_xref(OF_xref_from_node(provider), NULL); + OF_device_register_xref(OF_xref_from_device(provider), NULL); } Copied: stable/10/sys/dev/fdt/fdt_clock.h (from r270957, head/sys/dev/fdt/fdt_clock.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/fdt/fdt_clock.h Sun Oct 26 02:19:03 2014 (r273657, copy of r270957, head/sys/dev/fdt/fdt_clock.h) @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 2014 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef DEV_FDT_CLOCK_H +#define DEV_FDT_CLOCK_H + +#include "fdt_clock_if.h" + +/* + * Get info about the Nth clock listed in consumer's "clocks" property. + * + * Returns 0 on success, ENXIO if clock #n not found. + */ +int fdt_clock_get_info(device_t consumer, int n, struct fdt_clock_info *info); + +/* + * Look up "clocks" property in consumer's fdt data and enable or disable all + * configured clocks. + */ +int fdt_clock_enable_all(device_t consumer); +int fdt_clock_disable_all(device_t consumer); + +/* + * [Un]register the given device instance as a driver that implements the + * fdt_clock interface. + */ +void fdt_clock_register_provider(device_t provider); +void fdt_clock_unregister_provider(device_t provider); + +#endif /* DEV_FDT_CLOCK_H */ + Copied: stable/10/sys/dev/fdt/fdt_clock_if.m (from r270957, head/sys/dev/fdt/fdt_clock_if.m) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/fdt/fdt_clock_if.m Sun Oct 26 02:19:03 2014 (r273657, copy of r270957, head/sys/dev/fdt/fdt_clock_if.m) @@ -0,0 +1,81 @@ +#- +# Copyright (c) 2014 Ian Lepore +# 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 + +# +# This is the interface that fdt_clock drivers provide to other drivers. +# In this context, clock refers to a clock signal provided to some other +# hardware component within the system. They are most often found within +# embedded processors that have on-chip IO controllers. +# + +INTERFACE fdt_clock; + +HEADER { + + enum { + FDT_CIFLAG_RUNNING = 0x01, + }; + + struct fdt_clock_info { + device_t provider; + uint32_t index; + const char * name; /* May be "", will not be NULL. */ + uint32_t flags; + uint64_t frequency; /* In Hz. */ + }; +} + +# +# Enable the specified clock. +# Returns 0 on success or a standard errno value. +# +METHOD int enable { + device_t provider; + int index; +}; + +# +# Disable the specified clock. +# Returns 0 on success or a standard errno value. +# +METHOD int disable { + device_t provider; + int index; +}; + +# +# Returns information about the current operational state of specified clock. +# +METHOD int get_info { + device_t provider; + int index; + struct fdt_clock_info *info; +}; + From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 02:21:55 2014 Return-Path: Delivered-To: svn-src-all@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 66D0979C; Sun, 26 Oct 2014 02:21: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 526DFA65; Sun, 26 Oct 2014 02:21: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 s9Q2LtsX080690; Sun, 26 Oct 2014 02:21:55 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q2LtbA080666; Sun, 26 Oct 2014 02:21:55 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260221.s9Q2LtbA080666@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 02:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273658 - stable/10/sys/boot/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 02:21:55 -0000 Author: ian Date: Sun Oct 26 02:21:54 2014 New Revision: 273658 URL: https://svnweb.freebsd.org/changeset/base/273658 Log: MFC r271054: When built with FDT support, add /boot/dtb to the list of search directories. Modified: stable/10/sys/boot/common/module.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/common/module.c ============================================================================== --- stable/10/sys/boot/common/module.c Sun Oct 26 02:19:03 2014 (r273657) +++ stable/10/sys/boot/common/module.c Sun Oct 26 02:21:54 2014 (r273658) @@ -65,7 +65,12 @@ static void moduledir_rebuild(void); /* load address should be tweaked by first module loaded (kernel) */ static vm_offset_t loadaddr = 0; +#if defined(LOADER_FDT_SUPPORT) +static const char *default_searchpath = + "/boot/kernel;/boot/modules;/boot/dtb"; +#else static const char *default_searchpath ="/boot/kernel;/boot/modules"; +#endif static STAILQ_HEAD(, moduledir) moduledir_list = STAILQ_HEAD_INITIALIZER(moduledir_list); From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 02:25:36 2014 Return-Path: Delivered-To: svn-src-all@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 5BEC58E2; Sun, 26 Oct 2014 02:25: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 4694AA77; Sun, 26 Oct 2014 02:25: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 s9Q2PapJ083126; Sun, 26 Oct 2014 02:25:36 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q2PZdI083116; Sun, 26 Oct 2014 02:25:35 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260225.s9Q2PZdI083116@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 02:25:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273659 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 02:25:36 -0000 Author: ian Date: Sun Oct 26 02:25:34 2014 New Revision: 273659 URL: https://svnweb.freebsd.org/changeset/base/273659 Log: MFC r271055, r271084, r271094: Add a function to get the frequency of the AHB bus. Another stopgap function until we have full clock support for imx6. The imx5x and imx6 chips have an onboard IOMUX device which also contains a few "general purpose registers" whose values control chip behavior in ways that have nothing to do with IO pin mux control. Define a simple API that other soc-specific code can use to read and write the registers, and provide the imx51 implementation of them. Fix a typo. Added: stable/10/sys/arm/freescale/imx/imx_iomuxvar.h - copied unchanged from r271084, head/sys/arm/freescale/imx/imx_iomuxvar.h Modified: stable/10/sys/arm/freescale/imx/imx51_ccm.c stable/10/sys/arm/freescale/imx/imx51_iomux.c stable/10/sys/arm/freescale/imx/imx6_ccm.c stable/10/sys/arm/freescale/imx/imx_ccmvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/imx51_ccm.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx51_ccm.c Sun Oct 26 02:21:54 2014 (r273658) +++ stable/10/sys/arm/freescale/imx/imx51_ccm.c Sun Oct 26 02:25:34 2014 (r273659) @@ -580,3 +580,10 @@ imx_ccm_uart_hz(void) return (imx51_get_clock(IMX51CLK_UART_CLK_ROOT)); } + +uint32_t +imx_ccm_ahb_hz(void) +{ + + return (imx51_get_clock(IMX51CLK_AHB_CLK_ROOT)); +} Modified: stable/10/sys/arm/freescale/imx/imx51_iomux.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx51_iomux.c Sun Oct 26 02:21:54 2014 (r273658) +++ stable/10/sys/arm/freescale/imx/imx51_iomux.c Sun Oct 26 02:25:34 2014 (r273659) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -216,6 +217,41 @@ iomux_input_config(const struct iomux_in } #endif +uint32_t +imx_iomux_gpr_get(u_int regnum) +{ + + KASSERT(iomuxsc != NULL, ("imx_iomux_gpr_get() called before attach")); + KASSERT(regnum >= 0 && regnum <= 1, + ("imx_iomux_gpr_get bad regnum %u", regnum)); + return (IOMUX_READ(iomuxsc, IOMUXC_GPR0 + regnum)); +} + +void +imx_iomux_gpr_set(u_int regnum, uint32_t val) +{ + + KASSERT(iomuxsc != NULL, ("imx_iomux_gpr_set() called before attach")); + KASSERT(regnum >= 0 && regnum <= 1, + ("imx_iomux_gpr_set bad regnum %u", regnum)); + IOMUX_WRITE(iomuxsc, IOMUXC_GPR0 + regnum, val); +} + +void +imx_iomux_gpr_set_masked(u_int regnum, uint32_t clrbits, uint32_t setbits) +{ + uint32_t val; + + KASSERT(iomuxsc != NULL, + ("imx_iomux_gpr_set_masked called before attach")); + KASSERT(regnum >= 0 && regnum <= 1, + ("imx_iomux_gpr_set_masked bad regnum %u", regnum)); + + val = IOMUX_READ(iomuxsc, IOMUXC_GPR0 + regnum); + val = (val & ~clrbits) | setbits; + IOMUX_WRITE(iomuxsc, IOMUXC_GPR0 + regnum, val); +} + static device_method_t imx_iomux_methods[] = { DEVMETHOD(device_probe, iomux_probe), DEVMETHOD(device_attach, iomux_attach), Modified: stable/10/sys/arm/freescale/imx/imx6_ccm.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_ccm.c Sun Oct 26 02:21:54 2014 (r273658) +++ stable/10/sys/arm/freescale/imx/imx6_ccm.c Sun Oct 26 02:25:34 2014 (r273659) @@ -238,6 +238,12 @@ imx_ccm_uart_hz(void) return (80000000); } +uint32_t +imx_ccm_ahb_hz(void) +{ + return (132000000); +} + static device_method_t ccm_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ccm_probe), Modified: stable/10/sys/arm/freescale/imx/imx_ccmvar.h ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_ccmvar.h Sun Oct 26 02:21:54 2014 (r273658) +++ stable/10/sys/arm/freescale/imx/imx_ccmvar.h Sun Oct 26 02:25:34 2014 (r273659) @@ -47,6 +47,7 @@ uint32_t imx_ccm_ipg_hz(void); uint32_t imx_ccm_perclk_hz(void); uint32_t imx_ccm_sdhci_hz(void); uint32_t imx_ccm_uart_hz(void); +uint32_t imx_ccm_ahb_hz(void); void imx_ccm_usb_enable(device_t _usbdev); void imx_ccm_usbphy_enable(device_t _phydev); Copied: stable/10/sys/arm/freescale/imx/imx_iomuxvar.h (from r271084, head/sys/arm/freescale/imx/imx_iomuxvar.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/imx/imx_iomuxvar.h Sun Oct 26 02:25:34 2014 (r273659, copy of r271084, head/sys/arm/freescale/imx/imx_iomuxvar.h) @@ -0,0 +1,42 @@ +/*- + * Copyright (c) 2014 Ian Lepore + * 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 IMX_IOMUXVAR_H +#define IMX_IOMUXVAR_H + +/* + * The IOMUX Controller device has a small set of "general purpose registers" + * which control various aspects of SoC operation that really have nothing to do + * with IO pin assignments or pad control. These functions let other soc level + * code manipulate these values. + */ +uint32_t imx_iomux_gpr_get(u_int regnum); +void imx_iomux_gpr_set(u_int regnum, uint32_t val); +void imx_iomux_gpr_set_masked(u_int regnum, uint32_t clrbits, uint32_t setbits); + +#endif From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 02:27:11 2014 Return-Path: Delivered-To: svn-src-all@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 96E33A17; Sun, 26 Oct 2014 02:27: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 822B9A83; Sun, 26 Oct 2014 02:27: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 s9Q2RBiM083593; Sun, 26 Oct 2014 02:27:11 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q2RBxv083591; Sun, 26 Oct 2014 02:27:11 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260227.s9Q2RBxv083591@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 02:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273660 - in stable/10: etc/mtree share/man/man7 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 02:27:11 -0000 Author: ian Date: Sun Oct 26 02:27:10 2014 New Revision: 273660 URL: https://svnweb.freebsd.org/changeset/base/273660 Log: MFC r271057: Create a /boot/dtb directory to house DTB blobs. Modified: stable/10/etc/mtree/BSD.root.dist stable/10/share/man/man7/hier.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.root.dist ============================================================================== --- stable/10/etc/mtree/BSD.root.dist Sun Oct 26 02:25:34 2014 (r273659) +++ stable/10/etc/mtree/BSD.root.dist Sun Oct 26 02:27:10 2014 (r273660) @@ -10,6 +10,8 @@ boot defaults .. + dtb + .. firmware .. kernel Modified: stable/10/share/man/man7/hier.7 ============================================================================== --- stable/10/share/man/man7/hier.7 Sun Oct 26 02:25:34 2014 (r273659) +++ stable/10/share/man/man7/hier.7 Sun Oct 26 02:27:10 2014 (r273660) @@ -52,13 +52,25 @@ programs and configuration files used du .It Pa defaults/ default bootstrapping configuration files; see .Xr loader.conf 5 +.It Pa dtb/ +Compiled flattened device tree (FDT) files; see +.Xr fdt 4 +and +.Xr dtc 1 +.It Pa firmware/ +Loadable modules containing binary firmware for hardware that needs +firmware downloaded to it to function .It Pa kernel/ pure kernel executable (the operating system loaded into memory -at boot time). +at boot time) .It Pa modules/ third-party loadable kernel modules; see .Xr kldstat 8 +.It Pa zfs/ +Contains +.Xr zfs 8 +zpool cache files. .El .It Pa /cdrom/ default mount point for CD-ROM drives From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 02:37:46 2014 Return-Path: Delivered-To: svn-src-all@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 E2433BA1; Sun, 26 Oct 2014 02:37: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 CC359B3A; Sun, 26 Oct 2014 02:37: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 s9Q2bjgg089865; Sun, 26 Oct 2014 02:37:45 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q2bhed089849; Sun, 26 Oct 2014 02:37:43 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260237.s9Q2bhed089849@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 02:37:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273661 - in stable/10/sys: arm/conf arm/freescale/imx boot/fdt/dts/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 02:37:46 -0000 Author: ian Date: Sun Oct 26 02:37:42 2014 New Revision: 273661 URL: https://svnweb.freebsd.org/changeset/base/273661 Log: MFC r268834, r268835: o Enable GPIO device driver for i.MX6. It was originally written for i.MX5 and compatible with newer chip. o Extend device tree information o style(9) fixes o Rename gpio driver file. Added: stable/10/sys/arm/freescale/imx/imx_gpio.c - copied unchanged from r268835, head/sys/arm/freescale/imx/imx_gpio.c Deleted: stable/10/sys/arm/freescale/imx/imx51_gpio.c Modified: stable/10/sys/arm/conf/IMX6 stable/10/sys/arm/freescale/imx/files.imx51 stable/10/sys/arm/freescale/imx/files.imx53 stable/10/sys/arm/freescale/imx/files.imx6 stable/10/sys/boot/fdt/dts/arm/imx6.dtsi stable/10/sys/boot/fdt/dts/arm/wandboard-dual.dts stable/10/sys/boot/fdt/dts/arm/wandboard-quad.dts stable/10/sys/boot/fdt/dts/arm/wandboard-solo.dts Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/IMX6 ============================================================================== --- stable/10/sys/arm/conf/IMX6 Sun Oct 26 02:27:10 2014 (r273660) +++ stable/10/sys/arm/conf/IMX6 Sun Oct 26 02:37:42 2014 (r273661) @@ -82,6 +82,9 @@ device miibus # Required for etherne device bpf # Berkeley packet filter (required for DHCP) #device iomux # IO Multiplexor +# General-purpose input/output +device gpio + # Serial (COM) ports device uart # Multi-uart driver @@ -106,7 +109,7 @@ device u3g # USB modems #device ukbd # Allow keyboard like HIDs to control console #device ums # USB mouse -# USB Ethernet, requires miibus +# USB Ethernet, requires miibus #device aue # ADMtek USB Ethernet #device axe # ASIX Electronics USB Ethernet #device cdce # Generic USB over Ethernet Modified: stable/10/sys/arm/freescale/imx/files.imx51 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx51 Sun Oct 26 02:27:10 2014 (r273660) +++ stable/10/sys/arm/freescale/imx/files.imx51 Sun Oct 26 02:37:42 2014 (r273661) @@ -22,7 +22,7 @@ arm/freescale/imx/tzic.c standard arm/freescale/imx/imx51_iomux.c optional iomux # GPIO -arm/freescale/imx/imx51_gpio.c optional gpio +arm/freescale/imx/imx_gpio.c optional gpio # Generic Periodic Timer arm/freescale/imx/imx_gpt.c standard Modified: stable/10/sys/arm/freescale/imx/files.imx53 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx53 Sun Oct 26 02:27:10 2014 (r273660) +++ stable/10/sys/arm/freescale/imx/files.imx53 Sun Oct 26 02:37:42 2014 (r273661) @@ -25,7 +25,7 @@ arm/freescale/imx/tzic.c standard arm/freescale/imx/imx51_iomux.c optional iomux # GPIO -arm/freescale/imx/imx51_gpio.c optional gpio +arm/freescale/imx/imx_gpio.c optional gpio # Generic Periodic Timer arm/freescale/imx/imx_gpt.c standard Modified: stable/10/sys/arm/freescale/imx/files.imx6 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx6 Sun Oct 26 02:27:10 2014 (r273660) +++ stable/10/sys/arm/freescale/imx/files.imx6 Sun Oct 26 02:37:42 2014 (r273661) @@ -26,6 +26,7 @@ arm/freescale/imx/imx6_mp.c optional sm arm/freescale/imx/imx6_pl310.c standard arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx_gpt.c standard +arm/freescale/imx/imx_gpio.c optional gpio # # Optional devices. @@ -50,8 +51,6 @@ arm/freescale/imx/imx6_usbphy.c optiona # Not ready yet... # #arm/freescale/imx/imx51_iomux.c optional iomux -#arm/freescale/imx/imx51_gpio.c optional gpio #dev/ata/chipsets/ata-fsl.c optional imxata #arm/freescale/imx/i2c.c optional fsliic #arm/freescale/imx/imx51_ipuv3.c optional sc - Copied: stable/10/sys/arm/freescale/imx/imx_gpio.c (from r268835, head/sys/arm/freescale/imx/imx_gpio.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/imx/imx_gpio.c Sun Oct 26 02:37:42 2014 (r273661, copy of r268835, head/sys/arm/freescale/imx/imx_gpio.c) @@ -0,0 +1,491 @@ +/*- + * Copyright (c) 2012, 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Oleksandr Rybalko under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Freescale i.MX515 GPIO driver. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include "gpio_if.h" + +#define GPIO_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define GPIO_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define GPIO_LOCK_INIT(_sc) mtx_init(&_sc->sc_mtx, \ + device_get_nameunit(_sc->sc_dev), "imx_gpio", MTX_DEF) +#define GPIO_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); +#define GPIO_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); +#define GPIO_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); + +#define WRITE4(_sc, _r, _v) \ + bus_space_write_4((_sc)->sc_iot, (_sc)->sc_ioh, (_r), (_v)) +#define READ4(_sc, _r) \ + bus_space_read_4((_sc)->sc_iot, (_sc)->sc_ioh, (_r)) +#define SET4(_sc, _r, _m) \ + WRITE4((_sc), (_r), READ4((_sc), (_r)) | (_m)) +#define CLEAR4(_sc, _r, _m) \ + WRITE4((_sc), (_r), READ4((_sc), (_r)) & ~(_m)) + +/* Registers definition for Freescale i.MX515 GPIO controller */ + +#define IMX_GPIO_DR_REG 0x000 /* Pin Data */ +#define IMX_GPIO_OE_REG 0x004 /* Set Pin Output */ +#define IMX_GPIO_PSR_REG 0x008 /* Pad Status */ +#define IMX_GPIO_ICR1_REG 0x00C /* Interrupt Configuration */ +#define IMX_GPIO_ICR2_REG 0x010 /* Interrupt Configuration */ +#define GPIO_ICR_COND_LOW 0 +#define GPIO_ICR_COND_HIGH 1 +#define GPIO_ICR_COND_RISE 2 +#define GPIO_ICR_COND_FALL 3 +#define IMX_GPIO_IMR_REG 0x014 /* Interrupt Mask Register */ +#define IMX_GPIO_ISR_REG 0x018 /* Interrupt Status Register */ +#define IMX_GPIO_EDGE_REG 0x01C /* Edge Detect Register */ + +#define DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT) +#define NGPIO 32 + +struct imx51_gpio_softc { + device_t dev; + struct mtx sc_mtx; + struct resource *sc_res[11]; /* 1 x mem, 2 x IRQ, 8 x IRQ */ + void *gpio_ih[11]; /* 1 ptr is not a big waste */ + int sc_l_irq; /* Last irq resource */ + bus_space_tag_t sc_iot; + bus_space_handle_t sc_ioh; + int gpio_npins; + struct gpio_pin gpio_pins[NGPIO]; +}; + +static struct ofw_compat_data compat_data[] = { + {"fsl,imx6q-gpio", 1}, + {"fsl,imx53-gpio", 1}, + {"fsl,imx51-gpio", 1}, + {NULL, 0} +}; + +static struct resource_spec imx_gpio_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 1, RF_ACTIVE }, + { -1, 0 } +}; + +static struct resource_spec imx_gpio0irq_spec[] = { + { SYS_RES_IRQ, 2, RF_ACTIVE }, + { SYS_RES_IRQ, 3, RF_ACTIVE }, + { SYS_RES_IRQ, 4, RF_ACTIVE }, + { SYS_RES_IRQ, 5, RF_ACTIVE }, + { SYS_RES_IRQ, 6, RF_ACTIVE }, + { SYS_RES_IRQ, 7, RF_ACTIVE }, + { SYS_RES_IRQ, 8, RF_ACTIVE }, + { SYS_RES_IRQ, 9, RF_ACTIVE }, + { -1, 0 } +}; + +/* + * Helpers + */ +static void imx51_gpio_pin_configure(struct imx51_gpio_softc *, + struct gpio_pin *, uint32_t); + +/* + * Driver stuff + */ +static int imx51_gpio_probe(device_t); +static int imx51_gpio_attach(device_t); +static int imx51_gpio_detach(device_t); +static int imx51_gpio_intr(void *); + +/* + * GPIO interface + */ +static int imx51_gpio_pin_max(device_t, int *); +static int imx51_gpio_pin_getcaps(device_t, uint32_t, uint32_t *); +static int imx51_gpio_pin_getflags(device_t, uint32_t, uint32_t *); +static int imx51_gpio_pin_getname(device_t, uint32_t, char *); +static int imx51_gpio_pin_setflags(device_t, uint32_t, uint32_t); +static int imx51_gpio_pin_set(device_t, uint32_t, unsigned int); +static int imx51_gpio_pin_get(device_t, uint32_t, unsigned int *); +static int imx51_gpio_pin_toggle(device_t, uint32_t pin); + +static void +imx51_gpio_pin_configure(struct imx51_gpio_softc *sc, struct gpio_pin *pin, + unsigned int flags) +{ + + GPIO_LOCK(sc); + + /* + * Manage input/output + */ + if (flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) { + pin->gp_flags &= ~(GPIO_PIN_INPUT|GPIO_PIN_OUTPUT); + if (flags & GPIO_PIN_OUTPUT) { + pin->gp_flags |= GPIO_PIN_OUTPUT; + SET4(sc, IMX_GPIO_OE_REG, (1 << pin->gp_pin)); + } + else { + pin->gp_flags |= GPIO_PIN_INPUT; + CLEAR4(sc, IMX_GPIO_OE_REG, (1 << pin->gp_pin)); + } + } + + GPIO_UNLOCK(sc); +} + +static int +imx51_gpio_pin_max(device_t dev, int *maxpin) +{ + + *maxpin = NGPIO - 1; + return (0); +} + +static int +imx51_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +{ + struct imx51_gpio_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < sc->gpio_npins; i++) { + if (sc->gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->gpio_npins) + return (EINVAL); + + GPIO_LOCK(sc); + *caps = sc->gpio_pins[i].gp_caps; + GPIO_UNLOCK(sc); + + return (0); +} + +static int +imx51_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) +{ + struct imx51_gpio_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < sc->gpio_npins; i++) { + if (sc->gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->gpio_npins) + return (EINVAL); + + GPIO_LOCK(sc); + *flags = sc->gpio_pins[i].gp_flags; + GPIO_UNLOCK(sc); + + return (0); +} + +static int +imx51_gpio_pin_getname(device_t dev, uint32_t pin, char *name) +{ + struct imx51_gpio_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < sc->gpio_npins; i++) { + if (sc->gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->gpio_npins) + return (EINVAL); + + GPIO_LOCK(sc); + memcpy(name, sc->gpio_pins[i].gp_name, GPIOMAXNAME); + GPIO_UNLOCK(sc); + + return (0); +} + +static int +imx51_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +{ + struct imx51_gpio_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < sc->gpio_npins; i++) { + if (sc->gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->gpio_npins) + return (EINVAL); + + /* Check for unwanted flags. */ + if ((flags & sc->gpio_pins[i].gp_caps) != flags) + return (EINVAL); + + /* Can't mix input/output together */ + if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == + (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) + return (EINVAL); + + imx51_gpio_pin_configure(sc, &sc->gpio_pins[i], flags); + + + return (0); +} + +static int +imx51_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value) +{ + struct imx51_gpio_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < sc->gpio_npins; i++) { + if (sc->gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->gpio_npins) + return (EINVAL); + + GPIO_LOCK(sc); + if (value) + SET4(sc, IMX_GPIO_DR_REG, (1 << i)); + else + CLEAR4(sc, IMX_GPIO_DR_REG, (1 << i)); + GPIO_UNLOCK(sc); + + return (0); +} + +static int +imx51_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val) +{ + struct imx51_gpio_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < sc->gpio_npins; i++) { + if (sc->gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->gpio_npins) + return (EINVAL); + + GPIO_LOCK(sc); + *val = (READ4(sc, IMX_GPIO_DR_REG) >> i) & 1; + GPIO_UNLOCK(sc); + + return (0); +} + +static int +imx51_gpio_pin_toggle(device_t dev, uint32_t pin) +{ + struct imx51_gpio_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < sc->gpio_npins; i++) { + if (sc->gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->gpio_npins) + return (EINVAL); + + GPIO_LOCK(sc); + WRITE4(sc, IMX_GPIO_DR_REG, + (READ4(sc, IMX_GPIO_DR_REG) ^ (1 << i))); + GPIO_UNLOCK(sc); + + return (0); +} + +static int +imx51_gpio_intr(void *arg) +{ + struct imx51_gpio_softc *sc; + uint32_t input, value; + + sc = arg; + input = READ4(sc, IMX_GPIO_ISR_REG); + value = input & READ4(sc, IMX_GPIO_IMR_REG); + WRITE4(sc, IMX_GPIO_ISR_REG, input); + + if (!value) + goto intr_done; + + /* TODO: interrupt handling */ + +intr_done: + return (FILTER_HANDLED); +} + +static int +imx51_gpio_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { + device_set_desc(dev, "Freescale i.MX GPIO Controller"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +imx51_gpio_attach(device_t dev) +{ + struct imx51_gpio_softc *sc; + int i, irq; + + sc = device_get_softc(dev); + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF); + + if (bus_alloc_resources(dev, imx_gpio_spec, sc->sc_res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + sc->dev = dev; + sc->gpio_npins = NGPIO; + sc->sc_l_irq = 2; + sc->sc_iot = rman_get_bustag(sc->sc_res[0]); + sc->sc_ioh = rman_get_bushandle(sc->sc_res[0]); + + if (bus_alloc_resources(dev, imx_gpio0irq_spec, &sc->sc_res[3]) == 0) { + /* + * First GPIO unit able to serve +8 interrupts for 8 first + * pins. + */ + sc->sc_l_irq = 10; + } + + for (irq = 1; irq <= sc->sc_l_irq; irq ++) { + if ((bus_setup_intr(dev, sc->sc_res[irq], INTR_TYPE_MISC, + imx51_gpio_intr, NULL, sc, &sc->gpio_ih[irq]))) { + device_printf(dev, + "WARNING: unable to register interrupt handler\n"); + return (ENXIO); + } + } + + for (i = 0; i < sc->gpio_npins; i++) { + sc->gpio_pins[i].gp_pin = i; + sc->gpio_pins[i].gp_caps = DEFAULT_CAPS; + sc->gpio_pins[i].gp_flags = + (READ4(sc, IMX_GPIO_OE_REG) & (1 << i)) ? GPIO_PIN_OUTPUT: + GPIO_PIN_INPUT; + snprintf(sc->gpio_pins[i].gp_name, GPIOMAXNAME, + "imx_gpio%d.%d", device_get_unit(dev), i); + } + + device_add_child(dev, "gpioc", device_get_unit(dev)); + device_add_child(dev, "gpiobus", device_get_unit(dev)); + + return (bus_generic_attach(dev)); +} + +static int +imx51_gpio_detach(device_t dev) +{ + struct imx51_gpio_softc *sc; + + sc = device_get_softc(dev); + + KASSERT(mtx_initialized(&sc->sc_mtx), ("gpio mutex not initialized")); + + bus_generic_detach(dev); + + if (sc->sc_res[3]) + bus_release_resources(dev, imx_gpio0irq_spec, &sc->sc_res[3]); + + if (sc->sc_res[0]) + bus_release_resources(dev, imx_gpio_spec, sc->sc_res); + + mtx_destroy(&sc->sc_mtx); + + return(0); +} + +static device_method_t imx51_gpio_methods[] = { + DEVMETHOD(device_probe, imx51_gpio_probe), + DEVMETHOD(device_attach, imx51_gpio_attach), + DEVMETHOD(device_detach, imx51_gpio_detach), + + /* GPIO protocol */ + DEVMETHOD(gpio_pin_max, imx51_gpio_pin_max), + DEVMETHOD(gpio_pin_getname, imx51_gpio_pin_getname), + DEVMETHOD(gpio_pin_getflags, imx51_gpio_pin_getflags), + DEVMETHOD(gpio_pin_getcaps, imx51_gpio_pin_getcaps), + DEVMETHOD(gpio_pin_setflags, imx51_gpio_pin_setflags), + DEVMETHOD(gpio_pin_get, imx51_gpio_pin_get), + DEVMETHOD(gpio_pin_set, imx51_gpio_pin_set), + DEVMETHOD(gpio_pin_toggle, imx51_gpio_pin_toggle), + {0, 0}, +}; + +static driver_t imx51_gpio_driver = { + "gpio", + imx51_gpio_methods, + sizeof(struct imx51_gpio_softc), +}; +static devclass_t imx51_gpio_devclass; + +DRIVER_MODULE(imx51_gpio, simplebus, imx51_gpio_driver, imx51_gpio_devclass, + 0, 0); Modified: stable/10/sys/boot/fdt/dts/arm/imx6.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/imx6.dtsi Sun Oct 26 02:27:10 2014 (r273660) +++ stable/10/sys/boot/fdt/dts/arm/imx6.dtsi Sun Oct 26 02:37:42 2014 (r273661) @@ -102,6 +102,20 @@ interrupts = <119 120>; }; + /* System Reset Controller */ + src: src@4006E000 { + compatible = "fsl,imx6-src"; + reg = <0x020D8000 0x100>; + }; + + sdma: sdma@020ec000 { + compatible = "fsl,imx6q-sdma"; + reg = <0x020ec000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <34>; + status = "disabled"; + }; + anatop: anatop@020c8000 { compatible = "fsl,imx6q-anatop"; reg = <0x020c8000 0x1000>; @@ -115,87 +129,95 @@ interrupt-parent = <&gic>; interrupts = <87>; }; -// iomux@73fa8000 { -// compatible = "fsl,imx51-iomux"; -// reg = <0x73fa8000 0x4000>; -// interrupt-parent = <&gic>; interrupts = <7>; -// status = "disabled"; -// }; + iomux@020e0000 { + compatible = "fsl,imx6q-iomux"; + reg = <0x020e0000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <32>; + status = "disabled"; + }; gpio1: gpio@0209c000 { compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; reg = <0x0209c000 0x4000>; - interrupts = <0 66 0x04 0 67 0x04>; + interrupts = < 98 99 >; gpio-controller; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; + status = "disabled"; }; - + gpio2: gpio@020a0000 { compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; reg = <0x020a0000 0x4000>; - interrupts = <0 68 0x04 0 69 0x04>; + interrupts = < 100 101 >; gpio-controller; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; + status = "disabled"; }; - + gpio3: gpio@020a4000 { compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; reg = <0x020a4000 0x4000>; - interrupts = <0 70 0x04 0 71 0x04>; + interrupts = < 102 103 >; gpio-controller; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; + status = "disabled"; }; - + gpio4: gpio@020a8000 { compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; reg = <0x020a8000 0x4000>; - interrupts = <0 72 0x04 0 73 0x04>; + interrupts = < 104 105 >; gpio-controller; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; + status = "disabled"; }; - + gpio5: gpio@020ac000 { compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; reg = <0x020ac000 0x4000>; - interrupts = <0 74 0x04 0 75 0x04>; + interrupts = < 106 107 >; gpio-controller; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; + status = "disabled"; }; - + gpio6: gpio@020b0000 { compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; reg = <0x020b0000 0x4000>; - interrupts = <0 76 0x04 0 77 0x04>; + interrupts = < 108 109 >; gpio-controller; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; + status = "disabled"; }; - + gpio7: gpio@020b4000 { compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; reg = <0x020b4000 0x4000>; - interrupts = <0 78 0x04 0 79 0x04>; + interrupts = < 110 111 >; gpio-controller; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; + status = "disabled"; }; uart1: serial@02020000 { compatible = "fsl,imx6q-uart"; reg = <0x02020000 0x4000>; - interrupt-parent = <&gic>; + interrupt-parent = <&gic>; interrupts = <58>; clock-frequency = <80000000>; status = "disabled"; @@ -204,7 +226,7 @@ uart2: serial@021e8000 { compatible = "fsl,imx6q-uart"; reg = <0x021e8000 0x4000>; - interrupt-parent = <&gic>; + interrupt-parent = <&gic>; interrupts = <59>; clock-frequency = <80000000>; status = "disabled"; @@ -213,7 +235,7 @@ uart3: serial@021ec000 { compatible = "fsl,imx6q-uart"; reg = <0x021ec000 0x4000>; - interrupt-parent = <&gic>; + interrupt-parent = <&gic>; interrupts = <60>; clock-frequency = <80000000>; status = "disabled"; @@ -222,7 +244,7 @@ uart4: serial@021f0000 { compatible = "fsl,imx6q-uart"; reg = <0x021f0000 0x4000>; - interrupt-parent = <&gic>; + interrupt-parent = <&gic>; interrupts = <61>; clock-frequency = <80000000>; status = "disabled"; @@ -231,7 +253,7 @@ uart5: serial@021f4000 { compatible = "fsl,imx6q-uart"; reg = <0x021f4000 0x4000>; - interrupt-parent = <&gic>; + interrupt-parent = <&gic>; interrupts = <62>; clock-frequency = <80000000>; status = "disabled"; @@ -243,14 +265,69 @@ interrupts = <44>; status = "disabled"; }; - + usbphy2: usbphy@020ca000 { compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy"; reg = <0x020ca000 0x1000>; interrupts = <45>; status = "disabled"; }; - + + ecspi1: ecspi@02008000 { + compatible = "fsl,imx6q-ecspi"; + reg = <0x02008000 0x4000>; + interrupts = < 63 >; + status = "disabled"; + }; + + ecspi2: ecspi@0200C000 { + compatible = "fsl,imx6q-ecspi"; + reg = <0x0200C000 0x4000>; + interrupts = < 64 >; + status = "disabled"; + }; + + ecspi3: ecspi@02010000 { + compatible = "fsl,imx6q-ecspi"; + reg = <0x02010000 0x4000>; + interrupts = < 65 >; + status = "disabled"; + }; + + ecspi4: ecspi@02014000 { + compatible = "fsl,imx6q-ecspi"; + reg = <0x02014000 0x4000>; + interrupts = < 66 >; + status = "disabled"; + }; + + ecspi5: ecspi@02018000 { + compatible = "fsl,imx6q-ecspi"; + reg = <0x02018000 0x4000>; + interrupts = < 67 >; + status = "disabled"; + }; + + ssi1: ssi@02028000 { + compatible = "fsl,imx6q-ssi"; + reg = <0x02028000 0x4000>; + interrupts = < 78 >; + status = "disabled"; + }; + + ssi2: ssi@0202C000 { + compatible = "fsl,imx6q-ssi"; + reg = <0x0202C000 0x4000>; + interrupts = < 79 >; + status = "disabled"; + }; + + ssi3: ssi@02030000 { + compatible = "fsl,imx6q-ssi"; + reg = <0x02030000 0x4000>; + interrupts = < 80 >; + status = "disabled"; + }; }; aips@02100000 { /* AIPS2 */ @@ -267,7 +344,7 @@ interrupts = <150 151>; status = "disabled"; }; - + usbotg1: usb@02184000 { compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; reg = <0x02184000 0x200>; @@ -276,7 +353,7 @@ fsl,usbmisc = <&usbmisc 0>; status = "disabled"; }; - + usbh1: usb@02184200 { compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; reg = <0x02184200 0x200>; @@ -285,7 +362,7 @@ fsl,usbmisc = <&usbmisc 1>; status = "disabled"; }; - + usbh2: usb@02184400 { compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; reg = <0x02184400 0x200>; @@ -293,7 +370,7 @@ fsl,usbmisc = <&usbmisc 2>; status = "disabled"; }; - + usbh3: usb@02184600 { compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; reg = <0x02184600 0x200>; @@ -301,7 +378,7 @@ fsl,usbmisc = <&usbmisc 3>; status = "disabled"; }; - + usbmisc: usbmisc@02184800 { #index-cells = <1>; compatible = "fsl,imx6q-usbmisc"; @@ -352,6 +429,12 @@ compatible = "fsl,imx6q-ocotp"; reg = <0x021bc000 0x4000>; }; + + audmux: audmux@021d8000 { + compatible = "fsl,imx6q-audmux"; + reg = <0x021d8000 0x4000>; + status = "disabled"; + }; }; }; }; Modified: stable/10/sys/boot/fdt/dts/arm/wandboard-dual.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/wandboard-dual.dts Sun Oct 26 02:27:10 2014 (r273660) +++ stable/10/sys/boot/fdt/dts/arm/wandboard-dual.dts Sun Oct 26 02:37:42 2014 (r273661) @@ -44,11 +44,14 @@ SOC: soc@00000000 { aips@02000000 { /* AIPS1 */ -// iomux@73fa8000 { status = "disabled"; }; -// gpio@0209C000 { status = "disabled"; }; -// gpio@020A0000 { status = "disabled"; }; -// gpio@020A4000 { status = "disabled"; }; -// gpio@020A8000 { status = "disabled"; }; + iomux@020e0000 { status = "disabled"; }; + gpio@0209c000 { status = "okay"; }; + gpio@020a0000 { status = "okay"; }; + gpio@020a4000 { status = "okay"; }; + gpio@020a8000 { status = "okay"; }; + gpio@020aC000 { status = "okay"; }; + gpio@020b0000 { status = "okay"; }; + gpio@020b4000 { status = "okay"; }; console:serial@02020000 { status = "okay"; }; serial@021e8000 { status = "disabled"; }; serial@021ec000 { status = "disabled"; }; @@ -58,7 +61,7 @@ usbphy@020ca000 { status = "okay"; }; }; aips@02100000 { /* AIPS2 */ - ethernet@02188000 { + ethernet@02188000 { status = "okay"; phy-mode = "rgmii"; phy-disable-preamble; Modified: stable/10/sys/boot/fdt/dts/arm/wandboard-quad.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/wandboard-quad.dts Sun Oct 26 02:27:10 2014 (r273660) +++ stable/10/sys/boot/fdt/dts/arm/wandboard-quad.dts Sun Oct 26 02:37:42 2014 (r273661) @@ -44,11 +44,14 @@ SOC: soc@00000000 { aips@02000000 { /* AIPS1 */ -// iomux@73fa8000 { status = "disabled"; }; -// gpio@0209C000 { status = "disabled"; }; -// gpio@020A0000 { status = "disabled"; }; -// gpio@020A4000 { status = "disabled"; }; -// gpio@020A8000 { status = "disabled"; }; + iomux@020e0000 { status = "disabled"; }; + gpio@0209c000 { status = "okay"; }; + gpio@020a0000 { status = "okay"; }; + gpio@020a4000 { status = "okay"; }; + gpio@020a8000 { status = "okay"; }; + gpio@020aC000 { status = "okay"; }; + gpio@020b0000 { status = "okay"; }; + gpio@020b4000 { status = "okay"; }; console:serial@02020000 { status = "okay"; }; serial@021e8000 { status = "disabled"; }; serial@021ec000 { status = "disabled"; }; @@ -58,7 +61,7 @@ usbphy@020ca000 { status = "okay"; }; }; aips@02100000 { /* AIPS2 */ - ethernet@02188000 { + ethernet@02188000 { status = "okay"; phy-mode = "rgmii"; phy-disable-preamble; Modified: stable/10/sys/boot/fdt/dts/arm/wandboard-solo.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/wandboard-solo.dts Sun Oct 26 02:27:10 2014 (r273660) +++ stable/10/sys/boot/fdt/dts/arm/wandboard-solo.dts Sun Oct 26 02:37:42 2014 (r273661) @@ -44,11 +44,14 @@ SOC: soc@00000000 { aips@02000000 { /* AIPS1 */ -// iomux@73fa8000 { status = "disabled"; }; -// gpio@0209C000 { status = "disabled"; }; -// gpio@020A0000 { status = "disabled"; }; -// gpio@020A4000 { status = "disabled"; }; -// gpio@020A8000 { status = "disabled"; }; + iomux@020e0000 { status = "disabled"; }; + gpio@0209c000 { status = "okay"; }; + gpio@020a0000 { status = "okay"; }; + gpio@020a4000 { status = "okay"; }; + gpio@020a8000 { status = "okay"; }; + gpio@020aC000 { status = "okay"; }; + gpio@020b0000 { status = "okay"; }; + gpio@020b4000 { status = "okay"; }; console:serial@02020000 { status = "okay"; }; serial@021e8000 { status = "disabled"; }; serial@021ec000 { status = "disabled"; }; @@ -58,7 +61,7 @@ usbphy@020ca000 { status = "okay"; }; }; aips@02100000 { /* AIPS2 */ - ethernet@02188000 { + ethernet@02188000 { status = "okay"; phy-mode = "rgmii"; phy-disable-preamble; From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 02:40:37 2014 Return-Path: Delivered-To: svn-src-all@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 64C98D34; Sun, 26 Oct 2014 02:40: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 45948B56; Sun, 26 Oct 2014 02:40: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 s9Q2ebgo091523; Sun, 26 Oct 2014 02:40:37 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q2eZIf091327; Sun, 26 Oct 2014 02:40:35 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260240.s9Q2eZIf091327@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 02:40:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273662 - in stable/10/sys: arm/conf arm/freescale/imx arm/freescale/vybrid boot/fdt/dts/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 02:40:37 -0000 Author: ian Date: Sun Oct 26 02:40:34 2014 New Revision: 273662 URL: https://svnweb.freebsd.org/changeset/base/273662 Log: MFC r268973, r268977: Rename i.MX I2C driver file, enable it on imx6. Added: stable/10/sys/arm/freescale/imx/imx_i2c.c - copied, changed from r268973, head/sys/arm/freescale/imx/imx_i2c.c Deleted: stable/10/sys/arm/freescale/imx/i2c.c Modified: stable/10/sys/arm/conf/IMX6 stable/10/sys/arm/freescale/imx/files.imx51 stable/10/sys/arm/freescale/imx/files.imx53 stable/10/sys/arm/freescale/imx/files.imx6 stable/10/sys/arm/freescale/vybrid/vf_i2c.c stable/10/sys/boot/fdt/dts/arm/imx6.dtsi Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/IMX6 ============================================================================== --- stable/10/sys/arm/conf/IMX6 Sun Oct 26 02:37:42 2014 (r273661) +++ stable/10/sys/arm/conf/IMX6 Sun Oct 26 02:40:34 2014 (r273662) @@ -154,8 +154,8 @@ options FREEBSD_BOOT_LOADER # Process # SoC-specific devices device ffec # Freescale Fast Ethernet Controller -#device fsliic # Freescale i2c/iic (not ready yet) -#device iic # iic protocol -#device iicbus # iic bus +device fsliic # Freescale i2c/iic +device iic # iic protocol +device iicbus # iic bus #device imxwdt # Watchdog. WARNING: can't be disabled!!! Modified: stable/10/sys/arm/freescale/imx/files.imx51 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx51 Sun Oct 26 02:37:42 2014 (r273661) +++ stable/10/sys/arm/freescale/imx/files.imx51 Sun Oct 26 02:40:34 2014 (r273662) @@ -44,7 +44,7 @@ dev/usb/controller/ehci_imx.c optional arm/freescale/imx/imx_wdog.c optional imxwdt # i2c -arm/freescale/imx/i2c.c optional fsliic +arm/freescale/imx/imx_i2c.c optional fsliic # IPU - Image Processing Unit (frame buffer also) arm/freescale/imx/imx51_ipuv3.c optional sc Modified: stable/10/sys/arm/freescale/imx/files.imx53 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx53 Sun Oct 26 02:37:42 2014 (r273661) +++ stable/10/sys/arm/freescale/imx/files.imx53 Sun Oct 26 02:40:34 2014 (r273662) @@ -47,7 +47,7 @@ dev/usb/controller/ehci_imx.c optional arm/freescale/imx/imx_wdog.c optional imxwdt # i2c -arm/freescale/imx/i2c.c optional fsliic +arm/freescale/imx/imx_i2c.c optional fsliic # IPU - Image Processing Unit (frame buffer also) arm/freescale/imx/imx51_ipuv3.c optional sc Modified: stable/10/sys/arm/freescale/imx/files.imx6 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx6 Sun Oct 26 02:37:42 2014 (r273661) +++ stable/10/sys/arm/freescale/imx/files.imx6 Sun Oct 26 02:40:34 2014 (r273662) @@ -27,6 +27,7 @@ arm/freescale/imx/imx6_pl310.c standard arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx_gpt.c standard arm/freescale/imx/imx_gpio.c optional gpio +arm/freescale/imx/imx_i2c.c optional fsliic # # Optional devices. @@ -52,5 +53,4 @@ arm/freescale/imx/imx6_usbphy.c optiona # #arm/freescale/imx/imx51_iomux.c optional iomux #dev/ata/chipsets/ata-fsl.c optional imxata -#arm/freescale/imx/i2c.c optional fsliic #arm/freescale/imx/imx51_ipuv3.c optional sc Copied and modified: stable/10/sys/arm/freescale/imx/imx_i2c.c (from r268973, head/sys/arm/freescale/imx/imx_i2c.c) ============================================================================== --- head/sys/arm/freescale/imx/imx_i2c.c Tue Jul 22 03:59:14 2014 (r268973, copy source) +++ stable/10/sys/arm/freescale/imx/imx_i2c.c Sun Oct 26 02:40:34 2014 (r273662) @@ -86,6 +86,12 @@ __FBSDID("$FreeBSD$"); #define debugf(fmt, args...) #endif +static struct ofw_compat_data compat_data[] = { + {"fsl,imx6q-i2c", 1}, + {"fsl,imx-i2c", 1}, + {NULL, 0} +}; + struct i2c_softc { device_t dev; device_t iicbus; @@ -227,7 +233,7 @@ i2c_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "fsl,imx-i2c")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); sc = device_get_softc(dev); @@ -246,7 +252,7 @@ i2c_probe(device_t dev) /* Enable I2C */ i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN); bus_release_resource(dev, SYS_RES_MEMORY, sc->rid, sc->res); - device_set_desc(dev, "I2C bus controller"); + device_set_desc(dev, "Freescale i.MX I2C bus controller"); return (BUS_PROBE_DEFAULT); } Modified: stable/10/sys/arm/freescale/vybrid/vf_i2c.c ============================================================================== --- stable/10/sys/arm/freescale/vybrid/vf_i2c.c Sun Oct 26 02:37:42 2014 (r273661) +++ stable/10/sys/arm/freescale/vybrid/vf_i2c.c Sun Oct 26 02:40:34 2014 (r273662) @@ -30,7 +30,7 @@ */ /* - * This driver is based on the I2C driver for IMX (imx/i2c.c). + * This driver is based on the I2C driver for i.MX */ #include Modified: stable/10/sys/boot/fdt/dts/arm/imx6.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/imx6.dtsi Sun Oct 26 02:37:42 2014 (r273661) +++ stable/10/sys/boot/fdt/dts/arm/imx6.dtsi Sun Oct 26 02:40:34 2014 (r273662) @@ -338,6 +338,27 @@ reg = <0x02100000 0x00100000>; ranges; + i2c1: i2c@021a0000 { + compatible = "fsl,imx6q-i2c"; + reg = <0x021a0000 0x4000>; + interrupts = < 68 >; + status = "disabled"; + }; + + i2c2: i2c@021a4000 { + compatible = "fsl,imx6q-i2c"; + reg = <0x021a4000 0x4000>; + interrupts = < 69 >; + status = "disabled"; + }; + + i2c3: i2c@021ac000 { + compatible = "fsl,imx6q-i2c"; + reg = <0x021a8000 0x4000>; + interrupts = < 70 >; + status = "disabled"; + }; + fec1: ethernet@02188000 { compatible = "fsl,imx6q-fec"; reg = <0x02188000 0x4000>; From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 02:44:44 2014 Return-Path: Delivered-To: svn-src-all@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 AB792E87; Sun, 26 Oct 2014 02:44: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 94B37BED; Sun, 26 Oct 2014 02:44: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 s9Q2iiNt095299; Sun, 26 Oct 2014 02:44:44 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q2igH3095279; Sun, 26 Oct 2014 02:44:42 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260244.s9Q2igH3095279@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 02:44:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273663 - in stable/10/sys: arm/conf arm/freescale/imx boot/fdt/dts/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 02:44:44 -0000 Author: ian Date: Sun Oct 26 02:44:41 2014 New Revision: 273663 URL: https://svnweb.freebsd.org/changeset/base/273663 Log: MFC r271097, r271100, r271101, r271102, r271124: - Add a basic iomux driver for imx6. - Implement the same public interface in imx51 and imx6 iomux - The iomux driver is no longer optional, remove it from kernel configs. - Implement the imx_iomux_get/set_gpr() interface for imx6. - Stop setting the iomux device status to disabled, now that we have a driver. Added: stable/10/sys/arm/freescale/imx/imx6_iomux.c - copied, changed from r271097, head/sys/arm/freescale/imx/imx6_iomux.c stable/10/sys/arm/freescale/imx/imx6_iomuxreg.h - copied unchanged from r271097, head/sys/arm/freescale/imx/imx6_iomuxreg.h Deleted: stable/10/sys/arm/freescale/imx/imx51_iomuxvar.h Modified: stable/10/sys/arm/conf/DIGI-CCWMX53 stable/10/sys/arm/conf/EFIKA_MX stable/10/sys/arm/conf/IMX53-QSB stable/10/sys/arm/conf/IMX6 stable/10/sys/arm/freescale/imx/files.imx51 stable/10/sys/arm/freescale/imx/files.imx53 stable/10/sys/arm/freescale/imx/files.imx6 stable/10/sys/arm/freescale/imx/imx51_iomux.c stable/10/sys/arm/freescale/imx/imx_iomuxvar.h stable/10/sys/boot/fdt/dts/arm/imx6.dtsi stable/10/sys/boot/fdt/dts/arm/wandboard-dual.dts stable/10/sys/boot/fdt/dts/arm/wandboard-quad.dts stable/10/sys/boot/fdt/dts/arm/wandboard-solo.dts Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/DIGI-CCWMX53 ============================================================================== --- stable/10/sys/arm/conf/DIGI-CCWMX53 Sun Oct 26 02:40:34 2014 (r273662) +++ stable/10/sys/arm/conf/DIGI-CCWMX53 Sun Oct 26 02:44:41 2014 (r273663) @@ -120,8 +120,6 @@ device atapci # Only for helper funct device imxata options ATA_STATIC_ID # Static device numbering -device iomux # IO Multiplexor - device gpio device gpioled Modified: stable/10/sys/arm/conf/EFIKA_MX ============================================================================== --- stable/10/sys/arm/conf/EFIKA_MX Sun Oct 26 02:40:34 2014 (r273662) +++ stable/10/sys/arm/conf/EFIKA_MX Sun Oct 26 02:44:41 2014 (r273663) @@ -116,8 +116,6 @@ device atapci # Only for helper funct device imxata options ATA_STATIC_ID # Static device numbering -device iomux # IO Multiplexor - device gpio device gpioled Modified: stable/10/sys/arm/conf/IMX53-QSB ============================================================================== --- stable/10/sys/arm/conf/IMX53-QSB Sun Oct 26 02:40:34 2014 (r273662) +++ stable/10/sys/arm/conf/IMX53-QSB Sun Oct 26 02:44:41 2014 (r273663) @@ -119,8 +119,6 @@ options ALT_BREAK_TO_DEBUGGER #device imxata #options ATA_STATIC_ID # Static device numbering -device iomux # IO Multiplexor - device gpio device gpioled Modified: stable/10/sys/arm/conf/IMX6 ============================================================================== --- stable/10/sys/arm/conf/IMX6 Sun Oct 26 02:40:34 2014 (r273662) +++ stable/10/sys/arm/conf/IMX6 Sun Oct 26 02:44:41 2014 (r273663) @@ -80,7 +80,6 @@ device md # Memory "disks" device ether # Ethernet support device miibus # Required for ethernet device bpf # Berkeley packet filter (required for DHCP) -#device iomux # IO Multiplexor # General-purpose input/output device gpio Modified: stable/10/sys/arm/freescale/imx/files.imx51 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx51 Sun Oct 26 02:40:34 2014 (r273662) +++ stable/10/sys/arm/freescale/imx/files.imx51 Sun Oct 26 02:44:41 2014 (r273663) @@ -19,7 +19,7 @@ arm/freescale/imx/bus_space.c standard arm/freescale/imx/tzic.c standard # IOMUX - external pins multiplexor -arm/freescale/imx/imx51_iomux.c optional iomux +arm/freescale/imx/imx51_iomux.c standard # GPIO arm/freescale/imx/imx_gpio.c optional gpio Modified: stable/10/sys/arm/freescale/imx/files.imx53 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx53 Sun Oct 26 02:40:34 2014 (r273662) +++ stable/10/sys/arm/freescale/imx/files.imx53 Sun Oct 26 02:44:41 2014 (r273663) @@ -22,7 +22,7 @@ dev/uart/uart_dev_imx.c optional uart arm/freescale/imx/tzic.c standard # IOMUX - external pins multiplexor -arm/freescale/imx/imx51_iomux.c optional iomux +arm/freescale/imx/imx51_iomux.c standard # GPIO arm/freescale/imx/imx_gpio.c optional gpio Modified: stable/10/sys/arm/freescale/imx/files.imx6 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx6 Sun Oct 26 02:40:34 2014 (r273662) +++ stable/10/sys/arm/freescale/imx/files.imx6 Sun Oct 26 02:44:41 2014 (r273663) @@ -19,11 +19,12 @@ arm/freescale/imx/bus_space.c standard arm/arm/mpcore_timer.c standard arm/freescale/fsl_ocotp.c standard arm/freescale/imx/imx6_anatop.c standard -arm/freescale/imx/imx_common.c standard arm/freescale/imx/imx6_ccm.c standard +arm/freescale/imx/imx6_iomux.c standard arm/freescale/imx/imx6_machdep.c standard arm/freescale/imx/imx6_mp.c optional smp arm/freescale/imx/imx6_pl310.c standard +arm/freescale/imx/imx_common.c standard arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx_gpt.c standard arm/freescale/imx/imx_gpio.c optional gpio @@ -51,6 +52,4 @@ arm/freescale/imx/imx6_usbphy.c optiona # # Not ready yet... # -#arm/freescale/imx/imx51_iomux.c optional iomux -#dev/ata/chipsets/ata-fsl.c optional imxata #arm/freescale/imx/imx51_ipuv3.c optional sc Modified: stable/10/sys/arm/freescale/imx/imx51_iomux.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx51_iomux.c Sun Oct 26 02:40:34 2014 (r273662) +++ stable/10/sys/arm/freescale/imx/imx51_iomux.c Sun Oct 26 02:44:41 2014 (r273663) @@ -75,8 +75,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include "imx51_iomuxreg.h" #define IOMUX_WRITE(_sc, _r, _v) \ @@ -177,45 +176,23 @@ iomux_set_pad(unsigned int pin, unsigned iomux_set_pad_sub(iomuxsc, pin, config); } -#ifdef notyet -void -iomux_set_input(unsigned int input, unsigned int config) +static uint32_t +iomux_get_pad_config_sub(struct iomux_softc *sc, uint32_t pin) { - bus_size_t input_ctl_reg = input; - - bus_space_write_4(iomuxsc->iomux_memt, iomuxsc->iomux_memh, - input_ctl_reg, config); -} -#endif + bus_size_t pad_reg = IOMUX_PIN_TO_PAD_ADDRESS(pin); + uint32_t result; -void -iomux_mux_config(const struct iomux_conf *conflist) -{ - int i; + result = IOMUX_READ(sc, pad_reg); - if (iomuxsc == NULL) - return; - for (i = 0; conflist[i].pin != IOMUX_CONF_EOT; i++) { - iomux_set_pad_sub(iomuxsc, conflist[i].pin, conflist[i].pad); - iomux_set_function_sub(iomuxsc, conflist[i].pin, - conflist[i].mux); - } + return(result); } -#ifdef notyet -void -iomux_input_config(const struct iomux_input_conf *conflist) +unsigned int +iomux_get_pad_config(unsigned int pin) { - int i; - if (iomuxsc == NULL) - return; - for (i = 0; conflist[i].inout != -1; i++) { - iomux_set_inout(iomuxsc, conflist[i].inout, - conflist[i].inout_mode); - } + return(iomux_get_pad_config_sub(iomuxsc, pin)); } -#endif uint32_t imx_iomux_gpr_get(u_int regnum) @@ -268,5 +245,5 @@ static driver_t imx_iomux_driver = { static devclass_t imx_iomux_devclass; EARLY_DRIVER_MODULE(imx_iomux, simplebus, imx_iomux_driver, - imx_iomux_devclass, 0, 0, BUS_PASS_BUS - 1); + imx_iomux_devclass, 0, 0, BUS_PASS_CPU + BUS_PASS_ORDER_LATE); Copied and modified: stable/10/sys/arm/freescale/imx/imx6_iomux.c (from r271097, head/sys/arm/freescale/imx/imx6_iomux.c) ============================================================================== --- head/sys/arm/freescale/imx/imx6_iomux.c Thu Sep 4 14:25:32 2014 (r271097, copy source) +++ stable/10/sys/arm/freescale/imx/imx6_iomux.c Sun Oct 26 02:44:41 2014 (r273663) @@ -166,6 +166,42 @@ iomux_get_pad_config(unsigned int pin) return(iomux_get_pad_config_sub(iomuxsc, pin)); } + +uint32_t +imx_iomux_gpr_get(u_int regnum) +{ + + KASSERT(iomuxsc != NULL, ("imx_iomux_gpr_get() called before attach")); + KASSERT(regnum >= 0 && regnum <= 13, + ("imx_iomux_gpr_get bad regnum %u", regnum)); + return (IOMUX_READ(iomuxsc, IOMUXC_GPR0 + regnum)); +} + +void +imx_iomux_gpr_set(u_int regnum, uint32_t val) +{ + + KASSERT(iomuxsc != NULL, ("imx_iomux_gpr_set() called before attach")); + KASSERT(regnum >= 0 && regnum <= 13, + ("imx_iomux_gpr_set bad regnum %u", regnum)); + IOMUX_WRITE(iomuxsc, IOMUXC_GPR0 + regnum, val); +} + +void +imx_iomux_gpr_set_masked(u_int regnum, uint32_t clrbits, uint32_t setbits) +{ + uint32_t val; + + KASSERT(iomuxsc != NULL, + ("imx_iomux_gpr_set_masked called before attach")); + KASSERT(regnum >= 0 && regnum <= 13, + ("imx_iomux_gpr_set_masked bad regnum %u", regnum)); + + val = IOMUX_READ(iomuxsc, IOMUXC_GPR0 + regnum); + val = (val & ~clrbits) | setbits; + IOMUX_WRITE(iomuxsc, IOMUXC_GPR0 + regnum, val); +} + static device_method_t imx6_iomux_methods[] = { /* Device interface */ DEVMETHOD(device_probe, imx6_iomux_probe), Copied: stable/10/sys/arm/freescale/imx/imx6_iomuxreg.h (from r271097, head/sys/arm/freescale/imx/imx6_iomuxreg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/imx/imx6_iomuxreg.h Sun Oct 26 02:44:41 2014 (r273663, copy of r271097, head/sys/arm/freescale/imx/imx6_iomuxreg.h) @@ -0,0 +1,798 @@ +/*- + * Copyright (c) 2014 Boris Samorodov + * 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$ + */ + +/* + * Pad : pin ("pin" is used at electric schemes, + * while at HW SOC it's named "pad"). + * Drive strength : the current that can be drawn with + * appropriate voltage (varies inversely with + * the supply impedance of the output pin). + * Drive strength enable (DSE) : The value of the current the pin uses. + * HiZ (HYZ) : high input impedance value. + * Daisy chain (DAISY) : the one after another interconnection of + * devices. + * On die termination (ODT) : the termination resistor for impedance + * matching. + * Software input on (SION) : the value to force the pin to be an input + * one (i.e. to force the pin state reading). + * Hysteresis (HYS) : Controls if the value of the input pin + * remains the same until a sufficient change + * is applied. + * Slow rate enable (SRE) : How slow the pin value changes (slow rate + * saves power). + * Open drain enable (ODE) : If the input pin drains on low input or + * goes down. + * Pull/keep enable (PKE) : Enables pull/keep functionality. + * PUll/keep select (PUE) : Selects if the pin is pullup/pulldown one + * or remains it's previous role. + * A note: I'm not sure why it's not PKS... + * Pullup (Pic.1)/pulldown (Pic.2): the pin's resistor connected to VCC (GND) + * to prevent random value drai. + * Pullup/pulldown select (PUS) : Selects the value of pullup/pulldown + * resistor. + * Open drain (Pic.3) : the output signal is applied to the base + * of a transistor whose collector is used + * as a pin. + * + * VCC o VCC o Open drain + * | | ----> pin + * +++ o| / + * | | R | Switch / + * +++ pullup o| .---. + * | | / |/ \ + * >---+------> Pin >---+------> Pin >---{--| ) + * | | \ |\ / + * o| +++ `--v' + * | Switch | | R \ + * o| +++ pulldown | + * | | | + * ----- ----- ----- + * --- --- --- + * - - - + * + * Pic.1 Pic.2 Pic.3 + */ + +#ifndef IMX6_IOMUXREG_H +#define IMX6_IOMUXREG_H + +/* + * Multiplex control + */ +#define IOMUXC_MUX_CTL 0x004c +#define IOMUX_CONFIG_SION (1<<4) +#define IOMUX_CONFIG_ALT0 0 +#define IOMUX_CONFIG_ALT1 1 +#define IOMUX_CONFIG_ALT2 2 +#define IOMUX_CONFIG_ALT3 3 +#define IOMUX_CONFIG_ALT4 4 +#define IOMUX_CONFIG_ALT5 5 +#define IOMUX_CONFIG_ALT6 6 +#define IOMUX_CONFIG_ALT7 7 + +/* + * Pad control + */ +#define IOMUXC_PAD_CTL 0x0360 + /* DDR Select Field */ +#define PAD_CTL_DDR_SEL_0 (0x0<<18) +#define PAD_CTL_DDR_SEL_1 (0x1<<18) +#define PAD_CTL_DDR_SEL_2 (0x2<<18) +#define PAD_CTL_DDR_SEL_3 (0x3<<18) +#define PAD_CTL_DDR_INPUT (0x1<<17) /* DDR/CMOS Input Mode Field */ +#define PAD_CTL_HYS (1<<16) /* Hysteresis Enable Field */ + /* PullUp/Down Config Field: */ +#define PAD_CTL_PUS_100K_PD (0x0<<14) /* 100K Ohm Pull Down */ +#define PAD_CTL_PUS_47K_PU (0x1<<14) /* 47K Ohn Pull Up */ +#define PAD_CTL_PUS_100K_PU (0x2<<14) /* 100K Ohm Pull Up */ +#define PAD_CTL_PUS_22K_PU (0x3<<14) /* 22K Ohm Pull Up */ +#define PAD_CTL_PUE (1<<13) /* Pull/Keep Select Field */ +#define PAD_CTL_PKE (1<<12) /* Pull/Keep Enable Field */ +#define PAD_CTL_ODE (1<<11) /* Open Drain Enable Field */ + /* On Die Termination Field: */ +#define PAD_CTL_ODT_DISABLED (0x0<<8) /* Disabled */ +#define PAD_CTL_ODT_1 (0x1<<8) +#define PAD_CTL_ODT_2 (0x2<<8) +#define PAD_CTL_ODT_3 (0x3<<8) +#define PAD_CTL_ODT_4 (0x4<<8) +#define PAD_CTL_ODT_5 (0x5<<8) +#define PAD_CTL_ODT_6 (0x6<<8) +#define PAD_CTL_ODT_7 (0x7<<8) + /* Speed Field: */ +#define PAD_CTL_SPEED_RESERVED0 (0x0<<6) /* RESERVED */ +#define PAD_CTL_SPEED_50_MHZ (0x1<<6) /* 50 MHz */ +#define PAD_CTL_SPEED_100_MHZ (0x2<<6) /* 100 MHz */ +#define PAD_CTL_SPEED_200_MHZ (0x3<<6) /* 200 MHz */ + /* Drive Strength Field */ +#define PAD_CTL_DSE_HIZ (0x0<<3) /* HI-Z */ +#define PAD_CTL_DSE_1 (0x1<<3) +#define PAD_CTL_DSE_2 (0x2<<3) +#define PAD_CTL_DSE_3 (0x3<<3) +#define PAD_CTL_DSE_4 (0x4<<3) +#define PAD_CTL_DSE_5 (0x5<<3) +#define PAD_CTL_DSE_6 (0x6<<3) +#define PAD_CTL_DSE_7 (0x7<<3) +#define PAD_CTL_SRE (0x1<<0) /* Slew rate Field */ + +/* + * Input control + */ +#define IOMUXC_INPUT_CTL 0x07b0 /* input control */ +#define INPUT_DAISY_0 0 +#define INPUT_DAISY_1 1 +#define INPUT_DAISY_2 2 +#define INPUT_DAISY_3 3 +#define INPUT_DAISY_4 4 +#define INPUT_DAISY_5 5 +#define INPUT_DAISY_6 6 +#define INPUT_DAISY_7 7 + +/* + * IOMUX index + */ +#define IOMUX_PIN_TO_MUX_ADDRESS(pin) (((pin) >> 16) & 0xffff) +#define IOMUX_PIN_TO_PAD_ADDRESS(pin) (((pin) >> 0) & 0xffff) +#define IOMUX_PIN(mux_adr, pad_adr) \ + (((mux_adr) << 16) | (((pad_adr) << 0))) +#define IOMUX_MUX_NONE 0xffff +#define IOMUX_PAD_NONE 0xffff + +/* + * MUX & PAD Control + */ +#define MUX_PIN(name) \ + IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_##name, \ + IOMUXC_SW_PAD_CTL_PAD_##name) + +#define MUX_PIN_MUX(name) \ + IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_##name, IOMUX_PAD_NONE) + +#define MUX_PIN_PAD(name) \ + IOMUX_PIN(IOMUX_MUX_NONE, IOMUXC_SW_PAD_CTL_PAD_##name) + +#define MUX_PIN_GRP(name) \ + IOMUX_PIN(IOMUX_MUX_NONE, IOMUXC_SW_PAD_CTL_GRP_##name) + +#define MUX_PIN_PATH(name) \ + IOMUX_PIN(IOMUXC_##name##_SELECT_INPUT, IOMUX_MUX_NONE) + +/* + * INPUT Control + */ +#define MUX_SELECT(name) (name##_SELECT_INPUT) + +/* + * Register names, offset addresses (and reset values for reference) + * from Chapter 36 IOMUX Controller (IOMUXC), IMX6DQRM, Rev.1, 04/2013 + * + * General Purpose Registers + */ +#define IOMUXC_GPR0 0x0000 /* 0x00000000 */ +#define IOMUXC_GPR1 0x0004 /* 0x48400005 */ +#define IOMUXC_GPR2 0x0008 /* 0x00000000 */ +#define IOMUXC_GPR3 0x000c /* 0x01e00000 */ +#define IOMUXC_GPR4 0x0010 /* 0x00000000 */ +#define IOMUXC_GPR5 0x0014 /* 0x00000000 */ +#define IOMUXC_GPR6 0x0018 /* 0x22222222 */ +#define IOMUXC_GPR7 0x001c /* 0x22222222 */ +#define IOMUXC_GPR8 0x0020 /* 0x00000000 */ +#define IOMUXC_GPR9 0x0024 /* 0x00000000 */ +#define IOMUXC_GPR10 0x0028 /* 0x00003800 */ +#define IOMUXC_GPR11 0x002c /* 0x00003800 */ +#define IOMUXC_GPR12 0x0030 /* 0x0f000000 */ +#define IOMUXC_GPR13 0x0034 /* 0x059124c4 */ +/* + * Pad Mux Registers + */ +#define IOMUXC_SW_MUX_CTL_PAD_SD2_DATA1 0x004c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD2_DATA2 0x0050 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD2_DATA0 0x0054 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_TXC 0x0058 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_TD0 0x005c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_TD1 0x0060 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_TD2 0x0064 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_TD3 0x0068 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_RX_CTL 0x006c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_RD0 0x0070 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_TX_CTL 0x0074 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_RD1 0x0078 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_RD2 0x007c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_RD3 0x0080 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_RXC 0x0084 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_ADDR25 0x0088 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_EB2_B 0x008c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA16 0x0090 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA17 0x0094 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA18 0x0098 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA19 0x009c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA20 0x00a0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA21 0x00a4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA22 0x00a8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA23 0x00ac /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_EB3_B 0x00b0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA24 0x00b4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA25 0x00b8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA26 0x00bc /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA27 0x00c0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA28 0x00c4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA29 0x00c8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA30 0x00cc /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA31 0x00d0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_ADDR24 0x00d4 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_ADDR23 0x00d8 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_ADDR22 0x00dc /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_ADDR21 0x00e0 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_ADDR20 0x00e4 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_ADDR19 0x00e8 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_ADDR18 0x00ec /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_ADDR17 0x00f0 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_ADDR16 0x00f4 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_CS0_B 0x00f8 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_CS1_B 0x00fc /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_OE_B 0x0100 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_RW 0x0104 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_LBA_B 0x0108 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_EB0_B 0x010c /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_EB1_B 0x0110 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD00 0x0114 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD01 0x0118 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD02 0x011c /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD03 0x0120 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD04 0x0124 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD05 0x0128 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD06 0x012c /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD07 0x0130 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD08 0x0134 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD09 0x0138 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD10 0x013c /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD11 0x0140 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD12 0x0144 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD13 0x0148 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD14 0x014c /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD15 0x0150 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_WAIT_B 0x0154 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_BCLK 0x0158 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_DI0_DISP_CLK 0x015c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DI0_PIN15 0x0160 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DI0_PIN02 0x0164 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DI0_PIN03 0x0168 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DI0_PIN04 0x016c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA00 0x0170 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA01 0x0174 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA02 0x0178 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA03 0x017c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA04 0x0180 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA05 0x0184 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA06 0x0188 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA07 0x018c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA08 0x0190 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA09 0x0194 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA10 0x0198 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA11 0x019c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA12 0x01a0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA13 0x01a4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA14 0x01a8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA15 0x01ac /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA16 0x01b0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA17 0x01b4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA18 0x01b8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA19 0x01bc /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA20 0x01c0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA21 0x01c4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA22 0x01c8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA23 0x01cc /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_ENET_MDIO 0x01d0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_ENET_REF_CLK 0x01d4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_ENET_RX_ER 0x01d8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_ENET_CRS_DV 0x01dc /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_ENET_RX_DATA1 0x01e0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_ENET_RX_DATA0 0x01e4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_ENET_TX_EN 0x01e8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_ENET_TX_DATA1 0x01ec /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_ENET_TX_DATA0 0x01f0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_ENET_MDC 0x01f4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_KEY_COL0 0x01f8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_KEY_ROW0 0x01fc /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_KEY_COL1 0x0200 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_KEY_ROW1 0x0204 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_KEY_COL2 0x0208 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_KEY_ROW2 0x020c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_KEY_COL3 0x0210 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_KEY_ROW3 0x0214 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_KEY_COL4 0x0218 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_KEY_ROW4 0x021c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO00 0x0220 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO01 0x0224 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO09 0x0228 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO03 0x022c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO06 0x0230 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO02 0x0234 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO04 0x0238 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO05 0x023c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO07 0x0240 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO08 0x0244 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO16 0x0248 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO17 0x024c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO18 0x0250 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO19 0x0254 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_PIXCLK 0x0258 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_HSYNC 0x025c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA_EN 0x0260 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_VSYNC 0x0264 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA04 0x0268 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA05 0x026c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA06 0x0270 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA07 0x0274 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA08 0x0278 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA09 0x027c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA10 0x0280 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA11 0x0284 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA12 0x0288 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA13 0x028c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA14 0x0290 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA15 0x0294 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA16 0x0298 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA17 0x029c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA18 0x02a0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA19 0x02a4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_DATA7 0x02a8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_DATA6 0x02ac /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_DATA5 0x02b0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_DATA4 0x02b4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_CMD 0x02b8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_CLK 0x02bc /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_DATA0 0x02c0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_DATA1 0x02c4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_DATA2 0x02c8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_DATA3 0x02cc /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_RESET 0x02d0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_CLE 0x02d4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_ALE 0x02d8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_WP_B 0x02dc /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_READY_B 0x02e0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_CS0_B 0x02e4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_CS1_B 0x02e8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_CS2_B 0x02ec /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_CS3_B 0x02f0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD4_CMD 0x02f4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD4_CLK 0x02f8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_DATA00 0x02fc /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_DATA01 0x0300 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_DATA02 0x0304 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_DATA03 0x0308 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_DATA04 0x030c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_DATA05 0x0310 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_DATA06 0x0314 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_DATA07 0x0318 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD4_DATA0 0x031c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD4_DATA1 0x0320 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD4_DATA2 0x0324 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD4_DATA3 0x0328 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD4_DATA4 0x032c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD4_DATA5 0x0330 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD4_DATA6 0x0334 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD4_DATA7 0x0338 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD1_DATA1 0x033c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD1_DATA0 0x0340 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD1_DATA3 0x0344 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD1_CMD 0x0348 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD1_DATA2 0x034c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD1_CLK 0x0350 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD2_CLK 0x0354 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD2_CMD 0x0358 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD2_DATA3 0x035c /* 0x00000005 */ +/* + * Pad Control registers + */ +#define IOMUXC_SW_PAD_CTL_PAD_SD2_DATA1 0x0360 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD2_DATA2 0x0364 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD2_DATA0 0x0368 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_TXC 0x036c /* 0x00013030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_TD0 0x0370 /* 0x0001b030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_TD1 0x0374 /* 0x0001b030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_TD2 0x0378 /* 0x0001b030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_TD3 0x037c /* 0x0001b030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_RX_CTL 0x0380 /* 0x00013030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_RD0 0x0384 /* 0x0001b030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_TX_CTL 0x0388 /* 0x00013030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_RD1 0x038c /* 0x0001b030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_RD2 0x0390 /* 0x0001b030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_RD3 0x0394 /* 0x0001b030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_RXC 0x0398 /* 0x00013030 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_ADDR25 0x039c /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_EB2_B 0x03a0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA16 0x03a4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA17 0x03a8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA18 0x03ac /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA19 0x03b0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA20 0x03b4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA21 0x03b8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA22 0x03bc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA23 0x03c0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_EB3_B 0x03c4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA24 0x03c8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA25 0x03cc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA26 0x03d0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA27 0x03d4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA28 0x03d8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA29 0x03dc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA30 0x03e0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA31 0x03e4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_ADDR24 0x03e8 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_ADDR23 0x03ec /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_ADDR22 0x03f0 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_ADDR21 0x03f4 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_ADDR20 0x03f8 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_ADDR19 0x03fc /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_ADDR18 0x0400 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_ADDR17 0x0404 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_ADDR16 0x0408 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_CS0_B 0x040c /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_CS1_B 0x0410 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_OE_B 0x0414 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_RW 0x0418 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_LBA_B 0x041c /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_EB0_B 0x0420 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_EB1_B 0x0424 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD00 0x0428 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD01 0x042c /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD02 0x0430 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD03 0x0434 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD04 0x0438 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD05 0x043c /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD06 0x0440 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD07 0x0444 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD08 0x0448 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD09 0x044c /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD10 0x0450 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD11 0x0454 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD12 0x0458 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD13 0x045c /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD14 0x0460 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD15 0x0464 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_WAIT_B 0x0468 /* 0x0000b060 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_BCLK 0x046c /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_DI0_DISP_CLK 0x0470 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DI0_PIN15 0x0474 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DI0_PIN02 0x0478 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DI0_PIN03 0x047c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DI0_PIN04 0x0480 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA00 0x0484 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA01 0x0488 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA02 0x048c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA03 0x0490 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA04 0x0494 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA05 0x0498 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA06 0x049c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA07 0x04a0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA08 0x04a4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA09 0x04a8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA10 0x04ac /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA11 0x04b0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA12 0x04b4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA13 0x04b8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA14 0x04bc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA15 0x04c0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA16 0x04c4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA17 0x04c8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA18 0x04cc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA19 0x04d0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA20 0x04d4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA21 0x04d8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA22 0x04dc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA23 0x04e0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_ENET_MDIO 0x04e4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_ENET_REF_CLK 0x04e8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_ENET_RX_ER 0x04ec /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_ENET_CRS_DV 0x04f0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_ENET_RX_DATA1 0x04f4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_ENET_RX_DATA0 0x04f8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_ENET_TX_EN 0x04fc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_ENET_TX_DATA1 0x0500 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_ENET_TX_DATA0 0x0504 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_ENET_MDC 0x0508 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS5_P 0x050c /* 0x00002030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM5 0x0510 /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM4 0x0514 /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS4_P 0x0518 /* 0x00002030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS3_P 0x051c /* 0x00002030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM3 0x0520 /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS2_P 0x0524 /* 0x00002030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM2 0x0528 /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR00 0x052c /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR01 0x0530 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR02 0x0534 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR03 0x0538 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR04 0x053c /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR05 0x0540 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR06 0x0544 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR07 0x0548 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR08 0x054c /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR09 0x0550 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR10 0x0554 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR11 0x0558 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR12 0x055c /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR13 0x0560 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR14 0x0564 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR15 0x0568 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_CAS_B 0x056c /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_CS0_B 0x0570 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_CS1_B 0x0574 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_RAS_B 0x0578 /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_RESET 0x057c /* 0x00083030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDBA0 0x0580 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDBA1 0x0584 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDCLK0_P 0x0588 /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDBA2 0x058c /* 0x0000b000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDCKE0 0x0590 /* 0x00003000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDCLK1_P 0x0594 /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDCKE1 0x0598 /* 0x00003000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ODT0 0x059c /* 0x00003030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ODT1 0x05a0 /* 0x00003030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDWE_B 0x05a4 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS0_P 0x05a8 /* 0x00002030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM0 0x05ac /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS1_P 0x05b0 /* 0x00002030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM1 0x05b4 /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS6_P 0x05b8 /* 0x00002030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM6 0x05bc /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS7_P 0x05c0 /* 0x00002030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM7 0x05c4 /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_KEY_COL0 0x05c8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_KEY_ROW0 0x05cc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_KEY_COL1 0x05d0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_KEY_ROW1 0x05d4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_KEY_COL2 0x05d8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_KEY_ROW2 0x05dc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_KEY_COL3 0x05e0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_KEY_ROW3 0x05e4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_KEY_COL4 0x05e8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_KEY_ROW4 0x05ec /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO00 0x05f0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO01 0x05f4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO09 0x05f8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO03 0x05fc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO06 0x0600 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO02 0x0604 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO04 0x0608 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO05 0x060c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO07 0x0610 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO08 0x0614 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO16 0x0618 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO17 0x061c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO18 0x0620 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO19 0x0624 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_PIXCLK 0x0628 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_HSYNC 0x062c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA_EN 0x0630 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_VSYNC 0x0634 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA04 0x0638 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA05 0x063c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA06 0x0640 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA07 0x0644 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA08 0x0648 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA09 0x064c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA10 0x0650 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA11 0x0654 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA12 0x0658 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA13 0x065c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA14 0x0660 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA15 0x0664 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA16 0x0668 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA17 0x066c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA18 0x0670 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA19 0x0674 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_JTAG_TMS 0x0678 /* 0x00007060 */ +#define IOMUXC_SW_PAD_CTL_PAD_JTAG_MOD 0x067c /* 0x0000b060 */ +#define IOMUXC_SW_PAD_CTL_PAD_JTAG_TRSTB 0x0680 /* 0x00007060 */ +#define IOMUXC_SW_PAD_CTL_PAD_JTAG_TDI 0x0684 /* 0x00007060 */ +#define IOMUXC_SW_PAD_CTL_PAD_JTAG_TCK 0x0688 /* 0x00007060 */ +#define IOMUXC_SW_PAD_CTL_PAD_JTAG_TDO 0x068c /* 0x000090b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_DATA7 0x0690 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_DATA6 0x0694 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_DATA5 0x0698 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_DATA4 0x069c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_CMD 0x06a0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_CLK 0x06a4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_DATA0 0x06a8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_DATA1 0x06ac /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_DATA2 0x06b0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_DATA3 0x06b4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_RESET 0x06b8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_CLE 0x06bc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_ALE 0x06c0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_WP_B 0x06c4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_READY_B 0x06c8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_CS0_B 0x06cc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_CS1_B 0x06d0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_CS2_B 0x06d4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_CS3_B 0x06d8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD4_CMD 0x06dc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD4_CLK 0x06e0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_DATA00 0x06e4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_DATA01 0x06e8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_DATA02 0x06ec /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_DATA03 0x06f0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_DATA04 0x06f4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_DATA05 0x06f8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_DATA06 0x06fc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_DATA07 0x0700 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD4_DATA0 0x0704 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD4_DATA1 0x0708 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD4_DATA2 0x070c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD4_DATA3 0x0710 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD4_DATA4 0x0714 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD4_DATA5 0x0718 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD4_DATA6 0x071c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD4_DATA7 0x0720 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD1_DATA1 0x0724 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD1_DATA0 0x0728 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD1_DATA3 0x072c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD1_CMD 0x0730 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD1_DATA2 0x0734 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD1_CLK 0x0738 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD2_CLK 0x073c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD2_CMD 0x0740 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD2_DATA3 0x0744 /* 0x0001b0b0 */ +/* + * Pad Group Control Registers + */ +#define IOMUXC_SW_PAD_CTL_GRP_B7DS 0x0748 /* 0x00000030 */ +#define IOMUXC_SW_PAD_CTL_GRP_ADDDS 0x074c /* 0x00000030 */ +#define IOMUXC_SW_PAD_CTL_GRP_DDRMODE_CTL 0x0750 /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_TERM_CTL0 0x0754 /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_DDRPKE 0x0758 /* 0x00001000 */ +#define IOMUXC_SW_PAD_CTL_GRP_TERM_CTL1 0x075c /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_TERM_CTL2 0x0760 /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_TERM_CTL3 0x0764 /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_DDRPK 0x0768 /* 0x00002000 */ +#define IOMUXC_SW_PAD_CTL_GRP_TERM_CTL4 0x076c /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_DDRHYS 0x0770 /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_DDRMODE 0x0774 /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_TERM_CTL5 0x0778 /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_TERM_CTL6 0x077c /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_TERM_CTL7 0x0780 /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_B0DS 0x0784 /* 0x00000030 */ +#define IOMUXC_SW_PAD_CTL_GRP_B1DS 0x0788 /* 0x00000030 */ +#define IOMUXC_SW_PAD_CTL_GRP_CTLDS 0x078c /* 0x00000030 */ +#define IOMUXC_SW_PAD_CTL_GRP_DDR_TYPE_RGMII 0x0790 /* 0x00080000 */ +#define IOMUXC_SW_PAD_CTL_GRP_B2DS 0x0794 /* 0x00000030 */ +#define IOMUXC_SW_PAD_CTL_GRP_DDR_TYPE 0x0798 /* 0x00080000 */ +#define IOMUXC_SW_PAD_CTL_GRP_B3DS 0x079c /* 0x00000030 */ +#define IOMUXC_SW_PAD_CTL_GRP_B4DS 0x07a0 /* 0x00000030 */ +#define IOMUXC_SW_PAD_CTL_GRP_B5DS 0x07a4 /* 0x00000030 */ +#define IOMUXC_SW_PAD_CTL_GRP_B6DS 0x07a8 /* 0x00000030 */ +#define IOMUXC_SW_PAD_CTL_GRP_RGMII_TERM 0x07ac /* 0x00000000 */ +/* + * Select Input Registers + */ +#define IOMUXC_ASRC_ASRCK_CLOCK_6_SELECT_INPUT 0x07b0 /* 0x00000000 */ +#define IOMUXC_AUD4_INPUT_DA_AMX_SELECT_INPUT 0x07b4 /* 0x00000000 */ +#define IOMUXC_AUD4_INPUT_DB_AMX_SELECT_INPUT 0x07b8 /* 0x00000000 */ +#define IOMUXC_AUD4_INPUT_RXCLK_AMX_SELECT_INPUT 0x07bc /* 0x00000000 */ +#define IOMUXC_AUD4_INPUT_RXFS_AMX_SELECT_INPUT 0x07c0 /* 0x00000000 */ +#define IOMUXC_AUD4_INPUT_TXCLK_AMX_SELECT_INPUT 0x07c4 /* 0x00000000 */ +#define IOMUXC_AUD4_INPUT_TXFS_AMX_SELECT_INPUT 0x07c8 /* 0x00000000 */ +#define IOMUXC_AUD5_INPUT_DA_AMX_SELECT_INPUT 0x07cc /* 0x00000000 */ +#define IOMUXC_AUD5_INPUT_DB_AMX_SELECT_INPUT 0x07d0 /* 0x00000000 */ +#define IOMUXC_AUD5_INPUT_RXCLK_AMX_SELECT_INPUT 0x07d4 /* 0x00000000 */ +#define IOMUXC_AUD5_INPUT_RXFS_AMX_SELECT_INPUT 0x07d8 /* 0x00000000 */ +#define IOMUXC_AUD5_INPUT_TXCLK_AMX_SELECT_INPUT 0x07dc /* 0x00000000 */ +#define IOMUXC_AUD5_INPUT_TXFS_AMX_SELECT_INPUT 0x07e0 /* 0x00000000 */ +#define IOMUXC_FLEXCAN1_RX_SELECT_INPUT 0x07e4 /* 0x00000000 */ +#define IOMUXC_FLEXCAN2_RX_SELECT_INPUT 0x07e8 /* 0x00000000 */ +#define IOMUXC_CCM_PMIC_READY_SELECT_INPUT 0x07f0 /* 0x00000000 */ +#define IOMUXC_ECSPI1_CSPI_CLK_IN_SELECT_INPUT 0x07f4 /* 0x00000000 */ +#define IOMUXC_ECSPI1_MISO_SELECT_INPUT 0x07f8 /* 0x00000000 */ +#define IOMUXC_ECSPI1_MOSI_SELECT_INPUT 0x07fc /* 0x00000000 */ +#define IOMUXC_ECSPI1_SS0_SELECT_INPUT 0x0800 /* 0x00000000 */ +#define IOMUXC_ECSPI1_SS1_SELECT_INPUT 0x0804 /* 0x00000000 */ +#define IOMUXC_ECSPI1_SS2_SELECT_INPUT 0x0808 /* 0x00000000 */ +#define IOMUXC_ECSPI1_SS3_SELECT_INPUT 0x080c /* 0x00000000 */ +#define IOMUXC_ECSPI2_CSPI_CLK_IN_SELECT_INPUT 0x0810 /* 0x00000000 */ +#define IOMUXC_ECSPI2_MISO_SELECT_INPUT 0x0814 /* 0x00000000 */ +#define IOMUXC_ECSPI2_MOSI_SELECT_INPUT 0x0818 /* 0x00000000 */ +#define IOMUXC_ECSPI2_SS0_SELECT_INPUT 0x081c /* 0x00000000 */ +#define IOMUXC_ECSPI2_SS1_SELECT_INPUT 0x0820 /* 0x00000000 */ +#define IOMUXC_ECSPI4_SS0_SELECT_INPUT 0x0824 /* 0x00000000 */ +#define IOMUXC_ECSPI5_CSPI_CLK_IN_SELECT_INPUT 0x0828 /* 0x00000000 */ +#define IOMUXC_ECSPI5_MISO_SELECT_INPUT 0x082c /* 0x00000000 */ +#define IOMUXC_ECSPI5_MOSI_SELECT_INPUT 0x0830 /* 0x00000000 */ +#define IOMUXC_ECSPI5_SS0_SELECT_INPUT 0x0834 /* 0x00000000 */ +#define IOMUXC_ECSPI5_SS1_SELECT_INPUT 0x0838 /* 0x00000000 */ +#define IOMUXC_ENET_REF_CLK_SELECT_INPUT 0x083c /* 0x00000000 */ +#define IOMUXC_ENET_MAC0_MDIO_SELECT_INPUT 0x0840 /* 0x00000000 */ +#define IOMUXC_ENET_MAC0_RX_CLK_SELECT_INPUT 0x0844 /* 0x00000000 */ +#define IOMUXC_ENET_MAC0_RX_DATA0_SELECT_INPUT 0x0848 /* 0x00000000 */ +#define IOMUXC_ENET_MAC0_RX_DATA1_SELECT_INPUT 0x084c /* 0x00000000 */ +#define IOMUXC_ENET_MAC0_RX_DATA2_SELECT_INPUT 0x0850 /* 0x00000000 */ +#define IOMUXC_ENET_MAC0_RX_DATA3_SELECT_INPUT 0x0854 /* 0x00000000 */ +#define IOMUXC_ENET_MAC0_RX_EN_SELECT_INPUT 0x0858 /* 0x00000000 */ +#define IOMUXC_ESAI_RX_FS_SELECT_INPUT 0x085c /* 0x00000000 */ +#define IOMUXC_ESAI_TX_FS_SELECT_INPUT 0x0860 /* 0x00000000 */ +#define IOMUXC_ESAI_RX_HF_CLK_SELECT_INPUT 0x0864 /* 0x00000000 */ +#define IOMUXC_ESAI_TX_HF_CLK_SELECT_INPUT 0x0868 /* 0x00000000 */ +#define IOMUXC_ESAI_RX_CLK_SELECT_INPUT 0x086c /* 0x00000000 */ +#define IOMUXC_ESAI_TX_CLK_SELECT_INPUT 0x0870 /* 0x00000000 */ +#define IOMUXC_ESAI_SDO0_SELECT_INPUT 0x0874 /* 0x00000000 */ +#define IOMUXC_ESAI_SDO1_SELECT_INPUT 0x0878 /* 0x00000000 */ +#define IOMUXC_ESAI_SDO2_SDI3_SELECT_INPUT 0x087c /* 0x00000000 */ +#define IOMUXC_ESAI_SDO3_SDI2_SELECT_INPUT 0x0880 /* 0x00000000 */ +#define IOMUXC_ESAI_SDO4_SDI1_SELECT_INPUT 0x0884 /* 0x00000000 */ +#define IOMUXC_ESAI_SDO5_SDI0_SELECT_INPUT 0x0888 /* 0x00000000 */ +#define IOMUXC_HDMI_ICECIN_SELECT_INPUT 0x088c /* 0x00000000 */ +#define IOMUXC_HDMI_II2C_CLKIN_SELECT_INPUT 0x0890 /* 0x00000000 */ +#define IOMUXC_HDMI_II2C_DATAIN_SELECT_INPUT 0x0894 /* 0x00000000 */ +#define IOMUXC_I2C1_SCL_IN_SELECT_INPUT 0x0898 /* 0x00000000 */ +#define IOMUXC_I2C1_SDA_IN_SELECT_INPUT 0x089c /* 0x00000000 */ +#define IOMUXC_I2C2_SCL_IN_SELECT_INPUT 0x08a0 /* 0x00000000 */ +#define IOMUXC_I2C2_SDA_IN_SELECT_INPUT 0x08a4 /* 0x00000000 */ +#define IOMUXC_I2C3_SCL_IN_SELECT_INPUT 0x08a8 /* 0x00000000 */ +#define IOMUXC_I2C3_SDA_IN_SELECT_INPUT 0x08ac /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA10_SELECT_INPUT 0x08b0 /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA11_SELECT_INPUT 0x08b4 /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA12_SELECT_INPUT 0x08b8 /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA13_SELECT_INPUT 0x08bc /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA14_SELECT_INPUT 0x08c0 /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA15_SELECT_INPUT 0x08c4 /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA16_SELECT_INPUT 0x08c8 /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA17_SELECT_INPUT 0x08cc /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA18_SELECT_INPUT 0x08d0 /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA19_SELECT_INPUT 0x08d4 /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA_EN_SELECT_INPUT 0x08d8 /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_HSYNC_SELECT_INPUT 0x08dc /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_PIX_CLK_SELECT_INPUT 0x08e0 /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_VSYNC_SELECT_INPUT 0x08e4 /* 0x00000000 */ +#define IOMUXC_KEY_COL5_SELECT_INPUT 0x08e8 /* 0x00000000 */ +#define IOMUXC_KEY_COL6_SELECT_INPUT 0x08ec /* 0x00000000 */ +#define IOMUXC_KEY_COL7_SELECT_INPUT 0x08f0 /* 0x00000000 */ +#define IOMUXC_KEY_ROW5_SELECT_INPUT 0x08f4 /* 0x00000000 */ +#define IOMUXC_KEY_ROW6_SELECT_INPUT 0x08f8 /* 0x00000000 */ +#define IOMUXC_KEY_ROW7_SELECT_INPUT 0x08fc /* 0x00000000 */ +#define IOMUXC_MLB_MLB_CLK_IN_SELECT_INPUT 0x0900 /* 0x00000000 */ +#define IOMUXC_MLB_MLB_DATA_IN_SELECT_INPUT 0x0904 /* 0x00000000 */ +#define IOMUXC_MLB_MLB_SIG_IN_SELECT_INPUT 0x0908 /* 0x00000000 */ +#define IOMUXC_SDMA_EVENTS14_SELECT_INPUT 0x090c /* 0x00000000 */ +#define IOMUXC_SDMA_EVENTS15_SELECT_INPUT 0x0910 /* 0x00000000 */ +#define IOMUXC_SPDIF_SPDIF_IN1_SELECT_INPUT 0x0914 /* 0x00000000 */ +#define IOMUXC_SPDIF_TX_CLK2_SELECT_INPUT 0x0918 /* 0x00000000 */ +#define IOMUXC_UART1_UART_RTS_B_SELECT_INPUT 0x091c /* 0x00000000 */ +#define IOMUXC_UART1_UART_RX_DATA_SELECT_INPUT 0x0920 /* 0x00000000 */ +#define IOMUXC_UART2_UART_RTS_B_SELECT_INPUT 0x0924 /* 0x00000000 */ +#define IOMUXC_UART2_UART_RX_DATA_SELECT_INPUT 0x0928 /* 0x00000000 */ +#define IOMUXC_UART3_UART_RTS_B_SELECT_INPUT 0x092c /* 0x00000000 */ +#define IOMUXC_UART3_UART_RX_DATA_SELECT_INPUT 0x0930 /* 0x00000000 */ +#define IOMUXC_UART4_UART_RTS_B_SELECT_INPUT 0x0934 /* 0x00000000 */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 02:51:57 2014 Return-Path: Delivered-To: svn-src-all@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 CF1C5FF8; Sun, 26 Oct 2014 02:51: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 BA9B1C9F; Sun, 26 Oct 2014 02:51: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 s9Q2pv7A000797; Sun, 26 Oct 2014 02:51:57 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q2pvMn000794; Sun, 26 Oct 2014 02:51:57 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260251.s9Q2pvMn000794@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 02:51:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273664 - stable/10/lib/libstand X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 02:51:58 -0000 Author: ian Date: Sun Oct 26 02:51:56 2014 New Revision: 273664 URL: https://svnweb.freebsd.org/changeset/base/273664 Log: MFC r266878, r266879: Add support for snprintf() to libstand. Modified: stable/10/lib/libstand/printf.c stable/10/lib/libstand/stand.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libstand/printf.c ============================================================================== --- stable/10/lib/libstand/printf.c Sun Oct 26 02:44:41 2014 (r273663) +++ stable/10/lib/libstand/printf.c Sun Oct 26 02:51:56 2014 (r273664) @@ -56,8 +56,17 @@ __FBSDID("$FreeBSD$"); #define MAXNBUF (sizeof(intmax_t) * CHAR_BIT + 1) +typedef void (kvprintf_fn_t)(int, void *); + static char *ksprintn (char *buf, uintmax_t num, int base, int *len, int upper); -static int kvprintf(char const *fmt, void (*func)(int), void *arg, int radix, va_list ap); +static int kvprintf(char const *fmt, kvprintf_fn_t *func, void *arg, int radix, va_list ap); + +static void +putchar_wrapper(int cc, void *arg) +{ + + putchar(cc); +} int printf(const char *fmt, ...) @@ -66,7 +75,7 @@ printf(const char *fmt, ...) int retval; va_start(ap, fmt); - retval = kvprintf(fmt, putchar, NULL, 10, ap); + retval = kvprintf(fmt, putchar_wrapper, NULL, 10, ap); va_end(ap); return retval; } @@ -75,7 +84,7 @@ void vprintf(const char *fmt, va_list ap) { - kvprintf(fmt, putchar, NULL, 10, ap); + kvprintf(fmt, putchar_wrapper, NULL, 10, ap); } int @@ -91,6 +100,46 @@ sprintf(char *buf, const char *cfmt, ... return retval; } +struct print_buf { + char *buf; + size_t size; +}; + +static void +snprint_func(int ch, void *arg) +{ + struct print_buf *pbuf = arg; + + if (pbuf->size < 2) { + /* + * Reserve last buffer position for the terminating + * character: + */ + return; + } + *(pbuf->buf)++ = ch; + pbuf->size--; +} + +int +snprintf(char *buf, size_t size, const char *cfmt, ...) +{ + int retval; + va_list ap; + struct print_buf arg; + + arg.buf = buf; + arg.size = size; + + va_start(ap, cfmt); + retval = kvprintf(cfmt, &snprint_func, &arg, 10, ap); + va_end(ap); + + if (arg.size >= 1) + *(arg.buf)++ = 0; + return retval; +} + void vsprintf(char *buf, const char *cfmt, va_list ap) { @@ -149,9 +198,9 @@ ksprintn(char *nbuf, uintmax_t num, int * ("%*D", len, ptr, " " -> XX XX XX XX ... */ static int -kvprintf(char const *fmt, void (*func)(int), void *arg, int radix, va_list ap) +kvprintf(char const *fmt, kvprintf_fn_t *func, void *arg, int radix, va_list ap) { -#define PCHAR(c) {int cc=(c); if (func) (*func)(cc); else *d++ = cc; retval++; } +#define PCHAR(c) {int cc=(c); if (func) (*func)(cc, arg); else *d++ = cc; retval++; } char nbuf[MAXNBUF]; char *d; const char *p, *percent, *q; Modified: stable/10/lib/libstand/stand.h ============================================================================== --- stable/10/lib/libstand/stand.h Sun Oct 26 02:44:41 2014 (r273663) +++ stable/10/lib/libstand/stand.h Sun Oct 26 02:51:56 2014 (r273664) @@ -238,6 +238,7 @@ extern void mallocstats(void); extern int printf(const char *fmt, ...) __printflike(1, 2); extern void vprintf(const char *fmt, __va_list); extern int sprintf(char *buf, const char *cfmt, ...) __printflike(2, 3); +extern int snprintf(char *buf, size_t size, const char *cfmt, ...) __printflike(3, 4); extern void vsprintf(char *buf, const char *cfmt, __va_list); extern void twiddle(void); From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 02:53:24 2014 Return-Path: Delivered-To: svn-src-all@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 B93341C3; Sun, 26 Oct 2014 02:53:24 +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 A453CCB0; Sun, 26 Oct 2014 02:53: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 s9Q2rORH001270; Sun, 26 Oct 2014 02:53:24 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q2rOfB001263; Sun, 26 Oct 2014 02:53:24 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260253.s9Q2rOfB001263@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 02:53:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273665 - in stable/10/sys/boot: arm/uboot uboot/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 02:53:24 -0000 Author: ian Date: Sun Oct 26 02:53:23 2014 New Revision: 273665 URL: https://svnweb.freebsd.org/changeset/base/273665 Log: MFC r271285: Add a 'ubenv import' command to import environment variables from the u-boot env into the loader(8) env (which also gets them into the kernel env). Modified: stable/10/sys/boot/arm/uboot/help.uboot stable/10/sys/boot/uboot/common/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/arm/uboot/help.uboot ============================================================================== --- stable/10/sys/boot/arm/uboot/help.uboot Sun Oct 26 02:51:56 2014 (r273664) +++ stable/10/sys/boot/arm/uboot/help.uboot Sun Oct 26 02:53:23 2014 (r273665) @@ -1 +1,27 @@ $FreeBSD$ + +############################################################################### +# Tubenv DShow or import U-Boot environment variables + + ubenv [varname ...] + + Display U-Boot environment variables, or import them into the + loader environment (which makes them available in the kernel). + +############################################################################### +# Tubenv Simport DImport U-Boot env vars + + ubenv import [varname ...] + + If no variable names are specified, all U-Boot environment + variables are imported. Each variable is prefixed with "uboot." + to avoid any possible conflicts with loader or kernel variables. + +############################################################################### +# Tubenv Sshow DShow U-Boot env vars + + ubenv show [varname ...] + + If no variable names are specified, all U-Boot environment + variables are shown. + Modified: stable/10/sys/boot/uboot/common/main.c ============================================================================== --- stable/10/sys/boot/uboot/common/main.c Sun Oct 26 02:51:56 2014 (r273664) +++ stable/10/sys/boot/uboot/common/main.c Sun Oct 26 02:53:23 2014 (r273665) @@ -556,6 +556,75 @@ command_sysinfo(int argc, char *argv[]) return (CMD_OK); } +enum ubenv_action { + UBENV_UNKNOWN, + UBENV_SHOW, + UBENV_IMPORT +}; + +static void +handle_uboot_env_var(enum ubenv_action action, const char * var) +{ + const char * val; + char ubv[128]; + + /* + * If the user prepended "uboot." (which is how they usually see these + * names) strip it off as a convenience. + */ + if (strncmp(var, "uboot.", 6) == 0) { + snprintf(ubv, sizeof(ubv), "%s", &var[6]); + var = ubv; + } + val = ub_env_get(var); + if (action == UBENV_SHOW) { + if (val == NULL) + printf("uboot.%s is not set\n", var); + else + printf("uboot.%s=%s\n", var, val); + } else if (action == UBENV_IMPORT) { + if (val != NULL) { + snprintf(ubv, sizeof(ubv), "uboot.%s", var); + setenv(ubv, val, 1); + } + } +} + +static int +command_ubenv(int argc, char *argv[]) +{ + enum ubenv_action action; + const char *var; + int i; + + action = UBENV_UNKNOWN; + if (argc > 1) { + if (strcasecmp(argv[1], "import") == 0) + action = UBENV_IMPORT; + else if (strcasecmp(argv[1], "show") == 0) + action = UBENV_SHOW; + } + if (action == UBENV_UNKNOWN) { + command_errmsg = "usage: 'ubenv [var ...]"; + return (CMD_ERROR); + } + + if (argc > 2) { + for (i = 2; i < argc; i++) + handle_uboot_env_var(action, argv[i]); + } else { + var = NULL; + for (;;) { + if ((var = ub_env_enum(var)) == NULL) + break; + handle_uboot_env_var(action, var); + } + } + + return (CMD_OK); +} +COMMAND_SET(ubenv, "ubenv", "show or import U-Boot env vars", command_ubenv); + #ifdef LOADER_FDT_SUPPORT /* * Since proper fdt command handling function is defined in fdt_loader_cmd.c, From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 03:03:42 2014 Return-Path: Delivered-To: svn-src-all@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 752B34F3; Sun, 26 Oct 2014 03:03: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 48A39E2A; Sun, 26 Oct 2014 03:03: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 s9Q33gwa008647; Sun, 26 Oct 2014 03:03:42 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q33gmX008646; Sun, 26 Oct 2014 03:03:42 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201410260303.s9Q33gmX008646@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sun, 26 Oct 2014 03:03:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273666 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 03:03:42 -0000 Author: neel Date: Sun Oct 26 03:03:41 2014 New Revision: 273666 URL: https://svnweb.freebsd.org/changeset/base/273666 Log: Don't pass the 'error' return from an I/O port handler directly to vm_run(). Most I/O port handlers return -1 to signal an error. If this value is returned without modification to vm_run() then it leads to incorrect behavior because '-1' is interpreted as ERESTART at the system call level. Fix this by always returning EIO to signal an error from an I/O port handler. MFC after: 1 week Modified: head/sys/amd64/vmm/vmm_ioport.c Modified: head/sys/amd64/vmm/vmm_ioport.c ============================================================================== --- head/sys/amd64/vmm/vmm_ioport.c Sun Oct 26 02:53:23 2014 (r273665) +++ head/sys/amd64/vmm/vmm_ioport.c Sun Oct 26 03:03:41 2014 (r273666) @@ -106,15 +106,14 @@ emulate_inout_port(struct vm *vm, int vc uint32_t mask, val; int error; - error = 0; - *retu = true; - - if (vmexit->u.inout.port >= MAX_IOPORTS) - goto done; - - handler = ioport_handler[vmexit->u.inout.port]; - if (handler == NULL) - goto done; + /* + * If there is no handler for the I/O port then punt to userspace. + */ + if (vmexit->u.inout.port >= MAX_IOPORTS || + (handler = ioport_handler[vmexit->u.inout.port]) == NULL) { + *retu = true; + return (0); + } mask = vie_size2mask(vmexit->u.inout.bytes); @@ -124,20 +123,27 @@ emulate_inout_port(struct vm *vm, int vc error = (*handler)(vm, vcpuid, vmexit->u.inout.in, vmexit->u.inout.port, vmexit->u.inout.bytes, &val); + if (error) { + /* + * The value returned by this function is also the return value + * of vm_run(). This needs to be a positive number otherwise it + * can be interpreted as a "pseudo-error" like ERESTART. + * + * Enforce this by mapping all errors to EIO. + */ + return (EIO); + } - if (!error) { - *retu = false; - if (vmexit->u.inout.in) { - vmexit->u.inout.eax &= ~mask; - vmexit->u.inout.eax |= val & mask; - error = vm_set_register(vm, vcpuid, - VM_REG_GUEST_RAX, vmexit->u.inout.eax); - KASSERT(error == 0, ("emulate_ioport: error %d " - "setting guest rax register", error)); - } + if (vmexit->u.inout.in) { + vmexit->u.inout.eax &= ~mask; + vmexit->u.inout.eax |= val & mask; + error = vm_set_register(vm, vcpuid, VM_REG_GUEST_RAX, + vmexit->u.inout.eax); + KASSERT(error == 0, ("emulate_ioport: error %d setting guest " + "rax register", error)); } -done: - return (error); + *retu = false; + return (0); } static int From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 03:13:20 2014 Return-Path: Delivered-To: svn-src-all@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 CB9F169D; Sun, 26 Oct 2014 03:13: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 B7755EF1; Sun, 26 Oct 2014 03:13: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 s9Q3DKQ6014832; Sun, 26 Oct 2014 03:13:20 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q3DKX5014831; Sun, 26 Oct 2014 03:13:20 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260313.s9Q3DKX5014831@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 03:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273667 - stable/10/sys/arm/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 03:13:20 -0000 Author: ian Date: Sun Oct 26 03:13:19 2014 New Revision: 273667 URL: https://svnweb.freebsd.org/changeset/base/273667 Log: MFC r271310: Rename new to newval in inline asm code, to avoid clashes with C++ new. Modified: stable/10/sys/arm/include/atomic.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/include/atomic.h ============================================================================== --- stable/10/sys/arm/include/atomic.h Sun Oct 26 03:03:41 2014 (r273666) +++ stable/10/sys/arm/include/atomic.h Sun Oct 26 03:13:19 2014 (r273667) @@ -268,12 +268,12 @@ atomic_cmpset_64(volatile uint64_t *p, u __asm __volatile( "1: \n" " ldrexd %[tmp], [%[ptr]]\n" - " teq %Q[tmp], %Q[cmp]\n" + " teq %Q[tmp], %Q[cmpval]\n" " itee eq \n" - " teqeq %R[tmp], %R[cmp]\n" + " teqeq %R[tmp], %R[cmpval]\n" " movne %[ret], #0\n" " bne 2f\n" - " strexd %[ret], %[new], [%[ptr]]\n" + " strexd %[ret], %[newval], [%[ptr]]\n" " teq %[ret], #0\n" " it ne \n" " bne 1b\n" @@ -282,8 +282,8 @@ atomic_cmpset_64(volatile uint64_t *p, u : [ret] "=&r" (ret), [tmp] "=&r" (tmp) : [ptr] "r" (p), - [cmp] "r" (cmpval), - [new] "r" (newval) + [cmpval] "r" (cmpval), + [newval] "r" (newval) : "cc", "memory"); return (ret); } From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 03:29:07 2014 Return-Path: Delivered-To: svn-src-all@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 0ED9BA69; Sun, 26 Oct 2014 03:29: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 EF050FE2; Sun, 26 Oct 2014 03:29: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 s9Q3T6H9020742; Sun, 26 Oct 2014 03:29:06 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q3T6AM020741; Sun, 26 Oct 2014 03:29:06 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260329.s9Q3T6AM020741@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 03:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273668 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 03:29:07 -0000 Author: ian Date: Sun Oct 26 03:29:06 2014 New Revision: 273668 URL: https://svnweb.freebsd.org/changeset/base/273668 Log: MFC r271535: Make inclusion of fdt clock support conditional on fdt_clock, not just fdt. Modified: stable/10/sys/conf/files Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Sun Oct 26 03:13:19 2014 (r273667) +++ stable/10/sys/conf/files Sun Oct 26 03:29:06 2014 (r273668) @@ -1371,8 +1371,8 @@ dev/fatm/if_fatm.c optional fatm pci dev/fb/fbd.c optional fbd | vt dev/fb/fb_if.m standard dev/fb/splash.c optional sc splash -dev/fdt/fdt_clock.c optional fdt -dev/fdt/fdt_clock_if.m optional fdt +dev/fdt/fdt_clock.c optional fdt_clock +dev/fdt/fdt_clock_if.m optional fdt_clock dev/fdt/fdt_common.c optional fdt dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static \ From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 03:41:29 2014 Return-Path: Delivered-To: svn-src-all@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 DDF2BCB5; Sun, 26 Oct 2014 03: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 BEE681C8; Sun, 26 Oct 2014 03: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 s9Q3fSDW028032; Sun, 26 Oct 2014 03:41:28 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q3fRUU028020; Sun, 26 Oct 2014 03:41:27 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260341.s9Q3fRUU028020@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 03:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273669 - in stable/10/sys: conf dev/fdt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 03:41:29 -0000 Author: ian Date: Sun Oct 26 03:41:27 2014 New Revision: 273669 URL: https://svnweb.freebsd.org/changeset/base/273669 Log: MFC 271546: Create an interface and support routines for drivers that handle IO pin multiplexing and configuration based on FDT data. Added: stable/10/sys/dev/fdt/fdt_pinctrl.c - copied unchanged from r271546, head/sys/dev/fdt/fdt_pinctrl.c stable/10/sys/dev/fdt/fdt_pinctrl.h - copied unchanged from r271546, head/sys/dev/fdt/fdt_pinctrl.h stable/10/sys/dev/fdt/fdt_pinctrl_if.m - copied unchanged from r271546, head/sys/dev/fdt/fdt_pinctrl_if.m Modified: stable/10/sys/conf/files Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Sun Oct 26 03:29:06 2014 (r273668) +++ stable/10/sys/conf/files Sun Oct 26 03:41:27 2014 (r273669) @@ -1371,9 +1371,11 @@ dev/fatm/if_fatm.c optional fatm pci dev/fb/fbd.c optional fbd | vt dev/fb/fb_if.m standard dev/fb/splash.c optional sc splash -dev/fdt/fdt_clock.c optional fdt_clock -dev/fdt/fdt_clock_if.m optional fdt_clock +dev/fdt/fdt_clock.c optional fdt fdt_clock +dev/fdt/fdt_clock_if.m optional fdt fdt_clock dev/fdt/fdt_common.c optional fdt +dev/fdt/fdt_pinctrl.c optional fdt fdt_pinctrl +dev/fdt/fdt_pinctrl_if.m optional fdt fdt_pinctrl dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static \ dependency "$S/boot/fdt/dts/${MACHINE}/${FDT_DTS_FILE}" Copied: stable/10/sys/dev/fdt/fdt_pinctrl.c (from r271546, head/sys/dev/fdt/fdt_pinctrl.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/fdt/fdt_pinctrl.c Sun Oct 26 03:41:27 2014 (r273669, copy of r271546, head/sys/dev/fdt/fdt_pinctrl.c) @@ -0,0 +1,151 @@ +/*- + * Copyright (c) 2014 Ian Lepore + * 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 "fdt_pinctrl_if.h" + +#include +#include + +int +fdt_pinctrl_configure(device_t client, u_int index) +{ + device_t pinctrl; + phandle_t *configs; + int i, nconfigs; + char name[16]; + + snprintf(name, sizeof(name), "pinctrl-%u", index); + nconfigs = OF_getprop_alloc(ofw_bus_get_node(client), name, + sizeof(*configs), (void **)&configs); + if (nconfigs < 0) + return (ENOENT); + if (nconfigs == 0) + return (0); /* Empty property is documented as valid. */ + for (i = 0; i < nconfigs; i++) { + if ((pinctrl = OF_device_from_xref(configs[i])) != NULL) + FDT_PINCTRL_CONFIGURE(pinctrl, configs[i]); + } + free(configs, M_OFWPROP); + return (0); +} + +int +fdt_pinctrl_configure_by_name(device_t client, const char * name) +{ + char * names; + int i, offset, nameslen; + + nameslen = OF_getprop_alloc(ofw_bus_get_node(client), "pinctrl-names", + sizeof(*names), (void **)&names); + if (nameslen <= 0) + return (ENOENT); + for (i = 0, offset = 0; offset < nameslen; i++) { + if (strcmp(name, &names[offset]) == 0) + break; + offset += strlen(&names[offset]) + 1; + } + free(names, M_OFWPROP); + if (offset < nameslen) + return (fdt_pinctrl_configure(client, i)); + else + return (ENOENT); +} + +static int +pinctrl_register_children(device_t pinctrl, phandle_t parent, + const char *pinprop) +{ + phandle_t node; + + /* + * Recursively descend from parent, looking for nodes that have the + * given property, and associate the pinctrl device_t with each one. + */ + for (node = OF_child(parent); node != 0; node = OF_peer(node)) { + pinctrl_register_children(pinctrl, node, pinprop); + if (pinprop == NULL || OF_hasprop(node, pinprop)) { + OF_device_register_xref(OF_xref_from_node(node), + pinctrl); + } + } + return (0); +} + +int +fdt_pinctrl_register(device_t pinctrl, const char *pinprop) +{ + phandle_t node; + + node = ofw_bus_get_node(pinctrl); + OF_device_register_xref(OF_xref_from_node(node), pinctrl); + return (pinctrl_register_children(pinctrl, node, pinprop)); +} + +static int +pinctrl_configure_children(device_t pinctrl, phandle_t parent) +{ + phandle_t node, *configs; + int i, nconfigs; + + for (node = OF_child(parent); node != 0; node = OF_peer(node)) { + if (!fdt_is_enabled(node)) + continue; + pinctrl_configure_children(pinctrl, node); + nconfigs = OF_getencprop_alloc(node, "pinctrl-0", + sizeof(*configs), (void **)&configs); +#ifdef DEBUG + { + char name[32]; + OF_getprop(node, "name", &name, sizeof(name)); + printf("%d items in pinctrl-0 for %s\n", nconfigs, name); + } +#endif + if (nconfigs <= 0) + continue; + for (i = 0; i < nconfigs; i++) { + if (OF_device_from_xref(configs[i]) == pinctrl) + FDT_PINCTRL_CONFIGURE(pinctrl, configs[i]); + } + free(configs, M_OFWPROP); + } + return (0); +} + +int +fdt_pinctrl_configure_tree(device_t pinctrl) +{ + + return (pinctrl_configure_children(pinctrl, OF_peer(0))); +} + Copied: stable/10/sys/dev/fdt/fdt_pinctrl.h (from r271546, head/sys/dev/fdt/fdt_pinctrl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/fdt/fdt_pinctrl.h Sun Oct 26 03:41:27 2014 (r273669, copy of r271546, head/sys/dev/fdt/fdt_pinctrl.h) @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 2014 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef DEV_FDT_PINCTRL_H +#define DEV_FDT_PINCTRL_H + +#include "fdt_pinctrl_if.h" + +/* + * Configure pins by name or index. This looks up the pinctrl-N property in + * client's fdt data by index or name, and passes each handle in it to the + * pinctrl driver for configuration. + */ +int fdt_pinctrl_configure(device_t client, u_int index); +int fdt_pinctrl_configure_by_name(device_t client, const char * name); + +/* + * Register a pinctrl driver so that it can be used by other devices which call + * fdt_pinctrl_configure(). The pinprop argument is the name of a property that + * identifies each descendent of the pinctrl node which is a pin configuration + * node whose xref phandle can be passed to FDT_PINCTRL_CONFIGURE(). If this is + * NULL, every descendant node is registered. + */ +int fdt_pinctrl_register(device_t pinctrl, const char *pinprop); + +/* + * Walk the device tree and configure pins for each enabled device whose + * pinctrl-0 property contains references to nodes which are children of the + * given pinctrl device. This helper routine is for use by pinctrl drivers. + */ +int fdt_pinctrl_configure_tree(device_t pinctrl); + +#endif /* DEV_FDT_PINCTRL_H */ + Copied: stable/10/sys/dev/fdt/fdt_pinctrl_if.m (from r271546, head/sys/dev/fdt/fdt_pinctrl_if.m) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/fdt/fdt_pinctrl_if.m Sun Oct 26 03:41:27 2014 (r273669, copy of r271546, head/sys/dev/fdt/fdt_pinctrl_if.m) @@ -0,0 +1,47 @@ +#- +# Copyright (c) 2014 Ian Lepore +# 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 + +# +# This is the interface that fdt_pinctrl drivers provide to other drivers. +# + +INTERFACE fdt_pinctrl; + +# +# Set pins to the specified configuration. The cfgxref arg is an xref phandle +# to a descendent node (child, grandchild, ...) of the pinctrl device node. +# Returns 0 on success or a standard errno value. +# +METHOD int configure { + device_t pinctrl; + phandle_t cfgxref; +}; + From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 03:44:22 2014 Return-Path: Delivered-To: svn-src-all@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 3265EDF7; Sun, 26 Oct 2014 03:44:22 +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 1DAFB1D3; Sun, 26 Oct 2014 03:44:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9Q3iLAd029501; Sun, 26 Oct 2014 03:44:21 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q3iK2t029488; Sun, 26 Oct 2014 03:44:20 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260344.s9Q3iK2t029488@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 03:44:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273670 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 03:44:22 -0000 Author: ian Date: Sun Oct 26 03:44:19 2014 New Revision: 273670 URL: https://svnweb.freebsd.org/changeset/base/273670 Log: MFC r271550, r271591: Replace the imx5 and imx6 iomux drivers with a single common driver that uses the new fdt_pinctrl interface. Added: stable/10/sys/arm/freescale/imx/imx_iomux.c - copied, changed from r271550, head/sys/arm/freescale/imx/imx_iomux.c Deleted: stable/10/sys/arm/freescale/imx/imx51_iomux.c stable/10/sys/arm/freescale/imx/imx51_iomuxreg.h stable/10/sys/arm/freescale/imx/imx6_iomux.c stable/10/sys/arm/freescale/imx/imx6_iomuxreg.h Modified: stable/10/sys/arm/freescale/imx/files.imx51 stable/10/sys/arm/freescale/imx/files.imx53 stable/10/sys/arm/freescale/imx/files.imx6 stable/10/sys/arm/freescale/imx/std.imx51 stable/10/sys/arm/freescale/imx/std.imx53 stable/10/sys/arm/freescale/imx/std.imx6 Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/files.imx51 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx51 Sun Oct 26 03:41:27 2014 (r273669) +++ stable/10/sys/arm/freescale/imx/files.imx51 Sun Oct 26 03:44:19 2014 (r273670) @@ -19,7 +19,7 @@ arm/freescale/imx/bus_space.c standard arm/freescale/imx/tzic.c standard # IOMUX - external pins multiplexor -arm/freescale/imx/imx51_iomux.c standard +arm/freescale/imx/imx_iomux.c standard # GPIO arm/freescale/imx/imx_gpio.c optional gpio Modified: stable/10/sys/arm/freescale/imx/files.imx53 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx53 Sun Oct 26 03:41:27 2014 (r273669) +++ stable/10/sys/arm/freescale/imx/files.imx53 Sun Oct 26 03:44:19 2014 (r273670) @@ -22,7 +22,7 @@ dev/uart/uart_dev_imx.c optional uart arm/freescale/imx/tzic.c standard # IOMUX - external pins multiplexor -arm/freescale/imx/imx51_iomux.c standard +arm/freescale/imx/imx_iomux.c standard # GPIO arm/freescale/imx/imx_gpio.c optional gpio Modified: stable/10/sys/arm/freescale/imx/files.imx6 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx6 Sun Oct 26 03:41:27 2014 (r273669) +++ stable/10/sys/arm/freescale/imx/files.imx6 Sun Oct 26 03:44:19 2014 (r273670) @@ -20,11 +20,11 @@ arm/arm/mpcore_timer.c standard arm/freescale/fsl_ocotp.c standard arm/freescale/imx/imx6_anatop.c standard arm/freescale/imx/imx6_ccm.c standard -arm/freescale/imx/imx6_iomux.c standard arm/freescale/imx/imx6_machdep.c standard arm/freescale/imx/imx6_mp.c optional smp arm/freescale/imx/imx6_pl310.c standard arm/freescale/imx/imx_common.c standard +arm/freescale/imx/imx_iomux.c standard arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx_gpt.c standard arm/freescale/imx/imx_gpio.c optional gpio Copied and modified: stable/10/sys/arm/freescale/imx/imx_iomux.c (from r271550, head/sys/arm/freescale/imx/imx_iomux.c) ============================================================================== --- head/sys/arm/freescale/imx/imx_iomux.c Sat Sep 13 20:09:34 2014 (r271550, copy source) +++ stable/10/sys/arm/freescale/imx/imx_iomux.c Sun Oct 26 03:44:19 2014 (r273670) @@ -26,6 +26,29 @@ * $FreeBSD$ */ +/* + * Pin mux and pad control driver for imx5 and imx6. + * + * This driver implements the fdt_pinctrl interface for configuring the gpio and + * peripheral pins based on fdt configuration data. + * + * When the driver attaches, it walks the entire fdt tree and automatically + * configures the pins for each device which has a pinctrl-0 property and whose + * status is "okay". In addition it implements the fdt_pinctrl_configure() + * method which any other driver can call at any time to reconfigure its pins. + * + * The nature of the fsl,pins property in fdt data makes this driver's job very + * easy. Instead of representing each pin and pad configuration using symbolic + * properties such as pullup-enable="true" and so on, the data simply contains + * the addresses of the registers that control the pins, and the raw values to + * store in those registers. + * + * The imx5 and imx6 SoCs also have a small number of "general purpose + * registers" in the iomuxc device which are used to control an assortment + * of completely unrelated aspects of SoC behavior. This driver provides other + * drivers with direct access to those registers via simple accessor functions. + */ + #include #include #include @@ -102,13 +125,6 @@ iomux_configure_pins(device_t dev, phand cfgnode = OF_node_from_xref(cfgxref); ntuples = OF_getencprop_alloc(cfgnode, "fsl,pins", sizeof(*cfgtuples), (void **)&cfgtuples); -#ifdef DEBUG - { - char name[32]; - OF_getprop(cfgnode, "name", &name, sizeof(name)); - printf("found %d tuples in fsl,pins for %s\n", ntuples, name); - } -#endif if (ntuples < 0) return (ENOENT); if (ntuples == 0) Modified: stable/10/sys/arm/freescale/imx/std.imx51 ============================================================================== --- stable/10/sys/arm/freescale/imx/std.imx51 Sun Oct 26 03:41:27 2014 (r273669) +++ stable/10/sys/arm/freescale/imx/std.imx51 Sun Oct 26 03:44:19 2014 (r273670) @@ -10,5 +10,7 @@ options KERNPHYSADDR=0x90100000 makeoptions KERNPHYSADDR=0x90100000 options PHYSADDR=0x90000000 +device fdt_pinctrl + files "../freescale/imx/files.imx51" Modified: stable/10/sys/arm/freescale/imx/std.imx53 ============================================================================== --- stable/10/sys/arm/freescale/imx/std.imx53 Sun Oct 26 03:41:27 2014 (r273669) +++ stable/10/sys/arm/freescale/imx/std.imx53 Sun Oct 26 03:44:19 2014 (r273670) @@ -10,5 +10,7 @@ options KERNPHYSADDR=0x70100000 makeoptions KERNPHYSADDR=0x70100000 options PHYSADDR=0x70000000 +device fdt_pinctrl + files "../freescale/imx/files.imx53" Modified: stable/10/sys/arm/freescale/imx/std.imx6 ============================================================================== --- stable/10/sys/arm/freescale/imx/std.imx6 Sun Oct 26 03:41:27 2014 (r273669) +++ stable/10/sys/arm/freescale/imx/std.imx6 Sun Oct 26 03:44:19 2014 (r273670) @@ -13,5 +13,7 @@ options PHYSADDR = 0x10000000 options IPI_IRQ_START=0 options IPI_IRQ_END=15 +device fdt_pinctrl + files "../freescale/imx/files.imx6" From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 03:48:13 2014 Return-Path: Delivered-To: svn-src-all@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 BCECCF46; Sun, 26 Oct 2014 03:48: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 A90B71E6; Sun, 26 Oct 2014 03:48: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 s9Q3mDNL030045; Sun, 26 Oct 2014 03:48:13 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q3mDtk030044; Sun, 26 Oct 2014 03:48:13 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260348.s9Q3mDtk030044@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 03:48:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273671 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 03:48:13 -0000 Author: ian Date: Sun Oct 26 03:48:12 2014 New Revision: 273671 URL: https://svnweb.freebsd.org/changeset/base/273671 Log: MFC r271594: Fix an undefined variable that was accidentally not causing an error. Modified: stable/10/sys/arm/arm/nexus.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/nexus.c ============================================================================== --- stable/10/sys/arm/arm/nexus.c Sun Oct 26 03:44:19 2014 (r273670) +++ stable/10/sys/arm/arm/nexus.c Sun Oct 26 03:48:12 2014 (r273671) @@ -338,16 +338,16 @@ nexus_ofw_map_intr(device_t dev, device_ pcell_t *intr) { fdt_pic_decode_t intr_decode; - phandle_t intr_offset; + phandle_t intr_parent; int i, rv, interrupt, trig, pol; - intr_offset = OF_node_from_xref(iparent); + intr_parent = OF_node_from_xref(iparent); for (i = 0; i < icells; i++) intr[i] = cpu_to_fdt32(intr[i]); for (i = 0; fdt_pic_table[i] != NULL; i++) { intr_decode = fdt_pic_table[i]; - rv = intr_decode(intr_offset, intr, &interrupt, &trig, &pol); + rv = intr_decode(intr_parent, intr, &interrupt, &trig, &pol); if (rv == 0) { /* This was recognized as our PIC and decoded. */ From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 03:52:47 2014 Return-Path: Delivered-To: svn-src-all@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 838C6121; Sun, 26 Oct 2014 03:52: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 6D28628C; Sun, 26 Oct 2014 03:52: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 s9Q3qkUJ034012; Sun, 26 Oct 2014 03:52:46 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q3qknf034008; Sun, 26 Oct 2014 03:52:46 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260352.s9Q3qknf034008@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 03:52:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273672 - in stable/10/sys/arm: arm freescale/imx include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 03:52:47 -0000 Author: ian Date: Sun Oct 26 03:52:45 2014 New Revision: 273672 URL: https://svnweb.freebsd.org/changeset/base/273672 Log: MFC r271595, r271601, r271607, r271630: Add compat strings for all the flavors of GIC this driver should support. Also allow the driver to attach to ofwbus as well as simplebus, some FDT data puts the root interrupt controller on the root bus. Add a common routine for parsing FDT data describing an ARM GIC interrupt. Use gic_decode_fdt() rather than a local routine to parse fdt interrupt properties. Move fdt_pic_table and fdt_fixup_table into imx6_machdep.c, which means imx6 doesn't need imx_common.c anymore. The private peripheral interrupts start at offset 16, not 0. Also, use names rather than inline mystery constants for these offsets. Modified: stable/10/sys/arm/arm/gic.c stable/10/sys/arm/freescale/imx/files.imx6 stable/10/sys/arm/freescale/imx/imx6_machdep.c stable/10/sys/arm/include/intr.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/gic.c ============================================================================== --- stable/10/sys/arm/arm/gic.c Sun Oct 26 03:48:12 2014 (r273671) +++ stable/10/sys/arm/arm/gic.c Sun Oct 26 03:52:45 2014 (r273672) @@ -83,7 +83,11 @@ __FBSDID("$FreeBSD$"); #define GICC_ABPR 0x001C /* v1 ICCABPR */ #define GICC_IIDR 0x00FC /* v1 ICCIIDR*/ -#define GIC_LAST_IPI 15 /* Irqs 0-15 are IPIs. */ +#define GIC_FIRST_IPI 0 /* Irqs 0-15 are SGIs/IPIs. */ +#define GIC_LAST_IPI 15 +#define GIC_FIRST_PPI 16 /* Irqs 16-31 are private (per */ +#define GIC_LAST_PPI 31 /* core) peripheral interrupts. */ +#define GIC_FIRST_SPI 32 /* Irqs 32+ are shared peripherals. */ /* First bit is a polarity bit (0 - low, 1 - high) */ #define GICD_ICFGR_POL_LOW (0 << 0) @@ -127,6 +131,17 @@ static int gic_config_irq(int irq, enum enum intr_polarity pol); static void gic_post_filter(void *); +static struct ofw_compat_data compat_data[] = { + {"arm,gic", true}, /* Non-standard, used in FreeBSD dts. */ + {"arm,gic-400", true}, + {"arm,cortex-a15-gic", true}, + {"arm,cortex-a9-gic", true}, + {"arm,cortex-a7-gic", true}, + {"arm,arm11mp-gic", true}, + {"brcm,brahma-b15-gic", true}, + {NULL, false} +}; + static int arm_gic_probe(device_t dev) { @@ -134,7 +149,7 @@ arm_gic_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "arm,gic")) + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) return (ENXIO); device_set_desc(dev, "ARM Generic Interrupt Controller"); return (BUS_PROBE_DEFAULT); @@ -170,6 +185,51 @@ gic_init_secondary(void) gic_d_write_4(GICD_ISENABLER(29 >> 5), (1UL << (29 & 0x1F))); } +int +gic_decode_fdt(uint32_t iparent, uint32_t *intr, int *interrupt, + int *trig, int *pol) +{ + static u_int num_intr_cells; + + if (num_intr_cells == 0) { + if (OF_searchencprop(OF_node_from_xref(iparent), + "#interrupt-cells", &num_intr_cells, + sizeof(num_intr_cells)) == -1) { + num_intr_cells = 1; + } + } + + if (num_intr_cells == 1) { + *interrupt = fdt32_to_cpu(intr[0]); + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + } else { + if (intr[0] == 0) + *interrupt = fdt32_to_cpu(intr[1]) + GIC_FIRST_SPI; + else + *interrupt = fdt32_to_cpu(intr[1]) + GIC_FIRST_PPI; + /* + * In intr[2], bits[3:0] are trigger type and level flags. + * 1 = low-to-high edge triggered + * 2 = high-to-low edge triggered + * 4 = active high level-sensitive + * 8 = active low level-sensitive + * The hardware only supports active-high-level or rising-edge. + */ + if (intr[2] & 0x0a) { + printf("unsupported trigger/polarity configuration " + "0x%2x\n", intr[2] & 0x0f); + return (ENOTSUP); + } + *pol = INTR_POLARITY_CONFORM; + if (intr[2] & 0x01) + *trig = INTR_TRIGGER_EDGE; + else + *trig = INTR_TRIGGER_LEVEL; + } + return (0); +} + static int arm_gic_attach(device_t dev) { @@ -265,6 +325,8 @@ static devclass_t arm_gic_devclass; EARLY_DRIVER_MODULE(gic, simplebus, arm_gic_driver, arm_gic_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); +EARLY_DRIVER_MODULE(gic, ofwbus, arm_gic_driver, arm_gic_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); static void gic_post_filter(void *arg) Modified: stable/10/sys/arm/freescale/imx/files.imx6 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx6 Sun Oct 26 03:48:12 2014 (r273671) +++ stable/10/sys/arm/freescale/imx/files.imx6 Sun Oct 26 03:52:45 2014 (r273672) @@ -23,7 +23,6 @@ arm/freescale/imx/imx6_ccm.c standard arm/freescale/imx/imx6_machdep.c standard arm/freescale/imx/imx6_mp.c optional smp arm/freescale/imx/imx6_pl310.c standard -arm/freescale/imx/imx_common.c standard arm/freescale/imx/imx_iomux.c standard arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx_gpt.c standard Modified: stable/10/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_machdep.c Sun Oct 26 03:48:12 2014 (r273671) +++ stable/10/sys/arm/freescale/imx/imx6_machdep.c Sun Oct 26 03:52:45 2014 (r273672) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -45,6 +46,18 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + +struct fdt_fixup_entry fdt_fixup_table[] = { + { NULL, NULL } +}; + +fdt_pic_decode_t fdt_pic_table[] = { + &gic_decode_fdt, + NULL +}; + vm_offset_t initarm_lastaddr(void) { Modified: stable/10/sys/arm/include/intr.h ============================================================================== --- stable/10/sys/arm/include/intr.h Sun Oct 26 03:48:12 2014 (r273671) +++ stable/10/sys/arm/include/intr.h Sun Oct 26 03:52:45 2014 (r273672) @@ -82,5 +82,7 @@ extern int (*arm_config_irq)(int irq, en void arm_irq_memory_barrier(uintptr_t); void gic_init_secondary(void); +int gic_decode_fdt(uint32_t iparentnode, uint32_t *intrcells, int *interrupt, + int *trig, int *pol); #endif /* _MACHINE_INTR_H */ From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 03:55:10 2014 Return-Path: Delivered-To: svn-src-all@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 C087D25E; Sun, 26 Oct 2014 03:55: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 AB6D329F; Sun, 26 Oct 2014 03:55: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 s9Q3tAC8034392; Sun, 26 Oct 2014 03:55:10 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q3tAGV034391; Sun, 26 Oct 2014 03:55:10 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260355.s9Q3tAGV034391@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 03:55:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273673 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 03:55:10 -0000 Author: ian Date: Sun Oct 26 03:55:09 2014 New Revision: 273673 URL: https://svnweb.freebsd.org/changeset/base/273673 Log: MFC r271906: Make the ARM MPCore Timer driver work with published standard FDT bindings. Modified: stable/10/sys/arm/arm/mpcore_timer.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/mpcore_timer.c ============================================================================== --- stable/10/sys/arm/arm/mpcore_timer.c Sun Oct 26 03:52:45 2014 (r273672) +++ stable/10/sys/arm/arm/mpcore_timer.c Sun Oct 26 03:55:09 2014 (r273673) @@ -97,36 +97,25 @@ __FBSDID("$FreeBSD$"); #define GBL_TIMER_INTR_EVENT (1UL << 0) struct arm_tmr_softc { - struct resource * tmr_res[4]; - bus_space_tag_t prv_bst; - bus_space_tag_t gbl_bst; - bus_space_handle_t prv_bsh; - bus_space_handle_t gbl_bsh; + device_t dev; + int irqrid; + int memrid; + struct resource * gbl_mem; + struct resource * prv_mem; + struct resource * prv_irq; uint64_t clkfreq; struct eventtimer et; }; -static struct resource_spec arm_tmr_spec[] = { - { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* Global registers */ - { SYS_RES_IRQ, 0, RF_ACTIVE }, /* Global timer interrupt (unused) */ - { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* Private (per-CPU) registers */ - { SYS_RES_IRQ, 1, RF_ACTIVE }, /* Private timer interrupt */ - { -1, 0 } -}; - -static struct arm_tmr_softc *arm_tmr_sc = NULL; - -static uint64_t platform_arm_tmr_freq = 0; - -#define tmr_prv_read_4(reg) \ - bus_space_read_4(arm_tmr_sc->prv_bst, arm_tmr_sc->prv_bsh, reg) -#define tmr_prv_write_4(reg, val) \ - bus_space_write_4(arm_tmr_sc->prv_bst, arm_tmr_sc->prv_bsh, reg, val) -#define tmr_gbl_read_4(reg) \ - bus_space_read_4(arm_tmr_sc->gbl_bst, arm_tmr_sc->gbl_bsh, reg) -#define tmr_gbl_write_4(reg, val) \ - bus_space_write_4(arm_tmr_sc->gbl_bst, arm_tmr_sc->gbl_bsh, reg, val) - +static struct eventtimer *arm_tmr_et; +static struct timecounter *arm_tmr_tc; +static uint64_t arm_tmr_freq; +static boolean_t arm_tmr_freq_varies; + +#define tmr_prv_read_4(sc, reg) bus_read_4((sc)->prv_mem, reg) +#define tmr_prv_write_4(sc, reg, val) bus_write_4((sc)->prv_mem, reg, val) +#define tmr_gbl_read_4(sc, reg) bus_read_4((sc)->gbl_mem, reg) +#define tmr_gbl_write_4(sc, reg, val) bus_write_4((sc)->gbl_mem, reg, val) static timecounter_get_t arm_tmr_get_timecount; @@ -139,6 +128,21 @@ static struct timecounter arm_tmr_timeco .tc_quality = 800, }; +#define TMR_GBL 0x01 +#define TMR_PRV 0x02 +#define TMR_BOTH (TMR_GBL | TMR_PRV) +#define TMR_NONE 0 + +static struct ofw_compat_data compat_data[] = { + {"arm,mpcore-timers", TMR_BOTH}, /* Non-standard, FreeBSD. */ + {"arm,cortex-a9-global-timer", TMR_GBL}, + {"arm,cortex-a5-global-timer", TMR_GBL}, + {"arm,cortex-a9-twd-timer", TMR_PRV}, + {"arm,cortex-a5-twd-timer", TMR_PRV}, + {"arm,arm11mp-twd-timer", TMR_PRV}, + {NULL, TMR_NONE} +}; + /** * arm_tmr_get_timecount - reads the timecount (global) timer * @tc: pointer to arm_tmr_timecount struct @@ -152,7 +156,10 @@ static struct timecounter arm_tmr_timeco static unsigned arm_tmr_get_timecount(struct timecounter *tc) { - return (tmr_gbl_read_4(GBL_TIMER_COUNT_LOW)); + struct arm_tmr_softc *sc; + + sc = tc->tc_priv; + return (tmr_gbl_read_4(sc, GBL_TIMER_COUNT_LOW)); } /** @@ -172,11 +179,13 @@ arm_tmr_get_timecount(struct timecounter static int arm_tmr_start(struct eventtimer *et, sbintime_t first, sbintime_t period) { + struct arm_tmr_softc *sc; uint32_t load, count; uint32_t ctrl; - tmr_prv_write_4(PRV_TIMER_CTRL, 0); - tmr_prv_write_4(PRV_TIMER_INTR, PRV_TIMER_INTR_EVENT); + sc = et->et_priv; + tmr_prv_write_4(sc, PRV_TIMER_CTRL, 0); + tmr_prv_write_4(sc, PRV_TIMER_INTR, PRV_TIMER_INTR_EVENT); ctrl = PRV_TIMER_CTRL_IRQ_ENABLE | PRV_TIMER_CTRL_TIMER_ENABLE; @@ -191,9 +200,9 @@ arm_tmr_start(struct eventtimer *et, sbi else count = load; - tmr_prv_write_4(PRV_TIMER_LOAD, load); - tmr_prv_write_4(PRV_TIMER_COUNT, count); - tmr_prv_write_4(PRV_TIMER_CTRL, ctrl); + tmr_prv_write_4(sc, PRV_TIMER_LOAD, load); + tmr_prv_write_4(sc, PRV_TIMER_COUNT, count); + tmr_prv_write_4(sc, PRV_TIMER_CTRL, ctrl); return (0); } @@ -210,8 +219,11 @@ arm_tmr_start(struct eventtimer *et, sbi static int arm_tmr_stop(struct eventtimer *et) { - tmr_prv_write_4(PRV_TIMER_CTRL, 0); - tmr_prv_write_4(PRV_TIMER_INTR, PRV_TIMER_INTR_EVENT); + struct arm_tmr_softc *sc; + + sc = et->et_priv; + tmr_prv_write_4(sc, PRV_TIMER_CTRL, 0); + tmr_prv_write_4(sc, PRV_TIMER_INTR, PRV_TIMER_INTR_EVENT); return (0); } @@ -227,13 +239,12 @@ arm_tmr_stop(struct eventtimer *et) static int arm_tmr_intr(void *arg) { - struct arm_tmr_softc *sc = (struct arm_tmr_softc *)arg; - - tmr_prv_write_4(PRV_TIMER_INTR, PRV_TIMER_INTR_EVENT); + struct arm_tmr_softc *sc; + sc = arg; + tmr_prv_write_4(sc, PRV_TIMER_INTR, PRV_TIMER_INTR_EVENT); if (sc->et.et_active) sc->et.et_event_cb(&sc->et, sc->et.et_arg); - return (FILTER_HANDLED); } @@ -257,13 +268,98 @@ arm_tmr_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "arm,mpcore-timers")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == TMR_NONE) return (ENXIO); device_set_desc(dev, "ARM MPCore Timers"); return (BUS_PROBE_DEFAULT); } +static int +attach_tc(struct arm_tmr_softc *sc) +{ + int rid; + + if (arm_tmr_tc != NULL) + return (EBUSY); + + rid = sc->memrid; + sc->gbl_mem = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->gbl_mem == NULL) { + device_printf(sc->dev, "could not allocate gbl mem resources\n"); + return (ENXIO); + } + tmr_gbl_write_4(sc, GBL_TIMER_CTRL, 0x00000000); + + arm_tmr_timecount.tc_frequency = sc->clkfreq; + arm_tmr_timecount.tc_priv = sc; + tc_init(&arm_tmr_timecount); + arm_tmr_tc = &arm_tmr_timecount; + + tmr_gbl_write_4(sc, GBL_TIMER_CTRL, GBL_TIMER_CTRL_TIMER_ENABLE); + + return (0); +} + +static int +attach_et(struct arm_tmr_softc *sc) +{ + void *ihl; + int irid, mrid; + + if (arm_tmr_et != NULL) + return (EBUSY); + + mrid = sc->memrid; + sc->prv_mem = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY, &mrid, + RF_ACTIVE); + if (sc->prv_mem == NULL) { + device_printf(sc->dev, "could not allocate prv mem resources\n"); + return (ENXIO); + } + tmr_prv_write_4(sc, PRV_TIMER_CTRL, 0x00000000); + + irid = sc->irqrid; + sc->prv_irq = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &irid, RF_ACTIVE); + if (sc->prv_irq == NULL) { + bus_release_resource(sc->dev, SYS_RES_MEMORY, mrid, sc->prv_mem); + device_printf(sc->dev, "could not allocate prv irq resources\n"); + return (ENXIO); + } + + if (bus_setup_intr(sc->dev, sc->prv_irq, INTR_TYPE_CLK, arm_tmr_intr, + NULL, sc, &ihl) != 0) { + bus_release_resource(sc->dev, SYS_RES_MEMORY, mrid, sc->prv_mem); + bus_release_resource(sc->dev, SYS_RES_IRQ, irid, sc->prv_irq); + device_printf(sc->dev, "unable to setup the et irq handler.\n"); + return (ENXIO); + } + + /* + * Setup and register the eventtimer. Most event timers set their min + * and max period values to some value calculated from the clock + * frequency. We might not know yet what our runtime clock frequency + * will be, so we just use some safe values. A max of 2 seconds ensures + * that even if our base clock frequency is 2GHz (meaning a 4GHz CPU), + * we won't overflow our 32-bit timer count register. A min of 20 + * nanoseconds is pretty much completely arbitrary. + */ + sc->et.et_name = "MPCore"; + sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU; + sc->et.et_quality = 1000; + sc->et.et_frequency = sc->clkfreq; + sc->et.et_min_period = 20 * SBT_1NS; + sc->et.et_max_period = 2 * SBT_1S; + sc->et.et_start = arm_tmr_start; + sc->et.et_stop = arm_tmr_stop; + sc->et.et_priv = sc; + et_register(&sc->et); + arm_tmr_et = &sc->et; + + return (0); +} + /** * arm_tmr_attach - attaches the timer to the simplebus * @dev: new device @@ -277,21 +373,19 @@ arm_tmr_probe(device_t dev) static int arm_tmr_attach(device_t dev) { - struct arm_tmr_softc *sc = device_get_softc(dev); + struct arm_tmr_softc *sc; phandle_t node; pcell_t clock; - void *ihl; - boolean_t fixed_freq; + int et_err, tc_err, tmrtype; - if (arm_tmr_sc) - return (ENXIO); + sc = device_get_softc(dev); + sc->dev = dev; - if (platform_arm_tmr_freq == ARM_TMR_FREQUENCY_VARIES) { - fixed_freq = false; + if (arm_tmr_freq_varies) { + sc->clkfreq = arm_tmr_freq; } else { - fixed_freq = true; - if (platform_arm_tmr_freq != 0) { - sc->clkfreq = platform_arm_tmr_freq; + if (arm_tmr_freq != 0) { + sc->clkfreq = arm_tmr_freq; } else { /* Get the base clock frequency */ node = ofw_bus_get_node(dev); @@ -305,66 +399,40 @@ arm_tmr_attach(device_t dev) } } - if (bus_alloc_resources(dev, arm_tmr_spec, sc->tmr_res)) { - device_printf(dev, "could not allocate resources\n"); - return (ENXIO); - } - - /* Global timer interface */ - sc->gbl_bst = rman_get_bustag(sc->tmr_res[0]); - sc->gbl_bsh = rman_get_bushandle(sc->tmr_res[0]); - - /* Private per-CPU timer interface */ - sc->prv_bst = rman_get_bustag(sc->tmr_res[2]); - sc->prv_bsh = rman_get_bushandle(sc->tmr_res[2]); - - arm_tmr_sc = sc; - - /* Disable both timers to start off */ - tmr_prv_write_4(PRV_TIMER_CTRL, 0x00000000); - tmr_gbl_write_4(GBL_TIMER_CTRL, 0x00000000); - - if (bus_setup_intr(dev, sc->tmr_res[3], INTR_TYPE_CLK, arm_tmr_intr, - NULL, sc, &ihl) != 0) { - bus_release_resources(dev, arm_tmr_spec, sc->tmr_res); - device_printf(dev, "Unable to setup the clock irq handler.\n"); - return (ENXIO); - } + tmrtype = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + tc_err = ENXIO; + et_err = ENXIO; /* - * If the clock is fixed-frequency, setup and enable the global timer to - * use as the timecounter. If it's variable frequency it won't work as - * a timecounter. We also can't use it for DELAY(), so hopefully the - * platform provides its own implementation. If it doesn't, ours will + * If we're handling the global timer and it is fixed-frequency, set it + * up to use as a timecounter. If it's variable frequency it won't work + * as a timecounter. We also can't use it for DELAY(), so hopefully the + * platform provides its own implementation. If it doesn't, ours will * get used, but since the frequency isn't set, it will only use the * bogus loop counter. */ - if (fixed_freq) { - tmr_gbl_write_4(GBL_TIMER_CTRL, GBL_TIMER_CTRL_TIMER_ENABLE); - arm_tmr_timecount.tc_frequency = sc->clkfreq; - tc_init(&arm_tmr_timecount); + if (tmrtype & TMR_GBL) { + if (!arm_tmr_freq_varies) + tc_err = attach_tc(sc); + else if (bootverbose) + device_printf(sc->dev, + "not using variable-frequency device as timecounter"); + sc->memrid++; + sc->irqrid++; + } + + /* If we are handling the private timer, set it up as an eventtimer. */ + if (tmrtype & TMR_PRV) { + et_err = attach_et(sc); } /* - * Setup and register the eventtimer. Most event timers set their min - * and max period values to some value calculated from the clock - * frequency. We might not know yet what our runtime clock frequency - * will be, so we just use some safe values. A max of 2 seconds ensures - * that even if our base clock frequency is 2GHz (meaning a 4GHz CPU), - * we won't overflow our 32-bit timer count register. A min of 20 - * nanoseconds is pretty much completely arbitrary. + * If we didn't successfully set up a timecounter or eventtimer then we + * didn't actually attach at all, return error. */ - sc->et.et_name = "MPCore"; - sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU; - sc->et.et_quality = 1000; - sc->et.et_frequency = sc->clkfreq; - sc->et.et_min_period = 20 * SBT_1NS; - sc->et.et_max_period = 2 * SBT_1S; - sc->et.et_start = arm_tmr_start; - sc->et.et_stop = arm_tmr_stop; - sc->et.et_priv = sc; - et_register(&sc->et); - + if (tc_err != 0 && et_err != 0) { + return (ENXIO); + } return (0); } @@ -384,6 +452,8 @@ static devclass_t arm_tmr_devclass; EARLY_DRIVER_MODULE(mp_tmr, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0, BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE); +EARLY_DRIVER_MODULE(mp_tmr, ofwbus, arm_tmr_driver, arm_tmr_devclass, 0, 0, + BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE); /* * Handle a change in clock frequency. The mpcore timer runs at half the CPU @@ -404,10 +474,14 @@ void arm_tmr_change_frequency(uint64_t newfreq) { - if (arm_tmr_sc == NULL) - platform_arm_tmr_freq = newfreq; - else - et_change_frequency(&arm_tmr_sc->et, newfreq); + if (newfreq == ARM_TMR_FREQUENCY_VARIES) { + arm_tmr_freq_varies = true; + return; + } + + arm_tmr_freq = newfreq; + if (arm_tmr_et != NULL) + et_change_frequency(arm_tmr_et, newfreq); } /** @@ -424,12 +498,13 @@ arm_tmr_change_frequency(uint64_t newfre static void __used /* Must emit function code for the weak ref below. */ arm_tmr_DELAY(int usec) { + struct arm_tmr_softc *sc; int32_t counts_per_usec; int32_t counts; uint32_t first, last; /* Check the timers are setup, if not just use a for loop for the meantime */ - if (arm_tmr_sc == NULL || arm_tmr_timecount.tc_frequency == 0) { + if (arm_tmr_tc == NULL || arm_tmr_timecount.tc_frequency == 0) { for (; usec > 0; usec--) for (counts = 200; counts > 0; counts--) cpufunc_nullop(); /* Prevent gcc from optimizing @@ -438,6 +513,8 @@ arm_tmr_DELAY(int usec) return; } + sc = arm_tmr_tc->tc_priv; + /* Get the number of times to count */ counts_per_usec = ((arm_tmr_timecount.tc_frequency / 1000000) + 1); @@ -452,10 +529,10 @@ arm_tmr_DELAY(int usec) else counts = usec * counts_per_usec; - first = tmr_gbl_read_4(GBL_TIMER_COUNT_LOW); + first = tmr_gbl_read_4(sc, GBL_TIMER_COUNT_LOW); while (counts > 0) { - last = tmr_gbl_read_4(GBL_TIMER_COUNT_LOW); + last = tmr_gbl_read_4(sc, GBL_TIMER_COUNT_LOW); counts -= (int32_t)(last - first); first = last; } From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 03:55:56 2014 Return-Path: Delivered-To: svn-src-all@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 9E89B398; Sun, 26 Oct 2014 03:55: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 8890D2B1; Sun, 26 Oct 2014 03:55: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 s9Q3tumA034512; Sun, 26 Oct 2014 03:55:56 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q3tuqN034510; Sun, 26 Oct 2014 03:55:56 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260355.s9Q3tuqN034510@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 03:55:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273674 - stable/10/share/man/man4/man4.arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 03:55:56 -0000 Author: ian Date: Sun Oct 26 03:55:55 2014 New Revision: 273674 URL: https://svnweb.freebsd.org/changeset/base/273674 Log: MFC r271907: Add a man page for the cgem(4) driver. Added: stable/10/share/man/man4/man4.arm/cgem.4 - copied unchanged from r271907, head/share/man/man4/man4.arm/cgem.4 Modified: stable/10/share/man/man4/man4.arm/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/man4.arm/Makefile ============================================================================== --- stable/10/share/man/man4/man4.arm/Makefile Sun Oct 26 03:55:09 2014 (r273673) +++ stable/10/share/man/man4/man4.arm/Makefile Sun Oct 26 03:55:55 2014 (r273674) @@ -1,11 +1,13 @@ # $FreeBSD$ -MAN= devcfg.4 \ +MAN= cgem.4 \ + devcfg.4 \ mge.4 \ npe.4 \ ti_adc.4 -MLINKS= mge.4 if_mge.4 +MLINKS= cgem.4 if_cgem.4 +MLINKS+= mge.4 if_mge.4 MLINKS+=npe.4 if_npe.4 MANSUBDIR=/arm Copied: stable/10/share/man/man4/man4.arm/cgem.4 (from r271907, head/share/man/man4/man4.arm/cgem.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/man4.arm/cgem.4 Sun Oct 26 03:55:55 2014 (r273674, copy of r271907, head/share/man/man4/man4.arm/cgem.4) @@ -0,0 +1,297 @@ +.\" +.\" Copyright (c) 2014 Thomas Skibo +.\" 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. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" 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 August 26, 2014 +.Dt CGEM 4 +.Os +.Sh NAME +.Nm cgem +.Nd "Cadence GEM Gigabit Ethernet driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device ether" +.Cd "device miibus" +.Cd "device cgem" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the Cadence GEM (Gigabit Ethernet MAC). +The Cadence GEM is used in some SoC (System on a Chip) devices such as +the Xilinx Zynq-7000 and the Atmel SAMA5D3. +.Pp +The +.Nm +driver supports the following media types: +.Bl -tag -width ".Cm 10baseT/UTP" +.It Cm autoselect +Enable autoselection of the media type and options. +The user can manually override +the autoselected mode using +.Xr ifconfig 8 +or by adding media options to +.Xr rc.conf 5 . +.It Cm 10baseT/UTP +Set 10Mbps operation. +The +.Xr ifconfig 8 +.Cm mediaopt +option can also be used to select either +.Cm full-duplex +or +.Cm half-duplex +modes. +.It Cm 100baseTX +Set 100Mbps (Fast Ethernet) operation. +The +.Xr ifconfig 8 +.Cm mediaopt +option can also be used to select either +.Cm full-duplex +or +.Cm half-duplex +modes. +.It Cm 1000baseT +Set 1000Mbps (Gigabit Ethernet) operation over twisted pair. +The GEM supports 1000Mbps in +.Cm full-duplex +mode only. +.El +.Pp +The +.Nm +driver supports the following media options: +.Bl -tag -width ".Cm full-duplex" +.It Cm full-duplex +Force full-duplex operation. +.It Cm half-duplex +Force half-duplex operation. +.El +.Pp +The driver provides support for TCP/UDP/IP checksum offloading (although +disabled by default). +The device and driver also support 1536-byte frames for VLANs (vlanmtu). +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width "xxxxxxxx" +.It Va dev.cgem.%d.rxbufs +The number of receive buffers allocated to the hardware. +The default value is 256. +The maximum value is 511. +If this number is increased while the interface is UP, it will not +take effect until the next packet is received. +If this number is decreased while the interface is UP, buffers will +not be immediately removed from the receive buffer ring but the +number of buffers will decrease as packets are received until it +reaches the new value. +.It Va dev.cgem.%d.rxhangwar +This tunable enables a work-around to recover from receive hangs. +The default value is 1. +Set to 0 to disable the work-around. +.El +.Pp +The following read-only variables are available as +.Xr sysctl 8 +variables: +.Bl -tag -width "xxxxxxxx" +.It Va dev.cgem.%d._rxoverruns +This variable counts the number of receive packet buffer overrun interrupts. +.It Va dev.cgem.%d._rxnobufs +This variable counts the number of interrupts due to the GEM buffer ring +going empty. +.It Va dev.cgem.%d._rxdmamapfails +This variable is the number of times bus_dmamap_load_mbuf_sg(9) failed in +the receive path. +.It Va dev.cgem.%d._txfull +The number of times the GEM's transmit ring was full. +.It Va dev.cgem.%d._txdmamapfails +This variable is the number of times bus_dmamap_load_mbuf_sg(9) failed in +the transmit path. +.It Va dev.cgem.%d._txdefrags +This variable is the number of times the driver needed to call m_defrag(9) +because a packet queued for transmit had too many DMA segments. +.It Va dev.cgem.%d._txdefragfails +This variable is the number of times +.Xr m_defrag 9 +failed. +.It Va dev.cgem.%d.stats.* +The following variables are useful MAC counters supplied by the hardware: +.It Va dev.cgem.%d.stats.tx_bytes +A 64-bit counter of the number of bytes transmitted in frames without error. +.It Va dev.cgem.%d.stats.tx_frames +Counter of frames transmitted without error excluding pause frames. +.It Va dev.cgem.%d.stats.tx_frames_bcast +Counter of broadcast frames transmitted without error excluding +pause frames. +.It Va dev.cgem.%d.stats.tx_frames_multi +Counter of multicast frames transmitted without error excluding +pause frames. +.It Va dev.cgem.%d.stats.tx_frames_pause +Counter of pause frames transmitted without error. +.It Va dev.cgem.%d.stats.tx_frames_64b +Counter of 64 byte frames transmitted without error. +.It Va dev.cgem.%d.stats.tx_frames_65to127b +Counter of 65 to 127 byte frames transmitted without error. +.It Va dev.cgem.%d.stats.tx_frames_128to255b +Counter of 128 to 255 byte frames transmitted without error. +.It Va dev.cgem.%d.stats.tx_frames_256to511b +Counter of 256 to 511 byte frames transmitted without error. +.It Va dev.cgem.%d.stats.tx_frames_512to1023b +Counter of 512 to 1023 byte frames transmitted without error. +.It Va dev.cgem.%d.stats.tx_frames_1024to1536b +Counter of 1024 to 1536 byte frames transmitted without error. +.It Va dev.cgem.%d.stats.tx_under_runs +Counter of frames not transmitted due to a transmit underrun. +.It Va dev.cgem.%d.stats.tx_single_collisn +Counter of frames experiencing a single collision before being successfully +transmitted. +.It Va dev.cgem.%d.stats.tx_multi_collisn +Counter of frames experiencing between 2 and 15 collisions before +being successfully transmitted. +.It Va dev.cgem.%d.stats.tx_excsv_collisn +Counter of frames that failed to transmit because they experienced 16 +collisions. +.It Va dev.cgem.%d.stats.tx_late_collisn +Counter of frames that experienced a late collision. +.It Va dev.cgem.%d.stats.tx_deferred_frames +Counter of frames experiencing deferral due to carrier sense being +active on their first attempt at transmission. +.It Va dev.cgem.%d.stats.tx_carrier_sense_errs +Counter of frames transmitted where carrier sense was not seen during +transmission or where carrier sense was deasserted after being asserted +in a transmit frame without collision. +.It Va dev.cgem.%d.stats.rx_bytes +A 64-bit counter of bytes received without error excluding pause +frames. +.It Va dev.cgem.%d.stats.rx_frames +Counter of frames received without error excluding pause frames. +.It Va dev.cgem.%d.stats.rx_frames_bcast +Counter of broadcast frames receive without error excluding pause frames. +.It Va dev.cgem.%d.stats.rx_frames_multi +Counter of multicast frames receive without error excluding pause frames. +.It Va dev.cgem.%d.stats.rx_frames_pause +Counter of pause frames recevied without error. +.It Va dev.cgem.%d.stats.rx_frames_64b +Counter of 64-byte frames received without error. +.It Va dev.cgem.%d.stats.rx_frames_65to127b +Counter of 65 to 127 byte frames received without error. +.It Va dev.cgem.%d.stats.rx_frames_128to255b +Counter of 128 to 255 byte frames received without error. +.It Va dev.cgem.%d.stats.rx_frames_256to511b +Counter of 256 to 511 byte frames received without error. +.It Va dev.cgem.%d.stats.rx_frames_512to1023b +Counter of 512 to 1023 byte frames received without error. +.It Va dev.cgem.%d.stats.rx_frames_1024to1536b +Counter of 1024 to 1536 byte frames received without error. +.It Va dev.cgem.%d.stats.rx_frames_undersize +Counter of frames received less than 64 bytes in length that +do not also have either a CRC error or an alignment error. +.It Va dev.cgem.%d.stats.rx_frames_oversize +Counter of frames received exceeding 1536 bytes and do not also have either +a CRC error or an alignment error. +.It Va dev.cgem.%d.stats.rx_frames_jabber +Counter of frames received exceeding 1536 bytes and also have either a CRC +error, an alignment error, or a receive symbol error. +.It Va dev.cgem.%d.stats.rx_frames_fcs_errs +Counter of frames received with a bad CRC and are between 64 +and 1536 bytes. +.It Va dev.cgem.%d.stats.rx_frames_length_errs +Counter of frames received that are shorter than that extracted +from the length field. +.It Va dev.cgem.%d.stats.rx_symbol_errs +Counter of receive symbol errors. +.It Va dev.cgem.%d.stats.rx_align_errs +Counter of received frames that are not an integral number of bytes. +.It Va dev.cgem.%d.stats.rx_resource_errs +Counter of frames successfully receive by the MAC but could not be +copied to memory because no receive buffer was available. +.It Va dev.cgem.%d.stats.rx_overrun_errs +Counter of frames that are address recognized but were not copied +to memory due to a receive overrun. +.It Va dev.cgem.%d.stats.rx_frames_ip_hdr_csum_errs +Counter of frames discarded due to an incorrect IP header checksum when +checksum offloading is enabled. +.It Va dev.cgem.%d.stats.rx_frames_tcp_csum_errs +Counter of frames discarded due to an incorrect TCP checksum when +checksum offloading is enabled. +.It Va dev.cgem.%d.stats.rx_frames_udp_csum_errs +Counter of frames discarded due to an incorrect UDP checksum when +checksum offloading is enabled. +.El +.Sh BUGS +The GEM can perform TCP/UDP/IP checksum offloading. +However, when transmit checksum offloading is enabled, the GEM generates and +replaces checksums for all packets it transmits. +In a system that is forwarding packets, the device could potentially correct +the checksum of packet that was corrupted in transit. +For this reason, checksum offloading is disabled by default but can be +enabled using ifconfig(8). +.Pp +When receive checksum offloading is enabled, the device will discard packets +with bad TCP/UDP/IP checksums. +The bad packets will not be counted in any +.Xr netstat 1 +statistics. There are +.Xr sysctl 8 +variables that count +packets discarded by the hardware (see below). +.Pp +The GEM used in the Zynq-7000 has a bug such that the receiver can +potentially freeze up under a high load. The issue is described in sec. 16.7 +"Known Issues" of the Zynq-7000 SoC Technical Reference Manual (Xilinx +UG585 v1.7). +The +.Nm +driver implements the work-around suggested in the manual. +If the bug does not exist in other versions of this device, the +work-around can be disabled by setting the dev.cgem.%d.rxhangwar +.Xr sysctl 8 +variable to 0. +.Pp +.Sh SEE ALSO +.Xr miibus 4 , +.Xr ifconfig 8 +.Rs +.%T "Zynq-7000 SoC Technical Reference Manual (Xilinx doc UG585)" +.%U http://www.xilinx.com/support/documentation/user_guides/\:ug585-Zynq-7000-TRM.pdf +.Re +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +driver and this manual page was written by +.An Thomas Skibo Aq Mt thomasskibo@yahoo.com . From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 04:02:00 2014 Return-Path: Delivered-To: svn-src-all@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 DA29B507; Sun, 26 Oct 2014 04:02: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 C4387372; Sun, 26 Oct 2014 04:02: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 s9Q420N9038800; Sun, 26 Oct 2014 04:02:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q41woA038780; Sun, 26 Oct 2014 04:01:58 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260401.s9Q41woA038780@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 04:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273675 - in stable/10/sys: dev/fdt dev/ofw mips/beri powerpc/ofw powerpc/pseries X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 04:02:01 -0000 Author: ian Date: Sun Oct 26 04:01:57 2014 New Revision: 273675 URL: https://svnweb.freebsd.org/changeset/base/273675 Log: MFC r272109, r272181: Replace multiple nearly-identical copies of code to walk through an FDT node's interrupts=<...> property creating resource list entries with a single common implementation. This change makes ofw_bus_intr_to_rl() the one true copy of that code and removes the copies of it from other places. This also adds handling of the interrupts-extended property. Modified: stable/10/sys/dev/fdt/fdt_common.c stable/10/sys/dev/fdt/fdt_common.h stable/10/sys/dev/fdt/simplebus.c stable/10/sys/dev/ofw/ofw_bus_subr.c stable/10/sys/dev/ofw/ofw_bus_subr.h stable/10/sys/dev/ofw/ofwbus.c stable/10/sys/mips/beri/beri_simplebus.c stable/10/sys/powerpc/ofw/ofw_pcibus.c stable/10/sys/powerpc/pseries/vdevice.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/fdt/fdt_common.c ============================================================================== --- stable/10/sys/dev/fdt/fdt_common.c Sun Oct 26 03:55:55 2014 (r273674) +++ stable/10/sys/dev/fdt/fdt_common.c Sun Oct 26 04:01:57 2014 (r273675) @@ -494,46 +494,6 @@ out: } int -fdt_intr_to_rl(device_t dev, phandle_t node, struct resource_list *rl, - struct fdt_sense_level *intr_sl) -{ - phandle_t iparent; - uint32_t *intr, icells; - int nintr, i, k; - - nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), - (void **)&intr); - if (nintr > 0) { - if (OF_searchencprop(node, "interrupt-parent", &iparent, - sizeof(iparent)) == -1) { - device_printf(dev, "No interrupt-parent found, " - "assuming direct parent\n"); - iparent = OF_parent(node); - } - if (OF_searchencprop(OF_node_from_xref(iparent), - "#interrupt-cells", &icells, sizeof(icells)) == -1) { - device_printf(dev, "Missing #interrupt-cells property, " - "assuming <1>\n"); - icells = 1; - } - if (icells < 1 || icells > nintr) { - device_printf(dev, "Invalid #interrupt-cells property " - "value <%d>, assuming <1>\n", icells); - icells = 1; - } - for (i = 0, k = 0; i < nintr; i += icells, k++) { - intr[i] = ofw_bus_map_intr(dev, iparent, icells, - &intr[i]); - resource_list_add(rl, SYS_RES_IRQ, k, intr[i], intr[i], - 1); - } - free(intr, M_OFWPROP); - } - - return (0); -} - -int fdt_get_phyaddr(phandle_t node, device_t dev, int *phy_addr, void **phy_sc) { phandle_t phy_node; Modified: stable/10/sys/dev/fdt/fdt_common.h ============================================================================== --- stable/10/sys/dev/fdt/fdt_common.h Sun Oct 26 03:55:55 2014 (r273674) +++ stable/10/sys/dev/fdt/fdt_common.h Sun Oct 26 04:01:57 2014 (r273675) @@ -88,7 +88,6 @@ int fdt_get_phyaddr(phandle_t, device_t, int fdt_get_range(phandle_t, int, u_long *, u_long *); int fdt_immr_addr(vm_offset_t); int fdt_regsize(phandle_t, u_long *, u_long *); -int fdt_intr_to_rl(device_t, phandle_t, struct resource_list *, struct fdt_sense_level *); int fdt_is_compatible(phandle_t, const char *); int fdt_is_compatible_strict(phandle_t, const char *); int fdt_is_enabled(phandle_t); Modified: stable/10/sys/dev/fdt/simplebus.c ============================================================================== --- stable/10/sys/dev/fdt/simplebus.c Sun Oct 26 03:55:55 2014 (r273674) +++ stable/10/sys/dev/fdt/simplebus.c Sun Oct 26 04:01:57 2014 (r273675) @@ -247,11 +247,9 @@ simplebus_setup_dinfo(device_t dev, phan { struct simplebus_softc *sc; struct simplebus_devinfo *ndi; - uint32_t *reg, *intr, icells; + uint32_t *reg; uint64_t phys, size; - phandle_t iparent; int i, j, k; - int nintr; int nreg; sc = device_get_softc(dev); @@ -289,34 +287,7 @@ simplebus_setup_dinfo(device_t dev, phan } free(reg, M_OFWPROP); - nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), - (void **)&intr); - if (nintr > 0) { - if (OF_searchencprop(node, "interrupt-parent", &iparent, - sizeof(iparent)) == -1) { - device_printf(dev, "No interrupt-parent found, " - "assuming direct parent\n"); - iparent = OF_parent(node); - } - if (OF_searchencprop(OF_node_from_xref(iparent), - "#interrupt-cells", &icells, sizeof(icells)) == -1) { - device_printf(dev, "Missing #interrupt-cells property, " - "assuming <1>\n"); - icells = 1; - } - if (icells < 1 || icells > nintr) { - device_printf(dev, "Invalid #interrupt-cells property " - "value <%d>, assuming <1>\n", icells); - icells = 1; - } - for (i = 0, k = 0; i < nintr; i += icells, k++) { - intr[i] = ofw_bus_map_intr(dev, iparent, icells, - &intr[i]); - resource_list_add(&ndi->rl, SYS_RES_IRQ, k, intr[i], - intr[i], 1); - } - free(intr, M_OFWPROP); - } + ofw_bus_intr_to_rl(dev, node, &ndi->rl); return (ndi); } Modified: stable/10/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- stable/10/sys/dev/ofw/ofw_bus_subr.c Sun Oct 26 03:55:55 2014 (r273674) +++ stable/10/sys/dev/ofw/ofw_bus_subr.c Sun Oct 26 04:01:57 2014 (r273675) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include @@ -367,3 +369,64 @@ ofw_bus_search_intrmap(void *intr, int i return (0); } +int +ofw_bus_intr_to_rl(device_t dev, phandle_t node, struct resource_list *rl) +{ + phandle_t iparent; + uint32_t icells, *intr; + int err, i, irqnum, nintr, rid; + boolean_t extended; + + nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), + (void **)&intr); + if (nintr > 0) { + if (OF_searchencprop(node, "interrupt-parent", &iparent, + sizeof(iparent)) == -1) { + device_printf(dev, "No interrupt-parent found, " + "assuming direct parent\n"); + iparent = OF_parent(node); + } + if (OF_searchencprop(OF_node_from_xref(iparent), + "#interrupt-cells", &icells, sizeof(icells)) == -1) { + device_printf(dev, "Missing #interrupt-cells " + "property, assuming <1>\n"); + icells = 1; + } + if (icells < 1 || icells > nintr) { + device_printf(dev, "Invalid #interrupt-cells property " + "value <%d>, assuming <1>\n", icells); + icells = 1; + } + extended = false; + } else { + nintr = OF_getencprop_alloc(node, "interrupts-extended", + sizeof(*intr), (void **)&intr); + if (nintr <= 0) + return (0); + extended = true; + } + err = 0; + rid = 0; + for (i = 0; i < nintr; i += icells) { + if (extended) { + iparent = intr[i++]; + if (OF_searchencprop(OF_node_from_xref(iparent), + "#interrupt-cells", &icells, sizeof(icells)) == -1) { + device_printf(dev, "Missing #interrupt-cells " + "property\n"); + err = ENOENT; + break; + } + if (icells < 1 || (i + icells) > nintr) { + device_printf(dev, "Invalid #interrupt-cells " + "property value <%d>\n", icells); + err = ERANGE; + break; + } + } + irqnum = ofw_bus_map_intr(dev, iparent, icells, &intr[i]); + resource_list_add(rl, SYS_RES_IRQ, rid++, irqnum, irqnum, 1); + } + free(intr, M_OFWPROP); + return (err); +} Modified: stable/10/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- stable/10/sys/dev/ofw/ofw_bus_subr.h Sun Oct 26 03:55:55 2014 (r273674) +++ stable/10/sys/dev/ofw/ofw_bus_subr.h Sun Oct 26 04:01:57 2014 (r273675) @@ -72,6 +72,9 @@ int ofw_bus_lookup_imap(phandle_t, struc int ofw_bus_search_intrmap(void *, int, void *, int, void *, int, void *, void *, void *, int, phandle_t *); +/* Routines for parsing device-tree data into resource lists. */ +int ofw_bus_intr_to_rl(device_t, phandle_t, struct resource_list *); + /* Helper to get device status property */ const char *ofw_bus_get_status(device_t dev); int ofw_bus_status_okay(device_t dev); Modified: stable/10/sys/dev/ofw/ofwbus.c ============================================================================== --- stable/10/sys/dev/ofw/ofwbus.c Sun Oct 26 03:55:55 2014 (r273674) +++ stable/10/sys/dev/ofw/ofwbus.c Sun Oct 26 04:01:57 2014 (r273675) @@ -436,11 +436,9 @@ ofwbus_setup_dinfo(device_t dev, phandle struct ofwbus_softc *sc; struct ofwbus_devinfo *ndi; const char *nodename; - uint32_t *reg, *intr, icells; + uint32_t *reg; uint64_t phys, size; - phandle_t iparent; int i, j, rid; - int nintr; int nreg; sc = device_get_softc(dev); @@ -485,35 +483,7 @@ ofwbus_setup_dinfo(device_t dev, phandle } free(reg, M_OFWPROP); - nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), - (void **)&intr); - if (nintr > 0) { - if (OF_searchencprop(node, "interrupt-parent", &iparent, - sizeof(iparent)) == -1) { - device_printf(dev, "No interrupt-parent found, " - "assuming nexus on <%s>\n", nodename); - iparent = 0xffffffff; - } - if (OF_searchencprop(OF_node_from_xref(iparent), - "#interrupt-cells", &icells, sizeof(icells)) == -1) { - device_printf(dev, "Missing #interrupt-cells property, " - "assuming <1> on <%s>\n", nodename); - icells = 1; - } - if (icells < 1 || icells > nintr) { - device_printf(dev, "Invalid #interrupt-cells property " - "value <%d>, assuming <1> on <%s>\n", icells, - nodename); - icells = 1; - } - for (i = 0, rid = 0; i < nintr; i += icells, rid++) { - intr[i] = ofw_bus_map_intr(dev, iparent, icells, - &intr[i]); - resource_list_add(&ndi->ndi_rl, SYS_RES_IRQ, rid, intr[i], - intr[i], 1); - } - free(intr, M_OFWPROP); - } + ofw_bus_intr_to_rl(dev, node, &ndi->ndi_rl); return (ndi); } Modified: stable/10/sys/mips/beri/beri_simplebus.c ============================================================================== --- stable/10/sys/mips/beri/beri_simplebus.c Sun Oct 26 03:55:55 2014 (r273674) +++ stable/10/sys/mips/beri/beri_simplebus.c Sun Oct 26 04:01:57 2014 (r273675) @@ -197,7 +197,7 @@ simplebus_attach(device_t dev) continue; } - if (fdt_intr_to_rl(dev, dt_child, &di->di_res, di->di_intr_sl)) { + if (ofw_bus_intr_to_rl(dev, dt_child, &di->di_res)) { device_printf(dev, "%s: could not process " "'interrupts' property\n", di->di_ofw.obd_name); resource_list_free(&di->di_res); Modified: stable/10/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- stable/10/sys/powerpc/ofw/ofw_pcibus.c Sun Oct 26 03:55:55 2014 (r273674) +++ stable/10/sys/powerpc/ofw/ofw_pcibus.c Sun Oct 26 04:01:57 2014 (r273675) @@ -200,29 +200,8 @@ ofw_pcibus_enum_devtree(device_t dev, u_ * interrupts property, so add that value to the device's * resource list. */ - if (dinfo->opd_dinfo.cfg.intpin == 0) { - ofw_pci_intr_t intr[2]; - phandle_t iparent; - int icells; - - if (OF_getprop(child, "interrupts", &intr, - sizeof(intr)) > 0) { - iparent = 0; - icells = 1; - OF_getprop(child, "interrupt-parent", &iparent, - sizeof(iparent)); - if (iparent != 0) { - OF_getprop(OF_node_from_xref(iparent), - "#interrupt-cells", &icells, - sizeof(icells)); - intr[0] = ofw_bus_map_intr(dev, iparent, - icells, intr); - } - - resource_list_add(&dinfo->opd_dinfo.resources, - SYS_RES_IRQ, 0, intr[0], intr[0], 1); - } - } + if (dinfo->opd_dinfo.cfg.intpin == 0) + ofw_bus_intr_to_rl(dev, child, &dinfo->opd_dinfo.resources); } } Modified: stable/10/sys/powerpc/pseries/vdevice.c ============================================================================== --- stable/10/sys/powerpc/pseries/vdevice.c Sun Oct 26 03:55:55 2014 (r273674) +++ stable/10/sys/powerpc/pseries/vdevice.c Sun Oct 26 04:01:57 2014 (r273675) @@ -128,8 +128,6 @@ vdevice_attach(device_t dev) { phandle_t root, child; device_t cdev; - int icells, i, nintr, *intr; - phandle_t iparent; struct vdevice_devinfo *dinfo; root = ofw_bus_get_node(dev); @@ -144,25 +142,7 @@ vdevice_attach(device_t dev) } resource_list_init(&dinfo->mdi_resources); - if (OF_searchprop(child, "#interrupt-cells", &icells, - sizeof(icells)) <= 0) - icells = 2; - if (OF_getprop(child, "interrupt-parent", &iparent, - sizeof(iparent)) <= 0) - iparent = -1; - nintr = OF_getprop_alloc(child, "interrupts", sizeof(*intr), - (void **)&intr); - if (nintr > 0) { - for (i = 0; i < nintr; i += icells) { - u_int irq = intr[i]; - if (iparent != -1) - irq = ofw_bus_map_intr(dev, iparent, - icells, &intr[i]); - - resource_list_add(&dinfo->mdi_resources, - SYS_RES_IRQ, i, irq, irq, i); - } - } + ofw_bus_intr_to_rl(dev, child, &dinfo->mdi_resources); cdev = device_add_child(dev, NULL, -1); if (cdev == NULL) { From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 04:06:30 2014 Return-Path: Delivered-To: svn-src-all@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 71234664; Sun, 26 Oct 2014 04:06: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 574EA388; Sun, 26 Oct 2014 04:06: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 s9Q46UGA039390; Sun, 26 Oct 2014 04:06:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q46UNm039389; Sun, 26 Oct 2014 04:06:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260406.s9Q46UNm039389@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 04:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273676 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 04:06:30 -0000 Author: ian Date: Sun Oct 26 04:06:29 2014 New Revision: 273676 URL: https://svnweb.freebsd.org/changeset/base/273676 Log: MFC r272333: Honor exclusion flags when building the memory lists. Modified: stable/10/sys/arm/arm/physmem.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/physmem.c ============================================================================== --- stable/10/sys/arm/arm/physmem.c Sun Oct 26 04:01:57 2014 (r273675) +++ stable/10/sys/arm/arm/physmem.c Sun Oct 26 04:06:29 2014 (r273676) @@ -168,6 +168,12 @@ regions_to_avail(vm_paddr_t *avail, uint end = hwp->size + start; realmem += arm32_btop(end - start); for (exi = 0, exp = exregions; exi < excnt; ++exi, ++exp) { + /* + * If the excluded region does not match given flags, + * continue checking with the next excluded region. + */ + if ((exp->flags & exflags) == 0) + continue; xstart = exp->addr; xend = exp->size + xstart; /* From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 04:08:35 2014 Return-Path: Delivered-To: svn-src-all@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 EA3847B0; Sun, 26 Oct 2014 04:08: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 C55CB399; Sun, 26 Oct 2014 04:08: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 s9Q48Yl0039686; Sun, 26 Oct 2014 04:08:34 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q48Yt1039685; Sun, 26 Oct 2014 04:08:34 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260408.s9Q48Yt1039685@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 04:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273677 - stable/10/sys/dev/uart X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 04:08:35 -0000 Author: ian Date: Sun Oct 26 04:08:34 2014 New Revision: 273677 URL: https://svnweb.freebsd.org/changeset/base/273677 Log: MFC r272334, r273004: Return the actual baud rate programmed in the hardware rather than 115200. This allows the "3wire" entry in /etc/ttys (with no speed specified) to work. Use the FIFOs in the imx5/imx6 uart hardware instead of interrupting on each byte sent or received. Modified: stable/10/sys/dev/uart/uart_dev_imx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/uart/uart_dev_imx.c ============================================================================== --- stable/10/sys/dev/uart/uart_dev_imx.c Sun Oct 26 04:06:29 2014 (r273676) +++ stable/10/sys/dev/uart/uart_dev_imx.c Sun Oct 26 04:08:34 2014 (r273677) @@ -49,6 +49,17 @@ __FBSDID("$FreeBSD$"); #include /* + * The hardare FIFOs are 32 bytes. We want an interrupt when there are 24 bytes + * available to read or space for 24 more bytes to write. While 8 bytes of + * slack before over/underrun might seem excessive, the hardware can run at + * 5mbps, which means 2uS per char, so at full speed 8 bytes provides only 16uS + * to get into the interrupt handler and service the fifo. + */ +#define IMX_FIFOSZ 32 +#define IMX_RXFIFO_LEVEL 24 +#define IMX_TXFIFO_LEVEL 24 + +/* * Low-level UART interface. */ static int imx_uart_probe(struct uart_bas *bas); @@ -90,6 +101,45 @@ imx_uart_probe(struct uart_bas *bas) return (0); } +static u_int +imx_uart_getbaud(struct uart_bas *bas) +{ + uint32_t rate, ubir, ubmr; + u_int baud, blo, bhi, i; + static const u_int predivs[] = {6, 5, 4, 3, 2, 1, 7, 1}; + static const u_int std_rates[] = { + 9600, 14400, 19200, 38400, 57600, 115200, 230400, 460800, 921600 + }; + + /* + * Get the baud rate the hardware is programmed for, then search the + * table of standard baud rates for a number that's within 3% of the + * actual rate the hardware is programmed for. It's more comforting to + * see that your console is running at 115200 than 114942. Note that + * here we cannot make a simplifying assumption that the predivider and + * numerator are 1 (like we do when setting the baud rate), because we + * don't know what u-boot might have set up. + */ + i = (GETREG(bas, REG(UFCR)) & IMXUART_UFCR_RFDIV_MASK) >> + IMXUART_UFCR_RFDIV_SHIFT; + rate = imx_ccm_uart_hz() / predivs[i]; + ubir = GETREG(bas, REG(UBIR)) + 1; + ubmr = GETREG(bas, REG(UBMR)) + 1; + baud = ((rate / 16 ) * ubir) / ubmr; + + blo = (baud * 100) / 103; + bhi = (baud * 100) / 97; + for (i = 0; i < nitems(std_rates); i++) { + rate = std_rates[i]; + if (rate >= blo && rate <= bhi) { + baud = rate; + break; + } + } + + return (baud); +} + static void imx_uart_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, int parity) @@ -148,6 +198,17 @@ imx_uart_init(struct uart_bas *bas, int SETREG(bas, REG(UBIR), 15); SETREG(bas, REG(UBMR), (baseclk / baudrate) - 1); } + + /* + * Program the tx lowater and rx hiwater levels at which fifo-service + * interrupts are signaled. The tx value is interpetted as "when there + * are only this many bytes remaining" (not "this many free"). + */ + reg = GETREG(bas, REG(UFCR)); + reg &= ~(IMXUART_UFCR_TXTL_MASK | IMXUART_UFCR_RXTL_MASK); + reg |= (IMX_FIFOSZ - IMX_TXFIFO_LEVEL) << IMXUART_UFCR_TXTL_SHIFT; + reg |= IMX_RXFIFO_LEVEL << IMXUART_UFCR_RXTL_SHIFT; + SETREG(bas, REG(UFCR), reg); } static void @@ -160,7 +221,7 @@ static void imx_uart_putc(struct uart_bas *bas, int c) { - while (!(IS(bas, USR2, TXFE))) + while (!(IS(bas, USR1, TRDY))) ; SETREG(bas, REG(UTXD), c); } @@ -263,11 +324,15 @@ imx_uart_bus_attach(struct uart_softc *s (void)imx_uart_bus_getsig(sc); - ENA(bas, UCR4, DREN); - DIS(bas, UCR1, RRDYEN); + /* Clear all pending interrupts. */ + SETREG(bas, REG(USR1), 0xffff); + SETREG(bas, REG(USR2), 0xffff); + + DIS(bas, UCR4, DREN); + ENA(bas, UCR1, RRDYEN); DIS(bas, UCR1, IDEN); DIS(bas, UCR3, RXDSEN); - DIS(bas, UCR2, ATEN); + ENA(bas, UCR2, ATEN); DIS(bas, UCR1, TXMPTYEN); DIS(bas, UCR1, TRDYEN); DIS(bas, UCR4, TCEN); @@ -291,9 +356,6 @@ imx_uart_bus_attach(struct uart_softc *s ENA(bas, UCR2, IRTS); ENA(bas, UCR3, RXDMUXSEL); - /* ACK all interrupts */ - SETREG(bas, REG(USR1), 0xffff); - SETREG(bas, REG(USR2), 0xffff); return (0); } @@ -348,8 +410,7 @@ imx_uart_bus_ioctl(struct uart_softc *sc /* TODO */ break; case UART_IOCTL_BAUD: - /* TODO */ - *(int*)data = 115200; + *(u_int*)data = imx_uart_getbaud(bas); break; default: error = EINVAL; @@ -366,7 +427,7 @@ imx_uart_bus_ipend(struct uart_softc *sc struct uart_bas *bas; int ipend; uint32_t usr1, usr2; - uint32_t ucr1, ucr4; + uint32_t ucr1, ucr2, ucr4; bas = &sc->sc_bas; ipend = 0; @@ -381,18 +442,28 @@ imx_uart_bus_ipend(struct uart_softc *sc SETREG(bas, REG(USR2), usr2); ucr1 = GETREG(bas, REG(UCR1)); + ucr2 = GETREG(bas, REG(UCR2)); ucr4 = GETREG(bas, REG(UCR4)); - if ((usr2 & FLD(USR2, TXFE)) && (ucr1 & FLD(UCR1, TXMPTYEN))) { - DIS(bas, UCR1, TXMPTYEN); - /* Continue TXing */ + /* If we have reached tx low-water, we can tx some more now. */ + if ((usr1 & FLD(USR1, TRDY)) && (ucr1 & FLD(UCR1, TRDYEN))) { + DIS(bas, UCR1, TRDYEN); ipend |= SER_INT_TXIDLE; } - if ((usr2 & FLD(USR2, RDR)) && (ucr4 & FLD(UCR4, DREN))) { - DIS(bas, UCR4, DREN); - /* Wow, new char on input */ + + /* + * If we have reached the rx high-water, or if there are bytes in the rx + * fifo and no new data has arrived for 8 character periods (aging + * timer), we have input data to process. + */ + if (((usr1 & FLD(USR1, RRDY)) && (ucr1 & FLD(UCR1, RRDYEN))) || + ((usr1 & FLD(USR1, AGTIM)) && (ucr2 & FLD(UCR2, ATEN)))) { + DIS(bas, UCR1, RRDYEN); + DIS(bas, UCR2, ATEN); ipend |= SER_INT_RXREADY; } + + /* A break can come in at any time, it never gets disabled. */ if ((usr2 & FLD(USR2, BRCD)) && (ucr4 & FLD(UCR4, BKEN))) ipend |= SER_INT_BREAK; @@ -421,8 +492,14 @@ imx_uart_bus_probe(struct uart_softc *sc if (error) return (error); - sc->sc_rxfifosz = 1; - sc->sc_txfifosz = 1; + /* + * On input we can read up to the full fifo size at once. On output, we + * want to write only as much as the programmed tx low water level, + * because that's all we can be certain we have room for in the fifo + * when we get a tx-ready interrupt. + */ + sc->sc_rxfifosz = IMX_FIFOSZ; + sc->sc_txfifosz = IMX_TXFIFO_LEVEL; device_set_desc(sc->sc_dev, "Freescale i.MX UART"); return (0); @@ -437,20 +514,20 @@ imx_uart_bus_receive(struct uart_softc * bas = &sc->sc_bas; uart_lock(sc->sc_hwmtx); - /* Read while we have anything in FIFO */ + /* + * Empty the rx fifo. We get the RRDY interrupt when IMX_RXFIFO_LEVEL + * (the rx high-water level) is reached, but we set sc_rxfifosz to the + * full hardware fifo size, so we can safely process however much is + * there, not just the highwater size. + */ while (IS(bas, USR2, RDR)) { if (uart_rx_full(sc)) { /* No space left in input buffer */ sc->sc_rxbuf[sc->sc_rxput] = UART_STAT_OVERRUN; break; } - out = 0; xc = GETREG(bas, REG(URXD)); - - /* We have valid char */ - if (xc & FLD(URXD, CHARRDY)) - out = xc & 0x000000ff; - + out = xc & 0x000000ff; if (xc & FLD(URXD, FRMERR)) out |= UART_STAT_FRAMERR; if (xc & FLD(URXD, PRERR)) @@ -462,8 +539,8 @@ imx_uart_bus_receive(struct uart_softc * uart_rx_put(sc, out); } - /* Reenable Data Ready interrupt */ - ENA(bas, UCR4, DREN); + ENA(bas, UCR1, RRDYEN); + ENA(bas, UCR2, ATEN); uart_unlock(sc->sc_hwmtx); return (0); @@ -485,14 +562,17 @@ imx_uart_bus_transmit(struct uart_softc bas = &sc->sc_bas; uart_lock(sc->sc_hwmtx); - /* Fill TX FIFO */ + /* + * Fill the tx fifo. The uart core puts at most IMX_TXFIFO_LEVEL bytes + * into the txbuf (because that's what sc_txfifosz is set to), and + * because we got the TRDY (low-water reached) interrupt we know at + * least that much space is available in the fifo. + */ for (i = 0; i < sc->sc_txdatasz; i++) { SETREG(bas, REG(UTXD), sc->sc_txbuf[i] & 0xff); } - sc->sc_txbusy = 1; - /* Call me when ready */ - ENA(bas, UCR1, TXMPTYEN); + ENA(bas, UCR1, TRDYEN); uart_unlock(sc->sc_hwmtx); @@ -506,7 +586,8 @@ imx_uart_bus_grab(struct uart_softc *sc) bas = &sc->sc_bas; uart_lock(sc->sc_hwmtx); - DIS(bas, UCR4, DREN); + DIS(bas, UCR1, RRDYEN); + DIS(bas, UCR2, ATEN); uart_unlock(sc->sc_hwmtx); } @@ -517,6 +598,7 @@ imx_uart_bus_ungrab(struct uart_softc *s bas = &sc->sc_bas; uart_lock(sc->sc_hwmtx); - ENA(bas, UCR4, DREN); + ENA(bas, UCR1, RRDYEN); + ENA(bas, UCR2, ATEN); uart_unlock(sc->sc_hwmtx); } From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 04:10:18 2014 Return-Path: Delivered-To: svn-src-all@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 762579CC; Sun, 26 Oct 2014 04:10: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 5A9783B7; Sun, 26 Oct 2014 04:10: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 s9Q4AITY040144; Sun, 26 Oct 2014 04:10:18 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q4AIqU040143; Sun, 26 Oct 2014 04:10:18 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260410.s9Q4AIqU040143@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 04:10:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273678 - stable/10/sys/dev/fdt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 04:10:18 -0000 Author: ian Date: Sun Oct 26 04:10:17 2014 New Revision: 273678 URL: https://svnweb.freebsd.org/changeset/base/273678 Log: MFC r273282: Fail to probe on simplebus nodes that lack a "ranges" property. Modified: stable/10/sys/dev/fdt/simplebus.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/fdt/simplebus.c ============================================================================== --- stable/10/sys/dev/fdt/simplebus.c Sun Oct 26 04:08:34 2014 (r273677) +++ stable/10/sys/dev/fdt/simplebus.c Sun Oct 26 04:10:17 2014 (r273678) @@ -133,7 +133,13 @@ simplebus_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "simple-bus") && + /* + * FDT data puts a "simple-bus" compatible string on many things that + * have children but aren't really busses in our world. Without a + * ranges property we will fail to attach, so just fail to probe too. + */ + if (!(ofw_bus_is_compatible(dev, "simple-bus") && + ofw_bus_has_prop(dev, "ranges")) && (ofw_bus_get_type(dev) == NULL || strcmp(ofw_bus_get_type(dev), "soc") != 0)) return (ENXIO); From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 04:11:33 2014 Return-Path: Delivered-To: svn-src-all@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 8D47BAFE; Sun, 26 Oct 2014 04:11: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 6937562C; Sun, 26 Oct 2014 04:11: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 s9Q4BX1o042893; Sun, 26 Oct 2014 04:11:33 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q4BXlf042873; Sun, 26 Oct 2014 04:11:33 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260411.s9Q4BXlf042873@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 04:11:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273679 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 04:11:33 -0000 Author: ian Date: Sun Oct 26 04:11:32 2014 New Revision: 273679 URL: https://svnweb.freebsd.org/changeset/base/273679 Log: MFC r273283: Attach this driver during BUS_PASS_BUS and move the cpu init code to a bus_new_pass() handler so it doesn't happen until BUS_PASS_CPU. This allows the anatop driver to outbid the generic simplebus driver (which the FDT data describes as compatible). Modified: stable/10/sys/arm/freescale/imx/imx6_anatop.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_anatop.c Sun Oct 26 04:10:17 2014 (r273678) +++ stable/10/sys/arm/freescale/imx/imx6_anatop.c Sun Oct 26 04:11:32 2014 (r273679) @@ -98,6 +98,7 @@ struct imx6_anatop_softc { uint32_t cpu_maxmv; uint32_t cpu_maxmhz_hw; boolean_t cpu_overclock_enable; + boolean_t cpu_init_done; uint32_t refosc_mhz; void *temp_intrhand; uint32_t temp_high_val; @@ -626,6 +627,31 @@ intr_setup(void *arg) config_intrhook_disestablish(&sc->intr_setup_hook); } +static void +imx6_anatop_new_pass(device_t dev) +{ + struct imx6_anatop_softc *sc; + const int cpu_init_pass = BUS_PASS_CPU + BUS_PASS_ORDER_MIDDLE; + + /* + * We attach during BUS_PASS_BUS (because some day we will be a + * simplebus that has regulator devices as children), but some of our + * init work cannot be done until BUS_PASS_CPU (we rely on other devices + * that attach on the CPU pass). + */ + sc = device_get_softc(dev); + if (!sc->cpu_init_done && bus_current_pass >= cpu_init_pass) { + sc->cpu_init_done = true; + cpufreq_initialize(sc); + initialize_tempmon(sc); + if (bootverbose) { + device_printf(sc->dev, "CPU %uMHz @ %umV\n", + sc->cpu_curmhz, sc->cpu_curmv); + } + } + bus_generic_new_pass(dev); +} + static int imx6_anatop_detach(device_t dev) { @@ -669,13 +695,13 @@ imx6_anatop_attach(device_t dev) imx6_anatop_write_4(IMX6_ANALOG_PMU_MISC0_SET, IMX6_ANALOG_PMU_MISC0_SELFBIASOFF); - cpufreq_initialize(sc); - initialize_tempmon(sc); + /* + * Some day, when we're ready to deal with the actual anatop regulators + * that are described in fdt data as children of this "bus", this would + * be the place to invoke a simplebus helper routine to instantiate the + * children from the fdt data. + */ - if (bootverbose) { - device_printf(sc->dev, "CPU %uMHz @ %umV\n", sc->cpu_curmhz, - sc->cpu_curmv); - } err = 0; out: @@ -718,6 +744,9 @@ static device_method_t imx6_anatop_metho DEVMETHOD(device_attach, imx6_anatop_attach), DEVMETHOD(device_detach, imx6_anatop_detach), + /* Bus interface */ + DEVMETHOD(bus_new_pass, imx6_anatop_new_pass), + DEVMETHOD_END }; @@ -730,5 +759,7 @@ static driver_t imx6_anatop_driver = { static devclass_t imx6_anatop_devclass; EARLY_DRIVER_MODULE(imx6_anatop, simplebus, imx6_anatop_driver, - imx6_anatop_devclass, 0, 0, BUS_PASS_CPU + BUS_PASS_ORDER_FIRST + 1); + imx6_anatop_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); +EARLY_DRIVER_MODULE(imx6_anatop, ofwbus, imx6_anatop_driver, + imx6_anatop_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 04:13:09 2014 Return-Path: Delivered-To: svn-src-all@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 B0182C5A; Sun, 26 Oct 2014 04:13: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 9630E63A; Sun, 26 Oct 2014 04:13: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 s9Q4D9Pi043957; Sun, 26 Oct 2014 04:13:09 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q4D9So043956; Sun, 26 Oct 2014 04:13:09 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260413.s9Q4D9So043956@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 04:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273680 - stable/10/sys/boot/fdt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 04:13:09 -0000 Author: ian Date: Sun Oct 26 04:13:08 2014 New Revision: 273680 URL: https://svnweb.freebsd.org/changeset/base/273680 Log: MFC r273298: The U-Boot README says fdt_addr_r is the right env var for fdt data loaded into ram, but vendors also use fdtaddr and fdt_addr. Check the recommended variable first and fall back to the others. Modified: stable/10/sys/boot/fdt/fdt_loader_cmd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- stable/10/sys/boot/fdt/fdt_loader_cmd.c Sun Oct 26 04:11:32 2014 (r273679) +++ stable/10/sys/boot/fdt/fdt_loader_cmd.c Sun Oct 26 04:13:08 2014 (r273680) @@ -310,10 +310,13 @@ fdt_setup_fdtp() /* * If the U-boot environment contains a variable giving the address of a - * valid blob in memory, use it. Board vendors use both fdtaddr and - * fdt_addr names. + * valid blob in memory, use it. The U-boot README says the right + * variable for fdt data loaded into ram is fdt_addr_r, so try that + * first. Board vendors also use both fdtaddr and fdt_addr names. */ - s = ub_env_get("fdtaddr"); + s = ub_env_get("fdt_addr_r"); + if (s == NULL) + s = ub_env_get("fdtaddr"); if (s == NULL) s = ub_env_get("fdt_addr"); if (s != NULL && *s != '\0') { From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 04:15:27 2014 Return-Path: Delivered-To: svn-src-all@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 AC0D9DAF; Sun, 26 Oct 2014 04:15: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 984DB64E; Sun, 26 Oct 2014 04:15: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 s9Q4FRVe044321; Sun, 26 Oct 2014 04:15:27 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q4FRcd044320; Sun, 26 Oct 2014 04:15:27 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260415.s9Q4FRcd044320@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 04:15:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273681 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 04:15:27 -0000 Author: ian Date: Sun Oct 26 04:15:27 2014 New Revision: 273681 URL: https://svnweb.freebsd.org/changeset/base/273681 Log: MFC r273352: Ask for the fastest available clock for the GTP timecounter. Modified: stable/10/sys/arm/freescale/imx/imx_gpt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/imx_gpt.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_gpt.c Sun Oct 26 04:13:08 2014 (r273680) +++ stable/10/sys/arm/freescale/imx/imx_gpt.c Sun Oct 26 04:15:27 2014 (r273681) @@ -95,7 +95,7 @@ struct imx_gpt_softc *imx_gpt_sc = NULL; static const int imx_gpt_delay_count = 78; /* Try to divide down an available fast clock to this frequency. */ -#define TARGET_FREQUENCY 10000000 +#define TARGET_FREQUENCY 1000000000 /* Don't try to set an event timer period smaller than this. */ #define MIN_ET_PERIOD 10LLU From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 04:17:21 2014 Return-Path: Delivered-To: svn-src-all@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 B4963EF7; Sun, 26 Oct 2014 04:17: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 81B58661; Sun, 26 Oct 2014 04:17: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 s9Q4HLO0044594; Sun, 26 Oct 2014 04:17:21 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q4HLvo044593; Sun, 26 Oct 2014 04:17:21 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260417.s9Q4HLvo044593@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 04:17:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273682 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 04:17:22 -0000 Author: ian Date: Sun Oct 26 04:17:20 2014 New Revision: 273682 URL: https://svnweb.freebsd.org/changeset/base/273682 Log: MFC r273353, r273514: Attach the imx6 CCM driver during BUS_PASS_CPU. Unconditionally enable the clocks for all imx6 devices that we have drivers for, or that are required to run the chip (such as busses). Modified: stable/10/sys/arm/freescale/imx/imx6_ccm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/imx6_ccm.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_ccm.c Sun Oct 26 04:15:27 2014 (r273681) +++ stable/10/sys/arm/freescale/imx/imx6_ccm.c Sun Oct 26 04:17:20 2014 (r273682) @@ -76,6 +76,28 @@ WR4(struct ccm_softc *sc, bus_size_t off bus_write_4(sc->mem_res, off, val); } +/* + * Until we have a fully functional ccm driver which implements the fdt_clock + * interface, use the age-old workaround of unconditionally enabling the clocks + * for devices we might need to use. The SoC defaults to most clocks enabled, + * but the rom boot code and u-boot disable a few of them. We turn on only + * what's needed to run the chip plus devices we have drivers for, and turn off + * devices we don't yet have drivers for. (Note that USB is not turned on here + * because that is one we do when the driver asks for it.) + */ +static void +ccm_init_gates(struct ccm_softc *sc) +{ + /* Turns on... */ + WR4(sc, CCM_CCGR0, 0x0000003f); /* ahpbdma, aipstz 1 & 2 busses */ + WR4(sc, CCM_CCGR1, 0x00300c00); /* gpt, enet */ + WR4(sc, CCM_CCGR2, 0x0fffffc0); /* ipmux & ipsync (bridges), iomux, i2c */ + WR4(sc, CCM_CCGR3, 0x3ff00000); /* DDR memory controller */ + WR4(sc, CCM_CCGR4, 0x0000f300); /* pl301 bus crossbar */ + WR4(sc, CCM_CCGR5, 0x0f000000); /* uarts */ + WR4(sc, CCM_CCGR6, 0x000000cc); /* usdhc 1 & 3 */ +} + static int ccm_detach(device_t dev) { @@ -130,6 +152,8 @@ ccm_attach(device_t dev) reg = (reg & ~CCM_CLPCR_LPM_MASK) | CCM_CLPCR_LPM_RUN; WR4(sc, CCM_CLPCR, reg); + ccm_init_gates(sc); + err = 0; out: @@ -261,5 +285,6 @@ static driver_t ccm_driver = { static devclass_t ccm_devclass; -DRIVER_MODULE(ccm, simplebus, ccm_driver, ccm_devclass, 0, 0); +EARLY_DRIVER_MODULE(ccm, simplebus, ccm_driver, ccm_devclass, 0, 0, + BUS_PASS_CPU + BUS_PASS_ORDER_EARLY); From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 04:21:15 2014 Return-Path: Delivered-To: svn-src-all@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 E52FDC9; Sun, 26 Oct 2014 04:21:14 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id ACB1974F; Sun, 26 Oct 2014 04:21:14 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id 35AD320E7088C; Sun, 26 Oct 2014 04:21:07 +0000 (UTC) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTP id 1DB5A20E70886; Sun, 26 Oct 2014 04:21:06 +0000 (UTC) Message-ID: <544C7722.1080201@freebsd.org> Date: Sun, 26 Oct 2014 04:22:58 +0000 From: Steven Hartland User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r273630 - head/tools/regression/zfs/zpool/add References: <201410250610.s9P6A2GP001878@svn.freebsd.org> In-Reply-To: <201410250610.s9P6A2GP001878@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 04:21:15 -0000 Its not clear from this why you elected to disable the test and hide the issue instead of fixing the panic cause, could you clarify please? On 25/10/2014 07:10, Garrett Cooper wrote: > Author: ngie > Date: Sat Oct 25 06:10:01 2014 > New Revision: 273630 > URL: https://svnweb.freebsd.org/changeset/base/273630 > > Log: > Bail out of the script on FreeBSD due to deterministic panic issue > > PR: 191573 > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/tools/regression/zfs/zpool/add/files.t > > Modified: head/tools/regression/zfs/zpool/add/files.t > ============================================================================== > --- head/tools/regression/zfs/zpool/add/files.t Sat Oct 25 05:56:21 2014 (r273629) > +++ head/tools/regression/zfs/zpool/add/files.t Sat Oct 25 06:10:01 2014 (r273630) > @@ -4,6 +4,8 @@ > dir=`dirname $0` > . ${dir}/../../misc.sh > > +[ "${os}" = "FreeBSD" ] && die "panics FreeBSD; see bug # 191573" > + > echo "1..54" > > files_create 8 > > > From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 04:44:31 2014 Return-Path: Delivered-To: svn-src-all@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 77B6F33B; Sun, 26 Oct 2014 04:44: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 623738CB; Sun, 26 Oct 2014 04:44: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 s9Q4iVub058059; Sun, 26 Oct 2014 04:44:31 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q4iT53058052; Sun, 26 Oct 2014 04:44:29 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201410260444.s9Q4iT53058052@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sun, 26 Oct 2014 04:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273683 - in head: sys/amd64/include sys/amd64/vmm sys/amd64/vmm/io sys/modules/vmm 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 04:44:31 -0000 Author: neel Date: Sun Oct 26 04:44:28 2014 New Revision: 273683 URL: https://svnweb.freebsd.org/changeset/base/273683 Log: Move the ACPI PM timer emulation into vmm.ko. This reduces variability during timer calibration by keeping the emulation "close" to the guest. Additionally having all timer emulations in the kernel will ease the transition to a per-VM clock source (as opposed to using the host's uptime keep track of time). Discussed with: grehan Added: head/sys/amd64/vmm/io/vpmtmr.c (contents, props changed) head/sys/amd64/vmm/io/vpmtmr.h (contents, props changed) Deleted: head/usr.sbin/bhyve/pmtmr.c Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_ioport.c head/sys/modules/vmm/Makefile head/usr.sbin/bhyve/Makefile Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Sun Oct 26 04:17:20 2014 (r273682) +++ head/sys/amd64/include/vmm.h Sun Oct 26 04:44:28 2014 (r273683) @@ -285,6 +285,7 @@ int vm_assign_pptdev(struct vm *vm, int int vm_unassign_pptdev(struct vm *vm, int bus, int slot, int func); struct vatpic *vm_atpic(struct vm *vm); struct vatpit *vm_atpit(struct vm *vm); +struct vpmtmr *vm_pmtmr(struct vm *vm); /* * Inject exception 'vme' into the guest vcpu. This function returns 0 on Added: head/sys/amd64/vmm/io/vpmtmr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/vmm/io/vpmtmr.c Sun Oct 26 04:44:28 2014 (r273683) @@ -0,0 +1,104 @@ +/*- + * Copyright (c) 2014, Neel Natu (neel@freebsd.org) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include + +#include "vpmtmr.h" + +/* + * The ACPI Power Management timer is a free-running 24- or 32-bit + * timer with a frequency of 3.579545MHz + * + * This implementation will be 32-bits + */ + +#define PMTMR_FREQ 3579545 /* 3.579545MHz */ + +struct vpmtmr { + sbintime_t freq_sbt; + sbintime_t baseuptime; + uint32_t baseval; +}; + +static MALLOC_DEFINE(M_VPMTMR, "vpmtmr", "bhyve virtual acpi timer"); + +struct vpmtmr * +vpmtmr_init(struct vm *vm) +{ + struct vpmtmr *vpmtmr; + struct bintime bt; + + vpmtmr = malloc(sizeof(struct vpmtmr), M_VPMTMR, M_WAITOK | M_ZERO); + vpmtmr->baseuptime = sbinuptime(); + vpmtmr->baseval = 0; + + FREQ2BT(PMTMR_FREQ, &bt); + vpmtmr->freq_sbt = bttosbt(bt); + + return (vpmtmr); +} + +void +vpmtmr_cleanup(struct vpmtmr *vpmtmr) +{ + + free(vpmtmr, M_VPMTMR); +} + +int +vpmtmr_handler(void *vm, int vcpuid, bool in, int port, int bytes, + uint32_t *val) +{ + struct vpmtmr *vpmtmr; + sbintime_t now, delta; + + if (!in || bytes != 4) + return (-1); + + vpmtmr = vm_pmtmr(vm); + + /* + * No locking needed because 'baseuptime' and 'baseval' are + * written only during initialization. + */ + now = sbinuptime(); + delta = now - vpmtmr->baseuptime; + KASSERT(delta >= 0, ("vpmtmr_handler: uptime went backwards: " + "%#lx to %#lx", vpmtmr->baseuptime, now)); + *val = vpmtmr->baseval + delta / vpmtmr->freq_sbt; + + return (0); +} Added: head/sys/amd64/vmm/io/vpmtmr.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/vmm/io/vpmtmr.h Sun Oct 26 04:44:28 2014 (r273683) @@ -0,0 +1,42 @@ +/*- + * Copyright (c) 2014 Neel Natu (neel@freebsd.org) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _VPMTMR_H_ +#define _VPMTMR_H_ + +#define IO_PMTMR 0x408 + +struct vpmtmr; + +struct vpmtmr *vpmtmr_init(struct vm *vm); +void vpmtmr_cleanup(struct vpmtmr *pmtmr); + +int vpmtmr_handler(void *vm, int vcpuid, bool in, int port, int bytes, + uint32_t *val); + +#endif Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Sun Oct 26 04:17:20 2014 (r273682) +++ head/sys/amd64/vmm/vmm.c Sun Oct 26 04:44:28 2014 (r273683) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include "vhpet.h" #include "vioapic.h" #include "vlapic.h" +#include "vpmtmr.h" #include "vmm_ipi.h" #include "vmm_stat.h" #include "vmm_lapic.h" @@ -134,6 +135,7 @@ struct vm { struct vioapic *vioapic; /* (i) virtual ioapic */ struct vatpic *vatpic; /* (i) virtual atpic */ struct vatpit *vatpit; /* (i) virtual atpit */ + struct vpmtmr *vpmtmr; /* (i) virtual ACPI PM timer */ volatile cpuset_t active_cpus; /* (i) active vcpus */ int suspend; /* (i) stop VM execution */ volatile cpuset_t suspended_cpus; /* (i) suspended vcpus */ @@ -360,6 +362,7 @@ vm_init(struct vm *vm, bool create) vm->vhpet = vhpet_init(vm); vm->vatpic = vatpic_init(vm); vm->vatpit = vatpit_init(vm); + vm->vpmtmr = vpmtmr_init(vm); CPU_ZERO(&vm->active_cpus); @@ -422,6 +425,7 @@ vm_cleanup(struct vm *vm, bool destroy) if (vm->iommu != NULL) iommu_destroy_domain(vm->iommu); + vpmtmr_cleanup(vm->vpmtmr); vatpit_cleanup(vm->vatpit); vhpet_cleanup(vm->vhpet); vatpic_cleanup(vm->vatpic); @@ -2199,6 +2203,13 @@ vm_atpit(struct vm *vm) return (vm->vatpit); } +struct vpmtmr * +vm_pmtmr(struct vm *vm) +{ + + return (vm->vpmtmr); +} + enum vm_reg_name vm_segment_name(int seg) { Modified: head/sys/amd64/vmm/vmm_ioport.c ============================================================================== --- head/sys/amd64/vmm/vmm_ioport.c Sun Oct 26 04:17:20 2014 (r273682) +++ head/sys/amd64/vmm/vmm_ioport.c Sun Oct 26 04:44:28 2014 (r273683) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include "vatpic.h" #include "vatpit.h" +#include "vpmtmr.h" #include "vmm_ioport.h" #include "vmm_ktr.h" @@ -58,6 +59,7 @@ ioport_handler_func_t ioport_handler[MAX [IO_ICU2 + ICU_IMR_OFFSET] = vatpic_slave_handler, [IO_ELCR1] = vatpic_elc_handler, [IO_ELCR2] = vatpic_elc_handler, + [IO_PMTMR] = vpmtmr_handler, }; #ifdef KTR Modified: head/sys/modules/vmm/Makefile ============================================================================== --- head/sys/modules/vmm/Makefile Sun Oct 26 04:17:20 2014 (r273682) +++ head/sys/modules/vmm/Makefile Sun Oct 26 04:44:28 2014 (r273683) @@ -33,7 +33,8 @@ SRCS+= iommu.c \ vatpit.c \ vhpet.c \ vioapic.c \ - vlapic.c + vlapic.c \ + vpmtmr.c # intel-specific files .PATH: ${.CURDIR}/../../amd64/vmm/intel Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Sun Oct 26 04:17:20 2014 (r273682) +++ head/usr.sbin/bhyve/Makefile Sun Oct 26 04:44:28 2014 (r273683) @@ -31,7 +31,6 @@ SRCS= \ pci_virtio_rnd.c \ pci_uart.c \ pm.c \ - pmtmr.c \ post.c \ rtc.c \ smbiostbl.c \ From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 05:39:42 2014 Return-Path: Delivered-To: svn-src-all@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 D645C60C; Sun, 26 Oct 2014 05:39: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 C328FC3C; Sun, 26 Oct 2014 05:39: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 s9Q5dgGr081656; Sun, 26 Oct 2014 05:39:42 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q5dgQH081655; Sun, 26 Oct 2014 05:39:42 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410260539.s9Q5dgQH081655@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 26 Oct 2014 05:39:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273684 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 05:39:42 -0000 Author: mjg Date: Sun Oct 26 05:39:42 2014 New Revision: 273684 URL: https://svnweb.freebsd.org/changeset/base/273684 Log: Use a temporary buffer in sys_setgroups for requests with <= XU_NGROUPS groups. Submitted by: Tiwei Bie X-Additional: JuniorJobs project MFC after: 2 weeks Modified: head/sys/kern/kern_prot.c Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Sun Oct 26 04:44:28 2014 (r273683) +++ head/sys/kern/kern_prot.c Sun Oct 26 05:39:42 2014 (r273684) @@ -806,17 +806,24 @@ int sys_setgroups(struct thread *td, struct setgroups_args *uap) { gid_t *groups = NULL; + gid_t smallgroups[XU_NGROUPS]; + u_int gidsetsize; int error; - if (uap->gidsetsize > ngroups_max + 1) + gidsetsize = uap->gidsetsize; + if (gidsetsize > ngroups_max + 1) return (EINVAL); - groups = malloc(uap->gidsetsize * sizeof(gid_t), M_TEMP, M_WAITOK); - error = copyin(uap->gidset, groups, uap->gidsetsize * sizeof(gid_t)); + if (gidsetsize > XU_NGROUPS) + groups = malloc(gidsetsize * sizeof(gid_t), M_TEMP, M_WAITOK); + else + groups = smallgroups; + error = copyin(uap->gidset, groups, gidsetsize * sizeof(gid_t)); if (error) goto out; - error = kern_setgroups(td, uap->gidsetsize, groups); + error = kern_setgroups(td, gidsetsize, groups); out: - free(groups, M_TEMP); + if (gidsetsize > XU_NGROUPS) + free(groups, M_TEMP); return (error); } From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 05:41:51 2014 Return-Path: Delivered-To: svn-src-all@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 D4477770; Sun, 26 Oct 2014 05:41:51 +0000 (UTC) Received: from mail-lb0-x22c.google.com (mail-lb0-x22c.google.com [IPv6:2a00:1450:4010:c04::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F0C1CD8; Sun, 26 Oct 2014 05:41:50 +0000 (UTC) Received: by mail-lb0-f172.google.com with SMTP id n15so418578lbi.31 for ; Sat, 25 Oct 2014 22:41: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=eqLMvO1IGVX16jwCdbIERTdxWd9XNph5Pz+egGDCgX4=; b=Bi5F2PGNuXbxlytaAF01gwLurm0rYddQ8j9Qqqp6Sr2CUgzUX3+kTPqFqKP0jzBmKu pQfK271iAsJ+WKlsexpa63dpl2XsJ7M6I3SPJA7jhqXll4+ZhYwI7iwqEPMa2zPKlDad TA3QzxoVLK60LaW/CoYJlgMfwVdXkP4D9DE4GV49NxUCj4V/IVwGi0Nk+qF9iaJy/cTU aYv4KKW3OYkxJurQNrfJHZ+r5jNiFdluJjaL3jwP+y3VUse7hgVoabJrzIHLLDKQtAZZ iNNT0Zyw1oS8JnIPLGquBCnprGQ6PbGGKyW5zK7fLy7wx3fo3i1Li6bSnd5HUtM1qO3y acvQ== MIME-Version: 1.0 X-Received: by 10.152.27.38 with SMTP id q6mr323632lag.92.1414302108329; Sat, 25 Oct 2014 22:41:48 -0700 (PDT) Sender: crodr001@gmail.com Received: by 10.112.84.197 with HTTP; Sat, 25 Oct 2014 22:41:48 -0700 (PDT) In-Reply-To: <544C7722.1080201@freebsd.org> References: <201410250610.s9P6A2GP001878@svn.freebsd.org> <544C7722.1080201@freebsd.org> Date: Sat, 25 Oct 2014 22:41:48 -0700 X-Google-Sender-Auth: jwHy_pFfxC9W9qDEdtmx6iPzzT4 Message-ID: Subject: Re: svn commit: r273630 - head/tools/regression/zfs/zpool/add From: Craig Rodrigues To: Steven Hartland Content-Type: text/plain; charset=ISO-8859-1 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, Garrett Cooper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 05:41:52 -0000 On Sat, Oct 25, 2014 at 9:22 PM, Steven Hartland wrote: > Its not clear from this why you elected to disable the test and hide the > issue instead of fixing the panic cause, could you clarify please? See: https://lists.freebsd.org/pipermail/freebsd-testing/2014-October/000584.html https://lists.freebsd.org/pipermail/freebsd-testing/2014-October/000585.html -- Craig From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 06:04:10 2014 Return-Path: Delivered-To: svn-src-all@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 DD4F5AF9; Sun, 26 Oct 2014 06:04: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 B00B8E60; Sun, 26 Oct 2014 06:04: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 s9Q64AlJ094751; Sun, 26 Oct 2014 06:04:10 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q64A4x094750; Sun, 26 Oct 2014 06:04:10 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410260604.s9Q64A4x094750@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 26 Oct 2014 06:04:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273685 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 06:04:11 -0000 Author: mjg Date: Sun Oct 26 06:04:09 2014 New Revision: 273685 URL: https://svnweb.freebsd.org/changeset/base/273685 Log: Tidy up sys_setgroups and kern_setgroups. - 'groups' initialization to NULL is always ovewrwriten before use, so plug it - get rid of 'goto out' - kern_setgroups's callers already validate ngrp, so only assert the condition - ngrp is an u_int, so 'ngrp < 1' is more readable as 'ngrp == 0' No functional changes. Modified: head/sys/kern/kern_prot.c Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Sun Oct 26 05:39:42 2014 (r273684) +++ head/sys/kern/kern_prot.c Sun Oct 26 06:04:09 2014 (r273685) @@ -805,23 +805,24 @@ struct setgroups_args { int sys_setgroups(struct thread *td, struct setgroups_args *uap) { - gid_t *groups = NULL; gid_t smallgroups[XU_NGROUPS]; + gid_t *groups; u_int gidsetsize; int error; gidsetsize = uap->gidsetsize; if (gidsetsize > ngroups_max + 1) return (EINVAL); + if (gidsetsize > XU_NGROUPS) groups = malloc(gidsetsize * sizeof(gid_t), M_TEMP, M_WAITOK); else groups = smallgroups; + error = copyin(uap->gidset, groups, gidsetsize * sizeof(gid_t)); - if (error) - goto out; - error = kern_setgroups(td, gidsetsize, groups); -out: + if (error == 0) + error = kern_setgroups(td, gidsetsize, groups); + if (gidsetsize > XU_NGROUPS) free(groups, M_TEMP); return (error); @@ -834,8 +835,7 @@ kern_setgroups(struct thread *td, u_int struct ucred *newcred, *oldcred; int error; - if (ngrp > ngroups_max + 1) - return (EINVAL); + MPASS(ngrp <= ngroups_max); AUDIT_ARG_GROUPSET(groups, ngrp); newcred = crget(); crextend(newcred, ngrp); @@ -852,7 +852,7 @@ kern_setgroups(struct thread *td, u_int if (error) goto fail; - if (ngrp < 1) { + if (ngrp == 0) { /* * setgroups(0, NULL) is a legitimate way of clearing the * groups vector on non-BSD systems (which generally do not From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 07:07:54 2014 Return-Path: Delivered-To: svn-src-all@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 C47C028A; Sun, 26 Oct 2014 07:07: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 B02AD36B; Sun, 26 Oct 2014 07:07: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 s9Q77sBR023071; Sun, 26 Oct 2014 07:07:54 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q77sd6023070; Sun, 26 Oct 2014 07:07:54 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201410260707.s9Q77sd6023070@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Sun, 26 Oct 2014 07:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273686 - stable/10/sys/arm/ti X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 07:07:54 -0000 Author: rpaulo Date: Sun Oct 26 07:07:54 2014 New Revision: 273686 URL: https://svnweb.freebsd.org/changeset/base/273686 Log: MFC r273281: Style changes as pointed out by stas@. Modified: stable/10/sys/arm/ti/ti_wdt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/ti/ti_wdt.c ============================================================================== --- stable/10/sys/arm/ti/ti_wdt.c Sun Oct 26 06:04:09 2014 (r273685) +++ stable/10/sys/arm/ti/ti_wdt.c Sun Oct 26 07:07:54 2014 (r273686) @@ -98,12 +98,14 @@ DRIVER_MODULE(ti_wdt, simplebus, ti_wdt_ static volatile __inline uint32_t ti_wdt_reg_read(struct ti_wdt_softc *sc, uint32_t reg) { + return (bus_space_read_4(sc->sc_bt, sc->sc_bh, reg)); } static __inline void ti_wdt_reg_write(struct ti_wdt_softc *sc, uint32_t reg, uint32_t val) { + bus_space_write_4(sc->sc_bt, sc->sc_bh, reg, val); } @@ -113,14 +115,15 @@ ti_wdt_reg_write(struct ti_wdt_softc *sc static __inline void ti_wdt_reg_wait(struct ti_wdt_softc *sc, uint32_t bit) { + while (ti_wdt_reg_read(sc, TI_WDT_WWPS) & bit) DELAY(10); - } static __inline void ti_wdt_disable(struct ti_wdt_softc *sc) { + DPRINTF("disabling watchdog %p\n", sc); ti_wdt_reg_write(sc, TI_WDT_WSPR, 0xAAAA); ti_wdt_reg_wait(sc, TI_W_PEND_WSPR); @@ -131,6 +134,7 @@ ti_wdt_disable(struct ti_wdt_softc *sc) static __inline void ti_wdt_enable(struct ti_wdt_softc *sc) { + DPRINTF("enabling watchdog %p\n", sc); ti_wdt_reg_write(sc, TI_WDT_WSPR, 0xBBBB); ti_wdt_reg_wait(sc, TI_W_PEND_WSPR); From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 07:09:00 2014 Return-Path: Delivered-To: svn-src-all@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 1F95B3C8; Sun, 26 Oct 2014 07:09:00 +0000 (UTC) Received: from st11p02mm-asmtp001.mac.com (st11p02mm-asmtp001.mac.com [17.172.220.236]) (using TLSv1 with cipher DES-CBC3-SHA (112/168 bits)) (Client CN "smtp.me.com", Issuer "VeriSign Class 3 Extended Validation SSL SGC CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7025375; Sun, 26 Oct 2014 07:08:59 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp001.mac.com (Oracle Communications Messaging Server 7u4-27.10(7.0.4.27.9) 64bit (built Jun 6 2014)) with ESMTPSA id <0NE1009NUII5QZ50@st11p02mm-asmtp001.mac.com>; Sun, 26 Oct 2014 07:08:32 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.12.52,1.0.28,0.0.0000 definitions=2014-10-26_01:2014-10-24,2014-10-25,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1408290000 definitions=main-1410260078 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Subject: Re: svn commit: r273647 - head/sys/dev/acpica From: Rui Paulo In-reply-to: <201410252101.s9PL1pnm022006@svn.freebsd.org> Date: Sun, 26 Oct 2014 00:08:29 -0700 Content-transfer-encoding: quoted-printable Message-id: <4880436F-59EF-4792-8C52-9E3F03215EA8@me.com> References: <201410252101.s9PL1pnm022006@svn.freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.1990.1) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 07:09:00 -0000 On Oct 25, 2014, at 14:01, Konstantin Belousov wrote: >=20 > Author: kib > Date: Sat Oct 25 21:01:50 2014 > New Revision: 273647 > URL: https://svnweb.freebsd.org/changeset/base/273647 >=20 > Log: > Set the caching mode for the usermode mapping of the HPET registers > page to uncached. >=20 > Reviewed by: rpaulo > Sponsored by: The FreeBSD Foundation > MFC after: 1 week >=20 > Modified: > head/sys/dev/acpica/acpi_hpet.c >=20 > Modified: head/sys/dev/acpica/acpi_hpet.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/acpica/acpi_hpet.c Sat Oct 25 20:42:47 2014 = (r273646) > +++ head/sys/dev/acpica/acpi_hpet.c Sat Oct 25 21:01:50 2014 = (r273647) > @@ -356,6 +356,7 @@ hpet_mmap(struct cdev *cdev, vm_ooffset_ > if (!sc->mmap_allow_write && (nprot & PROT_WRITE)) > return (EPERM); > *paddr =3D rman_get_start(sc->mem_res) + offset; > + *memattr =3D VM_MEMATTR_UNCACHEABLE; >=20 > return (0); > } Thanks! -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 07:40:39 2014 Return-Path: Delivered-To: svn-src-all@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 0B0D877C; Sun, 26 Oct 2014 07:40: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 CF7127E2; Sun, 26 Oct 2014 07:40: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 s9Q7ecs9038275; Sun, 26 Oct 2014 07:40:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q7ecUK038273; Sun, 26 Oct 2014 07:40:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201410260740.s9Q7ecUK038273@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 26 Oct 2014 07:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273687 - in head: sys/cam/ctl usr.sbin/ctladm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 07:40:39 -0000 Author: mav Date: Sun Oct 26 07:40:37 2014 New Revision: 273687 URL: https://svnweb.freebsd.org/changeset/base/273687 Log: Add "rpm" and "formfactor" LUN options to match istgt functionality. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c head/usr.sbin/ctladm/ctladm.8 Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sun Oct 26 07:07:54 2014 (r273686) +++ head/sys/cam/ctl/ctl.c Sun Oct 26 07:40:37 2014 (r273687) @@ -10207,6 +10207,8 @@ ctl_inquiry_evpd_bdc(struct ctl_scsiio * { struct scsi_vpd_block_device_characteristics *bdc_ptr; struct ctl_lun *lun; + const char *value; + u_int i; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; @@ -10239,7 +10241,18 @@ ctl_inquiry_evpd_bdc(struct ctl_scsiio * bdc_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; bdc_ptr->page_code = SVPD_BDC; scsi_ulto2b(sizeof(*bdc_ptr) - 4, bdc_ptr->page_length); - scsi_ulto2b(SVPD_NON_ROTATING, bdc_ptr->medium_rotation_rate); + if (lun != NULL && + (value = ctl_get_opt(&lun->be_lun->options, "rpm")) != NULL) + i = strtol(value, NULL, 0); + else + i = SVPD_NON_ROTATING; + scsi_ulto2b(i, bdc_ptr->medium_rotation_rate); + if (lun != NULL && + (value = ctl_get_opt(&lun->be_lun->options, "formfactor")) != NULL) + i = strtol(value, NULL, 0); + else + i = 0; + bdc_ptr->wab_wac_ff = (i & 0x0f); bdc_ptr->flags = SVPD_FUAB | SVPD_VBULS; ctsio->scsi_status = SCSI_STATUS_OK; Modified: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Sun Oct 26 07:07:54 2014 (r273686) +++ head/usr.sbin/ctladm/ctladm.8 Sun Oct 26 07:40:37 2014 (r273687) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd October 12, 2014 +.Dd October 26, 2014 .Dt CTLADM 8 .Os .Sh NAME @@ -995,6 +995,12 @@ command sequence order shall be explicit client through the selection of appropriate commands and task attributes. The default value is "restricted". It improves data integrity, but may introduce some additional delays. +.It Va rpm +Specifies medium rotation rate of the device: 0 -- not reported, +1 -- non-rotating (SSD), >1024 -- value in revolutions per minute. +.It Va formfactor +Specifies nominal form factor of the device: 0 -- not reported, 1 -- 5.25", +2 -- 3.5", 3 -- 2.5", 4 -- 1.8", 5 -- less then 1.8". .It Va unmap Set to "on", enables UNMAP support for the LUN, if supported by the backend. .It Va writecache From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 09:24:33 2014 Return-Path: Delivered-To: svn-src-all@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 986182F1; Sun, 26 Oct 2014 09:24: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 83091D2; Sun, 26 Oct 2014 09:24: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 s9Q9OXLS087780; Sun, 26 Oct 2014 09:24:33 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q9OXUx087779; Sun, 26 Oct 2014 09:24:33 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410260924.s9Q9OXUx087779@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 26 Oct 2014 09:24:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r273688 - vendor/file/dist/magic/Magdir X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 09:24:33 -0000 Author: delphij Date: Sun Oct 26 09:24:32 2014 New Revision: 273688 URL: https://svnweb.freebsd.org/changeset/base/273688 Log: Update filesystems magic to CVS version 1.106. Submitted by: madpilot Modified: vendor/file/dist/magic/Magdir/filesystems Modified: vendor/file/dist/magic/Magdir/filesystems ============================================================================== --- vendor/file/dist/magic/Magdir/filesystems Sun Oct 26 07:40:37 2014 (r273687) +++ vendor/file/dist/magic/Magdir/filesystems Sun Oct 26 09:24:32 2014 (r273688) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: filesystems,v 1.95 2014/06/03 19:17:27 christos Exp $ +# $File: filesystems,v 1.106 2014/10/23 17:17:09 christos Exp $ # filesystems: file(1) magic for different filesystems # 0 name partid @@ -254,19 +254,13 @@ 30 search/481 \x55\xAA # to display DOS/MBR boot sector (40) before old one (strength=50+21),Syslinux bootloader (71),SYSLINUX MBR (37+36),NetBSD mbr (110),AdvanceMAME mbr (111) # DOS BPB information (70) and after DOS floppy (120) like in previous file version -!:strength +72 +!:strength +65 # for sector sizes < 512 Bytes >11 uleshort <512 >>(11.s-2) uleshort 0xAA55 DOS/MBR boot sector # for sector sizes with 512 or more Bytes >0x1FE leshort 0xAA55 DOS/MBR boot sector -# keep old DOS/MBR boot sector as dummy for mbr and bootloader displaying -# only for sector sizes with 512 or more Bytes -0x1FE leshort 0xAA55 -# -# to display information (50) before DOS BPB (strength=70) and after DOS floppy (120) like in old file version -!:strength +21 ->2 string OSBS \b, OS/BS MBR +>2 string OSBS OS/BS MBR # added by Joerg Jenderek at Feb 2013 according to http://thestarman.pcministry.com/asm/mbr/ # and http://en.wikipedia.org/wiki/Master_Boot_Record # test for nearly all MS-DOS Master Boot Record initial program loader (IPL) is now done by @@ -538,6 +532,8 @@ >>>514 string !HdrS # not BeOS >>>>422 string !Be\ Boot\ Loader +>>>>>32769 string CD001 +>>>>>>0 use cdrom # jump over BPB instruction implies DOS bootsector or AdvanceMAME mbr >>>>>0 ubelong&0xFD000000 =0xE9000000 # AdvanceMAME mbr @@ -1043,7 +1039,7 @@ >>>>>>466 ubyte <0x10 >>>>>>>466 ubyte 0x05 \b, extended partition table >>>>>>>466 ubyte 0x0F \b, extended partition table (LBA) ->>>>>>>466 ubyte 0x0 \b, extended partition table (last) +>>>>>>>466 ubyte 0x0 \b, extended partition table (last) # DOS x86 sector separated and moved from "DOS/MBR boot sector" by Joerg Jenderek at May 2011 @@ -1236,6 +1232,7 @@ >>>>>181 search/166 Error\ \0 # "a: disk" , "Fn: diskn" or "NetBSD MBR boot" >>>>>>&3 string x \b,"%s" +>>>446 use partition-table # Andrea Mazzoleni AdvanceCD mbr loader of http://advancemame.sourceforge.net/boot-readme.html # added by Joerg Jenderek at Nov 2012 for versions 1.3 - 1.4 # assembler instructions: jmp short 0x58;nop;ASCII @@ -1353,18 +1350,19 @@ # minimal short forward jump found 0x29 for bootloaders or 0x0 # maximal short forward jump is 0x7f # OEM-ID is empty or contain readable bytes -0 ulelong&0x804000E9 0x000000E9 +0 ulelong&0x804000E9 0x000000E9 +!:strength +60 # mtools-3.9.8/msdos.h # usual values are marked with comments to get only informations of strange FAT systems # valid sectorsize must be a power of 2 from 32 to 32768 ->11 uleshort&0xf001f 0 +>11 uleshort&0x001f 0 >>11 uleshort <32769 >>>11 uleshort >31 >>>>21 ubyte&0xf0 0xF0 ->>>>>0 ubyte 0xEB +>>>>>0 ubyte 0xEB DOS/MBR boot sector >>>>>>1 ubyte x \b, code offset 0x%x+2 >>>>>0 ubyte 0xE9 ->>>>>>1 uleshort x \b, code offset 0x%x+2 +>>>>>>1 uleshort x \b, code offset 0x%x+3 >>>>>3 string >\0 \b, OEM-ID "%-.8s" #http://mirror.href.com/thestarman/asm/debug/debug2.htm#IHC >>>>>>8 string IHC \b cached by Windows 9M @@ -1373,10 +1371,11 @@ >>>>>11 uleshort <512 \b, Bytes/sector %u >>>>>13 ubyte >1 \b, sectors/cluster %u #>>>>>13 ubyte =1 \b, sectors/cluster %u (usual on Floppies) ->>>>>82 string FAT32 +# for lazy FAT32 implementation like Transcend digital photo frame PF830 +>>>>>82 string/c fat32 >>>>>>14 uleshort !32 \b, reserved sectors %u #>>>>>>14 uleshort =32 \b, reserved sectors %u (usual Fat32) ->>>>>82 string !FAT32 +>>>>>82 string/c !fat32 >>>>>>14 uleshort >1 \b, reserved sectors %u #>>>>>>14 uleshort =1 \b, reserved sectors %u (usual FAT12,FAT16) #>>>>>>14 uleshort 0 \b, reserved sectors %u (usual NTFS) @@ -1399,24 +1398,29 @@ >>>>>26 ubyte =1 \b, heads %u # valid only for sector sizes with more then 32 Bytes >>>>>11 uleshort >32 -# skip for Digital Research DOS (version 3.41) 1440 kB Bootdisk ->>>>>>38 ubyte !0x70 +# http://en.wikipedia.org/wiki/Design_of_the_FAT_file_system#Extended_BIOS_Parameter_Block +# skip for values 2,2Ah,70h,73h,DFh +# and continue for extended boot signature values 0,28h,29h,80h +>>>>>>38 ubyte&0x56 =0 >>>>>>>28 ulelong >0 \b, hidden sectors %u #>>>>>>>28 ulelong =0 \b, hidden sectors %u (usual floppy) >>>>>>>32 ulelong >0 \b, sectors %u (volumes > 32 MB) #>>>>>>>32 ulelong =0 \b, sectors %u (volumes > 32 MB) # FAT<32 bit specific ->>>>>>>82 string !FAT32 +>>>>>>>82 string/c !fat32 #>>>>>>>>36 ubyte 0x80 \b, physical drive 0x%x=0x80 (usual harddisk) #>>>>>>>>36 ubyte 0 \b, physical drive 0x%x=0 (usual floppy) >>>>>>>>36 ubyte !0x80 >>>>>>>>>36 ubyte !0 \b, physical drive 0x%x +# VGA-copy CRC or +# in Windows NT bit 0 is a dirty flag to request chkdsk at boot time. bit 1 requests surface scan too >>>>>>>>37 ubyte >0 \b, reserved 0x%x #>>>>>>>>37 ubyte =0 \b, reserved 0x%x -# value is 0x80 for NTFS +# extended boot signatur value is 0x80 for NTFS, 0x28 or 0x29 for others >>>>>>>>38 ubyte !0x29 \b, dos < 4.0 BootSector (0x%x) ->>>>>>>>38 ubyte =0x29 +>>>>>>>>38 ubyte&0xFE =0x28 >>>>>>>>>39 ulelong x \b, serial number 0x%x +>>>>>>>>38 ubyte =0x29 >>>>>>>>>43 string >>>>>>>>43 string >NO\ NAME \b, label: "%11.11s" >>>>>>>>>43 string =NO\ NAME \b, unlabeled @@ -1426,11 +1430,35 @@ # if it is small enough FAT is 12 bit, if it is too big enough FAT is 32 bit, # otherwise FAT is 16 bit. # http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/determining-fat-widths.html ->>>>>>54 string FAT \b, FAT ->>>>>>>54 string FAT12 \b (12 bit) ->>>>>>>54 string FAT16 \b (16 bit) +>>>>>82 string/c !fat32 +>>>>>>54 string FAT12 \b, FAT (12 bit) +>>>>>>54 string FAT16 \b, FAT (16 bit) +>>>>>>54 default x +# determinate FAT bit size by media descriptor +# small floppies implies FAT12 +>>>>>>>21 ubyte <0xF0 \b, FAT (12 bit by descriptor) +# with media descriptor F0h floppy or maybe superfloppy with FAT16 +>>>>>>>21 ubyte =0xF0 +# superfloppy (many sectors) implies FAT16 +>>>>>>>>32 ulelong >0xFFFF \b, FAT (16 bit by descriptor+sectors) +# no superfloppy with media descriptor F0h implies FAT12 +>>>>>>>>32 default x \b, FAT (12 bit by descriptor+sectors) +# with media descriptor F8h floppy or hard disc with FAT12 or FAT16 +>>>>>>>21 ubyte =0xF8 +# 360 KiB with media descriptor F8h, 9 sectors per track ,single sided floppy implies FAT12 +>>>>>>>>19 ubequad 0xd002f80300090001 \b, FAT (12 bit by descriptor+geometry) +# hard disc with FAT12 or FAT16 +>>>>>>>>19 default x \b, FAT (1Y bit by descriptor) +# with media descriptor FAh floppy, RAM disc with FAT12 or FAT16 or Tandy hard disc +>>>>>>>21 ubyte =0xFA +# 320 KiB with media descriptor FAh, 8 sectors per track ,single sided floppy implies FAT12 +>>>>>>>>19 ubequad 0x8002fa0200080001 \b, FAT (12 bit by descriptor+geometry) +# RAM disc with FAT12 or FAT16 or Tandy hard disc +>>>>>>>>19 default x \b, FAT (1Y bit by descriptor) +# others are floppy +>>>>>>>21 default x \b, FAT (12 bit by descriptor) # FAT32 bit specific ->>>>>82 string FAT32 \b, FAT (32 bit) +>>>>>82 string/c fat32 \b, FAT (32 bit) >>>>>>36 ulelong x \b, sectors/FAT %u # http://technet.microsoft.com/en-us/library/cc977221.aspx >>>>>>40 uleshort >0 \b, extension flags 0x%x @@ -1443,9 +1471,12 @@ >>>>>>48 uleshort >1 \b, infoSector %u #>>>>>>48 uleshort =1 \b, infoSector %u (usual) >>>>>>48 uleshort <1 \b, infoSector %u ->>>>>>50 uleshort >6 \b, Backup boot sector %u +# 0 or 0xFFFF instead of usual 6 means no backup sector +>>>>>>50 uleshort =0xFFFF \b, no Backup boot sector +>>>>>>50 uleshort =0 \b, no Backup boot sector #>>>>>>50 uleshort =6 \b, Backup boot sector %u (usual) ->>>>>>50 uleshort <6 \b, Backup boot sector %u +>>>>>>50 default x +>>>>>>>50 uleshort x \b, Backup boot sector %u # corrected by Joerg Jenderek at Feb 2011 according to http://thestarman.pcministry.com/asm/mbr/MSWIN41.htm#FSINFO >>>>>>52 ulelong >0 \b, reserved1 0x%x >>>>>>56 ulelong >0 \b, reserved2 0x%x @@ -1880,12 +1911,11 @@ # defect IO.SYS+MSDOS.SYS ? #>>>>>0x162 use 2xDOS-filename -# CDROM Filesystems -# Modified for UDF by gerardo.cacciari@gmail.com -32769 string CD001 # -!:mime application/x-iso9660-image +0 name cdrom >38913 string !NSR0 ISO 9660 CD-ROM filesystem data +!:mime application/x-iso9660-image >38913 string NSR0 UDF filesystem data +!:mime application/x-iso9660-image >>38917 string 1 (version 1.0) >>38917 string 2 (version 1.5) >>38917 string 3 (version 2.0) @@ -1898,6 +1928,18 @@ !:mime application/x-iso9660-image 32777 string CDROM High Sierra CD-ROM filesystem data +# CDROM Filesystems +# https://en.wikipedia.org/wiki/ISO_9660 +# Modified for UDF by gerardo.cacciari@gmail.com +32769 string CD001 +# mime line at that position does not work +# to display CD-ROM (70=81-11) after MBR (113=40+72+1), partition-table (71=50+21) and before Apple Driver Map (51) +!:strength -11 +# to display CD-ROM (114=81+33) before MBR (113=40+72+1), partition-table (71=50+21) and Apple Driver Map (51) +# does not work +#!:strength +33 +>0 use cdrom + # .cso files 0 string CISO Compressed ISO CD image @@ -2131,7 +2173,6 @@ # which is mapped to VBN 2 of [000000]INDEXF.SYS;1 - gerardo.cacciari@gmail.com # 1008 string DECFILE11 Files-11 On-Disk Structure ->525 byte x Level %d >525 byte x (ODS-%d); >1017 string A RSX-11, VAX/VMS or OpenVMS VAX file system; >1017 string B @@ -2266,14 +2307,31 @@ # UBIfs # Linux kernel sources: fs/ubifs/ubifs-media.h -0 belong 0x31181006 ->0x16 short 0 UBIfs image ->0x08 lequad x \b, sequence number %llu ->0x10 leshort x \b, length %u ->0x04 lelong x \b, CRC 0x%08x - -0 belong 0x55424923 ->0x04 short <2 ->0x05 string \0\0\0 ->0x1c string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 ->0x04 short x UBI image, version %u +0 lelong 0x06101831 +>0x16 leshort 0 UBIfs image +>0x08 lequad x \b, sequence number %llu +>0x10 leshort x \b, length %u +>0x04 lelong x \b, CRC 0x%08x + +0 lelong 0x23494255 +>0x04 leshort <2 +>0x05 string \0\0\0 +>0x1c string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 +>0x04 leshort x UBI image, version %u + +# NEC PC-88 2D disk image +# From Fabio R. Schmidlin +0x20 ulelong&0xFFFFFEFF 0x2A0 +>0x10 string \0\0\0\0\0\0\0\0\0\0 +>>0x280 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 +>>>0x1A ubyte&0xEF 0 +>>>>0x1B ubyte&0x8F 0 +>>>>>0x1B ubyte&70 <0x40 +>>>>>>0x1C ulelong >0x21 +>>>>>>>0 regex [[:print:]]* NEC PC-88 disk image, name=%s +>>>>>>>>0x1B ubyte 0 \b, media=2D +>>>>>>>>0x1B ubyte 0x10 \b, media=2DD +>>>>>>>>0x1B ubyte 0x20 \b, media=2HD +>>>>>>>>0x1B ubyte 0x30 \b, media=1D +>>>>>>>>0x1B ubyte 0x40 \b, media=1DD +>>>>>>>>0x1A ubyte 0x10 \b, write-protected From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 09:29:13 2014 Return-Path: Delivered-To: svn-src-all@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 DEDD2443; Sun, 26 Oct 2014 09:29: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 C9E7CED; Sun, 26 Oct 2014 09:29: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 s9Q9TC5o088367; Sun, 26 Oct 2014 09:29:12 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q9TCcu088366; Sun, 26 Oct 2014 09:29:12 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410260929.s9Q9TCcu088366@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 26 Oct 2014 09:29:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273689 - head/contrib/file/magic/Magdir X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 09:29:13 -0000 Author: delphij Date: Sun Oct 26 09:29:12 2014 New Revision: 273689 URL: https://svnweb.freebsd.org/changeset/base/273689 Log: MFV r273688: Update filesystems magic. This fixes a regression introduced by libmagic 5.19 which prevents file(1) to show more verbose information about a MBR. Submitted by: madpilot MFC after: 2 weeks Modified: head/contrib/file/magic/Magdir/filesystems Directory Properties: head/contrib/file/ (props changed) Modified: head/contrib/file/magic/Magdir/filesystems ============================================================================== --- head/contrib/file/magic/Magdir/filesystems Sun Oct 26 09:24:32 2014 (r273688) +++ head/contrib/file/magic/Magdir/filesystems Sun Oct 26 09:29:12 2014 (r273689) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: filesystems,v 1.95 2014/06/03 19:17:27 christos Exp $ +# $File: filesystems,v 1.106 2014/10/23 17:17:09 christos Exp $ # filesystems: file(1) magic for different filesystems # 0 name partid @@ -254,19 +254,13 @@ 30 search/481 \x55\xAA # to display DOS/MBR boot sector (40) before old one (strength=50+21),Syslinux bootloader (71),SYSLINUX MBR (37+36),NetBSD mbr (110),AdvanceMAME mbr (111) # DOS BPB information (70) and after DOS floppy (120) like in previous file version -!:strength +72 +!:strength +65 # for sector sizes < 512 Bytes >11 uleshort <512 >>(11.s-2) uleshort 0xAA55 DOS/MBR boot sector # for sector sizes with 512 or more Bytes >0x1FE leshort 0xAA55 DOS/MBR boot sector -# keep old DOS/MBR boot sector as dummy for mbr and bootloader displaying -# only for sector sizes with 512 or more Bytes -0x1FE leshort 0xAA55 -# -# to display information (50) before DOS BPB (strength=70) and after DOS floppy (120) like in old file version -!:strength +21 ->2 string OSBS \b, OS/BS MBR +>2 string OSBS OS/BS MBR # added by Joerg Jenderek at Feb 2013 according to http://thestarman.pcministry.com/asm/mbr/ # and http://en.wikipedia.org/wiki/Master_Boot_Record # test for nearly all MS-DOS Master Boot Record initial program loader (IPL) is now done by @@ -538,6 +532,8 @@ >>>514 string !HdrS # not BeOS >>>>422 string !Be\ Boot\ Loader +>>>>>32769 string CD001 +>>>>>>0 use cdrom # jump over BPB instruction implies DOS bootsector or AdvanceMAME mbr >>>>>0 ubelong&0xFD000000 =0xE9000000 # AdvanceMAME mbr @@ -1043,7 +1039,7 @@ >>>>>>466 ubyte <0x10 >>>>>>>466 ubyte 0x05 \b, extended partition table >>>>>>>466 ubyte 0x0F \b, extended partition table (LBA) ->>>>>>>466 ubyte 0x0 \b, extended partition table (last) +>>>>>>>466 ubyte 0x0 \b, extended partition table (last) # DOS x86 sector separated and moved from "DOS/MBR boot sector" by Joerg Jenderek at May 2011 @@ -1236,6 +1232,7 @@ >>>>>181 search/166 Error\ \0 # "a: disk" , "Fn: diskn" or "NetBSD MBR boot" >>>>>>&3 string x \b,"%s" +>>>446 use partition-table # Andrea Mazzoleni AdvanceCD mbr loader of http://advancemame.sourceforge.net/boot-readme.html # added by Joerg Jenderek at Nov 2012 for versions 1.3 - 1.4 # assembler instructions: jmp short 0x58;nop;ASCII @@ -1353,18 +1350,19 @@ # minimal short forward jump found 0x29 for bootloaders or 0x0 # maximal short forward jump is 0x7f # OEM-ID is empty or contain readable bytes -0 ulelong&0x804000E9 0x000000E9 +0 ulelong&0x804000E9 0x000000E9 +!:strength +60 # mtools-3.9.8/msdos.h # usual values are marked with comments to get only informations of strange FAT systems # valid sectorsize must be a power of 2 from 32 to 32768 ->11 uleshort&0xf001f 0 +>11 uleshort&0x001f 0 >>11 uleshort <32769 >>>11 uleshort >31 >>>>21 ubyte&0xf0 0xF0 ->>>>>0 ubyte 0xEB +>>>>>0 ubyte 0xEB DOS/MBR boot sector >>>>>>1 ubyte x \b, code offset 0x%x+2 >>>>>0 ubyte 0xE9 ->>>>>>1 uleshort x \b, code offset 0x%x+2 +>>>>>>1 uleshort x \b, code offset 0x%x+3 >>>>>3 string >\0 \b, OEM-ID "%-.8s" #http://mirror.href.com/thestarman/asm/debug/debug2.htm#IHC >>>>>>8 string IHC \b cached by Windows 9M @@ -1373,10 +1371,11 @@ >>>>>11 uleshort <512 \b, Bytes/sector %u >>>>>13 ubyte >1 \b, sectors/cluster %u #>>>>>13 ubyte =1 \b, sectors/cluster %u (usual on Floppies) ->>>>>82 string FAT32 +# for lazy FAT32 implementation like Transcend digital photo frame PF830 +>>>>>82 string/c fat32 >>>>>>14 uleshort !32 \b, reserved sectors %u #>>>>>>14 uleshort =32 \b, reserved sectors %u (usual Fat32) ->>>>>82 string !FAT32 +>>>>>82 string/c !fat32 >>>>>>14 uleshort >1 \b, reserved sectors %u #>>>>>>14 uleshort =1 \b, reserved sectors %u (usual FAT12,FAT16) #>>>>>>14 uleshort 0 \b, reserved sectors %u (usual NTFS) @@ -1399,24 +1398,29 @@ >>>>>26 ubyte =1 \b, heads %u # valid only for sector sizes with more then 32 Bytes >>>>>11 uleshort >32 -# skip for Digital Research DOS (version 3.41) 1440 kB Bootdisk ->>>>>>38 ubyte !0x70 +# http://en.wikipedia.org/wiki/Design_of_the_FAT_file_system#Extended_BIOS_Parameter_Block +# skip for values 2,2Ah,70h,73h,DFh +# and continue for extended boot signature values 0,28h,29h,80h +>>>>>>38 ubyte&0x56 =0 >>>>>>>28 ulelong >0 \b, hidden sectors %u #>>>>>>>28 ulelong =0 \b, hidden sectors %u (usual floppy) >>>>>>>32 ulelong >0 \b, sectors %u (volumes > 32 MB) #>>>>>>>32 ulelong =0 \b, sectors %u (volumes > 32 MB) # FAT<32 bit specific ->>>>>>>82 string !FAT32 +>>>>>>>82 string/c !fat32 #>>>>>>>>36 ubyte 0x80 \b, physical drive 0x%x=0x80 (usual harddisk) #>>>>>>>>36 ubyte 0 \b, physical drive 0x%x=0 (usual floppy) >>>>>>>>36 ubyte !0x80 >>>>>>>>>36 ubyte !0 \b, physical drive 0x%x +# VGA-copy CRC or +# in Windows NT bit 0 is a dirty flag to request chkdsk at boot time. bit 1 requests surface scan too >>>>>>>>37 ubyte >0 \b, reserved 0x%x #>>>>>>>>37 ubyte =0 \b, reserved 0x%x -# value is 0x80 for NTFS +# extended boot signatur value is 0x80 for NTFS, 0x28 or 0x29 for others >>>>>>>>38 ubyte !0x29 \b, dos < 4.0 BootSector (0x%x) ->>>>>>>>38 ubyte =0x29 +>>>>>>>>38 ubyte&0xFE =0x28 >>>>>>>>>39 ulelong x \b, serial number 0x%x +>>>>>>>>38 ubyte =0x29 >>>>>>>>>43 string >>>>>>>>43 string >NO\ NAME \b, label: "%11.11s" >>>>>>>>>43 string =NO\ NAME \b, unlabeled @@ -1426,11 +1430,35 @@ # if it is small enough FAT is 12 bit, if it is too big enough FAT is 32 bit, # otherwise FAT is 16 bit. # http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/determining-fat-widths.html ->>>>>>54 string FAT \b, FAT ->>>>>>>54 string FAT12 \b (12 bit) ->>>>>>>54 string FAT16 \b (16 bit) +>>>>>82 string/c !fat32 +>>>>>>54 string FAT12 \b, FAT (12 bit) +>>>>>>54 string FAT16 \b, FAT (16 bit) +>>>>>>54 default x +# determinate FAT bit size by media descriptor +# small floppies implies FAT12 +>>>>>>>21 ubyte <0xF0 \b, FAT (12 bit by descriptor) +# with media descriptor F0h floppy or maybe superfloppy with FAT16 +>>>>>>>21 ubyte =0xF0 +# superfloppy (many sectors) implies FAT16 +>>>>>>>>32 ulelong >0xFFFF \b, FAT (16 bit by descriptor+sectors) +# no superfloppy with media descriptor F0h implies FAT12 +>>>>>>>>32 default x \b, FAT (12 bit by descriptor+sectors) +# with media descriptor F8h floppy or hard disc with FAT12 or FAT16 +>>>>>>>21 ubyte =0xF8 +# 360 KiB with media descriptor F8h, 9 sectors per track ,single sided floppy implies FAT12 +>>>>>>>>19 ubequad 0xd002f80300090001 \b, FAT (12 bit by descriptor+geometry) +# hard disc with FAT12 or FAT16 +>>>>>>>>19 default x \b, FAT (1Y bit by descriptor) +# with media descriptor FAh floppy, RAM disc with FAT12 or FAT16 or Tandy hard disc +>>>>>>>21 ubyte =0xFA +# 320 KiB with media descriptor FAh, 8 sectors per track ,single sided floppy implies FAT12 +>>>>>>>>19 ubequad 0x8002fa0200080001 \b, FAT (12 bit by descriptor+geometry) +# RAM disc with FAT12 or FAT16 or Tandy hard disc +>>>>>>>>19 default x \b, FAT (1Y bit by descriptor) +# others are floppy +>>>>>>>21 default x \b, FAT (12 bit by descriptor) # FAT32 bit specific ->>>>>82 string FAT32 \b, FAT (32 bit) +>>>>>82 string/c fat32 \b, FAT (32 bit) >>>>>>36 ulelong x \b, sectors/FAT %u # http://technet.microsoft.com/en-us/library/cc977221.aspx >>>>>>40 uleshort >0 \b, extension flags 0x%x @@ -1443,9 +1471,12 @@ >>>>>>48 uleshort >1 \b, infoSector %u #>>>>>>48 uleshort =1 \b, infoSector %u (usual) >>>>>>48 uleshort <1 \b, infoSector %u ->>>>>>50 uleshort >6 \b, Backup boot sector %u +# 0 or 0xFFFF instead of usual 6 means no backup sector +>>>>>>50 uleshort =0xFFFF \b, no Backup boot sector +>>>>>>50 uleshort =0 \b, no Backup boot sector #>>>>>>50 uleshort =6 \b, Backup boot sector %u (usual) ->>>>>>50 uleshort <6 \b, Backup boot sector %u +>>>>>>50 default x +>>>>>>>50 uleshort x \b, Backup boot sector %u # corrected by Joerg Jenderek at Feb 2011 according to http://thestarman.pcministry.com/asm/mbr/MSWIN41.htm#FSINFO >>>>>>52 ulelong >0 \b, reserved1 0x%x >>>>>>56 ulelong >0 \b, reserved2 0x%x @@ -1880,12 +1911,11 @@ # defect IO.SYS+MSDOS.SYS ? #>>>>>0x162 use 2xDOS-filename -# CDROM Filesystems -# Modified for UDF by gerardo.cacciari@gmail.com -32769 string CD001 # -!:mime application/x-iso9660-image +0 name cdrom >38913 string !NSR0 ISO 9660 CD-ROM filesystem data +!:mime application/x-iso9660-image >38913 string NSR0 UDF filesystem data +!:mime application/x-iso9660-image >>38917 string 1 (version 1.0) >>38917 string 2 (version 1.5) >>38917 string 3 (version 2.0) @@ -1898,6 +1928,18 @@ !:mime application/x-iso9660-image 32777 string CDROM High Sierra CD-ROM filesystem data +# CDROM Filesystems +# https://en.wikipedia.org/wiki/ISO_9660 +# Modified for UDF by gerardo.cacciari@gmail.com +32769 string CD001 +# mime line at that position does not work +# to display CD-ROM (70=81-11) after MBR (113=40+72+1), partition-table (71=50+21) and before Apple Driver Map (51) +!:strength -11 +# to display CD-ROM (114=81+33) before MBR (113=40+72+1), partition-table (71=50+21) and Apple Driver Map (51) +# does not work +#!:strength +33 +>0 use cdrom + # .cso files 0 string CISO Compressed ISO CD image @@ -2131,7 +2173,6 @@ # which is mapped to VBN 2 of [000000]INDEXF.SYS;1 - gerardo.cacciari@gmail.com # 1008 string DECFILE11 Files-11 On-Disk Structure ->525 byte x Level %d >525 byte x (ODS-%d); >1017 string A RSX-11, VAX/VMS or OpenVMS VAX file system; >1017 string B @@ -2266,14 +2307,31 @@ # UBIfs # Linux kernel sources: fs/ubifs/ubifs-media.h -0 belong 0x31181006 ->0x16 short 0 UBIfs image ->0x08 lequad x \b, sequence number %llu ->0x10 leshort x \b, length %u ->0x04 lelong x \b, CRC 0x%08x - -0 belong 0x55424923 ->0x04 short <2 ->0x05 string \0\0\0 ->0x1c string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 ->0x04 short x UBI image, version %u +0 lelong 0x06101831 +>0x16 leshort 0 UBIfs image +>0x08 lequad x \b, sequence number %llu +>0x10 leshort x \b, length %u +>0x04 lelong x \b, CRC 0x%08x + +0 lelong 0x23494255 +>0x04 leshort <2 +>0x05 string \0\0\0 +>0x1c string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 +>0x04 leshort x UBI image, version %u + +# NEC PC-88 2D disk image +# From Fabio R. Schmidlin +0x20 ulelong&0xFFFFFEFF 0x2A0 +>0x10 string \0\0\0\0\0\0\0\0\0\0 +>>0x280 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 +>>>0x1A ubyte&0xEF 0 +>>>>0x1B ubyte&0x8F 0 +>>>>>0x1B ubyte&70 <0x40 +>>>>>>0x1C ulelong >0x21 +>>>>>>>0 regex [[:print:]]* NEC PC-88 disk image, name=%s +>>>>>>>>0x1B ubyte 0 \b, media=2D +>>>>>>>>0x1B ubyte 0x10 \b, media=2DD +>>>>>>>>0x1B ubyte 0x20 \b, media=2HD +>>>>>>>>0x1B ubyte 0x30 \b, media=1D +>>>>>>>>0x1B ubyte 0x40 \b, media=1DD +>>>>>>>>0x1A ubyte 0x10 \b, write-protected From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 13:30:54 2014 Return-Path: Delivered-To: svn-src-all@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 0CC47C6A; Sun, 26 Oct 2014 13: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 ECF78994; Sun, 26 Oct 2014 13: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 s9QDUr09000737; Sun, 26 Oct 2014 13:30:53 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QDUrJa000736; Sun, 26 Oct 2014 13:30:53 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410261330.s9QDUrJa000736@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 26 Oct 2014 13:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273690 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 13:30:54 -0000 Author: trasz Date: Sun Oct 26 13:30:53 2014 New Revision: 273690 URL: https://svnweb.freebsd.org/changeset/base/273690 Log: Mention VAAI and ODX in ctl(4). Reviewed by: mav@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/ctl.4 Modified: head/share/man/man4/ctl.4 ============================================================================== --- head/share/man/man4/ctl.4 Sun Oct 26 09:29:12 2014 (r273689) +++ head/share/man/man4/ctl.4 Sun Oct 26 13:30:53 2014 (r273690) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 2, 2013 +.Dd October 23, 2014 .Dt CTL 4 .Os .Sh NAME @@ -57,7 +57,7 @@ Tagged queueing .It SCSI task attribute support (ordered, head of queue, simple tags) .It -SCSI implicit command ordering support. +SCSI implicit command ordering support .It Full task management support (abort, LUN reset, target reset, etc.) .It @@ -67,6 +67,12 @@ Support for multiple simultaneous initia .It Support for multiple simultaneous backing stores .It +Support for VMWare VAAI: COMPARE AND WRITE, XCOPY, WRITE SAME, +and UNMAP commands +.It +Support for Microsoft ODX: POPULATE TOKEN/WRITE USING TOKEN, +WRITE SAME, and UNMAP commands +.It Persistent reservation support .It Mode sense/select support From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 14:25:43 2014 Return-Path: Delivered-To: svn-src-all@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 F246150D; Sun, 26 Oct 2014 14:25: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 DEDE7D76; Sun, 26 Oct 2014 14:25: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 s9QEPgCA026796; Sun, 26 Oct 2014 14:25:42 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QEPggh026795; Sun, 26 Oct 2014 14:25:42 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410261425.s9QEPggh026795@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 26 Oct 2014 14:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273691 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 14:25:43 -0000 Author: mjg Date: Sun Oct 26 14:25:42 2014 New Revision: 273691 URL: https://svnweb.freebsd.org/changeset/base/273691 Log: Fix up an assertion in kern_setgroups, it should compare with ngroups_max + 1 Bug introdued in r273685. Noted by: Tiwei Bie Modified: head/sys/kern/kern_prot.c Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Sun Oct 26 13:30:53 2014 (r273690) +++ head/sys/kern/kern_prot.c Sun Oct 26 14:25:42 2014 (r273691) @@ -835,7 +835,7 @@ kern_setgroups(struct thread *td, u_int struct ucred *newcred, *oldcred; int error; - MPASS(ngrp <= ngroups_max); + MPASS(ngrp <= ngroups_max + 1); AUDIT_ARG_GROUPSET(groups, ngrp); newcred = crget(); crextend(newcred, ngrp); From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 15:28:09 2014 Return-Path: Delivered-To: svn-src-all@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 4B450302; Sun, 26 Oct 2014 15:28: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 14C2D2E4; Sun, 26 Oct 2014 15:28: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 s9QFS8dT055579; Sun, 26 Oct 2014 15:28:08 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QFS8Wa055577; Sun, 26 Oct 2014 15:28:08 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201410261528.s9QFS8Wa055577@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 26 Oct 2014 15:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273693 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 15:28:09 -0000 Author: mav Date: Sun Oct 26 15:28:07 2014 New Revision: 273693 URL: https://svnweb.freebsd.org/changeset/base/273693 Log: Fix printing non-terminated strings in devlist XML. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sun Oct 26 14:43:02 2014 (r273692) +++ head/sys/cam/ctl/ctl.c Sun Oct 26 15:28:07 2014 (r273693) @@ -2200,13 +2200,14 @@ ctl_copyout_args(int num_args, struct ct * Escape characters that are illegal or not recommended in XML. */ int -ctl_sbuf_printf_esc(struct sbuf *sb, char *str) +ctl_sbuf_printf_esc(struct sbuf *sb, char *str, int size) { + char *end = str + size; int retval; retval = 0; - for (; *str; str++) { + for (; *str && str < end; str++) { switch (*str) { case '&': retval = sbuf_printf(sb, "&"); @@ -3198,7 +3199,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, break; retval = ctl_sbuf_printf_esc(sb, - lun->be_lun->serial_num); + lun->be_lun->serial_num, + sizeof(lun->be_lun->serial_num)); if (retval != 0) break; @@ -3213,7 +3215,9 @@ ctl_ioctl(struct cdev *dev, u_long cmd, if (retval != 0) break; - retval = ctl_sbuf_printf_esc(sb,lun->be_lun->device_id); + retval = ctl_sbuf_printf_esc(sb, + lun->be_lun->device_id, + sizeof(lun->be_lun->device_id)); if (retval != 0) break; Modified: head/sys/cam/ctl/ctl.h ============================================================================== --- head/sys/cam/ctl/ctl.h Sun Oct 26 14:43:02 2014 (r273692) +++ head/sys/cam/ctl/ctl.h Sun Oct 26 15:28:07 2014 (r273693) @@ -156,7 +156,7 @@ int ctl_port_list(struct ctl_port_entry * Put a string into an sbuf, escaping characters that are illegal or not * recommended in XML. Note this doesn't escape everything, just > < and &. */ -int ctl_sbuf_printf_esc(struct sbuf *sb, char *str); +int ctl_sbuf_printf_esc(struct sbuf *sb, char *str, int size); int ctl_ffz(uint32_t *mask, uint32_t size); int ctl_set_mask(uint32_t *mask, uint32_t bit); From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 16:02:36 2014 Return-Path: Delivered-To: svn-src-all@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 C10A3887; Sun, 26 Oct 2014 16:02: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 943BE835; Sun, 26 Oct 2014 16:02: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 s9QG2aXk073906; Sun, 26 Oct 2014 16:02:36 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QG2aAx073905; Sun, 26 Oct 2014 16:02:36 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410261602.s9QG2aAx073905@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 16:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273694 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 16:02:36 -0000 Author: ian Date: Sun Oct 26 16:02:35 2014 New Revision: 273694 URL: https://svnweb.freebsd.org/changeset/base/273694 Log: MFC r273561: Install a temporary workaround to avoid problems in fdt data with linux's workaround for an imx6 chip erratum by using gpio1_6 as an interrupt. Modified: stable/10/sys/arm/freescale/imx/imx6_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_machdep.c Sun Oct 26 15:28:07 2014 (r273693) +++ stable/10/sys/arm/freescale/imx/imx6_machdep.c Sun Oct 26 16:02:35 2014 (r273694) @@ -53,8 +53,39 @@ struct fdt_fixup_entry fdt_fixup_table[] { NULL, NULL } }; +static uint32_t gpio1_node; + +/* + * Work around the linux workaround for imx6 erratum 006687, in which some + * ethernet interrupts don't go to the GPC and thus won't wake the system from + * Wait mode. We don't use Wait mode (which halts the GIC, leaving only GPC + * interrupts able to wake the system), so we don't experience the bug at all. + * The linux workaround is to reconfigure GPIO1_6 as the ENET interrupt by + * writing magic values to an undocumented IOMUX register, then letting the gpio + * interrupt driver notify the ethernet driver. We'll be able to do all that + * (even though we don't need to) once the INTRNG project is committed and the + * imx_gpio driver becomes an interrupt driver. Until then, this crazy little + * workaround watches for requests to map an interrupt 6 with the interrupt + * controller node referring to gpio1, and it substitutes the proper ffec + * interrupt number. + */ +static int +imx6_decode_fdt(uint32_t iparent, uint32_t *intr, int *interrupt, + int *trig, int *pol) +{ + + if (fdt32_to_cpu(intr[0]) == 6 && + OF_node_from_xref(iparent) == gpio1_node) { + *interrupt = 150; + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + return (0); + } + return (gic_decode_fdt(iparent, intr, interrupt, trig, pol)); +} + fdt_pic_decode_t fdt_pic_table[] = { - &gic_decode_fdt, + &imx6_decode_fdt, NULL }; @@ -83,6 +114,9 @@ void initarm_late_init(void) { + /* Cache the gpio1 node handle for imx6_decode_fdt() workaround code. */ + gpio1_node = OF_node_from_xref( + OF_finddevice("/soc/aips-bus@02000000/gpio@0209c000")); } /* From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 16:10:00 2014 Return-Path: Delivered-To: svn-src-all@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 4B314A2F; Sun, 26 Oct 2014 16:10: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 37645878; Sun, 26 Oct 2014 16:10: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 s9QGA0in075034; Sun, 26 Oct 2014 16:10:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QGA00M075033; Sun, 26 Oct 2014 16:10:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410261610.s9QGA00M075033@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 16:10:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273695 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 16:10:00 -0000 Author: ian Date: Sun Oct 26 16:09:59 2014 New Revision: 273695 URL: https://svnweb.freebsd.org/changeset/base/273695 Log: MFC r273590: Accept documented compatible string for PL310 cache controller/ Modified: stable/10/sys/arm/arm/pl310.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/pl310.c ============================================================================== --- stable/10/sys/arm/arm/pl310.c Sun Oct 26 16:02:35 2014 (r273694) +++ stable/10/sys/arm/arm/pl310.c Sun Oct 26 16:09:59 2014 (r273695) @@ -84,6 +84,12 @@ static uint32_t g_ways_assoc; static struct pl310_softc *pl310_softc; +static struct ofw_compat_data compat_data[] = { + {"arm,pl310", true}, /* Non-standard, FreeBSD. */ + {"arm,pl310-cache", true}, + {NULL, false} +}; + void pl310_print_config(struct pl310_softc *sc) { @@ -422,8 +428,7 @@ pl310_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - - if (!ofw_bus_is_compatible(dev, "arm,pl310")) + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) return (ENXIO); device_set_desc(dev, "PL310 L2 cache controller"); return (0); From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 17:14:58 2014 Return-Path: Delivered-To: svn-src-all@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 37417581; Sun, 26 Oct 2014 17:14: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 0A090DF8; Sun, 26 Oct 2014 17:14: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 s9QHEvTL008365; Sun, 26 Oct 2014 17:14:57 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QHEvi3008364; Sun, 26 Oct 2014 17:14:57 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201410261714.s9QHEvi3008364@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sun, 26 Oct 2014 17:14:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273698 - stable/10/release X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 17:14:58 -0000 Author: gjb Date: Sun Oct 26 17:14:57 2014 New Revision: 273698 URL: https://svnweb.freebsd.org/changeset/base/273698 Log: MFC r273653: Fix a few issues with creating VOLUME_LABEL for the installation ISOs: - TYPE, BRANCH, and REVISION are only defined if OSRELEASE is not defined, so in situations where one might set OSRELEASE for an in-house ISO build, VOLUME_LABEL would be empty. - makefs(8) limits the volume label to 32 characters, which for the powerpc64 case, OSRELEASE expands to FreeBSD-11.0-CURRENT-powerpc-powerpc64. Even with removing the prefixing 'FreeBSD-', the string is 30 characters long, leaving zero room for suffixing the type of ISO media (BO for bootonly, CD for cdrom, and DVD for dvdrom). Resolve these by defining VOLUME_LABEL when defining OSRELEASE if unset. If OSRELEASE is defined by the builder, use the OSRELEASE from that definition as the VOLUME_LABEL. In addition, for cases where both TARGET and TARGET_ARCH are used for the VOLUME_LABEL, use TARGET_ARCH if it differs from TARGET. There are probably a few sharp edges here yet, but these problems are going to affect the powerpc/powerpc64 builds for 10.1-RELEASE, so the immediate concern is fixing the underlying problem at hand quickly, and less so about the elegance of the fix. Insta-MFC ok: re (kib) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile ============================================================================== --- stable/10/release/Makefile Sun Oct 26 16:31:25 2014 (r273697) +++ stable/10/release/Makefile Sun Oct 26 17:14:57 2014 (r273698) @@ -56,13 +56,17 @@ ${_V}!= eval $$(awk '/^${_V}=/{print}' $ .for _V in ${TARGET_ARCH} .if !empty(TARGET:M${_V}) OSRELEASE= ${TYPE}-${REVISION}-${BRANCH}-${TARGET} +VOLUME_LABEL= ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET} .else OSRELEASE= ${TYPE}-${REVISION}-${BRANCH}-${TARGET}-${TARGET_ARCH} +VOLUME_LABEL= ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET_ARCH} .endif .endfor .endif -VOLUME_LABEL= ${OSRELEASE:C/[-\.]/_/g:S/^$${TYPE}_//} +.if !defined(VOLUME_LABEL) || empty(VOLUME_LABEL) +VOLUME_LABEL= FreeBSD_Install +.endif .if !exists(${DOCDIR}) NODOC= true From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 17:17:09 2014 Return-Path: Delivered-To: svn-src-all@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 D2F976D7; Sun, 26 Oct 2014 17:17: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 A6169E13; Sun, 26 Oct 2014 17:17: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 s9QHH9j6008756; Sun, 26 Oct 2014 17:17:09 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QHH9UQ008755; Sun, 26 Oct 2014 17:17:09 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201410261717.s9QHH9UQ008755@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sun, 26 Oct 2014 17:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r273699 - releng/10.1/release X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 17:17:09 -0000 Author: gjb Date: Sun Oct 26 17:17:08 2014 New Revision: 273699 URL: https://svnweb.freebsd.org/changeset/base/273699 Log: MFstable10 r273698: MFC r273653: Fix a few issues with creating VOLUME_LABEL for the installation ISOs: - TYPE, BRANCH, and REVISION are only defined if OSRELEASE is not defined, so in situations where one might set OSRELEASE for an in-house ISO build, VOLUME_LABEL would be empty. - makefs(8) limits the volume label to 32 characters, which for the powerpc64 case, OSRELEASE expands to FreeBSD-11.0-CURRENT-powerpc-powerpc64. Even with removing the prefixing 'FreeBSD-', the string is 30 characters long, leaving zero room for suffixing the type of ISO media (BO for bootonly, CD for cdrom, and DVD for dvdrom). Resolve these by defining VOLUME_LABEL when defining OSRELEASE if unset. If OSRELEASE is defined by the builder, use the OSRELEASE from that definition as the VOLUME_LABEL. In addition, for cases where both TARGET and TARGET_ARCH are used for the VOLUME_LABEL, use TARGET_ARCH if it differs from TARGET. There are probably a few sharp edges here yet, but these problems are going to affect the powerpc/powerpc64 builds for 10.1-RELEASE, so the immediate concern is fixing the underlying problem at hand quickly, and less so about the elegance of the fix. Approved by: re (kib) Sponsored by: The FreeBSD Foundation Modified: releng/10.1/release/Makefile Directory Properties: releng/10.1/ (props changed) Modified: releng/10.1/release/Makefile ============================================================================== --- releng/10.1/release/Makefile Sun Oct 26 17:14:57 2014 (r273698) +++ releng/10.1/release/Makefile Sun Oct 26 17:17:08 2014 (r273699) @@ -56,13 +56,17 @@ ${_V}!= eval $$(awk '/^${_V}=/{print}' $ .for _V in ${TARGET_ARCH} .if !empty(TARGET:M${_V}) OSRELEASE= ${TYPE}-${REVISION}-${BRANCH}-${TARGET} +VOLUME_LABEL= ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET} .else OSRELEASE= ${TYPE}-${REVISION}-${BRANCH}-${TARGET}-${TARGET_ARCH} +VOLUME_LABEL= ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET_ARCH} .endif .endfor .endif -VOLUME_LABEL= ${OSRELEASE:C/[-\.]/_/g:S/^$${TYPE}_//} +.if !defined(VOLUME_LABEL) || empty(VOLUME_LABEL) +VOLUME_LABEL= FreeBSD_Install +.endif .if !exists(${DOCDIR}) NODOC= true From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 17:50:35 2014 Return-Path: Delivered-To: svn-src-all@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 A4A34301; Sun, 26 Oct 2014 17:50: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 902C9155; Sun, 26 Oct 2014 17:50: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 s9QHoZV5024233; Sun, 26 Oct 2014 17:50:35 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QHoYag024224; Sun, 26 Oct 2014 17:50:34 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201410261750.s9QHoYag024224@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 26 Oct 2014 17:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273700 - in head/bin/sh: . tests/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 17:50:35 -0000 Author: jilles Date: Sun Oct 26 17:50:33 2014 New Revision: 273700 URL: https://svnweb.freebsd.org/changeset/base/273700 Log: sh: Make getopts memory-safe if with changing arguments. POSIX does not permit to continuing a getopts loop with different arguments. For parsing the positional parameters, we handle this case by resetting the getopts state when the positional parameters are changed in any way (and the getopts state is local to a function). However, in the syntax getopts , changes could lead to invalid memory access. In the syntax getopts , store a copy of the arguments and continue to use them until getopts is reset. Added: head/bin/sh/tests/builtins/getopts9.0 (contents, props changed) head/bin/sh/tests/builtins/getopts9.0.stdout (contents, props changed) Modified: head/bin/sh/eval.c head/bin/sh/options.c head/bin/sh/options.h Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Oct 26 17:17:08 2014 (r273699) +++ head/bin/sh/eval.c Sun Oct 26 17:50:33 2014 (r273700) @@ -1039,6 +1039,7 @@ evalcommand(union node *cmd, int flags, shellparam.reset = 1; shellparam.nparam = argc - 1; shellparam.p = argv + 1; + shellparam.optp = NULL; shellparam.optnext = NULL; INTOFF; savelocalvars = localvars; Modified: head/bin/sh/options.c ============================================================================== --- head/bin/sh/options.c Sun Oct 26 17:17:08 2014 (r273699) +++ head/bin/sh/options.c Sun Oct 26 17:50:33 2014 (r273700) @@ -325,6 +325,7 @@ setparam(char **argv) shellparam.malloc = 1; shellparam.nparam = nparam; shellparam.p = newparam; + shellparam.optp = NULL; shellparam.reset = 1; shellparam.optnext = NULL; } @@ -344,6 +345,11 @@ freeparam(struct shparam *param) ckfree(*ap); ckfree(param->p); } + if (param->optp) { + for (ap = param->optp ; *ap ; ap++) + ckfree(*ap); + ckfree(param->optp); + } } @@ -417,20 +423,33 @@ getoptsreset(const char *value) int getoptscmd(int argc, char **argv) { - char **optbase = NULL; + char **optbase = NULL, **ap; + int i; if (argc < 3) error("usage: getopts optstring var [arg]"); - else if (argc == 3) - optbase = shellparam.p; - else - optbase = &argv[3]; if (shellparam.reset == 1) { + INTOFF; + if (shellparam.optp) { + for (ap = shellparam.optp ; *ap ; ap++) + ckfree(*ap); + ckfree(shellparam.optp); + shellparam.optp = NULL; + } + if (argc > 3) { + shellparam.optp = ckmalloc((argc - 2) * sizeof *ap); + memset(shellparam.optp, '\0', (argc - 2) * sizeof *ap); + for (i = 0; i < argc - 3; i++) + shellparam.optp[i] = savestr(argv[i + 3]); + } + INTON; + optbase = argc == 3 ? shellparam.p : shellparam.optp; shellparam.optnext = optbase; shellparam.optptr = NULL; shellparam.reset = 0; - } + } else + optbase = shellparam.optp ? shellparam.optp : shellparam.p; return getopts(argv[1], argv[2], optbase, &shellparam.optnext, &shellparam.optptr); Modified: head/bin/sh/options.h ============================================================================== --- head/bin/sh/options.h Sun Oct 26 17:17:08 2014 (r273699) +++ head/bin/sh/options.h Sun Oct 26 17:50:33 2014 (r273700) @@ -38,6 +38,7 @@ struct shparam { unsigned char malloc; /* if parameter list dynamically allocated */ unsigned char reset; /* if getopts has been reset */ char **p; /* parameter list */ + char **optp; /* parameter list for getopts */ char **optnext; /* next parameter to be processed by getopts */ char *optptr; /* used by getopts */ }; Added: head/bin/sh/tests/builtins/getopts9.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/getopts9.0 Sun Oct 26 17:50:33 2014 (r273700) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +args='-ab' +getopts ab opt $args +echo $?:$opt:$OPTARG +for dummy in dummy1 dummy2; do + getopts ab opt $args + echo $?:$opt:$OPTARG +done Added: head/bin/sh/tests/builtins/getopts9.0.stdout ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/getopts9.0.stdout Sun Oct 26 17:50:33 2014 (r273700) @@ -0,0 +1,3 @@ +0:a: +0:b: +1:?: From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 17:56:49 2014 Return-Path: Delivered-To: svn-src-all@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 61E964C6; Sun, 26 Oct 2014 17:56: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 42B9422C; Sun, 26 Oct 2014 17:56: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 s9QHunQi027929; Sun, 26 Oct 2014 17:56:49 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QHumF4027924; Sun, 26 Oct 2014 17:56:48 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201410261756.s9QHumF4027924@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 26 Oct 2014 17:56:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273701 - in head/sys: amd64/amd64 arm/arm i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 17:56:49 -0000 Author: alc Date: Sun Oct 26 17:56:47 2014 New Revision: 273701 URL: https://svnweb.freebsd.org/changeset/base/273701 Log: By the time that pmap_init() runs, vm_phys_segs[] has been initialized. Obtaining the end of memory address from vm_phys_segs[] is a little easier than obtaining it from phys_avail[]. Discussed with: Svatopluk Kraus Modified: head/sys/amd64/amd64/pmap.c head/sys/arm/arm/pmap-v6.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Oct 26 17:50:33 2014 (r273700) +++ head/sys/amd64/amd64/pmap.c Sun Oct 26 17:56:47 2014 (r273701) @@ -131,6 +131,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1056,8 +1057,7 @@ pmap_init(void) /* * Calculate the size of the pv head table for superpages. */ - for (i = 0; phys_avail[i + 1]; i += 2); - pv_npg = round_2mpage(phys_avail[(i - 2) + 1]) / NBPDR; + pv_npg = howmany(vm_phys_segs[vm_phys_nsegs - 1].end, NBPDR); /* * Allocate memory for the pv head table for superpages. Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Sun Oct 26 17:50:33 2014 (r273700) +++ head/sys/arm/arm/pmap-v6.c Sun Oct 26 17:56:47 2014 (r273701) @@ -172,6 +172,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -1342,9 +1343,10 @@ pmap_init(void) /* * Calculate the size of the pv head table for superpages. + * Handle the possibility that "vm_phys_segs[...].end" is zero. */ - for (i = 0; phys_avail[i + 1]; i += 2); - pv_npg = round_1mpage(phys_avail[(i - 2) + 1]) / NBPDR; + pv_npg = trunc_1mpage(vm_phys_segs[vm_phys_nsegs - 1].end - + PAGE_SIZE) / NBPDR + 1; /* * Allocate memory for the pv head table for superpages. Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sun Oct 26 17:50:33 2014 (r273700) +++ head/sys/i386/i386/pmap.c Sun Oct 26 17:56:47 2014 (r273701) @@ -133,6 +133,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -778,9 +779,10 @@ pmap_init(void) /* * Calculate the size of the pv head table for superpages. + * Handle the possibility that "vm_phys_segs[...].end" is zero. */ - for (i = 0; phys_avail[i + 1]; i += 2); - pv_npg = round_4mpage(phys_avail[(i - 2) + 1]) / NBPDR; + pv_npg = trunc_4mpage(vm_phys_segs[vm_phys_nsegs - 1].end - + PAGE_SIZE) / NBPDR + 1; /* * Allocate memory for the pv head table for superpages. From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 17:56:58 2014 Return-Path: Delivered-To: svn-src-all@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 D2AC85FE; Sun, 26 Oct 2014 17:56: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 BE81722D; Sun, 26 Oct 2014 17:56: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 s9QHuwM8027992; Sun, 26 Oct 2014 17:56:58 GMT (envelope-from stefanf@FreeBSD.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QHuwup027991; Sun, 26 Oct 2014 17:56:58 GMT (envelope-from stefanf@FreeBSD.org) Message-Id: <201410261756.s9QHuwup027991@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: stefanf set sender to stefanf@FreeBSD.org using -f From: Stefan Farfeleder Date: Sun, 26 Oct 2014 17:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273702 - head/tools/regression/lib/libc/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 17:56:58 -0000 Author: stefanf Date: Sun Oct 26 17:56:58 2014 New Revision: 273702 URL: https://svnweb.freebsd.org/changeset/base/273702 Log: Remove incorrect semicolon. Modified: head/tools/regression/lib/libc/nss/test-gethostby.c Modified: head/tools/regression/lib/libc/nss/test-gethostby.c ============================================================================== --- head/tools/regression/lib/libc/nss/test-gethostby.c Sun Oct 26 17:56:47 2014 (r273701) +++ head/tools/regression/lib/libc/nss/test-gethostby.c Sun Oct 26 17:56:58 2014 (r273702) @@ -109,7 +109,7 @@ __gethostbyname2(const char *name, int a else { error = 0; he = getipnodebyname(name, af, ipnode_flags, &error); - if (he == NULL); + if (he == NULL) errno = error; } From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 18:30:36 2014 Return-Path: Delivered-To: svn-src-all@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 B6A94831; Sun, 26 Oct 2014 18:30: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 889A8855; Sun, 26 Oct 2014 18:30: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 s9QIUaT6046511; Sun, 26 Oct 2014 18:30:36 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QIUZvQ046506; Sun, 26 Oct 2014 18:30:35 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410261830.s9QIUZvQ046506@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 18:30:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273703 - in head/sys: arm/arm arm/at91 conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 18:30:36 -0000 Author: ian Date: Sun Oct 26 18:30:35 2014 New Revision: 273703 URL: https://svnweb.freebsd.org/changeset/base/273703 Log: Remove the ARM_DEVICE_MULTIPASS option and make its effect be the default. Multipass device attachment was tested on many arm platforms by users and only success was reported on the arm@ mailing list. This is just the long-delayed followup of making it the default. Multipass attachment is necessary when using vendor-supplied FDT data, because our devices may need to be attached in a different order than they are described in the FDT data. Modified: head/sys/arm/arm/nexus.c head/sys/arm/at91/std.atmel head/sys/conf/options.arm Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Sun Oct 26 17:56:58 2014 (r273702) +++ head/sys/arm/arm/nexus.c Sun Oct 26 18:30:35 2014 (r273703) @@ -128,12 +128,8 @@ static driver_t nexus_driver = { nexus_methods, 1 /* no softc */ }; -#ifdef ARM_DEVICE_MULTIPASS EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_EARLY); -#else -DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); -#endif static int nexus_probe(device_t dev) Modified: head/sys/arm/at91/std.atmel ============================================================================== --- head/sys/arm/at91/std.atmel Sun Oct 26 17:56:58 2014 (r273702) +++ head/sys/arm/at91/std.atmel Sun Oct 26 18:30:35 2014 (r273703) @@ -12,4 +12,3 @@ device at91sam9x5 # bring in the sam specific timers and such device at91sam9 -options ARM_DEVICE_MULTIPASS Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Sun Oct 26 17:56:58 2014 (r273702) +++ head/sys/conf/options.arm Sun Oct 26 18:30:35 2014 (r273703) @@ -1,7 +1,6 @@ #$FreeBSD$ ARM9_CACHE_WRITE_THROUGH opt_global.h ARM_CACHE_LOCK_ENABLE opt_global.h -ARM_DEVICE_MULTIPASS opt_global.h ARM_KERN_DIRECTMAP opt_vm.h ARM_L2_PIPT opt_global.h ARM_MANY_BOARD opt_global.h From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 18:41:02 2014 Return-Path: Delivered-To: svn-src-all@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 02813B4C; Sun, 26 Oct 2014 18: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 DA3328B1; Sun, 26 Oct 2014 18: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 s9QIf1fY052340; Sun, 26 Oct 2014 18:41:01 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QIf1AQ052339; Sun, 26 Oct 2014 18:41:01 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201410261841.s9QIf1AQ052339@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Sun, 26 Oct 2014 18:41:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273704 - head/sys/cam/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 18:41:02 -0000 Author: smh Date: Sun Oct 26 18:41:01 2014 New Revision: 273704 URL: https://svnweb.freebsd.org/changeset/base/273704 Log: Fix CF ERASE breakage caused by 268205. This prevents BIO_DELETE requests getting stuck in the TRIM queue which results in a panic on shutdown due to outstanding requests. PR: 194606 Reported by: Guido Falsi Reviewed by: mav MFC after: 3 days Sponsored by: Multiplay Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sun Oct 26 18:30:35 2014 (r273703) +++ head/sys/cam/ata/ata_da.c Sun Oct 26 18:41:01 2014 (r273704) @@ -1483,9 +1483,15 @@ ada_dsmtrim(struct ada_softc *softc, str static void ada_cfaerase(struct ada_softc *softc, struct bio *bp, struct ccb_ataio *ataio) { + struct trim_request *req = &softc->trim_req; uint64_t lba = bp->bio_pblkno; uint16_t count = bp->bio_bcount / softc->params.secsize; + bzero(req, sizeof(*req)); + TAILQ_INIT(&req->bps); + bioq_remove(&softc->trim_queue, bp); + TAILQ_INSERT_TAIL(&req->bps, bp, bio_queue); + cam_fill_ataio(ataio, ada_retry_count, adadone, From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 18:46:04 2014 Return-Path: Delivered-To: svn-src-all@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 D5F2CD3B; Sun, 26 Oct 2014 18:46: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 A74F0979; Sun, 26 Oct 2014 18:46: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 s9QIk4CB053673; Sun, 26 Oct 2014 18:46:04 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QIk4wp053671; Sun, 26 Oct 2014 18:46:04 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410261846.s9QIk4wp053671@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 18:46:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273705 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 18:46:05 -0000 Author: ian Date: Sun Oct 26 18:46:03 2014 New Revision: 273705 URL: https://svnweb.freebsd.org/changeset/base/273705 Log: MFC r272528: Make kevent(2) periodic timer events more reliably periodic. Modified: stable/10/sys/kern/kern_event.c stable/10/sys/sys/event.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_event.c ============================================================================== --- stable/10/sys/kern/kern_event.c Sun Oct 26 18:41:01 2014 (r273704) +++ stable/10/sys/kern/kern_event.c Sun Oct 26 18:46:03 2014 (r273705) @@ -541,9 +541,9 @@ filt_timerexpire(void *knx) if ((kn->kn_flags & EV_ONESHOT) != EV_ONESHOT) { calloutp = (struct callout *)kn->kn_hook; - callout_reset_sbt_on(calloutp, - timer2sbintime(kn->kn_sdata), 0 /* 1ms? */, - filt_timerexpire, kn, PCPU_GET(cpuid), 0); + *kn->kn_ptr.p_nexttime += timer2sbintime(kn->kn_sdata); + callout_reset_sbt_on(calloutp, *kn->kn_ptr.p_nexttime, 0, + filt_timerexpire, kn, PCPU_GET(cpuid), C_ABSOLUTE); } } @@ -575,11 +575,13 @@ filt_timerattach(struct knote *kn) kn->kn_flags |= EV_CLEAR; /* automatically set */ kn->kn_status &= ~KN_DETACHED; /* knlist_add clears it */ + kn->kn_ptr.p_nexttime = malloc(sizeof(sbintime_t), M_KQUEUE, M_WAITOK); calloutp = malloc(sizeof(*calloutp), M_KQUEUE, M_WAITOK); callout_init(calloutp, CALLOUT_MPSAFE); kn->kn_hook = calloutp; - callout_reset_sbt_on(calloutp, to, 0 /* 1ms? */, - filt_timerexpire, kn, PCPU_GET(cpuid), 0); + *kn->kn_ptr.p_nexttime = to + sbinuptime(); + callout_reset_sbt_on(calloutp, *kn->kn_ptr.p_nexttime, 0, + filt_timerexpire, kn, PCPU_GET(cpuid), C_ABSOLUTE); return (0); } @@ -593,6 +595,7 @@ filt_timerdetach(struct knote *kn) calloutp = (struct callout *)kn->kn_hook; callout_drain(calloutp); free(calloutp, M_KQUEUE); + free(kn->kn_ptr.p_nexttime, M_KQUEUE); old = atomic_fetch_sub_explicit(&kq_ncallouts, 1, memory_order_relaxed); KASSERT(old > 0, ("Number of callouts cannot become negative")); kn->kn_status |= KN_DETACHED; /* knlist_remove sets it */ Modified: stable/10/sys/sys/event.h ============================================================================== --- stable/10/sys/sys/event.h Sun Oct 26 18:41:01 2014 (r273704) +++ stable/10/sys/sys/event.h Sun Oct 26 18:46:03 2014 (r273705) @@ -214,6 +214,7 @@ struct knote { struct proc *p_proc; /* proc pointer */ struct aiocblist *p_aio; /* AIO job pointer */ struct aioliojob *p_lio; /* LIO job pointer */ + sbintime_t *p_nexttime; /* next timer event fires at */ } kn_ptr; struct filterops *kn_fop; void *kn_hook; From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 19:03:09 2014 Return-Path: Delivered-To: svn-src-all@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 70392F8D; Sun, 26 Oct 2014 19:03: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 5138AB17; Sun, 26 Oct 2014 19:03: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 s9QJ39At062801; Sun, 26 Oct 2014 19:03:09 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QJ37OX062792; Sun, 26 Oct 2014 19:03:07 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201410261903.s9QJ37OX062792@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sun, 26 Oct 2014 19:03:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273706 - in head/sys/amd64/vmm: . io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 19:03:09 -0000 Author: neel Date: Sun Oct 26 19:03:06 2014 New Revision: 273706 URL: https://svnweb.freebsd.org/changeset/base/273706 Log: Change the type of the first argument to the I/O emulation handlers to 'struct vm *'. Previously it used to be a 'void *' but there is no reason to hide the actual type from the handler. Discussed with: tychon MFC after: 1 week Modified: head/sys/amd64/vmm/io/vatpic.c head/sys/amd64/vmm/io/vatpic.h head/sys/amd64/vmm/io/vatpit.c head/sys/amd64/vmm/io/vatpit.h head/sys/amd64/vmm/io/vpmtmr.c head/sys/amd64/vmm/io/vpmtmr.h head/sys/amd64/vmm/vmm_ioport.h Modified: head/sys/amd64/vmm/io/vatpic.c ============================================================================== --- head/sys/amd64/vmm/io/vatpic.c Sun Oct 26 18:46:03 2014 (r273705) +++ head/sys/amd64/vmm/io/vatpic.c Sun Oct 26 19:03:06 2014 (r273706) @@ -641,7 +641,7 @@ vatpic_write(struct vatpic *vatpic, stru } int -vatpic_master_handler(void *vm, int vcpuid, bool in, int port, int bytes, +vatpic_master_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, uint32_t *eax) { struct vatpic *vatpic; @@ -661,7 +661,7 @@ vatpic_master_handler(void *vm, int vcpu } int -vatpic_slave_handler(void *vm, int vcpuid, bool in, int port, int bytes, +vatpic_slave_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, uint32_t *eax) { struct vatpic *vatpic; @@ -681,7 +681,7 @@ vatpic_slave_handler(void *vm, int vcpui } int -vatpic_elc_handler(void *vm, int vcpuid, bool in, int port, int bytes, +vatpic_elc_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, uint32_t *eax) { struct vatpic *vatpic; Modified: head/sys/amd64/vmm/io/vatpic.h ============================================================================== --- head/sys/amd64/vmm/io/vatpic.h Sun Oct 26 18:46:03 2014 (r273705) +++ head/sys/amd64/vmm/io/vatpic.h Sun Oct 26 19:03:06 2014 (r273706) @@ -39,11 +39,11 @@ struct vatpic *vatpic_init(struct vm *vm); void vatpic_cleanup(struct vatpic *vatpic); -int vatpic_master_handler(void *vm, int vcpuid, bool in, int port, int bytes, - uint32_t *eax); -int vatpic_slave_handler(void *vm, int vcpuid, bool in, int port, int bytes, - uint32_t *eax); -int vatpic_elc_handler(void *vm, int vcpuid, bool in, int port, int bytes, +int vatpic_master_handler(struct vm *vm, int vcpuid, bool in, int port, + int bytes, uint32_t *eax); +int vatpic_slave_handler(struct vm *vm, int vcpuid, bool in, int port, + int bytes, uint32_t *eax); +int vatpic_elc_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, uint32_t *eax); int vatpic_assert_irq(struct vm *vm, int irq); Modified: head/sys/amd64/vmm/io/vatpit.c ============================================================================== --- head/sys/amd64/vmm/io/vatpit.c Sun Oct 26 18:46:03 2014 (r273705) +++ head/sys/amd64/vmm/io/vatpit.c Sun Oct 26 19:03:06 2014 (r273706) @@ -317,7 +317,7 @@ vatpit_update_mode(struct vatpit *vatpit } int -vatpit_handler(void *vm, int vcpuid, bool in, int port, int bytes, +vatpit_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, uint32_t *eax) { struct vatpit *vatpit; @@ -400,7 +400,7 @@ vatpit_handler(void *vm, int vcpuid, boo } int -vatpit_nmisc_handler(void *vm, int vcpuid, bool in, int port, int bytes, +vatpit_nmisc_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, uint32_t *eax) { struct vatpit *vatpit; Modified: head/sys/amd64/vmm/io/vatpit.h ============================================================================== --- head/sys/amd64/vmm/io/vatpit.h Sun Oct 26 18:46:03 2014 (r273705) +++ head/sys/amd64/vmm/io/vatpit.h Sun Oct 26 19:03:06 2014 (r273706) @@ -37,9 +37,9 @@ struct vatpit *vatpit_init(struct vm *vm); void vatpit_cleanup(struct vatpit *vatpit); -int vatpit_handler(void *vm, int vcpuid, bool in, int port, int bytes, - uint32_t *eax); -int vatpit_nmisc_handler(void *vm, int vcpuid, bool in, int port, int bytes, +int vatpit_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, uint32_t *eax); +int vatpit_nmisc_handler(struct vm *vm, int vcpuid, bool in, int port, + int bytes, uint32_t *eax); #endif /* _VATPIT_H_ */ Modified: head/sys/amd64/vmm/io/vpmtmr.c ============================================================================== --- head/sys/amd64/vmm/io/vpmtmr.c Sun Oct 26 18:46:03 2014 (r273705) +++ head/sys/amd64/vmm/io/vpmtmr.c Sun Oct 26 19:03:06 2014 (r273706) @@ -79,7 +79,7 @@ vpmtmr_cleanup(struct vpmtmr *vpmtmr) } int -vpmtmr_handler(void *vm, int vcpuid, bool in, int port, int bytes, +vpmtmr_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, uint32_t *val) { struct vpmtmr *vpmtmr; Modified: head/sys/amd64/vmm/io/vpmtmr.h ============================================================================== --- head/sys/amd64/vmm/io/vpmtmr.h Sun Oct 26 18:46:03 2014 (r273705) +++ head/sys/amd64/vmm/io/vpmtmr.h Sun Oct 26 19:03:06 2014 (r273706) @@ -36,7 +36,7 @@ struct vpmtmr; struct vpmtmr *vpmtmr_init(struct vm *vm); void vpmtmr_cleanup(struct vpmtmr *pmtmr); -int vpmtmr_handler(void *vm, int vcpuid, bool in, int port, int bytes, +int vpmtmr_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, uint32_t *val); #endif Modified: head/sys/amd64/vmm/vmm_ioport.h ============================================================================== --- head/sys/amd64/vmm/vmm_ioport.h Sun Oct 26 18:46:03 2014 (r273705) +++ head/sys/amd64/vmm/vmm_ioport.h Sun Oct 26 19:03:06 2014 (r273706) @@ -29,7 +29,7 @@ #ifndef _VMM_IOPORT_H_ #define _VMM_IOPORT_H_ -typedef int (*ioport_handler_func_t)(void *vm, int vcpuid, +typedef int (*ioport_handler_func_t)(struct vm *vm, int vcpuid, bool in, int port, int bytes, uint32_t *val); int vm_handle_inout(struct vm *vm, int vcpuid, struct vm_exit *vme, bool *retu); From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 19:42:48 2014 Return-Path: Delivered-To: svn-src-all@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 CF3844E7; Sun, 26 Oct 2014 19:42: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 B0487E25; Sun, 26 Oct 2014 19:42: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 s9QJgmpA081647; Sun, 26 Oct 2014 19:42:48 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QJgjch081623; Sun, 26 Oct 2014 19:42:45 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410261942.s9QJgjch081623@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 26 Oct 2014 19:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273707 - in head/sys: compat/freebsd32 kern kgssapi netinet nfs nlm sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 19:42:48 -0000 Author: mjg Date: Sun Oct 26 19:42:44 2014 New Revision: 273707 URL: https://svnweb.freebsd.org/changeset/base/273707 Log: Avoid dynamic syscall overhead for statically compiled modules. The kernel tracks syscall users so that modules can safely unregister them. But if the module is not unloadable or was compiled into the kernel, there is no need to do this. Achieve this by adding SY_THR_STATIC_KLD macro which expands to SY_THR_STATIC during kernel build and 0 otherwise. Reviewed by: kib (previous version) MFC after: 2 weeks Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/freebsd32/freebsd32_util.h head/sys/kern/kern_syscalls.c head/sys/kern/sysv_msg.c head/sys/kern/sysv_sem.c head/sys/kern/sysv_shm.c head/sys/kern/uipc_mqueue.c head/sys/kern/uipc_sem.c head/sys/kern/vfs_aio.c head/sys/kgssapi/gss_impl.c head/sys/netinet/sctp_syscalls.c head/sys/nfs/nfs_nfssvc.c head/sys/nlm/nlm_prot_impl.c head/sys/sys/sysent.h Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sun Oct 26 19:03:06 2014 (r273706) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sun Oct 26 19:42:44 2014 (r273707) @@ -2628,8 +2628,12 @@ freebsd32_xxx(struct thread *td, struct int syscall32_register(int *offset, struct sysent *new_sysent, - struct sysent *old_sysent) + struct sysent *old_sysent, int flags) { + + if ((flags & ~SY_THR_STATIC) != 0) + return (EINVAL); + if (*offset == NO_SYSCALL) { int i; @@ -2648,16 +2652,19 @@ syscall32_register(int *offset, struct s *old_sysent = freebsd32_sysent[*offset]; freebsd32_sysent[*offset] = *new_sysent; - return 0; + atomic_store_rel_32(&freebsd32_sysent[*offset].sy_thrcnt, flags); + return (0); } int syscall32_deregister(int *offset, struct sysent *old_sysent) { - if (*offset) - freebsd32_sysent[*offset] = *old_sysent; - return 0; + if (*offset == 0) + return (0); + + freebsd32_sysent[*offset] = *old_sysent; + return (0); } int @@ -2670,7 +2677,7 @@ syscall32_module_handler(struct module * switch (what) { case MOD_LOAD: error = syscall32_register(data->offset, data->new_sysent, - &data->old_sysent); + &data->old_sysent, SY_THR_STATIC_KLD); if (error) { /* Leave a mark so we know to safely unload below. */ data->offset = NULL; @@ -2707,14 +2714,14 @@ syscall32_module_handler(struct module * } int -syscall32_helper_register(struct syscall_helper_data *sd) +syscall32_helper_register(struct syscall_helper_data *sd, int flags) { struct syscall_helper_data *sd1; int error; for (sd1 = sd; sd1->syscall_no != NO_SYSCALL; sd1++) { error = syscall32_register(&sd1->syscall_no, &sd1->new_sysent, - &sd1->old_sysent); + &sd1->old_sysent, flags); if (error != 0) { syscall32_helper_unregister(sd); return (error); Modified: head/sys/compat/freebsd32/freebsd32_util.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_util.h Sun Oct 26 19:03:06 2014 (r273706) +++ head/sys/compat/freebsd32/freebsd32_util.h Sun Oct 26 19:42:44 2014 (r273707) @@ -98,10 +98,10 @@ SYSCALL32_MODULE(syscallname, } int syscall32_register(int *offset, struct sysent *new_sysent, - struct sysent *old_sysent); + struct sysent *old_sysent, int flags); int syscall32_deregister(int *offset, struct sysent *old_sysent); int syscall32_module_handler(struct module *mod, int what, void *arg); -int syscall32_helper_register(struct syscall_helper_data *sd); +int syscall32_helper_register(struct syscall_helper_data *sd, int flags); int syscall32_helper_unregister(struct syscall_helper_data *sd); struct iovec32; Modified: head/sys/kern/kern_syscalls.c ============================================================================== --- head/sys/kern/kern_syscalls.c Sun Oct 26 19:03:06 2014 (r273706) +++ head/sys/kern/kern_syscalls.c Sun Oct 26 19:42:44 2014 (r273707) @@ -105,10 +105,13 @@ syscall_thread_exit(struct thread *td, s int syscall_register(int *offset, struct sysent *new_sysent, - struct sysent *old_sysent) + struct sysent *old_sysent, int flags) { int i; + if ((flags & ~SY_THR_STATIC) != 0) + return (EINVAL); + if (*offset == NO_SYSCALL) { for (i = 1; i < SYS_MAXSYSCALL; ++i) if (sysent[i].sy_call == (sy_call_t *)lkmnosys) @@ -127,18 +130,23 @@ syscall_register(int *offset, struct sys *old_sysent = sysent[*offset]; new_sysent->sy_thrcnt = SY_THR_ABSENT; sysent[*offset] = *new_sysent; - atomic_store_rel_32(&sysent[*offset].sy_thrcnt, 0); + atomic_store_rel_32(&sysent[*offset].sy_thrcnt, flags); return (0); } int syscall_deregister(int *offset, struct sysent *old_sysent) { + struct sysent *se; - if (*offset) { - syscall_thread_drain(&sysent[*offset]); - sysent[*offset] = *old_sysent; - } + if (*offset == 0) + return (0); /* XXX? */ + + se = &sysent[*offset]; + if ((se->sy_thrcnt & SY_THR_STATIC) != 0) + return (EINVAL); + syscall_thread_drain(se); + sysent[*offset] = *old_sysent; return (0); } @@ -152,7 +160,7 @@ syscall_module_handler(struct module *mo switch (what) { case MOD_LOAD: error = syscall_register(data->offset, data->new_sysent, - &data->old_sysent); + &data->old_sysent, SY_THR_STATIC_KLD); if (error) { /* Leave a mark so we know to safely unload below. */ data->offset = NULL; @@ -190,14 +198,14 @@ syscall_module_handler(struct module *mo } int -syscall_helper_register(struct syscall_helper_data *sd) +syscall_helper_register(struct syscall_helper_data *sd, int flags) { struct syscall_helper_data *sd1; int error; for (sd1 = sd; sd1->syscall_no != NO_SYSCALL; sd1++) { error = syscall_register(&sd1->syscall_no, &sd1->new_sysent, - &sd1->old_sysent); + &sd1->old_sysent, flags); if (error != 0) { syscall_helper_unregister(sd); return (error); Modified: head/sys/kern/sysv_msg.c ============================================================================== --- head/sys/kern/sysv_msg.c Sun Oct 26 19:03:06 2014 (r273706) +++ head/sys/kern/sysv_msg.c Sun Oct 26 19:42:44 2014 (r273707) @@ -252,11 +252,11 @@ msginit() } mtx_init(&msq_mtx, "msq", NULL, MTX_DEF); - error = syscall_helper_register(msg_syscalls); + error = syscall_helper_register(msg_syscalls, SY_THR_STATIC_KLD); if (error != 0) return (error); #ifdef COMPAT_FREEBSD32 - error = syscall32_helper_register(msg32_syscalls); + error = syscall32_helper_register(msg32_syscalls, SY_THR_STATIC_KLD); if (error != 0) return (error); #endif Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Sun Oct 26 19:03:06 2014 (r273706) +++ head/sys/kern/sysv_sem.c Sun Oct 26 19:42:44 2014 (r273707) @@ -278,11 +278,11 @@ seminit(void) semexit_tag = EVENTHANDLER_REGISTER(process_exit, semexit_myhook, NULL, EVENTHANDLER_PRI_ANY); - error = syscall_helper_register(sem_syscalls); + error = syscall_helper_register(sem_syscalls, SY_THR_STATIC_KLD); if (error != 0) return (error); #ifdef COMPAT_FREEBSD32 - error = syscall32_helper_register(sem32_syscalls); + error = syscall32_helper_register(sem32_syscalls, SY_THR_STATIC_KLD); if (error != 0) return (error); #endif Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Sun Oct 26 19:03:06 2014 (r273706) +++ head/sys/kern/sysv_shm.c Sun Oct 26 19:42:44 2014 (r273707) @@ -910,11 +910,11 @@ shminit() shmexit_hook = &shmexit_myhook; shmfork_hook = &shmfork_myhook; - error = syscall_helper_register(shm_syscalls); + error = syscall_helper_register(shm_syscalls, SY_THR_STATIC_KLD); if (error != 0) return (error); #ifdef COMPAT_FREEBSD32 - error = syscall32_helper_register(shm32_syscalls); + error = syscall32_helper_register(shm32_syscalls, SY_THR_STATIC_KLD); if (error != 0) return (error); #endif Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Sun Oct 26 19:03:06 2014 (r273706) +++ head/sys/kern/uipc_mqueue.c Sun Oct 26 19:42:44 2014 (r273707) @@ -2809,11 +2809,11 @@ mqinit(void) { int error; - error = syscall_helper_register(mq_syscalls); + error = syscall_helper_register(mq_syscalls, SY_THR_STATIC_KLD); if (error != 0) return (error); #ifdef COMPAT_FREEBSD32 - error = syscall32_helper_register(mq32_syscalls); + error = syscall32_helper_register(mq32_syscalls, SY_THR_STATIC_KLD); if (error != 0) return (error); #endif Modified: head/sys/kern/uipc_sem.c ============================================================================== --- head/sys/kern/uipc_sem.c Sun Oct 26 19:03:06 2014 (r273706) +++ head/sys/kern/uipc_sem.c Sun Oct 26 19:42:44 2014 (r273707) @@ -993,11 +993,11 @@ ksem_module_init(void) p31b_setcfg(CTL_P1003_1B_SEM_NSEMS_MAX, SEM_MAX); p31b_setcfg(CTL_P1003_1B_SEM_VALUE_MAX, SEM_VALUE_MAX); - error = syscall_helper_register(ksem_syscalls); + error = syscall_helper_register(ksem_syscalls, SY_THR_STATIC_KLD); if (error) return (error); #ifdef COMPAT_FREEBSD32 - error = syscall32_helper_register(ksem32_syscalls); + error = syscall32_helper_register(ksem32_syscalls, SY_THR_STATIC_KLD); if (error) return (error); #endif Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Sun Oct 26 19:03:06 2014 (r273706) +++ head/sys/kern/vfs_aio.c Sun Oct 26 19:42:44 2014 (r273707) @@ -511,11 +511,11 @@ aio_onceonly(void) p31b_setcfg(CTL_P1003_1B_AIO_MAX, MAX_AIO_QUEUE); p31b_setcfg(CTL_P1003_1B_AIO_PRIO_DELTA_MAX, 0); - error = syscall_helper_register(aio_syscalls); + error = syscall_helper_register(aio_syscalls, SY_THR_STATIC_KLD); if (error) return (error); #ifdef COMPAT_FREEBSD32 - error = syscall32_helper_register(aio32_syscalls); + error = syscall32_helper_register(aio32_syscalls, SY_THR_STATIC_KLD); if (error) return (error); #endif Modified: head/sys/kgssapi/gss_impl.c ============================================================================== --- head/sys/kgssapi/gss_impl.c Sun Oct 26 19:03:06 2014 (r273706) +++ head/sys/kgssapi/gss_impl.c Sun Oct 26 19:42:44 2014 (r273707) @@ -70,7 +70,7 @@ kgss_init(void *dummy) LIST_INIT(&kgss_mechs); error = syscall_register(&gssd_syscall_offset, &gssd_syscall_sysent, - &gssd_syscall_prev_sysent); + &gssd_syscall_prev_sysent, SY_THR_STATIC_KLD); if (error) printf("Can't register GSSD syscall\n"); else Modified: head/sys/netinet/sctp_syscalls.c ============================================================================== --- head/sys/netinet/sctp_syscalls.c Sun Oct 26 19:03:06 2014 (r273706) +++ head/sys/netinet/sctp_syscalls.c Sun Oct 26 19:42:44 2014 (r273707) @@ -94,11 +94,11 @@ sctp_syscalls_init(void *unused __unused { int error; - error = syscall_helper_register(sctp_syscalls); + error = syscall_helper_register(sctp_syscalls, SY_THR_STATIC); KASSERT((error == 0), ("%s: syscall_helper_register failed for sctp syscalls", __func__)); #ifdef COMPAT_FREEBSD32 - error = syscall32_helper_register(sctp_syscalls); + error = syscall32_helper_register(sctp_syscalls, SY_THR_STATIC); KASSERT((error == 0), ("%s: syscall32_helper_register failed for sctp syscalls", __func__)); Modified: head/sys/nfs/nfs_nfssvc.c ============================================================================== --- head/sys/nfs/nfs_nfssvc.c Sun Oct 26 19:03:06 2014 (r273706) +++ head/sys/nfs/nfs_nfssvc.c Sun Oct 26 19:42:44 2014 (r273707) @@ -123,7 +123,7 @@ nfssvc_modevent(module_t mod, int type, switch (type) { case MOD_LOAD: error = syscall_register(&nfssvc_offset, &nfssvc_sysent, - &nfssvc_prev_sysent); + &nfssvc_prev_sysent, SY_THR_STATIC_KLD); if (error) break; registered = 1; Modified: head/sys/nlm/nlm_prot_impl.c ============================================================================== --- head/sys/nlm/nlm_prot_impl.c Sun Oct 26 19:03:06 2014 (r273706) +++ head/sys/nlm/nlm_prot_impl.c Sun Oct 26 19:42:44 2014 (r273707) @@ -295,7 +295,7 @@ nlm_init(void *dummy) TAILQ_INIT(&nlm_hosts); error = syscall_register(&nlm_syscall_offset, &nlm_syscall_sysent, - &nlm_syscall_prev_sysent); + &nlm_syscall_prev_sysent, SY_THR_STATIC_KLD); if (error) NLM_ERR("Can't register NLM syscall\n"); else Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Sun Oct 26 19:03:06 2014 (r273706) +++ head/sys/sys/sysent.h Sun Oct 26 19:42:44 2014 (r273707) @@ -76,6 +76,12 @@ struct sysent { /* system call table * #define SY_THR_ABSENT 0x4 #define SY_THR_INCR 0x8 +#ifdef KLD_MODULE +#define SY_THR_STATIC_KLD 0 +#else +#define SY_THR_STATIC_KLD SY_THR_STATIC +#endif + struct image_params; struct __sigset; struct syscall_args; @@ -242,10 +248,10 @@ struct syscall_helper_data { } int syscall_register(int *offset, struct sysent *new_sysent, - struct sysent *old_sysent); + struct sysent *old_sysent, int flags); int syscall_deregister(int *offset, struct sysent *old_sysent); int syscall_module_handler(struct module *mod, int what, void *arg); -int syscall_helper_register(struct syscall_helper_data *sd); +int syscall_helper_register(struct syscall_helper_data *sd, int flags); int syscall_helper_unregister(struct syscall_helper_data *sd); struct proc; From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 20:13:46 2014 Return-Path: Delivered-To: svn-src-all@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 AB015868; Sun, 26 Oct 2014 20:13: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 97E0211B; Sun, 26 Oct 2014 20:13: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 s9QKDkeX096075; Sun, 26 Oct 2014 20:13:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QKDkLl096074; Sun, 26 Oct 2014 20:13:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201410262013.s9QKDkLl096074@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 26 Oct 2014 20:13:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273708 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 20:13:46 -0000 Author: mav Date: Sun Oct 26 20:13:46 2014 New Revision: 273708 URL: https://svnweb.freebsd.org/changeset/base/273708 Log: Fix support for LUN flat space addressing. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sun Oct 26 19:42:44 2014 (r273707) +++ head/sys/cam/ctl/ctl.c Sun Oct 26 20:13:46 2014 (r273708) @@ -9403,17 +9403,18 @@ ctl_report_luns(struct ctl_scsiio *ctsio * Flat addressing method. */ lun_data->luns[num_filled].lundata[0] = - RPL_LUNDATA_ATYP_FLAT | - (targ_lun_id & RPL_LUNDATA_FLAT_LUN_MASK); -#ifdef OLDCTLHEADERS - (SRLD_ADDR_FLAT << SRLD_ADDR_SHIFT) | - (targ_lun_id & SRLD_BUS_LUN_MASK); -#endif + RPL_LUNDATA_ATYP_FLAT | (targ_lun_id >> 8); lun_data->luns[num_filled].lundata[1] = -#ifdef OLDCTLHEADERS - targ_lun_id >> SRLD_BUS_LUN_BITS; -#endif - targ_lun_id >> RPL_LUNDATA_FLAT_LUN_BITS; + (targ_lun_id & 0xff); + num_filled++; + } else if (targ_lun_id <= 0xffffff) { + /* + * Extended flat addressing method. + */ + lun_data->luns[num_filled].lundata[0] = + RPL_LUNDATA_ATYP_EXTLUN | 0x12; + scsi_ulto3b(targ_lun_id, + &lun_data->luns[num_filled].lundata[1]); num_filled++; } else { printf("ctl_report_luns: bogus LUN number %jd, " From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 20:48:27 2014 Return-Path: Delivered-To: svn-src-all@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 722E3D5E; Sun, 26 Oct 2014 20:48: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 5ECC93C7; Sun, 26 Oct 2014 20:48: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 s9QKmRvu010856; Sun, 26 Oct 2014 20:48:27 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QKmRxr010855; Sun, 26 Oct 2014 20:48:27 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201410262048.s9QKmRxr010855@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 26 Oct 2014 20:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273709 - head/usr.bin/vmstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 20:48:27 -0000 Author: mckusick Date: Sun Oct 26 20:48:26 2014 New Revision: 273709 URL: https://svnweb.freebsd.org/changeset/base/273709 Log: Replace update from -r271410 accidentally lost in -r273575. Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Sun Oct 26 20:13:46 2014 (r273708) +++ head/usr.bin/vmstat/vmstat.c Sun Oct 26 20:48:26 2014 (r273709) @@ -828,7 +828,7 @@ dovmstat(unsigned int interval, int reps } static void -printhdr(int ncpus, u_long cpumask) +printhdr(int maxid, u_long cpumask) { int i, num_shown; @@ -844,7 +844,7 @@ printhdr(int ncpus, u_long cpumask) (void)printf(" disk"); (void)printf(" faults "); if (Pflag) { - for (i = 0; i < ncpus; i++) { + for (i = 0; i <= maxid; i++) { if (cpumask & (1ul << i)) printf(" cpu%d ", i); } @@ -864,7 +864,7 @@ printhdr(int ncpus, u_long cpumask) dev_select[i].unit_number); (void)printf(" in sy cs"); if (Pflag) { - for (i = 0; i < ncpus; i++) { + for (i = 0; i <= maxid; i++) { if (cpumask & (1ul << i)) printf(" us sy id"); } From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 21:17:45 2014 Return-Path: Delivered-To: svn-src-all@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 2FDA5509; Sun, 26 Oct 2014 21:17: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 1CC848FE; Sun, 26 Oct 2014 21:17: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 s9QLHiBc025121; Sun, 26 Oct 2014 21:17:44 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QLHi2b025120; Sun, 26 Oct 2014 21:17:44 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201410262117.s9QLHi2b025120@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sun, 26 Oct 2014 21:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273710 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 21:17:45 -0000 Author: neel Date: Sun Oct 26 21:17:44 2014 New Revision: 273710 URL: https://svnweb.freebsd.org/changeset/base/273710 Log: Add a comment explaining the intent behind the I/O reservation [0x72-0x77]. Modified: head/usr.sbin/bhyve/rtc.c Modified: head/usr.sbin/bhyve/rtc.c ============================================================================== --- head/usr.sbin/bhyve/rtc.c Sun Oct 26 20:48:26 2014 (r273709) +++ head/usr.sbin/bhyve/rtc.c Sun Oct 26 21:17:44 2014 (r273710) @@ -375,4 +375,8 @@ rtc_dsdt(void) } LPC_DSDT(rtc_dsdt); +/* + * Reserve the extended RTC I/O ports although they are not emulated at this + * time. + */ SYSRES_IO(0x72, 6); From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 23:25:44 2014 Return-Path: Delivered-To: svn-src-all@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 DF4199D6; Sun, 26 Oct 2014 23:25:43 +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 CB9BB400; Sun, 26 Oct 2014 23:25:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9QNPh3D089179; Sun, 26 Oct 2014 23:25:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QNPhae089172; Sun, 26 Oct 2014 23:25:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201410262325.s9QNPhae089172@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 26 Oct 2014 23:25:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273711 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 23:25:44 -0000 Author: mav Date: Sun Oct 26 23:25:42 2014 New Revision: 273711 URL: https://svnweb.freebsd.org/changeset/base/273711 Log: Allocate buffer for READ BUFFER/WRITE BUFFER commands on demand. These commands are rare, but consume additional 256KB RAM per LUN. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_private.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sun Oct 26 21:17:44 2014 (r273710) +++ head/sys/cam/ctl/ctl.c Sun Oct 26 23:25:42 2014 (r273711) @@ -4735,6 +4735,7 @@ ctl_free_lun(struct ctl_lun *lun) ctl_tpc_lun_shutdown(lun); mtx_destroy(&lun->lun_lock); free(lun->lun_devid, M_CTL); + free(lun->write_buffer, M_CTL); if (lun->flags & CTL_LUN_MALLOCED) free(lun, M_CTL); @@ -5726,7 +5727,7 @@ ctl_read_buffer(struct ctl_scsiio *ctsio len = scsi_3btoul(cdb->length); buffer_offset = scsi_3btoul(cdb->offset); - if (buffer_offset + len > sizeof(lun->write_buffer)) { + if (buffer_offset + len > CTL_WRITE_BUFFER_SIZE) { ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 1, @@ -5739,14 +5740,19 @@ ctl_read_buffer(struct ctl_scsiio *ctsio if ((cdb->byte2 & RWB_MODE) == RWB_MODE_DESCR) { descr[0] = 0; - scsi_ulto3b(sizeof(lun->write_buffer), &descr[1]); + scsi_ulto3b(CTL_WRITE_BUFFER_SIZE, &descr[1]); ctsio->kern_data_ptr = descr; len = min(len, sizeof(descr)); } else if ((cdb->byte2 & RWB_MODE) == RWB_MODE_ECHO_DESCR) { ctsio->kern_data_ptr = echo_descr; len = min(len, sizeof(echo_descr)); - } else + } else { + if (lun->write_buffer == NULL) { + lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, + M_CTL, M_WAITOK); + } ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; + } ctsio->kern_data_len = len; ctsio->kern_total_len = len; ctsio->kern_data_resid = 0; @@ -5784,7 +5790,7 @@ ctl_write_buffer(struct ctl_scsiio *ctsi len = scsi_3btoul(cdb->length); buffer_offset = scsi_3btoul(cdb->offset); - if (buffer_offset + len > sizeof(lun->write_buffer)) { + if (buffer_offset + len > CTL_WRITE_BUFFER_SIZE) { ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 1, @@ -5800,6 +5806,10 @@ ctl_write_buffer(struct ctl_scsiio *ctsi * malloc it and tell the caller the data buffer is here. */ if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { + if (lun->write_buffer == NULL) { + lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, + M_CTL, M_WAITOK); + } ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; ctsio->kern_data_len = len; ctsio->kern_total_len = len; Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Sun Oct 26 21:17:44 2014 (r273710) +++ head/sys/cam/ctl/ctl_private.h Sun Oct 26 23:25:42 2014 (r273711) @@ -384,6 +384,8 @@ struct ctl_devid { */ #define NUM_TARGET_PORT_GROUPS 2 +#define CTL_WRITE_BUFFER_SIZE 262144 + struct tpc_list; struct ctl_lun { struct mtx lun_lock; @@ -417,7 +419,7 @@ struct ctl_lun { int pr_key_count; uint32_t pr_res_idx; uint8_t res_type; - uint8_t write_buffer[262144]; + uint8_t *write_buffer; struct ctl_devid *lun_devid; TAILQ_HEAD(tpc_lists, tpc_list) tpc_lists; }; From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 23:37:29 2014 Return-Path: Delivered-To: svn-src-all@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 34346CAC; Sun, 26 Oct 2014 23:37: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 1ABE36D7; Sun, 26 Oct 2014 23:37: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 s9QNbStX094318; Sun, 26 Oct 2014 23:37:28 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QNbPfX094292; Sun, 26 Oct 2014 23:37:25 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410262337.s9QNbPfX094292@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 23:37:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273712 - in stable/10/sys: contrib/dts gnu/dts gnu/dts/arm gnu/dts/include/dt-bindings/clk gnu/dts/include/dt-bindings/clock gnu/dts/include/dt-bindings/dma gnu/dts/include/dt-bindings... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 23:37:29 -0000 Author: ian Date: Sun Oct 26 23:37:24 2014 New Revision: 273712 URL: https://svnweb.freebsd.org/changeset/base/273712 Log: MFC r262606, r262607, r262608, r262609, r262610, r269528, r269609, r271133: - Move imported dts source from sys/contrib/dts/ to sys/gnu/dts. - Fix some missing properties. - Import dts-related header files. - Update everything to latest vendor branch representing 3.17-rc2 level of Linux DTS API. Added: stable/10/sys/gnu/dts/ - copied from r262606, head/sys/gnu/dts/ stable/10/sys/gnu/dts/arm/skeleton.dtsi - copied unchanged from r262609, head/sys/gnu/dts/arm/skeleton.dtsi - copied from r262610, head/sys/gnu/dts/include/ stable/10/sys/gnu/dts/include/dt-bindings/clk/ti-dra7-atl.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clk/ti-dra7-atl.h stable/10/sys/gnu/dts/include/dt-bindings/clock/at91.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/at91.h stable/10/sys/gnu/dts/include/dt-bindings/clock/bcm21664.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/bcm21664.h stable/10/sys/gnu/dts/include/dt-bindings/clock/bcm281xx.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/bcm281xx.h stable/10/sys/gnu/dts/include/dt-bindings/clock/berlin2.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/berlin2.h stable/10/sys/gnu/dts/include/dt-bindings/clock/berlin2q.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/berlin2q.h stable/10/sys/gnu/dts/include/dt-bindings/clock/clps711x-clock.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/clps711x-clock.h stable/10/sys/gnu/dts/include/dt-bindings/clock/exynos-audss-clk.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/exynos-audss-clk.h stable/10/sys/gnu/dts/include/dt-bindings/clock/exynos3250.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/exynos3250.h stable/10/sys/gnu/dts/include/dt-bindings/clock/exynos5260-clk.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/exynos5260-clk.h stable/10/sys/gnu/dts/include/dt-bindings/clock/exynos5410.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/exynos5410.h stable/10/sys/gnu/dts/include/dt-bindings/clock/hip04-clock.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/hip04-clock.h stable/10/sys/gnu/dts/include/dt-bindings/clock/hix5hd2-clock.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/hix5hd2-clock.h stable/10/sys/gnu/dts/include/dt-bindings/clock/imx1-clock.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/imx1-clock.h stable/10/sys/gnu/dts/include/dt-bindings/clock/imx21-clock.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/imx21-clock.h stable/10/sys/gnu/dts/include/dt-bindings/clock/imx27-clock.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/imx27-clock.h stable/10/sys/gnu/dts/include/dt-bindings/clock/imx6qdl-clock.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/imx6qdl-clock.h stable/10/sys/gnu/dts/include/dt-bindings/clock/imx6sx-clock.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/imx6sx-clock.h stable/10/sys/gnu/dts/include/dt-bindings/clock/lsi,axm5516-clks.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/lsi,axm5516-clks.h stable/10/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-apq8084.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-apq8084.h stable/10/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-ipq806x.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-ipq806x.h stable/10/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-apq8084.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-apq8084.h stable/10/sys/gnu/dts/include/dt-bindings/clock/r7s72100-clock.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/r7s72100-clock.h stable/10/sys/gnu/dts/include/dt-bindings/clock/r8a7779-clock.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/r8a7779-clock.h stable/10/sys/gnu/dts/include/dt-bindings/clock/rk3066a-cru.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/rk3066a-cru.h stable/10/sys/gnu/dts/include/dt-bindings/clock/rk3188-cru-common.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/rk3188-cru-common.h stable/10/sys/gnu/dts/include/dt-bindings/clock/rk3188-cru.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/rk3188-cru.h stable/10/sys/gnu/dts/include/dt-bindings/clock/rk3288-cru.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/rk3288-cru.h stable/10/sys/gnu/dts/include/dt-bindings/clock/s3c2410.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/s3c2410.h stable/10/sys/gnu/dts/include/dt-bindings/clock/s3c2412.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/s3c2412.h stable/10/sys/gnu/dts/include/dt-bindings/clock/s3c2443.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/s3c2443.h stable/10/sys/gnu/dts/include/dt-bindings/clock/s5pv210-audss.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/s5pv210-audss.h stable/10/sys/gnu/dts/include/dt-bindings/clock/s5pv210.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/s5pv210.h stable/10/sys/gnu/dts/include/dt-bindings/clock/stih415-clks.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/stih415-clks.h stable/10/sys/gnu/dts/include/dt-bindings/clock/stih416-clks.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/clock/stih416-clks.h stable/10/sys/gnu/dts/include/dt-bindings/dma/nbpfaxi.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/dma/nbpfaxi.h stable/10/sys/gnu/dts/include/dt-bindings/mfd/palmas.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/mfd/palmas.h - copied from r271133, head/sys/gnu/dts/include/dt-bindings/phy/ stable/10/sys/gnu/dts/include/dt-bindings/pinctrl/pinctrl-tegra-xusb.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/pinctrl/pinctrl-tegra-xusb.h - copied from r271133, head/sys/gnu/dts/include/dt-bindings/reset-controller/ stable/10/sys/gnu/dts/include/dt-bindings/reset/altr,rst-mgr.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/reset/altr,rst-mgr.h stable/10/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-apq8084.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-apq8084.h stable/10/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-ipq806x.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-ipq806x.h stable/10/sys/gnu/dts/include/dt-bindings/reset/qcom,mmcc-apq8084.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/reset/qcom,mmcc-apq8084.h - copied from r271133, head/sys/gnu/dts/include/dt-bindings/soc/ stable/10/sys/gnu/dts/include/dt-bindings/sound/tlv320aic31xx-micbias.h - copied unchanged from r271133, head/sys/gnu/dts/include/dt-bindings/sound/tlv320aic31xx-micbias.h - copied from r271133, head/sys/gnu/dts/include/dt-bindings/spmi/ Directory Properties: stable/10/sys/gnu/dts/include/ (props changed) stable/10/sys/gnu/dts/include/dt-bindings/phy/ (props changed) stable/10/sys/gnu/dts/include/dt-bindings/reset-controller/ (props changed) stable/10/sys/gnu/dts/include/dt-bindings/soc/ (props changed) stable/10/sys/gnu/dts/include/dt-bindings/spmi/ (props changed) Deleted: stable/10/sys/contrib/dts/ Modified: stable/10/sys/gnu/dts/FreeBSD-list (contents, props changed) stable/10/sys/gnu/dts/FreeBSD-upgrade (contents, props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/exynos4.h (contents, props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/exynos5250.h (contents, props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/exynos5420.h (contents, props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/exynos5440.h (contents, props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/hi3620-clock.h (contents, props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/imx6sl-clock.h (contents, props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8960.h (contents, props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8974.h (contents, props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8960.h (contents, props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/r8a7790-clock.h (contents, props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/r8a7791-clock.h (contents, props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/tegra114-car.h (contents, props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/tegra124-car.h (contents, props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/vf610-clock.h (contents, props changed) stable/10/sys/gnu/dts/include/dt-bindings/mfd/as3722.h (contents, props changed) stable/10/sys/gnu/dts/include/dt-bindings/pinctrl/am43xx.h (contents, props changed) stable/10/sys/gnu/dts/include/dt-bindings/pinctrl/dra.h (contents, props changed) stable/10/sys/gnu/dts/include/dt-bindings/pinctrl/omap.h (contents, props changed) stable/10/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-msm8960.h (contents, props changed) stable/10/sys/gnu/dts/include/dt-bindings/reset/qcom,mmcc-msm8960.h (contents, props changed) Directory Properties: stable/10/ (props changed) stable/10/sys/gnu/dts/include/dt-bindings/ (props changed) stable/10/sys/gnu/dts/include/dt-bindings/clk/ (props changed) stable/10/sys/gnu/dts/include/dt-bindings/clk/at91.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/clk/exynos-audss-clk.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/ (props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/efm32-cmu.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/imx5-clock.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/mpc512x-clock.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8660.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8974.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/samsung,s3c64xx-clock.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/tegra20-car.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/clock/tegra30-car.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/dma/ (props changed) stable/10/sys/gnu/dts/include/dt-bindings/dma/at91.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/gpio/ (props changed) stable/10/sys/gnu/dts/include/dt-bindings/gpio/gpio.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/gpio/tegra-gpio.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/input/ (props changed) stable/10/sys/gnu/dts/include/dt-bindings/input/input.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/interrupt-controller/ (props changed) stable/10/sys/gnu/dts/include/dt-bindings/interrupt-controller/arm-gic.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/interrupt-controller/irq.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/mfd/ (props changed) stable/10/sys/gnu/dts/include/dt-bindings/mfd/dbx500-prcmu.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/pinctrl/ (props changed) stable/10/sys/gnu/dts/include/dt-bindings/pinctrl/am33xx.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/pinctrl/at91.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/pinctrl/nomadik.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/pinctrl/pinctrl-tegra.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/pinctrl/rockchip.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/pwm/ (props changed) stable/10/sys/gnu/dts/include/dt-bindings/pwm/pwm.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/reset/ (props changed) stable/10/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-msm8660.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-msm8974.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/reset/qcom,mmcc-msm8974.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/sound/ (props changed) stable/10/sys/gnu/dts/include/dt-bindings/sound/fsl-imx-audmux.h (props changed) stable/10/sys/gnu/dts/include/dt-bindings/thermal/ (props changed) stable/10/sys/gnu/dts/include/dt-bindings/thermal/thermal.h (props changed) Modified: stable/10/sys/gnu/dts/FreeBSD-list ============================================================================== --- head/sys/gnu/dts/FreeBSD-list Fri Feb 28 16:26:44 2014 (r262606) +++ stable/10/sys/gnu/dts/FreeBSD-list Sun Oct 26 23:37:24 2014 (r273712) @@ -64,6 +64,7 @@ src/arm/sama5d3_uart.dtsi src/arm/sama5d3xcm.dtsi src/arm/sama5d3xdm.dtsi src/arm/sama5d3xmb.dtsi +src/arm/skeleton.dtsi src/arm/tny_a9260.dts src/arm/tny_a9260_common.dtsi src/arm/tny_a9263.dts Modified: stable/10/sys/gnu/dts/FreeBSD-upgrade ============================================================================== --- head/sys/gnu/dts/FreeBSD-upgrade Fri Feb 28 16:26:44 2014 (r262606) +++ stable/10/sys/gnu/dts/FreeBSD-upgrade Sun Oct 26 23:37:24 2014 (r273712) @@ -13,7 +13,7 @@ # all of them. This means we have an 'opt in' list rather than an 'opt out' list # that's more typical for FreeBSD. The opt-in list should be relative to the top level # directory (so a bunch of lines starting with src). We import src/$ARCH/foo into -# sys/contrib/dts/$ARCH/foo with the goal being to use as many of these files as possible +# sys/gnu/dts/$ARCH/foo with the goal being to use as many of these files as possible # unmodified for FreeBSD. This isn't always possible, but there are workarounds. # # This script should take care of all that the first time... @@ -21,4 +21,4 @@ s=svn+ssh://svn.freebsd.org/base/vendor/device-tree/dist/ args=$(grep -v ^# FreeBSD-list | sed -e"s=^=$s=") -svn cp -m "Initial import of DTS files from Linux" ${args} svn+ssh://svn.freebsd.org/base/head/sys/contrib/dts/arm +svn cp -m "Initial import of DTS files from Linux" ${args} svn+ssh://svn.freebsd.org/base/head/sys/gnu/dts/arm Copied: stable/10/sys/gnu/dts/arm/skeleton.dtsi (from r262609, head/sys/gnu/dts/arm/skeleton.dtsi) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/gnu/dts/arm/skeleton.dtsi Sun Oct 26 23:37:24 2014 (r273712, copy of r262609, head/sys/gnu/dts/arm/skeleton.dtsi) @@ -0,0 +1,13 @@ +/* + * Skeleton device tree; the bare minimum needed to boot; just include and + * add a compatible value. The bootloader will typically populate the memory + * node. + */ + +/ { + #address-cells = <1>; + #size-cells = <1>; + chosen { }; + aliases { }; + memory { device_type = "memory"; reg = <0 0>; }; +}; Copied: stable/10/sys/gnu/dts/include/dt-bindings/clk/ti-dra7-atl.h (from r271133, head/sys/gnu/dts/include/dt-bindings/clk/ti-dra7-atl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/gnu/dts/include/dt-bindings/clk/ti-dra7-atl.h Sun Oct 26 23:37:24 2014 (r273712, copy of r271133, head/sys/gnu/dts/include/dt-bindings/clk/ti-dra7-atl.h) @@ -0,0 +1,40 @@ +/* + * This header provides constants for DRA7 ATL (Audio Tracking Logic) + * + * The constants defined in this header are used in dts files + * + * Copyright (C) 2013 Texas Instruments, Inc. + * + * Peter Ujfalusi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _DT_BINDINGS_CLK_DRA7_ATL_H +#define _DT_BINDINGS_CLK_DRA7_ATL_H + +#define DRA7_ATL_WS_MCASP1_FSR 0 +#define DRA7_ATL_WS_MCASP1_FSX 1 +#define DRA7_ATL_WS_MCASP2_FSR 2 +#define DRA7_ATL_WS_MCASP2_FSX 3 +#define DRA7_ATL_WS_MCASP3_FSX 4 +#define DRA7_ATL_WS_MCASP4_FSX 5 +#define DRA7_ATL_WS_MCASP5_FSX 6 +#define DRA7_ATL_WS_MCASP6_FSX 7 +#define DRA7_ATL_WS_MCASP7_FSX 8 +#define DRA7_ATL_WS_MCASP8_FSX 9 +#define DRA7_ATL_WS_MCASP8_AHCLKX 10 +#define DRA7_ATL_WS_XREF_CLK3 11 +#define DRA7_ATL_WS_XREF_CLK0 12 +#define DRA7_ATL_WS_XREF_CLK1 13 +#define DRA7_ATL_WS_XREF_CLK2 14 +#define DRA7_ATL_WS_OSC1_X1 15 + +#endif Copied: stable/10/sys/gnu/dts/include/dt-bindings/clock/at91.h (from r271133, head/sys/gnu/dts/include/dt-bindings/clock/at91.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/gnu/dts/include/dt-bindings/clock/at91.h Sun Oct 26 23:37:24 2014 (r273712, copy of r271133, head/sys/gnu/dts/include/dt-bindings/clock/at91.h) @@ -0,0 +1,22 @@ +/* + * This header provides constants for AT91 pmc status. + * + * The constants defined in this header are being used in dts. + * + * Licensed under GPLv2 or later. + */ + +#ifndef _DT_BINDINGS_CLK_AT91_H +#define _DT_BINDINGS_CLK_AT91_H + +#define AT91_PMC_MOSCS 0 /* MOSCS Flag */ +#define AT91_PMC_LOCKA 1 /* PLLA Lock */ +#define AT91_PMC_LOCKB 2 /* PLLB Lock */ +#define AT91_PMC_MCKRDY 3 /* Master Clock */ +#define AT91_PMC_LOCKU 6 /* UPLL Lock */ +#define AT91_PMC_PCKRDY(id) (8 + (id)) /* Programmable Clock */ +#define AT91_PMC_MOSCSELS 16 /* Main Oscillator Selection */ +#define AT91_PMC_MOSCRCS 17 /* Main On-Chip RC */ +#define AT91_PMC_CFDEV 18 /* Clock Failure Detector Event */ + +#endif Copied: stable/10/sys/gnu/dts/include/dt-bindings/clock/bcm21664.h (from r271133, head/sys/gnu/dts/include/dt-bindings/clock/bcm21664.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/gnu/dts/include/dt-bindings/clock/bcm21664.h Sun Oct 26 23:37:24 2014 (r273712, copy of r271133, head/sys/gnu/dts/include/dt-bindings/clock/bcm21664.h) @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2013 Broadcom Corporation + * Copyright 2013 Linaro Limited + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _CLOCK_BCM21664_H +#define _CLOCK_BCM21664_H + +/* + * This file defines the values used to specify clocks provided by + * the clock control units (CCUs) on Broadcom BCM21664 family SoCs. + */ + +/* bcm21664 CCU device tree "compatible" strings */ +#define BCM21664_DT_ROOT_CCU_COMPAT "brcm,bcm21664-root-ccu" +#define BCM21664_DT_AON_CCU_COMPAT "brcm,bcm21664-aon-ccu" +#define BCM21664_DT_MASTER_CCU_COMPAT "brcm,bcm21664-master-ccu" +#define BCM21664_DT_SLAVE_CCU_COMPAT "brcm,bcm21664-slave-ccu" + +/* root CCU clock ids */ + +#define BCM21664_ROOT_CCU_FRAC_1M 0 +#define BCM21664_ROOT_CCU_CLOCK_COUNT 1 + +/* aon CCU clock ids */ + +#define BCM21664_AON_CCU_HUB_TIMER 0 +#define BCM21664_AON_CCU_CLOCK_COUNT 1 + +/* master CCU clock ids */ + +#define BCM21664_MASTER_CCU_SDIO1 0 +#define BCM21664_MASTER_CCU_SDIO2 1 +#define BCM21664_MASTER_CCU_SDIO3 2 +#define BCM21664_MASTER_CCU_SDIO4 3 +#define BCM21664_MASTER_CCU_SDIO1_SLEEP 4 +#define BCM21664_MASTER_CCU_SDIO2_SLEEP 5 +#define BCM21664_MASTER_CCU_SDIO3_SLEEP 6 +#define BCM21664_MASTER_CCU_SDIO4_SLEEP 7 +#define BCM21664_MASTER_CCU_CLOCK_COUNT 8 + +/* slave CCU clock ids */ + +#define BCM21664_SLAVE_CCU_UARTB 0 +#define BCM21664_SLAVE_CCU_UARTB2 1 +#define BCM21664_SLAVE_CCU_UARTB3 2 +#define BCM21664_SLAVE_CCU_BSC1 3 +#define BCM21664_SLAVE_CCU_BSC2 4 +#define BCM21664_SLAVE_CCU_BSC3 5 +#define BCM21664_SLAVE_CCU_BSC4 6 +#define BCM21664_SLAVE_CCU_CLOCK_COUNT 7 + +#endif /* _CLOCK_BCM21664_H */ Copied: stable/10/sys/gnu/dts/include/dt-bindings/clock/bcm281xx.h (from r271133, head/sys/gnu/dts/include/dt-bindings/clock/bcm281xx.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/gnu/dts/include/dt-bindings/clock/bcm281xx.h Sun Oct 26 23:37:24 2014 (r273712, copy of r271133, head/sys/gnu/dts/include/dt-bindings/clock/bcm281xx.h) @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2013 Broadcom Corporation + * Copyright 2013 Linaro Limited + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _CLOCK_BCM281XX_H +#define _CLOCK_BCM281XX_H + +/* + * This file defines the values used to specify clocks provided by + * the clock control units (CCUs) on Broadcom BCM281XX family SoCs. + */ + +/* + * These are the bcm281xx CCU device tree "compatible" strings. + * We're stuck with using "bcm11351" in the string because wild + * cards aren't allowed, and that name was the first one defined + * in this family of devices. + */ +#define BCM281XX_DT_ROOT_CCU_COMPAT "brcm,bcm11351-root-ccu" +#define BCM281XX_DT_AON_CCU_COMPAT "brcm,bcm11351-aon-ccu" +#define BCM281XX_DT_HUB_CCU_COMPAT "brcm,bcm11351-hub-ccu" +#define BCM281XX_DT_MASTER_CCU_COMPAT "brcm,bcm11351-master-ccu" +#define BCM281XX_DT_SLAVE_CCU_COMPAT "brcm,bcm11351-slave-ccu" + +/* root CCU clock ids */ + +#define BCM281XX_ROOT_CCU_FRAC_1M 0 +#define BCM281XX_ROOT_CCU_CLOCK_COUNT 1 + +/* aon CCU clock ids */ + +#define BCM281XX_AON_CCU_HUB_TIMER 0 +#define BCM281XX_AON_CCU_PMU_BSC 1 +#define BCM281XX_AON_CCU_PMU_BSC_VAR 2 +#define BCM281XX_AON_CCU_CLOCK_COUNT 3 + +/* hub CCU clock ids */ + +#define BCM281XX_HUB_CCU_TMON_1M 0 +#define BCM281XX_HUB_CCU_CLOCK_COUNT 1 + +/* master CCU clock ids */ + +#define BCM281XX_MASTER_CCU_SDIO1 0 +#define BCM281XX_MASTER_CCU_SDIO2 1 +#define BCM281XX_MASTER_CCU_SDIO3 2 +#define BCM281XX_MASTER_CCU_SDIO4 3 +#define BCM281XX_MASTER_CCU_USB_IC 4 +#define BCM281XX_MASTER_CCU_HSIC2_48M 5 +#define BCM281XX_MASTER_CCU_HSIC2_12M 6 +#define BCM281XX_MASTER_CCU_CLOCK_COUNT 7 + +/* slave CCU clock ids */ + +#define BCM281XX_SLAVE_CCU_UARTB 0 +#define BCM281XX_SLAVE_CCU_UARTB2 1 +#define BCM281XX_SLAVE_CCU_UARTB3 2 +#define BCM281XX_SLAVE_CCU_UARTB4 3 +#define BCM281XX_SLAVE_CCU_SSP0 4 +#define BCM281XX_SLAVE_CCU_SSP2 5 +#define BCM281XX_SLAVE_CCU_BSC1 6 +#define BCM281XX_SLAVE_CCU_BSC2 7 +#define BCM281XX_SLAVE_CCU_BSC3 8 +#define BCM281XX_SLAVE_CCU_PWM 9 +#define BCM281XX_SLAVE_CCU_CLOCK_COUNT 10 + +#endif /* _CLOCK_BCM281XX_H */ Copied: stable/10/sys/gnu/dts/include/dt-bindings/clock/berlin2.h (from r271133, head/sys/gnu/dts/include/dt-bindings/clock/berlin2.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/gnu/dts/include/dt-bindings/clock/berlin2.h Sun Oct 26 23:37:24 2014 (r273712, copy of r271133, head/sys/gnu/dts/include/dt-bindings/clock/berlin2.h) @@ -0,0 +1,45 @@ +/* + * Berlin2 BG2/BG2CD clock tree IDs + */ + +#define CLKID_SYS 0 +#define CLKID_CPU 1 +#define CLKID_DRMFIGO 2 +#define CLKID_CFG 3 +#define CLKID_GFX 4 +#define CLKID_ZSP 5 +#define CLKID_PERIF 6 +#define CLKID_PCUBE 7 +#define CLKID_VSCOPE 8 +#define CLKID_NFC_ECC 9 +#define CLKID_VPP 10 +#define CLKID_APP 11 +#define CLKID_AUDIO0 12 +#define CLKID_AUDIO2 13 +#define CLKID_AUDIO3 14 +#define CLKID_AUDIO1 15 +#define CLKID_GFX3D_CORE 16 +#define CLKID_GFX3D_SYS 17 +#define CLKID_ARC 18 +#define CLKID_VIP 19 +#define CLKID_SDIO0XIN 20 +#define CLKID_SDIO1XIN 21 +#define CLKID_GFX3D_EXTRA 22 +#define CLKID_GC360 23 +#define CLKID_SDIO_DLLMST 24 +#define CLKID_GETH0 25 +#define CLKID_GETH1 26 +#define CLKID_SATA 27 +#define CLKID_AHBAPB 28 +#define CLKID_USB0 29 +#define CLKID_USB1 30 +#define CLKID_PBRIDGE 31 +#define CLKID_SDIO0 32 +#define CLKID_SDIO1 33 +#define CLKID_NFC 34 +#define CLKID_SMEMC 35 +#define CLKID_AUDIOHD 36 +#define CLKID_VIDEO0 37 +#define CLKID_VIDEO1 38 +#define CLKID_VIDEO2 39 +#define CLKID_TWD 40 Copied: stable/10/sys/gnu/dts/include/dt-bindings/clock/berlin2q.h (from r271133, head/sys/gnu/dts/include/dt-bindings/clock/berlin2q.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/gnu/dts/include/dt-bindings/clock/berlin2q.h Sun Oct 26 23:37:24 2014 (r273712, copy of r271133, head/sys/gnu/dts/include/dt-bindings/clock/berlin2q.h) @@ -0,0 +1,31 @@ +/* + * Berlin2 BG2Q clock tree IDs + */ + +#define CLKID_SYS 0 +#define CLKID_DRMFIGO 1 +#define CLKID_CFG 2 +#define CLKID_GFX2D 3 +#define CLKID_ZSP 4 +#define CLKID_PERIF 5 +#define CLKID_PCUBE 6 +#define CLKID_VSCOPE 7 +#define CLKID_NFC_ECC 8 +#define CLKID_VPP 9 +#define CLKID_APP 10 +#define CLKID_SDIO0XIN 11 +#define CLKID_SDIO1XIN 12 +#define CLKID_GFX2DAXI 13 +#define CLKID_GETH0 14 +#define CLKID_SATA 15 +#define CLKID_AHBAPB 16 +#define CLKID_USB0 17 +#define CLKID_USB1 18 +#define CLKID_USB2 19 +#define CLKID_USB3 20 +#define CLKID_PBRIDGE 21 +#define CLKID_SDIO 22 +#define CLKID_NFC 23 +#define CLKID_SMEMC 24 +#define CLKID_PCIE 25 +#define CLKID_TWD 26 Copied: stable/10/sys/gnu/dts/include/dt-bindings/clock/clps711x-clock.h (from r271133, head/sys/gnu/dts/include/dt-bindings/clock/clps711x-clock.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/gnu/dts/include/dt-bindings/clock/clps711x-clock.h Sun Oct 26 23:37:24 2014 (r273712, copy of r271133, head/sys/gnu/dts/include/dt-bindings/clock/clps711x-clock.h) @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2014 Alexander Shiyan + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#ifndef __DT_BINDINGS_CLOCK_CLPS711X_H +#define __DT_BINDINGS_CLOCK_CLPS711X_H + +#define CLPS711X_CLK_DUMMY 0 +#define CLPS711X_CLK_CPU 1 +#define CLPS711X_CLK_BUS 2 +#define CLPS711X_CLK_PLL 3 +#define CLPS711X_CLK_TIMERREF 4 +#define CLPS711X_CLK_TIMER1 5 +#define CLPS711X_CLK_TIMER2 6 +#define CLPS711X_CLK_PWM 7 +#define CLPS711X_CLK_SPIREF 8 +#define CLPS711X_CLK_SPI 9 +#define CLPS711X_CLK_UART 10 +#define CLPS711X_CLK_TICK 11 +#define CLPS711X_CLK_MAX 12 + +#endif Copied: stable/10/sys/gnu/dts/include/dt-bindings/clock/exynos-audss-clk.h (from r271133, head/sys/gnu/dts/include/dt-bindings/clock/exynos-audss-clk.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/gnu/dts/include/dt-bindings/clock/exynos-audss-clk.h Sun Oct 26 23:37:24 2014 (r273712, copy of r271133, head/sys/gnu/dts/include/dt-bindings/clock/exynos-audss-clk.h) @@ -0,0 +1,26 @@ +/* + * This header provides constants for Samsung audio subsystem + * clock controller. + * + * The constants defined in this header are being used in dts + * and exynos audss driver. + */ + +#ifndef _DT_BINDINGS_CLK_EXYNOS_AUDSS_H +#define _DT_BINDINGS_CLK_EXYNOS_AUDSS_H + +#define EXYNOS_MOUT_AUDSS 0 +#define EXYNOS_MOUT_I2S 1 +#define EXYNOS_DOUT_SRP 2 +#define EXYNOS_DOUT_AUD_BUS 3 +#define EXYNOS_DOUT_I2S 4 +#define EXYNOS_SRP_CLK 5 +#define EXYNOS_I2S_BUS 6 +#define EXYNOS_SCLK_I2S 7 +#define EXYNOS_PCM_BUS 8 +#define EXYNOS_SCLK_PCM 9 +#define EXYNOS_ADMA 10 + +#define EXYNOS_AUDSS_MAX_CLKS 11 + +#endif Copied: stable/10/sys/gnu/dts/include/dt-bindings/clock/exynos3250.h (from r271133, head/sys/gnu/dts/include/dt-bindings/clock/exynos3250.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/gnu/dts/include/dt-bindings/clock/exynos3250.h Sun Oct 26 23:37:24 2014 (r273712, copy of r271133, head/sys/gnu/dts/include/dt-bindings/clock/exynos3250.h) @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Author: Tomasz Figa + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Device Tree binding constants for Samsung Exynos3250 clock controllers. + */ + +#ifndef _DT_BINDINGS_CLOCK_SAMSUNG_EXYNOS3250_CLOCK_H +#define _DT_BINDINGS_CLOCK_SAMSUNG_EXYNOS3250_CLOCK_H + +/* + * Let each exported clock get a unique index, which is used on DT-enabled + * platforms to lookup the clock from a clock specifier. These indices are + * therefore considered an ABI and so must not be changed. This implies + * that new clocks should be added either in free spaces between clock groups + * or at the end. + */ + + +/* + * Main CMU + */ + +#define CLK_OSCSEL 1 +#define CLK_FIN_PLL 2 +#define CLK_FOUT_APLL 3 +#define CLK_FOUT_VPLL 4 +#define CLK_FOUT_UPLL 5 +#define CLK_FOUT_MPLL 6 + +/* Muxes */ +#define CLK_MOUT_MPLL_USER_L 16 +#define CLK_MOUT_GDL 17 +#define CLK_MOUT_MPLL_USER_R 18 +#define CLK_MOUT_GDR 19 +#define CLK_MOUT_EBI 20 +#define CLK_MOUT_ACLK_200 21 +#define CLK_MOUT_ACLK_160 22 +#define CLK_MOUT_ACLK_100 23 +#define CLK_MOUT_ACLK_266_1 24 +#define CLK_MOUT_ACLK_266_0 25 +#define CLK_MOUT_ACLK_266 26 +#define CLK_MOUT_VPLL 27 +#define CLK_MOUT_EPLL_USER 28 +#define CLK_MOUT_EBI_1 29 +#define CLK_MOUT_UPLL 30 +#define CLK_MOUT_ACLK_400_MCUISP_SUB 31 +#define CLK_MOUT_MPLL 32 +#define CLK_MOUT_ACLK_400_MCUISP 33 +#define CLK_MOUT_VPLLSRC 34 +#define CLK_MOUT_CAM1 35 +#define CLK_MOUT_CAM_BLK 36 +#define CLK_MOUT_MFC 37 +#define CLK_MOUT_MFC_1 38 +#define CLK_MOUT_MFC_0 39 +#define CLK_MOUT_G3D 40 +#define CLK_MOUT_G3D_1 41 +#define CLK_MOUT_G3D_0 42 +#define CLK_MOUT_MIPI0 43 +#define CLK_MOUT_FIMD0 44 +#define CLK_MOUT_UART_ISP 45 +#define CLK_MOUT_SPI1_ISP 46 +#define CLK_MOUT_SPI0_ISP 47 +#define CLK_MOUT_TSADC 48 +#define CLK_MOUT_MMC1 49 +#define CLK_MOUT_MMC0 50 +#define CLK_MOUT_UART1 51 +#define CLK_MOUT_UART0 52 +#define CLK_MOUT_SPI1 53 +#define CLK_MOUT_SPI0 54 +#define CLK_MOUT_AUDIO 55 +#define CLK_MOUT_MPLL_USER_C 56 +#define CLK_MOUT_HPM 57 +#define CLK_MOUT_CORE 58 +#define CLK_MOUT_APLL 59 +#define CLK_MOUT_ACLK_266_SUB 60 + +/* Dividers */ +#define CLK_DIV_GPL 64 +#define CLK_DIV_GDL 65 +#define CLK_DIV_GPR 66 +#define CLK_DIV_GDR 67 +#define CLK_DIV_MPLL_PRE 68 +#define CLK_DIV_ACLK_400_MCUISP 69 +#define CLK_DIV_EBI 70 +#define CLK_DIV_ACLK_200 71 +#define CLK_DIV_ACLK_160 72 +#define CLK_DIV_ACLK_100 73 +#define CLK_DIV_ACLK_266 74 +#define CLK_DIV_CAM1 75 +#define CLK_DIV_CAM_BLK 76 +#define CLK_DIV_MFC 77 +#define CLK_DIV_G3D 78 +#define CLK_DIV_MIPI0_PRE 79 +#define CLK_DIV_MIPI0 80 +#define CLK_DIV_FIMD0 81 +#define CLK_DIV_UART_ISP 82 +#define CLK_DIV_SPI1_ISP_PRE 83 +#define CLK_DIV_SPI1_ISP 84 +#define CLK_DIV_SPI0_ISP_PRE 85 +#define CLK_DIV_SPI0_ISP 86 +#define CLK_DIV_TSADC_PRE 87 +#define CLK_DIV_TSADC 88 +#define CLK_DIV_MMC1_PRE 89 +#define CLK_DIV_MMC1 90 +#define CLK_DIV_MMC0_PRE 91 +#define CLK_DIV_MMC0 92 +#define CLK_DIV_UART1 93 +#define CLK_DIV_UART0 94 +#define CLK_DIV_SPI1_PRE 95 +#define CLK_DIV_SPI1 96 +#define CLK_DIV_SPI0_PRE 97 +#define CLK_DIV_SPI0 98 +#define CLK_DIV_PCM 99 +#define CLK_DIV_AUDIO 100 +#define CLK_DIV_I2S 101 +#define CLK_DIV_CORE2 102 +#define CLK_DIV_APLL 103 +#define CLK_DIV_PCLK_DBG 104 +#define CLK_DIV_ATB 105 +#define CLK_DIV_COREM 106 +#define CLK_DIV_CORE 107 +#define CLK_DIV_HPM 108 +#define CLK_DIV_COPY 109 + +/* Gates */ +#define CLK_ASYNC_G3D 128 +#define CLK_ASYNC_MFCL 129 +#define CLK_PPMULEFT 130 +#define CLK_GPIO_LEFT 131 +#define CLK_ASYNC_ISPMX 132 +#define CLK_ASYNC_FSYSD 133 +#define CLK_ASYNC_LCD0X 134 +#define CLK_ASYNC_CAMX 135 +#define CLK_PPMURIGHT 136 +#define CLK_GPIO_RIGHT 137 +#define CLK_MONOCNT 138 +#define CLK_TZPC6 139 +#define CLK_PROVISIONKEY1 140 +#define CLK_PROVISIONKEY0 141 +#define CLK_CMU_ISPPART 142 +#define CLK_TMU_APBIF 143 +#define CLK_KEYIF 144 +#define CLK_RTC 145 +#define CLK_WDT 146 +#define CLK_MCT 147 +#define CLK_SECKEY 148 +#define CLK_TZPC5 149 +#define CLK_TZPC4 150 +#define CLK_TZPC3 151 +#define CLK_TZPC2 152 +#define CLK_TZPC1 153 +#define CLK_TZPC0 154 +#define CLK_CMU_COREPART 155 +#define CLK_CMU_TOPPART 156 +#define CLK_PMU_APBIF 157 +#define CLK_SYSREG 158 +#define CLK_CHIP_ID 159 +#define CLK_QEJPEG 160 +#define CLK_PIXELASYNCM1 161 +#define CLK_PIXELASYNCM0 162 +#define CLK_PPMUCAMIF 163 +#define CLK_QEM2MSCALER 164 +#define CLK_QEGSCALER1 165 +#define CLK_QEGSCALER0 166 +#define CLK_SMMUJPEG 167 +#define CLK_SMMUM2M2SCALER 168 +#define CLK_SMMUGSCALER1 169 +#define CLK_SMMUGSCALER0 170 +#define CLK_JPEG 171 +#define CLK_M2MSCALER 172 +#define CLK_GSCALER1 173 +#define CLK_GSCALER0 174 +#define CLK_QEMFC 175 +#define CLK_PPMUMFC_L 176 +#define CLK_SMMUMFC_L 177 +#define CLK_MFC 178 +#define CLK_SMMUG3D 179 +#define CLK_QEG3D 180 +#define CLK_PPMUG3D 181 +#define CLK_G3D 182 +#define CLK_QE_CH1_LCD 183 +#define CLK_QE_CH0_LCD 184 +#define CLK_PPMULCD0 185 +#define CLK_SMMUFIMD0 186 +#define CLK_DSIM0 187 +#define CLK_FIMD0 188 +#define CLK_CAM1 189 +#define CLK_UART_ISP_TOP 190 +#define CLK_SPI1_ISP_TOP 191 +#define CLK_SPI0_ISP_TOP 192 +#define CLK_TSADC 193 +#define CLK_PPMUFILE 194 +#define CLK_USBOTG 195 +#define CLK_USBHOST 196 +#define CLK_SROMC 197 +#define CLK_SDMMC1 198 +#define CLK_SDMMC0 199 +#define CLK_PDMA1 200 +#define CLK_PDMA0 201 +#define CLK_PWM 202 +#define CLK_PCM 203 +#define CLK_I2S 204 +#define CLK_SPI1 205 +#define CLK_SPI0 206 +#define CLK_I2C7 207 +#define CLK_I2C6 208 +#define CLK_I2C5 209 +#define CLK_I2C4 210 +#define CLK_I2C3 211 +#define CLK_I2C2 212 +#define CLK_I2C1 213 +#define CLK_I2C0 214 +#define CLK_UART1 215 +#define CLK_UART0 216 +#define CLK_BLOCK_LCD 217 +#define CLK_BLOCK_G3D 218 +#define CLK_BLOCK_MFC 219 +#define CLK_BLOCK_CAM 220 +#define CLK_SMIES 221 + +/* Special clocks */ +#define CLK_SCLK_JPEG 224 +#define CLK_SCLK_M2MSCALER 225 +#define CLK_SCLK_GSCALER1 226 +#define CLK_SCLK_GSCALER0 227 +#define CLK_SCLK_MFC 228 +#define CLK_SCLK_G3D 229 +#define CLK_SCLK_MIPIDPHY2L 230 +#define CLK_SCLK_MIPI0 231 +#define CLK_SCLK_FIMD0 232 +#define CLK_SCLK_CAM1 233 +#define CLK_SCLK_UART_ISP 234 +#define CLK_SCLK_SPI1_ISP 235 +#define CLK_SCLK_SPI0_ISP 236 +#define CLK_SCLK_UPLL 237 +#define CLK_SCLK_TSADC 238 +#define CLK_SCLK_EBI 239 +#define CLK_SCLK_MMC1 240 +#define CLK_SCLK_MMC0 241 +#define CLK_SCLK_I2S 242 +#define CLK_SCLK_PCM 243 +#define CLK_SCLK_SPI1 244 +#define CLK_SCLK_SPI0 245 +#define CLK_SCLK_UART1 246 +#define CLK_SCLK_UART0 247 + +/* + * Total number of clocks of main CMU. + * NOTE: Must be equal to last clock ID increased by one. + */ +#define CLK_NR_CLKS 248 + +#endif /* _DT_BINDINGS_CLOCK_SAMSUNG_EXYNOS3250_CLOCK_H */ Modified: stable/10/sys/gnu/dts/include/dt-bindings/clock/exynos4.h ============================================================================== --- head/sys/gnu/dts/include/dt-bindings/clock/exynos4.h Fri Feb 28 16:51:33 2014 (r262610) +++ stable/10/sys/gnu/dts/include/dt-bindings/clock/exynos4.h Sun Oct 26 23:37:24 2014 (r273712) @@ -1,6 +1,6 @@ /* * Copyright (c) 2013 Samsung Electronics Co., Ltd. - * Author: Andrzej Haja + * Author: Andrzej Hajda * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -33,6 +33,12 @@ #define CLK_MOUT_MPLL_USER_C 18 /* Exynos4x12 only */ #define CLK_MOUT_CORE 19 #define CLK_MOUT_APLL 20 +#define CLK_SCLK_HDMIPHY 22 +#define CLK_OUT_DMC 23 +#define CLK_OUT_TOP 24 +#define CLK_OUT_LEFTBUS 25 +#define CLK_OUT_RIGHTBUS 26 +#define CLK_OUT_CPU 27 /* gate for special clocks (sclk) */ #define CLK_SCLK_FIMC0 128 @@ -181,7 +187,6 @@ #define CLK_KEYIF 347 #define CLK_AUDSS 348 #define CLK_MIPI_HSI 349 /* Exynos4210 only */ -#define CLK_MDMA2 350 /* Exynos4210 only */ #define CLK_PIXELASYNCM0 351 #define CLK_PIXELASYNCM1 352 #define CLK_FIMC_LITE0 353 /* Exynos4x12 only */ @@ -230,6 +235,24 @@ #define CLK_MOUT_G3D 394 #define CLK_ACLK400_MCUISP 395 /* Exynos4x12 only */ +/* gate clocks - ppmu */ +#define CLK_PPMULEFT 400 +#define CLK_PPMURIGHT 401 +#define CLK_PPMUCAMIF 402 +#define CLK_PPMUTV 403 +#define CLK_PPMUMFC_L 404 +#define CLK_PPMUMFC_R 405 +#define CLK_PPMUG3D 406 +#define CLK_PPMUIMAGE 407 +#define CLK_PPMULCD0 408 +#define CLK_PPMULCD1 409 /* Exynos4210 only */ +#define CLK_PPMUFILE 410 +#define CLK_PPMUGPS 411 +#define CLK_PPMUDMC0 412 +#define CLK_PPMUDMC1 413 +#define CLK_PPMUCPU 414 +#define CLK_PPMUACP 415 + /* div clocks */ #define CLK_DIV_ISP0 450 /* Exynos4x12 only */ #define CLK_DIV_ISP1 451 /* Exynos4x12 only */ Modified: stable/10/sys/gnu/dts/include/dt-bindings/clock/exynos5250.h ============================================================================== --- head/sys/gnu/dts/include/dt-bindings/clock/exynos5250.h Fri Feb 28 16:51:33 2014 (r262610) +++ stable/10/sys/gnu/dts/include/dt-bindings/clock/exynos5250.h Sun Oct 26 23:37:24 2014 (r273712) @@ -1,6 +1,6 @@ /* * Copyright (c) 2013 Samsung Electronics Co., Ltd. - * Author: Andrzej Haja + * Author: Andrzej Hajda * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -150,11 +150,30 @@ #define CLK_G2D 345 #define CLK_MDMA0 346 #define CLK_SMMU_MDMA0 347 +#define CLK_SSS 348 +#define CLK_G3D 349 +#define CLK_SMMU_TV 350 +#define CLK_SMMU_FIMD1 351 +#define CLK_SMMU_2D 352 +#define CLK_SMMU_FIMC_ISP 353 +#define CLK_SMMU_FIMC_DRC 354 +#define CLK_SMMU_FIMC_SCC 355 +#define CLK_SMMU_FIMC_SCP 356 +#define CLK_SMMU_FIMC_FD 357 +#define CLK_SMMU_FIMC_MCU 358 +#define CLK_SMMU_FIMC_ODC 359 +#define CLK_SMMU_FIMC_DIS0 360 +#define CLK_SMMU_FIMC_DIS1 361 +#define CLK_SMMU_FIMC_3DNR 362 +#define CLK_SMMU_FIMC_LITE0 363 +#define CLK_SMMU_FIMC_LITE1 364 +#define CLK_CAMIF_TOP 365 /* mux clocks */ #define CLK_MOUT_HDMI 1024 +#define CLK_MOUT_GPLL 1025 /* must be greater than maximal clock id */ -#define CLK_NR_CLKS 1025 +#define CLK_NR_CLKS 1026 #endif /* _DT_BINDINGS_CLOCK_EXYNOS_5250_H */ Copied: stable/10/sys/gnu/dts/include/dt-bindings/clock/exynos5260-clk.h (from r271133, head/sys/gnu/dts/include/dt-bindings/clock/exynos5260-clk.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/gnu/dts/include/dt-bindings/clock/exynos5260-clk.h Sun Oct 26 23:37:24 2014 (r273712, copy of r271133, head/sys/gnu/dts/include/dt-bindings/clock/exynos5260-clk.h) @@ -0,0 +1,469 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Author: Rahul Sharma + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Provides Constants for Exynos5260 clocks. +*/ + +#ifndef _DT_BINDINGS_CLK_EXYNOS5260_H +#define _DT_BINDINGS_CLK_EXYNOS5260_H + +/* Clock names: */ + +/* List Of Clocks For CMU_TOP */ + +#define TOP_FOUT_DISP_PLL 1 +#define TOP_FOUT_AUD_PLL 2 +#define TOP_MOUT_AUDTOP_PLL_USER 3 +#define TOP_MOUT_AUD_PLL 4 +#define TOP_MOUT_DISP_PLL 5 +#define TOP_MOUT_BUSTOP_PLL_USER 6 +#define TOP_MOUT_MEMTOP_PLL_USER 7 +#define TOP_MOUT_MEDIATOP_PLL_USER 8 +#define TOP_MOUT_DISP_DISP_333 9 +#define TOP_MOUT_ACLK_DISP_333 10 +#define TOP_MOUT_DISP_DISP_222 11 +#define TOP_MOUT_ACLK_DISP_222 12 +#define TOP_MOUT_DISP_MEDIA_PIXEL 13 +#define TOP_MOUT_FIMD1 14 +#define TOP_MOUT_SCLK_PERI_SPI0_CLK 15 +#define TOP_MOUT_SCLK_PERI_SPI1_CLK 16 +#define TOP_MOUT_SCLK_PERI_SPI2_CLK 17 +#define TOP_MOUT_SCLK_PERI_UART0_UCLK 18 +#define TOP_MOUT_SCLK_PERI_UART2_UCLK 19 +#define TOP_MOUT_SCLK_PERI_UART1_UCLK 20 +#define TOP_MOUT_BUS4_BUSTOP_100 21 +#define TOP_MOUT_BUS4_BUSTOP_400 22 +#define TOP_MOUT_BUS3_BUSTOP_100 23 +#define TOP_MOUT_BUS3_BUSTOP_400 24 +#define TOP_MOUT_BUS2_BUSTOP_400 25 +#define TOP_MOUT_BUS2_BUSTOP_100 26 +#define TOP_MOUT_BUS1_BUSTOP_100 27 +#define TOP_MOUT_BUS1_BUSTOP_400 28 +#define TOP_MOUT_SCLK_FSYS_USB 29 +#define TOP_MOUT_SCLK_FSYS_MMC0_SDCLKIN_A 30 +#define TOP_MOUT_SCLK_FSYS_MMC1_SDCLKIN_A 31 +#define TOP_MOUT_SCLK_FSYS_MMC2_SDCLKIN_A 32 +#define TOP_MOUT_SCLK_FSYS_MMC0_SDCLKIN_B 33 +#define TOP_MOUT_SCLK_FSYS_MMC1_SDCLKIN_B 34 +#define TOP_MOUT_SCLK_FSYS_MMC2_SDCLKIN_B 35 +#define TOP_MOUT_ACLK_ISP1_266 36 +#define TOP_MOUT_ISP1_MEDIA_266 37 +#define TOP_MOUT_ACLK_ISP1_400 38 +#define TOP_MOUT_ISP1_MEDIA_400 39 +#define TOP_MOUT_SCLK_ISP1_SPI0 40 +#define TOP_MOUT_SCLK_ISP1_SPI1 41 +#define TOP_MOUT_SCLK_ISP1_UART 42 +#define TOP_MOUT_SCLK_ISP1_SENSOR2 43 +#define TOP_MOUT_SCLK_ISP1_SENSOR1 44 +#define TOP_MOUT_SCLK_ISP1_SENSOR0 45 +#define TOP_MOUT_ACLK_MFC_333 46 +#define TOP_MOUT_MFC_BUSTOP_333 47 +#define TOP_MOUT_ACLK_G2D_333 48 +#define TOP_MOUT_G2D_BUSTOP_333 49 +#define TOP_MOUT_ACLK_GSCL_FIMC 50 +#define TOP_MOUT_GSCL_BUSTOP_FIMC 51 +#define TOP_MOUT_ACLK_GSCL_333 52 +#define TOP_MOUT_GSCL_BUSTOP_333 53 +#define TOP_MOUT_ACLK_GSCL_400 54 +#define TOP_MOUT_M2M_MEDIATOP_400 55 +#define TOP_DOUT_ACLK_MFC_333 56 +#define TOP_DOUT_ACLK_G2D_333 57 +#define TOP_DOUT_SCLK_ISP1_SENSOR2_A 58 +#define TOP_DOUT_SCLK_ISP1_SENSOR1_A 59 +#define TOP_DOUT_SCLK_ISP1_SENSOR0_A 60 +#define TOP_DOUT_ACLK_GSCL_FIMC 61 +#define TOP_DOUT_ACLK_GSCL_400 62 +#define TOP_DOUT_ACLK_GSCL_333 63 +#define TOP_DOUT_SCLK_ISP1_SPI0_B 64 +#define TOP_DOUT_SCLK_ISP1_SPI0_A 65 +#define TOP_DOUT_ACLK_ISP1_400 66 +#define TOP_DOUT_ACLK_ISP1_266 67 +#define TOP_DOUT_SCLK_ISP1_UART 68 +#define TOP_DOUT_SCLK_ISP1_SPI1_B 69 +#define TOP_DOUT_SCLK_ISP1_SPI1_A 70 +#define TOP_DOUT_SCLK_ISP1_SENSOR2_B 71 +#define TOP_DOUT_SCLK_ISP1_SENSOR1_B 72 +#define TOP_DOUT_SCLK_ISP1_SENSOR0_B 73 +#define TOP_DOUTTOP__SCLK_HPM_TARGETCLK 74 +#define TOP_DOUT_SCLK_DISP_PIXEL 75 +#define TOP_DOUT_ACLK_DISP_222 76 +#define TOP_DOUT_ACLK_DISP_333 77 +#define TOP_DOUT_ACLK_BUS4_100 78 +#define TOP_DOUT_ACLK_BUS4_400 79 +#define TOP_DOUT_ACLK_BUS3_100 80 +#define TOP_DOUT_ACLK_BUS3_400 81 +#define TOP_DOUT_ACLK_BUS2_100 82 +#define TOP_DOUT_ACLK_BUS2_400 83 +#define TOP_DOUT_ACLK_BUS1_100 84 +#define TOP_DOUT_ACLK_BUS1_400 85 +#define TOP_DOUT_SCLK_PERI_SPI1_B 86 +#define TOP_DOUT_SCLK_PERI_SPI1_A 87 +#define TOP_DOUT_SCLK_PERI_SPI0_B 88 +#define TOP_DOUT_SCLK_PERI_SPI0_A 89 +#define TOP_DOUT_SCLK_PERI_UART0 90 +#define TOP_DOUT_SCLK_PERI_UART2 91 +#define TOP_DOUT_SCLK_PERI_UART1 92 +#define TOP_DOUT_SCLK_PERI_SPI2_B 93 +#define TOP_DOUT_SCLK_PERI_SPI2_A 94 +#define TOP_DOUT_ACLK_PERI_AUD 95 +#define TOP_DOUT_ACLK_PERI_66 96 +#define TOP_DOUT_SCLK_FSYS_MMC0_SDCLKIN_B 97 +#define TOP_DOUT_SCLK_FSYS_MMC0_SDCLKIN_A 98 +#define TOP_DOUT_SCLK_FSYS_USBDRD30_SUSPEND_CLK 99 +#define TOP_DOUT_ACLK_FSYS_200 100 +#define TOP_DOUT_SCLK_FSYS_MMC2_SDCLKIN_B 101 +#define TOP_DOUT_SCLK_FSYS_MMC2_SDCLKIN_A 102 +#define TOP_DOUT_SCLK_FSYS_MMC1_SDCLKIN_B 103 +#define TOP_DOUT_SCLK_FSYS_MMC1_SDCLKIN_A 104 +#define TOP_SCLK_FIMD1 105 +#define TOP_SCLK_MMC2 106 +#define TOP_SCLK_MMC1 107 +#define TOP_SCLK_MMC0 108 +#define PHYCLK_DPTX_PHY_CH3_TXD_CLK 109 +#define PHYCLK_DPTX_PHY_CH2_TXD_CLK 110 +#define PHYCLK_DPTX_PHY_CH1_TXD_CLK 111 +#define PHYCLK_DPTX_PHY_CH0_TXD_CLK 112 +#define phyclk_hdmi_phy_tmds_clko 113 +#define PHYCLK_HDMI_PHY_PIXEL_CLKO 114 +#define PHYCLK_HDMI_LINK_O_TMDS_CLKHI 115 +#define PHYCLK_MIPI_DPHY_4L_M_TXBYTECLKHS 116 +#define PHYCLK_DPTX_PHY_O_REF_CLK_24M 117 +#define PHYCLK_DPTX_PHY_CLK_DIV2 118 +#define PHYCLK_MIPI_DPHY_4L_M_RXCLKESC0 119 +#define PHYCLK_USBHOST20_PHY_PHYCLOCK 120 +#define PHYCLK_USBHOST20_PHY_FREECLK 121 +#define PHYCLK_USBHOST20_PHY_CLK48MOHCI 122 +#define PHYCLK_USBDRD30_UDRD30_PIPE_PCLK 123 +#define PHYCLK_USBDRD30_UDRD30_PHYCLOCK 124 +#define TOP_NR_CLK 125 + + +/* List Of Clocks For CMU_EGL */ + +#define EGL_FOUT_EGL_PLL 1 +#define EGL_FOUT_EGL_DPLL 2 +#define EGL_MOUT_EGL_B 3 +#define EGL_MOUT_EGL_PLL 4 +#define EGL_DOUT_EGL_PLL 5 +#define EGL_DOUT_EGL_PCLK_DBG 6 +#define EGL_DOUT_EGL_ATCLK 7 +#define EGL_DOUT_PCLK_EGL 8 +#define EGL_DOUT_ACLK_EGL 9 +#define EGL_DOUT_EGL2 10 +#define EGL_DOUT_EGL1 11 +#define EGL_NR_CLK 12 + + +/* List Of Clocks For CMU_KFC */ + +#define KFC_FOUT_KFC_PLL 1 +#define KFC_MOUT_KFC_PLL 2 +#define KFC_MOUT_KFC 3 +#define KFC_DOUT_KFC_PLL 4 +#define KFC_DOUT_PCLK_KFC 5 +#define KFC_DOUT_ACLK_KFC 6 +#define KFC_DOUT_KFC_PCLK_DBG 7 +#define KFC_DOUT_KFC_ATCLK 8 +#define KFC_DOUT_KFC2 9 +#define KFC_DOUT_KFC1 10 +#define KFC_NR_CLK 11 + + +/* List Of Clocks For CMU_MIF */ + +#define MIF_FOUT_MEM_PLL 1 +#define MIF_FOUT_MEDIA_PLL 2 +#define MIF_FOUT_BUS_PLL 3 +#define MIF_MOUT_CLK2X_PHY 4 +#define MIF_MOUT_MIF_DREX2X 5 +#define MIF_MOUT_CLKM_PHY 6 +#define MIF_MOUT_MIF_DREX 7 +#define MIF_MOUT_MEDIA_PLL 8 +#define MIF_MOUT_BUS_PLL 9 +#define MIF_MOUT_MEM_PLL 10 +#define MIF_DOUT_ACLK_BUS_100 11 +#define MIF_DOUT_ACLK_BUS_200 12 +#define MIF_DOUT_ACLK_MIF_466 13 +#define MIF_DOUT_CLK2X_PHY 14 +#define MIF_DOUT_CLKM_PHY 15 +#define MIF_DOUT_BUS_PLL 16 +#define MIF_DOUT_MEM_PLL 17 +#define MIF_DOUT_MEDIA_PLL 18 +#define MIF_CLK_LPDDR3PHY_WRAP1 19 +#define MIF_CLK_LPDDR3PHY_WRAP0 20 +#define MIF_CLK_MONOCNT 21 +#define MIF_CLK_MIF_RTC 22 +#define MIF_CLK_DREX1 23 +#define MIF_CLK_DREX0 24 +#define MIF_CLK_INTMEM 25 +#define MIF_SCLK_LPDDR3PHY_WRAP_U1 26 +#define MIF_SCLK_LPDDR3PHY_WRAP_U0 27 +#define MIF_NR_CLK 28 + + +/* List Of Clocks For CMU_G3D */ + +#define G3D_FOUT_G3D_PLL 1 +#define G3D_MOUT_G3D_PLL 2 +#define G3D_DOUT_PCLK_G3D 3 +#define G3D_DOUT_ACLK_G3D 4 +#define G3D_CLK_G3D_HPM 5 +#define G3D_CLK_G3D 6 +#define G3D_NR_CLK 7 + + +/* List Of Clocks For CMU_AUD */ + +#define AUD_MOUT_SCLK_AUD_PCM 1 +#define AUD_MOUT_SCLK_AUD_I2S 2 +#define AUD_MOUT_AUD_PLL_USER 3 +#define AUD_DOUT_ACLK_AUD_131 4 +#define AUD_DOUT_SCLK_AUD_UART 5 +#define AUD_DOUT_SCLK_AUD_PCM 6 +#define AUD_DOUT_SCLK_AUD_I2S 7 +#define AUD_CLK_AUD_UART 8 +#define AUD_CLK_PCM 9 +#define AUD_CLK_I2S 10 +#define AUD_CLK_DMAC 11 +#define AUD_CLK_SRAMC 12 +#define AUD_SCLK_AUD_UART 13 +#define AUD_SCLK_PCM 14 +#define AUD_SCLK_I2S 15 +#define AUD_NR_CLK 16 + + +/* List Of Clocks For CMU_MFC */ + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 23:39:16 2014 Return-Path: Delivered-To: svn-src-all@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 2999ADEC; Sun, 26 Oct 2014 23:39: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 154176E5; Sun, 26 Oct 2014 23:39: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 s9QNdFVj094659; Sun, 26 Oct 2014 23:39:15 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QNdF31094658; Sun, 26 Oct 2014 23:39:15 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410262339.s9QNdF31094658@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 23:39:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273713 - stable/10/sys/gnu/dts/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 23:39:16 -0000 Author: ian Date: Sun Oct 26 23:39:15 2014 New Revision: 273713 URL: https://svnweb.freebsd.org/changeset/base/273713 Log: MFC 271140: Delete old arm dts tree. This was created by cherry picking from a full vendor tree. This worked great until it was time to update, but now it is time to update. Hit the rest button by removing this branch and re-adding it by a full copy of whatever is in the vendor tree. Deleted: stable/10/sys/gnu/dts/arm/ Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Oct 26 23:45:35 2014 Return-Path: Delivered-To: svn-src-all@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 E8F57B9; Sun, 26 Oct 2014 23:45: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 D3A997F2; Sun, 26 Oct 2014 23:45: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 s9QNjYgp098875; Sun, 26 Oct 2014 23:45:34 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9QNjYH1098872; Sun, 26 Oct 2014 23:45:34 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410262345.s9QNjYH1098872@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 23:45:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273714 - stable/10/sys/gnu/dts/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 23:45:35 -0000 Author: ian Date: Sun Oct 26 23:45:33 2014 New Revision: 273714 URL: https://svnweb.freebsd.org/changeset/base/273714 Log: MFC r271143, r271151: Reimport dts from vendor branch after proper trim. Added: stable/10/sys/gnu/dts/arm/ - copied from r271143, head/sys/gnu/dts/arm/ stable/10/sys/gnu/dts/arm/imx51-pinfunc.h - copied unchanged from r271151, head/sys/gnu/dts/arm/imx51-pinfunc.h stable/10/sys/gnu/dts/arm/imx53-pinfunc.h - copied unchanged from r271151, head/sys/gnu/dts/arm/imx53-pinfunc.h stable/10/sys/gnu/dts/arm/imx6dl-pinfunc.h - copied unchanged from r271151, head/sys/gnu/dts/arm/imx6dl-pinfunc.h stable/10/sys/gnu/dts/arm/imx6q-pinfunc.h - copied unchanged from r271151, head/sys/gnu/dts/arm/imx6q-pinfunc.h stable/10/sys/gnu/dts/arm/imx6sl-pinfunc.h - copied unchanged from r271151, head/sys/gnu/dts/arm/imx6sl-pinfunc.h Modified: Directory Properties: stable/10/ (props changed) Copied: stable/10/sys/gnu/dts/arm/imx51-pinfunc.h (from r271151, head/sys/gnu/dts/arm/imx51-pinfunc.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/gnu/dts/arm/imx51-pinfunc.h Sun Oct 26 23:45:33 2014 (r273714, copy of r271151, head/sys/gnu/dts/arm/imx51-pinfunc.h) @@ -0,0 +1,773 @@ +/* + * Copyright 2013 Freescale Semiconductor, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#ifndef __DTS_IMX51_PINFUNC_H +#define __DTS_IMX51_PINFUNC_H + +/* + * The pin function ID is a tuple of + * + */ +#define MX51_PAD_EIM_D16__AUD4_RXFS 0x05c 0x3f0 0x000 0x5 0x0 +#define MX51_PAD_EIM_D16__AUD5_TXD 0x05c 0x3f0 0x8d8 0x7 0x0 +#define MX51_PAD_EIM_D16__EIM_D16 0x05c 0x3f0 0x000 0x0 0x0 +#define MX51_PAD_EIM_D16__GPIO2_0 0x05c 0x3f0 0x000 0x1 0x0 +#define MX51_PAD_EIM_D16__I2C1_SDA 0x05c 0x3f0 0x9b4 0x4 0x0 +#define MX51_PAD_EIM_D16__UART2_CTS 0x05c 0x3f0 0x000 0x3 0x0 +#define MX51_PAD_EIM_D16__USBH2_DATA0 0x05c 0x3f0 0x000 0x2 0x0 +#define MX51_PAD_EIM_D17__AUD5_RXD 0x060 0x3f4 0x8d4 0x7 0x0 +#define MX51_PAD_EIM_D17__EIM_D17 0x060 0x3f4 0x000 0x0 0x0 +#define MX51_PAD_EIM_D17__GPIO2_1 0x060 0x3f4 0x000 0x1 0x0 +#define MX51_PAD_EIM_D17__UART2_RXD 0x060 0x3f4 0x9ec 0x3 0x0 +#define MX51_PAD_EIM_D17__UART3_CTS 0x060 0x3f4 0x000 0x4 0x0 +#define MX51_PAD_EIM_D17__USBH2_DATA1 0x060 0x3f4 0x000 0x2 0x0 +#define MX51_PAD_EIM_D18__AUD5_TXC 0x064 0x3f8 0x8e4 0x7 0x0 +#define MX51_PAD_EIM_D18__EIM_D18 0x064 0x3f8 0x000 0x0 0x0 +#define MX51_PAD_EIM_D18__GPIO2_2 0x064 0x3f8 0x000 0x1 0x0 +#define MX51_PAD_EIM_D18__UART2_TXD 0x064 0x3f8 0x000 0x3 0x0 +#define MX51_PAD_EIM_D18__UART3_RTS 0x064 0x3f8 0x9f0 0x4 0x1 +#define MX51_PAD_EIM_D18__USBH2_DATA2 0x064 0x3f8 0x000 0x2 0x0 +#define MX51_PAD_EIM_D19__AUD4_RXC 0x068 0x3fc 0x000 0x5 0x0 +#define MX51_PAD_EIM_D19__AUD5_TXFS 0x068 0x3fc 0x8e8 0x7 0x0 +#define MX51_PAD_EIM_D19__EIM_D19 0x068 0x3fc 0x000 0x0 0x0 +#define MX51_PAD_EIM_D19__GPIO2_3 0x068 0x3fc 0x000 0x1 0x0 +#define MX51_PAD_EIM_D19__I2C1_SCL 0x068 0x3fc 0x9b0 0x4 0x0 +#define MX51_PAD_EIM_D19__UART2_RTS 0x068 0x3fc 0x9e8 0x3 0x1 +#define MX51_PAD_EIM_D19__USBH2_DATA3 0x068 0x3fc 0x000 0x2 0x0 +#define MX51_PAD_EIM_D20__AUD4_TXD 0x06c 0x400 0x8c8 0x5 0x0 +#define MX51_PAD_EIM_D20__EIM_D20 0x06c 0x400 0x000 0x0 0x0 +#define MX51_PAD_EIM_D20__GPIO2_4 0x06c 0x400 0x000 0x1 0x0 +#define MX51_PAD_EIM_D20__SRTC_ALARM_DEB 0x06c 0x400 0x000 0x4 0x0 +#define MX51_PAD_EIM_D20__USBH2_DATA4 0x06c 0x400 0x000 0x2 0x0 +#define MX51_PAD_EIM_D21__AUD4_RXD 0x070 0x404 0x8c4 0x5 0x0 +#define MX51_PAD_EIM_D21__EIM_D21 0x070 0x404 0x000 0x0 0x0 +#define MX51_PAD_EIM_D21__GPIO2_5 0x070 0x404 0x000 0x1 0x0 +#define MX51_PAD_EIM_D21__SRTC_ALARM_DEB 0x070 0x404 0x000 0x3 0x0 +#define MX51_PAD_EIM_D21__USBH2_DATA5 0x070 0x404 0x000 0x2 0x0 +#define MX51_PAD_EIM_D22__AUD4_TXC 0x074 0x408 0x8cc 0x5 0x0 +#define MX51_PAD_EIM_D22__EIM_D22 0x074 0x408 0x000 0x0 0x0 +#define MX51_PAD_EIM_D22__GPIO2_6 0x074 0x408 0x000 0x1 0x0 +#define MX51_PAD_EIM_D22__USBH2_DATA6 0x074 0x408 0x000 0x2 0x0 +#define MX51_PAD_EIM_D23__AUD4_TXFS 0x078 0x40c 0x8d0 0x5 0x0 +#define MX51_PAD_EIM_D23__EIM_D23 0x078 0x40c 0x000 0x0 0x0 +#define MX51_PAD_EIM_D23__GPIO2_7 0x078 0x40c 0x000 0x1 0x0 +#define MX51_PAD_EIM_D23__SPDIF_OUT1 0x078 0x40c 0x000 0x4 0x0 +#define MX51_PAD_EIM_D23__USBH2_DATA7 0x078 0x40c 0x000 0x2 0x0 +#define MX51_PAD_EIM_D24__AUD6_RXFS 0x07c 0x410 0x8f8 0x5 0x0 +#define MX51_PAD_EIM_D24__EIM_D24 0x07c 0x410 0x000 0x0 0x0 +#define MX51_PAD_EIM_D24__GPIO2_8 0x07c 0x410 0x000 0x1 0x0 +#define MX51_PAD_EIM_D24__I2C2_SDA 0x07c 0x410 0x9bc 0x4 0x0 +#define MX51_PAD_EIM_D24__UART3_CTS 0x07c 0x410 0x000 0x3 0x0 +#define MX51_PAD_EIM_D24__USBOTG_DATA0 0x07c 0x410 0x000 0x2 0x0 +#define MX51_PAD_EIM_D25__EIM_D25 0x080 0x414 0x000 0x0 0x0 +#define MX51_PAD_EIM_D25__KEY_COL6 0x080 0x414 0x9c8 0x1 0x0 +#define MX51_PAD_EIM_D25__UART2_CTS 0x080 0x414 0x000 0x4 0x0 +#define MX51_PAD_EIM_D25__UART3_RXD 0x080 0x414 0x9f4 0x3 0x0 +#define MX51_PAD_EIM_D25__USBOTG_DATA1 0x080 0x414 0x000 0x2 0x0 +#define MX51_PAD_EIM_D26__EIM_D26 0x084 0x418 0x000 0x0 0x0 +#define MX51_PAD_EIM_D26__KEY_COL7 0x084 0x418 0x9cc 0x1 0x0 +#define MX51_PAD_EIM_D26__UART2_RTS 0x084 0x418 0x9e8 0x4 0x3 +#define MX51_PAD_EIM_D26__UART3_TXD 0x084 0x418 0x000 0x3 0x0 +#define MX51_PAD_EIM_D26__USBOTG_DATA2 0x084 0x418 0x000 0x2 0x0 +#define MX51_PAD_EIM_D27__AUD6_RXC 0x088 0x41c 0x8f4 0x5 0x0 +#define MX51_PAD_EIM_D27__EIM_D27 0x088 0x41c 0x000 0x0 0x0 +#define MX51_PAD_EIM_D27__GPIO2_9 0x088 0x41c 0x000 0x1 0x0 +#define MX51_PAD_EIM_D27__I2C2_SCL 0x088 0x41c 0x9b8 0x4 0x0 +#define MX51_PAD_EIM_D27__UART3_RTS 0x088 0x41c 0x9f0 0x3 0x3 +#define MX51_PAD_EIM_D27__USBOTG_DATA3 0x088 0x41c 0x000 0x2 0x0 +#define MX51_PAD_EIM_D28__AUD6_TXD 0x08c 0x420 0x8f0 0x5 0x0 +#define MX51_PAD_EIM_D28__EIM_D28 0x08c 0x420 0x000 0x0 0x0 +#define MX51_PAD_EIM_D28__KEY_ROW4 0x08c 0x420 0x9d0 0x1 0x0 +#define MX51_PAD_EIM_D28__USBOTG_DATA4 0x08c 0x420 0x000 0x2 0x0 +#define MX51_PAD_EIM_D29__AUD6_RXD 0x090 0x424 0x8ec 0x5 0x0 +#define MX51_PAD_EIM_D29__EIM_D29 0x090 0x424 0x000 0x0 0x0 +#define MX51_PAD_EIM_D29__KEY_ROW5 0x090 0x424 0x9d4 0x1 0x0 +#define MX51_PAD_EIM_D29__USBOTG_DATA5 0x090 0x424 0x000 0x2 0x0 +#define MX51_PAD_EIM_D30__AUD6_TXC 0x094 0x428 0x8fc 0x5 0x0 +#define MX51_PAD_EIM_D30__EIM_D30 0x094 0x428 0x000 0x0 0x0 +#define MX51_PAD_EIM_D30__KEY_ROW6 0x094 0x428 0x9d8 0x1 0x0 +#define MX51_PAD_EIM_D30__USBOTG_DATA6 0x094 0x428 0x000 0x2 0x0 +#define MX51_PAD_EIM_D31__AUD6_TXFS 0x098 0x42c 0x900 0x5 0x0 +#define MX51_PAD_EIM_D31__EIM_D31 0x098 0x42c 0x000 0x0 0x0 +#define MX51_PAD_EIM_D31__KEY_ROW7 0x098 0x42c 0x9dc 0x1 0x0 +#define MX51_PAD_EIM_D31__USBOTG_DATA7 0x098 0x42c 0x000 0x2 0x0 +#define MX51_PAD_EIM_A16__EIM_A16 0x09c 0x430 0x000 0x0 0x0 +#define MX51_PAD_EIM_A16__GPIO2_10 0x09c 0x430 0x000 0x1 0x0 +#define MX51_PAD_EIM_A16__OSC_FREQ_SEL0 0x09c 0x430 0x000 0x7 0x0 +#define MX51_PAD_EIM_A17__EIM_A17 0x0a0 0x434 0x000 0x0 0x0 +#define MX51_PAD_EIM_A17__GPIO2_11 0x0a0 0x434 0x000 0x1 0x0 +#define MX51_PAD_EIM_A17__OSC_FREQ_SEL1 0x0a0 0x434 0x000 0x7 0x0 +#define MX51_PAD_EIM_A18__BOOT_LPB0 0x0a4 0x438 0x000 0x7 0x0 +#define MX51_PAD_EIM_A18__EIM_A18 0x0a4 0x438 0x000 0x0 0x0 +#define MX51_PAD_EIM_A18__GPIO2_12 0x0a4 0x438 0x000 0x1 0x0 +#define MX51_PAD_EIM_A19__BOOT_LPB1 0x0a8 0x43c 0x000 0x7 0x0 +#define MX51_PAD_EIM_A19__EIM_A19 0x0a8 0x43c 0x000 0x0 0x0 +#define MX51_PAD_EIM_A19__GPIO2_13 0x0a8 0x43c 0x000 0x1 0x0 +#define MX51_PAD_EIM_A20__BOOT_UART_SRC0 0x0ac 0x440 0x000 0x7 0x0 +#define MX51_PAD_EIM_A20__EIM_A20 0x0ac 0x440 0x000 0x0 0x0 +#define MX51_PAD_EIM_A20__GPIO2_14 0x0ac 0x440 0x000 0x1 0x0 +#define MX51_PAD_EIM_A21__BOOT_UART_SRC1 0x0b0 0x444 0x000 0x7 0x0 +#define MX51_PAD_EIM_A21__EIM_A21 0x0b0 0x444 0x000 0x0 0x0 +#define MX51_PAD_EIM_A21__GPIO2_15 0x0b0 0x444 0x000 0x1 0x0 +#define MX51_PAD_EIM_A22__EIM_A22 0x0b4 0x448 0x000 0x0 0x0 +#define MX51_PAD_EIM_A22__GPIO2_16 0x0b4 0x448 0x000 0x1 0x0 +#define MX51_PAD_EIM_A23__BOOT_HPN_EN 0x0b8 0x44c 0x000 0x7 0x0 +#define MX51_PAD_EIM_A23__EIM_A23 0x0b8 0x44c 0x000 0x0 0x0 +#define MX51_PAD_EIM_A23__GPIO2_17 0x0b8 0x44c 0x000 0x1 0x0 +#define MX51_PAD_EIM_A24__EIM_A24 0x0bc 0x450 0x000 0x0 0x0 +#define MX51_PAD_EIM_A24__GPIO2_18 0x0bc 0x450 0x000 0x1 0x0 +#define MX51_PAD_EIM_A24__USBH2_CLK 0x0bc 0x450 0x000 0x2 0x0 +#define MX51_PAD_EIM_A25__DISP1_PIN4 0x0c0 0x454 0x000 0x6 0x0 +#define MX51_PAD_EIM_A25__EIM_A25 0x0c0 0x454 0x000 0x0 0x0 +#define MX51_PAD_EIM_A25__GPIO2_19 0x0c0 0x454 0x000 0x1 0x0 +#define MX51_PAD_EIM_A25__USBH2_DIR 0x0c0 0x454 0x000 0x2 0x0 +#define MX51_PAD_EIM_A26__CSI1_DATA_EN 0x0c4 0x458 0x9a0 0x5 0x0 +#define MX51_PAD_EIM_A26__DISP2_EXT_CLK 0x0c4 0x458 0x908 0x6 0x0 +#define MX51_PAD_EIM_A26__EIM_A26 0x0c4 0x458 0x000 0x0 0x0 +#define MX51_PAD_EIM_A26__GPIO2_20 0x0c4 0x458 0x000 0x1 0x0 +#define MX51_PAD_EIM_A26__USBH2_STP 0x0c4 0x458 0x000 0x2 0x0 +#define MX51_PAD_EIM_A27__CSI2_DATA_EN 0x0c8 0x45c 0x99c 0x5 0x0 +#define MX51_PAD_EIM_A27__DISP1_PIN1 0x0c8 0x45c 0x9a4 0x6 0x0 +#define MX51_PAD_EIM_A27__EIM_A27 0x0c8 0x45c 0x000 0x0 0x0 +#define MX51_PAD_EIM_A27__GPIO2_21 0x0c8 0x45c 0x000 0x1 0x0 +#define MX51_PAD_EIM_A27__USBH2_NXT 0x0c8 0x45c 0x000 0x2 0x0 +#define MX51_PAD_EIM_EB0__EIM_EB0 0x0cc 0x460 0x000 0x0 0x0 +#define MX51_PAD_EIM_EB1__EIM_EB1 0x0d0 0x464 0x000 0x0 0x0 +#define MX51_PAD_EIM_EB2__AUD5_RXFS 0x0d4 0x468 0x8e0 0x6 0x0 +#define MX51_PAD_EIM_EB2__CSI1_D2 0x0d4 0x468 0x000 0x5 0x0 +#define MX51_PAD_EIM_EB2__EIM_EB2 0x0d4 0x468 0x000 0x0 0x0 +#define MX51_PAD_EIM_EB2__FEC_MDIO 0x0d4 0x468 0x954 0x3 0x0 +#define MX51_PAD_EIM_EB2__GPIO2_22 0x0d4 0x468 0x000 0x1 0x0 +#define MX51_PAD_EIM_EB2__GPT_CMPOUT1 0x0d4 0x468 0x000 0x7 0x0 +#define MX51_PAD_EIM_EB3__AUD5_RXC 0x0d8 0x46c 0x8dc 0x6 0x0 +#define MX51_PAD_EIM_EB3__CSI1_D3 0x0d8 0x46c 0x000 0x5 0x0 +#define MX51_PAD_EIM_EB3__EIM_EB3 0x0d8 0x46c 0x000 0x0 0x0 +#define MX51_PAD_EIM_EB3__FEC_RDATA1 0x0d8 0x46c 0x95c 0x3 0x0 +#define MX51_PAD_EIM_EB3__GPIO2_23 0x0d8 0x46c 0x000 0x1 0x0 +#define MX51_PAD_EIM_EB3__GPT_CMPOUT2 0x0d8 0x46c 0x000 0x7 0x0 +#define MX51_PAD_EIM_OE__EIM_OE 0x0dc 0x470 0x000 0x0 0x0 +#define MX51_PAD_EIM_OE__GPIO2_24 0x0dc 0x470 0x000 0x1 0x0 +#define MX51_PAD_EIM_CS0__EIM_CS0 0x0e0 0x474 0x000 0x0 0x0 +#define MX51_PAD_EIM_CS0__GPIO2_25 0x0e0 0x474 0x000 0x1 0x0 +#define MX51_PAD_EIM_CS1__EIM_CS1 0x0e4 0x478 0x000 0x0 0x0 +#define MX51_PAD_EIM_CS1__GPIO2_26 0x0e4 0x478 0x000 0x1 0x0 +#define MX51_PAD_EIM_CS2__AUD5_TXD 0x0e8 0x47c 0x8d8 0x6 0x1 +#define MX51_PAD_EIM_CS2__CSI1_D4 0x0e8 0x47c 0x000 0x5 0x0 +#define MX51_PAD_EIM_CS2__EIM_CS2 0x0e8 0x47c 0x000 0x0 0x0 +#define MX51_PAD_EIM_CS2__FEC_RDATA2 0x0e8 0x47c 0x960 0x3 0x0 +#define MX51_PAD_EIM_CS2__GPIO2_27 0x0e8 0x47c 0x000 0x1 0x0 +#define MX51_PAD_EIM_CS2__USBOTG_STP 0x0e8 0x47c 0x000 0x2 0x0 +#define MX51_PAD_EIM_CS3__AUD5_RXD 0x0ec 0x480 0x8d4 0x6 0x1 +#define MX51_PAD_EIM_CS3__CSI1_D5 0x0ec 0x480 0x000 0x5 0x0 +#define MX51_PAD_EIM_CS3__EIM_CS3 0x0ec 0x480 0x000 0x0 0x0 +#define MX51_PAD_EIM_CS3__FEC_RDATA3 0x0ec 0x480 0x964 0x3 0x0 +#define MX51_PAD_EIM_CS3__GPIO2_28 0x0ec 0x480 0x000 0x1 0x0 +#define MX51_PAD_EIM_CS3__USBOTG_NXT 0x0ec 0x480 0x000 0x2 0x0 +#define MX51_PAD_EIM_CS4__AUD5_TXC 0x0f0 0x484 0x8e4 0x6 0x1 +#define MX51_PAD_EIM_CS4__CSI1_D6 0x0f0 0x484 0x000 0x5 0x0 +#define MX51_PAD_EIM_CS4__EIM_CS4 0x0f0 0x484 0x000 0x0 0x0 +#define MX51_PAD_EIM_CS4__FEC_RX_ER 0x0f0 0x484 0x970 0x3 0x0 +#define MX51_PAD_EIM_CS4__GPIO2_29 0x0f0 0x484 0x000 0x1 0x0 +#define MX51_PAD_EIM_CS4__USBOTG_CLK 0x0f0 0x484 0x000 0x2 0x0 +#define MX51_PAD_EIM_CS5__AUD5_TXFS 0x0f4 0x488 0x8e8 0x6 0x1 +#define MX51_PAD_EIM_CS5__CSI1_D7 0x0f4 0x488 0x000 0x5 0x0 +#define MX51_PAD_EIM_CS5__DISP1_EXT_CLK 0x0f4 0x488 0x904 0x4 0x0 +#define MX51_PAD_EIM_CS5__EIM_CS5 0x0f4 0x488 0x000 0x0 0x0 +#define MX51_PAD_EIM_CS5__FEC_CRS 0x0f4 0x488 0x950 0x3 0x0 +#define MX51_PAD_EIM_CS5__GPIO2_30 0x0f4 0x488 0x000 0x1 0x0 +#define MX51_PAD_EIM_CS5__USBOTG_DIR 0x0f4 0x488 0x000 0x2 0x0 +#define MX51_PAD_EIM_DTACK__EIM_DTACK 0x0f8 0x48c 0x000 0x0 0x0 +#define MX51_PAD_EIM_DTACK__GPIO2_31 0x0f8 0x48c 0x000 0x1 0x0 +#define MX51_PAD_EIM_LBA__EIM_LBA 0x0fc 0x494 0x000 0x0 0x0 +#define MX51_PAD_EIM_LBA__GPIO3_1 0x0fc 0x494 0x978 0x1 0x0 +#define MX51_PAD_EIM_CRE__EIM_CRE 0x100 0x4a0 0x000 0x0 0x0 +#define MX51_PAD_EIM_CRE__GPIO3_2 0x100 0x4a0 0x97c 0x1 0x0 +#define MX51_PAD_DRAM_CS1__DRAM_CS1 0x104 0x4d0 0x000 0x0 0x0 +#define MX51_PAD_NANDF_WE_B__GPIO3_3 0x108 0x4e4 0x980 0x3 0x0 +#define MX51_PAD_NANDF_WE_B__NANDF_WE_B 0x108 0x4e4 0x000 0x0 0x0 +#define MX51_PAD_NANDF_WE_B__PATA_DIOW 0x108 0x4e4 0x000 0x1 0x0 +#define MX51_PAD_NANDF_WE_B__SD3_DATA0 0x108 0x4e4 0x93c 0x2 0x0 +#define MX51_PAD_NANDF_RE_B__GPIO3_4 0x10c 0x4e8 0x984 0x3 0x0 +#define MX51_PAD_NANDF_RE_B__NANDF_RE_B 0x10c 0x4e8 0x000 0x0 0x0 +#define MX51_PAD_NANDF_RE_B__PATA_DIOR 0x10c 0x4e8 0x000 0x1 0x0 +#define MX51_PAD_NANDF_RE_B__SD3_DATA1 0x10c 0x4e8 0x940 0x2 0x0 +#define MX51_PAD_NANDF_ALE__GPIO3_5 0x110 0x4ec 0x988 0x3 0x0 +#define MX51_PAD_NANDF_ALE__NANDF_ALE 0x110 0x4ec 0x000 0x0 0x0 +#define MX51_PAD_NANDF_ALE__PATA_BUFFER_EN 0x110 0x4ec 0x000 0x1 0x0 +#define MX51_PAD_NANDF_CLE__GPIO3_6 0x114 0x4f0 0x98c 0x3 0x0 +#define MX51_PAD_NANDF_CLE__NANDF_CLE 0x114 0x4f0 0x000 0x0 0x0 +#define MX51_PAD_NANDF_CLE__PATA_RESET_B 0x114 0x4f0 0x000 0x1 0x0 +#define MX51_PAD_NANDF_WP_B__GPIO3_7 0x118 0x4f4 0x990 0x3 0x0 +#define MX51_PAD_NANDF_WP_B__NANDF_WP_B 0x118 0x4f4 0x000 0x0 0x0 +#define MX51_PAD_NANDF_WP_B__PATA_DMACK 0x118 0x4f4 0x000 0x1 0x0 +#define MX51_PAD_NANDF_WP_B__SD3_DATA2 0x118 0x4f4 0x944 0x2 0x0 +#define MX51_PAD_NANDF_RB0__ECSPI2_SS1 0x11c 0x4f8 0x930 0x5 0x0 +#define MX51_PAD_NANDF_RB0__GPIO3_8 0x11c 0x4f8 0x994 0x3 0x0 +#define MX51_PAD_NANDF_RB0__NANDF_RB0 0x11c 0x4f8 0x000 0x0 0x0 +#define MX51_PAD_NANDF_RB0__PATA_DMARQ 0x11c 0x4f8 0x000 0x1 0x0 +#define MX51_PAD_NANDF_RB0__SD3_DATA3 0x11c 0x4f8 0x948 0x2 0x0 +#define MX51_PAD_NANDF_RB1__CSPI_MOSI 0x120 0x4fc 0x91c 0x6 0x0 +#define MX51_PAD_NANDF_RB1__ECSPI2_RDY 0x120 0x4fc 0x000 0x2 0x0 +#define MX51_PAD_NANDF_RB1__GPIO3_9 0x120 0x4fc 0x000 0x3 0x0 +#define MX51_PAD_NANDF_RB1__NANDF_RB1 0x120 0x4fc 0x000 0x0 0x0 +#define MX51_PAD_NANDF_RB1__PATA_IORDY 0x120 0x4fc 0x000 0x1 0x0 +#define MX51_PAD_NANDF_RB1__SD4_CMD 0x120 0x4fc 0x000 0x5 0x0 +#define MX51_PAD_NANDF_RB2__DISP2_WAIT 0x124 0x500 0x9a8 0x5 0x0 +#define MX51_PAD_NANDF_RB2__ECSPI2_SCLK 0x124 0x500 0x000 0x2 0x0 +#define MX51_PAD_NANDF_RB2__FEC_COL 0x124 0x500 0x94c 0x1 0x0 +#define MX51_PAD_NANDF_RB2__GPIO3_10 0x124 0x500 0x000 0x3 0x0 +#define MX51_PAD_NANDF_RB2__NANDF_RB2 0x124 0x500 0x000 0x0 0x0 +#define MX51_PAD_NANDF_RB2__USBH3_H3_DP 0x124 0x500 0x000 0x7 0x0 +#define MX51_PAD_NANDF_RB2__USBH3_NXT 0x124 0x500 0xa20 0x6 0x0 +#define MX51_PAD_NANDF_RB3__DISP1_WAIT 0x128 0x504 0x000 0x5 0x0 +#define MX51_PAD_NANDF_RB3__ECSPI2_MISO 0x128 0x504 0x000 0x2 0x0 +#define MX51_PAD_NANDF_RB3__FEC_RX_CLK 0x128 0x504 0x968 0x1 0x0 +#define MX51_PAD_NANDF_RB3__GPIO3_11 0x128 0x504 0x000 0x3 0x0 +#define MX51_PAD_NANDF_RB3__NANDF_RB3 0x128 0x504 0x000 0x0 0x0 +#define MX51_PAD_NANDF_RB3__USBH3_CLK 0x128 0x504 0x9f8 0x6 0x0 +#define MX51_PAD_NANDF_RB3__USBH3_H3_DM 0x128 0x504 0x000 0x7 0x0 +#define MX51_PAD_GPIO_NAND__GPIO_NAND 0x12c 0x514 0x998 0x0 0x0 +#define MX51_PAD_GPIO_NAND__PATA_INTRQ 0x12c 0x514 0x000 0x1 0x0 +#define MX51_PAD_NANDF_CS0__GPIO3_16 0x130 0x518 0x000 0x3 0x0 +#define MX51_PAD_NANDF_CS0__NANDF_CS0 0x130 0x518 0x000 0x0 0x0 +#define MX51_PAD_NANDF_CS1__GPIO3_17 0x134 0x51c 0x000 0x3 0x0 +#define MX51_PAD_NANDF_CS1__NANDF_CS1 0x134 0x51c 0x000 0x0 0x0 +#define MX51_PAD_NANDF_CS2__CSPI_SCLK 0x138 0x520 0x914 0x6 0x0 +#define MX51_PAD_NANDF_CS2__FEC_TX_ER 0x138 0x520 0x000 0x2 0x0 +#define MX51_PAD_NANDF_CS2__GPIO3_18 0x138 0x520 0x000 0x3 0x0 +#define MX51_PAD_NANDF_CS2__NANDF_CS2 0x138 0x520 0x000 0x0 0x0 +#define MX51_PAD_NANDF_CS2__PATA_CS_0 0x138 0x520 0x000 0x1 0x0 +#define MX51_PAD_NANDF_CS2__SD4_CLK 0x138 0x520 0x000 0x5 0x0 +#define MX51_PAD_NANDF_CS2__USBH3_H1_DP 0x138 0x520 0x000 0x7 0x0 +#define MX51_PAD_NANDF_CS3__FEC_MDC 0x13c 0x524 0x000 0x2 0x0 +#define MX51_PAD_NANDF_CS3__GPIO3_19 0x13c 0x524 0x000 0x3 0x0 +#define MX51_PAD_NANDF_CS3__NANDF_CS3 0x13c 0x524 0x000 0x0 0x0 +#define MX51_PAD_NANDF_CS3__PATA_CS_1 0x13c 0x524 0x000 0x1 0x0 +#define MX51_PAD_NANDF_CS3__SD4_DAT0 0x13c 0x524 0x000 0x5 0x0 +#define MX51_PAD_NANDF_CS3__USBH3_H1_DM 0x13c 0x524 0x000 0x7 0x0 +#define MX51_PAD_NANDF_CS4__FEC_TDATA1 0x140 0x528 0x000 0x2 0x0 +#define MX51_PAD_NANDF_CS4__GPIO3_20 0x140 0x528 0x000 0x3 0x0 +#define MX51_PAD_NANDF_CS4__NANDF_CS4 0x140 0x528 0x000 0x0 0x0 +#define MX51_PAD_NANDF_CS4__PATA_DA_0 0x140 0x528 0x000 0x1 0x0 +#define MX51_PAD_NANDF_CS4__SD4_DAT1 0x140 0x528 0x000 0x5 0x0 +#define MX51_PAD_NANDF_CS4__USBH3_STP 0x140 0x528 0xa24 0x7 0x0 +#define MX51_PAD_NANDF_CS5__FEC_TDATA2 0x144 0x52c 0x000 0x2 0x0 +#define MX51_PAD_NANDF_CS5__GPIO3_21 0x144 0x52c 0x000 0x3 0x0 +#define MX51_PAD_NANDF_CS5__NANDF_CS5 0x144 0x52c 0x000 0x0 0x0 +#define MX51_PAD_NANDF_CS5__PATA_DA_1 0x144 0x52c 0x000 0x1 0x0 +#define MX51_PAD_NANDF_CS5__SD4_DAT2 0x144 0x52c 0x000 0x5 0x0 +#define MX51_PAD_NANDF_CS5__USBH3_DIR 0x144 0x52c 0xa1c 0x7 0x0 +#define MX51_PAD_NANDF_CS6__CSPI_SS3 0x148 0x530 0x928 0x7 0x0 +#define MX51_PAD_NANDF_CS6__FEC_TDATA3 0x148 0x530 0x000 0x2 0x0 +#define MX51_PAD_NANDF_CS6__GPIO3_22 0x148 0x530 0x000 0x3 0x0 +#define MX51_PAD_NANDF_CS6__NANDF_CS6 0x148 0x530 0x000 0x0 0x0 +#define MX51_PAD_NANDF_CS6__PATA_DA_2 0x148 0x530 0x000 0x1 0x0 +#define MX51_PAD_NANDF_CS6__SD4_DAT3 0x148 0x530 0x000 0x5 0x0 +#define MX51_PAD_NANDF_CS7__FEC_TX_EN 0x14c 0x534 0x000 0x1 0x0 +#define MX51_PAD_NANDF_CS7__GPIO3_23 0x14c 0x534 0x000 0x3 0x0 +#define MX51_PAD_NANDF_CS7__NANDF_CS7 0x14c 0x534 0x000 0x0 0x0 +#define MX51_PAD_NANDF_CS7__SD3_CLK 0x14c 0x534 0x000 0x5 0x0 +#define MX51_PAD_NANDF_RDY_INT__ECSPI2_SS0 0x150 0x538 0x000 0x2 0x0 +#define MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK 0x150 0x538 0x974 0x1 0x0 +#define MX51_PAD_NANDF_RDY_INT__GPIO3_24 0x150 0x538 0x000 0x3 0x0 +#define MX51_PAD_NANDF_RDY_INT__NANDF_RDY_INT 0x150 0x538 0x938 0x0 0x0 +#define MX51_PAD_NANDF_RDY_INT__SD3_CMD 0x150 0x538 0x000 0x5 0x0 +#define MX51_PAD_NANDF_D15__ECSPI2_MOSI 0x154 0x53c 0x000 0x2 0x0 +#define MX51_PAD_NANDF_D15__GPIO3_25 0x154 0x53c 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D15__NANDF_D15 0x154 0x53c 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D15__PATA_DATA15 0x154 0x53c 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D15__SD3_DAT7 0x154 0x53c 0x000 0x5 0x0 +#define MX51_PAD_NANDF_D14__ECSPI2_SS3 0x158 0x540 0x934 0x2 0x0 +#define MX51_PAD_NANDF_D14__GPIO3_26 0x158 0x540 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D14__NANDF_D14 0x158 0x540 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D14__PATA_DATA14 0x158 0x540 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D14__SD3_DAT6 0x158 0x540 0x000 0x5 0x0 +#define MX51_PAD_NANDF_D13__ECSPI2_SS2 0x15c 0x544 0x000 0x2 0x0 +#define MX51_PAD_NANDF_D13__GPIO3_27 0x15c 0x544 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D13__NANDF_D13 0x15c 0x544 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D13__PATA_DATA13 0x15c 0x544 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D13__SD3_DAT5 0x15c 0x544 0x000 0x5 0x0 +#define MX51_PAD_NANDF_D12__ECSPI2_SS1 0x160 0x548 0x930 0x2 0x1 +#define MX51_PAD_NANDF_D12__GPIO3_28 0x160 0x548 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D12__NANDF_D12 0x160 0x548 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D12__PATA_DATA12 0x160 0x548 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D12__SD3_DAT4 0x160 0x548 0x000 0x5 0x0 +#define MX51_PAD_NANDF_D11__FEC_RX_DV 0x164 0x54c 0x96c 0x2 0x0 +#define MX51_PAD_NANDF_D11__GPIO3_29 0x164 0x54c 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D11__NANDF_D11 0x164 0x54c 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D11__PATA_DATA11 0x164 0x54c 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D11__SD3_DATA3 0x164 0x54c 0x948 0x5 0x1 +#define MX51_PAD_NANDF_D10__GPIO3_30 0x168 0x550 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D10__NANDF_D10 0x168 0x550 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D10__PATA_DATA10 0x168 0x550 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D10__SD3_DATA2 0x168 0x550 0x944 0x5 0x1 +#define MX51_PAD_NANDF_D9__FEC_RDATA0 0x16c 0x554 0x958 0x2 0x0 +#define MX51_PAD_NANDF_D9__GPIO3_31 0x16c 0x554 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D9__NANDF_D9 0x16c 0x554 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D9__PATA_DATA9 0x16c 0x554 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D9__SD3_DATA1 0x16c 0x554 0x940 0x5 0x1 +#define MX51_PAD_NANDF_D8__FEC_TDATA0 0x170 0x558 0x000 0x2 0x0 +#define MX51_PAD_NANDF_D8__GPIO4_0 0x170 0x558 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D8__NANDF_D8 0x170 0x558 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D8__PATA_DATA8 0x170 0x558 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D8__SD3_DATA0 0x170 0x558 0x93c 0x5 0x1 +#define MX51_PAD_NANDF_D7__GPIO4_1 0x174 0x55c 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D7__NANDF_D7 0x174 0x55c 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D7__PATA_DATA7 0x174 0x55c 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D7__USBH3_DATA0 0x174 0x55c 0x9fc 0x5 0x0 +#define MX51_PAD_NANDF_D6__GPIO4_2 0x178 0x560 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D6__NANDF_D6 0x178 0x560 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D6__PATA_DATA6 0x178 0x560 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D6__SD4_LCTL 0x178 0x560 0x000 0x2 0x0 +#define MX51_PAD_NANDF_D6__USBH3_DATA1 0x178 0x560 0xa00 0x5 0x0 +#define MX51_PAD_NANDF_D5__GPIO4_3 0x17c 0x564 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D5__NANDF_D5 0x17c 0x564 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D5__PATA_DATA5 0x17c 0x564 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D5__SD4_WP 0x17c 0x564 0x000 0x2 0x0 +#define MX51_PAD_NANDF_D5__USBH3_DATA2 0x17c 0x564 0xa04 0x5 0x0 +#define MX51_PAD_NANDF_D4__GPIO4_4 0x180 0x568 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D4__NANDF_D4 0x180 0x568 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D4__PATA_DATA4 0x180 0x568 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D4__SD4_CD 0x180 0x568 0x000 0x2 0x0 +#define MX51_PAD_NANDF_D4__USBH3_DATA3 0x180 0x568 0xa08 0x5 0x0 +#define MX51_PAD_NANDF_D3__GPIO4_5 0x184 0x56c 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D3__NANDF_D3 0x184 0x56c 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D3__PATA_DATA3 0x184 0x56c 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D3__SD4_DAT4 0x184 0x56c 0x000 0x2 0x0 +#define MX51_PAD_NANDF_D3__USBH3_DATA4 0x184 0x56c 0xa0c 0x5 0x0 +#define MX51_PAD_NANDF_D2__GPIO4_6 0x188 0x570 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D2__NANDF_D2 0x188 0x570 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D2__PATA_DATA2 0x188 0x570 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D2__SD4_DAT5 0x188 0x570 0x000 0x2 0x0 +#define MX51_PAD_NANDF_D2__USBH3_DATA5 0x188 0x570 0xa10 0x5 0x0 +#define MX51_PAD_NANDF_D1__GPIO4_7 0x18c 0x574 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D1__NANDF_D1 0x18c 0x574 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D1__PATA_DATA1 0x18c 0x574 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D1__SD4_DAT6 0x18c 0x574 0x000 0x2 0x0 +#define MX51_PAD_NANDF_D1__USBH3_DATA6 0x18c 0x574 0xa14 0x5 0x0 +#define MX51_PAD_NANDF_D0__GPIO4_8 0x190 0x578 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D0__NANDF_D0 0x190 0x578 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D0__PATA_DATA0 0x190 0x578 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D0__SD4_DAT7 0x190 0x578 0x000 0x2 0x0 +#define MX51_PAD_NANDF_D0__USBH3_DATA7 0x190 0x578 0xa18 0x5 0x0 +#define MX51_PAD_CSI1_D8__CSI1_D8 0x194 0x57c 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D8__GPIO3_12 0x194 0x57c 0x998 0x3 0x1 +#define MX51_PAD_CSI1_D9__CSI1_D9 0x198 0x580 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D9__GPIO3_13 0x198 0x580 0x000 0x3 0x0 +#define MX51_PAD_CSI1_D10__CSI1_D10 0x19c 0x584 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D11__CSI1_D11 0x1a0 0x588 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D12__CSI1_D12 0x1a4 0x58c 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D13__CSI1_D13 0x1a8 0x590 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D14__CSI1_D14 0x1ac 0x594 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D15__CSI1_D15 0x1b0 0x598 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D16__CSI1_D16 0x1b4 0x59c 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D17__CSI1_D17 0x1b8 0x5a0 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D18__CSI1_D18 0x1bc 0x5a4 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D19__CSI1_D19 0x1c0 0x5a8 0x000 0x0 0x0 +#define MX51_PAD_CSI1_VSYNC__CSI1_VSYNC 0x1c4 0x5ac 0x000 0x0 0x0 +#define MX51_PAD_CSI1_VSYNC__GPIO3_14 0x1c4 0x5ac 0x000 0x3 0x0 +#define MX51_PAD_CSI1_HSYNC__CSI1_HSYNC 0x1c8 0x5b0 0x000 0x0 0x0 +#define MX51_PAD_CSI1_HSYNC__GPIO3_15 0x1c8 0x5b0 0x000 0x3 0x0 +#define MX51_PAD_CSI1_PIXCLK__CSI1_PIXCLK 0x000 0x5b4 0x000 0x0 0x0 +#define MX51_PAD_CSI1_MCLK__CSI1_MCLK 0x000 0x5b8 0x000 0x0 0x0 +#define MX51_PAD_CSI2_D12__CSI2_D12 0x1cc 0x5bc 0x000 0x0 0x0 +#define MX51_PAD_CSI2_D12__GPIO4_9 0x1cc 0x5bc 0x000 0x3 0x0 +#define MX51_PAD_CSI2_D13__CSI2_D13 0x1d0 0x5c0 0x000 0x0 0x0 +#define MX51_PAD_CSI2_D13__GPIO4_10 0x1d0 0x5c0 0x000 0x3 0x0 +#define MX51_PAD_CSI2_D14__CSI2_D14 0x1d4 0x5c4 0x000 0x0 0x0 +#define MX51_PAD_CSI2_D15__CSI2_D15 0x1d8 0x5c8 0x000 0x0 0x0 +#define MX51_PAD_CSI2_D16__CSI2_D16 0x1dc 0x5cc 0x000 0x0 0x0 +#define MX51_PAD_CSI2_D17__CSI2_D17 0x1e0 0x5d0 0x000 0x0 0x0 +#define MX51_PAD_CSI2_D18__CSI2_D18 0x1e4 0x5d4 0x000 0x0 0x0 +#define MX51_PAD_CSI2_D18__GPIO4_11 0x1e4 0x5d4 0x000 0x3 0x0 +#define MX51_PAD_CSI2_D19__CSI2_D19 0x1e8 0x5d8 0x000 0x0 0x0 +#define MX51_PAD_CSI2_D19__GPIO4_12 0x1e8 0x5d8 0x000 0x3 0x0 +#define MX51_PAD_CSI2_VSYNC__CSI2_VSYNC 0x1ec 0x5dc 0x000 0x0 0x0 +#define MX51_PAD_CSI2_VSYNC__GPIO4_13 0x1ec 0x5dc 0x000 0x3 0x0 +#define MX51_PAD_CSI2_HSYNC__CSI2_HSYNC 0x1f0 0x5e0 0x000 0x0 0x0 +#define MX51_PAD_CSI2_HSYNC__GPIO4_14 0x1f0 0x5e0 0x000 0x3 0x0 +#define MX51_PAD_CSI2_PIXCLK__CSI2_PIXCLK 0x1f4 0x5e4 0x000 0x0 0x0 +#define MX51_PAD_CSI2_PIXCLK__GPIO4_15 0x1f4 0x5e4 0x000 0x3 0x0 +#define MX51_PAD_I2C1_CLK__GPIO4_16 0x1f8 0x5e8 0x000 0x3 0x0 +#define MX51_PAD_I2C1_CLK__I2C1_CLK 0x1f8 0x5e8 0x000 0x0 0x0 +#define MX51_PAD_I2C1_DAT__GPIO4_17 0x1fc 0x5ec 0x000 0x3 0x0 +#define MX51_PAD_I2C1_DAT__I2C1_DAT 0x1fc 0x5ec 0x000 0x0 0x0 +#define MX51_PAD_AUD3_BB_TXD__AUD3_TXD 0x200 0x5f0 0x000 0x0 0x0 +#define MX51_PAD_AUD3_BB_TXD__GPIO4_18 0x200 0x5f0 0x000 0x3 0x0 +#define MX51_PAD_AUD3_BB_RXD__AUD3_RXD 0x204 0x5f4 0x000 0x0 0x0 +#define MX51_PAD_AUD3_BB_RXD__GPIO4_19 0x204 0x5f4 0x000 0x3 0x0 +#define MX51_PAD_AUD3_BB_RXD__UART3_RXD 0x204 0x5f4 0x9f4 0x1 0x2 +#define MX51_PAD_AUD3_BB_CK__AUD3_TXC 0x208 0x5f8 0x000 0x0 0x0 +#define MX51_PAD_AUD3_BB_CK__GPIO4_20 0x208 0x5f8 0x000 0x3 0x0 +#define MX51_PAD_AUD3_BB_FS__AUD3_TXFS 0x20c 0x5fc 0x000 0x0 0x0 +#define MX51_PAD_AUD3_BB_FS__GPIO4_21 0x20c 0x5fc 0x000 0x3 0x0 +#define MX51_PAD_AUD3_BB_FS__UART3_TXD 0x20c 0x5fc 0x000 0x1 0x0 +#define MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI 0x210 0x600 0x000 0x0 0x0 +#define MX51_PAD_CSPI1_MOSI__GPIO4_22 0x210 0x600 0x000 0x3 0x0 +#define MX51_PAD_CSPI1_MOSI__I2C1_SDA 0x210 0x600 0x9b4 0x1 0x1 +#define MX51_PAD_CSPI1_MISO__AUD4_RXD 0x214 0x604 0x8c4 0x1 0x1 +#define MX51_PAD_CSPI1_MISO__ECSPI1_MISO 0x214 0x604 0x000 0x0 0x0 +#define MX51_PAD_CSPI1_MISO__GPIO4_23 0x214 0x604 0x000 0x3 0x0 +#define MX51_PAD_CSPI1_SS0__AUD4_TXC 0x218 0x608 0x8cc 0x1 0x1 +#define MX51_PAD_CSPI1_SS0__ECSPI1_SS0 0x218 0x608 0x000 0x0 0x0 +#define MX51_PAD_CSPI1_SS0__GPIO4_24 0x218 0x608 0x000 0x3 0x0 +#define MX51_PAD_CSPI1_SS1__AUD4_TXD 0x21c 0x60c 0x8c8 0x1 0x1 +#define MX51_PAD_CSPI1_SS1__ECSPI1_SS1 0x21c 0x60c 0x000 0x0 0x0 +#define MX51_PAD_CSPI1_SS1__GPIO4_25 0x21c 0x60c 0x000 0x3 0x0 +#define MX51_PAD_CSPI1_RDY__AUD4_TXFS 0x220 0x610 0x8d0 0x1 0x1 +#define MX51_PAD_CSPI1_RDY__ECSPI1_RDY 0x220 0x610 0x000 0x0 0x0 +#define MX51_PAD_CSPI1_RDY__GPIO4_26 0x220 0x610 0x000 0x3 0x0 +#define MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK 0x224 0x614 0x000 0x0 0x0 +#define MX51_PAD_CSPI1_SCLK__GPIO4_27 0x224 0x614 0x000 0x3 0x0 +#define MX51_PAD_CSPI1_SCLK__I2C1_SCL 0x224 0x614 0x9b0 0x1 0x1 +#define MX51_PAD_UART1_RXD__GPIO4_28 0x228 0x618 0x000 0x3 0x0 +#define MX51_PAD_UART1_RXD__UART1_RXD 0x228 0x618 0x9e4 0x0 0x0 +#define MX51_PAD_UART1_TXD__GPIO4_29 0x22c 0x61c 0x000 0x3 0x0 +#define MX51_PAD_UART1_TXD__PWM2_PWMO 0x22c 0x61c 0x000 0x1 0x0 +#define MX51_PAD_UART1_TXD__UART1_TXD 0x22c 0x61c 0x000 0x0 0x0 +#define MX51_PAD_UART1_RTS__GPIO4_30 0x230 0x620 0x000 0x3 0x0 +#define MX51_PAD_UART1_RTS__UART1_RTS 0x230 0x620 0x9e0 0x0 0x0 +#define MX51_PAD_UART1_CTS__GPIO4_31 0x234 0x624 0x000 0x3 0x0 +#define MX51_PAD_UART1_CTS__UART1_CTS 0x234 0x624 0x000 0x0 0x0 +#define MX51_PAD_UART2_RXD__FIRI_TXD 0x238 0x628 0x000 0x1 0x0 +#define MX51_PAD_UART2_RXD__GPIO1_20 0x238 0x628 0x000 0x3 0x0 +#define MX51_PAD_UART2_RXD__UART2_RXD 0x238 0x628 0x9ec 0x0 0x2 +#define MX51_PAD_UART2_TXD__FIRI_RXD 0x23c 0x62c 0x000 0x1 0x0 +#define MX51_PAD_UART2_TXD__GPIO1_21 0x23c 0x62c 0x000 0x3 0x0 +#define MX51_PAD_UART2_TXD__UART2_TXD 0x23c 0x62c 0x000 0x0 0x0 +#define MX51_PAD_UART3_RXD__CSI1_D0 0x240 0x630 0x000 0x2 0x0 +#define MX51_PAD_UART3_RXD__GPIO1_22 0x240 0x630 0x000 0x3 0x0 +#define MX51_PAD_UART3_RXD__UART1_DTR 0x240 0x630 0x000 0x0 0x0 +#define MX51_PAD_UART3_RXD__UART3_RXD 0x240 0x630 0x9f4 0x1 0x4 +#define MX51_PAD_UART3_TXD__CSI1_D1 0x244 0x634 0x000 0x2 0x0 +#define MX51_PAD_UART3_TXD__GPIO1_23 0x244 0x634 0x000 0x3 0x0 +#define MX51_PAD_UART3_TXD__UART1_DSR 0x244 0x634 0x000 0x0 0x0 +#define MX51_PAD_UART3_TXD__UART3_TXD 0x244 0x634 0x000 0x1 0x0 +#define MX51_PAD_OWIRE_LINE__GPIO1_24 0x248 0x638 0x000 0x3 0x0 +#define MX51_PAD_OWIRE_LINE__OWIRE_LINE 0x248 0x638 0x000 0x0 0x0 +#define MX51_PAD_OWIRE_LINE__SPDIF_OUT 0x248 0x638 0x000 0x6 0x0 +#define MX51_PAD_KEY_ROW0__KEY_ROW0 0x24c 0x63c 0x000 0x0 0x0 +#define MX51_PAD_KEY_ROW1__KEY_ROW1 0x250 0x640 0x000 0x0 0x0 +#define MX51_PAD_KEY_ROW2__KEY_ROW2 0x254 0x644 0x000 0x0 0x0 +#define MX51_PAD_KEY_ROW3__KEY_ROW3 0x258 0x648 0x000 0x0 0x0 +#define MX51_PAD_KEY_COL0__KEY_COL0 0x25c 0x64c 0x000 0x0 0x0 +#define MX51_PAD_KEY_COL0__PLL1_BYP 0x25c 0x64c 0x90c 0x7 0x0 +#define MX51_PAD_KEY_COL1__KEY_COL1 0x260 0x650 0x000 0x0 0x0 +#define MX51_PAD_KEY_COL1__PLL2_BYP 0x260 0x650 0x910 0x7 0x0 +#define MX51_PAD_KEY_COL2__KEY_COL2 0x264 0x654 0x000 0x0 0x0 +#define MX51_PAD_KEY_COL2__PLL3_BYP 0x264 0x654 0x000 0x7 0x0 +#define MX51_PAD_KEY_COL3__KEY_COL3 0x268 0x658 0x000 0x0 0x0 +#define MX51_PAD_KEY_COL4__I2C2_SCL 0x26c 0x65c 0x9b8 0x3 0x1 +#define MX51_PAD_KEY_COL4__KEY_COL4 0x26c 0x65c 0x000 0x0 0x0 +#define MX51_PAD_KEY_COL4__SPDIF_OUT1 0x26c 0x65c 0x000 0x6 0x0 +#define MX51_PAD_KEY_COL4__UART1_RI 0x26c 0x65c 0x000 0x1 0x0 +#define MX51_PAD_KEY_COL4__UART3_RTS 0x26c 0x65c 0x9f0 0x2 0x4 +#define MX51_PAD_KEY_COL5__I2C2_SDA 0x270 0x660 0x9bc 0x3 0x1 +#define MX51_PAD_KEY_COL5__KEY_COL5 0x270 0x660 0x000 0x0 0x0 +#define MX51_PAD_KEY_COL5__UART1_DCD 0x270 0x660 0x000 0x1 0x0 +#define MX51_PAD_KEY_COL5__UART3_CTS 0x270 0x660 0x000 0x2 0x0 +#define MX51_PAD_USBH1_CLK__CSPI_SCLK 0x278 0x678 0x914 0x1 0x1 +#define MX51_PAD_USBH1_CLK__GPIO1_25 0x278 0x678 0x000 0x2 0x0 +#define MX51_PAD_USBH1_CLK__I2C2_SCL 0x278 0x678 0x9b8 0x5 0x2 +#define MX51_PAD_USBH1_CLK__USBH1_CLK 0x278 0x678 0x000 0x0 0x0 +#define MX51_PAD_USBH1_DIR__CSPI_MOSI 0x27c 0x67c 0x91c 0x1 0x1 +#define MX51_PAD_USBH1_DIR__GPIO1_26 0x27c 0x67c 0x000 0x2 0x0 +#define MX51_PAD_USBH1_DIR__I2C2_SDA 0x27c 0x67c 0x9bc 0x5 0x2 +#define MX51_PAD_USBH1_DIR__USBH1_DIR 0x27c 0x67c 0x000 0x0 0x0 +#define MX51_PAD_USBH1_STP__CSPI_RDY 0x280 0x680 0x000 0x1 0x0 +#define MX51_PAD_USBH1_STP__GPIO1_27 0x280 0x680 0x000 0x2 0x0 +#define MX51_PAD_USBH1_STP__UART3_RXD 0x280 0x680 0x9f4 0x5 0x6 +#define MX51_PAD_USBH1_STP__USBH1_STP 0x280 0x680 0x000 0x0 0x0 +#define MX51_PAD_USBH1_NXT__CSPI_MISO 0x284 0x684 0x918 0x1 0x0 +#define MX51_PAD_USBH1_NXT__GPIO1_28 0x284 0x684 0x000 0x2 0x0 +#define MX51_PAD_USBH1_NXT__UART3_TXD 0x284 0x684 0x000 0x5 0x0 +#define MX51_PAD_USBH1_NXT__USBH1_NXT 0x284 0x684 0x000 0x0 0x0 +#define MX51_PAD_USBH1_DATA0__GPIO1_11 0x288 0x688 0x000 0x2 0x0 +#define MX51_PAD_USBH1_DATA0__UART2_CTS 0x288 0x688 0x000 0x1 0x0 +#define MX51_PAD_USBH1_DATA0__USBH1_DATA0 0x288 0x688 0x000 0x0 0x0 +#define MX51_PAD_USBH1_DATA1__GPIO1_12 0x28c 0x68c 0x000 0x2 0x0 +#define MX51_PAD_USBH1_DATA1__UART2_RXD 0x28c 0x68c 0x9ec 0x1 0x4 +#define MX51_PAD_USBH1_DATA1__USBH1_DATA1 0x28c 0x68c 0x000 0x0 0x0 +#define MX51_PAD_USBH1_DATA2__GPIO1_13 0x290 0x690 0x000 0x2 0x0 +#define MX51_PAD_USBH1_DATA2__UART2_TXD 0x290 0x690 0x000 0x1 0x0 +#define MX51_PAD_USBH1_DATA2__USBH1_DATA2 0x290 0x690 0x000 0x0 0x0 +#define MX51_PAD_USBH1_DATA3__GPIO1_14 0x294 0x694 0x000 0x2 0x0 +#define MX51_PAD_USBH1_DATA3__UART2_RTS 0x294 0x694 0x9e8 0x1 0x5 +#define MX51_PAD_USBH1_DATA3__USBH1_DATA3 0x294 0x694 0x000 0x0 0x0 +#define MX51_PAD_USBH1_DATA4__CSPI_SS0 0x298 0x698 0x000 0x1 0x0 +#define MX51_PAD_USBH1_DATA4__GPIO1_15 0x298 0x698 0x000 0x2 0x0 +#define MX51_PAD_USBH1_DATA4__USBH1_DATA4 0x298 0x698 0x000 0x0 0x0 +#define MX51_PAD_USBH1_DATA5__CSPI_SS1 0x29c 0x69c 0x920 0x1 0x0 +#define MX51_PAD_USBH1_DATA5__GPIO1_16 0x29c 0x69c 0x000 0x2 0x0 +#define MX51_PAD_USBH1_DATA5__USBH1_DATA5 0x29c 0x69c 0x000 0x0 0x0 +#define MX51_PAD_USBH1_DATA6__CSPI_SS3 0x2a0 0x6a0 0x928 0x1 0x1 +#define MX51_PAD_USBH1_DATA6__GPIO1_17 0x2a0 0x6a0 0x000 0x2 0x0 +#define MX51_PAD_USBH1_DATA6__USBH1_DATA6 0x2a0 0x6a0 0x000 0x0 0x0 +#define MX51_PAD_USBH1_DATA7__ECSPI1_SS3 0x2a4 0x6a4 0x000 0x1 0x0 +#define MX51_PAD_USBH1_DATA7__ECSPI2_SS3 0x2a4 0x6a4 0x934 0x5 0x1 +#define MX51_PAD_USBH1_DATA7__GPIO1_18 0x2a4 0x6a4 0x000 0x2 0x0 +#define MX51_PAD_USBH1_DATA7__USBH1_DATA7 0x2a4 0x6a4 0x000 0x0 0x0 +#define MX51_PAD_DI1_PIN11__DI1_PIN11 0x2a8 0x6a8 0x000 0x0 0x0 +#define MX51_PAD_DI1_PIN11__ECSPI1_SS2 0x2a8 0x6a8 0x000 0x7 0x0 +#define MX51_PAD_DI1_PIN11__GPIO3_0 0x2a8 0x6a8 0x000 0x4 0x0 +#define MX51_PAD_DI1_PIN12__DI1_PIN12 0x2ac 0x6ac 0x000 0x0 0x0 +#define MX51_PAD_DI1_PIN12__GPIO3_1 0x2ac 0x6ac 0x978 0x4 0x1 +#define MX51_PAD_DI1_PIN13__DI1_PIN13 0x2b0 0x6b0 0x000 0x0 0x0 +#define MX51_PAD_DI1_PIN13__GPIO3_2 0x2b0 0x6b0 0x97c 0x4 0x1 +#define MX51_PAD_DI1_D0_CS__DI1_D0_CS 0x2b4 0x6b4 0x000 0x0 0x0 +#define MX51_PAD_DI1_D0_CS__GPIO3_3 0x2b4 0x6b4 0x980 0x4 0x1 +#define MX51_PAD_DI1_D1_CS__DI1_D1_CS 0x2b8 0x6b8 0x000 0x0 0x0 +#define MX51_PAD_DI1_D1_CS__DISP1_PIN14 0x2b8 0x6b8 0x000 0x2 0x0 +#define MX51_PAD_DI1_D1_CS__DISP1_PIN5 0x2b8 0x6b8 0x000 0x3 0x0 +#define MX51_PAD_DI1_D1_CS__GPIO3_4 0x2b8 0x6b8 0x984 0x4 0x1 +#define MX51_PAD_DISPB2_SER_DIN__DISP1_PIN1 0x2bc 0x6bc 0x9a4 0x2 0x1 +#define MX51_PAD_DISPB2_SER_DIN__DISPB2_SER_DIN 0x2bc 0x6bc 0x9c4 0x0 0x0 +#define MX51_PAD_DISPB2_SER_DIN__GPIO3_5 0x2bc 0x6bc 0x988 0x4 0x1 +#define MX51_PAD_DISPB2_SER_DIO__DISP1_PIN6 0x2c0 0x6c0 0x000 0x3 0x0 +#define MX51_PAD_DISPB2_SER_DIO__DISPB2_SER_DIO 0x2c0 0x6c0 0x9c4 0x0 0x1 +#define MX51_PAD_DISPB2_SER_DIO__GPIO3_6 0x2c0 0x6c0 0x98c 0x4 0x1 +#define MX51_PAD_DISPB2_SER_CLK__DISP1_PIN17 0x2c4 0x6c4 0x000 0x2 0x0 +#define MX51_PAD_DISPB2_SER_CLK__DISP1_PIN7 0x2c4 0x6c4 0x000 0x3 0x0 +#define MX51_PAD_DISPB2_SER_CLK__DISPB2_SER_CLK 0x2c4 0x6c4 0x000 0x0 0x0 +#define MX51_PAD_DISPB2_SER_CLK__GPIO3_7 0x2c4 0x6c4 0x990 0x4 0x1 +#define MX51_PAD_DISPB2_SER_RS__DISP1_EXT_CLK 0x2c8 0x6c8 0x000 0x2 0x0 +#define MX51_PAD_DISPB2_SER_RS__DISP1_PIN16 0x2c8 0x6c8 0x000 0x2 0x0 +#define MX51_PAD_DISPB2_SER_RS__DISP1_PIN8 0x2c8 0x6c8 0x000 0x3 0x0 +#define MX51_PAD_DISPB2_SER_RS__DISPB2_SER_RS 0x2c8 0x6c8 0x000 0x0 0x0 +#define MX51_PAD_DISPB2_SER_RS__GPIO3_8 0x2c8 0x6c8 0x994 0x4 0x1 +#define MX51_PAD_DISP1_DAT0__DISP1_DAT0 0x2cc 0x6cc 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT1__DISP1_DAT1 0x2d0 0x6d0 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT2__DISP1_DAT2 0x2d4 0x6d4 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT3__DISP1_DAT3 0x2d8 0x6d8 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT4__DISP1_DAT4 0x2dc 0x6dc 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT5__DISP1_DAT5 0x2e0 0x6e0 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT6__BOOT_USB_SRC 0x2e4 0x6e4 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT6__DISP1_DAT6 0x2e4 0x6e4 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT7__BOOT_EEPROM_CFG 0x2e8 0x6e8 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT7__DISP1_DAT7 0x2e8 0x6e8 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT8__BOOT_SRC0 0x2ec 0x6ec 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT8__DISP1_DAT8 0x2ec 0x6ec 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT9__BOOT_SRC1 0x2f0 0x6f0 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT9__DISP1_DAT9 0x2f0 0x6f0 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT10__BOOT_SPARE_SIZE 0x2f4 0x6f4 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT10__DISP1_DAT10 0x2f4 0x6f4 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT11__BOOT_LPB_FREQ2 0x2f8 0x6f8 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT11__DISP1_DAT11 0x2f8 0x6f8 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT12__BOOT_MLC_SEL 0x2fc 0x6fc 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT12__DISP1_DAT12 0x2fc 0x6fc 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT13__BOOT_MEM_CTL0 0x300 0x700 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT13__DISP1_DAT13 0x300 0x700 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT14__BOOT_MEM_CTL1 0x304 0x704 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT14__DISP1_DAT14 0x304 0x704 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT15__BOOT_BUS_WIDTH 0x308 0x708 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT15__DISP1_DAT15 0x308 0x708 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT16__BOOT_PAGE_SIZE0 0x30c 0x70c 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT16__DISP1_DAT16 0x30c 0x70c 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT17__BOOT_PAGE_SIZE1 0x310 0x710 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT17__DISP1_DAT17 0x310 0x710 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT18__BOOT_WEIM_MUXED0 0x314 0x714 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT18__DISP1_DAT18 0x314 0x714 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT18__DISP2_PIN11 0x314 0x714 0x000 0x5 0x0 +#define MX51_PAD_DISP1_DAT18__DISP2_PIN5 0x314 0x714 0x000 0x4 0x0 +#define MX51_PAD_DISP1_DAT19__BOOT_WEIM_MUXED1 0x318 0x718 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT19__DISP1_DAT19 0x318 0x718 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT19__DISP2_PIN12 0x318 0x718 0x000 0x5 0x0 +#define MX51_PAD_DISP1_DAT19__DISP2_PIN6 0x318 0x718 0x000 0x4 0x0 +#define MX51_PAD_DISP1_DAT20__BOOT_MEM_TYPE0 0x31c 0x71c 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT20__DISP1_DAT20 0x31c 0x71c 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT20__DISP2_PIN13 0x31c 0x71c 0x000 0x5 0x0 +#define MX51_PAD_DISP1_DAT20__DISP2_PIN7 0x31c 0x71c 0x000 0x4 0x0 +#define MX51_PAD_DISP1_DAT21__BOOT_MEM_TYPE1 0x320 0x720 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT21__DISP1_DAT21 0x320 0x720 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT21__DISP2_PIN14 0x320 0x720 0x000 0x5 0x0 +#define MX51_PAD_DISP1_DAT21__DISP2_PIN8 0x320 0x720 0x000 0x4 0x0 +#define MX51_PAD_DISP1_DAT22__BOOT_LPB_FREQ0 0x324 0x724 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT22__DISP1_DAT22 0x324 0x724 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT22__DISP2_D0_CS 0x324 0x724 0x000 0x6 0x0 +#define MX51_PAD_DISP1_DAT22__DISP2_DAT16 0x324 0x724 0x000 0x5 0x0 +#define MX51_PAD_DISP1_DAT23__BOOT_LPB_FREQ1 0x328 0x728 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT23__DISP1_DAT23 0x328 0x728 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT23__DISP2_D1_CS 0x328 0x728 0x000 0x6 0x0 +#define MX51_PAD_DISP1_DAT23__DISP2_DAT17 0x328 0x728 0x000 0x5 0x0 +#define MX51_PAD_DISP1_DAT23__DISP2_SER_CS 0x328 0x728 0x000 0x4 0x0 +#define MX51_PAD_DI1_PIN3__DI1_PIN3 0x32c 0x72c 0x000 0x0 0x0 +#define MX51_PAD_DI1_PIN2__DI1_PIN2 0x330 0x734 0x000 0x0 0x0 +#define MX51_PAD_DI_GP2__DISP1_SER_CLK 0x338 0x740 0x000 0x0 0x0 +#define MX51_PAD_DI_GP2__DISP2_WAIT 0x338 0x740 0x9a8 0x2 0x1 +#define MX51_PAD_DI_GP3__CSI1_DATA_EN 0x33c 0x744 0x9a0 0x3 0x1 +#define MX51_PAD_DI_GP3__DISP1_SER_DIO 0x33c 0x744 0x9c0 0x0 0x0 +#define MX51_PAD_DI_GP3__FEC_TX_ER 0x33c 0x744 0x000 0x2 0x0 +#define MX51_PAD_DI2_PIN4__CSI2_DATA_EN 0x340 0x748 0x99c 0x3 0x1 +#define MX51_PAD_DI2_PIN4__DI2_PIN4 0x340 0x748 0x000 0x0 0x0 +#define MX51_PAD_DI2_PIN4__FEC_CRS 0x340 0x748 0x950 0x2 0x1 +#define MX51_PAD_DI2_PIN2__DI2_PIN2 0x344 0x74c 0x000 0x0 0x0 +#define MX51_PAD_DI2_PIN2__FEC_MDC 0x344 0x74c 0x000 0x2 0x0 +#define MX51_PAD_DI2_PIN3__DI2_PIN3 0x348 0x750 0x000 0x0 0x0 +#define MX51_PAD_DI2_PIN3__FEC_MDIO 0x348 0x750 0x954 0x2 0x1 +#define MX51_PAD_DI2_DISP_CLK__DI2_DISP_CLK 0x34c 0x754 0x000 0x0 0x0 +#define MX51_PAD_DI2_DISP_CLK__FEC_RDATA1 0x34c 0x754 0x95c 0x2 0x1 +#define MX51_PAD_DI_GP4__DI2_PIN15 0x350 0x758 0x000 0x4 0x0 +#define MX51_PAD_DI_GP4__DISP1_SER_DIN 0x350 0x758 0x9c0 0x0 0x1 +#define MX51_PAD_DI_GP4__DISP2_PIN1 0x350 0x758 0x000 0x3 0x0 +#define MX51_PAD_DI_GP4__FEC_RDATA2 0x350 0x758 0x960 0x2 0x1 +#define MX51_PAD_DISP2_DAT0__DISP2_DAT0 0x354 0x75c 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT0__FEC_RDATA3 0x354 0x75c 0x964 0x2 0x1 +#define MX51_PAD_DISP2_DAT0__KEY_COL6 0x354 0x75c 0x9c8 0x4 0x1 +#define MX51_PAD_DISP2_DAT0__UART3_RXD 0x354 0x75c 0x9f4 0x5 0x8 +#define MX51_PAD_DISP2_DAT0__USBH3_CLK 0x354 0x75c 0x9f8 0x3 0x1 +#define MX51_PAD_DISP2_DAT1__DISP2_DAT1 0x358 0x760 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT1__FEC_RX_ER 0x358 0x760 0x970 0x2 0x1 +#define MX51_PAD_DISP2_DAT1__KEY_COL7 0x358 0x760 0x9cc 0x4 0x1 +#define MX51_PAD_DISP2_DAT1__UART3_TXD 0x358 0x760 0x000 0x5 0x0 +#define MX51_PAD_DISP2_DAT1__USBH3_DIR 0x358 0x760 0xa1c 0x3 0x1 +#define MX51_PAD_DISP2_DAT2__DISP2_DAT2 0x35c 0x764 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT3__DISP2_DAT3 0x360 0x768 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT4__DISP2_DAT4 0x364 0x76c 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT5__DISP2_DAT5 0x368 0x770 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT6__DISP2_DAT6 0x36c 0x774 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT6__FEC_TDATA1 0x36c 0x774 0x000 0x2 0x0 +#define MX51_PAD_DISP2_DAT6__GPIO1_19 0x36c 0x774 0x000 0x5 0x0 +#define MX51_PAD_DISP2_DAT6__KEY_ROW4 0x36c 0x774 0x9d0 0x4 0x1 +#define MX51_PAD_DISP2_DAT6__USBH3_STP 0x36c 0x774 0xa24 0x3 0x1 +#define MX51_PAD_DISP2_DAT7__DISP2_DAT7 0x370 0x778 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT7__FEC_TDATA2 0x370 0x778 0x000 0x2 0x0 +#define MX51_PAD_DISP2_DAT7__GPIO1_29 0x370 0x778 0x000 0x5 0x0 +#define MX51_PAD_DISP2_DAT7__KEY_ROW5 0x370 0x778 0x9d4 0x4 0x1 +#define MX51_PAD_DISP2_DAT7__USBH3_NXT 0x370 0x778 0xa20 0x3 0x1 +#define MX51_PAD_DISP2_DAT8__DISP2_DAT8 0x374 0x77c 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT8__FEC_TDATA3 0x374 0x77c 0x000 0x2 0x0 +#define MX51_PAD_DISP2_DAT8__GPIO1_30 0x374 0x77c 0x000 0x5 0x0 +#define MX51_PAD_DISP2_DAT8__KEY_ROW6 0x374 0x77c 0x9d8 0x4 0x1 +#define MX51_PAD_DISP2_DAT8__USBH3_DATA0 0x374 0x77c 0x9fc 0x3 0x1 +#define MX51_PAD_DISP2_DAT9__AUD6_RXC 0x378 0x780 0x8f4 0x4 0x1 +#define MX51_PAD_DISP2_DAT9__DISP2_DAT9 0x378 0x780 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT9__FEC_TX_EN 0x378 0x780 0x000 0x2 0x0 +#define MX51_PAD_DISP2_DAT9__GPIO1_31 0x378 0x780 0x000 0x5 0x0 +#define MX51_PAD_DISP2_DAT9__USBH3_DATA1 0x378 0x780 0xa00 0x3 0x1 +#define MX51_PAD_DISP2_DAT10__DISP2_DAT10 0x37c 0x784 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT10__DISP2_SER_CS 0x37c 0x784 0x000 0x5 0x0 +#define MX51_PAD_DISP2_DAT10__FEC_COL 0x37c 0x784 0x94c 0x2 0x1 +#define MX51_PAD_DISP2_DAT10__KEY_ROW7 0x37c 0x784 0x9dc 0x4 0x1 +#define MX51_PAD_DISP2_DAT10__USBH3_DATA2 0x37c 0x784 0xa04 0x3 0x1 +#define MX51_PAD_DISP2_DAT11__AUD6_TXD 0x380 0x788 0x8f0 0x4 0x1 +#define MX51_PAD_DISP2_DAT11__DISP2_DAT11 0x380 0x788 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT11__FEC_RX_CLK 0x380 0x788 0x968 0x2 0x1 +#define MX51_PAD_DISP2_DAT11__GPIO1_10 0x380 0x788 0x000 0x7 0x0 +#define MX51_PAD_DISP2_DAT11__USBH3_DATA3 0x380 0x788 0xa08 0x3 0x1 +#define MX51_PAD_DISP2_DAT12__AUD6_RXD 0x384 0x78c 0x8ec 0x4 0x1 +#define MX51_PAD_DISP2_DAT12__DISP2_DAT12 0x384 0x78c 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT12__FEC_RX_DV 0x384 0x78c 0x96c 0x2 0x1 +#define MX51_PAD_DISP2_DAT12__USBH3_DATA4 0x384 0x78c 0xa0c 0x3 0x1 +#define MX51_PAD_DISP2_DAT13__AUD6_TXC 0x388 0x790 0x8fc 0x4 0x1 +#define MX51_PAD_DISP2_DAT13__DISP2_DAT13 0x388 0x790 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT13__FEC_TX_CLK 0x388 0x790 0x974 0x2 0x1 +#define MX51_PAD_DISP2_DAT13__USBH3_DATA5 0x388 0x790 0xa10 0x3 0x1 +#define MX51_PAD_DISP2_DAT14__AUD6_TXFS 0x38c 0x794 0x900 0x4 0x1 +#define MX51_PAD_DISP2_DAT14__DISP2_DAT14 0x38c 0x794 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT14__FEC_RDATA0 0x38c 0x794 0x958 0x2 0x1 +#define MX51_PAD_DISP2_DAT14__USBH3_DATA6 0x38c 0x794 0xa14 0x3 0x1 +#define MX51_PAD_DISP2_DAT15__AUD6_RXFS 0x390 0x798 0x8f8 0x4 0x1 +#define MX51_PAD_DISP2_DAT15__DISP1_SER_CS 0x390 0x798 0x000 0x5 0x0 +#define MX51_PAD_DISP2_DAT15__DISP2_DAT15 0x390 0x798 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT15__FEC_TDATA0 0x390 0x798 0x000 0x2 0x0 +#define MX51_PAD_DISP2_DAT15__USBH3_DATA7 0x390 0x798 0xa18 0x3 0x1 +#define MX51_PAD_SD1_CMD__AUD5_RXFS 0x394 0x79c 0x8e0 0x1 0x1 +#define MX51_PAD_SD1_CMD__CSPI_MOSI 0x394 0x79c 0x91c 0x2 0x2 +#define MX51_PAD_SD1_CMD__SD1_CMD 0x394 0x79c 0x000 0x0 0x0 +#define MX51_PAD_SD1_CLK__AUD5_RXC 0x398 0x7a0 0x8dc 0x1 0x1 +#define MX51_PAD_SD1_CLK__CSPI_SCLK 0x398 0x7a0 0x914 0x2 0x2 +#define MX51_PAD_SD1_CLK__SD1_CLK 0x398 0x7a0 0x000 0x0 0x0 +#define MX51_PAD_SD1_DATA0__AUD5_TXD 0x39c 0x7a4 0x8d8 0x1 0x2 +#define MX51_PAD_SD1_DATA0__CSPI_MISO 0x39c 0x7a4 0x918 0x2 0x1 +#define MX51_PAD_SD1_DATA0__SD1_DATA0 0x39c 0x7a4 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA0__EIM_DA0 0x01c 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA1__EIM_DA1 0x020 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA2__EIM_DA2 0x024 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA3__EIM_DA3 0x028 0x000 0x000 0x0 0x0 +#define MX51_PAD_SD1_DATA1__AUD5_RXD 0x3a0 0x7a8 0x8d4 0x1 0x2 +#define MX51_PAD_SD1_DATA1__SD1_DATA1 0x3a0 0x7a8 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA4__EIM_DA4 0x02c 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA5__EIM_DA5 0x030 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA6__EIM_DA6 0x034 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA7__EIM_DA7 0x038 0x000 0x000 0x0 0x0 +#define MX51_PAD_SD1_DATA2__AUD5_TXC 0x3a4 0x7ac 0x8e4 0x1 0x2 +#define MX51_PAD_SD1_DATA2__SD1_DATA2 0x3a4 0x7ac 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA10__EIM_DA10 0x044 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA11__EIM_DA11 0x048 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA8__EIM_DA8 0x03c 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA9__EIM_DA9 0x040 0x000 0x000 0x0 0x0 +#define MX51_PAD_SD1_DATA3__AUD5_TXFS 0x3a8 0x7b0 0x8e8 0x1 0x2 +#define MX51_PAD_SD1_DATA3__CSPI_SS1 0x3a8 0x7b0 0x920 0x2 0x1 +#define MX51_PAD_SD1_DATA3__SD1_DATA3 0x3a8 0x7b0 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_0__CSPI_SS2 0x3ac 0x7b4 0x924 0x2 0x0 +#define MX51_PAD_GPIO1_0__GPIO1_0 0x3ac 0x7b4 0x000 0x1 0x0 +#define MX51_PAD_GPIO1_0__SD1_CD 0x3ac 0x7b4 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_1__CSPI_MISO 0x3b0 0x7b8 0x918 0x2 0x2 +#define MX51_PAD_GPIO1_1__GPIO1_1 0x3b0 0x7b8 0x000 0x1 0x0 +#define MX51_PAD_GPIO1_1__SD1_WP 0x3b0 0x7b8 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA12__EIM_DA12 0x04c 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA13__EIM_DA13 0x050 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA14__EIM_DA14 0x054 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA15__EIM_DA15 0x058 0x000 0x000 0x0 0x0 +#define MX51_PAD_SD2_CMD__CSPI_MOSI 0x3b4 0x7bc 0x91c 0x2 0x3 +#define MX51_PAD_SD2_CMD__I2C1_SCL 0x3b4 0x7bc 0x9b0 0x1 0x2 +#define MX51_PAD_SD2_CMD__SD2_CMD 0x3b4 0x7bc 0x000 0x0 0x0 +#define MX51_PAD_SD2_CLK__CSPI_SCLK 0x3b8 0x7c0 0x914 0x2 0x3 +#define MX51_PAD_SD2_CLK__I2C1_SDA 0x3b8 0x7c0 0x9b4 0x1 0x2 +#define MX51_PAD_SD2_CLK__SD2_CLK 0x3b8 0x7c0 0x000 0x0 0x0 +#define MX51_PAD_SD2_DATA0__CSPI_MISO 0x3bc 0x7c4 0x918 0x2 0x3 +#define MX51_PAD_SD2_DATA0__SD1_DAT4 0x3bc 0x7c4 0x000 0x1 0x0 +#define MX51_PAD_SD2_DATA0__SD2_DATA0 0x3bc 0x7c4 0x000 0x0 0x0 +#define MX51_PAD_SD2_DATA1__SD1_DAT5 0x3c0 0x7c8 0x000 0x1 0x0 +#define MX51_PAD_SD2_DATA1__SD2_DATA1 0x3c0 0x7c8 0x000 0x0 0x0 +#define MX51_PAD_SD2_DATA1__USBH3_H2_DP 0x3c0 0x7c8 0x000 0x2 0x0 +#define MX51_PAD_SD2_DATA2__SD1_DAT6 0x3c4 0x7cc 0x000 0x1 0x0 +#define MX51_PAD_SD2_DATA2__SD2_DATA2 0x3c4 0x7cc 0x000 0x0 0x0 +#define MX51_PAD_SD2_DATA2__USBH3_H2_DM 0x3c4 0x7cc 0x000 0x2 0x0 +#define MX51_PAD_SD2_DATA3__CSPI_SS2 0x3c8 0x7d0 0x924 0x2 0x1 +#define MX51_PAD_SD2_DATA3__SD1_DAT7 0x3c8 0x7d0 0x000 0x1 0x0 +#define MX51_PAD_SD2_DATA3__SD2_DATA3 0x3c8 0x7d0 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_2__CCM_OUT_2 0x3cc 0x7d4 0x000 0x5 0x0 +#define MX51_PAD_GPIO1_2__GPIO1_2 0x3cc 0x7d4 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_2__I2C2_SCL 0x3cc 0x7d4 0x9b8 0x2 0x3 +#define MX51_PAD_GPIO1_2__PLL1_BYP 0x3cc 0x7d4 0x90c 0x7 0x1 +#define MX51_PAD_GPIO1_2__PWM1_PWMO 0x3cc 0x7d4 0x000 0x1 0x0 +#define MX51_PAD_GPIO1_3__GPIO1_3 0x3d0 0x7d8 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_3__I2C2_SDA 0x3d0 0x7d8 0x9bc 0x2 0x3 +#define MX51_PAD_GPIO1_3__PLL2_BYP 0x3d0 0x7d8 0x910 0x7 0x1 +#define MX51_PAD_GPIO1_3__PWM2_PWMO 0x3d0 0x7d8 0x000 0x1 0x0 +#define MX51_PAD_PMIC_INT_REQ__PMIC_INT_REQ 0x3d4 0x7fc 0x000 0x0 0x0 +#define MX51_PAD_PMIC_INT_REQ__PMIC_PMU_IRQ_B 0x3d4 0x7fc 0x000 0x1 0x0 +#define MX51_PAD_GPIO1_4__DISP2_EXT_CLK 0x3d8 0x804 0x908 0x4 0x1 +#define MX51_PAD_GPIO1_4__EIM_RDY 0x3d8 0x804 0x938 0x3 0x1 +#define MX51_PAD_GPIO1_4__GPIO1_4 0x3d8 0x804 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_4__WDOG1_WDOG_B 0x3d8 0x804 0x000 0x2 0x0 +#define MX51_PAD_GPIO1_5__CSI2_MCLK 0x3dc 0x808 0x000 0x6 0x0 +#define MX51_PAD_GPIO1_5__DISP2_PIN16 0x3dc 0x808 0x000 0x3 0x0 +#define MX51_PAD_GPIO1_5__GPIO1_5 0x3dc 0x808 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_5__WDOG2_WDOG_B 0x3dc 0x808 0x000 0x2 0x0 +#define MX51_PAD_GPIO1_6__DISP2_PIN17 0x3e0 0x80c 0x000 0x4 0x0 +#define MX51_PAD_GPIO1_6__GPIO1_6 0x3e0 0x80c 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_6__REF_EN_B 0x3e0 0x80c 0x000 0x3 0x0 +#define MX51_PAD_GPIO1_7__CCM_OUT_0 0x3e4 0x810 0x000 0x3 0x0 +#define MX51_PAD_GPIO1_7__GPIO1_7 0x3e4 0x810 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_7__SD2_WP 0x3e4 0x810 0x000 0x6 0x0 +#define MX51_PAD_GPIO1_7__SPDIF_OUT1 0x3e4 0x810 0x000 0x2 0x0 +#define MX51_PAD_GPIO1_8__CSI2_DATA_EN 0x3e8 0x814 0x99c 0x2 0x2 +#define MX51_PAD_GPIO1_8__GPIO1_8 0x3e8 0x814 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_8__SD2_CD 0x3e8 0x814 0x000 0x6 0x0 +#define MX51_PAD_GPIO1_8__USBH3_PWR 0x3e8 0x814 0x000 0x1 0x0 +#define MX51_PAD_GPIO1_9__CCM_OUT_1 0x3ec 0x818 0x000 0x3 0x0 +#define MX51_PAD_GPIO1_9__DISP2_D1_CS 0x3ec 0x818 0x000 0x2 0x0 +#define MX51_PAD_GPIO1_9__DISP2_SER_CS 0x3ec 0x818 0x000 0x7 0x0 +#define MX51_PAD_GPIO1_9__GPIO1_9 0x3ec 0x818 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_9__SD2_LCTL 0x3ec 0x818 0x000 0x6 0x0 +#define MX51_PAD_GPIO1_9__USBH3_OC 0x3ec 0x818 0x000 0x1 0x0 + +#endif /* __DTS_IMX51_PINFUNC_H */ Copied: stable/10/sys/gnu/dts/arm/imx53-pinfunc.h (from r271151, head/sys/gnu/dts/arm/imx53-pinfunc.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/gnu/dts/arm/imx53-pinfunc.h Sun Oct 26 23:45:33 2014 (r273714, copy of r271151, head/sys/gnu/dts/arm/imx53-pinfunc.h) @@ -0,0 +1,1189 @@ +/* + * Copyright 2013 Freescale Semiconductor, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#ifndef __DTS_IMX53_PINFUNC_H +#define __DTS_IMX53_PINFUNC_H + +/* + * The pin function ID is a tuple of + * + */ +#define MX53_PAD_GPIO_19__KPP_COL_5 0x020 0x348 0x840 0x0 0x0 +#define MX53_PAD_GPIO_19__GPIO4_5 0x020 0x348 0x000 0x1 0x0 +#define MX53_PAD_GPIO_19__CCM_CLKO 0x020 0x348 0x000 0x2 0x0 +#define MX53_PAD_GPIO_19__SPDIF_OUT1 0x020 0x348 0x000 0x3 0x0 +#define MX53_PAD_GPIO_19__RTC_CE_RTC_EXT_TRIG2 0x020 0x348 0x000 0x4 0x0 +#define MX53_PAD_GPIO_19__ECSPI1_RDY 0x020 0x348 0x000 0x5 0x0 +#define MX53_PAD_GPIO_19__FEC_TDATA_3 0x020 0x348 0x000 0x6 0x0 +#define MX53_PAD_GPIO_19__SRC_INT_BOOT 0x020 0x348 0x000 0x7 0x0 +#define MX53_PAD_KEY_COL0__KPP_COL_0 0x024 0x34c 0x000 0x0 0x0 +#define MX53_PAD_KEY_COL0__GPIO4_6 0x024 0x34c 0x000 0x1 0x0 +#define MX53_PAD_KEY_COL0__AUDMUX_AUD5_TXC 0x024 0x34c 0x758 0x2 0x0 +#define MX53_PAD_KEY_COL0__UART4_TXD_MUX 0x024 0x34c 0x000 0x4 0x0 +#define MX53_PAD_KEY_COL0__ECSPI1_SCLK 0x024 0x34c 0x79c 0x5 0x0 +#define MX53_PAD_KEY_COL0__FEC_RDATA_3 0x024 0x34c 0x000 0x6 0x0 +#define MX53_PAD_KEY_COL0__SRC_ANY_PU_RST 0x024 0x34c 0x000 0x7 0x0 +#define MX53_PAD_KEY_ROW0__KPP_ROW_0 0x028 0x350 0x000 0x0 0x0 +#define MX53_PAD_KEY_ROW0__GPIO4_7 0x028 0x350 0x000 0x1 0x0 +#define MX53_PAD_KEY_ROW0__AUDMUX_AUD5_TXD 0x028 0x350 0x74c 0x2 0x0 +#define MX53_PAD_KEY_ROW0__UART4_RXD_MUX 0x028 0x350 0x890 0x4 0x1 +#define MX53_PAD_KEY_ROW0__ECSPI1_MOSI 0x028 0x350 0x7a4 0x5 0x0 +#define MX53_PAD_KEY_ROW0__FEC_TX_ER 0x028 0x350 0x000 0x6 0x0 +#define MX53_PAD_KEY_COL1__KPP_COL_1 0x02c 0x354 0x000 0x0 0x0 +#define MX53_PAD_KEY_COL1__GPIO4_8 0x02c 0x354 0x000 0x1 0x0 +#define MX53_PAD_KEY_COL1__AUDMUX_AUD5_TXFS 0x02c 0x354 0x75c 0x2 0x0 +#define MX53_PAD_KEY_COL1__UART5_TXD_MUX 0x02c 0x354 0x000 0x4 0x0 +#define MX53_PAD_KEY_COL1__ECSPI1_MISO 0x02c 0x354 0x7a0 0x5 0x0 +#define MX53_PAD_KEY_COL1__FEC_RX_CLK 0x02c 0x354 0x808 0x6 0x0 +#define MX53_PAD_KEY_COL1__USBPHY1_TXREADY 0x02c 0x354 0x000 0x7 0x0 +#define MX53_PAD_KEY_ROW1__KPP_ROW_1 0x030 0x358 0x000 0x0 0x0 +#define MX53_PAD_KEY_ROW1__GPIO4_9 0x030 0x358 0x000 0x1 0x0 +#define MX53_PAD_KEY_ROW1__AUDMUX_AUD5_RXD 0x030 0x358 0x748 0x2 0x0 +#define MX53_PAD_KEY_ROW1__UART5_RXD_MUX 0x030 0x358 0x898 0x4 0x1 +#define MX53_PAD_KEY_ROW1__ECSPI1_SS0 0x030 0x358 0x7a8 0x5 0x0 +#define MX53_PAD_KEY_ROW1__FEC_COL 0x030 0x358 0x800 0x6 0x0 +#define MX53_PAD_KEY_ROW1__USBPHY1_RXVALID 0x030 0x358 0x000 0x7 0x0 +#define MX53_PAD_KEY_COL2__KPP_COL_2 0x034 0x35c 0x000 0x0 0x0 +#define MX53_PAD_KEY_COL2__GPIO4_10 0x034 0x35c 0x000 0x1 0x0 +#define MX53_PAD_KEY_COL2__CAN1_TXCAN 0x034 0x35c 0x000 0x2 0x0 +#define MX53_PAD_KEY_COL2__FEC_MDIO 0x034 0x35c 0x804 0x4 0x0 +#define MX53_PAD_KEY_COL2__ECSPI1_SS1 0x034 0x35c 0x7ac 0x5 0x0 +#define MX53_PAD_KEY_COL2__FEC_RDATA_2 0x034 0x35c 0x000 0x6 0x0 +#define MX53_PAD_KEY_COL2__USBPHY1_RXACTIVE 0x034 0x35c 0x000 0x7 0x0 +#define MX53_PAD_KEY_ROW2__KPP_ROW_2 0x038 0x360 0x000 0x0 0x0 +#define MX53_PAD_KEY_ROW2__GPIO4_11 0x038 0x360 0x000 0x1 0x0 +#define MX53_PAD_KEY_ROW2__CAN1_RXCAN 0x038 0x360 0x760 0x2 0x0 +#define MX53_PAD_KEY_ROW2__FEC_MDC 0x038 0x360 0x000 0x4 0x0 +#define MX53_PAD_KEY_ROW2__ECSPI1_SS2 0x038 0x360 0x7b0 0x5 0x0 +#define MX53_PAD_KEY_ROW2__FEC_TDATA_2 0x038 0x360 0x000 0x6 0x0 +#define MX53_PAD_KEY_ROW2__USBPHY1_RXERROR 0x038 0x360 0x000 0x7 0x0 +#define MX53_PAD_KEY_COL3__KPP_COL_3 0x03c 0x364 0x000 0x0 0x0 +#define MX53_PAD_KEY_COL3__GPIO4_12 0x03c 0x364 0x000 0x1 0x0 +#define MX53_PAD_KEY_COL3__USBOH3_H2_DP 0x03c 0x364 0x000 0x2 0x0 +#define MX53_PAD_KEY_COL3__SPDIF_IN1 0x03c 0x364 0x870 0x3 0x0 +#define MX53_PAD_KEY_COL3__I2C2_SCL 0x03c 0x364 0x81c 0x4 0x0 +#define MX53_PAD_KEY_COL3__ECSPI1_SS3 0x03c 0x364 0x7b4 0x5 0x0 +#define MX53_PAD_KEY_COL3__FEC_CRS 0x03c 0x364 0x000 0x6 0x0 +#define MX53_PAD_KEY_COL3__USBPHY1_SIECLOCK 0x03c 0x364 0x000 0x7 0x0 +#define MX53_PAD_KEY_ROW3__KPP_ROW_3 0x040 0x368 0x000 0x0 0x0 +#define MX53_PAD_KEY_ROW3__GPIO4_13 0x040 0x368 0x000 0x1 0x0 +#define MX53_PAD_KEY_ROW3__USBOH3_H2_DM 0x040 0x368 0x000 0x2 0x0 +#define MX53_PAD_KEY_ROW3__CCM_ASRC_EXT_CLK 0x040 0x368 0x768 0x3 0x0 +#define MX53_PAD_KEY_ROW3__I2C2_SDA 0x040 0x368 0x820 0x4 0x0 +#define MX53_PAD_KEY_ROW3__OSC32K_32K_OUT 0x040 0x368 0x000 0x5 0x0 +#define MX53_PAD_KEY_ROW3__CCM_PLL4_BYP 0x040 0x368 0x77c 0x6 0x0 +#define MX53_PAD_KEY_ROW3__USBPHY1_LINESTATE_0 0x040 0x368 0x000 0x7 0x0 +#define MX53_PAD_KEY_COL4__KPP_COL_4 0x044 0x36c 0x000 0x0 0x0 +#define MX53_PAD_KEY_COL4__GPIO4_14 0x044 0x36c 0x000 0x1 0x0 +#define MX53_PAD_KEY_COL4__CAN2_TXCAN 0x044 0x36c 0x000 0x2 0x0 +#define MX53_PAD_KEY_COL4__IPU_SISG_4 0x044 0x36c 0x000 0x3 0x0 +#define MX53_PAD_KEY_COL4__UART5_RTS 0x044 0x36c 0x894 0x4 0x0 +#define MX53_PAD_KEY_COL4__USBOH3_USBOTG_OC 0x044 0x36c 0x89c 0x5 0x0 +#define MX53_PAD_KEY_COL4__USBPHY1_LINESTATE_1 0x044 0x36c 0x000 0x7 0x0 +#define MX53_PAD_KEY_ROW4__KPP_ROW_4 0x048 0x370 0x000 0x0 0x0 +#define MX53_PAD_KEY_ROW4__GPIO4_15 0x048 0x370 0x000 0x1 0x0 +#define MX53_PAD_KEY_ROW4__CAN2_RXCAN 0x048 0x370 0x764 0x2 0x0 +#define MX53_PAD_KEY_ROW4__IPU_SISG_5 0x048 0x370 0x000 0x3 0x0 +#define MX53_PAD_KEY_ROW4__UART5_CTS 0x048 0x370 0x000 0x4 0x0 +#define MX53_PAD_KEY_ROW4__USBOH3_USBOTG_PWR 0x048 0x370 0x000 0x5 0x0 +#define MX53_PAD_KEY_ROW4__USBPHY1_VBUSVALID 0x048 0x370 0x000 0x7 0x0 +#define MX53_PAD_DI0_DISP_CLK__IPU_DI0_DISP_CLK 0x04c 0x378 0x000 0x0 0x0 +#define MX53_PAD_DI0_DISP_CLK__GPIO4_16 0x04c 0x378 0x000 0x1 0x0 +#define MX53_PAD_DI0_DISP_CLK__USBOH3_USBH2_DIR 0x04c 0x378 0x000 0x2 0x0 +#define MX53_PAD_DI0_DISP_CLK__SDMA_DEBUG_CORE_STATE_0 0x04c 0x378 0x000 0x5 0x0 +#define MX53_PAD_DI0_DISP_CLK__EMI_EMI_DEBUG_0 0x04c 0x378 0x000 0x6 0x0 +#define MX53_PAD_DI0_DISP_CLK__USBPHY1_AVALID 0x04c 0x378 0x000 0x7 0x0 +#define MX53_PAD_DI0_PIN15__IPU_DI0_PIN15 0x050 0x37c 0x000 0x0 0x0 +#define MX53_PAD_DI0_PIN15__GPIO4_17 0x050 0x37c 0x000 0x1 0x0 +#define MX53_PAD_DI0_PIN15__AUDMUX_AUD6_TXC 0x050 0x37c 0x000 0x2 0x0 +#define MX53_PAD_DI0_PIN15__SDMA_DEBUG_CORE_STATE_1 0x050 0x37c 0x000 0x5 0x0 +#define MX53_PAD_DI0_PIN15__EMI_EMI_DEBUG_1 0x050 0x37c 0x000 0x6 0x0 +#define MX53_PAD_DI0_PIN15__USBPHY1_BVALID 0x050 0x37c 0x000 0x7 0x0 +#define MX53_PAD_DI0_PIN2__IPU_DI0_PIN2 0x054 0x380 0x000 0x0 0x0 +#define MX53_PAD_DI0_PIN2__GPIO4_18 0x054 0x380 0x000 0x1 0x0 +#define MX53_PAD_DI0_PIN2__AUDMUX_AUD6_TXD 0x054 0x380 0x000 0x2 0x0 +#define MX53_PAD_DI0_PIN2__SDMA_DEBUG_CORE_STATE_2 0x054 0x380 0x000 0x5 0x0 +#define MX53_PAD_DI0_PIN2__EMI_EMI_DEBUG_2 0x054 0x380 0x000 0x6 0x0 +#define MX53_PAD_DI0_PIN2__USBPHY1_ENDSESSION 0x054 0x380 0x000 0x7 0x0 +#define MX53_PAD_DI0_PIN3__IPU_DI0_PIN3 0x058 0x384 0x000 0x0 0x0 +#define MX53_PAD_DI0_PIN3__GPIO4_19 0x058 0x384 0x000 0x1 0x0 +#define MX53_PAD_DI0_PIN3__AUDMUX_AUD6_TXFS 0x058 0x384 0x000 0x2 0x0 +#define MX53_PAD_DI0_PIN3__SDMA_DEBUG_CORE_STATE_3 0x058 0x384 0x000 0x5 0x0 +#define MX53_PAD_DI0_PIN3__EMI_EMI_DEBUG_3 0x058 0x384 0x000 0x6 0x0 +#define MX53_PAD_DI0_PIN3__USBPHY1_IDDIG 0x058 0x384 0x000 0x7 0x0 +#define MX53_PAD_DI0_PIN4__IPU_DI0_PIN4 0x05c 0x388 0x000 0x0 0x0 +#define MX53_PAD_DI0_PIN4__GPIO4_20 0x05c 0x388 0x000 0x1 0x0 +#define MX53_PAD_DI0_PIN4__AUDMUX_AUD6_RXD 0x05c 0x388 0x000 0x2 0x0 +#define MX53_PAD_DI0_PIN4__ESDHC1_WP 0x05c 0x388 0x7fc 0x3 0x0 +#define MX53_PAD_DI0_PIN4__SDMA_DEBUG_YIELD 0x05c 0x388 0x000 0x5 0x0 +#define MX53_PAD_DI0_PIN4__EMI_EMI_DEBUG_4 0x05c 0x388 0x000 0x6 0x0 +#define MX53_PAD_DI0_PIN4__USBPHY1_HOSTDISCONNECT 0x05c 0x388 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT0__IPU_DISP0_DAT_0 0x060 0x38c 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT0__GPIO4_21 0x060 0x38c 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT0__CSPI_SCLK 0x060 0x38c 0x780 0x2 0x0 +#define MX53_PAD_DISP0_DAT0__USBOH3_USBH2_DATA_0 0x060 0x38c 0x000 0x3 0x0 +#define MX53_PAD_DISP0_DAT0__SDMA_DEBUG_CORE_RUN 0x060 0x38c 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT0__EMI_EMI_DEBUG_5 0x060 0x38c 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT0__USBPHY2_TXREADY 0x060 0x38c 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT1__IPU_DISP0_DAT_1 0x064 0x390 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT1__GPIO4_22 0x064 0x390 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT1__CSPI_MOSI 0x064 0x390 0x788 0x2 0x0 +#define MX53_PAD_DISP0_DAT1__USBOH3_USBH2_DATA_1 0x064 0x390 0x000 0x3 0x0 +#define MX53_PAD_DISP0_DAT1__SDMA_DEBUG_EVENT_CHANNEL_SEL 0x064 0x390 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT1__EMI_EMI_DEBUG_6 0x064 0x390 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT1__USBPHY2_RXVALID 0x064 0x390 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT2__IPU_DISP0_DAT_2 0x068 0x394 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT2__GPIO4_23 0x068 0x394 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT2__CSPI_MISO 0x068 0x394 0x784 0x2 0x0 +#define MX53_PAD_DISP0_DAT2__USBOH3_USBH2_DATA_2 0x068 0x394 0x000 0x3 0x0 +#define MX53_PAD_DISP0_DAT2__SDMA_DEBUG_MODE 0x068 0x394 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT2__EMI_EMI_DEBUG_7 0x068 0x394 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT2__USBPHY2_RXACTIVE 0x068 0x394 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT3__IPU_DISP0_DAT_3 0x06c 0x398 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT3__GPIO4_24 0x06c 0x398 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT3__CSPI_SS0 0x06c 0x398 0x78c 0x2 0x0 +#define MX53_PAD_DISP0_DAT3__USBOH3_USBH2_DATA_3 0x06c 0x398 0x000 0x3 0x0 +#define MX53_PAD_DISP0_DAT3__SDMA_DEBUG_BUS_ERROR 0x06c 0x398 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT3__EMI_EMI_DEBUG_8 0x06c 0x398 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT3__USBPHY2_RXERROR 0x06c 0x398 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT4__IPU_DISP0_DAT_4 0x070 0x39c 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT4__GPIO4_25 0x070 0x39c 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT4__CSPI_SS1 0x070 0x39c 0x790 0x2 0x0 +#define MX53_PAD_DISP0_DAT4__USBOH3_USBH2_DATA_4 0x070 0x39c 0x000 0x3 0x0 +#define MX53_PAD_DISP0_DAT4__SDMA_DEBUG_BUS_RWB 0x070 0x39c 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT4__EMI_EMI_DEBUG_9 0x070 0x39c 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT4__USBPHY2_SIECLOCK 0x070 0x39c 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT5__IPU_DISP0_DAT_5 0x074 0x3a0 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT5__GPIO4_26 0x074 0x3a0 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT5__CSPI_SS2 0x074 0x3a0 0x794 0x2 0x0 +#define MX53_PAD_DISP0_DAT5__USBOH3_USBH2_DATA_5 0x074 0x3a0 0x000 0x3 0x0 +#define MX53_PAD_DISP0_DAT5__SDMA_DEBUG_MATCHED_DMBUS 0x074 0x3a0 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT5__EMI_EMI_DEBUG_10 0x074 0x3a0 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT5__USBPHY2_LINESTATE_0 0x074 0x3a0 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT6__IPU_DISP0_DAT_6 0x078 0x3a4 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT6__GPIO4_27 0x078 0x3a4 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT6__CSPI_SS3 0x078 0x3a4 0x798 0x2 0x0 +#define MX53_PAD_DISP0_DAT6__USBOH3_USBH2_DATA_6 0x078 0x3a4 0x000 0x3 0x0 +#define MX53_PAD_DISP0_DAT6__SDMA_DEBUG_RTBUFFER_WRITE 0x078 0x3a4 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT6__EMI_EMI_DEBUG_11 0x078 0x3a4 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT6__USBPHY2_LINESTATE_1 0x078 0x3a4 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT7__IPU_DISP0_DAT_7 0x07c 0x3a8 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT7__GPIO4_28 0x07c 0x3a8 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT7__CSPI_RDY 0x07c 0x3a8 0x000 0x2 0x0 +#define MX53_PAD_DISP0_DAT7__USBOH3_USBH2_DATA_7 0x07c 0x3a8 0x000 0x3 0x0 +#define MX53_PAD_DISP0_DAT7__SDMA_DEBUG_EVENT_CHANNEL_0 0x07c 0x3a8 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT7__EMI_EMI_DEBUG_12 0x07c 0x3a8 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT7__USBPHY2_VBUSVALID 0x07c 0x3a8 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT8__IPU_DISP0_DAT_8 0x080 0x3ac 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT8__GPIO4_29 0x080 0x3ac 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT8__PWM1_PWMO 0x080 0x3ac 0x000 0x2 0x0 +#define MX53_PAD_DISP0_DAT8__WDOG1_WDOG_B 0x080 0x3ac 0x000 0x3 0x0 +#define MX53_PAD_DISP0_DAT8__SDMA_DEBUG_EVENT_CHANNEL_1 0x080 0x3ac 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT8__EMI_EMI_DEBUG_13 0x080 0x3ac 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT8__USBPHY2_AVALID 0x080 0x3ac 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT9__IPU_DISP0_DAT_9 0x084 0x3b0 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT9__GPIO4_30 0x084 0x3b0 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT9__PWM2_PWMO 0x084 0x3b0 0x000 0x2 0x0 +#define MX53_PAD_DISP0_DAT9__WDOG2_WDOG_B 0x084 0x3b0 0x000 0x3 0x0 +#define MX53_PAD_DISP0_DAT9__SDMA_DEBUG_EVENT_CHANNEL_2 0x084 0x3b0 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT9__EMI_EMI_DEBUG_14 0x084 0x3b0 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT9__USBPHY2_VSTATUS_0 0x084 0x3b0 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT10__IPU_DISP0_DAT_10 0x088 0x3b4 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT10__GPIO4_31 0x088 0x3b4 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT10__USBOH3_USBH2_STP 0x088 0x3b4 0x000 0x2 0x0 +#define MX53_PAD_DISP0_DAT10__SDMA_DEBUG_EVENT_CHANNEL_3 0x088 0x3b4 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT10__EMI_EMI_DEBUG_15 0x088 0x3b4 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT10__USBPHY2_VSTATUS_1 0x088 0x3b4 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT11__IPU_DISP0_DAT_11 0x08c 0x3b8 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT11__GPIO5_5 0x08c 0x3b8 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT11__USBOH3_USBH2_NXT 0x08c 0x3b8 0x000 0x2 0x0 +#define MX53_PAD_DISP0_DAT11__SDMA_DEBUG_EVENT_CHANNEL_4 0x08c 0x3b8 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT11__EMI_EMI_DEBUG_16 0x08c 0x3b8 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT11__USBPHY2_VSTATUS_2 0x08c 0x3b8 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT12__IPU_DISP0_DAT_12 0x090 0x3bc 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT12__GPIO5_6 0x090 0x3bc 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT12__USBOH3_USBH2_CLK 0x090 0x3bc 0x000 0x2 0x0 +#define MX53_PAD_DISP0_DAT12__SDMA_DEBUG_EVENT_CHANNEL_5 0x090 0x3bc 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT12__EMI_EMI_DEBUG_17 0x090 0x3bc 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT12__USBPHY2_VSTATUS_3 0x090 0x3bc 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT13__IPU_DISP0_DAT_13 0x094 0x3c0 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT13__GPIO5_7 0x094 0x3c0 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT13__AUDMUX_AUD5_RXFS 0x094 0x3c0 0x754 0x3 0x0 +#define MX53_PAD_DISP0_DAT13__SDMA_DEBUG_EVT_CHN_LINES_0 0x094 0x3c0 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT13__EMI_EMI_DEBUG_18 0x094 0x3c0 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT13__USBPHY2_VSTATUS_4 0x094 0x3c0 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT14__IPU_DISP0_DAT_14 0x098 0x3c4 0x000 0x0 0x0 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 00:47:56 2014 Return-Path: Delivered-To: svn-src-all@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 C7612A71; Mon, 27 Oct 2014 00:47: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 B2D9DCDE; Mon, 27 Oct 2014 00:47: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 s9R0luXr028160; Mon, 27 Oct 2014 00:47:56 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9R0lu9F028157; Mon, 27 Oct 2014 00:47:56 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410270047.s9R0lu9F028157@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 27 Oct 2014 00:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273715 - in stable/10: . sys/conf sys/tools/fdt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 00:47:57 -0000 Author: ian Date: Mon Oct 27 00:47:55 2014 New Revision: 273715 URL: https://svnweb.freebsd.org/changeset/base/273715 Log: MFC r262626, r262626, r264979, r265154, r265162, r265163, r267319, r270863, r270991, r271045: Enhancements related to compiling FDT data... - Use proper include path for dtc as well as cpp. - Call cpp with -P to avoid printing line markings. - Allow FDT_DTS_FILE to be a list, either in the makedtb target, or in a kernel config file. - Add the dts include directory to the -I list when doing arm builds. - Invoke make_dtb with MACHINE defined for cross building friendliness. - Allow the make_dtb script to work outside of a "make buildkernel" context by setting MACHINE from uname -m if it's not set already. - Use sh -c '...' to launch the dtb build scripts with env prepended, otherwise it tries to treat the env var stuff as a script file name. Modified: stable/10/Makefile.inc1 stable/10/sys/conf/files stable/10/sys/tools/fdt/make_dtb.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Sun Oct 26 23:45:33 2014 (r273714) +++ stable/10/Makefile.inc1 Mon Oct 27 00:47:55 2014 (r273715) @@ -1871,23 +1871,9 @@ DTBOUTPUTPATH= ${.CURDIR} # Build 'standalone' Device Tree Blob # builddtb: - @if [ "${FDT_DTS_FILE}" = "" ]; then \ - echo "ERROR: FDT_DTS_FILE must be specified!"; \ - exit 1; \ - fi; \ - if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${MACHINE}/${FDT_DTS_FILE} ]; then \ - echo "ERROR: Specified DTS file (${FDT_DTS_FILE}) does not \ - exist!"; \ - exit 1; \ - fi; \ - if [ "${DTBOUTPUTPATH}" = "${.CURDIR}" ]; then \ - echo "WARNING: DTB will be placed in the current working \ - directory"; \ - fi - @PATH=${TMPPATH} \ + @PATH=${TMPPATH} MACHINE=${TARGET} \ ${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \ - ${FDT_DTS_FILE} \ - ${DTBOUTPUTPATH}/`basename ${FDT_DTS_FILE} .dts` + "${FDT_DTS_FILE}" ${DTBOUTPUTPATH} ############### Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Sun Oct 26 23:45:33 2014 (r273714) +++ stable/10/sys/conf/files Mon Oct 27 00:47:55 2014 (r273715) @@ -14,11 +14,11 @@ acpi_quirks.h optional acpi \ # from the specified source (DTS) file: .dts -> .dtb # fdt_dtb_file optional fdt fdt_dtb_static \ - compile-with "sh $S/tools/fdt/make_dtb.sh $S ${FDT_DTS_FILE} ${.CURDIR}/${FDT_DTS_FILE:R}.dtb" \ + compile-with "sh -c 'MACHINE=${MACHINE} $S/tools/fdt/make_dtb.sh $S ${FDT_DTS_FILE} ${.CURDIR}'" \ no-obj no-implicit-rule before-depend \ clean "${FDT_DTS_FILE:R}.dtb" fdt_static_dtb.h optional fdt fdt_dtb_static \ - compile-with "sh $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ${.CURDIR}" \ + compile-with "sh -c 'MACHINE=${MACHINE} $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ${.CURDIR}'" \ dependency "fdt_dtb_file" \ no-obj no-implicit-rule before-depend \ clean "fdt_static_dtb.h" Modified: stable/10/sys/tools/fdt/make_dtb.sh ============================================================================== --- stable/10/sys/tools/fdt/make_dtb.sh Sun Oct 26 23:45:33 2014 (r273714) +++ stable/10/sys/tools/fdt/make_dtb.sh Mon Oct 27 00:47:55 2014 (r273715) @@ -4,8 +4,21 @@ # Script generates dtb file ($3) from dts source ($2) in build tree S ($1) S=$1 -dts=$2 -dtb=$3 +dts="$2" +dtb_path=$3 -cpp -x assembler-with-cpp -I $S/gnu/dts/include -I $S/boot/fdt/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $dts /dev/null | +if [ -z "$dts" ]; then + echo "No DTS specified" + exit 1 +fi + +if [ -z "${MACHINE}" ]; then + MACHINE=$(uname -m) +fi + +for d in ${dts}; do + dtb=${dtb_path}/`basename $d .dts`.dtb + echo "converting $d -> $dtb" + cpp -P -x assembler-with-cpp -I $S/gnu/dts/include -I $S/boot/fdt/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $d /dev/null | dtc -O dtb -o $dtb -b 0 -p 1024 -i $S/boot/fdt/dts/${MACHINE} -i $S/gnu/dts/${MACHINE} +done From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 01:10:41 2014 Return-Path: Delivered-To: svn-src-all@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 BA28AEB3; Mon, 27 Oct 2014 01:10: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 A65C6EA1; Mon, 27 Oct 2014 01:10: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 s9R1AfSY038667; Mon, 27 Oct 2014 01:10:41 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9R1AfHX038666; Mon, 27 Oct 2014 01:10:41 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201410270110.s9R1AfHX038666@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 27 Oct 2014 01:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273716 - head/sys/sparc64/sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 01:10:41 -0000 Author: alc Date: Mon Oct 27 01:10:40 2014 New Revision: 273716 URL: https://svnweb.freebsd.org/changeset/base/273716 Log: Simplify memrw(). MFC after: 10 days Modified: head/sys/sparc64/sparc64/mem.c Modified: head/sys/sparc64/sparc64/mem.c ============================================================================== --- head/sys/sparc64/sparc64/mem.c Mon Oct 27 00:47:55 2014 (r273715) +++ head/sys/sparc64/sparc64/mem.c Mon Oct 27 01:10:40 2014 (r273716) @@ -65,13 +65,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include -#include #include #include @@ -92,7 +92,6 @@ memrw(struct cdev *dev, struct uio *uio, vm_size_t cnt; vm_page_t m; int error; - int i; uint32_t colors; cnt = 0; @@ -124,15 +123,7 @@ memrw(struct cdev *dev, struct uio *uio, cnt = ulmin(cnt, PAGE_SIZE - off); cnt = ulmin(cnt, iov->iov_len); - m = NULL; - for (i = 0; phys_avail[i] != 0; i += 2) { - if (pa >= phys_avail[i] && - pa < phys_avail[i + 1]) { - m = PHYS_TO_VM_PAGE(pa); - break; - } - } - + m = vm_phys_paddr_to_vm_page(pa); if (m != NULL) { if (ova == 0) { if (dcache_color_ignore == 0) From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 02:51:08 2014 Return-Path: Delivered-To: svn-src-all@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 9198AA17; Mon, 27 Oct 2014 02:51:08 +0000 (UTC) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 5627DA41; Mon, 27 Oct 2014 02:51:08 +0000 (UTC) Received: from lgwl-lstewart2.corp.netflix.com (c110-22-7-57.eburwd3.vic.optusnet.com.au [110.22.7.57]) by lauren.room52.net (Postfix) with ESMTPSA id A713B7E824; Mon, 27 Oct 2014 13:43:32 +1100 (EST) Message-ID: <544DB140.7070807@freebsd.org> Date: Mon, 27 Oct 2014 13:43:12 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Hiroki Sato , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r272386 - in head: sbin/ifconfig share/man/man4 sys/net References: <201410012137.s91LbXL4025967@svn.freebsd.org> In-Reply-To: <201410012137.s91LbXL4025967@svn.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 02:51:08 -0000 Hi Hiroki-san, On 10/02/14 07:37, Hiroki Sato wrote: > Author: hrs > Date: Wed Oct 1 21:37:32 2014 > New Revision: 272386 > URL: https://svnweb.freebsd.org/changeset/base/272386 > > Log: > Virtualize lagg(4) cloner. This change fixes a panic when tearing down > if_lagg(4) interfaces which were cloned in a vnet jail. > > Sysctl nodes which are dynamically generated for each cloned interface > (net.link.lagg.N.*) have been removed, and use_flowid and flowid_shift > ifconfig(8) parameters have been added instead. Flags and per-interface > statistics counters are displayed in "ifconfig -v". > > CR: D842 > > Modified: > head/sbin/ifconfig/ifconfig.8 > head/sbin/ifconfig/iflagg.c > head/share/man/man4/lagg.4 > head/sys/net/ieee8023ad_lacp.c > head/sys/net/if_lagg.c > head/sys/net/if_lagg.h What was the reasoning for removing the net.link.lagg.* sysctls? We use them at Netflix and the new way of obtaining the information via ifconfig -v is less structured and significantly higher overhead by comparison. Would be good to have the sysctls back or an equivalent low overhead way of obtaining the previously available information. Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 04:09:24 2014 Return-Path: Delivered-To: svn-src-all@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 E18E33F9; Mon, 27 Oct 2014 04:09:24 +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 CD95F1A3; Mon, 27 Oct 2014 04:09: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 s9R49OaD023320; Mon, 27 Oct 2014 04:09:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9R49Ola023318; Mon, 27 Oct 2014 04:09:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201410270409.s9R49Ola023318@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 27 Oct 2014 04:09:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273717 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 04:09:25 -0000 Author: markj Date: Mon Oct 27 04:09:23 2014 New Revision: 273717 URL: https://svnweb.freebsd.org/changeset/base/273717 Log: getgrouplist(3) was reimplemented in terms of getgrent_r(3) in r174547, so this bug is no longer valid. MFC after: 3 days Modified: head/lib/libc/gen/getgrouplist.3 head/lib/libc/gen/initgroups.3 Modified: head/lib/libc/gen/getgrouplist.3 ============================================================================== --- head/lib/libc/gen/getgrouplist.3 Mon Oct 27 01:10:40 2014 (r273716) +++ head/lib/libc/gen/getgrouplist.3 Mon Oct 27 04:09:23 2014 (r273717) @@ -28,7 +28,7 @@ .\" @(#)getgrouplist.3 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd February 20, 2012 +.Dd October 26, 2014 .Dt GETGROUPLIST 3 .Os .Sh NAME @@ -80,13 +80,3 @@ The .Fn getgrouplist function first appeared in .Bx 4.4 . -.Sh BUGS -The -.Fn getgrouplist -function -uses the routines based on -.Xr getgrent 3 . -If the invoking program uses any of these routines, -the group structure will -be overwritten in the call to -.Fn getgrouplist . Modified: head/lib/libc/gen/initgroups.3 ============================================================================== --- head/lib/libc/gen/initgroups.3 Mon Oct 27 01:10:40 2014 (r273716) +++ head/lib/libc/gen/initgroups.3 Mon Oct 27 04:09:23 2014 (r273717) @@ -28,7 +28,7 @@ .\" @(#)initgroups.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd October 26, 2014 .Dt INITGROUPS 3 .Os .Sh NAME @@ -80,14 +80,3 @@ The .Fn initgroups function appeared in .Bx 4.2 . -.Sh BUGS -The -.Fn getgrouplist -function called by -.Fn initgroups -uses the routines based on -.Xr getgrent 3 . -If the invoking program uses any of these routines, -the group structure will -be overwritten in the call to -.Fn initgroups . From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 05:50:03 2014 Return-Path: Delivered-To: svn-src-all@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 8FCF3E92; Mon, 27 Oct 2014 05:50: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 7AD81C36; Mon, 27 Oct 2014 05:50: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 s9R5o32j068996; Mon, 27 Oct 2014 05:50:03 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9R5o2J1068989; Mon, 27 Oct 2014 05:50:02 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201410270550.s9R5o2J1068989@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Mon, 27 Oct 2014 05:50:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273718 - head/contrib/tzdata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 05:50:03 -0000 Author: edwin Date: Mon Oct 27 05:50:02 2014 New Revision: 273718 URL: https://svnweb.freebsd.org/changeset/base/273718 Log: Merge of 273518, tzdata2014i Upgrade to 2014i Lots of historical data Pacific/Fiji will go into DST from 2014-11-02 to 2015-01-18 Pacific/Bougainville will go from UTC+10 to UTC+11. Europe/Minsk will go from FET to MSK. Modified: head/contrib/tzdata/africa head/contrib/tzdata/antarctica head/contrib/tzdata/asia head/contrib/tzdata/australasia head/contrib/tzdata/backward head/contrib/tzdata/europe head/contrib/tzdata/northamerica head/contrib/tzdata/southamerica head/contrib/tzdata/zone.tab head/contrib/tzdata/zone1970.tab Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/africa ============================================================================== --- head/contrib/tzdata/africa Mon Oct 27 04:09:23 2014 (r273717) +++ head/contrib/tzdata/africa Mon Oct 27 05:50:02 2014 (r273718) @@ -1,9 +1,10 @@ # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. -# This data is by no means authoritative; if you think you know better, +# This file is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@iana.org for general use in the future). +# tz@iana.org for general use in the future). For more, please see +# the file CONTRIBUTING in the tz distribution. # From Paul Eggert (2013-02-21): # @@ -25,8 +26,8 @@ # I found in the UCLA library. # # For data circa 1899, a common source is: -# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 -# . +# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94. +# http://www.jstor.org/stable/1774359 # # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). @@ -93,9 +94,9 @@ Rule Algeria 1980 only - Oct 31 2:00 0 # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's # more precise 0:09:21. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 15 0:01 - 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time - 0:00 Algeria WE%sT 1940 Feb 25 2:00 +Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 15 0:01 + 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time + 0:00 Algeria WE%sT 1940 Feb 25 2:00 1:00 Algeria CE%sT 1946 Oct 7 0:00 - WET 1956 Jan 29 1:00 - CET 1963 Apr 14 @@ -105,82 +106,57 @@ Zone Africa/Algiers 0:12:12 - LMT 1891 M 1:00 - CET # Angola -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Luanda 0:52:56 - LMT 1892 - 0:52:04 - AOT 1911 May 26 # Angola Time - 1:00 - WAT - # Benin -# Whitman says they switched to 1:00 in 1946, not 1934; -# go with Shanks & Pottenger. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Porto-Novo 0:10:28 - LMT 1912 - 0:00 - GMT 1934 Feb 26 - 1:00 - WAT +# See Africa/Lagos. # Botswana -# From Paul Eggert (2013-02-21): -# Milne says they were regulated by the Cape Town Signal in 1899; -# assume they switched to 2:00 when Cape Town did. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Gaborone 1:43:40 - LMT 1885 - 1:30 - SAST 1903 Mar - 2:00 - CAT 1943 Sep 19 2:00 - 2:00 1:00 CAST 1944 Mar 19 2:00 - 2:00 - CAT +# See Africa/Maputo. # Burkina Faso # See Africa/Abidjan. # Burundi -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Bujumbura 1:57:28 - LMT 1890 - 2:00 - CAT +# See Africa/Maputo. # Cameroon -# Whitman says they switched to 1:00 in 1920; go with Shanks & Pottenger. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Douala 0:38:48 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. # Cape Verde +# +# Shanks gives 1907 for the transition to CVT. +# Perhaps the 1911-05-26 Portuguese decree +# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# merely made it official? +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Atlantic/Cape_Verde -1:34:04 - LMT 1907 # Praia +Zone Atlantic/Cape_Verde -1:34:04 - LMT 1907 # Praia -2:00 - CVT 1942 Sep -2:00 1:00 CVST 1945 Oct 15 - -2:00 - CVT 1975 Nov 25 2:00 + -2:00 - CVT 1975 Nov 25 2:00 -1:00 - CVT # Central African Republic -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Bangui 1:14:20 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. # Chad # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena +Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena 1:00 - WAT 1979 Oct 14 1:00 1:00 WAST 1980 Mar 8 1:00 - WAT # Comoros # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Comoro 2:53:04 - LMT 1911 Jul # Moroni, Gran Comoro +Zone Indian/Comoro 2:53:04 - LMT 1911 Jul # Moroni, Gran Comoro 3:00 - EAT -# Democratic Republic of Congo -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Kinshasa 1:01:12 - LMT 1897 Nov 9 - 1:00 - WAT -Zone Africa/Lubumbashi 1:49:52 - LMT 1897 Nov 9 - 2:00 - CAT +# Democratic Republic of the Congo +# See Africa/Lagos for the western part and Africa/Maputo for the eastern. # Republic of the Congo -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Brazzaville 1:01:08 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. -# Côte D'Ivoire / Ivory Coast +# Côte d'Ivoire / Ivory Coast # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Abidjan -0:16:08 - LMT 1912 0:00 - GMT @@ -327,7 +303,7 @@ Rule Egypt 2007 only - Sep Thu>=1 24:00 # Egypt is to change back to Daylight system on May 15 # http://english.ahram.org.eg/NewsContent/1/64/100735/Egypt/Politics-/Egypts-government-to-reapply-daylight-saving-time-.aspx -# From Gunther Vermier (2015-05-13): +# From Gunther Vermier (2014-05-13): # our Egypt office confirms that the change will be at 15 May "midnight" (24:00) # From Imed Chihi (2014-06-04): @@ -408,16 +384,13 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct 2:00 Egypt EE%sT # Equatorial Guinea -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Malabo 0:35:08 - LMT 1912 - 0:00 - GMT 1963 Dec 15 - 1:00 - WAT +# See Africa/Lagos. # Eritrea # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Asmara 2:35:32 - LMT 1870 - 2:35:32 - AMT 1890 # Asmara Mean Time - 2:35:20 - ADMT 1936 May 5 # Adis Dera MT + 2:35:32 - AMT 1890 # Asmara Mean Time + 2:35:20 - ADMT 1936 May 5 # Adis Dera MT 3:00 - EAT # Ethiopia @@ -429,16 +402,15 @@ Zone Africa/Asmara 2:35:32 - LMT 1870 # Shanks & Pottenger write that Ethiopia had six narrowly-spaced time # zones between 1870 and 1890, that they merged to 38E50 (2:35:20) in # 1890, and that they switched to 3:00 on 1936-05-05. Perhaps 38E50 -# was for Adis Dera. Quite likely the Shanks data are wrong anyway. +# was for Adis Dera. Quite likely the Shanks data entries are wrong +# anyway. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Addis_Ababa 2:34:48 - LMT 1870 - 2:35:20 - ADMT 1936 May 5 # Adis Dera MT + 2:35:20 - ADMT 1936 May 5 # Adis Dera MT 3:00 - EAT # Gabon -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Libreville 0:37:48 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. # Gambia # See Africa/Abidjan. @@ -461,8 +433,14 @@ Zone Africa/Accra -0:00:52 - LMT 1918 # See Africa/Abidjan. # Guinea-Bissau +# +# Shanks gives 1911-05-26 for the transition to WAT, +# evidently confusing the date of the Portuguese decree +# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# with the date that it took effect, namely 1912-01-01. +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Bissau -1:02:20 - LMT 1911 May 26 +Zone Africa/Bissau -1:02:20 - LMT 1912 Jan 1 -1:00 - WAT 1975 0:00 - GMT @@ -475,11 +453,7 @@ Zone Africa/Nairobi 2:27:16 - LMT 1928 J 3:00 - EAT # Lesotho -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Maseru 1:50:00 - LMT 1903 Mar - 2:00 - SAST 1943 Sep 19 2:00 - 2:00 1:00 SAST 1944 Mar 19 2:00 - 2:00 - SAST +# See Africa/Johannesburg. # Liberia # From Paul Eggert (2006-03-22): @@ -546,11 +520,11 @@ Zone Africa/Tripoli 0:52:44 - LMT 1920 2:00 - EET 1982 1:00 Libya CE%sT 1990 May 4 # The 1996 and 1997 entries are from Shanks & Pottenger; -# the IATA SSIM data contain some obvious errors. +# the IATA SSIM data entries contain some obvious errors. 2:00 - EET 1996 Sep 30 1:00 Libya CE%sT 1997 Oct 4 - 2:00 - EET 2012 Nov 10 2:00 - 1:00 Libya CE%sT 2013 Oct 25 2:00 + 2:00 - EET 2012 Nov 10 2:00 + 1:00 Libya CE%sT 2013 Oct 25 2:00 2:00 - EET # Madagascar @@ -561,9 +535,7 @@ Zone Indian/Antananarivo 3:10:04 - LMT 1 3:00 - EAT # Malawi -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Blantyre 2:20:00 - LMT 1903 Mar - 2:00 - CAT +# See Africa/Maputo. # Mali # Mauritania @@ -606,7 +578,7 @@ Zone Africa/Blantyre 2:20:00 - LMT 1903 # From Alex Krivenyshev (2008-07-11): # Seems that English language article "The revival of daylight saving -# time: Energy conservation?"-# No. 16578 (07/11/2008) was originally +# time: Energy conservation?"-# No. 16578 (07/11/2008) was originally # published on Monday, June 30, 2008... # # I guess that article in French "Le gouvernement avance l'introduction @@ -657,14 +629,14 @@ Rule Mauritius 1983 only - Mar 21 0:00 0 Rule Mauritius 2008 only - Oct lastSun 2:00 1:00 S Rule Mauritius 2009 only - Mar lastSun 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis +Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis 4:00 Mauritius MU%sT # Mauritius Time # Agalega Is, Rodriguez # no information; probably like Indian/Mauritius # Mayotte # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou +Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou 3:00 - EAT # Morocco @@ -682,7 +654,8 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # http://en.afrik.com/news11892.html # From Alex Krivenyshev (2008-05-09): -# The Morocco time change can be confirmed on Morocco web site Maghreb Arabe Presse: +# The Morocco time change can be confirmed on Morocco web site Maghreb Arabe +# Presse: # http://www.map.ma/eng/sections/box3/morocco_shifts_to_da/view # # Morocco shifts to daylight time on June 1st through September 27, Govt. @@ -760,8 +733,8 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # From Dan Abitol (2011-03-30): # ...Rules for Africa/Casablanca are the following (24h format) -# The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00 -# The 31th july 2011 at 00:59:59, [it] will be 31th July 00:00:00 +# The 3rd April 2011 at 00:00:00, [it] will be 3rd April 01:00:00 +# The 31st July 2011 at 00:59:59, [it] will be 31st July 00:00:00 # ...Official links of change in morocco # The change was broadcast on the FM Radio # I ve called ANRT (telecom regulations in Morocco) at @@ -831,7 +804,7 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # announced a bit in advance. On 2012-07-11 the Moroccan government # announced that year's Ramadan daylight-saving transitions would be # 2012-07-20 and 2012-08-20; see -# . +# http://www.mmsp.gov.ma/fr/actualites.aspx?id=288 # From Andrew Paprocki (2013-07-02): # Morocco announced that the year's Ramadan daylight-savings @@ -963,16 +936,29 @@ Zone Africa/El_Aaiun -0:52:48 - LMT 1934 0:00 Morocco WE%sT # Mozambique +# +# Shanks gives 1903-03-01 for the transition to CAT. +# Perhaps the 1911-05-26 Portuguese decree +# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# merely made it official? +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Maputo 2:10:20 - LMT 1903 Mar 2:00 - CAT +Link Africa/Maputo Africa/Blantyre # Malawi +Link Africa/Maputo Africa/Bujumbura # Burundi +Link Africa/Maputo Africa/Gaborone # Botswana +Link Africa/Maputo Africa/Harare # Zimbabwe +Link Africa/Maputo Africa/Kigali # Rwanda +Link Africa/Maputo Africa/Lubumbashi # E Dem. Rep. of Congo +Link Africa/Maputo Africa/Lusaka # Zambia # Namibia # The 1994-04-03 transition is from Shanks & Pottenger. # Shanks & Pottenger report no DST after 1998-04; go with IATA. -# From Petronella Sibeene (2007-03-30) in -# : +# From Petronella Sibeene (2007-03-30): +# http://allafrica.com/stories/200703300178.html # While the entire country changes its time, Katima Mulilo and other # settlements in Caprivi unofficially will not because the sun there # rises and sets earlier compared to other regions. Chief of @@ -989,28 +975,33 @@ Rule Namibia 1994 max - Sep Sun>=1 2:00 Rule Namibia 1995 max - Apr Sun>=1 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Windhoek 1:08:24 - LMT 1892 Feb 8 - 1:30 - SWAT 1903 Mar # SW Africa Time - 2:00 - SAST 1942 Sep 20 2:00 - 2:00 1:00 SAST 1943 Mar 21 2:00 + 1:30 - SWAT 1903 Mar # SW Africa Time + 2:00 - SAST 1942 Sep 20 2:00 + 2:00 1:00 SAST 1943 Mar 21 2:00 2:00 - SAST 1990 Mar 21 # independence 2:00 - CAT 1994 Apr 3 1:00 Namibia WA%sT # Niger -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Niamey 0:08:28 - LMT 1912 - -1:00 - WAT 1934 Feb 26 - 0:00 - GMT 1960 - 1:00 - WAT +# See Africa/Lagos. # Nigeria # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Lagos 0:13:36 - LMT 1919 Sep 1:00 - WAT +Link Africa/Lagos Africa/Bangui # Central African Republic +Link Africa/Lagos Africa/Brazzaville # Rep. of the Congo +Link Africa/Lagos Africa/Douala # Cameroon +Link Africa/Lagos Africa/Kinshasa # Dem. Rep. of the Congo (west) +Link Africa/Lagos Africa/Libreville # Gabon +Link Africa/Lagos Africa/Luanda # Angola +Link Africa/Lagos Africa/Malabo # Equatorial Guinea +Link Africa/Lagos Africa/Niamey # Niger +Link Africa/Lagos Africa/Porto-Novo # Benin # Réunion # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Denis +Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Denis 4:00 - RET # Réunion Time # # Crozet Islands also observes Réunion time; see the 'antarctica' file. @@ -1028,9 +1019,7 @@ Zone Indian/Reunion 3:41:52 - LMT 1911 J # Tromelin - inhabited until at least 1958 # Rwanda -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Kigali 2:00:16 - LMT 1935 Jun - 2:00 - CAT +# See Africa/Maputo. # St Helena # See Africa/Abidjan. @@ -1047,7 +1036,7 @@ Zone Africa/Kigali 2:00:16 - LMT 1935 Ju # Seychelles # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria +Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria 4:00 - SCT # Seychelles Time # From Paul Eggert (2001-05-30): # Aldabra, Farquhar, and Desroches, originally dependencies of the @@ -1074,6 +1063,9 @@ Rule SA 1943 1944 - Mar Sun>=15 2:00 0 - Zone Africa/Johannesburg 1:52:00 - LMT 1892 Feb 8 1:30 - SAST 1903 Mar 2:00 SA SAST +Link Africa/Johannesburg Africa/Maseru # Lesotho +Link Africa/Johannesburg Africa/Mbabane # Swaziland +# # Marion and Prince Edward Is # scientific station since 1947 # no information @@ -1101,9 +1093,7 @@ Zone Africa/Khartoum 2:10:08 - LMT 1931 Link Africa/Khartoum Africa/Juba # Swaziland -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Mbabane 2:04:24 - LMT 1903 Mar - 2:00 - SAST +# See Africa/Johannesburg. # Tanzania # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1128,7 +1118,7 @@ Zone Africa/Dar_es_Salaam 2:37:08 - LMT # # From Oscar van Vlijmen (2005-05-02): # La Presse, the first national daily newspaper ... -# +# http://www.lapresse.tn/archives/archives280405/actualites/lheure.html # ... DST for 2005: on: Sun May 1 0h standard time, off: Fri Sept. 30, # 1h standard time. # @@ -1212,7 +1202,7 @@ Rule Tunisia 2006 2008 - Oct lastSun 2: # Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Tunis 0:40:44 - LMT 1881 May 12 - 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time + 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time 1:00 Tunisia CE%sT # Uganda @@ -1224,11 +1214,5 @@ Zone Africa/Kampala 2:09:40 - LMT 1928 J 3:00 - EAT # Zambia -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Lusaka 1:53:08 - LMT 1903 Mar - 2:00 - CAT - # Zimbabwe -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Harare 2:04:12 - LMT 1903 Mar - 2:00 - CAT +# See Africa/Maputo. Modified: head/contrib/tzdata/antarctica ============================================================================== --- head/contrib/tzdata/antarctica Mon Oct 27 04:09:23 2014 (r273717) +++ head/contrib/tzdata/antarctica Mon Oct 27 05:50:02 2014 (r273718) @@ -4,10 +4,10 @@ # From Paul Eggert (1999-11-15): # To keep things manageable, we list only locations occupied year-round; see # COMNAP - Stations and Bases -# +# http://www.comnap.aq/comnap/comnap.nsf/P/Stations/ # and # Summary of the Peri-Antarctic Islands (1998-07-23) -# +# http://www.spri.cam.ac.uk/bob/periant.htm # for information. # Unless otherwise specified, we have no time zone information. # @@ -63,7 +63,7 @@ Rule ChileAQ 2012 max - Sep Sun>=2 4:00u # Heard Island, McDonald Islands (uninhabited) # previously sealers and scientific personnel wintered # Margaret Turner reports -# +# http://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html # (1999-09-30) that they're UTC+5, with no DST; # presumably this is when they have visitors. # @@ -103,32 +103,30 @@ Rule ChileAQ 2012 max - Sep Sun>=2 4:00u # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Antarctica/Casey 0 - zzz 1969 - 8:00 - AWST 2009 Oct 18 2:00 + 8:00 - AWST 2009 Oct 18 2:00 # Australian Western Std Time - 11:00 - CAST 2010 Mar 5 2:00 - # Casey Time - 8:00 - AWST 2011 Oct 28 2:00 + 11:00 - CAST 2010 Mar 5 2:00 # Casey Time + 8:00 - AWST 2011 Oct 28 2:00 11:00 - CAST 2012 Feb 21 17:00u 8:00 - AWST Zone Antarctica/Davis 0 - zzz 1957 Jan 13 - 7:00 - DAVT 1964 Nov # Davis Time + 7:00 - DAVT 1964 Nov # Davis Time 0 - zzz 1969 Feb - 7:00 - DAVT 2009 Oct 18 2:00 + 7:00 - DAVT 2009 Oct 18 2:00 5:00 - DAVT 2010 Mar 10 20:00u - 7:00 - DAVT 2011 Oct 28 2:00 + 7:00 - DAVT 2011 Oct 28 2:00 5:00 - DAVT 2012 Feb 21 20:00u 7:00 - DAVT Zone Antarctica/Mawson 0 - zzz 1954 Feb 13 - 6:00 - MAWT 2009 Oct 18 2:00 - # Mawson Time + 6:00 - MAWT 2009 Oct 18 2:00 # Mawson Time 5:00 - MAWT # References: # Casey Weather (1998-02-26) -# +# http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html # Davis Station, Antarctica (1998-02-26) -# +# http://www.antdiv.gov.au/aad/exop/sfo/davis/video.html # Mawson Station, Antarctica (1998-02-25) -# +# http://www.antdiv.gov.au/aad/exop/sfo/mawson/video.html # Belgium - year-round base # Princess Elisabeth, Queen Maud Land, -713412+0231200, since 2007 @@ -154,7 +152,7 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb # France - year-round bases (also see "France & Italy") # # From Antoine Leca (1997-01-20): -# Time data are from Nicole Pailleau at the IFRTP +# Time data entries are from Nicole Pailleau at the IFRTP # (French Institute for Polar Research and Technology). # She confirms that French Southern Territories and Terre Adélie bases # don't observe daylight saving time, even if Terre Adélie supplies came @@ -174,7 +172,7 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb # fishing stations operated variously 1819/1931 # # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Kerguelen 0 - zzz 1950 # Port-aux-Français +Zone Indian/Kerguelen 0 - zzz 1950 # Port-aux-Français 5:00 - TFT # ISO code TF Time # # year-round base in the main continent @@ -217,7 +215,7 @@ Zone Antarctica/Syowa 0 - zzz 1957 Jan 2 3:00 - SYOT # Syowa Time # See: # NIPR Antarctic Research Activities (1999-08-17) -# +# http://www.nipr.ac.jp/english/ara01.html # S Korea - year-round base # Jang Bogo, Terra Nova Bay, -743700+1641205 since 2014 @@ -264,7 +262,7 @@ Rule Troll 2005 max - Mar lastSun 1:00u Rule Troll 2004 max - Oct lastSun 1:00u 0:00 UTC # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Antarctica/Troll 0 - zzz 2005 Feb 12 - 0:00 Troll %s + 0:00 Troll %s # Poland - year-round base # Arctowski, King George Island, -620945-0582745, since 1977 @@ -281,8 +279,8 @@ Zone Antarctica/Troll 0 - zzz 2005 Feb 1 # year-round from 1960/61 to 1992 # Vostok, since 1957-12-16, temporarily closed 1994-02/1994-11 -# From Craig Mundell (1994-12-15) -# : +# From Craig Mundell (1994-12-15): +# http://quest.arc.nasa.gov/antarctica/QA/computers/Directions,Time,ZIP # Vostok, which is one of the Russian stations, is set on the same # time as Moscow, Russia. # Modified: head/contrib/tzdata/asia ============================================================================== --- head/contrib/tzdata/asia Mon Oct 27 04:09:23 2014 (r273717) +++ head/contrib/tzdata/asia Mon Oct 27 05:50:02 2014 (r273718) @@ -1,9 +1,10 @@ # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. -# This data is by no means authoritative; if you think you know better, +# This file is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@iana.org for general use in the future). +# tz@iana.org for general use in the future). For more, please see +# the file CONTRIBUTING in the tz distribution. # From Paul Eggert (2013-08-11): # @@ -25,8 +26,12 @@ # I found in the UCLA library. # # For data circa 1899, a common source is: -# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 -# . +# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94. +# http://www.jstor.org/stable/1774359 +# +# For Russian data circa 1919, a source is: +# Byalokoz EL. New Counting of Time in Russia since July 1, 1919. +# (See the 'europe' file for a fuller citation.) # # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). @@ -42,10 +47,11 @@ # 3:30 IRST IRDT Iran # 4:00 GST Gulf* # 5:30 IST India -# 7:00 ICT Indochina* +# 7:00 ICT Indochina, most times and locations* # 7:00 WIB west Indonesia (Waktu Indonesia Barat) # 8:00 WITA central Indonesia (Waktu Indonesia Tengah) # 8:00 CST China +# 8:00 IDT Indochina, 1943-45, 1947-55, 1960-75 (some locations)* # 8:00 JWST Western Standard Time (Japan, 1896/1937)* # 9:00 JCST Central Standard Time (Japan, 1896/1937) # 9:00 WIT east Indonesia (Waktu Indonesia Timur) @@ -115,11 +121,11 @@ Zone Asia/Kabul 4:36:48 - LMT 1890 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2 3:00 - YERT 1957 Mar # Yerevan Time - 4:00 RussiaAsia YER%sT 1991 Mar 31 2:00s + 4:00 RussiaAsia YER%sT 1991 Mar 31 2:00s 3:00 1:00 YERST 1991 Sep 23 # independence - 3:00 RussiaAsia AM%sT 1995 Sep 24 2:00s + 3:00 RussiaAsia AM%sT 1995 Sep 24 2:00s 4:00 - AMT 1997 - 4:00 RussiaAsia AM%sT 2012 Mar 25 2:00s + 4:00 RussiaAsia AM%sT 2012 Mar 25 2:00s 4:00 - AMT # Azerbaijan @@ -132,16 +138,16 @@ Rule Azer 1997 max - Oct lastSun 5:00 0 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Baku 3:19:24 - LMT 1924 May 2 3:00 - BAKT 1957 Mar # Baku Time - 4:00 RussiaAsia BAK%sT 1991 Mar 31 2:00s + 4:00 RussiaAsia BAK%sT 1991 Mar 31 2:00s 3:00 1:00 BAKST 1991 Aug 30 # independence 3:00 RussiaAsia AZ%sT 1992 Sep lastSat 23:00 - 4:00 - AZT 1996 # Azerbaijan time + 4:00 - AZT 1996 # Azerbaijan Time 4:00 EUAsia AZ%sT 1997 4:00 Azer AZ%sT # Bahrain # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah +Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah 4:00 - GST 1972 Jun 3:00 - AST @@ -219,7 +225,7 @@ Zone Asia/Bahrain 3:22:20 - LMT 1920 # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Dhaka 2009 only - Jun 19 23:00 1:00 S -Rule Dhaka 2009 only - Dec 31 23:59 0 - +Rule Dhaka 2009 only - Dec 31 24:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Dhaka 6:01:40 - LMT 1890 @@ -250,7 +256,7 @@ Zone Indian/Chagos 4:49:40 - LMT 1907 # Brunei # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan +Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan 7:30 - BNT 1933 8:00 - BNT @@ -259,19 +265,15 @@ Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Milne says 6:24:40 was the meridian of the time ball observatory at Rangoon. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Rangoon 6:24:40 - LMT 1880 # or Yangon - 6:24:40 - RMT 1920 # Rangoon Mean Time? - 6:30 - BURT 1942 May # Burma Time - 9:00 - JST 1945 May 3 - 6:30 - MMT # Myanmar Time +Zone Asia/Rangoon 6:24:40 - LMT 1880 # or Yangon + 6:24:40 - RMT 1920 # Rangoon Mean Time? + 6:30 - BURT 1942 May # Burma Time + 9:00 - JST 1945 May 3 + 6:30 - MMT # Myanmar Time # Cambodia -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Phnom_Penh 6:59:40 - LMT 1906 Jun 9 - 7:06:20 - SMT 1911 Mar 11 0:01 # Saigon MT? - 7:00 - ICT 1912 May - 8:00 - ICT 1931 May - 7:00 - ICT +# See Asia/Bangkok. + # China @@ -356,8 +358,8 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1: # * The Republic of China instituted Beijing mean solar time effective # the official calendar book of 1914. # * The French Concession in Shanghai set up signal stations in -# French docks in the 1890s, controled by Xujiahui (Zikawei) -# Obervatory and set to local mean time. +# French docks in the 1890s, controlled by Xujiahui (Zikawei) +# Observatory and set to local mean time. # * "From the end of the 19th century" it changed to UT+8. # * Chinese Customs (by then reduced to a tool of foreign powers) # eventually standardized on this time for all ports, and it @@ -381,7 +383,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1: # Xujiahui Observatory was under French control and stuck with UT+8. # # In earlier versions of this file, China had many separate Zone entries, but -# this was based on what was apparently incorrect data in Shanks & Pottenger. +# this was based on what were apparently incorrect data in Shanks & Pottenger. # This has now been simplified to the two entries Asia/Shanghai and # Asia/Urumqi, with the others being links for backward compatibility. # Proposed in 1918 and theoretically in effect until 1949 (although in practice @@ -501,7 +503,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1: # "The Working-Calendar for The Xinjiang Uygur Autonomous Region Government" # (2014-04-22). # Unfortunately, we have no good records of time in Xinjiang before 1986. -# During the 20th century parts of Xinjiang were ruled by the Qing dyansty, +# During the 20th century parts of Xinjiang were ruled by the Qing dynasty, # the Republic of China, various warlords, the First and Second East Turkestan # Republics, the Soviet Union, the Kuomintang, and the People's Republic of # China, and tracking down all these organizations' timekeeping rules would be @@ -698,19 +700,19 @@ Zone Asia/Hong_Kong 7:36:42 - LMT 1904 O # Central Weather Bureau website was not correct. # # Original Bulletin: -# -# (cont.) +# http://subtpg.tpg.gov.tw/og/image2.asp?f=03502F0AKM1AF +# http://subtpg.tpg.gov.tw/og/image2.asp?f=0350300AKM1B0 (cont.) # # In 1947, DST in Taiwan was expanded to Oct 31. There is a backup of that # telegram announcement from Taiwan Province Government: # -# +# http://subtpg.tpg.gov.tw/og/image2.asp?f=0360310AKZ431 # # Here is a brief translation: # # The Summer Time this year is adopted from midnight Apr 15 until Sep 20 # midnight. To save (energy?) consumption, we're expanding Summer Time -# adption till Oct 31 midnight. +# adoption till Oct 31 midnight. # # The Central Weather Bureau website didn't mention that, however it can # be found from historical government announcement database. @@ -741,7 +743,7 @@ Rule Taiwan 1979 only - Oct 1 0:00 0 S # Taipei or Taibei or T'ai-pei Zone Asia/Taipei 8:06:00 - LMT 1896 Jan 1 8:00 - JWST 1937 Oct 1 - 9:00 - JST 1945 Sep 21 01:00 + 9:00 - JST 1945 Sep 21 1:00 8:00 Taiwan C%sT # Macau (Macao, Aomen) @@ -761,7 +763,7 @@ Rule Macau 1975 1977 - Apr Sun>=15 3:30 Rule Macau 1978 1980 - Apr Sun>=15 0:00 1:00 S Rule Macau 1978 1980 - Oct Sun>=15 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Macau 7:34:20 - LMT 1912 +Zone Asia/Macau 7:34:20 - LMT 1912 Jan 1 8:00 Macau MO%sT 1999 Dec 20 # return to China 8:00 PRC C%sT @@ -823,20 +825,22 @@ Link Asia/Nicosia Europe/Nicosia # I don't know what can be done, especially knowing that some years ago our # DST rules where changed THREE TIMES during one month. -# Milne says Tbilisi (Tiflis) time was 2:59:05.7; round to nearest.) +# Milne 1899 says Tbilisi (Tiflis) time was 2:59:05.7. +# Byalokoz 1919 says Georgia was 2:59:11. +# Go with Byalokoz. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Tbilisi 2:59:06 - LMT 1880 - 2:59:06 - TBMT 1924 May 2 # Tbilisi Mean Time +Zone Asia/Tbilisi 2:59:11 - LMT 1880 + 2:59:11 - TBMT 1924 May 2 # Tbilisi Mean Time 3:00 - TBIT 1957 Mar # Tbilisi Time - 4:00 RussiaAsia TBI%sT 1991 Mar 31 2:00s + 4:00 RussiaAsia TBI%sT 1991 Mar 31 2:00s 3:00 1:00 TBIST 1991 Apr 9 # independence - 3:00 RussiaAsia GE%sT 1992 # Georgia Time + 3:00 RussiaAsia GE%sT 1992 # Georgia Time 3:00 E-EurAsia GE%sT 1994 Sep lastSun 4:00 E-EurAsia GE%sT 1996 Oct lastSun 4:00 1:00 GEST 1997 Mar lastSun 4:00 E-EurAsia GE%sT 2004 Jun 27 - 3:00 RussiaAsia GE%sT 2005 Mar lastSun 2:00 + 3:00 RussiaAsia GE%sT 2005 Mar lastSun 2:00 4:00 - GET # East Timor @@ -864,16 +868,16 @@ Zone Asia/Tbilisi 2:59:06 - LMT 1880 # midnight on Saturday, September 16. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Dili 8:22:20 - LMT 1912 +Zone Asia/Dili 8:22:20 - LMT 1912 Jan 1 8:00 - TLT 1942 Feb 21 23:00 # E Timor Time 9:00 - JST 1945 Sep 23 9:00 - TLT 1976 May 3 - 8:00 - WITA 2000 Sep 17 00:00 + 8:00 - WITA 2000 Sep 17 0:00 9:00 - TLT # India # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata +Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata 5:53:20 - HMT 1941 Oct # Howrah Mean Time? 6:30 - BURT 1942 May 15 # Burma Time 5:30 - IST 1942 Sep @@ -886,8 +890,12 @@ Zone Asia/Kolkata 5:53:28 - LMT 1880 # K # Indonesia # +# From Paul Eggert (2014-09-06): +# The 1876 Report of the Secretary of the [US] Navy, p 306 says that Batavia +# civil time was 7:07:12.5; round to even for Jakarta. +# # From Gwillim Law (2001-05-28), overriding Shanks & Pottenger: -# +# http://www.sumatera-inc.com/go_to_invest/about_indonesia.asp#standtime # says that Indonesia's time zones changed on 1988-01-01. Looking at some # time zone maps, I think that must refer to Western Borneo (Kalimantan Barat # and Kalimantan Tengah) switching from UTC+8 to UTC+7. @@ -924,7 +932,7 @@ Zone Asia/Jakarta 7:07:12 - LMT 1867 Aug # Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13, # but this must be a typo. 7:07:12 - BMT 1923 Dec 31 23:47:12 # Batavia - 7:20 - JAVT 1932 Nov # Java Time + 7:20 - JAVT 1932 Nov # Java Time 7:30 - WIB 1942 Mar 23 9:00 - JST 1945 Sep 23 7:30 - WIB 1948 May @@ -1082,7 +1090,7 @@ Rule Iran 2036 2037 - Mar 21 0:00 1:00 D Rule Iran 2036 2037 - Sep 21 0:00 0 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tehran 3:25:44 - LMT 1916 - 3:25:44 - TMT 1946 # Tehran Mean Time + 3:25:44 - TMT 1946 # Tehran Mean Time 3:30 - IRST 1977 Nov 4:00 Iran IR%sT 1979 3:30 Iran IR%sT @@ -1127,7 +1135,7 @@ Rule Iraq 1991 2007 - Apr 1 3:00s 1:00 Rule Iraq 1991 2007 - Oct 1 3:00s 0 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Baghdad 2:57:40 - LMT 1890 - 2:57:36 - BMT 1918 # Baghdad Mean Time? + 2:57:36 - BMT 1918 # Baghdad Mean Time? 3:00 - AST 1982 May 3:00 Iraq A%sT @@ -1355,7 +1363,7 @@ Rule Zion 2013 max - Oct lastSun 2:00 0 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Jerusalem 2:20:54 - LMT 1880 - 2:20:40 - JMT 1918 # Jerusalem Mean Time? + 2:20:40 - JMT 1918 # Jerusalem Mean Time? 2:00 Zion I%sT @@ -1371,8 +1379,8 @@ Zone Asia/Jerusalem 2:20:54 - LMT 1880 # daylight saving between 1948 and 1951, but "the system was discontinued # because the public believed it would lead to longer working hours." -# From Mayumi Negishi in the 2005-08-10 Japan Times -# : +# From Mayumi Negishi in the 2005-08-10 Japan Times: +# http://www.japantimes.co.jp/cgi-bin/getarticle.pl5?nn20050810f2.htm # Occupation authorities imposed daylight-saving time on Japan on # [1948-05-01].... But lack of prior debate and the execution of # daylight-saving time just three days after the bill was passed generated @@ -1396,7 +1404,8 @@ Rule Japan 1950 1951 - May Sun>=1 2:00 1 # From Hideyuki Suzuki (1998-11-09): # 'Tokyo' usually stands for the former location of Tokyo Astronomical -# Observatory: 139 degrees 44' 40.90" E (9h 18m 58.727s), 35 degrees 39' 16.0" N. +# Observatory: 139 degrees 44' 40.90" E (9h 18m 58.727s), +# 35 degrees 39' 16.0" N. # This data is from 'Rika Nenpyou (Chronological Scientific Tables) 1996' # edited by National Astronomical Observatory of Japan.... # JST (Japan Standard Time) has been used since 1888-01-01 00:00 (JST). @@ -1586,10 +1595,10 @@ Zone Asia/Qyzylorda 4:21:52 - LMT 1924 M 6:00 - KIZT 1982 Apr 1 5:00 RussiaAsia KIZ%sT 1991 5:00 - KIZT 1991 Dec 16 # independence - 5:00 - QYZT 1992 Jan 19 2:00 + 5:00 - QYZT 1992 Jan 19 2:00 6:00 RussiaAsia QYZ%sT 2005 Mar 15 6:00 - QYZT -# Aqtobe (aka Aktobe, formerly Akt'ubinsk) +# Aqtobe (aka Aktobe, formerly Aktyubinsk) Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 4:00 - AKTT 1930 Jun 21 # Aktyubinsk Time 5:00 - AKTT 1981 Apr 1 @@ -1609,7 +1618,7 @@ Zone Asia/Aqtau 3:21:04 - LMT 1924 May 6:00 - SHET 1982 Apr 1 5:00 RussiaAsia SHE%sT 1991 5:00 - SHET 1991 Dec 16 # independence - 5:00 RussiaAsia AQT%sT 1995 Mar lastSun 2:00 # Aqtau Time + 5:00 RussiaAsia AQT%sT 1995 Mar lastSun 2:00 # Aqtau Time 4:00 RussiaAsia AQT%sT 2005 Mar 15 5:00 - AQTT # West Kazakhstan @@ -1618,7 +1627,7 @@ Zone Asia/Oral 3:25:24 - LMT 1924 May 2 5:00 - URAT 1981 Apr 1 5:00 1:00 URAST 1981 Oct 1 6:00 - URAT 1982 Apr 1 - 5:00 RussiaAsia URA%sT 1989 Mar 26 2:00 + 5:00 RussiaAsia URA%sT 1989 Mar 26 2:00 4:00 RussiaAsia URA%sT 1991 4:00 - URAT 1991 Dec 16 # independence 4:00 RussiaAsia ORA%sT 2005 Mar 15 # Oral Time @@ -1629,7 +1638,7 @@ Zone Asia/Oral 3:25:24 - LMT 1924 May 2 # From Paul Eggert (2005-08-15): # According to an article dated today in the Kyrgyzstan Development Gateway -# +# http://eng.gateway.kg/cgi-bin/page.pl?id=1&story_name=doc9979.shtml # Kyrgyzstan is canceling the daylight saving time system. I take the article # to mean that they will leave their clocks at 6 hours ahead of UTC. # From Malik Abdugaliev (2005-09-21): @@ -1644,17 +1653,17 @@ Rule Kyrgyz 1997 2004 - Oct lastSun 2:30 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2 5:00 - FRUT 1930 Jun 21 # Frunze Time - 6:00 RussiaAsia FRU%sT 1991 Mar 31 2:00s - 5:00 1:00 FRUST 1991 Aug 31 2:00 # independence - 5:00 Kyrgyz KG%sT 2005 Aug 12 # Kyrgyzstan Time + 6:00 RussiaAsia FRU%sT 1991 Mar 31 2:00s + 5:00 1:00 FRUST 1991 Aug 31 2:00 # independence + 5:00 Kyrgyz KG%sT 2005 Aug 12 # Kyrgyzstan Time 6:00 - KGT ############################################################################### # Korea (North and South) -# From Annie I. Bang (2006-07-10) in -# : +# From Annie I. Bang (2006-07-10): +# http://www.koreaherald.co.kr/SITE/data/html_dir/2006/07/10/200607100012.asp # The Ministry of Commerce, Industry and Energy has already # commissioned a research project [to reintroduce DST] and has said # the system may begin as early as 2008.... Korea ran a daylight @@ -1702,12 +1711,8 @@ Zone Asia/Kuwait 3:11:56 - LMT 1950 3:00 - AST # Laos -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Vientiane 6:50:24 - LMT 1906 Jun 9 # or Viangchan - 7:06:20 - SMT 1911 Mar 11 0:01 # Saigon MT? - 7:00 - ICT 1912 May - 8:00 - ICT 1931 May - 7:00 - ICT +# See Asia/Bangkok. + # Lebanon # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -1745,8 +1750,8 @@ Rule NBorneo 1935 1941 - Sep 14 0:00 0:2 Rule NBorneo 1935 1941 - Dec 14 0:00 0 - # # peninsular Malaysia -# The data here are taken from Mok Ly Yng (2003-10-30) -# . +# taken from Mok Ly Yng (2003-10-30) +# http://www.math.nus.edu.sg/aslaksen/teaching/timezone.html # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Kuala_Lumpur 6:46:46 - LMT 1901 Jan 1 6:55:25 - SMT 1905 Jun 1 # Singapore M.T. @@ -1758,12 +1763,12 @@ Zone Asia/Kuala_Lumpur 6:46:46 - LMT 190 7:30 - MALT 1982 Jan 1 8:00 - MYT # Malaysia Time # Sabah & Sarawak -# From Paul Eggert (2006-03-22): -# The data here are mostly from Shanks & Pottenger, but the 1942, 1945 and 1982 -# transition dates are from Mok Ly Yng. +# From Paul Eggert (2014-08-12): +# The data entries here are mostly from Shanks & Pottenger, but the 1942, 1945 +# and 1982 transition dates are from Mok Ly Yng. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Kuching 7:21:20 - LMT 1926 Mar - 7:30 - BORT 1933 # Borneo Time + 7:30 - BORT 1933 # Borneo Time 8:00 NBorneo BOR%sT 1942 Feb 16 9:00 - JST 1945 Sep 12 8:00 - BORT 1982 Jan 1 @@ -1771,9 +1776,9 @@ Zone Asia/Kuching 7:21:20 - LMT 1926 Mar # Maldives # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Maldives 4:54:00 - LMT 1880 # Male - 4:54:00 - MMT 1960 # Male Mean Time - 5:00 - MVT # Maldives Time +Zone Indian/Maldives 4:54:00 - LMT 1880 # Male + 4:54:00 - MMT 1960 # Male Mean Time + 5:00 - MVT # Maldives Time # Mongolia @@ -1835,7 +1840,7 @@ Zone Indian/Maldives 4:54:00 - LMT 1880 # Oscar van Vlijmen (2005-05-20) reports that the Mongolian Embassy in # Washington, DC says there are two time zones, with DST observed. # He also found *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 06:05:41 2014 Return-Path: Delivered-To: svn-src-all@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 605F1179; Mon, 27 Oct 2014 06:05: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 4AC31DC3; Mon, 27 Oct 2014 06:05: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 s9R65fNF077741; Mon, 27 Oct 2014 06:05:41 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9R65eNn077737; Mon, 27 Oct 2014 06:05:40 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201410270605.s9R65eNn077737@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Mon, 27 Oct 2014 06:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273719 - stable/10/contrib/tzdata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 06:05:41 -0000 Author: edwin Date: Mon Oct 27 06:05:40 2014 New Revision: 273719 URL: https://svnweb.freebsd.org/changeset/base/273719 Log: MFC of 273718, tzdata2014i Upgrade to 2014i Lots of historical data Pacific/Fiji will go into DST from 2014-11-02 to 2015-01-18 Pacific/Bougainville will go from UTC+10 to UTC+11. Europe/Minsk will go from FET to MSK. Modified: stable/10/contrib/tzdata/africa stable/10/contrib/tzdata/antarctica stable/10/contrib/tzdata/asia stable/10/contrib/tzdata/australasia stable/10/contrib/tzdata/backward stable/10/contrib/tzdata/europe stable/10/contrib/tzdata/northamerica stable/10/contrib/tzdata/southamerica stable/10/contrib/tzdata/zone.tab stable/10/contrib/tzdata/zone1970.tab Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/tzdata/africa ============================================================================== --- stable/10/contrib/tzdata/africa Mon Oct 27 05:50:02 2014 (r273718) +++ stable/10/contrib/tzdata/africa Mon Oct 27 06:05:40 2014 (r273719) @@ -1,9 +1,10 @@ # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. -# This data is by no means authoritative; if you think you know better, +# This file is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@iana.org for general use in the future). +# tz@iana.org for general use in the future). For more, please see +# the file CONTRIBUTING in the tz distribution. # From Paul Eggert (2013-02-21): # @@ -25,8 +26,8 @@ # I found in the UCLA library. # # For data circa 1899, a common source is: -# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 -# . +# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94. +# http://www.jstor.org/stable/1774359 # # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). @@ -93,9 +94,9 @@ Rule Algeria 1980 only - Oct 31 2:00 0 # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's # more precise 0:09:21. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 15 0:01 - 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time - 0:00 Algeria WE%sT 1940 Feb 25 2:00 +Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 15 0:01 + 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time + 0:00 Algeria WE%sT 1940 Feb 25 2:00 1:00 Algeria CE%sT 1946 Oct 7 0:00 - WET 1956 Jan 29 1:00 - CET 1963 Apr 14 @@ -105,82 +106,57 @@ Zone Africa/Algiers 0:12:12 - LMT 1891 M 1:00 - CET # Angola -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Luanda 0:52:56 - LMT 1892 - 0:52:04 - AOT 1911 May 26 # Angola Time - 1:00 - WAT - # Benin -# Whitman says they switched to 1:00 in 1946, not 1934; -# go with Shanks & Pottenger. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Porto-Novo 0:10:28 - LMT 1912 - 0:00 - GMT 1934 Feb 26 - 1:00 - WAT +# See Africa/Lagos. # Botswana -# From Paul Eggert (2013-02-21): -# Milne says they were regulated by the Cape Town Signal in 1899; -# assume they switched to 2:00 when Cape Town did. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Gaborone 1:43:40 - LMT 1885 - 1:30 - SAST 1903 Mar - 2:00 - CAT 1943 Sep 19 2:00 - 2:00 1:00 CAST 1944 Mar 19 2:00 - 2:00 - CAT +# See Africa/Maputo. # Burkina Faso # See Africa/Abidjan. # Burundi -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Bujumbura 1:57:28 - LMT 1890 - 2:00 - CAT +# See Africa/Maputo. # Cameroon -# Whitman says they switched to 1:00 in 1920; go with Shanks & Pottenger. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Douala 0:38:48 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. # Cape Verde +# +# Shanks gives 1907 for the transition to CVT. +# Perhaps the 1911-05-26 Portuguese decree +# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# merely made it official? +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Atlantic/Cape_Verde -1:34:04 - LMT 1907 # Praia +Zone Atlantic/Cape_Verde -1:34:04 - LMT 1907 # Praia -2:00 - CVT 1942 Sep -2:00 1:00 CVST 1945 Oct 15 - -2:00 - CVT 1975 Nov 25 2:00 + -2:00 - CVT 1975 Nov 25 2:00 -1:00 - CVT # Central African Republic -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Bangui 1:14:20 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. # Chad # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena +Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena 1:00 - WAT 1979 Oct 14 1:00 1:00 WAST 1980 Mar 8 1:00 - WAT # Comoros # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Comoro 2:53:04 - LMT 1911 Jul # Moroni, Gran Comoro +Zone Indian/Comoro 2:53:04 - LMT 1911 Jul # Moroni, Gran Comoro 3:00 - EAT -# Democratic Republic of Congo -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Kinshasa 1:01:12 - LMT 1897 Nov 9 - 1:00 - WAT -Zone Africa/Lubumbashi 1:49:52 - LMT 1897 Nov 9 - 2:00 - CAT +# Democratic Republic of the Congo +# See Africa/Lagos for the western part and Africa/Maputo for the eastern. # Republic of the Congo -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Brazzaville 1:01:08 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. -# Côte D'Ivoire / Ivory Coast +# Côte d'Ivoire / Ivory Coast # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Abidjan -0:16:08 - LMT 1912 0:00 - GMT @@ -327,7 +303,7 @@ Rule Egypt 2007 only - Sep Thu>=1 24:00 # Egypt is to change back to Daylight system on May 15 # http://english.ahram.org.eg/NewsContent/1/64/100735/Egypt/Politics-/Egypts-government-to-reapply-daylight-saving-time-.aspx -# From Gunther Vermier (2015-05-13): +# From Gunther Vermier (2014-05-13): # our Egypt office confirms that the change will be at 15 May "midnight" (24:00) # From Imed Chihi (2014-06-04): @@ -408,16 +384,13 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct 2:00 Egypt EE%sT # Equatorial Guinea -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Malabo 0:35:08 - LMT 1912 - 0:00 - GMT 1963 Dec 15 - 1:00 - WAT +# See Africa/Lagos. # Eritrea # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Asmara 2:35:32 - LMT 1870 - 2:35:32 - AMT 1890 # Asmara Mean Time - 2:35:20 - ADMT 1936 May 5 # Adis Dera MT + 2:35:32 - AMT 1890 # Asmara Mean Time + 2:35:20 - ADMT 1936 May 5 # Adis Dera MT 3:00 - EAT # Ethiopia @@ -429,16 +402,15 @@ Zone Africa/Asmara 2:35:32 - LMT 1870 # Shanks & Pottenger write that Ethiopia had six narrowly-spaced time # zones between 1870 and 1890, that they merged to 38E50 (2:35:20) in # 1890, and that they switched to 3:00 on 1936-05-05. Perhaps 38E50 -# was for Adis Dera. Quite likely the Shanks data are wrong anyway. +# was for Adis Dera. Quite likely the Shanks data entries are wrong +# anyway. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Addis_Ababa 2:34:48 - LMT 1870 - 2:35:20 - ADMT 1936 May 5 # Adis Dera MT + 2:35:20 - ADMT 1936 May 5 # Adis Dera MT 3:00 - EAT # Gabon -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Libreville 0:37:48 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. # Gambia # See Africa/Abidjan. @@ -461,8 +433,14 @@ Zone Africa/Accra -0:00:52 - LMT 1918 # See Africa/Abidjan. # Guinea-Bissau +# +# Shanks gives 1911-05-26 for the transition to WAT, +# evidently confusing the date of the Portuguese decree +# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# with the date that it took effect, namely 1912-01-01. +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Bissau -1:02:20 - LMT 1911 May 26 +Zone Africa/Bissau -1:02:20 - LMT 1912 Jan 1 -1:00 - WAT 1975 0:00 - GMT @@ -475,11 +453,7 @@ Zone Africa/Nairobi 2:27:16 - LMT 1928 J 3:00 - EAT # Lesotho -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Maseru 1:50:00 - LMT 1903 Mar - 2:00 - SAST 1943 Sep 19 2:00 - 2:00 1:00 SAST 1944 Mar 19 2:00 - 2:00 - SAST +# See Africa/Johannesburg. # Liberia # From Paul Eggert (2006-03-22): @@ -546,11 +520,11 @@ Zone Africa/Tripoli 0:52:44 - LMT 1920 2:00 - EET 1982 1:00 Libya CE%sT 1990 May 4 # The 1996 and 1997 entries are from Shanks & Pottenger; -# the IATA SSIM data contain some obvious errors. +# the IATA SSIM data entries contain some obvious errors. 2:00 - EET 1996 Sep 30 1:00 Libya CE%sT 1997 Oct 4 - 2:00 - EET 2012 Nov 10 2:00 - 1:00 Libya CE%sT 2013 Oct 25 2:00 + 2:00 - EET 2012 Nov 10 2:00 + 1:00 Libya CE%sT 2013 Oct 25 2:00 2:00 - EET # Madagascar @@ -561,9 +535,7 @@ Zone Indian/Antananarivo 3:10:04 - LMT 1 3:00 - EAT # Malawi -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Blantyre 2:20:00 - LMT 1903 Mar - 2:00 - CAT +# See Africa/Maputo. # Mali # Mauritania @@ -606,7 +578,7 @@ Zone Africa/Blantyre 2:20:00 - LMT 1903 # From Alex Krivenyshev (2008-07-11): # Seems that English language article "The revival of daylight saving -# time: Energy conservation?"-# No. 16578 (07/11/2008) was originally +# time: Energy conservation?"-# No. 16578 (07/11/2008) was originally # published on Monday, June 30, 2008... # # I guess that article in French "Le gouvernement avance l'introduction @@ -657,14 +629,14 @@ Rule Mauritius 1983 only - Mar 21 0:00 0 Rule Mauritius 2008 only - Oct lastSun 2:00 1:00 S Rule Mauritius 2009 only - Mar lastSun 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis +Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis 4:00 Mauritius MU%sT # Mauritius Time # Agalega Is, Rodriguez # no information; probably like Indian/Mauritius # Mayotte # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou +Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou 3:00 - EAT # Morocco @@ -682,7 +654,8 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # http://en.afrik.com/news11892.html # From Alex Krivenyshev (2008-05-09): -# The Morocco time change can be confirmed on Morocco web site Maghreb Arabe Presse: +# The Morocco time change can be confirmed on Morocco web site Maghreb Arabe +# Presse: # http://www.map.ma/eng/sections/box3/morocco_shifts_to_da/view # # Morocco shifts to daylight time on June 1st through September 27, Govt. @@ -760,8 +733,8 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # From Dan Abitol (2011-03-30): # ...Rules for Africa/Casablanca are the following (24h format) -# The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00 -# The 31th july 2011 at 00:59:59, [it] will be 31th July 00:00:00 +# The 3rd April 2011 at 00:00:00, [it] will be 3rd April 01:00:00 +# The 31st July 2011 at 00:59:59, [it] will be 31st July 00:00:00 # ...Official links of change in morocco # The change was broadcast on the FM Radio # I ve called ANRT (telecom regulations in Morocco) at @@ -831,7 +804,7 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # announced a bit in advance. On 2012-07-11 the Moroccan government # announced that year's Ramadan daylight-saving transitions would be # 2012-07-20 and 2012-08-20; see -# . +# http://www.mmsp.gov.ma/fr/actualites.aspx?id=288 # From Andrew Paprocki (2013-07-02): # Morocco announced that the year's Ramadan daylight-savings @@ -963,16 +936,29 @@ Zone Africa/El_Aaiun -0:52:48 - LMT 1934 0:00 Morocco WE%sT # Mozambique +# +# Shanks gives 1903-03-01 for the transition to CAT. +# Perhaps the 1911-05-26 Portuguese decree +# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# merely made it official? +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Maputo 2:10:20 - LMT 1903 Mar 2:00 - CAT +Link Africa/Maputo Africa/Blantyre # Malawi +Link Africa/Maputo Africa/Bujumbura # Burundi +Link Africa/Maputo Africa/Gaborone # Botswana +Link Africa/Maputo Africa/Harare # Zimbabwe +Link Africa/Maputo Africa/Kigali # Rwanda +Link Africa/Maputo Africa/Lubumbashi # E Dem. Rep. of Congo +Link Africa/Maputo Africa/Lusaka # Zambia # Namibia # The 1994-04-03 transition is from Shanks & Pottenger. # Shanks & Pottenger report no DST after 1998-04; go with IATA. -# From Petronella Sibeene (2007-03-30) in -# : +# From Petronella Sibeene (2007-03-30): +# http://allafrica.com/stories/200703300178.html # While the entire country changes its time, Katima Mulilo and other # settlements in Caprivi unofficially will not because the sun there # rises and sets earlier compared to other regions. Chief of @@ -989,28 +975,33 @@ Rule Namibia 1994 max - Sep Sun>=1 2:00 Rule Namibia 1995 max - Apr Sun>=1 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Windhoek 1:08:24 - LMT 1892 Feb 8 - 1:30 - SWAT 1903 Mar # SW Africa Time - 2:00 - SAST 1942 Sep 20 2:00 - 2:00 1:00 SAST 1943 Mar 21 2:00 + 1:30 - SWAT 1903 Mar # SW Africa Time + 2:00 - SAST 1942 Sep 20 2:00 + 2:00 1:00 SAST 1943 Mar 21 2:00 2:00 - SAST 1990 Mar 21 # independence 2:00 - CAT 1994 Apr 3 1:00 Namibia WA%sT # Niger -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Niamey 0:08:28 - LMT 1912 - -1:00 - WAT 1934 Feb 26 - 0:00 - GMT 1960 - 1:00 - WAT +# See Africa/Lagos. # Nigeria # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Lagos 0:13:36 - LMT 1919 Sep 1:00 - WAT +Link Africa/Lagos Africa/Bangui # Central African Republic +Link Africa/Lagos Africa/Brazzaville # Rep. of the Congo +Link Africa/Lagos Africa/Douala # Cameroon +Link Africa/Lagos Africa/Kinshasa # Dem. Rep. of the Congo (west) +Link Africa/Lagos Africa/Libreville # Gabon +Link Africa/Lagos Africa/Luanda # Angola +Link Africa/Lagos Africa/Malabo # Equatorial Guinea +Link Africa/Lagos Africa/Niamey # Niger +Link Africa/Lagos Africa/Porto-Novo # Benin # Réunion # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Denis +Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Denis 4:00 - RET # Réunion Time # # Crozet Islands also observes Réunion time; see the 'antarctica' file. @@ -1028,9 +1019,7 @@ Zone Indian/Reunion 3:41:52 - LMT 1911 J # Tromelin - inhabited until at least 1958 # Rwanda -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Kigali 2:00:16 - LMT 1935 Jun - 2:00 - CAT +# See Africa/Maputo. # St Helena # See Africa/Abidjan. @@ -1047,7 +1036,7 @@ Zone Africa/Kigali 2:00:16 - LMT 1935 Ju # Seychelles # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria +Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria 4:00 - SCT # Seychelles Time # From Paul Eggert (2001-05-30): # Aldabra, Farquhar, and Desroches, originally dependencies of the @@ -1074,6 +1063,9 @@ Rule SA 1943 1944 - Mar Sun>=15 2:00 0 - Zone Africa/Johannesburg 1:52:00 - LMT 1892 Feb 8 1:30 - SAST 1903 Mar 2:00 SA SAST +Link Africa/Johannesburg Africa/Maseru # Lesotho +Link Africa/Johannesburg Africa/Mbabane # Swaziland +# # Marion and Prince Edward Is # scientific station since 1947 # no information @@ -1101,9 +1093,7 @@ Zone Africa/Khartoum 2:10:08 - LMT 1931 Link Africa/Khartoum Africa/Juba # Swaziland -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Mbabane 2:04:24 - LMT 1903 Mar - 2:00 - SAST +# See Africa/Johannesburg. # Tanzania # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1128,7 +1118,7 @@ Zone Africa/Dar_es_Salaam 2:37:08 - LMT # # From Oscar van Vlijmen (2005-05-02): # La Presse, the first national daily newspaper ... -# +# http://www.lapresse.tn/archives/archives280405/actualites/lheure.html # ... DST for 2005: on: Sun May 1 0h standard time, off: Fri Sept. 30, # 1h standard time. # @@ -1212,7 +1202,7 @@ Rule Tunisia 2006 2008 - Oct lastSun 2: # Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Tunis 0:40:44 - LMT 1881 May 12 - 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time + 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time 1:00 Tunisia CE%sT # Uganda @@ -1224,11 +1214,5 @@ Zone Africa/Kampala 2:09:40 - LMT 1928 J 3:00 - EAT # Zambia -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Lusaka 1:53:08 - LMT 1903 Mar - 2:00 - CAT - # Zimbabwe -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Harare 2:04:12 - LMT 1903 Mar - 2:00 - CAT +# See Africa/Maputo. Modified: stable/10/contrib/tzdata/antarctica ============================================================================== --- stable/10/contrib/tzdata/antarctica Mon Oct 27 05:50:02 2014 (r273718) +++ stable/10/contrib/tzdata/antarctica Mon Oct 27 06:05:40 2014 (r273719) @@ -4,10 +4,10 @@ # From Paul Eggert (1999-11-15): # To keep things manageable, we list only locations occupied year-round; see # COMNAP - Stations and Bases -# +# http://www.comnap.aq/comnap/comnap.nsf/P/Stations/ # and # Summary of the Peri-Antarctic Islands (1998-07-23) -# +# http://www.spri.cam.ac.uk/bob/periant.htm # for information. # Unless otherwise specified, we have no time zone information. # @@ -63,7 +63,7 @@ Rule ChileAQ 2012 max - Sep Sun>=2 4:00u # Heard Island, McDonald Islands (uninhabited) # previously sealers and scientific personnel wintered # Margaret Turner reports -# +# http://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html # (1999-09-30) that they're UTC+5, with no DST; # presumably this is when they have visitors. # @@ -103,32 +103,30 @@ Rule ChileAQ 2012 max - Sep Sun>=2 4:00u # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Antarctica/Casey 0 - zzz 1969 - 8:00 - AWST 2009 Oct 18 2:00 + 8:00 - AWST 2009 Oct 18 2:00 # Australian Western Std Time - 11:00 - CAST 2010 Mar 5 2:00 - # Casey Time - 8:00 - AWST 2011 Oct 28 2:00 + 11:00 - CAST 2010 Mar 5 2:00 # Casey Time + 8:00 - AWST 2011 Oct 28 2:00 11:00 - CAST 2012 Feb 21 17:00u 8:00 - AWST Zone Antarctica/Davis 0 - zzz 1957 Jan 13 - 7:00 - DAVT 1964 Nov # Davis Time + 7:00 - DAVT 1964 Nov # Davis Time 0 - zzz 1969 Feb - 7:00 - DAVT 2009 Oct 18 2:00 + 7:00 - DAVT 2009 Oct 18 2:00 5:00 - DAVT 2010 Mar 10 20:00u - 7:00 - DAVT 2011 Oct 28 2:00 + 7:00 - DAVT 2011 Oct 28 2:00 5:00 - DAVT 2012 Feb 21 20:00u 7:00 - DAVT Zone Antarctica/Mawson 0 - zzz 1954 Feb 13 - 6:00 - MAWT 2009 Oct 18 2:00 - # Mawson Time + 6:00 - MAWT 2009 Oct 18 2:00 # Mawson Time 5:00 - MAWT # References: # Casey Weather (1998-02-26) -# +# http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html # Davis Station, Antarctica (1998-02-26) -# +# http://www.antdiv.gov.au/aad/exop/sfo/davis/video.html # Mawson Station, Antarctica (1998-02-25) -# +# http://www.antdiv.gov.au/aad/exop/sfo/mawson/video.html # Belgium - year-round base # Princess Elisabeth, Queen Maud Land, -713412+0231200, since 2007 @@ -154,7 +152,7 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb # France - year-round bases (also see "France & Italy") # # From Antoine Leca (1997-01-20): -# Time data are from Nicole Pailleau at the IFRTP +# Time data entries are from Nicole Pailleau at the IFRTP # (French Institute for Polar Research and Technology). # She confirms that French Southern Territories and Terre Adélie bases # don't observe daylight saving time, even if Terre Adélie supplies came @@ -174,7 +172,7 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb # fishing stations operated variously 1819/1931 # # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Kerguelen 0 - zzz 1950 # Port-aux-Français +Zone Indian/Kerguelen 0 - zzz 1950 # Port-aux-Français 5:00 - TFT # ISO code TF Time # # year-round base in the main continent @@ -217,7 +215,7 @@ Zone Antarctica/Syowa 0 - zzz 1957 Jan 2 3:00 - SYOT # Syowa Time # See: # NIPR Antarctic Research Activities (1999-08-17) -# +# http://www.nipr.ac.jp/english/ara01.html # S Korea - year-round base # Jang Bogo, Terra Nova Bay, -743700+1641205 since 2014 @@ -264,7 +262,7 @@ Rule Troll 2005 max - Mar lastSun 1:00u Rule Troll 2004 max - Oct lastSun 1:00u 0:00 UTC # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Antarctica/Troll 0 - zzz 2005 Feb 12 - 0:00 Troll %s + 0:00 Troll %s # Poland - year-round base # Arctowski, King George Island, -620945-0582745, since 1977 @@ -281,8 +279,8 @@ Zone Antarctica/Troll 0 - zzz 2005 Feb 1 # year-round from 1960/61 to 1992 # Vostok, since 1957-12-16, temporarily closed 1994-02/1994-11 -# From Craig Mundell (1994-12-15) -# : +# From Craig Mundell (1994-12-15): +# http://quest.arc.nasa.gov/antarctica/QA/computers/Directions,Time,ZIP # Vostok, which is one of the Russian stations, is set on the same # time as Moscow, Russia. # Modified: stable/10/contrib/tzdata/asia ============================================================================== --- stable/10/contrib/tzdata/asia Mon Oct 27 05:50:02 2014 (r273718) +++ stable/10/contrib/tzdata/asia Mon Oct 27 06:05:40 2014 (r273719) @@ -1,9 +1,10 @@ # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. -# This data is by no means authoritative; if you think you know better, +# This file is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@iana.org for general use in the future). +# tz@iana.org for general use in the future). For more, please see +# the file CONTRIBUTING in the tz distribution. # From Paul Eggert (2013-08-11): # @@ -25,8 +26,12 @@ # I found in the UCLA library. # # For data circa 1899, a common source is: -# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 -# . +# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94. +# http://www.jstor.org/stable/1774359 +# +# For Russian data circa 1919, a source is: +# Byalokoz EL. New Counting of Time in Russia since July 1, 1919. +# (See the 'europe' file for a fuller citation.) # # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). @@ -42,10 +47,11 @@ # 3:30 IRST IRDT Iran # 4:00 GST Gulf* # 5:30 IST India -# 7:00 ICT Indochina* +# 7:00 ICT Indochina, most times and locations* # 7:00 WIB west Indonesia (Waktu Indonesia Barat) # 8:00 WITA central Indonesia (Waktu Indonesia Tengah) # 8:00 CST China +# 8:00 IDT Indochina, 1943-45, 1947-55, 1960-75 (some locations)* # 8:00 JWST Western Standard Time (Japan, 1896/1937)* # 9:00 JCST Central Standard Time (Japan, 1896/1937) # 9:00 WIT east Indonesia (Waktu Indonesia Timur) @@ -115,11 +121,11 @@ Zone Asia/Kabul 4:36:48 - LMT 1890 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2 3:00 - YERT 1957 Mar # Yerevan Time - 4:00 RussiaAsia YER%sT 1991 Mar 31 2:00s + 4:00 RussiaAsia YER%sT 1991 Mar 31 2:00s 3:00 1:00 YERST 1991 Sep 23 # independence - 3:00 RussiaAsia AM%sT 1995 Sep 24 2:00s + 3:00 RussiaAsia AM%sT 1995 Sep 24 2:00s 4:00 - AMT 1997 - 4:00 RussiaAsia AM%sT 2012 Mar 25 2:00s + 4:00 RussiaAsia AM%sT 2012 Mar 25 2:00s 4:00 - AMT # Azerbaijan @@ -132,16 +138,16 @@ Rule Azer 1997 max - Oct lastSun 5:00 0 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Baku 3:19:24 - LMT 1924 May 2 3:00 - BAKT 1957 Mar # Baku Time - 4:00 RussiaAsia BAK%sT 1991 Mar 31 2:00s + 4:00 RussiaAsia BAK%sT 1991 Mar 31 2:00s 3:00 1:00 BAKST 1991 Aug 30 # independence 3:00 RussiaAsia AZ%sT 1992 Sep lastSat 23:00 - 4:00 - AZT 1996 # Azerbaijan time + 4:00 - AZT 1996 # Azerbaijan Time 4:00 EUAsia AZ%sT 1997 4:00 Azer AZ%sT # Bahrain # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah +Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah 4:00 - GST 1972 Jun 3:00 - AST @@ -219,7 +225,7 @@ Zone Asia/Bahrain 3:22:20 - LMT 1920 # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Dhaka 2009 only - Jun 19 23:00 1:00 S -Rule Dhaka 2009 only - Dec 31 23:59 0 - +Rule Dhaka 2009 only - Dec 31 24:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Dhaka 6:01:40 - LMT 1890 @@ -250,7 +256,7 @@ Zone Indian/Chagos 4:49:40 - LMT 1907 # Brunei # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan +Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan 7:30 - BNT 1933 8:00 - BNT @@ -259,19 +265,15 @@ Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Milne says 6:24:40 was the meridian of the time ball observatory at Rangoon. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Rangoon 6:24:40 - LMT 1880 # or Yangon - 6:24:40 - RMT 1920 # Rangoon Mean Time? - 6:30 - BURT 1942 May # Burma Time - 9:00 - JST 1945 May 3 - 6:30 - MMT # Myanmar Time +Zone Asia/Rangoon 6:24:40 - LMT 1880 # or Yangon + 6:24:40 - RMT 1920 # Rangoon Mean Time? + 6:30 - BURT 1942 May # Burma Time + 9:00 - JST 1945 May 3 + 6:30 - MMT # Myanmar Time # Cambodia -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Phnom_Penh 6:59:40 - LMT 1906 Jun 9 - 7:06:20 - SMT 1911 Mar 11 0:01 # Saigon MT? - 7:00 - ICT 1912 May - 8:00 - ICT 1931 May - 7:00 - ICT +# See Asia/Bangkok. + # China @@ -356,8 +358,8 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1: # * The Republic of China instituted Beijing mean solar time effective # the official calendar book of 1914. # * The French Concession in Shanghai set up signal stations in -# French docks in the 1890s, controled by Xujiahui (Zikawei) -# Obervatory and set to local mean time. +# French docks in the 1890s, controlled by Xujiahui (Zikawei) +# Observatory and set to local mean time. # * "From the end of the 19th century" it changed to UT+8. # * Chinese Customs (by then reduced to a tool of foreign powers) # eventually standardized on this time for all ports, and it @@ -381,7 +383,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1: # Xujiahui Observatory was under French control and stuck with UT+8. # # In earlier versions of this file, China had many separate Zone entries, but -# this was based on what was apparently incorrect data in Shanks & Pottenger. +# this was based on what were apparently incorrect data in Shanks & Pottenger. # This has now been simplified to the two entries Asia/Shanghai and # Asia/Urumqi, with the others being links for backward compatibility. # Proposed in 1918 and theoretically in effect until 1949 (although in practice @@ -501,7 +503,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1: # "The Working-Calendar for The Xinjiang Uygur Autonomous Region Government" # (2014-04-22). # Unfortunately, we have no good records of time in Xinjiang before 1986. -# During the 20th century parts of Xinjiang were ruled by the Qing dyansty, +# During the 20th century parts of Xinjiang were ruled by the Qing dynasty, # the Republic of China, various warlords, the First and Second East Turkestan # Republics, the Soviet Union, the Kuomintang, and the People's Republic of # China, and tracking down all these organizations' timekeeping rules would be @@ -698,19 +700,19 @@ Zone Asia/Hong_Kong 7:36:42 - LMT 1904 O # Central Weather Bureau website was not correct. # # Original Bulletin: -# -# (cont.) +# http://subtpg.tpg.gov.tw/og/image2.asp?f=03502F0AKM1AF +# http://subtpg.tpg.gov.tw/og/image2.asp?f=0350300AKM1B0 (cont.) # # In 1947, DST in Taiwan was expanded to Oct 31. There is a backup of that # telegram announcement from Taiwan Province Government: # -# +# http://subtpg.tpg.gov.tw/og/image2.asp?f=0360310AKZ431 # # Here is a brief translation: # # The Summer Time this year is adopted from midnight Apr 15 until Sep 20 # midnight. To save (energy?) consumption, we're expanding Summer Time -# adption till Oct 31 midnight. +# adoption till Oct 31 midnight. # # The Central Weather Bureau website didn't mention that, however it can # be found from historical government announcement database. @@ -741,7 +743,7 @@ Rule Taiwan 1979 only - Oct 1 0:00 0 S # Taipei or Taibei or T'ai-pei Zone Asia/Taipei 8:06:00 - LMT 1896 Jan 1 8:00 - JWST 1937 Oct 1 - 9:00 - JST 1945 Sep 21 01:00 + 9:00 - JST 1945 Sep 21 1:00 8:00 Taiwan C%sT # Macau (Macao, Aomen) @@ -761,7 +763,7 @@ Rule Macau 1975 1977 - Apr Sun>=15 3:30 Rule Macau 1978 1980 - Apr Sun>=15 0:00 1:00 S Rule Macau 1978 1980 - Oct Sun>=15 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Macau 7:34:20 - LMT 1912 +Zone Asia/Macau 7:34:20 - LMT 1912 Jan 1 8:00 Macau MO%sT 1999 Dec 20 # return to China 8:00 PRC C%sT @@ -823,20 +825,22 @@ Link Asia/Nicosia Europe/Nicosia # I don't know what can be done, especially knowing that some years ago our # DST rules where changed THREE TIMES during one month. -# Milne says Tbilisi (Tiflis) time was 2:59:05.7; round to nearest.) +# Milne 1899 says Tbilisi (Tiflis) time was 2:59:05.7. +# Byalokoz 1919 says Georgia was 2:59:11. +# Go with Byalokoz. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Tbilisi 2:59:06 - LMT 1880 - 2:59:06 - TBMT 1924 May 2 # Tbilisi Mean Time +Zone Asia/Tbilisi 2:59:11 - LMT 1880 + 2:59:11 - TBMT 1924 May 2 # Tbilisi Mean Time 3:00 - TBIT 1957 Mar # Tbilisi Time - 4:00 RussiaAsia TBI%sT 1991 Mar 31 2:00s + 4:00 RussiaAsia TBI%sT 1991 Mar 31 2:00s 3:00 1:00 TBIST 1991 Apr 9 # independence - 3:00 RussiaAsia GE%sT 1992 # Georgia Time + 3:00 RussiaAsia GE%sT 1992 # Georgia Time 3:00 E-EurAsia GE%sT 1994 Sep lastSun 4:00 E-EurAsia GE%sT 1996 Oct lastSun 4:00 1:00 GEST 1997 Mar lastSun 4:00 E-EurAsia GE%sT 2004 Jun 27 - 3:00 RussiaAsia GE%sT 2005 Mar lastSun 2:00 + 3:00 RussiaAsia GE%sT 2005 Mar lastSun 2:00 4:00 - GET # East Timor @@ -864,16 +868,16 @@ Zone Asia/Tbilisi 2:59:06 - LMT 1880 # midnight on Saturday, September 16. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Dili 8:22:20 - LMT 1912 +Zone Asia/Dili 8:22:20 - LMT 1912 Jan 1 8:00 - TLT 1942 Feb 21 23:00 # E Timor Time 9:00 - JST 1945 Sep 23 9:00 - TLT 1976 May 3 - 8:00 - WITA 2000 Sep 17 00:00 + 8:00 - WITA 2000 Sep 17 0:00 9:00 - TLT # India # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata +Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata 5:53:20 - HMT 1941 Oct # Howrah Mean Time? 6:30 - BURT 1942 May 15 # Burma Time 5:30 - IST 1942 Sep @@ -886,8 +890,12 @@ Zone Asia/Kolkata 5:53:28 - LMT 1880 # K # Indonesia # +# From Paul Eggert (2014-09-06): +# The 1876 Report of the Secretary of the [US] Navy, p 306 says that Batavia +# civil time was 7:07:12.5; round to even for Jakarta. +# # From Gwillim Law (2001-05-28), overriding Shanks & Pottenger: -# +# http://www.sumatera-inc.com/go_to_invest/about_indonesia.asp#standtime # says that Indonesia's time zones changed on 1988-01-01. Looking at some # time zone maps, I think that must refer to Western Borneo (Kalimantan Barat # and Kalimantan Tengah) switching from UTC+8 to UTC+7. @@ -924,7 +932,7 @@ Zone Asia/Jakarta 7:07:12 - LMT 1867 Aug # Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13, # but this must be a typo. 7:07:12 - BMT 1923 Dec 31 23:47:12 # Batavia - 7:20 - JAVT 1932 Nov # Java Time + 7:20 - JAVT 1932 Nov # Java Time 7:30 - WIB 1942 Mar 23 9:00 - JST 1945 Sep 23 7:30 - WIB 1948 May @@ -1082,7 +1090,7 @@ Rule Iran 2036 2037 - Mar 21 0:00 1:00 D Rule Iran 2036 2037 - Sep 21 0:00 0 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tehran 3:25:44 - LMT 1916 - 3:25:44 - TMT 1946 # Tehran Mean Time + 3:25:44 - TMT 1946 # Tehran Mean Time 3:30 - IRST 1977 Nov 4:00 Iran IR%sT 1979 3:30 Iran IR%sT @@ -1127,7 +1135,7 @@ Rule Iraq 1991 2007 - Apr 1 3:00s 1:00 Rule Iraq 1991 2007 - Oct 1 3:00s 0 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Baghdad 2:57:40 - LMT 1890 - 2:57:36 - BMT 1918 # Baghdad Mean Time? + 2:57:36 - BMT 1918 # Baghdad Mean Time? 3:00 - AST 1982 May 3:00 Iraq A%sT @@ -1355,7 +1363,7 @@ Rule Zion 2013 max - Oct lastSun 2:00 0 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Jerusalem 2:20:54 - LMT 1880 - 2:20:40 - JMT 1918 # Jerusalem Mean Time? + 2:20:40 - JMT 1918 # Jerusalem Mean Time? 2:00 Zion I%sT @@ -1371,8 +1379,8 @@ Zone Asia/Jerusalem 2:20:54 - LMT 1880 # daylight saving between 1948 and 1951, but "the system was discontinued # because the public believed it would lead to longer working hours." -# From Mayumi Negishi in the 2005-08-10 Japan Times -# : +# From Mayumi Negishi in the 2005-08-10 Japan Times: +# http://www.japantimes.co.jp/cgi-bin/getarticle.pl5?nn20050810f2.htm # Occupation authorities imposed daylight-saving time on Japan on # [1948-05-01].... But lack of prior debate and the execution of # daylight-saving time just three days after the bill was passed generated @@ -1396,7 +1404,8 @@ Rule Japan 1950 1951 - May Sun>=1 2:00 1 # From Hideyuki Suzuki (1998-11-09): # 'Tokyo' usually stands for the former location of Tokyo Astronomical -# Observatory: 139 degrees 44' 40.90" E (9h 18m 58.727s), 35 degrees 39' 16.0" N. +# Observatory: 139 degrees 44' 40.90" E (9h 18m 58.727s), +# 35 degrees 39' 16.0" N. # This data is from 'Rika Nenpyou (Chronological Scientific Tables) 1996' # edited by National Astronomical Observatory of Japan.... # JST (Japan Standard Time) has been used since 1888-01-01 00:00 (JST). @@ -1586,10 +1595,10 @@ Zone Asia/Qyzylorda 4:21:52 - LMT 1924 M 6:00 - KIZT 1982 Apr 1 5:00 RussiaAsia KIZ%sT 1991 5:00 - KIZT 1991 Dec 16 # independence - 5:00 - QYZT 1992 Jan 19 2:00 + 5:00 - QYZT 1992 Jan 19 2:00 6:00 RussiaAsia QYZ%sT 2005 Mar 15 6:00 - QYZT -# Aqtobe (aka Aktobe, formerly Akt'ubinsk) +# Aqtobe (aka Aktobe, formerly Aktyubinsk) Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 4:00 - AKTT 1930 Jun 21 # Aktyubinsk Time 5:00 - AKTT 1981 Apr 1 @@ -1609,7 +1618,7 @@ Zone Asia/Aqtau 3:21:04 - LMT 1924 May 6:00 - SHET 1982 Apr 1 5:00 RussiaAsia SHE%sT 1991 5:00 - SHET 1991 Dec 16 # independence - 5:00 RussiaAsia AQT%sT 1995 Mar lastSun 2:00 # Aqtau Time + 5:00 RussiaAsia AQT%sT 1995 Mar lastSun 2:00 # Aqtau Time 4:00 RussiaAsia AQT%sT 2005 Mar 15 5:00 - AQTT # West Kazakhstan @@ -1618,7 +1627,7 @@ Zone Asia/Oral 3:25:24 - LMT 1924 May 2 5:00 - URAT 1981 Apr 1 5:00 1:00 URAST 1981 Oct 1 6:00 - URAT 1982 Apr 1 - 5:00 RussiaAsia URA%sT 1989 Mar 26 2:00 + 5:00 RussiaAsia URA%sT 1989 Mar 26 2:00 4:00 RussiaAsia URA%sT 1991 4:00 - URAT 1991 Dec 16 # independence 4:00 RussiaAsia ORA%sT 2005 Mar 15 # Oral Time @@ -1629,7 +1638,7 @@ Zone Asia/Oral 3:25:24 - LMT 1924 May 2 # From Paul Eggert (2005-08-15): # According to an article dated today in the Kyrgyzstan Development Gateway -# +# http://eng.gateway.kg/cgi-bin/page.pl?id=1&story_name=doc9979.shtml # Kyrgyzstan is canceling the daylight saving time system. I take the article # to mean that they will leave their clocks at 6 hours ahead of UTC. # From Malik Abdugaliev (2005-09-21): @@ -1644,17 +1653,17 @@ Rule Kyrgyz 1997 2004 - Oct lastSun 2:30 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2 5:00 - FRUT 1930 Jun 21 # Frunze Time - 6:00 RussiaAsia FRU%sT 1991 Mar 31 2:00s - 5:00 1:00 FRUST 1991 Aug 31 2:00 # independence - 5:00 Kyrgyz KG%sT 2005 Aug 12 # Kyrgyzstan Time + 6:00 RussiaAsia FRU%sT 1991 Mar 31 2:00s + 5:00 1:00 FRUST 1991 Aug 31 2:00 # independence + 5:00 Kyrgyz KG%sT 2005 Aug 12 # Kyrgyzstan Time 6:00 - KGT ############################################################################### # Korea (North and South) -# From Annie I. Bang (2006-07-10) in -# : +# From Annie I. Bang (2006-07-10): +# http://www.koreaherald.co.kr/SITE/data/html_dir/2006/07/10/200607100012.asp # The Ministry of Commerce, Industry and Energy has already # commissioned a research project [to reintroduce DST] and has said # the system may begin as early as 2008.... Korea ran a daylight @@ -1702,12 +1711,8 @@ Zone Asia/Kuwait 3:11:56 - LMT 1950 3:00 - AST # Laos -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Vientiane 6:50:24 - LMT 1906 Jun 9 # or Viangchan - 7:06:20 - SMT 1911 Mar 11 0:01 # Saigon MT? - 7:00 - ICT 1912 May - 8:00 - ICT 1931 May - 7:00 - ICT +# See Asia/Bangkok. + # Lebanon # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -1745,8 +1750,8 @@ Rule NBorneo 1935 1941 - Sep 14 0:00 0:2 Rule NBorneo 1935 1941 - Dec 14 0:00 0 - # # peninsular Malaysia -# The data here are taken from Mok Ly Yng (2003-10-30) -# . +# taken from Mok Ly Yng (2003-10-30) +# http://www.math.nus.edu.sg/aslaksen/teaching/timezone.html # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Kuala_Lumpur 6:46:46 - LMT 1901 Jan 1 6:55:25 - SMT 1905 Jun 1 # Singapore M.T. @@ -1758,12 +1763,12 @@ Zone Asia/Kuala_Lumpur 6:46:46 - LMT 190 7:30 - MALT 1982 Jan 1 8:00 - MYT # Malaysia Time # Sabah & Sarawak -# From Paul Eggert (2006-03-22): -# The data here are mostly from Shanks & Pottenger, but the 1942, 1945 and 1982 -# transition dates are from Mok Ly Yng. +# From Paul Eggert (2014-08-12): +# The data entries here are mostly from Shanks & Pottenger, but the 1942, 1945 +# and 1982 transition dates are from Mok Ly Yng. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Kuching 7:21:20 - LMT 1926 Mar - 7:30 - BORT 1933 # Borneo Time + 7:30 - BORT 1933 # Borneo Time 8:00 NBorneo BOR%sT 1942 Feb 16 9:00 - JST 1945 Sep 12 8:00 - BORT 1982 Jan 1 @@ -1771,9 +1776,9 @@ Zone Asia/Kuching 7:21:20 - LMT 1926 Mar # Maldives # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Maldives 4:54:00 - LMT 1880 # Male - 4:54:00 - MMT 1960 # Male Mean Time - 5:00 - MVT # Maldives Time +Zone Indian/Maldives 4:54:00 - LMT 1880 # Male + 4:54:00 - MMT 1960 # Male Mean Time + 5:00 - MVT # Maldives Time # Mongolia @@ -1835,7 +1840,7 @@ Zone Indian/Maldives 4:54:00 - LMT 1880 # Oscar van Vlijmen (2005-05-20) reports that the Mongolian Embassy in # Washington, DC says there are two time zones, with DST observed. # He also found *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 06:12:12 2014 Return-Path: Delivered-To: svn-src-all@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 EF40B2D1; Mon, 27 Oct 2014 06:12: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 DA295E71; Mon, 27 Oct 2014 06:12: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 s9R6CBM9082160; Mon, 27 Oct 2014 06:12:11 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9R6CBwC082156; Mon, 27 Oct 2014 06:12:11 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201410270612.s9R6CBwC082156@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Mon, 27 Oct 2014 06:12:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r273720 - stable/9/contrib/tzdata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 06:12:12 -0000 Author: edwin Date: Mon Oct 27 06:12:10 2014 New Revision: 273720 URL: https://svnweb.freebsd.org/changeset/base/273720 Log: MFC of 273718, tzdata2014i Upgrade to 2014i Lots of historical data Pacific/Fiji will go into DST from 2014-11-02 to 2015-01-18 Pacific/Bougainville will go from UTC+10 to UTC+11. Europe/Minsk will go from FET to MSK. Modified: stable/9/contrib/tzdata/africa stable/9/contrib/tzdata/antarctica stable/9/contrib/tzdata/asia stable/9/contrib/tzdata/australasia stable/9/contrib/tzdata/backward stable/9/contrib/tzdata/europe stable/9/contrib/tzdata/northamerica stable/9/contrib/tzdata/southamerica stable/9/contrib/tzdata/zone.tab stable/9/contrib/tzdata/zone1970.tab Directory Properties: stable/9/contrib/tzdata/ (props changed) Modified: stable/9/contrib/tzdata/africa ============================================================================== --- stable/9/contrib/tzdata/africa Mon Oct 27 06:05:40 2014 (r273719) +++ stable/9/contrib/tzdata/africa Mon Oct 27 06:12:10 2014 (r273720) @@ -1,9 +1,10 @@ # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. -# This data is by no means authoritative; if you think you know better, +# This file is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@iana.org for general use in the future). +# tz@iana.org for general use in the future). For more, please see +# the file CONTRIBUTING in the tz distribution. # From Paul Eggert (2013-02-21): # @@ -25,8 +26,8 @@ # I found in the UCLA library. # # For data circa 1899, a common source is: -# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 -# . +# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94. +# http://www.jstor.org/stable/1774359 # # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). @@ -93,9 +94,9 @@ Rule Algeria 1980 only - Oct 31 2:00 0 # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's # more precise 0:09:21. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 15 0:01 - 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time - 0:00 Algeria WE%sT 1940 Feb 25 2:00 +Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 15 0:01 + 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time + 0:00 Algeria WE%sT 1940 Feb 25 2:00 1:00 Algeria CE%sT 1946 Oct 7 0:00 - WET 1956 Jan 29 1:00 - CET 1963 Apr 14 @@ -105,82 +106,57 @@ Zone Africa/Algiers 0:12:12 - LMT 1891 M 1:00 - CET # Angola -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Luanda 0:52:56 - LMT 1892 - 0:52:04 - AOT 1911 May 26 # Angola Time - 1:00 - WAT - # Benin -# Whitman says they switched to 1:00 in 1946, not 1934; -# go with Shanks & Pottenger. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Porto-Novo 0:10:28 - LMT 1912 - 0:00 - GMT 1934 Feb 26 - 1:00 - WAT +# See Africa/Lagos. # Botswana -# From Paul Eggert (2013-02-21): -# Milne says they were regulated by the Cape Town Signal in 1899; -# assume they switched to 2:00 when Cape Town did. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Gaborone 1:43:40 - LMT 1885 - 1:30 - SAST 1903 Mar - 2:00 - CAT 1943 Sep 19 2:00 - 2:00 1:00 CAST 1944 Mar 19 2:00 - 2:00 - CAT +# See Africa/Maputo. # Burkina Faso # See Africa/Abidjan. # Burundi -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Bujumbura 1:57:28 - LMT 1890 - 2:00 - CAT +# See Africa/Maputo. # Cameroon -# Whitman says they switched to 1:00 in 1920; go with Shanks & Pottenger. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Douala 0:38:48 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. # Cape Verde +# +# Shanks gives 1907 for the transition to CVT. +# Perhaps the 1911-05-26 Portuguese decree +# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# merely made it official? +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Atlantic/Cape_Verde -1:34:04 - LMT 1907 # Praia +Zone Atlantic/Cape_Verde -1:34:04 - LMT 1907 # Praia -2:00 - CVT 1942 Sep -2:00 1:00 CVST 1945 Oct 15 - -2:00 - CVT 1975 Nov 25 2:00 + -2:00 - CVT 1975 Nov 25 2:00 -1:00 - CVT # Central African Republic -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Bangui 1:14:20 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. # Chad # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena +Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena 1:00 - WAT 1979 Oct 14 1:00 1:00 WAST 1980 Mar 8 1:00 - WAT # Comoros # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Comoro 2:53:04 - LMT 1911 Jul # Moroni, Gran Comoro +Zone Indian/Comoro 2:53:04 - LMT 1911 Jul # Moroni, Gran Comoro 3:00 - EAT -# Democratic Republic of Congo -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Kinshasa 1:01:12 - LMT 1897 Nov 9 - 1:00 - WAT -Zone Africa/Lubumbashi 1:49:52 - LMT 1897 Nov 9 - 2:00 - CAT +# Democratic Republic of the Congo +# See Africa/Lagos for the western part and Africa/Maputo for the eastern. # Republic of the Congo -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Brazzaville 1:01:08 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. -# Côte D'Ivoire / Ivory Coast +# Côte d'Ivoire / Ivory Coast # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Abidjan -0:16:08 - LMT 1912 0:00 - GMT @@ -327,7 +303,7 @@ Rule Egypt 2007 only - Sep Thu>=1 24:00 # Egypt is to change back to Daylight system on May 15 # http://english.ahram.org.eg/NewsContent/1/64/100735/Egypt/Politics-/Egypts-government-to-reapply-daylight-saving-time-.aspx -# From Gunther Vermier (2015-05-13): +# From Gunther Vermier (2014-05-13): # our Egypt office confirms that the change will be at 15 May "midnight" (24:00) # From Imed Chihi (2014-06-04): @@ -408,16 +384,13 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct 2:00 Egypt EE%sT # Equatorial Guinea -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Malabo 0:35:08 - LMT 1912 - 0:00 - GMT 1963 Dec 15 - 1:00 - WAT +# See Africa/Lagos. # Eritrea # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Asmara 2:35:32 - LMT 1870 - 2:35:32 - AMT 1890 # Asmara Mean Time - 2:35:20 - ADMT 1936 May 5 # Adis Dera MT + 2:35:32 - AMT 1890 # Asmara Mean Time + 2:35:20 - ADMT 1936 May 5 # Adis Dera MT 3:00 - EAT # Ethiopia @@ -429,16 +402,15 @@ Zone Africa/Asmara 2:35:32 - LMT 1870 # Shanks & Pottenger write that Ethiopia had six narrowly-spaced time # zones between 1870 and 1890, that they merged to 38E50 (2:35:20) in # 1890, and that they switched to 3:00 on 1936-05-05. Perhaps 38E50 -# was for Adis Dera. Quite likely the Shanks data are wrong anyway. +# was for Adis Dera. Quite likely the Shanks data entries are wrong +# anyway. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Addis_Ababa 2:34:48 - LMT 1870 - 2:35:20 - ADMT 1936 May 5 # Adis Dera MT + 2:35:20 - ADMT 1936 May 5 # Adis Dera MT 3:00 - EAT # Gabon -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Libreville 0:37:48 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. # Gambia # See Africa/Abidjan. @@ -461,8 +433,14 @@ Zone Africa/Accra -0:00:52 - LMT 1918 # See Africa/Abidjan. # Guinea-Bissau +# +# Shanks gives 1911-05-26 for the transition to WAT, +# evidently confusing the date of the Portuguese decree +# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# with the date that it took effect, namely 1912-01-01. +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Bissau -1:02:20 - LMT 1911 May 26 +Zone Africa/Bissau -1:02:20 - LMT 1912 Jan 1 -1:00 - WAT 1975 0:00 - GMT @@ -475,11 +453,7 @@ Zone Africa/Nairobi 2:27:16 - LMT 1928 J 3:00 - EAT # Lesotho -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Maseru 1:50:00 - LMT 1903 Mar - 2:00 - SAST 1943 Sep 19 2:00 - 2:00 1:00 SAST 1944 Mar 19 2:00 - 2:00 - SAST +# See Africa/Johannesburg. # Liberia # From Paul Eggert (2006-03-22): @@ -546,11 +520,11 @@ Zone Africa/Tripoli 0:52:44 - LMT 1920 2:00 - EET 1982 1:00 Libya CE%sT 1990 May 4 # The 1996 and 1997 entries are from Shanks & Pottenger; -# the IATA SSIM data contain some obvious errors. +# the IATA SSIM data entries contain some obvious errors. 2:00 - EET 1996 Sep 30 1:00 Libya CE%sT 1997 Oct 4 - 2:00 - EET 2012 Nov 10 2:00 - 1:00 Libya CE%sT 2013 Oct 25 2:00 + 2:00 - EET 2012 Nov 10 2:00 + 1:00 Libya CE%sT 2013 Oct 25 2:00 2:00 - EET # Madagascar @@ -561,9 +535,7 @@ Zone Indian/Antananarivo 3:10:04 - LMT 1 3:00 - EAT # Malawi -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Blantyre 2:20:00 - LMT 1903 Mar - 2:00 - CAT +# See Africa/Maputo. # Mali # Mauritania @@ -606,7 +578,7 @@ Zone Africa/Blantyre 2:20:00 - LMT 1903 # From Alex Krivenyshev (2008-07-11): # Seems that English language article "The revival of daylight saving -# time: Energy conservation?"-# No. 16578 (07/11/2008) was originally +# time: Energy conservation?"-# No. 16578 (07/11/2008) was originally # published on Monday, June 30, 2008... # # I guess that article in French "Le gouvernement avance l'introduction @@ -657,14 +629,14 @@ Rule Mauritius 1983 only - Mar 21 0:00 0 Rule Mauritius 2008 only - Oct lastSun 2:00 1:00 S Rule Mauritius 2009 only - Mar lastSun 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis +Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis 4:00 Mauritius MU%sT # Mauritius Time # Agalega Is, Rodriguez # no information; probably like Indian/Mauritius # Mayotte # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou +Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou 3:00 - EAT # Morocco @@ -682,7 +654,8 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # http://en.afrik.com/news11892.html # From Alex Krivenyshev (2008-05-09): -# The Morocco time change can be confirmed on Morocco web site Maghreb Arabe Presse: +# The Morocco time change can be confirmed on Morocco web site Maghreb Arabe +# Presse: # http://www.map.ma/eng/sections/box3/morocco_shifts_to_da/view # # Morocco shifts to daylight time on June 1st through September 27, Govt. @@ -760,8 +733,8 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # From Dan Abitol (2011-03-30): # ...Rules for Africa/Casablanca are the following (24h format) -# The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00 -# The 31th july 2011 at 00:59:59, [it] will be 31th July 00:00:00 +# The 3rd April 2011 at 00:00:00, [it] will be 3rd April 01:00:00 +# The 31st July 2011 at 00:59:59, [it] will be 31st July 00:00:00 # ...Official links of change in morocco # The change was broadcast on the FM Radio # I ve called ANRT (telecom regulations in Morocco) at @@ -831,7 +804,7 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # announced a bit in advance. On 2012-07-11 the Moroccan government # announced that year's Ramadan daylight-saving transitions would be # 2012-07-20 and 2012-08-20; see -# . +# http://www.mmsp.gov.ma/fr/actualites.aspx?id=288 # From Andrew Paprocki (2013-07-02): # Morocco announced that the year's Ramadan daylight-savings @@ -963,16 +936,29 @@ Zone Africa/El_Aaiun -0:52:48 - LMT 1934 0:00 Morocco WE%sT # Mozambique +# +# Shanks gives 1903-03-01 for the transition to CAT. +# Perhaps the 1911-05-26 Portuguese decree +# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# merely made it official? +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Maputo 2:10:20 - LMT 1903 Mar 2:00 - CAT +Link Africa/Maputo Africa/Blantyre # Malawi +Link Africa/Maputo Africa/Bujumbura # Burundi +Link Africa/Maputo Africa/Gaborone # Botswana +Link Africa/Maputo Africa/Harare # Zimbabwe +Link Africa/Maputo Africa/Kigali # Rwanda +Link Africa/Maputo Africa/Lubumbashi # E Dem. Rep. of Congo +Link Africa/Maputo Africa/Lusaka # Zambia # Namibia # The 1994-04-03 transition is from Shanks & Pottenger. # Shanks & Pottenger report no DST after 1998-04; go with IATA. -# From Petronella Sibeene (2007-03-30) in -# : +# From Petronella Sibeene (2007-03-30): +# http://allafrica.com/stories/200703300178.html # While the entire country changes its time, Katima Mulilo and other # settlements in Caprivi unofficially will not because the sun there # rises and sets earlier compared to other regions. Chief of @@ -989,28 +975,33 @@ Rule Namibia 1994 max - Sep Sun>=1 2:00 Rule Namibia 1995 max - Apr Sun>=1 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Windhoek 1:08:24 - LMT 1892 Feb 8 - 1:30 - SWAT 1903 Mar # SW Africa Time - 2:00 - SAST 1942 Sep 20 2:00 - 2:00 1:00 SAST 1943 Mar 21 2:00 + 1:30 - SWAT 1903 Mar # SW Africa Time + 2:00 - SAST 1942 Sep 20 2:00 + 2:00 1:00 SAST 1943 Mar 21 2:00 2:00 - SAST 1990 Mar 21 # independence 2:00 - CAT 1994 Apr 3 1:00 Namibia WA%sT # Niger -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Niamey 0:08:28 - LMT 1912 - -1:00 - WAT 1934 Feb 26 - 0:00 - GMT 1960 - 1:00 - WAT +# See Africa/Lagos. # Nigeria # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Lagos 0:13:36 - LMT 1919 Sep 1:00 - WAT +Link Africa/Lagos Africa/Bangui # Central African Republic +Link Africa/Lagos Africa/Brazzaville # Rep. of the Congo +Link Africa/Lagos Africa/Douala # Cameroon +Link Africa/Lagos Africa/Kinshasa # Dem. Rep. of the Congo (west) +Link Africa/Lagos Africa/Libreville # Gabon +Link Africa/Lagos Africa/Luanda # Angola +Link Africa/Lagos Africa/Malabo # Equatorial Guinea +Link Africa/Lagos Africa/Niamey # Niger +Link Africa/Lagos Africa/Porto-Novo # Benin # Réunion # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Denis +Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Denis 4:00 - RET # Réunion Time # # Crozet Islands also observes Réunion time; see the 'antarctica' file. @@ -1028,9 +1019,7 @@ Zone Indian/Reunion 3:41:52 - LMT 1911 J # Tromelin - inhabited until at least 1958 # Rwanda -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Kigali 2:00:16 - LMT 1935 Jun - 2:00 - CAT +# See Africa/Maputo. # St Helena # See Africa/Abidjan. @@ -1047,7 +1036,7 @@ Zone Africa/Kigali 2:00:16 - LMT 1935 Ju # Seychelles # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria +Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria 4:00 - SCT # Seychelles Time # From Paul Eggert (2001-05-30): # Aldabra, Farquhar, and Desroches, originally dependencies of the @@ -1074,6 +1063,9 @@ Rule SA 1943 1944 - Mar Sun>=15 2:00 0 - Zone Africa/Johannesburg 1:52:00 - LMT 1892 Feb 8 1:30 - SAST 1903 Mar 2:00 SA SAST +Link Africa/Johannesburg Africa/Maseru # Lesotho +Link Africa/Johannesburg Africa/Mbabane # Swaziland +# # Marion and Prince Edward Is # scientific station since 1947 # no information @@ -1101,9 +1093,7 @@ Zone Africa/Khartoum 2:10:08 - LMT 1931 Link Africa/Khartoum Africa/Juba # Swaziland -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Mbabane 2:04:24 - LMT 1903 Mar - 2:00 - SAST +# See Africa/Johannesburg. # Tanzania # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1128,7 +1118,7 @@ Zone Africa/Dar_es_Salaam 2:37:08 - LMT # # From Oscar van Vlijmen (2005-05-02): # La Presse, the first national daily newspaper ... -# +# http://www.lapresse.tn/archives/archives280405/actualites/lheure.html # ... DST for 2005: on: Sun May 1 0h standard time, off: Fri Sept. 30, # 1h standard time. # @@ -1212,7 +1202,7 @@ Rule Tunisia 2006 2008 - Oct lastSun 2: # Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Tunis 0:40:44 - LMT 1881 May 12 - 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time + 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time 1:00 Tunisia CE%sT # Uganda @@ -1224,11 +1214,5 @@ Zone Africa/Kampala 2:09:40 - LMT 1928 J 3:00 - EAT # Zambia -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Lusaka 1:53:08 - LMT 1903 Mar - 2:00 - CAT - # Zimbabwe -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Harare 2:04:12 - LMT 1903 Mar - 2:00 - CAT +# See Africa/Maputo. Modified: stable/9/contrib/tzdata/antarctica ============================================================================== --- stable/9/contrib/tzdata/antarctica Mon Oct 27 06:05:40 2014 (r273719) +++ stable/9/contrib/tzdata/antarctica Mon Oct 27 06:12:10 2014 (r273720) @@ -4,10 +4,10 @@ # From Paul Eggert (1999-11-15): # To keep things manageable, we list only locations occupied year-round; see # COMNAP - Stations and Bases -# +# http://www.comnap.aq/comnap/comnap.nsf/P/Stations/ # and # Summary of the Peri-Antarctic Islands (1998-07-23) -# +# http://www.spri.cam.ac.uk/bob/periant.htm # for information. # Unless otherwise specified, we have no time zone information. # @@ -63,7 +63,7 @@ Rule ChileAQ 2012 max - Sep Sun>=2 4:00u # Heard Island, McDonald Islands (uninhabited) # previously sealers and scientific personnel wintered # Margaret Turner reports -# +# http://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html # (1999-09-30) that they're UTC+5, with no DST; # presumably this is when they have visitors. # @@ -103,32 +103,30 @@ Rule ChileAQ 2012 max - Sep Sun>=2 4:00u # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Antarctica/Casey 0 - zzz 1969 - 8:00 - AWST 2009 Oct 18 2:00 + 8:00 - AWST 2009 Oct 18 2:00 # Australian Western Std Time - 11:00 - CAST 2010 Mar 5 2:00 - # Casey Time - 8:00 - AWST 2011 Oct 28 2:00 + 11:00 - CAST 2010 Mar 5 2:00 # Casey Time + 8:00 - AWST 2011 Oct 28 2:00 11:00 - CAST 2012 Feb 21 17:00u 8:00 - AWST Zone Antarctica/Davis 0 - zzz 1957 Jan 13 - 7:00 - DAVT 1964 Nov # Davis Time + 7:00 - DAVT 1964 Nov # Davis Time 0 - zzz 1969 Feb - 7:00 - DAVT 2009 Oct 18 2:00 + 7:00 - DAVT 2009 Oct 18 2:00 5:00 - DAVT 2010 Mar 10 20:00u - 7:00 - DAVT 2011 Oct 28 2:00 + 7:00 - DAVT 2011 Oct 28 2:00 5:00 - DAVT 2012 Feb 21 20:00u 7:00 - DAVT Zone Antarctica/Mawson 0 - zzz 1954 Feb 13 - 6:00 - MAWT 2009 Oct 18 2:00 - # Mawson Time + 6:00 - MAWT 2009 Oct 18 2:00 # Mawson Time 5:00 - MAWT # References: # Casey Weather (1998-02-26) -# +# http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html # Davis Station, Antarctica (1998-02-26) -# +# http://www.antdiv.gov.au/aad/exop/sfo/davis/video.html # Mawson Station, Antarctica (1998-02-25) -# +# http://www.antdiv.gov.au/aad/exop/sfo/mawson/video.html # Belgium - year-round base # Princess Elisabeth, Queen Maud Land, -713412+0231200, since 2007 @@ -154,7 +152,7 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb # France - year-round bases (also see "France & Italy") # # From Antoine Leca (1997-01-20): -# Time data are from Nicole Pailleau at the IFRTP +# Time data entries are from Nicole Pailleau at the IFRTP # (French Institute for Polar Research and Technology). # She confirms that French Southern Territories and Terre Adélie bases # don't observe daylight saving time, even if Terre Adélie supplies came @@ -174,7 +172,7 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb # fishing stations operated variously 1819/1931 # # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Kerguelen 0 - zzz 1950 # Port-aux-Français +Zone Indian/Kerguelen 0 - zzz 1950 # Port-aux-Français 5:00 - TFT # ISO code TF Time # # year-round base in the main continent @@ -217,7 +215,7 @@ Zone Antarctica/Syowa 0 - zzz 1957 Jan 2 3:00 - SYOT # Syowa Time # See: # NIPR Antarctic Research Activities (1999-08-17) -# +# http://www.nipr.ac.jp/english/ara01.html # S Korea - year-round base # Jang Bogo, Terra Nova Bay, -743700+1641205 since 2014 @@ -264,7 +262,7 @@ Rule Troll 2005 max - Mar lastSun 1:00u Rule Troll 2004 max - Oct lastSun 1:00u 0:00 UTC # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Antarctica/Troll 0 - zzz 2005 Feb 12 - 0:00 Troll %s + 0:00 Troll %s # Poland - year-round base # Arctowski, King George Island, -620945-0582745, since 1977 @@ -281,8 +279,8 @@ Zone Antarctica/Troll 0 - zzz 2005 Feb 1 # year-round from 1960/61 to 1992 # Vostok, since 1957-12-16, temporarily closed 1994-02/1994-11 -# From Craig Mundell (1994-12-15) -# : +# From Craig Mundell (1994-12-15): +# http://quest.arc.nasa.gov/antarctica/QA/computers/Directions,Time,ZIP # Vostok, which is one of the Russian stations, is set on the same # time as Moscow, Russia. # Modified: stable/9/contrib/tzdata/asia ============================================================================== --- stable/9/contrib/tzdata/asia Mon Oct 27 06:05:40 2014 (r273719) +++ stable/9/contrib/tzdata/asia Mon Oct 27 06:12:10 2014 (r273720) @@ -1,9 +1,10 @@ # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. -# This data is by no means authoritative; if you think you know better, +# This file is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@iana.org for general use in the future). +# tz@iana.org for general use in the future). For more, please see +# the file CONTRIBUTING in the tz distribution. # From Paul Eggert (2013-08-11): # @@ -25,8 +26,12 @@ # I found in the UCLA library. # # For data circa 1899, a common source is: -# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 -# . +# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94. +# http://www.jstor.org/stable/1774359 +# +# For Russian data circa 1919, a source is: +# Byalokoz EL. New Counting of Time in Russia since July 1, 1919. +# (See the 'europe' file for a fuller citation.) # # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). @@ -42,10 +47,11 @@ # 3:30 IRST IRDT Iran # 4:00 GST Gulf* # 5:30 IST India -# 7:00 ICT Indochina* +# 7:00 ICT Indochina, most times and locations* # 7:00 WIB west Indonesia (Waktu Indonesia Barat) # 8:00 WITA central Indonesia (Waktu Indonesia Tengah) # 8:00 CST China +# 8:00 IDT Indochina, 1943-45, 1947-55, 1960-75 (some locations)* # 8:00 JWST Western Standard Time (Japan, 1896/1937)* # 9:00 JCST Central Standard Time (Japan, 1896/1937) # 9:00 WIT east Indonesia (Waktu Indonesia Timur) @@ -115,11 +121,11 @@ Zone Asia/Kabul 4:36:48 - LMT 1890 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2 3:00 - YERT 1957 Mar # Yerevan Time - 4:00 RussiaAsia YER%sT 1991 Mar 31 2:00s + 4:00 RussiaAsia YER%sT 1991 Mar 31 2:00s 3:00 1:00 YERST 1991 Sep 23 # independence - 3:00 RussiaAsia AM%sT 1995 Sep 24 2:00s + 3:00 RussiaAsia AM%sT 1995 Sep 24 2:00s 4:00 - AMT 1997 - 4:00 RussiaAsia AM%sT 2012 Mar 25 2:00s + 4:00 RussiaAsia AM%sT 2012 Mar 25 2:00s 4:00 - AMT # Azerbaijan @@ -132,16 +138,16 @@ Rule Azer 1997 max - Oct lastSun 5:00 0 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Baku 3:19:24 - LMT 1924 May 2 3:00 - BAKT 1957 Mar # Baku Time - 4:00 RussiaAsia BAK%sT 1991 Mar 31 2:00s + 4:00 RussiaAsia BAK%sT 1991 Mar 31 2:00s 3:00 1:00 BAKST 1991 Aug 30 # independence 3:00 RussiaAsia AZ%sT 1992 Sep lastSat 23:00 - 4:00 - AZT 1996 # Azerbaijan time + 4:00 - AZT 1996 # Azerbaijan Time 4:00 EUAsia AZ%sT 1997 4:00 Azer AZ%sT # Bahrain # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah +Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah 4:00 - GST 1972 Jun 3:00 - AST @@ -219,7 +225,7 @@ Zone Asia/Bahrain 3:22:20 - LMT 1920 # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Dhaka 2009 only - Jun 19 23:00 1:00 S -Rule Dhaka 2009 only - Dec 31 23:59 0 - +Rule Dhaka 2009 only - Dec 31 24:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Dhaka 6:01:40 - LMT 1890 @@ -250,7 +256,7 @@ Zone Indian/Chagos 4:49:40 - LMT 1907 # Brunei # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan +Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan 7:30 - BNT 1933 8:00 - BNT @@ -259,19 +265,15 @@ Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Milne says 6:24:40 was the meridian of the time ball observatory at Rangoon. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Rangoon 6:24:40 - LMT 1880 # or Yangon - 6:24:40 - RMT 1920 # Rangoon Mean Time? - 6:30 - BURT 1942 May # Burma Time - 9:00 - JST 1945 May 3 - 6:30 - MMT # Myanmar Time +Zone Asia/Rangoon 6:24:40 - LMT 1880 # or Yangon + 6:24:40 - RMT 1920 # Rangoon Mean Time? + 6:30 - BURT 1942 May # Burma Time + 9:00 - JST 1945 May 3 + 6:30 - MMT # Myanmar Time # Cambodia -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Phnom_Penh 6:59:40 - LMT 1906 Jun 9 - 7:06:20 - SMT 1911 Mar 11 0:01 # Saigon MT? - 7:00 - ICT 1912 May - 8:00 - ICT 1931 May - 7:00 - ICT +# See Asia/Bangkok. + # China @@ -356,8 +358,8 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1: # * The Republic of China instituted Beijing mean solar time effective # the official calendar book of 1914. # * The French Concession in Shanghai set up signal stations in -# French docks in the 1890s, controled by Xujiahui (Zikawei) -# Obervatory and set to local mean time. +# French docks in the 1890s, controlled by Xujiahui (Zikawei) +# Observatory and set to local mean time. # * "From the end of the 19th century" it changed to UT+8. # * Chinese Customs (by then reduced to a tool of foreign powers) # eventually standardized on this time for all ports, and it @@ -381,7 +383,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1: # Xujiahui Observatory was under French control and stuck with UT+8. # # In earlier versions of this file, China had many separate Zone entries, but -# this was based on what was apparently incorrect data in Shanks & Pottenger. +# this was based on what were apparently incorrect data in Shanks & Pottenger. # This has now been simplified to the two entries Asia/Shanghai and # Asia/Urumqi, with the others being links for backward compatibility. # Proposed in 1918 and theoretically in effect until 1949 (although in practice @@ -501,7 +503,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1: # "The Working-Calendar for The Xinjiang Uygur Autonomous Region Government" # (2014-04-22). # Unfortunately, we have no good records of time in Xinjiang before 1986. -# During the 20th century parts of Xinjiang were ruled by the Qing dyansty, +# During the 20th century parts of Xinjiang were ruled by the Qing dynasty, # the Republic of China, various warlords, the First and Second East Turkestan # Republics, the Soviet Union, the Kuomintang, and the People's Republic of # China, and tracking down all these organizations' timekeeping rules would be @@ -698,19 +700,19 @@ Zone Asia/Hong_Kong 7:36:42 - LMT 1904 O # Central Weather Bureau website was not correct. # # Original Bulletin: -# -# (cont.) +# http://subtpg.tpg.gov.tw/og/image2.asp?f=03502F0AKM1AF +# http://subtpg.tpg.gov.tw/og/image2.asp?f=0350300AKM1B0 (cont.) # # In 1947, DST in Taiwan was expanded to Oct 31. There is a backup of that # telegram announcement from Taiwan Province Government: # -# +# http://subtpg.tpg.gov.tw/og/image2.asp?f=0360310AKZ431 # # Here is a brief translation: # # The Summer Time this year is adopted from midnight Apr 15 until Sep 20 # midnight. To save (energy?) consumption, we're expanding Summer Time -# adption till Oct 31 midnight. +# adoption till Oct 31 midnight. # # The Central Weather Bureau website didn't mention that, however it can # be found from historical government announcement database. @@ -741,7 +743,7 @@ Rule Taiwan 1979 only - Oct 1 0:00 0 S # Taipei or Taibei or T'ai-pei Zone Asia/Taipei 8:06:00 - LMT 1896 Jan 1 8:00 - JWST 1937 Oct 1 - 9:00 - JST 1945 Sep 21 01:00 + 9:00 - JST 1945 Sep 21 1:00 8:00 Taiwan C%sT # Macau (Macao, Aomen) @@ -761,7 +763,7 @@ Rule Macau 1975 1977 - Apr Sun>=15 3:30 Rule Macau 1978 1980 - Apr Sun>=15 0:00 1:00 S Rule Macau 1978 1980 - Oct Sun>=15 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Macau 7:34:20 - LMT 1912 +Zone Asia/Macau 7:34:20 - LMT 1912 Jan 1 8:00 Macau MO%sT 1999 Dec 20 # return to China 8:00 PRC C%sT @@ -823,20 +825,22 @@ Link Asia/Nicosia Europe/Nicosia # I don't know what can be done, especially knowing that some years ago our # DST rules where changed THREE TIMES during one month. -# Milne says Tbilisi (Tiflis) time was 2:59:05.7; round to nearest.) +# Milne 1899 says Tbilisi (Tiflis) time was 2:59:05.7. +# Byalokoz 1919 says Georgia was 2:59:11. +# Go with Byalokoz. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Tbilisi 2:59:06 - LMT 1880 - 2:59:06 - TBMT 1924 May 2 # Tbilisi Mean Time +Zone Asia/Tbilisi 2:59:11 - LMT 1880 + 2:59:11 - TBMT 1924 May 2 # Tbilisi Mean Time 3:00 - TBIT 1957 Mar # Tbilisi Time - 4:00 RussiaAsia TBI%sT 1991 Mar 31 2:00s + 4:00 RussiaAsia TBI%sT 1991 Mar 31 2:00s 3:00 1:00 TBIST 1991 Apr 9 # independence - 3:00 RussiaAsia GE%sT 1992 # Georgia Time + 3:00 RussiaAsia GE%sT 1992 # Georgia Time 3:00 E-EurAsia GE%sT 1994 Sep lastSun 4:00 E-EurAsia GE%sT 1996 Oct lastSun 4:00 1:00 GEST 1997 Mar lastSun 4:00 E-EurAsia GE%sT 2004 Jun 27 - 3:00 RussiaAsia GE%sT 2005 Mar lastSun 2:00 + 3:00 RussiaAsia GE%sT 2005 Mar lastSun 2:00 4:00 - GET # East Timor @@ -864,16 +868,16 @@ Zone Asia/Tbilisi 2:59:06 - LMT 1880 # midnight on Saturday, September 16. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Dili 8:22:20 - LMT 1912 +Zone Asia/Dili 8:22:20 - LMT 1912 Jan 1 8:00 - TLT 1942 Feb 21 23:00 # E Timor Time 9:00 - JST 1945 Sep 23 9:00 - TLT 1976 May 3 - 8:00 - WITA 2000 Sep 17 00:00 + 8:00 - WITA 2000 Sep 17 0:00 9:00 - TLT # India # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata +Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata 5:53:20 - HMT 1941 Oct # Howrah Mean Time? 6:30 - BURT 1942 May 15 # Burma Time 5:30 - IST 1942 Sep @@ -886,8 +890,12 @@ Zone Asia/Kolkata 5:53:28 - LMT 1880 # K # Indonesia # +# From Paul Eggert (2014-09-06): +# The 1876 Report of the Secretary of the [US] Navy, p 306 says that Batavia +# civil time was 7:07:12.5; round to even for Jakarta. +# # From Gwillim Law (2001-05-28), overriding Shanks & Pottenger: -# +# http://www.sumatera-inc.com/go_to_invest/about_indonesia.asp#standtime # says that Indonesia's time zones changed on 1988-01-01. Looking at some # time zone maps, I think that must refer to Western Borneo (Kalimantan Barat # and Kalimantan Tengah) switching from UTC+8 to UTC+7. @@ -924,7 +932,7 @@ Zone Asia/Jakarta 7:07:12 - LMT 1867 Aug # Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13, # but this must be a typo. 7:07:12 - BMT 1923 Dec 31 23:47:12 # Batavia - 7:20 - JAVT 1932 Nov # Java Time + 7:20 - JAVT 1932 Nov # Java Time 7:30 - WIB 1942 Mar 23 9:00 - JST 1945 Sep 23 7:30 - WIB 1948 May @@ -1082,7 +1090,7 @@ Rule Iran 2036 2037 - Mar 21 0:00 1:00 D Rule Iran 2036 2037 - Sep 21 0:00 0 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tehran 3:25:44 - LMT 1916 - 3:25:44 - TMT 1946 # Tehran Mean Time + 3:25:44 - TMT 1946 # Tehran Mean Time 3:30 - IRST 1977 Nov 4:00 Iran IR%sT 1979 3:30 Iran IR%sT @@ -1127,7 +1135,7 @@ Rule Iraq 1991 2007 - Apr 1 3:00s 1:00 Rule Iraq 1991 2007 - Oct 1 3:00s 0 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Baghdad 2:57:40 - LMT 1890 - 2:57:36 - BMT 1918 # Baghdad Mean Time? + 2:57:36 - BMT 1918 # Baghdad Mean Time? 3:00 - AST 1982 May 3:00 Iraq A%sT @@ -1355,7 +1363,7 @@ Rule Zion 2013 max - Oct lastSun 2:00 0 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Jerusalem 2:20:54 - LMT 1880 - 2:20:40 - JMT 1918 # Jerusalem Mean Time? + 2:20:40 - JMT 1918 # Jerusalem Mean Time? 2:00 Zion I%sT @@ -1371,8 +1379,8 @@ Zone Asia/Jerusalem 2:20:54 - LMT 1880 # daylight saving between 1948 and 1951, but "the system was discontinued # because the public believed it would lead to longer working hours." -# From Mayumi Negishi in the 2005-08-10 Japan Times -# : +# From Mayumi Negishi in the 2005-08-10 Japan Times: +# http://www.japantimes.co.jp/cgi-bin/getarticle.pl5?nn20050810f2.htm # Occupation authorities imposed daylight-saving time on Japan on # [1948-05-01].... But lack of prior debate and the execution of # daylight-saving time just three days after the bill was passed generated @@ -1396,7 +1404,8 @@ Rule Japan 1950 1951 - May Sun>=1 2:00 1 # From Hideyuki Suzuki (1998-11-09): # 'Tokyo' usually stands for the former location of Tokyo Astronomical -# Observatory: 139 degrees 44' 40.90" E (9h 18m 58.727s), 35 degrees 39' 16.0" N. +# Observatory: 139 degrees 44' 40.90" E (9h 18m 58.727s), +# 35 degrees 39' 16.0" N. # This data is from 'Rika Nenpyou (Chronological Scientific Tables) 1996' # edited by National Astronomical Observatory of Japan.... # JST (Japan Standard Time) has been used since 1888-01-01 00:00 (JST). @@ -1586,10 +1595,10 @@ Zone Asia/Qyzylorda 4:21:52 - LMT 1924 M 6:00 - KIZT 1982 Apr 1 5:00 RussiaAsia KIZ%sT 1991 5:00 - KIZT 1991 Dec 16 # independence - 5:00 - QYZT 1992 Jan 19 2:00 + 5:00 - QYZT 1992 Jan 19 2:00 6:00 RussiaAsia QYZ%sT 2005 Mar 15 6:00 - QYZT -# Aqtobe (aka Aktobe, formerly Akt'ubinsk) +# Aqtobe (aka Aktobe, formerly Aktyubinsk) Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 4:00 - AKTT 1930 Jun 21 # Aktyubinsk Time 5:00 - AKTT 1981 Apr 1 @@ -1609,7 +1618,7 @@ Zone Asia/Aqtau 3:21:04 - LMT 1924 May 6:00 - SHET 1982 Apr 1 5:00 RussiaAsia SHE%sT 1991 5:00 - SHET 1991 Dec 16 # independence - 5:00 RussiaAsia AQT%sT 1995 Mar lastSun 2:00 # Aqtau Time + 5:00 RussiaAsia AQT%sT 1995 Mar lastSun 2:00 # Aqtau Time 4:00 RussiaAsia AQT%sT 2005 Mar 15 5:00 - AQTT # West Kazakhstan @@ -1618,7 +1627,7 @@ Zone Asia/Oral 3:25:24 - LMT 1924 May 2 5:00 - URAT 1981 Apr 1 5:00 1:00 URAST 1981 Oct 1 6:00 - URAT 1982 Apr 1 - 5:00 RussiaAsia URA%sT 1989 Mar 26 2:00 + 5:00 RussiaAsia URA%sT 1989 Mar 26 2:00 4:00 RussiaAsia URA%sT 1991 4:00 - URAT 1991 Dec 16 # independence 4:00 RussiaAsia ORA%sT 2005 Mar 15 # Oral Time @@ -1629,7 +1638,7 @@ Zone Asia/Oral 3:25:24 - LMT 1924 May 2 # From Paul Eggert (2005-08-15): # According to an article dated today in the Kyrgyzstan Development Gateway -# +# http://eng.gateway.kg/cgi-bin/page.pl?id=1&story_name=doc9979.shtml # Kyrgyzstan is canceling the daylight saving time system. I take the article # to mean that they will leave their clocks at 6 hours ahead of UTC. # From Malik Abdugaliev (2005-09-21): @@ -1644,17 +1653,17 @@ Rule Kyrgyz 1997 2004 - Oct lastSun 2:30 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2 5:00 - FRUT 1930 Jun 21 # Frunze Time - 6:00 RussiaAsia FRU%sT 1991 Mar 31 2:00s - 5:00 1:00 FRUST 1991 Aug 31 2:00 # independence - 5:00 Kyrgyz KG%sT 2005 Aug 12 # Kyrgyzstan Time + 6:00 RussiaAsia FRU%sT 1991 Mar 31 2:00s + 5:00 1:00 FRUST 1991 Aug 31 2:00 # independence + 5:00 Kyrgyz KG%sT 2005 Aug 12 # Kyrgyzstan Time 6:00 - KGT ############################################################################### # Korea (North and South) -# From Annie I. Bang (2006-07-10) in -# : +# From Annie I. Bang (2006-07-10): +# http://www.koreaherald.co.kr/SITE/data/html_dir/2006/07/10/200607100012.asp # The Ministry of Commerce, Industry and Energy has already # commissioned a research project [to reintroduce DST] and has said # the system may begin as early as 2008.... Korea ran a daylight @@ -1702,12 +1711,8 @@ Zone Asia/Kuwait 3:11:56 - LMT 1950 3:00 - AST # Laos -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Vientiane 6:50:24 - LMT 1906 Jun 9 # or Viangchan - 7:06:20 - SMT 1911 Mar 11 0:01 # Saigon MT? - 7:00 - ICT 1912 May - 8:00 - ICT 1931 May - 7:00 - ICT +# See Asia/Bangkok. + # Lebanon # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -1745,8 +1750,8 @@ Rule NBorneo 1935 1941 - Sep 14 0:00 0:2 Rule NBorneo 1935 1941 - Dec 14 0:00 0 - # # peninsular Malaysia -# The data here are taken from Mok Ly Yng (2003-10-30) -# . +# taken from Mok Ly Yng (2003-10-30) +# http://www.math.nus.edu.sg/aslaksen/teaching/timezone.html # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Kuala_Lumpur 6:46:46 - LMT 1901 Jan 1 6:55:25 - SMT 1905 Jun 1 # Singapore M.T. @@ -1758,12 +1763,12 @@ Zone Asia/Kuala_Lumpur 6:46:46 - LMT 190 7:30 - MALT 1982 Jan 1 8:00 - MYT # Malaysia Time # Sabah & Sarawak -# From Paul Eggert (2006-03-22): -# The data here are mostly from Shanks & Pottenger, but the 1942, 1945 and 1982 -# transition dates are from Mok Ly Yng. +# From Paul Eggert (2014-08-12): +# The data entries here are mostly from Shanks & Pottenger, but the 1942, 1945 +# and 1982 transition dates are from Mok Ly Yng. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Kuching 7:21:20 - LMT 1926 Mar - 7:30 - BORT 1933 # Borneo Time + 7:30 - BORT 1933 # Borneo Time 8:00 NBorneo BOR%sT 1942 Feb 16 9:00 - JST 1945 Sep 12 8:00 - BORT 1982 Jan 1 @@ -1771,9 +1776,9 @@ Zone Asia/Kuching 7:21:20 - LMT 1926 Mar # Maldives # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Maldives 4:54:00 - LMT 1880 # Male - 4:54:00 - MMT 1960 # Male Mean Time - 5:00 - MVT # Maldives Time +Zone Indian/Maldives 4:54:00 - LMT 1880 # Male + 4:54:00 - MMT 1960 # Male Mean Time + 5:00 - MVT # Maldives Time # Mongolia @@ -1835,7 +1840,7 @@ Zone Indian/Maldives 4:54:00 - LMT 1880 # Oscar van Vlijmen (2005-05-20) reports that the Mongolian Embassy in # Washington, DC says there are two time zones, with DST observed. # He also found *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 06:12:30 2014 Return-Path: Delivered-To: svn-src-all@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 62AF2406; Mon, 27 Oct 2014 06:12: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 34CF3E75; Mon, 27 Oct 2014 06:12: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 s9R6CUHh082248; Mon, 27 Oct 2014 06:12:30 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9R6CUL3082247; Mon, 27 Oct 2014 06:12:30 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201410270612.s9R6CUL3082247@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Mon, 27 Oct 2014 06:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r273721 - stable/9/contrib/tzdata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 06:12:30 -0000 Author: edwin Date: Mon Oct 27 06:12:29 2014 New Revision: 273721 URL: https://svnweb.freebsd.org/changeset/base/273721 Log: MFC of 267473,tzdata2014e Fix historical data for Egypt. Better prediction for future Egypt / Morocco changes. Update to Cocos / Cook islands. Fix historical data for Russia. Modified: Directory Properties: stable/9/contrib/tzdata/zone1970.tab (props changed) From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 06:12:42 2014 Return-Path: Delivered-To: svn-src-all@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 E8F9B537; Mon, 27 Oct 2014 06:12: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 D3C63E78; Mon, 27 Oct 2014 06:12: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 s9R6CgPR082321; Mon, 27 Oct 2014 06:12:42 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9R6Cgib082317; Mon, 27 Oct 2014 06:12:42 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201410270612.s9R6Cgib082317@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Mon, 27 Oct 2014 06:12:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r273722 - stable/8/share/zoneinfo X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 06:12:43 -0000 Author: edwin Date: Mon Oct 27 06:12:41 2014 New Revision: 273722 URL: https://svnweb.freebsd.org/changeset/base/273722 Log: MFC of 273718, tzdata2014i Upgrade to 2014i Lots of historical data Pacific/Fiji will go into DST from 2014-11-02 to 2015-01-18 Pacific/Bougainville will go from UTC+10 to UTC+11. Europe/Minsk will go from FET to MSK. Modified: stable/8/share/zoneinfo/africa stable/8/share/zoneinfo/antarctica stable/8/share/zoneinfo/asia stable/8/share/zoneinfo/australasia stable/8/share/zoneinfo/backward stable/8/share/zoneinfo/europe stable/8/share/zoneinfo/northamerica stable/8/share/zoneinfo/southamerica stable/8/share/zoneinfo/zone.tab stable/8/share/zoneinfo/zone1970.tab (contents, props changed) Modified: stable/8/share/zoneinfo/africa ============================================================================== --- stable/8/share/zoneinfo/africa Mon Oct 27 06:12:29 2014 (r273721) +++ stable/8/share/zoneinfo/africa Mon Oct 27 06:12:41 2014 (r273722) @@ -1,9 +1,10 @@ # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. -# This data is by no means authoritative; if you think you know better, +# This file is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@iana.org for general use in the future). +# tz@iana.org for general use in the future). For more, please see +# the file CONTRIBUTING in the tz distribution. # From Paul Eggert (2013-02-21): # @@ -25,8 +26,8 @@ # I found in the UCLA library. # # For data circa 1899, a common source is: -# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 -# . +# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94. +# http://www.jstor.org/stable/1774359 # # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). @@ -93,9 +94,9 @@ Rule Algeria 1980 only - Oct 31 2:00 0 # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's # more precise 0:09:21. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 15 0:01 - 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time - 0:00 Algeria WE%sT 1940 Feb 25 2:00 +Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 15 0:01 + 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time + 0:00 Algeria WE%sT 1940 Feb 25 2:00 1:00 Algeria CE%sT 1946 Oct 7 0:00 - WET 1956 Jan 29 1:00 - CET 1963 Apr 14 @@ -105,82 +106,57 @@ Zone Africa/Algiers 0:12:12 - LMT 1891 M 1:00 - CET # Angola -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Luanda 0:52:56 - LMT 1892 - 0:52:04 - AOT 1911 May 26 # Angola Time - 1:00 - WAT - # Benin -# Whitman says they switched to 1:00 in 1946, not 1934; -# go with Shanks & Pottenger. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Porto-Novo 0:10:28 - LMT 1912 - 0:00 - GMT 1934 Feb 26 - 1:00 - WAT +# See Africa/Lagos. # Botswana -# From Paul Eggert (2013-02-21): -# Milne says they were regulated by the Cape Town Signal in 1899; -# assume they switched to 2:00 when Cape Town did. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Gaborone 1:43:40 - LMT 1885 - 1:30 - SAST 1903 Mar - 2:00 - CAT 1943 Sep 19 2:00 - 2:00 1:00 CAST 1944 Mar 19 2:00 - 2:00 - CAT +# See Africa/Maputo. # Burkina Faso # See Africa/Abidjan. # Burundi -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Bujumbura 1:57:28 - LMT 1890 - 2:00 - CAT +# See Africa/Maputo. # Cameroon -# Whitman says they switched to 1:00 in 1920; go with Shanks & Pottenger. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Douala 0:38:48 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. # Cape Verde +# +# Shanks gives 1907 for the transition to CVT. +# Perhaps the 1911-05-26 Portuguese decree +# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# merely made it official? +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Atlantic/Cape_Verde -1:34:04 - LMT 1907 # Praia +Zone Atlantic/Cape_Verde -1:34:04 - LMT 1907 # Praia -2:00 - CVT 1942 Sep -2:00 1:00 CVST 1945 Oct 15 - -2:00 - CVT 1975 Nov 25 2:00 + -2:00 - CVT 1975 Nov 25 2:00 -1:00 - CVT # Central African Republic -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Bangui 1:14:20 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. # Chad # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena +Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena 1:00 - WAT 1979 Oct 14 1:00 1:00 WAST 1980 Mar 8 1:00 - WAT # Comoros # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Comoro 2:53:04 - LMT 1911 Jul # Moroni, Gran Comoro +Zone Indian/Comoro 2:53:04 - LMT 1911 Jul # Moroni, Gran Comoro 3:00 - EAT -# Democratic Republic of Congo -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Kinshasa 1:01:12 - LMT 1897 Nov 9 - 1:00 - WAT -Zone Africa/Lubumbashi 1:49:52 - LMT 1897 Nov 9 - 2:00 - CAT +# Democratic Republic of the Congo +# See Africa/Lagos for the western part and Africa/Maputo for the eastern. # Republic of the Congo -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Brazzaville 1:01:08 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. -# Côte D'Ivoire / Ivory Coast +# Côte d'Ivoire / Ivory Coast # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Abidjan -0:16:08 - LMT 1912 0:00 - GMT @@ -327,7 +303,7 @@ Rule Egypt 2007 only - Sep Thu>=1 24:00 # Egypt is to change back to Daylight system on May 15 # http://english.ahram.org.eg/NewsContent/1/64/100735/Egypt/Politics-/Egypts-government-to-reapply-daylight-saving-time-.aspx -# From Gunther Vermier (2015-05-13): +# From Gunther Vermier (2014-05-13): # our Egypt office confirms that the change will be at 15 May "midnight" (24:00) # From Imed Chihi (2014-06-04): @@ -408,16 +384,13 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct 2:00 Egypt EE%sT # Equatorial Guinea -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Malabo 0:35:08 - LMT 1912 - 0:00 - GMT 1963 Dec 15 - 1:00 - WAT +# See Africa/Lagos. # Eritrea # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Asmara 2:35:32 - LMT 1870 - 2:35:32 - AMT 1890 # Asmara Mean Time - 2:35:20 - ADMT 1936 May 5 # Adis Dera MT + 2:35:32 - AMT 1890 # Asmara Mean Time + 2:35:20 - ADMT 1936 May 5 # Adis Dera MT 3:00 - EAT # Ethiopia @@ -429,16 +402,15 @@ Zone Africa/Asmara 2:35:32 - LMT 1870 # Shanks & Pottenger write that Ethiopia had six narrowly-spaced time # zones between 1870 and 1890, that they merged to 38E50 (2:35:20) in # 1890, and that they switched to 3:00 on 1936-05-05. Perhaps 38E50 -# was for Adis Dera. Quite likely the Shanks data are wrong anyway. +# was for Adis Dera. Quite likely the Shanks data entries are wrong +# anyway. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Addis_Ababa 2:34:48 - LMT 1870 - 2:35:20 - ADMT 1936 May 5 # Adis Dera MT + 2:35:20 - ADMT 1936 May 5 # Adis Dera MT 3:00 - EAT # Gabon -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Libreville 0:37:48 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. # Gambia # See Africa/Abidjan. @@ -461,8 +433,14 @@ Zone Africa/Accra -0:00:52 - LMT 1918 # See Africa/Abidjan. # Guinea-Bissau +# +# Shanks gives 1911-05-26 for the transition to WAT, +# evidently confusing the date of the Portuguese decree +# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# with the date that it took effect, namely 1912-01-01. +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Bissau -1:02:20 - LMT 1911 May 26 +Zone Africa/Bissau -1:02:20 - LMT 1912 Jan 1 -1:00 - WAT 1975 0:00 - GMT @@ -475,11 +453,7 @@ Zone Africa/Nairobi 2:27:16 - LMT 1928 J 3:00 - EAT # Lesotho -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Maseru 1:50:00 - LMT 1903 Mar - 2:00 - SAST 1943 Sep 19 2:00 - 2:00 1:00 SAST 1944 Mar 19 2:00 - 2:00 - SAST +# See Africa/Johannesburg. # Liberia # From Paul Eggert (2006-03-22): @@ -546,11 +520,11 @@ Zone Africa/Tripoli 0:52:44 - LMT 1920 2:00 - EET 1982 1:00 Libya CE%sT 1990 May 4 # The 1996 and 1997 entries are from Shanks & Pottenger; -# the IATA SSIM data contain some obvious errors. +# the IATA SSIM data entries contain some obvious errors. 2:00 - EET 1996 Sep 30 1:00 Libya CE%sT 1997 Oct 4 - 2:00 - EET 2012 Nov 10 2:00 - 1:00 Libya CE%sT 2013 Oct 25 2:00 + 2:00 - EET 2012 Nov 10 2:00 + 1:00 Libya CE%sT 2013 Oct 25 2:00 2:00 - EET # Madagascar @@ -561,9 +535,7 @@ Zone Indian/Antananarivo 3:10:04 - LMT 1 3:00 - EAT # Malawi -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Blantyre 2:20:00 - LMT 1903 Mar - 2:00 - CAT +# See Africa/Maputo. # Mali # Mauritania @@ -606,7 +578,7 @@ Zone Africa/Blantyre 2:20:00 - LMT 1903 # From Alex Krivenyshev (2008-07-11): # Seems that English language article "The revival of daylight saving -# time: Energy conservation?"-# No. 16578 (07/11/2008) was originally +# time: Energy conservation?"-# No. 16578 (07/11/2008) was originally # published on Monday, June 30, 2008... # # I guess that article in French "Le gouvernement avance l'introduction @@ -657,14 +629,14 @@ Rule Mauritius 1983 only - Mar 21 0:00 0 Rule Mauritius 2008 only - Oct lastSun 2:00 1:00 S Rule Mauritius 2009 only - Mar lastSun 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis +Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis 4:00 Mauritius MU%sT # Mauritius Time # Agalega Is, Rodriguez # no information; probably like Indian/Mauritius # Mayotte # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou +Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou 3:00 - EAT # Morocco @@ -682,7 +654,8 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # http://en.afrik.com/news11892.html # From Alex Krivenyshev (2008-05-09): -# The Morocco time change can be confirmed on Morocco web site Maghreb Arabe Presse: +# The Morocco time change can be confirmed on Morocco web site Maghreb Arabe +# Presse: # http://www.map.ma/eng/sections/box3/morocco_shifts_to_da/view # # Morocco shifts to daylight time on June 1st through September 27, Govt. @@ -760,8 +733,8 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # From Dan Abitol (2011-03-30): # ...Rules for Africa/Casablanca are the following (24h format) -# The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00 -# The 31th july 2011 at 00:59:59, [it] will be 31th July 00:00:00 +# The 3rd April 2011 at 00:00:00, [it] will be 3rd April 01:00:00 +# The 31st July 2011 at 00:59:59, [it] will be 31st July 00:00:00 # ...Official links of change in morocco # The change was broadcast on the FM Radio # I ve called ANRT (telecom regulations in Morocco) at @@ -831,7 +804,7 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # announced a bit in advance. On 2012-07-11 the Moroccan government # announced that year's Ramadan daylight-saving transitions would be # 2012-07-20 and 2012-08-20; see -# . +# http://www.mmsp.gov.ma/fr/actualites.aspx?id=288 # From Andrew Paprocki (2013-07-02): # Morocco announced that the year's Ramadan daylight-savings @@ -963,16 +936,29 @@ Zone Africa/El_Aaiun -0:52:48 - LMT 1934 0:00 Morocco WE%sT # Mozambique +# +# Shanks gives 1903-03-01 for the transition to CAT. +# Perhaps the 1911-05-26 Portuguese decree +# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# merely made it official? +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Maputo 2:10:20 - LMT 1903 Mar 2:00 - CAT +Link Africa/Maputo Africa/Blantyre # Malawi +Link Africa/Maputo Africa/Bujumbura # Burundi +Link Africa/Maputo Africa/Gaborone # Botswana +Link Africa/Maputo Africa/Harare # Zimbabwe +Link Africa/Maputo Africa/Kigali # Rwanda +Link Africa/Maputo Africa/Lubumbashi # E Dem. Rep. of Congo +Link Africa/Maputo Africa/Lusaka # Zambia # Namibia # The 1994-04-03 transition is from Shanks & Pottenger. # Shanks & Pottenger report no DST after 1998-04; go with IATA. -# From Petronella Sibeene (2007-03-30) in -# : +# From Petronella Sibeene (2007-03-30): +# http://allafrica.com/stories/200703300178.html # While the entire country changes its time, Katima Mulilo and other # settlements in Caprivi unofficially will not because the sun there # rises and sets earlier compared to other regions. Chief of @@ -989,28 +975,33 @@ Rule Namibia 1994 max - Sep Sun>=1 2:00 Rule Namibia 1995 max - Apr Sun>=1 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Windhoek 1:08:24 - LMT 1892 Feb 8 - 1:30 - SWAT 1903 Mar # SW Africa Time - 2:00 - SAST 1942 Sep 20 2:00 - 2:00 1:00 SAST 1943 Mar 21 2:00 + 1:30 - SWAT 1903 Mar # SW Africa Time + 2:00 - SAST 1942 Sep 20 2:00 + 2:00 1:00 SAST 1943 Mar 21 2:00 2:00 - SAST 1990 Mar 21 # independence 2:00 - CAT 1994 Apr 3 1:00 Namibia WA%sT # Niger -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Niamey 0:08:28 - LMT 1912 - -1:00 - WAT 1934 Feb 26 - 0:00 - GMT 1960 - 1:00 - WAT +# See Africa/Lagos. # Nigeria # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Lagos 0:13:36 - LMT 1919 Sep 1:00 - WAT +Link Africa/Lagos Africa/Bangui # Central African Republic +Link Africa/Lagos Africa/Brazzaville # Rep. of the Congo +Link Africa/Lagos Africa/Douala # Cameroon +Link Africa/Lagos Africa/Kinshasa # Dem. Rep. of the Congo (west) +Link Africa/Lagos Africa/Libreville # Gabon +Link Africa/Lagos Africa/Luanda # Angola +Link Africa/Lagos Africa/Malabo # Equatorial Guinea +Link Africa/Lagos Africa/Niamey # Niger +Link Africa/Lagos Africa/Porto-Novo # Benin # Réunion # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Denis +Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Denis 4:00 - RET # Réunion Time # # Crozet Islands also observes Réunion time; see the 'antarctica' file. @@ -1028,9 +1019,7 @@ Zone Indian/Reunion 3:41:52 - LMT 1911 J # Tromelin - inhabited until at least 1958 # Rwanda -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Kigali 2:00:16 - LMT 1935 Jun - 2:00 - CAT +# See Africa/Maputo. # St Helena # See Africa/Abidjan. @@ -1047,7 +1036,7 @@ Zone Africa/Kigali 2:00:16 - LMT 1935 Ju # Seychelles # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria +Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria 4:00 - SCT # Seychelles Time # From Paul Eggert (2001-05-30): # Aldabra, Farquhar, and Desroches, originally dependencies of the @@ -1074,6 +1063,9 @@ Rule SA 1943 1944 - Mar Sun>=15 2:00 0 - Zone Africa/Johannesburg 1:52:00 - LMT 1892 Feb 8 1:30 - SAST 1903 Mar 2:00 SA SAST +Link Africa/Johannesburg Africa/Maseru # Lesotho +Link Africa/Johannesburg Africa/Mbabane # Swaziland +# # Marion and Prince Edward Is # scientific station since 1947 # no information @@ -1101,9 +1093,7 @@ Zone Africa/Khartoum 2:10:08 - LMT 1931 Link Africa/Khartoum Africa/Juba # Swaziland -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Mbabane 2:04:24 - LMT 1903 Mar - 2:00 - SAST +# See Africa/Johannesburg. # Tanzania # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1128,7 +1118,7 @@ Zone Africa/Dar_es_Salaam 2:37:08 - LMT # # From Oscar van Vlijmen (2005-05-02): # La Presse, the first national daily newspaper ... -# +# http://www.lapresse.tn/archives/archives280405/actualites/lheure.html # ... DST for 2005: on: Sun May 1 0h standard time, off: Fri Sept. 30, # 1h standard time. # @@ -1212,7 +1202,7 @@ Rule Tunisia 2006 2008 - Oct lastSun 2: # Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Tunis 0:40:44 - LMT 1881 May 12 - 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time + 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time 1:00 Tunisia CE%sT # Uganda @@ -1224,11 +1214,5 @@ Zone Africa/Kampala 2:09:40 - LMT 1928 J 3:00 - EAT # Zambia -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Lusaka 1:53:08 - LMT 1903 Mar - 2:00 - CAT - # Zimbabwe -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Harare 2:04:12 - LMT 1903 Mar - 2:00 - CAT +# See Africa/Maputo. Modified: stable/8/share/zoneinfo/antarctica ============================================================================== --- stable/8/share/zoneinfo/antarctica Mon Oct 27 06:12:29 2014 (r273721) +++ stable/8/share/zoneinfo/antarctica Mon Oct 27 06:12:41 2014 (r273722) @@ -4,10 +4,10 @@ # From Paul Eggert (1999-11-15): # To keep things manageable, we list only locations occupied year-round; see # COMNAP - Stations and Bases -# +# http://www.comnap.aq/comnap/comnap.nsf/P/Stations/ # and # Summary of the Peri-Antarctic Islands (1998-07-23) -# +# http://www.spri.cam.ac.uk/bob/periant.htm # for information. # Unless otherwise specified, we have no time zone information. # @@ -63,7 +63,7 @@ Rule ChileAQ 2012 max - Sep Sun>=2 4:00u # Heard Island, McDonald Islands (uninhabited) # previously sealers and scientific personnel wintered # Margaret Turner reports -# +# http://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html # (1999-09-30) that they're UTC+5, with no DST; # presumably this is when they have visitors. # @@ -103,32 +103,30 @@ Rule ChileAQ 2012 max - Sep Sun>=2 4:00u # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Antarctica/Casey 0 - zzz 1969 - 8:00 - AWST 2009 Oct 18 2:00 + 8:00 - AWST 2009 Oct 18 2:00 # Australian Western Std Time - 11:00 - CAST 2010 Mar 5 2:00 - # Casey Time - 8:00 - AWST 2011 Oct 28 2:00 + 11:00 - CAST 2010 Mar 5 2:00 # Casey Time + 8:00 - AWST 2011 Oct 28 2:00 11:00 - CAST 2012 Feb 21 17:00u 8:00 - AWST Zone Antarctica/Davis 0 - zzz 1957 Jan 13 - 7:00 - DAVT 1964 Nov # Davis Time + 7:00 - DAVT 1964 Nov # Davis Time 0 - zzz 1969 Feb - 7:00 - DAVT 2009 Oct 18 2:00 + 7:00 - DAVT 2009 Oct 18 2:00 5:00 - DAVT 2010 Mar 10 20:00u - 7:00 - DAVT 2011 Oct 28 2:00 + 7:00 - DAVT 2011 Oct 28 2:00 5:00 - DAVT 2012 Feb 21 20:00u 7:00 - DAVT Zone Antarctica/Mawson 0 - zzz 1954 Feb 13 - 6:00 - MAWT 2009 Oct 18 2:00 - # Mawson Time + 6:00 - MAWT 2009 Oct 18 2:00 # Mawson Time 5:00 - MAWT # References: # Casey Weather (1998-02-26) -# +# http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html # Davis Station, Antarctica (1998-02-26) -# +# http://www.antdiv.gov.au/aad/exop/sfo/davis/video.html # Mawson Station, Antarctica (1998-02-25) -# +# http://www.antdiv.gov.au/aad/exop/sfo/mawson/video.html # Belgium - year-round base # Princess Elisabeth, Queen Maud Land, -713412+0231200, since 2007 @@ -154,7 +152,7 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb # France - year-round bases (also see "France & Italy") # # From Antoine Leca (1997-01-20): -# Time data are from Nicole Pailleau at the IFRTP +# Time data entries are from Nicole Pailleau at the IFRTP # (French Institute for Polar Research and Technology). # She confirms that French Southern Territories and Terre Adélie bases # don't observe daylight saving time, even if Terre Adélie supplies came @@ -174,7 +172,7 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb # fishing stations operated variously 1819/1931 # # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Kerguelen 0 - zzz 1950 # Port-aux-Français +Zone Indian/Kerguelen 0 - zzz 1950 # Port-aux-Français 5:00 - TFT # ISO code TF Time # # year-round base in the main continent @@ -217,7 +215,7 @@ Zone Antarctica/Syowa 0 - zzz 1957 Jan 2 3:00 - SYOT # Syowa Time # See: # NIPR Antarctic Research Activities (1999-08-17) -# +# http://www.nipr.ac.jp/english/ara01.html # S Korea - year-round base # Jang Bogo, Terra Nova Bay, -743700+1641205 since 2014 @@ -264,7 +262,7 @@ Rule Troll 2005 max - Mar lastSun 1:00u Rule Troll 2004 max - Oct lastSun 1:00u 0:00 UTC # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Antarctica/Troll 0 - zzz 2005 Feb 12 - 0:00 Troll %s + 0:00 Troll %s # Poland - year-round base # Arctowski, King George Island, -620945-0582745, since 1977 @@ -281,8 +279,8 @@ Zone Antarctica/Troll 0 - zzz 2005 Feb 1 # year-round from 1960/61 to 1992 # Vostok, since 1957-12-16, temporarily closed 1994-02/1994-11 -# From Craig Mundell (1994-12-15) -# : +# From Craig Mundell (1994-12-15): +# http://quest.arc.nasa.gov/antarctica/QA/computers/Directions,Time,ZIP # Vostok, which is one of the Russian stations, is set on the same # time as Moscow, Russia. # Modified: stable/8/share/zoneinfo/asia ============================================================================== --- stable/8/share/zoneinfo/asia Mon Oct 27 06:12:29 2014 (r273721) +++ stable/8/share/zoneinfo/asia Mon Oct 27 06:12:41 2014 (r273722) @@ -1,9 +1,10 @@ # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. -# This data is by no means authoritative; if you think you know better, +# This file is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@iana.org for general use in the future). +# tz@iana.org for general use in the future). For more, please see +# the file CONTRIBUTING in the tz distribution. # From Paul Eggert (2013-08-11): # @@ -25,8 +26,12 @@ # I found in the UCLA library. # # For data circa 1899, a common source is: -# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 -# . +# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94. +# http://www.jstor.org/stable/1774359 +# +# For Russian data circa 1919, a source is: +# Byalokoz EL. New Counting of Time in Russia since July 1, 1919. +# (See the 'europe' file for a fuller citation.) # # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). @@ -42,10 +47,11 @@ # 3:30 IRST IRDT Iran # 4:00 GST Gulf* # 5:30 IST India -# 7:00 ICT Indochina* +# 7:00 ICT Indochina, most times and locations* # 7:00 WIB west Indonesia (Waktu Indonesia Barat) # 8:00 WITA central Indonesia (Waktu Indonesia Tengah) # 8:00 CST China +# 8:00 IDT Indochina, 1943-45, 1947-55, 1960-75 (some locations)* # 8:00 JWST Western Standard Time (Japan, 1896/1937)* # 9:00 JCST Central Standard Time (Japan, 1896/1937) # 9:00 WIT east Indonesia (Waktu Indonesia Timur) @@ -115,11 +121,11 @@ Zone Asia/Kabul 4:36:48 - LMT 1890 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2 3:00 - YERT 1957 Mar # Yerevan Time - 4:00 RussiaAsia YER%sT 1991 Mar 31 2:00s + 4:00 RussiaAsia YER%sT 1991 Mar 31 2:00s 3:00 1:00 YERST 1991 Sep 23 # independence - 3:00 RussiaAsia AM%sT 1995 Sep 24 2:00s + 3:00 RussiaAsia AM%sT 1995 Sep 24 2:00s 4:00 - AMT 1997 - 4:00 RussiaAsia AM%sT 2012 Mar 25 2:00s + 4:00 RussiaAsia AM%sT 2012 Mar 25 2:00s 4:00 - AMT # Azerbaijan @@ -132,16 +138,16 @@ Rule Azer 1997 max - Oct lastSun 5:00 0 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Baku 3:19:24 - LMT 1924 May 2 3:00 - BAKT 1957 Mar # Baku Time - 4:00 RussiaAsia BAK%sT 1991 Mar 31 2:00s + 4:00 RussiaAsia BAK%sT 1991 Mar 31 2:00s 3:00 1:00 BAKST 1991 Aug 30 # independence 3:00 RussiaAsia AZ%sT 1992 Sep lastSat 23:00 - 4:00 - AZT 1996 # Azerbaijan time + 4:00 - AZT 1996 # Azerbaijan Time 4:00 EUAsia AZ%sT 1997 4:00 Azer AZ%sT # Bahrain # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah +Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah 4:00 - GST 1972 Jun 3:00 - AST @@ -219,7 +225,7 @@ Zone Asia/Bahrain 3:22:20 - LMT 1920 # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Dhaka 2009 only - Jun 19 23:00 1:00 S -Rule Dhaka 2009 only - Dec 31 23:59 0 - +Rule Dhaka 2009 only - Dec 31 24:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Dhaka 6:01:40 - LMT 1890 @@ -250,7 +256,7 @@ Zone Indian/Chagos 4:49:40 - LMT 1907 # Brunei # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan +Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan 7:30 - BNT 1933 8:00 - BNT @@ -259,19 +265,15 @@ Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Milne says 6:24:40 was the meridian of the time ball observatory at Rangoon. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Rangoon 6:24:40 - LMT 1880 # or Yangon - 6:24:40 - RMT 1920 # Rangoon Mean Time? - 6:30 - BURT 1942 May # Burma Time - 9:00 - JST 1945 May 3 - 6:30 - MMT # Myanmar Time +Zone Asia/Rangoon 6:24:40 - LMT 1880 # or Yangon + 6:24:40 - RMT 1920 # Rangoon Mean Time? + 6:30 - BURT 1942 May # Burma Time + 9:00 - JST 1945 May 3 + 6:30 - MMT # Myanmar Time # Cambodia -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Phnom_Penh 6:59:40 - LMT 1906 Jun 9 - 7:06:20 - SMT 1911 Mar 11 0:01 # Saigon MT? - 7:00 - ICT 1912 May - 8:00 - ICT 1931 May - 7:00 - ICT +# See Asia/Bangkok. + # China @@ -356,8 +358,8 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1: # * The Republic of China instituted Beijing mean solar time effective # the official calendar book of 1914. # * The French Concession in Shanghai set up signal stations in -# French docks in the 1890s, controled by Xujiahui (Zikawei) -# Obervatory and set to local mean time. +# French docks in the 1890s, controlled by Xujiahui (Zikawei) +# Observatory and set to local mean time. # * "From the end of the 19th century" it changed to UT+8. # * Chinese Customs (by then reduced to a tool of foreign powers) # eventually standardized on this time for all ports, and it @@ -381,7 +383,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1: # Xujiahui Observatory was under French control and stuck with UT+8. # # In earlier versions of this file, China had many separate Zone entries, but -# this was based on what was apparently incorrect data in Shanks & Pottenger. +# this was based on what were apparently incorrect data in Shanks & Pottenger. # This has now been simplified to the two entries Asia/Shanghai and # Asia/Urumqi, with the others being links for backward compatibility. # Proposed in 1918 and theoretically in effect until 1949 (although in practice @@ -501,7 +503,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1: # "The Working-Calendar for The Xinjiang Uygur Autonomous Region Government" # (2014-04-22). # Unfortunately, we have no good records of time in Xinjiang before 1986. -# During the 20th century parts of Xinjiang were ruled by the Qing dyansty, +# During the 20th century parts of Xinjiang were ruled by the Qing dynasty, # the Republic of China, various warlords, the First and Second East Turkestan # Republics, the Soviet Union, the Kuomintang, and the People's Republic of # China, and tracking down all these organizations' timekeeping rules would be @@ -698,19 +700,19 @@ Zone Asia/Hong_Kong 7:36:42 - LMT 1904 O # Central Weather Bureau website was not correct. # # Original Bulletin: -# -# (cont.) +# http://subtpg.tpg.gov.tw/og/image2.asp?f=03502F0AKM1AF +# http://subtpg.tpg.gov.tw/og/image2.asp?f=0350300AKM1B0 (cont.) # # In 1947, DST in Taiwan was expanded to Oct 31. There is a backup of that # telegram announcement from Taiwan Province Government: # -# +# http://subtpg.tpg.gov.tw/og/image2.asp?f=0360310AKZ431 # # Here is a brief translation: # # The Summer Time this year is adopted from midnight Apr 15 until Sep 20 # midnight. To save (energy?) consumption, we're expanding Summer Time -# adption till Oct 31 midnight. +# adoption till Oct 31 midnight. # # The Central Weather Bureau website didn't mention that, however it can # be found from historical government announcement database. @@ -741,7 +743,7 @@ Rule Taiwan 1979 only - Oct 1 0:00 0 S # Taipei or Taibei or T'ai-pei Zone Asia/Taipei 8:06:00 - LMT 1896 Jan 1 8:00 - JWST 1937 Oct 1 - 9:00 - JST 1945 Sep 21 01:00 + 9:00 - JST 1945 Sep 21 1:00 8:00 Taiwan C%sT # Macau (Macao, Aomen) @@ -761,7 +763,7 @@ Rule Macau 1975 1977 - Apr Sun>=15 3:30 Rule Macau 1978 1980 - Apr Sun>=15 0:00 1:00 S Rule Macau 1978 1980 - Oct Sun>=15 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Macau 7:34:20 - LMT 1912 +Zone Asia/Macau 7:34:20 - LMT 1912 Jan 1 8:00 Macau MO%sT 1999 Dec 20 # return to China 8:00 PRC C%sT @@ -823,20 +825,22 @@ Link Asia/Nicosia Europe/Nicosia # I don't know what can be done, especially knowing that some years ago our # DST rules where changed THREE TIMES during one month. -# Milne says Tbilisi (Tiflis) time was 2:59:05.7; round to nearest.) +# Milne 1899 says Tbilisi (Tiflis) time was 2:59:05.7. +# Byalokoz 1919 says Georgia was 2:59:11. +# Go with Byalokoz. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Tbilisi 2:59:06 - LMT 1880 - 2:59:06 - TBMT 1924 May 2 # Tbilisi Mean Time +Zone Asia/Tbilisi 2:59:11 - LMT 1880 + 2:59:11 - TBMT 1924 May 2 # Tbilisi Mean Time 3:00 - TBIT 1957 Mar # Tbilisi Time - 4:00 RussiaAsia TBI%sT 1991 Mar 31 2:00s + 4:00 RussiaAsia TBI%sT 1991 Mar 31 2:00s 3:00 1:00 TBIST 1991 Apr 9 # independence - 3:00 RussiaAsia GE%sT 1992 # Georgia Time + 3:00 RussiaAsia GE%sT 1992 # Georgia Time 3:00 E-EurAsia GE%sT 1994 Sep lastSun 4:00 E-EurAsia GE%sT 1996 Oct lastSun 4:00 1:00 GEST 1997 Mar lastSun 4:00 E-EurAsia GE%sT 2004 Jun 27 - 3:00 RussiaAsia GE%sT 2005 Mar lastSun 2:00 + 3:00 RussiaAsia GE%sT 2005 Mar lastSun 2:00 4:00 - GET # East Timor @@ -864,16 +868,16 @@ Zone Asia/Tbilisi 2:59:06 - LMT 1880 # midnight on Saturday, September 16. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Dili 8:22:20 - LMT 1912 +Zone Asia/Dili 8:22:20 - LMT 1912 Jan 1 8:00 - TLT 1942 Feb 21 23:00 # E Timor Time 9:00 - JST 1945 Sep 23 9:00 - TLT 1976 May 3 - 8:00 - WITA 2000 Sep 17 00:00 + 8:00 - WITA 2000 Sep 17 0:00 9:00 - TLT # India # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata +Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata 5:53:20 - HMT 1941 Oct # Howrah Mean Time? 6:30 - BURT 1942 May 15 # Burma Time 5:30 - IST 1942 Sep @@ -886,8 +890,12 @@ Zone Asia/Kolkata 5:53:28 - LMT 1880 # K # Indonesia # +# From Paul Eggert (2014-09-06): +# The 1876 Report of the Secretary of the [US] Navy, p 306 says that Batavia +# civil time was 7:07:12.5; round to even for Jakarta. +# # From Gwillim Law (2001-05-28), overriding Shanks & Pottenger: -# +# http://www.sumatera-inc.com/go_to_invest/about_indonesia.asp#standtime # says that Indonesia's time zones changed on 1988-01-01. Looking at some # time zone maps, I think that must refer to Western Borneo (Kalimantan Barat # and Kalimantan Tengah) switching from UTC+8 to UTC+7. @@ -924,7 +932,7 @@ Zone Asia/Jakarta 7:07:12 - LMT 1867 Aug # Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13, # but this must be a typo. 7:07:12 - BMT 1923 Dec 31 23:47:12 # Batavia - 7:20 - JAVT 1932 Nov # Java Time + 7:20 - JAVT 1932 Nov # Java Time 7:30 - WIB 1942 Mar 23 9:00 - JST 1945 Sep 23 7:30 - WIB 1948 May @@ -1082,7 +1090,7 @@ Rule Iran 2036 2037 - Mar 21 0:00 1:00 D Rule Iran 2036 2037 - Sep 21 0:00 0 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tehran 3:25:44 - LMT 1916 - 3:25:44 - TMT 1946 # Tehran Mean Time + 3:25:44 - TMT 1946 # Tehran Mean Time 3:30 - IRST 1977 Nov 4:00 Iran IR%sT 1979 3:30 Iran IR%sT @@ -1127,7 +1135,7 @@ Rule Iraq 1991 2007 - Apr 1 3:00s 1:00 Rule Iraq 1991 2007 - Oct 1 3:00s 0 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Baghdad 2:57:40 - LMT 1890 - 2:57:36 - BMT 1918 # Baghdad Mean Time? + 2:57:36 - BMT 1918 # Baghdad Mean Time? 3:00 - AST 1982 May 3:00 Iraq A%sT @@ -1355,7 +1363,7 @@ Rule Zion 2013 max - Oct lastSun 2:00 0 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Jerusalem 2:20:54 - LMT 1880 - 2:20:40 - JMT 1918 # Jerusalem Mean Time? + 2:20:40 - JMT 1918 # Jerusalem Mean Time? 2:00 Zion I%sT @@ -1371,8 +1379,8 @@ Zone Asia/Jerusalem 2:20:54 - LMT 1880 # daylight saving between 1948 and 1951, but "the system was discontinued # because the public believed it would lead to longer working hours." -# From Mayumi Negishi in the 2005-08-10 Japan Times -# : +# From Mayumi Negishi in the 2005-08-10 Japan Times: +# http://www.japantimes.co.jp/cgi-bin/getarticle.pl5?nn20050810f2.htm # Occupation authorities imposed daylight-saving time on Japan on # [1948-05-01].... But lack of prior debate and the execution of # daylight-saving time just three days after the bill was passed generated @@ -1396,7 +1404,8 @@ Rule Japan 1950 1951 - May Sun>=1 2:00 1 # From Hideyuki Suzuki (1998-11-09): # 'Tokyo' usually stands for the former location of Tokyo Astronomical -# Observatory: 139 degrees 44' 40.90" E (9h 18m 58.727s), 35 degrees 39' 16.0" N. +# Observatory: 139 degrees 44' 40.90" E (9h 18m 58.727s), +# 35 degrees 39' 16.0" N. # This data is from 'Rika Nenpyou (Chronological Scientific Tables) 1996' # edited by National Astronomical Observatory of Japan.... # JST (Japan Standard Time) has been used since 1888-01-01 00:00 (JST). @@ -1586,10 +1595,10 @@ Zone Asia/Qyzylorda 4:21:52 - LMT 1924 M 6:00 - KIZT 1982 Apr 1 5:00 RussiaAsia KIZ%sT 1991 5:00 - KIZT 1991 Dec 16 # independence - 5:00 - QYZT 1992 Jan 19 2:00 + 5:00 - QYZT 1992 Jan 19 2:00 6:00 RussiaAsia QYZ%sT 2005 Mar 15 6:00 - QYZT -# Aqtobe (aka Aktobe, formerly Akt'ubinsk) +# Aqtobe (aka Aktobe, formerly Aktyubinsk) Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 4:00 - AKTT 1930 Jun 21 # Aktyubinsk Time 5:00 - AKTT 1981 Apr 1 @@ -1609,7 +1618,7 @@ Zone Asia/Aqtau 3:21:04 - LMT 1924 May 6:00 - SHET 1982 Apr 1 5:00 RussiaAsia SHE%sT 1991 5:00 - SHET 1991 Dec 16 # independence - 5:00 RussiaAsia AQT%sT 1995 Mar lastSun 2:00 # Aqtau Time + 5:00 RussiaAsia AQT%sT 1995 Mar lastSun 2:00 # Aqtau Time 4:00 RussiaAsia AQT%sT 2005 Mar 15 5:00 - AQTT # West Kazakhstan @@ -1618,7 +1627,7 @@ Zone Asia/Oral 3:25:24 - LMT 1924 May 2 5:00 - URAT 1981 Apr 1 5:00 1:00 URAST 1981 Oct 1 6:00 - URAT 1982 Apr 1 - 5:00 RussiaAsia URA%sT 1989 Mar 26 2:00 + 5:00 RussiaAsia URA%sT 1989 Mar 26 2:00 4:00 RussiaAsia URA%sT 1991 4:00 - URAT 1991 Dec 16 # independence 4:00 RussiaAsia ORA%sT 2005 Mar 15 # Oral Time @@ -1629,7 +1638,7 @@ Zone Asia/Oral 3:25:24 - LMT 1924 May 2 # From Paul Eggert (2005-08-15): # According to an article dated today in the Kyrgyzstan Development Gateway -# +# http://eng.gateway.kg/cgi-bin/page.pl?id=1&story_name=doc9979.shtml # Kyrgyzstan is canceling the daylight saving time system. I take the article # to mean that they will leave their clocks at 6 hours ahead of UTC. # From Malik Abdugaliev (2005-09-21): @@ -1644,17 +1653,17 @@ Rule Kyrgyz 1997 2004 - Oct lastSun 2:30 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2 5:00 - FRUT 1930 Jun 21 # Frunze Time - 6:00 RussiaAsia FRU%sT 1991 Mar 31 2:00s - 5:00 1:00 FRUST 1991 Aug 31 2:00 # independence - 5:00 Kyrgyz KG%sT 2005 Aug 12 # Kyrgyzstan Time + 6:00 RussiaAsia FRU%sT 1991 Mar 31 2:00s + 5:00 1:00 FRUST 1991 Aug 31 2:00 # independence + 5:00 Kyrgyz KG%sT 2005 Aug 12 # Kyrgyzstan Time 6:00 - KGT ############################################################################### # Korea (North and South) -# From Annie I. Bang (2006-07-10) in -# : +# From Annie I. Bang (2006-07-10): +# http://www.koreaherald.co.kr/SITE/data/html_dir/2006/07/10/200607100012.asp # The Ministry of Commerce, Industry and Energy has already # commissioned a research project [to reintroduce DST] and has said # the system may begin as early as 2008.... Korea ran a daylight @@ -1702,12 +1711,8 @@ Zone Asia/Kuwait 3:11:56 - LMT 1950 3:00 - AST # Laos -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Vientiane 6:50:24 - LMT 1906 Jun 9 # or Viangchan - 7:06:20 - SMT 1911 Mar 11 0:01 # Saigon MT? - 7:00 - ICT 1912 May - 8:00 - ICT 1931 May - 7:00 - ICT +# See Asia/Bangkok. + # Lebanon # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -1745,8 +1750,8 @@ Rule NBorneo 1935 1941 - Sep 14 0:00 0:2 Rule NBorneo 1935 1941 - Dec 14 0:00 0 - # # peninsular Malaysia -# The data here are taken from Mok Ly Yng (2003-10-30) -# . +# taken from Mok Ly Yng (2003-10-30) +# http://www.math.nus.edu.sg/aslaksen/teaching/timezone.html # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Kuala_Lumpur 6:46:46 - LMT 1901 Jan 1 6:55:25 - SMT 1905 Jun 1 # Singapore M.T. @@ -1758,12 +1763,12 @@ Zone Asia/Kuala_Lumpur 6:46:46 - LMT 190 7:30 - MALT 1982 Jan 1 8:00 - MYT # Malaysia Time # Sabah & Sarawak -# From Paul Eggert (2006-03-22): -# The data here are mostly from Shanks & Pottenger, but the 1942, 1945 and 1982 -# transition dates are from Mok Ly Yng. +# From Paul Eggert (2014-08-12): +# The data entries here are mostly from Shanks & Pottenger, but the 1942, 1945 +# and 1982 transition dates are from Mok Ly Yng. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Kuching 7:21:20 - LMT 1926 Mar - 7:30 - BORT 1933 # Borneo Time + 7:30 - BORT 1933 # Borneo Time 8:00 NBorneo BOR%sT 1942 Feb 16 9:00 - JST 1945 Sep 12 8:00 - BORT 1982 Jan 1 @@ -1771,9 +1776,9 @@ Zone Asia/Kuching 7:21:20 - LMT 1926 Mar # Maldives # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Maldives 4:54:00 - LMT 1880 # Male - 4:54:00 - MMT 1960 # Male Mean Time - 5:00 - MVT # Maldives Time +Zone Indian/Maldives 4:54:00 - LMT 1880 # Male + 4:54:00 - MMT 1960 # Male Mean Time + 5:00 - MVT # Maldives Time # Mongolia @@ -1835,7 +1840,7 @@ Zone Indian/Maldives 4:54:00 - LMT 1880 # Oscar van Vlijmen (2005-05-20) reports that the Mongolian Embassy in # Washington, DC says there are two time zones, with DST observed. # He also found *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 06:13:23 2014 Return-Path: Delivered-To: svn-src-all@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 D316C667; Mon, 27 Oct 2014 06:13: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 BD82FE81; Mon, 27 Oct 2014 06:13: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 s9R6DNqs082621; Mon, 27 Oct 2014 06:13:23 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9R6DNqZ082615; Mon, 27 Oct 2014 06:13:23 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201410270613.s9R6DNqZ082615@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Mon, 27 Oct 2014 06:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r273723 - stable/7/share/zoneinfo X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 06:13:24 -0000 Author: edwin Date: Mon Oct 27 06:13:22 2014 New Revision: 273723 URL: https://svnweb.freebsd.org/changeset/base/273723 Log: MFC of 273718, tzdata2014i Upgrade to 2014i Lots of historical data Pacific/Fiji will go into DST from 2014-11-02 to 2015-01-18 Pacific/Bougainville will go from UTC+10 to UTC+11. Europe/Minsk will go from FET to MSK. Modified: stable/7/share/zoneinfo/africa stable/7/share/zoneinfo/antarctica stable/7/share/zoneinfo/asia stable/7/share/zoneinfo/australasia stable/7/share/zoneinfo/backward stable/7/share/zoneinfo/europe stable/7/share/zoneinfo/northamerica stable/7/share/zoneinfo/southamerica stable/7/share/zoneinfo/zone.tab stable/7/share/zoneinfo/zone1970.tab (contents, props changed) Modified: stable/7/share/zoneinfo/africa ============================================================================== --- stable/7/share/zoneinfo/africa Mon Oct 27 06:12:41 2014 (r273722) +++ stable/7/share/zoneinfo/africa Mon Oct 27 06:13:22 2014 (r273723) @@ -1,9 +1,10 @@ # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. -# This data is by no means authoritative; if you think you know better, +# This file is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@iana.org for general use in the future). +# tz@iana.org for general use in the future). For more, please see +# the file CONTRIBUTING in the tz distribution. # From Paul Eggert (2013-02-21): # @@ -25,8 +26,8 @@ # I found in the UCLA library. # # For data circa 1899, a common source is: -# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 -# . +# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94. +# http://www.jstor.org/stable/1774359 # # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). @@ -93,9 +94,9 @@ Rule Algeria 1980 only - Oct 31 2:00 0 # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's # more precise 0:09:21. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 15 0:01 - 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time - 0:00 Algeria WE%sT 1940 Feb 25 2:00 +Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 15 0:01 + 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time + 0:00 Algeria WE%sT 1940 Feb 25 2:00 1:00 Algeria CE%sT 1946 Oct 7 0:00 - WET 1956 Jan 29 1:00 - CET 1963 Apr 14 @@ -105,82 +106,57 @@ Zone Africa/Algiers 0:12:12 - LMT 1891 M 1:00 - CET # Angola -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Luanda 0:52:56 - LMT 1892 - 0:52:04 - AOT 1911 May 26 # Angola Time - 1:00 - WAT - # Benin -# Whitman says they switched to 1:00 in 1946, not 1934; -# go with Shanks & Pottenger. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Porto-Novo 0:10:28 - LMT 1912 - 0:00 - GMT 1934 Feb 26 - 1:00 - WAT +# See Africa/Lagos. # Botswana -# From Paul Eggert (2013-02-21): -# Milne says they were regulated by the Cape Town Signal in 1899; -# assume they switched to 2:00 when Cape Town did. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Gaborone 1:43:40 - LMT 1885 - 1:30 - SAST 1903 Mar - 2:00 - CAT 1943 Sep 19 2:00 - 2:00 1:00 CAST 1944 Mar 19 2:00 - 2:00 - CAT +# See Africa/Maputo. # Burkina Faso # See Africa/Abidjan. # Burundi -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Bujumbura 1:57:28 - LMT 1890 - 2:00 - CAT +# See Africa/Maputo. # Cameroon -# Whitman says they switched to 1:00 in 1920; go with Shanks & Pottenger. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Douala 0:38:48 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. # Cape Verde +# +# Shanks gives 1907 for the transition to CVT. +# Perhaps the 1911-05-26 Portuguese decree +# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# merely made it official? +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Atlantic/Cape_Verde -1:34:04 - LMT 1907 # Praia +Zone Atlantic/Cape_Verde -1:34:04 - LMT 1907 # Praia -2:00 - CVT 1942 Sep -2:00 1:00 CVST 1945 Oct 15 - -2:00 - CVT 1975 Nov 25 2:00 + -2:00 - CVT 1975 Nov 25 2:00 -1:00 - CVT # Central African Republic -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Bangui 1:14:20 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. # Chad # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena +Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena 1:00 - WAT 1979 Oct 14 1:00 1:00 WAST 1980 Mar 8 1:00 - WAT # Comoros # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Comoro 2:53:04 - LMT 1911 Jul # Moroni, Gran Comoro +Zone Indian/Comoro 2:53:04 - LMT 1911 Jul # Moroni, Gran Comoro 3:00 - EAT -# Democratic Republic of Congo -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Kinshasa 1:01:12 - LMT 1897 Nov 9 - 1:00 - WAT -Zone Africa/Lubumbashi 1:49:52 - LMT 1897 Nov 9 - 2:00 - CAT +# Democratic Republic of the Congo +# See Africa/Lagos for the western part and Africa/Maputo for the eastern. # Republic of the Congo -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Brazzaville 1:01:08 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. -# Côte D'Ivoire / Ivory Coast +# Côte d'Ivoire / Ivory Coast # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Abidjan -0:16:08 - LMT 1912 0:00 - GMT @@ -327,7 +303,7 @@ Rule Egypt 2007 only - Sep Thu>=1 24:00 # Egypt is to change back to Daylight system on May 15 # http://english.ahram.org.eg/NewsContent/1/64/100735/Egypt/Politics-/Egypts-government-to-reapply-daylight-saving-time-.aspx -# From Gunther Vermier (2015-05-13): +# From Gunther Vermier (2014-05-13): # our Egypt office confirms that the change will be at 15 May "midnight" (24:00) # From Imed Chihi (2014-06-04): @@ -408,16 +384,13 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct 2:00 Egypt EE%sT # Equatorial Guinea -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Malabo 0:35:08 - LMT 1912 - 0:00 - GMT 1963 Dec 15 - 1:00 - WAT +# See Africa/Lagos. # Eritrea # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Asmara 2:35:32 - LMT 1870 - 2:35:32 - AMT 1890 # Asmara Mean Time - 2:35:20 - ADMT 1936 May 5 # Adis Dera MT + 2:35:32 - AMT 1890 # Asmara Mean Time + 2:35:20 - ADMT 1936 May 5 # Adis Dera MT 3:00 - EAT # Ethiopia @@ -429,16 +402,15 @@ Zone Africa/Asmara 2:35:32 - LMT 1870 # Shanks & Pottenger write that Ethiopia had six narrowly-spaced time # zones between 1870 and 1890, that they merged to 38E50 (2:35:20) in # 1890, and that they switched to 3:00 on 1936-05-05. Perhaps 38E50 -# was for Adis Dera. Quite likely the Shanks data are wrong anyway. +# was for Adis Dera. Quite likely the Shanks data entries are wrong +# anyway. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Addis_Ababa 2:34:48 - LMT 1870 - 2:35:20 - ADMT 1936 May 5 # Adis Dera MT + 2:35:20 - ADMT 1936 May 5 # Adis Dera MT 3:00 - EAT # Gabon -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Libreville 0:37:48 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. # Gambia # See Africa/Abidjan. @@ -461,8 +433,14 @@ Zone Africa/Accra -0:00:52 - LMT 1918 # See Africa/Abidjan. # Guinea-Bissau +# +# Shanks gives 1911-05-26 for the transition to WAT, +# evidently confusing the date of the Portuguese decree +# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# with the date that it took effect, namely 1912-01-01. +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Bissau -1:02:20 - LMT 1911 May 26 +Zone Africa/Bissau -1:02:20 - LMT 1912 Jan 1 -1:00 - WAT 1975 0:00 - GMT @@ -475,11 +453,7 @@ Zone Africa/Nairobi 2:27:16 - LMT 1928 J 3:00 - EAT # Lesotho -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Maseru 1:50:00 - LMT 1903 Mar - 2:00 - SAST 1943 Sep 19 2:00 - 2:00 1:00 SAST 1944 Mar 19 2:00 - 2:00 - SAST +# See Africa/Johannesburg. # Liberia # From Paul Eggert (2006-03-22): @@ -546,11 +520,11 @@ Zone Africa/Tripoli 0:52:44 - LMT 1920 2:00 - EET 1982 1:00 Libya CE%sT 1990 May 4 # The 1996 and 1997 entries are from Shanks & Pottenger; -# the IATA SSIM data contain some obvious errors. +# the IATA SSIM data entries contain some obvious errors. 2:00 - EET 1996 Sep 30 1:00 Libya CE%sT 1997 Oct 4 - 2:00 - EET 2012 Nov 10 2:00 - 1:00 Libya CE%sT 2013 Oct 25 2:00 + 2:00 - EET 2012 Nov 10 2:00 + 1:00 Libya CE%sT 2013 Oct 25 2:00 2:00 - EET # Madagascar @@ -561,9 +535,7 @@ Zone Indian/Antananarivo 3:10:04 - LMT 1 3:00 - EAT # Malawi -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Blantyre 2:20:00 - LMT 1903 Mar - 2:00 - CAT +# See Africa/Maputo. # Mali # Mauritania @@ -606,7 +578,7 @@ Zone Africa/Blantyre 2:20:00 - LMT 1903 # From Alex Krivenyshev (2008-07-11): # Seems that English language article "The revival of daylight saving -# time: Energy conservation?"-# No. 16578 (07/11/2008) was originally +# time: Energy conservation?"-# No. 16578 (07/11/2008) was originally # published on Monday, June 30, 2008... # # I guess that article in French "Le gouvernement avance l'introduction @@ -657,14 +629,14 @@ Rule Mauritius 1983 only - Mar 21 0:00 0 Rule Mauritius 2008 only - Oct lastSun 2:00 1:00 S Rule Mauritius 2009 only - Mar lastSun 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis +Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis 4:00 Mauritius MU%sT # Mauritius Time # Agalega Is, Rodriguez # no information; probably like Indian/Mauritius # Mayotte # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou +Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou 3:00 - EAT # Morocco @@ -682,7 +654,8 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # http://en.afrik.com/news11892.html # From Alex Krivenyshev (2008-05-09): -# The Morocco time change can be confirmed on Morocco web site Maghreb Arabe Presse: +# The Morocco time change can be confirmed on Morocco web site Maghreb Arabe +# Presse: # http://www.map.ma/eng/sections/box3/morocco_shifts_to_da/view # # Morocco shifts to daylight time on June 1st through September 27, Govt. @@ -760,8 +733,8 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # From Dan Abitol (2011-03-30): # ...Rules for Africa/Casablanca are the following (24h format) -# The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00 -# The 31th july 2011 at 00:59:59, [it] will be 31th July 00:00:00 +# The 3rd April 2011 at 00:00:00, [it] will be 3rd April 01:00:00 +# The 31st July 2011 at 00:59:59, [it] will be 31st July 00:00:00 # ...Official links of change in morocco # The change was broadcast on the FM Radio # I ve called ANRT (telecom regulations in Morocco) at @@ -831,7 +804,7 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # announced a bit in advance. On 2012-07-11 the Moroccan government # announced that year's Ramadan daylight-saving transitions would be # 2012-07-20 and 2012-08-20; see -# . +# http://www.mmsp.gov.ma/fr/actualites.aspx?id=288 # From Andrew Paprocki (2013-07-02): # Morocco announced that the year's Ramadan daylight-savings @@ -963,16 +936,29 @@ Zone Africa/El_Aaiun -0:52:48 - LMT 1934 0:00 Morocco WE%sT # Mozambique +# +# Shanks gives 1903-03-01 for the transition to CAT. +# Perhaps the 1911-05-26 Portuguese decree +# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# merely made it official? +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Maputo 2:10:20 - LMT 1903 Mar 2:00 - CAT +Link Africa/Maputo Africa/Blantyre # Malawi +Link Africa/Maputo Africa/Bujumbura # Burundi +Link Africa/Maputo Africa/Gaborone # Botswana +Link Africa/Maputo Africa/Harare # Zimbabwe +Link Africa/Maputo Africa/Kigali # Rwanda +Link Africa/Maputo Africa/Lubumbashi # E Dem. Rep. of Congo +Link Africa/Maputo Africa/Lusaka # Zambia # Namibia # The 1994-04-03 transition is from Shanks & Pottenger. # Shanks & Pottenger report no DST after 1998-04; go with IATA. -# From Petronella Sibeene (2007-03-30) in -# : +# From Petronella Sibeene (2007-03-30): +# http://allafrica.com/stories/200703300178.html # While the entire country changes its time, Katima Mulilo and other # settlements in Caprivi unofficially will not because the sun there # rises and sets earlier compared to other regions. Chief of @@ -989,28 +975,33 @@ Rule Namibia 1994 max - Sep Sun>=1 2:00 Rule Namibia 1995 max - Apr Sun>=1 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Windhoek 1:08:24 - LMT 1892 Feb 8 - 1:30 - SWAT 1903 Mar # SW Africa Time - 2:00 - SAST 1942 Sep 20 2:00 - 2:00 1:00 SAST 1943 Mar 21 2:00 + 1:30 - SWAT 1903 Mar # SW Africa Time + 2:00 - SAST 1942 Sep 20 2:00 + 2:00 1:00 SAST 1943 Mar 21 2:00 2:00 - SAST 1990 Mar 21 # independence 2:00 - CAT 1994 Apr 3 1:00 Namibia WA%sT # Niger -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Niamey 0:08:28 - LMT 1912 - -1:00 - WAT 1934 Feb 26 - 0:00 - GMT 1960 - 1:00 - WAT +# See Africa/Lagos. # Nigeria # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Lagos 0:13:36 - LMT 1919 Sep 1:00 - WAT +Link Africa/Lagos Africa/Bangui # Central African Republic +Link Africa/Lagos Africa/Brazzaville # Rep. of the Congo +Link Africa/Lagos Africa/Douala # Cameroon +Link Africa/Lagos Africa/Kinshasa # Dem. Rep. of the Congo (west) +Link Africa/Lagos Africa/Libreville # Gabon +Link Africa/Lagos Africa/Luanda # Angola +Link Africa/Lagos Africa/Malabo # Equatorial Guinea +Link Africa/Lagos Africa/Niamey # Niger +Link Africa/Lagos Africa/Porto-Novo # Benin # Réunion # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Denis +Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Denis 4:00 - RET # Réunion Time # # Crozet Islands also observes Réunion time; see the 'antarctica' file. @@ -1028,9 +1019,7 @@ Zone Indian/Reunion 3:41:52 - LMT 1911 J # Tromelin - inhabited until at least 1958 # Rwanda -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Kigali 2:00:16 - LMT 1935 Jun - 2:00 - CAT +# See Africa/Maputo. # St Helena # See Africa/Abidjan. @@ -1047,7 +1036,7 @@ Zone Africa/Kigali 2:00:16 - LMT 1935 Ju # Seychelles # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria +Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria 4:00 - SCT # Seychelles Time # From Paul Eggert (2001-05-30): # Aldabra, Farquhar, and Desroches, originally dependencies of the @@ -1074,6 +1063,9 @@ Rule SA 1943 1944 - Mar Sun>=15 2:00 0 - Zone Africa/Johannesburg 1:52:00 - LMT 1892 Feb 8 1:30 - SAST 1903 Mar 2:00 SA SAST +Link Africa/Johannesburg Africa/Maseru # Lesotho +Link Africa/Johannesburg Africa/Mbabane # Swaziland +# # Marion and Prince Edward Is # scientific station since 1947 # no information @@ -1101,9 +1093,7 @@ Zone Africa/Khartoum 2:10:08 - LMT 1931 Link Africa/Khartoum Africa/Juba # Swaziland -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Mbabane 2:04:24 - LMT 1903 Mar - 2:00 - SAST +# See Africa/Johannesburg. # Tanzania # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1128,7 +1118,7 @@ Zone Africa/Dar_es_Salaam 2:37:08 - LMT # # From Oscar van Vlijmen (2005-05-02): # La Presse, the first national daily newspaper ... -# +# http://www.lapresse.tn/archives/archives280405/actualites/lheure.html # ... DST for 2005: on: Sun May 1 0h standard time, off: Fri Sept. 30, # 1h standard time. # @@ -1212,7 +1202,7 @@ Rule Tunisia 2006 2008 - Oct lastSun 2: # Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Tunis 0:40:44 - LMT 1881 May 12 - 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time + 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time 1:00 Tunisia CE%sT # Uganda @@ -1224,11 +1214,5 @@ Zone Africa/Kampala 2:09:40 - LMT 1928 J 3:00 - EAT # Zambia -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Lusaka 1:53:08 - LMT 1903 Mar - 2:00 - CAT - # Zimbabwe -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Harare 2:04:12 - LMT 1903 Mar - 2:00 - CAT +# See Africa/Maputo. Modified: stable/7/share/zoneinfo/antarctica ============================================================================== --- stable/7/share/zoneinfo/antarctica Mon Oct 27 06:12:41 2014 (r273722) +++ stable/7/share/zoneinfo/antarctica Mon Oct 27 06:13:22 2014 (r273723) @@ -4,10 +4,10 @@ # From Paul Eggert (1999-11-15): # To keep things manageable, we list only locations occupied year-round; see # COMNAP - Stations and Bases -# +# http://www.comnap.aq/comnap/comnap.nsf/P/Stations/ # and # Summary of the Peri-Antarctic Islands (1998-07-23) -# +# http://www.spri.cam.ac.uk/bob/periant.htm # for information. # Unless otherwise specified, we have no time zone information. # @@ -63,7 +63,7 @@ Rule ChileAQ 2012 max - Sep Sun>=2 4:00u # Heard Island, McDonald Islands (uninhabited) # previously sealers and scientific personnel wintered # Margaret Turner reports -# +# http://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html # (1999-09-30) that they're UTC+5, with no DST; # presumably this is when they have visitors. # @@ -103,32 +103,30 @@ Rule ChileAQ 2012 max - Sep Sun>=2 4:00u # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Antarctica/Casey 0 - zzz 1969 - 8:00 - AWST 2009 Oct 18 2:00 + 8:00 - AWST 2009 Oct 18 2:00 # Australian Western Std Time - 11:00 - CAST 2010 Mar 5 2:00 - # Casey Time - 8:00 - AWST 2011 Oct 28 2:00 + 11:00 - CAST 2010 Mar 5 2:00 # Casey Time + 8:00 - AWST 2011 Oct 28 2:00 11:00 - CAST 2012 Feb 21 17:00u 8:00 - AWST Zone Antarctica/Davis 0 - zzz 1957 Jan 13 - 7:00 - DAVT 1964 Nov # Davis Time + 7:00 - DAVT 1964 Nov # Davis Time 0 - zzz 1969 Feb - 7:00 - DAVT 2009 Oct 18 2:00 + 7:00 - DAVT 2009 Oct 18 2:00 5:00 - DAVT 2010 Mar 10 20:00u - 7:00 - DAVT 2011 Oct 28 2:00 + 7:00 - DAVT 2011 Oct 28 2:00 5:00 - DAVT 2012 Feb 21 20:00u 7:00 - DAVT Zone Antarctica/Mawson 0 - zzz 1954 Feb 13 - 6:00 - MAWT 2009 Oct 18 2:00 - # Mawson Time + 6:00 - MAWT 2009 Oct 18 2:00 # Mawson Time 5:00 - MAWT # References: # Casey Weather (1998-02-26) -# +# http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html # Davis Station, Antarctica (1998-02-26) -# +# http://www.antdiv.gov.au/aad/exop/sfo/davis/video.html # Mawson Station, Antarctica (1998-02-25) -# +# http://www.antdiv.gov.au/aad/exop/sfo/mawson/video.html # Belgium - year-round base # Princess Elisabeth, Queen Maud Land, -713412+0231200, since 2007 @@ -154,7 +152,7 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb # France - year-round bases (also see "France & Italy") # # From Antoine Leca (1997-01-20): -# Time data are from Nicole Pailleau at the IFRTP +# Time data entries are from Nicole Pailleau at the IFRTP # (French Institute for Polar Research and Technology). # She confirms that French Southern Territories and Terre Adélie bases # don't observe daylight saving time, even if Terre Adélie supplies came @@ -174,7 +172,7 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb # fishing stations operated variously 1819/1931 # # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Kerguelen 0 - zzz 1950 # Port-aux-Français +Zone Indian/Kerguelen 0 - zzz 1950 # Port-aux-Français 5:00 - TFT # ISO code TF Time # # year-round base in the main continent @@ -217,7 +215,7 @@ Zone Antarctica/Syowa 0 - zzz 1957 Jan 2 3:00 - SYOT # Syowa Time # See: # NIPR Antarctic Research Activities (1999-08-17) -# +# http://www.nipr.ac.jp/english/ara01.html # S Korea - year-round base # Jang Bogo, Terra Nova Bay, -743700+1641205 since 2014 @@ -264,7 +262,7 @@ Rule Troll 2005 max - Mar lastSun 1:00u Rule Troll 2004 max - Oct lastSun 1:00u 0:00 UTC # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Antarctica/Troll 0 - zzz 2005 Feb 12 - 0:00 Troll %s + 0:00 Troll %s # Poland - year-round base # Arctowski, King George Island, -620945-0582745, since 1977 @@ -281,8 +279,8 @@ Zone Antarctica/Troll 0 - zzz 2005 Feb 1 # year-round from 1960/61 to 1992 # Vostok, since 1957-12-16, temporarily closed 1994-02/1994-11 -# From Craig Mundell (1994-12-15) -# : +# From Craig Mundell (1994-12-15): +# http://quest.arc.nasa.gov/antarctica/QA/computers/Directions,Time,ZIP # Vostok, which is one of the Russian stations, is set on the same # time as Moscow, Russia. # Modified: stable/7/share/zoneinfo/asia ============================================================================== --- stable/7/share/zoneinfo/asia Mon Oct 27 06:12:41 2014 (r273722) +++ stable/7/share/zoneinfo/asia Mon Oct 27 06:13:22 2014 (r273723) @@ -1,9 +1,10 @@ # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. -# This data is by no means authoritative; if you think you know better, +# This file is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@iana.org for general use in the future). +# tz@iana.org for general use in the future). For more, please see +# the file CONTRIBUTING in the tz distribution. # From Paul Eggert (2013-08-11): # @@ -25,8 +26,12 @@ # I found in the UCLA library. # # For data circa 1899, a common source is: -# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 -# . +# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94. +# http://www.jstor.org/stable/1774359 +# +# For Russian data circa 1919, a source is: +# Byalokoz EL. New Counting of Time in Russia since July 1, 1919. +# (See the 'europe' file for a fuller citation.) # # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). @@ -42,10 +47,11 @@ # 3:30 IRST IRDT Iran # 4:00 GST Gulf* # 5:30 IST India -# 7:00 ICT Indochina* +# 7:00 ICT Indochina, most times and locations* # 7:00 WIB west Indonesia (Waktu Indonesia Barat) # 8:00 WITA central Indonesia (Waktu Indonesia Tengah) # 8:00 CST China +# 8:00 IDT Indochina, 1943-45, 1947-55, 1960-75 (some locations)* # 8:00 JWST Western Standard Time (Japan, 1896/1937)* # 9:00 JCST Central Standard Time (Japan, 1896/1937) # 9:00 WIT east Indonesia (Waktu Indonesia Timur) @@ -115,11 +121,11 @@ Zone Asia/Kabul 4:36:48 - LMT 1890 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2 3:00 - YERT 1957 Mar # Yerevan Time - 4:00 RussiaAsia YER%sT 1991 Mar 31 2:00s + 4:00 RussiaAsia YER%sT 1991 Mar 31 2:00s 3:00 1:00 YERST 1991 Sep 23 # independence - 3:00 RussiaAsia AM%sT 1995 Sep 24 2:00s + 3:00 RussiaAsia AM%sT 1995 Sep 24 2:00s 4:00 - AMT 1997 - 4:00 RussiaAsia AM%sT 2012 Mar 25 2:00s + 4:00 RussiaAsia AM%sT 2012 Mar 25 2:00s 4:00 - AMT # Azerbaijan @@ -132,16 +138,16 @@ Rule Azer 1997 max - Oct lastSun 5:00 0 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Baku 3:19:24 - LMT 1924 May 2 3:00 - BAKT 1957 Mar # Baku Time - 4:00 RussiaAsia BAK%sT 1991 Mar 31 2:00s + 4:00 RussiaAsia BAK%sT 1991 Mar 31 2:00s 3:00 1:00 BAKST 1991 Aug 30 # independence 3:00 RussiaAsia AZ%sT 1992 Sep lastSat 23:00 - 4:00 - AZT 1996 # Azerbaijan time + 4:00 - AZT 1996 # Azerbaijan Time 4:00 EUAsia AZ%sT 1997 4:00 Azer AZ%sT # Bahrain # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah +Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah 4:00 - GST 1972 Jun 3:00 - AST @@ -219,7 +225,7 @@ Zone Asia/Bahrain 3:22:20 - LMT 1920 # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Dhaka 2009 only - Jun 19 23:00 1:00 S -Rule Dhaka 2009 only - Dec 31 23:59 0 - +Rule Dhaka 2009 only - Dec 31 24:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Dhaka 6:01:40 - LMT 1890 @@ -250,7 +256,7 @@ Zone Indian/Chagos 4:49:40 - LMT 1907 # Brunei # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan +Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan 7:30 - BNT 1933 8:00 - BNT @@ -259,19 +265,15 @@ Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Milne says 6:24:40 was the meridian of the time ball observatory at Rangoon. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Rangoon 6:24:40 - LMT 1880 # or Yangon - 6:24:40 - RMT 1920 # Rangoon Mean Time? - 6:30 - BURT 1942 May # Burma Time - 9:00 - JST 1945 May 3 - 6:30 - MMT # Myanmar Time +Zone Asia/Rangoon 6:24:40 - LMT 1880 # or Yangon + 6:24:40 - RMT 1920 # Rangoon Mean Time? + 6:30 - BURT 1942 May # Burma Time + 9:00 - JST 1945 May 3 + 6:30 - MMT # Myanmar Time # Cambodia -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Phnom_Penh 6:59:40 - LMT 1906 Jun 9 - 7:06:20 - SMT 1911 Mar 11 0:01 # Saigon MT? - 7:00 - ICT 1912 May - 8:00 - ICT 1931 May - 7:00 - ICT +# See Asia/Bangkok. + # China @@ -356,8 +358,8 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1: # * The Republic of China instituted Beijing mean solar time effective # the official calendar book of 1914. # * The French Concession in Shanghai set up signal stations in -# French docks in the 1890s, controled by Xujiahui (Zikawei) -# Obervatory and set to local mean time. +# French docks in the 1890s, controlled by Xujiahui (Zikawei) +# Observatory and set to local mean time. # * "From the end of the 19th century" it changed to UT+8. # * Chinese Customs (by then reduced to a tool of foreign powers) # eventually standardized on this time for all ports, and it @@ -381,7 +383,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1: # Xujiahui Observatory was under French control and stuck with UT+8. # # In earlier versions of this file, China had many separate Zone entries, but -# this was based on what was apparently incorrect data in Shanks & Pottenger. +# this was based on what were apparently incorrect data in Shanks & Pottenger. # This has now been simplified to the two entries Asia/Shanghai and # Asia/Urumqi, with the others being links for backward compatibility. # Proposed in 1918 and theoretically in effect until 1949 (although in practice @@ -501,7 +503,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1: # "The Working-Calendar for The Xinjiang Uygur Autonomous Region Government" # (2014-04-22). # Unfortunately, we have no good records of time in Xinjiang before 1986. -# During the 20th century parts of Xinjiang were ruled by the Qing dyansty, +# During the 20th century parts of Xinjiang were ruled by the Qing dynasty, # the Republic of China, various warlords, the First and Second East Turkestan # Republics, the Soviet Union, the Kuomintang, and the People's Republic of # China, and tracking down all these organizations' timekeeping rules would be @@ -698,19 +700,19 @@ Zone Asia/Hong_Kong 7:36:42 - LMT 1904 O # Central Weather Bureau website was not correct. # # Original Bulletin: -# -# (cont.) +# http://subtpg.tpg.gov.tw/og/image2.asp?f=03502F0AKM1AF +# http://subtpg.tpg.gov.tw/og/image2.asp?f=0350300AKM1B0 (cont.) # # In 1947, DST in Taiwan was expanded to Oct 31. There is a backup of that # telegram announcement from Taiwan Province Government: # -# +# http://subtpg.tpg.gov.tw/og/image2.asp?f=0360310AKZ431 # # Here is a brief translation: # # The Summer Time this year is adopted from midnight Apr 15 until Sep 20 # midnight. To save (energy?) consumption, we're expanding Summer Time -# adption till Oct 31 midnight. +# adoption till Oct 31 midnight. # # The Central Weather Bureau website didn't mention that, however it can # be found from historical government announcement database. @@ -741,7 +743,7 @@ Rule Taiwan 1979 only - Oct 1 0:00 0 S # Taipei or Taibei or T'ai-pei Zone Asia/Taipei 8:06:00 - LMT 1896 Jan 1 8:00 - JWST 1937 Oct 1 - 9:00 - JST 1945 Sep 21 01:00 + 9:00 - JST 1945 Sep 21 1:00 8:00 Taiwan C%sT # Macau (Macao, Aomen) @@ -761,7 +763,7 @@ Rule Macau 1975 1977 - Apr Sun>=15 3:30 Rule Macau 1978 1980 - Apr Sun>=15 0:00 1:00 S Rule Macau 1978 1980 - Oct Sun>=15 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Macau 7:34:20 - LMT 1912 +Zone Asia/Macau 7:34:20 - LMT 1912 Jan 1 8:00 Macau MO%sT 1999 Dec 20 # return to China 8:00 PRC C%sT @@ -823,20 +825,22 @@ Link Asia/Nicosia Europe/Nicosia # I don't know what can be done, especially knowing that some years ago our # DST rules where changed THREE TIMES during one month. -# Milne says Tbilisi (Tiflis) time was 2:59:05.7; round to nearest.) +# Milne 1899 says Tbilisi (Tiflis) time was 2:59:05.7. +# Byalokoz 1919 says Georgia was 2:59:11. +# Go with Byalokoz. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Tbilisi 2:59:06 - LMT 1880 - 2:59:06 - TBMT 1924 May 2 # Tbilisi Mean Time +Zone Asia/Tbilisi 2:59:11 - LMT 1880 + 2:59:11 - TBMT 1924 May 2 # Tbilisi Mean Time 3:00 - TBIT 1957 Mar # Tbilisi Time - 4:00 RussiaAsia TBI%sT 1991 Mar 31 2:00s + 4:00 RussiaAsia TBI%sT 1991 Mar 31 2:00s 3:00 1:00 TBIST 1991 Apr 9 # independence - 3:00 RussiaAsia GE%sT 1992 # Georgia Time + 3:00 RussiaAsia GE%sT 1992 # Georgia Time 3:00 E-EurAsia GE%sT 1994 Sep lastSun 4:00 E-EurAsia GE%sT 1996 Oct lastSun 4:00 1:00 GEST 1997 Mar lastSun 4:00 E-EurAsia GE%sT 2004 Jun 27 - 3:00 RussiaAsia GE%sT 2005 Mar lastSun 2:00 + 3:00 RussiaAsia GE%sT 2005 Mar lastSun 2:00 4:00 - GET # East Timor @@ -864,16 +868,16 @@ Zone Asia/Tbilisi 2:59:06 - LMT 1880 # midnight on Saturday, September 16. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Dili 8:22:20 - LMT 1912 +Zone Asia/Dili 8:22:20 - LMT 1912 Jan 1 8:00 - TLT 1942 Feb 21 23:00 # E Timor Time 9:00 - JST 1945 Sep 23 9:00 - TLT 1976 May 3 - 8:00 - WITA 2000 Sep 17 00:00 + 8:00 - WITA 2000 Sep 17 0:00 9:00 - TLT # India # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata +Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata 5:53:20 - HMT 1941 Oct # Howrah Mean Time? 6:30 - BURT 1942 May 15 # Burma Time 5:30 - IST 1942 Sep @@ -886,8 +890,12 @@ Zone Asia/Kolkata 5:53:28 - LMT 1880 # K # Indonesia # +# From Paul Eggert (2014-09-06): +# The 1876 Report of the Secretary of the [US] Navy, p 306 says that Batavia +# civil time was 7:07:12.5; round to even for Jakarta. +# # From Gwillim Law (2001-05-28), overriding Shanks & Pottenger: -# +# http://www.sumatera-inc.com/go_to_invest/about_indonesia.asp#standtime # says that Indonesia's time zones changed on 1988-01-01. Looking at some # time zone maps, I think that must refer to Western Borneo (Kalimantan Barat # and Kalimantan Tengah) switching from UTC+8 to UTC+7. @@ -924,7 +932,7 @@ Zone Asia/Jakarta 7:07:12 - LMT 1867 Aug # Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13, # but this must be a typo. 7:07:12 - BMT 1923 Dec 31 23:47:12 # Batavia - 7:20 - JAVT 1932 Nov # Java Time + 7:20 - JAVT 1932 Nov # Java Time 7:30 - WIB 1942 Mar 23 9:00 - JST 1945 Sep 23 7:30 - WIB 1948 May @@ -1082,7 +1090,7 @@ Rule Iran 2036 2037 - Mar 21 0:00 1:00 D Rule Iran 2036 2037 - Sep 21 0:00 0 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tehran 3:25:44 - LMT 1916 - 3:25:44 - TMT 1946 # Tehran Mean Time + 3:25:44 - TMT 1946 # Tehran Mean Time 3:30 - IRST 1977 Nov 4:00 Iran IR%sT 1979 3:30 Iran IR%sT @@ -1127,7 +1135,7 @@ Rule Iraq 1991 2007 - Apr 1 3:00s 1:00 Rule Iraq 1991 2007 - Oct 1 3:00s 0 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Baghdad 2:57:40 - LMT 1890 - 2:57:36 - BMT 1918 # Baghdad Mean Time? + 2:57:36 - BMT 1918 # Baghdad Mean Time? 3:00 - AST 1982 May 3:00 Iraq A%sT @@ -1355,7 +1363,7 @@ Rule Zion 2013 max - Oct lastSun 2:00 0 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Jerusalem 2:20:54 - LMT 1880 - 2:20:40 - JMT 1918 # Jerusalem Mean Time? + 2:20:40 - JMT 1918 # Jerusalem Mean Time? 2:00 Zion I%sT @@ -1371,8 +1379,8 @@ Zone Asia/Jerusalem 2:20:54 - LMT 1880 # daylight saving between 1948 and 1951, but "the system was discontinued # because the public believed it would lead to longer working hours." -# From Mayumi Negishi in the 2005-08-10 Japan Times -# : +# From Mayumi Negishi in the 2005-08-10 Japan Times: +# http://www.japantimes.co.jp/cgi-bin/getarticle.pl5?nn20050810f2.htm # Occupation authorities imposed daylight-saving time on Japan on # [1948-05-01].... But lack of prior debate and the execution of # daylight-saving time just three days after the bill was passed generated @@ -1396,7 +1404,8 @@ Rule Japan 1950 1951 - May Sun>=1 2:00 1 # From Hideyuki Suzuki (1998-11-09): # 'Tokyo' usually stands for the former location of Tokyo Astronomical -# Observatory: 139 degrees 44' 40.90" E (9h 18m 58.727s), 35 degrees 39' 16.0" N. +# Observatory: 139 degrees 44' 40.90" E (9h 18m 58.727s), +# 35 degrees 39' 16.0" N. # This data is from 'Rika Nenpyou (Chronological Scientific Tables) 1996' # edited by National Astronomical Observatory of Japan.... # JST (Japan Standard Time) has been used since 1888-01-01 00:00 (JST). @@ -1586,10 +1595,10 @@ Zone Asia/Qyzylorda 4:21:52 - LMT 1924 M 6:00 - KIZT 1982 Apr 1 5:00 RussiaAsia KIZ%sT 1991 5:00 - KIZT 1991 Dec 16 # independence - 5:00 - QYZT 1992 Jan 19 2:00 + 5:00 - QYZT 1992 Jan 19 2:00 6:00 RussiaAsia QYZ%sT 2005 Mar 15 6:00 - QYZT -# Aqtobe (aka Aktobe, formerly Akt'ubinsk) +# Aqtobe (aka Aktobe, formerly Aktyubinsk) Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 4:00 - AKTT 1930 Jun 21 # Aktyubinsk Time 5:00 - AKTT 1981 Apr 1 @@ -1609,7 +1618,7 @@ Zone Asia/Aqtau 3:21:04 - LMT 1924 May 6:00 - SHET 1982 Apr 1 5:00 RussiaAsia SHE%sT 1991 5:00 - SHET 1991 Dec 16 # independence - 5:00 RussiaAsia AQT%sT 1995 Mar lastSun 2:00 # Aqtau Time + 5:00 RussiaAsia AQT%sT 1995 Mar lastSun 2:00 # Aqtau Time 4:00 RussiaAsia AQT%sT 2005 Mar 15 5:00 - AQTT # West Kazakhstan @@ -1618,7 +1627,7 @@ Zone Asia/Oral 3:25:24 - LMT 1924 May 2 5:00 - URAT 1981 Apr 1 5:00 1:00 URAST 1981 Oct 1 6:00 - URAT 1982 Apr 1 - 5:00 RussiaAsia URA%sT 1989 Mar 26 2:00 + 5:00 RussiaAsia URA%sT 1989 Mar 26 2:00 4:00 RussiaAsia URA%sT 1991 4:00 - URAT 1991 Dec 16 # independence 4:00 RussiaAsia ORA%sT 2005 Mar 15 # Oral Time @@ -1629,7 +1638,7 @@ Zone Asia/Oral 3:25:24 - LMT 1924 May 2 # From Paul Eggert (2005-08-15): # According to an article dated today in the Kyrgyzstan Development Gateway -# +# http://eng.gateway.kg/cgi-bin/page.pl?id=1&story_name=doc9979.shtml # Kyrgyzstan is canceling the daylight saving time system. I take the article # to mean that they will leave their clocks at 6 hours ahead of UTC. # From Malik Abdugaliev (2005-09-21): @@ -1644,17 +1653,17 @@ Rule Kyrgyz 1997 2004 - Oct lastSun 2:30 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2 5:00 - FRUT 1930 Jun 21 # Frunze Time - 6:00 RussiaAsia FRU%sT 1991 Mar 31 2:00s - 5:00 1:00 FRUST 1991 Aug 31 2:00 # independence - 5:00 Kyrgyz KG%sT 2005 Aug 12 # Kyrgyzstan Time + 6:00 RussiaAsia FRU%sT 1991 Mar 31 2:00s + 5:00 1:00 FRUST 1991 Aug 31 2:00 # independence + 5:00 Kyrgyz KG%sT 2005 Aug 12 # Kyrgyzstan Time 6:00 - KGT ############################################################################### # Korea (North and South) -# From Annie I. Bang (2006-07-10) in -# : +# From Annie I. Bang (2006-07-10): +# http://www.koreaherald.co.kr/SITE/data/html_dir/2006/07/10/200607100012.asp # The Ministry of Commerce, Industry and Energy has already # commissioned a research project [to reintroduce DST] and has said # the system may begin as early as 2008.... Korea ran a daylight @@ -1702,12 +1711,8 @@ Zone Asia/Kuwait 3:11:56 - LMT 1950 3:00 - AST # Laos -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Vientiane 6:50:24 - LMT 1906 Jun 9 # or Viangchan - 7:06:20 - SMT 1911 Mar 11 0:01 # Saigon MT? - 7:00 - ICT 1912 May - 8:00 - ICT 1931 May - 7:00 - ICT +# See Asia/Bangkok. + # Lebanon # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -1745,8 +1750,8 @@ Rule NBorneo 1935 1941 - Sep 14 0:00 0:2 Rule NBorneo 1935 1941 - Dec 14 0:00 0 - # # peninsular Malaysia -# The data here are taken from Mok Ly Yng (2003-10-30) -# . +# taken from Mok Ly Yng (2003-10-30) +# http://www.math.nus.edu.sg/aslaksen/teaching/timezone.html # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Kuala_Lumpur 6:46:46 - LMT 1901 Jan 1 6:55:25 - SMT 1905 Jun 1 # Singapore M.T. @@ -1758,12 +1763,12 @@ Zone Asia/Kuala_Lumpur 6:46:46 - LMT 190 7:30 - MALT 1982 Jan 1 8:00 - MYT # Malaysia Time # Sabah & Sarawak -# From Paul Eggert (2006-03-22): -# The data here are mostly from Shanks & Pottenger, but the 1942, 1945 and 1982 -# transition dates are from Mok Ly Yng. +# From Paul Eggert (2014-08-12): +# The data entries here are mostly from Shanks & Pottenger, but the 1942, 1945 +# and 1982 transition dates are from Mok Ly Yng. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Kuching 7:21:20 - LMT 1926 Mar - 7:30 - BORT 1933 # Borneo Time + 7:30 - BORT 1933 # Borneo Time 8:00 NBorneo BOR%sT 1942 Feb 16 9:00 - JST 1945 Sep 12 8:00 - BORT 1982 Jan 1 @@ -1771,9 +1776,9 @@ Zone Asia/Kuching 7:21:20 - LMT 1926 Mar # Maldives # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Maldives 4:54:00 - LMT 1880 # Male - 4:54:00 - MMT 1960 # Male Mean Time - 5:00 - MVT # Maldives Time +Zone Indian/Maldives 4:54:00 - LMT 1880 # Male + 4:54:00 - MMT 1960 # Male Mean Time + 5:00 - MVT # Maldives Time # Mongolia @@ -1835,7 +1840,7 @@ Zone Indian/Maldives 4:54:00 - LMT 1880 # Oscar van Vlijmen (2005-05-20) reports that the Mongolian Embassy in # Washington, DC says there are two time zones, with DST observed. # He also found *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 06:14:15 2014 Return-Path: Delivered-To: svn-src-all@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 43928931; Mon, 27 Oct 2014 06:14: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 2E3B3E8A; Mon, 27 Oct 2014 06:14: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 s9R6EFj9082794; Mon, 27 Oct 2014 06:14:15 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9R6EEDe082788; Mon, 27 Oct 2014 06:14:14 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201410270614.s9R6EEDe082788@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Mon, 27 Oct 2014 06:14:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org Subject: svn commit: r273724 - stable/6/share/zoneinfo X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 06:14:15 -0000 Author: edwin Date: Mon Oct 27 06:14:13 2014 New Revision: 273724 URL: https://svnweb.freebsd.org/changeset/base/273724 Log: MFC of 273718, tzdata2014i Upgrade to 2014i Lots of historical data Pacific/Fiji will go into DST from 2014-11-02 to 2015-01-18 Pacific/Bougainville will go from UTC+10 to UTC+11. Europe/Minsk will go from FET to MSK. Modified: stable/6/share/zoneinfo/africa stable/6/share/zoneinfo/antarctica stable/6/share/zoneinfo/asia stable/6/share/zoneinfo/australasia stable/6/share/zoneinfo/backward stable/6/share/zoneinfo/europe stable/6/share/zoneinfo/northamerica stable/6/share/zoneinfo/southamerica stable/6/share/zoneinfo/zone.tab stable/6/share/zoneinfo/zone1970.tab (contents, props changed) Modified: stable/6/share/zoneinfo/africa ============================================================================== --- stable/6/share/zoneinfo/africa Mon Oct 27 06:13:22 2014 (r273723) +++ stable/6/share/zoneinfo/africa Mon Oct 27 06:14:13 2014 (r273724) @@ -1,9 +1,10 @@ # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. -# This data is by no means authoritative; if you think you know better, +# This file is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@iana.org for general use in the future). +# tz@iana.org for general use in the future). For more, please see +# the file CONTRIBUTING in the tz distribution. # From Paul Eggert (2013-02-21): # @@ -25,8 +26,8 @@ # I found in the UCLA library. # # For data circa 1899, a common source is: -# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 -# . +# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94. +# http://www.jstor.org/stable/1774359 # # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). @@ -93,9 +94,9 @@ Rule Algeria 1980 only - Oct 31 2:00 0 # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's # more precise 0:09:21. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 15 0:01 - 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time - 0:00 Algeria WE%sT 1940 Feb 25 2:00 +Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 15 0:01 + 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time + 0:00 Algeria WE%sT 1940 Feb 25 2:00 1:00 Algeria CE%sT 1946 Oct 7 0:00 - WET 1956 Jan 29 1:00 - CET 1963 Apr 14 @@ -105,82 +106,57 @@ Zone Africa/Algiers 0:12:12 - LMT 1891 M 1:00 - CET # Angola -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Luanda 0:52:56 - LMT 1892 - 0:52:04 - AOT 1911 May 26 # Angola Time - 1:00 - WAT - # Benin -# Whitman says they switched to 1:00 in 1946, not 1934; -# go with Shanks & Pottenger. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Porto-Novo 0:10:28 - LMT 1912 - 0:00 - GMT 1934 Feb 26 - 1:00 - WAT +# See Africa/Lagos. # Botswana -# From Paul Eggert (2013-02-21): -# Milne says they were regulated by the Cape Town Signal in 1899; -# assume they switched to 2:00 when Cape Town did. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Gaborone 1:43:40 - LMT 1885 - 1:30 - SAST 1903 Mar - 2:00 - CAT 1943 Sep 19 2:00 - 2:00 1:00 CAST 1944 Mar 19 2:00 - 2:00 - CAT +# See Africa/Maputo. # Burkina Faso # See Africa/Abidjan. # Burundi -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Bujumbura 1:57:28 - LMT 1890 - 2:00 - CAT +# See Africa/Maputo. # Cameroon -# Whitman says they switched to 1:00 in 1920; go with Shanks & Pottenger. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Douala 0:38:48 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. # Cape Verde +# +# Shanks gives 1907 for the transition to CVT. +# Perhaps the 1911-05-26 Portuguese decree +# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# merely made it official? +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Atlantic/Cape_Verde -1:34:04 - LMT 1907 # Praia +Zone Atlantic/Cape_Verde -1:34:04 - LMT 1907 # Praia -2:00 - CVT 1942 Sep -2:00 1:00 CVST 1945 Oct 15 - -2:00 - CVT 1975 Nov 25 2:00 + -2:00 - CVT 1975 Nov 25 2:00 -1:00 - CVT # Central African Republic -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Bangui 1:14:20 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. # Chad # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena +Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena 1:00 - WAT 1979 Oct 14 1:00 1:00 WAST 1980 Mar 8 1:00 - WAT # Comoros # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Comoro 2:53:04 - LMT 1911 Jul # Moroni, Gran Comoro +Zone Indian/Comoro 2:53:04 - LMT 1911 Jul # Moroni, Gran Comoro 3:00 - EAT -# Democratic Republic of Congo -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Kinshasa 1:01:12 - LMT 1897 Nov 9 - 1:00 - WAT -Zone Africa/Lubumbashi 1:49:52 - LMT 1897 Nov 9 - 2:00 - CAT +# Democratic Republic of the Congo +# See Africa/Lagos for the western part and Africa/Maputo for the eastern. # Republic of the Congo -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Brazzaville 1:01:08 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. -# Côte D'Ivoire / Ivory Coast +# Côte d'Ivoire / Ivory Coast # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Abidjan -0:16:08 - LMT 1912 0:00 - GMT @@ -327,7 +303,7 @@ Rule Egypt 2007 only - Sep Thu>=1 24:00 # Egypt is to change back to Daylight system on May 15 # http://english.ahram.org.eg/NewsContent/1/64/100735/Egypt/Politics-/Egypts-government-to-reapply-daylight-saving-time-.aspx -# From Gunther Vermier (2015-05-13): +# From Gunther Vermier (2014-05-13): # our Egypt office confirms that the change will be at 15 May "midnight" (24:00) # From Imed Chihi (2014-06-04): @@ -408,16 +384,13 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct 2:00 Egypt EE%sT # Equatorial Guinea -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Malabo 0:35:08 - LMT 1912 - 0:00 - GMT 1963 Dec 15 - 1:00 - WAT +# See Africa/Lagos. # Eritrea # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Asmara 2:35:32 - LMT 1870 - 2:35:32 - AMT 1890 # Asmara Mean Time - 2:35:20 - ADMT 1936 May 5 # Adis Dera MT + 2:35:32 - AMT 1890 # Asmara Mean Time + 2:35:20 - ADMT 1936 May 5 # Adis Dera MT 3:00 - EAT # Ethiopia @@ -429,16 +402,15 @@ Zone Africa/Asmara 2:35:32 - LMT 1870 # Shanks & Pottenger write that Ethiopia had six narrowly-spaced time # zones between 1870 and 1890, that they merged to 38E50 (2:35:20) in # 1890, and that they switched to 3:00 on 1936-05-05. Perhaps 38E50 -# was for Adis Dera. Quite likely the Shanks data are wrong anyway. +# was for Adis Dera. Quite likely the Shanks data entries are wrong +# anyway. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Addis_Ababa 2:34:48 - LMT 1870 - 2:35:20 - ADMT 1936 May 5 # Adis Dera MT + 2:35:20 - ADMT 1936 May 5 # Adis Dera MT 3:00 - EAT # Gabon -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Libreville 0:37:48 - LMT 1912 - 1:00 - WAT +# See Africa/Lagos. # Gambia # See Africa/Abidjan. @@ -461,8 +433,14 @@ Zone Africa/Accra -0:00:52 - LMT 1918 # See Africa/Abidjan. # Guinea-Bissau +# +# Shanks gives 1911-05-26 for the transition to WAT, +# evidently confusing the date of the Portuguese decree +# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# with the date that it took effect, namely 1912-01-01. +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Bissau -1:02:20 - LMT 1911 May 26 +Zone Africa/Bissau -1:02:20 - LMT 1912 Jan 1 -1:00 - WAT 1975 0:00 - GMT @@ -475,11 +453,7 @@ Zone Africa/Nairobi 2:27:16 - LMT 1928 J 3:00 - EAT # Lesotho -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Maseru 1:50:00 - LMT 1903 Mar - 2:00 - SAST 1943 Sep 19 2:00 - 2:00 1:00 SAST 1944 Mar 19 2:00 - 2:00 - SAST +# See Africa/Johannesburg. # Liberia # From Paul Eggert (2006-03-22): @@ -546,11 +520,11 @@ Zone Africa/Tripoli 0:52:44 - LMT 1920 2:00 - EET 1982 1:00 Libya CE%sT 1990 May 4 # The 1996 and 1997 entries are from Shanks & Pottenger; -# the IATA SSIM data contain some obvious errors. +# the IATA SSIM data entries contain some obvious errors. 2:00 - EET 1996 Sep 30 1:00 Libya CE%sT 1997 Oct 4 - 2:00 - EET 2012 Nov 10 2:00 - 1:00 Libya CE%sT 2013 Oct 25 2:00 + 2:00 - EET 2012 Nov 10 2:00 + 1:00 Libya CE%sT 2013 Oct 25 2:00 2:00 - EET # Madagascar @@ -561,9 +535,7 @@ Zone Indian/Antananarivo 3:10:04 - LMT 1 3:00 - EAT # Malawi -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Blantyre 2:20:00 - LMT 1903 Mar - 2:00 - CAT +# See Africa/Maputo. # Mali # Mauritania @@ -606,7 +578,7 @@ Zone Africa/Blantyre 2:20:00 - LMT 1903 # From Alex Krivenyshev (2008-07-11): # Seems that English language article "The revival of daylight saving -# time: Energy conservation?"-# No. 16578 (07/11/2008) was originally +# time: Energy conservation?"-# No. 16578 (07/11/2008) was originally # published on Monday, June 30, 2008... # # I guess that article in French "Le gouvernement avance l'introduction @@ -657,14 +629,14 @@ Rule Mauritius 1983 only - Mar 21 0:00 0 Rule Mauritius 2008 only - Oct lastSun 2:00 1:00 S Rule Mauritius 2009 only - Mar lastSun 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis +Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis 4:00 Mauritius MU%sT # Mauritius Time # Agalega Is, Rodriguez # no information; probably like Indian/Mauritius # Mayotte # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou +Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou 3:00 - EAT # Morocco @@ -682,7 +654,8 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # http://en.afrik.com/news11892.html # From Alex Krivenyshev (2008-05-09): -# The Morocco time change can be confirmed on Morocco web site Maghreb Arabe Presse: +# The Morocco time change can be confirmed on Morocco web site Maghreb Arabe +# Presse: # http://www.map.ma/eng/sections/box3/morocco_shifts_to_da/view # # Morocco shifts to daylight time on June 1st through September 27, Govt. @@ -760,8 +733,8 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # From Dan Abitol (2011-03-30): # ...Rules for Africa/Casablanca are the following (24h format) -# The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00 -# The 31th july 2011 at 00:59:59, [it] will be 31th July 00:00:00 +# The 3rd April 2011 at 00:00:00, [it] will be 3rd April 01:00:00 +# The 31st July 2011 at 00:59:59, [it] will be 31st July 00:00:00 # ...Official links of change in morocco # The change was broadcast on the FM Radio # I ve called ANRT (telecom regulations in Morocco) at @@ -831,7 +804,7 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # announced a bit in advance. On 2012-07-11 the Moroccan government # announced that year's Ramadan daylight-saving transitions would be # 2012-07-20 and 2012-08-20; see -# . +# http://www.mmsp.gov.ma/fr/actualites.aspx?id=288 # From Andrew Paprocki (2013-07-02): # Morocco announced that the year's Ramadan daylight-savings @@ -963,16 +936,29 @@ Zone Africa/El_Aaiun -0:52:48 - LMT 1934 0:00 Morocco WE%sT # Mozambique +# +# Shanks gives 1903-03-01 for the transition to CAT. +# Perhaps the 1911-05-26 Portuguese decree +# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf +# merely made it official? +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Maputo 2:10:20 - LMT 1903 Mar 2:00 - CAT +Link Africa/Maputo Africa/Blantyre # Malawi +Link Africa/Maputo Africa/Bujumbura # Burundi +Link Africa/Maputo Africa/Gaborone # Botswana +Link Africa/Maputo Africa/Harare # Zimbabwe +Link Africa/Maputo Africa/Kigali # Rwanda +Link Africa/Maputo Africa/Lubumbashi # E Dem. Rep. of Congo +Link Africa/Maputo Africa/Lusaka # Zambia # Namibia # The 1994-04-03 transition is from Shanks & Pottenger. # Shanks & Pottenger report no DST after 1998-04; go with IATA. -# From Petronella Sibeene (2007-03-30) in -# : +# From Petronella Sibeene (2007-03-30): +# http://allafrica.com/stories/200703300178.html # While the entire country changes its time, Katima Mulilo and other # settlements in Caprivi unofficially will not because the sun there # rises and sets earlier compared to other regions. Chief of @@ -989,28 +975,33 @@ Rule Namibia 1994 max - Sep Sun>=1 2:00 Rule Namibia 1995 max - Apr Sun>=1 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Windhoek 1:08:24 - LMT 1892 Feb 8 - 1:30 - SWAT 1903 Mar # SW Africa Time - 2:00 - SAST 1942 Sep 20 2:00 - 2:00 1:00 SAST 1943 Mar 21 2:00 + 1:30 - SWAT 1903 Mar # SW Africa Time + 2:00 - SAST 1942 Sep 20 2:00 + 2:00 1:00 SAST 1943 Mar 21 2:00 2:00 - SAST 1990 Mar 21 # independence 2:00 - CAT 1994 Apr 3 1:00 Namibia WA%sT # Niger -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Niamey 0:08:28 - LMT 1912 - -1:00 - WAT 1934 Feb 26 - 0:00 - GMT 1960 - 1:00 - WAT +# See Africa/Lagos. # Nigeria # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Lagos 0:13:36 - LMT 1919 Sep 1:00 - WAT +Link Africa/Lagos Africa/Bangui # Central African Republic +Link Africa/Lagos Africa/Brazzaville # Rep. of the Congo +Link Africa/Lagos Africa/Douala # Cameroon +Link Africa/Lagos Africa/Kinshasa # Dem. Rep. of the Congo (west) +Link Africa/Lagos Africa/Libreville # Gabon +Link Africa/Lagos Africa/Luanda # Angola +Link Africa/Lagos Africa/Malabo # Equatorial Guinea +Link Africa/Lagos Africa/Niamey # Niger +Link Africa/Lagos Africa/Porto-Novo # Benin # Réunion # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Denis +Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Denis 4:00 - RET # Réunion Time # # Crozet Islands also observes Réunion time; see the 'antarctica' file. @@ -1028,9 +1019,7 @@ Zone Indian/Reunion 3:41:52 - LMT 1911 J # Tromelin - inhabited until at least 1958 # Rwanda -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Kigali 2:00:16 - LMT 1935 Jun - 2:00 - CAT +# See Africa/Maputo. # St Helena # See Africa/Abidjan. @@ -1047,7 +1036,7 @@ Zone Africa/Kigali 2:00:16 - LMT 1935 Ju # Seychelles # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria +Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria 4:00 - SCT # Seychelles Time # From Paul Eggert (2001-05-30): # Aldabra, Farquhar, and Desroches, originally dependencies of the @@ -1074,6 +1063,9 @@ Rule SA 1943 1944 - Mar Sun>=15 2:00 0 - Zone Africa/Johannesburg 1:52:00 - LMT 1892 Feb 8 1:30 - SAST 1903 Mar 2:00 SA SAST +Link Africa/Johannesburg Africa/Maseru # Lesotho +Link Africa/Johannesburg Africa/Mbabane # Swaziland +# # Marion and Prince Edward Is # scientific station since 1947 # no information @@ -1101,9 +1093,7 @@ Zone Africa/Khartoum 2:10:08 - LMT 1931 Link Africa/Khartoum Africa/Juba # Swaziland -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Mbabane 2:04:24 - LMT 1903 Mar - 2:00 - SAST +# See Africa/Johannesburg. # Tanzania # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1128,7 +1118,7 @@ Zone Africa/Dar_es_Salaam 2:37:08 - LMT # # From Oscar van Vlijmen (2005-05-02): # La Presse, the first national daily newspaper ... -# +# http://www.lapresse.tn/archives/archives280405/actualites/lheure.html # ... DST for 2005: on: Sun May 1 0h standard time, off: Fri Sept. 30, # 1h standard time. # @@ -1212,7 +1202,7 @@ Rule Tunisia 2006 2008 - Oct lastSun 2: # Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Tunis 0:40:44 - LMT 1881 May 12 - 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time + 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time 1:00 Tunisia CE%sT # Uganda @@ -1224,11 +1214,5 @@ Zone Africa/Kampala 2:09:40 - LMT 1928 J 3:00 - EAT # Zambia -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Lusaka 1:53:08 - LMT 1903 Mar - 2:00 - CAT - # Zimbabwe -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Harare 2:04:12 - LMT 1903 Mar - 2:00 - CAT +# See Africa/Maputo. Modified: stable/6/share/zoneinfo/antarctica ============================================================================== --- stable/6/share/zoneinfo/antarctica Mon Oct 27 06:13:22 2014 (r273723) +++ stable/6/share/zoneinfo/antarctica Mon Oct 27 06:14:13 2014 (r273724) @@ -4,10 +4,10 @@ # From Paul Eggert (1999-11-15): # To keep things manageable, we list only locations occupied year-round; see # COMNAP - Stations and Bases -# +# http://www.comnap.aq/comnap/comnap.nsf/P/Stations/ # and # Summary of the Peri-Antarctic Islands (1998-07-23) -# +# http://www.spri.cam.ac.uk/bob/periant.htm # for information. # Unless otherwise specified, we have no time zone information. # @@ -63,7 +63,7 @@ Rule ChileAQ 2012 max - Sep Sun>=2 4:00u # Heard Island, McDonald Islands (uninhabited) # previously sealers and scientific personnel wintered # Margaret Turner reports -# +# http://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html # (1999-09-30) that they're UTC+5, with no DST; # presumably this is when they have visitors. # @@ -103,32 +103,30 @@ Rule ChileAQ 2012 max - Sep Sun>=2 4:00u # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Antarctica/Casey 0 - zzz 1969 - 8:00 - AWST 2009 Oct 18 2:00 + 8:00 - AWST 2009 Oct 18 2:00 # Australian Western Std Time - 11:00 - CAST 2010 Mar 5 2:00 - # Casey Time - 8:00 - AWST 2011 Oct 28 2:00 + 11:00 - CAST 2010 Mar 5 2:00 # Casey Time + 8:00 - AWST 2011 Oct 28 2:00 11:00 - CAST 2012 Feb 21 17:00u 8:00 - AWST Zone Antarctica/Davis 0 - zzz 1957 Jan 13 - 7:00 - DAVT 1964 Nov # Davis Time + 7:00 - DAVT 1964 Nov # Davis Time 0 - zzz 1969 Feb - 7:00 - DAVT 2009 Oct 18 2:00 + 7:00 - DAVT 2009 Oct 18 2:00 5:00 - DAVT 2010 Mar 10 20:00u - 7:00 - DAVT 2011 Oct 28 2:00 + 7:00 - DAVT 2011 Oct 28 2:00 5:00 - DAVT 2012 Feb 21 20:00u 7:00 - DAVT Zone Antarctica/Mawson 0 - zzz 1954 Feb 13 - 6:00 - MAWT 2009 Oct 18 2:00 - # Mawson Time + 6:00 - MAWT 2009 Oct 18 2:00 # Mawson Time 5:00 - MAWT # References: # Casey Weather (1998-02-26) -# +# http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html # Davis Station, Antarctica (1998-02-26) -# +# http://www.antdiv.gov.au/aad/exop/sfo/davis/video.html # Mawson Station, Antarctica (1998-02-25) -# +# http://www.antdiv.gov.au/aad/exop/sfo/mawson/video.html # Belgium - year-round base # Princess Elisabeth, Queen Maud Land, -713412+0231200, since 2007 @@ -154,7 +152,7 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb # France - year-round bases (also see "France & Italy") # # From Antoine Leca (1997-01-20): -# Time data are from Nicole Pailleau at the IFRTP +# Time data entries are from Nicole Pailleau at the IFRTP # (French Institute for Polar Research and Technology). # She confirms that French Southern Territories and Terre Adélie bases # don't observe daylight saving time, even if Terre Adélie supplies came @@ -174,7 +172,7 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb # fishing stations operated variously 1819/1931 # # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Kerguelen 0 - zzz 1950 # Port-aux-Français +Zone Indian/Kerguelen 0 - zzz 1950 # Port-aux-Français 5:00 - TFT # ISO code TF Time # # year-round base in the main continent @@ -217,7 +215,7 @@ Zone Antarctica/Syowa 0 - zzz 1957 Jan 2 3:00 - SYOT # Syowa Time # See: # NIPR Antarctic Research Activities (1999-08-17) -# +# http://www.nipr.ac.jp/english/ara01.html # S Korea - year-round base # Jang Bogo, Terra Nova Bay, -743700+1641205 since 2014 @@ -264,7 +262,7 @@ Rule Troll 2005 max - Mar lastSun 1:00u Rule Troll 2004 max - Oct lastSun 1:00u 0:00 UTC # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Antarctica/Troll 0 - zzz 2005 Feb 12 - 0:00 Troll %s + 0:00 Troll %s # Poland - year-round base # Arctowski, King George Island, -620945-0582745, since 1977 @@ -281,8 +279,8 @@ Zone Antarctica/Troll 0 - zzz 2005 Feb 1 # year-round from 1960/61 to 1992 # Vostok, since 1957-12-16, temporarily closed 1994-02/1994-11 -# From Craig Mundell (1994-12-15) -# : +# From Craig Mundell (1994-12-15): +# http://quest.arc.nasa.gov/antarctica/QA/computers/Directions,Time,ZIP # Vostok, which is one of the Russian stations, is set on the same # time as Moscow, Russia. # Modified: stable/6/share/zoneinfo/asia ============================================================================== --- stable/6/share/zoneinfo/asia Mon Oct 27 06:13:22 2014 (r273723) +++ stable/6/share/zoneinfo/asia Mon Oct 27 06:14:13 2014 (r273724) @@ -1,9 +1,10 @@ # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. -# This data is by no means authoritative; if you think you know better, +# This file is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@iana.org for general use in the future). +# tz@iana.org for general use in the future). For more, please see +# the file CONTRIBUTING in the tz distribution. # From Paul Eggert (2013-08-11): # @@ -25,8 +26,12 @@ # I found in the UCLA library. # # For data circa 1899, a common source is: -# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 -# . +# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94. +# http://www.jstor.org/stable/1774359 +# +# For Russian data circa 1919, a source is: +# Byalokoz EL. New Counting of Time in Russia since July 1, 1919. +# (See the 'europe' file for a fuller citation.) # # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). @@ -42,10 +47,11 @@ # 3:30 IRST IRDT Iran # 4:00 GST Gulf* # 5:30 IST India -# 7:00 ICT Indochina* +# 7:00 ICT Indochina, most times and locations* # 7:00 WIB west Indonesia (Waktu Indonesia Barat) # 8:00 WITA central Indonesia (Waktu Indonesia Tengah) # 8:00 CST China +# 8:00 IDT Indochina, 1943-45, 1947-55, 1960-75 (some locations)* # 8:00 JWST Western Standard Time (Japan, 1896/1937)* # 9:00 JCST Central Standard Time (Japan, 1896/1937) # 9:00 WIT east Indonesia (Waktu Indonesia Timur) @@ -115,11 +121,11 @@ Zone Asia/Kabul 4:36:48 - LMT 1890 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2 3:00 - YERT 1957 Mar # Yerevan Time - 4:00 RussiaAsia YER%sT 1991 Mar 31 2:00s + 4:00 RussiaAsia YER%sT 1991 Mar 31 2:00s 3:00 1:00 YERST 1991 Sep 23 # independence - 3:00 RussiaAsia AM%sT 1995 Sep 24 2:00s + 3:00 RussiaAsia AM%sT 1995 Sep 24 2:00s 4:00 - AMT 1997 - 4:00 RussiaAsia AM%sT 2012 Mar 25 2:00s + 4:00 RussiaAsia AM%sT 2012 Mar 25 2:00s 4:00 - AMT # Azerbaijan @@ -132,16 +138,16 @@ Rule Azer 1997 max - Oct lastSun 5:00 0 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Baku 3:19:24 - LMT 1924 May 2 3:00 - BAKT 1957 Mar # Baku Time - 4:00 RussiaAsia BAK%sT 1991 Mar 31 2:00s + 4:00 RussiaAsia BAK%sT 1991 Mar 31 2:00s 3:00 1:00 BAKST 1991 Aug 30 # independence 3:00 RussiaAsia AZ%sT 1992 Sep lastSat 23:00 - 4:00 - AZT 1996 # Azerbaijan time + 4:00 - AZT 1996 # Azerbaijan Time 4:00 EUAsia AZ%sT 1997 4:00 Azer AZ%sT # Bahrain # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah +Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah 4:00 - GST 1972 Jun 3:00 - AST @@ -219,7 +225,7 @@ Zone Asia/Bahrain 3:22:20 - LMT 1920 # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Dhaka 2009 only - Jun 19 23:00 1:00 S -Rule Dhaka 2009 only - Dec 31 23:59 0 - +Rule Dhaka 2009 only - Dec 31 24:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Dhaka 6:01:40 - LMT 1890 @@ -250,7 +256,7 @@ Zone Indian/Chagos 4:49:40 - LMT 1907 # Brunei # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan +Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan 7:30 - BNT 1933 8:00 - BNT @@ -259,19 +265,15 @@ Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Milne says 6:24:40 was the meridian of the time ball observatory at Rangoon. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Rangoon 6:24:40 - LMT 1880 # or Yangon - 6:24:40 - RMT 1920 # Rangoon Mean Time? - 6:30 - BURT 1942 May # Burma Time - 9:00 - JST 1945 May 3 - 6:30 - MMT # Myanmar Time +Zone Asia/Rangoon 6:24:40 - LMT 1880 # or Yangon + 6:24:40 - RMT 1920 # Rangoon Mean Time? + 6:30 - BURT 1942 May # Burma Time + 9:00 - JST 1945 May 3 + 6:30 - MMT # Myanmar Time # Cambodia -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Phnom_Penh 6:59:40 - LMT 1906 Jun 9 - 7:06:20 - SMT 1911 Mar 11 0:01 # Saigon MT? - 7:00 - ICT 1912 May - 8:00 - ICT 1931 May - 7:00 - ICT +# See Asia/Bangkok. + # China @@ -356,8 +358,8 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1: # * The Republic of China instituted Beijing mean solar time effective # the official calendar book of 1914. # * The French Concession in Shanghai set up signal stations in -# French docks in the 1890s, controled by Xujiahui (Zikawei) -# Obervatory and set to local mean time. +# French docks in the 1890s, controlled by Xujiahui (Zikawei) +# Observatory and set to local mean time. # * "From the end of the 19th century" it changed to UT+8. # * Chinese Customs (by then reduced to a tool of foreign powers) # eventually standardized on this time for all ports, and it @@ -381,7 +383,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1: # Xujiahui Observatory was under French control and stuck with UT+8. # # In earlier versions of this file, China had many separate Zone entries, but -# this was based on what was apparently incorrect data in Shanks & Pottenger. +# this was based on what were apparently incorrect data in Shanks & Pottenger. # This has now been simplified to the two entries Asia/Shanghai and # Asia/Urumqi, with the others being links for backward compatibility. # Proposed in 1918 and theoretically in effect until 1949 (although in practice @@ -501,7 +503,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1: # "The Working-Calendar for The Xinjiang Uygur Autonomous Region Government" # (2014-04-22). # Unfortunately, we have no good records of time in Xinjiang before 1986. -# During the 20th century parts of Xinjiang were ruled by the Qing dyansty, +# During the 20th century parts of Xinjiang were ruled by the Qing dynasty, # the Republic of China, various warlords, the First and Second East Turkestan # Republics, the Soviet Union, the Kuomintang, and the People's Republic of # China, and tracking down all these organizations' timekeeping rules would be @@ -698,19 +700,19 @@ Zone Asia/Hong_Kong 7:36:42 - LMT 1904 O # Central Weather Bureau website was not correct. # # Original Bulletin: -# -# (cont.) +# http://subtpg.tpg.gov.tw/og/image2.asp?f=03502F0AKM1AF +# http://subtpg.tpg.gov.tw/og/image2.asp?f=0350300AKM1B0 (cont.) # # In 1947, DST in Taiwan was expanded to Oct 31. There is a backup of that # telegram announcement from Taiwan Province Government: # -# +# http://subtpg.tpg.gov.tw/og/image2.asp?f=0360310AKZ431 # # Here is a brief translation: # # The Summer Time this year is adopted from midnight Apr 15 until Sep 20 # midnight. To save (energy?) consumption, we're expanding Summer Time -# adption till Oct 31 midnight. +# adoption till Oct 31 midnight. # # The Central Weather Bureau website didn't mention that, however it can # be found from historical government announcement database. @@ -741,7 +743,7 @@ Rule Taiwan 1979 only - Oct 1 0:00 0 S # Taipei or Taibei or T'ai-pei Zone Asia/Taipei 8:06:00 - LMT 1896 Jan 1 8:00 - JWST 1937 Oct 1 - 9:00 - JST 1945 Sep 21 01:00 + 9:00 - JST 1945 Sep 21 1:00 8:00 Taiwan C%sT # Macau (Macao, Aomen) @@ -761,7 +763,7 @@ Rule Macau 1975 1977 - Apr Sun>=15 3:30 Rule Macau 1978 1980 - Apr Sun>=15 0:00 1:00 S Rule Macau 1978 1980 - Oct Sun>=15 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Macau 7:34:20 - LMT 1912 +Zone Asia/Macau 7:34:20 - LMT 1912 Jan 1 8:00 Macau MO%sT 1999 Dec 20 # return to China 8:00 PRC C%sT @@ -823,20 +825,22 @@ Link Asia/Nicosia Europe/Nicosia # I don't know what can be done, especially knowing that some years ago our # DST rules where changed THREE TIMES during one month. -# Milne says Tbilisi (Tiflis) time was 2:59:05.7; round to nearest.) +# Milne 1899 says Tbilisi (Tiflis) time was 2:59:05.7. +# Byalokoz 1919 says Georgia was 2:59:11. +# Go with Byalokoz. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Tbilisi 2:59:06 - LMT 1880 - 2:59:06 - TBMT 1924 May 2 # Tbilisi Mean Time +Zone Asia/Tbilisi 2:59:11 - LMT 1880 + 2:59:11 - TBMT 1924 May 2 # Tbilisi Mean Time 3:00 - TBIT 1957 Mar # Tbilisi Time - 4:00 RussiaAsia TBI%sT 1991 Mar 31 2:00s + 4:00 RussiaAsia TBI%sT 1991 Mar 31 2:00s 3:00 1:00 TBIST 1991 Apr 9 # independence - 3:00 RussiaAsia GE%sT 1992 # Georgia Time + 3:00 RussiaAsia GE%sT 1992 # Georgia Time 3:00 E-EurAsia GE%sT 1994 Sep lastSun 4:00 E-EurAsia GE%sT 1996 Oct lastSun 4:00 1:00 GEST 1997 Mar lastSun 4:00 E-EurAsia GE%sT 2004 Jun 27 - 3:00 RussiaAsia GE%sT 2005 Mar lastSun 2:00 + 3:00 RussiaAsia GE%sT 2005 Mar lastSun 2:00 4:00 - GET # East Timor @@ -864,16 +868,16 @@ Zone Asia/Tbilisi 2:59:06 - LMT 1880 # midnight on Saturday, September 16. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Dili 8:22:20 - LMT 1912 +Zone Asia/Dili 8:22:20 - LMT 1912 Jan 1 8:00 - TLT 1942 Feb 21 23:00 # E Timor Time 9:00 - JST 1945 Sep 23 9:00 - TLT 1976 May 3 - 8:00 - WITA 2000 Sep 17 00:00 + 8:00 - WITA 2000 Sep 17 0:00 9:00 - TLT # India # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata +Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata 5:53:20 - HMT 1941 Oct # Howrah Mean Time? 6:30 - BURT 1942 May 15 # Burma Time 5:30 - IST 1942 Sep @@ -886,8 +890,12 @@ Zone Asia/Kolkata 5:53:28 - LMT 1880 # K # Indonesia # +# From Paul Eggert (2014-09-06): +# The 1876 Report of the Secretary of the [US] Navy, p 306 says that Batavia +# civil time was 7:07:12.5; round to even for Jakarta. +# # From Gwillim Law (2001-05-28), overriding Shanks & Pottenger: -# +# http://www.sumatera-inc.com/go_to_invest/about_indonesia.asp#standtime # says that Indonesia's time zones changed on 1988-01-01. Looking at some # time zone maps, I think that must refer to Western Borneo (Kalimantan Barat # and Kalimantan Tengah) switching from UTC+8 to UTC+7. @@ -924,7 +932,7 @@ Zone Asia/Jakarta 7:07:12 - LMT 1867 Aug # Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13, # but this must be a typo. 7:07:12 - BMT 1923 Dec 31 23:47:12 # Batavia - 7:20 - JAVT 1932 Nov # Java Time + 7:20 - JAVT 1932 Nov # Java Time 7:30 - WIB 1942 Mar 23 9:00 - JST 1945 Sep 23 7:30 - WIB 1948 May @@ -1082,7 +1090,7 @@ Rule Iran 2036 2037 - Mar 21 0:00 1:00 D Rule Iran 2036 2037 - Sep 21 0:00 0 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tehran 3:25:44 - LMT 1916 - 3:25:44 - TMT 1946 # Tehran Mean Time + 3:25:44 - TMT 1946 # Tehran Mean Time 3:30 - IRST 1977 Nov 4:00 Iran IR%sT 1979 3:30 Iran IR%sT @@ -1127,7 +1135,7 @@ Rule Iraq 1991 2007 - Apr 1 3:00s 1:00 Rule Iraq 1991 2007 - Oct 1 3:00s 0 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Baghdad 2:57:40 - LMT 1890 - 2:57:36 - BMT 1918 # Baghdad Mean Time? + 2:57:36 - BMT 1918 # Baghdad Mean Time? 3:00 - AST 1982 May 3:00 Iraq A%sT @@ -1355,7 +1363,7 @@ Rule Zion 2013 max - Oct lastSun 2:00 0 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Jerusalem 2:20:54 - LMT 1880 - 2:20:40 - JMT 1918 # Jerusalem Mean Time? + 2:20:40 - JMT 1918 # Jerusalem Mean Time? 2:00 Zion I%sT @@ -1371,8 +1379,8 @@ Zone Asia/Jerusalem 2:20:54 - LMT 1880 # daylight saving between 1948 and 1951, but "the system was discontinued # because the public believed it would lead to longer working hours." -# From Mayumi Negishi in the 2005-08-10 Japan Times -# : +# From Mayumi Negishi in the 2005-08-10 Japan Times: +# http://www.japantimes.co.jp/cgi-bin/getarticle.pl5?nn20050810f2.htm # Occupation authorities imposed daylight-saving time on Japan on # [1948-05-01].... But lack of prior debate and the execution of # daylight-saving time just three days after the bill was passed generated @@ -1396,7 +1404,8 @@ Rule Japan 1950 1951 - May Sun>=1 2:00 1 # From Hideyuki Suzuki (1998-11-09): # 'Tokyo' usually stands for the former location of Tokyo Astronomical -# Observatory: 139 degrees 44' 40.90" E (9h 18m 58.727s), 35 degrees 39' 16.0" N. +# Observatory: 139 degrees 44' 40.90" E (9h 18m 58.727s), +# 35 degrees 39' 16.0" N. # This data is from 'Rika Nenpyou (Chronological Scientific Tables) 1996' # edited by National Astronomical Observatory of Japan.... # JST (Japan Standard Time) has been used since 1888-01-01 00:00 (JST). @@ -1586,10 +1595,10 @@ Zone Asia/Qyzylorda 4:21:52 - LMT 1924 M 6:00 - KIZT 1982 Apr 1 5:00 RussiaAsia KIZ%sT 1991 5:00 - KIZT 1991 Dec 16 # independence - 5:00 - QYZT 1992 Jan 19 2:00 + 5:00 - QYZT 1992 Jan 19 2:00 6:00 RussiaAsia QYZ%sT 2005 Mar 15 6:00 - QYZT -# Aqtobe (aka Aktobe, formerly Akt'ubinsk) +# Aqtobe (aka Aktobe, formerly Aktyubinsk) Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 4:00 - AKTT 1930 Jun 21 # Aktyubinsk Time 5:00 - AKTT 1981 Apr 1 @@ -1609,7 +1618,7 @@ Zone Asia/Aqtau 3:21:04 - LMT 1924 May 6:00 - SHET 1982 Apr 1 5:00 RussiaAsia SHE%sT 1991 5:00 - SHET 1991 Dec 16 # independence - 5:00 RussiaAsia AQT%sT 1995 Mar lastSun 2:00 # Aqtau Time + 5:00 RussiaAsia AQT%sT 1995 Mar lastSun 2:00 # Aqtau Time 4:00 RussiaAsia AQT%sT 2005 Mar 15 5:00 - AQTT # West Kazakhstan @@ -1618,7 +1627,7 @@ Zone Asia/Oral 3:25:24 - LMT 1924 May 2 5:00 - URAT 1981 Apr 1 5:00 1:00 URAST 1981 Oct 1 6:00 - URAT 1982 Apr 1 - 5:00 RussiaAsia URA%sT 1989 Mar 26 2:00 + 5:00 RussiaAsia URA%sT 1989 Mar 26 2:00 4:00 RussiaAsia URA%sT 1991 4:00 - URAT 1991 Dec 16 # independence 4:00 RussiaAsia ORA%sT 2005 Mar 15 # Oral Time @@ -1629,7 +1638,7 @@ Zone Asia/Oral 3:25:24 - LMT 1924 May 2 # From Paul Eggert (2005-08-15): # According to an article dated today in the Kyrgyzstan Development Gateway -# +# http://eng.gateway.kg/cgi-bin/page.pl?id=1&story_name=doc9979.shtml # Kyrgyzstan is canceling the daylight saving time system. I take the article # to mean that they will leave their clocks at 6 hours ahead of UTC. # From Malik Abdugaliev (2005-09-21): @@ -1644,17 +1653,17 @@ Rule Kyrgyz 1997 2004 - Oct lastSun 2:30 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2 5:00 - FRUT 1930 Jun 21 # Frunze Time - 6:00 RussiaAsia FRU%sT 1991 Mar 31 2:00s - 5:00 1:00 FRUST 1991 Aug 31 2:00 # independence - 5:00 Kyrgyz KG%sT 2005 Aug 12 # Kyrgyzstan Time + 6:00 RussiaAsia FRU%sT 1991 Mar 31 2:00s + 5:00 1:00 FRUST 1991 Aug 31 2:00 # independence + 5:00 Kyrgyz KG%sT 2005 Aug 12 # Kyrgyzstan Time 6:00 - KGT ############################################################################### # Korea (North and South) -# From Annie I. Bang (2006-07-10) in -# : +# From Annie I. Bang (2006-07-10): +# http://www.koreaherald.co.kr/SITE/data/html_dir/2006/07/10/200607100012.asp # The Ministry of Commerce, Industry and Energy has already # commissioned a research project [to reintroduce DST] and has said # the system may begin as early as 2008.... Korea ran a daylight @@ -1702,12 +1711,8 @@ Zone Asia/Kuwait 3:11:56 - LMT 1950 3:00 - AST # Laos -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Vientiane 6:50:24 - LMT 1906 Jun 9 # or Viangchan - 7:06:20 - SMT 1911 Mar 11 0:01 # Saigon MT? - 7:00 - ICT 1912 May - 8:00 - ICT 1931 May - 7:00 - ICT +# See Asia/Bangkok. + # Lebanon # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -1745,8 +1750,8 @@ Rule NBorneo 1935 1941 - Sep 14 0:00 0:2 Rule NBorneo 1935 1941 - Dec 14 0:00 0 - # # peninsular Malaysia -# The data here are taken from Mok Ly Yng (2003-10-30) -# . +# taken from Mok Ly Yng (2003-10-30) +# http://www.math.nus.edu.sg/aslaksen/teaching/timezone.html # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Kuala_Lumpur 6:46:46 - LMT 1901 Jan 1 6:55:25 - SMT 1905 Jun 1 # Singapore M.T. @@ -1758,12 +1763,12 @@ Zone Asia/Kuala_Lumpur 6:46:46 - LMT 190 7:30 - MALT 1982 Jan 1 8:00 - MYT # Malaysia Time # Sabah & Sarawak -# From Paul Eggert (2006-03-22): -# The data here are mostly from Shanks & Pottenger, but the 1942, 1945 and 1982 -# transition dates are from Mok Ly Yng. +# From Paul Eggert (2014-08-12): +# The data entries here are mostly from Shanks & Pottenger, but the 1942, 1945 +# and 1982 transition dates are from Mok Ly Yng. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Kuching 7:21:20 - LMT 1926 Mar - 7:30 - BORT 1933 # Borneo Time + 7:30 - BORT 1933 # Borneo Time 8:00 NBorneo BOR%sT 1942 Feb 16 9:00 - JST 1945 Sep 12 8:00 - BORT 1982 Jan 1 @@ -1771,9 +1776,9 @@ Zone Asia/Kuching 7:21:20 - LMT 1926 Mar # Maldives # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Maldives 4:54:00 - LMT 1880 # Male - 4:54:00 - MMT 1960 # Male Mean Time - 5:00 - MVT # Maldives Time +Zone Indian/Maldives 4:54:00 - LMT 1880 # Male + 4:54:00 - MMT 1960 # Male Mean Time + 5:00 - MVT # Maldives Time # Mongolia @@ -1835,7 +1840,7 @@ Zone Indian/Maldives 4:54:00 - LMT 1880 # Oscar van Vlijmen (2005-05-20) reports that the Mongolian Embassy in # Washington, DC says there are two time zones, with DST observed. # He also found *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 07:20:40 2014 Return-Path: Delivered-To: svn-src-all@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 C11EF457; Mon, 27 Oct 2014 07:20: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 AC77D685; Mon, 27 Oct 2014 07:20: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 s9R7Kefu012791; Mon, 27 Oct 2014 07:20:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9R7KedQ012705; Mon, 27 Oct 2014 07:20:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201410270720.s9R7KedQ012705@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 27 Oct 2014 07:20:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273725 - in stable/10/sys/dev/ata: . chipsets X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 07:20:40 -0000 Author: mav Date: Mon Oct 27 07:20:39 2014 New Revision: 273725 URL: https://svnweb.freebsd.org/changeset/base/273725 Log: MFC r273328: Add another PCI ID for JMB368 PATA controller. Modified: stable/10/sys/dev/ata/ata-pci.h stable/10/sys/dev/ata/chipsets/ata-jmicron.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ata/ata-pci.h ============================================================================== --- stable/10/sys/dev/ata/ata-pci.h Mon Oct 27 06:14:13 2014 (r273724) +++ stable/10/sys/dev/ata/ata-pci.h Mon Oct 27 07:20:39 2014 (r273725) @@ -306,6 +306,7 @@ struct ata_pci_controller { #define ATA_JMB365 0x2365197b #define ATA_JMB366 0x2366197b #define ATA_JMB368 0x2368197b +#define ATA_JMB368_2 0x0368197b #define ATA_MARVELL_ID 0x11ab #define ATA_M88SX5040 0x504011ab Modified: stable/10/sys/dev/ata/chipsets/ata-jmicron.c ============================================================================== --- stable/10/sys/dev/ata/chipsets/ata-jmicron.c Mon Oct 27 06:14:13 2014 (r273724) +++ stable/10/sys/dev/ata/chipsets/ata-jmicron.c Mon Oct 27 07:20:39 2014 (r273725) @@ -71,6 +71,7 @@ ata_jmicron_probe(device_t dev) { ATA_JMB365, 0, 1, 2, ATA_UDMA6, "JMB365" }, { ATA_JMB366, 0, 2, 2, ATA_UDMA6, "JMB366" }, { ATA_JMB368, 0, 0, 1, ATA_UDMA6, "JMB368" }, + { ATA_JMB368_2, 0, 0, 1, ATA_UDMA6, "JMB368" }, { 0, 0, 0, 0, 0, 0}}; char buffer[64]; From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 07:21:38 2014 Return-Path: Delivered-To: svn-src-all@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 6C6BF585; Mon, 27 Oct 2014 07:21: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 583FE68F; Mon, 27 Oct 2014 07:21: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 s9R7LcS7015457; Mon, 27 Oct 2014 07:21:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9R7LbUc015454; Mon, 27 Oct 2014 07:21:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201410270721.s9R7LbUc015454@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 27 Oct 2014 07:21:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r273726 - in stable/9/sys/dev/ata: . chipsets X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 07:21:38 -0000 Author: mav Date: Mon Oct 27 07:21:37 2014 New Revision: 273726 URL: https://svnweb.freebsd.org/changeset/base/273726 Log: MFC r273328: Add another PCI ID for JMB368 PATA controller. Modified: stable/9/sys/dev/ata/ata-pci.h stable/9/sys/dev/ata/chipsets/ata-jmicron.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ata/ata-pci.h ============================================================================== --- stable/9/sys/dev/ata/ata-pci.h Mon Oct 27 07:20:39 2014 (r273725) +++ stable/9/sys/dev/ata/ata-pci.h Mon Oct 27 07:21:37 2014 (r273726) @@ -309,6 +309,7 @@ struct ata_pci_controller { #define ATA_JMB365 0x2365197b #define ATA_JMB366 0x2366197b #define ATA_JMB368 0x2368197b +#define ATA_JMB368_2 0x0368197b #define ATA_MARVELL_ID 0x11ab #define ATA_M88SX5040 0x504011ab Modified: stable/9/sys/dev/ata/chipsets/ata-jmicron.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-jmicron.c Mon Oct 27 07:20:39 2014 (r273725) +++ stable/9/sys/dev/ata/chipsets/ata-jmicron.c Mon Oct 27 07:21:37 2014 (r273726) @@ -72,6 +72,7 @@ ata_jmicron_probe(device_t dev) { ATA_JMB365, 0, 1, 2, ATA_UDMA6, "JMB365" }, { ATA_JMB366, 0, 2, 2, ATA_UDMA6, "JMB366" }, { ATA_JMB368, 0, 0, 1, ATA_UDMA6, "JMB368" }, + { ATA_JMB368_2, 0, 0, 1, ATA_UDMA6, "JMB368" }, { 0, 0, 0, 0, 0, 0}}; char buffer[64]; From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 07:47:13 2014 Return-Path: Delivered-To: svn-src-all@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 C9BB1C92; Mon, 27 Oct 2014 07:47: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 B66BD967; Mon, 27 Oct 2014 07:47: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 s9R7lDPv027795; Mon, 27 Oct 2014 07:47:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9R7lD0t027794; Mon, 27 Oct 2014 07:47:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201410270747.s9R7lD0t027794@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 27 Oct 2014 07:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273727 - head/sys/fs/nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 07:47:13 -0000 Author: kib Date: Mon Oct 27 07:47:13 2014 New Revision: 273727 URL: https://svnweb.freebsd.org/changeset/base/273727 Log: Allow the vfs.nfsd knobs to be set from loader.conf (or using kenv(8)). This is useful when nfsd is loaded as module. Reviewed by: rmacklem Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdkrpc.c Mon Oct 27 07:21:37 2014 (r273726) +++ head/sys/fs/nfsserver/nfs_nfsdkrpc.c Mon Oct 27 07:47:13 2014 (r273727) @@ -85,16 +85,16 @@ SYSCTL_DECL(_vfs_nfsd); SVCPOOL *nfsrvd_pool; static int nfs_privport = 0; -SYSCTL_INT(_vfs_nfsd, OID_AUTO, nfs_privport, CTLFLAG_RW, +SYSCTL_INT(_vfs_nfsd, OID_AUTO, nfs_privport, CTLFLAG_RWTUN, &nfs_privport, 0, "Only allow clients using a privileged port for NFSv2 and 3"); static int nfs_minvers = NFS_VER2; -SYSCTL_INT(_vfs_nfsd, OID_AUTO, server_min_nfsvers, CTLFLAG_RW, +SYSCTL_INT(_vfs_nfsd, OID_AUTO, server_min_nfsvers, CTLFLAG_RWTUN, &nfs_minvers, 0, "The lowest version of NFS handled by the server"); static int nfs_maxvers = NFS_VER4; -SYSCTL_INT(_vfs_nfsd, OID_AUTO, server_max_nfsvers, CTLFLAG_RW, +SYSCTL_INT(_vfs_nfsd, OID_AUTO, server_max_nfsvers, CTLFLAG_RWTUN, &nfs_maxvers, 0, "The highest version of NFS handled by the server"); static int nfs_proc(struct nfsrv_descript *, u_int32_t, SVCXPRT *xprt, From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 07:51:27 2014 Return-Path: Delivered-To: svn-src-all@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 B1736EFE; Mon, 27 Oct 2014 07:51: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 83FB1A13; Mon, 27 Oct 2014 07:51: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 s9R7pRHw031615; Mon, 27 Oct 2014 07:51:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9R7pR4K031613; Mon, 27 Oct 2014 07:51:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201410270751.s9R7pR4K031613@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 27 Oct 2014 07:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273728 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 07:51:27 -0000 Author: kib Date: Mon Oct 27 07:51:26 2014 New Revision: 273728 URL: https://svnweb.freebsd.org/changeset/base/273728 Log: Add a method to iicbus to request IIC_M_NOSTOP behaviour for multibyte transfers to be default. It simplifies porting code which assumes such settings. Discussed with: avg, llos, nwhitehorn Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/dev/iicbus/iicbus.h head/sys/dev/iicbus/iiconf.c Modified: head/sys/dev/iicbus/iicbus.h ============================================================================== --- head/sys/dev/iicbus/iicbus.h Mon Oct 27 07:47:13 2014 (r273727) +++ head/sys/dev/iicbus/iicbus.h Mon Oct 27 07:51:26 2014 (r273728) @@ -49,16 +49,19 @@ struct iicbus_softc struct iicbus_ivar { uint32_t addr; + bool nostop; }; enum { - IICBUS_IVAR_ADDR /* Address or base address */ + IICBUS_IVAR_ADDR, /* Address or base address */ + IICBUS_IVAR_NOSTOP, /* nostop defaults */ }; #define IICBUS_ACCESSOR(A, B, T) \ __BUS_ACCESSOR(iicbus, A, IICBUS, B, T) IICBUS_ACCESSOR(addr, ADDR, uint32_t) +IICBUS_ACCESSOR(nostop, NOSTOP, bool) #define IICBUS_LOCK(sc) mtx_lock(&(sc)->lock) #define IICBUS_UNLOCK(sc) mtx_unlock(&(sc)->lock) Modified: head/sys/dev/iicbus/iiconf.c ============================================================================== --- head/sys/dev/iicbus/iiconf.c Mon Oct 27 07:47:13 2014 (r273727) +++ head/sys/dev/iicbus/iiconf.c Mon Oct 27 07:51:26 2014 (r273728) @@ -365,6 +365,7 @@ iicbus_transfer_gen(device_t dev, struct { int i, error, lenread, lenwrote, nkid, rpstart, addr; device_t *children, bus; + bool nostop; if ((error = device_get_children(dev, &children, &nkid)) != 0) return (error); @@ -375,6 +376,7 @@ iicbus_transfer_gen(device_t dev, struct bus = children[0]; rpstart = 0; free(children, M_TEMP); + nostop = iicbus_get_nostop(dev); for (i = 0, error = 0; i < nmsgs && error == 0; i++) { addr = msgs[i].slave; if (msgs[i].flags & IIC_M_RD) @@ -399,11 +401,12 @@ iicbus_transfer_gen(device_t dev, struct error = iicbus_write(bus, msgs[i].buf, msgs[i].len, &lenwrote, 0); - if (!(msgs[i].flags & IIC_M_NOSTOP)) { + if ((msgs[i].flags & IIC_M_NOSTOP) != 0 || + (nostop && i + 1 < nmsgs)) { + rpstart = 1; /* Next message gets repeated start */ + } else { rpstart = 0; iicbus_stop(bus); - } else { - rpstart = 1; /* Next message gets repeated start */ } } return (error); From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 09:07:32 2014 Return-Path: Delivered-To: svn-src-all@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 56A43DAF; Mon, 27 Oct 2014 09:07: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 3FA9D1C3; Mon, 27 Oct 2014 09:07: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 s9R97WOO071243; Mon, 27 Oct 2014 09:07:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9R97Vpq071240; Mon, 27 Oct 2014 09:07:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410270907.s9R97Vpq071240@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 27 Oct 2014 09:07:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273729 - stable/10/sys/dev/usb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 09:07:32 -0000 Author: hselasky Date: Mon Oct 27 09:07:30 2014 New Revision: 273729 URL: https://svnweb.freebsd.org/changeset/base/273729 Log: MFC r272733, r272807 and r272822: Add support for disabling USB enumeration or USB port power in general or on selected USB HUBs. Modified: stable/10/sys/dev/usb/usb_freebsd.h stable/10/sys/dev/usb/usb_freebsd_loader.h stable/10/sys/dev/usb/usb_hub.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/usb_freebsd.h ============================================================================== --- stable/10/sys/dev/usb/usb_freebsd.h Mon Oct 27 07:51:26 2014 (r273728) +++ stable/10/sys/dev/usb/usb_freebsd.h Mon Oct 27 09:07:30 2014 (r273729) @@ -49,6 +49,7 @@ #define USB_HAVE_FIXED_IFACE 0 #define USB_HAVE_FIXED_CONFIG 0 #define USB_HAVE_FIXED_PORT 0 +#define USB_HAVE_DISABLE_ENUM 1 /* define zero ticks callout value */ #define USB_CALLOUT_ZERO_TICKS 1 Modified: stable/10/sys/dev/usb/usb_freebsd_loader.h ============================================================================== --- stable/10/sys/dev/usb/usb_freebsd_loader.h Mon Oct 27 07:51:26 2014 (r273728) +++ stable/10/sys/dev/usb/usb_freebsd_loader.h Mon Oct 27 09:07:30 2014 (r273729) @@ -49,6 +49,7 @@ #define USB_HAVE_FIXED_IFACE 0 #define USB_HAVE_FIXED_CONFIG 0 #define USB_HAVE_FIXED_PORT 0 +#define USB_HAVE_DISABLE_ENUM 0 #define USB_CALLOUT_ZERO_TICKS 1 Modified: stable/10/sys/dev/usb/usb_hub.c ============================================================================== --- stable/10/sys/dev/usb/usb_hub.c Mon Oct 27 07:51:26 2014 (r273728) +++ stable/10/sys/dev/usb/usb_hub.c Mon Oct 27 09:07:30 2014 (r273729) @@ -98,6 +98,18 @@ SYSCTL_INT(_hw_usb, OID_AUTO, power_time &usb_power_timeout, 0, "USB power timeout"); #endif +#if USB_HAVE_DISABLE_ENUM +static int usb_disable_enumeration = 0; +SYSCTL_INT(_hw_usb, OID_AUTO, disable_enumeration, CTLFLAG_RWTUN, + &usb_disable_enumeration, 0, "Set to disable all USB device enumeration."); +TUNABLE_INT("hw.usb.disable_enumeration", &usb_disable_enumeration); + +static int usb_disable_port_power = 0; +SYSCTL_INT(_hw_usb, OID_AUTO, disable_port_power, CTLFLAG_RWTUN, + &usb_disable_port_power, 0, "Set to disable all USB port power."); +TUNABLE_INT("hw.usb.disable_port_power", &usb_disable_port_power); +#endif + struct uhub_current_state { uint16_t port_change; uint16_t port_status; @@ -112,6 +124,10 @@ struct uhub_softc { struct mtx sc_mtx; /* our mutex */ struct usb_device *sc_udev; /* USB device */ struct usb_xfer *sc_xfer[UHUB_N_TRANSFER]; /* interrupt xfer */ +#if USB_HAVE_DISABLE_ENUM + int sc_disable_enumeration; + int sc_disable_port_power; +#endif uint8_t sc_flags; #define UHUB_FLAG_DID_EXPLORE 0x01 }; @@ -619,9 +635,9 @@ repeat: err = usbd_req_clear_port_feature(udev, NULL, portno, UHF_C_PORT_CONNECTION); - if (err) { + if (err) goto error; - } + /* check if there is a child */ if (child != NULL) { @@ -634,14 +650,22 @@ repeat: /* get fresh status */ err = uhub_read_port_status(sc, portno); - if (err) { + if (err) + goto error; + +#if USB_HAVE_DISABLE_ENUM + /* check if we should skip enumeration from this USB HUB */ + if (usb_disable_enumeration != 0 || + sc->sc_disable_enumeration != 0) { + DPRINTF("Enumeration is disabled!\n"); goto error; } +#endif /* check if nothing is connected to the port */ - if (!(sc->sc_st.port_status & UPS_CURRENT_CONNECT_STATUS)) { + if (!(sc->sc_st.port_status & UPS_CURRENT_CONNECT_STATUS)) goto error; - } + /* check if there is no power on the port and print a warning */ switch (udev->speed) { @@ -1189,6 +1213,10 @@ uhub_attach(device_t dev) struct usb_hub *hub; struct usb_hub_descriptor hubdesc20; struct usb_hub_ss_descriptor hubdesc30; +#if USB_HAVE_DISABLE_ENUM + struct sysctl_ctx_list *sysctl_ctx; + struct sysctl_oid *sysctl_tree; +#endif uint16_t pwrdly; uint16_t nports; uint8_t x; @@ -1386,6 +1414,34 @@ uhub_attach(device_t dev) /* wait with power off for a while */ usb_pause_mtx(NULL, USB_MS_TO_TICKS(USB_POWER_DOWN_TIME)); +#if USB_HAVE_DISABLE_ENUM + /* Add device sysctls */ + + sysctl_ctx = device_get_sysctl_ctx(dev); + sysctl_tree = device_get_sysctl_tree(dev); + + if (sysctl_ctx != NULL && sysctl_tree != NULL) { + char path[128]; + + snprintf(path, sizeof(path), "dev.uhub.%d.disable_enumeration", + device_get_unit(dev)); + TUNABLE_INT_FETCH(path, &sc->sc_disable_enumeration); + + (void) SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "disable_enumeration", CTLFLAG_RWTUN, + &sc->sc_disable_enumeration, 0, + "Set to disable enumeration on this USB HUB."); + + snprintf(path, sizeof(path), "dev.uhub.%d.disable_port_power", + device_get_unit(dev)); + TUNABLE_INT_FETCH(path, &sc->sc_disable_port_power); + + (void) SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "disable_port_power", CTLFLAG_RWTUN, + &sc->sc_disable_port_power, 0, + "Set to disable USB port power on this USB HUB."); + } +#endif /* * To have the best chance of success we do things in the exact same * order as Windoze98. This should not be necessary, but some @@ -1440,13 +1496,27 @@ uhub_attach(device_t dev) removable++; break; } - if (!err) { - /* turn the power on */ - err = usbd_req_set_port_feature(udev, NULL, - portno, UHF_PORT_POWER); + if (err == 0) { +#if USB_HAVE_DISABLE_ENUM + /* check if we should disable USB port power or not */ + if (usb_disable_port_power != 0 || + sc->sc_disable_port_power != 0) { + /* turn the power off */ + DPRINTFN(0, "Turning port %d power off\n", portno); + err = usbd_req_clear_port_feature(udev, NULL, + portno, UHF_PORT_POWER); + } else { +#endif + /* turn the power on */ + DPRINTFN(0, "Turning port %d power on\n", portno); + err = usbd_req_set_port_feature(udev, NULL, + portno, UHF_PORT_POWER); +#if USB_HAVE_DISABLE_ENUM + } +#endif } - if (err) { - DPRINTFN(0, "port %d power on failed, %s\n", + if (err != 0) { + DPRINTFN(0, "port %d power on or off failed, %s\n", portno, usbd_errstr(err)); } DPRINTF("turn on port %d power\n", From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 09:26:25 2014 Return-Path: Delivered-To: svn-src-all@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 D546CCE; Mon, 27 Oct 2014 09:26: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 C19A23DE; Mon, 27 Oct 2014 09:26: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 s9R9QPtH081900; Mon, 27 Oct 2014 09:26:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9R9QPJr081897; Mon, 27 Oct 2014 09:26:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201410270926.s9R9QPJr081897@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 27 Oct 2014 09:26:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273730 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 09:26:25 -0000 Author: mav Date: Mon Oct 27 09:26:24 2014 New Revision: 273730 URL: https://svnweb.freebsd.org/changeset/base/273730 Log: Reduce code duplication around Write Exclusive persistent reservation. While there, allow some more commands to pass persistent reservation. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_cmd_table.c head/sys/cam/ctl/ctl_private.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Mon Oct 27 09:07:30 2014 (r273729) +++ head/sys/cam/ctl/ctl.c Mon Oct 27 09:26:24 2014 (r273730) @@ -5341,8 +5341,7 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi mtx_lock(&lun->lun_lock); if ((lun->flags & CTL_LUN_RESERVED) && (lun->res_idx != residx)) { - ctsio->scsi_status = SCSI_STATUS_RESERV_CONFLICT; - ctsio->io_hdr.status = CTL_SCSI_ERROR; + ctl_set_reservation_conflict(ctsio); goto bailout; } @@ -5693,24 +5692,6 @@ ctl_read_buffer(struct ctl_scsiio *ctsio lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; cdb = (struct scsi_read_buffer *)ctsio->cdb; - if (lun->flags & CTL_LUN_PR_RESERVED) { - uint32_t residx; - - /* - * XXX KDM need a lock here. - */ - residx = ctl_get_resindex(&ctsio->io_hdr.nexus); - if ((lun->res_type == SPR_TYPE_EX_AC - && residx != lun->pr_res_idx) - || ((lun->res_type == SPR_TYPE_EX_AC_RO - || lun->res_type == SPR_TYPE_EX_AC_AR) - && lun->pr_keys[residx] == 0)) { - ctl_set_reservation_conflict(ctsio); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } - } - if ((cdb->byte2 & RWB_MODE) != RWB_MODE_DATA && (cdb->byte2 & RWB_MODE) != RWB_MODE_ECHO_DESCR && (cdb->byte2 & RWB_MODE) != RWB_MODE_DESCR) { @@ -6642,24 +6623,6 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) else control_dev = 0; - if (lun->flags & CTL_LUN_PR_RESERVED) { - uint32_t residx; - - /* - * XXX KDM need a lock here. - */ - residx = ctl_get_resindex(&ctsio->io_hdr.nexus); - if ((lun->res_type == SPR_TYPE_EX_AC - && residx != lun->pr_res_idx) - || ((lun->res_type == SPR_TYPE_EX_AC_RO - || lun->res_type == SPR_TYPE_EX_AC_AR) - && lun->pr_keys[residx] == 0)) { - ctl_set_reservation_conflict(ctsio); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } - } - switch (ctsio->cdb[0]) { case MODE_SENSE_6: { struct scsi_mode_sense_6 *cdb; @@ -7196,23 +7159,6 @@ ctl_read_defect(struct ctl_scsiio *ctsio CTL_DEBUG_PRINT(("ctl_read_defect\n")); lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - if (lun->flags & CTL_LUN_PR_RESERVED) { - uint32_t residx; - - /* - * XXX KDM need a lock here. - */ - residx = ctl_get_resindex(&ctsio->io_hdr.nexus); - if ((lun->res_type == SPR_TYPE_EX_AC - && residx != lun->pr_res_idx) - || ((lun->res_type == SPR_TYPE_EX_AC_RO - || lun->res_type == SPR_TYPE_EX_AC_AR) - && lun->pr_keys[residx] == 0)) { - ctl_set_reservation_conflict(ctsio); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } - } if (ctsio->cdb[0] == READ_DEFECT_DATA_10) { ccb10 = (struct scsi_read_defect_data_10 *)&ctsio->cdb; @@ -8906,24 +8852,6 @@ ctl_read_write(struct ctl_scsiio *ctsio) isread = ctsio->cdb[0] == READ_6 || ctsio->cdb[0] == READ_10 || ctsio->cdb[0] == READ_12 || ctsio->cdb[0] == READ_16; - if (lun->flags & CTL_LUN_PR_RESERVED && isread) { - uint32_t residx; - - /* - * XXX KDM need a lock here. - */ - residx = ctl_get_resindex(&ctsio->io_hdr.nexus); - if ((lun->res_type == SPR_TYPE_EX_AC - && residx != lun->pr_res_idx) - || ((lun->res_type == SPR_TYPE_EX_AC_RO - || lun->res_type == SPR_TYPE_EX_AC_AR) - && lun->pr_keys[residx] == 0)) { - ctl_set_reservation_conflict(ctsio); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } - } - switch (ctsio->cdb[0]) { case READ_6: case WRITE_6: { @@ -11225,15 +11153,21 @@ ctl_scsiio_lun_check(struct ctl_softc *c if ((lun->flags & CTL_LUN_RESERVED) && ((entry->flags & CTL_CMD_FLAG_ALLOW_ON_RESV) == 0)) { if (lun->res_idx != residx) { - ctsio->scsi_status = SCSI_STATUS_RESERV_CONFLICT; - ctsio->io_hdr.status = CTL_SCSI_ERROR; + ctl_set_reservation_conflict(ctsio); retval = 1; goto bailout; } } - if ((lun->flags & CTL_LUN_PR_RESERVED) - && ((entry->flags & CTL_CMD_FLAG_ALLOW_ON_PR_RESV) == 0)) { + if ((lun->flags & CTL_LUN_PR_RESERVED) == 0 || + (entry->flags & CTL_CMD_FLAG_ALLOW_ON_PR_RESV)) { + /* No reservation or command is allowed. */; + } else if ((entry->flags & CTL_CMD_FLAG_ALLOW_ON_PR_WRESV) && + (lun->res_type == SPR_TYPE_WR_EX || + lun->res_type == SPR_TYPE_WR_EX_RO || + lun->res_type == SPR_TYPE_WR_EX_AR)) { + /* The command is allowed for Write Exclusive resv. */; + } else { /* * if we aren't registered or it's a res holder type * reservation and this isn't the res holder then set a @@ -11244,8 +11178,7 @@ ctl_scsiio_lun_check(struct ctl_softc *c */ if (lun->pr_keys[residx] == 0 || (residx != lun->pr_res_idx && lun->res_type < 4)) { - ctsio->scsi_status = SCSI_STATUS_RESERV_CONFLICT; - ctsio->io_hdr.status = CTL_SCSI_ERROR; + ctl_set_reservation_conflict(ctsio); retval = 1; goto bailout; } Modified: head/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- head/sys/cam/ctl/ctl_cmd_table.c Mon Oct 27 09:07:30 2014 (r273729) +++ head/sys/cam/ctl/ctl_cmd_table.c Mon Oct 27 09:26:24 2014 (r273730) @@ -259,7 +259,8 @@ const struct ctl_cmd_entry ctl_cmd_table /* 10 POPULATE TOKEN */ {ctl_populate_token, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_SLUN | - CTL_FLAG_DATA_OUT, + CTL_FLAG_DATA_OUT | + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_NONE, 16, { 0x10, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -347,7 +348,8 @@ const struct ctl_cmd_entry ctl_cmd_table /* 05 RECEIVE COPY STATUS (LID4) */ {ctl_receive_copy_status_lid4, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_BOTH | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 16, {0x05, 0xff, 0xff, 0xff, 0xff, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -357,14 +359,16 @@ const struct ctl_cmd_entry ctl_cmd_table /* 07 RECEIVE ROD TOKEN INFORMATION */ {ctl_receive_rod_token_information, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_BOTH | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 16, {0x07, 0xff, 0xff, 0xff, 0xff, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, /* 08 REPORT ALL ROD TOKENS */ {ctl_report_all_rod_tokens, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_BOTH | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 16, {0x08, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, }; @@ -472,7 +476,8 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_INOPERABLE | CTL_CMD_FLAG_OK_ON_OFFLINE | CTL_CMD_FLAG_OK_ON_SECONDARY | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 12, {0x0a, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -510,7 +515,8 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_INOPERABLE | CTL_CMD_FLAG_OK_ON_OFFLINE | CTL_CMD_FLAG_OK_ON_SECONDARY | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 12, {0x0f, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -561,7 +567,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 08 READ(6) */ {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 6, {0x1f, 0xff, 0xff, 0xff, 0x07}}, /* 09 */ @@ -653,7 +659,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_OFFLINE | CTL_CMD_FLAG_OK_ON_SECONDARY | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_NONE, 6, {0x08, 0xff, 0xff, 0xff, 0x07}}, /* 1B START STOP UNIT */ @@ -710,7 +716,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 28 READ(10) */ {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 10, {0x1a, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}}, @@ -739,7 +745,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 2F VERIFY(10) */ {ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_OUT | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 10, {0x16, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}}, @@ -770,7 +776,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 37 READ DEFECT DATA(10) */ {ctl_read_defect, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_NONE, 10, {0, 0x1f, 0, 0, 0, 0, 0xff, 0xff, 0x07}}, @@ -792,7 +798,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 3C READ BUFFER */ {ctl_read_buffer, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_BOTH | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_NONE, 10, {0x1f, 0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07}}, @@ -918,7 +924,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_OFFLINE | CTL_CMD_FLAG_OK_ON_SECONDARY | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_NONE, 10, {0x18, 0xff, 0xff, 0, 0, 0, 0xff, 0xff, 0x07} }, /* 5B CLOSE TRACK/SESSION */ @@ -1062,7 +1068,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 88 READ(16) */ {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 16, {0x1a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -1097,7 +1103,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 8F VERIFY(16) */ {ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_OUT | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 16, {0x16, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -1199,7 +1205,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* A8 READ(12) */ {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 12, {0x1a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -1228,7 +1234,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* AF VERIFY(12) */ {ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_OUT | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 12, {0x16, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -1256,7 +1262,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* B7 READ DEFECT DATA(12) */ {ctl_read_defect, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_NONE, 12, {0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Mon Oct 27 09:07:30 2014 (r273729) +++ head/sys/cam/ctl/ctl_private.h Mon Oct 27 09:26:24 2014 (r273730) @@ -144,6 +144,7 @@ typedef enum { CTL_CMD_FLAG_NO_SENSE = 0x0010, CTL_CMD_FLAG_OK_ON_ALL_LUNS = 0x0020, CTL_CMD_FLAG_ALLOW_ON_RESV = 0x0040, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV = 0x0080, CTL_CMD_FLAG_OK_ON_PROC = 0x0100, CTL_CMD_FLAG_OK_ON_SLUN = 0x0200, CTL_CMD_FLAG_OK_ON_BOTH = 0x0300, From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 09:30:58 2014 Return-Path: Delivered-To: svn-src-all@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 B273F4EB; Mon, 27 Oct 2014 09:30: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 9F48860D; Mon, 27 Oct 2014 09:30: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 s9R9UwOc083603; Mon, 27 Oct 2014 09:30:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9R9Uwce083602; Mon, 27 Oct 2014 09:30:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201410270930.s9R9Uwce083602@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 27 Oct 2014 09:30:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273731 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 09:30:58 -0000 Author: mav Date: Mon Oct 27 09:30:57 2014 New Revision: 273731 URL: https://svnweb.freebsd.org/changeset/base/273731 Log: Remove comment obsoleted by r273730. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Mon Oct 27 09:26:24 2014 (r273730) +++ head/sys/cam/ctl/ctl.c Mon Oct 27 09:30:57 2014 (r273731) @@ -11172,9 +11172,6 @@ ctl_scsiio_lun_check(struct ctl_softc *c * if we aren't registered or it's a res holder type * reservation and this isn't the res holder then set a * conflict. - * NOTE: Commands which might be allowed on write exclusive - * type reservations are checked in the particular command - * for a conflict. Read and SSU are the only ones. */ if (lun->pr_keys[residx] == 0 || (residx != lun->pr_res_idx && lun->res_type < 4)) { From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 10:34:10 2014 Return-Path: Delivered-To: svn-src-all@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 70F82E8D; Mon, 27 Oct 2014 10:34: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 5D827EBD; Mon, 27 Oct 2014 10:34: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 s9RAYAxc026041; Mon, 27 Oct 2014 10:34:10 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RAY9Ib026035; Mon, 27 Oct 2014 10:34:09 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201410271034.s9RAY9Ib026035@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 27 Oct 2014 10:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273732 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 10:34:10 -0000 Author: ae Date: Mon Oct 27 10:34:09 2014 New Revision: 273732 URL: https://svnweb.freebsd.org/changeset/base/273732 Log: Remove unused function. Sponsored by: Yandex LLC Modified: head/sys/netinet6/in6.c head/sys/netinet6/in6_var.h Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Mon Oct 27 09:30:57 2014 (r273731) +++ head/sys/netinet6/in6.c Mon Oct 27 10:34:09 2014 (r273732) @@ -1584,20 +1584,6 @@ in6_unlink_ifa(struct in6_ifaddr *ia, st ifa_free(&ia->ia_ifa); /* in6_ifaddrhead */ } -void -in6_purgeif(struct ifnet *ifp) -{ - struct ifaddr *ifa, *nifa; - - TAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, nifa) { - if (ifa->ifa_addr->sa_family != AF_INET6) - continue; - in6_purgeaddr(ifa); - } - - in6_ifdetach(ifp); -} - /* * Notifies other other subsystems about address change/arrival: * 1) Notifies device handler on first IPv6 address assignment Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Mon Oct 27 09:30:57 2014 (r273731) +++ head/sys/netinet6/in6_var.h Mon Oct 27 10:34:09 2014 (r273732) @@ -804,7 +804,6 @@ void in6_prepare_ifra(struct in6_aliasre const struct in6_addr *); void in6_purgeaddr(struct ifaddr *); int in6if_do_dad(struct ifnet *); -void in6_purgeif(struct ifnet *); void in6_savemkludge(struct in6_ifaddr *); void *in6_domifattach(struct ifnet *); void in6_domifdetach(struct ifnet *, void *); From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 11:21:48 2014 Return-Path: Delivered-To: svn-src-all@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 9D38D195; Mon, 27 Oct 2014 11:21: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 897206EC; Mon, 27 Oct 2014 11:21: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 s9RBLmLo095540; Mon, 27 Oct 2014 11:21:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RBLmOv095539; Mon, 27 Oct 2014 11:21:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410271121.s9RBLmOv095539@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 27 Oct 2014 11:21:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273733 - head/sys/netinet/cc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 11:21:48 -0000 Author: hselasky Date: Mon Oct 27 11:21:47 2014 New Revision: 273733 URL: https://svnweb.freebsd.org/changeset/base/273733 Log: Make assignments to "net.inet.tcp.cc.algorithm" work by fixing a bad string comparison. MFC after: 3 days Reported by: Jukka Ukkonen Sponsored by: Mellanox Technologies Modified: head/sys/netinet/cc/cc.c Modified: head/sys/netinet/cc/cc.c ============================================================================== --- head/sys/netinet/cc/cc.c Mon Oct 27 10:34:09 2014 (r273732) +++ head/sys/netinet/cc/cc.c Mon Oct 27 11:21:47 2014 (r273733) @@ -106,11 +106,13 @@ cc_default_algo(SYSCTL_HANDLER_ARGS) /* Find algo with specified name and set it to default. */ CC_LIST_RLOCK(); STAILQ_FOREACH(funcs, &cc_list, entries) { - if (strncmp((char *)req->newptr, funcs->name, - TCP_CA_NAME_MAX) == 0) { - found = 1; - V_default_cc_ptr = funcs; - } + /* NOTE: "newptr" is not zero terminated */ + if (req->newlen != strlen(funcs->name)) + continue; + if (bcmp(req->newptr, funcs->name, req->newlen)) + continue; + found = 1; + V_default_cc_ptr = funcs; } CC_LIST_RUNLOCK(); From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 11:38:19 2014 Return-Path: Delivered-To: svn-src-all@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 33E70A25; Mon, 27 Oct 2014 11:38: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 14EC0920; Mon, 27 Oct 2014 11:38: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 s9RBcIkE002455; Mon, 27 Oct 2014 11:38:18 GMT (envelope-from pi@FreeBSD.org) Received: (from pi@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RBcHrA002447; Mon, 27 Oct 2014 11:38:17 GMT (envelope-from pi@FreeBSD.org) Message-Id: <201410271138.s9RBcHrA002447@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pi set sender to pi@FreeBSD.org using -f From: Kurt Jaeger Date: Mon, 27 Oct 2014 11:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273734 - head/bin/dd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 11:38:19 -0000 Author: pi (ports committer) Date: Mon Oct 27 11:38:17 2014 New Revision: 273734 URL: https://svnweb.freebsd.org/changeset/base/273734 Log: bin/dd: Fix incorrect casting of arguments dd(1) casts many of its numeric arguments from uintmax_t to intmax_t and back again to detect whether or not the original arguments were negative. This caused wrong behaviour in some boundary cases: $ dd if=/dev/zero of=/dev/null count=18446744073709551615 dd: count cannot be negative After the fix: $ dd if=/dev/zero of=/dev/null count=18446744073709551615 dd: count: Result too large PR: 191263 Submitted by: will@worrbase.com Approved by: cognet@ Modified: head/bin/dd/args.c head/bin/dd/conv.c head/bin/dd/dd.c head/bin/dd/dd.h head/bin/dd/position.c Modified: head/bin/dd/args.c ============================================================================== --- head/bin/dd/args.c Mon Oct 27 11:21:47 2014 (r273733) +++ head/bin/dd/args.c Mon Oct 27 11:38:17 2014 (r273734) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -171,8 +172,7 @@ jcl(char **argv) */ if (in.offset > OFF_MAX / (ssize_t)in.dbsz || out.offset > OFF_MAX / (ssize_t)out.dbsz) - errx(1, "seek offsets cannot be larger than %jd", - (intmax_t)OFF_MAX); + errx(1, "seek offsets cannot be larger than %jd", OFF_MAX); } static int @@ -186,37 +186,30 @@ c_arg(const void *a, const void *b) static void f_bs(char *arg) { - uintmax_t res; - res = get_num(arg); - if (res < 1 || res > SSIZE_MAX) - errx(1, "bs must be between 1 and %jd", (intmax_t)SSIZE_MAX); - in.dbsz = out.dbsz = (size_t)res; + in.dbsz = out.dbsz = get_num(arg); + if (out.dbsz < 1 || out.dbsz > SSIZE_MAX) + errx(1, "bs must be between 1 and %jd", SSIZE_MAX); } static void f_cbs(char *arg) { - uintmax_t res; - res = get_num(arg); - if (res < 1 || res > SSIZE_MAX) - errx(1, "cbs must be between 1 and %jd", (intmax_t)SSIZE_MAX); - cbsz = (size_t)res; + cbsz = get_num(arg); + if (cbsz < 1 || cbsz > SSIZE_MAX) + errx(1, "cbs must be between 1 and %jd", SSIZE_MAX); } static void f_count(char *arg) { - intmax_t res; - res = (intmax_t)get_num(arg); - if (res < 0) - errx(1, "count cannot be negative"); - if (res == 0) - cpy_cnt = (uintmax_t)-1; - else - cpy_cnt = (uintmax_t)res; + cpy_cnt = get_num(arg); + if (cpy_cnt == SIZE_MAX) + errc(1, ERANGE, "%s", oper); + if (cpy_cnt == 0) + cpy_cnt = -1; } static void @@ -225,7 +218,7 @@ f_files(char *arg) files_cnt = get_num(arg); if (files_cnt < 1) - errx(1, "files must be between 1 and %jd", (uintmax_t)-1); + errx(1, "files must be between 1 and %ju", SIZE_MAX); } static void @@ -241,14 +234,11 @@ f_fillchar(char *arg) static void f_ibs(char *arg) { - uintmax_t res; if (!(ddflags & C_BS)) { - res = get_num(arg); - if (res < 1 || res > SSIZE_MAX) - errx(1, "ibs must be between 1 and %jd", - (intmax_t)SSIZE_MAX); - in.dbsz = (size_t)res; + in.dbsz = get_num(arg); + if (in.dbsz < 1 || in.dbsz > SSIZE_MAX) + errx(1, "ibs must be between 1 and %ju", SSIZE_MAX); } } @@ -262,14 +252,11 @@ f_if(char *arg) static void f_obs(char *arg) { - uintmax_t res; if (!(ddflags & C_BS)) { - res = get_num(arg); - if (res < 1 || res > SSIZE_MAX) - errx(1, "obs must be between 1 and %jd", - (intmax_t)SSIZE_MAX); - out.dbsz = (size_t)res; + out.dbsz = get_num(arg); + if (out.dbsz < 1 || out.dbsz > SSIZE_MAX) + errx(1, "obs must be between 1 and %jd", SSIZE_MAX); } } @@ -378,11 +365,17 @@ get_num(const char *val) uintmax_t num, mult, prevnum; char *expr; + while (isspace(val[0])) + val++; + + if (val[0] == '-') + errx(1, "%s: cannot be negative", oper); + errno = 0; - num = strtouq(val, &expr, 0); + num = strtoull(val, &expr, 0); if (errno != 0) /* Overflow or underflow. */ err(1, "%s", oper); - + if (expr == val) /* No valid digits. */ errx(1, "%s: illegal numeric value", oper); Modified: head/bin/dd/conv.c ============================================================================== --- head/bin/dd/conv.c Mon Oct 27 11:21:47 2014 (r273733) +++ head/bin/dd/conv.c Mon Oct 27 11:38:17 2014 (r273734) @@ -133,7 +133,7 @@ block(void) */ ch = 0; for (inp = in.dbp - in.dbcnt, outp = out.dbp; in.dbcnt;) { - maxlen = MIN(cbsz, in.dbcnt); + maxlen = MIN(cbsz, (size_t)in.dbcnt); if ((t = ctab) != NULL) for (cnt = 0; cnt < maxlen && (ch = *inp++) != '\n'; ++cnt) @@ -146,7 +146,7 @@ block(void) * Check for short record without a newline. Reassemble the * input block. */ - if (ch != '\n' && in.dbcnt < cbsz) { + if (ch != '\n' && (size_t)in.dbcnt < cbsz) { (void)memmove(in.db, in.dbp - in.dbcnt, in.dbcnt); break; } @@ -228,7 +228,7 @@ unblock(void) * translation has to already be done or we might not recognize the * spaces. */ - for (inp = in.db; in.dbcnt >= cbsz; inp += cbsz, in.dbcnt -= cbsz) { + for (inp = in.db; (size_t)in.dbcnt >= cbsz; inp += cbsz, in.dbcnt -= cbsz) { for (t = inp + cbsz - 1; t >= inp && *t == ' '; --t) ; if (t >= inp) { Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Mon Oct 27 11:21:47 2014 (r273733) +++ head/bin/dd/dd.c Mon Oct 27 11:38:17 2014 (r273734) @@ -168,10 +168,10 @@ setup(void) * record oriented I/O, only need a single buffer. */ if (!(ddflags & (C_BLOCK | C_UNBLOCK))) { - if ((in.db = malloc(out.dbsz + in.dbsz - 1)) == NULL) + if ((in.db = malloc((size_t)out.dbsz + in.dbsz - 1)) == NULL) err(1, "input buffer"); out.db = in.db; - } else if ((in.db = malloc(MAX(in.dbsz, cbsz) + cbsz)) == NULL || + } else if ((in.db = malloc(MAX((size_t)in.dbsz, cbsz) + cbsz)) == NULL || (out.db = malloc(out.dbsz + cbsz)) == NULL) err(1, "output buffer"); @@ -343,7 +343,7 @@ dd_in(void) ++st.in_full; /* Handle full input blocks. */ - } else if ((size_t)n == in.dbsz) { + } else if ((size_t)n == (size_t)in.dbsz) { in.dbcnt += in.dbrcnt = n; ++st.in_full; @@ -493,7 +493,7 @@ dd_out(int force) outp += nw; st.bytes += nw; - if ((size_t)nw == n && n == out.dbsz) + if ((size_t)nw == n && n == (size_t)out.dbsz) ++st.out_full; else ++st.out_part; Modified: head/bin/dd/dd.h ============================================================================== --- head/bin/dd/dd.h Mon Oct 27 11:21:47 2014 (r273733) +++ head/bin/dd/dd.h Mon Oct 27 11:38:17 2014 (r273734) @@ -38,10 +38,9 @@ typedef struct { u_char *db; /* buffer address */ u_char *dbp; /* current buffer I/O address */ - /* XXX ssize_t? */ - size_t dbcnt; /* current buffer byte count */ - size_t dbrcnt; /* last read byte count */ - size_t dbsz; /* block size */ + ssize_t dbcnt; /* current buffer byte count */ + ssize_t dbrcnt; /* last read byte count */ + ssize_t dbsz; /* block size */ #define ISCHR 0x01 /* character device (warn on short) */ #define ISPIPE 0x02 /* pipe-like (see position.c) */ @@ -57,13 +56,13 @@ typedef struct { } IO; typedef struct { - uintmax_t in_full; /* # of full input blocks */ - uintmax_t in_part; /* # of partial input blocks */ - uintmax_t out_full; /* # of full output blocks */ - uintmax_t out_part; /* # of partial output blocks */ - uintmax_t trunc; /* # of truncated records */ - uintmax_t swab; /* # of odd-length swab blocks */ - uintmax_t bytes; /* # of bytes written */ + size_t in_full; /* # of full input blocks */ + size_t in_part; /* # of partial input blocks */ + size_t out_full; /* # of full output blocks */ + size_t out_part; /* # of partial output blocks */ + size_t trunc; /* # of truncated records */ + size_t swab; /* # of odd-length swab blocks */ + size_t bytes; /* # of bytes written */ struct timespec start; /* start time of dd */ } STAT; Modified: head/bin/dd/position.c ============================================================================== --- head/bin/dd/position.c Mon Oct 27 11:21:47 2014 (r273733) +++ head/bin/dd/position.c Mon Oct 27 11:38:17 2014 (r273734) @@ -178,7 +178,7 @@ pos_out(void) n = write(out.fd, out.db, out.dbsz); if (n == -1) err(1, "%s", out.name); - if ((size_t)n != out.dbsz) + if (n != out.dbsz) errx(1, "%s: write failure", out.name); } break; From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 12:18:07 2014 Return-Path: Delivered-To: svn-src-all@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 A4BB4786; Mon, 27 Oct 2014 12:18: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 8F3DBD5B; Mon, 27 Oct 2014 12:18: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 s9RCI74D025047; Mon, 27 Oct 2014 12:18:07 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RCI7RD025045; Mon, 27 Oct 2014 12:18:07 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201410271218.s9RCI7RD025045@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 27 Oct 2014 12:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273735 - stable/10/sys/arm/ti X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 12:18:07 -0000 Author: loos Date: Mon Oct 27 12:18:07 2014 New Revision: 273735 URL: https://svnweb.freebsd.org/changeset/base/273735 Log: MFC: r266336, r270230 and r273263 r266336: Allow us to compile the Ti iic driver for both OMAP4 and AM335x. r270230: Rewrite of ti_i2c based on gonzo's patch, fix the following bugs/problems: . interrupt storm detected on "intr70:"; throttling interrupt source; . Added access serialization on iicbus_transfer(), previously there was no such protection and a new transfer could easily confuse the controller; . Add error checkings (i.e. stop the transfer when a error is detected and do _not_ overwrite the previous error); . On command done interrupt do not assume that the transfer was finished sucessfully as we will receive the command done interrupt even after errors; . Simplify the FIFO handling; . Reset the FIFO between the transfers as the FIFO may contain data from the last (failed) transfer; . Fix the iicbus speed for AM335x, which in turn will make better use of the I2C noise filter (set to one internal clock cycle); . Move the read and write handler to ithread instead of notifying the requesting thread with wakeup(9); . Fix the comments based on OMAP4 TRM. The above changes allows me to read the EDID from my HDMI monitor on BBB with gonzo's patches to support TDA19988 (which does 128 bytes reads) and repeatedly scan the iicbus (with a modified i2c(8)) without lock up the bus. r273263: Fix the chan address for mtx_sleep() on bus wait. Without this fix the threads waiting for the bus would never wake. Modified: stable/10/sys/arm/ti/ti_i2c.c stable/10/sys/arm/ti/ti_i2c.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/ti/ti_i2c.c ============================================================================== --- stable/10/sys/arm/ti/ti_i2c.c Mon Oct 27 11:38:17 2014 (r273734) +++ stable/10/sys/arm/ti/ti_i2c.c Mon Oct 27 12:18:07 2014 (r273735) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2011 - * Ben Gray . + * Copyright (c) 2011 Ben Gray . + * Copyright (c) 2014 Luiz Otavio O Souza . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -58,13 +58,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include -#include #include #include #include +#include #include #include @@ -89,8 +90,13 @@ struct ti_i2c_softc struct mtx sc_mtx; - volatile uint16_t sc_stat_flags; /* contains the status flags last IRQ */ + struct iic_msg* sc_buffer; + int sc_bus_inuse; + int sc_buffer_pos; + int sc_error; + int sc_fifo_trsh; + uint16_t sc_con_reg; uint16_t sc_rev; }; @@ -105,61 +111,54 @@ struct ti_i2c_clock_config uint8_t hssclh; /* High Speed mode SCL high time */ }; -static struct ti_i2c_clock_config ti_i2c_clock_configs[] = { +#if defined(SOC_OMAP3) +#error "Unsupported SoC" +#endif #if defined(SOC_OMAP4) - { IIC_SLOW, 100000, 23, 13, 15, 0, 0}, - { IIC_FAST, 400000, 9, 5, 7, 0, 0}, - { IIC_FASTEST, 3310000, 1, 113, 115, 7, 10}, -#elif defined(SOC_TI_AM335X) - { IIC_SLOW, 100000, 3, 53, 55, 0, 0}, - { IIC_FAST, 400000, 3, 8, 10, 0, 0}, - { IIC_FASTEST, 400000, 3, 8, 10, 0, 0}, /* This might be higher */ -#else -#error "TI I2C driver is not supported on this SoC" -#endif +static struct ti_i2c_clock_config ti_omap4_i2c_clock_configs[] = { + { IIC_UNKNOWN, 100000, 23, 13, 15, 0, 0}, + { IIC_SLOW, 100000, 23, 13, 15, 0, 0}, + { IIC_FAST, 400000, 9, 5, 7, 0, 0}, + { IIC_FASTEST, 1000000, 5, 3, 4, 0, 0}, + /* { IIC_FASTEST, 3200000, 1, 113, 115, 7, 10}, - HS mode */ { -1, 0 } }; +#endif - -#define TI_I2C_REV1 0x003C /* OMAP3 */ -#define TI_I2C_REV2 0x000A /* OMAP4 */ +#if defined(SOC_TI_AM335X) +/* + * AM335X doesn't support HS mode. For 100kHz I2C clock set the internal + * clock to 12Mhz, for 400kHz I2C clock set the internal clock to 24Mhz. + */ +static struct ti_i2c_clock_config ti_am335x_i2c_clock_configs[] = { + { IIC_UNKNOWN, 100000, 7, 59, 61, 0, 0}, + { IIC_SLOW, 100000, 7, 59, 61, 0, 0}, + { IIC_FAST, 400000, 3, 23, 25, 0, 0}, + { IIC_FASTEST, 400000, 3, 23, 25, 0, 0}, + { -1, 0 } +}; +#endif /** * Locking macros used throughout the driver */ -#define TI_I2C_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) -#define TI_I2C_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define TI_I2C_LOCK_INIT(_sc) \ - mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), \ - "ti_i2c", MTX_DEF) -#define TI_I2C_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); -#define TI_I2C_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); -#define TI_I2C_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); +#define TI_I2C_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define TI_I2C_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define TI_I2C_LOCK_INIT(_sc) \ + mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), \ + "ti_i2c", MTX_DEF) +#define TI_I2C_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx) +#define TI_I2C_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED) +#define TI_I2C_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED) #ifdef DEBUG -#define ti_i2c_dbg(_sc, fmt, args...) \ - device_printf((_sc)->sc_dev, fmt, ##args) +#define ti_i2c_dbg(_sc, fmt, args...) \ + device_printf((_sc)->sc_dev, fmt, ##args) #else -#define ti_i2c_dbg(_sc, fmt, args...) +#define ti_i2c_dbg(_sc, fmt, args...) #endif -static devclass_t ti_i2c_devclass; - -/* bus entry points */ - -static int ti_i2c_probe(device_t dev); -static int ti_i2c_attach(device_t dev); -static int ti_i2c_detach(device_t dev); -static void ti_i2c_intr(void *); - -/* OFW routine */ -static phandle_t ti_i2c_get_node(device_t bus, device_t dev); - -/* helper routines */ -static int ti_i2c_activate(device_t dev); -static void ti_i2c_deactivate(device_t dev); - /** * ti_i2c_read_2 - reads a 16-bit value from one of the I2C registers * @sc: I2C device context @@ -175,7 +174,8 @@ static void ti_i2c_deactivate(device_t d static inline uint16_t ti_i2c_read_2(struct ti_i2c_softc *sc, bus_size_t off) { - return bus_read_2(sc->sc_mem_res, off); + + return (bus_read_2(sc->sc_mem_res, off)); } /** @@ -193,129 +193,117 @@ ti_i2c_read_2(struct ti_i2c_softc *sc, b static inline void ti_i2c_write_2(struct ti_i2c_softc *sc, bus_size_t off, uint16_t val) { - bus_write_2(sc->sc_mem_res, off, val); -} -/** - * ti_i2c_read_reg - reads a 16-bit value from one of the I2C registers - * take into account revision-dependent register offset - * @sc: I2C device context - * @off: the byte offset within the register bank to read from. - * - * - * LOCKING: - * No locking required - * - * RETURNS: - * 16-bit value read from the register. - */ -static inline uint16_t -ti_i2c_read_reg(struct ti_i2c_softc *sc, bus_size_t off) -{ - /* XXXOMAP3: FIXME add registers mapping here */ - return bus_read_2(sc->sc_mem_res, off); -} - -/** - * ti_i2c_write_reg - writes a 16-bit value to one of the I2C registers - * take into account revision-dependent register offset - * @sc: I2C device context - * @off: the byte offset within the register bank to read from. - * @val: the value to write into the register - * - * LOCKING: - * No locking required - * - * RETURNS: - * 16-bit value read from the register. - */ -static inline void -ti_i2c_write_reg(struct ti_i2c_softc *sc, bus_size_t off, uint16_t val) -{ - /* XXXOMAP3: FIXME add registers mapping here */ bus_write_2(sc->sc_mem_res, off, val); } -/** - * ti_i2c_set_intr_enable - writes the interrupt enable register - * @sc: I2C device context - * @ie: bitmask of the interrupts to enable - * - * This function is needed as writing the I2C_IE register on the OMAP4 devices - * doesn't seem to actually enable the interrupt, rather you have to write - * through the I2C_IRQENABLE_CLR and I2C_IRQENABLE_SET registers. - * - * LOCKING: - * No locking required - * - * RETURNS: - * Nothing. - */ -static inline void -ti_i2c_set_intr_enable(struct ti_i2c_softc *sc, uint16_t ie) -{ - /* XXXOMAP3: FIXME */ - ti_i2c_write_2(sc, I2C_REG_IRQENABLE_CLR, 0xffff); - if (ie) - ti_i2c_write_2(sc, I2C_REG_IRQENABLE_SET, ie); -} - -/** - * ti_i2c_reset - attach function for the driver - * @dev: i2c device handle - * - * - * - * LOCKING: - * Called from timer context - * - * RETURNS: - * EH_HANDLED or EH_NOT_HANDLED - */ static int -ti_i2c_reset(device_t dev, u_char speed, u_char addr, u_char *oldaddr) +ti_i2c_transfer_intr(struct ti_i2c_softc* sc, uint16_t status) { - struct ti_i2c_softc *sc = device_get_softc(dev); - struct ti_i2c_clock_config *clkcfg; - uint16_t con_reg; + int amount, done, i; - clkcfg = ti_i2c_clock_configs; - while (clkcfg->speed != -1) { - if (clkcfg->speed == speed) - break; - /* take slow if speed is unknown */ - if ((speed == IIC_UNKNOWN) && (clkcfg->speed == IIC_SLOW)) - break; - clkcfg++; + done = 0; + amount = 0; + /* Check for the error conditions. */ + if (status & I2C_STAT_NACK) { + /* No ACK from slave. */ + ti_i2c_dbg(sc, "NACK\n"); + ti_i2c_write_2(sc, I2C_REG_STATUS, I2C_STAT_NACK); + sc->sc_error = ENXIO; + } else if (status & I2C_STAT_AL) { + /* Arbitration lost. */ + ti_i2c_dbg(sc, "Arbitration lost\n"); + ti_i2c_write_2(sc, I2C_REG_STATUS, I2C_STAT_AL); + sc->sc_error = ENXIO; + } + + /* Check if we have finished. */ + if (status & I2C_STAT_ARDY) { + /* Register access ready - transaction complete basically. */ + ti_i2c_dbg(sc, "ARDY transaction complete\n"); + if (sc->sc_error != 0 && sc->sc_buffer->flags & IIC_M_NOSTOP) { + ti_i2c_write_2(sc, I2C_REG_CON, + sc->sc_con_reg | I2C_CON_STP); + } + ti_i2c_write_2(sc, I2C_REG_STATUS, + I2C_STAT_ARDY | I2C_STAT_RDR | I2C_STAT_RRDY | + I2C_STAT_XDR | I2C_STAT_XRDY); + return (1); } - if (clkcfg->speed == -1) - return (EINVAL); - TI_I2C_LOCK(sc); + if (sc->sc_buffer->flags & IIC_M_RD) { + /* Read some data. */ + if (status & I2C_STAT_RDR) { + /* + * Receive draining interrupt - last data received. + * The set FIFO threshold wont be reached to trigger + * RRDY. + */ + ti_i2c_dbg(sc, "Receive draining interrupt\n"); - /* First disable the controller while changing the clocks */ - con_reg = ti_i2c_read_reg(sc, I2C_REG_CON); - ti_i2c_write_reg(sc, I2C_REG_CON, 0x0000); - - /* Program the prescaler */ - ti_i2c_write_reg(sc, I2C_REG_PSC, clkcfg->psc); - - /* Set the bitrate */ - ti_i2c_write_reg(sc, I2C_REG_SCLL, clkcfg->scll | (clkcfg->hsscll<<8)); - ti_i2c_write_reg(sc, I2C_REG_SCLH, clkcfg->sclh | (clkcfg->hssclh<<8)); - - /* Check if we are dealing with high speed mode */ - if ((clkcfg->hsscll + clkcfg->hssclh) > 0) - con_reg = I2C_CON_OPMODE_HS; - else - con_reg = I2C_CON_OPMODE_STD; + /* + * Drain the FIFO. Read the pending data in the FIFO. + */ + amount = sc->sc_buffer->len - sc->sc_buffer_pos; + } else if (status & I2C_STAT_RRDY) { + /* + * Receive data ready interrupt - FIFO has reached the + * set threshold. + */ + ti_i2c_dbg(sc, "Receive data ready interrupt\n"); - /* Enable the I2C module again */ - ti_i2c_write_reg(sc, I2C_REG_CON, I2C_CON_I2C_EN | con_reg); + amount = min(sc->sc_fifo_trsh, + sc->sc_buffer->len - sc->sc_buffer_pos); + } - TI_I2C_UNLOCK(sc); + /* Read the bytes from the fifo. */ + for (i = 0; i < amount; i++) + sc->sc_buffer->buf[sc->sc_buffer_pos++] = + (uint8_t)(ti_i2c_read_2(sc, I2C_REG_DATA) & 0xff); + + if (status & I2C_STAT_RDR) + ti_i2c_write_2(sc, I2C_REG_STATUS, I2C_STAT_RDR); + if (status & I2C_STAT_RRDY) + ti_i2c_write_2(sc, I2C_REG_STATUS, I2C_STAT_RRDY); - return (IIC_ENOADDR); + } else { + /* Write some data. */ + if (status & I2C_STAT_XDR) { + /* + * Transmit draining interrupt - FIFO level is below + * the set threshold and the amount of data still to + * be transferred wont reach the set FIFO threshold. + */ + ti_i2c_dbg(sc, "Transmit draining interrupt\n"); + + /* + * Drain the TX data. Write the pending data in the + * FIFO. + */ + amount = sc->sc_buffer->len - sc->sc_buffer_pos; + } else if (status & I2C_STAT_XRDY) { + /* + * Transmit data ready interrupt - the FIFO level + * is below the set threshold. + */ + ti_i2c_dbg(sc, "Transmit data ready interrupt\n"); + + amount = min(sc->sc_fifo_trsh, + sc->sc_buffer->len - sc->sc_buffer_pos); + } + + /* Write the bytes from the fifo. */ + for (i = 0; i < amount; i++) + ti_i2c_write_2(sc, I2C_REG_DATA, + sc->sc_buffer->buf[sc->sc_buffer_pos++]); + + if (status & I2C_STAT_XDR) + ti_i2c_write_2(sc, I2C_REG_STATUS, I2C_STAT_XDR); + if (status & I2C_STAT_XRDY) + ti_i2c_write_2(sc, I2C_REG_STATUS, I2C_STAT_XRDY); + } + + return (done); } /** @@ -333,381 +321,41 @@ ti_i2c_reset(device_t dev, u_char speed, static void ti_i2c_intr(void *arg) { - struct ti_i2c_softc *sc = (struct ti_i2c_softc*) arg; - uint16_t status; + int done; + struct ti_i2c_softc *sc; + uint16_t events, status; - status = ti_i2c_read_reg(sc, I2C_REG_STAT); - if (status == 0) - return; + sc = (struct ti_i2c_softc *)arg; TI_I2C_LOCK(sc); - /* save the flags */ - sc->sc_stat_flags |= status; - - /* clear the status flags */ - ti_i2c_write_reg(sc, I2C_REG_STAT, status); - - /* wakeup the process the started the transaction */ - wakeup(sc); - - TI_I2C_UNLOCK(sc); - - return; -} - -/** - * ti_i2c_wait - waits for the specific event to occur - * @sc: i2c driver context - * @flags: the event(s) to wait on, this is a bitmask of the I2C_STAT_??? flags - * @statp: if not null will contain the status flags upon return - * @timo: the number of ticks to wait - * - * - * - * LOCKING: - * The driver context must be locked before calling this function. Internally - * the function sleeps, releasing the lock as it does so, however the lock is - * always retaken before this function returns. - * - * RETURNS: - * 0 if the event(s) were tripped within timeout period - * EBUSY if timedout waiting for the events - * ENXIO if a NACK event was received - */ -static int -ti_i2c_wait(struct ti_i2c_softc *sc, uint16_t flags, uint16_t *statp, int timo) -{ - int waittime = timo; - int start_ticks = ticks; - int rc; - - TI_I2C_ASSERT_LOCKED(sc); - - /* check if the condition has already occured, the interrupt routine will - * clear the status flags. - */ - if ((sc->sc_stat_flags & flags) == 0) { - - /* condition(s) haven't occured so sleep on the IRQ */ - while (waittime > 0) { - - rc = mtx_sleep(sc, &sc->sc_mtx, 0, "I2Cwait", waittime); - if (rc == EWOULDBLOCK) { - /* timed-out, simply break out of the loop */ - break; - } else { - /* IRQ has been tripped, but need to sanity check we have the - * right events in the status flag. - */ - if ((sc->sc_stat_flags & flags) != 0) - break; - - /* event hasn't been tripped so wait some more */ - waittime -= (ticks - start_ticks); - start_ticks = ticks; - } - } - } - - /* copy the actual status bits */ - if (statp != NULL) - *statp = sc->sc_stat_flags; - - /* return the status found */ - if ((sc->sc_stat_flags & flags) != 0) - rc = 0; - else - rc = EBUSY; - - /* clear the flags set by the interrupt handler */ - sc->sc_stat_flags = 0; - - return (rc); -} - -/** - * ti_i2c_wait_for_free_bus - waits for the bus to become free - * @sc: i2c driver context - * @timo: the time to wait for the bus to become free - * - * - * - * LOCKING: - * The driver context must be locked before calling this function. Internally - * the function sleeps, releasing the lock as it does so, however the lock is - * always taken before this function returns. - * - * RETURNS: - * 0 if the event(s) were tripped within timeout period - * EBUSY if timedout waiting for the events - * ENXIO if a NACK event was received - */ -static int -ti_i2c_wait_for_free_bus(struct ti_i2c_softc *sc, int timo) -{ - /* check if the bus is free, BB bit = 0 */ - if ((ti_i2c_read_reg(sc, I2C_REG_STAT) & I2C_STAT_BB) == 0) - return 0; - - /* enable bus free interrupts */ - ti_i2c_set_intr_enable(sc, I2C_IE_BF); - - /* wait for the bus free interrupt to be tripped */ - return ti_i2c_wait(sc, I2C_STAT_BF, NULL, timo); -} - -/** - * ti_i2c_read_bytes - attempts to perform a read operation - * @sc: i2c driver context - * @buf: buffer to hold the received bytes - * @len: the number of bytes to read - * - * This function assumes the slave address is already set - * - * LOCKING: - * The context lock should be held before calling this function - * - * RETURNS: - * 0 on function succeeded - * EINVAL if invalid message is passed as an arg - */ -static int -ti_i2c_read_bytes(struct ti_i2c_softc *sc, uint8_t *buf, uint16_t len) -{ - int timo = (hz / 4); - int err = 0; - uint16_t con_reg; - uint16_t events; - uint16_t status; - uint32_t amount = 0; - uint32_t sofar = 0; - uint32_t i; - - /* wait for the bus to become free */ - err = ti_i2c_wait_for_free_bus(sc, timo); - if (err != 0) { - device_printf(sc->sc_dev, "bus never freed\n"); - return (err); + status = ti_i2c_read_2(sc, I2C_REG_STATUS); + if (status == 0) { + TI_I2C_UNLOCK(sc); + return; } - /* set the events to wait for */ - events = I2C_IE_RDR | /* Receive draining interrupt */ - I2C_IE_RRDY | /* Receive Data Ready interrupt */ - I2C_IE_ARDY | /* Register Access Ready interrupt */ - I2C_IE_NACK | /* No Acknowledgment interrupt */ - I2C_IE_AL; - - /* enable interrupts for the events we want */ - ti_i2c_set_intr_enable(sc, events); - - /* write the number of bytes to read */ - ti_i2c_write_reg(sc, I2C_REG_CNT, len); - - /* clear the write bit and initiate the read transaction. Setting the STT - * (start) bit initiates the transfer. - */ - con_reg = ti_i2c_read_reg(sc, I2C_REG_CON); - con_reg &= ~I2C_CON_TRX; - con_reg |= I2C_CON_MST | I2C_CON_STT | I2C_CON_STP; - ti_i2c_write_reg(sc, I2C_REG_CON, con_reg); - - /* reading loop */ - while (1) { - - /* wait for an event */ - err = ti_i2c_wait(sc, events, &status, timo); - if (err != 0) { - break; - } - - /* check for the error conditions */ - if (status & I2C_STAT_NACK) { - /* no ACK from slave */ - ti_i2c_dbg(sc, "NACK\n"); - err = ENXIO; - break; - } - if (status & I2C_STAT_AL) { - /* arbitration lost */ - ti_i2c_dbg(sc, "Arbitration lost\n"); - err = ENXIO; - break; - } - - /* check if we have finished */ - if (status & I2C_STAT_ARDY) { - /* register access ready - transaction complete basically */ - ti_i2c_dbg(sc, "ARDY transaction complete\n"); - err = 0; - break; - } - - /* read some data */ - if (status & I2C_STAT_RDR) { - /* Receive draining interrupt - last data received */ - ti_i2c_dbg(sc, "Receive draining interrupt\n"); - - /* get the number of bytes in the FIFO */ - amount = ti_i2c_read_reg(sc, I2C_REG_BUFSTAT); - amount >>= 8; - amount &= 0x3f; - } - else if (status & I2C_STAT_RRDY) { - /* Receive data ready interrupt - enough data received */ - ti_i2c_dbg(sc, "Receive data ready interrupt\n"); - - /* get the number of bytes in the FIFO */ - amount = ti_i2c_read_reg(sc, I2C_REG_BUF); - amount >>= 8; - amount &= 0x3f; - amount += 1; - } + /* Save enabled interrupts. */ + events = ti_i2c_read_2(sc, I2C_REG_IRQENABLE_SET); - /* sanity check we haven't overwritten the array */ - if ((sofar + amount) > len) { - ti_i2c_dbg(sc, "to many bytes to read\n"); - amount = (len - sofar); - } + /* We only care about enabled interrupts. */ + status &= events; - /* read the bytes from the fifo */ - for (i = 0; i < amount; i++) { - buf[sofar++] = (uint8_t)(ti_i2c_read_reg(sc, I2C_REG_DATA) & 0xff); - } + done = 0; - /* attempt to clear the receive ready bits */ - ti_i2c_write_reg(sc, I2C_REG_STAT, I2C_STAT_RDR | I2C_STAT_RRDY); + if (sc->sc_buffer != NULL) + done = ti_i2c_transfer_intr(sc, status); + else { + ti_i2c_dbg(sc, "Transfer interrupt without buffer\n"); + sc->sc_error = EINVAL; + done = 1; } - /* reset the registers regardless if there was an error or not */ - ti_i2c_set_intr_enable(sc, 0x0000); - ti_i2c_write_reg(sc, I2C_REG_CON, I2C_CON_I2C_EN | I2C_CON_MST | I2C_CON_STP); - - return (err); -} - -/** - * ti_i2c_write_bytes - attempts to perform a read operation - * @sc: i2c driver context - * @buf: buffer containing the bytes to write - * @len: the number of bytes to write - * - * This function assumes the slave address is already set - * - * LOCKING: - * The context lock should be held before calling this function - * - * RETURNS: - * 0 on function succeeded - * EINVAL if invalid message is passed as an arg - */ -static int -ti_i2c_write_bytes(struct ti_i2c_softc *sc, const uint8_t *buf, uint16_t len) -{ - int timo = (hz / 4); - int err = 0; - uint16_t con_reg; - uint16_t events; - uint16_t status; - uint32_t amount = 0; - uint32_t sofar = 0; - uint32_t i; - - /* wait for the bus to become free */ - err = ti_i2c_wait_for_free_bus(sc, timo); - if (err != 0) - return (err); - - /* set the events to wait for */ - events = I2C_IE_XDR | /* Transmit draining interrupt */ - I2C_IE_XRDY | /* Transmit Data Ready interrupt */ - I2C_IE_ARDY | /* Register Access Ready interrupt */ - I2C_IE_NACK | /* No Acknowledgment interrupt */ - I2C_IE_AL; - - /* enable interrupts for the events we want*/ - ti_i2c_set_intr_enable(sc, events); - - /* write the number of bytes to write */ - ti_i2c_write_reg(sc, I2C_REG_CNT, len); - - /* set the write bit and initiate the write transaction. Setting the STT - * (start) bit initiates the transfer. - */ - con_reg = ti_i2c_read_reg(sc, I2C_REG_CON); - con_reg |= I2C_CON_TRX | I2C_CON_MST | I2C_CON_STT | I2C_CON_STP; - ti_i2c_write_reg(sc, I2C_REG_CON, con_reg); - - /* writing loop */ - while (1) { - - /* wait for an event */ - err = ti_i2c_wait(sc, events, &status, timo); - if (err != 0) { - break; - } + if (done) + /* Wakeup the process that started the transaction. */ + wakeup(sc); - /* check for the error conditions */ - if (status & I2C_STAT_NACK) { - /* no ACK from slave */ - ti_i2c_dbg(sc, "NACK\n"); - err = ENXIO; - break; - } - if (status & I2C_STAT_AL) { - /* arbitration lost */ - ti_i2c_dbg(sc, "Arbitration lost\n"); - err = ENXIO; - break; - } - - /* check if we have finished */ - if (status & I2C_STAT_ARDY) { - /* register access ready - transaction complete basically */ - ti_i2c_dbg(sc, "ARDY transaction complete\n"); - err = 0; - break; - } - - /* read some data */ - if (status & I2C_STAT_XDR) { - /* Receive draining interrupt - last data received */ - ti_i2c_dbg(sc, "Transmit draining interrupt\n"); - - /* get the number of bytes in the FIFO */ - amount = ti_i2c_read_reg(sc, I2C_REG_BUFSTAT); - amount &= 0x3f; - } - else if (status & I2C_STAT_XRDY) { - /* Receive data ready interrupt - enough data received */ - ti_i2c_dbg(sc, "Transmit data ready interrupt\n"); - - /* get the number of bytes in the FIFO */ - amount = ti_i2c_read_reg(sc, I2C_REG_BUF); - amount &= 0x3f; - amount += 1; - } - - /* sanity check we haven't overwritten the array */ - if ((sofar + amount) > len) { - ti_i2c_dbg(sc, "to many bytes to write\n"); - amount = (len - sofar); - } - - /* write the bytes from the fifo */ - for (i = 0; i < amount; i++) { - ti_i2c_write_reg(sc, I2C_REG_DATA, buf[sofar++]); - } - - /* attempt to clear the transmit ready bits */ - ti_i2c_write_reg(sc, I2C_REG_STAT, I2C_STAT_XDR | I2C_STAT_XRDY); - } - - /* reset the registers regardless if there was an error or not */ - ti_i2c_set_intr_enable(sc, 0x0000); - ti_i2c_write_reg(sc, I2C_REG_CON, I2C_CON_I2C_EN | I2C_CON_MST | I2C_CON_STP); - - return (err); + TI_I2C_UNLOCK(sc); } /** @@ -727,45 +375,109 @@ ti_i2c_write_bytes(struct ti_i2c_softc * static int ti_i2c_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) { - struct ti_i2c_softc *sc = device_get_softc(dev); - int err = 0; - uint32_t i; - uint16_t len; - uint8_t *buf; + int err, i, repstart, timeout; + struct ti_i2c_softc *sc; + uint16_t reg; + sc = device_get_softc(dev); TI_I2C_LOCK(sc); - for (i = 0; i < nmsgs; i++) { + /* If the controller is busy wait until it is available. */ + while (sc->sc_bus_inuse == 1) + mtx_sleep(sc, &sc->sc_mtx, 0, "i2cbuswait", 0); - len = msgs[i].len; - buf = msgs[i].buf; + /* Now we have control over the I2C controller. */ + sc->sc_bus_inuse = 1; + + err = 0; + repstart = 0; + for (i = 0; i < nmsgs; i++) { - /* zero byte transfers aren't allowed */ - if (len == 0 || buf == NULL) { + sc->sc_buffer = &msgs[i]; + sc->sc_buffer_pos = 0; + sc->sc_error = 0; + + /* Zero byte transfers aren't allowed. */ + if (sc->sc_buffer == NULL || sc->sc_buffer->buf == NULL || + sc->sc_buffer->len == 0) { err = EINVAL; - goto out; + break; } - /* set the slave address */ - ti_i2c_write_reg(sc, I2C_REG_SA, msgs[i].slave >> 1); - - /* perform the read or write */ - if (msgs[i].flags & IIC_M_RD) { - err = ti_i2c_read_bytes(sc, buf, len); - } else { - err = ti_i2c_write_bytes(sc, buf, len); - } + /* Check if the i2c bus is free. */ + if (repstart == 0) { + /* + * On repeated start we send the START condition while + * the bus _is_ busy. + */ + timeout = 0; + while (ti_i2c_read_2(sc, I2C_REG_STATUS_RAW) & I2C_STAT_BB) { + if (timeout++ > 100) { + err = EBUSY; + goto out; + } + DELAY(1000); + } + timeout = 0; + } else + repstart = 0; + + if (sc->sc_buffer->flags & IIC_M_NOSTOP) + repstart = 1; + + /* Set the slave address. */ + ti_i2c_write_2(sc, I2C_REG_SA, msgs[i].slave >> 1); + + /* Write the data length. */ + ti_i2c_write_2(sc, I2C_REG_CNT, sc->sc_buffer->len); + + /* Clear the RX and the TX FIFO. */ + reg = ti_i2c_read_2(sc, I2C_REG_BUF); + reg |= I2C_BUF_RXFIFO_CLR | I2C_BUF_TXFIFO_CLR; + ti_i2c_write_2(sc, I2C_REG_BUF, reg); + + reg = sc->sc_con_reg | I2C_CON_STT; + if (repstart == 0) + reg |= I2C_CON_STP; + if ((sc->sc_buffer->flags & IIC_M_RD) == 0) + reg |= I2C_CON_TRX; + ti_i2c_write_2(sc, I2C_REG_CON, reg); + + /* Wait for an event. */ + err = mtx_sleep(sc, &sc->sc_mtx, 0, "i2ciowait", hz); + if (err == 0) + err = sc->sc_error; + if (err) + break; } out: + if (timeout == 0) { + while (ti_i2c_read_2(sc, I2C_REG_STATUS_RAW) & I2C_STAT_BB) { + if (timeout++ > 100) + break; + DELAY(1000); + } + } + /* Put the controller in master mode again. */ + if ((ti_i2c_read_2(sc, I2C_REG_CON) & I2C_CON_MST) == 0) + ti_i2c_write_2(sc, I2C_REG_CON, sc->sc_con_reg); + + sc->sc_buffer = NULL; + sc->sc_bus_inuse = 0; + + /* Wake up the processes that are waiting for the bus. */ + wakeup(sc); + TI_I2C_UNLOCK(sc); return (err); } /** - * ti_i2c_callback - not sure about this one + * ti_i2c_callback - as we only provide iicbus_transfer() interface + * we don't need to implement the serialization here. * @dev: i2c device handle * * @@ -795,158 +507,231 @@ ti_i2c_callback(device_t dev, int index, return (error); } -/** - * ti_i2c_activate - initialises and activates an I2C bus - * @dev: i2c device handle - * @num: the number of the I2C controller to activate; 1, 2 or 3 - * - * - * LOCKING: - * Assumed called in an atomic context. - * - * RETURNS: - * nothing - */ static int -ti_i2c_activate(device_t dev) +ti_i2c_reset(struct ti_i2c_softc *sc, u_char speed) { - struct ti_i2c_softc *sc = (struct ti_i2c_softc*) device_get_softc(dev); - unsigned int timeout = 0; - uint16_t con_reg; - int err; - clk_ident_t clk; + int timeout; + struct ti_i2c_clock_config *clkcfg; + uint16_t fifo_trsh, reg, scll, sclh; - /* - * The following sequence is taken from the OMAP3530 technical reference - * - * 1. Enable the functional and interface clocks (see Section 18.3.1.1.1). - */ - clk = I2C0_CLK + sc->device_id; - err = ti_prcm_clk_enable(clk); - if (err) - return (err); + switch (ti_chip()) { +#ifdef SOC_OMAP4 + case CHIP_OMAP_4: + clkcfg = ti_omap4_i2c_clock_configs; + break; +#endif +#ifdef SOC_TI_AM335X + case CHIP_AM335X: + clkcfg = ti_am335x_i2c_clock_configs; + break; +#endif + default: + panic("Unknown Ti SoC, unable to reset the i2c"); + } + while (clkcfg->speed != -1) { + if (clkcfg->speed == speed) + break; + clkcfg++; + } + if (clkcfg->speed == -1) + return (EINVAL); - /* There seems to be a bug in the I2C reset mechanism, for some reason you - * need to disable the I2C module before issuing the reset and then enable - * it again after to detect the reset done. + /* + * 23.1.4.3 - HS I2C Software Reset + * From OMAP4 TRM at page 4068. * - * I found this out by looking at the Linux driver implementation, thanks - * linux guys! + * 1. Ensure that the module is disabled. */ + sc->sc_con_reg = 0; + ti_i2c_write_2(sc, I2C_REG_CON, sc->sc_con_reg); - /* Disable the I2C controller */ - ti_i2c_write_reg(sc, I2C_REG_CON, 0x0000); - - /* Issue a softreset to the controller */ - /* XXXOMAP3: FIXME */ - bus_write_2(sc->sc_mem_res, I2C_REG_SYSC, 0x0002); - - /* Re-enable the module and then check for the reset done */ - ti_i2c_write_reg(sc, I2C_REG_CON, I2C_CON_I2C_EN); + /* 2. Issue a softreset to the controller. */ + bus_write_2(sc->sc_mem_res, I2C_REG_SYSC, I2C_REG_SYSC_SRST); - while ((ti_i2c_read_reg(sc, I2C_REG_SYSS) & 0x01) == 0x00) { - if (timeout++ > 100) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 14:38:05 2014 Return-Path: Delivered-To: svn-src-all@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 A344C88E; Mon, 27 Oct 2014 14:38: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 8A5BFED4; Mon, 27 Oct 2014 14:38: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 s9REc5G4099876; Mon, 27 Oct 2014 14:38:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9REc0W6099841; Mon, 27 Oct 2014 14:38:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410271438.s9REc0W6099841@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 27 Oct 2014 14:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273736 - in stable/10/sys: amd64/amd64 arm/arm cam/scsi cddl/contrib/opensolaris/uts/common/fs/zfs cddl/dev/dtrace compat/ndis dev/acpi_support dev/bxe dev/cxgb dev/cxgbe dev/e1000 dev... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 14:38:05 -0000 Author: hselasky Date: Mon Oct 27 14:38:00 2014 New Revision: 273736 URL: https://svnweb.freebsd.org/changeset/base/273736 Log: MFC r263710, r273377, r273378, r273423 and r273455: - De-vnet hash sizes and hash masks. - Fix multiple issues related to arguments passed to SYSCTL macros. Sponsored by: Mellanox Technologies Modified: stable/10/sys/amd64/amd64/fpu.c stable/10/sys/arm/arm/busdma_machdep-v6.c stable/10/sys/arm/arm/busdma_machdep.c stable/10/sys/cam/scsi/scsi_sa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/10/sys/cddl/dev/dtrace/dtrace_sysctl.c stable/10/sys/compat/ndis/kern_ndis.c stable/10/sys/dev/acpi_support/acpi_asus.c stable/10/sys/dev/acpi_support/acpi_asus_wmi.c stable/10/sys/dev/acpi_support/acpi_hp.c stable/10/sys/dev/acpi_support/acpi_ibm.c stable/10/sys/dev/acpi_support/acpi_rapidstart.c stable/10/sys/dev/acpi_support/acpi_sony.c stable/10/sys/dev/bxe/bxe.c stable/10/sys/dev/cxgb/cxgb_sge.c stable/10/sys/dev/cxgbe/t4_main.c stable/10/sys/dev/e1000/if_em.c stable/10/sys/dev/e1000/if_igb.c stable/10/sys/dev/e1000/if_lem.c stable/10/sys/dev/hatm/if_hatm.c stable/10/sys/dev/ixgbe/ixgbe.c stable/10/sys/dev/ixgbe/ixv.c stable/10/sys/dev/ixl/if_ixl.c stable/10/sys/dev/mpr/mpr.c stable/10/sys/dev/mps/mps.c stable/10/sys/dev/mrsas/mrsas.c stable/10/sys/dev/mrsas/mrsas.h stable/10/sys/dev/mxge/if_mxge.c stable/10/sys/dev/oce/oce_sysctl.c stable/10/sys/dev/qlxgb/qla_os.c stable/10/sys/dev/qlxgbe/ql_os.c stable/10/sys/dev/rt/if_rt.c stable/10/sys/dev/sound/pci/hda/hdaa.c stable/10/sys/dev/vxge/vxge.c stable/10/sys/dev/xen/netfront/netfront.c stable/10/sys/fs/devfs/devfs_devs.c stable/10/sys/fs/fuse/fuse_main.c stable/10/sys/fs/fuse/fuse_vfsops.c stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c stable/10/sys/geom/geom_kern.c stable/10/sys/kern/kern_cpuset.c stable/10/sys/kern/kern_descrip.c stable/10/sys/kern/kern_mib.c stable/10/sys/kern/kern_synch.c stable/10/sys/kern/subr_devstat.c stable/10/sys/kern/subr_kdb.c stable/10/sys/kern/subr_uio.c stable/10/sys/kern/vfs_cache.c stable/10/sys/mips/mips/busdma_machdep.c stable/10/sys/net/if_lagg.c stable/10/sys/net/pfvar.h stable/10/sys/net80211/ieee80211_ht.c stable/10/sys/net80211/ieee80211_hwmp.c stable/10/sys/net80211/ieee80211_mesh.c stable/10/sys/net80211/ieee80211_superg.c stable/10/sys/netgraph/bluetooth/common/ng_bluetooth.c stable/10/sys/netgraph/ng_base.c stable/10/sys/netgraph/ng_socket.c stable/10/sys/netinet/cc/cc_chd.c stable/10/sys/netinet/tcp_reass.c stable/10/sys/netipsec/ipsec.h stable/10/sys/netipx/ipx_proto.c stable/10/sys/netpfil/pf/if_pfsync.c stable/10/sys/netpfil/pf/pf.c stable/10/sys/netpfil/pf/pf_ioctl.c stable/10/sys/ofed/drivers/net/mlx4/mlx4_en.h stable/10/sys/powerpc/powermac/fcu.c stable/10/sys/powerpc/powermac/smu.c stable/10/sys/powerpc/powerpc/busdma_machdep.c stable/10/sys/powerpc/powerpc/cpu.c stable/10/sys/sys/sysctl.h stable/10/sys/vm/memguard.c stable/10/sys/vm/vm_kern.c stable/10/sys/x86/x86/busdma_bounce.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/fpu.c ============================================================================== --- stable/10/sys/amd64/amd64/fpu.c Mon Oct 27 12:18:07 2014 (r273735) +++ stable/10/sys/amd64/amd64/fpu.c Mon Oct 27 14:38:00 2014 (r273736) @@ -130,7 +130,7 @@ CTASSERT(sizeof(struct pcb) % XSAVE_AREA static void fpu_clean_state(void); SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, - NULL, 1, "Floating point instructions executed in hardware"); + SYSCTL_NULL_INT_PTR, 1, "Floating point instructions executed in hardware"); int use_xsave; /* non-static for cpu_switch.S */ uint64_t xsave_mask; /* the same */ Modified: stable/10/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- stable/10/sys/arm/arm/busdma_machdep-v6.c Mon Oct 27 12:18:07 2014 (r273735) +++ stable/10/sys/arm/arm/busdma_machdep-v6.c Mon Oct 27 14:38:00 2014 (r273736) @@ -1503,9 +1503,9 @@ alloc_bounce_zone(bus_dma_tag_t dmat) SYSCTL_ADD_STRING(busdma_sysctl_tree(bz), SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO, "lowaddr", CTLFLAG_RD, bz->lowaddrid, 0, ""); - SYSCTL_ADD_INT(busdma_sysctl_tree(bz), + SYSCTL_ADD_ULONG(busdma_sysctl_tree(bz), SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO, - "alignment", CTLFLAG_RD, &bz->alignment, 0, ""); + "alignment", CTLFLAG_RD, &bz->alignment, ""); return (0); } Modified: stable/10/sys/arm/arm/busdma_machdep.c ============================================================================== --- stable/10/sys/arm/arm/busdma_machdep.c Mon Oct 27 12:18:07 2014 (r273735) +++ stable/10/sys/arm/arm/busdma_machdep.c Mon Oct 27 14:38:00 2014 (r273736) @@ -1346,9 +1346,9 @@ alloc_bounce_zone(bus_dma_tag_t dmat) SYSCTL_ADD_STRING(busdma_sysctl_tree(bz), SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO, "lowaddr", CTLFLAG_RD, bz->lowaddrid, 0, ""); - SYSCTL_ADD_INT(busdma_sysctl_tree(bz), + SYSCTL_ADD_ULONG(busdma_sysctl_tree(bz), SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO, - "alignment", CTLFLAG_RD, &bz->alignment, 0, ""); + "alignment", CTLFLAG_RD, &bz->alignment, ""); return (0); } Modified: stable/10/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_sa.c Mon Oct 27 12:18:07 2014 (r273735) +++ stable/10/sys/cam/scsi/scsi_sa.c Mon Oct 27 14:38:00 2014 (r273736) @@ -1486,13 +1486,13 @@ sasysctlinit(void *context, int pending) goto bailout; SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "allow_io_split", CTLTYPE_INT | CTLFLAG_RDTUN, + OID_AUTO, "allow_io_split", CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &softc->allow_io_split, 0, "Allow Splitting I/O"); SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "maxio", CTLTYPE_INT | CTLFLAG_RD, + OID_AUTO, "maxio", CTLFLAG_RD, &softc->maxio, 0, "Maximum I/O size"); SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "cpi_maxio", CTLTYPE_INT | CTLFLAG_RD, + OID_AUTO, "cpi_maxio", CTLFLAG_RD, &softc->cpi_maxio, 0, "Maximum Controller I/O size"); bailout: Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Oct 27 12:18:07 2014 (r273735) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Oct 27 14:38:00 2014 (r273736) @@ -67,8 +67,8 @@ #include "zfs_comutil.h" /* Used by fstat(1). */ -SYSCTL_INT(_debug_sizeof, OID_AUTO, znode, CTLFLAG_RD, 0, sizeof(znode_t), - "sizeof(znode_t)"); +SYSCTL_INT(_debug_sizeof, OID_AUTO, znode, CTLFLAG_RD, + SYSCTL_NULL_INT_PTR, sizeof(znode_t), "sizeof(znode_t)"); /* * Define ZNODE_STATS to turn on statistic gathering. By default, it is only Modified: stable/10/sys/cddl/dev/dtrace/dtrace_sysctl.c ============================================================================== --- stable/10/sys/cddl/dev/dtrace/dtrace_sysctl.c Mon Oct 27 12:18:07 2014 (r273735) +++ stable/10/sys/cddl/dev/dtrace/dtrace_sysctl.c Mon Oct 27 14:38:00 2014 (r273736) @@ -84,10 +84,10 @@ SYSCTL_PROC(_debug_dtrace, OID_AUTO, pro SYSCTL_NODE(_kern, OID_AUTO, dtrace, CTLFLAG_RD, 0, "DTrace parameters"); -SYSCTL_LONG(_kern_dtrace, OID_AUTO, dof_maxsize, CTLFLAG_RW, +SYSCTL_QUAD(_kern_dtrace, OID_AUTO, dof_maxsize, CTLFLAG_RW, &dtrace_dof_maxsize, 0, "largest allowed DOF table"); -SYSCTL_LONG(_kern_dtrace, OID_AUTO, helper_actions_max, CTLFLAG_RW, +SYSCTL_QUAD(_kern_dtrace, OID_AUTO, helper_actions_max, CTLFLAG_RW, &dtrace_helper_actions_max, 0, "maximum number of allowed helper actions"); SYSCTL_INT(_kern_dtrace, OID_AUTO, memstr_max, CTLFLAG_RW, &dtrace_memstr_max, Modified: stable/10/sys/compat/ndis/kern_ndis.c ============================================================================== --- stable/10/sys/compat/ndis/kern_ndis.c Mon Oct 27 12:18:07 2014 (r273735) +++ stable/10/sys/compat/ndis/kern_ndis.c Mon Oct 27 14:38:00 2014 (r273736) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #define NDIS_DUMMY_PATH "\\\\some\\bogus\\path" +#define NDIS_FLAG_RDONLY 1 static void ndis_status_func(ndis_handle, ndis_status, void *, uint32_t); static void ndis_statusdone_func(ndis_handle); @@ -325,48 +326,48 @@ ndis_create_sysctls(arg) * We qualify as the latter. */ ndis_add_sysctl(sc, "Environment", - "Windows environment", "1", CTLFLAG_RD); + "Windows environment", "1", NDIS_FLAG_RDONLY); /* NDIS version should be 5.1. */ ndis_add_sysctl(sc, "NdisVersion", - "NDIS API Version", "0x00050001", CTLFLAG_RD); + "NDIS API Version", "0x00050001", NDIS_FLAG_RDONLY); /* * Some miniport drivers rely on the existence of the SlotNumber, * NetCfgInstanceId and DriverDesc keys. */ - ndis_add_sysctl(sc, "SlotNumber", "Slot Numer", "01", CTLFLAG_RD); + ndis_add_sysctl(sc, "SlotNumber", "Slot Numer", "01", NDIS_FLAG_RDONLY); ndis_add_sysctl(sc, "NetCfgInstanceId", "NetCfgInstanceId", - "{12345678-1234-5678-CAFE0-123456789ABC}", CTLFLAG_RD); + "{12345678-1234-5678-CAFE0-123456789ABC}", NDIS_FLAG_RDONLY); ndis_add_sysctl(sc, "DriverDesc", "Driver Description", - "NDIS Network Adapter", CTLFLAG_RD); + "NDIS Network Adapter", NDIS_FLAG_RDONLY); /* Bus type (PCI, PCMCIA, etc...) */ sprintf(buf, "%d", (int)sc->ndis_iftype); - ndis_add_sysctl(sc, "BusType", "Bus Type", buf, CTLFLAG_RD); + ndis_add_sysctl(sc, "BusType", "Bus Type", buf, NDIS_FLAG_RDONLY); if (sc->ndis_res_io != NULL) { sprintf(buf, "0x%lx", rman_get_start(sc->ndis_res_io)); ndis_add_sysctl(sc, "IOBaseAddress", - "Base I/O Address", buf, CTLFLAG_RD); + "Base I/O Address", buf, NDIS_FLAG_RDONLY); } if (sc->ndis_irq != NULL) { sprintf(buf, "%lu", rman_get_start(sc->ndis_irq)); ndis_add_sysctl(sc, "InterruptNumber", - "Interrupt Number", buf, CTLFLAG_RD); + "Interrupt Number", buf, NDIS_FLAG_RDONLY); } return (0); } int -ndis_add_sysctl(arg, key, desc, val, flag) +ndis_add_sysctl(arg, key, desc, val, flag_rdonly) void *arg; char *key; char *desc; char *val; - int flag; + int flag_rdonly; { struct ndis_softc *sc; struct ndis_cfglist *cfg; @@ -391,13 +392,21 @@ ndis_add_sysctl(arg, key, desc, val, fla TAILQ_INSERT_TAIL(&sc->ndis_cfglist_head, cfg, link); - cfg->ndis_oid = - SYSCTL_ADD_STRING(device_get_sysctl_ctx(sc->ndis_dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ndis_dev)), - OID_AUTO, cfg->ndis_cfg.nc_cfgkey, flag, - cfg->ndis_cfg.nc_val, sizeof(cfg->ndis_cfg.nc_val), - cfg->ndis_cfg.nc_cfgdesc); - + if (flag_rdonly != 0) { + cfg->ndis_oid = + SYSCTL_ADD_STRING(device_get_sysctl_ctx(sc->ndis_dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ndis_dev)), + OID_AUTO, cfg->ndis_cfg.nc_cfgkey, CTLFLAG_RD, + cfg->ndis_cfg.nc_val, sizeof(cfg->ndis_cfg.nc_val), + cfg->ndis_cfg.nc_cfgdesc); + } else { + cfg->ndis_oid = + SYSCTL_ADD_STRING(device_get_sysctl_ctx(sc->ndis_dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ndis_dev)), + OID_AUTO, cfg->ndis_cfg.nc_cfgkey, CTLFLAG_RW, + cfg->ndis_cfg.nc_val, sizeof(cfg->ndis_cfg.nc_val), + cfg->ndis_cfg.nc_cfgdesc); + } return (0); } Modified: stable/10/sys/dev/acpi_support/acpi_asus.c ============================================================================== --- stable/10/sys/dev/acpi_support/acpi_asus.c Mon Oct 27 12:18:07 2014 (r273735) +++ stable/10/sys/dev/acpi_support/acpi_asus.c Mon Oct 27 14:38:00 2014 (r273736) @@ -465,43 +465,39 @@ static struct { char *name; char *description; int method; - int flags; + int flag_anybody; } acpi_asus_sysctls[] = { { .name = "lcd_backlight", .method = ACPI_ASUS_METHOD_LCD, .description = "state of the lcd backlight", - .flags = CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY + .flag_anybody = 1 }, { .name = "lcd_brightness", .method = ACPI_ASUS_METHOD_BRN, .description = "brightness of the lcd panel", - .flags = CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY + .flag_anybody = 1 }, { .name = "video_output", .method = ACPI_ASUS_METHOD_DISP, .description = "display output state", - .flags = CTLTYPE_INT | CTLFLAG_RW }, { .name = "camera", .method = ACPI_ASUS_METHOD_CAMERA, .description = "internal camera state", - .flags = CTLTYPE_INT | CTLFLAG_RW }, { .name = "cardreader", .method = ACPI_ASUS_METHOD_CARDRD, .description = "internal card reader state", - .flags = CTLTYPE_INT | CTLFLAG_RW }, { .name = "wlan", .method = ACPI_ASUS_METHOD_WLAN, .description = "wireless lan state", - .flags = CTLTYPE_INT | CTLFLAG_RW }, { .name = NULL } @@ -741,12 +737,21 @@ acpi_asus_attach(device_t dev) if (!acpi_asus_sysctl_init(sc, acpi_asus_sysctls[i].method)) continue; - SYSCTL_ADD_PROC(&sc->sysctl_ctx, - SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, - acpi_asus_sysctls[i].name, - acpi_asus_sysctls[i].flags, - sc, i, acpi_asus_sysctl, "I", - acpi_asus_sysctls[i].description); + if (acpi_asus_sysctls[i].flag_anybody != 0) { + SYSCTL_ADD_PROC(&sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + acpi_asus_sysctls[i].name, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY, + sc, i, acpi_asus_sysctl, "I", + acpi_asus_sysctls[i].description); + } else { + SYSCTL_ADD_PROC(&sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + acpi_asus_sysctls[i].name, + CTLTYPE_INT | CTLFLAG_RW, + sc, i, acpi_asus_sysctl, "I", + acpi_asus_sysctls[i].description); + } } /* Attach leds */ Modified: stable/10/sys/dev/acpi_support/acpi_asus_wmi.c ============================================================================== --- stable/10/sys/dev/acpi_support/acpi_asus_wmi.c Mon Oct 27 12:18:07 2014 (r273735) +++ stable/10/sys/dev/acpi_support/acpi_asus_wmi.c Mon Oct 27 14:38:00 2014 (r273736) @@ -119,163 +119,139 @@ static struct { char *name; int dev_id; char *description; - int access; + int flag_rdonly; } acpi_asus_wmi_sysctls[] = { { .name = "hw_switch", .dev_id = ASUS_WMI_DEVID_HW_SWITCH, .description = "hw_switch", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "wireless_led", .dev_id = ASUS_WMI_DEVID_WIRELESS_LED, .description = "Wireless LED control", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "cwap", .dev_id = ASUS_WMI_DEVID_CWAP, .description = "Alt+F2 function", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "wlan", .dev_id = ASUS_WMI_DEVID_WLAN, .description = "WLAN power control", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "bluetooth", .dev_id = ASUS_WMI_DEVID_BLUETOOTH, .description = "Bluetooth power control", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "gps", .dev_id = ASUS_WMI_DEVID_GPS, .description = "GPS power control", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "wimax", .dev_id = ASUS_WMI_DEVID_WIMAX, .description = "WiMAX power control", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "wwan3g", .dev_id = ASUS_WMI_DEVID_WWAN3G, .description = "WWAN-3G power control", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "uwb", .dev_id = ASUS_WMI_DEVID_UWB, .description = "UWB power control", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "led1", .dev_id = ASUS_WMI_DEVID_LED1, .description = "LED1 control", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "led2", .dev_id = ASUS_WMI_DEVID_LED2, .description = "LED2 control", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "led3", .dev_id = ASUS_WMI_DEVID_LED3, .description = "LED3 control", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "led4", .dev_id = ASUS_WMI_DEVID_LED4, .description = "LED4 control", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "led5", .dev_id = ASUS_WMI_DEVID_LED5, .description = "LED5 control", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "led6", .dev_id = ASUS_WMI_DEVID_LED6, .description = "LED6 control", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "backlight", .dev_id = ASUS_WMI_DEVID_BACKLIGHT, .description = "LCD backlight on/off control", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "brightness", .dev_id = ASUS_WMI_DEVID_BRIGHTNESS, .description = "LCD backlight brightness control", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "kbd_backlight", .dev_id = ASUS_WMI_DEVID_KBD_BACKLIGHT, .description = "Keyboard backlight brightness control", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "light_sensor", .dev_id = ASUS_WMI_DEVID_LIGHT_SENSOR, .description = "Ambient light sensor", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "camera", .dev_id = ASUS_WMI_DEVID_CAMERA, .description = "Camera power control", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "cardreader", .dev_id = ASUS_WMI_DEVID_CARDREADER, .description = "Cardreader power control", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "touchpad", .dev_id = ASUS_WMI_DEVID_TOUCHPAD, .description = "Touchpad control", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "touchpad_led", .dev_id = ASUS_WMI_DEVID_TOUCHPAD_LED, .description = "Touchpad LED control", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "themperature", .dev_id = ASUS_WMI_DEVID_THERMAL_CTRL, .description = "Temperature (C)", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "fan_speed", .dev_id = ASUS_WMI_DEVID_FAN_CTRL, .description = "Fan speed (0-3)", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "processor_state", .dev_id = ASUS_WMI_DEVID_PROCESSOR_STATE, - .description = "Processor state", - .access = CTLTYPE_INT | CTLFLAG_RW + .flag_rdonly = 1 }, { NULL, 0, NULL, 0 } }; @@ -449,12 +425,21 @@ next: break; } - SYSCTL_ADD_PROC(sc->sysctl_ctx, - SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, - acpi_asus_wmi_sysctls[i].name, - acpi_asus_wmi_sysctls[i].access, - sc, i, acpi_asus_wmi_sysctl, "I", - acpi_asus_wmi_sysctls[i].description); + if (acpi_asus_wmi_sysctls[i].flag_rdonly != 0) { + SYSCTL_ADD_PROC(sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + acpi_asus_wmi_sysctls[i].name, + CTLTYPE_INT | CTLFLAG_RD, + sc, i, acpi_asus_wmi_sysctl, "I", + acpi_asus_wmi_sysctls[i].description); + } else { + SYSCTL_ADD_PROC(sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + acpi_asus_wmi_sysctls[i].name, + CTLTYPE_INT | CTLFLAG_RW, + sc, i, acpi_asus_wmi_sysctl, "I", + acpi_asus_wmi_sysctls[i].description); + } } ACPI_SERIAL_END(asus_wmi); Modified: stable/10/sys/dev/acpi_support/acpi_hp.c ============================================================================== --- stable/10/sys/dev/acpi_support/acpi_hp.c Mon Oct 27 12:18:07 2014 (r273735) +++ stable/10/sys/dev/acpi_support/acpi_hp.c Mon Oct 27 14:38:00 2014 (r273736) @@ -152,135 +152,123 @@ static struct { char *name; int method; char *description; - int access; + int flag_rdonly; } acpi_hp_sysctls[] = { { .name = "wlan_enabled", .method = ACPI_HP_METHOD_WLAN_ENABLED, .description = "Enable/Disable WLAN (WiFi)", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "wlan_radio", .method = ACPI_HP_METHOD_WLAN_RADIO, .description = "WLAN radio status", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "wlan_on_air", .method = ACPI_HP_METHOD_WLAN_ON_AIR, .description = "WLAN radio ready to use (enabled and radio)", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "wlan_enable_if_radio_on", .method = ACPI_HP_METHOD_WLAN_ENABLE_IF_RADIO_ON, .description = "Enable WLAN if radio is turned on", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "wlan_disable_if_radio_off", .method = ACPI_HP_METHOD_WLAN_DISABLE_IF_RADIO_OFF, .description = "Disable WLAN if radio is turned off", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "bt_enabled", .method = ACPI_HP_METHOD_BLUETOOTH_ENABLED, .description = "Enable/Disable Bluetooth", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "bt_radio", .method = ACPI_HP_METHOD_BLUETOOTH_RADIO, .description = "Bluetooth radio status", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "bt_on_air", .method = ACPI_HP_METHOD_BLUETOOTH_ON_AIR, .description = "Bluetooth radio ready to use" " (enabled and radio)", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "bt_enable_if_radio_on", .method = ACPI_HP_METHOD_BLUETOOTH_ENABLE_IF_RADIO_ON, .description = "Enable bluetooth if radio is turned on", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "bt_disable_if_radio_off", .method = ACPI_HP_METHOD_BLUETOOTH_DISABLE_IF_RADIO_OFF, .description = "Disable bluetooth if radio is turned off", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "wwan_enabled", .method = ACPI_HP_METHOD_WWAN_ENABLED, .description = "Enable/Disable WWAN (UMTS)", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "wwan_radio", .method = ACPI_HP_METHOD_WWAN_RADIO, .description = "WWAN radio status", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "wwan_on_air", .method = ACPI_HP_METHOD_WWAN_ON_AIR, .description = "WWAN radio ready to use (enabled and radio)", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "wwan_enable_if_radio_on", .method = ACPI_HP_METHOD_WWAN_ENABLE_IF_RADIO_ON, .description = "Enable WWAN if radio is turned on", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "wwan_disable_if_radio_off", .method = ACPI_HP_METHOD_WWAN_DISABLE_IF_RADIO_OFF, .description = "Disable WWAN if radio is turned off", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "als_enabled", .method = ACPI_HP_METHOD_ALS, .description = "Enable/Disable ALS (Ambient light sensor)", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "display", .method = ACPI_HP_METHOD_DISPLAY, .description = "Display status", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "hdd_temperature", .method = ACPI_HP_METHOD_HDDTEMP, .description = "HDD temperature", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "is_docked", .method = ACPI_HP_METHOD_DOCK, .description = "Docking station status", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "cmi_detail", .method = ACPI_HP_METHOD_CMI_DETAIL, .description = "Details shown in CMI output " "(cat /dev/hpcmi)", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "verbose", .method = ACPI_HP_METHOD_VERBOSE, .description = "Verbosity level", - .access = CTLTYPE_INT | CTLFLAG_RW }, { NULL, 0, NULL, 0 } @@ -560,11 +548,19 @@ acpi_hp_attach(device_t dev) sc->was_wwan_on_air = arg; } - SYSCTL_ADD_PROC(sc->sysctl_ctx, - SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, - acpi_hp_sysctls[i].name, acpi_hp_sysctls[i].access, - sc, i, acpi_hp_sysctl, "I", - acpi_hp_sysctls[i].description); + if (acpi_hp_sysctls[i].flag_rdonly != 0) { + SYSCTL_ADD_PROC(sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + acpi_hp_sysctls[i].name, CTLTYPE_INT | CTLFLAG_RD, + sc, i, acpi_hp_sysctl, "I", + acpi_hp_sysctls[i].description); + } else { + SYSCTL_ADD_PROC(sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + acpi_hp_sysctls[i].name, CTLTYPE_INT | CTLFLAG_RW, + sc, i, acpi_hp_sysctl, "I", + acpi_hp_sysctls[i].description); + } } ACPI_SERIAL_END(hp); Modified: stable/10/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- stable/10/sys/dev/acpi_support/acpi_ibm.c Mon Oct 27 12:18:07 2014 (r273735) +++ stable/10/sys/dev/acpi_support/acpi_ibm.c Mon Oct 27 14:38:00 2014 (r273736) @@ -192,79 +192,70 @@ static struct { char *name; int method; char *description; - int access; + int flag_rdonly; } acpi_ibm_sysctls[] = { { .name = "events", .method = ACPI_IBM_METHOD_EVENTS, .description = "ACPI events enable", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "eventmask", .method = ACPI_IBM_METHOD_EVENTMASK, .description = "ACPI eventmask", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "hotkey", .method = ACPI_IBM_METHOD_HOTKEY, .description = "Key Status", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "lcd_brightness", .method = ACPI_IBM_METHOD_BRIGHTNESS, .description = "LCD Brightness", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "volume", .method = ACPI_IBM_METHOD_VOLUME, .description = "Volume", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "mute", .method = ACPI_IBM_METHOD_MUTE, .description = "Mute", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "thinklight", .method = ACPI_IBM_METHOD_THINKLIGHT, .description = "Thinklight enable", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "bluetooth", .method = ACPI_IBM_METHOD_BLUETOOTH, .description = "Bluetooth enable", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "wlan", .method = ACPI_IBM_METHOD_WLAN, .description = "WLAN enable", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "fan_speed", .method = ACPI_IBM_METHOD_FANSPEED, .description = "Fan speed", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "fan_level", .method = ACPI_IBM_METHOD_FANLEVEL, .description = "Fan level", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "fan", .method = ACPI_IBM_METHOD_FANSTATUS, .description = "Fan enable", - .access = CTLTYPE_INT | CTLFLAG_RW }, { NULL, 0, NULL, 0 } @@ -415,11 +406,19 @@ acpi_ibm_attach(device_t dev) if (!acpi_ibm_sysctl_init(sc, acpi_ibm_sysctls[i].method)) continue; - SYSCTL_ADD_PROC(sc->sysctl_ctx, - SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, - acpi_ibm_sysctls[i].name, acpi_ibm_sysctls[i].access, - sc, i, acpi_ibm_sysctl, "I", - acpi_ibm_sysctls[i].description); + if (acpi_ibm_sysctls[i].flag_rdonly != 0) { + SYSCTL_ADD_PROC(sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + acpi_ibm_sysctls[i].name, CTLTYPE_INT | CTLFLAG_RD, + sc, i, acpi_ibm_sysctl, "I", + acpi_ibm_sysctls[i].description); + } else { + SYSCTL_ADD_PROC(sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + acpi_ibm_sysctls[i].name, CTLTYPE_INT | CTLFLAG_RW, + sc, i, acpi_ibm_sysctl, "I", + acpi_ibm_sysctls[i].description); + } } /* Hook up thermal node */ @@ -483,15 +482,10 @@ acpi_ibm_resume(device_t dev) for (int i = 0; acpi_ibm_sysctls[i].name != NULL; i++) { int val; - if ((acpi_ibm_sysctls[i].access & CTLFLAG_RD) == 0) { - continue; - } - val = acpi_ibm_sysctl_get(sc, i); - if ((acpi_ibm_sysctls[i].access & CTLFLAG_WR) == 0) { + if (acpi_ibm_sysctls[i].flag_rdonly != 0) continue; - } acpi_ibm_sysctl_set(sc, i, val); } Modified: stable/10/sys/dev/acpi_support/acpi_rapidstart.c ============================================================================== --- stable/10/sys/dev/acpi_support/acpi_rapidstart.c Mon Oct 27 12:18:07 2014 (r273735) +++ stable/10/sys/dev/acpi_support/acpi_rapidstart.c Mon Oct 27 14:38:00 2014 (r273736) @@ -84,12 +84,21 @@ acpi_rapidstart_attach(device_t dev) sc->sysctl_ctx = device_get_sysctl_ctx(dev); sc->sysctl_tree = device_get_sysctl_tree(dev); for (i = 0 ; acpi_rapidstart_oids[i].nodename != NULL; i++){ - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - i, acpi_rapidstart_oids[i].nodename , CTLTYPE_INT | - ((acpi_rapidstart_oids[i].setmethod)? CTLFLAG_RW: CTLFLAG_RD), - dev, i, sysctl_acpi_rapidstart_gen_handler, "I", - acpi_rapidstart_oids[i].comment); + if (acpi_rapidstart_oids[i].setmethod != NULL) { + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + i, acpi_rapidstart_oids[i].nodename, + CTLTYPE_INT | CTLFLAG_RW, + dev, i, sysctl_acpi_rapidstart_gen_handler, "I", + acpi_rapidstart_oids[i].comment); + } else { + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + i, acpi_rapidstart_oids[i].nodename, + CTLTYPE_INT | CTLFLAG_RD, + dev, i, sysctl_acpi_rapidstart_gen_handler, "I", + acpi_rapidstart_oids[i].comment); + } } return (0); } Modified: stable/10/sys/dev/acpi_support/acpi_sony.c ============================================================================== --- stable/10/sys/dev/acpi_support/acpi_sony.c Mon Oct 27 12:18:07 2014 (r273735) +++ stable/10/sys/dev/acpi_support/acpi_sony.c Mon Oct 27 14:38:00 2014 (r273736) @@ -132,13 +132,22 @@ acpi_sony_attach(device_t dev) sc = device_get_softc(dev); acpi_GetInteger(acpi_get_handle(dev), ACPI_SONY_GET_PID, &sc->pid); device_printf(dev, "PID %x\n", sc->pid); - for (i = 0 ; acpi_sony_oids[i].nodename != NULL; i++){ - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - i, acpi_sony_oids[i].nodename , CTLTYPE_INT | - ((acpi_sony_oids[i].setmethod)? CTLFLAG_RW: CTLFLAG_RD), - dev, i, sysctl_acpi_sony_gen_handler, "I", - acpi_sony_oids[i].comment); + for (i = 0 ; acpi_sony_oids[i].nodename != NULL; i++) { + if (acpi_sony_oids[i].setmethod != NULL) { + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + i, acpi_sony_oids[i].nodename , + CTLTYPE_INT | CTLFLAG_RW, + dev, i, sysctl_acpi_sony_gen_handler, "I", + acpi_sony_oids[i].comment); + } else { + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + i, acpi_sony_oids[i].nodename , + CTLTYPE_INT | CTLFLAG_RD, + dev, i, sysctl_acpi_sony_gen_handler, "I", + acpi_sony_oids[i].comment); + } } return (0); } Modified: stable/10/sys/dev/bxe/bxe.c ============================================================================== --- stable/10/sys/dev/bxe/bxe.c Mon Oct 27 12:18:07 2014 (r273735) +++ stable/10/sys/dev/bxe/bxe.c Mon Oct 27 14:38:00 2014 (r273736) @@ -16221,7 +16221,7 @@ bxe_add_sysctls(struct bxe_softc *sc) "version"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "bc_version", - CTLFLAG_RD, &sc->devinfo.bc_ver_str, 0, + CTLFLAG_RD, sc->devinfo.bc_ver_str, 0, "bootcode version"); snprintf(sc->fw_ver_str, sizeof(sc->fw_ver_str), "%d.%d.%d.%d", @@ -16230,7 +16230,7 @@ bxe_add_sysctls(struct bxe_softc *sc) BCM_5710_FW_REVISION_VERSION, BCM_5710_FW_ENGINEERING_VERSION); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "fw_version", - CTLFLAG_RD, &sc->fw_ver_str, 0, + CTLFLAG_RD, sc->fw_ver_str, 0, "firmware version"); snprintf(sc->mf_mode_str, sizeof(sc->mf_mode_str), "%s", @@ -16240,7 +16240,7 @@ bxe_add_sysctls(struct bxe_softc *sc) (sc->devinfo.mf_info.mf_mode == MULTI_FUNCTION_AFEX) ? "MF-AFEX" : "Unknown")); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mf_mode", - CTLFLAG_RD, &sc->mf_mode_str, 0, + CTLFLAG_RD, sc->mf_mode_str, 0, "multifunction mode"); SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "mf_vnics", @@ -16248,7 +16248,7 @@ bxe_add_sysctls(struct bxe_softc *sc) "multifunction vnics per port"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mac_addr", - CTLFLAG_RD, &sc->mac_addr_str, 0, + CTLFLAG_RD, sc->mac_addr_str, 0, "mac address"); snprintf(sc->pci_link_str, sizeof(sc->pci_link_str), "%s x%d", @@ -16258,12 +16258,12 @@ bxe_add_sysctls(struct bxe_softc *sc) "???GT/s"), sc->devinfo.pcie_link_width); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "pci_link", - CTLFLAG_RD, &sc->pci_link_str, 0, + CTLFLAG_RD, sc->pci_link_str, 0, "pci link status"); sc->debug = bxe_debug; - SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "debug", - CTLFLAG_RW, &sc->debug, 0, + SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "debug", + CTLFLAG_RW, &sc->debug, "debug logging mode"); sc->rx_budget = bxe_rx_budget; Modified: stable/10/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- stable/10/sys/dev/cxgb/cxgb_sge.c Mon Oct 27 12:18:07 2014 (r273735) +++ stable/10/sys/dev/cxgb/cxgb_sge.c Mon Oct 27 14:38:00 2014 (r273736) @@ -3370,7 +3370,7 @@ t3_add_attach_sysctls(adapter_t *sc) /* random information */ SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "firmware_version", - CTLFLAG_RD, &sc->fw_version, + CTLFLAG_RD, sc->fw_version, 0, "firmware version"); SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "hw_revision", @@ -3378,7 +3378,7 @@ t3_add_attach_sysctls(adapter_t *sc) 0, "chip model"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "port_types", - CTLFLAG_RD, &sc->port_types, + CTLFLAG_RD, sc->port_types, 0, "type of ports"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "enable_debug", @@ -3509,7 +3509,7 @@ t3_add_configured_sysctls(adapter_t *sc) SYSCTL_ADD_UINT(ctx, rspqpoidlist, OID_AUTO, "starved", CTLFLAG_RD, &qs->rspq.starved, 0, "#times starved"); - SYSCTL_ADD_ULONG(ctx, rspqpoidlist, OID_AUTO, "phys_addr", + SYSCTL_ADD_UAUTO(ctx, rspqpoidlist, OID_AUTO, "phys_addr", CTLFLAG_RD, &qs->rspq.phys_addr, "physical_address_of the queue"); SYSCTL_ADD_UINT(ctx, rspqpoidlist, OID_AUTO, "dump_start", @@ -3545,7 +3545,7 @@ t3_add_configured_sysctls(adapter_t *sc) SYSCTL_ADD_UINT(ctx, txqpoidlist, OID_AUTO, "in_use", CTLFLAG_RD, &txq->in_use, 0, "#tunneled packet slots in use"); - SYSCTL_ADD_ULONG(ctx, txqpoidlist, OID_AUTO, "frees", + SYSCTL_ADD_UQUAD(ctx, txqpoidlist, OID_AUTO, "frees", CTLFLAG_RD, &txq->txq_frees, "#tunneled packets freed"); SYSCTL_ADD_UINT(ctx, txqpoidlist, OID_AUTO, "skipped", @@ -3560,7 +3560,7 @@ t3_add_configured_sysctls(adapter_t *sc) SYSCTL_ADD_UINT(ctx, txqpoidlist, OID_AUTO, "stopped_flags", CTLFLAG_RD, &qs->txq_stopped, 0, "tx queues stopped"); - SYSCTL_ADD_ULONG(ctx, txqpoidlist, OID_AUTO, "phys_addr", + SYSCTL_ADD_UAUTO(ctx, txqpoidlist, OID_AUTO, "phys_addr", CTLFLAG_RD, &txq->phys_addr, "physical_address_of the queue"); SYSCTL_ADD_UINT(ctx, txqpoidlist, OID_AUTO, "qgen", Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Mon Oct 27 12:18:07 2014 (r273735) +++ stable/10/sys/dev/cxgbe/t4_main.c Mon Oct 27 14:38:00 2014 (r273736) @@ -4426,10 +4426,10 @@ t4_sysctls(struct adapter *sc) NULL, chip_rev(sc), "chip hardware revision"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "firmware_version", - CTLFLAG_RD, &sc->fw_version, 0, "firmware version"); + CTLFLAG_RD, sc->fw_version, 0, "firmware version"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "cf", - CTLFLAG_RD, &sc->cfg_file, 0, "configuration file"); + CTLFLAG_RD, sc->cfg_file, 0, "configuration file"); SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "cfcsum", CTLFLAG_RD, NULL, sc->cfcsum, "config file checksum"); Modified: stable/10/sys/dev/e1000/if_em.c ============================================================================== --- stable/10/sys/dev/e1000/if_em.c Mon Oct 27 12:18:07 2014 (r273735) +++ stable/10/sys/dev/e1000/if_em.c Mon Oct 27 14:38:00 2014 (r273736) @@ -5680,7 +5680,7 @@ em_set_sysctl_value(struct adapter *adap *limit = value; SYSCTL_ADD_INT(device_get_sysctl_ctx(adapter->dev), SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)), - OID_AUTO, name, CTLTYPE_INT|CTLFLAG_RW, limit, value, description); + OID_AUTO, name, CTLFLAG_RW, limit, value, description); } Modified: stable/10/sys/dev/e1000/if_igb.c ============================================================================== --- stable/10/sys/dev/e1000/if_igb.c Mon Oct 27 12:18:07 2014 (r273735) +++ stable/10/sys/dev/e1000/if_igb.c Mon Oct 27 14:38:00 2014 (r273736) @@ -5602,8 +5602,8 @@ igb_add_hw_stats(struct adapter *adapter char namebuf[QUEUE_NAME_LEN]; /* Driver Statistics */ - SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "link_irq", - CTLFLAG_RD, &adapter->link_irq, 0, + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "link_irq", + CTLFLAG_RD, &adapter->link_irq, "Link MSIX IRQ Handled"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "dropped", CTLFLAG_RD, &adapter->dropped_pkts, @@ -5652,17 +5652,17 @@ igb_add_hw_stats(struct adapter *adapter queue_list = SYSCTL_CHILDREN(queue_node); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "interrupt_rate", - CTLFLAG_RD, &adapter->queues[i], + CTLTYPE_UINT | CTLFLAG_RD, &adapter->queues[i], sizeof(&adapter->queues[i]), igb_sysctl_interrupt_rate_handler, "IU", "Interrupt Rate"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_head", - CTLFLAG_RD, adapter, E1000_TDH(txr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_TDH(txr->me), igb_sysctl_reg_handler, "IU", "Transmit Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_tail", - CTLFLAG_RD, adapter, E1000_TDT(txr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_TDT(txr->me), igb_sysctl_reg_handler, "IU", "Transmit Descriptor Tail"); SYSCTL_ADD_QUAD(ctx, queue_list, OID_AUTO, "no_desc_avail", @@ -5673,11 +5673,11 @@ igb_add_hw_stats(struct adapter *adapter "Queue Packets Transmitted"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_head", - CTLFLAG_RD, adapter, E1000_RDH(rxr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_RDH(rxr->me), igb_sysctl_reg_handler, "IU", "Receive Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_tail", - CTLFLAG_RD, adapter, E1000_RDT(rxr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_RDT(rxr->me), igb_sysctl_reg_handler, "IU", "Receive Descriptor Tail"); SYSCTL_ADD_QUAD(ctx, queue_list, OID_AUTO, "rx_packets", @@ -6027,7 +6027,7 @@ igb_set_sysctl_value(struct adapter *ada *limit = value; SYSCTL_ADD_INT(device_get_sysctl_ctx(adapter->dev), *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 15:33:44 2014 Return-Path: Delivered-To: svn-src-all@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 E22A65A4; Mon, 27 Oct 2014 15:33: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 CDD8C836; Mon, 27 Oct 2014 15:33: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 s9RFXiDj031297; Mon, 27 Oct 2014 15:33:44 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RFXims031296; Mon, 27 Oct 2014 15:33:44 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201410271533.s9RFXims031296@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 27 Oct 2014 15:33:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273737 - head/usr.sbin/pmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 15:33:45 -0000 Author: bapt Date: Mon Oct 27 15:33:44 2014 New Revision: 273737 URL: https://svnweb.freebsd.org/changeset/base/273737 Log: Clarify the documentation of pmcstat: the -d argument should be passed before -p, -s, -P or -S to be taken in account Differential Revision: https://reviews.freebsd.org/D1011 Reviewed by: adrian, gnn MFC after: 1 week Modified: head/usr.sbin/pmcstat/pmcstat.8 Modified: head/usr.sbin/pmcstat/pmcstat.8 ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.8 Mon Oct 27 14:38:00 2014 (r273736) +++ head/usr.sbin/pmcstat/pmcstat.8 Mon Oct 27 15:33:44 2014 (r273737) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2014 +.Dd Oct 27, 2014 .Dt PMCSTAT 8 .Os .Sh NAME @@ -254,6 +254,13 @@ Toggle between process mode PMCs measuri process' current and future children or only measuring events for the target process. The default is to measure events for the target process alone. +(it has to be passed in the command line prior to +.Fl p , +.Fl s , +.Fl P , +or +.Fl S +). .It Fl f Ar pluginopt Pass option string to the active plugin. .br From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 15:40:03 2014 Return-Path: Delivered-To: svn-src-all@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 A15A486D; Mon, 27 Oct 2014 15:40: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 2E27D89D; Mon, 27 Oct 2014 15:40:03 +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 s9RFdvsk015082 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 27 Oct 2014 17:39:57 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s9RFdvsk015082 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s9RFdvnP015081; Mon, 27 Oct 2014 17:39:57 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 27 Oct 2014 17:39:57 +0200 From: Konstantin Belousov To: Kurt Jaeger Subject: Re: svn commit: r273734 - head/bin/dd Message-ID: <20141027153957.GZ1877@kib.kiev.ua> References: <201410271138.s9RBcHrA002447@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201410271138.s9RBcHrA002447@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 15:40:03 -0000 On Mon, Oct 27, 2014 at 11:38:17AM +0000, Kurt Jaeger wrote: > Author: pi (ports committer) > Date: Mon Oct 27 11:38:17 2014 > New Revision: 273734 > URL: https://svnweb.freebsd.org/changeset/base/273734 > > Log: > bin/dd: Fix incorrect casting of arguments This causes non-trivial amount of errors like cc1: warnings being treated as errors /scratch/tmp/kib/src/bin/dd/args.c: In function 'f_bs': /scratch/tmp/kib/src/bin/dd/args.c:192: warning: format '%jd' expects type 'intm ax_t', but argument 3 has type 'int' (this is on arm). From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 15:45:38 2014 Return-Path: Delivered-To: svn-src-all@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 7A7BAB21; Mon, 27 Oct 2014 15:45: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 665E596C; Mon, 27 Oct 2014 15:45: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 s9RFjcdF036374; Mon, 27 Oct 2014 15:45:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RFjcem036373; Mon, 27 Oct 2014 15:45:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201410271545.s9RFjcem036373@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 27 Oct 2014 15:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273738 - head/share/man/man3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 15:45:38 -0000 Author: jhb Date: Mon Oct 27 15:45:37 2014 New Revision: 273738 URL: https://svnweb.freebsd.org/changeset/base/273738 Log: Correct a typo: this is the manpage for pthread_cleanup_pop, not push. Submitted by: ian Modified: head/share/man/man3/pthread_cleanup_pop.3 Modified: head/share/man/man3/pthread_cleanup_pop.3 ============================================================================== --- head/share/man/man3/pthread_cleanup_pop.3 Mon Oct 27 15:33:44 2014 (r273737) +++ head/share/man/man3/pthread_cleanup_pop.3 Mon Oct 27 15:45:37 2014 (r273738) @@ -52,7 +52,7 @@ then does nothing. .Pp The -.Fn pthread_cleanup_push +.Fn pthread_cleanup_pop function is implemented as a macro that closes a block. Invocations of this function must appear as standalone statements that are paired with an earlier call of From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 15:46:03 2014 Return-Path: Delivered-To: svn-src-all@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 34035C91; Mon, 27 Oct 2014 15:46:03 +0000 (UTC) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) (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 0B9DF97A; Mon, 27 Oct 2014 15:46:02 +0000 (UTC) Received: from [209.211.73.8] (port=39658 helo=[172.16.19.1]) by vps.hungerhost.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82) (envelope-from ) id 1XimUX-0001eM-IQ; Mon, 27 Oct 2014 11:45:59 -0400 From: "George Neville-Neil" To: "Hans Petter Selasky" Subject: Re: svn commit: r273733 - head/sys/netinet/cc Date: Mon, 27 Oct 2014 11:45:46 -0400 Message-ID: <4CE45B86-9B99-439D-B4BF-1AC61F4B78BB@neville-neil.com> In-Reply-To: <201410271121.s9RBLmOv095539@svn.freebsd.org> References: <201410271121.s9RBLmOv095539@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Mailer: MailMate (1.8r4576) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 15:46:03 -0000 Can you modify this to preserve the limitation of TCP_CA_NAME_MAX ? Best, George On 27 Oct 2014, at 7:21, Hans Petter Selasky wrote: > Author: hselasky > Date: Mon Oct 27 11:21:47 2014 > New Revision: 273733 > URL: https://svnweb.freebsd.org/changeset/base/273733 > > Log: > Make assignments to "net.inet.tcp.cc.algorithm" work by fixing a bad > string comparison. > > MFC after: 3 days > Reported by: Jukka Ukkonen > Sponsored by: Mellanox Technologies > > Modified: > head/sys/netinet/cc/cc.c > > Modified: head/sys/netinet/cc/cc.c > ============================================================================== > --- head/sys/netinet/cc/cc.c Mon Oct 27 10:34:09 2014 (r273732) > +++ head/sys/netinet/cc/cc.c Mon Oct 27 11:21:47 2014 (r273733) > @@ -106,11 +106,13 @@ cc_default_algo(SYSCTL_HANDLER_ARGS) > /* Find algo with specified name and set it to default. */ > CC_LIST_RLOCK(); > STAILQ_FOREACH(funcs, &cc_list, entries) { > - if (strncmp((char *)req->newptr, funcs->name, > - TCP_CA_NAME_MAX) == 0) { > - found = 1; > - V_default_cc_ptr = funcs; > - } > + /* NOTE: "newptr" is not zero terminated */ > + if (req->newlen != strlen(funcs->name)) > + continue; > + if (bcmp(req->newptr, funcs->name, req->newlen)) > + continue; > + found = 1; > + V_default_cc_ptr = funcs; > } > CC_LIST_RUNLOCK(); From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 15:50:47 2014 Return-Path: Delivered-To: svn-src-all@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 D45CAD6; Mon, 27 Oct 2014 15: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 C074A9B9; Mon, 27 Oct 2014 15: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 s9RFol0Q038487; Mon, 27 Oct 2014 15:50:47 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RFolnI038486; Mon, 27 Oct 2014 15:50:47 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201410271550.s9RFolnI038486@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 27 Oct 2014 15:50:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273739 - head/usr.sbin/pmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 15:50:47 -0000 Author: bapt Date: Mon Oct 27 15:50:47 2014 New Revision: 273739 URL: https://svnweb.freebsd.org/changeset/base/273739 Log: Fix rendering Submitted by: brueffer Modified: head/usr.sbin/pmcstat/pmcstat.8 Modified: head/usr.sbin/pmcstat/pmcstat.8 ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.8 Mon Oct 27 15:45:37 2014 (r273738) +++ head/usr.sbin/pmcstat/pmcstat.8 Mon Oct 27 15:50:47 2014 (r273739) @@ -259,8 +259,7 @@ The default is to measure events for the .Fl s , .Fl P , or -.Fl S -). +.Fl S ) . .It Fl f Ar pluginopt Pass option string to the active plugin. .br From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 15:54:33 2014 Return-Path: Delivered-To: svn-src-all@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 E46622AB; Mon, 27 Oct 2014 15:54:33 +0000 (UTC) Received: from f10.opsec.eu (f10.opsec.eu [IPv6:2001:14f8:200:4::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 9EF0DA75; Mon, 27 Oct 2014 15:54:33 +0000 (UTC) Received: from pi by f10.opsec.eu with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1Ximcl-0003nG-N9; Mon, 27 Oct 2014 16:54:27 +0100 Date: Mon, 27 Oct 2014 16:54:27 +0100 From: Kurt Jaeger To: Konstantin Belousov Subject: Re: svn commit: r273734 - head/bin/dd Message-ID: <20141027155427.GM1492@f10.opsec.eu> References: <201410271138.s9RBcHrA002447@svn.freebsd.org> <20141027153957.GZ1877@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141027153957.GZ1877@kib.kiev.ua> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Kurt Jaeger X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 15:54:34 -0000 > On Mon, Oct 27, 2014 at 11:38:17AM +0000, Kurt Jaeger wrote: > > Author: pi (ports committer) > > Date: Mon Oct 27 11:38:17 2014 > > New Revision: 273734 > > URL: https://svnweb.freebsd.org/changeset/base/273734 > > > > Log: > > bin/dd: Fix incorrect casting of arguments > This causes non-trivial amount of errors like > > cc1: warnings being treated as errors > /scratch/tmp/kib/src/bin/dd/args.c: In function 'f_bs': > /scratch/tmp/kib/src/bin/dd/args.c:192: warning: format '%jd' expects type 'intm > ax_t', but argument 3 has type 'int' > > (this is on arm). Thanks for the pointer. I'll take it up with the submitter. I do not have a working arm setup right now. -- pi@FreeBSD.org +49 171 3101372 6 years to go ! From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 16:03:59 2014 Return-Path: Delivered-To: svn-src-all@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 C0ED67A3; Mon, 27 Oct 2014 16:03:59 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 820B7BBC; Mon, 27 Oct 2014 16:03:59 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id DA5CD1043210; Tue, 28 Oct 2014 03:03:57 +1100 (AEDT) Date: Tue, 28 Oct 2014 03:03:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov Subject: Re: svn commit: r273734 - head/bin/dd In-Reply-To: <20141027153957.GZ1877@kib.kiev.ua> Message-ID: <20141028024954.L2501@besplex.bde.org> References: <201410271138.s9RBcHrA002447@svn.freebsd.org> <20141027153957.GZ1877@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=dMCfxopb c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=RjzIgjlDYm5_AU5-cgkA:9 a=vx3u5fnQNF83gsCp:21 a=_J6P8AWba1TwnPjU:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Kurt Jaeger X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 16:03:59 -0000 On Mon, 27 Oct 2014, Konstantin Belousov wrote: > On Mon, Oct 27, 2014 at 11:38:17AM +0000, Kurt Jaeger wrote: >> Log: >> bin/dd: Fix incorrect casting of arguments > This causes non-trivial amount of errors like > > cc1: warnings being treated as errors > /scratch/tmp/kib/src/bin/dd/args.c: In function 'f_bs': > /scratch/tmp/kib/src/bin/dd/args.c:192: warning: format '%jd' expects type 'intm > ax_t', but argument 3 has type 'int' > > (this is on arm). Sigh. I noticed that half the changes were to break correct casting, but thought that the errors were not detected on any supported arch (since the patch wouldn't have passed review if they were). Actually, they are detected on all 32-bit arches (since 32-bit SSIZE_MAX is incompatible with 64-bit intmax_t). Further examination of the history: in green's big patch that fixed most of the arg checking, or at least in its MFC, there is this breakage: % Index: args.c % =================================================================== % RCS file: /home/ncvs/src/bin/dd/args.c,v % retrieving revision 1.13.2.2 % retrieving revision 1.13.2.3 % diff -u -2 -r1.13.2.2 -r1.13.2.3 % --- args.c 29 Aug 1999 14:12:07 -0000 1.13.2.2 % +++ args.c 12 Dec 1999 01:54:03 -0000 1.13.2.3 % ... % @@ -207,7 +208,9 @@ % { % % - cpy_cnt = (u_int)get_bsz(arg); % - if (!cpy_cnt) % - terminate(0); % + cpy_cnt = get_num(arg); % + if (cpy_cnt < 0) % + errx(1, "count cannot be negative"); % + if (cpy_cnt == 0) % + cpy_cnt = -1; % } % % @@ -217,5 +220,7 @@ % { % % - files_cnt = (int)get_bsz(arg); % + files_cnt = get_num(arg); % + if (files_cnt < 1) % + errx(1, "files must be between 1 and %qd", QUAD_MAX); % } % The magic -1 wasn't in previous versions. It is just some hack to recover the previous behaviour. My version doesn't have it, but uses essentially the old code with no range checking but the type expanded to uintmax_t. All uintmax_t values are valid counts. The correct range checking is already in get_num(). I also removed the special case for cpuy_cnt = 0. I think it means no limit in my version. This is more useful than immediate termination. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 16:06:53 2014 Return-Path: Delivered-To: svn-src-all@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 123AA93B; Mon, 27 Oct 2014 16:06:53 +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 87D79BE6; Mon, 27 Oct 2014 16:06:52 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 3358BD433DE; Tue, 28 Oct 2014 02:45:12 +1100 (AEDT) Date: Tue, 28 Oct 2014 02:45:04 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kurt Jaeger Subject: Re: svn commit: r273734 - head/bin/dd In-Reply-To: <201410271138.s9RBcHrA002447@svn.freebsd.org> Message-ID: <20141028005225.S2013@besplex.bde.org> References: <201410271138.s9RBcHrA002447@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=dMCfxopb c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=qKvkKEtZAAAA:8 a=CyJx2C2pdSMWXbW4vZwA:9 a=irJhU9xJ9eRPbFF4:21 a=CSi6hEsHd1jE7GJe:21 a=-0KXm9qgDs5jN3Rh:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 16:06:53 -0000 On Mon, 27 Oct 2014, Kurt Jaeger wrote: > Log: > bin/dd: Fix incorrect casting of arguments > > dd(1) casts many of its numeric arguments from uintmax_t to intmax_t > and back again to detect whether or not the original arguments were > negative. This caused wrong behaviour in some boundary cases: > > $ dd if=/dev/zero of=/dev/null count=18446744073709551615 > dd: count cannot be negative > > After the fix: > > $ dd if=/dev/zero of=/dev/null count=18446744073709551615 > dd: count: Result too large Both of these work correctly in my version (with a relatively small patch and no breakage of other cases). (I actually typed large values as -1 and 11111111111111111111111111. -1 means (uintmax_t)-1 although this is undocumented and now broken). > > PR: 191263 > Submitted by: will@worrbase.com > Approved by: cognet@ I couldn't review the PR since I bugzilla doesn't accept mail responses. I didn't fear it was so bad. > Modified: head/bin/dd/args.c > ============================================================================== > --- head/bin/dd/args.c Mon Oct 27 11:21:47 2014 (r273733) > +++ head/bin/dd/args.c Mon Oct 27 11:38:17 2014 (r273734) > @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); > > #include > > +#include > #include > #include > #include > @@ -171,8 +172,7 @@ jcl(char **argv) > */ > if (in.offset > OFF_MAX / (ssize_t)in.dbsz || > out.offset > OFF_MAX / (ssize_t)out.dbsz) > - errx(1, "seek offsets cannot be larger than %jd", > - (intmax_t)OFF_MAX); > + errx(1, "seek offsets cannot be larger than %jd", OFF_MAX); > } This used to be correct. Now it assumes that off_t == intmax_t. Both just happen to be int64_t. This will break when intmax_t is expanded (off_t is unlikely to be expanded). The bug would be detected at compile time now if the type of intmax_t had maximal rank (long long) but int64_t and off_t remain as long on 64-bit arches. C99 doesn't seem to require intmax_t to have maximal rank. This seems to be a bug in C99, but FreeBSD exploits it to avoid using the long long abomination on 6 4-bit arches. > > static int > @@ -186,37 +186,30 @@ c_arg(const void *a, const void *b) > static void > f_bs(char *arg) > { > - uintmax_t res; > > - res = get_num(arg); This used to be correct. Though I don't like unsigned types, the API of read() and write() encourages use of size_t instead of ssize_t for buffer sizes. That was done, but a limit of SSIZE_MAX was applied, partly to avoid problems detecting errors from read() and write() and partly to distinguish overflowing cases. get_num() returns an unsigned type (uintmax_t), so it is suitable for handling the size_t args here. It was used. However, size_t might be smaller than uintmax_t, so it cannot always hold the result of get_num(). So a temporary variable was used to hold the value before checking it. > - if (res < 1 || res > SSIZE_MAX) > - errx(1, "bs must be between 1 and %jd", (intmax_t)SSIZE_MAX); get_num() returns UINTMAX_MAX if the result is too large. This may or may not be an error. But in all arches, UINTMAX_MAX exceeds SSIZE_MAX, so the overflowing case gives the same error as a non-overflowing but too large value. > - in.dbsz = out.dbsz = (size_t)res; > + in.dbsz = out.dbsz = get_num(arg); This breaks the error checking. Blind assignment may corrupt the value before it can be checked. > + if (out.dbsz < 1 || out.dbsz > SSIZE_MAX) > + errx(1, "bs must be between 1 and %jd", SSIZE_MAX); > } Printf format error, as above. > > static void > f_cbs(char *arg) > { > - uintmax_t res; > > - res = get_num(arg); > - if (res < 1 || res > SSIZE_MAX) > - errx(1, "cbs must be between 1 and %jd", (intmax_t)SSIZE_MAX); > - cbsz = (size_t)res; > + cbsz = get_num(arg); > + if (cbsz < 1 || cbsz > SSIZE_MAX) > + errx(1, "cbs must be between 1 and %jd", SSIZE_MAX); > } This just breaks the range checking and the printf format, as above. > > static void > f_count(char *arg) > { > - intmax_t res; > > - res = (intmax_t)get_num(arg); > - if (res < 0) > - errx(1, "count cannot be negative"); This was correct too. Though get_num() returns an unsigned type, it is based on strtoul() which handles negative values as correctly as possible. (The multipliers in get_num() don't handle negative values as correctly as possible.) dd also has a get_off_t() function. This is supposed to handle negative values more carefully, but is so badly implemented that it has many more bugs than blindly casting get_num() to off_t. The above cast is safer since it converts to the signed type corresponding to the return type. In 2's complement, the result is predictable and correct except in unrepresentable cases. E.g., an arg of -1 is returned as UINTMAX_MAX and casting it gives -1 again. My version implements get_off_t() using get_num(). Of course it doesn't blindly convert to an off_t. If does range checking on the uintmax_t before converting: @ static off_t @ get_off_t(const char *val) @ { @ uintmax_t num; @ @ num = get_num(val); @ if (num != (uintmax_t)(off_t)num) @ errx(1, "%s: offset too large", oper); @ return ((off_t)num); @ } > - if (res == 0) > - cpy_cnt = (uintmax_t)-1; > - else > - cpy_cnt = (uintmax_t)res; This function doesn't want an off_t variable, so get_off_t() is unuable for it. Though I don't like unsigned types, it is natural for this one to use one, and this helps avoid proliferation of conversion functions. So I changed the variable type to uintmax_t so that get_num() can be used directly. I also removed the magic -1 case and fixed the broken count = 0 case. A count of 0 should mean 0. Actually, the variable type was already uintmax_t, so using intmax_t and -1 here is more garbage magic than might first appear. I use the following patches for bogus counting (relative to an old version, and possibly not all enclosed here): @diff -u2 args.c~ args.c @--- args.c~ Wed Apr 7 20:20:58 2004 @+++ args.c Wed Apr 7 20:20:59 2004 @@@ -204,13 +206,10 @@ @ f_count(char *arg) @ { @- intmax_t res; @ @- res = (intmax_t)get_num(arg); @- if (res < 0) @- errx(1, "count cannot be negative"); @- if (res == 0) @- cpy_cnt = (uintmax_t)-1; @- else @- cpy_cnt = (uintmax_t)res; @+ cpy_cnt = get_num(arg); @+#if 0 @+ if (cpy_cnt == 0) @+ terminate(0); @+#endif @ } @ @@@ -220,6 +219,4 @@ @ @ files_cnt = get_num(arg); @- if (files_cnt < 1) @- errx(1, "files must be between 1 and %jd", (uintmax_t)-1); @ } @ @diff -u2 dd.c~ dd.c @--- dd.c~ Wed Apr 7 20:20:48 2004 @+++ dd.c Wed Apr 7 20:20:49 2004 @@@ -272,14 +267,6 @@ @ @ for (;;) { @- switch (cpy_cnt) { @- case -1: /* count=0 was specified */ @+ if (cpy_cnt != 0 && st.in_full + st.in_part >= cpy_cnt) @ return; @- case 0: @- break; @- default: @- if (st.in_full + st.in_part >= (uintmax_t)cpy_cnt) @- return; @- break; @- } @ @ /* > + cpy_cnt = get_num(arg); Seems to be correct. > + if (cpy_cnt == SIZE_MAX) > + errc(1, ERANGE, "%s", oper); Bogus. Counts aren't sizes, and no useful restriction on the count can prevent total counts overflowing. Only the non-useful restriction to counts of 0 and 1 prevents overflow. Counts of 2 to sizes of near the maximum to add up to almost twice the maximum. > + if (cpy_cnt == 0) > + cpy_cnt = -1; > } Bogus. -1 really means UINTMAX_MAX (at least, that is what it becomes in cpy_cnt). On 64-bit arches, SIZE_MAX has the same value and the previous check keeps that value as magic. On 32-bit arches, it doesn't even do that. > > static void > @@ -225,7 +218,7 @@ f_files(char *arg) > > files_cnt = get_num(arg); > if (files_cnt < 1) > - errx(1, "files must be between 1 and %jd", (uintmax_t)-1); > + errx(1, "files must be between 1 and %ju", SIZE_MAX); > } The usual printf format error. > > static void > @@ -241,14 +234,11 @@ f_fillchar(char *arg) > static void > f_ibs(char *arg) > { > - uintmax_t res; > > if (!(ddflags & C_BS)) { > - res = get_num(arg); > - if (res < 1 || res > SSIZE_MAX) > - errx(1, "ibs must be between 1 and %jd", > - (intmax_t)SSIZE_MAX); > - in.dbsz = (size_t)res; > + in.dbsz = get_num(arg); > + if (in.dbsz < 1 || in.dbsz > SSIZE_MAX) > + errx(1, "ibs must be between 1 and %ju", SSIZE_MAX); > } > } The usual range checking errors. More than the usual printf format error. SSIZE_MAX has a signed type, but is now printed using an unsigned format. > > @@ -262,14 +252,11 @@ f_if(char *arg) > static void > f_obs(char *arg) > { > - uintmax_t res; > > if (!(ddflags & C_BS)) { > - res = get_num(arg); > - if (res < 1 || res > SSIZE_MAX) > - errx(1, "obs must be between 1 and %jd", > - (intmax_t)SSIZE_MAX); > - out.dbsz = (size_t)res; > + out.dbsz = get_num(arg); > + if (out.dbsz < 1 || out.dbsz > SSIZE_MAX) > + errx(1, "obs must be between 1 and %jd", SSIZE_MAX); > } > } The usual range checking errors. The usual printf format error. > > @@ -378,11 +365,17 @@ get_num(const char *val) > uintmax_t num, mult, prevnum; > char *expr; > > + while (isspace(val[0])) isspace() is undefined on negative characters. > + val++; > + Style bug (extra blank line). > + if (val[0] == '-') > + errx(1, "%s: cannot be negative", oper); There is no particular reason to enforce this. It breaks using get_num() to implement get_off_t(). Any check like this should be external to the function. I don't know of any useful useful use of negative numbers in dd, but I want get_num() to be more generally useful, and used. It can easily handle negative args but either it or the caller would need a sign check like the above to determine if the unsigned result actually is just a representation of a signed result. There is only an ambiguity for signed results above INTMAX_MAX. Another interesting case is an arg of -1*-1. get_num() allowed both the -1's, but turned them into UINTMAX_MAX. The overflow checking is too careful, so -1*-1 is rejected as overflow instead of giving 1. > + More of this style bug. > errno = 0; > - num = strtouq(val, &expr, 0); > + num = strtoull(val, &expr, 0); get_num() returns uintmax_t, but still used strtouq() internally. This changes it to use a loing long abomination instead of the correct function strtoumax(). My fixes for get_num() are relatively small: patch relative to an old version: @ @@ -334,5 +331,5 @@ @ } @ @ -/* @ +/*- @ * Convert an expression of the following forms to a uintmax_t. @ * 1) A positive decimal number. @ @@ -341,6 +338,6 @@ @ * 4) A positive decimal number followed by a m (mult by 1 << 20). @ * 5) A positive decimal number followed by a g (mult by 1 << 30). @ - * 5) A positive decimal number followed by a w (mult by sizeof int). @ - * 6) Two or more positive decimal numbers (with/without [bkmgw]) @ + * 6) A positive decimal number followed by a w (mult by sizeof int). @ + * 7) Two or more positive decimal numbers (with/without [bkmgw]) @ * separated by x (also * for backwards compatibility), specifying @ * the product of the indicated values. I didn't fix the spammed error in the comment. The errors start with "positive". This function accepts negative numbers and returns them as positive numbers. Except this commit breaks that. The errors continue with "decimal". This function actually takes decimal, octal or hexadecimal numbers... @ @@ -349,13 +346,12 @@ @ get_num(const char *val) @ { @ - uintmax_t num, mult, prevnum; @ + uintmax_t mult, num, prevnum; @ char *expr; @ @ errno = 0; @ - num = strtouq(val, &expr, 0); @ - if (errno != 0) /* Overflow or underflow. */ @ + num = strtoumax(val, &expr, 0); @ + if (errno == ERANGE) /* Overflow. */ "Underflow" can only occur for FP expressions. It is not going negative. @ err(1, "%s", oper); @ - @ - if (expr == val) /* No valid digits. */ @ + if (expr == val) /* No digits. */ @ errx(1, "%s: illegal numeric value", oper); @ @ @@ -369,8 +365,8 @@ @ break; @ case 'm': @ - mult = 1 << 20; @ + mult = 1UL << 20; @ break; Don't assume 32-bit ints. @ case 'g': @ - mult = 1 << 30; @ + mult = 1UL << 30; @ break; @ case 'w': @ @@ -378,7 +374,6 @@ @ break; @ default: @ - ; @ + break; @ } @ - @ if (mult != 0) { @ prevnum = num; @ > Modified: head/bin/dd/conv.c > ============================================================================== > --- head/bin/dd/conv.c Mon Oct 27 11:21:47 2014 (r273733) > +++ head/bin/dd/conv.c Mon Oct 27 11:38:17 2014 (r273734) > @@ -133,7 +133,7 @@ block(void) > */ > ch = 0; > for (inp = in.dbp - in.dbcnt, outp = out.dbp; in.dbcnt;) { > - maxlen = MIN(cbsz, in.dbcnt); > + maxlen = MIN(cbsz, (size_t)in.dbcnt); > if ((t = ctab) != NULL) > for (cnt = 0; cnt < maxlen && (ch = *inp++) != '\n'; > ++cnt) > @@ -146,7 +146,7 @@ block(void) > * Check for short record without a newline. Reassemble the > * input block. > */ > - if (ch != '\n' && in.dbcnt < cbsz) { > + if (ch != '\n' && (size_t)in.dbcnt < cbsz) { > (void)memmove(in.db, in.dbp - in.dbcnt, in.dbcnt); > break; > } Now you need casts to recover from changing the mixture of unsigned and signed types. If some block size variables are signed, then all should be, but cbsz is still size_t. > @@ -228,7 +228,7 @@ unblock(void) > * translation has to already be done or we might not recognize the > * spaces. > */ > - for (inp = in.db; in.dbcnt >= cbsz; inp += cbsz, in.dbcnt -= cbsz) { > + for (inp = in.db; (size_t)in.dbcnt >= cbsz; inp += cbsz, in.dbcnt -= cbsz) { > for (t = inp + cbsz - 1; t >= inp && *t == ' '; --t) > ; > if (t >= inp) { > The excessive casts give 2 more style bugs here (expannsion of the line beyond 80 columns and no re-wrapping to fix this). > Modified: head/bin/dd/dd.c [More type poisoning] > ... > Modified: head/bin/dd/dd.h > ============================================================================== > --- head/bin/dd/dd.h Mon Oct 27 11:21:47 2014 (r273733) > +++ head/bin/dd/dd.h Mon Oct 27 11:38:17 2014 (r273734) > @@ -38,10 +38,9 @@ > typedef struct { > u_char *db; /* buffer address */ > u_char *dbp; /* current buffer I/O address */ > - /* XXX ssize_t? */ ISTR asking the author of this comment to clean up some sign-related bugs. I didn't like the results. They including changing minor sign hacks to broken overflow handling in get_off_t(). > - size_t dbcnt; /* current buffer byte count */ > - size_t dbrcnt; /* last read byte count */ > - size_t dbsz; /* block size */ > + ssize_t dbcnt; /* current buffer byte count */ > + ssize_t dbrcnt; /* last read byte count */ > + ssize_t dbsz; /* block size */ > > #define ISCHR 0x01 /* character device (warn on short) */ > #define ISPIPE 0x02 /* pipe-like (see position.c) */ > @@ -57,13 +56,13 @@ typedef struct { > } IO; > > typedef struct { > - uintmax_t in_full; /* # of full input blocks */ > - uintmax_t in_part; /* # of partial input blocks */ > - uintmax_t out_full; /* # of full output blocks */ > - uintmax_t out_part; /* # of partial output blocks */ > - uintmax_t trunc; /* # of truncated records */ > - uintmax_t swab; /* # of odd-length swab blocks */ > - uintmax_t bytes; /* # of bytes written */ All of these were correct. Counters aren't related to sizes, and shouldn't be limited to 32 bits on 32-bit arches. Especally since they used to be 64 bits on 32-bit arches. They were only u_long in 4.4BSD, but went through several rounds of churning in 1999 to reach the above. > + size_t in_full; /* # of full input blocks */ > + size_t in_part; /* # of partial input blocks */ > + size_t out_full; /* # of full output blocks */ > + size_t out_part; /* # of partial output blocks */ > + size_t trunc; /* # of truncated records */ > + size_t swab; /* # of odd-length swab blocks */ > + size_t bytes; /* # of bytes written */ The byte count is most broken. Now it overflows on 32-bit arches after copying just 0.1% or a 4TB disk. > struct timespec start; /* start time of dd */ > } STAT; > > > Modified: head/bin/dd/position.c > ============================================================================== > --- head/bin/dd/position.c Mon Oct 27 11:21:47 2014 (r273733) > +++ head/bin/dd/position.c Mon Oct 27 11:38:17 2014 (r273734) > @@ -178,7 +178,7 @@ pos_out(void) > n = write(out.fd, out.db, out.dbsz); > if (n == -1) > err(1, "%s", out.name); > - if ((size_t)n != out.dbsz) > + if (n != out.dbsz) > errx(1, "%s: write failure", out.name); > } > break; This is about the only simplification that you get from using ssize_t for dbsz, etc. The values were restricted to SSIZE_MAX instead of to SIZE_MAX mainly so that the error checking can be simpler here (it is too simple to be correct -- dd is clueless about short i/o's). But the compiler doesn't know about the restriction, so might warn. The cast prevents that and expresses correctness of the conversion. This isn't really a simplification. Another compiler might warn about the implicit conversion of out.dbsz when passed to write() (since the compiler doesn't know that the value is >= 0). Then you would need a cast to prevent that and express the correctness of the conversion. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 16:08:07 2014 Return-Path: Delivered-To: svn-src-all@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 76613A8D; Mon, 27 Oct 2014 16:08:07 +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 02F3CBF6; Mon, 27 Oct 2014 16:08:06 +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 s9RG7xTV021729 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 27 Oct 2014 18:07:59 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s9RG7xTV021729 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s9RG7uJU021728; Mon, 27 Oct 2014 18:07:56 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 27 Oct 2014 18:07:56 +0200 From: Konstantin Belousov To: Kurt Jaeger Subject: Re: svn commit: r273734 - head/bin/dd Message-ID: <20141027160755.GA1877@kib.kiev.ua> References: <201410271138.s9RBcHrA002447@svn.freebsd.org> <20141027153957.GZ1877@kib.kiev.ua> <20141027155427.GM1492@f10.opsec.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141027155427.GM1492@f10.opsec.eu> 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 16:08:07 -0000 On Mon, Oct 27, 2014 at 04:54:27PM +0100, Kurt Jaeger wrote: > > On Mon, Oct 27, 2014 at 11:38:17AM +0000, Kurt Jaeger wrote: > > > Author: pi (ports committer) > > > Date: Mon Oct 27 11:38:17 2014 > > > New Revision: 273734 > > > URL: https://svnweb.freebsd.org/changeset/base/273734 > > > > > > Log: > > > bin/dd: Fix incorrect casting of arguments > > This causes non-trivial amount of errors like > > > > cc1: warnings being treated as errors > > /scratch/tmp/kib/src/bin/dd/args.c: In function 'f_bs': > > /scratch/tmp/kib/src/bin/dd/args.c:192: warning: format '%jd' expects type 'intm > > ax_t', but argument 3 has type 'int' > > > > (this is on arm). > > Thanks for the pointer. I'll take it up with the submitter. I do not > have a working arm setup right now. I do not have arm setup either. Errors for arm and mips (at least) are reported by make tinderbox. From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 16:08:42 2014 Return-Path: Delivered-To: svn-src-all@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 594D6C06; Mon, 27 Oct 2014 16:08: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 45117C05; Mon, 27 Oct 2014 16:08: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 s9RG8g4k046742; Mon, 27 Oct 2014 16:08:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RG8gxm046741; Mon, 27 Oct 2014 16:08:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410271608.s9RG8gxm046741@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 27 Oct 2014 16:08:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273740 - head/sys/netinet/cc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 16:08:42 -0000 Author: hselasky Date: Mon Oct 27 16:08:41 2014 New Revision: 273740 URL: https://svnweb.freebsd.org/changeset/base/273740 Log: Preserve limitation of "TCP_CA_NAME_MAX" when matching the algorithm name. MFC after: 3 days Suggested by: gnn @ Modified: head/sys/netinet/cc/cc.c Modified: head/sys/netinet/cc/cc.c ============================================================================== --- head/sys/netinet/cc/cc.c Mon Oct 27 15:50:47 2014 (r273739) +++ head/sys/netinet/cc/cc.c Mon Oct 27 16:08:41 2014 (r273740) @@ -107,7 +107,8 @@ cc_default_algo(SYSCTL_HANDLER_ARGS) CC_LIST_RLOCK(); STAILQ_FOREACH(funcs, &cc_list, entries) { /* NOTE: "newptr" is not zero terminated */ - if (req->newlen != strlen(funcs->name)) + if (req->newlen != strnlen(funcs->name, + TCP_CA_NAME_MAX - 1)) continue; if (bcmp(req->newptr, funcs->name, req->newlen)) continue; From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 16:09:37 2014 Return-Path: Delivered-To: svn-src-all@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 2A378D55; Mon, 27 Oct 2014 16:09:37 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (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 DD894C13; Mon, 27 Oct 2014 16:09:36 +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 0D8321FE024; Mon, 27 Oct 2014 17:09:33 +0100 (CET) Message-ID: <544E6E46.1020606@selasky.org> Date: Mon, 27 Oct 2014 17:09:42 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: George Neville-Neil Subject: Re: svn commit: r273733 - head/sys/netinet/cc References: <201410271121.s9RBLmOv095539@svn.freebsd.org> <4CE45B86-9B99-439D-B4BF-1AC61F4B78BB@neville-neil.com> In-Reply-To: <4CE45B86-9B99-439D-B4BF-1AC61F4B78BB@neville-neil.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 16:09:37 -0000 On 10/27/14 16:45, George Neville-Neil wrote: > Can you modify this to preserve the limitation of TCP_CA_NAME_MAX ? > > Best, > George > Can you verify the following change? Subtracted one character from the limit for the terminating zero: https://svnweb.freebsd.org/changeset/base/273740 --HPS From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 16:13:11 2014 Return-Path: Delivered-To: svn-src-all@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 C4832EF9; Mon, 27 Oct 2014 16:13:11 +0000 (UTC) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) (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 9B665CD6; Mon, 27 Oct 2014 16:13:11 +0000 (UTC) Received: from [209.211.73.8] (port=63642 helo=[172.16.19.1]) by vps.hungerhost.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82) (envelope-from ) id 1Ximus-0007cg-3Y; Mon, 27 Oct 2014 12:13:10 -0400 From: "George Neville-Neil" To: "Hans Petter Selasky" Subject: Re: svn commit: r273733 - head/sys/netinet/cc Date: Mon, 27 Oct 2014 12:12:59 -0400 Message-ID: <95CE0574-F804-458C-AAC4-4D168B7D7A3C@neville-neil.com> In-Reply-To: <544E6E46.1020606@selasky.org> References: <201410271121.s9RBLmOv095539@svn.freebsd.org> <4CE45B86-9B99-439D-B4BF-1AC61F4B78BB@neville-neil.com> <544E6E46.1020606@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Mailer: MailMate (1.8r4576) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 16:13:11 -0000 On 27 Oct 2014, at 12:09, Hans Petter Selasky wrote: > On 10/27/14 16:45, George Neville-Neil wrote: >> Can you modify this to preserve the limitation of TCP_CA_NAME_MAX ? >> >> Best, >> George >> > > Can you verify the following change? Subtracted one character from the > limit for the terminating zero: > > https://svnweb.freebsd.org/changeset/base/273740 > That looks right. Also, can you sign up for reviews.freebsd.org ? Besst, George From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 16:13:52 2014 Return-Path: Delivered-To: svn-src-all@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 6B274C8; Mon, 27 Oct 2014 16:13: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 56F16CDF; Mon, 27 Oct 2014 16:13: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 s9RGDqXL051033; Mon, 27 Oct 2014 16:13:52 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RGDqrm051032; Mon, 27 Oct 2014 16:13:52 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201410271613.s9RGDqrm051032@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 27 Oct 2014 16:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273741 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 16:13:52 -0000 Author: glebius Date: Mon Oct 27 16:13:51 2014 New Revision: 273741 URL: https://svnweb.freebsd.org/changeset/base/273741 Log: Tiny comment fixup. Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Mon Oct 27 16:08:41 2014 (r273740) +++ head/sys/sys/mbuf.h Mon Oct 27 16:13:51 2014 (r273741) @@ -393,7 +393,7 @@ void sf_ext_free(void *, void *); * Outbound flags that are set by upper protocol layers requesting lower * layers, or ideally the hardware, to perform these offloading tasks. * For outbound packets this field and its flags can be directly tested - * against if_data.ifi_hwassist. + * against ifnet if_hwassist. */ #define CSUM_IP 0x00000001 /* IP header checksum offload */ #define CSUM_IP_UDP 0x00000002 /* UDP checksum offload */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 16:15:16 2014 Return-Path: Delivered-To: svn-src-all@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 EB7DB393; Mon, 27 Oct 2014 16:15: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 CC5B1D0A; Mon, 27 Oct 2014 16:15: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 s9RGFFk3051318; Mon, 27 Oct 2014 16:15:15 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RGFF9A051317; Mon, 27 Oct 2014 16:15:15 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201410271615.s9RGFF9A051317@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 27 Oct 2014 16:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273742 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 16:15:16 -0000 Author: ae Date: Mon Oct 27 16:15:15 2014 New Revision: 273742 URL: https://svnweb.freebsd.org/changeset/base/273742 Log: Do not automatically install routes to link-local and interface-local multicast addresses. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Mon Oct 27 16:13:51 2014 (r273741) +++ head/sys/netinet6/in6.c Mon Oct 27 16:15:15 2014 (r273742) @@ -782,27 +782,24 @@ in6_update_ifa_join_mc(struct ifnet *ifp struct in6_ifaddr *ia, int flags, struct in6_multi **in6m_sol) { char ip6buf[INET6_ADDRSTRLEN]; - struct sockaddr_in6 mltaddr, mltmask; - struct in6_addr llsol; + struct in6_addr mltaddr; struct in6_multi_mship *imm; - struct rtentry *rt; int delay, error; KASSERT(in6m_sol != NULL, ("%s: in6m_sol is NULL", __func__)); /* Join solicited multicast addr for new host id. */ - bzero(&llsol, sizeof(struct in6_addr)); - llsol.s6_addr32[0] = IPV6_ADDR_INT32_MLL; - llsol.s6_addr32[1] = 0; - llsol.s6_addr32[2] = htonl(1); - llsol.s6_addr32[3] = ifra->ifra_addr.sin6_addr.s6_addr32[3]; - llsol.s6_addr8[12] = 0xff; - if ((error = in6_setscope(&llsol, ifp, NULL)) != 0) { + bzero(&mltaddr, sizeof(struct in6_addr)); + mltaddr.s6_addr32[0] = IPV6_ADDR_INT32_MLL; + mltaddr.s6_addr32[2] = htonl(1); + mltaddr.s6_addr32[3] = ifra->ifra_addr.sin6_addr.s6_addr32[3]; + mltaddr.s6_addr8[12] = 0xff; + if ((error = in6_setscope(&mltaddr, ifp, NULL)) != 0) { /* XXX: should not happen */ log(LOG_ERR, "%s: in6_setscope failed\n", __func__); goto cleanup; } - delay = 0; + delay = error = 0; if ((flags & IN6_IFAUPDATE_DADDELAY)) { /* * We need a random delay for DAD on the address being @@ -812,62 +809,28 @@ in6_update_ifa_join_mc(struct ifnet *ifp */ delay = arc4random() % (MAX_RTR_SOLICITATION_DELAY * hz); } - imm = in6_joingroup(ifp, &llsol, &error, delay); + imm = in6_joingroup(ifp, &mltaddr, &error, delay); if (imm == NULL) { - nd6log((LOG_WARNING, "%s: addmulti failed for %s on %s " - "(errno=%d)\n", __func__, ip6_sprintf(ip6buf, &llsol), + nd6log((LOG_WARNING, "%s: in6_joingroup failed for %s on %s " + "(errno=%d)\n", __func__, ip6_sprintf(ip6buf, &mltaddr), if_name(ifp), error)); goto cleanup; } LIST_INSERT_HEAD(&ia->ia6_memberships, imm, i6mm_chain); *in6m_sol = imm->i6mm_maddr; - bzero(&mltmask, sizeof(mltmask)); - mltmask.sin6_len = sizeof(struct sockaddr_in6); - mltmask.sin6_family = AF_INET6; - mltmask.sin6_addr = in6mask32; -#define MLTMASK_LEN 4 /* mltmask's masklen (=32bit=4octet) */ - /* * Join link-local all-nodes address. */ - bzero(&mltaddr, sizeof(mltaddr)); - mltaddr.sin6_len = sizeof(struct sockaddr_in6); - mltaddr.sin6_family = AF_INET6; - mltaddr.sin6_addr = in6addr_linklocal_allnodes; - if ((error = in6_setscope(&mltaddr.sin6_addr, ifp, NULL)) != 0) + mltaddr = in6addr_linklocal_allnodes; + if ((error = in6_setscope(&mltaddr, ifp, NULL)) != 0) goto cleanup; /* XXX: should not fail */ - /* - * XXX: do we really need this automatic routes? We should probably - * reconsider this stuff. Most applications actually do not need the - * routes, since they usually specify the outgoing interface. - */ - rt = in6_rtalloc1((struct sockaddr *)&mltaddr, 0, 0UL, RT_DEFAULT_FIB); - if (rt != NULL) { - /* XXX: only works in !SCOPEDROUTING case. */ - if (memcmp(&mltaddr.sin6_addr, - &((struct sockaddr_in6 *)rt_key(rt))->sin6_addr, - MLTMASK_LEN)) { - RTFREE_LOCKED(rt); - rt = NULL; - } - } - if (rt == NULL) { - error = in6_rtrequest(RTM_ADD, (struct sockaddr *)&mltaddr, - (struct sockaddr *)&ia->ia_addr, - (struct sockaddr *)&mltmask, RTF_UP, - (struct rtentry **)0, RT_DEFAULT_FIB); - if (error) - goto cleanup; - } else - RTFREE_LOCKED(rt); - - imm = in6_joingroup(ifp, &mltaddr.sin6_addr, &error, 0); + imm = in6_joingroup(ifp, &mltaddr, &error, 0); if (imm == NULL) { - nd6log((LOG_WARNING, "%s: addmulti failed for %s on %s " - "(errno=%d)\n", __func__, ip6_sprintf(ip6buf, - &mltaddr.sin6_addr), if_name(ifp), error)); + nd6log((LOG_WARNING, "%s: in6_joingroup failed for %s on %s " + "(errno=%d)\n", __func__, ip6_sprintf(ip6buf, &mltaddr), + if_name(ifp), error)); goto cleanup; } LIST_INSERT_HEAD(&ia->ia6_memberships, imm, i6mm_chain); @@ -883,24 +846,26 @@ in6_update_ifa_join_mc(struct ifnet *ifp */ delay = arc4random() % (MAX_RTR_SOLICITATION_DELAY * hz); } - if (in6_nigroup(ifp, NULL, -1, &mltaddr.sin6_addr) == 0) { + if (in6_nigroup(ifp, NULL, -1, &mltaddr) == 0) { /* XXX jinmei */ - imm = in6_joingroup(ifp, &mltaddr.sin6_addr, &error, delay); + imm = in6_joingroup(ifp, &mltaddr, &error, delay); if (imm == NULL) - nd6log((LOG_WARNING, "%s: addmulti failed for %s on %s " + nd6log((LOG_WARNING, + "%s: in6_joingroup failed for %s on %s " "(errno=%d)\n", __func__, ip6_sprintf(ip6buf, - &mltaddr.sin6_addr), if_name(ifp), error)); + &mltaddr), if_name(ifp), error)); /* XXX not very fatal, go on... */ else LIST_INSERT_HEAD(&ia->ia6_memberships, imm, i6mm_chain); } - if (V_icmp6_nodeinfo_oldmcprefix && - in6_nigroup_oldmcprefix(ifp, NULL, -1, &mltaddr.sin6_addr) == 0) { - imm = in6_joingroup(ifp, &mltaddr.sin6_addr, &error, delay); + if (V_icmp6_nodeinfo_oldmcprefix && + in6_nigroup_oldmcprefix(ifp, NULL, -1, &mltaddr) == 0) { + imm = in6_joingroup(ifp, &mltaddr, &error, delay); if (imm == NULL) - nd6log((LOG_WARNING, "%s: addmulti failed for %s on %s " + nd6log((LOG_WARNING, + "%s: in6_joingroup failed for %s on %s " "(errno=%d)\n", __func__, ip6_sprintf(ip6buf, - &mltaddr.sin6_addr), if_name(ifp), error)); + &mltaddr), if_name(ifp), error)); /* XXX not very fatal, go on... */ else LIST_INSERT_HEAD(&ia->ia6_memberships, imm, i6mm_chain); @@ -910,38 +875,18 @@ in6_update_ifa_join_mc(struct ifnet *ifp * Join interface-local all-nodes address. * (ff01::1%ifN, and ff01::%ifN/32) */ - mltaddr.sin6_addr = in6addr_nodelocal_allnodes; - if ((error = in6_setscope(&mltaddr.sin6_addr, ifp, NULL)) != 0) + mltaddr = in6addr_nodelocal_allnodes; + if ((error = in6_setscope(&mltaddr, ifp, NULL)) != 0) goto cleanup; /* XXX: should not fail */ - /* XXX: again, do we really need the route? */ - rt = in6_rtalloc1((struct sockaddr *)&mltaddr, 0, 0UL, RT_DEFAULT_FIB); - if (rt != NULL) { - if (memcmp(&mltaddr.sin6_addr, - &((struct sockaddr_in6 *)rt_key(rt))->sin6_addr, - MLTMASK_LEN)) { - RTFREE_LOCKED(rt); - rt = NULL; - } - } - if (rt == NULL) { - error = in6_rtrequest(RTM_ADD, (struct sockaddr *)&mltaddr, - (struct sockaddr *)&ia->ia_addr, - (struct sockaddr *)&mltmask, RTF_UP, - (struct rtentry **)0, RT_DEFAULT_FIB); - if (error) - goto cleanup; - } else - RTFREE_LOCKED(rt); - imm = in6_joingroup(ifp, &mltaddr.sin6_addr, &error, 0); + imm = in6_joingroup(ifp, &mltaddr, &error, 0); if (imm == NULL) { - nd6log((LOG_WARNING, "%s: addmulti failed for %s on %s " + nd6log((LOG_WARNING, "%s: in6_joingroup failed for %s on %s " "(errno=%d)\n", __func__, ip6_sprintf(ip6buf, - &mltaddr.sin6_addr), if_name(ifp), error)); + &mltaddr), if_name(ifp), error)); goto cleanup; } LIST_INSERT_HEAD(&ia->ia6_memberships, imm, i6mm_chain); -#undef MLTMASK_LEN cleanup: return (error); @@ -1343,135 +1288,17 @@ in6_broadcast_ifa(struct ifnet *ifp, str } /* - * Leave multicast groups. Factored out from in6_purgeaddr(). - * This entire work should only be done once, for the default FIB. + * Leave from multicast groups we have joined for the interface. */ static int in6_purgeaddr_mc(struct ifnet *ifp, struct in6_ifaddr *ia, struct ifaddr *ifa0) { - struct sockaddr_in6 mltaddr, mltmask; struct in6_multi_mship *imm; - struct rtentry *rt; - struct sockaddr_in6 sin6; - int error; - /* - * Leave from multicast groups we have joined for the interface. - */ while ((imm = LIST_FIRST(&ia->ia6_memberships)) != NULL) { LIST_REMOVE(imm, i6mm_chain); in6_leavegroup(imm); } - - /* - * Remove the link-local all-nodes address. - */ - bzero(&mltmask, sizeof(mltmask)); - mltmask.sin6_len = sizeof(struct sockaddr_in6); - mltmask.sin6_family = AF_INET6; - mltmask.sin6_addr = in6mask32; - - bzero(&mltaddr, sizeof(mltaddr)); - mltaddr.sin6_len = sizeof(struct sockaddr_in6); - mltaddr.sin6_family = AF_INET6; - mltaddr.sin6_addr = in6addr_linklocal_allnodes; - - if ((error = in6_setscope(&mltaddr.sin6_addr, ifp, NULL)) != 0) - return (error); - - /* - * As for the mltaddr above, proactively prepare the sin6 to avoid - * rtentry un- and re-locking. - */ - if (ifa0 != NULL) { - bzero(&sin6, sizeof(sin6)); - sin6.sin6_len = sizeof(sin6); - sin6.sin6_family = AF_INET6; - memcpy(&sin6.sin6_addr, &satosin6(ifa0->ifa_addr)->sin6_addr, - sizeof(sin6.sin6_addr)); - error = in6_setscope(&sin6.sin6_addr, ifa0->ifa_ifp, NULL); - if (error != 0) - return (error); - } - - rt = in6_rtalloc1((struct sockaddr *)&mltaddr, 0, 0UL, RT_DEFAULT_FIB); - if (rt != NULL && rt->rt_gateway != NULL && - (memcmp(&satosin6(rt->rt_gateway)->sin6_addr, - &ia->ia_addr.sin6_addr, - sizeof(ia->ia_addr.sin6_addr)) == 0)) { - /* - * If no more IPv6 address exists on this interface then - * remove the multicast address route. - */ - if (ifa0 == NULL) { - memcpy(&mltaddr.sin6_addr, - &satosin6(rt_key(rt))->sin6_addr, - sizeof(mltaddr.sin6_addr)); - RTFREE_LOCKED(rt); - error = in6_rtrequest(RTM_DELETE, - (struct sockaddr *)&mltaddr, - (struct sockaddr *)&ia->ia_addr, - (struct sockaddr *)&mltmask, RTF_UP, - (struct rtentry **)0, RT_DEFAULT_FIB); - if (error) - log(LOG_INFO, "%s: link-local all-nodes " - "multicast address deletion error\n", - __func__); - } else { - /* - * Replace the gateway of the route. - */ - memcpy(rt->rt_gateway, &sin6, sizeof(sin6)); - RTFREE_LOCKED(rt); - } - } else { - if (rt != NULL) - RTFREE_LOCKED(rt); - } - - /* - * Remove the node-local all-nodes address. - */ - mltaddr.sin6_addr = in6addr_nodelocal_allnodes; - if ((error = in6_setscope(&mltaddr.sin6_addr, ifp, NULL)) != 0) - return (error); - - rt = in6_rtalloc1((struct sockaddr *)&mltaddr, 0, 0UL, RT_DEFAULT_FIB); - if (rt != NULL && rt->rt_gateway != NULL && - (memcmp(&satosin6(rt->rt_gateway)->sin6_addr, - &ia->ia_addr.sin6_addr, - sizeof(ia->ia_addr.sin6_addr)) == 0)) { - /* - * If no more IPv6 address exists on this interface then - * remove the multicast address route. - */ - if (ifa0 == NULL) { - memcpy(&mltaddr.sin6_addr, - &satosin6(rt_key(rt))->sin6_addr, - sizeof(mltaddr.sin6_addr)); - - RTFREE_LOCKED(rt); - error = in6_rtrequest(RTM_DELETE, - (struct sockaddr *)&mltaddr, - (struct sockaddr *)&ia->ia_addr, - (struct sockaddr *)&mltmask, RTF_UP, - (struct rtentry **)0, RT_DEFAULT_FIB); - if (error) - log(LOG_INFO, "%s: node-local all-nodes" - "multicast address deletion error\n", - __func__); - } else { - /* - * Replace the gateway of the route. - */ - memcpy(rt->rt_gateway, &sin6, sizeof(sin6)); - RTFREE_LOCKED(rt); - } - } else { - if (rt != NULL) - RTFREE_LOCKED(rt); - } - return (0); } From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 16:20:39 2014 Return-Path: Delivered-To: svn-src-all@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 B71E8715; Mon, 27 Oct 2014 16:20:39 +0000 (UTC) Received: from f10.opsec.eu (f10.opsec.eu [IPv6:2001:14f8:200:4::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 70066D55; Mon, 27 Oct 2014 16:20:39 +0000 (UTC) Received: from pi by f10.opsec.eu with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1Xin22-0003p5-QK; Mon, 27 Oct 2014 17:20:34 +0100 Date: Mon, 27 Oct 2014 17:20:34 +0100 From: Kurt Jaeger To: Bruce Evans Subject: Re: svn commit: r273734 - head/bin/dd Message-ID: <20141027162034.GN1492@f10.opsec.eu> References: <201410271138.s9RBcHrA002447@svn.freebsd.org> <20141028005225.S2013@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141028005225.S2013@besplex.bde.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Kurt Jaeger X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 16:20:39 -0000 Hi! > > Log: > > bin/dd: Fix incorrect casting of arguments [...] > Both of these work correctly in my version (with a relatively small patch > and no breakage of other cases). (I actually typed large values as -1 > and 11111111111111111111111111. -1 means (uintmax_t)-1 although this > is undocumented and now broken). So, given this detailed review, should I revert the change ? -- pi@FreeBSD.org +49 171 3101372 6 years to go ! From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 16:29:21 2014 Return-Path: Delivered-To: svn-src-all@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 6E2EEC88; Mon, 27 Oct 2014 16:29:21 +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 43290E81; Mon, 27 Oct 2014 16:29:21 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 4B357B96E; Mon, 27 Oct 2014 12:29:20 -0400 (EDT) From: John Baldwin To: Warner Losh Subject: Re: svn commit: r273214 - in head/sys: amd64/vmm/intel modules/vmm Date: Mon, 27 Oct 2014 11:54:47 -0400 Message-ID: <1725598.2CCKLon8F3@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-PRERELEASE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201410171320.s9HDKo53045297@svn.freebsd.org> References: <201410171320.s9HDKo53045297@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, 27 Oct 2014 12:29:20 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 16:29:21 -0000 On Friday, October 17, 2014 01:20:50 PM Warner Losh wrote: > Author: imp > Date: Fri Oct 17 13:20:49 2014 > New Revision: 273214 > URL: https://svnweb.freebsd.org/changeset/base/273214 > > Log: > Fix build to not bogusly always rebuild vmm.ko. > > Rename vmx_assym.s to vmx_assym.h to reflect that file's actual use > and update vmx_support.S's include to match. Add vmx_assym.h to the > SRCS to that it gets properly added to the dependency list. Add > vmx_support.S to SRCS as well, so it gets built and needs fewer > special-case goo. Remove now-redundant special-case goo. Finally, > vmx_genassym.o doesn't need to depend on a hand expanded ${_ILINKS} > explicitly, that's all taken care of by beforedepend. > > With these items fixed, we no longer build vmm.ko every single time > through the modules on a KERNFAST build. So I cheered for this before, but it appears to be broken. :( Namely, I rebuilt world + kernel on my laptop this weekend (it was about a month old). My normal setup builds kernels with NO_KERNELCLEAN=yes. On my next reboot when I started a bhyve VM I promptly got a panic due to a page fault in this assembly code: /* * If 'vmx->eptgen[curcpu]' is not identical to 'pmap->pm_eptgen' * then we must invalidate all mappings associated with this EPTP. */ movq PM_EPTGEN(%r11), %r10 cmpq %r10, VMX_EPTGEN(%rsi, %rax, 8) je guest_restore (The 'cmpq' instruction) This change came to mind, so I blew away the 'vmm' module directory and rebuilt my kernel. Comparing the assembly of this instruction before and after used different values for VMX_EPTGEN. In other words, the NO_KERNELCLEAN=yes build failed to regenerate vmx_assym.h and the build used stale values. In particular, if you examine the generated .depend file, you will find that there are no dependencies recorded for vmx_genassym.o, so it is never rebuilt if any of the headers it includes are changed. In my case the panic happened to be one that was easily diagnosed, but I could imagine stale assym headers causing very odd crashes that would be quite hard to track down. I think these changes should be reverted if we can't fix the dependencies of the associated object files they are generated from. :( -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 16:29:22 2014 Return-Path: Delivered-To: svn-src-all@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 1FB42C8A; Mon, 27 Oct 2014 16:29: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 EC417E82; Mon, 27 Oct 2014 16:29:21 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id F0344B978; Mon, 27 Oct 2014 12:29:20 -0400 (EDT) From: John Baldwin To: Ian Lepore Subject: Re: svn commit: r273644 - head/share/man/man3 Date: Mon, 27 Oct 2014 11:45:45 -0400 Message-ID: <1571247.xrK7mpMDYa@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-PRERELEASE; KDE/4.14.2; amd64; ; ) In-Reply-To: <1414267896.12052.652.camel@revolution.hippie.lan> References: <201410251931.s9PJVYIk080552@svn.freebsd.org> <1414267896.12052.652.camel@revolution.hippie.lan> 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, 27 Oct 2014 12:29:21 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 16:29:22 -0000 On Saturday, October 25, 2014 02:11:36 PM Ian Lepore wrote: > On Sat, 2014-10-25 at 19:31 +0000, John Baldwin wrote: > > +.Pp > > +The > > +.Fn pthread_cleanup_push > > Should be pop? Doh, yes! -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 16:29:23 2014 Return-Path: Delivered-To: svn-src-all@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 38293D25; Mon, 27 Oct 2014 16:29: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 D5DCAE83; Mon, 27 Oct 2014 16:29:22 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E7A9AB9B1; Mon, 27 Oct 2014 12:29:21 -0400 (EDT) From: John Baldwin To: Mateusz Guzik Subject: Re: svn commit: r273401 - head/sys/kern Date: Mon, 27 Oct 2014 11:43:20 -0400 Message-ID: <5873867.B31rYEIzUD@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-PRERELEASE; KDE/4.14.2; amd64; ; ) In-Reply-To: <20141026015743.GE19066@dft-labs.eu> References: <201410211905.s9LJ5jDb032492@svn.freebsd.org> <201410231214.04027.jhb@freebsd.org> <20141026015743.GE19066@dft-labs.eu> 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, 27 Oct 2014 12:29:22 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 16:29:23 -0000 On Sunday, October 26, 2014 02:57:43 AM Mateusz Guzik wrote: > On Thu, Oct 23, 2014 at 12:14:03PM -0400, John Baldwin wrote: > I specifically added sysctl_lock/unlock so that next folk with similar > usecse will not have to. So I'm not going to remove it, but if you > really don't like it feel free to do it. However, if there isn't a future use case that needs it then it is just obfuscation. :-/ Given how static the sysctl code is in terms of API changes, etc. I strongly doubt there will be a future use case any time soon. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 16:36:53 2014 Return-Path: Delivered-To: svn-src-all@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 837E7645 for ; Mon, 27 Oct 2014 16:36:53 +0000 (UTC) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F806FA4 for ; Mon, 27 Oct 2014 16:36:53 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id rd3so5830132pab.13 for ; Mon, 27 Oct 2014 09:36:47 -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:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=JqHTlqcOYzjiGZVbOdD+2rX1ARJWDs2MJFdHTgHXmH4=; b=KWckzTJJ0eXyROSrqBDMslgnWSben6GbZGfew+wfwF9dwr1pIzJ0Ys/GCQeCGV0sl5 d1pL586uUzsAj8ag45aFI5D+0ZlXUHGUL3I+uH/Oz13ASvkKOVQs5Aufx7/BjuPj+U0a OzgjwJimGNvn/r9lV/my2iWMjsa+fBzCFX1LuHRhHfYRluXjGXUsOIn8AykarBm//4+/ UcMwRtCb5Z5zsoqscR8WT/BZCCo9PmZ3AcK6XgmKOINy0b3BkaUsUKcDhkMkcqBfamii ZvzC7Q02oA2fYjyQ4aeTD1h1Dn4oLJkqJ1JvVKIOoyQhLSjyxKgxOruNmFOQuZeTrBeu BFOw== X-Gm-Message-State: ALoCoQn6xV8nHsLmcepDU1Go+14J6Z1yu7XMdCcbecKqT8OBEOdxZhwFfA3BJWIrzZKkeO+VQhWh X-Received: by 10.68.88.195 with SMTP id bi3mr25500303pbb.118.1414427807057; Mon, 27 Oct 2014 09:36:47 -0700 (PDT) Received: from [10.64.24.233] (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id mx7sm9825273pdb.65.2014.10.27.09.36.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Oct 2014 09:36:46 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_25BDB42C-D6E2-4B9A-BDC5-8C8727B4CD4C"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r273214 - in head/sys: amd64/vmm/intel modules/vmm From: Warner Losh In-Reply-To: <1725598.2CCKLon8F3@ralph.baldwin.cx> Date: Mon, 27 Oct 2014 11:36:41 -0500 Message-Id: <2B7C3745-04E4-4FA9-A849-AECE54EA83A3@bsdimp.com> References: <201410171320.s9HDKo53045297@svn.freebsd.org> <1725598.2CCKLon8F3@ralph.baldwin.cx> To: John Baldwin X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 16:36:53 -0000 --Apple-Mail=_25BDB42C-D6E2-4B9A-BDC5-8C8727B4CD4C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Oct 27, 2014, at 10:54 AM, John Baldwin wrote: > On Friday, October 17, 2014 01:20:50 PM Warner Losh wrote: >> Author: imp >> Date: Fri Oct 17 13:20:49 2014 >> New Revision: 273214 >> URL: https://svnweb.freebsd.org/changeset/base/273214 >>=20 >> Log: >> Fix build to not bogusly always rebuild vmm.ko. >>=20 >> Rename vmx_assym.s to vmx_assym.h to reflect that file's actual use >> and update vmx_support.S's include to match. Add vmx_assym.h to the >> SRCS to that it gets properly added to the dependency list. Add >> vmx_support.S to SRCS as well, so it gets built and needs fewer >> special-case goo. Remove now-redundant special-case goo. Finally, >> vmx_genassym.o doesn't need to depend on a hand expanded ${_ILINKS} >> explicitly, that's all taken care of by beforedepend. >>=20 >> With these items fixed, we no longer build vmm.ko every single time >> through the modules on a KERNFAST build. >=20 > So I cheered for this before, but it appears to be broken. :( >=20 > Namely, I rebuilt world + kernel on my laptop this weekend (it was = about a=20 > month old). My normal setup builds kernels with NO_KERNELCLEAN=3Dyes. = On my=20 > next reboot when I started a bhyve VM I promptly got a panic due to a = page=20 > fault in this assembly code: >=20 > /* > * If 'vmx->eptgen[curcpu]' is not identical to = 'pmap->pm_eptgen' > * then we must invalidate all mappings associated with this = EPTP. > */ > movq PM_EPTGEN(%r11), %r10 > cmpq %r10, VMX_EPTGEN(%rsi, %rax, 8) > je guest_restore >=20 > (The 'cmpq' instruction) >=20 > This change came to mind, so I blew away the 'vmm' module directory = and=20 > rebuilt my kernel. Comparing the assembly of this instruction before = and=20 > after used different values for VMX_EPTGEN. In other words, the=20 > NO_KERNELCLEAN=3Dyes build failed to regenerate vmx_assym.h and the = build used=20 > stale values. Is there a way to force this condition for testing? > In particular, if you examine the generated .depend file, you will = find that=20 > there are no dependencies recorded for vmx_genassym.o, so it is never = rebuilt=20 > if any of the headers it includes are changed. In my case the panic = happened=20 > to be one that was easily diagnosed, but I could imagine stale assym = headers=20 > causing very odd crashes that would be quite hard to track down. I = think=20 > these changes should be reverted if we can't fix the dependencies of = the=20 > associated object files they are generated from. :( Give me a bit and I=92ll fix it. There=92s a number of implicit = dependencies that don=92t get recorded in the .depend file, iirc, so = that=92s not completely conclusive. Not building, though is kinda a big = hint that something=92s amiss. However, -DNO_CLEAN has always been a very-sharp edged tool that will = cut you in a number of ways, so there=92s no rush to back this out. Warner --Apple-Mail=_25BDB42C-D6E2-4B9A-BDC5-8C8727B4CD4C 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 iQIcBAEBCgAGBQJUTnSZAAoJEGwc0Sh9sBEAtssP/ihxpIZuBrJF0yFr713jTxzQ KAaeFU+ERLT+Uc6KAHUXW4EQ6w59xfFy0ek5bQv+fkteH5RskzE8pPFdNPa2qPkS cgHQkx15eBlCJF1qwIsq9aSfRAUFBy3S0K2qzsI0KgXPr0PSKfepiMIzzyvvh/co GlrG0hBvQsPKwz4FgU+Gqi6rqb9KEvw2BULGcjU047YxEusgeBxpnmpiUeP19arS bR+G/H+gmtFD2vHfB765d4XtB2ktlyFZDKGoeMDwD4OuMzn7A9lGJVDE9SptMy8b N8LtgIli/I5BodZGAp2oNnEp760RQiHeNhxe5yfjbJqsE9OX0NTXT/ZFbQhyWtve sKvbd3hSpTKsX2aCVQ7VwVLp1pniOJx2w7nifh4zA8Fwvj/utUccA626sQ6As2+P cYsAvETq/qkSuDGnngRBMUJS1yq65xFcMJcjt0YslSFpHgbFwP5o9p4qTB9u3957 jSm2mGiTW+B/HIhq8FAZ4/HKDwvrhpnsK6l9/UK/fx1q7Lgv/ybdD/pkl0qdaYNo tYfQULFz3T9sb4UDpU8iGD+GmKsh3nXfTu1pl9GwChwaJne2mL13TuNdWRbV/jNz U8FcbGvcx93fOUBPdshJA/x3PGKqdljS1aBiDYZ2/Oa+mpyk8ZbeCFTAeHN++rZY 0LJvKU/+tiFkbj4qm4JB =/VLc -----END PGP SIGNATURE----- --Apple-Mail=_25BDB42C-D6E2-4B9A-BDC5-8C8727B4CD4C-- From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 16:43:54 2014 Return-Path: Delivered-To: svn-src-all@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 6AEFF946; Mon, 27 Oct 2014 16:43:54 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DC96911C; Mon, 27 Oct 2014 16:43:53 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 1948725D37C7; Mon, 27 Oct 2014 16:43:50 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 10BF9C77042; Mon, 27 Oct 2014 16:43:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id AqQz6s5VlRxU; Mon, 27 Oct 2014 16:43:44 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 8C280C76FD4; Mon, 27 Oct 2014 16:43:43 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r273742 - head/sys/netinet6 From: "Bjoern A. Zeeb" In-Reply-To: <201410271615.s9RGFF9A051317@svn.freebsd.org> Date: Mon, 27 Oct 2014 16:43:42 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <77B7E340-1C0A-4322-BDF1-CA945DC64F63@FreeBSD.org> References: <201410271615.s9RGFF9A051317@svn.freebsd.org> To: "Andrey V. Elsukov" X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 16:43:54 -0000 On 27 Oct 2014, at 16:15 , Andrey V. Elsukov wrote: > Author: ae > Date: Mon Oct 27 16:15:15 2014 > New Revision: 273742 > URL: https://svnweb.freebsd.org/changeset/base/273742 >=20 > Log: > Do not automatically install routes to link-local and interface-local = multicast > addresses. Why? >=20 > Obtained from: Yandex LLC > Sponsored by: Yandex LLC >=20 > Modified: > head/sys/netinet6/in6.c >=20 > Modified: head/sys/netinet6/in6.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/netinet6/in6.c Mon Oct 27 16:13:51 2014 = (r273741) > +++ head/sys/netinet6/in6.c Mon Oct 27 16:15:15 2014 = (r273742) > @@ -782,27 +782,24 @@ in6_update_ifa_join_mc(struct ifnet *ifp > struct in6_ifaddr *ia, int flags, struct in6_multi **in6m_sol) > { > char ip6buf[INET6_ADDRSTRLEN]; > - struct sockaddr_in6 mltaddr, mltmask; > - struct in6_addr llsol; > + struct in6_addr mltaddr; > struct in6_multi_mship *imm; > - struct rtentry *rt; > int delay, error; >=20 > KASSERT(in6m_sol !=3D NULL, ("%s: in6m_sol is NULL", __func__)); >=20 > /* Join solicited multicast addr for new host id. */ > - bzero(&llsol, sizeof(struct in6_addr)); > - llsol.s6_addr32[0] =3D IPV6_ADDR_INT32_MLL; > - llsol.s6_addr32[1] =3D 0; > - llsol.s6_addr32[2] =3D htonl(1); > - llsol.s6_addr32[3] =3D ifra->ifra_addr.sin6_addr.s6_addr32[3]; > - llsol.s6_addr8[12] =3D 0xff; > - if ((error =3D in6_setscope(&llsol, ifp, NULL)) !=3D 0) { > + bzero(&mltaddr, sizeof(struct in6_addr)); > + mltaddr.s6_addr32[0] =3D IPV6_ADDR_INT32_MLL; > + mltaddr.s6_addr32[2] =3D htonl(1); > + mltaddr.s6_addr32[3] =3D ifra->ifra_addr.sin6_addr.s6_addr32[3]; > + mltaddr.s6_addr8[12] =3D 0xff; > + if ((error =3D in6_setscope(&mltaddr, ifp, NULL)) !=3D 0) { > /* XXX: should not happen */ > log(LOG_ERR, "%s: in6_setscope failed\n", __func__); > goto cleanup; > } > - delay =3D 0; > + delay =3D error =3D 0; > if ((flags & IN6_IFAUPDATE_DADDELAY)) { > /* > * We need a random delay for DAD on the address being > @@ -812,62 +809,28 @@ in6_update_ifa_join_mc(struct ifnet *ifp > */ > delay =3D arc4random() % (MAX_RTR_SOLICITATION_DELAY * = hz); > } > - imm =3D in6_joingroup(ifp, &llsol, &error, delay); > + imm =3D in6_joingroup(ifp, &mltaddr, &error, delay); > if (imm =3D=3D NULL) { > - nd6log((LOG_WARNING, "%s: addmulti failed for %s on %s " > - "(errno=3D%d)\n", __func__, ip6_sprintf(ip6buf, = &llsol), > + nd6log((LOG_WARNING, "%s: in6_joingroup failed for %s on = %s " > + "(errno=3D%d)\n", __func__, ip6_sprintf(ip6buf, = &mltaddr), > if_name(ifp), error)); > goto cleanup; > } > LIST_INSERT_HEAD(&ia->ia6_memberships, imm, i6mm_chain); > *in6m_sol =3D imm->i6mm_maddr; >=20 > - bzero(&mltmask, sizeof(mltmask)); > - mltmask.sin6_len =3D sizeof(struct sockaddr_in6); > - mltmask.sin6_family =3D AF_INET6; > - mltmask.sin6_addr =3D in6mask32; > -#define MLTMASK_LEN 4 /* mltmask's masklen (=3D32bit=3D4octet) = */ > - > /* > * Join link-local all-nodes address. > */ > - bzero(&mltaddr, sizeof(mltaddr)); > - mltaddr.sin6_len =3D sizeof(struct sockaddr_in6); > - mltaddr.sin6_family =3D AF_INET6; > - mltaddr.sin6_addr =3D in6addr_linklocal_allnodes; > - if ((error =3D in6_setscope(&mltaddr.sin6_addr, ifp, NULL)) !=3D = 0) > + mltaddr =3D in6addr_linklocal_allnodes; > + if ((error =3D in6_setscope(&mltaddr, ifp, NULL)) !=3D 0) > goto cleanup; /* XXX: should not fail */ >=20 > - /* > - * XXX: do we really need this automatic routes? We should = probably > - * reconsider this stuff. Most applications actually do not = need the > - * routes, since they usually specify the outgoing interface. > - */ > - rt =3D in6_rtalloc1((struct sockaddr *)&mltaddr, 0, 0UL, = RT_DEFAULT_FIB); > - if (rt !=3D NULL) { > - /* XXX: only works in !SCOPEDROUTING case. */ > - if (memcmp(&mltaddr.sin6_addr, > - &((struct sockaddr_in6 *)rt_key(rt))->sin6_addr, > - MLTMASK_LEN)) { > - RTFREE_LOCKED(rt); > - rt =3D NULL; > - } > - } > - if (rt =3D=3D NULL) { > - error =3D in6_rtrequest(RTM_ADD, (struct sockaddr = *)&mltaddr, > - (struct sockaddr *)&ia->ia_addr, > - (struct sockaddr *)&mltmask, RTF_UP, > - (struct rtentry **)0, RT_DEFAULT_FIB); > - if (error) > - goto cleanup; > - } else > - RTFREE_LOCKED(rt); > - > - imm =3D in6_joingroup(ifp, &mltaddr.sin6_addr, &error, 0); > + imm =3D in6_joingroup(ifp, &mltaddr, &error, 0); > if (imm =3D=3D NULL) { > - nd6log((LOG_WARNING, "%s: addmulti failed for %s on %s " > - "(errno=3D%d)\n", __func__, ip6_sprintf(ip6buf, > - &mltaddr.sin6_addr), if_name(ifp), error)); > + nd6log((LOG_WARNING, "%s: in6_joingroup failed for %s on = %s " > + "(errno=3D%d)\n", __func__, ip6_sprintf(ip6buf, = &mltaddr), > + if_name(ifp), error)); > goto cleanup; > } > LIST_INSERT_HEAD(&ia->ia6_memberships, imm, i6mm_chain); > @@ -883,24 +846,26 @@ in6_update_ifa_join_mc(struct ifnet *ifp > */ > delay =3D arc4random() % (MAX_RTR_SOLICITATION_DELAY * = hz); > } > - if (in6_nigroup(ifp, NULL, -1, &mltaddr.sin6_addr) =3D=3D 0) { > + if (in6_nigroup(ifp, NULL, -1, &mltaddr) =3D=3D 0) { > /* XXX jinmei */ > - imm =3D in6_joingroup(ifp, &mltaddr.sin6_addr, &error, = delay); > + imm =3D in6_joingroup(ifp, &mltaddr, &error, delay); > if (imm =3D=3D NULL) > - nd6log((LOG_WARNING, "%s: addmulti failed for %s = on %s " > + nd6log((LOG_WARNING, > + "%s: in6_joingroup failed for %s on %s " > "(errno=3D%d)\n", __func__, = ip6_sprintf(ip6buf, > - &mltaddr.sin6_addr), if_name(ifp), error)); > + &mltaddr), if_name(ifp), error)); > /* XXX not very fatal, go on... */ > else > LIST_INSERT_HEAD(&ia->ia6_memberships, imm, = i6mm_chain); > } > - if (V_icmp6_nodeinfo_oldmcprefix &&=20 > - in6_nigroup_oldmcprefix(ifp, NULL, -1, &mltaddr.sin6_addr) = =3D=3D 0) { > - imm =3D in6_joingroup(ifp, &mltaddr.sin6_addr, &error, = delay); > + if (V_icmp6_nodeinfo_oldmcprefix && > + in6_nigroup_oldmcprefix(ifp, NULL, -1, &mltaddr) =3D=3D 0) { > + imm =3D in6_joingroup(ifp, &mltaddr, &error, delay); > if (imm =3D=3D NULL) > - nd6log((LOG_WARNING, "%s: addmulti failed for %s = on %s " > + nd6log((LOG_WARNING, > + "%s: in6_joingroup failed for %s on %s " > "(errno=3D%d)\n", __func__, = ip6_sprintf(ip6buf, > - &mltaddr.sin6_addr), if_name(ifp), error)); > + &mltaddr), if_name(ifp), error)); > /* XXX not very fatal, go on... */ > else > LIST_INSERT_HEAD(&ia->ia6_memberships, imm, = i6mm_chain); > @@ -910,38 +875,18 @@ in6_update_ifa_join_mc(struct ifnet *ifp > * Join interface-local all-nodes address. > * (ff01::1%ifN, and ff01::%ifN/32) > */ > - mltaddr.sin6_addr =3D in6addr_nodelocal_allnodes; > - if ((error =3D in6_setscope(&mltaddr.sin6_addr, ifp, NULL)) !=3D = 0) > + mltaddr =3D in6addr_nodelocal_allnodes; > + if ((error =3D in6_setscope(&mltaddr, ifp, NULL)) !=3D 0) > goto cleanup; /* XXX: should not fail */ > - /* XXX: again, do we really need the route? */ > - rt =3D in6_rtalloc1((struct sockaddr *)&mltaddr, 0, 0UL, = RT_DEFAULT_FIB); > - if (rt !=3D NULL) { > - if (memcmp(&mltaddr.sin6_addr, > - &((struct sockaddr_in6 *)rt_key(rt))->sin6_addr, > - MLTMASK_LEN)) { > - RTFREE_LOCKED(rt); > - rt =3D NULL; > - } > - } > - if (rt =3D=3D NULL) { > - error =3D in6_rtrequest(RTM_ADD, (struct sockaddr = *)&mltaddr, > - (struct sockaddr *)&ia->ia_addr, > - (struct sockaddr *)&mltmask, RTF_UP, > - (struct rtentry **)0, RT_DEFAULT_FIB); > - if (error) > - goto cleanup; > - } else > - RTFREE_LOCKED(rt); >=20 > - imm =3D in6_joingroup(ifp, &mltaddr.sin6_addr, &error, 0); > + imm =3D in6_joingroup(ifp, &mltaddr, &error, 0); > if (imm =3D=3D NULL) { > - nd6log((LOG_WARNING, "%s: addmulti failed for %s on %s " > + nd6log((LOG_WARNING, "%s: in6_joingroup failed for %s on = %s " > "(errno=3D%d)\n", __func__, ip6_sprintf(ip6buf, > - &mltaddr.sin6_addr), if_name(ifp), error)); > + &mltaddr), if_name(ifp), error)); > goto cleanup; > } > LIST_INSERT_HEAD(&ia->ia6_memberships, imm, i6mm_chain); > -#undef MLTMASK_LEN >=20 > cleanup: > return (error); > @@ -1343,135 +1288,17 @@ in6_broadcast_ifa(struct ifnet *ifp, str > } >=20 > /* > - * Leave multicast groups. Factored out from in6_purgeaddr(). > - * This entire work should only be done once, for the default FIB. > + * Leave from multicast groups we have joined for the interface. > */ > static int > in6_purgeaddr_mc(struct ifnet *ifp, struct in6_ifaddr *ia, struct = ifaddr *ifa0) > { > - struct sockaddr_in6 mltaddr, mltmask; > struct in6_multi_mship *imm; > - struct rtentry *rt; > - struct sockaddr_in6 sin6; > - int error; >=20 > - /* > - * Leave from multicast groups we have joined for the interface. > - */ > while ((imm =3D LIST_FIRST(&ia->ia6_memberships)) !=3D NULL) { > LIST_REMOVE(imm, i6mm_chain); > in6_leavegroup(imm); > } > - > - /* > - * Remove the link-local all-nodes address. > - */ > - bzero(&mltmask, sizeof(mltmask)); > - mltmask.sin6_len =3D sizeof(struct sockaddr_in6); > - mltmask.sin6_family =3D AF_INET6; > - mltmask.sin6_addr =3D in6mask32; > - > - bzero(&mltaddr, sizeof(mltaddr)); > - mltaddr.sin6_len =3D sizeof(struct sockaddr_in6); > - mltaddr.sin6_family =3D AF_INET6; > - mltaddr.sin6_addr =3D in6addr_linklocal_allnodes; > - > - if ((error =3D in6_setscope(&mltaddr.sin6_addr, ifp, NULL)) !=3D = 0) > - return (error); > - > - /* > - * As for the mltaddr above, proactively prepare the sin6 to = avoid > - * rtentry un- and re-locking. > - */ > - if (ifa0 !=3D NULL) { > - bzero(&sin6, sizeof(sin6)); > - sin6.sin6_len =3D sizeof(sin6); > - sin6.sin6_family =3D AF_INET6; > - memcpy(&sin6.sin6_addr, = &satosin6(ifa0->ifa_addr)->sin6_addr, > - sizeof(sin6.sin6_addr)); > - error =3D in6_setscope(&sin6.sin6_addr, ifa0->ifa_ifp, = NULL); > - if (error !=3D 0) > - return (error); > - } > - > - rt =3D in6_rtalloc1((struct sockaddr *)&mltaddr, 0, 0UL, = RT_DEFAULT_FIB); > - if (rt !=3D NULL && rt->rt_gateway !=3D NULL && > - (memcmp(&satosin6(rt->rt_gateway)->sin6_addr, > - &ia->ia_addr.sin6_addr, > - sizeof(ia->ia_addr.sin6_addr)) =3D=3D 0)) { > - /* > - * If no more IPv6 address exists on this interface then > - * remove the multicast address route. > - */ > - if (ifa0 =3D=3D NULL) { > - memcpy(&mltaddr.sin6_addr, > - &satosin6(rt_key(rt))->sin6_addr, > - sizeof(mltaddr.sin6_addr)); > - RTFREE_LOCKED(rt); > - error =3D in6_rtrequest(RTM_DELETE, > - (struct sockaddr *)&mltaddr, > - (struct sockaddr *)&ia->ia_addr, > - (struct sockaddr *)&mltmask, RTF_UP, > - (struct rtentry **)0, RT_DEFAULT_FIB); > - if (error) > - log(LOG_INFO, "%s: link-local all-nodes = " > - "multicast address deletion = error\n", > - __func__); > - } else { > - /* > - * Replace the gateway of the route. > - */ > - memcpy(rt->rt_gateway, &sin6, sizeof(sin6)); > - RTFREE_LOCKED(rt); > - } > - } else { > - if (rt !=3D NULL) > - RTFREE_LOCKED(rt); > - } > - > - /* > - * Remove the node-local all-nodes address. > - */ > - mltaddr.sin6_addr =3D in6addr_nodelocal_allnodes; > - if ((error =3D in6_setscope(&mltaddr.sin6_addr, ifp, NULL)) !=3D = 0) > - return (error); > - > - rt =3D in6_rtalloc1((struct sockaddr *)&mltaddr, 0, 0UL, = RT_DEFAULT_FIB); > - if (rt !=3D NULL && rt->rt_gateway !=3D NULL && > - (memcmp(&satosin6(rt->rt_gateway)->sin6_addr, > - &ia->ia_addr.sin6_addr, > - sizeof(ia->ia_addr.sin6_addr)) =3D=3D 0)) { > - /* > - * If no more IPv6 address exists on this interface then > - * remove the multicast address route. > - */ > - if (ifa0 =3D=3D NULL) { > - memcpy(&mltaddr.sin6_addr, > - &satosin6(rt_key(rt))->sin6_addr, > - sizeof(mltaddr.sin6_addr)); > - > - RTFREE_LOCKED(rt); > - error =3D in6_rtrequest(RTM_DELETE, > - (struct sockaddr *)&mltaddr, > - (struct sockaddr *)&ia->ia_addr, > - (struct sockaddr *)&mltmask, RTF_UP, > - (struct rtentry **)0, RT_DEFAULT_FIB); > - if (error) > - log(LOG_INFO, "%s: node-local all-nodes" > - "multicast address deletion = error\n", > - __func__); > - } else { > - /* > - * Replace the gateway of the route. > - */ > - memcpy(rt->rt_gateway, &sin6, sizeof(sin6)); > - RTFREE_LOCKED(rt); > - } > - } else { > - if (rt !=3D NULL) > - RTFREE_LOCKED(rt); > - } > - > return (0); > } >=20 >=20 =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 16:49:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0184ED25; Mon, 27 Oct 2014 16:49:22 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id E84223550; Mon, 27 Oct 2014 16:49:20 +0000 (UTC) Message-ID: <544E778F.3000909@FreeBSD.org> Date: Mon, 27 Oct 2014 19:49:19 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: "Bjoern A. Zeeb" Subject: Re: svn commit: r273742 - head/sys/netinet6 References: <201410271615.s9RGFF9A051317@svn.freebsd.org> <77B7E340-1C0A-4322-BDF1-CA945DC64F63@FreeBSD.org> In-Reply-To: <77B7E340-1C0A-4322-BDF1-CA945DC64F63@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 16:49:22 -0000 On 27.10.2014 19:43, Bjoern A. Zeeb wrote: > > On 27 Oct 2014, at 16:15 , Andrey V. Elsukov wrote: > >> Author: ae >> Date: Mon Oct 27 16:15:15 2014 >> New Revision: 273742 >> URL: https://svnweb.freebsd.org/changeset/base/273742 >> >> Log: >> Do not automatically install routes to link-local and interface-local multicast >> addresses. > > Why? They are useless. Multicast code maintains needed routing information internally when system does join to multicast groups. -- WBR, Andrey V. Elsukov From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 17:08:24 2014 Return-Path: Delivered-To: svn-src-all@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 5B1BA4CD; Mon, 27 Oct 2014 17:08:24 +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 1D14D3CF; Mon, 27 Oct 2014 17:08:23 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 6C24AD42AB3; Tue, 28 Oct 2014 04:08:21 +1100 (AEDT) Date: Tue, 28 Oct 2014 04:08:20 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kurt Jaeger Subject: Re: svn commit: r273734 - head/bin/dd In-Reply-To: <20141027162034.GN1492@f10.opsec.eu> Message-ID: <20141028040638.O3114@besplex.bde.org> References: <201410271138.s9RBcHrA002447@svn.freebsd.org> <20141028005225.S2013@besplex.bde.org> <20141027162034.GN1492@f10.opsec.eu> 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=dMCfxopb c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=Fzk3_7XD2FUfaiSXAJQA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 17:08:24 -0000 On Mon, 27 Oct 2014, Kurt Jaeger wrote: >>> Log: >>> bin/dd: Fix incorrect casting of arguments > [...] >> Both of these work correctly in my version (with a relatively small patch >> and no breakage of other cases). (I actually typed large values as -1 >> and 11111111111111111111111111. -1 means (uintmax_t)-1 although this >> is undocumented and now broken). > > So, given this detailed review, should I revert the change ? Yes. You would have to change half of it just to get it to compile on 32-bit arches. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 17:09:07 2014 Return-Path: Delivered-To: svn-src-all@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 8410A610; Mon, 27 Oct 2014 17:09:07 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (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 5532A3DA; Mon, 27 Oct 2014 17:09:07 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Xinmu-0004rw-CX; Mon, 27 Oct 2014 17:09:00 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id s9RH8wDG076686; Mon, 27 Oct 2014 11:08:58 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19mYJ9lmhv2zfGI9hyqnGQS X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r273734 - head/bin/dd From: Ian Lepore To: Kurt Jaeger In-Reply-To: <20141027162034.GN1492@f10.opsec.eu> References: <201410271138.s9RBcHrA002447@svn.freebsd.org> <20141028005225.S2013@besplex.bde.org> <20141027162034.GN1492@f10.opsec.eu> Content-Type: text/plain; charset="us-ascii" Date: Mon, 27 Oct 2014 11:08:58 -0600 Message-ID: <1414429738.17308.9.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 17:09:07 -0000 On Mon, 2014-10-27 at 17:20 +0100, Kurt Jaeger wrote: > Hi! > > > > Log: > > > bin/dd: Fix incorrect casting of arguments > [...] > > Both of these work correctly in my version (with a relatively small patch > > and no breakage of other cases). (I actually typed large values as -1 > > and 11111111111111111111111111. -1 means (uintmax_t)-1 although this > > is undocumented and now broken). > > So, given this detailed review, should I revert the change ? > Given that it breaks the build for 32 bit architectures, it probably should be reverted until a different set of changes is available. -- Ian From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 17:28:46 2014 Return-Path: Delivered-To: svn-src-all@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 681EBCA6; Mon, 27 Oct 2014 17:28:46 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 2BC987F8; Mon, 27 Oct 2014 17:28:45 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id E29C7D62048; Tue, 28 Oct 2014 04:28:37 +1100 (AEDT) Date: Tue, 28 Oct 2014 04:28:37 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov Subject: Re: svn commit: r273129 - head/sys/kern In-Reply-To: <201410151238.s9FCcRMe018200@svn.freebsd.org> Message-ID: <20141028040935.M3114@besplex.bde.org> References: <201410151238.s9FCcRMe018200@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=BdjhjNd2 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=wx-8-68_qoafIrUy0MQA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 17:28:46 -0000 On Wed, 15 Oct 2014, Konstantin Belousov wrote: > Log: > Implement FIODTYPE for master ptys. > > Requested and reviewed by: bde > Sponsored by: The FreeBSD Foundation > MFC after: 1 week Thanks. This allows dd to work on ptys again. dd has the following bad code: % static void % getfdtype(IO *io) % { % struct stat sb; % int type; % % if (fstat(io->fd, &sb) == -1) % err(1, "%s", io->name); FIODTYPE should only be used as a hint, but dd makes its non-support fatal in some cases. Even fstat() failure for determining the hint shouldn't be fatal. % if (S_ISREG(sb.st_mode)) % io->flags |= ISTRUNC; % if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) { % if (ioctl(io->fd, FIODTYPE, &type) == -1) { % err(1, "%s", io->name); % } else { dd only uses the dtype hint for devices. Otherwise, it uses defaults. It might as well use the defaults for devices that don't support dtype too. % if (type & D_TAPE) % io->flags |= ISTAPE; % else if (type & (D_DISK | D_MEM)) % io->flags |= ISSEEK; % if (S_ISCHR(sb.st_mode) && (type & D_TAPE) == 0) % io->flags |= ISCHR; % } % return; % } % errno = 0; % if (lseek(io->fd, (off_t)0, SEEK_CUR) == -1 && errno == ESPIPE) % io->flags |= ISPIPE; % else % io->flags |= ISSEEK; % } Not only the dtype check is bad. dd still has to guess about seekability, and does this not very well. Guessing is not needed for pipes, but dd guesses for them. Pipes are not seekable, but the converse is false. Tapes ar character devices, but ISCHR is not set for them. I use the following fixes (not complete -- at least the spelling change for ISSEEK is mostly in other files). @diff -u2 dd.c~ dd.c @--- dd.c~ Wed Apr 7 20:20:48 2004 @+++ dd.c Wed Apr 7 20:20:49 2004 @@@ -247,21 +245,18 @@ @ io->flags |= ISTRUNC; @ if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) { @- if (ioctl(io->fd, FIODTYPE, &type) == -1) { @+ if (ioctl(io->fd, FIODTYPE, &type) == -1) @ err(1, "%s", io->name); @- } else { @+ else { @ if (type & D_TAPE) @ io->flags |= ISTAPE; @ else if (type & (D_DISK | D_MEM)) @- io->flags |= ISSEEK; @- if (S_ISCHR(sb.st_mode) && (type & D_TAPE) == 0) @+ io->flags |= ISSEEKABLE; @+ if (S_ISCHR(sb.st_mode)) @ io->flags |= ISCHR; @ } @- return; @- } @- errno = 0; @- if (lseek(io->fd, (off_t)0, SEEK_CUR) == -1 && errno == ESPIPE) @- io->flags |= ISPIPE; @- else @- io->flags |= ISSEEK; @+ } else if (lseek(io->fd, (off_t)0, SEEK_CUR) == 0) @+ io->flags |= ISSEEKABLE; @+ else if (errno == ESPIPE) @+ io->flags |= ISPIPE; /* XXX fixed in 4.4BSD */ @ } @ Bruce From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 17:39:39 2014 Return-Path: Delivered-To: svn-src-all@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 1E6D02A1; Mon, 27 Oct 2014 17:39: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 F3313925; Mon, 27 Oct 2014 17:39: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 s9RHdcVu089314; Mon, 27 Oct 2014 17:39:38 GMT (envelope-from pi@FreeBSD.org) Received: (from pi@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RHdbWP089309; Mon, 27 Oct 2014 17:39:37 GMT (envelope-from pi@FreeBSD.org) Message-Id: <201410271739.s9RHdbWP089309@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pi set sender to pi@FreeBSD.org using -f From: Kurt Jaeger Date: Mon, 27 Oct 2014 17:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273743 - head/bin/dd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 17:39:39 -0000 Author: pi (ports committer) Date: Mon Oct 27 17:39:37 2014 New Revision: 273743 URL: https://svnweb.freebsd.org/changeset/base/273743 Log: bin/dd: revert 273734, as it fails on 32bit platforms Revert: insufficient testing on 32bit platforms PR: 191263 Modified: head/bin/dd/args.c head/bin/dd/conv.c head/bin/dd/dd.c head/bin/dd/dd.h head/bin/dd/position.c Modified: head/bin/dd/args.c ============================================================================== --- head/bin/dd/args.c Mon Oct 27 16:15:15 2014 (r273742) +++ head/bin/dd/args.c Mon Oct 27 17:39:37 2014 (r273743) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include @@ -172,7 +171,8 @@ jcl(char **argv) */ if (in.offset > OFF_MAX / (ssize_t)in.dbsz || out.offset > OFF_MAX / (ssize_t)out.dbsz) - errx(1, "seek offsets cannot be larger than %jd", OFF_MAX); + errx(1, "seek offsets cannot be larger than %jd", + (intmax_t)OFF_MAX); } static int @@ -186,30 +186,37 @@ c_arg(const void *a, const void *b) static void f_bs(char *arg) { + uintmax_t res; - in.dbsz = out.dbsz = get_num(arg); - if (out.dbsz < 1 || out.dbsz > SSIZE_MAX) - errx(1, "bs must be between 1 and %jd", SSIZE_MAX); + res = get_num(arg); + if (res < 1 || res > SSIZE_MAX) + errx(1, "bs must be between 1 and %jd", (intmax_t)SSIZE_MAX); + in.dbsz = out.dbsz = (size_t)res; } static void f_cbs(char *arg) { + uintmax_t res; - cbsz = get_num(arg); - if (cbsz < 1 || cbsz > SSIZE_MAX) - errx(1, "cbs must be between 1 and %jd", SSIZE_MAX); + res = get_num(arg); + if (res < 1 || res > SSIZE_MAX) + errx(1, "cbs must be between 1 and %jd", (intmax_t)SSIZE_MAX); + cbsz = (size_t)res; } static void f_count(char *arg) { + intmax_t res; - cpy_cnt = get_num(arg); - if (cpy_cnt == SIZE_MAX) - errc(1, ERANGE, "%s", oper); - if (cpy_cnt == 0) - cpy_cnt = -1; + res = (intmax_t)get_num(arg); + if (res < 0) + errx(1, "count cannot be negative"); + if (res == 0) + cpy_cnt = (uintmax_t)-1; + else + cpy_cnt = (uintmax_t)res; } static void @@ -218,7 +225,7 @@ f_files(char *arg) files_cnt = get_num(arg); if (files_cnt < 1) - errx(1, "files must be between 1 and %ju", SIZE_MAX); + errx(1, "files must be between 1 and %jd", (uintmax_t)-1); } static void @@ -234,11 +241,14 @@ f_fillchar(char *arg) static void f_ibs(char *arg) { + uintmax_t res; if (!(ddflags & C_BS)) { - in.dbsz = get_num(arg); - if (in.dbsz < 1 || in.dbsz > SSIZE_MAX) - errx(1, "ibs must be between 1 and %ju", SSIZE_MAX); + res = get_num(arg); + if (res < 1 || res > SSIZE_MAX) + errx(1, "ibs must be between 1 and %jd", + (intmax_t)SSIZE_MAX); + in.dbsz = (size_t)res; } } @@ -252,11 +262,14 @@ f_if(char *arg) static void f_obs(char *arg) { + uintmax_t res; if (!(ddflags & C_BS)) { - out.dbsz = get_num(arg); - if (out.dbsz < 1 || out.dbsz > SSIZE_MAX) - errx(1, "obs must be between 1 and %jd", SSIZE_MAX); + res = get_num(arg); + if (res < 1 || res > SSIZE_MAX) + errx(1, "obs must be between 1 and %jd", + (intmax_t)SSIZE_MAX); + out.dbsz = (size_t)res; } } @@ -365,17 +378,11 @@ get_num(const char *val) uintmax_t num, mult, prevnum; char *expr; - while (isspace(val[0])) - val++; - - if (val[0] == '-') - errx(1, "%s: cannot be negative", oper); - errno = 0; - num = strtoull(val, &expr, 0); + num = strtouq(val, &expr, 0); if (errno != 0) /* Overflow or underflow. */ err(1, "%s", oper); - + if (expr == val) /* No valid digits. */ errx(1, "%s: illegal numeric value", oper); Modified: head/bin/dd/conv.c ============================================================================== --- head/bin/dd/conv.c Mon Oct 27 16:15:15 2014 (r273742) +++ head/bin/dd/conv.c Mon Oct 27 17:39:37 2014 (r273743) @@ -133,7 +133,7 @@ block(void) */ ch = 0; for (inp = in.dbp - in.dbcnt, outp = out.dbp; in.dbcnt;) { - maxlen = MIN(cbsz, (size_t)in.dbcnt); + maxlen = MIN(cbsz, in.dbcnt); if ((t = ctab) != NULL) for (cnt = 0; cnt < maxlen && (ch = *inp++) != '\n'; ++cnt) @@ -146,7 +146,7 @@ block(void) * Check for short record without a newline. Reassemble the * input block. */ - if (ch != '\n' && (size_t)in.dbcnt < cbsz) { + if (ch != '\n' && in.dbcnt < cbsz) { (void)memmove(in.db, in.dbp - in.dbcnt, in.dbcnt); break; } @@ -228,7 +228,7 @@ unblock(void) * translation has to already be done or we might not recognize the * spaces. */ - for (inp = in.db; (size_t)in.dbcnt >= cbsz; inp += cbsz, in.dbcnt -= cbsz) { + for (inp = in.db; in.dbcnt >= cbsz; inp += cbsz, in.dbcnt -= cbsz) { for (t = inp + cbsz - 1; t >= inp && *t == ' '; --t) ; if (t >= inp) { Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Mon Oct 27 16:15:15 2014 (r273742) +++ head/bin/dd/dd.c Mon Oct 27 17:39:37 2014 (r273743) @@ -168,10 +168,10 @@ setup(void) * record oriented I/O, only need a single buffer. */ if (!(ddflags & (C_BLOCK | C_UNBLOCK))) { - if ((in.db = malloc((size_t)out.dbsz + in.dbsz - 1)) == NULL) + if ((in.db = malloc(out.dbsz + in.dbsz - 1)) == NULL) err(1, "input buffer"); out.db = in.db; - } else if ((in.db = malloc(MAX((size_t)in.dbsz, cbsz) + cbsz)) == NULL || + } else if ((in.db = malloc(MAX(in.dbsz, cbsz) + cbsz)) == NULL || (out.db = malloc(out.dbsz + cbsz)) == NULL) err(1, "output buffer"); @@ -343,7 +343,7 @@ dd_in(void) ++st.in_full; /* Handle full input blocks. */ - } else if ((size_t)n == (size_t)in.dbsz) { + } else if ((size_t)n == in.dbsz) { in.dbcnt += in.dbrcnt = n; ++st.in_full; @@ -493,7 +493,7 @@ dd_out(int force) outp += nw; st.bytes += nw; - if ((size_t)nw == n && n == (size_t)out.dbsz) + if ((size_t)nw == n && n == out.dbsz) ++st.out_full; else ++st.out_part; Modified: head/bin/dd/dd.h ============================================================================== --- head/bin/dd/dd.h Mon Oct 27 16:15:15 2014 (r273742) +++ head/bin/dd/dd.h Mon Oct 27 17:39:37 2014 (r273743) @@ -38,9 +38,10 @@ typedef struct { u_char *db; /* buffer address */ u_char *dbp; /* current buffer I/O address */ - ssize_t dbcnt; /* current buffer byte count */ - ssize_t dbrcnt; /* last read byte count */ - ssize_t dbsz; /* block size */ + /* XXX ssize_t? */ + size_t dbcnt; /* current buffer byte count */ + size_t dbrcnt; /* last read byte count */ + size_t dbsz; /* block size */ #define ISCHR 0x01 /* character device (warn on short) */ #define ISPIPE 0x02 /* pipe-like (see position.c) */ @@ -56,13 +57,13 @@ typedef struct { } IO; typedef struct { - size_t in_full; /* # of full input blocks */ - size_t in_part; /* # of partial input blocks */ - size_t out_full; /* # of full output blocks */ - size_t out_part; /* # of partial output blocks */ - size_t trunc; /* # of truncated records */ - size_t swab; /* # of odd-length swab blocks */ - size_t bytes; /* # of bytes written */ + uintmax_t in_full; /* # of full input blocks */ + uintmax_t in_part; /* # of partial input blocks */ + uintmax_t out_full; /* # of full output blocks */ + uintmax_t out_part; /* # of partial output blocks */ + uintmax_t trunc; /* # of truncated records */ + uintmax_t swab; /* # of odd-length swab blocks */ + uintmax_t bytes; /* # of bytes written */ struct timespec start; /* start time of dd */ } STAT; Modified: head/bin/dd/position.c ============================================================================== --- head/bin/dd/position.c Mon Oct 27 16:15:15 2014 (r273742) +++ head/bin/dd/position.c Mon Oct 27 17:39:37 2014 (r273743) @@ -178,7 +178,7 @@ pos_out(void) n = write(out.fd, out.db, out.dbsz); if (n == -1) err(1, "%s", out.name); - if (n != out.dbsz) + if ((size_t)n != out.dbsz) errx(1, "%s: write failure", out.name); } break; From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 17:40:24 2014 Return-Path: Delivered-To: svn-src-all@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 0EB5C3EB; Mon, 27 Oct 2014 17:40:24 +0000 (UTC) Received: from f10.opsec.eu (f10.opsec.eu [IPv6:2001:14f8:200:4::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 BA354931; Mon, 27 Oct 2014 17:40:23 +0000 (UTC) Received: from pi by f10.opsec.eu with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1XioHC-0003tP-Lw; Mon, 27 Oct 2014 18:40:18 +0100 Date: Mon, 27 Oct 2014 18:40:18 +0100 From: Kurt Jaeger To: Bruce Evans Subject: Re: svn commit: r273734 - head/bin/dd Message-ID: <20141027174018.GQ1492@f10.opsec.eu> References: <201410271138.s9RBcHrA002447@svn.freebsd.org> <20141028005225.S2013@besplex.bde.org> <20141027162034.GN1492@f10.opsec.eu> <20141028040638.O3114@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141028040638.O3114@besplex.bde.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Kurt Jaeger X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 17:40:24 -0000 Hi! > > So, given this detailed review, should I revert the change ? > > Yes. You would have to change half of it just to get it to compile > on 32-bit arches. Done. It's clearly my fault, I was sloppy in testing 8-( -- pi@FreeBSD.org +49 171 3101372 6 years to go ! From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 17:52:54 2014 Return-Path: Delivered-To: svn-src-all@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 C2FF4791; Mon, 27 Oct 2014 17:52:54 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 8558FAD5; Mon, 27 Oct 2014 17:52:54 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 00EA1104403F; Tue, 28 Oct 2014 04:52:45 +1100 (AEDT) Date: Tue, 28 Oct 2014 04:52:45 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov Subject: Re: svn commit: r273130 - head/sys/fs/deadfs In-Reply-To: <201410151308.s9FD8rY4032849@svn.freebsd.org> Message-ID: <20141028042928.J3114@besplex.bde.org> References: <201410151308.s9FD8rY4032849@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=fvDlOjIf c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=mvcpKk_RDYwzxCSpuQ0A:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 17:52:54 -0000 On Wed, 15 Oct 2014, Konstantin Belousov wrote: > Log: > Change the deadfs poll VOP to return POLLIN|POLLRDNORM if the caller > is interested in i/o state. Return POLLNVAL for invalid bits, similar > to poll_no_poll(). Note that POLLOUT must not be returned, since > POLLHUP is set. > > Noted and reviewed by: bde > Sponsored by: The FreeBSD Foundation > MFC after: 1 week Thanks. This is not a complete fix, but is just bug for bug compatible with poll_no_poll() and less buggy that the previous version. POLLNVAL means that the fd is valid, so it should not be returned for dead fd's (the whole point of deadfs is to keep the fd's alive enough to be valid). POLLIN should only be returned in there is (non-null) data. For some fd's, there may be both hangup and data, but for dead fd's there can only be hangup, so POLLIN is especially useless for deadfs. ttys are one of the few file types that usually set POLLIN correctly for EOF (that is, POLLIN is not set for EOF). 2 unusual broken cases remain for ttys: - when the tty goes away but the fd is still connected to the tty driver, POLLIN is set if it is checked for - but the fd is connected to deadfs (typically after it is revoked), the behaviour is now the same as when the tty goes away, except POLLNVAL is also set. For other file types, the new behaviour matches bugs in the handling for undead fd's better, while fixing some of the bugs in the old behaviour. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 18:29:49 2014 Return-Path: Delivered-To: svn-src-all@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 BEC2EFD9; Mon, 27 Oct 2014 18:29:49 +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 7A54AE99; Mon, 27 Oct 2014 18:29:49 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6B7BCB98A; Mon, 27 Oct 2014 14:29:48 -0400 (EDT) From: John Baldwin To: Warner Losh Subject: Re: svn commit: r273214 - in head/sys: amd64/vmm/intel modules/vmm Date: Mon, 27 Oct 2014 14:18:17 -0400 Message-ID: <5487187.5oKgfZ1XGT@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-PRERELEASE; KDE/4.14.2; amd64; ; ) In-Reply-To: <2B7C3745-04E4-4FA9-A849-AECE54EA83A3@bsdimp.com> References: <201410171320.s9HDKo53045297@svn.freebsd.org> <1725598.2CCKLon8F3@ralph.baldwin.cx> <2B7C3745-04E4-4FA9-A849-AECE54EA83A3@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 27 Oct 2014 14:29:48 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 18:29:49 -0000 On Monday, October 27, 2014 11:36:41 AM Warner Losh wrote: > On Oct 27, 2014, at 10:54 AM, John Baldwin wrote: > > On Friday, October 17, 2014 01:20:50 PM Warner Losh wrote: > >> Author: imp > >> Date: Fri Oct 17 13:20:49 2014 > >> New Revision: 273214 > >> URL: https://svnweb.freebsd.org/changeset/base/273214 > >>=20 > >> Log: > >> Fix build to not bogusly always rebuild vmm.ko. > >> =20 > >> Rename vmx_assym.s to vmx_assym.h to reflect that file's actual u= se > >> and update vmx_support.S's include to match. Add vmx_assym.h to t= he > >> SRCS to that it gets properly added to the dependency list. Add > >> vmx_support.S to SRCS as well, so it gets built and needs fewer > >> special-case goo. Remove now-redundant special-case goo. Finally,= > >> vmx_genassym.o doesn't need to depend on a hand expanded ${_ILINK= S} > >> explicitly, that's all taken care of by beforedepend. > >> =20 > >> With these items fixed, we no longer build vmm.ko every single ti= me > >> through the modules on a KERNFAST build. > >=20 > > So I cheered for this before, but it appears to be broken. :( > >=20 > > Namely, I rebuilt world + kernel on my laptop this weekend (it was = about a > > month old). My normal setup builds kernels with NO_KERNELCLEAN=3Dy= es. On my > > next reboot when I started a bhyve VM I promptly got a panic due to= a page > >=20 > > fault in this assembly code: > > =09/* > > =09 > > =09 * If 'vmx->eptgen[curcpu]' is not identical to 'pmap->pm_eptgen= ' > > =09 * then we must invalidate all mappings associated with this EPT= P. > > =09 */ > > =09 > > =09movq=09PM_EPTGEN(%r11), %r10 > > =09cmpq=09%r10, VMX_EPTGEN(%rsi, %rax, 8) > > =09je=09guest_restore > >=20 > > (The 'cmpq' instruction) > >=20 > > This change came to mind, so I blew away the 'vmm' module directory= and > > rebuilt my kernel. Comparing the assembly of this instruction befo= re and > > after used different values for VMX_EPTGEN. In other words, the > > NO_KERNELCLEAN=3Dyes build failed to regenerate vmx_assym.h and the= build > > used stale values. >=20 > Is there a way to force this condition for testing? You could checkout an older tree (probably before the recent merge of A= MD SVM support) and build vmm.ko, then svn update and see if vmx_assym and vmx_support.o are updated. Actually, this was simpler: % cd sys/modules/vmm % make depend % make vmx_assym.h # reports nothing to do % touch machine/vmm.h # vmx_genassym.c includes this % make vmx_assym.h # should rebuild, but doesn't > > In particular, if you examine the generated .depend file, you will = find > > that there are no dependencies recorded for vmx_genassym.o, so it i= s > > never rebuilt if any of the headers it includes are changed. In my= case > > the panic happened to be one that was easily diagnosed, but I could= > > imagine stale assym headers causing very odd crashes that would be = quite > > hard to track down. I think these changes should be reverted if we= can't > > fix the dependencies of the associated object files they are genera= ted > > from. :( >=20 > Give me a bit and I=E2=80=99ll fix it. There=E2=80=99s a number of im= plicit dependencies > that don=E2=80=99t get recorded in the .depend file, iirc, so that=E2= =80=99s not completely > conclusive. Not building, though is kinda a big hint that something=E2= =80=99s > amiss. I think the thing here is that for the assym files we don't record any dependency info at all. The main kernel build does record dependencies= for genassym.o in .depend, so it must be doable. In kern.pre.mk: GEN_CFILES=3D $S/$M/$M/genassym.c ${MFILES:T:S/.m$/.c/} and those are then explicitly passed to mkdep in kern.post.mk. So this fixes it: Index: Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- Makefile=09(revision 273555) +++ Makefile=09(working copy) @@ -4,6 +4,7 @@ KMOD=3D=09vmm =20 SRCS=3D=09opt_acpi.h opt_ddb.h device_if.h bus_if.h pci_if.h SRCS+=3D=09vmx_assym.h svm_assym.h +DPSRCS=3D=09vmx_genassym.c svm_genassym.c =20 CFLAGS+=3D -DVMM_KEEP_STATS -DSMP CFLAGS+=3D -I${.CURDIR}/../../amd64/vmm I'll try to track down all the other assym files and fix them as well. > However, -DNO_CLEAN has always been a very-sharp edged tool that will= cut > you in a number of ways, so there=E2=80=99s no rush to back this out.= This is the first time in many years that NO_KERNELCLEAN=3Dyes has been= a problem for me. (worlds sometimes have issues, but kernels rarely do).= Also, usually when it breaks it fails to compile, it doesn't compile an= d then panic. :( --=20 John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 18:37:12 2014 Return-Path: Delivered-To: svn-src-all@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 ED3FD413; Mon, 27 Oct 2014 18:37: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 D929AF8D; Mon, 27 Oct 2014 18:37: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 s9RIbCCc018112; Mon, 27 Oct 2014 18:37:12 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RIbCbR018109; Mon, 27 Oct 2014 18:37:12 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201410271837.s9RIbCbR018109@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 27 Oct 2014 18:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273744 - in head/sys/modules: linux vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 18:37:13 -0000 Author: jhb Date: Mon Oct 27 18:37:11 2014 New Revision: 273744 URL: https://svnweb.freebsd.org/changeset/base/273744 Log: Add foo_genassym.c files to DPSRCS so dependencies for them are generated. This ensures these objects are rebuilt to generate an updated header of assembly constants if needed. Modified: head/sys/modules/linux/Makefile head/sys/modules/vmm/Makefile Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Mon Oct 27 17:39:37 2014 (r273743) +++ head/sys/modules/linux/Makefile Mon Oct 27 18:37:11 2014 (r273744) @@ -17,6 +17,7 @@ SRCS= linux_fork.c linux${SFX}_dummy.c l opt_inet6.h opt_compat.h opt_posix.h opt_usb.h vnode_if.h \ device_if.h bus_if.h assym.s \ linux${SFX}_locore.s linux${SFX}_support.s +DPSRCS= linux${SFX}_genassym.c # XXX: for assym.s SRCS+= opt_kstack_pages.h opt_nfs.h opt_compat.h opt_hwpmc_hooks.h Modified: head/sys/modules/vmm/Makefile ============================================================================== --- head/sys/modules/vmm/Makefile Mon Oct 27 17:39:37 2014 (r273743) +++ head/sys/modules/vmm/Makefile Mon Oct 27 18:37:11 2014 (r273744) @@ -4,6 +4,7 @@ KMOD= vmm SRCS= opt_acpi.h opt_ddb.h device_if.h bus_if.h pci_if.h SRCS+= vmx_assym.h svm_assym.h +DPSRCS= vmx_genassym.c svm_genassym.c CFLAGS+= -DVMM_KEEP_STATS -DSMP CFLAGS+= -I${.CURDIR}/../../amd64/vmm @@ -53,7 +54,7 @@ SRCS+= vmcb.c \ npt.c \ amdv.c \ svm_msr.c - + CLEANFILES= vmx_assym.h vmx_genassym.o svm_assym.h svm_genassym.o vmx_assym.h: vmx_genassym.o From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 20:18:31 2014 Return-Path: Delivered-To: svn-src-all@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 5D8B3214; Mon, 27 Oct 2014 20:18: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 3E9E6D7F; Mon, 27 Oct 2014 20:18: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 s9RKIVt3065653; Mon, 27 Oct 2014 20:18:31 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RKIVjM065652; Mon, 27 Oct 2014 20:18:31 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410272018.s9RKIVjM065652@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 27 Oct 2014 20:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273745 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 20:18:31 -0000 Author: mjg Date: Mon Oct 27 20:18:30 2014 New Revision: 273745 URL: https://svnweb.freebsd.org/changeset/base/273745 Log: De-k&r-ify function definitions in kern/kern_resource.c No functional changes. Modified: head/sys/kern/kern_resource.c Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Mon Oct 27 18:37:11 2014 (r273744) +++ head/sys/kern/kern_resource.c Mon Oct 27 20:18:30 2014 (r273745) @@ -92,9 +92,7 @@ struct getpriority_args { }; #endif int -sys_getpriority(td, uap) - struct thread *td; - register struct getpriority_args *uap; +sys_getpriority(struct thread *td, register struct getpriority_args *uap) { struct proc *p; struct pgrp *pg; @@ -177,9 +175,7 @@ struct setpriority_args { }; #endif int -sys_setpriority(td, uap) - struct thread *td; - struct setpriority_args *uap; +sys_setpriority(struct thread *td, struct setpriority_args *uap) { struct proc *curp, *p; struct pgrp *pg; @@ -373,9 +369,7 @@ struct rtprio_args { }; #endif int -sys_rtprio(td, uap) - struct thread *td; /* curthread */ - register struct rtprio_args *uap; +sys_rtprio(struct thread *td, register struct rtprio_args *uap) { struct proc *p; struct thread *tdp; @@ -541,9 +535,7 @@ struct osetrlimit_args { }; #endif int -osetrlimit(td, uap) - struct thread *td; - register struct osetrlimit_args *uap; +osetrlimit(struct thread *td, register struct osetrlimit_args *uap) { struct orlimit olim; struct rlimit lim; @@ -564,9 +556,7 @@ struct ogetrlimit_args { }; #endif int -ogetrlimit(td, uap) - struct thread *td; - register struct ogetrlimit_args *uap; +ogetrlimit(struct thread *td, register struct ogetrlimit_args *uap) { struct orlimit olim; struct rlimit rl; @@ -603,9 +593,7 @@ struct __setrlimit_args { }; #endif int -sys_setrlimit(td, uap) - struct thread *td; - register struct __setrlimit_args *uap; +sys_setrlimit(struct thread *td, register struct __setrlimit_args *uap) { struct rlimit alim; int error; @@ -797,9 +785,7 @@ struct __getrlimit_args { #endif /* ARGSUSED */ int -sys_getrlimit(td, uap) - struct thread *td; - register struct __getrlimit_args *uap; +sys_getrlimit(struct thread *td, register struct __getrlimit_args *uap) { struct rlimit rlim; struct proc *p; @@ -820,10 +806,7 @@ sys_getrlimit(td, uap) * into user and system time usage. */ void -calccru(p, up, sp) - struct proc *p; - struct timeval *up; - struct timeval *sp; +calccru(struct proc *p, struct timeval *up, struct timeval *sp) { PROC_LOCK_ASSERT(p, MA_OWNED); @@ -976,9 +959,7 @@ struct getrusage_args { }; #endif int -sys_getrusage(td, uap) - register struct thread *td; - register struct getrusage_args *uap; +sys_getrusage(register struct thread *td, register struct getrusage_args *uap) { struct rusage ru; int error; @@ -1133,8 +1114,7 @@ lim_alloc() } struct plimit * -lim_hold(limp) - struct plimit *limp; +lim_hold(struct plimit *limp) { refcount_acquire(&limp->pl_refcnt); @@ -1142,8 +1122,7 @@ lim_hold(limp) } static __inline int -lim_shared(limp) - struct plimit *limp; +lim_shared(struct plimit *limp) { return (limp->pl_refcnt > 1); @@ -1164,8 +1143,7 @@ lim_fork(struct proc *p1, struct proc *p } void -lim_free(limp) - struct plimit *limp; +lim_free(struct plimit *limp) { if (refcount_release(&limp->pl_refcnt)) @@ -1177,8 +1155,7 @@ lim_free(limp) * We share these structures copy-on-write after fork. */ void -lim_copy(dst, src) - struct plimit *dst, *src; +lim_copy(struct plimit *dst, struct plimit *src) { KASSERT(!lim_shared(dst), ("lim_copy to shared limit")); @@ -1240,8 +1217,7 @@ uihashinit() * uihashtbl_lock must be locked. */ static struct uidinfo * -uilookup(uid) - uid_t uid; +uilookup(uid_t uid) { struct uihashhead *uipp; struct uidinfo *uip; @@ -1261,8 +1237,7 @@ uilookup(uid) * uifree() should be called on a struct uidinfo when released. */ struct uidinfo * -uifind(uid) - uid_t uid; +uifind(uid_t uid) { struct uidinfo *old_uip, *uip; @@ -1300,8 +1275,7 @@ uifind(uid) * Place another refcount on a uidinfo struct. */ void -uihold(uip) - struct uidinfo *uip; +uihold(struct uidinfo *uip) { refcount_acquire(&uip->ui_ref); @@ -1323,8 +1297,7 @@ uihold(uip) * order to try again. */ void -uifree(uip) - struct uidinfo *uip; +uifree(struct uidinfo *uip) { int old; @@ -1380,10 +1353,7 @@ ui_racct_foreach(void (*callback)(struct * a given user is using. When 'max' is 0, don't enforce a limit */ int -chgproccnt(uip, diff, max) - struct uidinfo *uip; - int diff; - rlim_t max; +chgproccnt(struct uidinfo *uip, int diff, rlim_t max) { /* Don't allow them to exceed max, but allow subtraction. */ @@ -1404,11 +1374,7 @@ chgproccnt(uip, diff, max) * Change the total socket buffer size a user has used. */ int -chgsbsize(uip, hiwat, to, max) - struct uidinfo *uip; - u_int *hiwat; - u_int to; - rlim_t max; +chgsbsize(struct uidinfo *uip, u_int *hiwat, u_int to, rlim_t max) { int diff; @@ -1432,10 +1398,7 @@ chgsbsize(uip, hiwat, to, max) * a given user is using. When 'max' is 0, don't enforce a limit */ int -chgptscnt(uip, diff, max) - struct uidinfo *uip; - int diff; - rlim_t max; +chgptscnt(struct uidinfo *uip, int diff, rlim_t max) { /* Don't allow them to exceed max, but allow subtraction. */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 20:20:06 2014 Return-Path: Delivered-To: svn-src-all@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 BB13E36D; Mon, 27 Oct 2014 20: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 A7D91D8F; Mon, 27 Oct 2014 20: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 s9RKK6Ww065967; Mon, 27 Oct 2014 20:20:06 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RKK6ln065966; Mon, 27 Oct 2014 20:20:06 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410272020.s9RKK6ln065966@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 27 Oct 2014 20:20:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273746 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 20:20:06 -0000 Author: mjg Date: Mon Oct 27 20:20:05 2014 New Revision: 273746 URL: https://svnweb.freebsd.org/changeset/base/273746 Log: Tidy up functions related to uidinfo management. - reference found uidinfo in uilookup - reduce nesting by handling shorter cases first Modified: head/sys/kern/kern_resource.c Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Mon Oct 27 20:18:30 2014 (r273745) +++ head/sys/kern/kern_resource.c Mon Oct 27 20:20:05 2014 (r273746) @@ -1215,6 +1215,7 @@ uihashinit() /* * Look up a uidinfo struct for the parameter uid. * uihashtbl_lock must be locked. + * Increase refcount on uidinfo struct returned. */ static struct uidinfo * uilookup(uid_t uid) @@ -1225,49 +1226,52 @@ uilookup(uid_t uid) rw_assert(&uihashtbl_lock, RA_LOCKED); uipp = UIHASH(uid); LIST_FOREACH(uip, uipp, ui_hash) - if (uip->ui_uid == uid) + if (uip->ui_uid == uid) { + uihold(uip); break; + } return (uip); } /* * Find or allocate a struct uidinfo for a particular uid. - * Increase refcount on uidinfo struct returned. + * Returns with uidinfo struct referenced. * uifree() should be called on a struct uidinfo when released. */ struct uidinfo * uifind(uid_t uid) { - struct uidinfo *old_uip, *uip; + struct uidinfo *new_uip, *uip; rw_rlock(&uihashtbl_lock); uip = uilookup(uid); - if (uip == NULL) { - rw_runlock(&uihashtbl_lock); - uip = malloc(sizeof(*uip), M_UIDINFO, M_WAITOK | M_ZERO); - racct_create(&uip->ui_racct); - rw_wlock(&uihashtbl_lock); - /* - * There's a chance someone created our uidinfo while we - * were in malloc and not holding the lock, so we have to - * make sure we don't insert a duplicate uidinfo. - */ - if ((old_uip = uilookup(uid)) != NULL) { - /* Someone else beat us to it. */ - racct_destroy(&uip->ui_racct); - free(uip, M_UIDINFO); - uip = old_uip; - } else { - refcount_init(&uip->ui_ref, 0); - uip->ui_uid = uid; - mtx_init(&uip->ui_vmsize_mtx, "ui_vmsize", NULL, - MTX_DEF); - LIST_INSERT_HEAD(UIHASH(uid), uip, ui_hash); - } + rw_runlock(&uihashtbl_lock); + if (uip != NULL) + return (uip); + + new_uip = malloc(sizeof(*new_uip), M_UIDINFO, M_WAITOK | M_ZERO); + racct_create(&new_uip->ui_racct); + refcount_init(&new_uip->ui_ref, 1); + new_uip->ui_uid = uid; + mtx_init(&new_uip->ui_vmsize_mtx, "ui_vmsize", NULL, MTX_DEF); + + rw_wlock(&uihashtbl_lock); + /* + * There's a chance someone created our uidinfo while we + * were in malloc and not holding the lock, so we have to + * make sure we don't insert a duplicate uidinfo. + */ + if ((uip = uilookup(uid)) == NULL) { + LIST_INSERT_HEAD(UIHASH(uid), new_uip, ui_hash); + rw_wunlock(&uihashtbl_lock); + uip = new_uip; + } else { + rw_wunlock(&uihashtbl_lock); + racct_destroy(&new_uip->ui_racct); + mtx_destroy(&new_uip->ui_vmsize_mtx); + free(new_uip, M_UIDINFO); } - uihold(uip); - rw_unlock(&uihashtbl_lock); return (uip); } @@ -1308,28 +1312,26 @@ uifree(struct uidinfo *uip) /* Prepare for suboptimal case. */ rw_wlock(&uihashtbl_lock); - if (refcount_release(&uip->ui_ref)) { - racct_destroy(&uip->ui_racct); - LIST_REMOVE(uip, ui_hash); + if (refcount_release(&uip->ui_ref) == 0) { rw_wunlock(&uihashtbl_lock); - if (uip->ui_sbsize != 0) - printf("freeing uidinfo: uid = %d, sbsize = %ld\n", - uip->ui_uid, uip->ui_sbsize); - if (uip->ui_proccnt != 0) - printf("freeing uidinfo: uid = %d, proccnt = %ld\n", - uip->ui_uid, uip->ui_proccnt); - if (uip->ui_vmsize != 0) - printf("freeing uidinfo: uid = %d, swapuse = %lld\n", - uip->ui_uid, (unsigned long long)uip->ui_vmsize); - mtx_destroy(&uip->ui_vmsize_mtx); - free(uip, M_UIDINFO); return; } - /* - * Someone added a reference between atomic_cmpset_int() and - * rw_wlock(&uihashtbl_lock). - */ + + racct_destroy(&uip->ui_racct); + LIST_REMOVE(uip, ui_hash); rw_wunlock(&uihashtbl_lock); + + if (uip->ui_sbsize != 0) + printf("freeing uidinfo: uid = %d, sbsize = %ld\n", + uip->ui_uid, uip->ui_sbsize); + if (uip->ui_proccnt != 0) + printf("freeing uidinfo: uid = %d, proccnt = %ld\n", + uip->ui_uid, uip->ui_proccnt); + if (uip->ui_vmsize != 0) + printf("freeing uidinfo: uid = %d, swapuse = %lld\n", + uip->ui_uid, (unsigned long long)uip->ui_vmsize); + mtx_destroy(&uip->ui_vmsize_mtx); + free(uip, M_UIDINFO); } void From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 21:29:43 2014 Return-Path: Delivered-To: svn-src-all@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 9F04F436; Mon, 27 Oct 2014 21:29:43 +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 7F507773; Mon, 27 Oct 2014 21:29:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9RLThPh098346; Mon, 27 Oct 2014 21:29:43 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RLTgep098342; Mon, 27 Oct 2014 21:29:42 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410272129.s9RLTgep098342@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 27 Oct 2014 21:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273747 - in head: contrib/hyperv/tools share/man/man8 tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 21:29:43 -0000 Author: delphij Date: Mon Oct 27 21:29:42 2014 New Revision: 273747 URL: https://svnweb.freebsd.org/changeset/base/273747 Log: Remove an extra copy of hv_kvp_daemon(8) [1]. While I'm there also correct typos in OptionalObsoleteFiles and add information of the command line options for hv_kvp_daemon(8). Reported by: jmg [1] Reviewed by: jmg MFC after: 2 weeks Deleted: head/share/man/man8/hv_kvp_daemon.8 Modified: head/contrib/hyperv/tools/hv_kvp_daemon.8 head/share/man/man8/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/contrib/hyperv/tools/hv_kvp_daemon.8 ============================================================================== --- head/contrib/hyperv/tools/hv_kvp_daemon.8 Mon Oct 27 20:20:05 2014 (r273746) +++ head/contrib/hyperv/tools/hv_kvp_daemon.8 Mon Oct 27 21:29:42 2014 (r273747) @@ -22,41 +22,71 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 10, 2013 -.Dt HYPER-V 4 +.\" $FreeBSD$ +.Dd October 27, 2014 +.Dt HV_KVP_DAEMON 8 .Os .Sh NAME .Nm hv_kvp_daemon .Nd Hyper-V Key Value Pair Daemon .Sh SYNOPSIS -The \fBhv_kvp_daemon\fP daemon provides the ability to store, retrieve, modify and delete -Key Value pairs for FreeBSD guest partitions running on Hyper-V. +.Nm +.Op Fl dn .Sh DESCRIPTION +The +.Nm +daemon provides the ability to store, retrieve, modify and delete +Key Value pairs for +.Fx +guest partitions running on Hyper-V. +.Pp Hyper-V allows administrators to store custom metadata in the form -of Key Value pairs inside the FreeBSD guest partition. Administrators can +of Key Value pairs inside the +.Fx +guest partition. +Administrators can use Windows Powershell scripts to add, read, modify and delete such Key Value pairs. - -The \fBhv_kvp_daemon\fP accepts Key Value pair management requests from the -\fBhv_utils\fP driver and performs the actual metadata management on the file-system. - +.Pp +The +.Nm +accepts Key Value pair management requests from the +.Xr hv_utils 4 +driver and performs the actual metadata management on the file-system. +.Pp The same daemon and driver combination is also used to set and get -IP addresses from a FreeBSD guest. - +IP addresses from a +.Fx +guest. +.Pp The set functionality is particularly -useful when the FreeBSD guest is assigned a static IP address and is failed -over from one Hyper-V host to another. After failover, Hyper-V uses the set IP +useful when the +.Fx +guest is assigned a static IP address and is failed +over from one Hyper-V host to another. +After failover, Hyper-V uses the set IP functionality to automatically -update the FreeBSD guest's IP address to its original static value. - +update the +.Fx +guest's IP address to its original static value. +.Pp On the other hand, the get IP functionality is used to update the guest IP address in the Hyper-V management console window. +.Pp +The options are as follows: +.Bl -tag -width indent +.It Fl d +Run as regular process instead of a daemon for debugging purpose. +.It Fl n +Generate debugging output. +.El .Sh SEE ALSO .Xr hv_vmbus 4 , .Xr hv_utils 4 , .Xr hv_netvsc 4 , .Xr hv_storvsc 4 , -.Xr hv_ata_pci_disengage 4 +.Xr hv_ata_pci_disengage 4 , +.Xr hv_kvp 4 .Sh HISTORY Support for Hyper-V in the form of ports was first released in September 2013. The daemon was developed through a joint effort between Citrix Inc., @@ -64,5 +94,7 @@ Microsoft Corp. and Network Appliance In .Sh AUTHORS .An -nosplit .Fx -support for \fBhv_kvp_daemon\fP was first added by -.An Microsoft BSD Integration Services Team Aq bsdic@microsoft.com . +support for +.Nm +was first added by +.An Microsoft BSD Integration Services Team Aq Mt bsdic@microsoft.com . Modified: head/share/man/man8/Makefile ============================================================================== --- head/share/man/man8/Makefile Mon Oct 27 20:20:05 2014 (r273746) +++ head/share/man/man8/Makefile Mon Oct 27 21:29:42 2014 (r273747) @@ -3,7 +3,6 @@ MAN= crash.8 \ diskless.8 \ - hv_kvp_daemon.8 \ intro.8 \ nanobsd.8 \ picobsd.8 \ Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Oct 27 20:20:05 2014 (r273746) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Oct 27 21:29:42 2014 (r273747) @@ -4779,5 +4779,6 @@ OLD_FILES+=etc/devd/hyperv.conf OLD_FILES+=usr/libexec/hyperv/hv_set_ifconfig OLD_FILES+=usr/libexec/hyperv/hv_get_dns_info OLD_FILES+=usr/libexec/hyperv/hv_get_dhcp_info -OLD_FILES+=usr/sbin/hv_kvpd +OLD_FILES+=usr/sbin/hv_kvp_daemon +OLD_FILES+=usr/share/man/man8/hv_kvp_daemon.8.gz .endif From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 22:02:36 2014 Return-Path: Delivered-To: svn-src-all@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 131D2307; Mon, 27 Oct 2014 22:02: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 E833DB73; Mon, 27 Oct 2014 22:02: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 s9RM2ZUT016517; Mon, 27 Oct 2014 22:02:35 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RM2Z7S016516; Mon, 27 Oct 2014 22:02:35 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201410272202.s9RM2Z7S016516@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Mon, 27 Oct 2014 22:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273748 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 22:02:36 -0000 Author: grehan Date: Mon Oct 27 22:02:35 2014 New Revision: 273748 URL: https://svnweb.freebsd.org/changeset/base/273748 Log: Output a summary of optional SVM features in dmesg similar to CPU features. If bootverbose is enabled, a detailed list is provided; otherwise, a single-line summary is displayed. Differential Revision: https://reviews.freebsd.org/D1008 Reviewed by: jhb, neel MFC after: 1 week Modified: head/sys/x86/x86/identcpu.c Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Mon Oct 27 21:29:42 2014 (r273747) +++ head/sys/x86/x86/identcpu.c Mon Oct 27 22:02:35 2014 (r273748) @@ -76,6 +76,7 @@ static u_int find_cpu_vendor_id(void); static void print_AMD_info(void); static void print_INTEL_info(void); static void print_INTEL_TLB(u_int data); +static void print_svm_info(void); static void print_via_padlock_info(void); static void print_vmx_info(void); @@ -932,6 +933,9 @@ printcpuinfo(void) if (cpu_feature2 & CPUID2_VMX) print_vmx_info(); + if (amd_feature2 & AMDID2_SVM) + print_svm_info(); + if ((cpu_feature & CPUID_HTT) && cpu_vendor_id == CPU_VENDOR_AMD) cpu_feature &= ~CPUID_HTT; @@ -1735,6 +1739,67 @@ print_INTEL_TLB(u_int data) } } +static void +print_svm_info(void) +{ + u_int features, regs[4]; + uint64_t msr; + int comma; + + printf("\n SVM: "); + do_cpuid(0x8000000A, regs); + features = regs[3]; + + msr = rdmsr(MSR_VM_CR); + if ((msr & VM_CR_SVMDIS) == VM_CR_SVMDIS) + printf("(disabled in BIOS) "); + + if (!bootverbose) { + comma = 0; + if (features & (1 << 0)) { + printf("%sNP", comma ? "," : ""); + comma = 1; + } + if (features & (1 << 3)) { + printf("%sNRIP", comma ? "," : ""); + comma = 1; + } + if (features & (1 << 5)) { + printf("%sVClean", comma ? "," : ""); + comma = 1; + } + if (features & (1 << 6)) { + printf("%sAFlush", comma ? "," : ""); + comma = 1; + } + if (features & (1 << 7)) { + printf("%sDAssist", comma ? "," : ""); + comma = 1; + } + printf("%sNAsids=%d", comma ? "," : "", regs[1]); + return; + } + + printf("Features=0x%b", features, + "\020" + "\001NP" /* Nested paging */ + "\002LbrVirt" /* LBR virtualization */ + "\003SVML" /* SVM lock */ + "\004NRIPS" /* NRIP save */ + "\005TscRateMsr" /* MSR based TSC rate control */ + "\006VmcbClean" /* VMCB clean bits */ + "\007FlushByAsid" /* Flush by ASID */ + "\010DecodeAssist" /* Decode assist */ + "\011" + "\012" + "\013PauseFilter" /* PAUSE intercept filter */ + "\014" + "\015PauseFilterThreshold" /* PAUSE filter threshold */ + "\016AVIC" /* virtual interrupt controller */ + ); + printf("\nRevision=%d, ASIDs=%d", regs[0] & 0xff, regs[1]); +} + #ifdef __i386__ static void print_transmeta_info(void) From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 22:20:52 2014 Return-Path: Delivered-To: svn-src-all@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 3C5FAA73; Mon, 27 Oct 2014 22:20: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 2835ECDF; Mon, 27 Oct 2014 22:20: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 s9RMKqZh023495; Mon, 27 Oct 2014 22:20:52 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RMKqOF023494; Mon, 27 Oct 2014 22:20:52 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201410272220.s9RMKqOF023494@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Mon, 27 Oct 2014 22:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273749 - head/sys/amd64/vmm/amd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 22:20:52 -0000 Author: grehan Date: Mon Oct 27 22:20:51 2014 New Revision: 273749 URL: https://svnweb.freebsd.org/changeset/base/273749 Log: Remove bhyve SVM feature printf's now that they are available in the general CPU feature detection code. Reviewed by: neel Modified: head/sys/amd64/vmm/amd/svm.c Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Mon Oct 27 22:02:35 2014 (r273748) +++ head/sys/amd64/vmm/amd/svm.c Mon Oct 27 22:20:51 2014 (r273749) @@ -174,30 +174,9 @@ check_svm_features(void) do_cpuid(0x8000000A, regs); svm_feature = regs[3]; - printf("SVM: Revision %d\n", regs[0] & 0xFF); - printf("SVM: NumASID %u\n", regs[1]); - nasid = regs[1]; KASSERT(nasid > 1, ("Insufficient ASIDs for guests: %#x", nasid)); - printf("SVM: Features 0x%b\n", svm_feature, - "\020" - "\001NP" /* Nested paging */ - "\002LbrVirt" /* LBR virtualization */ - "\003SVML" /* SVM lock */ - "\004NRIPS" /* NRIP save */ - "\005TscRateMsr" /* MSR based TSC rate control */ - "\006VmcbClean" /* VMCB clean bits */ - "\007FlushByAsid" /* Flush by ASID */ - "\010DecodeAssist" /* Decode assist */ - "\011" - "\012" - "\013PauseFilter" - "\014" - "\015PauseFilterThreshold" - "\016AVIC" - ); - /* bhyve requires the Nested Paging feature */ if (!(svm_feature & AMD_CPUID_SVM_NP)) { printf("SVM: Nested Paging feature not available.\n"); From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 22:22:46 2014 Return-Path: Delivered-To: svn-src-all@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 E5AF2BC5; Mon, 27 Oct 2014 22:22: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 D1ABDD7B; Mon, 27 Oct 2014 22:22: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 s9RMMkrg026090; Mon, 27 Oct 2014 22:22:46 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RMMkaT026089; Mon, 27 Oct 2014 22:22:46 GMT (envelope-from np@FreeBSD.org) Message-Id: <201410272222.s9RMMkaT026089@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 27 Oct 2014 22:22:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273750 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 22:22:47 -0000 Author: np Date: Mon Oct 27 22:22:46 2014 New Revision: 273750 URL: https://svnweb.freebsd.org/changeset/base/273750 Log: Some cxgbe/iw_cxgbe fixes: - Free rt in c4iw_connect only if it is allocated. - Call soclose instead of so_shutdown if there is an abort from the peer. - Close socket and return failure if TOE is not enabled. Submitted by: Hariprasad at Chelsio dot com Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Mon Oct 27 22:20:51 2014 (r273749) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Mon Oct 27 22:22:46 2014 (r273750) @@ -474,7 +474,7 @@ process_conn_error(struct c4iw_ep *ep) if (state != ABORTING) { CTR2(KTR_IW_CXGBE, "%s:pce1 %p", __func__, ep); - close_socket(&ep->com, 0); + close_socket(&ep->com, 1); state_set(&ep->com, DEAD); c4iw_put_ep(&ep->com); } @@ -2084,14 +2084,15 @@ int c4iw_connect(struct iw_cm_id *cm_id, CTR2(KTR_IW_CXGBE, "%s:cc7 %p", __func__, ep); printk(KERN_ERR MOD "%s - cannot find route.\n", __func__); err = -EHOSTUNREACH; - goto fail3; + goto fail2; } - - if (!(rt->rt_ifp->if_flags & IFCAP_TOE)) { + if (!(rt->rt_ifp->if_capenable & IFCAP_TOE)) { CTR2(KTR_IW_CXGBE, "%s:cc8 %p", __func__, ep); printf("%s - interface not TOE capable.\n", __func__); + close_socket(&ep->com, 0); + err = -ENOPROTOOPT; goto fail3; } tdev = TOEDEV(rt->rt_ifp); From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 22:41:56 2014 Return-Path: Delivered-To: svn-src-all@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 368D0F8E; Mon, 27 Oct 2014 22:41: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 22E71F58; Mon, 27 Oct 2014 22:41: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 s9RMfudM035460; Mon, 27 Oct 2014 22:41:56 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RMftda035459; Mon, 27 Oct 2014 22:41:55 GMT (envelope-from np@FreeBSD.org) Message-Id: <201410272241.s9RMftda035459@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 27 Oct 2014 22:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273751 - head/sys/contrib/rdma/krping X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 22:41:56 -0000 Author: np Date: Mon Oct 27 22:41:55 2014 New Revision: 273751 URL: https://svnweb.freebsd.org/changeset/base/273751 Log: krping: In verbose mode print only first 128 bytes of krping data. Submitted by: Hariprasad at Chelsio dot com. Sponsored by: Chelsio Communications Modified: head/sys/contrib/rdma/krping/krping.c Modified: head/sys/contrib/rdma/krping/krping.c ============================================================================== --- head/sys/contrib/rdma/krping/krping.c Mon Oct 27 22:22:46 2014 (r273750) +++ head/sys/contrib/rdma/krping/krping.c Mon Oct 27 22:41:55 2014 (r273751) @@ -1011,9 +1011,17 @@ static void krping_test_server(struct kr DEBUG_LOG(cb, "server received read complete\n"); /* Display data in recv buf */ - if (cb->verbose) - PRINTF(cb, "server ping data: %s\n", - cb->rdma_buf); + if (cb->verbose) { + if (strlen(cb->rdma_buf) > 128) { + char msgbuf[128]; + + strlcpy(msgbuf, cb->rdma_buf, sizeof(msgbuf)); + PRINTF(cb, "server ping data stripped: %s\n", + msgbuf); + } else + PRINTF(cb, "server ping data: %s\n", + cb->rdma_buf); + } /* Tell client to continue */ if (cb->server && cb->server_invalidate) { @@ -1713,8 +1721,16 @@ static void krping_test_client(struct kr break; } - if (cb->verbose) - PRINTF(cb, "ping data: %s\n", cb->rdma_buf); + if (cb->verbose) { + if (strlen(cb->rdma_buf) > 128) { + char msgbuf[128]; + + strlcpy(msgbuf, cb->rdma_buf, sizeof(msgbuf)); + PRINTF(cb, "ping data stripped: %s\n", + msgbuf); + } else + PRINTF(cb, "ping data: %s\n", cb->rdma_buf); + } #ifdef SLOW_KRPING wait_event_interruptible_timeout(cb->sem, cb->state == ERROR, HZ); #endif From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 23:03:18 2014 Return-Path: Delivered-To: svn-src-all@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 92595664; Mon, 27 Oct 2014 23:03: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 7E4251D7; Mon, 27 Oct 2014 23:03: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 s9RN3IrM045083; Mon, 27 Oct 2014 23:03:18 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RN3I2U045082; Mon, 27 Oct 2014 23:03:18 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201410272303.s9RN3I2U045082@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Mon, 27 Oct 2014 23:03:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273752 - head/lib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 23:03:18 -0000 Author: jmg Date: Mon Oct 27 23:03:17 2014 New Revision: 273752 URL: https://svnweb.freebsd.org/changeset/base/273752 Log: fix typo, properly install a link to nv for nvlist_freev... Modified: head/lib/libnv/Makefile Modified: head/lib/libnv/Makefile ============================================================================== --- head/lib/libnv/Makefile Mon Oct 27 22:41:55 2014 (r273751) +++ head/lib/libnv/Makefile Mon Oct 27 23:03:17 2014 (r273752) @@ -149,7 +149,7 @@ MLINKS+=nv.3 nvlist_existsv.3 \ nv.3 nvlist_takev_nvlist.3 \ nv.3 nvlist_takev_descriptor.3 \ nv.3 nvlist_takev_binary.3 \ - nv.3 nvlist_freef.3 \ + nv.3 nvlist_freev.3 \ nv.3 nvlist_freev_type.3 \ nv.3 nvlist_freev_null.3 \ nv.3 nvlist_freev_bool.3 \ From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 23:11:49 2014 Return-Path: Delivered-To: svn-src-all@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 B5E52847; Mon, 27 Oct 2014 23:11: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 88A6D2E9; Mon, 27 Oct 2014 23:11: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 s9RNBnCH049699; Mon, 27 Oct 2014 23:11:49 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RNBnHY049698; Mon, 27 Oct 2014 23:11:49 GMT (envelope-from np@FreeBSD.org) Message-Id: <201410272311.s9RNBnHY049698@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 27 Oct 2014 23:11:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273753 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 23:11:49 -0000 Author: np Date: Mon Oct 27 23:11:48 2014 New Revision: 273753 URL: https://svnweb.freebsd.org/changeset/base/273753 Log: iwcm_event status needs to be populated for close_complete_upcall Submitted by: Hariprasad at Chelsio dot com Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Mon Oct 27 23:03:17 2014 (r273752) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Mon Oct 27 23:11:48 2014 (r273753) @@ -94,7 +94,7 @@ static void abort_socket(struct c4iw_ep static void send_mpa_req(struct c4iw_ep *ep); static int send_mpa_reject(struct c4iw_ep *ep, const void *pdata, u8 plen); static int send_mpa_reply(struct c4iw_ep *ep, const void *pdata, u8 plen); -static void close_complete_upcall(struct c4iw_ep *ep); +static void close_complete_upcall(struct c4iw_ep *ep, int status); static int abort_connection(struct c4iw_ep *ep); static void peer_close_upcall(struct c4iw_ep *ep); static void peer_abort_upcall(struct c4iw_ep *ep); @@ -366,7 +366,7 @@ process_peer_close(struct c4iw_ep *ep) C4IW_QP_ATTR_NEXT_STATE, &attrs, 1); } close_socket(&ep->com, 0); - close_complete_upcall(ep); + close_complete_upcall(ep, 0); __state_set(&ep->com, DEAD); release = 1; disconnect = 0; @@ -528,7 +528,7 @@ process_close_complete(struct c4iw_ep *e CTR2(KTR_IW_CXGBE, "%s:pcc4 %p", __func__, ep); close_socket(&ep->com, 0); } - close_complete_upcall(ep); + close_complete_upcall(ep, 0); __state_set(&ep->com, DEAD); release = 1; break; @@ -1192,13 +1192,14 @@ static int send_mpa_reply(struct c4iw_ep -static void close_complete_upcall(struct c4iw_ep *ep) +static void close_complete_upcall(struct c4iw_ep *ep, int status) { struct iw_cm_event event; CTR2(KTR_IW_CXGBE, "%s:ccuB %p", __func__, ep); memset(&event, 0, sizeof(event)); event.event = IW_CM_EVENT_CLOSE; + event.status = status; if (ep->com.cm_id) { @@ -1217,7 +1218,7 @@ static int abort_connection(struct c4iw_ int err; CTR2(KTR_IW_CXGBE, "%s:abB %p", __func__, ep); - close_complete_upcall(ep); + close_complete_upcall(ep, -ECONNRESET); state_set(&ep->com, ABORTING); abort_socket(ep); err = close_socket(&ep->com, 0); @@ -2212,7 +2213,7 @@ int c4iw_ep_disconnect(struct c4iw_ep *e CTR2(KTR_IW_CXGBE, "%s:ced1 %p", __func__, ep); fatal = 1; - close_complete_upcall(ep); + close_complete_upcall(ep, -EIO); ep->com.state = DEAD; } CTR3(KTR_IW_CXGBE, "%s:ced2 %p %s", __func__, ep, From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 23:19:52 2014 Return-Path: Delivered-To: svn-src-all@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 A9CFEB59; Mon, 27 Oct 2014 23:19: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 8A5B0361; Mon, 27 Oct 2014 23:19: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 s9RNJqBI050740; Mon, 27 Oct 2014 23:19:52 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RNJqCo050738; Mon, 27 Oct 2014 23:19:52 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201410272319.s9RNJqCo050738@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Mon, 27 Oct 2014 23:19:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273754 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 23:19:52 -0000 Author: nwhitehorn Date: Mon Oct 27 23:19:51 2014 New Revision: 273754 URL: https://svnweb.freebsd.org/changeset/base/273754 Log: Use pkg-1.4-style platform identifiers based on MACHINE_ARCH (e.g. FreeBSD:11:amd64 instead of freebsd:11:x86:64) when bootstrapping pkg. Thanks to portmgr for providing symlinks so both styles work. Reviewed by: bapt MFC after: 3 weeks Deleted: head/usr.sbin/pkg/elf_tables.h Modified: head/usr.sbin/pkg/Makefile head/usr.sbin/pkg/config.c Modified: head/usr.sbin/pkg/Makefile ============================================================================== --- head/usr.sbin/pkg/Makefile Mon Oct 27 23:11:48 2014 (r273753) +++ head/usr.sbin/pkg/Makefile Mon Oct 27 23:19:51 2014 (r273754) @@ -8,7 +8,7 @@ CFLAGS+=-I${.CURDIR}/../../contrib/libuc .PATH: ${.CURDIR}/../../contrib/libucl/include DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBUCL} ${LIBSBUF} ${LIBSSL} \ ${LIBCRYPTO} ${LIBM} -LDADD= -larchive -lelf -lfetch ${LDUCL} -lsbuf -lssl -lcrypto -lm +LDADD= -larchive -lfetch ${LDUCL} -lsbuf -lssl -lcrypto -lm USEPRIVATELIB= ucl .include Modified: head/usr.sbin/pkg/config.c ============================================================================== --- head/usr.sbin/pkg/config.c Mon Oct 27 23:11:48 2014 (r273753) +++ head/usr.sbin/pkg/config.c Mon Oct 27 23:19:51 2014 (r273754) @@ -31,9 +31,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include +#include +#include #include #include @@ -42,14 +42,12 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include #include -#include "elf_tables.h" #include "config.h" #define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ @@ -135,349 +133,32 @@ static struct config_entry c[] = { }, }; -static const char * -elf_corres_to_string(struct _elf_corres *m, int e) -{ - int i; - - for (i = 0; m[i].string != NULL; i++) - if (m[i].elf_nb == e) - return (m[i].string); - - return ("unknown"); -} - -static const char * -aeabi_parse_arm_attributes(void *data, size_t length) -{ - uint32_t sect_len; - uint8_t *section = data; - -#define MOVE(len) do { \ - assert(length >= (len)); \ - section += (len); \ - length -= (len); \ -} while (0) - - if (length == 0 || *section != 'A') - return (NULL); - - MOVE(1); - - /* Read the section length */ - if (length < sizeof(sect_len)) - return (NULL); - - memcpy(§_len, section, sizeof(sect_len)); - - /* - * The section length should be no longer than the section it is within - */ - if (sect_len > length) - return (NULL); - - MOVE(sizeof(sect_len)); - - /* Skip the vendor name */ - while (length != 0) { - if (*section == '\0') - break; - MOVE(1); - } - if (length == 0) - return (NULL); - MOVE(1); - - while (length != 0) { - uint32_t tag_length; - - switch(*section) { - case 1: /* Tag_File */ - MOVE(1); - if (length < sizeof(tag_length)) - return (NULL); - memcpy(&tag_length, section, sizeof(tag_length)); - break; - case 2: /* Tag_Section */ - case 3: /* Tag_Symbol */ - default: - return (NULL); - } - /* At least space for the tag and size */ - if (tag_length <= 5) - return (NULL); - tag_length--; - /* Check the tag fits */ - if (tag_length > length) - return (NULL); - -#define MOVE_TAG(len) do { \ - assert(tag_length >= (len)); \ - MOVE(len); \ - tag_length -= (len); \ -} while(0) - - MOVE(sizeof(tag_length)); - tag_length -= sizeof(tag_length); - - while (tag_length != 0) { - uint8_t tag; - - assert(tag_length >= length); - - tag = *section; - MOVE_TAG(1); - - /* - * These tag values come from: - * - * Addenda to, and Errata in, the ABI for the - * ARM Architecture. Release 2.08, section 2.3. - */ - if (tag == 6) { /* == Tag_CPU_arch */ - uint8_t val; - - val = *section; - /* - * We don't support values that require - * more than one byte. - */ - if (val & (1 << 7)) - return (NULL); - - /* We have an ARMv4 or ARMv5 */ - if (val <= 5) - return ("arm"); - else /* We have an ARMv6+ */ - return ("armv6"); - } else if (tag == 4 || tag == 5 || tag == 32 || - tag == 65 || tag == 67) { - while (*section != '\0' && length != 0) - MOVE_TAG(1); - if (tag_length == 0) - return (NULL); - /* Skip the last byte */ - MOVE_TAG(1); - } else if ((tag >= 7 && tag <= 31) || tag == 34 || - tag == 36 || tag == 38 || tag == 42 || tag == 44 || - tag == 64 || tag == 66 || tag == 68 || tag == 70) { - /* Skip the uleb128 data */ - while (*section & (1 << 7) && length != 0) - MOVE_TAG(1); - if (tag_length == 0) - return (NULL); - /* Skip the last byte */ - MOVE_TAG(1); - } else - return (NULL); -#undef MOVE_TAG - } - - break; - } - return (NULL); -#undef MOVE -} - static int pkg_get_myabi(char *dest, size_t sz) { - Elf *elf; - Elf_Data *data; - Elf_Note note; - Elf_Scn *scn; - char *src, *osname; - const char *arch, *abi, *fpu, *endian_corres_str; - const char *wordsize_corres_str; - GElf_Ehdr elfhdr; - GElf_Shdr shdr; - int fd, i, ret; - uint32_t version; - - version = 0; - ret = -1; - scn = NULL; - abi = NULL; - - if (elf_version(EV_CURRENT) == EV_NONE) { - warnx("ELF library initialization failed: %s", - elf_errmsg(-1)); - return (-1); - } - - if ((fd = open(_PATH_BSHELL, O_RDONLY)) < 0) { - warn("open()"); - return (-1); - } - - if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { - ret = -1; - warnx("elf_begin() failed: %s.", elf_errmsg(-1)); - goto cleanup; - } - - if (gelf_getehdr(elf, &elfhdr) == NULL) { - ret = -1; - warn("getehdr() failed: %s.", elf_errmsg(-1)); - goto cleanup; - } - while ((scn = elf_nextscn(elf, scn)) != NULL) { - if (gelf_getshdr(scn, &shdr) != &shdr) { - ret = -1; - warn("getshdr() failed: %s.", elf_errmsg(-1)); - goto cleanup; - } + struct utsname uts; + char machine_arch[255]; + size_t len; + int error; + + error = uname(&uts); + if (error) + return (errno); + + len = sizeof(machine_arch); + error = sysctlbyname("hw.machine_arch", machine_arch, &len, NULL, 0); + if (error) + return (errno); + machine_arch[len] = '\0'; - if (shdr.sh_type == SHT_NOTE) - break; - } - - if (scn == NULL) { - ret = -1; - warn("failed to get the note section"); - goto cleanup; - } - - data = elf_getdata(scn, NULL); - src = data->d_buf; - for (;;) { - memcpy(¬e, src, sizeof(Elf_Note)); - src += sizeof(Elf_Note); - if (note.n_type == NT_VERSION) - break; - src += note.n_namesz + note.n_descsz; - } - osname = src; - src += roundup2(note.n_namesz, 4); - if (elfhdr.e_ident[EI_DATA] == ELFDATA2MSB) - version = be32dec(src); - else - version = le32dec(src); - - for (i = 0; osname[i] != '\0'; i++) - osname[i] = (char)tolower(osname[i]); - - wordsize_corres_str = elf_corres_to_string(wordsize_corres, - (int)elfhdr.e_ident[EI_CLASS]); - - arch = elf_corres_to_string(mach_corres, (int) elfhdr.e_machine); - - snprintf(dest, sz, "%s:%d", - osname, version / 100000); - - ret = 0; - - switch (elfhdr.e_machine) { - case EM_ARM: - endian_corres_str = elf_corres_to_string(endian_corres, - (int)elfhdr.e_ident[EI_DATA]); - - /* FreeBSD doesn't support the hard-float ABI yet */ - fpu = "softfp"; - if ((elfhdr.e_flags & 0xFF000000) != 0) { - const char *sh_name = NULL; - size_t shstrndx; - - /* This is an EABI file, the conformance level is set */ - abi = "eabi"; - /* Find which TARGET_ARCH we are building for. */ - elf_getshdrstrndx(elf, &shstrndx); - while ((scn = elf_nextscn(elf, scn)) != NULL) { - sh_name = NULL; - if (gelf_getshdr(scn, &shdr) != &shdr) { - scn = NULL; - break; - } - - sh_name = elf_strptr(elf, shstrndx, - shdr.sh_name); - if (sh_name == NULL) - continue; - if (strcmp(".ARM.attributes", sh_name) == 0) - break; - } - if (scn != NULL && sh_name != NULL) { - data = elf_getdata(scn, NULL); - /* - * Prior to FreeBSD 10.0 libelf would return - * NULL from elf_getdata on the .ARM.attributes - * section. As this was the first release to - * get armv6 support assume a NULL value means - * arm. - * - * This assumption can be removed when 9.x - * is unsupported. - */ - if (data != NULL) { - arch = aeabi_parse_arm_attributes( - data->d_buf, data->d_size); - if (arch == NULL) { - ret = 1; - warn("unknown ARM ARCH"); - goto cleanup; - } - } - } else { - ret = 1; - warn("Unable to find the .ARM.attributes " - "section"); - goto cleanup; - } - } else if (elfhdr.e_ident[EI_OSABI] != ELFOSABI_NONE) { - /* - * EABI executables all have this field set to - * ELFOSABI_NONE, therefore it must be an oabi file. - */ - abi = "oabi"; - } else { - ret = 1; - warn("unknown ARM ABI"); - goto cleanup; - } - snprintf(dest + strlen(dest), sz - strlen(dest), - ":%s:%s:%s:%s:%s", arch, wordsize_corres_str, - endian_corres_str, abi, fpu); - break; - case EM_MIPS: - /* - * this is taken from binutils sources: - * include/elf/mips.h - * mapping is figured out from binutils: - * gas/config/tc-mips.c - */ - switch (elfhdr.e_flags & EF_MIPS_ABI) { - case E_MIPS_ABI_O32: - abi = "o32"; - break; - case E_MIPS_ABI_N32: - abi = "n32"; - break; - default: - if (elfhdr.e_ident[EI_DATA] == - ELFCLASS32) - abi = "o32"; - else if (elfhdr.e_ident[EI_DATA] == - ELFCLASS64) - abi = "n64"; - break; - } - endian_corres_str = elf_corres_to_string(endian_corres, - (int)elfhdr.e_ident[EI_DATA]); - - snprintf(dest + strlen(dest), sz - strlen(dest), ":%s:%s:%s:%s", - arch, wordsize_corres_str, endian_corres_str, abi); - break; - default: - snprintf(dest + strlen(dest), sz - strlen(dest), ":%s:%s", - arch, wordsize_corres_str); - } - -cleanup: - if (elf != NULL) - elf_end(elf); + /* + * Use __FreeBSD_version rather than kernel version (uts.release) for + * use in jails. This is equivalent to the value of uname -U. + */ + snprintf(dest, sz, "%s:%d:%s", uts.sysname, __FreeBSD_version/100000, + machine_arch); - close(fd); - return (ret); + return (error); } static void From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 23:31:08 2014 Return-Path: Delivered-To: svn-src-all@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 5BE8AD45; Mon, 27 Oct 2014 23:31: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 484E1655; Mon, 27 Oct 2014 23:31: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 s9RNV8N2058122; Mon, 27 Oct 2014 23:31:08 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RNV8pJ058121; Mon, 27 Oct 2014 23:31:08 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201410272331.s9RNV8pJ058121@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 27 Oct 2014 23:31:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273755 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 23:31:08 -0000 Author: bapt Date: Mon Oct 27 23:31:07 2014 New Revision: 273755 URL: https://svnweb.freebsd.org/changeset/base/273755 Log: Rename XFLAGS to XCFLAGS and XXFLAGS to XCXXFLAGS This is less confusing names and actually more reflexting what they are intended to. Discussed with: brooks Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Oct 27 23:19:51 2014 (r273754) +++ head/Makefile.inc1 Mon Oct 27 23:31:07 2014 (r273755) @@ -323,9 +323,9 @@ X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX}${ X${BINUTIL}?= ${${BINUTIL}} .endif .endfor -WMAKEENV+= CC="${XCC} ${XFLAGS}" CXX="${XCXX} ${XFLAGS} ${XXFLAGS}" \ +WMAKEENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCFLAGS} ${XCXXFLAGS}" \ DEPFLAGS="${DEPFLAGS}" \ - CPP="${XCPP} ${XFLAGS}" \ + CPP="${XCPP} ${XCFLAGS}" \ AS="${XAS}" AR="${XAR}" LD="${XLD}" NM=${XNM} \ OBJDUMP=${XOBJDUMP} OBJCOPY="${XOBJCOPY}" \ RANLIB=${XRANLIB} STRINGS=${XSTRINGS} \ @@ -351,13 +351,13 @@ TARGET_ABI= gnueabi .endif .endif .if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc -XFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib -XXFLAGS+= -I${WORLDTMP}/usr/include/c++/v1 -std=gnu++11 -L${WORLDTMP}/../lib/libc++ +XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib +XCXXFLAGS+= -I${WORLDTMP}/usr/include/c++/v1 -std=gnu++11 -L${WORLDTMP}/../lib/libc++ DEPFLAGS+= -I${WORLDTMP}/usr/include/c++/v1 .else TARGET_ABI?= unknown TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0 -XFLAGS+= -target ${TARGET_TRIPLE} +XCFLAGS+= -target ${TARGET_TRIPLE} .endif .endif From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 23:43:26 2014 Return-Path: Delivered-To: svn-src-all@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 2728B194; Mon, 27 Oct 2014 23:43: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 1348883D; Mon, 27 Oct 2014 23:43: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 s9RNhPbC064077; Mon, 27 Oct 2014 23:43:25 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9RNhPW8064075; Mon, 27 Oct 2014 23:43:25 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201410272343.s9RNhPW8064075@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Mon, 27 Oct 2014 23:43:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273756 - in head/lib: libusb libz X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 23:43:26 -0000 Author: jmg Date: Mon Oct 27 23:43:25 2014 New Revision: 273756 URL: https://svnweb.freebsd.org/changeset/base/273756 Log: only install .pc files when we are not installing 32bit compat libs... This fixes the problem of installing the .pc files multiple times... Modified: head/lib/libusb/Makefile head/lib/libz/Makefile Modified: head/lib/libusb/Makefile ============================================================================== --- head/lib/libusb/Makefile Mon Oct 27 23:31:07 2014 (r273755) +++ head/lib/libusb/Makefile Mon Oct 27 23:43:25 2014 (r273756) @@ -38,6 +38,7 @@ SRCS+= libusb10_io.c CFLAGS+= -DCOMPAT_32BIT .endif +.ifndef COMPAT_32BIT beforeinstall: ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${.CURDIR}/libusb-0.1.pc ${DESTDIR}${LIBDATADIR}/pkgconfig @@ -45,6 +46,7 @@ beforeinstall: ${.CURDIR}/libusb-1.0.pc ${DESTDIR}${LIBDATADIR}/pkgconfig ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${.CURDIR}/libusb-2.0.pc ${DESTDIR}${LIBDATADIR}/pkgconfig +.endif # # Cross platform support Modified: head/lib/libz/Makefile ============================================================================== --- head/lib/libz/Makefile Mon Oct 27 23:31:07 2014 (r273755) +++ head/lib/libz/Makefile Mon Oct 27 23:43:25 2014 (r273756) @@ -68,9 +68,11 @@ test: example minigzip (export LD_LIBRARY_PATH=. ; \ echo hello world | ./minigzip | ./minigzip -d ) +.ifndef COMPAT_32BIT beforeinstall: ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${.CURDIR}/zlib.pc ${DESTDIR}${LIBDATADIR}/pkgconfig +.endif .include From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 00:04:28 2014 Return-Path: Delivered-To: svn-src-all@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 6BA0B5B0; Tue, 28 Oct 2014 00:04:28 +0000 (UTC) Received: from mail-wg0-x22b.google.com (mail-wg0-x22b.google.com [IPv6:2a00:1450:400c:c00::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 881C8A2F; Tue, 28 Oct 2014 00:04:27 +0000 (UTC) Received: by mail-wg0-f43.google.com with SMTP id n12so6791913wgh.2 for ; Mon, 27 Oct 2014 17:04:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=KzXOUHfJB78rv8CXGTSIbY5wRGC86i7McLgrUJcHR8U=; b=kVTrdta2P9OTdr54QDJLQs+A91B0DxXCXVEMdnk0iKxREc2q1XK1tnps3/lchSaTXe ti/IiQ/wUVUXWCbHoKOkJVe1N2y/vRi3AyJWZnzuLND74FKxlpVkYgoxF5m+WbtKxQ1a TYkFcCiH9KsW0lHUePOaWxEcmAPH7eXxX8RLznDX9Uykn/ydhBLpo2DVSf+7xgSC/FO3 y0NSWlqccOERznfRCAlIZ0dA1TcT9+rGLg1spash+Kf+0Rw8BDOYupKRta+B2IYSA/Wt 5FHWYexBxIL66qu8xt7gSxjOE0vvp0ag8lgVor92LTZWUU2oYm5g3/+btDHMcl5ogKtR C2xA== X-Received: by 10.180.107.136 with SMTP id hc8mr21484122wib.78.1414454665898; Mon, 27 Oct 2014 17:04:25 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id hk9sm7422041wjb.46.2014.10.27.17.04.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Oct 2014 17:04:24 -0700 (PDT) Sender: Baptiste Daroussin Date: Tue, 28 Oct 2014 01:04:22 +0100 From: Baptiste Daroussin To: John-Mark Gurney Subject: Re: svn commit: r273756 - in head/lib: libusb libz Message-ID: <20141028000422.GB26796@ivaldir.etoilebsd.net> References: <201410272343.s9RNhPW8064075@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dc+cDN39EJAMEtIO" Content-Disposition: inline In-Reply-To: <201410272343.s9RNhPW8064075@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 00:04:28 -0000 --dc+cDN39EJAMEtIO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 27, 2014 at 11:43:25PM +0000, John-Mark Gurney wrote: > Author: jmg > Date: Mon Oct 27 23:43:25 2014 > New Revision: 273756 > URL: https://svnweb.freebsd.org/changeset/base/273756 >=20 > Log: > only install .pc files when we are not installing 32bit compat libs... > =20 > This fixes the problem of installing the .pc files multiple times... >=20 May be we should start having an infrastructure to work with .pc files beca= use we will add more of them I do have in mind at least libarchive so far regards, Bapt --dc+cDN39EJAMEtIO Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlRO3YYACgkQ8kTtMUmk6EwUyACgwxrFxuECPSqlBi97gdoIs3dt k68AnisItbh7QjIoEi0dTogetfOQPJ2G =xuFy -----END PGP SIGNATURE----- --dc+cDN39EJAMEtIO-- From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 00:26:43 2014 Return-Path: Delivered-To: svn-src-all@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 3A1E3AE3; Tue, 28 Oct 2014 00:26:43 +0000 (UTC) Received: from mail-ie0-x231.google.com (mail-ie0-x231.google.com [IPv6:2607:f8b0:4001:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1F6FC89; Tue, 28 Oct 2014 00:26:42 +0000 (UTC) Received: by mail-ie0-f177.google.com with SMTP id tp5so5300035ieb.8 for ; Mon, 27 Oct 2014 17:26:42 -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=JObc/IDouqsRo29kJdHtsHa6nEqIRtM7XDWZxjjTwVM=; b=XGNin6DbAKoz5/6juJeKubbcxbqxpc5YsWBJY6UvrPZ9vJaqOBaV62zCkdjQIHOabC 43mvKBH5mvJXIMpj2B9IO9Vk4dUETzO5jdnLTVIvslReXGKtFnKci4VP7YJAvBj0QuTc MmvsDnYdh1QROgJKuLJ3hOBn8FIz7BlTsmboyfJx6Jumv55QfC0pMQeiNZLIXQ5dbWVK 1mYJ8fzS3P2TKgzWl/MwDeD6ZkHGihaQf2DlIuNeqtWIqdy/80DSG3eorbnRslNqN2a/ F8ECXEgou8ygvNXjvn6kvx29RW6peur2zQVwGkLbXAsQRWcDWQAUdpn3X8Ot9/j3MfmL R4Sw== MIME-Version: 1.0 X-Received: by 10.50.23.80 with SMTP id k16mr824427igf.26.1414456002400; Mon, 27 Oct 2014 17:26:42 -0700 (PDT) Received: by 10.50.193.135 with HTTP; Mon, 27 Oct 2014 17:26:42 -0700 (PDT) In-Reply-To: <201410272331.s9RNV8pJ058121@svn.freebsd.org> References: <201410272331.s9RNV8pJ058121@svn.freebsd.org> Date: Mon, 27 Oct 2014 17:26:42 -0700 Message-ID: Subject: Re: svn commit: r273755 - head From: NGie Cooper To: Baptiste Daroussin 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 00:26:43 -0000 On Mon, Oct 27, 2014 at 4:31 PM, Baptiste Daroussin wrote: > Author: bapt > Date: Mon Oct 27 23:31:07 2014 > New Revision: 273755 > URL: https://svnweb.freebsd.org/changeset/base/273755 > > Log: > Rename XFLAGS to XCFLAGS and XXFLAGS to XCXXFLAGS > > This is less confusing names and actually more reflexting what they are intended > to. > > Discussed with: brooks Add an UPDATING entry? From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 00:43:01 2014 Return-Path: Delivered-To: svn-src-all@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 DAD9C1F1; Tue, 28 Oct 2014 00:43: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 C62FAF88; Tue, 28 Oct 2014 00:43: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 s9S0h0IT093198; Tue, 28 Oct 2014 00:43:00 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9S0h06i093197; Tue, 28 Oct 2014 00:43:00 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201410280043.s9S0h06i093197@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Tue, 28 Oct 2014 00:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273757 - stable/10/sys/dev/re X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 00:43:02 -0000 Author: yongari Date: Tue Oct 28 00:43:00 2014 New Revision: 273757 URL: https://svnweb.freebsd.org/changeset/base/273757 Log: MFC r273359: It seems multicast filtering of RTL8168F does not work. Workaround the silicon bug by accepting any multicast packets. PR: 193488 Modified: stable/10/sys/dev/re/if_re.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/re/if_re.c ============================================================================== --- stable/10/sys/dev/re/if_re.c Mon Oct 27 23:43:25 2014 (r273756) +++ stable/10/sys/dev/re/if_re.c Tue Oct 28 00:43:00 2014 (r273757) @@ -702,6 +702,12 @@ re_set_rxmode(struct rl_softc *sc) rxfilt |= RL_RXCFG_RX_MULTI; } + if (sc->rl_hwrev->rl_rev == RL_HWREV_8168F) { + /* Disable multicast filtering due to silicon bug. */ + hashes[0] = 0xffffffff; + hashes[1] = 0xffffffff; + } + done: CSR_WRITE_4(sc, RL_MAR0, hashes[0]); CSR_WRITE_4(sc, RL_MAR4, hashes[1]); From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 00:44:21 2014 Return-Path: Delivered-To: svn-src-all@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 08C0532F; Tue, 28 Oct 2014 00:44: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 E8703F93; Tue, 28 Oct 2014 00:44: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 s9S0iKrI093494; Tue, 28 Oct 2014 00:44:20 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9S0iKii093493; Tue, 28 Oct 2014 00:44:20 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201410280044.s9S0iKii093493@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Tue, 28 Oct 2014 00:44:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r273758 - stable/9/sys/dev/re X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 00:44:21 -0000 Author: yongari Date: Tue Oct 28 00:44:20 2014 New Revision: 273758 URL: https://svnweb.freebsd.org/changeset/base/273758 Log: MFC r273359: It seems multicast filtering of RTL8168F does not work. Workaround the silicon bug by accepting any multicast packets. PR: 193488 Modified: stable/9/sys/dev/re/if_re.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/re/if_re.c ============================================================================== --- stable/9/sys/dev/re/if_re.c Tue Oct 28 00:43:00 2014 (r273757) +++ stable/9/sys/dev/re/if_re.c Tue Oct 28 00:44:20 2014 (r273758) @@ -702,6 +702,12 @@ re_set_rxmode(struct rl_softc *sc) rxfilt |= RL_RXCFG_RX_MULTI; } + if (sc->rl_hwrev->rl_rev == RL_HWREV_8168F) { + /* Disable multicast filtering due to silicon bug. */ + hashes[0] = 0xffffffff; + hashes[1] = 0xffffffff; + } + done: CSR_WRITE_4(sc, RL_MAR0, hashes[0]); CSR_WRITE_4(sc, RL_MAR4, hashes[1]); From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 01:34:02 2014 Return-Path: Delivered-To: svn-src-all@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 A8BD7C0C; Tue, 28 Oct 2014 01:34: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 94C6264C; Tue, 28 Oct 2014 01:34: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 s9S1Y2CA017679; Tue, 28 Oct 2014 01:34:02 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9S1Y20d017678; Tue, 28 Oct 2014 01:34:02 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201410280134.s9S1Y20d017678@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 28 Oct 2014 01:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273759 - head/sys/powerpc/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 01:34:02 -0000 Author: jhibbits Date: Tue Oct 28 01:34:01 2014 New Revision: 273759 URL: https://svnweb.freebsd.org/changeset/base/273759 Log: Add CAPABILITIES and CAPABILITY_MODE to powerpc GENERIC64, missed with the addition to GENERIC MFC after: 3 weeks Modified: head/sys/powerpc/conf/GENERIC64 Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Tue Oct 28 00:44:20 2014 (r273758) +++ head/sys/powerpc/conf/GENERIC64 Tue Oct 28 01:34:01 2014 (r273759) @@ -70,6 +70,8 @@ options SYSVSEM #SYSV-style semaphore options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing +options CAPABILITY_MODE # Capsicum capability mode +options CAPABILITIES # Capsicum capabilities options MAC # TrustedBSD MAC Framework options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # Kernel ELF linker loads CTF data From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 02:05:58 2014 Return-Path: Delivered-To: svn-src-all@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 89FC133F; Tue, 28 Oct 2014 02:05: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 76508949; Tue, 28 Oct 2014 02:05: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 s9S25wrG032325; Tue, 28 Oct 2014 02:05:58 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9S25wwe032324; Tue, 28 Oct 2014 02:05:58 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201410280205.s9S25wwe032324@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Tue, 28 Oct 2014 02:05:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273760 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 02:05:58 -0000 Author: kevlo Date: Tue Oct 28 02:05:57 2014 New Revision: 273760 URL: https://svnweb.freebsd.org/changeset/base/273760 Log: Fix prototypes. Modified: head/lib/libc/stdio/open_memstream.3 Modified: head/lib/libc/stdio/open_memstream.3 ============================================================================== --- head/lib/libc/stdio/open_memstream.3 Tue Oct 28 01:34:01 2014 (r273759) +++ head/lib/libc/stdio/open_memstream.3 Tue Oct 28 02:05:57 2014 (r273760) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 27, 2013 +.Dd October 28, 2014 .Dt OPEN_MEMSTREAM 3 .Os .Sh NAME @@ -37,10 +37,10 @@ .Sh SYNOPSIS .In stdio.h .Ft FILE * -.Fn open_memstream "char **bufp" "size_t **sizep" +.Fn open_memstream "char **bufp" "size_t *sizep" .In wchar.h .Ft FILE * -.Fn open_wmemstream "wchar_t **bufp" "size_t **sizep" +.Fn open_wmemstream "wchar_t **bufp" "size_t *sizep" .Sh DESCRIPTION The .Fn open_memstream From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 02:29:36 2014 Return-Path: Delivered-To: svn-src-all@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 553628AE for ; Tue, 28 Oct 2014 02:29:36 +0000 (UTC) Received: from mail-yk0-f174.google.com (mail-yk0-f174.google.com [209.85.160.174]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D115B15 for ; Tue, 28 Oct 2014 02:29:35 +0000 (UTC) Received: by mail-yk0-f174.google.com with SMTP id q200so910842ykb.33 for ; Mon, 27 Oct 2014 19:29:34 -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:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=dOUmjB9f1DlvSnHMy/wJx8ZDyWnBg0+wkOS4Cxv1RK4=; b=Estfv83RXfCeFe9MclJ7noANc38zrROIIoIt1dXZBcyK4iDXvyjx57QhILI3Moj0K5 YGtFzD32hUf1UKQ09gIDkeSriwjVm5X2IKcueocfE11oOx2tQ3nZnQ8VQyx+kLybrZBM wO2Q1GAzzSbfLZeztDZa6mNg27ihpHIYnT2/v/k4a8Vx4fa2T5DvYSLKNlXCiN2bk3Xs 2t0Z+t0MEFL3853hNblvRhgu5QkoRdULQ8u+JC2atKqXGgxrJ8Y5SD51jGn+CWrJW3cu Gtgz3fatTa5fMzUnsoreZatd2goFNrBnZFy5Cx7oXhPhaRr3OA6FyUO/KyhklGOm5j4D vuIw== X-Gm-Message-State: ALoCoQkFrQEsPbUJRt2JWCrnZ0EG79eIqW5g0lJjxTUYIhz/0G/A+BLesmb0WC34mJzxMx+hIcFX X-Received: by 10.236.216.82 with SMTP id f78mr106060yhp.33.1414461528574; Mon, 27 Oct 2014 18:58:48 -0700 (PDT) Received: from [192.168.0.14] (173-18-133-79.client.mchsi.com. [173.18.133.79]) by mx.google.com with ESMTPSA id v42sm56218yhn.31.2014.10.27.18.58.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Oct 2014 18:58:47 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_E2B88923-0130-4DF4-A045-532A780EADC9"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r273214 - in head/sys: amd64/vmm/intel modules/vmm From: Warner Losh In-Reply-To: <5487187.5oKgfZ1XGT@ralph.baldwin.cx> Date: Mon, 27 Oct 2014 20:58:36 -0500 Message-Id: <19D1B515-74B3-43A0-A017-B170FFAEBA6F@bsdimp.com> References: <201410171320.s9HDKo53045297@svn.freebsd.org> <1725598.2CCKLon8F3@ralph.baldwin.cx> <2B7C3745-04E4-4FA9-A849-AECE54EA83A3@bsdimp.com> <5487187.5oKgfZ1XGT@ralph.baldwin.cx> To: John Baldwin X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 02:29:36 -0000 --Apple-Mail=_E2B88923-0130-4DF4-A045-532A780EADC9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Oct 27, 2014, at 1:18 PM, John Baldwin wrote: > On Monday, October 27, 2014 11:36:41 AM Warner Losh wrote: >> On Oct 27, 2014, at 10:54 AM, John Baldwin wrote: >>> On Friday, October 17, 2014 01:20:50 PM Warner Losh wrote: >>>> Author: imp >>>> Date: Fri Oct 17 13:20:49 2014 >>>> New Revision: 273214 >>>> URL: https://svnweb.freebsd.org/changeset/base/273214 >>>>=20 >>>> Log: >>>> Fix build to not bogusly always rebuild vmm.ko. >>>>=20 >>>> Rename vmx_assym.s to vmx_assym.h to reflect that file's actual use >>>> and update vmx_support.S's include to match. Add vmx_assym.h to the >>>> SRCS to that it gets properly added to the dependency list. Add >>>> vmx_support.S to SRCS as well, so it gets built and needs fewer >>>> special-case goo. Remove now-redundant special-case goo. Finally, >>>> vmx_genassym.o doesn't need to depend on a hand expanded ${_ILINKS} >>>> explicitly, that's all taken care of by beforedepend. >>>>=20 >>>> With these items fixed, we no longer build vmm.ko every single time >>>> through the modules on a KERNFAST build. >>>=20 >>> So I cheered for this before, but it appears to be broken. :( >>>=20 >>> Namely, I rebuilt world + kernel on my laptop this weekend (it was = about a >>> month old). My normal setup builds kernels with NO_KERNELCLEAN=3Dyes.= On my >>> next reboot when I started a bhyve VM I promptly got a panic due to = a page >>>=20 >>> fault in this assembly code: >>> /* >>> =09 >>> * If 'vmx->eptgen[curcpu]' is not identical to = 'pmap->pm_eptgen' >>> * then we must invalidate all mappings associated with this = EPTP. >>> */ >>> =09 >>> movq PM_EPTGEN(%r11), %r10 >>> cmpq %r10, VMX_EPTGEN(%rsi, %rax, 8) >>> je guest_restore >>>=20 >>> (The 'cmpq' instruction) >>>=20 >>> This change came to mind, so I blew away the 'vmm' module directory = and >>> rebuilt my kernel. Comparing the assembly of this instruction = before and >>> after used different values for VMX_EPTGEN. In other words, the >>> NO_KERNELCLEAN=3Dyes build failed to regenerate vmx_assym.h and the = build >>> used stale values. >>=20 >> Is there a way to force this condition for testing? >=20 > You could checkout an older tree (probably before the recent merge of = AMD SVM > support) and build vmm.ko, then svn update and see if vmx_assym and > vmx_support.o are updated. >=20 > Actually, this was simpler: >=20 > % cd sys/modules/vmm > % make depend > % make vmx_assym.h # reports nothing to do > % touch machine/vmm.h # vmx_genassym.c includes this > % make vmx_assym.h # should rebuild, but doesn=92t Thanks! >>> In particular, if you examine the generated .depend file, you will = find >>> that there are no dependencies recorded for vmx_genassym.o, so it is >>> never rebuilt if any of the headers it includes are changed. In my = case >>> the panic happened to be one that was easily diagnosed, but I could >>> imagine stale assym headers causing very odd crashes that would be = quite >>> hard to track down. I think these changes should be reverted if we = can't >>> fix the dependencies of the associated object files they are = generated >>> from. :( >>=20 >> Give me a bit and I=92ll fix it. There=92s a number of implicit = dependencies >> that don=92t get recorded in the .depend file, iirc, so that=92s not = completely >> conclusive. Not building, though is kinda a big hint that something=92s= >> amiss. >=20 > I think the thing here is that for the assym files we don't record any > dependency info at all. The main kernel build does record = dependencies > for genassym.o in .depend, so it must be doable. True. > In kern.pre.mk: >=20 > GEN_CFILES=3D $S/$M/$M/genassym.c ${MFILES:T:S/.m$/.c/} >=20 > and those are then explicitly passed to mkdep in kern.post.mk. >=20 > So this fixes it: >=20 > Index: Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- Makefile (revision 273555) > +++ Makefile (working copy) > @@ -4,6 +4,7 @@ KMOD=3D vmm >=20 > SRCS=3D opt_acpi.h opt_ddb.h device_if.h bus_if.h pci_if.h > SRCS+=3D vmx_assym.h svm_assym.h > +DPSRCS=3D vmx_genassym.c svm_genassym.c That=92s the magic I was looking for... > CFLAGS+=3D -DVMM_KEEP_STATS -DSMP > CFLAGS+=3D -I${.CURDIR}/../../amd64/vmm >=20 > I'll try to track down all the other assym files and fix them as well. Cool. There=92s three more (but I had only fixed two of them, since I = didn=92t have a i386 build handy). >> However, -DNO_CLEAN has always been a very-sharp edged tool that will = cut >> you in a number of ways, so there=92s no rush to back this out. >=20 > This is the first time in many years that NO_KERNELCLEAN=3Dyes has = been a > problem for me. (worlds sometimes have issues, but kernels rarely = do). > Also, usually when it breaks it fails to compile, it doesn't compile = and > then panic. :( But it is current=85 :) Warner --Apple-Mail=_E2B88923-0130-4DF4-A045-532A780EADC9 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 iQIcBAEBCgAGBQJUTvhMAAoJEGwc0Sh9sBEAjAcP/3pgovT4SIGF175htGXM6qRp ntMa5kE6M9ccJVZLBqCsMLZPYYP1cY10J6jLTxdVup+hfvT3VbD8UMeqmkCoK8Qf iWD+IjzNEs8VQY2HBHD1mlPVHxgh8mcKPVu56WPRRsdfmfrk5SeKpBxQZCNfdAME HpxYZXQfUoTD4evHqCCz5yL0UZpoCeLMhsN+Tf5iY+Ldm69Pq3259JNVbS32cBuw zHSstSoRi/5QpbU6amzluUKXJrgr6ao63caR4zFITkU3YjGPzyHoBR77L2XxkT/q WRSvh4VdkrqGeKmAO0zPMUcM4jRVEfuE6ayeJpAoGaEZ/7W9JR7sjgs9una4NEB9 77dRKL1KOrbam+tA4g7O37N34ubpOvTiMhZCbhiA0WE0cwGyUGvKXxKWuFXB7fkZ usscxI7QXq9kI7bTyqk4MHsp1ZUcaP8vdohfRp1Ex6v2L6Zn6f7Kg/BOEi1ydWoQ 3mAHi5jKNNj+wXAwhQgu3ps9BDtNL5RlPIG++JZ3FB9WS//Tg64r8mSX7Rbfk/z3 9pLvwQ9evRv3xTWp0verqaxyBiWXkKu82TVd0MCBrwxp1x7uZHPDgaJnqF2xsTRj UOHb3bsu5N1MQ/ZaarnL0iPsUoOV4CD+Y59SlQ+ZR5J3TAsfj68YsAtl7f5WyWgg GptlW9WOkAmUN3CRYIjX =gG2/ -----END PGP SIGNATURE----- --Apple-Mail=_E2B88923-0130-4DF4-A045-532A780EADC9-- From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 03:42:10 2014 Return-Path: Delivered-To: svn-src-all@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 37733437; Tue, 28 Oct 2014 03:42: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 0897933C; Tue, 28 Oct 2014 03:42: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 s9S3g9Ix079230; Tue, 28 Oct 2014 03:42:09 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9S3g9oJ079229; Tue, 28 Oct 2014 03:42:09 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201410280342.s9S3g9oJ079229@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 28 Oct 2014 03:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273761 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 03:42:10 -0000 Author: araujo (ports committer) Date: Tue Oct 28 03:42:09 2014 New Revision: 273761 URL: https://svnweb.freebsd.org/changeset/base/273761 Log: Drop __DECONST as well as few fixes of style(9). Phabric: D1012 Suggested by: mjg, jhb Reviewed by: mjg, jhb Sponsored by: QNAP Systems Inc. Modified: head/sys/dev/uart/uart_subr.c Modified: head/sys/dev/uart/uart_subr.c ============================================================================== --- head/sys/dev/uart/uart_subr.c Tue Oct 28 02:05:57 2014 (r273760) +++ head/sys/dev/uart/uart_subr.c Tue Oct 28 03:42:09 2014 (r273761) @@ -196,7 +196,8 @@ out: int uart_getenv(int devtype, struct uart_devinfo *di, struct uart_class *class) { - const char *cp, *spec; + const char *spec; + char *cp; bus_addr_t addr = ~0U; int error; @@ -213,12 +214,18 @@ uart_getenv(int devtype, struct uart_dev * which UART port is to be used as serial console or debug * port (resp). */ - if (devtype == UART_DEV_CONSOLE) + switch (devtype) { + case UART_DEV_CONSOLE: cp = kern_getenv("hw.uart.console"); - else if (devtype == UART_DEV_DBGPORT) + break; + case UART_DEV_DBGPORT: cp = kern_getenv("hw.uart.dbgport"); - else + break; + default: cp = NULL; + break; + } + if (cp == NULL) return (ENXIO); @@ -233,7 +240,7 @@ uart_getenv(int devtype, struct uart_dev /* Parse the attributes. */ spec = cp; - while (1) { + for (;;) { switch (uart_parse_tag(&spec)) { case UART_TAG_BR: di->baudrate = uart_parse_long(&spec); @@ -268,18 +275,18 @@ uart_getenv(int devtype, struct uart_dev di->bas.rclk = uart_parse_long(&spec); break; default: - freeenv(__DECONST(char *, cp)); + freeenv(cp); return (EINVAL); } if (*spec == '\0') break; if (*spec != ',') { - freeenv(__DECONST(char *, cp)); + freeenv(cp); return (EINVAL); } spec++; } - freeenv(__DECONST(char *, cp)); + freeenv(cp); /* * If we still have an invalid address, the specification must be From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 03:43:39 2014 Return-Path: Delivered-To: svn-src-all@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 4DE86587; Tue, 28 Oct 2014 03:43:39 +0000 (UTC) Received: from mail-wg0-x22d.google.com (mail-wg0-x22d.google.com [IPv6:2a00:1450:400c:c00::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A82134A; Tue, 28 Oct 2014 03:43:38 +0000 (UTC) Received: by mail-wg0-f45.google.com with SMTP id x12so2723960wgg.4 for ; Mon, 27 Oct 2014 20:43:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=2NEOMGr/BIQugsNY4lTK2JJog77epGlEZ7dzD/6yqOo=; b=QidRXjC8fIayPXdRFA7EzHkBP/2D/vNMkVkcbOI9fMlp55L2x0kphFXS+3gv+8s46p 8uJ80veWmHgmfE6I8Ky7irglKkWxbEPdowyToJBd0i968oOdTyIAWc8DCb+iU3/T6d1J lGWY5pXg7H0qZiPX0514jdDlg14RLvtTzDphTYDEAlAX/pqT/My4RzfL2grOGeAotBKG jYh6xB+eaGf5mY78jnnFuF1bo9Y4F6q0irBonOKE/z8DXPXwU+r8Ku/+mXiCCAkB434Y jI3kNEafVbcwiEdhBuydapgLwmc1coDnynz3Ppfc+H4UxEvPdIVE1fGcfdCyVGnBHWnt nnGw== MIME-Version: 1.0 X-Received: by 10.194.157.137 with SMTP id wm9mr663475wjb.5.1414467816544; Mon, 27 Oct 2014 20:43:36 -0700 (PDT) Received: by 10.216.159.193 with HTTP; Mon, 27 Oct 2014 20:43:36 -0700 (PDT) Reply-To: araujo@FreeBSD.org In-Reply-To: <235737869.CpTJALnJpW@ralph.baldwin.cx> References: <201410240539.s9O5dWWK002150@svn.freebsd.org> <235737869.CpTJALnJpW@ralph.baldwin.cx> Date: Tue, 28 Oct 2014 11:43:36 +0800 Message-ID: Subject: Re: svn commit: r273576 - head/sys/dev/uart From: Marcelo Araujo To: John Baldwin 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 03:43:39 -0000 Done: https://svnweb.freebsd.org/base?view=revision&revision=273761 Thank you guys!!!! 2014-10-25 0:14 GMT+08:00 John Baldwin : > On Friday, October 24, 2014 05:39:32 AM Marcelo Araujo wrote: > > Author: araujo (ports committer) > > Date: Fri Oct 24 05:39:32 2014 > > New Revision: 273576 > > URL: https://svnweb.freebsd.org/changeset/base/273576 > > > > Log: > > Fix a leaked Storage Variable. > > > > Phabric: D981 > > Submitted by: myself > > Reported by: Coverity > > CID: 1248848 > > Reworked by: kevlo > > Reviewed by: marcel, davide, ray, kevlo > > Approved by: marcel, kevlo > > > > Modified: > > head/sys/dev/uart/uart_subr.c > > > > Modified: head/sys/dev/uart/uart_subr.c > > > ============================================================================== > > --- head/sys/dev/uart/uart_subr.c Fri Oct 24 04:01:14 2014 > (r273575) > > +++ head/sys/dev/uart/uart_subr.c Fri Oct 24 05:39:32 2014 > (r273576) > > @@ -196,7 +196,7 @@ out: > > int > > uart_getenv(int devtype, struct uart_devinfo *di, struct uart_class > *class) > > { > > - const char *spec; > > + const char *cp, *spec; > > Dropping const here is preferable to using __DECONST() for the freeenv() > calls. > > -- > John Baldwin > -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 04:18:09 2014 Return-Path: Delivered-To: svn-src-all@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 EC13FD13; Tue, 28 Oct 2014 04:18: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 D82FE92E; Tue, 28 Oct 2014 04:18: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 s9S4I9Yq094391; Tue, 28 Oct 2014 04:18:09 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9S4I9qh094390; Tue, 28 Oct 2014 04:18:09 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201410280418.s9S4I9qh094390@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Tue, 28 Oct 2014 04:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273762 - head/sys/modules/dtrace/dtraceall X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 04:18:10 -0000 Author: julian Date: Tue Oct 28 04:18:09 2014 New Revision: 273762 URL: https://svnweb.freebsd.org/changeset/base/273762 Log: Allow loading of dtraceall without nfscl if what you really wnat is nfsclient Obtained from: Panzura tree MFC after: 1 week Modified: head/sys/modules/dtrace/dtraceall/dtraceall.c Modified: head/sys/modules/dtrace/dtraceall/dtraceall.c ============================================================================== --- head/sys/modules/dtrace/dtraceall/dtraceall.c Tue Oct 28 03:42:09 2014 (r273761) +++ head/sys/modules/dtrace/dtraceall/dtraceall.c Tue Oct 28 04:18:09 2014 (r273762) @@ -67,7 +67,9 @@ MODULE_DEPEND(dtraceall, cyclic, 1, 1, 1 MODULE_DEPEND(dtraceall, opensolaris, 1, 1, 1); MODULE_DEPEND(dtraceall, dtrace, 1, 1, 1); MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, 1); +#if defined(NFSCLIENT) MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1); +#endif #if defined(NFSCLIENT) MODULE_DEPEND(dtraceall, dtnfsclient, 1, 1, 1); #endif From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 04:33:58 2014 Return-Path: Delivered-To: svn-src-all@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 7874CF94; Tue, 28 Oct 2014 04:33: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 64861AE1; Tue, 28 Oct 2014 04:33: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 s9S4XwZK003260; Tue, 28 Oct 2014 04:33:58 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9S4XwnT003259; Tue, 28 Oct 2014 04:33:58 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410280433.s9S4XwnT003259@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 28 Oct 2014 04:33:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273763 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 04:33:58 -0000 Author: mjg Date: Tue Oct 28 04:33:57 2014 New Revision: 273763 URL: https://svnweb.freebsd.org/changeset/base/273763 Log: Change loginclass mutex to an rwlock. While here reduce nesting in loginclass_free. Submitted by: Tiwei Bie X-Additional: JuniorJobs project MFC after: 2 weeks Modified: head/sys/kern/kern_loginclass.c Modified: head/sys/kern/kern_loginclass.c ============================================================================== --- head/sys/kern/kern_loginclass.c Tue Oct 28 04:18:09 2014 (r273762) +++ head/sys/kern/kern_loginclass.c Tue Oct 28 04:33:57 2014 (r273763) @@ -51,13 +51,13 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include #include #include +#include #include #include @@ -68,8 +68,8 @@ LIST_HEAD(, loginclass) loginclasses; /* * Lock protecting loginclasses list. */ -static struct mtx loginclasses_lock; -MTX_SYSINIT(loginclasses_init, &loginclasses_lock, "loginclasses lock", MTX_DEF); +static struct rwlock loginclasses_lock; +RW_SYSINIT(loginclasses_init, &loginclasses_lock, "loginclasses lock"); void loginclass_hold(struct loginclass *lc) @@ -87,16 +87,37 @@ loginclass_free(struct loginclass *lc) if (old > 1 && atomic_cmpset_int(&lc->lc_refcount, old, old - 1)) return; - mtx_lock(&loginclasses_lock); - if (refcount_release(&lc->lc_refcount)) { - racct_destroy(&lc->lc_racct); - LIST_REMOVE(lc, lc_next); - mtx_unlock(&loginclasses_lock); - free(lc, M_LOGINCLASS); - + rw_wlock(&loginclasses_lock); + if (!refcount_release(&lc->lc_refcount)) { + rw_wunlock(&loginclasses_lock); return; } - mtx_unlock(&loginclasses_lock); + + racct_destroy(&lc->lc_racct); + LIST_REMOVE(lc, lc_next); + rw_wunlock(&loginclasses_lock); + + free(lc, M_LOGINCLASS); +} + +/* + * Look up a loginclass struct for the parameter name. + * loginclasses_lock must be locked. + * Increase refcount on loginclass struct returned. + */ +static struct loginclass * +loginclass_lookup(const char *name) +{ + struct loginclass *lc; + + rw_assert(&loginclasses_lock, RA_LOCKED); + LIST_FOREACH(lc, &loginclasses, lc_next) + if (strcmp(name, lc->lc_name) == 0) { + loginclass_hold(lc); + break; + } + + return (lc); } /* @@ -109,34 +130,39 @@ loginclass_free(struct loginclass *lc) struct loginclass * loginclass_find(const char *name) { - struct loginclass *lc, *newlc; + struct loginclass *lc, *new_lc; if (name[0] == '\0' || strlen(name) >= MAXLOGNAME) return (NULL); - newlc = malloc(sizeof(*newlc), M_LOGINCLASS, M_ZERO | M_WAITOK); - racct_create(&newlc->lc_racct); - - mtx_lock(&loginclasses_lock); - LIST_FOREACH(lc, &loginclasses, lc_next) { - if (strcmp(name, lc->lc_name) != 0) - continue; - - /* Found loginclass with a matching name? */ - loginclass_hold(lc); - mtx_unlock(&loginclasses_lock); - racct_destroy(&newlc->lc_racct); - free(newlc, M_LOGINCLASS); + rw_rlock(&loginclasses_lock); + lc = loginclass_lookup(name); + rw_runlock(&loginclasses_lock); + if (lc != NULL) return (lc); - } - /* Add new loginclass. */ - strcpy(newlc->lc_name, name); - refcount_init(&newlc->lc_refcount, 1); - LIST_INSERT_HEAD(&loginclasses, newlc, lc_next); - mtx_unlock(&loginclasses_lock); + new_lc = malloc(sizeof(*new_lc), M_LOGINCLASS, M_ZERO | M_WAITOK); + racct_create(&new_lc->lc_racct); + refcount_init(&new_lc->lc_refcount, 1); + strcpy(new_lc->lc_name, name); + + rw_wlock(&loginclasses_lock); + /* + * There's a chance someone created our loginclass while we + * were in malloc and not holding the lock, so we have to + * make sure we don't insert a duplicate loginclass. + */ + if ((lc = loginclass_lookup(name)) == NULL) { + LIST_INSERT_HEAD(&loginclasses, new_lc, lc_next); + rw_wunlock(&loginclasses_lock); + lc = new_lc; + } else { + rw_wunlock(&loginclasses_lock); + racct_destroy(&new_lc->lc_racct); + free(new_lc, M_LOGINCLASS); + } - return (newlc); + return (lc); } /* @@ -222,8 +248,8 @@ loginclass_racct_foreach(void (*callback { struct loginclass *lc; - mtx_lock(&loginclasses_lock); + rw_rlock(&loginclasses_lock); LIST_FOREACH(lc, &loginclasses, lc_next) (callback)(lc->lc_racct, arg2, arg3); - mtx_unlock(&loginclasses_lock); + rw_runlock(&loginclasses_lock); } From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 04:59:34 2014 Return-Path: Delivered-To: svn-src-all@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 B304A465; Tue, 28 Oct 2014 04: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 9F6E7CF8; Tue, 28 Oct 2014 04: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 s9S4xYft013112; Tue, 28 Oct 2014 04:59:34 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9S4xYfA013111; Tue, 28 Oct 2014 04:59:34 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410280459.s9S4xYfA013111@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 28 Oct 2014 04:59:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273764 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 04:59:34 -0000 Author: mjg Date: Tue Oct 28 04:59:33 2014 New Revision: 273764 URL: https://svnweb.freebsd.org/changeset/base/273764 Log: Simplify sys_getloginclass. Just use current thread credentials as they have the same accuracy as the ones obtained from proc.. Modified: head/sys/kern/kern_loginclass.c Modified: head/sys/kern/kern_loginclass.c ============================================================================== --- head/sys/kern/kern_loginclass.c Tue Oct 28 04:33:57 2014 (r273763) +++ head/sys/kern/kern_loginclass.c Tue Oct 28 04:59:33 2014 (r273764) @@ -178,24 +178,14 @@ struct getloginclass_args { int sys_getloginclass(struct thread *td, struct getloginclass_args *uap) { - int error = 0; - size_t lcnamelen; - struct proc *p; struct loginclass *lc; + size_t lcnamelen; - p = td->td_proc; - PROC_LOCK(p); - lc = p->p_ucred->cr_loginclass; - loginclass_hold(lc); - PROC_UNLOCK(p); - + lc = td->td_ucred->cr_loginclass; lcnamelen = strlen(lc->lc_name) + 1; if (lcnamelen > uap->namelen) - error = ERANGE; - if (error == 0) - error = copyout(lc->lc_name, uap->namebuf, lcnamelen); - loginclass_free(lc); - return (error); + return (ERANGE); + return (copyout(lc->lc_name, uap->namebuf, lcnamelen)); } /* From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 06:17:26 2014 Return-Path: Delivered-To: svn-src-all@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 F0ECF3A1; Tue, 28 Oct 2014 06:17: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 D35937DF; Tue, 28 Oct 2014 06:17: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 s9S6HP8H050485; Tue, 28 Oct 2014 06:17:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9S6HPrH050484; Tue, 28 Oct 2014 06:17:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201410280617.s9S6HPrH050484@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 28 Oct 2014 06:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273765 - stable/10/cddl/lib/libdtrace X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 06:17:26 -0000 Author: markj Date: Tue Oct 28 06:17:25 2014 New Revision: 273765 URL: https://svnweb.freebsd.org/changeset/base/273765 Log: MFC r273370: Correct the calculation of tcps_rto in the struct tcpcb -> tcpsinfo_t translator. Modified: stable/10/cddl/lib/libdtrace/tcp.d Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/lib/libdtrace/tcp.d ============================================================================== --- stable/10/cddl/lib/libdtrace/tcp.d Tue Oct 28 04:59:33 2014 (r273764) +++ stable/10/cddl/lib/libdtrace/tcp.d Tue Oct 28 06:17:25 2014 (r273765) @@ -197,7 +197,7 @@ translator tcpsinfo_t < struct tcpcb *p tcps_cwnd_ssthresh = p == NULL ? -1 : p->snd_ssthresh; tcps_sack_fack = p == NULL ? 0 : p->snd_fack; tcps_sack_snxt = p == NULL ? 0 : p->sack_newdata; - tcps_rto = p == NULL ? -1 : p->t_rxtcur / 1000; /* XXX */ + tcps_rto = p == NULL ? -1 : (p->t_rxtcur * 1000) / `hz; tcps_mss = p == NULL ? -1 : p->t_maxseg; tcps_retransmit = p == NULL ? -1 : p->t_rxtshift > 0 ? 1 : 0; }; From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 06:44:07 2014 Return-Path: Delivered-To: svn-src-all@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 3F5A5808; Tue, 28 Oct 2014 06:44:07 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E687FA8E; Tue, 28 Oct 2014 06:44:06 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s9S6i4tr080927 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 27 Oct 2014 23:44:05 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s9S6i4nI080926; Mon, 27 Oct 2014 23:44:04 -0700 (PDT) (envelope-from jmg) Date: Mon, 27 Oct 2014 23:44:04 -0700 From: John-Mark Gurney To: Julian Elischer Subject: Re: svn commit: r273762 - head/sys/modules/dtrace/dtraceall Message-ID: <20141028064404.GV82214@funkthat.com> References: <201410280418.s9S4I9qh094390@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201410280418.s9S4I9qh094390@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Mon, 27 Oct 2014 23:44:05 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 06:44:07 -0000 Julian Elischer wrote this message on Tue, Oct 28, 2014 at 04:18 +0000: > Author: julian > Date: Tue Oct 28 04:18:09 2014 > New Revision: 273762 > URL: https://svnweb.freebsd.org/changeset/base/273762 > > Log: > Allow loading of dtraceall without nfscl if what you really wnat is nfsclient > > Obtained from: Panzura tree > MFC after: 1 week > > Modified: > head/sys/modules/dtrace/dtraceall/dtraceall.c > > Modified: head/sys/modules/dtrace/dtraceall/dtraceall.c > ============================================================================== > --- head/sys/modules/dtrace/dtraceall/dtraceall.c Tue Oct 28 03:42:09 2014 (r273761) > +++ head/sys/modules/dtrace/dtraceall/dtraceall.c Tue Oct 28 04:18:09 2014 (r273762) > @@ -67,7 +67,9 @@ MODULE_DEPEND(dtraceall, cyclic, 1, 1, 1 > MODULE_DEPEND(dtraceall, opensolaris, 1, 1, 1); > MODULE_DEPEND(dtraceall, dtrace, 1, 1, 1); > MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, 1); > +#if defined(NFSCLIENT) > MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1); > +#endif > #if defined(NFSCLIENT) > MODULE_DEPEND(dtraceall, dtnfsclient, 1, 1, 1); > #endif Why not put the MODULE_DEPEND in the same #if defined block that follows? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 06:50:50 2014 Return-Path: Delivered-To: svn-src-all@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 9A1EBA7D; Tue, 28 Oct 2014 06:50:50 +0000 (UTC) Received: from mail-wi0-x231.google.com (mail-wi0-x231.google.com [IPv6:2a00:1450:400c:c05::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4F79AE1; Tue, 28 Oct 2014 06:50:49 +0000 (UTC) Received: by mail-wi0-f177.google.com with SMTP id ex7so573713wid.4 for ; Mon, 27 Oct 2014 23:50:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=SjiUxhhKi9FaB+r89mDq4A1viMzER6EUdcS+Cj8Fgtk=; b=PMW6UPIkm2YEKzFtqNCJaVjmsqDoF8OfWIidz4nZH5P9kAsfBvU/bExQAdBvr3rMSd yMC39/YCqW+Bs4Ym1fti4FBjhbC6zJUu2tYACy+h4wxvJjP+NsyCu6ulqvLeX49PUTi/ W9pxVM09PYPaEvfWRxCYj0qhs+n9JN9hDGYJ07ijSbr58aul2/rS30nth0OIGlt2j/1f GwGdVSfKrt3RnPhyrTXEXdPxfPN7T3Tt/CT9DKF/D+LSqc03GcKkXIa80Cg0+mY4pY3k 5qtKLyZwpXzHihHTykD/pMqqMsLmXR98JsZAdIM9aNrSBI6blWsKQS/gT/LrLXUdIDkQ 2OfA== X-Received: by 10.180.149.169 with SMTP id ub9mr2215237wib.73.1414479048073; Mon, 27 Oct 2014 23:50:48 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id bc5sm695821wjb.14.2014.10.27.23.50.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Oct 2014 23:50:46 -0700 (PDT) Sender: Baptiste Daroussin Date: Tue, 28 Oct 2014 07:50:44 +0100 From: Baptiste Daroussin To: NGie Cooper Subject: Re: svn commit: r273755 - head Message-ID: <20141028065043.GC26796@ivaldir.etoilebsd.net> References: <201410272331.s9RNV8pJ058121@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1ccMZA6j1vT5UqiK" Content-Disposition: inline In-Reply-To: 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 06:50:50 -0000 --1ccMZA6j1vT5UqiK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 27, 2014 at 05:26:42PM -0700, NGie Cooper wrote: > On Mon, Oct 27, 2014 at 4:31 PM, Baptiste Daroussin wr= ote: > > Author: bapt > > Date: Mon Oct 27 23:31:07 2014 > > New Revision: 273755 > > URL: https://svnweb.freebsd.org/changeset/base/273755 > > > > Log: > > Rename XFLAGS to XCFLAGS and XXFLAGS to XCXXFLAGS > > > > This is less confusing names and actually more reflexting what they a= re intended > > to. > > > > Discussed with: brooks >=20 > Add an UPDATING entry? Well XCFLAGS and XCXXFLAGS are inernal only and concerning a feature (exter= nal toolchain) which is still WIP so it is worth adding an UPDATING entry? regards, Bapt --1ccMZA6j1vT5UqiK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlRPPMMACgkQ8kTtMUmk6Ez7lQCfcw+SDWVVJJ+Oz5h2/xsYIx1M zi0An3Jsk6vlfMhrNEt6Lrh2wJoOVBxr =kmIJ -----END PGP SIGNATURE----- --1ccMZA6j1vT5UqiK-- From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 07:19:03 2014 Return-Path: Delivered-To: svn-src-all@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 C52372DE; Tue, 28 Oct 2014 07:19: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 A6FB5DB8; Tue, 28 Oct 2014 07:19: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 s9S7J3VJ078740; Tue, 28 Oct 2014 07:19:03 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9S7J3DP078739; Tue, 28 Oct 2014 07:19:03 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201410280719.s9S7J3DP078739@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 28 Oct 2014 07:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273766 - head/sys/amd64/vmm/amd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 07:19:03 -0000 Author: araujo (ports committer) Date: Tue Oct 28 07:19:02 2014 New Revision: 273766 URL: https://svnweb.freebsd.org/changeset/base/273766 Log: Reported by: Coverity CID: 1249760 Reviewed by: neel Approved by: neel Sponsored by: QNAP Systems Inc. Modified: head/sys/amd64/vmm/amd/vmcb.c Modified: head/sys/amd64/vmm/amd/vmcb.c ============================================================================== --- head/sys/amd64/vmm/amd/vmcb.c Tue Oct 28 06:17:25 2014 (r273765) +++ head/sys/amd64/vmm/amd/vmcb.c Tue Oct 28 07:19:02 2014 (r273766) @@ -389,6 +389,7 @@ vmcb_setdesc(void *arg, int vcpu, int re case VM_REG_GUEST_ES: case VM_REG_GUEST_SS: svm_set_dirty(sc, vcpu, VMCB_CACHE_SEG); + break; case VM_REG_GUEST_GDTR: case VM_REG_GUEST_IDTR: svm_set_dirty(sc, vcpu, VMCB_CACHE_DT); From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 07:26:45 2014 Return-Path: Delivered-To: svn-src-all@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 62CAB5B1; Tue, 28 Oct 2014 07:26:45 +0000 (UTC) Received: from mail-wg0-x229.google.com (mail-wg0-x229.google.com [IPv6:2a00:1450:400c:c00::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C556EAC; Tue, 28 Oct 2014 07:26:44 +0000 (UTC) Received: by mail-wg0-f41.google.com with SMTP id k14so101076wgh.12 for ; Tue, 28 Oct 2014 00:26:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=pIdI2qfernomIw7irc2S1EBlcErhRBqPBoZgAhHMyUA=; b=AUhMYan1IlNDHkdQAH+JBgi4vdDuhF+N5cWBnT17iSa9mztW8h1AKvsFg9YTbPllvG frMbVZRfNV2Mn0/QVYIKH+AlPer0QFdQBl75QMPUxXKV2eR1NZLh6qyebJuzOCPO4LWD hRMAVKBO85Ky7frvfAyGLQrIn7DTO6vwSLG2YjQkGk8Cr3GjD23EAUIsQclv9vN3uYhn 7aB6IaLXg5sJ+vEd37hkIxnYHCWC15i/yzCHXrBCbydcB3+WC7haCKDnRgcB+CZkBxOx eq4vo4HUJMIFqqZXXm8b3uzUnWUnRKyMCysO7SxLODMhwrYHUtQZwxmyvWa65fnogDoS FlRQ== MIME-Version: 1.0 X-Received: by 10.194.157.137 with SMTP id wm9mr1778458wjb.5.1414481202644; Tue, 28 Oct 2014 00:26:42 -0700 (PDT) Received: by 10.216.159.193 with HTTP; Tue, 28 Oct 2014 00:26:42 -0700 (PDT) Reply-To: araujo@FreeBSD.org In-Reply-To: <201410280719.s9S7J3DP078739@svn.freebsd.org> References: <201410280719.s9S7J3DP078739@svn.freebsd.org> Date: Tue, 28 Oct 2014 15:26:42 +0800 Message-ID: Subject: Re: svn commit: r273766 - head/sys/amd64/vmm/amd From: Marcelo Araujo To: Marcelo Araujo 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 07:26:45 -0000 2014-10-28 15:19 GMT+08:00 Marcelo Araujo : > Author: araujo (ports committer) > Date: Tue Oct 28 07:19:02 2014 > New Revision: 273766 > URL: https://svnweb.freebsd.org/changeset/base/273766 > > Log: > Reported by: Coverity > CID: 1249760 > Reviewed by: neel > Approved by: neel > Sponsored by: QNAP Systems Inc. > > Modified: > head/sys/amd64/vmm/amd/vmcb.c > > Modified: head/sys/amd64/vmm/amd/vmcb.c > > ============================================================================== > --- head/sys/amd64/vmm/amd/vmcb.c Tue Oct 28 06:17:25 2014 > (r273765) > +++ head/sys/amd64/vmm/amd/vmcb.c Tue Oct 28 07:19:02 2014 > (r273766) > @@ -389,6 +389,7 @@ vmcb_setdesc(void *arg, int vcpu, int re > case VM_REG_GUEST_ES: > case VM_REG_GUEST_SS: > svm_set_dirty(sc, vcpu, VMCB_CACHE_SEG); > + break; > case VM_REG_GUEST_GDTR: > case VM_REG_GUEST_IDTR: > svm_set_dirty(sc, vcpu, VMCB_CACHE_DT); Missing the log, my bad!!! And as we don't have 'svn "force commit"' to append it. Change log: Missing break on the switch case statement. Best Regards, -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 08:00:30 2014 Return-Path: Delivered-To: svn-src-all@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 3142ABB3; Tue, 28 Oct 2014 08:00: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 14F4F272; Tue, 28 Oct 2014 08:00: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 s9S80TRQ097891; Tue, 28 Oct 2014 08:00:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9S80TxA097883; Tue, 28 Oct 2014 08:00:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201410280800.s9S80TxA097883@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 28 Oct 2014 08:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273767 - in stable/10/sys: geom kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 08:00:30 -0000 Author: mav Date: Tue Oct 28 08:00:28 2014 New Revision: 273767 URL: https://svnweb.freebsd.org/changeset/base/273767 Log: MFC r273638: Revert somewhat hackish geom_disk optimization, committed as part of r256880, and the following r273143 commit, supposed to workaround introduced issue by quite innocent-looking change. While there is no clear understanding why, but r273143 is accused in data corruption in some environments with high I/O load. I personally don't see any problem in that commit, and possibly it is just a trigger to some other bug somewhere, but better safe then sorry for now. Requested by: scottl@ Modified: stable/10/sys/geom/geom_disk.c stable/10/sys/kern/vfs_bio.c Modified: stable/10/sys/geom/geom_disk.c ============================================================================== --- stable/10/sys/geom/geom_disk.c Tue Oct 28 07:19:02 2014 (r273766) +++ stable/10/sys/geom/geom_disk.c Tue Oct 28 08:00:28 2014 (r273767) @@ -255,25 +255,6 @@ g_disk_done(struct bio *bp) g_destroy_bio(bp); } -static void -g_disk_done_single(struct bio *bp) -{ - struct bintime now; - struct g_disk_softc *sc; - - bp->bio_completed = bp->bio_length - bp->bio_resid; - bp->bio_done = (void *)bp->bio_to; - bp->bio_to = LIST_FIRST(&bp->bio_disk->d_geom->provider); - if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE|BIO_FLUSH)) != 0) { - binuptime(&now); - sc = bp->bio_to->private; - mtx_lock(&sc->done_mtx); - devstat_end_transaction_bio_bt(sc->dp->d_devstat, bp, &now); - mtx_unlock(&sc->done_mtx); - } - g_io_deliver(bp, bp->bio_error); -} - static int g_disk_ioctl(struct g_provider *pp, u_long cmd, void * data, int fflag, struct thread *td) { @@ -299,7 +280,7 @@ g_disk_start(struct bio *bp) struct disk *dp; struct g_disk_softc *sc; int error; - off_t d_maxsize, off; + off_t off; sc = bp->bio_to->private; if (sc == NULL || (dp = sc->dp) == NULL || dp->d_destroyed) { @@ -316,22 +297,6 @@ g_disk_start(struct bio *bp) /* fall-through */ case BIO_READ: case BIO_WRITE: - d_maxsize = (bp->bio_cmd == BIO_DELETE) ? - dp->d_delmaxsize : dp->d_maxsize; - if (bp->bio_length <= d_maxsize) { - bp->bio_disk = dp; - bp->bio_to = (void *)bp->bio_done; - bp->bio_done = g_disk_done_single; - bp->bio_pblkno = bp->bio_offset / dp->d_sectorsize; - bp->bio_bcount = bp->bio_length; - mtx_lock(&sc->start_mtx); - devstat_start_transaction_bio(dp->d_devstat, bp); - mtx_unlock(&sc->start_mtx); - g_disk_lock_giant(dp); - dp->d_strategy(bp); - g_disk_unlock_giant(dp); - break; - } off = 0; bp3 = NULL; bp2 = g_clone_bio(bp); @@ -340,6 +305,10 @@ g_disk_start(struct bio *bp) break; } do { + off_t d_maxsize; + + d_maxsize = (bp->bio_cmd == BIO_DELETE) ? + dp->d_delmaxsize : dp->d_maxsize; bp2->bio_offset += off; bp2->bio_length -= off; if ((bp->bio_flags & BIO_UNMAPPED) == 0) { @@ -447,14 +416,18 @@ g_disk_start(struct bio *bp) error = EOPNOTSUPP; break; } - bp->bio_disk = dp; - bp->bio_to = (void *)bp->bio_done; - bp->bio_done = g_disk_done_single; - mtx_lock(&sc->start_mtx); - devstat_start_transaction_bio(dp->d_devstat, bp); - mtx_unlock(&sc->start_mtx); + bp2 = g_clone_bio(bp); + if (bp2 == NULL) { + g_io_deliver(bp, ENOMEM); + return; + } + bp2->bio_done = g_disk_done; + bp2->bio_disk = dp; + mtx_lock(&sc->start_mtx); + devstat_start_transaction_bio(dp->d_devstat, bp2); + mtx_unlock(&sc->start_mtx); g_disk_lock_giant(dp); - dp->d_strategy(bp); + dp->d_strategy(bp2); g_disk_unlock_giant(dp); break; default: Modified: stable/10/sys/kern/vfs_bio.c ============================================================================== --- stable/10/sys/kern/vfs_bio.c Tue Oct 28 07:19:02 2014 (r273766) +++ stable/10/sys/kern/vfs_bio.c Tue Oct 28 08:00:28 2014 (r273767) @@ -3585,8 +3585,10 @@ biodone(struct bio *bp) bp->bio_flags |= BIO_DONE; wakeup(bp); mtx_unlock(mtxp); - } else + } else { + bp->bio_flags |= BIO_DONE; done(bp); + } } /* From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 08:37:17 2014 Return-Path: Delivered-To: svn-src-all@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 F329C26C; Tue, 28 Oct 2014 08:37:16 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id AF05F89C; Tue, 28 Oct 2014 08:37:16 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id EEC7EA931; Tue, 28 Oct 2014 08:37:09 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 0693E10693; Tue, 28 Oct 2014 09:37:10 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Kurt Jaeger Subject: Re: svn commit: r273734 - head/bin/dd References: <201410271138.s9RBcHrA002447@svn.freebsd.org> <20141027153957.GZ1877@kib.kiev.ua> <20141027155427.GM1492@f10.opsec.eu> Date: Tue, 28 Oct 2014 09:37:10 +0100 In-Reply-To: <20141027155427.GM1492@f10.opsec.eu> (Kurt Jaeger's message of "Mon, 27 Oct 2014 16:54:27 +0100") Message-ID: <86vbn4egjt.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 08:37:17 -0000 Kurt Jaeger writes: > Konstantin Belousov writes: > > On Mon, Oct 27, 2014 at 11:38:17AM +0000, Kurt Jaeger wrote: > > /scratch/tmp/kib/src/bin/dd/args.c:192: warning: format '%jd' expects t= ype 'intmax_t', but argument 3 has type 'int' > Thanks for the pointer. I'll take it up with the submitter. In an ideal world, you would have reviewed the patch before committing it... > I do not have a working arm setup right now. This is a bug on all platforms, and both clang and (recent) gcc should complain about it. That printf() call will print garbage. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 09:23:44 2014 Return-Path: Delivered-To: svn-src-all@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 B0819AEF; Tue, 28 Oct 2014 09:23:44 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 4B425D2E; Tue, 28 Oct 2014 09:23:43 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 6F4D5A976; Tue, 28 Oct 2014 09:16:42 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 7E664106A6; Tue, 28 Oct 2014 10:16:43 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Kurt Jaeger Subject: Re: svn commit: r273734 - head/bin/dd References: <201410271138.s9RBcHrA002447@svn.freebsd.org> <20141027153957.GZ1877@kib.kiev.ua> <20141027155427.GM1492@f10.opsec.eu> <86vbn4egjt.fsf@nine.des.no> Date: Tue, 28 Oct 2014 10:16:43 +0100 In-Reply-To: <86vbn4egjt.fsf@nine.des.no> ("Dag-Erling =?utf-8?Q?Sm=C3=B8r?= =?utf-8?Q?grav=22's?= message of "Tue, 28 Oct 2014 09:37:10 +0100") Message-ID: <86r3xseepw.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 09:23:44 -0000 Dag-Erling Sm=C3=B8rgrav writes: > Kurt Jaeger writes: > > I do not have a working arm setup right now. > This is a bug on all platforms, and both clang and (recent) gcc should > complain about it. That printf() call will print garbage. Correction: it will print garbage on 32-bit platforms, where sizeof(int) !=3D sizeof(intmax_t), but clang and gcc should still emit a warning. You don't need "a working arm setup" to see this; all you need is to cross-build (make TARGET=3Darm TARGET_ARCH=3Darm buildworld). It won't even take long (15 minutes on my AMD FX8350) since the arm world is significantly smaller than the i386 or amd64 world. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 09:28:26 2014 Return-Path: Delivered-To: svn-src-all@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 F2057C71; Tue, 28 Oct 2014 09:28:25 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id A8F1AD4F; Tue, 28 Oct 2014 09:28:25 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id B970AD64411; Tue, 28 Oct 2014 20:28:22 +1100 (AEDT) Date: Tue, 28 Oct 2014 20:28:16 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= Subject: Re: svn commit: r273734 - head/bin/dd In-Reply-To: <86vbn4egjt.fsf@nine.des.no> Message-ID: <20141028200418.E849@besplex.bde.org> References: <201410271138.s9RBcHrA002447@svn.freebsd.org> <20141027153957.GZ1877@kib.kiev.ua> <20141027155427.GM1492@f10.opsec.eu> <86vbn4egjt.fsf@nine.des.no> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=BdjhjNd2 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=nlC_4_pT8q9DhB4Ho9EA:9 a=cz2ZRIgtxKwA:10 a=wJWlkF7cXJYA:10 a=6I5d2MoRAAAA:8 a=pGLkceISAAAA:8 a=x6D4cnrRXBCFxlKM-O0A:9 a=aavBeuD2s3L_R28L:21 a=Opo4oY_bKmlN-vx-:21 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: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Kurt Jaeger X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 09:28:26 -0000 On Tue, 28 Oct 2014, [utf-8] Dag-Erling Sm=C3=B8rgrav wrote: > Kurt Jaeger writes: >> Konstantin Belousov writes: >>> On Mon, Oct 27, 2014 at 11:38:17AM +0000, Kurt Jaeger wrote: >>> /scratch/tmp/kib/src/bin/dd/args.c:192: warning: format '%jd' expects t= ype 'intmax_t', but argument 3 has type 'int' >> Thanks for the pointer. I'll take it up with the submitter. > > In an ideal world, you would have reviewed the patch before committing > it... > >> I do not have a working arm setup right now. > > This is a bug on all platforms, and both clang and (recent) gcc should > complain about it. That printf() call will print garbage. No, this is only a bug on 32-bit arches. The is is SSIZE_MAX. It has type int on 32-bit arches and type long on 64-bit arches. These types are the same as ssize_t. The compiler prints 'int' in the diagnostic on 32-bit arches since it cannot see that the int is really an ssize_t. SSIZE_MAX is defined as a literal constant with a correct type so that it works in cpp expressions, so it doesn't have a cast to ssize_t. At least clang has more understanding of typedefed types then the C standard requires, so it can distinguish identical types diagnostics. Of course the patch is just broken in removing the casts of SSIZE_MAX. They were carefully done to avoid precisely this portability bug. Long long is an abomination, but you could find a lot of these portability bugs on 64-bit arches by changing [u]intmax_t to [unsigned] while keeping [u]int64_t, [s]size_t and off_t as [unsigned] long. Then everything except [u]intmax_t and would need to be cast to print it using %j[du], the same as on 32-bit arches. Only change this transiently. It breaks detection of the mismatch between and intmax_t. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 09:52:40 2014 Return-Path: Delivered-To: svn-src-all@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 8337F3C0; Tue, 28 Oct 2014 09:52:40 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 2A772A; Tue, 28 Oct 2014 09:52:39 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id E51CEA9FC; Tue, 28 Oct 2014 09:52:38 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 03CA0106AB; Tue, 28 Oct 2014 10:52:40 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Bruce Evans Subject: Re: svn commit: r273734 - head/bin/dd References: <201410271138.s9RBcHrA002447@svn.freebsd.org> <20141027153957.GZ1877@kib.kiev.ua> <20141027155427.GM1492@f10.opsec.eu> <86vbn4egjt.fsf@nine.des.no> <20141028200418.E849@besplex.bde.org> Date: Tue, 28 Oct 2014 10:52:39 +0100 In-Reply-To: <20141028200418.E849@besplex.bde.org> (Bruce Evans's message of "Tue, 28 Oct 2014 20:28:16 +1100 (EST)") Message-ID: <86mw8ged20.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Kurt Jaeger X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 09:52:40 -0000 Bruce Evans writes: > Dag-Erling Sm=C3=B8rgrav writes: > > This is a bug on all platforms, and both clang and (recent) gcc > > should complain about it. That printf() call will print garbage. > No, this is only a bug on 32-bit arches. The is is SSIZE_MAX. If you mean "it only has consequences on 32-bit arches", then I agree - but it is still a bug to pass an int to %jd. =C2=A77.19.6.1 9 If a conversion specification is invalid, the behavior is undefined. 239) If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined. The term "correct type" is not defined anywhere, and is only used in the descriptions of fprintf() and fwprintf(). DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 10:26:00 2014 Return-Path: Delivered-To: svn-src-all@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 888D0C39; Tue, 28 Oct 2014 10:26: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 5D0773D3; Tue, 28 Oct 2014 10:26: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 s9SAPxVf066565; Tue, 28 Oct 2014 10:25:59 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SAPxCw066563; Tue, 28 Oct 2014 10:25:59 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410281025.s9SAPxCw066563@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 28 Oct 2014 10:25:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273768 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 10:26:00 -0000 Author: trasz Date: Tue Oct 28 10:25:59 2014 New Revision: 273768 URL: https://svnweb.freebsd.org/changeset/base/273768 Log: Remove the distinction between strings and numbers from ctld(8) yacc parser. This fixes problems with passing strings that look like numbers to clauses that expect strings; previously it caused syntax errors and had to be worked by user, using quotes. The workaround introduced in r267833 is no longer neccessary. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/parse.y head/usr.sbin/ctld/token.l Modified: head/usr.sbin/ctld/parse.y ============================================================================== --- head/usr.sbin/ctld/parse.y Tue Oct 28 08:00:28 2014 (r273767) +++ head/usr.sbin/ctld/parse.y Tue Oct 28 10:25:59 2014 (r273768) @@ -101,21 +101,45 @@ statement: target ; -debug: DEBUG NUM +debug: DEBUG STR { - conf->conf_debug = $2; + uint64_t tmp; + + if (expand_number($2, &tmp) != 0) { + log_warnx("invalid numeric value \"%s\"", $2); + free($2); + return (1); + } + + conf->conf_debug = tmp; } ; -timeout: TIMEOUT NUM +timeout: TIMEOUT STR { - conf->conf_timeout = $2; + uint64_t tmp; + + if (expand_number($2, &tmp) != 0) { + log_warnx("invalid numeric value \"%s\"", $2); + free($2); + return (1); + } + + conf->conf_timeout = tmp; } ; -maxproc: MAXPROC NUM +maxproc: MAXPROC STR { - conf->conf_maxproc = $2; + uint64_t tmp; + + if (expand_number($2, &tmp) != 0) { + log_warnx("invalid numeric value \"%s\"", $2); + free($2); + return (1); + } + + conf->conf_maxproc = tmp; } ; @@ -583,9 +607,17 @@ target_lun: LUN lun_number } ; -lun_number: NUM +lun_number: STR { - lun = lun_new(target, $1); + uint64_t tmp; + + if (expand_number($1, &tmp) != 0) { + log_warnx("invalid numeric value \"%s\"", $1); + free($1); + return (1); + } + + lun = lun_new(target, tmp); if (lun == NULL) return (1); } @@ -626,15 +658,23 @@ lun_backend: BACKEND STR } ; -lun_blocksize: BLOCKSIZE NUM +lun_blocksize: BLOCKSIZE STR { + uint64_t tmp; + + if (expand_number($2, &tmp) != 0) { + log_warnx("invalid numeric value \"%s\"", $2); + free($2); + return (1); + } + if (lun->l_blocksize != 0) { log_warnx("blocksize for lun %d, target \"%s\" " "specified more than once", lun->l_lun, target->t_name); return (1); } - lun_set_blocksize(lun, $2); + lun_set_blocksize(lun, tmp); } ; @@ -689,31 +729,26 @@ lun_serial: SERIAL STR } lun_set_serial(lun, $2); free($2); - } | SERIAL NUM + } + ; + +lun_size: SIZE STR { - char *str = NULL; + uint64_t tmp; - if (lun->l_serial != NULL) { - log_warnx("serial for lun %d, target \"%s\" " - "specified more than once", - lun->l_lun, target->t_name); + if (expand_number($2, &tmp) != 0) { + log_warnx("invalid numeric value \"%s\"", $2); + free($2); return (1); } - asprintf(&str, "%ju", $2); - lun_set_serial(lun, str); - free(str); - } - ; -lun_size: SIZE NUM - { if (lun->l_size != 0) { log_warnx("size for lun %d, target \"%s\" " "specified more than once", lun->l_lun, target->t_name); return (1); } - lun_set_size(lun, $2); + lun_set_size(lun, tmp); } ; %% Modified: head/usr.sbin/ctld/token.l ============================================================================== --- head/usr.sbin/ctld/token.l Tue Oct 28 08:00:28 2014 (r273767) +++ head/usr.sbin/ctld/token.l Tue Oct 28 10:25:59 2014 (r273768) @@ -75,12 +75,6 @@ serial { return SERIAL; } size { return SIZE; } target { return TARGET; } timeout { return TIMEOUT; } -[0-9]+[kKmMgGtTpPeE]? { if (expand_number(yytext, &yylval.num) == 0) - return NUM; - else { - yylval.str = strdup(yytext); return STR; - } - } \"[^"]+\" { yylval.str = strndup(yytext + 1, strlen(yytext) - 2); return STR; } [a-zA-Z0-9\.\-_/\:\[\]]+ { yylval.str = strdup(yytext); return STR; } From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 10:33:32 2014 Return-Path: Delivered-To: svn-src-all@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 A9713F80; Tue, 28 Oct 2014 10:33: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 860AB69D; Tue, 28 Oct 2014 10:33: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 s9SAXWsN070880; Tue, 28 Oct 2014 10:33:32 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SAXWdZ070878; Tue, 28 Oct 2014 10:33:32 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201410281033.s9SAXWdZ070878@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 28 Oct 2014 10:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273769 - head/usr.bin/timeout X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 10:33:32 -0000 Author: bapt Date: Tue Oct 28 10:33:31 2014 New Revision: 273769 URL: https://svnweb.freebsd.org/changeset/base/273769 Log: Improve compatibility with GNU timeout According to the coreutils regression testsuite for timeout(1) It is expect to exit with a status being: 125 in case an invalid duration or signal is passed in arguments 126 in case an invalid command is passed in arguments 127 in case the command passed in arguments does not exists. While here document this behaviour in the man page Modified: head/usr.bin/timeout/timeout.1 head/usr.bin/timeout/timeout.c Modified: head/usr.bin/timeout/timeout.1 ============================================================================== --- head/usr.bin/timeout/timeout.1 Tue Oct 28 10:25:59 2014 (r273768) +++ head/usr.bin/timeout/timeout.1 Tue Oct 28 10:33:31 2014 (r273769) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 19, 2014 +.Dd Oct 28, 2014 .Dt TIMEOUT 1 .Os .Sh NAME @@ -108,7 +108,22 @@ is not set, an exit status of 124 is ret .Pp If .Ar command -exits after receiving a signal, the exit status returned is the signal number plus 128. +exits after receiving a signal, the exit status returned is the signal number +plus 128. +.Pp +If +.Ar command +is an invalid command, the exit status returned is 126. +.Pp +If +.Ar command +is a non existing command, the exit status returned is 127. +.Pp +If an invalid parameter is passed to +.Fl s +or +.Fl k , +the exit status return is 125. .Sh SEE ALSO .Xr kill 1 , .Xr signal 3 Modified: head/usr.bin/timeout/timeout.c ============================================================================== --- head/usr.bin/timeout/timeout.c Tue Oct 28 10:25:59 2014 (r273768) +++ head/usr.bin/timeout/timeout.c Tue Oct 28 10:33:31 2014 (r273769) @@ -68,7 +68,7 @@ parse_duration(const char *duration) ret = strtod(duration, &end); if (ret == 0 && end == duration) - errx(EXIT_FAILURE, "invalid duration"); + errx(125, "invalid duration"); if (end == NULL || *end == '\0') return (ret); @@ -89,11 +89,11 @@ parse_duration(const char *duration) ret *= 60 * 60 * 24; break; default: - errx(EX_USAGE, "invalid duration"); + errx(125, "invalid duration"); } if (ret < 0 || ret >= 100000000UL) - errx(EX_USAGE, "invalid duration"); + errx(125, "invalid duration"); return (ret); } @@ -116,7 +116,7 @@ parse_signal(const char *str) return (i); } - errx(EX_USAGE, "invalid signal"); + errx(125, "invalid signal"); } static void @@ -260,8 +260,12 @@ main(int argc, char **argv) signal(SIGTTOU, SIG_DFL); error = execvp(argv[0], argv); - if (error == -1) - err(EX_UNAVAILABLE, "exec()"); + if (error == -1) { + if (errno == ENOENT) + err(127, "exec(%s)", argv[0]); + else + err(126, "exec(%s)", argv[0]); + } } if (sigprocmask(SIG_BLOCK, &signals.sa_mask, NULL) == -1) From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 10:39:30 2014 Return-Path: Delivered-To: svn-src-all@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 28FDF1BB; Tue, 28 Oct 2014 10:39: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 055C86CD; Tue, 28 Oct 2014 10:39: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 s9SAdTWa071654; Tue, 28 Oct 2014 10:39:29 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SAdTVQ071653; Tue, 28 Oct 2014 10:39:29 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410281039.s9SAdTVQ071653@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 28 Oct 2014 10:39:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273770 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 10:39:30 -0000 Author: trasz Date: Tue Oct 28 10:39:29 2014 New Revision: 273770 URL: https://svnweb.freebsd.org/changeset/base/273770 Log: Fix build after previous commit. While here, improve error messages. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/parse.y Modified: head/usr.sbin/ctld/parse.y ============================================================================== --- head/usr.sbin/ctld/parse.y Tue Oct 28 10:33:31 2014 (r273769) +++ head/usr.sbin/ctld/parse.y Tue Oct 28 10:39:29 2014 (r273770) @@ -59,17 +59,15 @@ extern void yyrestart(FILE *); %token ALIAS AUTH_GROUP AUTH_TYPE BACKEND BLOCKSIZE CHAP CHAP_MUTUAL %token CLOSING_BRACKET DEBUG DEVICE_ID DISCOVERY_AUTH_GROUP INITIATOR_NAME -%token INITIATOR_PORTAL LISTEN LISTEN_ISER LUN MAXPROC NUM OPENING_BRACKET +%token INITIATOR_PORTAL LISTEN LISTEN_ISER LUN MAXPROC OPENING_BRACKET %token OPTION PATH PIDFILE PORTAL_GROUP SERIAL SIZE STR TARGET TIMEOUT %token ISNS_SERVER ISNS_PERIOD ISNS_TIMEOUT %union { - uint64_t num; char *str; } -%token NUM %token STR %% @@ -106,7 +104,7 @@ debug: DEBUG STR uint64_t tmp; if (expand_number($2, &tmp) != 0) { - log_warnx("invalid numeric value \"%s\"", $2); + yyerror("invalid numeric value"); free($2); return (1); } @@ -120,7 +118,7 @@ timeout: TIMEOUT STR uint64_t tmp; if (expand_number($2, &tmp) != 0) { - log_warnx("invalid numeric value \"%s\"", $2); + yyerror("invalid numeric value"); free($2); return (1); } @@ -134,7 +132,7 @@ maxproc: MAXPROC STR uint64_t tmp; if (expand_number($2, &tmp) != 0) { - log_warnx("invalid numeric value \"%s\"", $2); + yyerror("invalid numeric value"); free($2); return (1); } @@ -165,15 +163,31 @@ isns_server: ISNS_SERVER STR } ; -isns_period: ISNS_PERIOD NUM +isns_period: ISNS_PERIOD STR { - conf->conf_isns_period = $2; + uint64_t tmp; + + if (expand_number($2, &tmp) != 0) { + yyerror("invalid numeric value"); + free($2); + return (1); + } + + conf->conf_isns_period = tmp; } ; -isns_timeout: ISNS_TIMEOUT NUM +isns_timeout: ISNS_TIMEOUT STR { - conf->conf_isns_timeout = $2; + uint64_t tmp; + + if (expand_number($2, &tmp) != 0) { + yyerror("invalid numeric value"); + free($2); + return (1); + } + + conf->conf_isns_timeout = tmp; } ; @@ -612,7 +626,7 @@ lun_number: STR uint64_t tmp; if (expand_number($1, &tmp) != 0) { - log_warnx("invalid numeric value \"%s\"", $1); + yyerror("invalid numeric value"); free($1); return (1); } @@ -663,7 +677,7 @@ lun_blocksize: BLOCKSIZE STR uint64_t tmp; if (expand_number($2, &tmp) != 0) { - log_warnx("invalid numeric value \"%s\"", $2); + yyerror("invalid numeric value"); free($2); return (1); } @@ -737,7 +751,7 @@ lun_size: SIZE STR uint64_t tmp; if (expand_number($2, &tmp) != 0) { - log_warnx("invalid numeric value \"%s\"", $2); + yyerror("invalid numeric value"); free($2); return (1); } From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 10:39:43 2014 Return-Path: Delivered-To: svn-src-all@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 13BD4341; Tue, 28 Oct 2014 10:39:43 +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 DA2686D4; Tue, 28 Oct 2014 10:39: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 s9SAdgCZ071722; Tue, 28 Oct 2014 10:39:42 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SAdfvq071716; Tue, 28 Oct 2014 10:39:41 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201410281039.s9SAdfvq071716@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 28 Oct 2014 10:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273771 - in head: etc/mtree usr.bin/timeout usr.bin/timeout/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 10:39:43 -0000 Author: bapt Date: Tue Oct 28 10:39:41 2014 New Revision: 273771 URL: https://svnweb.freebsd.org/changeset/base/273771 Log: Add regression tests for the timeout(1) utility They are modeled over the regression tests that are provided for the GNU coreutils timeout(1) utility Added: head/usr.bin/timeout/tests/ head/usr.bin/timeout/tests/Makefile (contents, props changed) head/usr.bin/timeout/tests/timeout.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.bin/timeout/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Tue Oct 28 10:39:29 2014 (r273770) +++ head/etc/mtree/BSD.tests.dist Tue Oct 28 10:39:41 2014 (r273771) @@ -281,6 +281,8 @@ regress.multitest.out .. .. + timeout + .. tr .. truncate Modified: head/usr.bin/timeout/Makefile ============================================================================== --- head/usr.bin/timeout/Makefile Tue Oct 28 10:39:29 2014 (r273770) +++ head/usr.bin/timeout/Makefile Tue Oct 28 10:39:41 2014 (r273771) @@ -1,5 +1,11 @@ # $FreeBSD$ +.include + PROG= timeout +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/usr.bin/timeout/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/timeout/tests/Makefile Tue Oct 28 10:39:41 2014 (r273771) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/timeout + +ATF_TESTS_SH= timeout + +.include Added: head/usr.bin/timeout/tests/timeout.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/timeout/tests/timeout.sh Tue Oct 28 10:39:41 2014 (r273771) @@ -0,0 +1,215 @@ +# $FreeBSD$ + +atf_test_case nominal +nominal_head() +{ + atf_set "descr" "Basic tests on timeout(1) utility" +} + +nominal_body() +{ + atf_check \ + -o empty \ + -e empty \ + -s exit:0 \ + -x timeout 5 true +} + +atf_test_case time_unit +time_unit_head() +{ + atf_set "descr" "Test parsing the default time unit" +} + +time_unit_body() +{ + atf_check \ + -o empty \ + -e empty \ + -s exit:0 \ + -x timeout 1d true + + atf_check \ + -o empty \ + -e empty \ + -s exit:0 \ + -x timeout 1h true + + atf_check \ + -o empty \ + -e empty \ + -s exit:0 \ + -x timeout 1m true + + atf_check \ + -o empty \ + -e empty \ + -s exit:0 \ + -x timeout 1s true +} + +atf_test_case no_timeout +no_timeout_head() +{ + atf_set "descr" "Test disabled timeout" +} + +no_timeout_body() +{ + atf_check \ + -o empty \ + -e empty \ + -s exit:0 \ + -x timeout 0 true +} + +atf_test_case exit_numbers +exit_numbers_head() +{ + atf_set "descr" "Test exit numbers" +} + +exit_numbers_body() +{ + atf_check \ + -o empty \ + -e empty \ + -s exit:2 \ + -x timeout 5 sh -c \'exit 2\' + + atf_check \ + -o empty \ + -e empty \ + -s exit:124 \ + -x timeout .1 sleep 1 + + # With preserv status exit shoudl be 128 + TERM aka 143 + atf_check \ + -o empty \ + -e empty \ + -s exit:143 \ + -x timeout --preserve-status .1 sleep 10 + + atf_check \ + -o empty \ + -e empty \ + -s exit:124 \ + -x timeout -s1 -k1 .1 sleep 10 + + atf_check \ + -o empty \ + -e empty \ + -s exit:0 \ + -x sh -c 'trap "" CHLD; exec timeout 10 true' +} + +atf_test_case with_a_child +with_a_child_head() +{ + atf_set "descr" "When starting with a child (coreutils bug#9098)" +} + +with_a_child_body() +{ + out=$(sleep .1 & exec timeout .5 sh -c 'sleep 2; echo foo') + status=$? + test "$out" = "" && test $status = 124 || atf_fail + +} + +atf_test_case invalid_timeout +invalid_timeout_head() +{ + atf_set "descr" "Invalid timeout" +} + +invalid_timeout_body() +{ + atf_check \ + -o empty \ + -e inline:"timeout: invalid duration\n" \ + -s exit:125 \ + -x timeout invalid sleep 0 + + atf_check \ + -o empty \ + -e inline:"timeout: invalid duration\n" \ + -s exit:125 \ + -x timeout --kill-after=invalid 1 sleep 0 + + atf_check \ + -o empty \ + -e inline:"timeout: invalid duration\n" \ + -s exit:125 \ + -x timeout 42D sleep 0 + + atf_check \ + -o empty \ + -e inline:"timeout: invalid duration\n" \ + -s exit:125 \ + -x timeout 999999999999999999999999999999999999999999999999999999999999d sleep 0 + + atf_check \ + -o empty \ + -e inline:"timeout: invalid duration\n" \ + -s exit:125 \ + -x timeout 2.34e+5d sleep 0 +} + +atf_test_case invalid_signal +invalid_signal_head() +{ + atf_set "descr" "Invalid signal" +} + +invalid_signal_body() +{ + atf_check \ + -o empty \ + -e inline:"timeout: invalid signal\n" \ + -s exit:125 \ + -x timeout --signal=invalid 1 sleep 0 +} + +atf_test_case invalid_command +invalid_command_head() +{ + atf_set "descr" "Invalid command" +} + +invalid_command_body() +{ + atf_check \ + -o empty \ + -e inline:"timeout: exec(.): Permission denied\n" \ + -s exit:126 \ + -x timeout 10 . +} + +atf_test_case no_such_command +no_such_command_head() +{ + atf_set "descr" "No such command" +} + +no_such_command_body() +{ + atf_check \ + -o empty \ + -e inline:"timeout: exec(enoexists): No such file or directory\n" \ + -s exit:127 \ + -x timeout 10 enoexists +} + +atf_init_test_cases() +{ + atf_add_test_case nominal + atf_add_test_case time_unit + atf_add_test_case no_timeout + atf_add_test_case exit_numbers + atf_add_test_case with_a_child + atf_add_test_case invalid_timeout + atf_add_test_case invalid_signal + atf_add_test_case invalid_command + atf_add_test_case no_such_command +} From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 11:00:11 2014 Return-Path: Delivered-To: svn-src-all@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 BEC4E620 for ; Tue, 28 Oct 2014 11:00:11 +0000 (UTC) Received: from ost.citrin.ru (ost.citrin.ru [193.169.234.215]) (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 6D6F299B for ; Tue, 28 Oct 2014 11:00:10 +0000 (UTC) Received: from citrin.office.vega.ru (office-nat.spylog.net [193.169.234.6]) (Authenticated sender: citrin@citrin.ru) by ost.citrin.ru (Postfix) with ESMTPSA id 7A734E0F803 for ; Tue, 28 Oct 2014 11:00:00 +0000 (UTC) Message-ID: <544F7730.2030608@citrin.ru> Date: Tue, 28 Oct 2014 14:00:00 +0300 From: Anton Yuzhaninov User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130516 Thunderbird/17.0.6 MIME-Version: 1.0 To: svn-src-all@freebsd.org Subject: Re: svn commit: r273766 - head/sys/amd64/vmm/amd References: <201410280719.s9S7J3DP078739@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrin.ru; s=s0; t=1414494001; bh=mQ9ITh42cVjtGJglJmTXkh084Qyc5PdaBACTCJ1zPFg=; h=Message-ID:Date:From:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=Z37bePn2/2bOKLBwhSAp9Q4WKB1jp96hbaPY3kknJBWMkVMADD4Ka4mg/4rRw4NfxRLx/Juj3S2/ZyxF8IamTUXVwzkQmc9K0RBK4DaQGTsdOJ6NyA/Tx/Y3X15Yqdi6q0jrFxv02ldx54LY/pwJzRLsi6mL07Fzd3scZ+BxsOk= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 11:00:11 -0000 On 10/28/14 10:26, Marcelo Araujo wrote: > > Missing the log, my bad!!! And as we don't have 'svn "force commit"' to > append it. > > Change log: > Missing break on the switch case statement. Why commands like: svn propedit svn:log --revprop -r273766 is not allowed? AFAIR propedit --revprop was disallowed to please SVN to CVS export. But now CVS repo is dead. From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 11:20:31 2014 Return-Path: Delivered-To: svn-src-all@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 78D6CA76; Tue, 28 Oct 2014 11:20: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 4B90DB33; Tue, 28 Oct 2014 11:20: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 s9SBKVsw093099; Tue, 28 Oct 2014 11:20:31 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SBKULS093097; Tue, 28 Oct 2014 11:20:30 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201410281120.s9SBKULS093097@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 28 Oct 2014 11:20:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273772 - in head/usr.sbin/pw: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 11:20:31 -0000 Author: bapt Date: Tue Oct 28 11:20:30 2014 New Revision: 273772 URL: https://svnweb.freebsd.org/changeset/base/273772 Log: When a group is renamed then the group has been invalidated for sure. In that case get the group information using the new name. Add a regression test about this bug PR: 193704 Reported by: az Modified: head/usr.sbin/pw/pw_group.c head/usr.sbin/pw/tests/pw_modify.sh Modified: head/usr.sbin/pw/pw_group.c ============================================================================== --- head/usr.sbin/pw/pw_group.c Tue Oct 28 10:39:41 2014 (r273771) +++ head/usr.sbin/pw/pw_group.c Tue Oct 28 11:20:30 2014 (r273772) @@ -51,6 +51,7 @@ int pw_group(struct userconf * cnf, int mode, struct cargs * args) { int rc; + struct carg *a_newname = getarg(args, 'l'); struct carg *a_name = getarg(args, 'n'); struct carg *a_gid = getarg(args, 'g'); struct carg *arg; @@ -140,8 +141,8 @@ pw_group(struct userconf * cnf, int mode if (a_gid) grp->gr_gid = (gid_t) atoi(a_gid->val); - if ((arg = getarg(args, 'l')) != NULL) - grp->gr_name = pw_checkname((u_char *)arg->val, 0); + if (a_newname != NULL) + grp->gr_name = pw_checkname((u_char *)a_newname->val, 0); } else { if (a_name == NULL) /* Required */ errx(EX_DATAERR, "group name required"); @@ -270,8 +271,10 @@ pw_group(struct userconf * cnf, int mode warn("group update"); return EX_IOERR; } + + arg = a_newname != NULL ? a_newname : a_name; /* grp may have been invalidated */ - if ((grp = GETGRNAM(a_name->val)) == NULL) + if ((grp = GETGRNAM(arg->val)) == NULL) errx(EX_SOFTWARE, "group disappeared during update"); pw_log(cnf, mode, W_GROUP, "%s(%ld)", grp->gr_name, (long) grp->gr_gid); Modified: head/usr.sbin/pw/tests/pw_modify.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_modify.sh Tue Oct 28 10:39:41 2014 (r273771) +++ head/usr.sbin/pw/tests/pw_modify.sh Tue Oct 28 11:20:30 2014 (r273772) @@ -27,8 +27,19 @@ groupmod_invalid_user_body() { atf_check -s exit:0 pw -V ${HOME} groupmod test -d foo } +atf_test_case groupmod_bug_193704 +groupmod_bug_193704_head() { + atf_set "descr" "Regression test for the #193704 bug" +} +groupmod_bug_193704_body() { + populate_etc_skel + atf_check -s exit:0 -x pw -V ${HOME} groupadd test + atf_check -s exit:0 -x pw -V ${HOME} groupmod test -l newgroupname + atf_check -s exit:65 -e match:"^pw: unknown group" -x pw -V ${HOME} groupshow test +} atf_init_test_cases() { atf_add_test_case groupmod_user atf_add_test_case groupmod_invalid_user + atf_add_test_case groupmod_bug_193704 } From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 11:33:12 2014 Return-Path: Delivered-To: svn-src-all@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 74791D05; Tue, 28 Oct 2014 11:33:12 +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 33219CE3; Tue, 28 Oct 2014 11:33:11 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 77F5B1A2CFF; Tue, 28 Oct 2014 22:33:03 +1100 (AEDT) Date: Tue, 28 Oct 2014 22:33:01 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= Subject: Re: svn commit: r273734 - head/bin/dd In-Reply-To: <86mw8ged20.fsf@nine.des.no> Message-ID: <20141028210830.L1034@besplex.bde.org> References: <201410271138.s9RBcHrA002447@svn.freebsd.org> <20141027153957.GZ1877@kib.kiev.ua> <20141027155427.GM1492@f10.opsec.eu> <86vbn4egjt.fsf@nine.des.no> <20141028200418.E849@besplex.bde.org> <86mw8ged20.fsf@nine.des.no> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=BdjhjNd2 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=nlC_4_pT8q9DhB4Ho9EA:9 a=cz2ZRIgtxKwA:10 a=wJWlkF7cXJYA:10 a=R2VWvxA4upp-_jUe8dYA: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: src-committers@freebsd.org, Bruce Evans , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Kurt Jaeger , Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 11:33:12 -0000 On Tue, 28 Oct 2014, [utf-8] Dag-Erling Sm=C3=B8rgrav wrote: > Bruce Evans writes: >> Dag-Erling Sm=C3=B8rgrav writes: >>> This is a bug on all platforms, and both clang and (recent) gcc >>> should complain about it. That printf() call will print garbage. >> No, this is only a bug on 32-bit arches. The is is SSIZE_MAX. > > If you mean "it only has consequences on 32-bit arches", then I agree - > but it is still a bug to pass an int to %jd. This is machine-dependent. intmax_t may be int. The only requirement on intmax_t is that it can represent any value of any signed integer type. This is possible if the largest integer type is 64 bits (the smallest permitted largest type) and int is also 64 bits (and there are no complications for padding bits). intmax_t can even be signed char if that is wide enough (not in POSIX starting 10-15 years ago, since signed char is now required to be 8 bits. It is weird for intmax_t to have the lowest rank (not counting Bool), but FreeBSD uses this loophole to make it have second highest rank on 64-bit arches. > =C2=A77.19.6.1 > > 9 If a conversion specification is invalid, the behavior is > undefined. 239) If any argument is not the correct type for the > corresponding conversion specification, the behavior is undefined. > > The term "correct type" is not defined anywhere, and is only used in the > descriptions of fprintf() and fwprintf(). Binary compatibility gives strong restrictions, and I think the standard is just as strict. Types must match after the default promotions, since otherwise their sizes and representations may be completely different even when their range is the same. "Correct type" for %jd should meant "the same type after the default promotion as intmax_t after its default promotion", but %jd also works for args of type uintmax_t that are not too large, since then they are required to have the same respresentation as when they are cast to the correct type (intmax_t). Bruce From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 12:00:42 2014 Return-Path: Delivered-To: svn-src-all@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 3D3CE28E; Tue, 28 Oct 2014 12:00: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 25606EF6; Tue, 28 Oct 2014 12:00: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 s9SC0gTp010547; Tue, 28 Oct 2014 12:00:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SC0eMm010535; Tue, 28 Oct 2014 12:00:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410281200.s9SC0eMm010535@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 28 Oct 2014 12:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273773 - in head/sys: dev/acpi_support dev/acpica dev/asmc kern net netinet netinet/cc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 12:00:42 -0000 Author: hselasky Date: Tue Oct 28 12:00:39 2014 New Revision: 273773 URL: https://svnweb.freebsd.org/changeset/base/273773 Log: The SYSCTL data pointers can come from userspace and must not be directly accessed. Although this will work on some platforms, it can throw an exception if the pointer is invalid and then panic the kernel. Add a missing SYSCTL_IN() of "SCTP_BASE_STATS" structure. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/acpi_support/acpi_ibm.c head/sys/dev/acpica/acpi.c head/sys/dev/asmc/asmc.c head/sys/kern/kern_ffclock.c head/sys/net/bpf.c head/sys/netinet/cc/cc.c head/sys/netinet/sctp_sysctl.c head/sys/netinet/siftr.c Modified: head/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- head/sys/dev/acpi_support/acpi_ibm.c Tue Oct 28 11:20:30 2014 (r273772) +++ head/sys/dev/acpi_support/acpi_ibm.c Tue Oct 28 12:00:39 2014 (r273773) @@ -899,6 +899,7 @@ acpi_ibm_handlerevents_sysctl(SYSCTL_HAN char *cp, *ep; int l, val; unsigned int handler_events; + char temp[128]; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -920,17 +921,18 @@ acpi_ibm_handlerevents_sysctl(SYSCTL_HAN sbuf_trim(&sb); sbuf_finish(&sb); - - /* Copy out the old values to the user. */ - error = SYSCTL_OUT(req, sbuf_data(&sb), sbuf_len(&sb)); + strlcpy(temp, sbuf_data(&sb), sizeof(temp)); sbuf_delete(&sb); + error = sysctl_handle_string(oidp, temp, sizeof(temp), req); + + /* Check for error or no change */ if (error != 0 || req->newptr == NULL) goto out; /* If the user is setting a string, parse it. */ handler_events = 0; - cp = (char *)req->newptr; + cp = temp; while (*cp) { if (isspace(*cp)) { cp++; Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Tue Oct 28 11:20:30 2014 (r273772) +++ head/sys/dev/acpica/acpi.c Tue Oct 28 12:00:39 2014 (r273773) @@ -3783,6 +3783,7 @@ acpi_debug_sysctl(SYSCTL_HANDLER_ARGS) int error, *dbg; struct debugtag *tag; struct sbuf sb; + char temp[128]; if (sbuf_new(&sb, NULL, 128, SBUF_AUTOEXTEND) == NULL) return (ENOMEM); @@ -3806,16 +3807,16 @@ acpi_debug_sysctl(SYSCTL_HANDLER_ARGS) } sbuf_trim(&sb); sbuf_finish(&sb); - - /* Copy out the old values to the user. */ - error = SYSCTL_OUT(req, sbuf_data(&sb), sbuf_len(&sb)); + strlcpy(temp, sbuf_data(&sb), sizeof(temp)); sbuf_delete(&sb); - /* If the user is setting a string, parse it. */ + error = sysctl_handle_string(oidp, temp, sizeof(temp), req); + + /* Check for error or no change */ if (error == 0 && req->newptr != NULL) { - *dbg = 0; - kern_setenv((char *)oidp->oid_arg1, (char *)req->newptr); - acpi_set_debugging(NULL); + *dbg = 0; + kern_setenv((char *)oidp->oid_arg1, temp); + acpi_set_debugging(NULL); } ACPI_SERIAL_END(acpi); Modified: head/sys/dev/asmc/asmc.c ============================================================================== --- head/sys/dev/asmc/asmc.c Tue Oct 28 11:20:30 2014 (r273772) +++ head/sys/dev/asmc/asmc.c Tue Oct 28 12:00:39 2014 (r273773) @@ -1052,7 +1052,7 @@ asmc_mb_sysctl_fanminspeed(SYSCTL_HANDLE error = sysctl_handle_int(oidp, &v, 0, req); if (error == 0 && req->newptr != NULL) { - unsigned int newspeed = *(unsigned int *)req->newptr; + unsigned int newspeed = v; asmc_fan_setvalue(dev, ASMC_KEY_FANMINSPEED, fan, newspeed); } @@ -1071,7 +1071,7 @@ asmc_mb_sysctl_fanmaxspeed(SYSCTL_HANDLE error = sysctl_handle_int(oidp, &v, 0, req); if (error == 0 && req->newptr != NULL) { - unsigned int newspeed = *(unsigned int *)req->newptr; + unsigned int newspeed = v; asmc_fan_setvalue(dev, ASMC_KEY_FANMAXSPEED, fan, newspeed); } @@ -1090,7 +1090,7 @@ asmc_mb_sysctl_fantargetspeed(SYSCTL_HAN error = sysctl_handle_int(oidp, &v, 0, req); if (error == 0 && req->newptr != NULL) { - unsigned int newspeed = *(unsigned int *)req->newptr; + unsigned int newspeed = v; asmc_fan_setvalue(dev, ASMC_KEY_FANTARGETSPEED, fan, newspeed); } @@ -1283,7 +1283,7 @@ asmc_mb_sysctl_sms_z(SYSCTL_HANDLER_ARGS asmc_sms_read(dev, ASMC_KEY_SMS_Z, &val); v = (int32_t) val; - error = sysctl_handle_int(oidp, &v, sizeof(v), req); + error = sysctl_handle_int(oidp, &v, 0, req); return (error); } @@ -1298,7 +1298,7 @@ asmc_mbp_sysctl_light_left(SYSCTL_HANDLE asmc_key_read(dev, ASMC_KEY_LIGHTLEFT, buf, sizeof buf); v = buf[2]; - error = sysctl_handle_int(oidp, &v, sizeof(v), req); + error = sysctl_handle_int(oidp, &v, 0, req); return (error); } @@ -1313,7 +1313,7 @@ asmc_mbp_sysctl_light_right(SYSCTL_HANDL asmc_key_read(dev, ASMC_KEY_LIGHTRIGHT, buf, sizeof buf); v = buf[2]; - error = sysctl_handle_int(oidp, &v, sizeof(v), req); + error = sysctl_handle_int(oidp, &v, 0, req); return (error); } @@ -1324,19 +1324,19 @@ asmc_mbp_sysctl_light_control(SYSCTL_HAN device_t dev = (device_t) arg1; uint8_t buf[2]; int error; - unsigned int level; - static int32_t v; - - error = sysctl_handle_int(oidp, &v, sizeof(v), req); + static unsigned int level; + int v; + + v = level; + error = sysctl_handle_int(oidp, &v, 0, req); + if (error == 0 && req->newptr != NULL) { - level = *(unsigned int *)req->newptr; - if (level > 255) + if (v < 0 || v > 255) return (EINVAL); - v = level; + level = v; buf[0] = level; buf[1] = 0x00; asmc_key_write(dev, ASMC_KEY_LIGHTVALUE, buf, sizeof buf); } - return (error); } Modified: head/sys/kern/kern_ffclock.c ============================================================================== --- head/sys/kern/kern_ffclock.c Tue Oct 28 11:20:30 2014 (r273772) +++ head/sys/kern/kern_ffclock.c Tue Oct 28 12:00:39 2014 (r273773) @@ -203,26 +203,29 @@ static int sysctl_kern_sysclock_active(SYSCTL_HANDLER_ARGS) { char newclock[MAX_SYSCLOCK_NAME_LEN]; - int clk, error; + int error; + int clk; - if (req->newptr == NULL) { - /* Return the name of the current active sysclock. */ - strlcpy(newclock, sysclocks[sysclock_active], sizeof(newclock)); - error = sysctl_handle_string(oidp, newclock, - sizeof(newclock), req); - } else { - /* Change the active sysclock to the user specified one. */ - error = EINVAL; - for (clk = 0; clk < NUM_SYSCLOCKS; clk++) { - if (strncmp((char *)req->newptr, sysclocks[clk], - strlen(sysclocks[clk])) == 0) { - sysclock_active = clk; - error = 0; - break; - } + /* Return the name of the current active sysclock. */ + strlcpy(newclock, sysclocks[sysclock_active], sizeof(newclock)); + error = sysctl_handle_string(oidp, newclock, sizeof(newclock), req); + + /* Check for error or no change */ + if (error != 0 || req->newptr == NULL) + goto done; + + /* Change the active sysclock to the user specified one: */ + error = EINVAL; + for (clk = 0; clk < NUM_SYSCLOCKS; clk++) { + if (strncmp(newclock, sysclocks[clk], + MAX_SYSCLOCK_NAME_LEN - 1)) { + continue; } + sysclock_active = clk; + error = 0; + break; } - +done: return (error); } Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Tue Oct 28 11:20:30 2014 (r273772) +++ head/sys/net/bpf.c Tue Oct 28 12:00:39 2014 (r273773) @@ -2807,7 +2807,8 @@ bpfstats_fill_xbpf(struct xbpf_d *d, str static int bpf_stats_sysctl(SYSCTL_HANDLER_ARGS) { - struct xbpf_d *xbdbuf, *xbd, zerostats; + static const struct xbpf_d zerostats; + struct xbpf_d *xbdbuf, *xbd, tempstats; int index, error; struct bpf_if *bp; struct bpf_d *bd; @@ -2827,11 +2828,13 @@ bpf_stats_sysctl(SYSCTL_HANDLER_ARGS) * as we aren't allowing the user to set the counters currently. */ if (req->newptr != NULL) { - if (req->newlen != sizeof(zerostats)) + if (req->newlen != sizeof(tempstats)) return (EINVAL); - bzero(&zerostats, sizeof(zerostats)); - xbd = req->newptr; - if (bcmp(xbd, &zerostats, sizeof(*xbd)) != 0) + memset(&tempstats, 0, sizeof(tempstats)); + error = SYSCTL_IN(req, &tempstats, sizeof(tempstats)); + if (error) + return (error); + if (bcmp(&tempstats, &zerostats, sizeof(tempstats)) != 0) return (EINVAL); bpf_zero_counters(); return (0); Modified: head/sys/netinet/cc/cc.c ============================================================================== --- head/sys/netinet/cc/cc.c Tue Oct 28 11:20:30 2014 (r273772) +++ head/sys/netinet/cc/cc.c Tue Oct 28 12:00:39 2014 (r273773) @@ -92,36 +92,33 @@ cc_default_algo(SYSCTL_HANDLER_ARGS) { char default_cc[TCP_CA_NAME_MAX]; struct cc_algo *funcs; - int err, found; + int error; - err = found = 0; + /* Get the current default: */ + CC_LIST_RLOCK(); + strlcpy(default_cc, CC_DEFAULT()->name, sizeof(default_cc)); + CC_LIST_RUNLOCK(); - if (req->newptr == NULL) { - /* Just print the current default. */ - CC_LIST_RLOCK(); - strlcpy(default_cc, CC_DEFAULT()->name, TCP_CA_NAME_MAX); - CC_LIST_RUNLOCK(); - err = sysctl_handle_string(oidp, default_cc, 0, req); - } else { - /* Find algo with specified name and set it to default. */ - CC_LIST_RLOCK(); - STAILQ_FOREACH(funcs, &cc_list, entries) { - /* NOTE: "newptr" is not zero terminated */ - if (req->newlen != strnlen(funcs->name, - TCP_CA_NAME_MAX - 1)) - continue; - if (bcmp(req->newptr, funcs->name, req->newlen)) - continue; - found = 1; - V_default_cc_ptr = funcs; - } - CC_LIST_RUNLOCK(); + error = sysctl_handle_string(oidp, default_cc, sizeof(default_cc), req); - if (!found) - err = ESRCH; - } + /* Check for error or no change */ + if (error != 0 || req->newptr == NULL) + goto done; - return (err); + error = ESRCH; + + /* Find algo with specified name and set it to default. */ + CC_LIST_RLOCK(); + STAILQ_FOREACH(funcs, &cc_list, entries) { + if (strncmp(default_cc, funcs->name, sizeof(default_cc))) + continue; + V_default_cc_ptr = funcs; + error = 0; + break; + } + CC_LIST_RUNLOCK(); +done: + return (error); } /* Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Tue Oct 28 11:20:30 2014 (r273772) +++ head/sys/netinet/sctp_sysctl.c Tue Oct 28 12:00:39 2014 (r273773) @@ -636,17 +636,26 @@ sctp_sysctl_handle_stats(SYSCTL_HANDLER_ int error; #if defined(SMP) && defined(SCTP_USE_PERCPU_STAT) + struct sctpstat sb_temp; + struct sctpstat *sarry; + struct sctpstat sb; int cpu; - struct sctpstat sb, *sarry; - #endif if ((req->newptr != NULL) && (req->newlen != sizeof(struct sctpstat))) { return (EINVAL); } + #if defined(SMP) && defined(SCTP_USE_PERCPU_STAT) - memset(&sb, 0, sizeof(struct sctpstat)); + memset(&sb, 0, sizeof(sb)); + memset(&sb_temp, 0, sizeof(sb_temp)); + + if (req->newptr != NULL) { + error = SYSCTL_IN(req, &sb_temp, sizeof(sb_temp)); + if (error != 0) + return (error); + } for (cpu = 0; cpu < mp_maxid; cpu++) { sarry = &SCTP_BASE_STATS[cpu]; if (sarry->sctps_discontinuitytime.tv_sec > sb.sctps_discontinuitytime.tv_sec) { @@ -774,12 +783,14 @@ sctp_sysctl_handle_stats(SYSCTL_HANDLER_ sb.sctps_send_burst_avoid += sarry->sctps_send_burst_avoid; sb.sctps_send_cwnd_avoid += sarry->sctps_send_cwnd_avoid; sb.sctps_fwdtsn_map_over += sarry->sctps_fwdtsn_map_over; - if (req->newptr != NULL) { - memcpy(sarry, req->newptr, sizeof(struct sctpstat)); - } + if (req->newptr != NULL) + memcpy(sarry, &sb_temp, sizeof(struct sctpstat)); } error = SYSCTL_OUT(req, &sb, sizeof(struct sctpstat)); #else + error = SYSCTL_IN(req, &SCTP_BASE_STATS, sizeof(struct sctpstat)); + if (error) + return (error); error = SYSCTL_OUT(req, &SCTP_BASE_STATS, sizeof(struct sctpstat)); #endif return (error); Modified: head/sys/netinet/siftr.c ============================================================================== --- head/sys/netinet/siftr.c Tue Oct 28 11:20:30 2014 (r273772) +++ head/sys/netinet/siftr.c Tue Oct 28 12:00:39 2014 (r273773) @@ -268,6 +268,7 @@ static unsigned int siftr_pkts_per_log = static unsigned int siftr_generate_hashes = 0; /* static unsigned int siftr_binary_log = 0; */ static char siftr_logfile[PATH_MAX] = "/var/log/siftr.log"; +static char siftr_logfile_shadow[PATH_MAX] = "/var/log/siftr.log"; static u_long siftr_hashmask; STAILQ_HEAD(pkthead, pkt_node) pkt_queue = STAILQ_HEAD_INITIALIZER(pkt_queue); LIST_HEAD(listhead, flow_hash_node) *counter_hash; @@ -299,7 +300,7 @@ SYSCTL_PROC(_net_inet_siftr, OID_AUTO, e "switch siftr module operations on/off"); SYSCTL_PROC(_net_inet_siftr, OID_AUTO, logfile, CTLTYPE_STRING|CTLFLAG_RW, - &siftr_logfile, sizeof(siftr_logfile), &siftr_sysctl_logfile_name_handler, + &siftr_logfile_shadow, sizeof(siftr_logfile_shadow), &siftr_sysctl_logfile_name_handler, "A", "file to save siftr log messages to"); SYSCTL_UINT(_net_inet_siftr, OID_AUTO, ppl, CTLFLAG_RW, @@ -1145,38 +1146,38 @@ siftr_sysctl_logfile_name_handler(SYSCTL struct alq *new_alq; int error; - if (req->newptr == NULL) - goto skip; - - /* If old filename and new filename are different. */ - if (strncmp(siftr_logfile, (char *)req->newptr, PATH_MAX)) { - - error = alq_open(&new_alq, req->newptr, curthread->td_ucred, - SIFTR_LOG_FILE_MODE, SIFTR_ALQ_BUFLEN, 0); + error = sysctl_handle_string(oidp, arg1, arg2, req); - /* Bail if unable to create new alq. */ - if (error) - return (1); + /* Check for error or same filename */ + if (error != 0 || req->newptr == NULL || + strncmp(siftr_logfile, arg1, arg2) == 0) + goto done; + + /* Filname changed */ + error = alq_open(&new_alq, arg1, curthread->td_ucred, + SIFTR_LOG_FILE_MODE, SIFTR_ALQ_BUFLEN, 0); + if (error != 0) + goto done; - /* - * If disabled, siftr_alq == NULL so we simply close - * the alq as we've proved it can be opened. - * If enabled, close the existing alq and switch the old - * for the new. - */ - if (siftr_alq == NULL) - alq_close(new_alq); - else { - alq_close(siftr_alq); - siftr_alq = new_alq; - } + /* + * If disabled, siftr_alq == NULL so we simply close + * the alq as we've proved it can be opened. + * If enabled, close the existing alq and switch the old + * for the new. + */ + if (siftr_alq == NULL) { + alq_close(new_alq); + } else { + alq_close(siftr_alq); + siftr_alq = new_alq; } -skip: - return (sysctl_handle_string(oidp, arg1, arg2, req)); + /* Update filename upon success */ + strlcpy(siftr_logfile, arg1, arg2); +done: + return (error); } - static int siftr_manage_ops(uint8_t action) { From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 12:46:53 2014 Return-Path: Delivered-To: svn-src-all@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 246C5D1A; Tue, 28 Oct 2014 12:46:53 +0000 (UTC) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id DD0C461C; Tue, 28 Oct 2014 12:46:52 +0000 (UTC) Received: from lgwl-lstewart2.corp.netflix.com (c110-22-7-57.eburwd3.vic.optusnet.com.au [110.22.7.57]) by lauren.room52.net (Postfix) with ESMTPSA id 708067E820; Tue, 28 Oct 2014 23:46:36 +1100 (EST) Message-ID: <544F901A.4000600@freebsd.org> Date: Tue, 28 Oct 2014 23:46:18 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Hiroki Sato , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r272386 - in head: sbin/ifconfig share/man/man4 sys/net References: <201410012137.s91LbXL4025967@svn.freebsd.org> <544DB140.7070807@freebsd.org> In-Reply-To: <544DB140.7070807@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 12:46:53 -0000 On 10/27/14 13:43, Lawrence Stewart wrote: > Hi Hiroki-san, > > On 10/02/14 07:37, Hiroki Sato wrote: >> Author: hrs >> Date: Wed Oct 1 21:37:32 2014 >> New Revision: 272386 >> URL: https://svnweb.freebsd.org/changeset/base/272386 >> >> Log: >> Virtualize lagg(4) cloner. This change fixes a panic when tearing down >> if_lagg(4) interfaces which were cloned in a vnet jail. >> >> Sysctl nodes which are dynamically generated for each cloned interface >> (net.link.lagg.N.*) have been removed, and use_flowid and flowid_shift >> ifconfig(8) parameters have been added instead. Flags and per-interface >> statistics counters are displayed in "ifconfig -v". >> >> CR: D842 >> >> Modified: >> head/sbin/ifconfig/ifconfig.8 >> head/sbin/ifconfig/iflagg.c >> head/share/man/man4/lagg.4 >> head/sys/net/ieee8023ad_lacp.c >> head/sys/net/if_lagg.c >> head/sys/net/if_lagg.h > > What was the reasoning for removing the net.link.lagg.* sysctls? We use > them at Netflix and the new way of obtaining the information via > ifconfig -v is less structured and significantly higher overhead by > comparison. Would be good to have the sysctls back or an equivalent low > overhead way of obtaining the previously available information. So it turns out I was missing some important context on this matter. We don't in fact want or need the sysctls back and have a sane way to access the information via means other than parsing ifconfig output. In short, apologies for the noise and move along, there's nothing to see here :) Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 13:38:13 2014 Return-Path: Delivered-To: svn-src-all@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 2A3A1B6B; Tue, 28 Oct 2014 13:38: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 0AB21C64; Tue, 28 Oct 2014 13:38: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 s9SDcClU058657; Tue, 28 Oct 2014 13:38:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SDcBXk058646; Tue, 28 Oct 2014 13:38:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410281338.s9SDcBXk058646@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 28 Oct 2014 13:38:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273774 - in head/contrib/ofed: librdmacm/examples librdmacm/examples/build librdmacm/examples/build/cmatose librdmacm/examples/build/mckey librdmacm/examples/build/rping librdmacm/exam... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 13:38:13 -0000 Author: hselasky Date: Tue Oct 28 13:38:10 2014 New Revision: 273774 URL: https://svnweb.freebsd.org/changeset/base/273774 Log: Make some infiniband example utilities easily buildable: - Add new Makefiles. - Add more include directories when building. - Fixed a printf() formatting string. MFC after: 3 days Sponsored by: Mellanox Technologies Added: head/contrib/ofed/librdmacm/examples/build/ head/contrib/ofed/librdmacm/examples/build/Makefile (contents, props changed) head/contrib/ofed/librdmacm/examples/build/Makefile.inc (contents, props changed) head/contrib/ofed/librdmacm/examples/build/cmatose/ head/contrib/ofed/librdmacm/examples/build/cmatose/Makefile (contents, props changed) head/contrib/ofed/librdmacm/examples/build/mckey/ head/contrib/ofed/librdmacm/examples/build/mckey/Makefile (contents, props changed) head/contrib/ofed/librdmacm/examples/build/rping/ head/contrib/ofed/librdmacm/examples/build/rping/Makefile (contents, props changed) head/contrib/ofed/librdmacm/examples/build/udaddy/ head/contrib/ofed/librdmacm/examples/build/udaddy/Makefile (contents, props changed) Modified: head/contrib/ofed/librdmacm/examples/rping.c head/contrib/ofed/usr.lib/Makefile.inc Added: head/contrib/ofed/librdmacm/examples/build/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/ofed/librdmacm/examples/build/Makefile Tue Oct 28 13:38:10 2014 (r273774) @@ -0,0 +1,3 @@ +SUBDIR= cmatose mckey rping udaddy + +.include Added: head/contrib/ofed/librdmacm/examples/build/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/ofed/librdmacm/examples/build/Makefile.inc Tue Oct 28 13:38:10 2014 (r273774) @@ -0,0 +1,9 @@ +IBDIR=../../../.. + +CFLAGS+= \ + -I${IBDIR}/include/infiniband \ + -I${IBDIR}/include \ + -I${IBDIR}/librdmacm/include \ + -I${IBDIR}/libibv/include \ + -I${IBDIR}/libibverbs/include + Added: head/contrib/ofed/librdmacm/examples/build/cmatose/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/ofed/librdmacm/examples/build/cmatose/Makefile Tue Oct 28 13:38:10 2014 (r273774) @@ -0,0 +1,10 @@ +# +# $FreeBSD$ +# +.PATH: ${.CURDIR}/../.. +PROG= cmatose +MAN= +SRCS= cmatose.c +LDADD+= -libverbs -lrdmacm -lpthread + +.include Added: head/contrib/ofed/librdmacm/examples/build/mckey/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/ofed/librdmacm/examples/build/mckey/Makefile Tue Oct 28 13:38:10 2014 (r273774) @@ -0,0 +1,10 @@ +# +# $FreeBSD$ +# +.PATH: ${.CURDIR}/../.. +PROG= mckey +MAN= +SRCS= mckey.c +LDADD+= -libverbs -lrdmacm -lpthread + +.include Added: head/contrib/ofed/librdmacm/examples/build/rping/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/ofed/librdmacm/examples/build/rping/Makefile Tue Oct 28 13:38:10 2014 (r273774) @@ -0,0 +1,10 @@ +# +# $FreeBSD$ +# +.PATH: ${.CURDIR}/../.. +PROG= rping +MAN= +SRCS= rping.c +LDADD+= -libverbs -lrdmacm -lpthread + +.include Added: head/contrib/ofed/librdmacm/examples/build/udaddy/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/ofed/librdmacm/examples/build/udaddy/Makefile Tue Oct 28 13:38:10 2014 (r273774) @@ -0,0 +1,10 @@ +# +# $FreeBSD$ +# +.PATH: ${.CURDIR}/../.. +PROG= udaddy +MAN= +SRCS= udaddy.c +LDADD+= -libverbs -lrdmacm -lpthread + +.include Modified: head/contrib/ofed/librdmacm/examples/rping.c ============================================================================== --- head/contrib/ofed/librdmacm/examples/rping.c Tue Oct 28 12:00:39 2014 (r273773) +++ head/contrib/ofed/librdmacm/examples/rping.c Tue Oct 28 13:38:10 2014 (r273774) @@ -1148,8 +1148,9 @@ int main(int argc, char *argv[]) if ((cb->size < RPING_MIN_BUFSIZE) || (cb->size > (RPING_BUFSIZE - 1))) { fprintf(stderr, "Invalid size %d " - "(valid range is %Zd to %d)\n", - cb->size, RPING_MIN_BUFSIZE, RPING_BUFSIZE); + "(valid range is %d to %d)\n", + (int)cb->size, (int)(RPING_MIN_BUFSIZE), + (int)(RPING_BUFSIZE)); ret = EINVAL; } else DEBUG_LOG("size %d\n", (int) atoi(optarg)); Modified: head/contrib/ofed/usr.lib/Makefile.inc ============================================================================== --- head/contrib/ofed/usr.lib/Makefile.inc Tue Oct 28 12:00:39 2014 (r273773) +++ head/contrib/ofed/usr.lib/Makefile.inc Tue Oct 28 13:38:10 2014 (r273774) @@ -7,11 +7,18 @@ COMPLIBDIR= ${OPENSMDIR}/complib VENDORLIBDIR= ${OPENSMDIR}/libvendor IBVERBSDIR= ${.CURDIR}/../../libibverbs IBINC= ${.CURDIR}/../../include +RDMACMDIR= ${.CURDIR}/../../librdmacm + +CFLAGS+= -I${.CURDIR} \ + -I${IBINC}/infiniband \ + -I${IBINC} \ + -I${IBCOMMONDIR}/include/infiniband \ + -I${IBCOMMONDIR}/include \ + -I${IBMADDIR}/include/infiniband \ + -I${IBMADDIR}/include \ + -I${UMADDIR}/include/infiniband \ + -I${UMADDIR}/include \ + -I${OPENSMDIR}/include \ + -I${RDMACMDIR}/include \ + -I${IBVERBSDIR}/include -CFLAGS+= -I${.CURDIR} -I${IBINC}/infiniband -CFLAGS+= -I${IBCOMMONDIR}/include/infiniband -CFLAGS+= -I${IBMADDIR}/include/infiniband -CFLAGS+= -I${UMADDIR}/include/infiniband -CFLAGS+= -I${OPENSMDIR}/include -# CFLAGS+= -I${UMADDIR}/include -# CFLAGS+= -I${IBVERBSDIR}/include From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 14:01:59 2014 Return-Path: Delivered-To: svn-src-all@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 B8F361FB; Tue, 28 Oct 2014 14:01: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 A4900F38; Tue, 28 Oct 2014 14:01: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 s9SE1xux072123; Tue, 28 Oct 2014 14:01:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SE1xcx072121; Tue, 28 Oct 2014 14:01:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201410281401.s9SE1xcx072121@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 28 Oct 2014 14:01:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r273776 - in releng/10.1/sys: geom kern X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 14:01:59 -0000 Author: mav Date: Tue Oct 28 14:01:58 2014 New Revision: 273776 URL: https://svnweb.freebsd.org/changeset/base/273776 Log: MFS10 r273767 / MFC r273638: Revert somewhat hackish geom_disk optimization, committed as part of r256880, and the following r273143 commit, supposed to workaround introduced issue by quite innocent-looking change. While there is no clear understanding why, but r273143 is accused in data corruption in some environments with high I/O load. I personally don't see any problem in that commit, and possibly it is just a trigger to some other bug somewhere, but better safe then sorry for now. Requested by: scottl@ Approved by: re (kib@) Modified: releng/10.1/sys/geom/geom_disk.c releng/10.1/sys/kern/vfs_bio.c Directory Properties: releng/10.1/ (props changed) Modified: releng/10.1/sys/geom/geom_disk.c ============================================================================== --- releng/10.1/sys/geom/geom_disk.c Tue Oct 28 13:38:30 2014 (r273775) +++ releng/10.1/sys/geom/geom_disk.c Tue Oct 28 14:01:58 2014 (r273776) @@ -255,25 +255,6 @@ g_disk_done(struct bio *bp) g_destroy_bio(bp); } -static void -g_disk_done_single(struct bio *bp) -{ - struct bintime now; - struct g_disk_softc *sc; - - bp->bio_completed = bp->bio_length - bp->bio_resid; - bp->bio_done = (void *)bp->bio_to; - bp->bio_to = LIST_FIRST(&bp->bio_disk->d_geom->provider); - if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE|BIO_FLUSH)) != 0) { - binuptime(&now); - sc = bp->bio_to->private; - mtx_lock(&sc->done_mtx); - devstat_end_transaction_bio_bt(sc->dp->d_devstat, bp, &now); - mtx_unlock(&sc->done_mtx); - } - g_io_deliver(bp, bp->bio_error); -} - static int g_disk_ioctl(struct g_provider *pp, u_long cmd, void * data, int fflag, struct thread *td) { @@ -299,7 +280,7 @@ g_disk_start(struct bio *bp) struct disk *dp; struct g_disk_softc *sc; int error; - off_t d_maxsize, off; + off_t off; sc = bp->bio_to->private; if (sc == NULL || (dp = sc->dp) == NULL || dp->d_destroyed) { @@ -316,22 +297,6 @@ g_disk_start(struct bio *bp) /* fall-through */ case BIO_READ: case BIO_WRITE: - d_maxsize = (bp->bio_cmd == BIO_DELETE) ? - dp->d_delmaxsize : dp->d_maxsize; - if (bp->bio_length <= d_maxsize) { - bp->bio_disk = dp; - bp->bio_to = (void *)bp->bio_done; - bp->bio_done = g_disk_done_single; - bp->bio_pblkno = bp->bio_offset / dp->d_sectorsize; - bp->bio_bcount = bp->bio_length; - mtx_lock(&sc->start_mtx); - devstat_start_transaction_bio(dp->d_devstat, bp); - mtx_unlock(&sc->start_mtx); - g_disk_lock_giant(dp); - dp->d_strategy(bp); - g_disk_unlock_giant(dp); - break; - } off = 0; bp3 = NULL; bp2 = g_clone_bio(bp); @@ -340,6 +305,10 @@ g_disk_start(struct bio *bp) break; } do { + off_t d_maxsize; + + d_maxsize = (bp->bio_cmd == BIO_DELETE) ? + dp->d_delmaxsize : dp->d_maxsize; bp2->bio_offset += off; bp2->bio_length -= off; if ((bp->bio_flags & BIO_UNMAPPED) == 0) { @@ -447,14 +416,18 @@ g_disk_start(struct bio *bp) error = EOPNOTSUPP; break; } - bp->bio_disk = dp; - bp->bio_to = (void *)bp->bio_done; - bp->bio_done = g_disk_done_single; - mtx_lock(&sc->start_mtx); - devstat_start_transaction_bio(dp->d_devstat, bp); - mtx_unlock(&sc->start_mtx); + bp2 = g_clone_bio(bp); + if (bp2 == NULL) { + g_io_deliver(bp, ENOMEM); + return; + } + bp2->bio_done = g_disk_done; + bp2->bio_disk = dp; + mtx_lock(&sc->start_mtx); + devstat_start_transaction_bio(dp->d_devstat, bp2); + mtx_unlock(&sc->start_mtx); g_disk_lock_giant(dp); - dp->d_strategy(bp); + dp->d_strategy(bp2); g_disk_unlock_giant(dp); break; default: Modified: releng/10.1/sys/kern/vfs_bio.c ============================================================================== --- releng/10.1/sys/kern/vfs_bio.c Tue Oct 28 13:38:30 2014 (r273775) +++ releng/10.1/sys/kern/vfs_bio.c Tue Oct 28 14:01:58 2014 (r273776) @@ -3582,8 +3582,10 @@ biodone(struct bio *bp) bp->bio_flags |= BIO_DONE; wakeup(bp); mtx_unlock(mtxp); - } else + } else { + bp->bio_flags |= BIO_DONE; done(bp); + } } /* From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 14:11:55 2014 Return-Path: Delivered-To: svn-src-all@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 C1D237A0; Tue, 28 Oct 2014 14:11: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 ADD52EC; Tue, 28 Oct 2014 14:11: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 s9SEBtDv077415; Tue, 28 Oct 2014 14:11:55 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SEBtFT077414; Tue, 28 Oct 2014 14:11:55 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201410281411.s9SEBtFT077414@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Tue, 28 Oct 2014 14:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273778 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 14:11:55 -0000 Author: nwhitehorn Date: Tue Oct 28 14:11:54 2014 New Revision: 273778 URL: https://svnweb.freebsd.org/changeset/base/273778 Log: Remove spurious libelf dependency. Submitted by: pluknet Modified: head/usr.sbin/pkg/Makefile Modified: head/usr.sbin/pkg/Makefile ============================================================================== --- head/usr.sbin/pkg/Makefile Tue Oct 28 14:03:22 2014 (r273777) +++ head/usr.sbin/pkg/Makefile Tue Oct 28 14:11:54 2014 (r273778) @@ -6,7 +6,7 @@ MAN= pkg.7 CFLAGS+=-I${.CURDIR}/../../contrib/libucl/include .PATH: ${.CURDIR}/../../contrib/libucl/include -DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBUCL} ${LIBSBUF} ${LIBSSL} \ +DPADD= ${LIBARCHIVE} ${LIBFETCH} ${LIBUCL} ${LIBSBUF} ${LIBSSL} \ ${LIBCRYPTO} ${LIBM} LDADD= -larchive -lfetch ${LDUCL} -lsbuf -lssl -lcrypto -lm USEPRIVATELIB= ucl From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 14:14:31 2014 Return-Path: Delivered-To: svn-src-all@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 7AC17AC3; Tue, 28 Oct 2014 14:14:31 +0000 (UTC) Received: from f10.opsec.eu (f10.opsec.eu [IPv6:2001:14f8:200:4::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 3541C12E; Tue, 28 Oct 2014 14:14:31 +0000 (UTC) Received: from pi by f10.opsec.eu with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1Xj7XW-000B8E-4P; Tue, 28 Oct 2014 15:14:26 +0100 Date: Tue, 28 Oct 2014 15:14:26 +0100 From: Kurt Jaeger To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Subject: Re: svn commit: r273734 - head/bin/dd Message-ID: <20141028141426.GA42752@f10.opsec.eu> References: <201410271138.s9RBcHrA002447@svn.freebsd.org> <20141027153957.GZ1877@kib.kiev.ua> <20141027155427.GM1492@f10.opsec.eu> <86vbn4egjt.fsf@nine.des.no> <86r3xseepw.fsf@nine.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <86r3xseepw.fsf@nine.des.no> Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Kurt Jaeger X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 14:14:31 -0000 Hi! > Dag-Erling Smørgrav writes: > > Kurt Jaeger writes: > > > I do not have a working arm setup right now. > > This is a bug on all platforms, and both clang and (recent) gcc should > > complain about it. That printf() call will print garbage. > > Correction: it will print garbage on 32-bit platforms, where sizeof(int) > != sizeof(intmax_t), but clang and gcc should still emit a warning. Yes. I'm old enough to remember the mess in C when going from 16bit to 32bit that I should have paid attention to the test case on 32bit, but my stupidity won 8-( Right now the submitter tests on 32bit and if time permits, I'll experiment on ARM as well. Sorry again for the mess. -- pi@FreeBSD.org +49 171 3101372 6 years to go ! From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 14:19:19 2014 Return-Path: Delivered-To: svn-src-all@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 DF757C76; Tue, 28 Oct 2014 14:19: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 C20E916F; Tue, 28 Oct 2014 14:19: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 s9SEJIKB078381; Tue, 28 Oct 2014 14:19:18 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SEJIZD078379; Tue, 28 Oct 2014 14:19:18 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201410281419.s9SEJIZD078379@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 28 Oct 2014 14:19:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273779 - in head/usr.sbin/pw: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 14:19:19 -0000 Author: bapt Date: Tue Oct 28 14:19:17 2014 New Revision: 273779 URL: https://svnweb.freebsd.org/changeset/base/273779 Log: Fix a regression in pw usermod -G list The user was perperly adding the to different groups from "list" but was not removed from the other groups it could have belong to. While here add a regression test about this bug PR: 185666 Reported by: sub.mesa@gmail.com MFC after: 1 week Modified: head/usr.sbin/pw/pw_user.c head/usr.sbin/pw/tests/pw_modify.sh Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Tue Oct 28 14:11:54 2014 (r273778) +++ head/usr.sbin/pw/pw_user.c Tue Oct 28 14:19:17 2014 (r273779) @@ -751,7 +751,25 @@ pw_user(struct userconf * cnf, int mode, */ if (mode == M_ADD || getarg(args, 'G') != NULL) { - int i; + int i, j; + /* First remove the user from all group */ + SETGRENT(); + while ((grp = GETGRENT()) != NULL) { + char group[MAXLOGNAME]; + if (grp->gr_mem == NULL) + continue; + for (i = 0; grp->gr_mem[i] != NULL; i++) { + if (strcmp(grp->gr_mem[i] , pwd->pw_name) != 0) + continue; + for (j = i; grp->gr_mem[j] != NULL ; j++) + grp->gr_mem[j] = grp->gr_mem[j+1]; + strlcpy(group, grp->gr_name, MAXLOGNAME); + chggrent(group, grp); + } + } + ENDGRENT(); + + /* now add to group where needed */ for (i = 0; cnf->groups[i] != NULL; i++) { grp = GETGRNAM(cnf->groups[i]); grp = gr_add(grp, pwd->pw_name); Modified: head/usr.sbin/pw/tests/pw_modify.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_modify.sh Tue Oct 28 14:11:54 2014 (r273778) +++ head/usr.sbin/pw/tests/pw_modify.sh Tue Oct 28 14:19:17 2014 (r273779) @@ -38,8 +38,29 @@ groupmod_bug_193704_body() { atf_check -s exit:65 -e match:"^pw: unknown group" -x pw -V ${HOME} groupshow test } +atf_test_case usermod_bug_185666 +usermod_bug_185666_head() { + atf_set "descr" "Regression test for the #185666 bug" +} + +usermod_bug_185666_body() { + populate_etc_skel + atf_check -s exit:0 -x pw -V ${HOME} useradd testuser + atf_check -s exit:0 -x pw -V ${HOME} groupadd testgroup + atf_check -s exit:0 -x pw -V ${HOME} groupadd testgroup2 + atf_check -s exit:0 -x pw -V ${HOME} usermod testuser -G testgroup + atf_check -o inline:"testuser:*:1001:\n" -x pw -V${HOME} groupshow testuser + atf_check -o inline:"testgroup:*:1002:testuser\n" -x pw -V ${HOME} groupshow testgroup + atf_check -o inline:"testgroup2:*:1003:\n" -x pw -V${HOME} groupshow testgroup2 + atf_check -s exit:0 -x pw -V ${HOME} usermod testuser -G testgroup2 + atf_check -o inline:"testuser:*:1001:\n" -x pw -V ${HOME} groupshow testuser + atf_check -o inline:"testgroup:*:1002:\n" -x pw -V ${HOME} groupshow testgroup + atf_check -o inline:"testgroup2:*:1003:testuser\n" -x pw -V ${HOME} groupshow testgroup2 +} + atf_init_test_cases() { atf_add_test_case groupmod_user atf_add_test_case groupmod_invalid_user atf_add_test_case groupmod_bug_193704 + atf_add_test_case usermod_bug_185666 } From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 14:34:28 2014 Return-Path: Delivered-To: svn-src-all@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 B9A7037C; Tue, 28 Oct 2014 14:34:28 +0000 (UTC) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) by mx1.freebsd.org (Postfix) with ESMTP id 6691E385; Tue, 28 Oct 2014 14:34:28 +0000 (UTC) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 1DEBA5A9F25; Tue, 28 Oct 2014 14:34:28 +0000 (UTC) Date: Tue, 28 Oct 2014 14:34:28 +0000 From: Brooks Davis To: Baptiste Daroussin Subject: Re: svn commit: r273755 - head Message-ID: <20141028143428.GC12109@spindle.one-eyed-alien.net> References: <201410272331.s9RNV8pJ058121@svn.freebsd.org> <20141028065043.GC26796@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZmUaFz6apKcXQszQ" Content-Disposition: inline In-Reply-To: <20141028065043.GC26796@ivaldir.etoilebsd.net> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , NGie Cooper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 14:34:28 -0000 --ZmUaFz6apKcXQszQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 28, 2014 at 07:50:44AM +0100, Baptiste Daroussin wrote: > On Mon, Oct 27, 2014 at 05:26:42PM -0700, NGie Cooper wrote: > > On Mon, Oct 27, 2014 at 4:31 PM, Baptiste Daroussin = wrote: > > > Author: bapt > > > Date: Mon Oct 27 23:31:07 2014 > > > New Revision: 273755 > > > URL: https://svnweb.freebsd.org/changeset/base/273755 > > > > > > Log: > > > Rename XFLAGS to XCFLAGS and XXFLAGS to XCXXFLAGS > > > > > > This is less confusing names and actually more reflexting what they= are intended > > > to. > > > > > > Discussed with: brooks > >=20 > > Add an UPDATING entry? >=20 > Well XCFLAGS and XCXXFLAGS are inernal only and concerning a feature (ext= ernal > toolchain) which is still WIP so it is worth adding an UPDATING entry? Probably not. It isn't documented on the wiki page and I've never needed to use it when using the other X* variables in several different scenerios. -- Brooks --ZmUaFz6apKcXQszQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlRPqXMACgkQXY6L6fI4GtRJrQCfXIJCDQMkyfMKl3Ih5QfzQTY7 wQoAn2+mcnid0Eeb+bp9tbOW7itnQp0o =/lGs -----END PGP SIGNATURE----- --ZmUaFz6apKcXQszQ-- From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 14:48:54 2014 Return-Path: Delivered-To: svn-src-all@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 0CE577C1; Tue, 28 Oct 2014 14:48: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 ECEF56BB; Tue, 28 Oct 2014 14:48: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 s9SEmrbM092436; Tue, 28 Oct 2014 14:48:53 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SEmrrW092434; Tue, 28 Oct 2014 14:48:53 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201410281448.s9SEmrrW092434@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 28 Oct 2014 14:48:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273780 - in head: . etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 14:48:54 -0000 Author: emaste Date: Tue Oct 28 14:48:52 2014 New Revision: 273780 URL: https://svnweb.freebsd.org/changeset/base/273780 Log: Add missing /usr/lib/debug directories Directories for /usr/lib{,32}/{i18n,private} were missing from the mtree file, which caused installworld to install the files that should be in the directory as the name of the directory. Modified: head/ObsoleteFiles.inc head/etc/mtree/BSD.debug.dist Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Oct 28 14:19:17 2014 (r273779) +++ head/ObsoleteFiles.inc Tue Oct 28 14:48:52 2014 (r273780) @@ -38,6 +38,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20141028: debug files accidentally installed as directory name +OLD_FILES+=usr/lib/debug/usr/lib/i18n +OLD_FILES+=usr/lib/debug/usr/lib/private +OLD_FILES+=usr/lib/debug/usr/lib32/i18n +OLD_FILES+=usr/lib/debug/usr/lib32/private # 20141015: OpenSSL 1.0.1j import OLD_FILES+=usr/share/openssl/man/man3/CMS_sign_add1_signer.3.gz # 20140922: sleepq_calc_signal_retval.9 and sleepq_catch_signals.9 removed Modified: head/etc/mtree/BSD.debug.dist ============================================================================== --- head/etc/mtree/BSD.debug.dist Tue Oct 28 14:19:17 2014 (r273779) +++ head/etc/mtree/BSD.debug.dist Tue Oct 28 14:48:52 2014 (r273780) @@ -26,8 +26,16 @@ lib engines .. + i18n + .. + private + .. .. lib32 + i18n + .. + private + .. .. libexec bsdinstall From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 14:54:06 2014 Return-Path: Delivered-To: svn-src-all@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 2D73DAA6; Tue, 28 Oct 2014 14:54: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 F3D347F2; Tue, 28 Oct 2014 14:54: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 s9SEs5Id098827; Tue, 28 Oct 2014 14:54:05 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SEs5kb098825; Tue, 28 Oct 2014 14:54:05 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201410281454.s9SEs5kb098825@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 28 Oct 2014 14:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273782 - in head/usr.sbin/pw: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 14:54:06 -0000 Author: bapt Date: Tue Oct 28 14:54:04 2014 New Revision: 273782 URL: https://svnweb.freebsd.org/changeset/base/273782 Log: Do not delete the group wheel when bad argument is passed to pw groupdel -g Check that the -g argument is actually a number, if not report an error. This argument is converted without checking with atoi(3) later so without this check it converts any alpha entries into 0 meaning it deletes the group wheel Add a regression test about it PR: 90114 Reported by: bkoenig@cs.tu-berlin.de MFC after: 1 week Modified: head/usr.sbin/pw/pw_group.c head/usr.sbin/pw/tests/pw_delete.sh Modified: head/usr.sbin/pw/pw_group.c ============================================================================== --- head/usr.sbin/pw/pw_group.c Tue Oct 28 14:49:10 2014 (r273781) +++ head/usr.sbin/pw/pw_group.c Tue Oct 28 14:54:04 2014 (r273782) @@ -67,6 +67,11 @@ pw_group(struct userconf * cnf, int mode NULL }; + if (a_gid != NULL) { + if (strspn(a_gid->val, "0123456789") != strlen(a_gid->val)) + errx(EX_USAGE, "-g expects a number"); + } + if (mode == M_LOCK || mode == M_UNLOCK) errx(EX_USAGE, "'lock' command is not available for groups"); Modified: head/usr.sbin/pw/tests/pw_delete.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_delete.sh Tue Oct 28 14:49:10 2014 (r273781) +++ head/usr.sbin/pw/tests/pw_delete.sh Tue Oct 28 14:54:04 2014 (r273782) @@ -18,7 +18,19 @@ rmuser_seperate_group_body() { pw -V ${HOME} userdel test || atf_fail "delete the user" } +atf_test_case group_do_not_delete_wheel_if_group_unkown +group_do_not_delete_wheel_if_group_unkown_head() { + atf_set "descr" "Make sure we do not consider as gid 0 an unknown group" +} + +group_do_not_delete_wheel_if_group_unkown_body() { + populate_etc_skel + atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x pw -V ${HOME} groupshow wheel + atf_check -e inline:"pw: -g expects a number\n" -s exit:64 -x pw -V ${HOME} groupdel -g I_do_not_exist + atf_check -s exit:0 -o "wheel:*:0:root\n" -x pw -V ${HOME} groupshow wheel +} atf_init_test_cases() { atf_add_test_case rmuser_seperate_group + atf_add_test_case group_do_not_delete_wheel_if_group_unkown } From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 15:22:17 2014 Return-Path: Delivered-To: svn-src-all@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 0A0BFFF1; Tue, 28 Oct 2014 15:22: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 E6A2EAE8; Tue, 28 Oct 2014 15:22: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 s9SFMGH6012986; Tue, 28 Oct 2014 15:22:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SFMEBP012969; Tue, 28 Oct 2014 15:22:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201410281522.s9SFMEBP012969@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 28 Oct 2014 15:22:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273783 - in head: share/man/man9 sys/amd64/amd64 sys/arm/include sys/i386/i386 sys/kern sys/mips/include sys/powerpc/powerpc sys/sparc64/include 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 15:22:17 -0000 Author: kib Date: Tue Oct 28 15:22:13 2014 New Revision: 273783 URL: https://svnweb.freebsd.org/changeset/base/273783 Log: Add fueword(9) and casueword(9) functions. They are like fuword(9) and casuword(9), but do not mix value read and indication of fault. I know (or remember) enough assembly to handle x86 and powerpc. For arm, mips and sparc64, implement fueword() and casueword() as wrappers around fuword() and casuword(), which means that the functions cannot distinguish between -1 and fault. On architectures where fueword() and casueword() are native, implement fuword() and casuword() using fueword() and casuword(), to reduce assembly code duplication. Sponsored by: The FreeBSD Foundation Tested by: pho MFC after: 2 weeks (ia64 needs treating) Added: head/share/man/man9/casuword.9 (contents, props changed) Modified: head/share/man/man9/Makefile head/share/man/man9/fetch.9 head/sys/amd64/amd64/support.S head/sys/arm/include/param.h head/sys/i386/i386/support.s head/sys/kern/subr_uio.c head/sys/mips/include/param.h head/sys/powerpc/powerpc/copyinout.c head/sys/sparc64/include/param.h head/sys/sys/systm.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Oct 28 14:54:04 2014 (r273782) +++ head/share/man/man9/Makefile Tue Oct 28 15:22:13 2014 (r273783) @@ -581,6 +581,9 @@ MLINKS+=condvar.9 cv_broadcast.9 \ MLINKS+=config_intrhook.9 config_intrhook_disestablish.9 \ config_intrhook.9 config_intrhook_establish.9 MLINKS+=contigmalloc.9 contigfree.9 +MLINKS+=casuword.9 casueword.9 \ + casuword.9 casueword32.9 \ + casuword.9 casuword32.9 MLINKS+=copy.9 copyin.9 \ copy.9 copyin_nofault.9 \ copy.9 copyinstr.9 \ @@ -688,7 +691,10 @@ MLINKS+=fetch.9 fubyte.9 \ fetch.9 fuword.9 \ fetch.9 fuword16.9 \ fetch.9 fuword32.9 \ - fetch.9 fuword64.9 + fetch.9 fuword64.9 \ + fetch.9 fueword.9 \ + fetch.9 fueword32.9 \ + fetch.9 fueword64.9 MLINKS+=firmware.9 firmware_get.9 \ firmware.9 firmware_put.9 \ firmware.9 firmware_register.9 \ Added: head/share/man/man9/casuword.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/casuword.9 Tue Oct 28 15:22:13 2014 (r273783) @@ -0,0 +1,95 @@ +.\" Copyright (c) 2014 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" Part of this documentation was written by +.\" Konstantin Belousov under sponsorship +.\" from the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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 October 21, 2014 +.Dt CASU 9 +.Os +.Sh NAME +.Nm casueword , +.Nm casueword32 , +.Nm casuword , +.Nm casuword32 +.Nd fetch, compare and store data from user-space +.Sh SYNOPSIS +.In sys/types.h +.In sys/systm.h +.Ft int +.Fn casueword "volatile u_long *base" "u_long oldval" "u_long *oldvalp" "u_long newval" +.Ft int +.Fn casueword32 "volatile uint32_t *base" "uint32_t oldval" "uint32_t *oldvalp" "uint32_t newval" +.Ft u_long +.Fn casuword "volatile u_long *base" "u_long oldval" "u_long newval" +.Ft uint32_t +.Fn casuword32 "volatile uint32_t *base" "uint32_t oldval" "uint32_t newval" +.Sh DESCRIPTION +The +.Nm +functions are designed to perform atomic compare-and-swap operation on +the value in the usermode memory of the current process. +.Pp +The +.Nm +routines reads the value from user memory with address +.Pa base , +and compare the value read with +.Pa oldval . +If the values are equal, +.Pa newval +is written to the +.Pa *base . +In case of +.Fn casueword32 +and +.Fn casueword , +old value is stored into the (kernel-mode) variable pointed by +.Pa *oldvalp . +The userspace value must be naturally aligned. +.Pp +The callers of +.Fn casuword +and +.Fn casuword32 +functions cannot distinguish between -1 read from +userspace and function failure. +.Sh RETURN VALUES +The +.Fn casuword +and +.Fn casuword32 +functions return the data fetched or -1 on failure. +The +.Fn casueword +and +.Fn casueword32 +functions return 0 on success and -1 on failure. +.Sh SEE ALSO +.Xr atomic 9 , +.Xr fetch 9 , +.Xr store 9 Modified: head/share/man/man9/fetch.9 ============================================================================== --- head/share/man/man9/fetch.9 Tue Oct 28 14:54:04 2014 (r273782) +++ head/share/man/man9/fetch.9 Tue Oct 28 15:22:13 2014 (r273783) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2009 +.Dd October 21, 2014 .Dt FETCH 9 .Os .Sh NAME @@ -44,11 +44,13 @@ .Nm fuword , .Nm fuword16 , .Nm fuword32 , -.Nm fuword64 +.Nm fuword64 , +.Nm fueword , +.Nm fueword32 , +.Nm fueword64 .Nd fetch data from user-space .Sh SYNOPSIS .In sys/types.h -.In sys/time.h .In sys/systm.h .Ft int .Fn fubyte "const void *base" @@ -60,27 +62,38 @@ .Fn fuword32 "const void *base" .Ft int64_t .Fn fuword64 "const void *base" +.Ft long +.Fn fueword "const void *base" "long *val" +.Ft int32_t +.Fn fueword32 "const void *base" "int32_t *val" +.Ft int64_t +.Fn fueword64 "const void *base" "int64_t *val" .In sys/resourcevar.h .Ft int .Fn fuswintr "void *base" .Sh DESCRIPTION The .Nm -functions are designed to copy small amounts of data from user-space. +functions are designed to copy small amounts of data from user-space +of the current process. +If read is successful, it is performed atomically. +The data read must be naturally aligned. .Pp The .Nm routines provide the following functionality: -.Bl -tag -width "fuswintr()" +.Bl -tag -width "fueword32()" .It Fn fubyte Fetches a byte of data from the user-space address .Pa base . +The byte read is zero-extended into the results variable. .It Fn fuword -Fetches a word of data from the user-space address +Fetches a word of data (long) from the user-space address .Pa base . .It Fn fuword16 Fetches 16 bits of data from the user-space address .Pa base . +The half-word read is zero-extended into the results variable. .It Fn fuword32 Fetches 32 bits of data from the user-space address .Pa base . @@ -91,11 +104,46 @@ Fetches 64 bits of data from the user-sp Fetches a short word of data from the user-space address .Pa base . This function is safe to call during an interrupt context. +.It Fn fueword +Fetches a word of data (long) from the user-space address +.Pa base +and stores the result in the variable pointed by +.Pa val . +.It Fn fueword32 +Fetches 32 bits of data from the user-space address +.Pa base +and stores the result in the variable pointed by +.Pa val . +.It Fn fueword64 +Fetches 64 bits of data from the user-space address +.Pa base +and stores the result in the variable pointed by +.Pa val . .El +.Pp +The callers of +.Fn fuword , +.Fn fuword32 +and +.Fn fuword64 +functions cannot distinguish between -1 read from +userspace and function failure. .Sh RETURN VALUES The -.Nm +.Fn fubyte , +.Fn fuword , +.Fn fuword16 , +.Fn fuword32 , +.Fn fuword64 , +and +.Fn fuswintr functions return the data fetched or -1 on failure. +The +.Fn fueword , +.Fn fueword32 +and +.Fn fueword64 +functions return 0 on success and -1 on failure. .Sh SEE ALSO .Xr copy 9 , .Xr store 9 Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Tue Oct 28 14:54:04 2014 (r273782) +++ head/sys/amd64/amd64/support.S Tue Oct 28 15:22:13 2014 (r273783) @@ -312,12 +312,13 @@ copyin_fault: END(copyin) /* - * casuword32. Compare and set user integer. Returns -1 or the current value. - * dst = %rdi, old = %rsi, new = %rdx + * casueword32. Compare and set user integer. Returns -1 on fault, + * 0 if access was successful. Old value is written to *oldp. + * dst = %rdi, old = %esi, oldp = %rdx, new = %ecx */ -ENTRY(casuword32) - movq PCPU(CURPCB),%rcx - movq $fusufault,PCB_ONFAULT(%rcx) +ENTRY(casueword32) + movq PCPU(CURPCB),%r8 + movq $fusufault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax cmpq %rax,%rdi /* verify address is valid */ @@ -327,26 +328,34 @@ ENTRY(casuword32) #ifdef SMP lock #endif - cmpxchgl %edx,(%rdi) /* new = %edx */ + cmpxchgl %ecx,(%rdi) /* new = %ecx */ /* * The old value is in %eax. If the store succeeded it will be the * value we expected (old) from before the store, otherwise it will - * be the current value. + * be the current value. Save %eax into %esi to prepare the return + * value. */ + movl %eax,%esi + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) - movq PCPU(CURPCB),%rcx - movq $0,PCB_ONFAULT(%rcx) + /* + * Access the oldp after the pcb_onfault is cleared, to correctly + * catch corrupted pointer. + */ + movl %esi,(%rdx) /* oldp = %rdx */ ret -END(casuword32) +END(casueword32) /* - * casuword. Compare and set user word. Returns -1 or the current value. - * dst = %rdi, old = %rsi, new = %rdx + * casueword. Compare and set user long. Returns -1 on fault, + * 0 if access was successful. Old value is written to *oldp. + * dst = %rdi, old = %rsi, oldp = %rdx, new = %rcx */ -ENTRY(casuword) - movq PCPU(CURPCB),%rcx - movq $fusufault,PCB_ONFAULT(%rcx) +ENTRY(casueword) + movq PCPU(CURPCB),%r8 + movq $fusufault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax cmpq %rax,%rdi /* verify address is valid */ @@ -356,28 +365,28 @@ ENTRY(casuword) #ifdef SMP lock #endif - cmpxchgq %rdx,(%rdi) /* new = %rdx */ + cmpxchgq %rcx,(%rdi) /* new = %rcx */ /* - * The old value is in %eax. If the store succeeded it will be the + * The old value is in %rax. If the store succeeded it will be the * value we expected (old) from before the store, otherwise it will * be the current value. */ - - movq PCPU(CURPCB),%rcx - movq $fusufault,PCB_ONFAULT(%rcx) - movq $0,PCB_ONFAULT(%rcx) + movq %rax,%rsi + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + movq %rsi,(%rdx) ret -END(casuword) +END(casueword) /* * Fetch (load) a 64-bit word, a 32-bit word, a 16-bit word, or an 8-bit - * byte from user memory. All these functions are MPSAFE. - * addr = %rdi + * byte from user memory. + * addr = %rdi, valp = %rsi */ -ALTENTRY(fuword64) -ENTRY(fuword) +ALTENTRY(fueword64) +ENTRY(fueword) movq PCPU(CURPCB),%rcx movq $fusufault,PCB_ONFAULT(%rcx) @@ -385,13 +394,15 @@ ENTRY(fuword) cmpq %rax,%rdi /* verify address is valid */ ja fusufault - movq (%rdi),%rax - movq $0,PCB_ONFAULT(%rcx) + xorl %eax,%eax + movq (%rdi),%r11 + movq %rax,PCB_ONFAULT(%rcx) + movq %r11,(%rsi) ret END(fuword64) END(fuword) -ENTRY(fuword32) +ENTRY(fueword32) movq PCPU(CURPCB),%rcx movq $fusufault,PCB_ONFAULT(%rcx) @@ -399,10 +410,12 @@ ENTRY(fuword32) cmpq %rax,%rdi /* verify address is valid */ ja fusufault - movl (%rdi),%eax - movq $0,PCB_ONFAULT(%rcx) + xorl %eax,%eax + movl (%rdi),%r11d + movq %rax,PCB_ONFAULT(%rcx) + movl %r11d,(%rsi) ret -END(fuword32) +END(fueword32) /* * fuswintr() and suswintr() are specialized variants of fuword16() and Modified: head/sys/arm/include/param.h ============================================================================== --- head/sys/arm/include/param.h Tue Oct 28 14:54:04 2014 (r273782) +++ head/sys/arm/include/param.h Tue Oct 28 15:22:13 2014 (r273783) @@ -149,4 +149,8 @@ #define pgtok(x) ((x) * (PAGE_SIZE / 1024)) +#ifdef _KERNEL +#define NO_FUEWORD 1 +#endif + #endif /* !_ARM_INCLUDE_PARAM_H_ */ Modified: head/sys/i386/i386/support.s ============================================================================== --- head/sys/i386/i386/support.s Tue Oct 28 14:54:04 2014 (r273782) +++ head/sys/i386/i386/support.s Tue Oct 28 15:22:13 2014 (r273783) @@ -389,16 +389,16 @@ copyin_fault: ret /* - * casuword. Compare and set user word. Returns -1 or the current value. + * casueword. Compare and set user word. Returns -1 on fault, + * 0 on non-faulting access. The current value is in *oldp. */ - -ALTENTRY(casuword32) -ENTRY(casuword) +ALTENTRY(casueword32) +ENTRY(casueword) movl PCPU(CURPCB),%ecx movl $fusufault,PCB_ONFAULT(%ecx) movl 4(%esp),%edx /* dst */ movl 8(%esp),%eax /* old */ - movl 12(%esp),%ecx /* new */ + movl 16(%esp),%ecx /* new */ cmpl $VM_MAXUSER_ADDRESS-4,%edx /* verify address is valid */ ja fusufault @@ -416,17 +416,20 @@ ENTRY(casuword) movl PCPU(CURPCB),%ecx movl $0,PCB_ONFAULT(%ecx) + movl 12(%esp),%edx /* oldp */ + movl %eax,(%edx) + xorl %eax,%eax ret -END(casuword32) -END(casuword) +END(casueword32) +END(casueword) /* * Fetch (load) a 32-bit word, a 16-bit word, or an 8-bit byte from user - * memory. All these functions are MPSAFE. + * memory. */ -ALTENTRY(fuword32) -ENTRY(fuword) +ALTENTRY(fueword32) +ENTRY(fueword) movl PCPU(CURPCB),%ecx movl $fusufault,PCB_ONFAULT(%ecx) movl 4(%esp),%edx /* from */ @@ -436,9 +439,12 @@ ENTRY(fuword) movl (%edx),%eax movl $0,PCB_ONFAULT(%ecx) + movl 8(%esp),%edx + movl %eax,(%edx) + xorl %eax,%eax ret -END(fuword32) -END(fuword) +END(fueword32) +END(fueword) /* * fuswintr() and suswintr() are specialized variants of fuword16() and Modified: head/sys/kern/subr_uio.c ============================================================================== --- head/sys/kern/subr_uio.c Tue Oct 28 14:54:04 2014 (r273782) +++ head/sys/kern/subr_uio.c Tue Oct 28 15:22:13 2014 (r273783) @@ -7,6 +7,11 @@ * Co. or Unix System Laboratories, Inc. and are reproduced herein with * the permission of UNIX System Laboratories, Inc. * + * Copyright (c) 2014 The FreeBSD Foundation + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -438,3 +443,128 @@ copyout_unmap(struct thread *td, vm_offs return (0); } + +#ifdef NO_FUEWORD +/* + * XXXKIB The temporal implementation of fue*() functions which do not + * handle usermode -1 properly, mixing it with the fault code. Keep + * this until MD code is written. Currently sparc64, mips and arm do + * not have proper implementation. + */ + +int +fueword(const void *base, long *val) +{ + long res; + + res = fuword(base); + if (res == -1) + return (-1); + *val = res; + return (0); +} + +int +fueword32(const void *base, int32_t *val) +{ + int32_t res; + + res = fuword32(base); + if (res == -1) + return (-1); + *val = res; + return (0); +} + +#ifdef _LP64 +int +fueword64(const void *base, int64_t *val) +{ + int32_t res; + + res = fuword64(base); + if (res == -1) + return (-1); + *val = res; + return (0); +} +#endif + +int +casueword32(volatile uint32_t *base, uint32_t oldval, uint32_t *oldvalp, + uint32_t newval) +{ + int32_t ov; + + ov = casuword32(base, oldval, newval); + if (ov == -1) + return (-1); + *oldvalp = ov; + return (0); +} + +int +casueword(volatile u_long *p, u_long oldval, u_long *oldvalp, u_long newval) +{ + u_long ov; + + ov = casuword(p, oldval, newval); + if (ov == -1) + return (-1); + *oldvalp = ov; + return (0); +} +#else /* NO_FUEWORD */ +int32_t +fuword32(const void *addr) +{ + int rv; + int32_t val; + + rv = fueword32(addr, &val); + return (rv == -1 ? -1 : val); +} + +#ifdef _LP64 +int64_t +fuword64(const void *addr) +{ + int rv; + int64_t val; + + rv = fueword64(addr, &val); + return (rv == -1 ? -1 : val); +} +#endif /* _LP64 */ + +long +fuword(const void *addr) +{ + long val; + int rv; + + rv = fueword(addr, &val); + return (rv == -1 ? -1 : val); +} + +uint32_t +casuword32(volatile uint32_t *addr, uint32_t old, uint32_t new) +{ + int rv; + uint32_t val; + + rv = casueword32(addr, old, &val, new); + return (rv == -1 ? -1 : val); +} + +u_long +casuword(volatile u_long *addr, u_long old, u_long new) +{ + int rv; + u_long val; + + rv = casueword(addr, old, &val, new); + return (rv == -1 ? -1 : val); +} + +#endif /* NO_FUEWORD */ Modified: head/sys/mips/include/param.h ============================================================================== --- head/sys/mips/include/param.h Tue Oct 28 14:54:04 2014 (r273782) +++ head/sys/mips/include/param.h Tue Oct 28 15:22:13 2014 (r273783) @@ -178,4 +178,8 @@ #define pgtok(x) ((x) * (PAGE_SIZE / 1024)) +#ifdef _KERNEL +#define NO_FUEWORD 1 +#endif + #endif /* !_MIPS_INCLUDE_PARAM_H_ */ Modified: head/sys/powerpc/powerpc/copyinout.c ============================================================================== --- head/sys/powerpc/powerpc/copyinout.c Tue Oct 28 14:54:04 2014 (r273782) +++ head/sys/powerpc/powerpc/copyinout.c Tue Oct 28 15:22:13 2014 (r273783) @@ -405,14 +405,13 @@ fubyte(const void *addr) return (val); } -#ifdef __powerpc64__ -int32_t -fuword32(const void *addr) +int +fuword16(const void *addr) { struct thread *td; pmap_t pm; faultbuf env; - int32_t *p, val; + uint16_t *p, val; td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; @@ -432,15 +431,14 @@ fuword32(const void *addr) td->td_pcb->pcb_onfault = NULL; return (val); } -#endif -long -fuword(const void *addr) +int +fueword32(const void *addr, int32_t *val) { struct thread *td; pmap_t pm; faultbuf env; - long *p, val; + int32_t *p; td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; @@ -455,22 +453,71 @@ fuword(const void *addr) return (-1); } - val = *p; + *val = *p; td->td_pcb->pcb_onfault = NULL; - return (val); + return (0); } -#ifndef __powerpc64__ -int32_t -fuword32(const void *addr) +#ifdef __powerpc64__ +int +fueword64(const void *addr, int64_t *val) { - return ((int32_t)fuword(addr)); + struct thread *td; + pmap_t pm; + faultbuf env; + int64_t *p; + + td = curthread; + pm = &td->td_proc->p_vmspace->vm_pmap; + + if (setfault(env)) { + td->td_pcb->pcb_onfault = NULL; + return (-1); + } + + if (map_user_ptr(pm, addr, (void **)&p, sizeof(*p), NULL)) { + td->td_pcb->pcb_onfault = NULL; + return (-1); + } + + *val = *p; + + td->td_pcb->pcb_onfault = NULL; + return (0); } #endif -uint32_t -casuword32(volatile uint32_t *addr, uint32_t old, uint32_t new) +int +fueword(const void *addr, long *val) +{ + struct thread *td; + pmap_t pm; + faultbuf env; + long *p; + + td = curthread; + pm = &td->td_proc->p_vmspace->vm_pmap; + + if (setfault(env)) { + td->td_pcb->pcb_onfault = NULL; + return (-1); + } + + if (map_user_ptr(pm, addr, (void **)&p, sizeof(*p), NULL)) { + td->td_pcb->pcb_onfault = NULL; + return (-1); + } + + *val = *p; + + td->td_pcb->pcb_onfault = NULL; + return (0); +} + +int +casueword32(volatile uint32_t *addr, uint32_t old, uint32_t *oldvalp, + uint32_t new) { struct thread *td; pmap_t pm; @@ -507,18 +554,21 @@ casuword32(volatile uint32_t *addr, uint td->td_pcb->pcb_onfault = NULL; - return (val); + *oldvalp = val; + return (0); } #ifndef __powerpc64__ -u_long -casuword(volatile u_long *addr, u_long old, u_long new) +int +casueword(volatile u_long *addr, u_long old, u_long *oldvalp, u_long new) { - return (casuword32((volatile uint32_t *)addr, old, new)); + + return (casueword32((volatile uint32_t *)addr, old, + (uint32_t *)oldvalp, new)); } #else -u_long -casuword(volatile u_long *addr, u_long old, u_long new) +int +casueword(volatile u_long *addr, u_long old, u_long *oldvalp, u_long new) { struct thread *td; pmap_t pm; @@ -555,7 +605,7 @@ casuword(volatile u_long *addr, u_long o td->td_pcb->pcb_onfault = NULL; - return (val); + *oldvalp = val; + return (0); } #endif - Modified: head/sys/sparc64/include/param.h ============================================================================== --- head/sys/sparc64/include/param.h Tue Oct 28 14:54:04 2014 (r273782) +++ head/sys/sparc64/include/param.h Tue Oct 28 15:22:13 2014 (r273783) @@ -146,4 +146,8 @@ #define pgtok(x) ((unsigned long)(x) * (PAGE_SIZE / 1024)) +#ifdef _KERNEL +#define NO_FUEWORD 1 +#endif + #endif /* !_SPARC64_INCLUDE_PARAM_H_ */ Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Tue Oct 28 14:54:04 2014 (r273782) +++ head/sys/sys/systm.h Tue Oct 28 15:22:13 2014 (r273783) @@ -254,16 +254,23 @@ int copyout_nofault(const void * __restr int fubyte(const void *base); long fuword(const void *base); -int fuword16(void *base); +int fuword16(const void *base); int32_t fuword32(const void *base); int64_t fuword64(const void *base); +int fueword(const void *base, long *val); +int fueword32(const void *base, int32_t *val); +int fueword64(const void *base, int64_t *val); int subyte(void *base, int byte); int suword(void *base, long word); int suword16(void *base, int word); int suword32(void *base, int32_t word); int suword64(void *base, int64_t word); uint32_t casuword32(volatile uint32_t *base, uint32_t oldval, uint32_t newval); -u_long casuword(volatile u_long *p, u_long oldval, u_long newval); +u_long casuword(volatile u_long *p, u_long oldval, u_long newval); +int casueword32(volatile uint32_t *base, uint32_t oldval, uint32_t *oldvalp, + uint32_t newval); +int casueword(volatile u_long *p, u_long oldval, u_long *oldvalp, + u_long newval); void realitexpire(void *); From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 15:28:22 2014 Return-Path: Delivered-To: svn-src-all@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 EA67C290; Tue, 28 Oct 2014 15:28:22 +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 D552AB54; Tue, 28 Oct 2014 15:28:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9SFSMUU013771; Tue, 28 Oct 2014 15:28:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SFSLs2013764; Tue, 28 Oct 2014 15:28:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201410281528.s9SFSLs2013764@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 28 Oct 2014 15:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273784 - in head/sys: amd64/ia32 compat/freebsd32 i386/i386 kern net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 15:28:23 -0000 Author: kib Date: Tue Oct 28 15:28:20 2014 New Revision: 273784 URL: https://svnweb.freebsd.org/changeset/base/273784 Log: Replace some calls to fuword() by fueword() with proper error checking. Sponsored by: The FreeBSD Foundation Tested by: pho MFC after: 3 weeks Modified: head/sys/amd64/ia32/ia32_syscall.c head/sys/compat/freebsd32/freebsd32_misc.c head/sys/i386/i386/trap.c head/sys/kern/kern_exec.c head/sys/kern/vfs_acl.c head/sys/net/if_spppsubr.c Modified: head/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- head/sys/amd64/ia32/ia32_syscall.c Tue Oct 28 15:22:13 2014 (r273783) +++ head/sys/amd64/ia32/ia32_syscall.c Tue Oct 28 15:28:20 2014 (r273784) @@ -110,7 +110,7 @@ ia32_fetch_syscall_args(struct thread *t struct proc *p; struct trapframe *frame; caddr_t params; - u_int32_t args[8]; + u_int32_t args[8], tmp; int error, i; p = td->td_proc; @@ -126,7 +126,10 @@ ia32_fetch_syscall_args(struct thread *t /* * Code is first argument, followed by actual args. */ - sa->code = fuword32(params); + error = fueword32(params, &tmp); + if (error == -1) + return (EFAULT); + sa->code = tmp; params += sizeof(int); } else if (sa->code == SYS___syscall) { /* @@ -135,7 +138,10 @@ ia32_fetch_syscall_args(struct thread *t * We use a 32-bit fetch in case params is not * aligned. */ - sa->code = fuword32(params); + error = fueword32(params, &tmp); + if (error == -1) + return (EFAULT); + sa->code = tmp; params += sizeof(quad_t); } if (p->p_sysent->sv_mask) Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue Oct 28 15:22:13 2014 (r273783) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue Oct 28 15:28:20 2014 (r273784) @@ -1832,16 +1832,21 @@ freebsd32_sysctl(struct thread *td, stru { int error, name[CTL_MAXNAME]; size_t j, oldlen; + uint32_t tmp; if (uap->namelen > CTL_MAXNAME || uap->namelen < 2) return (EINVAL); error = copyin(uap->name, name, uap->namelen * sizeof(int)); if (error) return (error); - if (uap->oldlenp) - oldlen = fuword32(uap->oldlenp); - else + if (uap->oldlenp) { + error = fueword32(uap->oldlenp, &tmp); + oldlen = tmp; + } else { oldlen = 0; + } + if (error != 0) + return (EFAULT); error = userland_sysctl(td, name, uap->namelen, uap->old, &oldlen, 1, uap->new, uap->newlen, &j, SCTL_MASK32); Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Tue Oct 28 15:22:13 2014 (r273783) +++ head/sys/i386/i386/trap.c Tue Oct 28 15:28:20 2014 (r273784) @@ -1059,6 +1059,7 @@ cpu_fetch_syscall_args(struct thread *td struct proc *p; struct trapframe *frame; caddr_t params; + long tmp; int error; p = td->td_proc; @@ -1074,14 +1075,20 @@ cpu_fetch_syscall_args(struct thread *td /* * Code is first argument, followed by actual args. */ - sa->code = fuword(params); + error = fueword(params, &tmp); + if (error == -1) + return (EFAULT); + sa->code = tmp; params += sizeof(int); } else if (sa->code == SYS___syscall) { /* * Like syscall, but code is a quad, so as to maintain * quad alignment for the rest of the arguments. */ - sa->code = fuword(params); + error = fueword(params, &tmp); + if (error == -1) + return (EFAULT); + sa->code = tmp; params += sizeof(quad_t); } Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Tue Oct 28 15:22:13 2014 (r273783) +++ head/sys/kern/kern_exec.c Tue Oct 28 15:28:20 2014 (r273784) @@ -1091,7 +1091,7 @@ int exec_copyin_args(struct image_args *args, char *fname, enum uio_seg segflg, char **argv, char **envv) { - char *argp, *envp; + u_long argp, envp; int error; size_t length; @@ -1127,13 +1127,17 @@ exec_copyin_args(struct image_args *args /* * extract arguments first */ - while ((argp = (caddr_t) (intptr_t) fuword(argv++))) { - if (argp == (caddr_t) -1) { + for (;;) { + error = fueword(argv++, &argp); + if (error == -1) { error = EFAULT; goto err_exit; } - if ((error = copyinstr(argp, args->endp, - args->stringspace, &length))) { + if (argp == 0) + break; + error = copyinstr((void *)(uintptr_t)argp, args->endp, + args->stringspace, &length); + if (error != 0) { if (error == ENAMETOOLONG) error = E2BIG; goto err_exit; @@ -1149,13 +1153,17 @@ exec_copyin_args(struct image_args *args * extract environment strings */ if (envv) { - while ((envp = (caddr_t)(intptr_t)fuword(envv++))) { - if (envp == (caddr_t)-1) { + for (;;) { + error = fueword(envv++, &envp); + if (error == -1) { error = EFAULT; goto err_exit; } - if ((error = copyinstr(envp, args->endp, - args->stringspace, &length))) { + if (envp == 0) + break; + error = copyinstr((void *)(uintptr_t)envp, + args->endp, args->stringspace, &length); + if (error != 0) { if (error == ENAMETOOLONG) error = E2BIG; goto err_exit; Modified: head/sys/kern/vfs_acl.c ============================================================================== --- head/sys/kern/vfs_acl.c Tue Oct 28 15:22:13 2014 (r273783) +++ head/sys/kern/vfs_acl.c Tue Oct 28 15:28:20 2014 (r273784) @@ -148,6 +148,7 @@ acl_copyin(void *user_acl, struct acl *k static int acl_copyout(struct acl *kernel_acl, void *user_acl, acl_type_t type) { + uint32_t am; int error; struct oldacl old; @@ -162,8 +163,11 @@ acl_copyout(struct acl *kernel_acl, void break; default: - if (fuword32((char *)user_acl + - offsetof(struct acl, acl_maxcnt)) != ACL_MAX_ENTRIES) + error = fueword32((char *)user_acl + + offsetof(struct acl, acl_maxcnt), &am); + if (error == -1) + return (EFAULT); + if (am != ACL_MAX_ENTRIES) return (EINVAL); error = copyout(kernel_acl, user_acl, sizeof(*kernel_acl)); Modified: head/sys/net/if_spppsubr.c ============================================================================== --- head/sys/net/if_spppsubr.c Tue Oct 28 15:22:13 2014 (r273783) +++ head/sys/net/if_spppsubr.c Tue Oct 28 15:28:20 2014 (r273784) @@ -5060,7 +5060,8 @@ sppp_params(struct sppp *sp, u_long cmd, * Check the cmd word first before attempting to fetch all the * data. */ - if ((subcmd = fuword(ifr->ifr_data)) == -1) { + rv = fueword(ifr->ifr_data, &subcmd); + if (rv == -1) { rv = EFAULT; goto quit; } From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 15:30:34 2014 Return-Path: Delivered-To: svn-src-all@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 5EBAE403; Tue, 28 Oct 2014 15:30: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 4A42EB71; Tue, 28 Oct 2014 15:30: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 s9SFUYh4015692; Tue, 28 Oct 2014 15:30:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SFUYBd015691; Tue, 28 Oct 2014 15:30:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201410281530.s9SFUYBd015691@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 28 Oct 2014 15:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273785 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 15:30:34 -0000 Author: kib Date: Tue Oct 28 15:30:33 2014 New Revision: 273785 URL: https://svnweb.freebsd.org/changeset/base/273785 Log: Convert kern_umtx.c to use fueword() and casueword(). Also fix some mishandling of suword(9) errors as errno, which resulted in spurious ERESTART. Sponsored by: The FreeBSD Foundation Tested by: pho MFC after: 3 weeks Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Tue Oct 28 15:28:20 2014 (r273784) +++ head/sys/kern/kern_umtx.c Tue Oct 28 15:30:33 2014 (r273785) @@ -510,6 +510,15 @@ umtxq_unbusy(struct umtx_key *key) wakeup_one(uc); } +static inline void +umtxq_unbusy_unlocked(struct umtx_key *key) +{ + + umtxq_lock(key); + umtxq_unbusy(key); + umtxq_unlock(key); +} + static struct umtxq_queue * umtxq_queue_lookup(struct umtx_key *key, int q) { @@ -847,6 +856,7 @@ do_wait(struct thread *td, void *addr, u struct abs_timeout timo; struct umtx_q *uq; u_long tmp; + uint32_t tmp32; int error = 0; uq = td->td_umtxq; @@ -860,18 +870,29 @@ do_wait(struct thread *td, void *addr, u umtxq_lock(&uq->uq_key); umtxq_insert(uq); umtxq_unlock(&uq->uq_key); - if (compat32 == 0) - tmp = fuword(addr); - else - tmp = (unsigned int)fuword32(addr); + if (compat32 == 0) { + error = fueword(addr, &tmp); + if (error != 0) + error = EFAULT; + } else { + error = fueword32(addr, &tmp32); + if (error == 0) + tmp = tmp32; + else + error = EFAULT; + } umtxq_lock(&uq->uq_key); - if (tmp == id) - error = umtxq_sleep(uq, "uwait", timeout == NULL ? - NULL : &timo); - if ((uq->uq_flags & UQF_UMTXQ) == 0) - error = 0; - else + if (error == 0) { + if (tmp == id) + error = umtxq_sleep(uq, "uwait", timeout == NULL ? + NULL : &timo); + if ((uq->uq_flags & UQF_UMTXQ) == 0) + error = 0; + else + umtxq_remove(uq); + } else if ((uq->uq_flags & UQF_UMTXQ) != 0) { umtxq_remove(uq); + } umtxq_unlock(&uq->uq_key); umtx_key_release(&uq->uq_key); if (error == ERESTART) @@ -908,11 +929,11 @@ do_lock_normal(struct thread *td, struct struct abs_timeout timo; struct umtx_q *uq; uint32_t owner, old, id; - int error = 0; + int error, rv; id = td->td_tid; uq = td->td_umtxq; - + error = 0; if (timeout != NULL) abs_timeout_init2(&timo, timeout); @@ -921,7 +942,9 @@ do_lock_normal(struct thread *td, struct * can fault on any access. */ for (;;) { - owner = fuword32(__DEVOLATILE(void *, &m->m_owner)); + rv = fueword32(__DEVOLATILE(void *, &m->m_owner), &owner); + if (rv == -1) + return (EFAULT); if (mode == _UMUTEX_WAIT) { if (owner == UMUTEX_UNOWNED || owner == UMUTEX_CONTESTED) return (0); @@ -929,31 +952,31 @@ do_lock_normal(struct thread *td, struct /* * Try the uncontested case. This should be done in userland. */ - owner = casuword32(&m->m_owner, UMUTEX_UNOWNED, id); + rv = casueword32(&m->m_owner, UMUTEX_UNOWNED, + &owner, id); + /* The address was invalid. */ + if (rv == -1) + return (EFAULT); /* The acquire succeeded. */ if (owner == UMUTEX_UNOWNED) return (0); - /* The address was invalid. */ - if (owner == -1) - return (EFAULT); - /* If no one owns it but it is contested try to acquire it. */ if (owner == UMUTEX_CONTESTED) { - owner = casuword32(&m->m_owner, - UMUTEX_CONTESTED, id | UMUTEX_CONTESTED); + rv = casueword32(&m->m_owner, + UMUTEX_CONTESTED, &owner, + id | UMUTEX_CONTESTED); + /* The address was invalid. */ + if (rv == -1) + return (EFAULT); if (owner == UMUTEX_CONTESTED) return (0); - /* The address was invalid. */ - if (owner == -1) - return (EFAULT); - - error = umtxq_check_susp(td); - if (error != 0) - return (error); + rv = umtxq_check_susp(td); + if (rv != 0) + return (rv); /* If this failed the lock has changed, restart. */ continue; @@ -985,10 +1008,11 @@ do_lock_normal(struct thread *td, struct * either some one else has acquired the lock or it has been * released. */ - old = casuword32(&m->m_owner, owner, owner | UMUTEX_CONTESTED); + rv = casueword32(&m->m_owner, owner, &old, + owner | UMUTEX_CONTESTED); /* The address was invalid. */ - if (old == -1) { + if (rv == -1) { umtxq_lock(&uq->uq_key); umtxq_remove(uq); umtxq_unbusy(&uq->uq_key); @@ -1033,16 +1057,16 @@ do_unlock_normal(struct thread *td, stru /* * Make sure we own this mtx. */ - owner = fuword32(__DEVOLATILE(uint32_t *, &m->m_owner)); - if (owner == -1) + error = fueword32(__DEVOLATILE(uint32_t *, &m->m_owner), &owner); + if (error == -1) return (EFAULT); if ((owner & ~UMUTEX_CONTESTED) != id) return (EPERM); if ((owner & UMUTEX_CONTESTED) == 0) { - old = casuword32(&m->m_owner, owner, UMUTEX_UNOWNED); - if (old == -1) + error = casueword32(&m->m_owner, owner, &old, UMUTEX_UNOWNED); + if (error == -1) return (EFAULT); if (old == owner) return (0); @@ -1064,14 +1088,14 @@ do_unlock_normal(struct thread *td, stru * there is zero or one thread only waiting for it. * Otherwise, it must be marked as contested. */ - old = casuword32(&m->m_owner, owner, - count <= 1 ? UMUTEX_UNOWNED : UMUTEX_CONTESTED); + error = casueword32(&m->m_owner, owner, &old, + count <= 1 ? UMUTEX_UNOWNED : UMUTEX_CONTESTED); umtxq_lock(&key); umtxq_signal(&key,1); umtxq_unbusy(&key); umtxq_unlock(&key); umtx_key_release(&key); - if (old == -1) + if (error == -1) return (EFAULT); if (old != owner) return (EINVAL); @@ -1091,14 +1115,16 @@ do_wake_umutex(struct thread *td, struct int error; int count; - owner = fuword32(__DEVOLATILE(uint32_t *, &m->m_owner)); - if (owner == -1) + error = fueword32(__DEVOLATILE(uint32_t *, &m->m_owner), &owner); + if (error == -1) return (EFAULT); if ((owner & ~UMUTEX_CONTESTED) != 0) return (0); - flags = fuword32(&m->m_flags); + error = fueword32(&m->m_flags, &flags); + if (error == -1) + return (EFAULT); /* We should only ever be in here for contested locks */ if ((error = umtx_key_get(m, TYPE_NORMAL_UMUTEX, GET_SHARE(flags), @@ -1110,16 +1136,20 @@ do_wake_umutex(struct thread *td, struct count = umtxq_count(&key); umtxq_unlock(&key); - if (count <= 1) - owner = casuword32(&m->m_owner, UMUTEX_CONTESTED, UMUTEX_UNOWNED); + if (count <= 1) { + error = casueword32(&m->m_owner, UMUTEX_CONTESTED, &owner, + UMUTEX_UNOWNED); + if (error == -1) + error = EFAULT; + } umtxq_lock(&key); - if (count != 0 && (owner & ~UMUTEX_CONTESTED) == 0) + if (error == 0 && count != 0 && (owner & ~UMUTEX_CONTESTED) == 0) umtxq_signal(&key, 1); umtxq_unbusy(&key); umtxq_unlock(&key); umtx_key_release(&key); - return (0); + return (error); } /* @@ -1162,41 +1192,49 @@ do_wake2_umutex(struct thread *td, struc * any memory. */ if (count > 1) { - owner = fuword32(__DEVOLATILE(uint32_t *, &m->m_owner)); - while ((owner & UMUTEX_CONTESTED) ==0) { - old = casuword32(&m->m_owner, owner, - owner|UMUTEX_CONTESTED); + error = fueword32(__DEVOLATILE(uint32_t *, &m->m_owner), + &owner); + if (error == -1) + error = EFAULT; + while (error == 0 && (owner & UMUTEX_CONTESTED) == 0) { + error = casueword32(&m->m_owner, owner, &old, + owner | UMUTEX_CONTESTED); + if (error == -1) { + error = EFAULT; + break; + } if (old == owner) break; owner = old; - if (old == -1) - break; error = umtxq_check_susp(td); if (error != 0) break; } } else if (count == 1) { - owner = fuword32(__DEVOLATILE(uint32_t *, &m->m_owner)); - while ((owner & ~UMUTEX_CONTESTED) != 0 && + error = fueword32(__DEVOLATILE(uint32_t *, &m->m_owner), + &owner); + if (error == -1) + error = EFAULT; + while (error == 0 && (owner & ~UMUTEX_CONTESTED) != 0 && (owner & UMUTEX_CONTESTED) == 0) { - old = casuword32(&m->m_owner, owner, - owner|UMUTEX_CONTESTED); + error = casueword32(&m->m_owner, owner, &old, + owner | UMUTEX_CONTESTED); + if (error == -1) { + error = EFAULT; + break; + } if (old == owner) break; owner = old; - if (old == -1) - break; error = umtxq_check_susp(td); if (error != 0) break; } } umtxq_lock(&key); - if (owner == -1) { - error = EFAULT; + if (error == EFAULT) { umtxq_signal(&key, INT_MAX); - } - else if (count != 0 && (owner & ~UMUTEX_CONTESTED) == 0) + } else if (count != 0 && (owner & ~UMUTEX_CONTESTED) == 0) umtxq_signal(&key, 1); umtxq_unbusy(&key); umtxq_unlock(&key); @@ -1576,7 +1614,7 @@ do_lock_pi(struct thread *td, struct umu struct umtx_q *uq; struct umtx_pi *pi, *new_pi; uint32_t id, owner, old; - int error; + int error, rv; id = td->td_tid; uq = td->td_umtxq; @@ -1619,7 +1657,12 @@ do_lock_pi(struct thread *td, struct umu /* * Try the uncontested case. This should be done in userland. */ - owner = casuword32(&m->m_owner, UMUTEX_UNOWNED, id); + rv = casueword32(&m->m_owner, UMUTEX_UNOWNED, &owner, id); + /* The address was invalid. */ + if (rv == -1) { + error = EFAULT; + break; + } /* The acquire succeeded. */ if (owner == UMUTEX_UNOWNED) { @@ -1627,16 +1670,15 @@ do_lock_pi(struct thread *td, struct umu break; } - /* The address was invalid. */ - if (owner == -1) { - error = EFAULT; - break; - } - /* If no one owns it but it is contested try to acquire it. */ if (owner == UMUTEX_CONTESTED) { - owner = casuword32(&m->m_owner, - UMUTEX_CONTESTED, id | UMUTEX_CONTESTED); + rv = casueword32(&m->m_owner, + UMUTEX_CONTESTED, &owner, id | UMUTEX_CONTESTED); + /* The address was invalid. */ + if (rv == -1) { + error = EFAULT; + break; + } if (owner == UMUTEX_CONTESTED) { umtxq_lock(&uq->uq_key); @@ -1647,12 +1689,6 @@ do_lock_pi(struct thread *td, struct umu break; } - /* The address was invalid. */ - if (owner == -1) { - error = EFAULT; - break; - } - error = umtxq_check_susp(td); if (error != 0) break; @@ -1683,13 +1719,12 @@ do_lock_pi(struct thread *td, struct umu * either some one else has acquired the lock or it has been * released. */ - old = casuword32(&m->m_owner, owner, owner | UMUTEX_CONTESTED); + rv = casueword32(&m->m_owner, owner, &old, + owner | UMUTEX_CONTESTED); /* The address was invalid. */ - if (old == -1) { - umtxq_lock(&uq->uq_key); - umtxq_unbusy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); + if (rv == -1) { + umtxq_unbusy_unlocked(&uq->uq_key); error = EFAULT; break; } @@ -1741,8 +1776,8 @@ do_unlock_pi(struct thread *td, struct u /* * Make sure we own this mtx. */ - owner = fuword32(__DEVOLATILE(uint32_t *, &m->m_owner)); - if (owner == -1) + error = fueword32(__DEVOLATILE(uint32_t *, &m->m_owner), &owner); + if (error == -1) return (EFAULT); if ((owner & ~UMUTEX_CONTESTED) != id) @@ -1750,8 +1785,8 @@ do_unlock_pi(struct thread *td, struct u /* This should be done in userland */ if ((owner & UMUTEX_CONTESTED) == 0) { - old = casuword32(&m->m_owner, owner, UMUTEX_UNOWNED); - if (old == -1) + error = casueword32(&m->m_owner, owner, &old, UMUTEX_UNOWNED); + if (error == -1) return (EFAULT); if (old == owner) return (0); @@ -1809,14 +1844,12 @@ do_unlock_pi(struct thread *td, struct u * there is zero or one thread only waiting for it. * Otherwise, it must be marked as contested. */ - old = casuword32(&m->m_owner, owner, - count <= 1 ? UMUTEX_UNOWNED : UMUTEX_CONTESTED); + error = casueword32(&m->m_owner, owner, &old, + count <= 1 ? UMUTEX_UNOWNED : UMUTEX_CONTESTED); - umtxq_lock(&key); - umtxq_unbusy(&key); - umtxq_unlock(&key); + umtxq_unbusy_unlocked(&key); umtx_key_release(&key); - if (old == -1) + if (error == -1) return (EFAULT); if (old != owner) return (EINVAL); @@ -1835,7 +1868,7 @@ do_lock_pp(struct thread *td, struct umu struct umtx_pi *pi; uint32_t ceiling; uint32_t owner, id; - int error, pri, old_inherited_pri, su; + int error, pri, old_inherited_pri, su, rv; id = td->td_tid; uq = td->td_umtxq; @@ -1853,7 +1886,12 @@ do_lock_pp(struct thread *td, struct umu umtxq_busy(&uq->uq_key); umtxq_unlock(&uq->uq_key); - ceiling = RTP_PRIO_MAX - fuword32(&m->m_ceilings[0]); + rv = fueword32(&m->m_ceilings[0], &ceiling); + if (rv == -1) { + error = EFAULT; + goto out; + } + ceiling = RTP_PRIO_MAX - ceiling; if (ceiling > RTP_PRIO_MAX) { error = EINVAL; goto out; @@ -1874,17 +1912,16 @@ do_lock_pp(struct thread *td, struct umu } mtx_unlock_spin(&umtx_lock); - owner = casuword32(&m->m_owner, - UMUTEX_CONTESTED, id | UMUTEX_CONTESTED); - - if (owner == UMUTEX_CONTESTED) { - error = 0; + rv = casueword32(&m->m_owner, + UMUTEX_CONTESTED, &owner, id | UMUTEX_CONTESTED); + /* The address was invalid. */ + if (rv == -1) { + error = EFAULT; break; } - /* The address was invalid. */ - if (owner == -1) { - error = EFAULT; + if (owner == UMUTEX_CONTESTED) { + error = 0; break; } @@ -1946,9 +1983,7 @@ do_lock_pp(struct thread *td, struct umu } out: - umtxq_lock(&uq->uq_key); - umtxq_unbusy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); + umtxq_unbusy_unlocked(&uq->uq_key); umtx_key_release(&uq->uq_key); return (error); } @@ -1973,8 +2008,8 @@ do_unlock_pp(struct thread *td, struct u /* * Make sure we own this mtx. */ - owner = fuword32(__DEVOLATILE(uint32_t *, &m->m_owner)); - if (owner == -1) + error = fueword32(__DEVOLATILE(uint32_t *, &m->m_owner), &owner); + if (error == -1) return (EFAULT); if ((owner & ~UMUTEX_CONTESTED) != id) @@ -2047,9 +2082,11 @@ do_set_ceiling(struct thread *td, struct uint32_t save_ceiling; uint32_t owner, id; uint32_t flags; - int error; + int error, rv; - flags = fuword32(&m->m_flags); + error = fueword32(&m->m_flags, &flags); + if (error == -1) + return (EFAULT); if ((flags & UMUTEX_PRIO_PROTECT) == 0) return (EINVAL); if (ceiling > RTP_PRIO_MAX) @@ -2064,10 +2101,18 @@ do_set_ceiling(struct thread *td, struct umtxq_busy(&uq->uq_key); umtxq_unlock(&uq->uq_key); - save_ceiling = fuword32(&m->m_ceilings[0]); + rv = fueword32(&m->m_ceilings[0], &save_ceiling); + if (rv == -1) { + error = EFAULT; + break; + } - owner = casuword32(&m->m_owner, - UMUTEX_CONTESTED, id | UMUTEX_CONTESTED); + rv = casueword32(&m->m_owner, + UMUTEX_CONTESTED, &owner, id | UMUTEX_CONTESTED); + if (rv == -1) { + error = EFAULT; + break; + } if (owner == UMUTEX_CONTESTED) { suword32(&m->m_ceilings[0], ceiling); @@ -2077,12 +2122,6 @@ do_set_ceiling(struct thread *td, struct break; } - /* The address was invalid. */ - if (owner == -1) { - error = EFAULT; - break; - } - if ((owner & ~UMUTEX_CONTESTED) == id) { suword32(&m->m_ceilings[0], ceiling); error = 0; @@ -2129,8 +2168,8 @@ do_lock_umutex(struct thread *td, struct uint32_t flags; int error; - flags = fuword32(&m->m_flags); - if (flags == -1) + error = fueword32(&m->m_flags, &flags); + if (error == -1) return (EFAULT); switch(flags & (UMUTEX_PRIO_INHERIT | UMUTEX_PRIO_PROTECT)) { @@ -2164,9 +2203,10 @@ static int do_unlock_umutex(struct thread *td, struct umutex *m) { uint32_t flags; + int error; - flags = fuword32(&m->m_flags); - if (flags == -1) + error = fueword32(&m->m_flags, &flags); + if (error == -1) return (EFAULT); switch(flags & (UMUTEX_PRIO_INHERIT | UMUTEX_PRIO_PROTECT)) { @@ -2187,21 +2227,27 @@ do_cv_wait(struct thread *td, struct uco { struct abs_timeout timo; struct umtx_q *uq; - uint32_t flags; - uint32_t clockid; + uint32_t flags, clockid, hasw; int error; uq = td->td_umtxq; - flags = fuword32(&cv->c_flags); + error = fueword32(&cv->c_flags, &flags); + if (error == -1) + return (EFAULT); error = umtx_key_get(cv, TYPE_CV, GET_SHARE(flags), &uq->uq_key); if (error != 0) return (error); if ((wflags & CVWAIT_CLOCKID) != 0) { - clockid = fuword32(&cv->c_clockid); + error = fueword32(&cv->c_clockid, &clockid); + if (error == -1) { + umtx_key_release(&uq->uq_key); + return (EFAULT); + } if (clockid < CLOCK_REALTIME || clockid >= CLOCK_THREAD_CPUTIME_ID) { /* hmm, only HW clock id will work. */ + umtx_key_release(&uq->uq_key); return (EINVAL); } } else { @@ -2217,12 +2263,12 @@ do_cv_wait(struct thread *td, struct uco * Set c_has_waiters to 1 before releasing user mutex, also * don't modify cache line when unnecessary. */ - if (fuword32(__DEVOLATILE(uint32_t *, &cv->c_has_waiters)) == 0) + error = fueword32(__DEVOLATILE(uint32_t *, &cv->c_has_waiters), + &hasw); + if (error == 0 && hasw == 0) suword32(__DEVOLATILE(uint32_t *, &cv->c_has_waiters), 1); - umtxq_lock(&uq->uq_key); - umtxq_unbusy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); + umtxq_unbusy_unlocked(&uq->uq_key); error = do_unlock_umutex(td, m); @@ -2276,7 +2322,9 @@ do_cv_signal(struct thread *td, struct u int error, cnt, nwake; uint32_t flags; - flags = fuword32(&cv->c_flags); + error = fueword32(&cv->c_flags, &flags); + if (error == -1) + return (EFAULT); if ((error = umtx_key_get(cv, TYPE_CV, GET_SHARE(flags), &key)) != 0) return (error); umtxq_lock(&key); @@ -2287,6 +2335,8 @@ do_cv_signal(struct thread *td, struct u umtxq_unlock(&key); error = suword32( __DEVOLATILE(uint32_t *, &cv->c_has_waiters), 0); + if (error == -1) + error = EFAULT; umtxq_lock(&key); } umtxq_unbusy(&key); @@ -2302,7 +2352,9 @@ do_cv_broadcast(struct thread *td, struc int error; uint32_t flags; - flags = fuword32(&cv->c_flags); + error = fueword32(&cv->c_flags, &flags); + if (error == -1) + return (EFAULT); if ((error = umtx_key_get(cv, TYPE_CV, GET_SHARE(flags), &key)) != 0) return (error); @@ -2312,10 +2364,10 @@ do_cv_broadcast(struct thread *td, struc umtxq_unlock(&key); error = suword32(__DEVOLATILE(uint32_t *, &cv->c_has_waiters), 0); + if (error == -1) + error = EFAULT; - umtxq_lock(&key); - umtxq_unbusy(&key); - umtxq_unlock(&key); + umtxq_unbusy_unlocked(&key); umtx_key_release(&key); return (error); @@ -2329,10 +2381,12 @@ do_rw_rdlock(struct thread *td, struct u uint32_t flags, wrflags; int32_t state, oldstate; int32_t blocked_readers; - int error; + int error, rv; uq = td->td_umtxq; - flags = fuword32(&rwlock->rw_flags); + error = fueword32(&rwlock->rw_flags, &flags); + if (error == -1) + return (EFAULT); error = umtx_key_get(rwlock, TYPE_RWLOCK, GET_SHARE(flags), &uq->uq_key); if (error != 0) return (error); @@ -2345,15 +2399,22 @@ do_rw_rdlock(struct thread *td, struct u wrflags |= URWLOCK_WRITE_WAITERS; for (;;) { - state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state)); + rv = fueword32(__DEVOLATILE(int32_t *, &rwlock->rw_state), + &state); + if (rv == -1) { + umtx_key_release(&uq->uq_key); + return (EFAULT); + } + /* try to lock it */ while (!(state & wrflags)) { if (__predict_false(URWLOCK_READER_COUNT(state) == URWLOCK_MAX_READERS)) { umtx_key_release(&uq->uq_key); return (EAGAIN); } - oldstate = casuword32(&rwlock->rw_state, state, state + 1); - if (oldstate == -1) { + rv = casueword32(&rwlock->rw_state, state, + &oldstate, state + 1); + if (rv == -1) { umtx_key_release(&uq->uq_key); return (EFAULT); } @@ -2379,12 +2440,17 @@ do_rw_rdlock(struct thread *td, struct u * re-read the state, in case it changed between the try-lock above * and the check below */ - state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state)); + rv = fueword32(__DEVOLATILE(int32_t *, &rwlock->rw_state), + &state); + if (rv == -1) + error = EFAULT; /* set read contention bit */ - while ((state & wrflags) && !(state & URWLOCK_READ_WAITERS)) { - oldstate = casuword32(&rwlock->rw_state, state, state | URWLOCK_READ_WAITERS); - if (oldstate == -1) { + while (error == 0 && (state & wrflags) && + !(state & URWLOCK_READ_WAITERS)) { + rv = casueword32(&rwlock->rw_state, state, + &oldstate, state | URWLOCK_READ_WAITERS); + if (rv == -1) { error = EFAULT; break; } @@ -2396,17 +2462,13 @@ do_rw_rdlock(struct thread *td, struct u break; } if (error != 0) { - umtxq_lock(&uq->uq_key); - umtxq_unbusy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); + umtxq_unbusy_unlocked(&uq->uq_key); break; } /* state is changed while setting flags, restart */ if (!(state & wrflags)) { - umtxq_lock(&uq->uq_key); - umtxq_unbusy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); + umtxq_unbusy_unlocked(&uq->uq_key); error = umtxq_check_susp(td); if (error != 0) break; @@ -2415,7 +2477,13 @@ do_rw_rdlock(struct thread *td, struct u sleep: /* contention bit is set, before sleeping, increase read waiter count */ - blocked_readers = fuword32(&rwlock->rw_blocked_readers); + rv = fueword32(&rwlock->rw_blocked_readers, + &blocked_readers); + if (rv == -1) { + umtxq_unbusy_unlocked(&uq->uq_key); + error = EFAULT; + break; + } suword32(&rwlock->rw_blocked_readers, blocked_readers+1); while (state & wrflags) { @@ -2431,18 +2499,32 @@ sleep: umtxq_unlock(&uq->uq_key); if (error) break; - state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state)); + rv = fueword32(__DEVOLATILE(int32_t *, + &rwlock->rw_state), &state); + if (rv == -1) { + error = EFAULT; + break; + } } /* decrease read waiter count, and may clear read contention bit */ - blocked_readers = fuword32(&rwlock->rw_blocked_readers); + rv = fueword32(&rwlock->rw_blocked_readers, + &blocked_readers); + if (rv == -1) { + umtxq_unbusy_unlocked(&uq->uq_key); + error = EFAULT; + break; + } suword32(&rwlock->rw_blocked_readers, blocked_readers-1); if (blocked_readers == 1) { - state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state)); - for (;;) { - oldstate = casuword32(&rwlock->rw_state, state, - state & ~URWLOCK_READ_WAITERS); - if (oldstate == -1) { + rv = fueword32(__DEVOLATILE(int32_t *, + &rwlock->rw_state), &state); + if (rv == -1) + error = EFAULT; + while (error == 0) { + rv = casueword32(&rwlock->rw_state, state, + &oldstate, state & ~URWLOCK_READ_WAITERS); + if (rv == -1) { error = EFAULT; break; } @@ -2450,14 +2532,10 @@ sleep: break; state = oldstate; error = umtxq_check_susp(td); - if (error != 0) - break; } } - umtxq_lock(&uq->uq_key); - umtxq_unbusy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); + umtxq_unbusy_unlocked(&uq->uq_key); if (error != 0) break; } @@ -2476,10 +2554,12 @@ do_rw_wrlock(struct thread *td, struct u int32_t state, oldstate; int32_t blocked_writers; int32_t blocked_readers; - int error; + int error, rv; uq = td->td_umtxq; - flags = fuword32(&rwlock->rw_flags); + error = fueword32(&rwlock->rw_flags, &flags); + if (error == -1) + return (EFAULT); error = umtx_key_get(rwlock, TYPE_RWLOCK, GET_SHARE(flags), &uq->uq_key); if (error != 0) return (error); @@ -2489,10 +2569,16 @@ do_rw_wrlock(struct thread *td, struct u blocked_readers = 0; for (;;) { - state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state)); + rv = fueword32(__DEVOLATILE(int32_t *, &rwlock->rw_state), + &state); + if (rv == -1) { + umtx_key_release(&uq->uq_key); + return (EFAULT); + } while (!(state & URWLOCK_WRITE_OWNER) && URWLOCK_READER_COUNT(state) == 0) { - oldstate = casuword32(&rwlock->rw_state, state, state | URWLOCK_WRITE_OWNER); - if (oldstate == -1) { + rv = casueword32(&rwlock->rw_state, state, + &oldstate, state | URWLOCK_WRITE_OWNER); + if (rv == -1) { umtx_key_release(&uq->uq_key); return (EFAULT); } @@ -2528,12 +2614,17 @@ do_rw_wrlock(struct thread *td, struct u * re-read the state, in case it changed between the try-lock above * and the check below */ - state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state)); + rv = fueword32(__DEVOLATILE(int32_t *, &rwlock->rw_state), + &state); + if (rv == -1) + error = EFAULT; - while (((state & URWLOCK_WRITE_OWNER) || URWLOCK_READER_COUNT(state) != 0) && - (state & URWLOCK_WRITE_WAITERS) == 0) { - oldstate = casuword32(&rwlock->rw_state, state, state | URWLOCK_WRITE_WAITERS); - if (oldstate == -1) { + while (error == 0 && ((state & URWLOCK_WRITE_OWNER) || + URWLOCK_READER_COUNT(state) != 0) && + (state & URWLOCK_WRITE_WAITERS) == 0) { + rv = casueword32(&rwlock->rw_state, state, + &oldstate, state | URWLOCK_WRITE_WAITERS); + if (rv == -1) { error = EFAULT; break; } @@ -2545,23 +2636,25 @@ do_rw_wrlock(struct thread *td, struct u break; } if (error != 0) { - umtxq_lock(&uq->uq_key); - umtxq_unbusy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); + umtxq_unbusy_unlocked(&uq->uq_key); break; } if (!(state & URWLOCK_WRITE_OWNER) && URWLOCK_READER_COUNT(state) == 0) { - umtxq_lock(&uq->uq_key); - umtxq_unbusy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); + umtxq_unbusy_unlocked(&uq->uq_key); error = umtxq_check_susp(td); if (error != 0) break; continue; } sleep: - blocked_writers = fuword32(&rwlock->rw_blocked_writers); + rv = fueword32(&rwlock->rw_blocked_writers, + &blocked_writers); + if (rv == -1) { + umtxq_unbusy_unlocked(&uq->uq_key); + error = EFAULT; + break; + } suword32(&rwlock->rw_blocked_writers, blocked_writers+1); while ((state & URWLOCK_WRITE_OWNER) || URWLOCK_READER_COUNT(state) != 0) { @@ -2577,17 +2670,34 @@ sleep: umtxq_unlock(&uq->uq_key); if (error) break; - state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state)); + rv = fueword32(__DEVOLATILE(int32_t *, + &rwlock->rw_state), &state); + if (rv == -1) { + error = EFAULT; + break; + } } - blocked_writers = fuword32(&rwlock->rw_blocked_writers); + rv = fueword32(&rwlock->rw_blocked_writers, + &blocked_writers); + if (rv == -1) { + umtxq_unbusy_unlocked(&uq->uq_key); + error = EFAULT; + break; + } suword32(&rwlock->rw_blocked_writers, blocked_writers-1); if (blocked_writers == 1) { - state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state)); + rv = fueword32(__DEVOLATILE(int32_t *, + &rwlock->rw_state), &state); + if (rv == -1) { + umtxq_unbusy_unlocked(&uq->uq_key); + error = EFAULT; + break; + } for (;;) { - oldstate = casuword32(&rwlock->rw_state, state, - state & ~URWLOCK_WRITE_WAITERS); - if (oldstate == -1) { + rv = casueword32(&rwlock->rw_state, state, + &oldstate, state & ~URWLOCK_WRITE_WAITERS); + if (rv == -1) { error = EFAULT; break; } @@ -2603,13 +2713,17 @@ sleep: if (error != 0) break; } - blocked_readers = fuword32(&rwlock->rw_blocked_readers); + rv = fueword32(&rwlock->rw_blocked_readers, + &blocked_readers); + if (rv == -1) { + umtxq_unbusy_unlocked(&uq->uq_key); + error = EFAULT; + break; + } } else blocked_readers = 0; - umtxq_lock(&uq->uq_key); - umtxq_unbusy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); + umtxq_unbusy_unlocked(&uq->uq_key); } umtx_key_release(&uq->uq_key); @@ -2624,20 +2738,26 @@ do_rw_unlock(struct thread *td, struct u struct umtx_q *uq; uint32_t flags; int32_t state, oldstate; - int error, q, count; + int error, rv, q, count; uq = td->td_umtxq; - flags = fuword32(&rwlock->rw_flags); + error = fueword32(&rwlock->rw_flags, &flags); + if (error == -1) + return (EFAULT); error = umtx_key_get(rwlock, TYPE_RWLOCK, GET_SHARE(flags), &uq->uq_key); if (error != 0) return (error); - state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state)); + error = fueword32(__DEVOLATILE(int32_t *, &rwlock->rw_state), &state); + if (error == -1) { + error = EFAULT; + goto out; + } if (state & URWLOCK_WRITE_OWNER) { for (;;) { - oldstate = casuword32(&rwlock->rw_state, state, - state & ~URWLOCK_WRITE_OWNER); - if (oldstate == -1) { + rv = casueword32(&rwlock->rw_state, state, + &oldstate, state & ~URWLOCK_WRITE_OWNER); + if (rv == -1) { error = EFAULT; goto out; } @@ -2655,9 +2775,9 @@ do_rw_unlock(struct thread *td, struct u } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 15:33:16 2014 Return-Path: Delivered-To: svn-src-all@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 80A225B7; Tue, 28 Oct 2014 15:33: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 6CF95C2F; Tue, 28 Oct 2014 15:33: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 s9SFXG8p017920; Tue, 28 Oct 2014 15:33:16 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SFXGa8017919; Tue, 28 Oct 2014 15:33:16 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201410281533.s9SFXGa8017919@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 28 Oct 2014 15:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273786 - head/usr.sbin/pw/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 15:33:16 -0000 Author: bapt Date: Tue Oct 28 15:33:15 2014 New Revision: 273786 URL: https://svnweb.freebsd.org/changeset/base/273786 Log: Fix atf syntax Modified: head/usr.sbin/pw/tests/pw_delete.sh Modified: head/usr.sbin/pw/tests/pw_delete.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_delete.sh Tue Oct 28 15:30:33 2014 (r273785) +++ head/usr.sbin/pw/tests/pw_delete.sh Tue Oct 28 15:33:15 2014 (r273786) @@ -27,7 +27,7 @@ group_do_not_delete_wheel_if_group_unkow populate_etc_skel atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x pw -V ${HOME} groupshow wheel atf_check -e inline:"pw: -g expects a number\n" -s exit:64 -x pw -V ${HOME} groupdel -g I_do_not_exist - atf_check -s exit:0 -o "wheel:*:0:root\n" -x pw -V ${HOME} groupshow wheel + atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x pw -V ${HOME} groupshow wheel } atf_init_test_cases() { From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 15:35:56 2014 Return-Path: Delivered-To: svn-src-all@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 6E645755; Tue, 28 Oct 2014 15:35:56 +0000 (UTC) Received: from mail.egr.msu.edu (gribble.egr.msu.edu [35.9.37.169]) by mx1.freebsd.org (Postfix) with ESMTP id 074C6C4F; Tue, 28 Oct 2014 15:35:56 +0000 (UTC) Received: from gribble (localhost [127.0.0.1]) by mail.egr.msu.edu (Postfix) with ESMTP id EDB793E76F; Tue, 28 Oct 2014 11:35:54 -0400 (EDT) X-Virus-Scanned: amavisd-new at egr.msu.edu Received: from mail.egr.msu.edu ([127.0.0.1]) by gribble (gribble.egr.msu.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b7UcRqqabQ3i; Tue, 28 Oct 2014 11:35:54 -0400 (EDT) Received: from EGR authenticated sender Message-ID: <544FB7DA.8010502@egr.msu.edu> Date: Tue, 28 Oct 2014 11:35:54 -0400 From: Adam McDougall User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: "bapt@FreeBSD.org >> Baptiste Daroussin" Subject: Re: svn commit: r273782 - in head/usr.sbin/pw: . tests References: <201410281454.s9SEs5kb098825@svn.freebsd.org> In-Reply-To: <201410281454.s9SEs5kb098825@svn.freebsd.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 15:35:56 -0000 On 10/28/2014 10:54, Baptiste Daroussin wrote: > Author: bapt > Date: Tue Oct 28 14:54:04 2014 > New Revision: 273782 > URL: https://svnweb.freebsd.org/changeset/base/273782 > > Log: > Do not delete the group wheel when bad argument is passed to pw groupdel -g > > Check that the -g argument is actually a number, if not report an error. > This argument is converted without checking with atoi(3) later so without this > check it converts any alpha entries into 0 meaning it deletes the group wheel > > Add a regression test about it > > PR: 90114 > Reported by: bkoenig@cs.tu-berlin.de > MFC after: 1 week > > Modified: > head/usr.sbin/pw/pw_group.c > head/usr.sbin/pw/tests/pw_delete.sh Would you mind looking at this related pw bug with patch? Thanks. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=187189 From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 15:40:14 2014 Return-Path: Delivered-To: svn-src-all@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 E5C25890; Tue, 28 Oct 2014 15:40:14 +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 59C29C90; Tue, 28 Oct 2014 15:40:14 +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 s9SFe6CN053728 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 28 Oct 2014 17:40:06 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s9SFe6CN053728 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s9SFe64H053727; Tue, 28 Oct 2014 17:40:06 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 28 Oct 2014 17:40:06 +0200 From: Konstantin Belousov To: Konstantin Belousov Subject: Re: svn commit: r273785 - head/sys/kern Message-ID: <20141028154006.GG1877@kib.kiev.ua> References: <201410281530.s9SFUYBd015691@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201410281530.s9SFUYBd015691@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 15:40:15 -0000 On Tue, Oct 28, 2014 at 03:30:34PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Tue Oct 28 15:30:33 2014 > New Revision: 273785 > URL: https://svnweb.freebsd.org/changeset/base/273785 > > Log: > Convert kern_umtx.c to use fueword() and casueword(). > > Also fix some mishandling of suword(9) errors as errno, which resulted > in spurious ERESTART. > > Sponsored by: The FreeBSD Foundation > Tested by: pho > MFC after: 3 weeks > > Modified: > head/sys/kern/kern_umtx.c Some explanation which I did not want to put into commit message. The kern_umtx.c commit is split from the other conversion commit for ease of reversal. The most tricky part of the work for fueword() was to preserve the logic of locking loops which rely on the suspension check functions errors preserved for next iteration. Another cause of troubles if kern_umtx.c were incomplete cleanups in case of userspace access errors, which left umtx sleepchains locked. The only consumers of fuword() left in tree are solaris compat layer/dtrace. Architectures which lack proper fueword() implementations are arm, mips and sparc64. I already forgot enough of sparc64 assembly, and do not know mips and arm. These arches currently should run with compat shims in subr_uio.c, but hopefully maintaners will plug the missed implementations. From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 15:46:23 2014 Return-Path: Delivered-To: svn-src-all@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 7BFB4AAA; Tue, 28 Oct 2014 15:46: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 6870BD88; Tue, 28 Oct 2014 15:46: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 s9SFkN0L022934; Tue, 28 Oct 2014 15:46:23 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SFkNZD022931; Tue, 28 Oct 2014 15:46:23 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201410281546.s9SFkNZD022931@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 28 Oct 2014 15:46:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273787 - in head/usr.sbin/pw: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 15:46:23 -0000 Author: bapt Date: Tue Oct 28 15:46:22 2014 New Revision: 273787 URL: https://svnweb.freebsd.org/changeset/base/273787 Log: Ensure pw userdel -u do not try to remove root Check the uid passed is actually a number as early as possible MFC after: 1 week Modified: head/usr.sbin/pw/pw_user.c head/usr.sbin/pw/tests/pw_delete.sh Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Tue Oct 28 15:33:15 2014 (r273786) +++ head/usr.sbin/pw/pw_user.c Tue Oct 28 15:46:22 2014 (r273787) @@ -321,6 +321,9 @@ pw_user(struct userconf * cnf, int mode, (a_uid = a_name)->ch = 'u'; a_name = NULL; } + } else { + if (strspn(a_uid->val, "0123456789") != strlen(a_uid->val)) + errx(EX_USAGE, "-u expects a number"); } /* Modified: head/usr.sbin/pw/tests/pw_delete.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_delete.sh Tue Oct 28 15:33:15 2014 (r273786) +++ head/usr.sbin/pw/tests/pw_delete.sh Tue Oct 28 15:46:22 2014 (r273787) @@ -30,7 +30,18 @@ group_do_not_delete_wheel_if_group_unkow atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x pw -V ${HOME} groupshow wheel } +atf_test_case user_do_not_try_to_delete_root_if_user_unkown +user_do_not_try_to_delete_root_if_user_unkown_head() { + atf_set "descr" "Make sure not to try to remove root if deleteing an unknown user" +} + +user_do_not_try_to_delete_root_if_user_unkown_body() { + populate_etc_skel + atf_check -e inline:"pw: -u expects a number\n" -s exit:64 -x pw -V ${HOME} userdel -u plop +} + atf_init_test_cases() { atf_add_test_case rmuser_seperate_group atf_add_test_case group_do_not_delete_wheel_if_group_unkown + atf_add_test_case user_do_not_try_to_delete_root_if_user_unkown } From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 15:52:22 2014 Return-Path: Delivered-To: svn-src-all@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 D94B0C88 for ; Tue, 28 Oct 2014 15:52:22 +0000 (UTC) Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [IPv6:2a00:1450:400c:c05::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69F0CE67 for ; Tue, 28 Oct 2014 15:52:22 +0000 (UTC) Received: by mail-wi0-f171.google.com with SMTP id hi2so6192971wib.10 for ; Tue, 28 Oct 2014 08:52:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=JfTA3z2ZvViz0R1JSAE+BW430nAn5YTnAPSpK/+GvPo=; b=lOhHXCZZV4JJIKlplj/bxzRr8Wutn9S4TI4s5D6PgOnuXagz+auE3dJZzLl30+Trkz UAcnAhjTXqz09MTbRX2gVhTsfM4ZJioO5D1cp3pNsI83KQHF3wuHhB+dNZw7YgkJwGSP koLkUxKgN4TxTAI+wkgpgHcJe/Tf7RssbscFyCNM16CvDjIxIjunF6x8UGdHfgakAac+ cXkfuVVk8j4vymOL5Xr9FF5z+Iv5PsTIcPIcZRgJLMkoe23XVG5ps4WUQBL0xojweHUG simIEHUZrxMVEy4aX+I6MJqaqCMeYvgLvk9ewTWXJGbq6A58W6irETHfYQ65LjpQsTXg CAJw== X-Received: by 10.194.122.231 with SMTP id lv7mr5459148wjb.27.1414511540637; Tue, 28 Oct 2014 08:52:20 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id h8sm2246288wjs.43.2014.10.28.08.52.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Oct 2014 08:52:19 -0700 (PDT) Sender: Baptiste Daroussin Date: Tue, 28 Oct 2014 16:52:17 +0100 From: "bapt@FreeBSD.org >> Baptiste Daroussin" To: Adam McDougall Subject: Re: svn commit: r273782 - in head/usr.sbin/pw: . tests Message-ID: <20141028155217.GD26796@ivaldir.etoilebsd.net> References: <201410281454.s9SEs5kb098825@svn.freebsd.org> <544FB7DA.8010502@egr.msu.edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0/kgSOzhNoDC5T3a" Content-Disposition: inline In-Reply-To: <544FB7DA.8010502@egr.msu.edu> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 15:52:22 -0000 --0/kgSOzhNoDC5T3a Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 28, 2014 at 11:35:54AM -0400, Adam McDougall wrote: > On 10/28/2014 10:54, Baptiste Daroussin wrote: > > Author: bapt > > Date: Tue Oct 28 14:54:04 2014 > > New Revision: 273782 > > URL: https://svnweb.freebsd.org/changeset/base/273782 > >=20 > > Log: > > Do not delete the group wheel when bad argument is passed to pw group= del -g > > =20 > > Check that the -g argument is actually a number, if not report an err= or. > > This argument is converted without checking with atoi(3) later so wit= hout this > > check it converts any alpha entries into 0 meaning it deletes the gro= up wheel > > =20 > > Add a regression test about it > > =20 > > PR: 90114 > > Reported by: bkoenig@cs.tu-berlin.de > > MFC after: 1 week > >=20 > > Modified: > > head/usr.sbin/pw/pw_group.c > > head/usr.sbin/pw/tests/pw_delete.sh >=20 > Would you mind looking at this related pw bug with patch? Thanks. >=20 > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D187189 I will yes regards, Bapt --0/kgSOzhNoDC5T3a Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlRPu7EACgkQ8kTtMUmk6EyTiwCeP9HMyETRBNJS8mgZ2hmFWnin 6zAAnRbBjiBnhBBnYHOmjPA/Vt+/qmN2 =tB46 -----END PGP SIGNATURE----- --0/kgSOzhNoDC5T3a-- From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 16:19:03 2014 Return-Path: Delivered-To: svn-src-all@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 8ADB3142; Tue, 28 Oct 2014 16:19: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 77E0A16D; Tue, 28 Oct 2014 16:19: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 s9SGJ3MV037354; Tue, 28 Oct 2014 16:19:03 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SGJ3su037353; Tue, 28 Oct 2014 16:19:03 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201410281619.s9SGJ3su037353@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 28 Oct 2014 16:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273788 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 16:19:03 -0000 Author: jkim Date: Tue Oct 28 16:19:02 2014 New Revision: 273788 URL: https://svnweb.freebsd.org/changeset/base/273788 Log: Actually install casuword(9) to fix build. Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Oct 28 15:46:22 2014 (r273787) +++ head/share/man/man9/Makefile Tue Oct 28 16:19:02 2014 (r273788) @@ -46,6 +46,7 @@ MAN= accept_filter.9 \ BUS_SETUP_INTR.9 \ bus_space.9 \ byteorder.9 \ + casuword.9 \ cd.9 \ condvar.9 \ config_intrhook.9 \ From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 16:24:09 2014 Return-Path: Delivered-To: svn-src-all@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 814E062B; Tue, 28 Oct 2014 16:24: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 6C3D0240; Tue, 28 Oct 2014 16:24: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 s9SGO9be041423; Tue, 28 Oct 2014 16:24:09 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SGO8tI041418; Tue, 28 Oct 2014 16:24:08 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201410281624.s9SGO8tI041418@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 28 Oct 2014 16:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r273789 - vendor/NetBSD/mtree/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 16:24:09 -0000 Author: brooks Date: Tue Oct 28 16:24:07 2014 New Revision: 273789 URL: https://svnweb.freebsd.org/changeset/base/273789 Log: Vendor import of NetBSD's mtree(8) at 2014-10-28 Modified: vendor/NetBSD/mtree/dist/create.c vendor/NetBSD/mtree/dist/extern.h vendor/NetBSD/mtree/dist/getid.c vendor/NetBSD/mtree/dist/mtree.c vendor/NetBSD/mtree/dist/spec.c Modified: vendor/NetBSD/mtree/dist/create.c ============================================================================== --- vendor/NetBSD/mtree/dist/create.c Tue Oct 28 16:19:02 2014 (r273788) +++ vendor/NetBSD/mtree/dist/create.c Tue Oct 28 16:24:07 2014 (r273789) @@ -1,4 +1,4 @@ -/* $NetBSD: create.c,v 1.72 2013/10/17 17:22:59 christos Exp $ */ +/* $NetBSD: create.c,v 1.73 2014/04/24 17:22:41 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)create.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: create.c,v 1.72 2013/10/17 17:22:59 christos Exp $"); +__RCSID("$NetBSD: create.c,v 1.73 2014/04/24 17:22:41 christos Exp $"); #endif #endif /* not lint */ @@ -91,13 +91,14 @@ static u_long flags; #endif static int dcmp(const FTSENT *FTS_CONST *, const FTSENT *FTS_CONST *); -static void output(int, int *, const char *, ...) - __attribute__((__format__(__printf__, 3, 4))); -static int statd(FTS *, FTSENT *, uid_t *, gid_t *, mode_t *, u_long *); -static void statf(int, FTSENT *); +static void output(FILE *, int, int *, const char *, ...) + __printflike(4, 5); +static int statd(FILE *, FTS *, FTSENT *, uid_t *, gid_t *, mode_t *, + u_long *); +static void statf(FILE *, int, FTSENT *); void -cwalk(void) +cwalk(FILE *fp) { FTS *t; FTSENT *p; @@ -121,7 +122,7 @@ cwalk(void) } if (!nflag) - printf( + fprintf(fp, "#\t user: %s\n#\tmachine: %s\n#\t tree: %s\n" "#\t date: %s", user, host, fullpath, ctime(&clocktime)); @@ -142,21 +143,21 @@ cwalk(void) switch(p->fts_info) { case FTS_D: if (!bflag) - printf("\n"); + fprintf(fp, "\n"); if (!nflag) - printf("# %s\n", p->fts_path); - statd(t, p, &uid, &gid, &mode, &flags); - statf(indent, p); + fprintf(fp, "# %s\n", p->fts_path); + statd(fp, t, p, &uid, &gid, &mode, &flags); + statf(fp, indent, p); break; case FTS_DP: if (p->fts_level > 0) if (!nflag) - printf("%*s# %s\n", indent, "", + fprintf(fp, "%*s# %s\n", indent, "", p->fts_path); if (p->fts_level > 0 || flavor == F_FREEBSD9) { - printf("%*s..\n", indent, ""); + fprintf(fp, "%*s..\n", indent, ""); if (!bflag) - printf("\n"); + fprintf(fp, "\n"); } break; case FTS_DNR: @@ -167,7 +168,7 @@ cwalk(void) break; default: if (!dflag) - statf(indent, p); + statf(fp, indent, p); break; } @@ -178,7 +179,7 @@ cwalk(void) } static void -statf(int indent, FTSENT *p) +statf(FILE *fp, int indent, FTSENT *p) { u_int32_t len, val; int fd, offset; @@ -187,51 +188,54 @@ statf(int indent, FTSENT *p) char *digestbuf; #endif - offset = printf("%*s%s%s", indent, "", + offset = fprintf(fp, "%*s%s%s", indent, "", S_ISDIR(p->fts_statp->st_mode) ? "" : " ", vispath(p->fts_name)); if (offset > (INDENTNAMELEN + indent)) offset = MAXLINELEN; else - offset += printf("%*s", (INDENTNAMELEN + indent) - offset, ""); + offset += fprintf(fp, "%*s", + (INDENTNAMELEN + indent) - offset, ""); if (!S_ISREG(p->fts_statp->st_mode) && (flavor == F_NETBSD6 || !dflag)) - output(indent, &offset, "type=%s", + output(fp, indent, &offset, "type=%s", inotype(p->fts_statp->st_mode)); if (keys & (F_UID | F_UNAME) && p->fts_statp->st_uid != uid) { if (keys & F_UNAME && (name = user_from_uid(p->fts_statp->st_uid, 1)) != NULL) - output(indent, &offset, "uname=%s", name); + output(fp, indent, &offset, "uname=%s", name); if (keys & F_UID || (keys & F_UNAME && name == NULL)) - output(indent, &offset, "uid=%u", p->fts_statp->st_uid); + output(fp, indent, &offset, "uid=%u", + p->fts_statp->st_uid); } if (keys & (F_GID | F_GNAME) && p->fts_statp->st_gid != gid) { if (keys & F_GNAME && (name = group_from_gid(p->fts_statp->st_gid, 1)) != NULL) - output(indent, &offset, "gname=%s", name); + output(fp, indent, &offset, "gname=%s", name); if (keys & F_GID || (keys & F_GNAME && name == NULL)) - output(indent, &offset, "gid=%u", p->fts_statp->st_gid); + output(fp, indent, &offset, "gid=%u", + p->fts_statp->st_gid); } if (keys & F_MODE && (p->fts_statp->st_mode & MBITS) != mode) - output(indent, &offset, "mode=%#o", + output(fp, indent, &offset, "mode=%#o", p->fts_statp->st_mode & MBITS); if (keys & F_DEV && (S_ISBLK(p->fts_statp->st_mode) || S_ISCHR(p->fts_statp->st_mode))) - output(indent, &offset, "device=%#jx", + output(fp, indent, &offset, "device=%#jx", (uintmax_t)p->fts_statp->st_rdev); if (keys & F_NLINK && p->fts_statp->st_nlink != 1) - output(indent, &offset, "nlink=%u", p->fts_statp->st_nlink); + output(fp, indent, &offset, "nlink=%u", p->fts_statp->st_nlink); if (keys & F_SIZE && (flavor == F_FREEBSD9 || S_ISREG(p->fts_statp->st_mode))) - output(indent, &offset, "size=%ju", + output(fp, indent, &offset, "size=%ju", (uintmax_t)p->fts_statp->st_size); if (keys & F_TIME) #if defined(BSD4_4) && !defined(HAVE_NBTOOL_CONFIG_H) - output(indent, &offset, "time=%jd.%09ld", + output(fp, indent, &offset, "time=%jd.%09ld", (intmax_t)p->fts_statp->st_mtimespec.tv_sec, p->fts_statp->st_mtimespec.tv_nsec); #else - output(indent, &offset, "time=%jd.%09ld", + output(fp, indent, &offset, "time=%jd.%09ld", (intmax_t)p->fts_statp->st_mtime, (long)0); #endif if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) { @@ -239,14 +243,14 @@ statf(int indent, FTSENT *p) crc(fd, &val, &len)) mtree_err("%s: %s", p->fts_accpath, strerror(errno)); close(fd); - output(indent, &offset, "cksum=%lu", (long)val); + output(fp, indent, &offset, "cksum=%lu", (long)val); } #ifndef NO_MD5 if (keys & F_MD5 && S_ISREG(p->fts_statp->st_mode)) { if ((digestbuf = MD5File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: MD5File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", MD5KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", MD5KEY, digestbuf); free(digestbuf); } #endif /* ! NO_MD5 */ @@ -255,7 +259,7 @@ statf(int indent, FTSENT *p) if ((digestbuf = RMD160File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: RMD160File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", RMD160KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", RMD160KEY, digestbuf); free(digestbuf); } #endif /* ! NO_RMD160 */ @@ -264,7 +268,7 @@ statf(int indent, FTSENT *p) if ((digestbuf = SHA1File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: SHA1File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", SHA1KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", SHA1KEY, digestbuf); free(digestbuf); } #endif /* ! NO_SHA1 */ @@ -273,7 +277,7 @@ statf(int indent, FTSENT *p) if ((digestbuf = SHA256_File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: SHA256_File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", SHA256KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", SHA256KEY, digestbuf); free(digestbuf); } #ifdef SHA384_BLOCK_LENGTH @@ -281,7 +285,7 @@ statf(int indent, FTSENT *p) if ((digestbuf = SHA384_File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: SHA384_File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", SHA384KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", SHA384KEY, digestbuf); free(digestbuf); } #endif @@ -289,18 +293,18 @@ statf(int indent, FTSENT *p) if ((digestbuf = SHA512_File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: SHA512_File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", SHA512KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", SHA512KEY, digestbuf); free(digestbuf); } #endif /* ! NO_SHA2 */ if (keys & F_SLINK && (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) - output(indent, &offset, "link=%s", + output(fp, indent, &offset, "link=%s", vispath(rlink(p->fts_accpath))); #if HAVE_STRUCT_STAT_ST_FLAGS if (keys & F_FLAGS && p->fts_statp->st_flags != flags) { char *str = flags_to_string(p->fts_statp->st_flags, "none"); - output(indent, &offset, "flags=%s", str); + output(fp, indent, &offset, "flags=%s", str); free(str); } #endif @@ -324,8 +328,8 @@ statf(int indent, FTSENT *p) #define MTREE_MAXS 16 static int -statd(FTS *t, FTSENT *parent, uid_t *puid, gid_t *pgid, mode_t *pmode, - u_long *pflags) +statd(FILE *fp, FTS *t, FTSENT *parent, uid_t *puid, gid_t *pgid, mode_t *pmode, + u_long *pflags) { FTSENT *p; gid_t sgid; @@ -398,33 +402,33 @@ statd(FTS *t, FTSENT *parent, uid_t *pui first) { first = 0; if (flavor != F_NETBSD6 && dflag) - printf("/set type=dir"); + fprintf(fp, "/set type=dir"); else - printf("/set type=file"); + fprintf(fp, "/set type=file"); if (keys & (F_UID | F_UNAME)) { if (keys & F_UNAME && (name = user_from_uid(saveuid, 1)) != NULL) - printf(" uname=%s", name); + fprintf(fp, " uname=%s", name); if (keys & F_UID || (keys & F_UNAME && name == NULL)) - printf(" uid=%lu", (u_long)saveuid); + fprintf(fp, " uid=%lu", (u_long)saveuid); } if (keys & (F_GID | F_GNAME)) { if (keys & F_GNAME && (name = group_from_gid(savegid, 1)) != NULL) - printf(" gname=%s", name); + fprintf(fp, " gname=%s", name); if (keys & F_GID || (keys & F_GNAME && name == NULL)) - printf(" gid=%lu", (u_long)savegid); + fprintf(fp, " gid=%lu", (u_long)savegid); } if (keys & F_MODE) - printf(" mode=%#lo", (u_long)savemode); + fprintf(fp, " mode=%#lo", (u_long)savemode); if (keys & F_NLINK) - printf(" nlink=1"); + fprintf(fp, " nlink=1"); if (keys & F_FLAGS) { char *str = flags_to_string(saveflags, "none"); - printf(" flags=%s", str); + fprintf(fp, " flags=%s", str); free(str); } - printf("\n"); + fprintf(fp, "\n"); *puid = saveuid; *pgid = savegid; *pmode = savemode; @@ -455,7 +459,7 @@ dcmp(const FTSENT *FTS_CONST *a, const F } void -output(int indent, int *offset, const char *fmt, ...) +output(FILE *fp, int indent, int *offset, const char *fmt, ...) { va_list ap; char buf[1024]; @@ -465,8 +469,8 @@ output(int indent, int *offset, const ch va_end(ap); if (*offset + strlen(buf) > MAXLINELEN - 3) { - printf(" \\\n%*s", INDENTNAMELEN + indent, ""); + fprintf(fp, " \\\n%*s", INDENTNAMELEN + indent, ""); *offset = INDENTNAMELEN + indent; } - *offset += printf(" %s", buf) + 1; + *offset += fprintf(fp, " %s", buf) + 1; } Modified: vendor/NetBSD/mtree/dist/extern.h ============================================================================== --- vendor/NetBSD/mtree/dist/extern.h Tue Oct 28 16:19:02 2014 (r273788) +++ vendor/NetBSD/mtree/dist/extern.h Tue Oct 28 16:24:07 2014 (r273789) @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.38 2013/02/03 19:15:17 christos Exp $ */ +/* $NetBSD: extern.h,v 1.39 2014/04/24 17:22:41 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -63,8 +63,8 @@ void addtag(slist_t *, char *); int check_excludes(const char *, const char *); int compare(NODE *, FTSENT *); int crc(int, u_int32_t *, u_int32_t *); -void cwalk(void); -void dump_nodes(const char *, NODE *, int); +void cwalk(FILE *); +void dump_nodes(FILE *, const char *, NODE *, int); void init_excludes(void); int matchtags(NODE *); __dead __printflike(1,2) void mtree_err(const char *, ...); Modified: vendor/NetBSD/mtree/dist/getid.c ============================================================================== --- vendor/NetBSD/mtree/dist/getid.c Tue Oct 28 16:19:02 2014 (r273788) +++ vendor/NetBSD/mtree/dist/getid.c Tue Oct 28 16:24:07 2014 (r273789) @@ -1,4 +1,4 @@ -/* $NetBSD: getid.c,v 1.8 2013/10/16 17:27:42 christos Exp $ */ +/* $NetBSD: getid.c,v 1.10 2014/10/27 21:46:45 christos Exp $ */ /* from: NetBSD: getpwent.c,v 1.48 2000/10/03 03:22:26 enami Exp */ /* from: NetBSD: getgrent.c,v 1.41 2002/01/12 23:51:30 lukem Exp */ @@ -65,7 +65,7 @@ #endif #include -__RCSID("$NetBSD: getid.c,v 1.8 2013/10/16 17:27:42 christos Exp $"); +__RCSID("$NetBSD: getid.c,v 1.10 2014/10/27 21:46:45 christos Exp $"); #include @@ -206,7 +206,12 @@ grstart(void) } if (grfile[0] == '\0') /* sanity check */ return 0; - return (_gr_fp = fopen(grfile, "r")) ? 1 : 0; + + _gr_fp = fopen(grfile, "r"); + if (_gr_fp != NULL) + return 1; + warn("Can't open `%s'", grfile); + return 0; } @@ -231,7 +236,7 @@ grscan(int search, gid_t gid, const char continue; } /* skip comments */ - if (pwline[0] == '#') + if (grline[0] == '#') continue; if (grmatchline(search, gid, name)) return 1; @@ -350,7 +355,11 @@ pwstart(void) } if (pwfile[0] == '\0') /* sanity check */ return 0; - return (_pw_fp = fopen(pwfile, "r")) ? 1 : 0; + _pw_fp = fopen(pwfile, "r"); + if (_pw_fp != NULL) + return 1; + warn("Can't open `%s'", pwfile); + return 0; } Modified: vendor/NetBSD/mtree/dist/mtree.c ============================================================================== --- vendor/NetBSD/mtree/dist/mtree.c Tue Oct 28 16:19:02 2014 (r273788) +++ vendor/NetBSD/mtree/dist/mtree.c Tue Oct 28 16:24:07 2014 (r273789) @@ -1,4 +1,4 @@ -/* $NetBSD: mtree.c,v 1.48 2013/04/08 17:39:11 christos Exp $ */ +/* $NetBSD: mtree.c,v 1.49 2014/04/24 17:22:41 christos Exp $ */ /*- * Copyright (c) 1989, 1990, 1993 @@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19 #if 0 static char sccsid[] = "@(#)mtree.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: mtree.c,v 1.48 2013/04/08 17:39:11 christos Exp $"); +__RCSID("$NetBSD: mtree.c,v 1.49 2014/04/24 17:22:41 christos Exp $"); #endif #endif /* not lint */ @@ -296,11 +296,11 @@ main(int argc, char **argv) mtree_err("-l and -u flags are mutually exclusive"); if (cflag) { - cwalk(); + cwalk(stdout); exit(0); } if (Cflag || Dflag) { - dump_nodes("", spec(spec1), Dflag); + dump_nodes(stdout, "", spec(spec1), Dflag); exit(0); } if (spec2 != NULL) Modified: vendor/NetBSD/mtree/dist/spec.c ============================================================================== --- vendor/NetBSD/mtree/dist/spec.c Tue Oct 28 16:19:02 2014 (r273788) +++ vendor/NetBSD/mtree/dist/spec.c Tue Oct 28 16:24:07 2014 (r273789) @@ -1,4 +1,4 @@ -/* $NetBSD: spec.c,v 1.88 2013/10/17 17:22:59 christos Exp $ */ +/* $NetBSD: spec.c,v 1.89 2014/04/24 17:22:41 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -67,7 +67,7 @@ #if 0 static char sccsid[] = "@(#)spec.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: spec.c,v 1.88 2013/10/17 17:22:59 christos Exp $"); +__RCSID("$NetBSD: spec.c,v 1.89 2014/04/24 17:22:41 christos Exp $"); #endif #endif /* not lint */ @@ -102,7 +102,7 @@ static void set(char *, NODE *); static void unset(char *, NODE *); static void addchild(NODE *, NODE *); static int nodecmp(const NODE *, const NODE *); -static int appendfield(int, const char *, ...) __printflike(2, 3); +static int appendfield(FILE *, int, const char *, ...) __printflike(3, 4); #define REPLACEPTR(x,v) do { if ((x)) free((x)); (x) = (v); } while (0) @@ -290,21 +290,21 @@ free_nodes(NODE *root) /* * appendfield -- - * Like printf(), but output a space either before or after + * Like fprintf(), but output a space either before or after * the regular output, according to the pathlast flag. */ static int -appendfield(int pathlast, const char *fmt, ...) +appendfield(FILE *fp, int pathlast, const char *fmt, ...) { va_list ap; int result; va_start(ap, fmt); if (!pathlast) - printf(" "); + fprintf(fp, " "); result = vprintf(fmt, ap); if (pathlast) - printf(" "); + fprintf(fp, " "); va_end(ap); return result; } @@ -316,7 +316,7 @@ appendfield(int pathlast, const char *fm * it first. */ void -dump_nodes(const char *dir, NODE *root, int pathlast) +dump_nodes(FILE *fp, const char *dir, NODE *root, int pathlast) { NODE *cur; char path[MAXPATHLEN]; @@ -334,70 +334,75 @@ dump_nodes(const char *dir, NODE *root, mtree_err("Pathname too long."); if (!pathlast) - printf("%s", vispath(path)); + fprintf(fp, "%s", vispath(path)); #define MATCHFLAG(f) ((keys & (f)) && (cur->flags & (f))) if (MATCHFLAG(F_TYPE)) - appendfield(pathlast, "type=%s", nodetype(cur->type)); + appendfield(fp, pathlast, "type=%s", + nodetype(cur->type)); if (MATCHFLAG(F_UID | F_UNAME)) { if (keys & F_UNAME && (name = user_from_uid(cur->st_uid, 1)) != NULL) - appendfield(pathlast, "uname=%s", name); + appendfield(fp, pathlast, "uname=%s", name); else - appendfield(pathlast, "uid=%u", cur->st_uid); + appendfield(fp, pathlast, "uid=%u", + cur->st_uid); } if (MATCHFLAG(F_GID | F_GNAME)) { if (keys & F_GNAME && (name = group_from_gid(cur->st_gid, 1)) != NULL) - appendfield(pathlast, "gname=%s", name); + appendfield(fp, pathlast, "gname=%s", name); else - appendfield(pathlast, "gid=%u", cur->st_gid); + appendfield(fp, pathlast, "gid=%u", + cur->st_gid); } if (MATCHFLAG(F_MODE)) - appendfield(pathlast, "mode=%#o", cur->st_mode); + appendfield(fp, pathlast, "mode=%#o", cur->st_mode); if (MATCHFLAG(F_DEV) && (cur->type == F_BLOCK || cur->type == F_CHAR)) - appendfield(pathlast, "device=%#jx", + appendfield(fp, pathlast, "device=%#jx", (uintmax_t)cur->st_rdev); if (MATCHFLAG(F_NLINK)) - appendfield(pathlast, "nlink=%d", cur->st_nlink); + appendfield(fp, pathlast, "nlink=%d", cur->st_nlink); if (MATCHFLAG(F_SLINK)) - appendfield(pathlast, "link=%s", vispath(cur->slink)); + appendfield(fp, pathlast, "link=%s", + vispath(cur->slink)); if (MATCHFLAG(F_SIZE)) - appendfield(pathlast, "size=%ju", + appendfield(fp, pathlast, "size=%ju", (uintmax_t)cur->st_size); if (MATCHFLAG(F_TIME)) - appendfield(pathlast, "time=%jd.%09ld", + appendfield(fp, pathlast, "time=%jd.%09ld", (intmax_t)cur->st_mtimespec.tv_sec, cur->st_mtimespec.tv_nsec); if (MATCHFLAG(F_CKSUM)) - appendfield(pathlast, "cksum=%lu", cur->cksum); + appendfield(fp, pathlast, "cksum=%lu", cur->cksum); if (MATCHFLAG(F_MD5)) - appendfield(pathlast, "%s=%s", MD5KEY, cur->md5digest); + appendfield(fp, pathlast, "%s=%s", MD5KEY, + cur->md5digest); if (MATCHFLAG(F_RMD160)) - appendfield(pathlast, "%s=%s", RMD160KEY, + appendfield(fp, pathlast, "%s=%s", RMD160KEY, cur->rmd160digest); if (MATCHFLAG(F_SHA1)) - appendfield(pathlast, "%s=%s", SHA1KEY, + appendfield(fp, pathlast, "%s=%s", SHA1KEY, cur->sha1digest); if (MATCHFLAG(F_SHA256)) - appendfield(pathlast, "%s=%s", SHA256KEY, + appendfield(fp, pathlast, "%s=%s", SHA256KEY, cur->sha256digest); if (MATCHFLAG(F_SHA384)) - appendfield(pathlast, "%s=%s", SHA384KEY, + appendfield(fp, pathlast, "%s=%s", SHA384KEY, cur->sha384digest); if (MATCHFLAG(F_SHA512)) - appendfield(pathlast, "%s=%s", SHA512KEY, + appendfield(fp, pathlast, "%s=%s", SHA512KEY, cur->sha512digest); if (MATCHFLAG(F_FLAGS)) { str = flags_to_string(cur->st_flags, "none"); - appendfield(pathlast, "flags=%s", str); + appendfield(fp, pathlast, "flags=%s", str); free(str); } if (MATCHFLAG(F_IGN)) - appendfield(pathlast, "ignore"); + appendfield(fp, pathlast, "ignore"); if (MATCHFLAG(F_OPT)) - appendfield(pathlast, "optional"); + appendfield(fp, pathlast, "optional"); if (MATCHFLAG(F_TAGS)) { /* don't output leading or trailing commas */ p = cur->tags; @@ -406,12 +411,12 @@ dump_nodes(const char *dir, NODE *root, q = p + strlen(p); while(q > p && q[-1] == ',') q--; - appendfield(pathlast, "tags=%.*s", (int)(q - p), p); + appendfield(fp, pathlast, "tags=%.*s", (int)(q - p), p); } puts(pathlast ? vispath(path) : ""); if (cur->child) - dump_nodes(path, cur->child, pathlast); + dump_nodes(fp, path, cur->child, pathlast); } } From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 16:24:45 2014 Return-Path: Delivered-To: svn-src-all@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 31A3F752; Tue, 28 Oct 2014 16:24: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 040E324B; Tue, 28 Oct 2014 16:24: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 s9SGOiNs041535; Tue, 28 Oct 2014 16:24:44 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SGOivx041534; Tue, 28 Oct 2014 16:24:44 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201410281624.s9SGOivx041534@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 28 Oct 2014 16:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r273790 - vendor/NetBSD/mtree/20141028 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 16:24:45 -0000 Author: brooks Date: Tue Oct 28 16:24:44 2014 New Revision: 273790 URL: https://svnweb.freebsd.org/changeset/base/273790 Log: Tag 2014-10-28 import of NetBSD's mtree(8) Added: vendor/NetBSD/mtree/20141028/ - copied from r273789, vendor/NetBSD/mtree/dist/ From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 16:27:30 2014 Return-Path: Delivered-To: svn-src-all@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 6B088942; Tue, 28 Oct 2014 16:27: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 3D91E271; Tue, 28 Oct 2014 16:27: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 s9SGRUk2041921; Tue, 28 Oct 2014 16:27:30 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SGRT7S041916; Tue, 28 Oct 2014 16:27:29 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201410281627.s9SGRT7S041916@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 28 Oct 2014 16:27:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273791 - in head: lib/libutil usr.sbin/pw/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 16:27:30 -0000 Author: bapt Date: Tue Oct 28 16:27:29 2014 New Revision: 273791 URL: https://svnweb.freebsd.org/changeset/base/273791 Log: Fix renaming a group via the gr_copy function Add a regression test to pw(8) because the bug was discovered via using: pw groupmod PR: 187189 Reported by: mcdouga9@egr.msu.edu Tested by: mcdouga9@egr.msu.edu Patch by: Marc de la Gueronniere Modified: head/lib/libutil/gr_util.c head/usr.sbin/pw/tests/pw_modify.sh Modified: head/lib/libutil/gr_util.c ============================================================================== --- head/lib/libutil/gr_util.c Tue Oct 28 16:24:44 2014 (r273790) +++ head/lib/libutil/gr_util.c Tue Oct 28 16:27:29 2014 (r273791) @@ -170,14 +170,21 @@ gr_copy(int ffd, int tfd, const struct g size_t len; int eof, readlen; - sgr = gr; + if (old_gr == NULL && gr == NULL) + return(-1); + + sgr = old_gr; + /* deleting a group */ if (gr == NULL) { line = NULL; - if (old_gr == NULL) + } else { + if ((line = gr_make(gr)) == NULL) return (-1); - sgr = old_gr; - } else if ((line = gr_make(gr)) == NULL) - return (-1); + } + + /* adding a group */ + if (sgr == NULL) + sgr = gr; eof = 0; len = 0; Modified: head/usr.sbin/pw/tests/pw_modify.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_modify.sh Tue Oct 28 16:24:44 2014 (r273790) +++ head/usr.sbin/pw/tests/pw_modify.sh Tue Oct 28 16:27:29 2014 (r273791) @@ -58,9 +58,23 @@ usermod_bug_185666_body() { atf_check -o inline:"testgroup2:*:1003:testuser\n" -x pw -V ${HOME} groupshow testgroup2 } +atf_test_case do_not_duplicate_group_on_gid_change +do_not_duplicate_group_on_gid_change_head() { + atf_set "descr" "Do not duplicate group on gid change" +} + +do_not_duplicate_group_on_gid_change_body() { + populate_etc_skel + atf_check -s exit:0 -x pw -V ${HOME} groupadd testgroup + atf_check -s exit:0 -x pw -V ${HOME} groupmod testgroup -g 12345 + # use grep to see if the entry has not be duplicated + atf_check -o inline:"testgroup:*:12345:\n" -s exit:0 -x grep "^testgroup" ${HOME}/group +} + atf_init_test_cases() { atf_add_test_case groupmod_user atf_add_test_case groupmod_invalid_user atf_add_test_case groupmod_bug_193704 atf_add_test_case usermod_bug_185666 + atf_add_test_case do_not_duplicate_group_on_gid_change } From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 17:11:51 2014 Return-Path: Delivered-To: svn-src-all@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 C744C7A7; Tue, 28 Oct 2014 17:11: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 B33E6A2F; Tue, 28 Oct 2014 17:11: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 s9SHBp2o064591; Tue, 28 Oct 2014 17:11:51 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SHBpmu064590; Tue, 28 Oct 2014 17:11:51 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410281711.s9SHBpmu064590@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 28 Oct 2014 17:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273793 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 17:11:51 -0000 Author: trasz Date: Tue Oct 28 17:11:51 2014 New Revision: 273793 URL: https://svnweb.freebsd.org/changeset/base/273793 Log: Document iSNS defaults. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctl.conf.5 Modified: head/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- head/usr.sbin/ctld/ctl.conf.5 Tue Oct 28 17:08:13 2014 (r273792) +++ head/usr.sbin/ctld/ctl.conf.5 Tue Oct 28 17:11:51 2014 (r273793) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 23, 2014 +.Dd October 28, 2014 .Dt CTL.CONF 5 .Os .Sh NAME @@ -111,8 +111,10 @@ An IPv4 or IPv6 address and optionally p .It Ic isns-period Ar seconds iSNS registration period. Registered Network Entity not updated during this period will be unregistered. +The default is 900. .It Ic isns-timeout Ar seconds Timeout for iSNS requests. +The default is 5. .El .Ss auth-group Context .Bl -tag -width indent From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 17:52:27 2014 Return-Path: Delivered-To: svn-src-all@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 D3AE74F3; Tue, 28 Oct 2014 17:52: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 BC465E4B; Tue, 28 Oct 2014 17:52: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 s9SHqRJn083206; Tue, 28 Oct 2014 17:52:27 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SHqQZf083200; Tue, 28 Oct 2014 17:52:26 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201410281752.s9SHqQZf083200@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 28 Oct 2014 17:52:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273796 - head/contrib/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 17:52:27 -0000 Author: brooks Date: Tue Oct 28 17:52:26 2014 New Revision: 273796 URL: https://svnweb.freebsd.org/changeset/base/273796 Log: Import in latest mtree from NetBSD to fix a bug in parsing group files that jmg fixed upstream. MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/contrib/mtree/create.c head/contrib/mtree/extern.h head/contrib/mtree/getid.c head/contrib/mtree/mtree.c head/contrib/mtree/spec.c Directory Properties: head/contrib/mtree/ (props changed) Modified: head/contrib/mtree/create.c ============================================================================== --- head/contrib/mtree/create.c Tue Oct 28 17:32:49 2014 (r273795) +++ head/contrib/mtree/create.c Tue Oct 28 17:52:26 2014 (r273796) @@ -1,4 +1,4 @@ -/* $NetBSD: create.c,v 1.72 2013/10/17 17:22:59 christos Exp $ */ +/* $NetBSD: create.c,v 1.73 2014/04/24 17:22:41 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)create.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: create.c,v 1.72 2013/10/17 17:22:59 christos Exp $"); +__RCSID("$NetBSD: create.c,v 1.73 2014/04/24 17:22:41 christos Exp $"); #endif #endif /* not lint */ @@ -91,13 +91,14 @@ static u_long flags; #endif static int dcmp(const FTSENT *FTS_CONST *, const FTSENT *FTS_CONST *); -static void output(int, int *, const char *, ...) - __attribute__((__format__(__printf__, 3, 4))); -static int statd(FTS *, FTSENT *, uid_t *, gid_t *, mode_t *, u_long *); -static void statf(int, FTSENT *); +static void output(FILE *, int, int *, const char *, ...) + __printflike(4, 5); +static int statd(FILE *, FTS *, FTSENT *, uid_t *, gid_t *, mode_t *, + u_long *); +static void statf(FILE *, int, FTSENT *); void -cwalk(void) +cwalk(FILE *fp) { FTS *t; FTSENT *p; @@ -121,7 +122,7 @@ cwalk(void) } if (!nflag) - printf( + fprintf(fp, "#\t user: %s\n#\tmachine: %s\n#\t tree: %s\n" "#\t date: %s", user, host, fullpath, ctime(&clocktime)); @@ -142,21 +143,21 @@ cwalk(void) switch(p->fts_info) { case FTS_D: if (!bflag) - printf("\n"); + fprintf(fp, "\n"); if (!nflag) - printf("# %s\n", p->fts_path); - statd(t, p, &uid, &gid, &mode, &flags); - statf(indent, p); + fprintf(fp, "# %s\n", p->fts_path); + statd(fp, t, p, &uid, &gid, &mode, &flags); + statf(fp, indent, p); break; case FTS_DP: if (p->fts_level > 0) if (!nflag) - printf("%*s# %s\n", indent, "", + fprintf(fp, "%*s# %s\n", indent, "", p->fts_path); if (p->fts_level > 0 || flavor == F_FREEBSD9) { - printf("%*s..\n", indent, ""); + fprintf(fp, "%*s..\n", indent, ""); if (!bflag) - printf("\n"); + fprintf(fp, "\n"); } break; case FTS_DNR: @@ -167,7 +168,7 @@ cwalk(void) break; default: if (!dflag) - statf(indent, p); + statf(fp, indent, p); break; } @@ -178,7 +179,7 @@ cwalk(void) } static void -statf(int indent, FTSENT *p) +statf(FILE *fp, int indent, FTSENT *p) { u_int32_t len, val; int fd, offset; @@ -187,51 +188,54 @@ statf(int indent, FTSENT *p) char *digestbuf; #endif - offset = printf("%*s%s%s", indent, "", + offset = fprintf(fp, "%*s%s%s", indent, "", S_ISDIR(p->fts_statp->st_mode) ? "" : " ", vispath(p->fts_name)); if (offset > (INDENTNAMELEN + indent)) offset = MAXLINELEN; else - offset += printf("%*s", (INDENTNAMELEN + indent) - offset, ""); + offset += fprintf(fp, "%*s", + (INDENTNAMELEN + indent) - offset, ""); if (!S_ISREG(p->fts_statp->st_mode) && (flavor == F_NETBSD6 || !dflag)) - output(indent, &offset, "type=%s", + output(fp, indent, &offset, "type=%s", inotype(p->fts_statp->st_mode)); if (keys & (F_UID | F_UNAME) && p->fts_statp->st_uid != uid) { if (keys & F_UNAME && (name = user_from_uid(p->fts_statp->st_uid, 1)) != NULL) - output(indent, &offset, "uname=%s", name); + output(fp, indent, &offset, "uname=%s", name); if (keys & F_UID || (keys & F_UNAME && name == NULL)) - output(indent, &offset, "uid=%u", p->fts_statp->st_uid); + output(fp, indent, &offset, "uid=%u", + p->fts_statp->st_uid); } if (keys & (F_GID | F_GNAME) && p->fts_statp->st_gid != gid) { if (keys & F_GNAME && (name = group_from_gid(p->fts_statp->st_gid, 1)) != NULL) - output(indent, &offset, "gname=%s", name); + output(fp, indent, &offset, "gname=%s", name); if (keys & F_GID || (keys & F_GNAME && name == NULL)) - output(indent, &offset, "gid=%u", p->fts_statp->st_gid); + output(fp, indent, &offset, "gid=%u", + p->fts_statp->st_gid); } if (keys & F_MODE && (p->fts_statp->st_mode & MBITS) != mode) - output(indent, &offset, "mode=%#o", + output(fp, indent, &offset, "mode=%#o", p->fts_statp->st_mode & MBITS); if (keys & F_DEV && (S_ISBLK(p->fts_statp->st_mode) || S_ISCHR(p->fts_statp->st_mode))) - output(indent, &offset, "device=%#jx", + output(fp, indent, &offset, "device=%#jx", (uintmax_t)p->fts_statp->st_rdev); if (keys & F_NLINK && p->fts_statp->st_nlink != 1) - output(indent, &offset, "nlink=%u", p->fts_statp->st_nlink); + output(fp, indent, &offset, "nlink=%u", p->fts_statp->st_nlink); if (keys & F_SIZE && (flavor == F_FREEBSD9 || S_ISREG(p->fts_statp->st_mode))) - output(indent, &offset, "size=%ju", + output(fp, indent, &offset, "size=%ju", (uintmax_t)p->fts_statp->st_size); if (keys & F_TIME) #if defined(BSD4_4) && !defined(HAVE_NBTOOL_CONFIG_H) - output(indent, &offset, "time=%jd.%09ld", + output(fp, indent, &offset, "time=%jd.%09ld", (intmax_t)p->fts_statp->st_mtimespec.tv_sec, p->fts_statp->st_mtimespec.tv_nsec); #else - output(indent, &offset, "time=%jd.%09ld", + output(fp, indent, &offset, "time=%jd.%09ld", (intmax_t)p->fts_statp->st_mtime, (long)0); #endif if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) { @@ -239,14 +243,14 @@ statf(int indent, FTSENT *p) crc(fd, &val, &len)) mtree_err("%s: %s", p->fts_accpath, strerror(errno)); close(fd); - output(indent, &offset, "cksum=%lu", (long)val); + output(fp, indent, &offset, "cksum=%lu", (long)val); } #ifndef NO_MD5 if (keys & F_MD5 && S_ISREG(p->fts_statp->st_mode)) { if ((digestbuf = MD5File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: MD5File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", MD5KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", MD5KEY, digestbuf); free(digestbuf); } #endif /* ! NO_MD5 */ @@ -255,7 +259,7 @@ statf(int indent, FTSENT *p) if ((digestbuf = RMD160File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: RMD160File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", RMD160KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", RMD160KEY, digestbuf); free(digestbuf); } #endif /* ! NO_RMD160 */ @@ -264,7 +268,7 @@ statf(int indent, FTSENT *p) if ((digestbuf = SHA1File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: SHA1File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", SHA1KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", SHA1KEY, digestbuf); free(digestbuf); } #endif /* ! NO_SHA1 */ @@ -273,7 +277,7 @@ statf(int indent, FTSENT *p) if ((digestbuf = SHA256_File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: SHA256_File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", SHA256KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", SHA256KEY, digestbuf); free(digestbuf); } #ifdef SHA384_BLOCK_LENGTH @@ -281,7 +285,7 @@ statf(int indent, FTSENT *p) if ((digestbuf = SHA384_File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: SHA384_File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", SHA384KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", SHA384KEY, digestbuf); free(digestbuf); } #endif @@ -289,18 +293,18 @@ statf(int indent, FTSENT *p) if ((digestbuf = SHA512_File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: SHA512_File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", SHA512KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", SHA512KEY, digestbuf); free(digestbuf); } #endif /* ! NO_SHA2 */ if (keys & F_SLINK && (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) - output(indent, &offset, "link=%s", + output(fp, indent, &offset, "link=%s", vispath(rlink(p->fts_accpath))); #if HAVE_STRUCT_STAT_ST_FLAGS if (keys & F_FLAGS && p->fts_statp->st_flags != flags) { char *str = flags_to_string(p->fts_statp->st_flags, "none"); - output(indent, &offset, "flags=%s", str); + output(fp, indent, &offset, "flags=%s", str); free(str); } #endif @@ -324,8 +328,8 @@ statf(int indent, FTSENT *p) #define MTREE_MAXS 16 static int -statd(FTS *t, FTSENT *parent, uid_t *puid, gid_t *pgid, mode_t *pmode, - u_long *pflags) +statd(FILE *fp, FTS *t, FTSENT *parent, uid_t *puid, gid_t *pgid, mode_t *pmode, + u_long *pflags) { FTSENT *p; gid_t sgid; @@ -398,33 +402,33 @@ statd(FTS *t, FTSENT *parent, uid_t *pui first) { first = 0; if (flavor != F_NETBSD6 && dflag) - printf("/set type=dir"); + fprintf(fp, "/set type=dir"); else - printf("/set type=file"); + fprintf(fp, "/set type=file"); if (keys & (F_UID | F_UNAME)) { if (keys & F_UNAME && (name = user_from_uid(saveuid, 1)) != NULL) - printf(" uname=%s", name); + fprintf(fp, " uname=%s", name); if (keys & F_UID || (keys & F_UNAME && name == NULL)) - printf(" uid=%lu", (u_long)saveuid); + fprintf(fp, " uid=%lu", (u_long)saveuid); } if (keys & (F_GID | F_GNAME)) { if (keys & F_GNAME && (name = group_from_gid(savegid, 1)) != NULL) - printf(" gname=%s", name); + fprintf(fp, " gname=%s", name); if (keys & F_GID || (keys & F_GNAME && name == NULL)) - printf(" gid=%lu", (u_long)savegid); + fprintf(fp, " gid=%lu", (u_long)savegid); } if (keys & F_MODE) - printf(" mode=%#lo", (u_long)savemode); + fprintf(fp, " mode=%#lo", (u_long)savemode); if (keys & F_NLINK) - printf(" nlink=1"); + fprintf(fp, " nlink=1"); if (keys & F_FLAGS) { char *str = flags_to_string(saveflags, "none"); - printf(" flags=%s", str); + fprintf(fp, " flags=%s", str); free(str); } - printf("\n"); + fprintf(fp, "\n"); *puid = saveuid; *pgid = savegid; *pmode = savemode; @@ -455,7 +459,7 @@ dcmp(const FTSENT *FTS_CONST *a, const F } void -output(int indent, int *offset, const char *fmt, ...) +output(FILE *fp, int indent, int *offset, const char *fmt, ...) { va_list ap; char buf[1024]; @@ -465,8 +469,8 @@ output(int indent, int *offset, const ch va_end(ap); if (*offset + strlen(buf) > MAXLINELEN - 3) { - printf(" \\\n%*s", INDENTNAMELEN + indent, ""); + fprintf(fp, " \\\n%*s", INDENTNAMELEN + indent, ""); *offset = INDENTNAMELEN + indent; } - *offset += printf(" %s", buf) + 1; + *offset += fprintf(fp, " %s", buf) + 1; } Modified: head/contrib/mtree/extern.h ============================================================================== --- head/contrib/mtree/extern.h Tue Oct 28 17:32:49 2014 (r273795) +++ head/contrib/mtree/extern.h Tue Oct 28 17:52:26 2014 (r273796) @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.38 2013/02/03 19:15:17 christos Exp $ */ +/* $NetBSD: extern.h,v 1.39 2014/04/24 17:22:41 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -63,8 +63,8 @@ void addtag(slist_t *, char *); int check_excludes(const char *, const char *); int compare(NODE *, FTSENT *); int crc(int, u_int32_t *, u_int32_t *); -void cwalk(void); -void dump_nodes(const char *, NODE *, int); +void cwalk(FILE *); +void dump_nodes(FILE *, const char *, NODE *, int); void init_excludes(void); int matchtags(NODE *); __dead __printflike(1,2) void mtree_err(const char *, ...); Modified: head/contrib/mtree/getid.c ============================================================================== --- head/contrib/mtree/getid.c Tue Oct 28 17:32:49 2014 (r273795) +++ head/contrib/mtree/getid.c Tue Oct 28 17:52:26 2014 (r273796) @@ -1,4 +1,4 @@ -/* $NetBSD: getid.c,v 1.8 2013/10/16 17:27:42 christos Exp $ */ +/* $NetBSD: getid.c,v 1.10 2014/10/27 21:46:45 christos Exp $ */ /* from: NetBSD: getpwent.c,v 1.48 2000/10/03 03:22:26 enami Exp */ /* from: NetBSD: getgrent.c,v 1.41 2002/01/12 23:51:30 lukem Exp */ @@ -65,7 +65,7 @@ #endif #include -__RCSID("$NetBSD: getid.c,v 1.8 2013/10/16 17:27:42 christos Exp $"); +__RCSID("$NetBSD: getid.c,v 1.10 2014/10/27 21:46:45 christos Exp $"); #include @@ -206,7 +206,12 @@ grstart(void) } if (grfile[0] == '\0') /* sanity check */ return 0; - return (_gr_fp = fopen(grfile, "r")) ? 1 : 0; + + _gr_fp = fopen(grfile, "r"); + if (_gr_fp != NULL) + return 1; + warn("Can't open `%s'", grfile); + return 0; } @@ -231,7 +236,7 @@ grscan(int search, gid_t gid, const char continue; } /* skip comments */ - if (pwline[0] == '#') + if (grline[0] == '#') continue; if (grmatchline(search, gid, name)) return 1; @@ -350,7 +355,11 @@ pwstart(void) } if (pwfile[0] == '\0') /* sanity check */ return 0; - return (_pw_fp = fopen(pwfile, "r")) ? 1 : 0; + _pw_fp = fopen(pwfile, "r"); + if (_pw_fp != NULL) + return 1; + warn("Can't open `%s'", pwfile); + return 0; } Modified: head/contrib/mtree/mtree.c ============================================================================== --- head/contrib/mtree/mtree.c Tue Oct 28 17:32:49 2014 (r273795) +++ head/contrib/mtree/mtree.c Tue Oct 28 17:52:26 2014 (r273796) @@ -1,4 +1,4 @@ -/* $NetBSD: mtree.c,v 1.48 2013/04/08 17:39:11 christos Exp $ */ +/* $NetBSD: mtree.c,v 1.49 2014/04/24 17:22:41 christos Exp $ */ /*- * Copyright (c) 1989, 1990, 1993 @@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19 #if 0 static char sccsid[] = "@(#)mtree.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: mtree.c,v 1.48 2013/04/08 17:39:11 christos Exp $"); +__RCSID("$NetBSD: mtree.c,v 1.49 2014/04/24 17:22:41 christos Exp $"); #endif #endif /* not lint */ @@ -296,11 +296,11 @@ main(int argc, char **argv) mtree_err("-l and -u flags are mutually exclusive"); if (cflag) { - cwalk(); + cwalk(stdout); exit(0); } if (Cflag || Dflag) { - dump_nodes("", spec(spec1), Dflag); + dump_nodes(stdout, "", spec(spec1), Dflag); exit(0); } if (spec2 != NULL) Modified: head/contrib/mtree/spec.c ============================================================================== --- head/contrib/mtree/spec.c Tue Oct 28 17:32:49 2014 (r273795) +++ head/contrib/mtree/spec.c Tue Oct 28 17:52:26 2014 (r273796) @@ -1,4 +1,4 @@ -/* $NetBSD: spec.c,v 1.88 2013/10/17 17:22:59 christos Exp $ */ +/* $NetBSD: spec.c,v 1.89 2014/04/24 17:22:41 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -67,7 +67,7 @@ #if 0 static char sccsid[] = "@(#)spec.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: spec.c,v 1.88 2013/10/17 17:22:59 christos Exp $"); +__RCSID("$NetBSD: spec.c,v 1.89 2014/04/24 17:22:41 christos Exp $"); #endif #endif /* not lint */ @@ -102,7 +102,7 @@ static void set(char *, NODE *); static void unset(char *, NODE *); static void addchild(NODE *, NODE *); static int nodecmp(const NODE *, const NODE *); -static int appendfield(int, const char *, ...) __printflike(2, 3); +static int appendfield(FILE *, int, const char *, ...) __printflike(3, 4); #define REPLACEPTR(x,v) do { if ((x)) free((x)); (x) = (v); } while (0) @@ -290,21 +290,21 @@ free_nodes(NODE *root) /* * appendfield -- - * Like printf(), but output a space either before or after + * Like fprintf(), but output a space either before or after * the regular output, according to the pathlast flag. */ static int -appendfield(int pathlast, const char *fmt, ...) +appendfield(FILE *fp, int pathlast, const char *fmt, ...) { va_list ap; int result; va_start(ap, fmt); if (!pathlast) - printf(" "); + fprintf(fp, " "); result = vprintf(fmt, ap); if (pathlast) - printf(" "); + fprintf(fp, " "); va_end(ap); return result; } @@ -316,7 +316,7 @@ appendfield(int pathlast, const char *fm * it first. */ void -dump_nodes(const char *dir, NODE *root, int pathlast) +dump_nodes(FILE *fp, const char *dir, NODE *root, int pathlast) { NODE *cur; char path[MAXPATHLEN]; @@ -334,70 +334,75 @@ dump_nodes(const char *dir, NODE *root, mtree_err("Pathname too long."); if (!pathlast) - printf("%s", vispath(path)); + fprintf(fp, "%s", vispath(path)); #define MATCHFLAG(f) ((keys & (f)) && (cur->flags & (f))) if (MATCHFLAG(F_TYPE)) - appendfield(pathlast, "type=%s", nodetype(cur->type)); + appendfield(fp, pathlast, "type=%s", + nodetype(cur->type)); if (MATCHFLAG(F_UID | F_UNAME)) { if (keys & F_UNAME && (name = user_from_uid(cur->st_uid, 1)) != NULL) - appendfield(pathlast, "uname=%s", name); + appendfield(fp, pathlast, "uname=%s", name); else - appendfield(pathlast, "uid=%u", cur->st_uid); + appendfield(fp, pathlast, "uid=%u", + cur->st_uid); } if (MATCHFLAG(F_GID | F_GNAME)) { if (keys & F_GNAME && (name = group_from_gid(cur->st_gid, 1)) != NULL) - appendfield(pathlast, "gname=%s", name); + appendfield(fp, pathlast, "gname=%s", name); else - appendfield(pathlast, "gid=%u", cur->st_gid); + appendfield(fp, pathlast, "gid=%u", + cur->st_gid); } if (MATCHFLAG(F_MODE)) - appendfield(pathlast, "mode=%#o", cur->st_mode); + appendfield(fp, pathlast, "mode=%#o", cur->st_mode); if (MATCHFLAG(F_DEV) && (cur->type == F_BLOCK || cur->type == F_CHAR)) - appendfield(pathlast, "device=%#jx", + appendfield(fp, pathlast, "device=%#jx", (uintmax_t)cur->st_rdev); if (MATCHFLAG(F_NLINK)) - appendfield(pathlast, "nlink=%d", cur->st_nlink); + appendfield(fp, pathlast, "nlink=%d", cur->st_nlink); if (MATCHFLAG(F_SLINK)) - appendfield(pathlast, "link=%s", vispath(cur->slink)); + appendfield(fp, pathlast, "link=%s", + vispath(cur->slink)); if (MATCHFLAG(F_SIZE)) - appendfield(pathlast, "size=%ju", + appendfield(fp, pathlast, "size=%ju", (uintmax_t)cur->st_size); if (MATCHFLAG(F_TIME)) - appendfield(pathlast, "time=%jd.%09ld", + appendfield(fp, pathlast, "time=%jd.%09ld", (intmax_t)cur->st_mtimespec.tv_sec, cur->st_mtimespec.tv_nsec); if (MATCHFLAG(F_CKSUM)) - appendfield(pathlast, "cksum=%lu", cur->cksum); + appendfield(fp, pathlast, "cksum=%lu", cur->cksum); if (MATCHFLAG(F_MD5)) - appendfield(pathlast, "%s=%s", MD5KEY, cur->md5digest); + appendfield(fp, pathlast, "%s=%s", MD5KEY, + cur->md5digest); if (MATCHFLAG(F_RMD160)) - appendfield(pathlast, "%s=%s", RMD160KEY, + appendfield(fp, pathlast, "%s=%s", RMD160KEY, cur->rmd160digest); if (MATCHFLAG(F_SHA1)) - appendfield(pathlast, "%s=%s", SHA1KEY, + appendfield(fp, pathlast, "%s=%s", SHA1KEY, cur->sha1digest); if (MATCHFLAG(F_SHA256)) - appendfield(pathlast, "%s=%s", SHA256KEY, + appendfield(fp, pathlast, "%s=%s", SHA256KEY, cur->sha256digest); if (MATCHFLAG(F_SHA384)) - appendfield(pathlast, "%s=%s", SHA384KEY, + appendfield(fp, pathlast, "%s=%s", SHA384KEY, cur->sha384digest); if (MATCHFLAG(F_SHA512)) - appendfield(pathlast, "%s=%s", SHA512KEY, + appendfield(fp, pathlast, "%s=%s", SHA512KEY, cur->sha512digest); if (MATCHFLAG(F_FLAGS)) { str = flags_to_string(cur->st_flags, "none"); - appendfield(pathlast, "flags=%s", str); + appendfield(fp, pathlast, "flags=%s", str); free(str); } if (MATCHFLAG(F_IGN)) - appendfield(pathlast, "ignore"); + appendfield(fp, pathlast, "ignore"); if (MATCHFLAG(F_OPT)) - appendfield(pathlast, "optional"); + appendfield(fp, pathlast, "optional"); if (MATCHFLAG(F_TAGS)) { /* don't output leading or trailing commas */ p = cur->tags; @@ -406,12 +411,12 @@ dump_nodes(const char *dir, NODE *root, q = p + strlen(p); while(q > p && q[-1] == ',') q--; - appendfield(pathlast, "tags=%.*s", (int)(q - p), p); + appendfield(fp, pathlast, "tags=%.*s", (int)(q - p), p); } puts(pathlast ? vispath(path) : ""); if (cur->child) - dump_nodes(path, cur->child, pathlast); + dump_nodes(fp, path, cur->child, pathlast); } } From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 18:10:58 2014 Return-Path: Delivered-To: svn-src-all@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 29A689AE; Tue, 28 Oct 2014 18:10: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 12036FCB; Tue, 28 Oct 2014 18:10: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 s9SIAva3091541; Tue, 28 Oct 2014 18:10:57 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SIAvYv091540; Tue, 28 Oct 2014 18:10:57 GMT (envelope-from np@FreeBSD.org) Message-Id: <201410281810.s9SIAvYv091540@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 28 Oct 2014 18:10:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273797 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 18:10:58 -0000 Author: np Date: Tue Oct 28 18:10:57 2014 New Revision: 273797 URL: https://svnweb.freebsd.org/changeset/base/273797 Log: Always request a completion for every work request for iWARP. The initial MPA exchange must be tracked this way so that t4_tom's state for the tid is all clean at the time the tid transitions to RDMA mode. Once it does, t4_tom is out of the way and iw_cxgbe uses the qp endpoints directly. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Oct 28 17:52:26 2014 (r273796) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Oct 28 18:10:57 2014 (r273797) @@ -739,7 +739,7 @@ t4_push_frames(struct adapter *sc, struc toep->tx_nocompl >= toep->tx_total / 4) compl = 1; - if (compl) { + if (compl || toep->ulp_mode == ULP_MODE_RDMA) { txwr->op_to_immdlen |= htobe32(F_FW_WR_COMPL); toep->tx_nocompl = 0; toep->plen_nocompl = 0; From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 18:19:23 2014 Return-Path: Delivered-To: svn-src-all@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 43C73C09; Tue, 28 Oct 2014 18:19: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 0E4EF149; Tue, 28 Oct 2014 18:19: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 s9SIJMhm093734; Tue, 28 Oct 2014 18:19:22 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SIJM4H093733; Tue, 28 Oct 2014 18:19:22 GMT (envelope-from des@FreeBSD.org) Message-Id: <201410281819.s9SIJM4H093733@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Tue, 28 Oct 2014 18:19:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r273798 - stable/9/contrib/openpam/lib/libpam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 18:19:23 -0000 Author: des Date: Tue Oct 28 18:19:22 2014 New Revision: 273798 URL: https://svnweb.freebsd.org/changeset/base/273798 Log: Merge upstream r825: fix line continuation in whitespace Modified: stable/9/contrib/openpam/lib/libpam/openpam_readword.c Directory Properties: stable/9/contrib/openpam/ (props changed) Modified: stable/9/contrib/openpam/lib/libpam/openpam_readword.c ============================================================================== --- stable/9/contrib/openpam/lib/libpam/openpam_readword.c Tue Oct 28 18:10:57 2014 (r273797) +++ stable/9/contrib/openpam/lib/libpam/openpam_readword.c Tue Oct 28 18:19:22 2014 (r273798) @@ -55,18 +55,35 @@ openpam_readword(FILE *f, int *lineno, s { char *word; size_t size, len; - int ch, comment, escape, quote; + int ch, escape, quote; int serrno; errno = 0; /* skip initial whitespace */ - comment = 0; - while ((ch = getc(f)) != EOF && ch != '\n') { - if (ch == '#') - comment = 1; - if (!is_lws(ch) && !comment) + escape = quote = 0; + while ((ch = getc(f)) != EOF) { + if (ch == '\n') { + /* either EOL or line continuation */ + if (!escape) + break; + if (lineno != NULL) + ++*lineno; + escape = 0; + } else if (escape) { + /* escaped something else */ + break; + } else if (ch == '#') { + /* comment: until EOL, no continuation */ + while ((ch = getc(f)) != EOF) + if (ch == '\n') + break; break; + } else if (ch == '\\') { + escape = 1; + } else if (!is_ws(ch)) { + break; + } } if (ch == EOF) return (NULL); @@ -76,7 +93,6 @@ openpam_readword(FILE *f, int *lineno, s word = NULL; size = len = 0; - escape = quote = 0; while ((ch = fgetc(f)) != EOF && (!is_ws(ch) || quote || escape)) { if (ch == '\\' && !escape && quote != '\'') { /* escape next character */ @@ -90,7 +106,7 @@ openpam_readword(FILE *f, int *lineno, s } else if (ch == quote && !escape) { /* end quote */ quote = 0; - } else if (ch == '\n' && escape && quote != '\'') { + } else if (ch == '\n' && escape) { /* line continuation */ escape = 0; } else { From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 18:26:44 2014 Return-Path: Delivered-To: svn-src-all@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 0C334197; Tue, 28 Oct 2014 18:26:44 +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 D504E233; Tue, 28 Oct 2014 18:26:43 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B311EB984; Tue, 28 Oct 2014 14:26:42 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Subject: Re: svn commit: r273785 - head/sys/kern Date: Tue, 28 Oct 2014 13:38:23 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201410281530.s9SFUYBd015691@svn.freebsd.org> <20141028154006.GG1877@kib.kiev.ua> In-Reply-To: <20141028154006.GG1877@kib.kiev.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201410281338.23538.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 28 Oct 2014 14:26:42 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 18:26:44 -0000 On Tuesday, October 28, 2014 11:40:06 am Konstantin Belousov wrote: > On Tue, Oct 28, 2014 at 03:30:34PM +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Tue Oct 28 15:30:33 2014 > > New Revision: 273785 > > URL: https://svnweb.freebsd.org/changeset/base/273785 > > > > Log: > > Convert kern_umtx.c to use fueword() and casueword(). > > > > Also fix some mishandling of suword(9) errors as errno, which resulted > > in spurious ERESTART. > > > > Sponsored by: The FreeBSD Foundation > > Tested by: pho > > MFC after: 3 weeks > > > > Modified: > > head/sys/kern/kern_umtx.c > > Some explanation which I did not want to put into commit message. > > The kern_umtx.c commit is split from the other conversion commit > for ease of reversal. The most tricky part of the work for fueword() > was to preserve the logic of locking loops which rely on the suspension > check functions errors preserved for next iteration. Another cause > of troubles if kern_umtx.c were incomplete cleanups in case of > userspace access errors, which left umtx sleepchains locked. > > The only consumers of fuword() left in tree are solaris compat layer/dtrace. > > Architectures which lack proper fueword() implementations are arm, > mips and sparc64. I already forgot enough of sparc64 assembly, and do > not know mips and arm. These arches currently should run with compat > shims in subr_uio.c, but hopefully maintaners will plug the missed > implementations. Thanks for fixing this! -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 18:34:04 2014 Return-Path: Delivered-To: svn-src-all@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 E8406748; Tue, 28 Oct 2014 18:34: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 B1884353; Tue, 28 Oct 2014 18:34: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 s9SIY4JD002619; Tue, 28 Oct 2014 18:34:04 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SIY09S002582; Tue, 28 Oct 2014 18:34:00 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201410281834.s9SIY09S002582@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, 28 Oct 2014 18:34:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273799 - in head/sys: arm/allwinner arm/broadcom/bcm2835 arm/freescale/imx arm/freescale/vybrid arm/lpc arm/rockchip arm/samsung/exynos arm/ti arm/xilinx arm/xscale/ixp425 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 18:34:05 -0000 Author: loos Date: Tue Oct 28 18:33:59 2014 New Revision: 273799 URL: https://svnweb.freebsd.org/changeset/base/273799 Log: Make the GPIO children attach to the first unit available and not only to unit 0. It seems that this 'simplification' was copied to all GPIO drivers in tree. This fix a bug where a GPIO controller could fail to attach its children (gpioc and gpiobus) if another GPIO driver attach first. Modified: head/sys/arm/allwinner/a10_gpio.c head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c head/sys/arm/freescale/imx/imx_gpio.c head/sys/arm/freescale/vybrid/vf_gpio.c head/sys/arm/lpc/lpc_gpio.c head/sys/arm/rockchip/rk30xx_gpio.c head/sys/arm/samsung/exynos/exynos5_pad.c head/sys/arm/ti/ti_gpio.c head/sys/arm/xilinx/zy7_gpio.c head/sys/arm/xscale/ixp425/avila_gpio.c head/sys/arm/xscale/ixp425/cambria_gpio.c head/sys/mips/atheros/ar71xx_gpio.c head/sys/mips/cavium/octeon_gpio.c head/sys/mips/rt305x/rt305x_gpio.c head/sys/powerpc/wii/wii_gpio.c Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/allwinner/a10_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -474,8 +474,8 @@ a10_gpio_attach(device_t dev) } sc->sc_gpio_npins = i; - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); a10_gpio_sc = sc; Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -747,8 +747,9 @@ bcm_gpio_attach(device_t dev) bcm_gpio_sysctl_init(sc); - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); + return (bus_generic_attach(dev)); fail: Modified: head/sys/arm/freescale/imx/imx_gpio.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/freescale/imx/imx_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -435,8 +435,8 @@ imx51_gpio_attach(device_t dev) "imx_gpio%d.%d", device_get_unit(dev), i); } - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); return (bus_generic_attach(dev)); } Modified: head/sys/arm/freescale/vybrid/vf_gpio.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/freescale/vybrid/vf_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -146,8 +146,8 @@ vf_gpio_attach(device_t dev) "vf_gpio%d.%d", device_get_unit(dev), i); } - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); return (bus_generic_attach(dev)); } Modified: head/sys/arm/lpc/lpc_gpio.c ============================================================================== --- head/sys/arm/lpc/lpc_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/lpc/lpc_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -192,8 +192,8 @@ lpc_gpio_attach(device_t dev) lpc_gpio_sc = sc; - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); return (bus_generic_attach(dev)); } Modified: head/sys/arm/rockchip/rk30xx_gpio.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/rockchip/rk30xx_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -504,8 +504,8 @@ rk30_gpio_attach(device_t dev) } sc->sc_gpio_npins = i; - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); rk30_gpio_sc = sc; Modified: head/sys/arm/samsung/exynos/exynos5_pad.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_pad.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/samsung/exynos/exynos5_pad.c Tue Oct 28 18:33:59 2014 (r273799) @@ -559,8 +559,8 @@ pad_attach(device_t dev) "pad%d.%d", device_get_unit(dev), i); } - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); return (bus_generic_attach(dev)); } Modified: head/sys/arm/ti/ti_gpio.c ============================================================================== --- head/sys/arm/ti/ti_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/ti/ti_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -800,8 +800,8 @@ ti_gpio_attach(device_t dev) } /* Finish of the probe call */ - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); return (bus_generic_attach(dev)); } Modified: head/sys/arm/xilinx/zy7_gpio.c ============================================================================== --- head/sys/arm/xilinx/zy7_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/xilinx/zy7_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -329,8 +329,8 @@ zy7_gpio_attach(device_t dev) /* Completely reset. */ zy7_gpio_hw_reset(sc); - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); return (bus_generic_attach(dev)); } Modified: head/sys/arm/xscale/ixp425/avila_gpio.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/xscale/ixp425/avila_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -318,8 +318,9 @@ avila_gpio_attach(device_t dev) sc->sc_valid |= 1 << p->pin; } - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); + return (bus_generic_attach(dev)); #undef N } Modified: head/sys/arm/xscale/ixp425/cambria_gpio.c ============================================================================== --- head/sys/arm/xscale/ixp425/cambria_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/arm/xscale/ixp425/cambria_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -447,8 +447,9 @@ cambria_gpio_attach(device_t dev) cambria_gpio_pin_setflags(dev, pin, p->flags); } - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); + return (bus_generic_attach(dev)); } Modified: head/sys/mips/atheros/ar71xx_gpio.c ============================================================================== --- head/sys/mips/atheros/ar71xx_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/mips/atheros/ar71xx_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -441,8 +441,9 @@ ar71xx_gpio_attach(device_t dev) ar71xx_gpio_pin_set(dev, j, 1); } } - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); + return (bus_generic_attach(dev)); } Modified: head/sys/mips/cavium/octeon_gpio.c ============================================================================== --- head/sys/mips/cavium/octeon_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/mips/cavium/octeon_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -441,8 +441,9 @@ octeon_gpio_attach(device_t dev) } } - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); + return (bus_generic_attach(dev)); } Modified: head/sys/mips/rt305x/rt305x_gpio.c ============================================================================== --- head/sys/mips/rt305x/rt305x_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/mips/rt305x/rt305x_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -511,9 +511,8 @@ rt305x_gpio_attach(device_t dev) } #endif - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); - + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); return (bus_generic_attach(dev)); } Modified: head/sys/powerpc/wii/wii_gpio.c ============================================================================== --- head/sys/powerpc/wii/wii_gpio.c Tue Oct 28 18:19:22 2014 (r273798) +++ head/sys/powerpc/wii/wii_gpio.c Tue Oct 28 18:33:59 2014 (r273799) @@ -182,8 +182,8 @@ wiigpio_attach(device_t dev) "GPIO_PIN_INPUT" : "GPIO_PIN_OUTPUT"); #endif } - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + device_add_child(dev, "gpioc", -1); + device_add_child(dev, "gpiobus", -1); /* * We will be responsible for powering off the system. */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 19:17:46 2014 Return-Path: Delivered-To: svn-src-all@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 CDA73364; Tue, 28 Oct 2014 19:17: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 B0E589A9; Tue, 28 Oct 2014 19:17: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 s9SJHkdO021930; Tue, 28 Oct 2014 19:17:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SJHihe021918; Tue, 28 Oct 2014 19:17:44 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201410281917.s9SJHihe021918@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 28 Oct 2014 19:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273800 - in head/sys: amd64/include i386/include kern sys x86/include x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 19:17:46 -0000 Author: jhb Date: Tue Oct 28 19:17:44 2014 New Revision: 273800 URL: https://svnweb.freebsd.org/changeset/base/273800 Log: Rework virtual machine hypervisor detection. - Move the existing code to x86/x86/identcpu.c since it is x86-specific. - If the CPUID2_HV flag is set, assume a hypervisor is present and query the 0x40000000 leaf to determine the hypervisor vendor ID. Export the vendor ID and the highest supported hypervisor CPUID leaf via hv_vendor[] and hv_high variables, respectively. The hv_vendor[] array is also exported via the hw.hv_vendor sysctl. - Merge the VMWare detection code from tsc.c into the new probe in identcpu.c. Add a VM_GUEST_VMWARE to identify vmware and use that in the TSC code to identify VMWare. Differential Revision: https://reviews.freebsd.org/D1010 Reviewed by: delphij, jkim, neel Added: head/sys/x86/include/vmware.h (contents, props changed) Modified: head/sys/amd64/include/md_var.h head/sys/i386/include/md_var.h head/sys/kern/subr_param.c head/sys/sys/systm.h head/sys/x86/x86/identcpu.c head/sys/x86/x86/tsc.c Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Tue Oct 28 18:33:59 2014 (r273799) +++ head/sys/amd64/include/md_var.h Tue Oct 28 19:17:44 2014 (r273800) @@ -62,6 +62,8 @@ extern u_int cpu_mon_mwait_flags; extern u_int cpu_mon_min_size; extern u_int cpu_mon_max_size; extern char ctx_switch_xsave[]; +extern u_int hv_high; +extern char hv_vendor[]; extern char kstack[]; extern char sigcode[]; extern int szsigcode; Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Tue Oct 28 18:33:59 2014 (r273799) +++ head/sys/i386/include/md_var.h Tue Oct 28 19:17:44 2014 (r273800) @@ -64,6 +64,8 @@ extern u_int cyrix_did; #if defined(I586_CPU) && !defined(NO_F00F_HACK) extern int has_f00f_bug; #endif +extern u_int hv_high; +extern char hv_vendor[]; extern char kstack[]; extern char sigcode[]; extern int szsigcode; Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Tue Oct 28 18:33:59 2014 (r273799) +++ head/sys/kern/subr_param.c Tue Oct 28 19:17:44 2014 (r273800) @@ -99,7 +99,11 @@ pid_t pid_max = PID_MAX; long maxswzone; /* max swmeta KVA storage */ long maxbcache; /* max buffer cache KVA storage */ long maxpipekva; /* Limit on pipe KVA */ -int vm_guest; /* Running as virtual machine guest? */ +#ifdef XEN +int vm_guest = VM_GUEST_XEN; +#else +int vm_guest = VM_GUEST_NO; /* Running as virtual machine guest? */ +#endif u_long maxtsiz; /* max text size */ u_long dfldsiz; /* initial data size limit */ u_long maxdsiz; /* max data size */ @@ -136,7 +140,7 @@ SYSCTL_ULONG(_kern, OID_AUTO, sgrowsiz, "Amount to grow stack on a stack fault"); SYSCTL_PROC(_kern, OID_AUTO, vm_guest, CTLFLAG_RD | CTLTYPE_STRING, NULL, 0, sysctl_kern_vm_guest, "A", - "Virtual machine guest detected? (none|generic|xen)"); + "Virtual machine guest detected?"); /* * These have to be allocated somewhere; allocating @@ -154,73 +158,18 @@ static const char *const vm_guest_sysctl "generic", "xen", "hv", + "vmware", NULL }; CTASSERT(nitems(vm_guest_sysctl_names) - 1 == VM_LAST); -#ifndef XEN -static const char *const vm_bnames[] = { - "QEMU", /* QEMU */ - "Plex86", /* Plex86 */ - "Bochs", /* Bochs */ - "Xen", /* Xen */ - "BHYVE", /* bhyve */ - "Seabios", /* KVM */ - NULL -}; - -static const char *const vm_pnames[] = { - "VMware Virtual Platform", /* VMWare VM */ - "Virtual Machine", /* Microsoft VirtualPC */ - "VirtualBox", /* Sun xVM VirtualBox */ - "Parallels Virtual Platform", /* Parallels VM */ - "KVM", /* KVM */ - NULL -}; - - -/* - * Detect known Virtual Machine hosts by inspecting the emulated BIOS. - */ -static enum VM_GUEST -detect_virtual(void) -{ - char *sysenv; - int i; - - sysenv = kern_getenv("smbios.bios.vendor"); - if (sysenv != NULL) { - for (i = 0; vm_bnames[i] != NULL; i++) - if (strcmp(sysenv, vm_bnames[i]) == 0) { - freeenv(sysenv); - return (VM_GUEST_VM); - } - freeenv(sysenv); - } - sysenv = kern_getenv("smbios.system.product"); - if (sysenv != NULL) { - for (i = 0; vm_pnames[i] != NULL; i++) - if (strcmp(sysenv, vm_pnames[i]) == 0) { - freeenv(sysenv); - return (VM_GUEST_VM); - } - freeenv(sysenv); - } - return (VM_GUEST_NO); -} -#endif - /* * Boot time overrides that are not scaled against main memory */ void init_param1(void) { -#ifndef XEN - vm_guest = detect_virtual(); -#else - vm_guest = VM_GUEST_XEN; -#endif + hz = -1; TUNABLE_INT_FETCH("kern.hz", &hz); if (hz == -1) Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Tue Oct 28 18:33:59 2014 (r273799) +++ head/sys/sys/systm.h Tue Oct 28 19:17:44 2014 (r273800) @@ -73,7 +73,7 @@ extern int vm_guest; /* Running as virt * Keep in sync with vm_guest_sysctl_names[]. */ enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN, VM_GUEST_HV, - VM_LAST }; + VM_GUEST_VMWARE, VM_LAST }; #if defined(WITNESS) || defined(INVARIANTS) void kassert_panic(const char *fmt, ...) __printflike(1, 2); Added: head/sys/x86/include/vmware.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/include/vmware.h Tue Oct 28 19:17:44 2014 (r273800) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2011-2014 Jung-uk Kim + * 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 _X86_VMWARE_H_ +#define _X86_VMWARE_H_ + +#define VMW_HVMAGIC 0x564d5868 +#define VMW_HVPORT 0x5658 +#define VMW_HVCMD_GETVERSION 10 +#define VMW_HVCMD_GETHZ 45 + +static __inline void +vmware_hvcall(u_int cmd, u_int *p) +{ + + __asm __volatile("inl %w3, %0" + : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3]) + : "0" (VMW_HVMAGIC), "1" (UINT_MAX), "2" (cmd), "3" (VMW_HVPORT) + : "memory"); +} + +#endif /* !_X86_VMWARE_H_ */ Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Tue Oct 28 18:33:59 2014 (r273799) +++ head/sys/x86/x86/identcpu.c Tue Oct 28 19:17:44 2014 (r273800) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -63,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #ifdef __i386__ #define IDENTBLUE_CYRIX486 0 @@ -76,6 +78,7 @@ static u_int find_cpu_vendor_id(void); static void print_AMD_info(void); static void print_INTEL_info(void); static void print_INTEL_TLB(u_int data); +static void print_hypervisor_info(void); static void print_svm_info(void); static void print_via_padlock_info(void); static void print_vmx_info(void); @@ -120,6 +123,11 @@ static int hw_clockrate; SYSCTL_INT(_hw, OID_AUTO, clockrate, CTLFLAG_RD, &hw_clockrate, 0, "CPU instruction clock rate"); +u_int hv_high; +char hv_vendor[16]; +SYSCTL_STRING(_hw, OID_AUTO, hv_vendor, CTLFLAG_RD, hv_vendor, 0, + "Hypervisor vendor"); + static eventhandler_tag tsc_post_tag; static char cpu_brand[48]; @@ -949,7 +957,6 @@ printcpuinfo(void) if (tsc_perf_stat) printf(", performance statistics"); } - } #ifdef __i386__ } else if (cpu_vendor_id == CPU_VENDOR_CYRIX) { @@ -967,17 +974,18 @@ printcpuinfo(void) if (*cpu_vendor || cpu_id) printf("\n"); - if (!bootverbose) - return; - - if (cpu_vendor_id == CPU_VENDOR_AMD) - print_AMD_info(); - else if (cpu_vendor_id == CPU_VENDOR_INTEL) - print_INTEL_info(); + if (bootverbose) { + if (cpu_vendor_id == CPU_VENDOR_AMD) + print_AMD_info(); + else if (cpu_vendor_id == CPU_VENDOR_INTEL) + print_INTEL_info(); #ifdef __i386__ - else if (cpu_vendor_id == CPU_VENDOR_TRANSMETA) - print_transmeta_info(); + else if (cpu_vendor_id == CPU_VENDOR_TRANSMETA) + print_transmeta_info(); #endif + } + + print_hypervisor_info(); } void @@ -1182,6 +1190,99 @@ hook_tsc_freq(void *arg __unused) SYSINIT(hook_tsc_freq, SI_SUB_CONFIGURE, SI_ORDER_ANY, hook_tsc_freq, NULL); +#ifndef XEN +static const char *const vm_bnames[] = { + "QEMU", /* QEMU */ + "Plex86", /* Plex86 */ + "Bochs", /* Bochs */ + "Xen", /* Xen */ + "BHYVE", /* bhyve */ + "Seabios", /* KVM */ + NULL +}; + +static const char *const vm_pnames[] = { + "VMware Virtual Platform", /* VMWare VM */ + "Virtual Machine", /* Microsoft VirtualPC */ + "VirtualBox", /* Sun xVM VirtualBox */ + "Parallels Virtual Platform", /* Parallels VM */ + "KVM", /* KVM */ + NULL +}; + +static void +identify_hypervisor(void) +{ + u_int regs[4]; + char *p; + int i; + + /* + * [RFC] CPUID usage for interaction between Hypervisors and Linux. + * http://lkml.org/lkml/2008/10/1/246 + * + * KB1009458: Mechanisms to determine if software is running in + * a VMware virtual machine + * http://kb.vmware.com/kb/1009458 + */ + if (cpu_feature2 & CPUID2_HV) { + vm_guest = VM_GUEST_VM; + do_cpuid(0x40000000, regs); + if (regs[0] >= 0x40000000) { + hv_high = regs[0]; + ((u_int *)&hv_vendor)[0] = regs[1]; + ((u_int *)&hv_vendor)[1] = regs[2]; + ((u_int *)&hv_vendor)[2] = regs[3]; + hv_vendor[12] = '\0'; + if (strcmp(hv_vendor, "VMwareVMware") == 0) + vm_guest = VM_GUEST_VMWARE; + } + return; + } + + /* + * Examine SMBIOS strings for older hypervisors. + */ + p = kern_getenv("smbios.system.serial"); + if (p != NULL) { + if (strncmp(p, "VMware-", 7) == 0 || strncmp(p, "VMW", 3) == 0) { + vmware_hvcall(VMW_HVCMD_GETVERSION, regs); + if (regs[1] == VMW_HVMAGIC) { + vm_guest = VM_GUEST_VMWARE; + freeenv(p); + return; + } + } + freeenv(p); + } + + /* + * XXX: Some of these entries may not be needed since they were + * added to FreeBSD before the checks above. + */ + p = kern_getenv("smbios.bios.vendor"); + if (p != NULL) { + for (i = 0; vm_bnames[i] != NULL; i++) + if (strcmp(p, vm_bnames[i]) == 0) { + vm_guest = VM_GUEST_VM; + freeenv(p); + return; + } + freeenv(p); + } + p = kern_getenv("smbios.system.product"); + if (p != NULL) { + for (i = 0; vm_pnames[i] != NULL; i++) + if (strcmp(p, vm_pnames[i]) == 0) { + vm_guest = VM_GUEST_VM; + freeenv(p); + return; + } + freeenv(p); + } +} +#endif + /* * Final stage of CPU identification. */ @@ -1213,6 +1314,9 @@ identify_cpu(void) cpu_feature2 = regs[2]; #endif +#ifndef XEN + identify_hypervisor(); +#endif cpu_vendor_id = find_cpu_vendor_id(); /* @@ -2046,3 +2150,11 @@ print_vmx_info(void) ); } } + +static void +print_hypervisor_info(void) +{ + + if (*hv_vendor) + printf("Hypervisor: Origin = \"%s\"\n", hv_vendor); +} Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Tue Oct 28 18:33:59 2014 (r273799) +++ head/sys/x86/x86/tsc.c Tue Oct 28 19:17:44 2014 (r273800) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "cpufreq_if.h" @@ -102,72 +103,11 @@ static struct timecounter tsc_timecounte 800, /* quality (adjusted in code) */ }; -#define VMW_HVMAGIC 0x564d5868 -#define VMW_HVPORT 0x5658 -#define VMW_HVCMD_GETVERSION 10 -#define VMW_HVCMD_GETHZ 45 - -static __inline void -vmware_hvcall(u_int cmd, u_int *p) -{ - - __asm __volatile("inl %w3, %0" - : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3]) - : "0" (VMW_HVMAGIC), "1" (UINT_MAX), "2" (cmd), "3" (VMW_HVPORT) - : "memory"); -} - -static int +static void tsc_freq_vmware(void) { - char hv_sig[13]; u_int regs[4]; - char *p; - u_int hv_high; - int i; - /* - * [RFC] CPUID usage for interaction between Hypervisors and Linux. - * http://lkml.org/lkml/2008/10/1/246 - * - * KB1009458: Mechanisms to determine if software is running in - * a VMware virtual machine - * http://kb.vmware.com/kb/1009458 - */ - hv_high = 0; - if ((cpu_feature2 & CPUID2_HV) != 0) { - do_cpuid(0x40000000, regs); - hv_high = regs[0]; - for (i = 1, p = hv_sig; i < 4; i++, p += sizeof(regs) / 4) - memcpy(p, ®s[i], sizeof(regs[i])); - *p = '\0'; - if (bootverbose) { - /* - * HV vendor ID string - * ------------+-------------- - * KVM "KVMKVMKVM" - * Microsoft "Microsoft Hv" - * VMware "VMwareVMware" - * Xen "XenVMMXenVMM" - */ - printf("Hypervisor: Origin = \"%s\"\n", hv_sig); - } - if (strncmp(hv_sig, "VMwareVMware", 12) != 0) - return (0); - } else { - p = kern_getenv("smbios.system.serial"); - if (p == NULL) - return (0); - if (strncmp(p, "VMware-", 7) != 0 && - strncmp(p, "VMW", 3) != 0) { - freeenv(p); - return (0); - } - freeenv(p); - vmware_hvcall(VMW_HVCMD_GETVERSION, regs); - if (regs[1] != VMW_HVMAGIC) - return (0); - } if (hv_high >= 0x40000010) { do_cpuid(0x40000010, regs); tsc_freq = regs[0] * 1000; @@ -177,7 +117,6 @@ tsc_freq_vmware(void) tsc_freq = regs[0] | ((uint64_t)regs[1] << 32); } tsc_is_invariant = 1; - return (1); } static void @@ -261,8 +200,10 @@ probe_tsc_freq(void) } } - if (tsc_freq_vmware()) + if (vm_guest == VM_GUEST_VMWARE) { + tsc_freq_vmware(); return; + } switch (cpu_vendor_id) { case CPU_VENDOR_AMD: From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 19:26:53 2014 Return-Path: Delivered-To: svn-src-all@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 63342872; Tue, 28 Oct 2014 19:26:53 +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 D58BDAE2; Tue, 28 Oct 2014 19:26:52 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 355F4D47447; Wed, 29 Oct 2014 06:26:44 +1100 (AEDT) Date: Wed, 29 Oct 2014 06:26:42 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov Subject: Re: svn commit: r273784 - in head/sys: amd64/ia32 compat/freebsd32 i386/i386 kern net In-Reply-To: <201410281528.s9SFSLs2013764@svn.freebsd.org> Message-ID: <20141029042007.N2423@besplex.bde.org> References: <201410281528.s9SFSLs2013764@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=BdjhjNd2 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=3o5ZHGEtQ1bD-Fw3Y7AA:9 a=3QTGIgrYzqncwDpa:21 a=QpfHI327jUG1pkl_:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 19:26:53 -0000 On Tue, 28 Oct 2014, Konstantin Belousov wrote: > Log: > Replace some calls to fuword() by fueword() with proper error checking. I just noticed some more API design errors. The pointer type for new APIs should be [qualifed] wordsize_t *, not [qualified] void *. Using void * reduces type safety for almost no benefits. The casuword() family already doesn't use void *. > Modified: head/sys/kern/kern_exec.c > ============================================================================== > --- head/sys/kern/kern_exec.c Tue Oct 28 15:22:13 2014 (r273783) > +++ head/sys/kern/kern_exec.c Tue Oct 28 15:28:20 2014 (r273784) > @@ -1091,7 +1091,7 @@ int > exec_copyin_args(struct image_args *args, char *fname, > enum uio_seg segflg, char **argv, char **envv) > { > - char *argp, *envp; > + u_long argp, envp; > int error; > size_t length; > Here you made some changes to reduce the type errors allowed by the bad type safety. Some places use caddr_t for the pointer type. This would be correct if caddr_t is actually an opaque type, but many uses of it require it to be precisely char *. Here the char * was used directly. > @@ -1127,13 +1127,17 @@ exec_copyin_args(struct image_args *args > /* > * extract arguments first > */ > - while ((argp = (caddr_t) (intptr_t) fuword(argv++))) { > - if (argp == (caddr_t) -1) { fuword() returns an integer type, and that is often what is wanted. But here argv is a pointer to a pointer and we want to follow it. We use lots of type puns to follow this user pointer in kernel code. The casts here should have been (char *)(uintptr_t). char * is the best type for argp, unless you change the API massively so that fu*word*() represents user pointers using a scalar type (vm_offset_t, or just a properly opaque caddr_t). > + for (;;) { > + error = fueword(argv++, &argp); > + if (error == -1) { > error = EFAULT; > goto err_exit; > } > - if ((error = copyinstr(argp, args->endp, > - args->stringspace, &length))) { > + if (argp == 0) > + break; > + error = copyinstr((void *)(uintptr_t)argp, args->endp, > + args->stringspace, &length); char * argp was a better match to the API than u_long. Now it is assumed (for fueword() to work) that long can represent all user pointers, and there are many more assumptions that type puns between long and u_long work. > + if (error != 0) { > if (error == ENAMETOOLONG) > error = E2BIG; > goto err_exit; This shows that the void * arg type for fu*word*() provides few benefits in a complicated case -- you still need some casts to defeat type safety. In simpler cases, I think the void * arg type just gives the negative benefit of built-in defeat of type safety. The simple use is: wordsize_t *user_foo_ptr; wordsize_t kernel_foo; .. error = fueword(user_foo_ptr, &kernel_foo); The new API already enforces some type safety for kernel_foo here (in the old API, you could easily assign to a kernel_foo of the wrong type). It is not much to ask that user_foo_ptr has a matching type too. For argv above, this makes it clear that significant type puns are needed to go from char ** to wordsize_t *. We already punned away a const. I just noticed some more type errors: - wordsize_t is long, to be bug for bug compatible with the old API. This is more bogus than before, since -1 no longer needs to be returned in wordsize_t. The casuword() family uses the slightly better type u_long. vm_offset_t would be more correct. - the above change takes a trip through u_long instead of a trip through caddr_t and char *. It should use long directly, given that the API uses long. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 22:14:33 2014 Return-Path: Delivered-To: svn-src-all@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 C827CB21; Tue, 28 Oct 2014 22:14: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 7F2CBEFB; Tue, 28 Oct 2014 22:14: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 s9SMEX0s007589; Tue, 28 Oct 2014 22:14:33 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SMEWFD007584; Tue, 28 Oct 2014 22:14:32 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201410282214.s9SMEWFD007584@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 28 Oct 2014 22:14:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273802 - in head/bin/sh: . tests/parameters X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 22:14:33 -0000 Author: jilles Date: Tue Oct 28 22:14:31 2014 New Revision: 273802 URL: https://svnweb.freebsd.org/changeset/base/273802 Log: Treat IFS separators in "$*" as quoted. This makes a difference if IFS starts with *, ?, [ or a CTL* byte. Added: head/bin/sh/tests/parameters/positional6.0 (contents, props changed) head/bin/sh/tests/parameters/positional7.0 (contents, props changed) Modified: head/bin/sh/expand.c head/bin/sh/tests/parameters/Makefile Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Tue Oct 28 21:06:04 2014 (r273801) +++ head/bin/sh/expand.c Tue Oct 28 22:14:31 2014 (r273802) @@ -878,7 +878,7 @@ varvalue(const char *name, int quoted, i int num; char *p; int i; - char sep; + char sep[2]; char **ap; switch (*name) { @@ -912,15 +912,18 @@ varvalue(const char *name, int quoted, i /* FALLTHROUGH */ case '*': if (ifsset()) - sep = ifsval()[0]; + sep[0] = ifsval()[0]; else - sep = ' '; + sep[0] = ' '; + sep[1] = '\0'; for (ap = shellparam.p ; (p = *ap++) != NULL ; ) { strtodest(p, flag, subtype, quoted); if (!*ap) break; - if (sep || (flag & EXP_FULL && !quoted && **ap != '\0')) - STPUTC(sep, expdest); + if (sep[0]) + strtodest(sep, flag, subtype, quoted); + else if (flag & EXP_FULL && !quoted && **ap != '\0') + STPUTC('\0', expdest); } return; default: Modified: head/bin/sh/tests/parameters/Makefile ============================================================================== --- head/bin/sh/tests/parameters/Makefile Tue Oct 28 21:06:04 2014 (r273801) +++ head/bin/sh/tests/parameters/Makefile Tue Oct 28 22:14:31 2014 (r273802) @@ -18,6 +18,8 @@ FILES+= positional2.0 FILES+= positional3.0 FILES+= positional4.0 FILES+= positional5.0 +FILES+= positional6.0 +FILES+= positional7.0 FILES+= pwd1.0 FILES+= pwd2.0 Added: head/bin/sh/tests/parameters/positional6.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/parameters/positional6.0 Tue Oct 28 22:14:31 2014 (r273802) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +IFS=? +set p r +v=pqrs +r=${v#"$*"} +[ "$r" = pqrs ] Added: head/bin/sh/tests/parameters/positional7.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/parameters/positional7.0 Tue Oct 28 22:14:31 2014 (r273802) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +set -- / '' +IFS=* +set -- "$*" +IFS=: +args="$*" +[ "$#:$args" = "1:/*" ] From owner-svn-src-all@FreeBSD.ORG Tue Oct 28 23:01:10 2014 Return-Path: Delivered-To: svn-src-all@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 3A9D5727; Tue, 28 Oct 2014 23:01: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 220413EE; Tue, 28 Oct 2014 23:01: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 s9SN19Lg028333; Tue, 28 Oct 2014 23:01:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9SN196Z028332; Tue, 28 Oct 2014 23:01:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201410282301.s9SN196Z028332@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 28 Oct 2014 23:01:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273803 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2014 23:01:10 -0000 Author: ngie Date: Tue Oct 28 23:01:09 2014 New Revision: 273803 URL: https://svnweb.freebsd.org/changeset/base/273803 Log: Filter out TESTS_SUBDIRS already added to SUBDIR instead of blindly appending the TESTS_SUBDIRS variable to SUBDIR Duplicate directory entries can cause unexpected side effects, like installing the same files multiple times. This can be easily reproduced via the following testcase prior to this commit: SUBDIR= dir TESTS_SUBDIRS+= dir .include Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.test.mk Modified: head/share/mk/bsd.test.mk ============================================================================== --- head/share/mk/bsd.test.mk Tue Oct 28 22:14:31 2014 (r273802) +++ head/share/mk/bsd.test.mk Tue Oct 28 23:01:09 2014 (r273803) @@ -54,9 +54,11 @@ _TESTS= .include .include -.if !empty(TESTS_SUBDIRS) -SUBDIR+= ${TESTS_SUBDIRS} +.for ts in ${TESTS_SUBDIRS} +.if empty(SUBDIR:N${ts}) +SUBDIR+= ${ts} .endif +.endfor # it is rare for test cases to have man pages .if !defined(MAN) From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 00:27:03 2014 Return-Path: Delivered-To: svn-src-all@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 9ECC0ED1; Wed, 29 Oct 2014 00:27: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 703F9E73; Wed, 29 Oct 2014 00:27: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 s9T0R3E2070862; Wed, 29 Oct 2014 00:27:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9T0R31i070859; Wed, 29 Oct 2014 00:27:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201410290027.s9T0R31i070859@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Oct 2014 00:27:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273805 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 00:27:03 -0000 Author: mav Date: Wed Oct 29 00:27:02 2014 New Revision: 273805 URL: https://svnweb.freebsd.org/changeset/base/273805 Log: MFC r273457: Document sort_io_queue sysctls/tunables. Modified: stable/10/share/man/man4/ada.4 stable/10/share/man/man4/da.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/ada.4 ============================================================================== --- stable/10/share/man/man4/ada.4 Tue Oct 28 23:32:05 2014 (r273804) +++ stable/10/share/man/man4/ada.4 Wed Oct 29 00:27:02 2014 (r273805) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 21, 2014 +.Dd October 22, 2014 .Dt ADA 4 .Os .Sh NAME @@ -123,6 +123,13 @@ seconds. This variable determines whether to spin-down disks when shutting down. Set to 1 to enable spin-down, 0 to disable. The default is currently enabled. +.It Va kern.cam.sort_io_queue +.It Va kern.cam.ada. Ns Ar X Ns Va .sort_io_queue +.Pp +These variables determine whether request queue should be sorted trying +to optimize head seeks. +Set to 1 to enable sorting, 0 to disable, -1 to leave it as-is. +The default is sorting enabled for HDDs and disabled SSDs. .It Va kern.cam.ada.read_ahead .It Va kern.cam.ada. Ns Ar X Ns Va .read_ahead .It Va kern.cam.ada.write_cache Modified: stable/10/share/man/man4/da.4 ============================================================================== --- stable/10/share/man/man4/da.4 Tue Oct 28 23:32:05 2014 (r273804) +++ stable/10/share/man/man4/da.4 Wed Oct 29 00:27:02 2014 (r273805) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2012 +.Dd October 22, 2014 .Dt DA 4 .Os .Sh NAME @@ -150,6 +150,13 @@ This variable determines how long the driver will wait before timing out an outstanding command. The units for this value are seconds, and the default is currently 60 seconds. +.It Va kern.cam.sort_io_queue +.It Va kern.cam.da. Ns Ar X Ns Va .sort_io_queue +.Pp +These variables determine whether request queue should be sorted trying +to optimize head seeks. +Set to 1 to enable sorting, 0 to disable, -1 to leave it as-is. +The default is sorting enabled for HDDs and disabled for SSDs. .It kern.cam.da.%d.minimum_cmd_size .Pp This variable determines what the minimum READ/WRITE CDB size is for a From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 01:15:49 2014 Return-Path: Delivered-To: svn-src-all@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 A662B46B; Wed, 29 Oct 2014 01:15: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 912FC32E; Wed, 29 Oct 2014 01:15: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 s9T1FnMm094117; Wed, 29 Oct 2014 01:15:49 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9T1FnTv094112; Wed, 29 Oct 2014 01:15:49 GMT (envelope-from np@FreeBSD.org) Message-Id: <201410290115.s9T1FnTv094112@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 29 Oct 2014 01:15:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273806 - in head/contrib/ofed: libcxgb4 libcxgb4/src usr.lib usr.lib/libcxgb4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 01:15:49 -0000 Author: np Date: Wed Oct 29 01:15:48 2014 New Revision: 273806 URL: https://svnweb.freebsd.org/changeset/base/273806 Log: Userspace library for Chelsio's Terminator 5 based iWARP RNICs (pretty much every T5 card that does _not_ have "-SO" in its name is RDMA capable). This plugs into the OFED verbs framework and allows userspace RDMA applications to work over T5 RNICs. Tested with rping. Obtained from: Chelsio Communications Relnotes: Yes Sponsored by: Chelsio Communications Added: head/contrib/ofed/libcxgb4/ head/contrib/ofed/libcxgb4/AUTHORS head/contrib/ofed/libcxgb4/COPYING head/contrib/ofed/libcxgb4/ChangeLog head/contrib/ofed/libcxgb4/README head/contrib/ofed/libcxgb4/cxgb4.driver head/contrib/ofed/libcxgb4/src/ head/contrib/ofed/libcxgb4/src/cq.c head/contrib/ofed/libcxgb4/src/cxgb4-abi.h head/contrib/ofed/libcxgb4/src/cxgb4.map head/contrib/ofed/libcxgb4/src/dev.c head/contrib/ofed/libcxgb4/src/libcxgb4.h head/contrib/ofed/libcxgb4/src/qp.c head/contrib/ofed/libcxgb4/src/queue.h head/contrib/ofed/libcxgb4/src/t4.h head/contrib/ofed/libcxgb4/src/t4_chip_type.h head/contrib/ofed/libcxgb4/src/t4_pci_id_tbl.h head/contrib/ofed/libcxgb4/src/t4_regs.h head/contrib/ofed/libcxgb4/src/t4fw_interface.h head/contrib/ofed/libcxgb4/src/verbs.c head/contrib/ofed/usr.lib/libcxgb4/ head/contrib/ofed/usr.lib/libcxgb4/Makefile head/contrib/ofed/usr.lib/libcxgb4/config.h Modified: head/contrib/ofed/usr.lib/Makefile Added: head/contrib/ofed/libcxgb4/AUTHORS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/ofed/libcxgb4/AUTHORS Wed Oct 29 01:15:48 2014 (r273806) @@ -0,0 +1 @@ +Chelsio Communications, Inc. Added: head/contrib/ofed/libcxgb4/COPYING ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/ofed/libcxgb4/COPYING Wed Oct 29 01:15:48 2014 (r273806) @@ -0,0 +1,29 @@ +Copyright (c) 2010-2013. Chelsio Communications. All rights reserved. + +This software is available to you under a choice of one of two +licenses. You may choose to be licensed under the terms of the GNU +General Public License (GPL) Version 2, available from the file +COPYING in the main directory of this source tree, or the +OpenIB.org BSD license below: + + Redistribution and use in source and binary forms, with or + without modification, are permitted provided that the following + conditions are met: + + - Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + - Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. Added: head/contrib/ofed/libcxgb4/ChangeLog ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/ofed/libcxgb4/ChangeLog Wed Oct 29 01:15:48 2014 (r273806) @@ -0,0 +1,1054 @@ +commit 6a417d903b9add7c8ab2b71ac11c85c46671e020 +Author: Steve Wise +Date: Thu Jul 31 11:25:22 2014 -0500 + + Spin release 1.3.5. + + Signed-off-by: Steve Wise + +commit 52ecbea1b908d3b449022e2d75ebe0ca3885bcf2 +Author: Steve Wise +Date: Thu Jul 31 11:14:05 2014 -0500 + + libcxb4: use wc_wmb() instead of wmb(). + + The user mode RDMA macro for wmb() is not sufficient to provide the + fencing needed. This was causing corrupted packets when running multiple + WD-UDP sockperf processes. The correct "sfence" instruction is provided + with the wc_wmb() macro. See /usr/include/infiniband/arch.h. + + Note: The kernel implementation of wmb() is sufficient. This is a + libcxgb4 issue only... + + Signed-off-by: Steve Wise + +commit 242c29715372bf6999aa343a5aad5654da3ecf3a +Author: Steve Wise +Date: Wed Jun 18 10:17:00 2014 -0500 + + Spin release 1.3.4 + + Signed-off-by: Steve Wise + +commit 2d54f4c5604cae24caac493aaf6d8b0907ac2ed2 +Author: Steve Wise +Date: Wed Jun 18 10:16:52 2014 -0500 + + Support the query_qp() verb + + Signed-off-by: Steve Wise + +commit f80159d12148774646ad65d03cd070f6d5f86eb4 +Author: Steve Wise +Date: Mon Jun 9 15:20:47 2014 -0500 + + Account for the full qid range. + + The total qid range is should really be based on the max_cq attribute. + + Signed-off-by: Steve Wise + +commit 5aaf5e7277a1c12964aac11a4cff94520717e805 +Author: Yann Droneaud +Date: Mon May 5 12:59:23 2014 -0500 + + kernel abi: adds explicit padding in struct c4iw_alloc_ucontext_resp + + i386 ABI disagree with most other ABIs regarding alignment + of data type larger than 4 bytes: on most ABIs a padding must + be added at end of the structures, while it is not + required on i386. + + Such ABI disagreement will make an x86_64 kernel try to write past + the struct c4iw_alloc_ucontext_resp buffer provided by an i386 + userspace binary. As struct c4iw_alloc_ucontext_resp is likely + on stack, see function c4iw_alloc_context(), side effects are + expected. + + On kernel side, this structure was modified for kernel v3.15-rc1 + by following commit: + + Commit 05eb23893c2cf9502a9cec0c32e7f1d1ed2895c8 + Author: Steve Wise + Date: Fri Mar 14 21:52:08 2014 +0530 + + cxgb4/iw_cxgb4: Doorbell Drop Avoidance Bug Fixes + + If boundary check is implemented on kernel side, the x86_64 + kernel will instead refuse to write past the i386 userspace + provided buffer and the uverbs will fail. + + To fix these issues, this patch adds an explicit padding at end + of structure so that i386 and others ABI share the same structure + layout. This patch makes c4iw_alloc_context() check for a value + in the padding field to detect newer kernel using the field for + a future purpose (only activated in debug). + + With this patch, libcxgb4 will work against older kernel and + newer patched kernel. + + Link: http://marc.info/?i=cover.1399216475.git.ydroneaud@opteya.com + Signed-off-by: Yann Droneaud + Signed-off-by: Steve Wise + +commit 5c65bf17913949368db8802656dc7dbc291271ed +Author: Yann Droneaud +Date: Mon May 5 12:59:23 2014 -0500 + + kernel abi: adds explicit padding in struct c4iw_create_cq_resp + + i386 ABI disagree with most other ABIs regarding alignment + of data type larger than 4 bytes: on most ABIs a padding must + be added at end of the structures, while it is not required + on i386. + + Such ABI disagreement will make an x86_64 kernel try to write past + the struct c4iw_create_cq_resp buffer provided by an i386 + userspace binary. As struct c4iw_create_cq_resp is likely + on stack, see function c4iw_create_cq(), side effects are + expected. + + On kernel side, this structure was added for kernel v2.6.35-rc1 + by following commit. + + Commit cfdda9d764362ab77b11a410bb928400e6520d57 + Author: Steve Wise + Date: Wed Apr 21 15:30:06 2010 -0700 + + RDMA/cxgb4: Add driver for Chelsio T4 RNIC + + If boundary check is implemented on kernel side, the x86_64 kernel + will refuse to write past the i386 userspace provided buffer and the + uverbs will fail. + + To fix these issues, this patch adds an explicit padding at end + of structure so that i386 and others ABI share the same structure + layout. This patch makes c4iw_create_cq() check for a value in the + padding field to detect newer kernel using the field for a future + purpose (only activated in debug). + + With this patch, libcxgb4 will work against older kernel and + newer patched kernel. + + Link: http://marc.info/?i=cover.1399216475.git.ydroneaud@opteya.com + + Signed-off-by: Yann Droneaud + Signed-off-by: Steve Wise + +commit 4f334446f63e3a34006f504f7c89075423c412b4 +Author: Steve Wise +Date: Tue Mar 11 11:47:19 2014 -0500 + + Spin release 1.3.3. + + Signed-off-by: Steve Wise + +commit 98cea522707232b99ff5c07dd9f57937aa8a7d91 +Author: Steve Wise +Date: Tue Mar 11 11:44:16 2014 -0500 + + Zero the status_page_size before calling get_context. + + Signed-off-by: Steve Wise + +commit a373e16a94524e20492301b0e97f53930133739b +Author: Steve Wise +Date: Tue Feb 18 12:07:19 2014 -0600 + + Spin release 1.3.2. + + Signed-off-by: Steve Wise + +commit a2f25730971e8b76033e283f03e79ef4c5dbc4bc +Author: Steve Wise +Date: Tue Feb 18 11:29:50 2014 -0600 + + Fixed compilation error with debug enabled. + + Signed-off-by: Steve Wise + +commit f484e0f4c5a4cb249f86a050efd659be37a51204 +Author: Steve Wise +Date: Tue Feb 18 11:24:06 2014 -0600 + + Use V_PIDX_T5() for T5 devices in ring_db funcs. + + Signed-off-by: Steve Wise + +commit 32b74074808da51e5918295bfc63d347548478a0 +Author: Steve Wise +Date: Tue Feb 18 11:24:05 2014 -0600 + + Call wc_wmb() needed after DB writes. + + Need to do an sfence after botht he WC and regular PIDX DB write. + Otherwise the host might reorder things and cause work request corruption + (seen with NFSRDMA). + + Signed-off-by: Steve Wise + +commit c078eed091a32b930f5bbdf0a12a3be0d0a79cf0 +Author: Steve Wise +Date: Tue Feb 18 11:23:57 2014 -0600 + + Call rmb() after reading valid gen bit. + + Some HW platforms can reorder read operations, so we must rmb() after + we see a valid gen bit in a CQE but before we read any other fields + from the CQE. + + Signed-off-by: Steve Wise + +commit 7b482dcdbbd187fd8372f744157ac2b323d32f45 +Author: Steve Wise +Date: Tue Feb 18 11:12:06 2014 -0600 + + Update copyrights. + + Signed-off-by: Steve Wise + +commit f74316373c0b2a2bd2872ae38f7be516a10503c9 +Author: Steve Wise +Date: Tue Feb 18 11:12:06 2014 -0600 + + Refresh t4 fw/hw reg files. + + Signed-off-by: Steve Wise + +commit 1b8434f22deb30f700246dd2f474eaa2512e4867 +Author: Steve Wise +Date: Tue Feb 18 11:12:03 2014 -0600 + + Add common device id table and chip types. + + This will make it easier to merge in new devices. + +commit 18e5bc32bbe7e19eb9ea5a34d8b2f7d1e6355105 +Author: Steve Wise +Date: Tue Feb 18 10:25:33 2014 -0600 + + Remove dead SIM code. + + Signed-off-by: Steve Wise + +commit c8c793385de1d3e9c1edeb7b13cbc964049b8362 +Author: Steve Wise +Date: Tue Feb 18 10:23:05 2014 -0600 + + Remove dead raw qp code. + + Signed-off-by: Steve Wise + +commit 9302c092d46e4c40cbf6b2189aeda08e5ca3fea4 +Author: Steve Wise +Date: Tue Feb 18 10:17:52 2014 -0600 + + iw_cxgb4/libcxgb4: swsq "signaled" state needs to mind sq_sig_all. + + When a qp is created, the ULP can request that all sq wrs be signaled. + The swsqe entries need to take this into account when marking the entry + as signaled. + + This bug will cause read request CQEs to be silently discarded, and can + cause flush problems because the swsqe entry will be mismarked for qps + created with sq_sig_all set in the qp init attributes. + + Signed-off-by: Steve Wise + +commit 48c6633d4a6510a8c1832ac800f45c2099eb28b4 +Author: Steve Wise +Date: Tue Feb 18 10:17:52 2014 -0600 + + never consume a pending wr in sq flush. + + There is a race when moving a QP from RTS->CLOSING where a SQ work + request could be posted after the FW receives the RDMA_RI/FINI WR. + The SQ work request will never get processed, and should be completed + with FLUSHED status. Function c4iw_flush_sq(), however was dropping + the oldest SQ work request when in CLOSING or IDLE states, instead of + completing the pending work request. If that oldest pending work request + was actually complete and has a CQE in the CQ, then when that CQE is + proceessed in poll_cq, we'll BUG_ON() due to the inconsistent SQ/CQ state. + + This is a very small timing hole and has only been hit once so far. + + c4iw_flush_sq() MUST always flush all non-completed WRs with FLUSHED + status regardless of the QP state. + + Signed-off-by: Steve Wise + +commit 1a3a3e8e8da7463e59b74d5c5396e7bd5e303cd4 +Author: Steve Wise +Date: Tue Feb 18 10:11:35 2014 -0600 + + unmap status page when freeing the context. + + Signed-off-by: Steve Wise + +commit 81e83780e44af2ff25c2572b15fe7e8b8cc6e134 +Author: Steve Wise +Date: Tue Feb 18 10:05:54 2014 -0600 + + DB Drop Avoidance, Version 2. + + Add support for the device status page mapped per device that is used + to enable/disable user db usage. + + Signed-off-by: Steve Wise + +commit 5830447cef866432c4d3e65f7e58c51a0c687798 +Author: Steve Wise +Date: Tue Feb 18 09:40:39 2014 -0600 + + Fix DEBUG code in c4iw_flush_hw_cq(). + + Signed-off-by: Steve Wise + +commit 127bc437797ca34e14b261fa653c1d0524d07272 +Author: Steve Wise +Date: Tue Feb 18 09:40:38 2014 -0600 + + T4 onchip workaround: do the 16 4B MA writes just before DB ring. + + This is a merge of sw repo changesets 1576, 2149, and 2246. + + Signed-off-by: Steve Wise + +commit ac38281728d12a91725aa67e0273dc26976598fb +Author: Steve Wise +Date: Fri Jul 19 09:37:10 2013 -0500 + + Spin release 1.3.1. + + Signed-off-by: Steve Wise + +commit 272fcac194318e13f563b46463726cc03ae83dbe +Author: Steve Wise +Date: Fri Jul 19 09:36:35 2013 -0500 + + Update copyright. + + Signed-off-by: Steve Wise + +commit ba3183d18168f764700ded52651033a79d2a9a86 +Author: Steve Wise +Date: Mon Jun 10 14:10:02 2013 -0500 + + get rid of hard coded queue iqs. + + Since we now get the number of queues available from the driver, + we shouldn't be using the hard coded defines anymore. + + Signed-off-by: Steve Wise + +commit 2095e0a04bc5357da1b9d346e00d52cf7c236cf6 +Author: Steve Wise +Date: Mon Jun 10 14:09:35 2013 -0500 + + update configure.in + + Signed-off-by: Steve Wise + +commit a7a4de4f37a60ffbd8addd8f9ab5505adb86c63f +Author: Steve Wise +Date: Mon Jun 10 14:09:34 2013 -0500 + + Mind the sq_sig_all/sq_sig_type QP attributes. + + Signed-off-by: Steve Wise + +commit 4a485c8dc1c7c70ab85c708bb4c530eef385424d +Author: Steve Wise +Date: Mon Jun 10 14:09:34 2013 -0500 + + always do GTS write if cidx_inc == M_CIDXINC. + + When polling, we do a GTS update if the accumulated cidx_inc == the cq + depth / 16. This works around a T4 bug. However, if the cq is large + enough, cq depth / 16 exceeds the size of the field in the GTS word. + So we also need to update if cidx_inc hits M_CIDXINC to avoid overflowing + the field. + + Signed-off-by: Steve Wise + +commit a276f65add45933cf8b16bb09361786cf1932c4b +Author: Steve Wise +Date: Mon Jun 10 14:09:34 2013 -0500 + + fixed bug where sq.udb was getting overwritten. + + There was an erroneous statement in create_rc_qp() which caused the + sq.udb va to be overwritten with the rq.udb va only for on-chip queues. + This error only affected unmapping of that mapped va when destroying + a qp. In the presence of multiple threads creating/destroying qps, the + erroneously unmapped va could have been assigned to another qp mapping. + This causes intermittent seg faults as libcxgb4 tries to access memory + that has been unmapped in error. + + Signed-off-by: Steve Wise + +commit 1cb6249cf722e265d8e2364de0ee5b0d59a8e4cd +Author: Steve Wise +Date: Mon Jun 10 14:09:34 2013 -0500 + + flush problem with unsignaled wrs. + + c4iw_flush_sq() should only flush wrs that have not already been + flushed. Since we already track where in the sq we've flushed via + sq.cidx_flush, just start at that point and flush any remaining. This bug + only caused a problem in the presence of unsignaled work requests. + + Signed-off-by: Steve Wise + +commit 4132e3434d8ffc2b92055649f42c56be77111216 +Author: Steve Wise +Date: Mon Jun 10 14:09:31 2013 -0500 + + clean up queue dump logic. + + Signed-off-by: Steve Wise + +commit a5e390613548f1dc62d9fe142b6a30a943fc56cf +Author: Steve Wise +Date: Tue Jun 4 12:09:21 2013 -0500 + + accounting for unsignled sq wrs fails to deal with wrap. + + When determining how many wrs are completed with a signaled cqe, + correctly deal with queue wraps. + + Signed-off-by: Steve Wise + +commit 0c1906cec82443e2323dc69dd5c23ae4314087c0 +Author: Steve Wise +Date: Tue Jun 4 12:09:19 2013 -0500 + + Handle qp flushes with pending sw cqes. + + The flush and out of order completion logic has a bug: If out of order + completions are flushed but not yet polled by the consumer and the qp + is then flushed, we end up inserting duplicate completions. + + Signed-off-by: Steve Wise + +commit 26a19bf6d020dbaab8c6cf13396b39a64f952dba +Author: Steve Wise +Date: Tue Jun 4 11:57:00 2013 -0500 + + fixed false uninitialized var warning. + + Signed-off-by: Steve Wise + +commit 119e11e72d20a07a806c3385b8cfa6de93f7d114 +Author: Steve Wise +Date: Thu Mar 28 15:15:39 2013 -0500 + + Spin release 1.3.0 + + Signed-off-by: Steve Wise + +commit a4a0d3fe768ffa33a75ab3df4bd8c678e7f7180b +Author: Steve Wise +Date: Thu Mar 28 15:15:38 2013 -0500 + + Remove aclocal.m4. + + Signed-off-by: Steve Wise + +commit 3c22ddca7cf627d62d06b0ff374fa04192a8cc4c +Author: Steve Wise +Date: Thu Mar 28 15:15:37 2013 -0500 + + libcxgb4: unmap the correct udb/ugts address. + + The various db and gts variables holding the mapped bar2 pointer + get incremented at creation time as a normal part of object creation. + However this causes the wrong address to get unmapped when the object is + destroyed. The result is a mapping leak because the munmap() fails. + So align them back to their proper page boundary when calling munmap(). + + Singed-off-by: Steve Wise + +commit 9b2d3af5735e4067b83cde79e08a37142e8fb895 +Author: Steve Wise +Date: Thu Mar 28 15:15:35 2013 -0500 + + Query device to get the max supported stags, qps, and cqs. + + Signed-off-by: Steve Wise + +commit e8a595da9129d650caf162b7103368af03e07fcc +Author: Steve Wise +Date: Thu Mar 28 15:15:33 2013 -0500 + + Add T5 support. + + This commit is composed of a series of patches to enable T5 support. I + folded them into one commit for simplicity. Plus intermittent patches + caused problems/regressions/etc, so its cleaner to have 1 commit to enable + the new device. + + Signed-off-by: Vipul Pandya + Signed-off-by: Steve Wise + +commit 7cb73aba54eb47d6902c9a3f952c0e37500cac8f +Author: Steve Wise +Date: Mon Mar 4 10:28:32 2013 -0600 + + zero out r3 and r4 fields of fw_ri_send_wr messages. + + Signed-off-by: Steve Wise + +commit f61c762e82b3e6e1c27496eecaf2bf8d00f009e3 +Author: Steve Wise +Date: Mon Mar 4 10:21:39 2013 -0600 + + Add new T4 device IDs. + + Signed-off-by: Steve Wise + +commit c66a627e1e964bad794e9dc40e9a39dc6977aa1e +Author: Steve Wise +Date: Mon Mar 4 10:08:59 2013 -0600 + + flush bug can cause application crash + + This fixes a problem in the flush logic that could occur if the + current position is near the end of the queue and the 'count' being + retired plus this position was greater than the queue size. In this + case the index wasn't being wrapped and the associated swcqe pointer + would point past the end of the CQ. + + Asserts were added to check other possible wrap-error paths. + + This bug was causing mbw to occasionally crash when flushing the qp. + + Signed-off-by: Steve Wise + +commit c5cdab8ad79cecc996d735011b210729fcc95ecd +Author: Steve Wise +Date: Mon Mar 4 10:08:58 2013 -0600 + + Silently eat unsignaled read response cqes. + + Terminator HW always generates read response cqes. We need to silently + eat them vs returning them to the user. The perftest benchmark ib_read_bw + relies on unsignaled work requests and will crash with this fix. + + Signed-off-by: Steve Wise + +commit 1eefdaae19110deae2c20a08ea53cab451fc00bb +Author: Steve Wise +Date: Fri Feb 8 13:51:37 2013 -0600 + + Remove useless dma_addr_t define. + + Signed-off-by: Steve Wise + +commit c551f4632cfcd284ad82d1d9b36d1449d109a5de +Author: Steve Wise +Date: Fri Feb 8 13:51:00 2013 -0600 + + Disable strict aliasing warnings. + + Signed-off-by: Steve Wise + +commit 695a5a4be21f44d49999c83e6ac0699ce90d97c7 +Author: Steve Wise +Date: Wed Nov 9 09:50:32 2011 -0600 + + Spin release 1.2.0. + + Signed-off-by: Steve Wise + +commit 721cfb11ca5697d017bc60167805aea9bbb13ba0 +Author: Vipul Pandya +Date: Mon Nov 7 15:08:45 2011 +0530 + + libcxgb4: Reset flush_cidx before incrementing cidx. + + Signed-off-by: Vipul Pandya + +commit db4fe38c7ee2b3ad9dc8c33f2b54f0c8cdf8b4d2 +Author: Vipul Pandya +Date: Mon Nov 7 15:06:29 2011 +0530 + + libcxgb4: Fix multi-flush logic path....again + + Signed-off-by: Vipul Pandya + +commit 19198bdc2f7feb05babcc2a544ae8b48e4943c41 +Author: Vipul Pandya +Date: Mon Nov 7 15:02:57 2011 +0530 + + libcxgb4: Reset cidx_flush if a active queue starts getting hw cqes + + Signed-off-by: Vipul Pandya + +commit 98545f3a8cbe1670efad080cf908db42269f76ff +Author: Vipul Pandya +Date: Mon Nov 7 14:56:44 2011 +0530 + + libcxgb4: Support for flushing a CQ bound to multiple QPs + + Signed-off-by: Vipul Pandya + +commit 86ba968706b3dc8cb232a303201bb03a2d919c88 +Author: Vipul Pandya +Date: Mon Nov 7 13:06:43 2011 +0530 + + libcxgb4: Checks iw_cxgb4 ABI version to know door bell drop recovery support + + Store iw_cxgb4 ABI version in a global state. Read that global state in + t4_wq_db_enabled to know if iw_cxgb4 driver supports door bell drop recovery. + + Signed-off-by: Vipul Pandya + +commit 2b6563ed5b377dac56c218b809d387089d70312d +Author: Vipul Pandya +Date: Sun Oct 23 16:50:16 2011 +0530 + + libcxgb4: fixed compilation warnings + + Signed-off-by: Vipul Pandya + +commit c5c120969c22a04d34adc566085192afc99d0db9 +Author: Vipul Pandya +Date: Fri Oct 21 19:05:20 2011 +0530 + + libcxgb4: Bug Fix#4410 - Fix 3 segfaults + + This patch fixes 3 segfaults with below signatures: + ---- + 1) + Program received signal SIGSEGV, Segmentation fault. + [Switching to Thread 0x7ffff7fef710 (LWP 22624)] + 0x00007ffff75613e4 in create_read_req_cqe (wq=0x7fffe800ada0, + hw_cqe=0x7ffff7fc7880, read_cqe=0x7ffff7fee860) at src/cq.c:162 + 162 read_cqe->u.rdma.u.scqe.cidx = wq->sq.oldest_read->idx; + (gdb) bt + hw_cqe=0x7ffff7fc7880, read_cqe=0x7ffff7fee860) at src/cq.c:162 + attr=0x7ffff7feeae0, attr_mask=1) at src/verbs.c:691 + src/verbs.c:721 + + 2) + Program received signal SIGSEGV, Segmentation fault. + [Switching to Thread 0x7ffff6e07710 (LWP 22218)] + 0x00007ffff71563e4 in create_read_req_cqe (wq=0x7fffe800ada0, + hw_cqe=0x7ffff7fc7880, read_cqe=0x7ffff6e02b70) at src/cq.c:162 + 162 read_cqe->u.rdma.u.scqe.cidx = wq->sq.oldest_read->idx; + (gdb) bt + hw_cqe=0x7ffff7fc7880, read_cqe=0x7ffff6e02b70) at src/cq.c:162 + src/verbs.c:887 + + 3) + (gdb) bt + wc=0x7ffff51378d0) at src/cq.c:776 + evd_ptr=, wc_ptr=) + at /usr/include/infiniband/verbs.h:957 + ---- + + Signed-off-by: Vipul Pandya + +commit 075adec1159606303b40f4b29ef3cea7ab780ac2 +Author: Vipul Pandya +Date: Fri Oct 21 18:59:16 2011 +0530 + + libcxgb4: return -ENOSYS in c4iw_resize_cq(). + + I fixed a "bug" in c4iw_resize_cq() in an earlier commit which regressed + us. c4iw_resize_cq() was returning 0 always even though we don't support + resizing the CQ. So I change libcxgb4 to return whatever errno is + returned by the kernel driver. However, because the driver didn't set + the uverbs capabilities for resize_cq, uverbs returned EINVAL. The OMPI + code checks for -ENOSYS and handles providers that don't support it. + If, however, ibv_resize_cq() returns any other error, OMPI bails out. + So we need to return -ENOSYS. + + I didn't see this error, however, running NP192 OMPI/IMB all night long. + So it must only try to resize for small jobs and thus I missed the + regression. + + Signed-off-by: Vipul Pandya + +commit 320285a3a3a93a614e24a78f7a68780d7791e3c5 +Author: Vipul Pandya +Date: Fri Oct 21 18:53:47 2011 +0530 + + libcxgb4: Don't flush unsignaled WRs if the QP closed normally + + - add query_qp support in driver to query the qp state before flushing. + + - fixed flush logic (again). + + - don't flush unsignaled WRs is QP had a normal close. + + - support up to 64K QIDs. + + Signed-off-by: Vipul Pandya + +commit 4c98bebe97aeef1c5cda2f071eb9c1d4fa29c37e +Author: Vipul Pandya +Date: Fri Oct 21 17:58:38 2011 +0530 + + libcxgb4: Correctly flush unsignaled WRs followed by a signaled WR. + + The cq flush logic was not accounting for unsignaled SQ WRs followed by + a signaled WR. The result was too many flushed CQEs causing application + faults or assert() failures in libcxgb4 because the SQ state is corrupted. + + Signed-off-by: Vipul Pandya + +commit 8196f85bdefb1511d6d834240a92fdaf815834b8 +Author: Vipul Pandya +Date: Fri Oct 21 17:31:03 2011 +0530 + + libcxgb4: Remove auto generated ltmain.sh file. + + Signed-off-by: Vipul Pandya + +commit 230d12f42d143eeb53d8c4935ba27620c13e6165 +Author: Vipul Pandya +Date: Fri Oct 21 17:20:37 2011 +0530 + + libcxgb4: Add debug code to dump state on a stall condition. + + Signed-off-by: Vipul Pandya + +commit 2df0677b22aebb7a22d0e8ca11beb90250b363c7 +Author: Vipul Pandya +Date: Fri Oct 21 15:04:46 2011 +0530 + + libcxgb4: don't write host idx values when wq is in error. + + This fixes a regression introduced by the db recovery changes. The host + idx shadow fields at the end of the wq should only be written if the wq + is not in error. Otherwise, a seg fault can occur. + + Signed-off-by: Vipul Pandya + +commit 4eaf4b9added6ca660ef2f9363b24d754185fddf +Author: Vipul Pandya +Date: Thu Oct 20 19:55:57 2011 +0530 + + libcxgb4: cq debug changes + + - turn on cq overflow detection by default + + - shadow cq->cidx in the cq status page + + Signed-off-by: Vipul Pandya + +commit b15d02248dd1029706d07fa229767d8b68d16c65 +Author: Vipul Pandya +Date: Thu Oct 20 19:43:07 2011 +0530 + + libcxgb4: DB Drop Recovery for RDMA and LLD queues. + + Signed-off-by: Vipul Pandya + +commit b2c7499eab73cf28cbd9cf86f6ea134e2450cdd3 +Author: Vipul Pandya +Date: Sun Oct 23 12:59:24 2011 +0530 + + libcxgb4: put queue idx values in status page for debug. + + Signed-off-by: Vipul Pandya + +commit 60a30673a4072b6727e7266f7782607ddcbc8de7 +Author: Vipul Pandya +Date: Thu Oct 20 18:07:13 2011 +0530 + + libcxgb4: DB Overflow Avoidance. + + - when user dbs are disabled, call into the kernel driver via modify_qp() + to ring the dbs. + + Signed-off-by: Vipul Pandya + +commit c8651d01a2d69d83caff8c01b32be0b23624d8da +Author: Steve Wise +Date: Thu Mar 10 09:45:00 2011 -0600 + + Spin release 1.1.1. + + Signed-off-by: Steve Wise + +commit ace467085deb7327522faeb19e20e13d691f66a2 +Author: Steve Wise +Date: Thu Mar 10 09:34:11 2011 -0600 + + Flush MA FIFO for on-chip queues. + + Signed-off-by: Steve Wise + +commit 7cb87f46c1784c791d29646104ab355ed920747d +Author: Steve Wise +Date: Thu Mar 10 09:27:57 2011 -0600 + + increase the frequency of CIDX-INC updates. + + Heavy IMB loads reveal that my current algorithm of doing CIDX-INC + GTS writes every 1/2 the CQ depth was not sufficient. This patch + increases the frequency to 1/16. + + Signed-off-by: Steve Wise + +commit 7652d71daadda0c3aba9b96311ea623a1e324d77 +Author: Steve Wise +Date: Wed Sep 15 16:57:04 2010 -0500 + + Spin release 1.1.0. + + Signed-off-by: Steve Wise + +commit ed05d22592bc96987635b2c255a99663f286b812 +Author: Steve Wise +Date: Wed Sep 15 16:56:51 2010 -0500 + + Support all T4 device IDs. + + Signed-off-by: Steve Wise + +commit b051a2ea9dc7b6ffa08f955e60b331e42fec8672 +Author: Steve Wise +Date: Wed Sep 15 15:54:35 2010 -0500 + + Support ABI 0 and 1 versions of the iwarp driver. + + Signed-off-by: Steve Wise + +commit 62f1363bb716e2283f9e2b885e5f02a6d5c692d1 +Author: Steve Wise +Date: Wed Sep 15 14:06:17 2010 -0500 + + Bump the slots per SQ to 5 to allow up to 128MB fast registers. + + Signed-off-by: Steve Wise + +commit d51e041839254d656cc260dba3f26a7c9d73aa56 +Author: Steve Wise +Date: Wed Sep 15 14:06:16 2010 -0500 + + Raw QP implementation + + Signed-off-by: Steve Wise + +commit 8f55539d0b8aea70084edf31687e590cf5a57221 +Author: Steve Wise +Date: Wed Sep 15 14:03:55 2010 -0500 + + Add compile-time user mode rdma stats. + + Signed-off-by: Steve Wise + +commit 2e3531bbd91d7a6f057b3503132aef5e64adb548 +Author: Steve Wise +Date: Wed Sep 15 13:57:03 2010 -0500 + + Support on-chip SQs. + + Signed-off-by: Steve Wise + +commit 65bb173b86c2e0a9ff5f877e4d3951cb8daa6e97 +Author: Steve Wise +Date: Wed Sep 15 13:54:44 2010 -0500 + + Work around TERM CQE hw bug. + + Signed-off-by: Steve Wise + +commit 6bb37d1f72652d4ed0c1972bc673f4418cc7a856 +Author: Steve Wise +Date: Wed Sep 15 13:54:44 2010 -0500 + + Zero out padding in iSGLs. + + Signed-off-by: Steve Wise + +commit aad128404c494ec4779055b5e550c2d7de7d5ca9 +Author: Steve Wise +Date: Thu Jul 22 14:58:51 2010 -0500 + + Spin release 1.0.4 + + Signed-off-by: Steve Wise + +commit 07ac253a8a479fd59fe654baf5a94ffc1de13765 +Author: Steve Wise +Date: Thu Jul 22 14:57:27 2010 -0500 + + Do GTS/CIDX_INC writes in the poll path to avoid drops. + + With T4 asic, we still see the CIDX_INC overflow/drops. + + Signed-off-by: Steve Wise + +commit 3394198639f811c86ab519c43197a9b724435cb0 +Author: Steve Wise +Date: Thu Jul 22 14:56:53 2010 -0500 + + Support T420 and T440 cards. + + Signed-off-by: Steve Wise + +commit 311dd1c8ec3e38287895053dce52dfef5ed5f0b1 +Author: Steve Wise +Date: Fri Jun 11 10:40:53 2010 -0500 + + Spin release 1.0.3. + + Signed-off-by: Steve Wise + +commit a62d7cf38f7b6c731486ff969ee7e3a4238ebc3f +Author: Steve Wise +Date: Fri Jun 11 10:37:17 2010 -0500 + + Support variable sized work requests. + + T4 EQ entries are in multiples of 64B. Currently the RDMA SQ and RQ + use fixed sized entries composed of 4 EQ entries for the SQ and 2 EQ + entries for the RQ. For optimial latency with small IO, we need to + change this so the HW only needs to DMA the EQ entries actually used by + a given work request. + + Implementation: + + - add wq_pidx counter to track where we are in the EQ. cidx/pidx are + used for the sw sq/rq tracking and flow control. + + - the variable part of work requests is the SGL. Add new functions to + build the SGL and/or immediate data directly in the EQ memory wrapping + when needed. + + - adjust the min burst size for the EQ contexts to 64B. + +commit 3be829d117a8ca7957370b09b477fe551de0cea5 +Author: Steve Wise +Date: Thu May 20 15:52:59 2010 -0500 + + Spin release 1.0.2. + + Signed-off-by: Steve Wise + +commit dc1ea232e8ece4ba53d2496befad14bd433e2e3e +Author: Steve Wise +Date: Thu May 20 15:48:37 2010 -0500 + + only insert sq qid in lookup tables. + + Signed-off-by: Steve Wise + +commit 00c60fd47b71dac42d864662567701e2618ff45d +Author: Steve Wise +Date: Thu May 20 15:47:37 2010 -0500 + + Update some driver limits. + + Signed-off-by: Steve Wise + +commit f25661e19d728a0a33a221c0646a9fce9b160f8b +Author: Steve Wise +Date: Thu May 20 15:46:38 2010 -0500 + + Fix cq arm overflow. + + - wrap cq->cqidx_inc based on cq size + - optimize t4_arm_cq() logic + + Signed-off-by: Steve Wise + +commit 8c224aca8f1acd219010e46da538ae4c9a4f9d1a *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 01:54:38 2014 Return-Path: Delivered-To: svn-src-all@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 42665BE1; Wed, 29 Oct 2014 01:54: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 14494915; Wed, 29 Oct 2014 01:54: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 s9T1sbFC012362; Wed, 29 Oct 2014 01:54:37 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9T1sbQJ012361; Wed, 29 Oct 2014 01:54:37 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201410290154.s9T1sbQJ012361@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Wed, 29 Oct 2014 01:54:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273807 - stable/10/sys/amd64/vmm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 01:54:38 -0000 Author: neel Date: Wed Oct 29 01:54:37 2014 New Revision: 273807 URL: https://svnweb.freebsd.org/changeset/base/273807 Log: MFC r273666. Don't pass the 'error' return from an I/O port handler directly to vm_run(). Modified: stable/10/sys/amd64/vmm/vmm_ioport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/vmm/vmm_ioport.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_ioport.c Wed Oct 29 01:15:48 2014 (r273806) +++ stable/10/sys/amd64/vmm/vmm_ioport.c Wed Oct 29 01:54:37 2014 (r273807) @@ -106,15 +106,14 @@ emulate_inout_port(struct vm *vm, int vc uint32_t mask, val; int error; - error = 0; - *retu = true; - - if (vmexit->u.inout.port >= MAX_IOPORTS) - goto done; - - handler = ioport_handler[vmexit->u.inout.port]; - if (handler == NULL) - goto done; + /* + * If there is no handler for the I/O port then punt to userspace. + */ + if (vmexit->u.inout.port >= MAX_IOPORTS || + (handler = ioport_handler[vmexit->u.inout.port]) == NULL) { + *retu = true; + return (0); + } mask = vie_size2mask(vmexit->u.inout.bytes); @@ -124,20 +123,27 @@ emulate_inout_port(struct vm *vm, int vc error = (*handler)(vm, vcpuid, vmexit->u.inout.in, vmexit->u.inout.port, vmexit->u.inout.bytes, &val); + if (error) { + /* + * The value returned by this function is also the return value + * of vm_run(). This needs to be a positive number otherwise it + * can be interpreted as a "pseudo-error" like ERESTART. + * + * Enforce this by mapping all errors to EIO. + */ + return (EIO); + } - if (!error) { - *retu = false; - if (vmexit->u.inout.in) { - vmexit->u.inout.eax &= ~mask; - vmexit->u.inout.eax |= val & mask; - error = vm_set_register(vm, vcpuid, - VM_REG_GUEST_RAX, vmexit->u.inout.eax); - KASSERT(error == 0, ("emulate_ioport: error %d " - "setting guest rax register", error)); - } + if (vmexit->u.inout.in) { + vmexit->u.inout.eax &= ~mask; + vmexit->u.inout.eax |= val & mask; + error = vm_set_register(vm, vcpuid, VM_REG_GUEST_RAX, + vmexit->u.inout.eax); + KASSERT(error == 0, ("emulate_ioport: error %d setting guest " + "rax register", error)); } -done: - return (error); + *retu = false; + return (0); } static int From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 02:17:50 2014 Return-Path: Delivered-To: svn-src-all@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 D84CFF99; Wed, 29 Oct 2014 02:17:50 +0000 (UTC) Received: from mail-la0-x231.google.com (mail-la0-x231.google.com [IPv6:2a00:1450:4010:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FCCFAD7; Wed, 29 Oct 2014 02:17:49 +0000 (UTC) Received: by mail-la0-f49.google.com with SMTP id ge10so1703176lab.22 for ; Tue, 28 Oct 2014 19:17:47 -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=G1NmCA2VsNfAUmDMKaPSEUNMwRnXbVSL5y7rqFLI71U=; b=ZBbdaLXbUfjHUTkUBNWNNJhoV8O9iedtbO3RL2g0HifZIsHD+GggbJQGiTmW6zAlHo gaQdz31goZFetlC3RZjqW+P1qRM3Zxc7x44J3RIupddX9m6wmg6/rbBsByYMs58kN0Th oDFWIe9VV7S6mHiBATLCDBH4NHlA+RuyA6jq+I3qtq9YIKCxABuupUq856nbm3w8FnbM zjt0huwPm6HhpQvmR+FznKmA3aCJfk/IQQtF2gvuDdxYaiowlONqrJrpq7NDfjgkxRjZ mZjVxBhRpdQUa368bNlY5jsL9r4OKAvtqstBPLWPmqv+FHCIXpZAE8HslttsnDGVFA+E haSw== MIME-Version: 1.0 X-Received: by 10.112.150.68 with SMTP id ug4mr8032550lbb.82.1414549067357; Tue, 28 Oct 2014 19:17:47 -0700 (PDT) Sender: crodr001@gmail.com Received: by 10.112.84.197 with HTTP; Tue, 28 Oct 2014 19:17:47 -0700 (PDT) Received: by 10.112.84.197 with HTTP; Tue, 28 Oct 2014 19:17:47 -0700 (PDT) In-Reply-To: <201410282214.s9SMEWFD007584@svn.freebsd.org> References: <201410282214.s9SMEWFD007584@svn.freebsd.org> Date: Tue, 28 Oct 2014 19:17:47 -0700 X-Google-Sender-Auth: jnIVlJvpOGq3PYy9qF9UPk5hV4Y Message-ID: Subject: Re: svn commit: r273802 - in head/bin/sh: . tests/parameters From: Craig Rodrigues To: Jilles Tjoelker Content-Type: text/plain; charset=ISO-8859-1 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, jenkins-admin@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 02:17:51 -0000 Hi, The tests started failing after this commit. Can you take a look? https://jenkins.freebsd.org/jenkins/job/FreeBSD_HEAD-tests2/143/console -- Craig On Oct 28, 2014 3:14 PM, "Jilles Tjoelker" wrote: > Author: jilles > Date: Tue Oct 28 22:14:31 2014 > New Revision: 273802 > URL: https://svnweb.freebsd.org/changeset/base/273802 > > Log: > Treat IFS separators in "$*" as quoted. > > This makes a difference if IFS starts with *, ?, [ or a CTL* byte. > > Added: > head/bin/sh/tests/parameters/positional6.0 (contents, props changed) > head/bin/sh/tests/parameters/positional7.0 (contents, props changed) > Modified: > head/bin/sh/expand.c > head/bin/sh/tests/parameters/Makefile > > Modified: head/bin/sh/expand.c > > ============================================================================== > --- head/bin/sh/expand.c Tue Oct 28 21:06:04 2014 (r273801) > +++ head/bin/sh/expand.c Tue Oct 28 22:14:31 2014 (r273802) > @@ -878,7 +878,7 @@ varvalue(const char *name, int quoted, i > int num; > char *p; > int i; > - char sep; > + char sep[2]; > char **ap; > > switch (*name) { > @@ -912,15 +912,18 @@ varvalue(const char *name, int quoted, i > /* FALLTHROUGH */ > case '*': > if (ifsset()) > - sep = ifsval()[0]; > + sep[0] = ifsval()[0]; > else > - sep = ' '; > + sep[0] = ' '; > + sep[1] = '\0'; > for (ap = shellparam.p ; (p = *ap++) != NULL ; ) { > strtodest(p, flag, subtype, quoted); > if (!*ap) > break; > - if (sep || (flag & EXP_FULL && !quoted && **ap != > '\0')) > - STPUTC(sep, expdest); > + if (sep[0]) > + strtodest(sep, flag, subtype, quoted); > + else if (flag & EXP_FULL && !quoted && **ap != > '\0') > + STPUTC('\0', expdest); > } > return; > default: > > Modified: head/bin/sh/tests/parameters/Makefile > > ============================================================================== > --- head/bin/sh/tests/parameters/Makefile Tue Oct 28 21:06:04 2014 > (r273801) > +++ head/bin/sh/tests/parameters/Makefile Tue Oct 28 22:14:31 2014 > (r273802) > @@ -18,6 +18,8 @@ FILES+= positional2.0 > FILES+= positional3.0 > FILES+= positional4.0 > FILES+= positional5.0 > +FILES+= positional6.0 > +FILES+= positional7.0 > FILES+= pwd1.0 > FILES+= pwd2.0 > > > Added: head/bin/sh/tests/parameters/positional6.0 > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/bin/sh/tests/parameters/positional6.0 Tue Oct 28 22:14:31 2014 > (r273802) > @@ -0,0 +1,7 @@ > +# $FreeBSD$ > + > +IFS=? > +set p r > +v=pqrs > +r=${v#"$*"} > +[ "$r" = pqrs ] > > Added: head/bin/sh/tests/parameters/positional7.0 > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/bin/sh/tests/parameters/positional7.0 Tue Oct 28 22:14:31 2014 > (r273802) > @@ -0,0 +1,8 @@ > +# $FreeBSD$ > + > +set -- / '' > +IFS=* > +set -- "$*" > +IFS=: > +args="$*" > +[ "$#:$args" = "1:/*" ] > > From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 02:23:51 2014 Return-Path: Delivered-To: svn-src-all@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 2BB6B1DF; Wed, 29 Oct 2014 02:23: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 0D89AB9C; Wed, 29 Oct 2014 02:23: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 s9T2Nom5026482; Wed, 29 Oct 2014 02:23:50 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9T2NoKh026481; Wed, 29 Oct 2014 02:23:50 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201410290223.s9T2NoKh026481@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Wed, 29 Oct 2014 02:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273808 - head/sys/dev/safe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 02:23:51 -0000 Author: jmg Date: Wed Oct 29 02:23:50 2014 New Revision: 273808 URL: https://svnweb.freebsd.org/changeset/base/273808 Log: make this compile on arm... bus_size_t is not size_t, and it has different sizes on different arches... Modified: head/sys/dev/safe/safe.c Modified: head/sys/dev/safe/safe.c ============================================================================== --- head/sys/dev/safe/safe.c Wed Oct 29 01:54:37 2014 (r273807) +++ head/sys/dev/safe/safe.c Wed Oct 29 02:23:50 2014 (r273808) @@ -1811,8 +1811,8 @@ safe_dma_malloc( BUS_DMA_NOWAIT, &dma->dma_map); if (r != 0) { device_printf(sc->sc_dev, "safe_dma_malloc: " - "bus_dmammem_alloc failed; size %zu, error %u\n", - size, r); + "bus_dmammem_alloc failed; size %ju, error %u\n", + (uintmax_t)size, r); goto fail_1; } From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 03:14:31 2014 Return-Path: Delivered-To: svn-src-all@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 722E8CB2; Wed, 29 Oct 2014 03:14: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 5E67E1C2; Wed, 29 Oct 2014 03:14: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 s9T3EVE8050786; Wed, 29 Oct 2014 03:14:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9T3EUFT050781; Wed, 29 Oct 2014 03:14:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201410290314.s9T3EUFT050781@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 29 Oct 2014 03:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273809 - in head/sys/cam: ctl scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 03:14:31 -0000 Author: mav Date: Wed Oct 29 03:14:29 2014 New Revision: 273809 URL: https://svnweb.freebsd.org/changeset/base/273809 Log: Implement better handling for ENOSPC error for both CTL and CAM. This makes VMWare VAAI Thin Provisioning Stun primitive activate, pausing the virtual machine, when backing storage (ZFS pool) is getting overflowed. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_error.c head/sys/cam/ctl/ctl_error.h head/sys/cam/scsi/scsi_all.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Wed Oct 29 02:23:50 2014 (r273808) +++ head/sys/cam/ctl/ctl_backend_block.c Wed Oct 29 03:14:29 2014 (r273809) @@ -501,6 +501,8 @@ ctl_be_block_biodone(struct bio *bio) if (beio->num_errors > 0) { if (error == EOPNOTSUPP) { ctl_set_invalid_opcode(&io->scsiio); + } else if (error == ENOSPC) { + ctl_set_space_alloc_fail(&io->scsiio); } else if (beio->bio_cmd == BIO_FLUSH) { /* XXX KDM is there is a better error here? */ ctl_set_internal_failure(&io->scsiio, @@ -711,14 +713,12 @@ ctl_be_block_dispatch_file(struct ctl_be char path_str[32]; ctl_scsi_path_string(io, path_str, sizeof(path_str)); - /* - * XXX KDM ZFS returns ENOSPC when the underlying - * filesystem fills up. What kind of SCSI error should we - * return for that? - */ printf("%s%s command returned errno %d\n", path_str, (beio->bio_cmd == BIO_READ) ? "READ" : "WRITE", error); - ctl_set_medium_error(&io->scsiio); + if (error == ENOSPC) { + ctl_set_space_alloc_fail(&io->scsiio); + } else + ctl_set_medium_error(&io->scsiio); ctl_complete_beio(beio); return; } @@ -804,7 +804,10 @@ ctl_be_block_dispatch_zvol(struct ctl_be * return the I/O to the user. */ if (error != 0) { - ctl_set_medium_error(&io->scsiio); + if (error == ENOSPC) { + ctl_set_space_alloc_fail(&io->scsiio); + } else + ctl_set_medium_error(&io->scsiio); ctl_complete_beio(beio); return; } Modified: head/sys/cam/ctl/ctl_error.c ============================================================================== --- head/sys/cam/ctl/ctl_error.c Wed Oct 29 02:23:50 2014 (r273808) +++ head/sys/cam/ctl/ctl_error.c Wed Oct 29 03:14:29 2014 (r273809) @@ -806,6 +806,18 @@ ctl_set_task_aborted(struct ctl_scsiio * } void +ctl_set_space_alloc_fail(struct ctl_scsiio *ctsio) +{ + /* "Space allocation failed write protect" */ + ctl_set_sense(ctsio, + /*current_error*/ 1, + /*sense_key*/ SSD_KEY_DATA_PROTECT, + /*asc*/ 0x27, + /*ascq*/ 0x07, + SSD_ELEM_NONE); +} + +void ctl_set_success(struct ctl_scsiio *ctsio) { struct scsi_sense_data *sense; Modified: head/sys/cam/ctl/ctl_error.h ============================================================================== --- head/sys/cam/ctl/ctl_error.h Wed Oct 29 02:23:50 2014 (r273808) +++ head/sys/cam/ctl/ctl_error.h Wed Oct 29 03:14:29 2014 (r273809) @@ -81,6 +81,7 @@ void ctl_set_reservation_conflict(struct void ctl_set_queue_full(struct ctl_scsiio *ctsio); void ctl_set_busy(struct ctl_scsiio *ctsio); void ctl_set_task_aborted(struct ctl_scsiio *ctsio); +void ctl_set_space_alloc_fail(struct ctl_scsiio *ctsio); void ctl_set_success(struct ctl_scsiio *ctsio); #endif /* _CTL_ERROR_H_ */ Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Wed Oct 29 02:23:50 2014 (r273808) +++ head/sys/cam/scsi/scsi_all.c Wed Oct 29 03:14:29 2014 (r273809) @@ -1733,7 +1733,7 @@ static struct asc_table_entry asc_table[ { SST(0x27, 0x06, SS_RDEF, /* XXX TBD */ "Conditional write protect") }, /* D B */ - { SST(0x27, 0x07, SS_RDEF, /* XXX TBD */ + { SST(0x27, 0x07, SS_FATAL | ENOSPC, "Space allocation failed write protect") }, /* DTLPWROMAEBKVF */ { SST(0x28, 0x00, SS_FATAL | ENXIO, From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 04:00:45 2014 Return-Path: Delivered-To: svn-src-all@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 45C575FF; Wed, 29 Oct 2014 04:00:45 +0000 (UTC) Received: from mail-pa0-x234.google.com (mail-pa0-x234.google.com [IPv6:2607:f8b0:400e:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDE6984C; Wed, 29 Oct 2014 04:00:44 +0000 (UTC) Received: by mail-pa0-f52.google.com with SMTP id fa1so2270987pad.11 for ; Tue, 28 Oct 2014 21:00:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=gEff82FUqm3onV+1S6bncPWJdS9kmYTBYNv3VcEa82s=; b=gfl8gJsf5yTx+hPYH1+nxrgT2+CB2QJX+XFRX95m2W99kcctEvKIohqWPC4rf+dpxy TlKFvEuWLBkkkFERNd3kx+gX/U4ozFPXa61AWNisNJic2eG+/WoWqRpdOEGCl3y7JG0O 5VAzTmRSmEug1NhWcvVT8nzo2oL4w7mD0OKlD8I/giXmGrvvmEJeRvNCZy+188Ngp+C+ 78cgCZyGMKdEvXjrSm68d0xP6CJwBFUIPLFXGxO30dE45Wx9ArJlvIXr3gztAmOozjB2 yF/YLQ81fdvHlBaGagJ0g9/3yOdazKQh2Irr6ezzsjJ7xx7pZrwk2veU21IOqyLJr23W nrPA== X-Received: by 10.70.43.229 with SMTP id z5mr852568pdl.25.1414555244572; Tue, 28 Oct 2014 21:00:44 -0700 (PDT) Received: from [192.168.242.58] (c-67-182-131-225.hsd1.wa.comcast.net. [67.182.131.225]) by mx.google.com with ESMTPSA id y7sm2653224pbt.83.2014.10.28.21.00.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 Oct 2014 21:00:43 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_A1BED174-FC8E-458E-A5D6-999F22DADF3B"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r273802 - in head/bin/sh: . tests/parameters From: Garrett Cooper In-Reply-To: Date: Tue, 28 Oct 2014 21:00:40 -0700 Message-Id: <56D198A5-FAC2-44F9-8057-E10B5DA3066E@gmail.com> References: <201410282214.s9SMEWFD007584@svn.freebsd.org> To: Craig Rodrigues X-Mailer: Apple Mail (2.1878.6) Cc: Jilles Tjoelker , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, jenkins-admin@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 04:00:45 -0000 --Apple-Mail=_A1BED174-FC8E-458E-A5D6-999F22DADF3B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Oct 28, 2014, at 19:17, Craig Rodrigues wrote: > Hi, >=20 > The tests started failing after this commit. Can you take a look? >=20 > = https://jenkins.freebsd.org/jenkins/job/FreeBSD_HEAD-tests2/143/console Hi Craig, It=92s my fault with not fully testing out the fix in r273803. = I=92m fixing my logic inversion after I fully test out the fix. Sorry :(.. --Apple-Mail=_A1BED174-FC8E-458E-A5D6-999F22DADF3B 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 iQEcBAEBCgAGBQJUUGZoAAoJEMZr5QU6S73erVkIAI1d8XKYsEKqK0dg/TpxEf2o 3VKXUzbNYHMNgeuda1v2DalHyDtwypNsjtxkJu0n9LKhkaSL/HSifY2aWfSR3Tb2 MjIIlOcLJyD4WmSIpc+grjc8fzgmMbnQwmqZUnYznTAgsLikpPP2geVizGUKuRab 2AR8+MDJwGQXIxuVeHJLrcfrmnExCr83SbudMWrpgSvLxJoeMaXzIFr80SxQcCK3 Adb3dkCAPMDDLdBysy2mxCLfqrSRZvfKZMDaAfSxjmAV6JJhbLDkaByZD4yRV7GU SrgbqlH/HMsMhECY/CYCkVpq1fFenZxJhZ9Vrn1YMyROG975HPxOqkvWsbJ6TB4= =trOY -----END PGP SIGNATURE----- --Apple-Mail=_A1BED174-FC8E-458E-A5D6-999F22DADF3B-- From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 04:32:47 2014 Return-Path: Delivered-To: svn-src-all@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 16528A5E; Wed, 29 Oct 2014 04:32: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 02B75B4E; Wed, 29 Oct 2014 04:32: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 s9T4WknG087361; Wed, 29 Oct 2014 04:32:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9T4Wkdg087360; Wed, 29 Oct 2014 04:32:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201410290432.s9T4Wkdg087360@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 29 Oct 2014 04:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273810 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 04:32:47 -0000 Author: ngie Date: Wed Oct 29 04:32:46 2014 New Revision: 273810 URL: https://svnweb.freebsd.org/changeset/base/273810 Log: Fix the logic inversion in the previous commit by ensuring that the matched expression (:M) is empty, not the not matched (:N) is empty. The former case means we have not found the TEST_SUBDIR value in SUBDIR Reported by: rodrigc X-MFC with: r273803 Pointyhat to: me (did not use a clean install root) Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.test.mk Modified: head/share/mk/bsd.test.mk ============================================================================== --- head/share/mk/bsd.test.mk Wed Oct 29 03:14:29 2014 (r273809) +++ head/share/mk/bsd.test.mk Wed Oct 29 04:32:46 2014 (r273810) @@ -55,7 +55,7 @@ _TESTS= .include .for ts in ${TESTS_SUBDIRS} -.if empty(SUBDIR:N${ts}) +.if empty(SUBDIR:M${ts}) SUBDIR+= ${ts} .endif .endfor From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 04:33:49 2014 Return-Path: Delivered-To: svn-src-all@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 A756DBBA; Wed, 29 Oct 2014 04:33:49 +0000 (UTC) Received: from mail-pa0-x230.google.com (mail-pa0-x230.google.com [IPv6:2607:f8b0:400e:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5AA84B5E; Wed, 29 Oct 2014 04:33:49 +0000 (UTC) Received: by mail-pa0-f48.google.com with SMTP id ey11so2305792pad.35 for ; Tue, 28 Oct 2014 21:33:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=Ms9HLLjXYgIF10rU31IC8yjbdxS/4iHs+Kootsd5Bes=; b=QLxow4BaciKL6Thi9C0uXxNQpizQ9+kMo/DcwZoNGcK9jy5e6FiMkqL+7cpUgbCQRZ Exc6RRNXRXtwbprtt7xzm5+sCgkUgmQl4lM31BhvfYUPczfnLU9AV6oBCGeyg0R3GrCv dd3oZZajADqmpLVc38I2qmsPm8A9Xj++OwILEet3L13J2C0Z4BWhBewC64I2XH92UrNY wRz/6unOHQ5nSMaHAtMM9RvgxNSUy/N28l5v4IO3Q+0EYDvZ0hfp28pAeQ1J04hAtYZj 27a8jSTkW6/zvizMaDC1tu10HyUelo2frzrwt4pJXE3J6zP5VKpM8WvDQMWm1Gu6CAoc 86og== X-Received: by 10.68.235.103 with SMTP id ul7mr7928848pbc.63.1414557228875; Tue, 28 Oct 2014 21:33:48 -0700 (PDT) Received: from [192.168.242.58] (c-67-182-131-225.hsd1.wa.comcast.net. [67.182.131.225]) by mx.google.com with ESMTPSA id qg7sm3046187pac.13.2014.10.28.21.33.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 Oct 2014 21:33:48 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_550A6C29-4928-4C64-9A0C-C89E125BD4A3"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r273802 - in head/bin/sh: . tests/parameters From: Garrett Cooper In-Reply-To: <56D198A5-FAC2-44F9-8057-E10B5DA3066E@gmail.com> Date: Tue, 28 Oct 2014 21:33:43 -0700 Message-Id: <7D698484-C425-406F-B740-F8C01C7AD9E3@gmail.com> References: <201410282214.s9SMEWFD007584@svn.freebsd.org> <56D198A5-FAC2-44F9-8057-E10B5DA3066E@gmail.com> To: Craig Rodrigues X-Mailer: Apple Mail (2.1878.6) Cc: Jilles Tjoelker , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, jenkins-admin@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 04:33:49 -0000 --Apple-Mail=_550A6C29-4928-4C64-9A0C-C89E125BD4A3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Oct 28, 2014, at 21:00, Garrett Cooper wrote: > On Oct 28, 2014, at 19:17, Craig Rodrigues = wrote: >=20 >> Hi, >>=20 >> The tests started failing after this commit. Can you take a look? >>=20 >> = https://jenkins.freebsd.org/jenkins/job/FreeBSD_HEAD-tests2/143/console >=20 > Hi Craig, > It=92s my fault with not fully testing out the fix in r273803. = I=92m fixing my logic inversion after I fully test out the fix. Fixed in r273810. Thank you! --Apple-Mail=_550A6C29-4928-4C64-9A0C-C89E125BD4A3 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 iQEcBAEBCgAGBQJUUG4pAAoJEMZr5QU6S73eSlMH/AuhK77DtZQBf8UIPQGEXtSb r/gtpTMdht1AfJo/siXBMiWU7c1PZRSDNyKq63slnoNPSnKzWaaUS1NKswo0RyO9 Sr6Ru5DLiN+ANUgkutp9OiMr7TailvgrTFoB3DOiKPxcfp9Gbo3wN+8x5JNfxY7j 3GPHPPJSdd8I3KmOnEflrbrfAUvPJVQIANL19iTEHPCjzdxiqpJu2xaRLB+HD+rP vbOhDZKpXxxahDh6xrHLTg22UC6jzIaVjtnsDivlCXnYPH9mG1VGu90XktcgeeS9 1obvmUs0Cx3lE8fuZYX6jqInPKUpYhl/L9bBxgrhEcm++wj0NbFvYUTS+cFhwWY= =Hi2R -----END PGP SIGNATURE----- --Apple-Mail=_550A6C29-4928-4C64-9A0C-C89E125BD4A3-- From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 06:24:13 2014 Return-Path: Delivered-To: svn-src-all@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 A9F41C6B; Wed, 29 Oct 2014 06:24: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 7D73874B; Wed, 29 Oct 2014 06:24: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 s9T6ODfU038595; Wed, 29 Oct 2014 06:24:13 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9T6OD1a038594; Wed, 29 Oct 2014 06:24:13 GMT (envelope-from np@FreeBSD.org) Message-Id: <201410290624.s9T6OD1a038594@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 29 Oct 2014 06:24:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273811 - head/contrib/ofed/librdmacm/examples X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 06:24:13 -0000 Author: np Date: Wed Oct 29 06:24:12 2014 New Revision: 273811 URL: https://svnweb.freebsd.org/changeset/base/273811 Log: rping: make sure that the CQ event thread can never poll a CQ after it has been destroyed. Submitted by: Hariprasad at Chelsio dot com Sponsored by: Chelsio Communications Modified: head/contrib/ofed/librdmacm/examples/rping.c Modified: head/contrib/ofed/librdmacm/examples/rping.c ============================================================================== --- head/contrib/ofed/librdmacm/examples/rping.c Wed Oct 29 04:32:46 2014 (r273810) +++ head/contrib/ofed/librdmacm/examples/rping.c Wed Oct 29 06:24:12 2014 (r273811) @@ -40,7 +40,6 @@ #include #include #include -#include #include #include #include @@ -280,10 +279,10 @@ static int rping_cq_event_handler(struct ret = 0; if (wc.status) { - fprintf(stderr, "cq completion failed status %d\n", - wc.status); if (wc.status != IBV_WC_WR_FLUSH_ERR) - ret = -1; + fprintf(stderr, "cq completion failed status %d\n", + wc.status); + ret = -1; goto error; } @@ -800,10 +799,9 @@ static void *rping_persistent_server_thr rping_test_server(cb); rdma_disconnect(cb->child_cm_id); + pthread_join(cb->cqthread, NULL); rping_free_buffers(cb); rping_free_qp(cb); - pthread_cancel(cb->cqthread); - pthread_join(cb->cqthread, NULL); rdma_destroy_id(cb->child_cm_id); free_cb(cb); return NULL; @@ -888,6 +886,7 @@ static int rping_run_server(struct rping rping_test_server(cb); rdma_disconnect(cb->child_cm_id); + pthread_join(cb->cqthread, NULL); rdma_destroy_id(cb->child_cm_id); err2: rping_free_buffers(cb); @@ -1053,9 +1052,16 @@ static int rping_run_client(struct rping goto err2; } - rping_test_client(cb); + ret = rping_test_client(cb); + if (ret) { + fprintf(stderr, "rping client failed: %d\n", ret); + goto err3; + } + ret = 0; +err3: rdma_disconnect(cb->cm_id); err2: + pthread_join(cb->cqthread, NULL); rping_free_buffers(cb); err1: rping_free_qp(cb); From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 06:34:34 2014 Return-Path: Delivered-To: svn-src-all@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 CC178E4C for ; Wed, 29 Oct 2014 06:34:34 +0000 (UTC) Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com [66.111.4.221]) (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 7542981D for ; Wed, 29 Oct 2014 06:34:33 +0000 (UTC) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 30A72448E for ; Wed, 29 Oct 2014 02:34:27 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Wed, 29 Oct 2014 02:34:27 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.fm; h= x-sasl-enc:in-reply-to:references:mime-version :content-transfer-encoding:content-type:subject:from:date:to :message-id; s=mesmtp; bh=XfbpDkTbkC3kPje9EhHBa8RAkbw=; b=Acok+g ON+eZA6X0v28OWC1aK5nCk3vjYUYxKDZN5Ziqktf7N389GcvDSIJ9YXC/cu/a/Hg zeCvY/ELIJBSEU19gDyp6bleC6psjzaP0ICcJckirK6A847irxXJffiI71SlWHF8 HvsGs6WN0jltyxyYGcutL2yUHGwoJNB4V1J+w= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:in-reply-to:references :mime-version:content-transfer-encoding:content-type:subject :from:date:to:message-id; s=smtpout; bh=XfbpDkTbkC3kPje9EhHBa8RA kbw=; b=poR22f6akbFmsfwOG48lQ9i81vQLJgXgQ72/MNlqx/bQ8zK0YpnX6Jmv NG/IJE135+u+sdDXSfvs11BOTHaKiJR7+BqhMDTdOJy6tkTujmlOKs4kHiax2LDw 9ch2Bw/B1X0koTDOQbLomVXlq1O1laRiKt5u0gLthImeTuhM2R8= X-Sasl-enc: hEmVplrFijZBRo4P7NUPLmqOBExbxoTs1nHRlFAGo0y6 1414564466 Received: from [192.168.0.110] (unknown [174.24.231.159]) by mail.messagingengine.com (Postfix) with ESMTPA id C39416800A8; Wed, 29 Oct 2014 02:34:25 -0400 (EDT) User-Agent: K-9 Mail for Android In-Reply-To: <201410290624.s9T6OD1a038594@svn.freebsd.org> References: <201410290624.s9T6OD1a038594@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: svn commit: r273811 - head/contrib/ofed/librdmacm/examples From: Anthony Cornehl Date: Tue, 28 Oct 2014 23:34:11 -0700 To: Navdeep Parhar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 06:34:35 -0000 On October 28, 2014 11:24:13 PM PDT, Navdeep Parhar wrote: >Author: np >Date: Wed Oct 29 06:24:12 2014 >New Revision: 273811 >URL: https://svnweb.freebsd.org/changeset/base/273811 > >Log: > rping: make sure that the CQ event thread can never poll a CQ after it > has been destroyed. > > Submitted by: Hariprasad at Chelsio dot com > Sponsored by: Chelsio Communications > Is this change present upstream? We really should be tracking the originating repositories when making changes in OFED packages, but the kernel and userspace is several years out of date from what OFED is tracking currently. [1] http://git.openfabrics.org/?p=~shefty/librdmacm.git;a=summary >Modified: > head/contrib/ofed/librdmacm/examples/rping.c > >Modified: head/contrib/ofed/librdmacm/examples/rping.c >============================================================================== >--- head/contrib/ofed/librdmacm/examples/rping.c Wed Oct 29 04:32:46 >2014 (r273810) >+++ head/contrib/ofed/librdmacm/examples/rping.c Wed Oct 29 06:24:12 >2014 (r273811) >@@ -40,7 +40,6 @@ > #include > #include > #include >-#include > #include > #include > #include >@@ -280,10 +279,10 @@ static int rping_cq_event_handler(struct > ret = 0; > > if (wc.status) { >- fprintf(stderr, "cq completion failed status %d\n", >- wc.status); > if (wc.status != IBV_WC_WR_FLUSH_ERR) >- ret = -1; >+ fprintf(stderr, "cq completion failed status %d\n", >+ wc.status); >+ ret = -1; > goto error; > } > >@@ -800,10 +799,9 @@ static void *rping_persistent_server_thr > > rping_test_server(cb); > rdma_disconnect(cb->child_cm_id); >+ pthread_join(cb->cqthread, NULL); > rping_free_buffers(cb); > rping_free_qp(cb); >- pthread_cancel(cb->cqthread); >- pthread_join(cb->cqthread, NULL); > rdma_destroy_id(cb->child_cm_id); > free_cb(cb); > return NULL; >@@ -888,6 +886,7 @@ static int rping_run_server(struct rping > > rping_test_server(cb); > rdma_disconnect(cb->child_cm_id); >+ pthread_join(cb->cqthread, NULL); > rdma_destroy_id(cb->child_cm_id); > err2: > rping_free_buffers(cb); >@@ -1053,9 +1052,16 @@ static int rping_run_client(struct rping > goto err2; > } > >- rping_test_client(cb); >+ ret = rping_test_client(cb); >+ if (ret) { >+ fprintf(stderr, "rping client failed: %d\n", ret); >+ goto err3; >+ } >+ ret = 0; >+err3: > rdma_disconnect(cb->cm_id); > err2: >+ pthread_join(cb->cqthread, NULL); > rping_free_buffers(cb); > err1: > rping_free_qp(cb); >_______________________________________________ >svn-src-head@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/svn-src-head >To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 06:38:08 2014 Return-Path: Delivered-To: svn-src-all@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 CB540FA6; Wed, 29 Oct 2014 06:38:08 +0000 (UTC) Received: from mail-pd0-x229.google.com (mail-pd0-x229.google.com [IPv6:2607:f8b0:400e:c02::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92B01836; Wed, 29 Oct 2014 06:38:08 +0000 (UTC) Received: by mail-pd0-f169.google.com with SMTP id y10so2363567pdj.14 for ; Tue, 28 Oct 2014 23:38:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=pR0/T+j/3v2iBKjCXWe2hzEfOfsyrELE2Nzo/ASNR+E=; b=qbPwQxKmJmXhslwUL4z2xgqE9G6czyQOh/fX7097Bru+C5Tc+YWZawdPrk7jklLwPB 7HuWPUTwiG/+yc5gKKh5CKOB8XMQIDp4J2WkvCxSKgTlXo7e9PF+YXGnPlG6ocN6iqzQ xz0ONczzWgyD2YdK+/T1hDil8yLo80PhHvXlo5f9PYKqtf/6/wsttqRbTdo+9GoxRhM2 jJwWPEc8l1KDOHcCo3iJmWC0PLtqbnFKLnThZZ25GLniY/DjnsK6CG1K5MeqADO9Bo4V Rm3Ir+82GnNyapDkgioo7A5BEmrnT0g17bfgOEvDfWzg380PFnyfMTbS3pK2r+BSsc1k aUMQ== X-Received: by 10.70.22.195 with SMTP id g3mr8423487pdf.37.1414564688218; Tue, 28 Oct 2014 23:38:08 -0700 (PDT) Received: from ox ([24.6.44.228]) by mx.google.com with ESMTPSA id z15sm3367299pdi.6.2014.10.28.23.38.05 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 28 Oct 2014 23:38:07 -0700 (PDT) Sender: Navdeep Parhar Date: Tue, 28 Oct 2014 23:38:01 -0700 From: Navdeep Parhar To: Anthony Cornehl Subject: Re: svn commit: r273811 - head/contrib/ofed/librdmacm/examples Message-ID: <20141029063729.GA7077@ox> Mail-Followup-To: Anthony Cornehl , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201410290624.s9T6OD1a038594@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.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 06:38:08 -0000 On Tue, Oct 28, 2014 at 11:34:11PM -0700, Anthony Cornehl wrote: > On October 28, 2014 11:24:13 PM PDT, Navdeep Parhar wrote: > >Author: np > >Date: Wed Oct 29 06:24:12 2014 > >New Revision: 273811 > >URL: https://svnweb.freebsd.org/changeset/base/273811 > > > >Log: > > rping: make sure that the CQ event thread can never poll a CQ after it > > has been destroyed. > > > > Submitted by: Hariprasad at Chelsio dot com > > Sponsored by: Chelsio Communications > > > > Is this change present upstream? We really should be tracking the originating > repositories when making changes in OFED packages, but the kernel and > userspace is several years out of date from what OFED is tracking currently. The patch was submitted upstream. I'm sure it'll get there eventually. Navdeep > > [1] http://git.openfabrics.org/?p=~shefty/librdmacm.git;a=summary > > >Modified: > > head/contrib/ofed/librdmacm/examples/rping.c > > > >Modified: head/contrib/ofed/librdmacm/examples/rping.c > >============================================================================== > >--- head/contrib/ofed/librdmacm/examples/rping.c Wed Oct 29 04:32:46 > >2014 (r273810) > >+++ head/contrib/ofed/librdmacm/examples/rping.c Wed Oct 29 06:24:12 > >2014 (r273811) > >@@ -40,7 +40,6 @@ > > #include > > #include > > #include > >-#include > > #include > > #include > > #include > >@@ -280,10 +279,10 @@ static int rping_cq_event_handler(struct > > ret = 0; > > > > if (wc.status) { > >- fprintf(stderr, "cq completion failed status %d\n", > >- wc.status); > > if (wc.status != IBV_WC_WR_FLUSH_ERR) > >- ret = -1; > >+ fprintf(stderr, "cq completion failed status %d\n", > >+ wc.status); > >+ ret = -1; > > goto error; > > } > > > >@@ -800,10 +799,9 @@ static void *rping_persistent_server_thr > > > > rping_test_server(cb); > > rdma_disconnect(cb->child_cm_id); > >+ pthread_join(cb->cqthread, NULL); > > rping_free_buffers(cb); > > rping_free_qp(cb); > >- pthread_cancel(cb->cqthread); > >- pthread_join(cb->cqthread, NULL); > > rdma_destroy_id(cb->child_cm_id); > > free_cb(cb); > > return NULL; > >@@ -888,6 +886,7 @@ static int rping_run_server(struct rping > > > > rping_test_server(cb); > > rdma_disconnect(cb->child_cm_id); > >+ pthread_join(cb->cqthread, NULL); > > rdma_destroy_id(cb->child_cm_id); > > err2: > > rping_free_buffers(cb); > >@@ -1053,9 +1052,16 @@ static int rping_run_client(struct rping > > goto err2; > > } > > > >- rping_test_client(cb); > >+ ret = rping_test_client(cb); > >+ if (ret) { > >+ fprintf(stderr, "rping client failed: %d\n", ret); > >+ goto err3; > >+ } > >+ ret = 0; > >+err3: > > rdma_disconnect(cb->cm_id); > > err2: > >+ pthread_join(cb->cqthread, NULL); > > rping_free_buffers(cb); > > err1: > > rping_free_qp(cb); > >_______________________________________________ > >svn-src-head@freebsd.org mailing list > >http://lists.freebsd.org/mailman/listinfo/svn-src-head > >To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > > > From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 06:47:47 2014 Return-Path: Delivered-To: svn-src-all@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 064C224A for ; Wed, 29 Oct 2014 06:47:47 +0000 (UTC) Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com [66.111.4.221]) (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 BE79690C for ; Wed, 29 Oct 2014 06:47:46 +0000 (UTC) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id 922702725 for ; Wed, 29 Oct 2014 02:47:45 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Wed, 29 Oct 2014 02:47:45 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.fm; h= x-sasl-enc:in-reply-to:references:mime-version :content-transfer-encoding:content-type:subject:from:date:to:cc :message-id; s=mesmtp; bh=xCjs35M3ryBbz8xpnLt2283NzCA=; b=OhC1ei lec2C+uSM4CtE+9Ok8Icmde4Cyx7Hnei0bYgEr8d0sFzjlcmJzW3HLKqo0nypzDj MiYwKSrXJJKHjSTuyBmMbNJyaoYbSZJJuUmvR9YJBqNJc27rdYwZ5I2EF9GtpyIN /UwmeBVRmwE01PcGOPYnUUrPoJlfdgycEQEmA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:in-reply-to:references :mime-version:content-transfer-encoding:content-type:subject :from:date:to:cc:message-id; s=smtpout; bh=xCjs35M3ryBbz8xpnLt22 83NzCA=; b=X9tX+ri1Rwtm34NOotFEkbFMhWoAtNR8Dv1W0lIT3816zwYrJYZeb MySpF21Em3ygEJ5G1B0oguHTXokdmm3j+6PGQJVzDqy5Gds1gdSdrSTPfgJpm4Y+ rZVIbsL9dfNPfbeISg/WNwDqONU556AdApTiTobXMpReA/i9uXoRkg= X-Sasl-enc: AA5yk2K6euDYYmFH5rjr0Squ2A4biLMls1aPosrm+9l7 1414565264 Received: from [192.168.0.110] (unknown [174.24.231.159]) by mail.messagingengine.com (Postfix) with ESMTPA id 6619E6800EC; Wed, 29 Oct 2014 02:47:43 -0400 (EDT) User-Agent: K-9 Mail for Android In-Reply-To: <20141029063729.GA7077@ox> References: <201410290624.s9T6OD1a038594@svn.freebsd.org> <20141029063729.GA7077@ox> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: svn commit: r273811 - head/contrib/ofed/librdmacm/examples From: Anthony Cornehl Date: Tue, 28 Oct 2014 23:47:29 -0700 To: Navdeep Parhar Message-ID: <2773FEBA-554C-4035-A27B-0F1DEBB98ED3@fastmail.fm> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 06:47:47 -0000 On October 28, 2014 11:38:01 PM PDT, Navdeep Parhar wrote: >On Tue, Oct 28, 2014 at 11:34:11PM -0700, Anthony Cornehl wrote: >> On October 28, 2014 11:24:13 PM PDT, Navdeep Parhar >wrote: >> >Author: np >> >Date: Wed Oct 29 06:24:12 2014 >> >New Revision: 273811 >> >URL: https://svnweb.freebsd.org/changeset/base/273811 >> > >> >Log: >> > rping: make sure that the CQ event thread can never poll a CQ after >it >> > has been destroyed. >> > >> > Submitted by: Hariprasad at Chelsio dot com >> > Sponsored by: Chelsio Communications >> > >> >> Is this change present upstream? We really should be tracking the >originating >> repositories when making changes in OFED packages, but the kernel and >> userspace is several years out of date from what OFED is tracking >currently. > >The patch was submitted upstream. I'm sure it'll get there eventually. > >Navdeep > Awesome! Thanks for fixing this. >> >> [1] http://git.openfabrics.org/?p=~shefty/librdmacm.git;a=summary >> >> >Modified: >> > head/contrib/ofed/librdmacm/examples/rping.c >> > >> >Modified: head/contrib/ofed/librdmacm/examples/rping.c >> >>============================================================================== >> >--- head/contrib/ofed/librdmacm/examples/rping.c Wed Oct 29 04:32:46 >> >2014 (r273810) >> >+++ head/contrib/ofed/librdmacm/examples/rping.c Wed Oct 29 06:24:12 >> >2014 (r273811) >> >@@ -40,7 +40,6 @@ >> > #include >> > #include >> > #include >> >-#include >> > #include >> > #include >> > #include >> >@@ -280,10 +279,10 @@ static int rping_cq_event_handler(struct >> > ret = 0; >> > >> > if (wc.status) { >> >- fprintf(stderr, "cq completion failed status %d\n", >> >- wc.status); >> > if (wc.status != IBV_WC_WR_FLUSH_ERR) >> >- ret = -1; >> >+ fprintf(stderr, "cq completion failed status %d\n", >> >+ wc.status); >> >+ ret = -1; >> > goto error; >> > } >> > >> >@@ -800,10 +799,9 @@ static void *rping_persistent_server_thr >> > >> > rping_test_server(cb); >> > rdma_disconnect(cb->child_cm_id); >> >+ pthread_join(cb->cqthread, NULL); >> > rping_free_buffers(cb); >> > rping_free_qp(cb); >> >- pthread_cancel(cb->cqthread); >> >- pthread_join(cb->cqthread, NULL); >> > rdma_destroy_id(cb->child_cm_id); >> > free_cb(cb); >> > return NULL; >> >@@ -888,6 +886,7 @@ static int rping_run_server(struct rping >> > >> > rping_test_server(cb); >> > rdma_disconnect(cb->child_cm_id); >> >+ pthread_join(cb->cqthread, NULL); >> > rdma_destroy_id(cb->child_cm_id); >> > err2: >> > rping_free_buffers(cb); >> >@@ -1053,9 +1052,16 @@ static int rping_run_client(struct rping >> > goto err2; >> > } >> > >> >- rping_test_client(cb); >> >+ ret = rping_test_client(cb); >> >+ if (ret) { >> >+ fprintf(stderr, "rping client failed: %d\n", ret); >> >+ goto err3; >> >+ } >> >+ ret = 0; >> >+err3: >> > rdma_disconnect(cb->cm_id); >> > err2: >> >+ pthread_join(cb->cqthread, NULL); >> > rping_free_buffers(cb); >> > err1: >> > rping_free_qp(cb); >> >_______________________________________________ >> >svn-src-head@freebsd.org mailing list >> >http://lists.freebsd.org/mailman/listinfo/svn-src-head >> >To unsubscribe, send any mail to >"svn-src-head-unsubscribe@freebsd.org" >> >> >> From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 08:35:11 2014 Return-Path: Delivered-To: svn-src-all@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 818E3A56; Wed, 29 Oct 2014 08:35:11 +0000 (UTC) Received: from frv155.fwdcdn.com (frv155.fwdcdn.com [212.42.77.155]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3ED2E5E6; Wed, 29 Oct 2014 08:35:11 +0000 (UTC) Received: from [10.10.10.25] (helo=frv152.fwdcdn.com) by frv155.fwdcdn.com QID:1XjOSZ-000NXb-8S/RC:5; Wed, 29 Oct 2014 10:18:27 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=ovgirpgZGa8V/XVYVorWIzbebc7XoSJ8DRrtZgDR20Y=; b=ur1MhnmzONiSsNL+aWBNfL3JnlhNxyai3F48ueB4rHNBwpYafmjNWYPkYVnkfiC8Z5GTT1P+oML0iJAYfZGnXYA9qd0RV2k7rhyJJJmkp3Amd5ULeQB4zPx84hBD17Izr4EJm6xGxd1SYu7PDuXjGlIw8UAYWRP05xOdjFV9How=; Received: from [5.248.240.192] (helo=nonamehost.local) by frv152.fwdcdn.com with esmtpsa ID 1XjOSM-000Eqi-0z ; Wed, 29 Oct 2014 10:18:14 +0200 Date: Wed, 29 Oct 2014 10:18:13 +0200 From: Ivan Klymenko To: Alexander Motin Subject: Re: svn commit: r273805 - stable/10/share/man/man4 Message-ID: <20141029101813.486e5518@nonamehost.local> In-Reply-To: <201410290027.s9T0R31i070859@svn.freebsd.org> References: <201410290027.s9T0R31i070859@svn.freebsd.org> X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.22; amd64-portbld-freebsd10.1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Authentication-Result: IP=5.248.240.192; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-Ukrnet-Yellow: 0 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 08:35:11 -0000 =D0=92 Wed, 29 Oct 2014 00:27:03 +0000 (UTC) Alexander Motin =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > Author: mav > Date: Wed Oct 29 00:27:02 2014 > New Revision: 273805 > URL: https://svnweb.freebsd.org/changeset/base/273805 >=20 > Log: > MFC r273457: Document sort_io_queue sysctls/tunables. >=20 Thanks! From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 09:26:58 2014 Return-Path: Delivered-To: svn-src-all@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 2988A65D; Wed, 29 Oct 2014 09:26: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 0ACFAB25; Wed, 29 Oct 2014 09:26: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 s9T9QvaT023398; Wed, 29 Oct 2014 09:26:57 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9T9Qu4E023387; Wed, 29 Oct 2014 09:26:56 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410290926.s9T9Qu4E023387@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 29 Oct 2014 09:26:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273813 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 09:26:58 -0000 Author: trasz Date: Wed Oct 29 09:26:55 2014 New Revision: 273813 URL: https://svnweb.freebsd.org/changeset/base/273813 Log: Add discovery-filter. This makes it possible to restrict which targets are returned during discovery based on initiator portal, name, and CHAP credentials. Reviewed by: mav@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctl.conf.5 head/usr.sbin/ctld/ctld.c head/usr.sbin/ctld/ctld.h head/usr.sbin/ctld/discovery.c head/usr.sbin/ctld/login.c head/usr.sbin/ctld/parse.y head/usr.sbin/ctld/token.l Modified: head/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- head/usr.sbin/ctld/ctl.conf.5 Wed Oct 29 09:06:05 2014 (r273812) +++ head/usr.sbin/ctld/ctl.conf.5 Wed Oct 29 09:26:55 2014 (r273813) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 28, 2014 +.Dd October 29, 2014 .Dt CTL.CONF 5 .Os .Sh NAME @@ -175,6 +175,43 @@ Another predefined .Qq Ar no-authentication , may be used to permit discovery without authentication. +.It Ic discovery-filter Ar filter +Determines which targets are returned during discovery. +Filter can be either +.Qq Ar none , +.Qq Ar portal , +.Qq Ar portal-name , +or +.Qq Ar portal-name-auth . +When set to +.Qq Ar none , +discovery will return all targets assigned to that portal group. +When set to +.Qq Ar portal , +discovery will not return targets that cannot be accessed by the +initiator because of their +.Sy initiator-portal . +When set to +.Qq Ar portal-name , +the check will include both +.Sy initiator-portal +and +.Sy initiator-name . +When set to +.Qq Ar portal-name-auth , +the check will include +.Sy initiator-portal , +.Sy initiator-name , +and authentication credentials, ie. if the target does not require +CHAP authentication, or if CHAP user and secret used during discovery +match CHAP user and secret required to access the target. +Note that when using +.Qq Ar portal-name-auth , +targets that require CHAP authentication will only be returned if +.Sy discovery-auth-group +requires CHAP. +The default is +.Qq Ar none . .It Ic listen Ar address An IPv4 or IPv6 address and port to listen on for incoming connections. .\".It Ic listen-iser Ar address Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Wed Oct 29 09:06:05 2014 (r273812) +++ head/usr.sbin/ctld/ctld.c Wed Oct 29 09:26:55 2014 (r273813) @@ -979,6 +979,53 @@ isns_deregister(struct isns *isns) set_timeout(0, false); } +static int +portal_group_set_filter(struct portal_group *pg, int filter) +{ + + if (pg->pg_discovery_filter == PG_FILTER_UNKNOWN) { + pg->pg_discovery_filter = filter; + return (0); + } + + if (pg->pg_discovery_filter == filter) + return (0); + + return (1); +} + +int +portal_group_set_filter_str(struct portal_group *pg, const char *str) +{ + int error, filter; + + if (strcmp(str, "none") == 0) { + filter = PG_FILTER_NONE; + } else if (strcmp(str, "portal") == 0) { + filter = PG_FILTER_PORTAL; + } else if (strcmp(str, "portal-name") == 0) { + filter = PG_FILTER_PORTAL_NAME; + } else if (strcmp(str, "portal-name-auth") == 0) { + filter = PG_FILTER_PORTAL_NAME_AUTH; + } else { + log_warnx("invalid discovery-filter \"%s\" for portal-group " + "\"%s\"; valid values are \"none\", \"portal\", " + "\"portal-name\", and \"portal-name-auth\"", + str, pg->pg_name); + return (1); + } + + error = portal_group_set_filter(pg, filter); + if (error != 0) { + log_warnx("cannot set discovery-filter to \"%s\" for " + "portal-group \"%s\"; already has a different " + "value", str, pg->pg_name); + return (1); + } + + return (error); +} + static bool valid_hex(const char ch) { @@ -1478,6 +1525,9 @@ conf_verify(struct conf *conf) assert(pg->pg_discovery_auth_group != NULL); } + if (pg->pg_discovery_filter == PG_FILTER_UNKNOWN) + pg->pg_discovery_filter = PG_FILTER_NONE; + TAILQ_FOREACH(targ, &conf->conf_targets, t_next) { if (targ->t_portal_group == pg) break; Modified: head/usr.sbin/ctld/ctld.h ============================================================================== --- head/usr.sbin/ctld/ctld.h Wed Oct 29 09:06:05 2014 (r273812) +++ head/usr.sbin/ctld/ctld.h Wed Oct 29 09:26:55 2014 (r273813) @@ -103,11 +103,18 @@ struct portal { int p_socket; }; +#define PG_FILTER_UNKNOWN 0 +#define PG_FILTER_NONE 1 +#define PG_FILTER_PORTAL 2 +#define PG_FILTER_PORTAL_NAME 3 +#define PG_FILTER_PORTAL_NAME_AUTH 4 + struct portal_group { TAILQ_ENTRY(portal_group) pg_next; struct conf *pg_conf; char *pg_name; struct auth_group *pg_discovery_auth_group; + int pg_discovery_filter; bool pg_unassigned; TAILQ_HEAD(, portal) pg_portals; @@ -200,6 +207,8 @@ struct connection { int conn_immediate_data; int conn_header_digest; int conn_data_digest; + const char *conn_user; + struct chap *conn_chap; }; struct pdu { @@ -290,6 +299,8 @@ struct portal_group *portal_group_find(c const char *name); int portal_group_add_listen(struct portal_group *pg, const char *listen, bool iser); +int portal_group_set_filter_str(struct portal_group *pg, + const char *filter); int isns_new(struct conf *conf, const char *addr); void isns_delete(struct isns *is); Modified: head/usr.sbin/ctld/discovery.c ============================================================================== --- head/usr.sbin/ctld/discovery.c Wed Oct 29 09:06:05 2014 (r273812) +++ head/usr.sbin/ctld/discovery.c Wed Oct 29 09:26:55 2014 (r273813) @@ -201,6 +201,65 @@ discovery_add_target(struct keys *respon } } +static bool +discovery_target_filtered_out(const struct connection *conn, + const struct target *targ) +{ + const struct auth_group *ag; + const struct portal_group *pg; + const struct auth *auth; + int error; + + ag = targ->t_auth_group; + pg = conn->conn_portal->p_portal_group; + + assert(pg->pg_discovery_auth_group != PG_FILTER_UNKNOWN); + + if (pg->pg_discovery_filter >= PG_FILTER_PORTAL && + auth_portal_check(ag, &conn->conn_initiator_sa) != 0) { + log_debugx("initiator does not match initiator portals " + "allowed for target \"%s\"; skipping", targ->t_name); + return (true); + } + + if (pg->pg_discovery_filter >= PG_FILTER_PORTAL_NAME && + auth_name_check(ag, conn->conn_initiator_name) != 0) { + log_debugx("initiator does not match initiator names " + "allowed for target \"%s\"; skipping", targ->t_name); + return (true); + } + + if (pg->pg_discovery_filter >= PG_FILTER_PORTAL_NAME_AUTH && + ag->ag_type != AG_TYPE_NO_AUTHENTICATION) { + if (conn->conn_chap == NULL) { + assert(pg->pg_discovery_auth_group->ag_type == + AG_TYPE_NO_AUTHENTICATION); + + log_debugx("initiator didn't authenticate, but target " + "\"%s\" requires CHAP; skipping", targ->t_name); + return (true); + } + + assert(conn->conn_user != NULL); + auth = auth_find(ag, conn->conn_user); + if (auth == NULL) { + log_debugx("CHAP user \"%s\" doesn't match target " + "\"%s\"; skipping", conn->conn_user, targ->t_name); + return (true); + } + + error = chap_authenticate(conn->conn_chap, auth->a_secret); + if (error != 0) { + log_debugx("password for CHAP user \"%s\" doesn't " + "match target \"%s\"; skipping", + conn->conn_user, targ->t_name); + return (true); + } + } + + return (false); +} + void discovery(struct connection *conn) { @@ -232,6 +291,10 @@ discovery(struct connection *conn) targ->t_name); continue; } + if (discovery_target_filtered_out(conn, targ)) { + /* Ignore this target. */ + continue; + } discovery_add_target(response_keys, targ); } } else { @@ -239,8 +302,13 @@ discovery(struct connection *conn) if (targ == NULL) { log_debugx("initiator requested information on unknown " "target \"%s\"; returning nothing", send_targets); - } else - discovery_add_target(response_keys, targ); + } else { + if (discovery_target_filtered_out(conn, targ)) { + /* Ignore this target. */ + } else { + discovery_add_target(response_keys, targ); + } + } } keys_save(response_keys, response); Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Wed Oct 29 09:06:05 2014 (r273812) +++ head/usr.sbin/ctld/login.c Wed Oct 29 09:26:55 2014 (r273813) @@ -441,7 +441,12 @@ login_chap(struct connection *conn, stru "transitioning to Negotiation Phase", auth->a_user); login_send_chap_success(request, auth); pdu_delete(request); - chap_delete(chap); + + /* + * Leave username and CHAP information for discovery(). + */ + conn->conn_user = auth->a_user; + conn->conn_chap = chap; } static void Modified: head/usr.sbin/ctld/parse.y ============================================================================== --- head/usr.sbin/ctld/parse.y Wed Oct 29 09:06:05 2014 (r273812) +++ head/usr.sbin/ctld/parse.y Wed Oct 29 09:26:55 2014 (r273813) @@ -58,10 +58,10 @@ extern void yyrestart(FILE *); %} %token ALIAS AUTH_GROUP AUTH_TYPE BACKEND BLOCKSIZE CHAP CHAP_MUTUAL -%token CLOSING_BRACKET DEBUG DEVICE_ID DISCOVERY_AUTH_GROUP INITIATOR_NAME -%token INITIATOR_PORTAL LISTEN LISTEN_ISER LUN MAXPROC OPENING_BRACKET -%token OPTION PATH PIDFILE PORTAL_GROUP SERIAL SIZE STR TARGET TIMEOUT -%token ISNS_SERVER ISNS_PERIOD ISNS_TIMEOUT +%token CLOSING_BRACKET DEBUG DEVICE_ID DISCOVERY_AUTH_GROUP DISCOVERY_FILTER +%token INITIATOR_NAME INITIATOR_PORTAL LISTEN LISTEN_ISER LUN MAXPROC +%token OPENING_BRACKET OPTION PATH PIDFILE PORTAL_GROUP SERIAL SIZE STR +%token TARGET TIMEOUT ISNS_SERVER ISNS_PERIOD ISNS_TIMEOUT %union { @@ -327,6 +327,8 @@ portal_group_entries: portal_group_entry: portal_group_discovery_auth_group | + portal_group_discovery_filter + | portal_group_listen | portal_group_listen_iser @@ -352,6 +354,17 @@ portal_group_discovery_auth_group: DISCO } ; +portal_group_discovery_filter: DISCOVERY_FILTER STR + { + int error; + + error = portal_group_set_filter_str(portal_group, $2); + free($2); + if (error != 0) + return (1); + } + ; + portal_group_listen: LISTEN STR { int error; Modified: head/usr.sbin/ctld/token.l ============================================================================== --- head/usr.sbin/ctld/token.l Wed Oct 29 09:06:05 2014 (r273812) +++ head/usr.sbin/ctld/token.l Wed Oct 29 09:26:55 2014 (r273813) @@ -58,6 +58,7 @@ chap-mutual { return CHAP_MUTUAL; } debug { return DEBUG; } device-id { return DEVICE_ID; } discovery-auth-group { return DISCOVERY_AUTH_GROUP; } +discovery-filter { return DISCOVERY_FILTER; } initiator-name { return INITIATOR_NAME; } initiator-portal { return INITIATOR_PORTAL; } listen { return LISTEN; } From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 09:27:25 2014 Return-Path: Delivered-To: svn-src-all@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 B3E527EC; Wed, 29 Oct 2014 09:27: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 9FF01B37; Wed, 29 Oct 2014 09:27: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 s9T9RPb8023517; Wed, 29 Oct 2014 09:27:25 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9T9RPKE023516; Wed, 29 Oct 2014 09:27:25 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201410290927.s9T9RPKE023516@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Wed, 29 Oct 2014 09:27:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273814 - stable/10/sys/cam/ata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 09:27:25 -0000 Author: smh Date: Wed Oct 29 09:27:24 2014 New Revision: 273814 URL: https://svnweb.freebsd.org/changeset/base/273814 Log: MFC: r273704 Fix CF ERASE breakage caused by 268205. Sponsored by: Multiplay Modified: stable/10/sys/cam/ata/ata_da.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ata/ata_da.c ============================================================================== --- stable/10/sys/cam/ata/ata_da.c Wed Oct 29 09:26:55 2014 (r273813) +++ stable/10/sys/cam/ata/ata_da.c Wed Oct 29 09:27:24 2014 (r273814) @@ -1467,9 +1467,15 @@ ada_dsmtrim(struct ada_softc *softc, str static void ada_cfaerase(struct ada_softc *softc, struct bio *bp, struct ccb_ataio *ataio) { + struct trim_request *req = &softc->trim_req; uint64_t lba = bp->bio_pblkno; uint16_t count = bp->bio_bcount / softc->params.secsize; + bzero(req, sizeof(*req)); + TAILQ_INIT(&req->bps); + bioq_remove(&softc->trim_queue, bp); + TAILQ_INSERT_TAIL(&req->bps, bp, bio_queue); + cam_fill_ataio(ataio, ada_retry_count, adadone, From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 09:32:37 2014 Return-Path: Delivered-To: svn-src-all@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 3F9359DE; Wed, 29 Oct 2014 09:32: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 2B2BFC08; Wed, 29 Oct 2014 09:32: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 s9T9WbFA027643; Wed, 29 Oct 2014 09:32:37 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9T9Wbjx027642; Wed, 29 Oct 2014 09:32:37 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201410290932.s9T9Wbjx027642@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Wed, 29 Oct 2014 09:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273815 - stable/10/contrib/pf/authpf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 09:32:37 -0000 Author: pluknet Date: Wed Oct 29 09:32:36 2014 New Revision: 273815 URL: https://svnweb.freebsd.org/changeset/base/273815 Log: MFC r261271: Ressurect the local change documenting authpf's requirement for a mounted fdescfs(5). PR: docs/186250 Modified: stable/10/contrib/pf/authpf/authpf.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/pf/authpf/authpf.8 ============================================================================== --- stable/10/contrib/pf/authpf/authpf.8 Wed Oct 29 09:27:24 2014 (r273814) +++ stable/10/contrib/pf/authpf/authpf.8 Wed Oct 29 09:32:36 2014 (r273815) @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd January 6 2009 +.Dd January 29 2014 .Dt AUTHPF 8 .Os .Sh NAME @@ -43,7 +43,11 @@ It is meant to be used with users who ca .Xr ssh 1 only, and requires the .Xr pf 4 -subsystem to be enabled. +subsystem and an +.Xr fdescfs 5 +file system mounted at +.Pa /dev/fd +to be enabled. .Pp .Nm authpf-noip is a user shell @@ -558,6 +562,7 @@ pass out on $internal_if from (self) to .El .Sh SEE ALSO .Xr pf 4 , +.Xr fdescfs 5 , .Xr pf.conf 5 , .Xr securelevel 7 , .Xr ftp-proxy 8 From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 09:36:04 2014 Return-Path: Delivered-To: svn-src-all@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 2E2E3D52; Wed, 29 Oct 2014 09:36: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 10E5CC3E; Wed, 29 Oct 2014 09:36: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 s9T9a3QZ028163; Wed, 29 Oct 2014 09:36:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9T9a39F028158; Wed, 29 Oct 2014 09:36:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410290936.s9T9a39F028158@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 29 Oct 2014 09:36:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273816 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 09:36:04 -0000 Author: trasz Date: Wed Oct 29 09:36:02 2014 New Revision: 273816 URL: https://svnweb.freebsd.org/changeset/base/273816 Log: Simplify code; no functional changes. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctld.c head/usr.sbin/ctld/ctld.h head/usr.sbin/ctld/parse.y Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Wed Oct 29 09:32:36 2014 (r273815) +++ head/usr.sbin/ctld/ctld.c Wed Oct 29 09:36:02 2014 (r273816) @@ -522,25 +522,10 @@ auth_group_find(const struct conf *conf, return (NULL); } -static int -auth_group_set_type(struct auth_group *ag, int type) -{ - - if (ag->ag_type == AG_TYPE_UNKNOWN) { - ag->ag_type = type; - return (0); - } - - if (ag->ag_type == type) - return (0); - - return (1); -} - int -auth_group_set_type_str(struct auth_group *ag, const char *str) +auth_group_set_type(struct auth_group *ag, const char *str) { - int error, type; + int type; if (strcmp(str, "none") == 0) { type = AG_TYPE_NO_AUTHENTICATION; @@ -560,20 +545,22 @@ auth_group_set_type_str(struct auth_grou return (1); } - error = auth_group_set_type(ag, type); - if (error != 0) { - if (ag->ag_name != NULL) + if (ag->ag_type != AG_TYPE_UNKNOWN && ag->ag_type != type) { + if (ag->ag_name != NULL) { log_warnx("cannot set auth-type to \"%s\" for " "auth-group \"%s\"; already has a different " "type", str, ag->ag_name); - else + } else { log_warnx("cannot set auth-type to \"%s\" for target " "\"%s\"; already has a different type", str, ag->ag_target->t_name); + } return (1); } - return (error); + ag->ag_type = type; + + return (0); } static struct portal * @@ -979,25 +966,10 @@ isns_deregister(struct isns *isns) set_timeout(0, false); } -static int -portal_group_set_filter(struct portal_group *pg, int filter) -{ - - if (pg->pg_discovery_filter == PG_FILTER_UNKNOWN) { - pg->pg_discovery_filter = filter; - return (0); - } - - if (pg->pg_discovery_filter == filter) - return (0); - - return (1); -} - int -portal_group_set_filter_str(struct portal_group *pg, const char *str) +portal_group_set_filter(struct portal_group *pg, const char *str) { - int error, filter; + int filter; if (strcmp(str, "none") == 0) { filter = PG_FILTER_NONE; @@ -1015,15 +987,17 @@ portal_group_set_filter_str(struct porta return (1); } - error = portal_group_set_filter(pg, filter); - if (error != 0) { + if (pg->pg_discovery_filter != PG_FILTER_UNKNOWN && + pg->pg_discovery_filter != filter) { log_warnx("cannot set discovery-filter to \"%s\" for " "portal-group \"%s\"; already has a different " "value", str, pg->pg_name); return (1); } - return (error); + pg->pg_discovery_filter = filter; + + return (0); } static bool Modified: head/usr.sbin/ctld/ctld.h ============================================================================== --- head/usr.sbin/ctld/ctld.h Wed Oct 29 09:32:36 2014 (r273815) +++ head/usr.sbin/ctld/ctld.h Wed Oct 29 09:36:02 2014 (r273816) @@ -266,7 +266,7 @@ struct auth_group *auth_group_new(struct void auth_group_delete(struct auth_group *ag); struct auth_group *auth_group_find(const struct conf *conf, const char *name); -int auth_group_set_type_str(struct auth_group *ag, +int auth_group_set_type(struct auth_group *ag, const char *type); const struct auth *auth_new_chap(struct auth_group *ag, @@ -299,7 +299,7 @@ struct portal_group *portal_group_find(c const char *name); int portal_group_add_listen(struct portal_group *pg, const char *listen, bool iser); -int portal_group_set_filter_str(struct portal_group *pg, +int portal_group_set_filter(struct portal_group *pg, const char *filter); int isns_new(struct conf *conf, const char *addr); Modified: head/usr.sbin/ctld/parse.y ============================================================================== --- head/usr.sbin/ctld/parse.y Wed Oct 29 09:32:36 2014 (r273815) +++ head/usr.sbin/ctld/parse.y Wed Oct 29 09:36:02 2014 (r273816) @@ -238,7 +238,7 @@ auth_group_auth_type: AUTH_TYPE STR { int error; - error = auth_group_set_type_str(auth_group, $2); + error = auth_group_set_type(auth_group, $2); free($2); if (error != 0) return (1); @@ -358,7 +358,7 @@ portal_group_discovery_filter: DISCOVERY { int error; - error = portal_group_set_filter_str(portal_group, $2); + error = portal_group_set_filter(portal_group, $2); free($2); if (error != 0) return (1); @@ -480,7 +480,7 @@ target_auth_type: AUTH_TYPE STR } target->t_auth_group->ag_target = target; } - error = auth_group_set_type_str(target->t_auth_group, $2); + error = auth_group_set_type(target->t_auth_group, $2); free($2); if (error != 0) return (1); From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 09:56:11 2014 Return-Path: Delivered-To: svn-src-all@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 8545059C; Wed, 29 Oct 2014 09:56:11 +0000 (UTC) Received: from mail-lb0-x22e.google.com (mail-lb0-x22e.google.com [IPv6:2a00:1450:4010:c04::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 744B5EA7; Wed, 29 Oct 2014 09:56:10 +0000 (UTC) Received: by mail-lb0-f174.google.com with SMTP id z11so164601lbi.5 for ; Wed, 29 Oct 2014 02:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=kl5CEm5o6cLSWA6UMF3miXYMPGpHL15xYKMHUiQXij4=; b=wIcIM0kpWfdaS7L0TQQ2tODKLmMyAMZJjPzbAzGPOadG1c8KuWVd6sUzVezwQrutDB zpDy7b7Qj8LbGMK7rEf0W/wAuydjauJpVfVYjPUtQa3aQEnAstNyGKrlghWzXJFuN+Mq EwB2xEyUbxWj908fyJOTRjQN/XihLKgCK2mDoKeyYjgjzDnjgwu4o5NK6rT4Qu7kCxhy BQtmI34cMCknVnBJ+NfaPIEuo//JfsTZKPluR51WtMrHYMuI3g/FOw0U5xqsx/eShJH7 OaJ1BbQjaYOTCRxYqpTrmkqHiEWIM9UTdWpWG26C+seZnTMGRgQh2Y717vV5xrDlfuKy iWXg== X-Received: by 10.112.97.175 with SMTP id eb15mr10199989lbb.12.1414576568364; Wed, 29 Oct 2014 02:56:08 -0700 (PDT) Received: from brick.home (adbe233.neoplus.adsl.tpnet.pl. [79.184.4.233]) by mx.google.com with ESMTPSA id je9sm1731711lbc.3.2014.10.29.02.56.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Oct 2014 02:56:07 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Wed, 29 Oct 2014 10:56:04 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Navdeep Parhar Subject: Re: svn commit: r273806 - in head/contrib/ofed: libcxgb4 libcxgb4/src usr.lib usr.lib/libcxgb4 Message-ID: <20141029095604.GA81110@brick.home> Mail-Followup-To: Navdeep Parhar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201410290115.s9T1FnTv094112@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201410290115.s9T1FnTv094112@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 09:56:11 -0000 On 1029T0115, Navdeep Parhar wrote: > Author: np > Date: Wed Oct 29 01:15:48 2014 > New Revision: 273806 > URL: https://svnweb.freebsd.org/changeset/base/273806 > > Log: > Userspace library for Chelsio's Terminator 5 based iWARP RNICs (pretty > much every T5 card that does _not_ have "-SO" in its name is RDMA > capable). Yay! This means we could add iSER without using the ICL_PROXY hack. Well, assuming it's possible to "hand off" RDMA connection from userspace to the kernel. Is it? From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 11:07:41 2014 Return-Path: Delivered-To: svn-src-all@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 4161E3E9; Wed, 29 Oct 2014 11:07: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 2210A837; Wed, 29 Oct 2014 11:07: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 s9TB7f9C070398; Wed, 29 Oct 2014 11:07:41 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9TB7eKW070396; Wed, 29 Oct 2014 11:07:40 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201410291107.s9TB7eKW070396@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 29 Oct 2014 11:07:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273817 - in stable/10: sbin/dumpon sys/geom X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 11:07:41 -0000 Author: ae Date: Wed Oct 29 11:07:40 2014 New Revision: 273817 URL: https://svnweb.freebsd.org/changeset/base/273817 Log: MFC r272746: Add an ability to set dumpdev via loader(8) tunable. MFC r272747: Revert r156046. We support setting dumpdev via loader tunable again. Also change default disk name to ada. Modified: stable/10/sbin/dumpon/dumpon.8 stable/10/sys/geom/geom_dev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/dumpon/dumpon.8 ============================================================================== --- stable/10/sbin/dumpon/dumpon.8 Wed Oct 29 09:36:02 2014 (r273816) +++ stable/10/sbin/dumpon/dumpon.8 Wed Oct 29 11:07:40 2014 (r273817) @@ -28,7 +28,7 @@ .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd April 29, 2013 +.Dd October 8, 2014 .Dt DUMPON 8 .Os .Sh NAME @@ -124,9 +124,18 @@ performs a on .Pa /dev/null and thus instructs the kernel not to save crash dumps. +.Pp +Since +.Nm +cannot be used during kernel initialization, the +.Va dumpdev +variable of +.Xr loader 8 +must be used to enable dumps for system panics which occur +during kernel initialization. .Sh FILES -.Bl -tag -width "/dev/{ad,da}?s?b" -compact -.It Pa /dev/{ad,da}?s?b +.Bl -tag -width "/dev/{ada,da}?s?b" -compact +.It Pa /dev/{ada,da}?s?b standard swap areas .It Pa /etc/rc.conf boot-time system configuration @@ -136,6 +145,7 @@ boot-time system configuration .Xr rc.conf 5 , .Xr config 8 , .Xr init 8 , +.Xr loader 8 , .Xr rc 8 , .Xr savecore 8 , .Xr swapon 8 , Modified: stable/10/sys/geom/geom_dev.c ============================================================================== --- stable/10/sys/geom/geom_dev.c Wed Oct 29 09:36:02 2014 (r273816) +++ stable/10/sys/geom/geom_dev.c Wed Oct 29 11:07:40 2014 (r273817) @@ -82,6 +82,8 @@ static struct cdevsw g_dev_cdevsw = { .d_flags = D_DISK | D_TRACKCLOSE, }; +static g_init_t g_dev_init; +static g_fini_t g_dev_fini; static g_taste_t g_dev_taste; static g_orphan_t g_dev_orphan; static g_attrchanged_t g_dev_attrchanged; @@ -89,6 +91,8 @@ static g_attrchanged_t g_dev_attrchanged static struct g_class g_dev_class = { .name = "DEV", .version = G_VERSION, + .init = g_dev_init, + .fini = g_dev_fini, .taste = g_dev_taste, .orphan = g_dev_orphan, .attrchanged = g_dev_attrchanged @@ -107,6 +111,58 @@ SYSCTL_QUAD(_kern_geom_dev, OID_AUTO, de "delete request sent to the provider. Larger requests are chunked " "so they can be interrupted. (0 = disable chunking)"); +static char *dumpdev = NULL; +static void +g_dev_init(struct g_class *mp) +{ + + dumpdev = getenv("dumpdev"); +} + +static void +g_dev_fini(struct g_class *mp) +{ + + freeenv(dumpdev); +} + +static int +g_dev_setdumpdev(struct cdev *dev) +{ + struct g_kerneldump kd; + struct g_consumer *cp; + int error, len; + + if (dev == NULL) + return (set_dumper(NULL, NULL)); + + cp = dev->si_drv2; + len = sizeof(kd); + kd.offset = 0; + kd.length = OFF_MAX; + error = g_io_getattr("GEOM::kerneldump", cp, &len, &kd); + if (error == 0) { + error = set_dumper(&kd.di, devtoname(dev)); + if (error == 0) + dev->si_flags |= SI_DUMPDEV; + } + return (error); +} + +static void +init_dumpdev(struct cdev *dev) +{ + + if (dumpdev == NULL) + return; + if (strcmp(devtoname(dev), dumpdev) != 0) + return; + if (g_dev_setdumpdev(dev) == 0) { + freeenv(dumpdev); + dumpdev = NULL; + } +} + static void g_dev_destroy(void *arg, int flags __unused) { @@ -260,9 +316,11 @@ g_dev_taste(struct g_class *mp, struct g dev->si_iosize_max = MAXPHYS; dev->si_drv2 = cp; + init_dumpdev(dev); if (adev != NULL) { adev->si_iosize_max = MAXPHYS; adev->si_drv2 = cp; + init_dumpdev(adev); } g_dev_attrchanged(cp, "GEOM::physpath"); @@ -356,10 +414,8 @@ g_dev_ioctl(struct cdev *dev, u_long cmd { struct g_consumer *cp; struct g_provider *pp; - struct g_kerneldump kd; off_t offset, length, chunk; int i, error; - u_int u; cp = dev->si_drv2; pp = cp->provider; @@ -394,21 +450,10 @@ g_dev_ioctl(struct cdev *dev, u_long cmd error = g_io_getattr("GEOM::frontstuff", cp, &i, data); break; case DIOCSKERNELDUMP: - u = *((u_int *)data); - if (!u) { - set_dumper(NULL, NULL); - error = 0; - break; - } - kd.offset = 0; - kd.length = OFF_MAX; - i = sizeof kd; - error = g_io_getattr("GEOM::kerneldump", cp, &i, &kd); - if (!error) { - error = set_dumper(&kd.di, devtoname(dev)); - if (!error) - dev->si_flags |= SI_DUMPDEV; - } + if (*(u_int *)data == 0) + error = g_dev_setdumpdev(NULL); + else + error = g_dev_setdumpdev(dev); break; case DIOCGFLUSH: error = g_io_flush(cp); From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 11:11:55 2014 Return-Path: Delivered-To: svn-src-all@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 AFFBD5AD; Wed, 29 Oct 2014 11:11: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 9C5E68EA; Wed, 29 Oct 2014 11:11: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 s9TBBt2v074467; Wed, 29 Oct 2014 11:11:55 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9TBBtDW074466; Wed, 29 Oct 2014 11:11:55 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201410291111.s9TBBtDW074466@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Wed, 29 Oct 2014 11:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r273818 - releng/10.1/sys/cam/ata X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 11:11:55 -0000 Author: smh Date: Wed Oct 29 11:11:54 2014 New Revision: 273818 URL: https://svnweb.freebsd.org/changeset/base/273818 Log: MFS10 r273814 MFC r273704 Fix ATA CF ERASE breakage caused by 268205 PR: 194606 Approved by: re (marius) Sponsored by: Multiplay Modified: releng/10.1/sys/cam/ata/ata_da.c Directory Properties: releng/10.1/ (props changed) Modified: releng/10.1/sys/cam/ata/ata_da.c ============================================================================== --- releng/10.1/sys/cam/ata/ata_da.c Wed Oct 29 11:07:40 2014 (r273817) +++ releng/10.1/sys/cam/ata/ata_da.c Wed Oct 29 11:11:54 2014 (r273818) @@ -1467,9 +1467,15 @@ ada_dsmtrim(struct ada_softc *softc, str static void ada_cfaerase(struct ada_softc *softc, struct bio *bp, struct ccb_ataio *ataio) { + struct trim_request *req = &softc->trim_req; uint64_t lba = bp->bio_pblkno; uint16_t count = bp->bio_bcount / softc->params.secsize; + bzero(req, sizeof(*req)); + TAILQ_INIT(&req->bps); + bioq_remove(&softc->trim_queue, bp); + TAILQ_INSERT_TAIL(&req->bps, bp, bio_queue); + cam_fill_ataio(ataio, ada_retry_count, adadone, From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 11:47:06 2014 Return-Path: Delivered-To: svn-src-all@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 2DE0DEDF; Wed, 29 Oct 2014 11:47: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 10FE0BEA; Wed, 29 Oct 2014 11:47: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 s9TBl5PJ089311; Wed, 29 Oct 2014 11:47:05 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9TBl4Cn089309; Wed, 29 Oct 2014 11:47:04 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201410291147.s9TBl4Cn089309@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 29 Oct 2014 11:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r273819 - in stable/9: sbin/dumpon sys/geom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 11:47:06 -0000 Author: ae Date: Wed Oct 29 11:47:04 2014 New Revision: 273819 URL: https://svnweb.freebsd.org/changeset/base/273819 Log: MFC r272746: Add an ability to set dumpdev via loader(8) tunable. MFC r272747: Revert r156046. We support setting dumpdev via loader tunable again. Also change default disk name to ada. Modified: stable/9/sbin/dumpon/dumpon.8 stable/9/sys/geom/geom_dev.c Directory Properties: stable/9/sbin/dumpon/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sbin/dumpon/dumpon.8 ============================================================================== --- stable/9/sbin/dumpon/dumpon.8 Wed Oct 29 11:11:54 2014 (r273818) +++ stable/9/sbin/dumpon/dumpon.8 Wed Oct 29 11:47:04 2014 (r273819) @@ -28,7 +28,7 @@ .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd May 12, 1995 +.Dd October 8, 2014 .Dt DUMPON 8 .Os .Sh NAME @@ -107,9 +107,18 @@ performs a on .Pa /dev/null and thus instructs the kernel not to save crash dumps. +.Pp +Since +.Nm +cannot be used during kernel initialization, the +.Va dumpdev +variable of +.Xr loader 8 +must be used to enable dumps for system panics which occur +during kernel initialization. .Sh FILES -.Bl -tag -width "/dev/{ad,da}?s?b" -compact -.It Pa /dev/{ad,da}?s?b +.Bl -tag -width "/dev/{ada,da}?s?b" -compact +.It Pa /dev/{ada,da}?s?b standard swap areas .It Pa /etc/rc.conf boot-time system configuration @@ -119,6 +128,7 @@ boot-time system configuration .Xr rc.conf 5 , .Xr config 8 , .Xr init 8 , +.Xr loader 8 , .Xr rc 8 , .Xr savecore 8 , .Xr swapon 8 , Modified: stable/9/sys/geom/geom_dev.c ============================================================================== --- stable/9/sys/geom/geom_dev.c Wed Oct 29 11:11:54 2014 (r273818) +++ stable/9/sys/geom/geom_dev.c Wed Oct 29 11:47:04 2014 (r273819) @@ -82,6 +82,8 @@ static struct cdevsw g_dev_cdevsw = { .d_flags = D_DISK | D_TRACKCLOSE, }; +static g_init_t g_dev_init; +static g_fini_t g_dev_fini; static g_taste_t g_dev_taste; static g_orphan_t g_dev_orphan; static g_attrchanged_t g_dev_attrchanged; @@ -89,6 +91,8 @@ static g_attrchanged_t g_dev_attrchanged static struct g_class g_dev_class = { .name = "DEV", .version = G_VERSION, + .init = g_dev_init, + .fini = g_dev_fini, .taste = g_dev_taste, .orphan = g_dev_orphan, .attrchanged = g_dev_attrchanged @@ -107,6 +111,58 @@ SYSCTL_QUAD(_kern_geom_dev, OID_AUTO, de "delete request sent to the provider. Larger requests are chunked " "so they can be interrupted. (0 = disable chunking)"); +static char *dumpdev = NULL; +static void +g_dev_init(struct g_class *mp) +{ + + dumpdev = getenv("dumpdev"); +} + +static void +g_dev_fini(struct g_class *mp) +{ + + freeenv(dumpdev); +} + +static int +g_dev_setdumpdev(struct cdev *dev) +{ + struct g_kerneldump kd; + struct g_consumer *cp; + int error, len; + + if (dev == NULL) + return (set_dumper(NULL)); + + cp = dev->si_drv2; + len = sizeof(kd); + kd.offset = 0; + kd.length = OFF_MAX; + error = g_io_getattr("GEOM::kerneldump", cp, &len, &kd); + if (error == 0) { + error = set_dumper(&kd.di); + if (error == 0) + dev->si_flags |= SI_DUMPDEV; + } + return (error); +} + +static void +init_dumpdev(struct cdev *dev) +{ + + if (dumpdev == NULL) + return; + if (strcmp(devtoname(dev), dumpdev) != 0) + return; + if (g_dev_setdumpdev(dev) == 0) { + freeenv(dumpdev); + dumpdev = NULL; + } +} + static void g_dev_destroy(void *arg, int flags __unused) { @@ -261,11 +317,13 @@ g_dev_taste(struct g_class *mp, struct g dev->si_flags |= SI_CANDELETE; dev->si_iosize_max = MAXPHYS; dev->si_drv2 = cp; + init_dumpdev(dev); if (adev != NULL) { if (pp->flags & G_PF_CANDELETE) adev->si_flags |= SI_CANDELETE; adev->si_iosize_max = MAXPHYS; adev->si_drv2 = cp; + init_dumpdev(adev); } g_dev_attrchanged(cp, "GEOM::physpath"); @@ -359,10 +417,8 @@ g_dev_ioctl(struct cdev *dev, u_long cmd { struct g_consumer *cp; struct g_provider *pp; - struct g_kerneldump kd; off_t offset, length, chunk; int i, error; - u_int u; cp = dev->si_drv2; pp = cp->provider; @@ -397,21 +453,10 @@ g_dev_ioctl(struct cdev *dev, u_long cmd error = g_io_getattr("GEOM::frontstuff", cp, &i, data); break; case DIOCSKERNELDUMP: - u = *((u_int *)data); - if (!u) { - set_dumper(NULL); - error = 0; - break; - } - kd.offset = 0; - kd.length = OFF_MAX; - i = sizeof kd; - error = g_io_getattr("GEOM::kerneldump", cp, &i, &kd); - if (!error) { - error = set_dumper(&kd.di); - if (!error) - dev->si_flags |= SI_DUMPDEV; - } + if (*(u_int *)data == 0) + error = g_dev_setdumpdev(NULL); + else + error = g_dev_setdumpdev(dev); break; case DIOCGFLUSH: error = g_io_flush(cp); From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 12:10:40 2014 Return-Path: Delivered-To: svn-src-all@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 539DA4FF; Wed, 29 Oct 2014 12:10: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 25EA0ECA; Wed, 29 Oct 2014 12:10: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 s9TCAegd001825; Wed, 29 Oct 2014 12:10:40 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9TCAdOp001823; Wed, 29 Oct 2014 12:10:39 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410291210.s9TCAdOp001823@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 29 Oct 2014 12:10:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273820 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 12:10:40 -0000 Author: trasz Date: Wed Oct 29 12:10:39 2014 New Revision: 273820 URL: https://svnweb.freebsd.org/changeset/base/273820 Log: Make it possible to optionally use semicolon to separate statements. This makes it possible to format stuff like this: target xxx { lun 0 { path /foo/bar; size 4G; } } MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/parse.y head/usr.sbin/ctld/token.l Modified: head/usr.sbin/ctld/parse.y ============================================================================== --- head/usr.sbin/ctld/parse.y Wed Oct 29 11:47:04 2014 (r273819) +++ head/usr.sbin/ctld/parse.y Wed Oct 29 12:10:39 2014 (r273820) @@ -60,7 +60,7 @@ extern void yyrestart(FILE *); %token ALIAS AUTH_GROUP AUTH_TYPE BACKEND BLOCKSIZE CHAP CHAP_MUTUAL %token CLOSING_BRACKET DEBUG DEVICE_ID DISCOVERY_AUTH_GROUP DISCOVERY_FILTER %token INITIATOR_NAME INITIATOR_PORTAL LISTEN LISTEN_ISER LUN MAXPROC -%token OPENING_BRACKET OPTION PATH PIDFILE PORTAL_GROUP SERIAL SIZE STR +%token OPENING_BRACKET OPTION PATH PIDFILE PORTAL_GROUP SEMICOLON SERIAL SIZE STR %token TARGET TIMEOUT ISNS_SERVER ISNS_PERIOD ISNS_TIMEOUT %union @@ -75,6 +75,8 @@ extern void yyrestart(FILE *); statements: | statements statement + | + statements statement SEMICOLON ; statement: @@ -220,6 +222,8 @@ auth_group_name: STR auth_group_entries: | auth_group_entries auth_group_entry + | + auth_group_entries auth_group_entry SEMICOLON ; auth_group_entry: @@ -322,6 +326,8 @@ portal_group_name: STR portal_group_entries: | portal_group_entries portal_group_entry + | + portal_group_entries portal_group_entry SEMICOLON ; portal_group_entry: @@ -406,6 +412,8 @@ target_name: STR target_entries: | target_entries target_entry + | + target_entries target_entry SEMICOLON ; target_entry: @@ -653,6 +661,8 @@ lun_number: STR lun_entries: | lun_entries lun_entry + | + lun_entries lun_entry SEMICOLON ; lun_entry: Modified: head/usr.sbin/ctld/token.l ============================================================================== --- head/usr.sbin/ctld/token.l Wed Oct 29 11:47:04 2014 (r273819) +++ head/usr.sbin/ctld/token.l Wed Oct 29 12:10:39 2014 (r273820) @@ -83,6 +83,7 @@ timeout { return TIMEOUT; } \} { return CLOSING_BRACKET; } #.*$ /* ignore comments */; \n { lineno++; } +; { return SEMICOLON; } [ \t]+ /* ignore whitespace */; . { yylval.str = strdup(yytext); return STR; } %% From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 12:12:28 2014 Return-Path: Delivered-To: svn-src-all@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 641B2664; Wed, 29 Oct 2014 12:12: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 4FE13EDD; Wed, 29 Oct 2014 12:12: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 s9TCCSZY003204; Wed, 29 Oct 2014 12:12:28 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9TCCSt4003203; Wed, 29 Oct 2014 12:12:28 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410291212.s9TCCSt4003203@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 29 Oct 2014 12:12:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273821 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 12:12:28 -0000 Author: trasz Date: Wed Oct 29 12:12:27 2014 New Revision: 273821 URL: https://svnweb.freebsd.org/changeset/base/273821 Log: Keep the token list sorted. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/parse.y Modified: head/usr.sbin/ctld/parse.y ============================================================================== --- head/usr.sbin/ctld/parse.y Wed Oct 29 12:10:39 2014 (r273820) +++ head/usr.sbin/ctld/parse.y Wed Oct 29 12:12:27 2014 (r273821) @@ -59,9 +59,9 @@ extern void yyrestart(FILE *); %token ALIAS AUTH_GROUP AUTH_TYPE BACKEND BLOCKSIZE CHAP CHAP_MUTUAL %token CLOSING_BRACKET DEBUG DEVICE_ID DISCOVERY_AUTH_GROUP DISCOVERY_FILTER -%token INITIATOR_NAME INITIATOR_PORTAL LISTEN LISTEN_ISER LUN MAXPROC -%token OPENING_BRACKET OPTION PATH PIDFILE PORTAL_GROUP SEMICOLON SERIAL SIZE STR -%token TARGET TIMEOUT ISNS_SERVER ISNS_PERIOD ISNS_TIMEOUT +%token INITIATOR_NAME INITIATOR_PORTAL ISNS_SERVER ISNS_PERIOD ISNS_TIMEOUT +%token LISTEN LISTEN_ISER LUN MAXPROC OPENING_BRACKET OPTION +%token PATH PIDFILE PORTAL_GROUP SEMICOLON SERIAL SIZE STR TARGET TIMEOUT %union { From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 12:22:33 2014 Return-Path: Delivered-To: svn-src-all@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 12922B35; Wed, 29 Oct 2014 12:22: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 F301BFF2; Wed, 29 Oct 2014 12:22: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 s9TCMW6n008022; Wed, 29 Oct 2014 12:22:32 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9TCMWhW008020; Wed, 29 Oct 2014 12:22:32 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410291222.s9TCMWhW008020@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 29 Oct 2014 12:22:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273822 - in head: usr.bin/iscsictl usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 12:22:33 -0000 Author: trasz Date: Wed Oct 29 12:22:32 2014 New Revision: 273822 URL: https://svnweb.freebsd.org/changeset/base/273822 Log: Fix iscsictl(8) and ctld(8) to correctly handle Windows newlines (CRLF) in iscsi.conf and ctl.conf. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/iscsictl/token.l head/usr.sbin/ctld/token.l Modified: head/usr.bin/iscsictl/token.l ============================================================================== --- head/usr.bin/iscsictl/token.l Wed Oct 29 12:12:27 2014 (r273821) +++ head/usr.bin/iscsictl/token.l Wed Oct 29 12:22:32 2014 (r273822) @@ -90,6 +90,7 @@ chapDigest { return IGNORED; } = { return EQUALS; } ; { return SEMICOLON; } #.*$ /* ignore comments */; +\r\n { lineno++; } \n { lineno++; } [ \t]+ /* ignore whitespace */; . { yylval.str = strdup(yytext); return STR; } Modified: head/usr.sbin/ctld/token.l ============================================================================== --- head/usr.sbin/ctld/token.l Wed Oct 29 12:12:27 2014 (r273821) +++ head/usr.sbin/ctld/token.l Wed Oct 29 12:22:32 2014 (r273822) @@ -82,6 +82,7 @@ timeout { return TIMEOUT; } \{ { return OPENING_BRACKET; } \} { return CLOSING_BRACKET; } #.*$ /* ignore comments */; +\r\n { lineno++; } \n { lineno++; } ; { return SEMICOLON; } [ \t]+ /* ignore whitespace */; From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 15:52:40 2014 Return-Path: Delivered-To: svn-src-all@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 2485395F; Wed, 29 Oct 2014 15:52:40 +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 73D76CA9; Wed, 29 Oct 2014 15:52:39 +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 s9TFqUQ3092805 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 29 Oct 2014 17:52:30 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s9TFqUQ3092805 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s9TFqUW1092804; Wed, 29 Oct 2014 17:52:30 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 29 Oct 2014 17:52:30 +0200 From: Konstantin Belousov To: Bruce Evans Subject: Re: svn commit: r273784 - in head/sys: amd64/ia32 compat/freebsd32 i386/i386 kern net Message-ID: <20141029155230.GE53947@kib.kiev.ua> References: <201410281528.s9SFSLs2013764@svn.freebsd.org> <20141029042007.N2423@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141029042007.N2423@besplex.bde.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, jhb@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 15:52:40 -0000 On Wed, Oct 29, 2014 at 06:26:42AM +1100, Bruce Evans wrote: > On Tue, 28 Oct 2014, Konstantin Belousov wrote: > > > Log: > > Replace some calls to fuword() by fueword() with proper error checking. > > I just noticed some more API design errors. The pointer type for new > APIs should be [qualifed] wordsize_t *, not [qualified] void *. Using > void * reduces type safety for almost no benefits. The casuword() > family already doesn't use void *. casuword() has very limited use, it was invented for umtx, and used only there. That said, I tend to agree with somewhat implicit note that base argument for fuword() and family should be vm_offset_t. Still, lets move by small steps. Below is the patch to add volatile qualifier to base, and remove __DEVOLATILE() from kern_umtx.c. I converted suword() as well, since I do not see why the same arguments which support change for fuword() are not applicable to suword(). The intr variants are left alone. Patch was only compile-tested on x86. diff --git a/share/man/man9/fetch.9 b/share/man/man9/fetch.9 index 7e13cbc..1d46784 100644 --- a/share/man/man9/fetch.9 +++ b/share/man/man9/fetch.9 @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 21, 2014 +.Dd October 29, 2014 .Dt FETCH 9 .Os .Sh NAME @@ -53,21 +53,21 @@ .In sys/types.h .In sys/systm.h .Ft int -.Fn fubyte "const void *base" +.Fn fubyte "volatile const void *base" .Ft long -.Fn fuword "const void *base" +.Fn fuword "volatile const void *base" .Ft int -.Fn fuword16 "void *base" +.Fn fuword16 "volatile const void *base" .Ft int32_t -.Fn fuword32 "const void *base" +.Fn fuword32 "volatile const void *base" .Ft int64_t -.Fn fuword64 "const void *base" +.Fn fuword64 "volatile const void *base" .Ft long -.Fn fueword "const void *base" "long *val" +.Fn fueword "volatile const void *base" "long *val" .Ft int32_t -.Fn fueword32 "const void *base" "int32_t *val" +.Fn fueword32 "volatile const void *base" "int32_t *val" .Ft int64_t -.Fn fueword64 "const void *base" "int64_t *val" +.Fn fueword64 "volatile const void *base" "int64_t *val" .In sys/resourcevar.h .Ft int .Fn fuswintr "void *base" diff --git a/share/man/man9/store.9 b/share/man/man9/store.9 index d333eff..cc442f2 100644 --- a/share/man/man9/store.9 +++ b/share/man/man9/store.9 @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2009 +.Dd October 29, 2014 .Dt STORE 9 .Os .Sh NAME @@ -48,15 +48,15 @@ .In sys/time.h .In sys/systm.h .Ft int -.Fn subyte "void *base" "int byte" +.Fn subyte "volatile void *base" "int byte" .Ft int -.Fn suword "void *base" "long word" +.Fn suword "volatile void *base" "long word" .Ft int -.Fn suword16 "void *base" "int word" +.Fn suword16 "volatile void *base" "int word" .Ft int -.Fn suword32 "void *base" "int32_t word" +.Fn suword32 "volatile void *base" "int32_t word" .Ft int -.Fn suword64 "void *base" "int64_t word" +.Fn suword64 "volatile void *base" "int64_t word" .In sys/resourcevar.h .Ft int .Fn suswintr "void *base" "int word" @@ -64,6 +64,8 @@ The .Nm functions are designed to copy small amounts of data to user-space. +If write is successful, it is performed atomically. +The data written must be naturally aligned. .Pp The .Nm diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 58e76bc..33fdf71 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -942,7 +942,7 @@ do_lock_normal(struct thread *td, struct umutex *m, uint32_t flags, * can fault on any access. */ for (;;) { - rv = fueword32(__DEVOLATILE(void *, &m->m_owner), &owner); + rv = fueword32(&m->m_owner, &owner); if (rv == -1) return (EFAULT); if (mode == _UMUTEX_WAIT) { @@ -1057,7 +1057,7 @@ do_unlock_normal(struct thread *td, struct umutex *m, uint32_t flags) /* * Make sure we own this mtx. */ - error = fueword32(__DEVOLATILE(uint32_t *, &m->m_owner), &owner); + error = fueword32(&m->m_owner, &owner); if (error == -1) return (EFAULT); @@ -1115,7 +1115,7 @@ do_wake_umutex(struct thread *td, struct umutex *m) int error; int count; - error = fueword32(__DEVOLATILE(uint32_t *, &m->m_owner), &owner); + error = fueword32(&m->m_owner, &owner); if (error == -1) return (EFAULT); @@ -1192,8 +1192,7 @@ do_wake2_umutex(struct thread *td, struct umutex *m, uint32_t flags) * any memory. */ if (count > 1) { - error = fueword32(__DEVOLATILE(uint32_t *, &m->m_owner), - &owner); + error = fueword32(&m->m_owner, &owner); if (error == -1) error = EFAULT; while (error == 0 && (owner & UMUTEX_CONTESTED) == 0) { @@ -1211,8 +1210,7 @@ do_wake2_umutex(struct thread *td, struct umutex *m, uint32_t flags) break; } } else if (count == 1) { - error = fueword32(__DEVOLATILE(uint32_t *, &m->m_owner), - &owner); + error = fueword32(&m->m_owner, &owner); if (error == -1) error = EFAULT; while (error == 0 && (owner & ~UMUTEX_CONTESTED) != 0 && @@ -1776,7 +1774,7 @@ do_unlock_pi(struct thread *td, struct umutex *m, uint32_t flags) /* * Make sure we own this mtx. */ - error = fueword32(__DEVOLATILE(uint32_t *, &m->m_owner), &owner); + error = fueword32(&m->m_owner, &owner); if (error == -1) return (EFAULT); @@ -2008,7 +2006,7 @@ do_unlock_pp(struct thread *td, struct umutex *m, uint32_t flags) /* * Make sure we own this mtx. */ - error = fueword32(__DEVOLATILE(uint32_t *, &m->m_owner), &owner); + error = fueword32(&m->m_owner, &owner); if (error == -1) return (EFAULT); @@ -2040,8 +2038,7 @@ do_unlock_pp(struct thread *td, struct umutex *m, uint32_t flags) * to lock the mutex, it is necessary because thread priority * has to be adjusted for such mutex. */ - error = suword32(__DEVOLATILE(uint32_t *, &m->m_owner), - UMUTEX_CONTESTED); + error = suword32(&m->m_owner, UMUTEX_CONTESTED); umtxq_lock(&key); if (error == 0) @@ -2116,8 +2113,7 @@ do_set_ceiling(struct thread *td, struct umutex *m, uint32_t ceiling, if (owner == UMUTEX_CONTESTED) { suword32(&m->m_ceilings[0], ceiling); - suword32(__DEVOLATILE(uint32_t *, &m->m_owner), - UMUTEX_CONTESTED); + suword32(&m->m_owner, UMUTEX_CONTESTED); error = 0; break; } @@ -2263,10 +2259,9 @@ do_cv_wait(struct thread *td, struct ucond *cv, struct umutex *m, * Set c_has_waiters to 1 before releasing user mutex, also * don't modify cache line when unnecessary. */ - error = fueword32(__DEVOLATILE(uint32_t *, &cv->c_has_waiters), - &hasw); + error = fueword32(&cv->c_has_waiters, &hasw); if (error == 0 && hasw == 0) - suword32(__DEVOLATILE(uint32_t *, &cv->c_has_waiters), 1); + suword32(&cv->c_has_waiters, 1); umtxq_unbusy_unlocked(&uq->uq_key); @@ -2296,9 +2291,7 @@ do_cv_wait(struct thread *td, struct ucond *cv, struct umutex *m, umtxq_remove(uq); if (oldlen == 1) { umtxq_unlock(&uq->uq_key); - suword32( - __DEVOLATILE(uint32_t *, - &cv->c_has_waiters), 0); + suword32(&cv->c_has_waiters, 0); umtxq_lock(&uq->uq_key); } } @@ -2333,8 +2326,7 @@ do_cv_signal(struct thread *td, struct ucond *cv) nwake = umtxq_signal(&key, 1); if (cnt <= nwake) { umtxq_unlock(&key); - error = suword32( - __DEVOLATILE(uint32_t *, &cv->c_has_waiters), 0); + error = suword32(&cv->c_has_waiters, 0); if (error == -1) error = EFAULT; umtxq_lock(&key); @@ -2363,7 +2355,7 @@ do_cv_broadcast(struct thread *td, struct ucond *cv) umtxq_signal(&key, INT_MAX); umtxq_unlock(&key); - error = suword32(__DEVOLATILE(uint32_t *, &cv->c_has_waiters), 0); + error = suword32(&cv->c_has_waiters, 0); if (error == -1) error = EFAULT; @@ -2399,8 +2391,7 @@ do_rw_rdlock(struct thread *td, struct urwlock *rwlock, long fflag, struct _umtx wrflags |= URWLOCK_WRITE_WAITERS; for (;;) { - rv = fueword32(__DEVOLATILE(int32_t *, &rwlock->rw_state), - &state); + rv = fueword32(&rwlock->rw_state, &state); if (rv == -1) { umtx_key_release(&uq->uq_key); return (EFAULT); @@ -2440,8 +2431,7 @@ do_rw_rdlock(struct thread *td, struct urwlock *rwlock, long fflag, struct _umtx * re-read the state, in case it changed between the try-lock above * and the check below */ - rv = fueword32(__DEVOLATILE(int32_t *, &rwlock->rw_state), - &state); + rv = fueword32(&rwlock->rw_state, &state); if (rv == -1) error = EFAULT; @@ -2499,8 +2489,7 @@ sleep: umtxq_unlock(&uq->uq_key); if (error) break; - rv = fueword32(__DEVOLATILE(int32_t *, - &rwlock->rw_state), &state); + rv = fueword32(&rwlock->rw_state, &state); if (rv == -1) { error = EFAULT; break; @@ -2517,8 +2506,7 @@ sleep: } suword32(&rwlock->rw_blocked_readers, blocked_readers-1); if (blocked_readers == 1) { - rv = fueword32(__DEVOLATILE(int32_t *, - &rwlock->rw_state), &state); + rv = fueword32(&rwlock->rw_state, &state); if (rv == -1) error = EFAULT; while (error == 0) { @@ -2569,8 +2557,7 @@ do_rw_wrlock(struct thread *td, struct urwlock *rwlock, struct _umtx_time *timeo blocked_readers = 0; for (;;) { - rv = fueword32(__DEVOLATILE(int32_t *, &rwlock->rw_state), - &state); + rv = fueword32(&rwlock->rw_state, &state); if (rv == -1) { umtx_key_release(&uq->uq_key); return (EFAULT); @@ -2614,8 +2601,7 @@ do_rw_wrlock(struct thread *td, struct urwlock *rwlock, struct _umtx_time *timeo * re-read the state, in case it changed between the try-lock above * and the check below */ - rv = fueword32(__DEVOLATILE(int32_t *, &rwlock->rw_state), - &state); + rv = fueword32(&rwlock->rw_state, &state); if (rv == -1) error = EFAULT; @@ -2670,8 +2656,7 @@ sleep: umtxq_unlock(&uq->uq_key); if (error) break; - rv = fueword32(__DEVOLATILE(int32_t *, - &rwlock->rw_state), &state); + rv = fueword32(&rwlock->rw_state, &state); if (rv == -1) { error = EFAULT; break; @@ -2687,8 +2672,7 @@ sleep: } suword32(&rwlock->rw_blocked_writers, blocked_writers-1); if (blocked_writers == 1) { - rv = fueword32(__DEVOLATILE(int32_t *, - &rwlock->rw_state), &state); + rv = fueword32(&rwlock->rw_state, &state); if (rv == -1) { umtxq_unbusy_unlocked(&uq->uq_key); error = EFAULT; @@ -2748,7 +2732,7 @@ do_rw_unlock(struct thread *td, struct urwlock *rwlock) if (error != 0) return (error); - error = fueword32(__DEVOLATILE(int32_t *, &rwlock->rw_state), &state); + error = fueword32(&rwlock->rw_state, &state); if (error == -1) { error = EFAULT; goto out; @@ -2856,7 +2840,7 @@ do_sem_wait(struct thread *td, struct _usem *sem, struct _umtx_time *timeout) umtxq_unlock(&uq->uq_key); rv = casueword32(&sem->_has_waiters, 0, &count1, 1); if (rv == 0) - rv = fueword32(__DEVOLATILE(uint32_t *, &sem->_count), &count); + rv = fueword32(&sem->_count, &count); if (rv == -1 || count != 0) { umtxq_lock(&uq->uq_key); umtxq_unbusy(&uq->uq_key); @@ -2911,8 +2895,7 @@ do_sem_wake(struct thread *td, struct _usem *sem) */ if (cnt == 1) { umtxq_unlock(&key); - error = suword32( - __DEVOLATILE(uint32_t *, &sem->_has_waiters), 0); + error = suword32(&sem->_has_waiters, 0); umtxq_lock(&key); if (error == -1) error = EFAULT; @@ -2946,7 +2929,7 @@ do_sem2_wait(struct thread *td, struct _usem2 *sem, struct _umtx_time *timeout) umtxq_busy(&uq->uq_key); umtxq_insert(uq); umtxq_unlock(&uq->uq_key); - rv = fueword32(__DEVOLATILE(uint32_t *, &sem->_count), &count); + rv = fueword32(&sem->_count, &count); if (rv == -1) { umtxq_lock(&uq->uq_key); umtxq_unbusy(&uq->uq_key); @@ -3024,8 +3007,7 @@ do_sem2_wake(struct thread *td, struct _usem2 *sem) */ if (cnt == 1) { umtxq_unlock(&key); - rv = fueword32(__DEVOLATILE(uint32_t *, &sem->_count), - &count); + rv = fueword32(&sem->_count, &count); while (rv != -1 && count & USEM_HAS_WAITERS) rv = casueword32(&sem->_count, count, &count, count & ~USEM_HAS_WAITERS); diff --git a/sys/kern/subr_uio.c b/sys/kern/subr_uio.c index f2bbb0c..87892fd 100644 --- a/sys/kern/subr_uio.c +++ b/sys/kern/subr_uio.c @@ -453,7 +453,7 @@ copyout_unmap(struct thread *td, vm_offset_t addr, size_t sz) */ int -fueword(const void *base, long *val) +fueword(volatile const void *base, long *val) { long res; @@ -465,7 +465,7 @@ fueword(const void *base, long *val) } int -fueword32(const void *base, int32_t *val) +fueword32(volatile const void *base, int32_t *val) { int32_t res; @@ -478,7 +478,7 @@ fueword32(const void *base, int32_t *val) #ifdef _LP64 int -fueword64(const void *base, int64_t *val) +fueword64(volatile const void *base, int64_t *val) { int32_t res; @@ -516,7 +516,7 @@ casueword(volatile u_long *p, u_long oldval, u_long *oldvalp, u_long newval) } #else /* NO_FUEWORD */ int32_t -fuword32(const void *addr) +fuword32(volatile const void *addr) { int rv; int32_t val; @@ -527,7 +527,7 @@ fuword32(const void *addr) #ifdef _LP64 int64_t -fuword64(const void *addr) +fuword64(volatile const void *addr) { int rv; int64_t val; @@ -538,7 +538,7 @@ fuword64(const void *addr) #endif /* _LP64 */ long -fuword(const void *addr) +fuword(volatile const void *addr) { long val; int rv; diff --git a/sys/powerpc/powerpc/copyinout.c b/sys/powerpc/powerpc/copyinout.c index a337c8b..ddaf33f 100644 --- a/sys/powerpc/powerpc/copyinout.c +++ b/sys/powerpc/powerpc/copyinout.c @@ -281,7 +281,7 @@ copyinstr(const void *udaddr, void *kaddr, size_t len, size_t *done) } int -subyte(void *addr, int byte) +subyte(volatile void *addr, int byte) { struct thread *td; pmap_t pm; @@ -309,7 +309,7 @@ subyte(void *addr, int byte) #ifdef __powerpc64__ int -suword32(void *addr, int word) +suword32(volatile void *addr, int word) { struct thread *td; pmap_t pm; @@ -337,7 +337,7 @@ suword32(void *addr, int word) #endif int -suword(void *addr, long word) +suword(volatile void *addr, long word) { struct thread *td; pmap_t pm; @@ -365,20 +365,20 @@ suword(void *addr, long word) #ifdef __powerpc64__ int -suword64(void *addr, int64_t word) +suword64(volatile void *addr, int64_t word) { return (suword(addr, (long)word)); } #else int -suword32(void *addr, int32_t word) +suword32(volatile void *addr, int32_t word) { return (suword(addr, (long)word)); } #endif int -fubyte(const void *addr) +fubyte(volatile const void *addr) { struct thread *td; pmap_t pm; @@ -406,7 +406,7 @@ fubyte(const void *addr) } int -fuword16(const void *addr) +fuword16(volatile const void *addr) { struct thread *td; pmap_t pm; @@ -433,7 +433,7 @@ fuword16(const void *addr) } int -fueword32(const void *addr, int32_t *val) +fueword32(volatile const void *addr, int32_t *val) { struct thread *td; pmap_t pm; @@ -461,7 +461,7 @@ fueword32(const void *addr, int32_t *val) #ifdef __powerpc64__ int -fueword64(const void *addr, int64_t *val) +fueword64(volatile const void *addr, int64_t *val) { struct thread *td; pmap_t pm; @@ -489,7 +489,7 @@ fueword64(const void *addr, int64_t *val) #endif int -fueword(const void *addr, long *val) +fueword(volatile const void *addr, long *val) { struct thread *td; pmap_t pm; diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 6e5ee61..47156fb 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -252,19 +252,19 @@ int copyout(const void * __restrict kaddr, void * __restrict udaddr, int copyout_nofault(const void * __restrict kaddr, void * __restrict udaddr, size_t len) __nonnull(1) __nonnull(2); -int fubyte(const void *base); -long fuword(const void *base); -int fuword16(const void *base); -int32_t fuword32(const void *base); -int64_t fuword64(const void *base); -int fueword(const void *base, long *val); -int fueword32(const void *base, int32_t *val); -int fueword64(const void *base, int64_t *val); -int subyte(void *base, int byte); -int suword(void *base, long word); -int suword16(void *base, int word); -int suword32(void *base, int32_t word); -int suword64(void *base, int64_t word); +int fubyte(volatile const void *base); +long fuword(volatile const void *base); +int fuword16(volatile const void *base); +int32_t fuword32(volatile const void *base); +int64_t fuword64(volatile const void *base); +int fueword(volatile const void *base, long *val); +int fueword32(volatile const void *base, int32_t *val); +int fueword64(volatile const void *base, int64_t *val); +int subyte(volatile void *base, int byte); +int suword(volatile void *base, long word); +int suword16(volatile void *base, int word); +int suword32(volatile void *base, int32_t word); +int suword64(volatile void *base, int64_t word); uint32_t casuword32(volatile uint32_t *base, uint32_t oldval, uint32_t newval); u_long casuword(volatile u_long *p, u_long oldval, u_long newval); int casueword32(volatile uint32_t *base, uint32_t oldval, uint32_t *oldvalp, From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 16:02:25 2014 Return-Path: Delivered-To: svn-src-all@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 7A3C6FFE; Wed, 29 Oct 2014 16:02:25 +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 514A6DF7; Wed, 29 Oct 2014 16:02:25 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D3517B9B4; Wed, 29 Oct 2014 12:02:23 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Subject: Re: svn commit: r273784 - in head/sys: amd64/ia32 compat/freebsd32 i386/i386 kern net Date: Wed, 29 Oct 2014 12:00:49 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201410281528.s9SFSLs2013764@svn.freebsd.org> <20141029042007.N2423@besplex.bde.org> <20141029155230.GE53947@kib.kiev.ua> In-Reply-To: <20141029155230.GE53947@kib.kiev.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201410291200.49330.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 29 Oct 2014 12:02:23 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 16:02:25 -0000 On Wednesday, October 29, 2014 11:52:30 am Konstantin Belousov wrote: > On Wed, Oct 29, 2014 at 06:26:42AM +1100, Bruce Evans wrote: > > On Tue, 28 Oct 2014, Konstantin Belousov wrote: > > > > > Log: > > > Replace some calls to fuword() by fueword() with proper error checking. > > > > I just noticed some more API design errors. The pointer type for new > > APIs should be [qualifed] wordsize_t *, not [qualified] void *. Using > > void * reduces type safety for almost no benefits. The casuword() > > family already doesn't use void *. > casuword() has very limited use, it was invented for umtx, and used > only there. That said, I tend to agree with somewhat implicit note > that base argument for fuword() and family should be vm_offset_t. I think Bruce is suggesting 'volatile long *' or 'volatile int32_t *' rather than vm_offset_t. > Still, lets move by small steps. Below is the patch to add volatile > qualifier to base, and remove __DEVOLATILE() from kern_umtx.c. I > converted suword() as well, since I do not see why the same arguments > which support change for fuword() are not applicable to suword(). > > The intr variants are left alone. > > Patch was only compile-tested on x86. This looks good to me, thanks! -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 16:24:04 2014 Return-Path: Delivered-To: svn-src-all@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 75E57DB6; Wed, 29 Oct 2014 16:24: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 56B4DF9; Wed, 29 Oct 2014 16:24: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 s9TGO42b024109; Wed, 29 Oct 2014 16:24:04 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9TGO39Z024101; Wed, 29 Oct 2014 16:24:03 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201410291624.s9TGO39Z024101@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 29 Oct 2014 16:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273827 - in stable/10: lib/libc/arm/aeabi lib/msun/arm sys/arm/arm sys/arm/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 16:24:04 -0000 Author: andrew Date: Wed Oct 29 16:24:02 2014 New Revision: 273827 URL: https://svnweb.freebsd.org/changeset/base/273827 Log: MFC r269956: From https://sourceware.org/ml/newlib/2014/msg00113.html By Richard Earnshaw at ARM > >GCC has for a number of years provides a set of pre-defined macros for >use with determining the ISA and features of the target during >pre-processing. However, the design was always somewhat cumbersome in >that each new architecture revision created a new define and then >removed the previous one. This meant that it was necessary to keep >updating the support code simply to recognise a new architecture being >added. > >The ACLE specification (ARM C Language Extentions) >(http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.set.swdev/index.html) >provides a much more suitable interface and GCC has supported this >since gcc-4.8. > >This patch makes use of the ACLE pre-defines to map to the internal >feature definitions. To support older versions of GCC a compatibility >header is provided that maps the traditional pre-defines onto the new >ACLE ones. Stop using __FreeBSD_ARCH_armv6__ and switch to __ARM_ARCH >= 6 in the couple of places in tree. clang already implements ACLE. Add a define that says we implement version 1.1, even though the implementation isn't quite complete. Added: stable/10/sys/arm/include/acle-compat.h - copied unchanged from r269956, head/sys/arm/include/acle-compat.h Modified: stable/10/lib/libc/arm/aeabi/aeabi_vfp.h stable/10/lib/msun/arm/fenv.c stable/10/sys/arm/arm/disassem.c stable/10/sys/arm/include/param.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/arm/aeabi/aeabi_vfp.h ============================================================================== --- stable/10/lib/libc/arm/aeabi/aeabi_vfp.h Wed Oct 29 16:20:49 2014 (r273826) +++ stable/10/lib/libc/arm/aeabi/aeabi_vfp.h Wed Oct 29 16:24:02 2014 (r273827) @@ -30,6 +30,8 @@ #ifndef AEABI_VFP_H #define AEABI_VFP_H +#include + /* * ASM helper macros. These allow the functions to be changed depending on * the endian-ness we are building for. @@ -49,7 +51,7 @@ * point falue. They will load the data from an ARM to a VFP register(s), * or from a VFP to an ARM register */ -#ifdef __ARMEB__ +#ifdef __ARM_BIG_ENDIAN #define LOAD_DREG(vreg, reg0, reg1) vmov vreg, reg1, reg0 #define UNLOAD_DREG(reg0, reg1, vreg) vmov reg1, reg0, vreg #else @@ -65,7 +67,7 @@ * C Helper macros */ -#if defined(__FreeBSD_ARCH_armv6__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 6) +#if __ARM_ARCH >= 6 /* * Generate a function that will either call into the VFP implementation, * or the soft float version for a given __aeabi_* helper. The function Modified: stable/10/lib/msun/arm/fenv.c ============================================================================== --- stable/10/lib/msun/arm/fenv.c Wed Oct 29 16:20:49 2014 (r273826) +++ stable/10/lib/msun/arm/fenv.c Wed Oct 29 16:24:02 2014 (r273827) @@ -30,7 +30,9 @@ #define __fenv_static #include "fenv.h" -#if defined(__FreeBSD_ARCH_armv6__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 6) +#include + +#if __ARM_ARCH >= 6 #define FENV_ARMv6 #endif Modified: stable/10/sys/arm/arm/disassem.c ============================================================================== --- stable/10/sys/arm/arm/disassem.c Wed Oct 29 16:20:49 2014 (r273826) +++ stable/10/sys/arm/arm/disassem.c Wed Oct 29 16:24:02 2014 (r273827) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* @@ -130,7 +131,7 @@ static const struct arm32_insn arm32_i[] { 0x0c500000, 0x04100000, "ldr", "daW" }, { 0x0c500000, 0x04400000, "strb", "daW" }, { 0x0c500000, 0x04500000, "ldrb", "daW" }, -#if defined(__FreeBSD_ARCH_armv6__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 6) +#if __ARM_ARCH >= 6 { 0xffffffff, 0xf57ff01f, "clrex", "c" }, { 0x0ff00ff0, 0x01800f90, "strex", "dmo" }, { 0x0ff00fff, 0x01900f9f, "ldrex", "do" }, Copied: stable/10/sys/arm/include/acle-compat.h (from r269956, head/sys/arm/include/acle-compat.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/include/acle-compat.h Wed Oct 29 16:24:02 2014 (r273827, copy of r269956, head/sys/arm/include/acle-compat.h) @@ -0,0 +1,185 @@ +/* + * Copyright (c) 2014 ARM Ltd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, 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. The name of the company may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY ARM LTD ``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 ARM LTD 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 __ARM_ARCH + +/* ACLE standardises a set of pre-defines that describe the ARM architecture. + These were mostly implemented in GCC around GCC-4.8; older versions + have no, or only partial support. To provide a level of backwards + compatibility we try to work out what the definitions should be, given + the older pre-defines that GCC did produce. This isn't complete, but + it should be enough for use by routines that depend on this header. */ + +/* No need to handle ARMv8, GCC had ACLE support before that. */ + +#define __ARM_ACLE 101 + +# ifdef __ARM_ARCH_7__ +/* The common subset of ARMv7 in all profiles. */ +# define __ARM_ARCH 7 +# define __ARM_ARCH_ISA_THUMB 2 +# define __ARM_FEATURE_CLZ +# define __ARM_FEATURE_LDREX 7 +# define __ARM_FEATURE_UNALIGNED +# endif + +# if defined (__ARM_ARCH_7A__) || defined (__ARM_ARCH_7R__) +# define __ARM_ARCH 7 +# define __ARM_ARCH_ISA_THUMB 2 +# define __ARM_ARCH_ISA_ARM +# define __ARM_FEATURE_CLZ +# define __ARM_FEATURE_SIMD32 +# define __ARM_FEATURE_DSP +# define __ARM_FEATURE_QBIT +# define __ARM_FEATURE_SAT +# define __ARM_FEATURE_LDREX 15 +# define __ARM_FEATURE_UNALIGNED +# ifdef __ARM_ARCH_7A__ +# define __ARM_ARCH_PROFILE 'A' +# else +# define __ARM_ARCH_PROFILE 'R' +# endif +# endif + +# ifdef __ARM_ARCH_7EM__ +# define __ARM_ARCH 7 +# define __ARM_ARCH_ISA_THUMB 2 +# define __ARM_FEATURE_CLZ +# define __ARM_FEATURE_SIMD32 +# define __ARM_FEATURE_DSP +# define __ARM_FEATURE_QBIT +# define __ARM_FEATURE_SAT +# define __ARM_FEATURE_LDREX 7 +# define __ARM_FEATURE_UNALIGNED +# define __ARM_ARCH_PROFILE 'M' +# endif + +# ifdef __ARM_ARCH_7M__ +# define __ARM_ARCH 7 +# define __ARM_ARCH_ISA_THUMB 2 +# define __ARM_FEATURE_CLZ +# define __ARM_FEATURE_QBIT +# define __ARM_FEATURE_SAT +# define __ARM_FEATURE_LDREX 7 +# define __ARM_FEATURE_UNALIGNED +# define __ARM_ARCH_PROFILE 'M' +# endif + +# ifdef __ARM_ARCH_6T2__ +# define __ARM_ARCH 6 +# define __ARM_ARCH_ISA_THUMB 2 +# define __ARM_ARCH_ISA_ARM +# define __ARM_FEATURE_CLZ +# define __ARM_FEATURE_SIMD32 +# define __ARM_FEATURE_DSP +# define __ARM_FEATURE_QBIT +# define __ARM_FEATURE_SAT +# define __ARM_FEATURE_LDREX 4 +# define __ARM_FEATURE_UNALIGNED +# endif + +# ifdef __ARM_ARCH_6M__ +# define __ARM_ARCH 6 +# define __ARM_ARCH_ISA_THUMB 1 +# define __ARM_ARCH_PROFILE 'M' +# endif + +# if defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6J__) \ + || defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6Z__) \ + || defined (__ARM_ARCH_6ZK__) +# define __ARM_ARCH 6 +# define __ARM_ARCH_ISA_THUMB 1 +# define __ARM_ARCH_ISA_ARM +# define __ARM_FEATURE_CLZ +# define __ARM_FEATURE_SIMD32 +# define __ARM_FEATURE_DSP +# define __ARM_FEATURE_QBIT +# define __ARM_FEATURE_SAT +# define __ARM_FEATURE_UNALIGNED +# ifndef __thumb__ +# if defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6ZK__) +# define __ARM_FEATURE_LDREX 15 +# else +# define __ARM_FEATURE_LDREX 4 +# endif +# endif +# endif + +# if defined (__ARM_ARCH_5TE__) || defined (__ARM_ARCH_5E__) +# define __ARM_ARCH 5 +# define __ARM_ARCH_ISA_ARM +# ifdef __ARM_ARCH_5TE__ +# define __ARM_ARCH_ISA_THUMB 1 +# endif +# define __ARM_FEATURE_CLZ +# define __ARM_FEATURE_DSP +# endif + +# if defined (__ARM_ARCH_5T__) || defined (__ARM_ARCH_5__) +# define __ARM_ARCH 5 +# define __ARM_ARCH_ISA_ARM +# ifdef __ARM_ARCH_5TE__ +# define __ARM_ARCH_ISA_THUMB 1 +# endif +# define __ARM_FEATURE_CLZ +# endif + +# ifdef __ARM_ARCH_4T__ +# define __ARM_ARCH 4 +# define __ARM_ARCH_ISA_ARM +# define __ARM_ARCH_ISA_THUMB 1 +# endif + +# ifdef __ARM_ARCH_4__ +# define __ARM_ARCH 4 +# define __ARM_ARCH_ISA_ARM +# endif + +# if defined (__ARM_ARCH_3__) || defined (__ARM_ARCH_3M__) +# define __ARM_ARCH 3 +# define __ARM_ARCH_ISA_ARM +# endif + +# ifdef __ARM_ARCH_2__ +# define __ARM_ARCH 2 +# define __ARM_ARCH_ISA_ARM +# endif + +# ifdef __ARMEB__ +# define __ARM_BIG_ENDIAN +# endif + +/* If we still don't know what the target architecture is, then we're + probably not using GCC. */ +# ifndef __ARM_ARCH +# error Unable to determine architecture version. +# endif + +#endif /* __ARM_ARCH */ Modified: stable/10/sys/arm/include/param.h ============================================================================== --- stable/10/sys/arm/include/param.h Wed Oct 29 16:20:49 2014 (r273826) +++ stable/10/sys/arm/include/param.h Wed Oct 29 16:24:02 2014 (r273827) @@ -46,13 +46,14 @@ */ #include +#include #define STACKALIGNBYTES (8 - 1) #define STACKALIGN(p) ((u_int)(p) & ~STACKALIGNBYTES) #define __PCI_REROUTE_INTERRUPT -#if defined(__FreeBSD_ARCH_armv6__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 6) +#if __ARM_ARCH >= 6 #define _V6_SUFFIX "v6" #else #define _V6_SUFFIX "" @@ -64,7 +65,7 @@ #define _HF_SUFFIX "" #endif -#ifdef __ARMEB__ +#ifdef __ARM_BIG_ENDIAN #define _EB_SUFFIX "eb" #else #define _EB_SUFFIX "" From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 16:36:09 2014 Return-Path: Delivered-To: svn-src-all@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 A4C842B1; Wed, 29 Oct 2014 16:36: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 85BA8211; Wed, 29 Oct 2014 16: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 s9TGa9vw029105; Wed, 29 Oct 2014 16:36:09 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9TGa8cx029100; Wed, 29 Oct 2014 16:36:08 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201410291636.s9TGa8cx029100@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 29 Oct 2014 16:36:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273828 - in stable/10: lib/libkvm sys/arm/arm sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 16:36:09 -0000 Author: andrew Date: Wed Oct 29 16:36:08 2014 New Revision: 273828 URL: https://svnweb.freebsd.org/changeset/base/273828 Log: MFC r273284: Allow libkvm to get the kernel va to pa delta without the need for physaddr. This should allow for a kernel where PHYSADDR and KERNPHYSADDR are both undefined. For now libkvm will use the old method of reading physaddr and kernaddr to allow it to work with old kernels. This could be removed in the future when enough time has passed. Modified: stable/10/lib/libkvm/kvm_arm.c stable/10/sys/arm/arm/dump_machdep.c stable/10/sys/sys/elf_common.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libkvm/kvm_arm.c ============================================================================== --- stable/10/lib/libkvm/kvm_arm.c Wed Oct 29 16:24:02 2014 (r273827) +++ stable/10/lib/libkvm/kvm_arm.c Wed Oct 29 16:36:08 2014 (r273828) @@ -128,8 +128,10 @@ _kvm_initvtop(kvm_t *kd) u_long kernbase, physaddr, pa; pd_entry_t *l1pt; Elf32_Ehdr *ehdr; + Elf32_Phdr *phdr; size_t hdrsz; char minihdr[8]; + int found, i; if (!kd->rawdump) { if (pread(kd->pmfd, &minihdr, 8, 0) == 8) { @@ -154,19 +156,33 @@ _kvm_initvtop(kvm_t *kd) hdrsz = ehdr->e_phoff + ehdr->e_phentsize * ehdr->e_phnum; if (_kvm_maphdrs(kd, hdrsz) == -1) return (-1); - nl[0].n_name = "kernbase"; - nl[1].n_name = NULL; - if (kvm_nlist(kd, nl) != 0) - kernbase = KERNBASE; - else - kernbase = nl[0].n_value; - nl[0].n_name = "physaddr"; - if (kvm_nlist(kd, nl) != 0) { - _kvm_err(kd, kd->program, "couldn't get phys addr"); - return (-1); + phdr = (Elf32_Phdr *)((uint8_t *)ehdr + ehdr->e_phoff); + found = 0; + for (i = 0; i < ehdr->e_phnum; i++) { + if (phdr[i].p_type == PT_DUMP_DELTA) { + kernbase = phdr[i].p_vaddr; + physaddr = phdr[i].p_paddr; + found = 1; + break; + } + } + + nl[1].n_name = NULL; + if (!found) { + nl[0].n_name = "kernbase"; + if (kvm_nlist(kd, nl) != 0) + kernbase = KERNBASE; + else + kernbase = nl[0].n_value; + + nl[0].n_name = "physaddr"; + if (kvm_nlist(kd, nl) != 0) { + _kvm_err(kd, kd->program, "couldn't get phys addr"); + return (-1); + } + physaddr = nl[0].n_value; } - physaddr = nl[0].n_value; nl[0].n_name = "kernel_l1pa"; if (kvm_nlist(kd, nl) != 0) { _kvm_err(kd, kd->program, "bad namelist"); Modified: stable/10/sys/arm/arm/dump_machdep.c ============================================================================== --- stable/10/sys/arm/arm/dump_machdep.c Wed Oct 29 16:24:02 2014 (r273827) +++ stable/10/sys/arm/arm/dump_machdep.c Wed Oct 29 16:36:08 2014 (r273828) @@ -246,6 +246,29 @@ cb_dumphdr(struct md_pa *mdp, int seqnr, return (error); } +/* + * Add a header to be used by libkvm to get the va to pa delta + */ +static int +dump_os_header(struct dumperinfo *di) +{ + Elf_Phdr phdr; + int error; + + bzero(&phdr, sizeof(phdr)); + phdr.p_type = PT_DUMP_DELTA; + phdr.p_flags = PF_R; /* XXX */ + phdr.p_offset = 0; + phdr.p_vaddr = KERNVIRTADDR; + phdr.p_paddr = pmap_kextract(KERNVIRTADDR); + phdr.p_filesz = 0; + phdr.p_memsz = 0; + phdr.p_align = PAGE_SIZE; + + error = buf_write(di, (char*)&phdr, sizeof(phdr)); + return (error); +} + static int cb_size(struct md_pa *mdp, int seqnr, void *arg) { @@ -311,7 +334,7 @@ dumpsys(struct dumperinfo *di) /* Calculate dump size. */ dumpsize = 0L; - ehdr.e_phnum = foreach_chunk(cb_size, &dumpsize); + ehdr.e_phnum = foreach_chunk(cb_size, &dumpsize) + 1; hdrsz = ehdr.e_phoff + ehdr.e_phnum * ehdr.e_phentsize; fileofs = MD_ALIGN(hdrsz); dumpsize += fileofs; @@ -328,7 +351,7 @@ dumpsys(struct dumperinfo *di) mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_ARM_VERSION, dumpsize, di->blocksize); printf("Dumping %llu MB (%d chunks)\n", (long long)dumpsize >> 20, - ehdr.e_phnum); + ehdr.e_phnum - 1); /* Dump leader */ error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); @@ -343,6 +366,8 @@ dumpsys(struct dumperinfo *di) /* Dump program headers */ error = foreach_chunk(cb_dumphdr, di); + if (error >= 0) + error = dump_os_header(di); if (error < 0) goto fail; buf_flush(di); Modified: stable/10/sys/sys/elf_common.h ============================================================================== --- stable/10/sys/sys/elf_common.h Wed Oct 29 16:24:02 2014 (r273827) +++ stable/10/sys/sys/elf_common.h Wed Oct 29 16:36:08 2014 (r273828) @@ -339,6 +339,8 @@ typedef struct { #define PT_GNU_EH_FRAME 0x6474e550 #define PT_GNU_STACK 0x6474e551 #define PT_GNU_RELRO 0x6474e552 +#define PT_DUMP_DELTA 0x6fb5d000 /* va->pa map for kernel dumps + (currently arm). */ #define PT_LOSUNW 0x6ffffffa #define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */ #define PT_SUNWSTACK 0x6ffffffb /* describes the stack segment */ From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 16:38:14 2014 Return-Path: Delivered-To: svn-src-all@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 5FE66422; Wed, 29 Oct 2014 16:38: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 4BAC723F; Wed, 29 Oct 2014 16:38: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 s9TGcE8m029409; Wed, 29 Oct 2014 16:38:14 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9TGcESN029408; Wed, 29 Oct 2014 16:38:14 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201410291638.s9TGcESN029408@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 29 Oct 2014 16:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273829 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 16:38:14 -0000 Author: andrew Date: Wed Oct 29 16:38:13 2014 New Revision: 273829 URL: https://svnweb.freebsd.org/changeset/base/273829 Log: MFC r273287: Only build the ARM tranpoline when KERNPHYSADDR is defined as it is otherwise unneeded in armv6 kernels. Modified: stable/10/sys/conf/Makefile.arm Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/Makefile.arm ============================================================================== --- stable/10/sys/conf/Makefile.arm Wed Oct 29 16:36:08 2014 (r273828) +++ stable/10/sys/conf/Makefile.arm Wed Oct 29 16:38:13 2014 (r273829) @@ -81,6 +81,7 @@ FILES_CPU_FUNC = \ $S/$M/$M/cpufunc_asm_pj4b.S $S/$M/$M/cpufunc_asm_armv6.S \ $S/$M/$M/cpufunc_asm_armv7.S +.if defined(KERNPHYSADDR) KERNEL_EXTRA=trampoline KERNEL_EXTRA_INSTALL=kernel.gz.tramp trampoline: ${KERNEL_KO}.tramp @@ -125,6 +126,7 @@ ${KERNEL_KO}.tramp: ${KERNEL_KO} $S/$M/$ ${KERNEL_KO}.gz.tramp.bin rm ${KERNEL_KO}.tmp.gz ${KERNEL_KO}.tramp.noheader opt_kernname.h \ inflate-tramp.o tmphack.S +.endif MKMODULESENV+= MACHINE=${MACHINE} From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 16:41:21 2014 Return-Path: Delivered-To: svn-src-all@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 A2C9B5C6; Wed, 29 Oct 2014 16:41: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 747A9321; Wed, 29 Oct 2014 16:41: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 s9TGfLRu030938; Wed, 29 Oct 2014 16:41:21 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9TGfLe3030937; Wed, 29 Oct 2014 16:41:21 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201410291641.s9TGfLe3030937@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 29 Oct 2014 16:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273830 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 16:41:21 -0000 Author: andrew Date: Wed Oct 29 16:41:20 2014 New Revision: 273830 URL: https://svnweb.freebsd.org/changeset/base/273830 Log: MFC r273288: Allow the armv6 kernel to be build with PHYSADDR undefined. The kernel will now find the virtual to physical mapping for libkvm to use at runtime. This makes PHYSADDR redundant, however keep it around to give everyone a chance to update their libkvm. Modified: stable/10/sys/arm/arm/locore.S Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/locore.S ============================================================================== --- stable/10/sys/arm/arm/locore.S Wed Oct 29 16:38:13 2014 (r273829) +++ stable/10/sys/arm/arm/locore.S Wed Oct 29 16:41:20 2014 (r273830) @@ -42,6 +42,18 @@ __FBSDID("$FreeBSD$"); +/* + * Sanity check the configuration. + * FLASHADDR and LOADERRAMADDR depend on PHYSADDR in some cases. + * ARMv4 and ARMv5 make assumptions on where they are loaded. + * + * TODO: Fix the ARMv4/v5 case. + */ +#if (defined(FLASHADDR) || defined(LOADERRAMADDR) || !defined(_ARM_ARCH_6)) && \ + !defined(PHYSADDR) +#error PHYSADDR must be defined for this configuration +#endif + /* What size should this really be ? It is only used by initarm() */ #define INIT_ARM_STACK_SIZE (2048 * 4) @@ -54,15 +66,21 @@ __FBSDID("$FreeBSD$"); CPWAIT_BRANCH /* branch to next insn */ /* - * This is for kvm_mkdb, and should be the address of the beginning + * This is for libkvm, and should be the address of the beginning * of the kernel text segment (not necessarily the same as kernbase). + * + * These are being phased out. Newer copies of libkvm don't need these + * values as the information is added to the core file by inspecting + * the running kernel. */ .text .align 0 +#ifdef PHYSADDR .globl kernbase .set kernbase,KERNBASE .globl physaddr .set physaddr,PHYSADDR +#endif /* * On entry for FreeBSD boot ABI: From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 16:48:23 2014 Return-Path: Delivered-To: svn-src-all@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 004738AD; Wed, 29 Oct 2014 16:48:22 +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 DE207384; Wed, 29 Oct 2014 16:48:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9TGmLeb034211; Wed, 29 Oct 2014 16:48:21 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9TGmIXM034195; Wed, 29 Oct 2014 16:48:18 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201410291648.s9TGmIXM034195@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Wed, 29 Oct 2014 16:48:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273831 - in stable/10/usr.sbin/bsdinstall: partedit scripts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 16:48:23 -0000 Author: nwhitehorn Date: Wed Oct 29 16:48:18 2014 New Revision: 273831 URL: https://svnweb.freebsd.org/changeset/base/273831 Log: MFC r271539,273003,273005: Add ZFS support to the bsdinstall partition editor and sade Submitted by: Kurt Lidl (original version) Modified: stable/10/usr.sbin/bsdinstall/partedit/gpart_ops.c stable/10/usr.sbin/bsdinstall/partedit/part_wizard.c stable/10/usr.sbin/bsdinstall/partedit/partedit.c stable/10/usr.sbin/bsdinstall/partedit/partedit.h stable/10/usr.sbin/bsdinstall/partedit/partedit_generic.c stable/10/usr.sbin/bsdinstall/partedit/partedit_pc98.c stable/10/usr.sbin/bsdinstall/partedit/partedit_powerpc.c stable/10/usr.sbin/bsdinstall/partedit/partedit_sparc64.c stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c stable/10/usr.sbin/bsdinstall/partedit/scripted.c stable/10/usr.sbin/bsdinstall/scripts/config stable/10/usr.sbin/bsdinstall/scripts/zfsboot Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/partedit/gpart_ops.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/gpart_ops.c Wed Oct 29 16:41:20 2014 (r273830) +++ stable/10/usr.sbin/bsdinstall/partedit/gpart_ops.c Wed Oct 29 16:48:18 2014 (r273831) @@ -27,6 +27,7 @@ */ #include +#include #include #include #include @@ -119,6 +120,53 @@ newfs_command(const char *fstype, char * else if (strcmp(items[i].name, "TRIM") == 0) strcat(command, "-t "); } + } else if (strcmp(fstype, "freebsd-zfs") == 0) { + int i; + DIALOG_LISTITEM items[] = { + {"fletcher4", "checksum algorithm: fletcher4", + "Use fletcher4 for data integrity checking. " + "(default)", 1 }, + {"fletcher2", "checksum algorithm: fletcher2", + "Use fletcher2 for data integrity checking. " + "(not recommended)", 0 }, + {"sha256", "checksum algorithm: sha256", + "Use sha256 for data integrity checking. " + "(not recommended)", 0 }, + {"atime", "Update atimes for files", + "Disable atime update", 0 }, + }; + + if (!use_default) { + int choice; + choice = dlg_checklist("ZFS Options", "", 0, 0, 0, + sizeof(items)/sizeof(items[0]), items, NULL, + FLAG_CHECK, &i); + if (choice == 1) /* Cancel */ + return; + } + + strcpy(command, "zpool create -f -m none "); + if (getenv("BSDINSTALL_TMPBOOT") != NULL) { + char zfsboot_path[MAXPATHLEN]; + sprintf(zfsboot_path, "%s/zfs", + getenv("BSDINSTALL_TMPBOOT")); + mkdir(zfsboot_path, S_IRWXU | S_IRGRP | S_IXGRP | + S_IROTH | S_IXOTH); + sprintf(command, "%s -o cachefile=%s/zpool.cache ", + command, zfsboot_path); + } + for (i = 0; i < (int)(sizeof(items)/sizeof(items[0])); i++) { + if (items[i].state == 0) + continue; + if (strcmp(items[i].name, "fletcher4") == 0) + strcat(command, "-O checksum=fletcher4 "); + else if (strcmp(items[i].name, "fletcher2") == 0) + strcat(command, "-O checksum=fletcher2 "); + else if (strcmp(items[i].name, "sha256") == 0) + strcat(command, "-O checksum=sha256 "); + else if (strcmp(items[i].name, "atime") == 0) + strcat(command, "-O atime=off "); + } } else if (strcmp(fstype, "fat32") == 0 || strcmp(fstype, "efi") == 0) { int i; DIALOG_LISTITEM items[] = { @@ -329,7 +377,7 @@ gpart_bootcode(struct ggeom *gp) } static void -gpart_partcode(struct gprovider *pp) +gpart_partcode(struct gprovider *pp, const char *fstype) { struct gconfig *gc; const char *scheme; @@ -344,7 +392,7 @@ gpart_partcode(struct gprovider *pp) } /* Make sure this partition scheme needs partcode on this platform */ - if (partcode_path(scheme) == NULL) + if (partcode_path(scheme, fstype) == NULL) return; LIST_FOREACH(gc, &pp->lg_config, lg_config) { @@ -356,7 +404,7 @@ gpart_partcode(struct gprovider *pp) /* Shell out to gpart for partcode for now */ sprintf(command, "gpart bootcode -p %s -i %s %s", - partcode_path(scheme), indexstr, pp->lg_geom->lg_name); + partcode_path(scheme, fstype), indexstr, pp->lg_geom->lg_name); if (system(command) != 0) { sprintf(message, "Error installing partcode on partition %s", pp->lg_name); @@ -416,15 +464,15 @@ gpart_edit(struct gprovider *pp) const char *errstr, *oldtype, *scheme; struct partition_metadata *md; char sizestr[32]; - char newfs[64]; + char newfs[255]; intmax_t idx; int hadlabel, choice, junk, nitems; unsigned i; DIALOG_FORMITEM items[] = { {0, "Type:", 5, 0, 0, FALSE, "", 11, 0, 12, 15, 0, - FALSE, "Filesystem type (e.g. freebsd-ufs, freebsd-swap)", - FALSE}, + FALSE, "Filesystem type (e.g. freebsd-ufs, freebsd-zfs, " + "freebsd-swap)", FALSE}, {0, "Size:", 5, 1, 0, FALSE, "", 11, 1, 12, 0, 0, FALSE, "Partition size. Append K, M, G for kilobytes, " "megabytes or gigabytes.", FALSE}, @@ -565,6 +613,8 @@ set_default_part_metadata(const char *na const char *type, const char *mountpoint, const char *newfs) { struct partition_metadata *md; + char *zpool_name = NULL; + int i; /* Set part metadata */ md = get_part_metadata(name, 1); @@ -577,8 +627,18 @@ set_default_part_metadata(const char *na if (newfs != NULL && newfs[0] != '\0') { md->newfs = malloc(strlen(newfs) + strlen(" /dev/") + - strlen(name) + 1); - sprintf(md->newfs, "%s /dev/%s", newfs, name); + strlen(mountpoint) + 5 + strlen(name) + 1); + if (strcmp("freebsd-zfs", type) == 0) { + zpool_name = strdup((strlen(mountpoint) == 1) ? + "root" : &mountpoint[1]); + for (i = 0; zpool_name[i] != 0; i++) + if (!isalnum(zpool_name[i])) + zpool_name[i] = '_'; + sprintf(md->newfs, "%s %s /dev/%s", newfs, + zpool_name, name); + } else { + sprintf(md->newfs, "%s /dev/%s", newfs, name); + } } } @@ -587,8 +647,9 @@ set_default_part_metadata(const char *na if (strcmp(type, bootpart_type(scheme)) == 0) md->bootcode = 1; - /* VTOC8 needs partcode in UFS partitions */ - if (strcmp(scheme, "VTOC8") == 0 && strcmp(type, "freebsd-ufs") == 0) + /* VTOC8 needs partcode at the start of partitions */ + if (strcmp(scheme, "VTOC8") == 0 && (strcmp(type, "freebsd-ufs") == 0 + || strcmp(type, "freebsd-zfs") == 0)) md->bootcode = 1; if (mountpoint == NULL || mountpoint[0] == '\0') { @@ -611,8 +672,13 @@ set_default_part_metadata(const char *na free(md->fstab->fs_mntops); free(md->fstab->fs_type); } - md->fstab->fs_spec = malloc(strlen(name) + 6); - sprintf(md->fstab->fs_spec, "/dev/%s", name); + if (strcmp("freebsd-zfs", type) == 0) { + md->fstab->fs_spec = strdup(zpool_name); + } else { + md->fstab->fs_spec = malloc(strlen(name) + + strlen("/dev/") + 1); + sprintf(md->fstab->fs_spec, "/dev/%s", name); + } md->fstab->fs_file = strdup(mountpoint); /* Get VFS from text after freebsd-, if possible */ if (strncmp("freebsd-", type, 8) == 0) @@ -625,6 +691,10 @@ set_default_part_metadata(const char *na md->fstab->fs_type = strdup(FSTAB_SW); md->fstab->fs_freq = 0; md->fstab->fs_passno = 0; + } else if (strcmp(type, "freebsd-zfs") == 0) { + md->fstab->fs_type = strdup(FSTAB_RW); + md->fstab->fs_freq = 0; + md->fstab->fs_passno = 0; } else { md->fstab->fs_type = strdup(FSTAB_RW); if (strcmp(mountpoint, "/") == 0) { @@ -637,6 +707,9 @@ set_default_part_metadata(const char *na } md->fstab->fs_mntops = strdup(md->fstab->fs_type); } + + if (zpool_name != NULL) + free(zpool_name); } static @@ -748,7 +821,7 @@ gpart_create(struct gprovider *pp, char struct ggeom *geom; const char *errstr, *scheme; char sizestr[32], startstr[32], output[64], *newpartname; - char newfs[64], options_fstype[64]; + char newfs[255], options_fstype[64]; intmax_t maxsize, size, sector, firstfree, stripe; uint64_t bytes; int nitems, choice, junk; @@ -756,8 +829,8 @@ gpart_create(struct gprovider *pp, char DIALOG_FORMITEM items[] = { {0, "Type:", 5, 0, 0, FALSE, "freebsd-ufs", 11, 0, 12, 15, 0, - FALSE, "Filesystem type (e.g. freebsd-ufs, freebsd-swap)", - FALSE}, + FALSE, "Filesystem type (e.g. freebsd-ufs, freebsd-zfs, " + "freebsd-swap)", FALSE}, {0, "Size:", 5, 1, 0, FALSE, "", 11, 1, 12, 15, 0, FALSE, "Partition size. Append K, M, G for kilobytes, " "megabytes or gigabytes.", FALSE}, @@ -935,6 +1008,20 @@ addpartform: goto addpartform; } + /* If this is the root partition, check that this fs is bootable */ + if (strcmp(items[2].text, "/") == 0 && !is_fs_bootable(scheme, + items[0].text)) { + char message[512]; + sprintf(message, "This file system (%s) is not bootable " + "on this system. Are you sure you want to proceed?", + items[0].text); + dialog_vars.defaultno = TRUE; + choice = dialog_yesno("Warning", message, 0, 0); + dialog_vars.defaultno = FALSE; + if (choice == 1) /* cancel */ + goto addpartform; + } + /* * If this is the root partition, and we need a boot partition, ask * the user to add one. @@ -1177,12 +1264,22 @@ gpart_commit(struct gmesh *mesh) struct gctl_req *r; const char *errstr; const char *modified; + const char *rootfs; LIST_FOREACH(classp, &mesh->lg_class, lg_class) { if (strcmp(classp->lg_name, "PART") == 0) break; } + /* Figure out what filesystem / uses */ + rootfs = "ufs"; /* Assume ufs if nothing else present */ + TAILQ_FOREACH(md, &part_metadata, metadata) { + if (md->fstab != NULL && strcmp(md->fstab->fs_file, "/") == 0) { + rootfs = md->fstab->fs_vfstype; + break; + } + } + if (strcmp(classp->lg_name, "PART") != 0) { dialog_msgbox("Error", "gpart not found!", 0, 0, TRUE); return; @@ -1222,7 +1319,7 @@ gpart_commit(struct gmesh *mesh) break; if (cp == NULL) /* No sub-partitions */ - gpart_partcode(pp); + gpart_partcode(pp, rootfs); } r = gctl_get_handle(); Modified: stable/10/usr.sbin/bsdinstall/partedit/part_wizard.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/part_wizard.c Wed Oct 29 16:41:20 2014 (r273830) +++ stable/10/usr.sbin/bsdinstall/partedit/part_wizard.c Wed Oct 29 16:48:18 2014 (r273831) @@ -31,6 +31,9 @@ #include #include +#include +#include + #include #include #include @@ -44,10 +47,16 @@ static char *boot_disk(struct gmesh *mes static char *wizard_partition(struct gmesh *mesh, const char *disk); int -part_wizard(void) { +part_wizard(const char *fsreq) { int error; struct gmesh mesh; char *disk, *schemeroot; + const char *fstype; + + if (fsreq != NULL) + fstype = fsreq; + else + fstype = "ufs"; startwizard: error = geom_gettree(&mesh); @@ -70,11 +79,11 @@ startwizard: dlg_put_backtitle(); error = geom_gettree(&mesh); - error = wizard_makeparts(&mesh, schemeroot, 1); + error = wizard_makeparts(&mesh, schemeroot, fstype, 1); if (error) goto startwizard; free(schemeroot); - + geom_deletetree(&mesh); return (0); @@ -106,9 +115,9 @@ boot_disk(struct gmesh *mesh) LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { desc = type = NULL; LIST_FOREACH(gc, &pp->lg_config, lg_config) { - if (strcmp(gc->lg_name, "type") == 0) + if (strcmp(gc->lg_name, "type") == 0) type = gc->lg_val; - if (strcmp(gc->lg_name, "descr") == 0) + if (strcmp(gc->lg_name, "descr") == 0) desc = gc->lg_val; } @@ -200,7 +209,7 @@ wizard_partition(struct gmesh *mesh, con break; if (classp != NULL) { - LIST_FOREACH(gpart, &classp->lg_geom, lg_geom) + LIST_FOREACH(gpart, &classp->lg_geom, lg_geom) if (strcmp(gpart->lg_name, disk) == 0) break; } @@ -282,21 +291,29 @@ query: } int -wizard_makeparts(struct gmesh *mesh, const char *disk, int interactive) +wizard_makeparts(struct gmesh *mesh, const char *disk, const char *fstype, int interactive) { struct gmesh submesh; struct gclass *classp; struct ggeom *gp; struct gprovider *pp; intmax_t swapsize, available; - char swapsizestr[10], rootsizestr[10]; + char swapsizestr[10], rootsizestr[10], *fsname; + char *fsnames[] = {"freebsd-ufs", "freebsd-zfs"}; int retval; + if (strcmp(fstype, "zfs") == 0) { + fsname = fsnames[1]; + } else { + /* default to UFS */ + fsname = fsnames[0]; + } + LIST_FOREACH(classp, &mesh->lg_class, lg_class) if (strcmp(classp->lg_name, "PART") == 0) break; - LIST_FOREACH(gp, &classp->lg_geom, lg_geom) + LIST_FOREACH(gp, &classp->lg_geom, lg_geom) if (strcmp(gp->lg_name, disk) == 0) break; @@ -331,7 +348,7 @@ wizard_makeparts(struct gmesh *mesh, con geom_gettree(&submesh); pp = provider_for_name(&submesh, disk); - gpart_create(pp, "freebsd-ufs", rootsizestr, "/", NULL, 0); + gpart_create(pp, fsname, rootsizestr, "/", NULL, 0); geom_deletetree(&submesh); geom_gettree(&submesh); Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit.c Wed Oct 29 16:41:20 2014 (r273830) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit.c Wed Oct 29 16:48:18 2014 (r273831) @@ -95,7 +95,12 @@ main(int argc, const char **argv) if (strcmp(basename(argv[0]), "autopart") == 0) { /* Guided */ prompt = "Please review the disk setup. When complete, press " "the Finish button."; - part_wizard(); + /* Experimental ZFS autopartition support */ + if (argc > 1 && strcmp(argv[1], "zfs") == 0) { + part_wizard("zfs"); + } else { + part_wizard("ufs"); + } } else if (strcmp(basename(argv[0]), "scriptedpart") == 0) { error = scripted_editor(argc, argv); prompt = NULL; @@ -162,7 +167,7 @@ main(int argc, const char **argv) init_fstab_metadata(); break; case 4: /* Auto */ - part_wizard(); + part_wizard("ufs"); break; } Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit.h ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit.h Wed Oct 29 16:41:20 2014 (r273830) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit.h Wed Oct 29 16:48:18 2014 (r273831) @@ -54,9 +54,10 @@ struct partition_metadata { struct partition_metadata *get_part_metadata(const char *name, int create); void delete_part_metadata(const char *name); -int part_wizard(void); +int part_wizard(const char *fstype); int scripted_editor(int argc, const char **argv); -int wizard_makeparts(struct gmesh *mesh, const char *disk, int interactive); +int wizard_makeparts(struct gmesh *mesh, const char *disk, const char *fstype, + int interactive); /* gpart operations */ void gpart_delete(struct gprovider *pp); @@ -75,9 +76,10 @@ void set_default_part_metadata(const cha /* machine-dependent bootability checks */ const char *default_scheme(void); int is_scheme_bootable(const char *scheme); +int is_fs_bootable(const char *scheme, const char *fs); size_t bootpart_size(const char *scheme); const char *bootpart_type(const char *scheme); const char *bootcode_path(const char *scheme); -const char *partcode_path(const char *scheme); +const char *partcode_path(const char *scheme, const char *fs_type); #endif Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_generic.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit_generic.c Wed Oct 29 16:41:20 2014 (r273830) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit_generic.c Wed Oct 29 16:48:18 2014 (r273831) @@ -50,6 +50,11 @@ is_scheme_bootable(const char *part_type return (1); } +int +is_fs_bootable(const char *part_type, const char *fs) { + return (1); +} + /* No clue => no boot partition, bootcode, or partcode */ size_t @@ -68,7 +73,7 @@ bootcode_path(const char *part_type) { } const char * -partcode_path(const char *part_type) { +partcode_path(const char *part_type, const char *fs_type) { return (NULL); } Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_pc98.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit_pc98.c Wed Oct 29 16:41:20 2014 (r273830) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit_pc98.c Wed Oct 29 16:48:18 2014 (r273831) @@ -45,6 +45,15 @@ is_scheme_bootable(const char *part_type return (0); } +int +is_fs_bootable(const char *part_type, const char *fs) +{ + if (strcmp(fs, "freebsd-ufs") == 0) + return (1); + + return (0); +} + size_t bootpart_size(const char *part_type) { /* No boot partition */ @@ -67,7 +76,7 @@ bootcode_path(const char *part_type) { } const char * -partcode_path(const char *part_type) { +partcode_path(const char *part_type, const char *fs_type) { /* No partcode */ return (NULL); } Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_powerpc.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit_powerpc.c Wed Oct 29 16:41:20 2014 (r273830) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit_powerpc.c Wed Oct 29 16:48:18 2014 (r273831) @@ -67,6 +67,15 @@ is_scheme_bootable(const char *part_type return (0); } +int +is_fs_bootable(const char *part_type, const char *fs) +{ + if (strcmp(fs, "freebsd-ufs") == 0) + return (1); + + return (0); +} + size_t bootpart_size(const char *part_type) { size_t platlen = sizeof(platform); @@ -100,7 +109,7 @@ bootcode_path(const char *part_type) { } const char * -partcode_path(const char *part_type) { +partcode_path(const char *part_type, const char *fs_type) { size_t platlen = sizeof(platform); if (strlen(platform) == 0) sysctlbyname("hw.platform", platform, &platlen, NULL, -1); Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_sparc64.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit_sparc64.c Wed Oct 29 16:41:20 2014 (r273830) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit_sparc64.c Wed Oct 29 16:48:18 2014 (r273831) @@ -42,6 +42,15 @@ is_scheme_bootable(const char *part_type return (0); } +int +is_fs_bootable(const char *part_type, const char *fs) +{ + if (strcmp(fs, "freebsd-ufs") == 0 || strcmp(fs, "freebsd-zfs") == 0) + return (1); + return (0); +} + + size_t bootpart_size(const char *part_type) { /* No standalone boot partition */ @@ -58,11 +67,16 @@ const char * bootcode_path(const char *part_type) { return (NULL); } - + const char * -partcode_path(const char *part_type) { - if (strcmp(part_type, "VTOC8") == 0) - return ("/boot/boot1"); +partcode_path(const char *part_type, const char *fs_type) { + if (strcmp(part_type, "VTOC8") == 0) { + if (strcmp(fs_type, "ufs") == 0) { + return ("/boot/boot1"); + } else if (strcmp(fs_type, "zfs") == 0) { + return ("/boot/zfsboot"); + } + } return (NULL); } Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c Wed Oct 29 16:41:20 2014 (r273830) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c Wed Oct 29 16:48:18 2014 (r273831) @@ -32,23 +32,35 @@ #include "partedit.h" -static char platform[255] = ""; -static const char *platform_sysctl = "machdep.bootmethod"; +static const char * +x86_bootmethod(void) +{ + static char fw[255] = ""; + size_t len = sizeof(fw); + int error; + + if (strlen(fw) == 0) { + error = sysctlbyname("machdep.bootmethod", fw, &len, NULL, -1); + if (error != 0) + return ("BIOS"); + } + + return (fw); +} const char * -default_scheme(void) { +default_scheme(void) +{ return ("GPT"); } int -is_scheme_bootable(const char *part_type) { - size_t platlen = sizeof(platform); - if (strlen(platform) == 0) - sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); +is_scheme_bootable(const char *part_type) +{ if (strcmp(part_type, "GPT") == 0) return (1); - if (strcmp(platform, "BIOS") == 0) { + if (strcmp(x86_bootmethod(), "BIOS") == 0) { if (strcmp(part_type, "BSD") == 0) return (1); if (strcmp(part_type, "MBR") == 0) @@ -58,17 +70,30 @@ is_scheme_bootable(const char *part_type return (0); } +int +is_fs_bootable(const char *part_type, const char *fs) +{ + + if (strcmp(fs, "freebsd-ufs") == 0) + return (1); + + if (strcmp(fs, "freebsd-zfs") == 0 && + strcmp(part_type, "GPT") == 0 && + strcmp(x86_bootmethod(), "BIOS") == 0) + return (1); + + return (0); +} + size_t -bootpart_size(const char *scheme) { - size_t platlen = sizeof(platform); - if (strlen(platform) == 0) - sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); +bootpart_size(const char *scheme) +{ /* No partcode except for GPT */ if (strcmp(scheme, "GPT") != 0) return (0); - if (strcmp(platform, "BIOS") == 0) + if (strcmp(x86_bootmethod(), "BIOS") == 0) return (512*1024); else return (800*1024); @@ -77,23 +102,20 @@ bootpart_size(const char *scheme) { } const char * -bootpart_type(const char *scheme) { - size_t platlen = sizeof(platform); - if (strlen(platform) == 0) - sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); +bootpart_type(const char *scheme) +{ - if (strcmp(platform, "UEFI") == 0) + if (strcmp(x86_bootmethod(), "UEFI") == 0) return ("efi"); return ("freebsd-boot"); } const char * -bootcode_path(const char *part_type) { - size_t platlen = sizeof(platform); - if (strlen(platform) == 0) - sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); - if (strcmp(platform, "UEFI") == 0) +bootcode_path(const char *part_type) +{ + + if (strcmp(x86_bootmethod(), "UEFI") == 0) return (NULL); if (strcmp(part_type, "GPT") == 0) @@ -107,14 +129,14 @@ bootcode_path(const char *part_type) { } const char * -partcode_path(const char *part_type) { - size_t platlen = sizeof(platform); - if (strlen(platform) == 0) - sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); +partcode_path(const char *part_type, const char *fs_type) +{ if (strcmp(part_type, "GPT") == 0) { - if (strcmp(platform, "UEFI") == 0) + if (strcmp(x86_bootmethod(), "UEFI") == 0) return ("/boot/boot1.efifat"); + else if (strcmp(fs_type, "zfs") == 0) + return ("/boot/gptzfsboot"); else return ("/boot/gptboot"); } Modified: stable/10/usr.sbin/bsdinstall/partedit/scripted.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/scripted.c Wed Oct 29 16:41:20 2014 (r273830) +++ stable/10/usr.sbin/bsdinstall/partedit/scripted.c Wed Oct 29 16:48:18 2014 (r273831) @@ -109,7 +109,7 @@ part_config(char *disk, const char *sche /* Create partitions */ if (config == NULL) { - wizard_makeparts(&mesh, disk, 0); + wizard_makeparts(&mesh, disk, "ufs", 0); goto finished; } Modified: stable/10/usr.sbin/bsdinstall/scripts/config ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/config Wed Oct 29 16:41:20 2014 (r273830) +++ stable/10/usr.sbin/bsdinstall/scripts/config Wed Oct 29 16:48:18 2014 (r273831) @@ -36,6 +36,7 @@ cp $BSDINSTALL_TMPETC/* $BSDINSTALL_CHRO cat $BSDINSTALL_TMPBOOT/loader.conf.* >> $BSDINSTALL_TMPBOOT/loader.conf rm $BSDINSTALL_TMPBOOT/loader.conf.* +df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "zfs_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/zfsboot Wed Oct 29 16:41:20 2014 (r273830) +++ stable/10/usr.sbin/bsdinstall/scripts/zfsboot Wed Oct 29 16:48:18 2014 (r273831) @@ -1315,8 +1315,6 @@ zfs_create_boot() "$funcname" f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_enable=\"YES\"' \ $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE - f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=\"YES\"' \ - $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE f_eval_catch $funcname echo "$ECHO_APPEND" \ 'kern.geom.label.gptid.enable=\"0\"' \ $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 16:49:30 2014 Return-Path: Delivered-To: svn-src-all@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 DDCF79EE; Wed, 29 Oct 2014 16: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 C9DB338E; Wed, 29 Oct 2014 16: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 s9TGnTiM034402; Wed, 29 Oct 2014 16:49:29 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9TGnTkH034400; Wed, 29 Oct 2014 16:49:29 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201410291649.s9TGnTkH034400@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Wed, 29 Oct 2014 16:49:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r273832 - in releng/10.1/sys/amd64: amd64 vmm X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 16:49:30 -0000 Author: neel Date: Wed Oct 29 16:49:28 2014 New Revision: 273832 URL: https://svnweb.freebsd.org/changeset/base/273832 Log: MFS10 r273573, MFC r273356: Fix a race in pmap_emulate_accessed_dirty() that could trigger a EPT misconfiguration VM-exit. MFS10 r273807, MFC r273666: Don't pass the 'error' return from an I/O port handler directly to vm_run(). Approved by: re (kib) Modified: releng/10.1/sys/amd64/amd64/pmap.c releng/10.1/sys/amd64/vmm/vmm_ioport.c Directory Properties: releng/10.1/ (props changed) Modified: releng/10.1/sys/amd64/amd64/pmap.c ============================================================================== --- releng/10.1/sys/amd64/amd64/pmap.c Wed Oct 29 16:48:18 2014 (r273831) +++ releng/10.1/sys/amd64/amd64/pmap.c Wed Oct 29 16:49:28 2014 (r273832) @@ -6787,9 +6787,19 @@ retry: if (ftype == VM_PROT_WRITE) { if ((*pte & PG_RW) == 0) goto done; - *pte |= PG_M; + /* + * Set the modified and accessed bits simultaneously. + * + * Intel EPT PTEs that do software emulation of A/D bits map + * PG_A and PG_M to EPT_PG_READ and EPT_PG_WRITE respectively. + * An EPT misconfiguration is triggered if the PTE is writable + * but not readable (WR=10). This is avoided by setting PG_A + * and PG_M simultaneously. + */ + *pte |= PG_M | PG_A; + } else { + *pte |= PG_A; } - *pte |= PG_A; /* try to promote the mapping */ if (va < VM_MAXUSER_ADDRESS) Modified: releng/10.1/sys/amd64/vmm/vmm_ioport.c ============================================================================== --- releng/10.1/sys/amd64/vmm/vmm_ioport.c Wed Oct 29 16:48:18 2014 (r273831) +++ releng/10.1/sys/amd64/vmm/vmm_ioport.c Wed Oct 29 16:49:28 2014 (r273832) @@ -106,15 +106,14 @@ emulate_inout_port(struct vm *vm, int vc uint32_t mask, val; int error; - error = 0; - *retu = true; - - if (vmexit->u.inout.port >= MAX_IOPORTS) - goto done; - - handler = ioport_handler[vmexit->u.inout.port]; - if (handler == NULL) - goto done; + /* + * If there is no handler for the I/O port then punt to userspace. + */ + if (vmexit->u.inout.port >= MAX_IOPORTS || + (handler = ioport_handler[vmexit->u.inout.port]) == NULL) { + *retu = true; + return (0); + } mask = vie_size2mask(vmexit->u.inout.bytes); @@ -124,20 +123,27 @@ emulate_inout_port(struct vm *vm, int vc error = (*handler)(vm, vcpuid, vmexit->u.inout.in, vmexit->u.inout.port, vmexit->u.inout.bytes, &val); + if (error) { + /* + * The value returned by this function is also the return value + * of vm_run(). This needs to be a positive number otherwise it + * can be interpreted as a "pseudo-error" like ERESTART. + * + * Enforce this by mapping all errors to EIO. + */ + return (EIO); + } - if (!error) { - *retu = false; - if (vmexit->u.inout.in) { - vmexit->u.inout.eax &= ~mask; - vmexit->u.inout.eax |= val & mask; - error = vm_set_register(vm, vcpuid, - VM_REG_GUEST_RAX, vmexit->u.inout.eax); - KASSERT(error == 0, ("emulate_ioport: error %d " - "setting guest rax register", error)); - } + if (vmexit->u.inout.in) { + vmexit->u.inout.eax &= ~mask; + vmexit->u.inout.eax |= val & mask; + error = vm_set_register(vm, vcpuid, VM_REG_GUEST_RAX, + vmexit->u.inout.eax); + KASSERT(error == 0, ("emulate_ioport: error %d setting guest " + "rax register", error)); } -done: - return (error); + *retu = false; + return (0); } static int From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 16:53:34 2014 Return-Path: Delivered-To: svn-src-all@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 E47D2BFB; Wed, 29 Oct 2014 16:53:34 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id C503565A; Wed, 29 Oct 2014 16:53:34 +0000 (UTC) Received: from bender.lan (97e078e7.skybroadband.com [151.224.120.231]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id 824845C692; Wed, 29 Oct 2014 16:53:27 +0000 (UTC) Date: Wed, 29 Oct 2014 16:52:49 +0000 From: Andrew Turner To: Andrew Turner Subject: Re: svn commit: r273830 - stable/10/sys/arm/arm Message-ID: <20141029165249.046b8e8b@bender.lan> In-Reply-To: <201410291641.s9TGfLe3030937@svn.freebsd.org> References: <201410291641.s9TGfLe3030937@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 16:53:35 -0000 On Wed, 29 Oct 2014 16:41:21 +0000 (UTC) Andrew Turner wrote: > Author: andrew > Date: Wed Oct 29 16:41:20 2014 > New Revision: 273830 > URL: https://svnweb.freebsd.org/changeset/base/273830 > > Log: > MFC r273288: > > Allow the armv6 kernel to be build with PHYSADDR undefined. The > kernel will now find the virtual to physical mapping for libkvm to > use at runtime. This makes PHYSADDR redundant, however keep it around > to give everyone a chance to update their libkvm. ... > @@ -54,15 +66,21 @@ __FBSDID("$FreeBSD$"); > CPWAIT_BRANCH /* branch to next insn > */ > /* > - * This is for kvm_mkdb, and should be the address of the beginning > + * This is for libkvm, and should be the address of the beginning > * of the kernel text segment (not necessarily the same as kernbase). > + * > + * These are being phased out. Newer copies of libkvm don't need > these > + * values as the information is added to the core file by inspecting > + * the running kernel. > */ > .text > .align 0 > +#ifdef PHYSADDR > .globl kernbase > .set kernbase,KERNBASE > .globl physaddr > .set physaddr,PHYSADDR > +#endif While this is now an option PHYSADDR should be enabled on all kernel configs in this branch. It could be considered a POLA violation to have an old libkvm not work with a new kernel dump. This change just allows users to change their kernel config to not define PHYSADDR. Abndrew From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 16:55:30 2014 Return-Path: Delivered-To: svn-src-all@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 CEB56DF9; Wed, 29 Oct 2014 16:55:30 +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 412F2686; Wed, 29 Oct 2014 16:55:30 +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 s9TGtOIe006678 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 29 Oct 2014 18:55:24 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s9TGtOIe006678 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s9TGtOYD006676; Wed, 29 Oct 2014 18:55:24 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 29 Oct 2014 18:55:24 +0200 From: Konstantin Belousov To: Bruce Evans Subject: Re: svn commit: r273129 - head/sys/kern Message-ID: <20141029165523.GF53947@kib.kiev.ua> References: <201410151238.s9FCcRMe018200@svn.freebsd.org> <20141028040935.M3114@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141028040935.M3114@besplex.bde.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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 16:55:30 -0000 On Tue, Oct 28, 2014 at 04:28:37AM +1100, Bruce Evans wrote: > @diff -u2 dd.c~ dd.c > @--- dd.c~ Wed Apr 7 20:20:48 2004 > @+++ dd.c Wed Apr 7 20:20:49 2004 > @@@ -247,21 +245,18 @@ > @ io->flags |= ISTRUNC; > @ if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) { > @- if (ioctl(io->fd, FIODTYPE, &type) == -1) { > @+ if (ioctl(io->fd, FIODTYPE, &type) == -1) > @ err(1, "%s", io->name); > @- } else { > @+ else { > @ if (type & D_TAPE) > @ io->flags |= ISTAPE; > @ else if (type & (D_DISK | D_MEM)) > @- io->flags |= ISSEEK; > @- if (S_ISCHR(sb.st_mode) && (type & D_TAPE) == 0) > @+ io->flags |= ISSEEKABLE; > @+ if (S_ISCHR(sb.st_mode)) > @ io->flags |= ISCHR; > @ } > @- return; > @- } > @- errno = 0; > @- if (lseek(io->fd, (off_t)0, SEEK_CUR) == -1 && errno == ESPIPE) > @- io->flags |= ISPIPE; > @- else > @- io->flags |= ISSEEK; > @+ } else if (lseek(io->fd, (off_t)0, SEEK_CUR) == 0) > @+ io->flags |= ISSEEKABLE; > @+ else if (errno == ESPIPE) > @+ io->flags |= ISPIPE; /* XXX fixed in 4.4BSD */ > @ } > @ Ok, I tried to de-obfuscate and restore the patch above. diff --git a/bin/dd/dd.c b/bin/dd/dd.c index 8ae11a7..aadc7da 100644 --- a/bin/dd/dd.c +++ b/bin/dd/dd.c @@ -257,7 +257,7 @@ getfdtype(IO *io) err(1, "%s", io->name); if (S_ISREG(sb.st_mode)) io->flags |= ISTRUNC; - if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) { + if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) { if (ioctl(io->fd, FIODTYPE, &type) == -1) { err(1, "%s", io->name); } else { @@ -265,16 +265,14 @@ getfdtype(IO *io) io->flags |= ISTAPE; else if (type & (D_DISK | D_MEM)) io->flags |= ISSEEK; - if (S_ISCHR(sb.st_mode) && (type & D_TAPE) == 0) + if (S_ISCHR(sb.st_mode)) io->flags |= ISCHR; } - return; - } - errno = 0; - if (lseek(io->fd, (off_t)0, SEEK_CUR) == -1 && errno == ESPIPE) - io->flags |= ISPIPE; - else + } else if (lseek(io->fd, (off_t)0, SEEK_CUR) == 0) { io->flags |= ISSEEK; + } else if (errno == ESPIPE) { + io->flags |= ISPIPE; + } } static void From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 16:58:46 2014 Return-Path: Delivered-To: svn-src-all@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 464BAEE; Wed, 29 Oct 2014 16:58:46 +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 AC1946B2; Wed, 29 Oct 2014 16:58:45 +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 s9TGwfhK007556 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 29 Oct 2014 18:58:41 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s9TGwfhK007556 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s9TGwfXp007555; Wed, 29 Oct 2014 18:58:41 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 29 Oct 2014 18:58:40 +0200 From: Konstantin Belousov To: John Baldwin Subject: Re: svn commit: r273784 - in head/sys: amd64/ia32 compat/freebsd32 i386/i386 kern net Message-ID: <20141029165840.GG53947@kib.kiev.ua> References: <201410281528.s9SFSLs2013764@svn.freebsd.org> <20141029042007.N2423@besplex.bde.org> <20141029155230.GE53947@kib.kiev.ua> <201410291200.49330.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201410291200.49330.jhb@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, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 16:58:46 -0000 On Wed, Oct 29, 2014 at 12:00:49PM -0400, John Baldwin wrote: > On Wednesday, October 29, 2014 11:52:30 am Konstantin Belousov wrote: > > On Wed, Oct 29, 2014 at 06:26:42AM +1100, Bruce Evans wrote: > > > I just noticed some more API design errors. The pointer type for new > > > APIs should be [qualifed] wordsize_t *, not [qualified] void *. Using > > > void * reduces type safety for almost no benefits. The casuword() > > > family already doesn't use void *. > > casuword() has very limited use, it was invented for umtx, and used > > only there. That said, I tend to agree with somewhat implicit note > > that base argument for fuword() and family should be vm_offset_t. > > I think Bruce is suggesting 'volatile long *' or 'volatile int32_t *' > rather than vm_offset_t. In main text, yes. But there was a small note, and I better like the vm_offset_t thing than normal pointers to different address space. In fact, something like Linux' __user annotation + vm_offset_t, which would put it extremely explicit that the address cannot be used as pointer at all. But we do not have anything 'dimentional' which would allow to prevent mixing __user and normal pointers. Some day Intel may release CPUs with SMAP. From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 18:01:10 2014 Return-Path: Delivered-To: svn-src-all@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 987506E2; Wed, 29 Oct 2014 18:01: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 79A57DEE; Wed, 29 Oct 2014 18:01: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 s9TI1AKd068711; Wed, 29 Oct 2014 18:01:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9TI1Ap0068710; Wed, 29 Oct 2014 18:01:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201410291801.s9TI1Ap0068710@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 29 Oct 2014 18:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273834 - head/usr.sbin/etcupdate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 18:01:10 -0000 Author: jhb Date: Wed Oct 29 18:01:09 2014 New Revision: 273834 URL: https://svnweb.freebsd.org/changeset/base/273834 Log: Rework the EXAMPLES section to be a bit clearer. - Add an example of using etcupdate diff. - Create a subsection on bootstrapping that is below the simple examples. This should make it clearer that 'etcupdate extract' is a one-time operation and not part of the common workflow. It also adds more suggestions on when bootstrapping is needed and additional steps to make future merges simpler. Reviewed by: adrian MFC after: 3 days Modified: head/usr.sbin/etcupdate/etcupdate.8 Modified: head/usr.sbin/etcupdate/etcupdate.8 ============================================================================== --- head/usr.sbin/etcupdate/etcupdate.8 Wed Oct 29 17:04:09 2014 (r273833) +++ head/usr.sbin/etcupdate/etcupdate.8 Wed Oct 29 18:01:09 2014 (r273834) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 9, 2013 +.Dd October 29, 2014 .Dt ETCUPDATE 8 .Os .Sh NAME @@ -608,12 +608,11 @@ Default log file. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES -If the source tree matches the currently installed world, -then the following can be used to bootstrap -.Nm -so that it can be used for future upgrades: +To compare the files in +.Pa /etc +with the stock versions: .Pp -.Dl "etcupdate extract" +.Dl "etcupdate diff" .Pp To merge changes after an upgrade via the buildworld and installworld process: .Pp @@ -622,6 +621,59 @@ To merge changes after an upgrade via th To resolve any conflicts generated during a merge: .Pp .Dl "etcupdate resolve" +.Ss Bootstrapping +The +.Nm +utility may need to be bootstrapped before it can be used. +The +.Cm diff +command will fail with an error about a missing reference tree if +bootstrapping is needed. +.Pp +Bootstrapping +.Nm +requires a source tree that matches the currently installed world. +The easiest way to ensure this is to bootstrap +.Nm +before updating the source tree to start the next world upgrade cycle. +First, +generate a reference tree: +.Pp +.Dl "etcupdate extract" +.Pp +Second, +use the +.Cm diff +command to compare the reference tree to your current files in +.Pa /etc . +Undesired differences should be removed using an editor, +.Xr patch 1 , +or by copying files from the reference tree +.Po +located at +.Pa /var/db/etcupdate/current +by default +.Pc +. +.Pp +If the tree at +.Pa /usr/src +is already newer than the currently installed world, +a new tree matching the currently installed world can be checked out to +a temporary location. +The reference tree for +.Nm +can then be generated via: +.Pp +.Dl "etcupdate extract -s /path/to/tree" +.Pp +The +.Cm diff +command can be used as above to remove undesired differences. +Afterwards, +the changes in the tree at +.Pa /usr/src +can be merged via a regular merge. .Sh DIAGNOSTICS The following warning messages may be generated during a merge. Note that several of these warnings cover obscure cases that should occur From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 18:24:02 2014 Return-Path: Delivered-To: svn-src-all@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 0D7981B5; Wed, 29 Oct 2014 18:24:02 +0000 (UTC) Received: from mail-pa0-x22b.google.com (mail-pa0-x22b.google.com [IPv6:2607:f8b0:400e:c03::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA11C16D; Wed, 29 Oct 2014 18:24:01 +0000 (UTC) Received: by mail-pa0-f43.google.com with SMTP id eu11so3689594pac.30 for ; Wed, 29 Oct 2014 11:24:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=ermiyGwcu4PyhHO5Jz+dht5vB94uP744TRSDa71igKA=; b=nb87sFqd5Pz6SYYgZYlsFpIkm3RE6WjBehnHWeeIHUI5L8Uyi9s8ayzpZ0GYxpuD7z s7A0jeVWnA78oDJBmIz6pWlAgcP/u4LpcR6S5N7rFdrZsP8fXfecRWENsqG50m5KhJAF jBuZDZ5BO3BgLX32XALTWKCh6Q6tFx3RjQ5bfANOmeui+9agBTFyZt0Ou6mtoz9jnhu/ UP5/l7ITb51vCJZ/ij3nW6I8/O69t+BYLN53ykSRze7cpCnACXgLMx4WSvrqtSnsHpeh lpyJRGkh24N2jXGfE3lRdu7PZ88QflrJ161Qhn3deug6Ry56fxz1pNNZNQYUuZpBgPu5 iVIw== X-Received: by 10.68.195.68 with SMTP id ic4mr12282455pbc.44.1414607041334; Wed, 29 Oct 2014 11:24:01 -0700 (PDT) Received: from ox ([24.6.44.228]) by mx.google.com with ESMTPSA id no8sm4954100pdb.63.2014.10.29.11.23.59 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 29 Oct 2014 11:24:00 -0700 (PDT) Sender: Navdeep Parhar Date: Wed, 29 Oct 2014 11:23:54 -0700 From: Navdeep Parhar To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r273806 - in head/contrib/ofed: libcxgb4 libcxgb4/src usr.lib usr.lib/libcxgb4 Message-ID: <20141029182354.GA8965@ox> Mail-Followup-To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201410290115.s9T1FnTv094112@svn.freebsd.org> <20141029095604.GA81110@brick.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20141029095604.GA81110@brick.home> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 18:24:02 -0000 On Wed, Oct 29, 2014 at 10:56:04AM +0100, Edward Tomasz NapieraÅ‚a wrote: > On 1029T0115, Navdeep Parhar wrote: > > Author: np > > Date: Wed Oct 29 01:15:48 2014 > > New Revision: 273806 > > URL: https://svnweb.freebsd.org/changeset/base/273806 > > > > Log: > > Userspace library for Chelsio's Terminator 5 based iWARP RNICs (pretty > > much every T5 card that does _not_ have "-SO" in its name is RDMA > > capable). > > Yay! This means we could add iSER without using the ICL_PROXY hack. > Well, assuming it's possible to "hand off" RDMA connection from userspace > to the kernel. Is it? Yes, this should be doable. The connection is just another TCP endpoint tracked like all others in the kernel. By the way, iSER is an unnecessary layer if you're using a T5 NIC. It'll work, sure, but you'll run iSER/RDMA/TOE when you could simply run iSCSI/TOE with full zero copy everywhere. Comes out to the same result with a much simpler stack. I think iSER makes sense for gear that does RDMA but not iSCSI natively. Regards, Navdeep From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 19:21:20 2014 Return-Path: Delivered-To: svn-src-all@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 CD0B9E61; Wed, 29 Oct 2014 19:21: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 B9BA89AC; Wed, 29 Oct 2014 19:21: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 s9TJLKcN005879; Wed, 29 Oct 2014 19:21:20 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9TJLKpg005878; Wed, 29 Oct 2014 19:21:20 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201410291921.s9TJLKpg005878@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 29 Oct 2014 19:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273835 - head/usr.bin/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 19:21:20 -0000 Author: jkim Date: Wed Oct 29 19:21:19 2014 New Revision: 273835 URL: https://svnweb.freebsd.org/changeset/base/273835 Log: Replace a magic number with the proper definition. This change actually fixes broken state field after r273266, i.e., "CPU-1" was displayed in place of "RUN". Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Wed Oct 29 18:01:09 2014 (r273834) +++ head/usr.bin/top/machine.c Wed Oct 29 19:21:19 2014 (r273835) @@ -941,7 +941,7 @@ format_next_process(caddr_t handle, char /* generate "STATE" field */ switch (state = pp->ki_stat) { case SRUN: - if (smpmode && pp->ki_oncpu != 0xff) + if (smpmode && pp->ki_oncpu != NOCPU) sprintf(status, "CPU%d", pp->ki_oncpu); else strcpy(status, "RUN"); @@ -1100,7 +1100,7 @@ format_next_process(caddr_t handle, char /* format this entry */ if (smpmode) { - if (state == SRUN && pp->ki_oncpu != 0xff) + if (state == SRUN && pp->ki_oncpu != NOCPU) cpu = pp->ki_oncpu; else cpu = pp->ki_lastcpu; From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 19:31:45 2014 Return-Path: Delivered-To: svn-src-all@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 DF6D1108; Wed, 29 Oct 2014 19:31:45 +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 8C331A30; Wed, 29 Oct 2014 19:31:45 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id D7B37422056; Thu, 30 Oct 2014 06:11:10 +1100 (AEDT) Date: Thu, 30 Oct 2014 06:11:09 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov Subject: Re: svn commit: r273129 - head/sys/kern In-Reply-To: <20141029165523.GF53947@kib.kiev.ua> Message-ID: <20141030054402.G2929@besplex.bde.org> References: <201410151238.s9FCcRMe018200@svn.freebsd.org> <20141028040935.M3114@besplex.bde.org> <20141029165523.GF53947@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=fvDlOjIf c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=vxL5pm7eCyaE4jrGXQAA:9 a=fIJQodi46wkFxh06:21 a=yVTk0KWOF527Rs97:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 19:31:46 -0000 On Wed, 29 Oct 2014, Konstantin Belousov wrote: > On Tue, Oct 28, 2014 at 04:28:37AM +1100, Bruce Evans wrote: >> @diff -u2 dd.c~ dd.c >> @--- dd.c~ Wed Apr 7 20:20:48 2004 >> @+++ dd.c Wed Apr 7 20:20:49 2004 >> @@@ -247,21 +245,18 @@ >> @ io->flags |= ISTRUNC; >> @ if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) { >> @- if (ioctl(io->fd, FIODTYPE, &type) == -1) { >> @+ if (ioctl(io->fd, FIODTYPE, &type) == -1) >> @ err(1, "%s", io->name); >> @- } else { >> @+ else { >> @ if (type & D_TAPE) >> @ io->flags |= ISTAPE; >> @ else if (type & (D_DISK | D_MEM)) >> @- io->flags |= ISSEEK; >> @- if (S_ISCHR(sb.st_mode) && (type & D_TAPE) == 0) >> @+ io->flags |= ISSEEKABLE; >> @+ if (S_ISCHR(sb.st_mode)) >> @ io->flags |= ISCHR; >> @ } >> @- return; >> @- } >> @- errno = 0; >> @- if (lseek(io->fd, (off_t)0, SEEK_CUR) == -1 && errno == ESPIPE) >> @- io->flags |= ISPIPE; >> @- else >> @- io->flags |= ISSEEK; >> @+ } else if (lseek(io->fd, (off_t)0, SEEK_CUR) == 0) >> @+ io->flags |= ISSEEKABLE; >> @+ else if (errno == ESPIPE) >> @+ io->flags |= ISPIPE; /* XXX fixed in 4.4BSD */ >> @ } >> @ > > Ok, I tried to de-obfuscate and restore the patch above. The patch came out not very readable for some reason. > diff --git a/bin/dd/dd.c b/bin/dd/dd.c > index 8ae11a7..aadc7da 100644 > --- a/bin/dd/dd.c > +++ b/bin/dd/dd.c > @@ -257,7 +257,7 @@ getfdtype(IO *io) > err(1, "%s", io->name); > if (S_ISREG(sb.st_mode)) > io->flags |= ISTRUNC; > - if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) { > + if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) { > if (ioctl(io->fd, FIODTYPE, &type) == -1) { > err(1, "%s", io->name); > } else { > @@ -265,16 +265,14 @@ getfdtype(IO *io) > io->flags |= ISTAPE; > else if (type & (D_DISK | D_MEM)) > io->flags |= ISSEEK; > - if (S_ISCHR(sb.st_mode) && (type & D_TAPE) == 0) > + if (S_ISCHR(sb.st_mode)) > io->flags |= ISCHR; > } > - return; > - } > - errno = 0; > - if (lseek(io->fd, (off_t)0, SEEK_CUR) == -1 && errno == ESPIPE) > - io->flags |= ISPIPE; > - else > + } else if (lseek(io->fd, (off_t)0, SEEK_CUR) == 0) { > io->flags |= ISSEEK; > + } else if (errno == ESPIPE) { > + io->flags |= ISPIPE; > + } > } > > static void That came out not very readable too. I don't like it much. Now I don't see what I was doing with the lseek() changes, except to improve the spelling (SEEK -> SEEKABLE). The XXX comment was in 4.4BSD. I restored it, but now I think removing it was correct, and the other FreeBSD changes near the lseek() call are improvements too. Another try, starting with -current sources. It doesn't touch the lseek() code, but changes more before that, to return early and reduce indentation after that, and never fail: % diff -u2 dd.c~ dd.c % --- dd.c~ 2014-08-06 20:12:52.000000000 +0000 % +++ dd.c 2014-10-29 18:36:03.979133000 +0000 % @@ -255,18 +255,16 @@ % % if (fstat(io->fd, &sb) == -1) % - err(1, "%s", io->name); % + return; Unlikely error. Treat it is null type. % if (S_ISREG(sb.st_mode)) % io->flags |= ISTRUNC; % if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) { % + if (S_ISCHR(sb.st_mode)) % + io->flags |= ISCHR; Default for next return. Note that block devices aren't supported, so the ISBLK() check and the second ISCHR() check are redundant. I keep them for compatibility. % if (ioctl(io->fd, FIODTYPE, &type) == -1) { % - err(1, "%s", io->name); % - } else { % - if (type & D_TAPE) % - io->flags |= ISTAPE; % - else if (type & (D_DISK | D_MEM)) % - io->flags |= ISSEEK; % - if (S_ISCHR(sb.st_mode) && (type & D_TAPE) == 0) % - io->flags |= ISCHR; % - } % + return; Actually, ISBLK() is possible. Then since block devices aren't supported, the ioctl should fail, and we again return with a null type. % + if (type & D_TAPE) % + io->flags |= ISTAPE; % + else if (type & (D_DISK | D_MEM)) % + io->flags |= ISSEEK; Re-indent and simplify a little. The only change in the non-failure cases is to not use tangled logic to avoid setting ISCHR for tape devices. So tape devices are ISCHR | ISTAPE now, and still not ISSEEK. ISTAPE is only used in a couple of places, and it is easy to see that having ISCHR also set doesn't affect the behaviour of ISTAPE. % return; % } After here there is a seek test. We get here for irregular regular files in procfs. Hopefully the seek test will fail for them. The seek test isn't very good, but it is better than unconditionally setting ISSEEK for regular files. We could also try falling through to here to do the seek test for cdevs, but it is know to give wrong results like succeeding on keyboards so it is best to only set ISSEEK for devices that are known to be seekable. I now see a small improvement in the seek test. Just remove its errno stuff, and trust the syscall to return -1 on error. This depends on -1 being an impossible seek offset. POSIX requires this, but we make it possible so that /dev/mem can be seeked to address 0xFFFFFFFFFFFFFFFF on 64-bit arches. We do this for any cdev but no other file types. Since we returned earlier for cdevs, this case can't happen here. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 20:08:12 2014 Return-Path: Delivered-To: svn-src-all@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 31428178; Wed, 29 Oct 2014 20:08:12 +0000 (UTC) Received: from f10.opsec.eu (f10.opsec.eu [IPv6:2001:14f8:200:4::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 E38BFE4B; Wed, 29 Oct 2014 20:08:11 +0000 (UTC) Received: from pi by f10.opsec.eu with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1XjZXJ-000NiZ-0l; Wed, 29 Oct 2014 21:08:05 +0100 Date: Wed, 29 Oct 2014 21:08:05 +0100 From: Kurt Jaeger To: Kurt Jaeger Subject: Re: svn commit: r273734 - head/bin/dd Message-ID: <20141029200805.GD42752@f10.opsec.eu> References: <201410271138.s9RBcHrA002447@svn.freebsd.org> <20141027153957.GZ1877@kib.kiev.ua> <20141027155427.GM1492@f10.opsec.eu> <86vbn4egjt.fsf@nine.des.no> <86r3xseepw.fsf@nine.des.no> <20141028141426.GA42752@f10.opsec.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141028141426.GA42752@f10.opsec.eu> Cc: Konstantin Belousov , Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 20:08:12 -0000 Hi! https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191263 > Right now the submitter tests on 32bit and if time permits, I'll > experiment on ARM as well. The submitter has provided a new patch, he tested it and, I tested it on - 10.0p10 amd64 - 10.1-RC3-i386 - 10.1-RC3-armv6 (raspberry-pi) All looks fine (I hope). Would some kind soul from the much more experienced src-committers please take up the PR, do some more testing and commit it ? Thanks very much! -- pi@FreeBSD.org +49 171 3101372 6 years to go ! From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 20:13:14 2014 Return-Path: Delivered-To: svn-src-all@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 574D84B6; Wed, 29 Oct 2014 20:13:14 +0000 (UTC) Received: from mail-ig0-x235.google.com (mail-ig0-x235.google.com [IPv6:2607:f8b0:4001:c05::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B43DF16; Wed, 29 Oct 2014 20:13:14 +0000 (UTC) Received: by mail-ig0-f181.google.com with SMTP id l13so4167397iga.14 for ; Wed, 29 Oct 2014 13:13:13 -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=XX2/oRpuoealHADJfoz6NzpmSYjBjfe7uw42W4yfjfA=; b=xSeYzssyeoqFQeVfS1GBse3Qr27lgUPkH4PALezY/jMz0hSe6Ctj2bEwnM2YO5ryny dmZQeu3ukRqsDamlbwn3PX6V1/fvRf58ZF/gbi3oFAB9Akb7I26uRXkLUDN7HZvZxoQv Zie9xyHiNExj6YB343il1YScd3aPXuD5ROPjbfTw+46EiTDMM1+DWhiloO9hfOWoM9+V mFLtQTDBI60b/bp4lKEOvvTfVbbLdz+Aenqr0r0i/UPsZW0xD2ES5g0614Z0Up9DNvPF w6Kf7wBRMAx4Xfy/WmzZypl34Qx1y0/7WK5xBpJOBtzN879+hkx5lh2+ahxfsZQUL4PE rWoQ== MIME-Version: 1.0 X-Received: by 10.107.12.222 with SMTP id 91mr5571673iom.71.1414613593536; Wed, 29 Oct 2014 13:13:13 -0700 (PDT) Received: by 10.50.193.135 with HTTP; Wed, 29 Oct 2014 13:13:13 -0700 (PDT) In-Reply-To: <20141029200805.GD42752@f10.opsec.eu> References: <201410271138.s9RBcHrA002447@svn.freebsd.org> <20141027153957.GZ1877@kib.kiev.ua> <20141027155427.GM1492@f10.opsec.eu> <86vbn4egjt.fsf@nine.des.no> <86r3xseepw.fsf@nine.des.no> <20141028141426.GA42752@f10.opsec.eu> <20141029200805.GD42752@f10.opsec.eu> Date: Wed, 29 Oct 2014 13:13:13 -0700 Message-ID: Subject: Re: svn commit: r273734 - head/bin/dd From: NGie Cooper To: Kurt Jaeger Content-Type: text/plain; charset=UTF-8 Cc: Konstantin Belousov , =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 20:13:14 -0000 On Wed, Oct 29, 2014 at 1:08 PM, Kurt Jaeger wrote: > Hi! > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191263 > >> Right now the submitter tests on 32bit and if time permits, I'll >> experiment on ARM as well. > > The submitter has provided a new patch, he tested it and, I tested it on > - 10.0p10 amd64 > - 10.1-RC3-i386 > - 10.1-RC3-armv6 (raspberry-pi) > > All looks fine (I hope). > > Would some kind soul from the much more experienced src-committers > please take up the PR, do some more testing and commit it ? > > Thanks very much! I'll work on integrating in bin/dd/tests from NetBSD too soon with some of the changes that I have from my github branch (they pass on amd64/i386 at least). The NetBSD tests deal with some of the edgecases with overflow output, etc. Cheers, From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 20:18:38 2014 Return-Path: Delivered-To: svn-src-all@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 84E9E9B5; Wed, 29 Oct 2014 20:18: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 71AB9F6A; Wed, 29 Oct 2014 20:18: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 s9TKIcRs034079; Wed, 29 Oct 2014 20:18:38 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9TKIcg1034078; Wed, 29 Oct 2014 20:18:38 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201410292018.s9TKIcg1034078@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 29 Oct 2014 20:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273837 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 20:18:38 -0000 Author: dim Date: Wed Oct 29 20:18:37 2014 New Revision: 273837 URL: https://svnweb.freebsd.org/changeset/base/273837 Log: Fix a clang 3.5 warning about abs(3) being given an argument of type quad_t in setusercontext(). While here, sanitize the clamping of the priority value, and use the correct type for the return value of login_getcapnum(). Reviewed by: kib MFC after: 3 days Modified: head/lib/libutil/login_class.c Modified: head/lib/libutil/login_class.c ============================================================================== --- head/lib/libutil/login_class.c Wed Oct 29 19:44:34 2014 (r273836) +++ head/lib/libutil/login_class.c Wed Oct 29 20:18:37 2014 (r273837) @@ -424,7 +424,7 @@ setlogincontext(login_cap_t *lc, const s int setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned int flags) { - quad_t p; + rlim_t p; mode_t mymask; login_cap_t *llc = NULL; struct sigaction sa, prevsa; @@ -449,16 +449,16 @@ setusercontext(login_cap_t *lc, const st if (p > PRIO_MAX) { rtp.type = RTP_PRIO_IDLE; - rtp.prio = p - PRIO_MAX - 1; - p = (rtp.prio > RTP_PRIO_MAX) ? 31 : p; + p -= PRIO_MAX + 1; + rtp.prio = p > RTP_PRIO_MAX ? RTP_PRIO_MAX : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", pwd ? pwd->pw_name : "-", lc ? lc->lc_class : LOGIN_DEFCLASS); } else if (p < PRIO_MIN) { rtp.type = RTP_PRIO_REALTIME; - rtp.prio = abs(p - PRIO_MIN + RTP_PRIO_MAX); - p = (rtp.prio > RTP_PRIO_MAX) ? 1 : p; + p -= PRIO_MIN - RTP_PRIO_MAX; + rtp.prio = p < RTP_PRIO_MIN ? RTP_PRIO_MIN : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", pwd ? pwd->pw_name : "-", From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 22:17:47 2014 Return-Path: Delivered-To: svn-src-all@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 A5CA470B; Wed, 29 Oct 2014 22:17: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 86840F27; Wed, 29 Oct 2014 22:17: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 s9TMHlsg094231; Wed, 29 Oct 2014 22:17:47 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9TMHkDv094225; Wed, 29 Oct 2014 22:17:46 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201410292217.s9TMHkDv094225@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 29 Oct 2014 22:17:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273838 - in stable/10: share/man/man4 sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 22:17:47 -0000 Author: sbruno Date: Wed Oct 29 22:17:45 2014 New Revision: 273838 URL: https://svnweb.freebsd.org/changeset/base/273838 Log: MFC r272720, 273061, 273062, 273063, 273064 Implement PLPMTUD blackhole detection (RFC 4821), inspired by code from xnu sources. If we encounter a network where ICMP is blocked the Needs Frag indicator may not propagate back to us. Attempt to downshift the mss once to a preconfigured value. Note, this is turned off by default. Modified: stable/10/share/man/man4/tcp.4 stable/10/sys/netinet/tcp_output.c stable/10/sys/netinet/tcp_timer.c stable/10/sys/netinet/tcp_var.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/tcp.4 ============================================================================== --- stable/10/share/man/man4/tcp.4 Wed Oct 29 20:18:37 2014 (r273837) +++ stable/10/share/man/man4/tcp.4 Wed Oct 29 22:17:45 2014 (r273838) @@ -38,7 +38,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd November 8, 2013 +.Dd October 13, 2014 .Dt TCP 4 .Os .Sh NAME @@ -522,6 +522,21 @@ avoid packet drops. Number of retries (SYN or SYN/ACK retransmits) before disabling ECN on a specific connection. This is needed to help with connection establishment when a broken firewall is in the network path. +.It Va pmtud_blackhole_detection +Turn on automatic path MTU blackhole detection. In case of retransmits we will +lower the MSS to check if it's MTU problem. If current MSS is greater than +configured value to try, it will be set to it, otherwise, MSS will be set to +default values (net.inet.tcp.mssdflt and net.inet.tcp.v6mssdflt). +.It Va pmtud_blackhole_mss +MSS to try for IPv4 if PMTU blackhole detection is turned on. +.It Va v6pmtud_blackhole_mss +MSS to try for IPv6 if PMTU blackhole detection is turned on. +.It Va pmtud_blackhole_activated +Number of times the code was activated to attempt a MSS downshift. +.It Va pmtud_blackhole_min_activated +Number of times the blackhole MSS was used in an attempt to downshift. +.It Va pmtud_blackhole_failed +Number of times that we failed to connect after we downshifted the MSS. .El .Sh ERRORS A socket operation may fail with one of the following errors returned: Modified: stable/10/sys/netinet/tcp_output.c ============================================================================== --- stable/10/sys/netinet/tcp_output.c Wed Oct 29 20:18:37 2014 (r273837) +++ stable/10/sys/netinet/tcp_output.c Wed Oct 29 22:17:45 2014 (r273838) @@ -676,6 +676,12 @@ just_return: send: SOCKBUF_LOCK_ASSERT(&so->so_snd); + if (len > 0) { + if (len >= tp->t_maxseg) + tp->t_flags2 |= TF2_PLPMTU_MAXSEGSNT; + else + tp->t_flags2 &= ~TF2_PLPMTU_MAXSEGSNT; + } /* * Before ESTABLISHED, force sending of initial options * unless TCP set not to do any options. @@ -1184,6 +1190,11 @@ send: */ ip6->ip6_plen = htons(m->m_pkthdr.len - sizeof(*ip6)); + if (V_path_mtu_discovery && tp->t_maxopd > V_tcp_minmss) + tp->t_flags2 |= TF2_PLPMTU_PMTUD; + else + tp->t_flags2 &= ~TF2_PLPMTU_PMTUD; + if (tp->t_state == TCPS_SYN_SENT) TCP_PROBE5(connect__request, NULL, tp, ip6, tp, th); @@ -1220,8 +1231,12 @@ send: * * NB: Don't set DF on small MTU/MSS to have a safe fallback. */ - if (V_path_mtu_discovery && tp->t_maxopd > V_tcp_minmss) + if (V_path_mtu_discovery && tp->t_maxopd > V_tcp_minmss) { ip->ip_off |= htons(IP_DF); + tp->t_flags2 |= TF2_PLPMTU_PMTUD; + } else { + tp->t_flags2 &= ~TF2_PLPMTU_PMTUD; + } if (tp->t_state == TCPS_SYN_SENT) TCP_PROBE5(connect__request, NULL, tp, ip, tp, th); Modified: stable/10/sys/netinet/tcp_timer.c ============================================================================== --- stable/10/sys/netinet/tcp_timer.c Wed Oct 29 20:18:37 2014 (r273837) +++ stable/10/sys/netinet/tcp_timer.c Wed Oct 29 22:17:45 2014 (r273838) @@ -63,6 +63,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef INET6 +#include +#endif #include #ifdef TCPDEBUG #include @@ -124,6 +127,54 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, rexm &tcp_rexmit_drop_options, 0, "Drop TCP options from 3rd and later retransmitted SYN"); +static VNET_DEFINE(int, tcp_pmtud_blackhole_detect); +#define V_tcp_pmtud_blackhole_detect VNET(tcp_pmtud_blackhole_detect) +SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_detection, + CTLFLAG_RW, + &VNET_NAME(tcp_pmtud_blackhole_detect), 0, + "Path MTU Discovery Black Hole Detection Enabled"); + +static VNET_DEFINE(int, tcp_pmtud_blackhole_activated); +#define V_tcp_pmtud_blackhole_activated \ + VNET(tcp_pmtud_blackhole_activated) +SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_activated, + CTLFLAG_RD, + &VNET_NAME(tcp_pmtud_blackhole_activated), 0, + "Path MTU Discovery Black Hole Detection, Activation Count"); + +static VNET_DEFINE(int, tcp_pmtud_blackhole_activated_min_mss); +#define V_tcp_pmtud_blackhole_activated_min_mss \ + VNET(tcp_pmtud_blackhole_activated_min_mss) +SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_activated_min_mss, + CTLFLAG_RD, + &VNET_NAME(tcp_pmtud_blackhole_activated_min_mss), 0, + "Path MTU Discovery Black Hole Detection, Activation Count at min MSS"); + +static VNET_DEFINE(int, tcp_pmtud_blackhole_failed); +#define V_tcp_pmtud_blackhole_failed VNET(tcp_pmtud_blackhole_failed) +SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_failed, + CTLFLAG_RD, + &VNET_NAME(tcp_pmtud_blackhole_failed), 0, + "Path MTU Discovery Black Hole Detection, Failure Count"); + +#ifdef INET +static VNET_DEFINE(int, tcp_pmtud_blackhole_mss) = 1200; +#define V_tcp_pmtud_blackhole_mss VNET(tcp_pmtud_blackhole_mss) +SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_mss, + CTLFLAG_RW, + &VNET_NAME(tcp_pmtud_blackhole_mss), 0, + "Path MTU Discovery Black Hole Detection lowered MSS"); +#endif + +#ifdef INET6 +static VNET_DEFINE(int, tcp_v6pmtud_blackhole_mss) = 1220; +#define V_tcp_v6pmtud_blackhole_mss VNET(tcp_v6pmtud_blackhole_mss) +SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, v6pmtud_blackhole_mss, + CTLFLAG_RW, + &VNET_NAME(tcp_v6pmtud_blackhole_mss), 0, + "Path MTU Discovery IPv6 Black Hole Detection lowered MSS"); +#endif + static int per_cpu_timers = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, per_cpu_timers, CTLFLAG_RW, &per_cpu_timers , 0, "run tcp timers on all cpus"); @@ -492,6 +543,7 @@ tcp_timer_rexmt(void * xtp) ostate = tp->t_state; #endif + INP_INFO_RLOCK(&V_tcbinfo); inp = tp->t_inpcb; /* @@ -593,6 +645,110 @@ tcp_timer_rexmt(void * xtp) rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift]; TCPT_RANGESET(tp->t_rxtcur, rexmt, tp->t_rttmin, TCPTV_REXMTMAX); + + /* + * We enter the path for PLMTUD if connection is established or, if + * connection is FIN_WAIT_1 status, reason for the last is that if + * amount of data we send is very small, we could send it in couple of + * packets and process straight to FIN. In that case we won't catch + * ESTABLISHED state. + */ + if (V_tcp_pmtud_blackhole_detect && (((tp->t_state == TCPS_ESTABLISHED)) + || (tp->t_state == TCPS_FIN_WAIT_1))) { + int optlen; +#ifdef INET6 + int isipv6; +#endif + + if (((tp->t_flags2 & (TF2_PLPMTU_PMTUD|TF2_PLPMTU_MAXSEGSNT)) == + (TF2_PLPMTU_PMTUD|TF2_PLPMTU_MAXSEGSNT)) && + (tp->t_rxtshift <= 2)) { + /* + * Enter Path MTU Black-hole Detection mechanism: + * - Disable Path MTU Discovery (IP "DF" bit). + * - Reduce MTU to lower value than what we + * negotiated with peer. + */ + /* Record that we may have found a black hole. */ + tp->t_flags2 |= TF2_PLPMTU_BLACKHOLE; + + /* Keep track of previous MSS. */ + optlen = tp->t_maxopd - tp->t_maxseg; + tp->t_pmtud_saved_maxopd = tp->t_maxopd; + + /* + * Reduce the MSS to blackhole value or to the default + * in an attempt to retransmit. + */ +#ifdef INET6 + isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) ? 1 : 0; + if (isipv6 && + tp->t_maxopd > V_tcp_v6pmtud_blackhole_mss) { + /* Use the sysctl tuneable blackhole MSS. */ + tp->t_maxopd = V_tcp_v6pmtud_blackhole_mss; + V_tcp_pmtud_blackhole_activated++; + } else if (isipv6) { + /* Use the default MSS. */ + tp->t_maxopd = V_tcp_v6mssdflt; + /* + * Disable Path MTU Discovery when we switch to + * minmss. + */ + tp->t_flags2 &= ~TF2_PLPMTU_PMTUD; + V_tcp_pmtud_blackhole_activated_min_mss++; + } +#endif +#if defined(INET6) && defined(INET) + else +#endif +#ifdef INET + if (tp->t_maxopd > V_tcp_pmtud_blackhole_mss) { + /* Use the sysctl tuneable blackhole MSS. */ + tp->t_maxopd = V_tcp_pmtud_blackhole_mss; + V_tcp_pmtud_blackhole_activated++; + } else { + /* Use the default MSS. */ + tp->t_maxopd = V_tcp_mssdflt; + /* + * Disable Path MTU Discovery when we switch to + * minmss. + */ + tp->t_flags2 &= ~TF2_PLPMTU_PMTUD; + V_tcp_pmtud_blackhole_activated_min_mss++; + } +#endif + tp->t_maxseg = tp->t_maxopd - optlen; + /* + * Reset the slow-start flight size + * as it may depend on the new MSS. + */ + if (CC_ALGO(tp)->conn_init != NULL) + CC_ALGO(tp)->conn_init(tp->ccv); + } else { + /* + * If further retransmissions are still unsuccessful + * with a lowered MTU, maybe this isn't a blackhole and + * we restore the previous MSS and blackhole detection + * flags. + */ + if ((tp->t_flags2 & TF2_PLPMTU_BLACKHOLE) && + (tp->t_rxtshift > 4)) { + tp->t_flags2 |= TF2_PLPMTU_PMTUD; + tp->t_flags2 &= ~TF2_PLPMTU_BLACKHOLE; + optlen = tp->t_maxopd - tp->t_maxseg; + tp->t_maxopd = tp->t_pmtud_saved_maxopd; + tp->t_maxseg = tp->t_maxopd - optlen; + V_tcp_pmtud_blackhole_failed++; + /* + * Reset the slow-start flight size as it + * may depend on the new MSS. + */ + if (CC_ALGO(tp)->conn_init != NULL) + CC_ALGO(tp)->conn_init(tp->ccv); + } + } + } + /* * Disable RFC1323 and SACK if we haven't got any response to * our third SYN to work-around some broken terminal servers Modified: stable/10/sys/netinet/tcp_var.h ============================================================================== --- stable/10/sys/netinet/tcp_var.h Wed Oct 29 20:18:37 2014 (r273837) +++ stable/10/sys/netinet/tcp_var.h Wed Oct 29 22:17:45 2014 (r273838) @@ -209,8 +209,10 @@ struct tcpcb { u_int t_keepcnt; /* number of keepalives before close */ u_int t_tsomax; /* tso burst length limit */ + u_int t_pmtud_saved_maxopd; /* pre-blackhole MSS */ + u_int t_flags2; /* More tcpcb flags storage */ - uint32_t t_ispare[8]; /* 5 UTO, 3 TBD */ + uint32_t t_ispare[6]; /* 5 UTO, 1 TBD */ void *t_pspare2[4]; /* 1 TCP_SIGNATURE, 3 TBD */ uint64_t _pad[6]; /* 6 TBD (1-2 CC/RTT?) */ }; @@ -284,6 +286,13 @@ struct tcpcb { #endif /* TCP_SIGNATURE */ /* + * Flags for PLPMTU handling, t_flags2 + */ +#define TF2_PLPMTU_BLACKHOLE 0x00000001 /* Possible PLPMTUD Black Hole. */ +#define TF2_PLPMTU_PMTUD 0x00000002 /* Allowed to attempt PLPMTUD. */ +#define TF2_PLPMTU_MAXSEGSNT 0x00000004 /* Last seg sent was full seg. */ + +/* * Structure to hold TCP options that are only used during segment * processing (in tcp_input), but not held in the tcpcb. * It's basically used to reduce the number of parameters From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 22:22:24 2014 Return-Path: Delivered-To: svn-src-all@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 E5373AB1; Wed, 29 Oct 2014 22:22:24 +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 D1C276D; Wed, 29 Oct 2014 22:22: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 s9TMMOEr098830; Wed, 29 Oct 2014 22:22:24 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9TMMOHk098829; Wed, 29 Oct 2014 22:22:24 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410292222.s9TMMOHk098829@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 29 Oct 2014 22:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273839 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 22:22:25 -0000 Author: delphij Date: Wed Oct 29 22:22:24 2014 New Revision: 273839 URL: https://svnweb.freebsd.org/changeset/base/273839 Log: .a's are installed in /usr/lib, don't delete them. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Oct 29 22:17:45 2014 (r273838) +++ head/ObsoleteFiles.inc Wed Oct 29 22:22:24 2014 (r273839) @@ -51,7 +51,6 @@ OLD_FILES+=usr/share/man/man9/sleepq_cat # 20140917: hv_kvpd rc.d script removed in favor of devd configuration OLD_FILES+=etc/rc.d/hv_kvpd # 20140917: libnv was accidentally being installed to /usr/lib instead of /lib -OLD_LIBS+=usr/lib/libnv.a OLD_LIBS+=usr/lib/libnv.so.0 # 20140829: rc.d/kerberos removed OLD_FILES+=etc/rc.d/kerberos From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 22:55:17 2014 Return-Path: Delivered-To: svn-src-all@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 7E01F894; Wed, 29 Oct 2014 22:55: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 5F79162F; Wed, 29 Oct 2014 22:55: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 s9TMtH12013557; Wed, 29 Oct 2014 22:55:17 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9TMtHqF013556; Wed, 29 Oct 2014 22:55:17 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201410292255.s9TMtHqF013556@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Wed, 29 Oct 2014 22:55:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273840 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 22:55:17 -0000 Author: jilles Date: Wed Oct 29 22:55:16 2014 New Revision: 273840 URL: https://svnweb.freebsd.org/changeset/base/273840 Log: MFC r264628: fcntl.h: Make visible various POSIX.1-2008 features. Also, remove #if __BSD_VISIBLE where it is redundant. When __BSD_VISIBLE is defined to 1, __POSIX_VISIBLE, __XSI_VISIBLE and __ISO_C_VISIBLE are also defined to the newest supported version. PR: 188173 Modified: stable/10/sys/sys/fcntl.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/fcntl.h ============================================================================== --- stable/10/sys/sys/fcntl.h Wed Oct 29 22:22:24 2014 (r273839) +++ stable/10/sys/sys/fcntl.h Wed Oct 29 22:55:16 2014 (r273840) @@ -96,7 +96,7 @@ typedef __pid_t pid_t; #define O_FSYNC 0x0080 /* synchronous writes */ #endif #define O_SYNC 0x0080 /* POSIX synonym for O_FSYNC */ -#if __BSD_VISIBLE +#if __POSIX_VISIBLE >= 200809 #define O_NOFOLLOW 0x0100 /* don't follow symlinks */ #endif #define O_CREAT 0x0200 /* create if nonexistent */ @@ -114,8 +114,7 @@ typedef __pid_t pid_t; #define O_DIRECT 0x00010000 #endif -/* Defined by POSIX Extended API Set Part 2 */ -#if __BSD_VISIBLE +#if __POSIX_VISIBLE >= 200809 #define O_DIRECTORY 0x00020000 /* Fail if not directory */ #define O_EXEC 0x00040000 /* Open for execute only */ #endif @@ -183,8 +182,7 @@ typedef __pid_t pid_t; #define FRDAHEAD O_CREAT #endif -/* Defined by POSIX Extended API Set Part 2 */ -#if __BSD_VISIBLE +#if __POSIX_VISIBLE >= 200809 /* * Magic value that specify the use of the current working directory * to determine the target of relative file paths in the openat() and @@ -211,7 +209,7 @@ typedef __pid_t pid_t; #define F_SETFD 2 /* set file descriptor flags */ #define F_GETFL 3 /* get file status flags */ #define F_SETFL 4 /* set file status flags */ -#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 +#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 #define F_GETOWN 5 /* get SIGIO/SIGURG proc/pgrp */ #define F_SETOWN 6 /* set SIGIO/SIGURG proc/pgrp */ #endif @@ -229,7 +227,7 @@ typedef __pid_t pid_t; #define F_READAHEAD 15 /* read ahead */ #define F_RDAHEAD 16 /* Darwin compatible read ahead */ #endif -#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 +#if __POSIX_VISIBLE >= 200809 #define F_DUPFD_CLOEXEC 17 /* Like F_DUPFD, but FD_CLOEXEC is set */ #endif #if __BSD_VISIBLE @@ -310,10 +308,10 @@ int fcntl(int, int, ...); #if __BSD_VISIBLE int flock(int, int); #endif -#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 +#if __POSIX_VISIBLE >= 200809 int openat(int, const char *, int, ...); #endif -#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 +#if __POSIX_VISIBLE >= 200112 int posix_fadvise(int, off_t, off_t, int); int posix_fallocate(int, off_t, off_t); #endif From owner-svn-src-all@FreeBSD.ORG Wed Oct 29 23:10:49 2014 Return-Path: Delivered-To: svn-src-all@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 B02B61F5; Wed, 29 Oct 2014 23:10: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 9C21D804; Wed, 29 Oct 2014 23:10: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 s9TNAn8v021092; Wed, 29 Oct 2014 23:10:49 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9TNAnlo021091; Wed, 29 Oct 2014 23:10:49 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201410292310.s9TNAnlo021091@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Wed, 29 Oct 2014 23:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273841 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 23:10:49 -0000 Author: jilles Date: Wed Oct 29 23:10:48 2014 New Revision: 273841 URL: https://svnweb.freebsd.org/changeset/base/273841 Log: MFC r266842: netinet/in.h: Expose htonl(), htons(), ntohl() and ntohs() in strict POSIX mode. Put the htonl(), htons(), ntohl() and ntohs() declarations under __POSIX_VISIBLE >= 200112. POSIX.1-2001 and newer require these to be exposed from (as well as ). Note that it may be unnecessary to check __POSIX_VISIBLE >= 200112 because older versions of POSIX and the C standard do not define this header. However, other places in the same file already perform the check. PR: 188316 Submitted by: Christian Neukirchen Modified: stable/10/sys/netinet/in.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/in.h ============================================================================== --- stable/10/sys/netinet/in.h Wed Oct 29 22:55:16 2014 (r273840) +++ stable/10/sys/netinet/in.h Wed Oct 29 23:10:48 2014 (r273841) @@ -100,7 +100,7 @@ struct sockaddr_in { char sin_zero[8]; }; -#if !defined(_KERNEL) && __BSD_VISIBLE +#if !defined(_KERNEL) && __POSIX_VISIBLE >= 200112 #ifndef _BYTEORDER_PROTOTYPED #define _BYTEORDER_PROTOTYPED @@ -120,7 +120,7 @@ __END_DECLS #define ntohs(x) __ntohs(x) #endif -#endif /* !_KERNEL && __BSD_VISIBLE */ +#endif /* !_KERNEL && __POSIX_VISIBLE >= 200112 */ #if __POSIX_VISIBLE >= 200112 #define IPPROTO_IPV6 41 /* IP6 header */ From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 05:10:34 2014 Return-Path: Delivered-To: svn-src-all@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 2DEA1E5D; Thu, 30 Oct 2014 05:10: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 19F02ED0; Thu, 30 Oct 2014 05:10: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 s9U5AXiv088399; Thu, 30 Oct 2014 05:10:33 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9U5AXkX088397; Thu, 30 Oct 2014 05:10:33 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410300510.s9U5AXkX088397@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Oct 2014 05:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273842 - in head/sys: 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 05:10:34 -0000 Author: mjg Date: Thu Oct 30 05:10:33 2014 New Revision: 273842 URL: https://svnweb.freebsd.org/changeset/base/273842 Log: filedesc: get rid of atomic_load_acq_int from fget_unlocked A read barrier was necessary because fd table pointer and table size were updated separately, opening a window where fget_unlocked could read new size and old pointer. This patch puts both these fields into one dedicated structure, pointer to which is later atomically updated. As such, fget_unlocked only needs data a dependency barrier which is a noop on all supported architectures. Reviewed by: kib (previous version) MFC after: 2 weeks Modified: head/sys/kern/kern_descrip.c head/sys/sys/filedesc.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Oct 29 23:10:48 2014 (r273841) +++ head/sys/kern/kern_descrip.c Thu Oct 30 05:10:33 2014 (r273842) @@ -150,7 +150,7 @@ static int getmaxfd(struct proc *p); * the process exits. */ struct freetable { - struct filedescent *ft_table; + struct fdescenttbl *ft_table; SLIST_ENTRY(freetable) ft_next; }; @@ -158,10 +158,16 @@ struct freetable { * Initial allocation: a filedesc structure + the head of SLIST used to * keep track of old ofiles + enough space for NDFILE descriptors. */ + +struct fdescenttbl0 { + int fdt_nfiles; + struct filedescent fdt_ofiles[NDFILE]; +}; + struct filedesc0 { struct filedesc fd_fd; SLIST_HEAD(, freetable) fd_free; - struct filedescent fd_dfiles[NDFILE]; + struct fdescenttbl0 fd_dfiles; NDSLOTTYPE fd_dmap[NDSLOTS(NDFILE)]; }; @@ -1516,8 +1522,8 @@ fdgrowtable(struct filedesc *fdp, int nf { struct filedesc0 *fdp0; struct freetable *ft; - struct filedescent *ntable; - struct filedescent *otable; + struct fdescenttbl *ntable; + struct fdescenttbl *otable; int nnfiles, onfiles; NDSLOTTYPE *nmap, *omap; @@ -1527,7 +1533,7 @@ fdgrowtable(struct filedesc *fdp, int nf /* save old values */ onfiles = fdp->fd_nfiles; - otable = fdp->fd_ofiles; + otable = fdp->fd_files; omap = fdp->fd_map; /* compute the size of the new table */ @@ -1537,17 +1543,20 @@ fdgrowtable(struct filedesc *fdp, int nf return; /* - * Allocate a new table. We need enough space for the - * file entries themselves and the struct freetable we will use + * Allocate a new table. We need enough space for the number of + * entries, file entries themselves and the struct freetable we will use * when we decommission the table and place it on the freelist. * We place the struct freetable in the middle so we don't have * to worry about padding. */ - ntable = malloc(nnfiles * sizeof(ntable[0]) + sizeof(struct freetable), + ntable = malloc(offsetof(struct fdescenttbl, fdt_ofiles) + + nnfiles * sizeof(ntable->fdt_ofiles[0]) + + sizeof(struct freetable), M_FILEDESC, M_ZERO | M_WAITOK); - /* copy the old data over and point at the new tables */ - memcpy(ntable, otable, onfiles * sizeof(*otable)); - fdp->fd_ofiles = ntable; + /* copy the old data */ + ntable->fdt_nfiles = nnfiles; + memcpy(ntable->fdt_ofiles, otable->fdt_ofiles, + onfiles * sizeof(ntable->fdt_ofiles[0])); /* * Allocate a new map only if the old is not large enough. It will @@ -1563,13 +1572,11 @@ fdgrowtable(struct filedesc *fdp, int nf } /* - * In order to have a valid pattern for fget_unlocked() - * fdp->fd_nfiles must be the last member to be updated, otherwise - * fget_unlocked() consumers may reference a new, higher value for - * fdp->fd_nfiles before to access the fdp->fd_ofiles array, - * resulting in OOB accesses. + * Make sure that ntable is correctly initialized before we replace + * fd_files poiner. Otherwise fget_unlocked() may see inconsistent + * data. */ - atomic_store_rel_int(&fdp->fd_nfiles, nnfiles); + atomic_store_rel_ptr((volatile void *)&fdp->fd_files, (uintptr_t)ntable); /* * Do not free the old file table, as some threads may still @@ -1581,7 +1588,7 @@ fdgrowtable(struct filedesc *fdp, int nf * which must not be freed. */ if (onfiles > NDFILE) { - ft = (struct freetable *)&otable[onfiles]; + ft = (struct freetable *)&otable->fdt_ofiles[onfiles]; fdp0 = (struct filedesc0 *)fdp; ft->ft_table = otable; SLIST_INSERT_HEAD(&fdp0->fd_free, ft, ft_next); @@ -1813,8 +1820,8 @@ fdinit(struct filedesc *fdp) newfdp->fd_fd.fd_refcnt = 1; newfdp->fd_fd.fd_holdcnt = 1; newfdp->fd_fd.fd_cmask = CMASK; - newfdp->fd_fd.fd_ofiles = newfdp->fd_dfiles; - newfdp->fd_fd.fd_nfiles = NDFILE; + newfdp->fd_dfiles.fdt_nfiles = NDFILE; + newfdp->fd_fd.fd_files = (struct fdescenttbl *)&newfdp->fd_dfiles; newfdp->fd_fd.fd_map = newfdp->fd_dmap; newfdp->fd_fd.fd_lastfile = -1; return (&newfdp->fd_fd); @@ -2054,10 +2061,10 @@ fdescfree(struct thread *td) } } - if (fdp->fd_nfiles > NDFILE) - free(fdp->fd_ofiles, M_FILEDESC); if (NDSLOTS(fdp->fd_nfiles) > NDSLOTS(NDFILE)) free(fdp->fd_map, M_FILEDESC); + if (fdp->fd_nfiles > NDFILE) + free(fdp->fd_files, M_FILEDESC); if (cdir != NULL) vrele(cdir); @@ -2305,6 +2312,7 @@ fget_unlocked(struct filedesc *fdp, int #ifdef CAPABILITIES struct filedescent fde; #endif + struct fdescenttbl *fdt; struct file *fp; u_int count; #ifdef CAPABILITIES @@ -2313,11 +2321,8 @@ fget_unlocked(struct filedesc *fdp, int int error; #endif - /* - * Avoid reads reordering and then a first access to the - * fdp->fd_ofiles table which could result in OOB operation. - */ - if (fd < 0 || fd >= atomic_load_acq_int(&fdp->fd_nfiles)) + fdt = fdp->fd_files; + if (fd < 0 || fd >= fdt->fdt_nfiles) return (EBADF); /* * Fetch the descriptor locklessly. We avoid fdrop() races by @@ -2329,15 +2334,15 @@ fget_unlocked(struct filedesc *fdp, int */ for (;;) { #ifdef CAPABILITIES - seq = seq_read(fd_seq(fdp, fd)); - fde = fdp->fd_ofiles[fd]; - if (!seq_consistent(fd_seq(fdp, fd), seq)) { + seq = seq_read(fd_seq(fdt, fd)); + fde = fdt->fdt_ofiles[fd]; + if (!seq_consistent(fd_seq(fdt, fd), seq)) { cpu_spinwait(); continue; } fp = fde.fde_file; #else - fp = fdp->fd_ofiles[fd].fde_file; + fp = fdt->fdt_ofiles[fd].fde_file; #endif if (fp == NULL) return (EBADF); @@ -2355,18 +2360,23 @@ fget_unlocked(struct filedesc *fdp, int } #endif count = fp->f_count; - if (count == 0) + if (count == 0) { + fdt = fdp->fd_files; continue; + } /* - * Use an acquire barrier to prevent caching of fd_ofiles - * so it is refreshed for verification. + * Use an acquire barrier to force re-reading of fdt so it is + * refreshed for verification. */ - if (atomic_cmpset_acq_int(&fp->f_count, count, count + 1) != 1) + if (atomic_cmpset_acq_int(&fp->f_count, count, count + 1) == 0) { + fdt = fdp->fd_files; continue; + } + fdt = fdp->fd_files; #ifdef CAPABILITIES - if (seq_consistent_nomb(fd_seq(fdp, fd), seq)) + if (seq_consistent_nomb(fd_seq(fdt, fd), seq)) #else - if (fp == fdp->fd_ofiles[fd].fde_file) + if (fp == fdt->fdt_ofiles[fd].fde_file) #endif break; fdrop(fp, curthread); Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Wed Oct 29 23:10:48 2014 (r273841) +++ head/sys/sys/filedesc.h Thu Oct 30 05:10:33 2014 (r273842) @@ -62,6 +62,12 @@ struct filedescent { #define fde_nioctls fde_caps.fc_nioctls #define fde_change_size (offsetof(struct filedescent, fde_seq)) +struct fdescenttbl { + int fdt_nfiles; /* number of open files allocated */ + struct filedescent fdt_ofiles[0]; /* open files */ +}; +#define fd_seq(fdt, fd) (&(fdt)->fdt_ofiles[(fd)].fde_seq) + /* * This structure is used for the management of descriptors. It may be * shared by multiple processes. @@ -69,11 +75,10 @@ struct filedescent { #define NDSLOTTYPE u_long struct filedesc { - struct filedescent *fd_ofiles; /* open files */ + struct fdescenttbl *fd_files; /* open files table */ struct vnode *fd_cdir; /* current directory */ struct vnode *fd_rdir; /* root directory */ struct vnode *fd_jdir; /* jail root directory */ - int fd_nfiles; /* number of open files allocated */ NDSLOTTYPE *fd_map; /* bitmap of free fds */ int fd_lastfile; /* high-water mark of fd_ofiles */ int fd_freefile; /* approx. next free file */ @@ -85,7 +90,6 @@ struct filedesc { int fd_holdleaderscount; /* block fdfree() for shared close() */ int fd_holdleaderswakeup; /* fdfree() needs wakeup */ }; -#define fd_seq(fdp, fd) (&(fdp)->fd_ofiles[(fd)].fde_seq) /* * Structure to keep track of (process leader, struct fildedesc) tuples. @@ -105,6 +109,8 @@ struct filedesc_to_leader { struct filedesc_to_leader *fdl_prev; struct filedesc_to_leader *fdl_next; }; +#define fd_nfiles fd_files->fdt_nfiles +#define fd_ofiles fd_files->fdt_ofiles /* * Per-process open flags. From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 05:21:13 2014 Return-Path: Delivered-To: svn-src-all@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 BB000154; Thu, 30 Oct 2014 05:21: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 A8113EC; Thu, 30 Oct 2014 05:21: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 s9U5LDk8093002; Thu, 30 Oct 2014 05:21:13 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9U5LDjD093001; Thu, 30 Oct 2014 05:21:13 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410300521.s9U5LDjD093001@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Oct 2014 05:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273843 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 05:21:13 -0000 Author: mjg Date: Thu Oct 30 05:21:12 2014 New Revision: 273843 URL: https://svnweb.freebsd.org/changeset/base/273843 Log: filedesc: microoptimize fget_unlocked by retrying obtaining reference count without restarting whole lookup Restart is only needed when fp was closed by current process, which is a much rarer event than ref/deref by some other thread. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Oct 30 05:10:33 2014 (r273842) +++ head/sys/kern/kern_descrip.c Thu Oct 30 05:21:12 2014 (r273843) @@ -2359,6 +2359,7 @@ fget_unlocked(struct filedesc *fdp, int } } #endif + retry: count = fp->f_count; if (count == 0) { fdt = fdp->fd_files; @@ -2368,10 +2369,8 @@ fget_unlocked(struct filedesc *fdp, int * Use an acquire barrier to force re-reading of fdt so it is * refreshed for verification. */ - if (atomic_cmpset_acq_int(&fp->f_count, count, count + 1) == 0) { - fdt = fdp->fd_files; - continue; - } + if (atomic_cmpset_acq_int(&fp->f_count, count, count + 1) == 0) + goto retry; fdt = fdp->fd_files; #ifdef CAPABILITIES if (seq_consistent_nomb(fd_seq(fdt, fd), seq)) From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 06:54:26 2014 Return-Path: Delivered-To: svn-src-all@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 B274FC3; Thu, 30 Oct 2014 06:54: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 9F896BE5; Thu, 30 Oct 2014 06:54: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 s9U6sQxI038131; Thu, 30 Oct 2014 06:54:26 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9U6sQdb038130; Thu, 30 Oct 2014 06:54:26 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201410300654.s9U6sQdb038130@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Thu, 30 Oct 2014 06:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273844 - head/usr.bin/hexdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 06:54:26 -0000 Author: jmg Date: Thu Oct 30 06:54:25 2014 New Revision: 273844 URL: https://svnweb.freebsd.org/changeset/base/273844 Log: fix spelling of offset since that is what is used in the body... Modified: head/usr.bin/hexdump/hexdump.1 Modified: head/usr.bin/hexdump/hexdump.1 ============================================================================== --- head/usr.bin/hexdump/hexdump.1 Thu Oct 30 05:21:12 2014 (r273843) +++ head/usr.bin/hexdump/hexdump.1 Thu Oct 30 06:54:25 2014 (r273844) @@ -28,7 +28,7 @@ .\" @(#)hexdump.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd February 18, 2010 +.Dd October 29, 2014 .Dt HEXDUMP 1 .Os .Sh NAME @@ -41,7 +41,7 @@ .Op Fl f Ar format_file .Op Fl n Ar length .Bk -words -.Op Fl s Ar skip +.Op Fl s Ar offset .Ek .Ar .Nm hd @@ -50,7 +50,7 @@ .Op Fl f Ar format_file .Op Fl n Ar length .Bk -words -.Op Fl s Ar skip +.Op Fl s Ar offset .Ek .Ar .Sh DESCRIPTION From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 07:17:34 2014 Return-Path: Delivered-To: svn-src-all@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 9F0B2780 for ; Thu, 30 Oct 2014 07:17:34 +0000 (UTC) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2498EE7E for ; Thu, 30 Oct 2014 07:17:33 +0000 (UTC) Received: by mail-la0-f45.google.com with SMTP id gm9so3914419lab.18 for ; Thu, 30 Oct 2014 00:17:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=/FuElK5g8LIpLsrnNUPiX+CVSLcMI9bBNHSnvwyloo4=; b=Y6iecODIAk82ng6VbMyuE201KDis4GB2Q2xORWTpyofQF134CJRwC5DdHk8FqB6AQT p4b3D8c1/yMZl7oIjR5LHIol81ZzgtvNTylrHTZxFaDDt6Cu8iaTK0SsEbM4t4fEYoEC NsZXLSVruO2k5WWe4KRND0uL4Nvif8HXWtmmhZhfdUcERJcvhIonRwhQWz+qTGeqstOV 1bvvrsAF6AfmTwHOdOus9YIQoOOS0gYprfCYNby+oEbIgVNGC2Q9GN6hXNIwLj1WhZW0 DI7aXkEdW8XdoTgZWDmhNeyQhA9SXJvZ/NDL0C78zEXslIR/PtHyrQG1FfakfXbAUlXh m/4Q== X-Gm-Message-State: ALoCoQnCypA7F0jGxlO1rFv2J1D5hLQY55d8vEdhobOIk4YKb57nxvyQxc5C1RZuJZSnBaKWhCrj X-Received: by 10.152.28.227 with SMTP id e3mr16955244lah.54.1414653445671; Thu, 30 Oct 2014 00:17:25 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id lt8sm2299746lac.35.2014.10.30.00.17.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Oct 2014 00:17:25 -0700 (PDT) Message-ID: <5451E604.5090709@freebsd.org> Date: Thu, 30 Oct 2014 10:17:24 +0300 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r273838 - in stable/10: share/man/man4 sys/netinet References: <201410292217.s9TMHkDv094225@svn.freebsd.org> In-Reply-To: <201410292217.s9TMHkDv094225@svn.freebsd.org> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 07:17:34 -0000 On 30.10.2014 1:17, Sean Bruno wrote: > +.It Va pmtud_blackhole_min_activated > +Number of times the blackhole MSS was used in an attempt to downshift. Should be pmtud_blackhole_activated_min_mss instead to match kernel sysctl name (or vice versa). -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 07:21:39 2014 Return-Path: Delivered-To: svn-src-all@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 40F818CA; Thu, 30 Oct 2014 07:21: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 2E895F1B; Thu, 30 Oct 2014 07:21: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 s9U7LdWL051393; Thu, 30 Oct 2014 07:21:39 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9U7Ld6Z051392; Thu, 30 Oct 2014 07:21:39 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410300721.s9U7Ld6Z051392@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Oct 2014 07:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273845 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 07:21:39 -0000 Author: mjg Date: Thu Oct 30 07:21:38 2014 New Revision: 273845 URL: https://svnweb.freebsd.org/changeset/base/273845 Log: filedesc: make sure to force table reload in fget_unlocked when count == 0 This is a fixup to r273843. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Oct 30 06:54:25 2014 (r273844) +++ head/sys/kern/kern_descrip.c Thu Oct 30 07:21:38 2014 (r273845) @@ -2362,7 +2362,12 @@ fget_unlocked(struct filedesc *fdp, int retry: count = fp->f_count; if (count == 0) { - fdt = fdp->fd_files; + /* + * Force a reload. Other thread could reallocate the + * table before this fd was closed, so it possible that + * there is a stale fp pointer in cached version. + */ + fdt = *(struct fdescenttbl * volatile *)&(fdp->fd_files); continue; } /* From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 08:03:27 2014 Return-Path: Delivered-To: svn-src-all@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 8A4AC2D6; Thu, 30 Oct 2014 08:03: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 7737935E; Thu, 30 Oct 2014 08:03: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 s9U83RDE070784; Thu, 30 Oct 2014 08:03:27 GMT (envelope-from matthew@FreeBSD.org) Received: (from matthew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9U83RGH070783; Thu, 30 Oct 2014 08:03:27 GMT (envelope-from matthew@FreeBSD.org) Message-Id: <201410300803.s9U83RGH070783@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: matthew set sender to matthew@FreeBSD.org using -f From: Matthew Seaman Date: Thu, 30 Oct 2014 08:03:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r273846 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 08:03:27 -0000 Author: matthew (ports committer) Date: Thu Oct 30 08:03:26 2014 New Revision: 273846 URL: https://svnweb.freebsd.org/changeset/base/273846 Log: Take kientzle's commit bit in for safe keeping at his request. Approved by: core Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Thu Oct 30 07:21:38 2014 (r273845) +++ svnadmin/conf/access Thu Oct 30 08:03:26 2014 (r273846) @@ -135,7 +135,6 @@ ken kensmith kevlo kib -kientzle kuriyama loos lstewart From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 08:04:51 2014 Return-Path: Delivered-To: svn-src-all@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 7215B434; Thu, 30 Oct 2014 08:04: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 5C02B370; Thu, 30 Oct 2014 08:04: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 s9U84pd0070992; Thu, 30 Oct 2014 08:04:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9U84n1J070984; Thu, 30 Oct 2014 08:04:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410300804.s9U84n1J070984@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 30 Oct 2014 08:04:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273847 - in stable/10/sys: dev/acpi_support dev/acpica dev/asmc kern net netinet netinet/cc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 08:04:51 -0000 Author: hselasky Date: Thu Oct 30 08:04:48 2014 New Revision: 273847 URL: https://svnweb.freebsd.org/changeset/base/273847 Log: MFC r273733, r273740 and r273773: The SYSCTL data pointers can come from userspace and must not be directly accessed. Although this will work on some platforms, it can throw an exception if the pointer is invalid and then panic the kernel. Add a missing SYSCTL_IN() of "SCTP_BASE_STATS" structure. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/acpi_support/acpi_ibm.c stable/10/sys/dev/acpica/acpi.c stable/10/sys/dev/asmc/asmc.c stable/10/sys/kern/kern_ffclock.c stable/10/sys/net/bpf.c stable/10/sys/netinet/cc/cc.c stable/10/sys/netinet/sctp_sysctl.c stable/10/sys/netinet/siftr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- stable/10/sys/dev/acpi_support/acpi_ibm.c Thu Oct 30 08:03:26 2014 (r273846) +++ stable/10/sys/dev/acpi_support/acpi_ibm.c Thu Oct 30 08:04:48 2014 (r273847) @@ -899,6 +899,7 @@ acpi_ibm_handlerevents_sysctl(SYSCTL_HAN char *cp, *ep; int l, val; unsigned int handler_events; + char temp[128]; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -920,17 +921,18 @@ acpi_ibm_handlerevents_sysctl(SYSCTL_HAN sbuf_trim(&sb); sbuf_finish(&sb); - - /* Copy out the old values to the user. */ - error = SYSCTL_OUT(req, sbuf_data(&sb), sbuf_len(&sb)); + strlcpy(temp, sbuf_data(&sb), sizeof(temp)); sbuf_delete(&sb); + error = sysctl_handle_string(oidp, temp, sizeof(temp), req); + + /* Check for error or no change */ if (error != 0 || req->newptr == NULL) goto out; /* If the user is setting a string, parse it. */ handler_events = 0; - cp = (char *)req->newptr; + cp = temp; while (*cp) { if (isspace(*cp)) { cp++; Modified: stable/10/sys/dev/acpica/acpi.c ============================================================================== --- stable/10/sys/dev/acpica/acpi.c Thu Oct 30 08:03:26 2014 (r273846) +++ stable/10/sys/dev/acpica/acpi.c Thu Oct 30 08:04:48 2014 (r273847) @@ -3748,6 +3748,7 @@ acpi_debug_sysctl(SYSCTL_HANDLER_ARGS) int error, *dbg; struct debugtag *tag; struct sbuf sb; + char temp[128]; if (sbuf_new(&sb, NULL, 128, SBUF_AUTOEXTEND) == NULL) return (ENOMEM); @@ -3771,15 +3772,15 @@ acpi_debug_sysctl(SYSCTL_HANDLER_ARGS) } sbuf_trim(&sb); sbuf_finish(&sb); - - /* Copy out the old values to the user. */ - error = SYSCTL_OUT(req, sbuf_data(&sb), sbuf_len(&sb)); + strlcpy(temp, sbuf_data(&sb), sizeof(temp)); sbuf_delete(&sb); - /* If the user is setting a string, parse it. */ + error = sysctl_handle_string(oidp, temp, sizeof(temp), req); + + /* Check for error or no change */ if (error == 0 && req->newptr != NULL) { *dbg = 0; - setenv((char *)oidp->oid_arg1, (char *)req->newptr); + setenv((char *)oidp->oid_arg1, temp); acpi_set_debugging(NULL); } ACPI_SERIAL_END(acpi); Modified: stable/10/sys/dev/asmc/asmc.c ============================================================================== --- stable/10/sys/dev/asmc/asmc.c Thu Oct 30 08:03:26 2014 (r273846) +++ stable/10/sys/dev/asmc/asmc.c Thu Oct 30 08:04:48 2014 (r273847) @@ -1052,7 +1052,7 @@ asmc_mb_sysctl_fanminspeed(SYSCTL_HANDLE error = sysctl_handle_int(oidp, &v, 0, req); if (error == 0 && req->newptr != NULL) { - unsigned int newspeed = *(unsigned int *)req->newptr; + unsigned int newspeed = v; asmc_fan_setvalue(dev, ASMC_KEY_FANMINSPEED, fan, newspeed); } @@ -1071,7 +1071,7 @@ asmc_mb_sysctl_fanmaxspeed(SYSCTL_HANDLE error = sysctl_handle_int(oidp, &v, 0, req); if (error == 0 && req->newptr != NULL) { - unsigned int newspeed = *(unsigned int *)req->newptr; + unsigned int newspeed = v; asmc_fan_setvalue(dev, ASMC_KEY_FANMAXSPEED, fan, newspeed); } @@ -1090,7 +1090,7 @@ asmc_mb_sysctl_fantargetspeed(SYSCTL_HAN error = sysctl_handle_int(oidp, &v, 0, req); if (error == 0 && req->newptr != NULL) { - unsigned int newspeed = *(unsigned int *)req->newptr; + unsigned int newspeed = v; asmc_fan_setvalue(dev, ASMC_KEY_FANTARGETSPEED, fan, newspeed); } @@ -1283,7 +1283,7 @@ asmc_mb_sysctl_sms_z(SYSCTL_HANDLER_ARGS asmc_sms_read(dev, ASMC_KEY_SMS_Z, &val); v = (int32_t) val; - error = sysctl_handle_int(oidp, &v, sizeof(v), req); + error = sysctl_handle_int(oidp, &v, 0, req); return (error); } @@ -1298,7 +1298,7 @@ asmc_mbp_sysctl_light_left(SYSCTL_HANDLE asmc_key_read(dev, ASMC_KEY_LIGHTLEFT, buf, sizeof buf); v = buf[2]; - error = sysctl_handle_int(oidp, &v, sizeof(v), req); + error = sysctl_handle_int(oidp, &v, 0, req); return (error); } @@ -1313,7 +1313,7 @@ asmc_mbp_sysctl_light_right(SYSCTL_HANDL asmc_key_read(dev, ASMC_KEY_LIGHTRIGHT, buf, sizeof buf); v = buf[2]; - error = sysctl_handle_int(oidp, &v, sizeof(v), req); + error = sysctl_handle_int(oidp, &v, 0, req); return (error); } @@ -1324,19 +1324,19 @@ asmc_mbp_sysctl_light_control(SYSCTL_HAN device_t dev = (device_t) arg1; uint8_t buf[2]; int error; - unsigned int level; - static int32_t v; - - error = sysctl_handle_int(oidp, &v, sizeof(v), req); + static unsigned int level; + int v; + + v = level; + error = sysctl_handle_int(oidp, &v, 0, req); + if (error == 0 && req->newptr != NULL) { - level = *(unsigned int *)req->newptr; - if (level > 255) + if (v < 0 || v > 255) return (EINVAL); - v = level; + level = v; buf[0] = level; buf[1] = 0x00; asmc_key_write(dev, ASMC_KEY_LIGHTVALUE, buf, sizeof buf); } - return (error); } Modified: stable/10/sys/kern/kern_ffclock.c ============================================================================== --- stable/10/sys/kern/kern_ffclock.c Thu Oct 30 08:03:26 2014 (r273846) +++ stable/10/sys/kern/kern_ffclock.c Thu Oct 30 08:04:48 2014 (r273847) @@ -203,26 +203,29 @@ static int sysctl_kern_sysclock_active(SYSCTL_HANDLER_ARGS) { char newclock[MAX_SYSCLOCK_NAME_LEN]; - int clk, error; + int error; + int clk; - if (req->newptr == NULL) { - /* Return the name of the current active sysclock. */ - strlcpy(newclock, sysclocks[sysclock_active], sizeof(newclock)); - error = sysctl_handle_string(oidp, newclock, - sizeof(newclock), req); - } else { - /* Change the active sysclock to the user specified one. */ - error = EINVAL; - for (clk = 0; clk < NUM_SYSCLOCKS; clk++) { - if (strncmp((char *)req->newptr, sysclocks[clk], - strlen(sysclocks[clk])) == 0) { - sysclock_active = clk; - error = 0; - break; - } + /* Return the name of the current active sysclock. */ + strlcpy(newclock, sysclocks[sysclock_active], sizeof(newclock)); + error = sysctl_handle_string(oidp, newclock, sizeof(newclock), req); + + /* Check for error or no change */ + if (error != 0 || req->newptr == NULL) + goto done; + + /* Change the active sysclock to the user specified one: */ + error = EINVAL; + for (clk = 0; clk < NUM_SYSCLOCKS; clk++) { + if (strncmp(newclock, sysclocks[clk], + MAX_SYSCLOCK_NAME_LEN - 1)) { + continue; } + sysclock_active = clk; + error = 0; + break; } - +done: return (error); } Modified: stable/10/sys/net/bpf.c ============================================================================== --- stable/10/sys/net/bpf.c Thu Oct 30 08:03:26 2014 (r273846) +++ stable/10/sys/net/bpf.c Thu Oct 30 08:04:48 2014 (r273847) @@ -2755,7 +2755,8 @@ bpfstats_fill_xbpf(struct xbpf_d *d, str static int bpf_stats_sysctl(SYSCTL_HANDLER_ARGS) { - struct xbpf_d *xbdbuf, *xbd, zerostats; + static const struct xbpf_d zerostats; + struct xbpf_d *xbdbuf, *xbd, tempstats; int index, error; struct bpf_if *bp; struct bpf_d *bd; @@ -2775,11 +2776,13 @@ bpf_stats_sysctl(SYSCTL_HANDLER_ARGS) * as we aren't allowing the user to set the counters currently. */ if (req->newptr != NULL) { - if (req->newlen != sizeof(zerostats)) + if (req->newlen != sizeof(tempstats)) return (EINVAL); - bzero(&zerostats, sizeof(zerostats)); - xbd = req->newptr; - if (bcmp(xbd, &zerostats, sizeof(*xbd)) != 0) + memset(&tempstats, 0, sizeof(tempstats)); + error = SYSCTL_IN(req, &tempstats, sizeof(tempstats)); + if (error) + return (error); + if (bcmp(&tempstats, &zerostats, sizeof(tempstats)) != 0) return (EINVAL); bpf_zero_counters(); return (0); Modified: stable/10/sys/netinet/cc/cc.c ============================================================================== --- stable/10/sys/netinet/cc/cc.c Thu Oct 30 08:03:26 2014 (r273846) +++ stable/10/sys/netinet/cc/cc.c Thu Oct 30 08:04:48 2014 (r273847) @@ -92,33 +92,33 @@ cc_default_algo(SYSCTL_HANDLER_ARGS) { char default_cc[TCP_CA_NAME_MAX]; struct cc_algo *funcs; - int err, found; + int error; - err = found = 0; + /* Get the current default: */ + CC_LIST_RLOCK(); + strlcpy(default_cc, CC_DEFAULT()->name, sizeof(default_cc)); + CC_LIST_RUNLOCK(); - if (req->newptr == NULL) { - /* Just print the current default. */ - CC_LIST_RLOCK(); - strlcpy(default_cc, CC_DEFAULT()->name, TCP_CA_NAME_MAX); - CC_LIST_RUNLOCK(); - err = sysctl_handle_string(oidp, default_cc, 0, req); - } else { - /* Find algo with specified name and set it to default. */ - CC_LIST_RLOCK(); - STAILQ_FOREACH(funcs, &cc_list, entries) { - if (strncmp((char *)req->newptr, funcs->name, - TCP_CA_NAME_MAX) == 0) { - found = 1; - V_default_cc_ptr = funcs; - } - } - CC_LIST_RUNLOCK(); + error = sysctl_handle_string(oidp, default_cc, sizeof(default_cc), req); - if (!found) - err = ESRCH; - } + /* Check for error or no change */ + if (error != 0 || req->newptr == NULL) + goto done; - return (err); + error = ESRCH; + + /* Find algo with specified name and set it to default. */ + CC_LIST_RLOCK(); + STAILQ_FOREACH(funcs, &cc_list, entries) { + if (strncmp(default_cc, funcs->name, sizeof(default_cc))) + continue; + V_default_cc_ptr = funcs; + error = 0; + break; + } + CC_LIST_RUNLOCK(); +done: + return (error); } /* Modified: stable/10/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/10/sys/netinet/sctp_sysctl.c Thu Oct 30 08:03:26 2014 (r273846) +++ stable/10/sys/netinet/sctp_sysctl.c Thu Oct 30 08:04:48 2014 (r273847) @@ -636,17 +636,26 @@ sctp_sysctl_handle_stats(SYSCTL_HANDLER_ int error; #if defined(SMP) && defined(SCTP_USE_PERCPU_STAT) + struct sctpstat sb_temp; + struct sctpstat *sarry; + struct sctpstat sb; int cpu; - struct sctpstat sb, *sarry; - #endif if ((req->newptr != NULL) && (req->newlen != sizeof(struct sctpstat))) { return (EINVAL); } + #if defined(SMP) && defined(SCTP_USE_PERCPU_STAT) - memset(&sb, 0, sizeof(struct sctpstat)); + memset(&sb, 0, sizeof(sb)); + memset(&sb_temp, 0, sizeof(sb_temp)); + + if (req->newptr != NULL) { + error = SYSCTL_IN(req, &sb_temp, sizeof(sb_temp)); + if (error != 0) + return (error); + } for (cpu = 0; cpu < mp_maxid; cpu++) { sarry = &SCTP_BASE_STATS[cpu]; if (sarry->sctps_discontinuitytime.tv_sec > sb.sctps_discontinuitytime.tv_sec) { @@ -774,12 +783,14 @@ sctp_sysctl_handle_stats(SYSCTL_HANDLER_ sb.sctps_send_burst_avoid += sarry->sctps_send_burst_avoid; sb.sctps_send_cwnd_avoid += sarry->sctps_send_cwnd_avoid; sb.sctps_fwdtsn_map_over += sarry->sctps_fwdtsn_map_over; - if (req->newptr != NULL) { - memcpy(sarry, req->newptr, sizeof(struct sctpstat)); - } + if (req->newptr != NULL) + memcpy(sarry, &sb_temp, sizeof(struct sctpstat)); } error = SYSCTL_OUT(req, &sb, sizeof(struct sctpstat)); #else + error = SYSCTL_IN(req, &SCTP_BASE_STATS, sizeof(struct sctpstat)); + if (error) + return (error); error = SYSCTL_OUT(req, &SCTP_BASE_STATS, sizeof(struct sctpstat)); #endif return (error); Modified: stable/10/sys/netinet/siftr.c ============================================================================== --- stable/10/sys/netinet/siftr.c Thu Oct 30 08:03:26 2014 (r273846) +++ stable/10/sys/netinet/siftr.c Thu Oct 30 08:04:48 2014 (r273847) @@ -266,6 +266,7 @@ static unsigned int siftr_pkts_per_log = static unsigned int siftr_generate_hashes = 0; /* static unsigned int siftr_binary_log = 0; */ static char siftr_logfile[PATH_MAX] = "/var/log/siftr.log"; +static char siftr_logfile_shadow[PATH_MAX] = "/var/log/siftr.log"; static u_long siftr_hashmask; STAILQ_HEAD(pkthead, pkt_node) pkt_queue = STAILQ_HEAD_INITIALIZER(pkt_queue); LIST_HEAD(listhead, flow_hash_node) *counter_hash; @@ -297,7 +298,7 @@ SYSCTL_PROC(_net_inet_siftr, OID_AUTO, e "switch siftr module operations on/off"); SYSCTL_PROC(_net_inet_siftr, OID_AUTO, logfile, CTLTYPE_STRING|CTLFLAG_RW, - &siftr_logfile, sizeof(siftr_logfile), &siftr_sysctl_logfile_name_handler, + &siftr_logfile_shadow, sizeof(siftr_logfile_shadow), &siftr_sysctl_logfile_name_handler, "A", "file to save siftr log messages to"); SYSCTL_UINT(_net_inet_siftr, OID_AUTO, ppl, CTLFLAG_RW, @@ -1143,38 +1144,38 @@ siftr_sysctl_logfile_name_handler(SYSCTL struct alq *new_alq; int error; - if (req->newptr == NULL) - goto skip; - - /* If old filename and new filename are different. */ - if (strncmp(siftr_logfile, (char *)req->newptr, PATH_MAX)) { - - error = alq_open(&new_alq, req->newptr, curthread->td_ucred, - SIFTR_LOG_FILE_MODE, SIFTR_ALQ_BUFLEN, 0); + error = sysctl_handle_string(oidp, arg1, arg2, req); - /* Bail if unable to create new alq. */ - if (error) - return (1); + /* Check for error or same filename */ + if (error != 0 || req->newptr == NULL || + strncmp(siftr_logfile, arg1, arg2) == 0) + goto done; + + /* Filname changed */ + error = alq_open(&new_alq, arg1, curthread->td_ucred, + SIFTR_LOG_FILE_MODE, SIFTR_ALQ_BUFLEN, 0); + if (error != 0) + goto done; - /* - * If disabled, siftr_alq == NULL so we simply close - * the alq as we've proved it can be opened. - * If enabled, close the existing alq and switch the old - * for the new. - */ - if (siftr_alq == NULL) - alq_close(new_alq); - else { - alq_close(siftr_alq); - siftr_alq = new_alq; - } + /* + * If disabled, siftr_alq == NULL so we simply close + * the alq as we've proved it can be opened. + * If enabled, close the existing alq and switch the old + * for the new. + */ + if (siftr_alq == NULL) { + alq_close(new_alq); + } else { + alq_close(siftr_alq); + siftr_alq = new_alq; } -skip: - return (sysctl_handle_string(oidp, arg1, arg2, req)); + /* Update filename upon success */ + strlcpy(siftr_logfile, arg1, arg2); +done: + return (error); } - static int siftr_manage_ops(uint8_t action) { From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 08:05:52 2014 Return-Path: Delivered-To: svn-src-all@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 C96E159B; Thu, 30 Oct 2014 08:05: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 AAB37390; Thu, 30 Oct 2014 08:05: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 s9U85qL1071203; Thu, 30 Oct 2014 08:05:52 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9U85qJQ071202; Thu, 30 Oct 2014 08:05:52 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410300805.s9U85qJQ071202@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 30 Oct 2014 08:05:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273848 - head/sbin/mount_nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 08:05:52 -0000 Author: trasz Date: Thu Oct 30 08:05:51 2014 New Revision: 273848 URL: https://svnweb.freebsd.org/changeset/base/273848 Log: Get rid of obsolete code in mount_nfs(8). Reviewed by: rmacklem@ Sponsored by: The FreeBSD Foundation Modified: head/sbin/mount_nfs/mount_nfs.c Modified: head/sbin/mount_nfs/mount_nfs.c ============================================================================== --- head/sbin/mount_nfs/mount_nfs.c Thu Oct 30 08:04:48 2014 (r273847) +++ head/sbin/mount_nfs/mount_nfs.c Thu Oct 30 08:05:51 2014 (r273848) @@ -130,7 +130,6 @@ enum tryret { TRYRET_LOCALERR /* Local failure. */ }; -static int fallback_mount(struct iovec *iov, int iovlen); static int sec_name_to_num(char *sec); static char *sec_num_to_name(int num); static int getnfsargs(char *, struct iovec **iov, int *iovlen); @@ -150,7 +149,6 @@ main(int argc, char *argv[]) int c; struct iovec *iov; int num, iovlen; - int osversion; char *name, *p, *spec, *fstype; char mntpath[MAXPATHLEN], errmsg[255]; char hostname[MAXHOSTNAMELEN + 1], *gssname, gssn[MAXHOSTNAMELEN + 50]; @@ -443,21 +441,8 @@ main(int argc, char *argv[]) build_iovec(&iov, &iovlen, "fspath", mntpath, (size_t)-1); build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); - /* - * XXX: - * Backwards compatibility routines for older kernels. - * Remove this and fallback_mount() code when we do not need to support - * NFS mounts against older kernels which still need - * struct nfs_args to be passed in via nmount(). - */ - osversion = getosreldate(); - if (osversion >= 702100) { - if (nmount(iov, iovlen, 0)) - err(1, "%s, %s", mntpath, errmsg); - } else { - if (fallback_mount(iov, iovlen)) - err(1, "%s, %s", mntpath, errmsg); - } + if (nmount(iov, iovlen, 0)) + err(1, "%s, %s", mntpath, errmsg); exit(0); } @@ -491,206 +476,6 @@ copyopt(struct iovec **newiov, int *newi build_iovec(newiov, newiovlen, name, value, len); } -/* - * XXX: This function is provided for backwards - * compatibility with older kernels which did not support - * passing NFS mount options to nmount() as individual - * parameters. It should be eventually be removed. - */ -static int -fallback_mount(struct iovec *iov, int iovlen) -{ - struct nfs_args args = { - .version = NFS_ARGSVERSION, - .addr = NULL, - .addrlen = sizeof (struct sockaddr_in), - .sotype = SOCK_STREAM, - .proto = 0, - .fh = NULL, - .fhsize = 0, - .flags = NFSMNT_RESVPORT, - .wsize = NFS_WSIZE, - .rsize = NFS_RSIZE, - .readdirsize = NFS_READDIRSIZE, - .timeo = 10, - .retrans = NFS_RETRANS, - .maxgrouplist = NFS_MAXGRPS, - .readahead = NFS_DEFRAHEAD, - .wcommitsize = 0, /* was: NQ_DEFLEASE */ - .deadthresh = NFS_MAXDEADTHRESH, /* was: NQ_DEADTHRESH */ - .hostname = NULL, - /* args version 4 */ - .acregmin = NFS_MINATTRTIMO, - .acregmax = NFS_MAXATTRTIMO, - .acdirmin = NFS_MINDIRATTRTIMO, - .acdirmax = NFS_MAXDIRATTRTIMO, - }; - int ret; - char *opt; - struct iovec *newiov; - int newiovlen; - - if (findopt(iov, iovlen, "dumbtimer", NULL, NULL) == 0) - args.flags |= NFSMNT_DUMBTIMR; - if (findopt(iov, iovlen, "noconn", NULL, NULL) == 0) - args.flags |= NFSMNT_NOCONN; - if (findopt(iov, iovlen, "conn", NULL, NULL) == 0) - args.flags |= NFSMNT_NOCONN; - if (findopt(iov, iovlen, "nolockd", NULL, NULL) == 0) - args.flags |= NFSMNT_NOLOCKD; - if (findopt(iov, iovlen, "lockd", NULL, NULL) == 0) - args.flags &= ~NFSMNT_NOLOCKD; - if (findopt(iov, iovlen, "intr", NULL, NULL) == 0) - args.flags |= NFSMNT_INT; - if (findopt(iov, iovlen, "rdirplus", NULL, NULL) == 0) - args.flags |= NFSMNT_RDIRPLUS; - if (findopt(iov, iovlen, "resvport", NULL, NULL) == 0) - args.flags |= NFSMNT_RESVPORT; - if (findopt(iov, iovlen, "noresvport", NULL, NULL) == 0) - args.flags &= ~NFSMNT_RESVPORT; - if (findopt(iov, iovlen, "soft", NULL, NULL) == 0) - args.flags |= NFSMNT_SOFT; - if (findopt(iov, iovlen, "hard", NULL, NULL) == 0) - args.flags &= ~NFSMNT_SOFT; - if (findopt(iov, iovlen, "mntudp", NULL, NULL) == 0) - args.sotype = SOCK_DGRAM; - if (findopt(iov, iovlen, "udp", NULL, NULL) == 0) - args.sotype = SOCK_DGRAM; - if (findopt(iov, iovlen, "tcp", NULL, NULL) == 0) - args.sotype = SOCK_STREAM; - if (findopt(iov, iovlen, "nfsv3", NULL, NULL) == 0) - args.flags |= NFSMNT_NFSV3; - if (findopt(iov, iovlen, "readdirsize", &opt, NULL) == 0) { - if (opt == NULL) { - errx(1, "illegal readdirsize"); - } - ret = sscanf(opt, "%d", &args.readdirsize); - if (ret != 1 || args.readdirsize <= 0) { - errx(1, "illegal readdirsize: %s", opt); - } - args.flags |= NFSMNT_READDIRSIZE; - } - if (findopt(iov, iovlen, "readahead", &opt, NULL) == 0) { - if (opt == NULL) { - errx(1, "illegal readahead"); - } - ret = sscanf(opt, "%d", &args.readahead); - if (ret != 1 || args.readahead <= 0) { - errx(1, "illegal readahead: %s", opt); - } - args.flags |= NFSMNT_READAHEAD; - } - if (findopt(iov, iovlen, "wsize", &opt, NULL) == 0) { - if (opt == NULL) { - errx(1, "illegal wsize"); - } - ret = sscanf(opt, "%d", &args.wsize); - if (ret != 1 || args.wsize <= 0) { - errx(1, "illegal wsize: %s", opt); - } - args.flags |= NFSMNT_WSIZE; - } - if (findopt(iov, iovlen, "rsize", &opt, NULL) == 0) { - if (opt == NULL) { - errx(1, "illegal rsize"); - } - ret = sscanf(opt, "%d", &args.rsize); - if (ret != 1 || args.rsize <= 0) { - errx(1, "illegal wsize: %s", opt); - } - args.flags |= NFSMNT_RSIZE; - } - if (findopt(iov, iovlen, "retrans", &opt, NULL) == 0) { - if (opt == NULL) { - errx(1, "illegal retrans"); - } - ret = sscanf(opt, "%d", &args.retrans); - if (ret != 1 || args.retrans <= 0) { - errx(1, "illegal retrans: %s", opt); - } - args.flags |= NFSMNT_RETRANS; - } - if (findopt(iov, iovlen, "acregmin", &opt, NULL) == 0) { - ret = sscanf(opt, "%d", &args.acregmin); - if (ret != 1 || args.acregmin < 0) { - errx(1, "illegal acregmin: %s", opt); - } - args.flags |= NFSMNT_ACREGMIN; - } - if (findopt(iov, iovlen, "acregmax", &opt, NULL) == 0) { - ret = sscanf(opt, "%d", &args.acregmax); - if (ret != 1 || args.acregmax < 0) { - errx(1, "illegal acregmax: %s", opt); - } - args.flags |= NFSMNT_ACREGMAX; - } - if (findopt(iov, iovlen, "acdirmin", &opt, NULL) == 0) { - ret = sscanf(opt, "%d", &args.acdirmin); - if (ret != 1 || args.acdirmin < 0) { - errx(1, "illegal acdirmin: %s", opt); - } - args.flags |= NFSMNT_ACDIRMIN; - } - if (findopt(iov, iovlen, "acdirmax", &opt, NULL) == 0) { - ret = sscanf(opt, "%d", &args.acdirmax); - if (ret != 1 || args.acdirmax < 0) { - errx(1, "illegal acdirmax: %s", opt); - } - args.flags |= NFSMNT_ACDIRMAX; - } - if (findopt(iov, iovlen, "wcommitsize", &opt, NULL) == 0) { - ret = sscanf(opt, "%d", &args.wcommitsize); - if (ret != 1 || args.wcommitsize < 0) { - errx(1, "illegal wcommitsize: %s", opt); - } - args.flags |= NFSMNT_WCOMMITSIZE; - } - if (findopt(iov, iovlen, "deadthresh", &opt, NULL) == 0) { - ret = sscanf(opt, "%d", &args.deadthresh); - if (ret != 1 || args.deadthresh <= 0) { - errx(1, "illegal deadthresh: %s", opt); - } - args.flags |= NFSMNT_DEADTHRESH; - } - if (findopt(iov, iovlen, "timeout", &opt, NULL) == 0) { - ret = sscanf(opt, "%d", &args.timeo); - if (ret != 1 || args.timeo <= 0) { - errx(1, "illegal timeout: %s", opt); - } - args.flags |= NFSMNT_TIMEO; - } - if (findopt(iov, iovlen, "maxgroups", &opt, NULL) == 0) { - ret = sscanf(opt, "%d", &args.maxgrouplist); - if (ret != 1 || args.timeo <= 0) { - errx(1, "illegal maxgroups: %s", opt); - } - args.flags |= NFSMNT_MAXGRPS; - } - if (findopt(iov, iovlen, "addr", &opt, - &args.addrlen) == 0) { - args.addr = (struct sockaddr *) opt; - } - if (findopt(iov, iovlen, "fh", &opt, &args.fhsize) == 0) { - args.fh = opt; - } - if (findopt(iov, iovlen, "hostname", &args.hostname, - NULL) == 0) { - } - if (args.hostname == NULL) { - errx(1, "Invalid hostname"); - } - - newiov = NULL; - newiovlen = 0; - - build_iovec(&newiov, &newiovlen, "nfs_args", &args, sizeof(args)); - copyopt(&newiov, &newiovlen, iov, iovlen, "fstype"); - copyopt(&newiov, &newiovlen, iov, iovlen, "fspath"); - copyopt(&newiov, &newiovlen, iov, iovlen, "errmsg"); - - return nmount(newiov, newiovlen, 0); -} - static int sec_name_to_num(char *sec) { From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 08:50:03 2014 Return-Path: Delivered-To: svn-src-all@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 0AD90773; Thu, 30 Oct 2014 08:50: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 EA3939FC; Thu, 30 Oct 2014 08:50: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 s9U8o2AG090629; Thu, 30 Oct 2014 08:50:02 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9U8o2s6090624; Thu, 30 Oct 2014 08:50:02 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410300850.s9U8o2s6090624@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 30 Oct 2014 08:50:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273849 - in head: sbin/mount_nfs sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 08:50:03 -0000 Author: trasz Date: Thu Oct 30 08:50:01 2014 New Revision: 273849 URL: https://svnweb.freebsd.org/changeset/base/273849 Log: Add support for "timeo", "actimeo", "noac", and "proto" options to mount_nfs(8). They are implemented on Linux, OS X, and Solaris, and thus can be expected to appear in automounter maps. Reviewed by: rmacklem@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sbin/mount_nfs/mount_nfs.8 head/sbin/mount_nfs/mount_nfs.c head/sys/fs/nfsclient/nfs_clvfsops.c Modified: head/sbin/mount_nfs/mount_nfs.8 ============================================================================== --- head/sbin/mount_nfs/mount_nfs.8 Thu Oct 30 08:05:51 2014 (r273848) +++ head/sbin/mount_nfs/mount_nfs.8 Thu Oct 30 08:50:01 2014 (r273849) @@ -28,7 +28,7 @@ .\" @(#)mount_nfs.8 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd August 5, 2014 +.Dd October 30, 2014 .Dt MOUNT_NFS 8 .Os .Sh NAME @@ -118,6 +118,8 @@ for regular files, and 30 -> 60 seconds The algorithm to calculate the timeout is based on the age of the file. The older the file, the longer the cache is considered valid, subject to the limits above. +.It Cm actimeo Ns = Ns Aq Ar seconds +Set four cache timeouts above to specified value. .It Cm allgssname This option can be used along with .Fl o Cm gssname @@ -211,6 +213,8 @@ NFS Version 4 protocol. This option is only meaningful when used with the .Cm minorversion option. +.It Cm noac +Disable attribute caching. .It Cm noconn For UDP mount points, do not do a .Xr connect 2 . @@ -282,6 +286,15 @@ use a reserved socket port number (see b .It Cm port Ns = Ns Aq Ar port_number Use specified port number for NFS requests. The default is to query the portmapper for the NFS port. +.It Cm proto Ns = Ns Aq Ar protocol +Specify transport protocol version to use. +Currently, they are: +.Bd -literal +udp - Use UDP over IPv4 +tcp - Use TCP over IPv4 +udp6 - Use UDP over IPv6 +tcp6 - Use TCP over IPv6 +.Ed .It Cm rdirplus Used with NFSV3 to specify that the \fBReaddirPlus\fR RPC should be used. @@ -369,6 +382,9 @@ value if there is a low retransmit rate option should be specified when using this option to manually tune the timeout interval.) +.It Cm timeo Ns = Ns Aq Ar value +Alias for +.Cm timeout . .It Cm udp Use UDP transport. .It Cm vers Ns = Ns Aq Ar vers_number Modified: head/sbin/mount_nfs/mount_nfs.c ============================================================================== --- head/sbin/mount_nfs/mount_nfs.c Thu Oct 30 08:05:51 2014 (r273848) +++ head/sbin/mount_nfs/mount_nfs.c Thu Oct 30 08:50:01 2014 (r273849) @@ -282,6 +282,35 @@ main(int argc, char *argv[]) err(1, "asprintf"); } else if (strcmp(opt, "principal") == 0) { got_principal = 1; + } else if (strcmp(opt, "proto") == 0) { + pass_flag_to_nmount=0; + if (strcmp(val, "tcp") == 0) { + nfsproto = IPPROTO_TCP; + opflags |= OF_NOINET6; + build_iovec(&iov, &iovlen, + "tcp", NULL, 0); + } else if (strcmp(val, "udp") == 0) { + mnttcp_ok = 0; + nfsproto = IPPROTO_UDP; + opflags |= OF_NOINET6; + build_iovec(&iov, &iovlen, + "udp", NULL, 0); + } else if (strcmp(val, "tcp6") == 0) { + nfsproto = IPPROTO_TCP; + opflags |= OF_NOINET4; + build_iovec(&iov, &iovlen, + "tcp", NULL, 0); + } else if (strcmp(val, "udp6") == 0) { + mnttcp_ok = 0; + nfsproto = IPPROTO_UDP; + opflags |= OF_NOINET4; + build_iovec(&iov, &iovlen, + "udp", NULL, 0); + } else { + errx(1, + "illegal proto value -- %s", + val); + } } else if (strcmp(opt, "sec") == 0) { /* * Don't add this option to Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Thu Oct 30 08:05:51 2014 (r273848) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Thu Oct 30 08:50:01 2014 (r273849) @@ -722,15 +722,15 @@ nfs_decode_args(struct mount *mp, struct } static const char *nfs_opts[] = { "from", "nfs_args", - "noatime", "noexec", "suiddir", "nosuid", "nosymfollow", "union", + "noac", "noatime", "noexec", "suiddir", "nosuid", "nosymfollow", "union", "noclusterr", "noclusterw", "multilabel", "acls", "force", "update", "async", "noconn", "nolockd", "conn", "lockd", "intr", "rdirplus", "readdirsize", "soft", "hard", "mntudp", "tcp", "udp", "wsize", "rsize", - "retrans", "acregmin", "acregmax", "acdirmin", "acdirmax", "resvport", - "readahead", "hostname", "timeout", "addr", "fh", "nfsv3", "sec", - "principal", "nfsv4", "gssname", "allgssname", "dirpath", "minorversion", - "nametimeo", "negnametimeo", "nocto", "noncontigwr", "pnfs", - "wcommitsize", + "retrans", "actimeo", "acregmin", "acregmax", "acdirmin", "acdirmax", + "resvport", "readahead", "hostname", "timeo", "timeout", "addr", "fh", + "nfsv3", "sec", "principal", "nfsv4", "gssname", "allgssname", "dirpath", + "minorversion", "nametimeo", "negnametimeo", "nocto", "noncontigwr", + "pnfs", "wcommitsize", NULL }; /* @@ -815,6 +815,12 @@ nfs_mount(struct mount *mp) } /* Handle the new style options. */ + if (vfs_getopt(mp->mnt_optnew, "noac", NULL, NULL) == 0) { + args.acdirmin = args.acdirmax = + args.acregmin = args.acregmax = 0; + args.flags |= NFSMNT_ACDIRMIN | NFSMNT_ACDIRMAX | + NFSMNT_ACREGMIN | NFSMNT_ACREGMAX; + } if (vfs_getopt(mp->mnt_optnew, "noconn", NULL, NULL) == 0) args.flags |= NFSMNT_NOCONN; if (vfs_getopt(mp->mnt_optnew, "conn", NULL, NULL) == 0) @@ -930,6 +936,18 @@ nfs_mount(struct mount *mp) } args.flags |= NFSMNT_RETRANS; } + if (vfs_getopt(mp->mnt_optnew, "actimeo", (void **)&opt, NULL) == 0) { + ret = sscanf(opt, "%d", &args.acregmin); + if (ret != 1 || args.acregmin < 0) { + vfs_mount_error(mp, "illegal actimeo: %s", + opt); + error = EINVAL; + goto out; + } + args.acdirmin = args.acdirmax = args.acregmax = args.acregmin; + args.flags |= NFSMNT_ACDIRMIN | NFSMNT_ACDIRMAX | + NFSMNT_ACREGMIN | NFSMNT_ACREGMAX; + } if (vfs_getopt(mp->mnt_optnew, "acregmin", (void **)&opt, NULL) == 0) { ret = sscanf(opt, "%d", &args.acregmin); if (ret != 1 || args.acregmin < 0) { @@ -979,6 +997,16 @@ nfs_mount(struct mount *mp) } args.flags |= NFSMNT_WCOMMITSIZE; } + if (vfs_getopt(mp->mnt_optnew, "timeo", (void **)&opt, NULL) == 0) { + ret = sscanf(opt, "%d", &args.timeo); + if (ret != 1 || args.timeo <= 0) { + vfs_mount_error(mp, "illegal timeo: %s", + opt); + error = EINVAL; + goto out; + } + args.flags |= NFSMNT_TIMEO; + } if (vfs_getopt(mp->mnt_optnew, "timeout", (void **)&opt, NULL) == 0) { ret = sscanf(opt, "%d", &args.timeo); if (ret != 1 || args.timeo <= 0) { From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 08:53:58 2014 Return-Path: Delivered-To: svn-src-all@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 E47A190E; Thu, 30 Oct 2014 08:53: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 D06DAAA4; Thu, 30 Oct 2014 08:53: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 s9U8rwbr094879; Thu, 30 Oct 2014 08:53:58 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9U8rvD0094873; Thu, 30 Oct 2014 08:53:57 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201410300853.s9U8rvD0094873@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Thu, 30 Oct 2014 08:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273850 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 08:53:59 -0000 Author: jch Date: Thu Oct 30 08:53:56 2014 New Revision: 273850 URL: https://svnweb.freebsd.org/changeset/base/273850 Log: Fix a race condition in TCP timewait between tcp_tw_2msl_reuse() and tcp_tw_2msl_scan(). This race condition drives unplanned timewait timeout cancellation. Also simplify implementation by holding inpcb reference and removing tcptw reference counting. Differential Revision: https://reviews.freebsd.org/D826 Submitted by: Marc De la Gueronniere Submitted by: jch Reviewed By: jhb (mentor), adrian, rwatson Sponsored by: Verisign, Inc. MFC after: 2 weeks X-MFC-With: r264321 Modified: head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h head/sys/netinet/tcp_timewait.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Thu Oct 30 08:50:01 2014 (r273849) +++ head/sys/netinet/tcp_timer.c Thu Oct 30 08:53:56 2014 (r273850) @@ -243,7 +243,7 @@ tcp_slowtimo(void) VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - tcp_tw_2msl_scan(); + (void) tcp_tw_2msl_scan(0); CURVNET_RESTORE(); } VNET_LIST_RUNLOCK_NOSLEEP(); Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Thu Oct 30 08:50:01 2014 (r273849) +++ head/sys/netinet/tcp_timer.h Thu Oct 30 08:53:56 2014 (r273850) @@ -178,8 +178,7 @@ extern int tcp_fast_finwait2_recycle; void tcp_timer_init(void); void tcp_timer_2msl(void *xtp); struct tcptw * - tcp_tw_2msl_reuse(void); /* XXX temporary? */ -void tcp_tw_2msl_scan(void); + tcp_tw_2msl_scan(int reuse); /* XXX temporary? */ void tcp_timer_keep(void *xtp); void tcp_timer_persist(void *xtp); void tcp_timer_rexmt(void *xtp); Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Thu Oct 30 08:50:01 2014 (r273849) +++ head/sys/netinet/tcp_timewait.c Thu Oct 30 08:53:56 2014 (r273850) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include @@ -101,6 +100,11 @@ static int maxtcptw; * currently in the TIME_WAIT state. The queue pointers, including the * queue pointers in each tcptw structure, are protected using the global * timewait lock, which must be held over queue iteration and modification. + * + * Rules on tcptw usage: + * - a inpcb is always freed _after_ its tcptw + * - a tcptw relies on its inpcb reference counting for memory stability + * - a tcptw is dereferenceable only while its inpcb is locked */ static VNET_DEFINE(TAILQ_HEAD(, tcptw), twq_2msl); #define V_twq_2msl VNET(twq_2msl) @@ -124,32 +128,6 @@ static void tcp_tw_2msl_reset(struct tcp static void tcp_tw_2msl_stop(struct tcptw *, int); static int tcp_twrespond(struct tcptw *, int); -/* - * tw_pcbref() bumps the reference count on an tw in order to maintain - * stability of an tw pointer despite the tw lock being released. - */ -static void -tw_pcbref(struct tcptw *tw) -{ - - KASSERT(tw->tw_refcount > 0, ("%s: refcount 0", __func__)); - refcount_acquire(&tw->tw_refcount); -} - -/* - * Drop a refcount on an tw elevated using tw_pcbref(). - */ -static int -tw_pcbrele(struct tcptw *tw) -{ - - KASSERT(tw->tw_refcount > 0, ("%s: refcount 0", __func__)); - if (!refcount_release(&tw->tw_refcount)) - return (0); - uma_zfree(V_tcptw_zone, tw); - return (1); -} - static int tcptw_auto_size(void) { @@ -279,8 +257,11 @@ tcp_twstart(struct tcpcb *tp) * Reached limit on total number of TIMEWAIT connections * allowed. Remove a connection from TIMEWAIT queue in LRU * fashion to make room for this connection. + * + * pcbinfo lock is needed here to prevent deadlock as + * two inpcb locks can be acquired simultaneously. */ - tw = tcp_tw_2msl_reuse(); + tw = tcp_tw_2msl_scan(1); if (tw == NULL) { tp = tcp_close(tp); if (tp != NULL) @@ -288,8 +269,12 @@ tcp_twstart(struct tcpcb *tp) return; } } + /* + * The tcptw will hold a reference on its inpcb until tcp_twclose + * is called + */ tw->tw_inpcb = inp; - refcount_init(&tw->tw_refcount, 1); + in_pcbref(inp); /* Reference from tw */ /* * Recover last window size sent. @@ -479,7 +464,6 @@ tcp_twclose(struct tcptw *tw, int reuse) INP_INFO_WLOCK_ASSERT(&V_tcbinfo); /* in_pcbfree() */ INP_WLOCK_ASSERT(inp); - tw->tw_inpcb = NULL; tcp_tw_2msl_stop(tw, reuse); inp->inp_ppcb = NULL; in_pcbdrop(inp); @@ -509,8 +493,13 @@ tcp_twclose(struct tcptw *tw, int reuse) */ INP_WUNLOCK(inp); } - } else + } else { + /* + * The socket has been already cleaned-up for us, only free the + * inpcb. + */ in_pcbfree(inp); + } TCPSTAT_INC(tcps_closed); } @@ -641,71 +630,94 @@ tcp_tw_2msl_reset(struct tcptw *tw, int static void tcp_tw_2msl_stop(struct tcptw *tw, int reuse) { + struct ucred *cred; + struct inpcb *inp; + int released; INP_INFO_WLOCK_ASSERT(&V_tcbinfo); TW_WLOCK(V_tw_lock); + inp = tw->tw_inpcb; + tw->tw_inpcb = NULL; + TAILQ_REMOVE(&V_twq_2msl, tw, tw_2msl); - crfree(tw->tw_cred); + cred = tw->tw_cred; tw->tw_cred = NULL; TW_WUNLOCK(V_tw_lock); + if (cred != NULL) + crfree(cred); + + released = in_pcbrele_wlocked(inp); + KASSERT(!released, ("%s: inp should not be released here", __func__)); + if (!reuse) - tw_pcbrele(tw); + uma_zfree(V_tcptw_zone, tw); } struct tcptw * -tcp_tw_2msl_reuse(void) +tcp_tw_2msl_scan(int reuse) { struct tcptw *tw; + struct inpcb *inp; - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); - - TW_WLOCK(V_tw_lock); - tw = TAILQ_FIRST(&V_twq_2msl); - if (tw == NULL) { - TW_WUNLOCK(V_tw_lock); - return NULL; +#ifdef INVARIANTS + if (reuse) { + /* + * pcbinfo lock is needed in reuse case to prevent deadlock + * as two inpcb locks can be acquired simultaneously: + * - the inpcb transitioning to TIME_WAIT state in + * tcp_tw_start(), + * - the inpcb closed by tcp_twclose(). + */ + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); } - TW_WUNLOCK(V_tw_lock); - - INP_WLOCK(tw->tw_inpcb); - tcp_twclose(tw, 1); - - return (tw); -} - -void -tcp_tw_2msl_scan(void) -{ - struct tcptw *tw; +#endif for (;;) { TW_RLOCK(V_tw_lock); tw = TAILQ_FIRST(&V_twq_2msl); - if (tw == NULL || tw->tw_time - ticks > 0) { + if (tw == NULL || (!reuse && (tw->tw_time - ticks) > 0)) { TW_RUNLOCK(V_tw_lock); break; } - tw_pcbref(tw); + KASSERT(tw->tw_inpcb != NULL, ("%s: tw->tw_inpcb == NULL", + __func__)); + + inp = tw->tw_inpcb; + in_pcbref(inp); TW_RUNLOCK(V_tw_lock); - /* Close timewait state */ if (INP_INFO_TRY_WLOCK(&V_tcbinfo)) { - if (tw_pcbrele(tw)) { + + INP_WLOCK(inp); + tw = intotw(inp); + if (in_pcbrele_wlocked(inp)) { + KASSERT(tw == NULL, ("%s: held last inp " + "reference but tw not NULL", __func__)); INP_INFO_WUNLOCK(&V_tcbinfo); continue; } - KASSERT(tw->tw_inpcb != NULL, - ("%s: tw->tw_inpcb == NULL", __func__)); - INP_WLOCK(tw->tw_inpcb); - tcp_twclose(tw, 0); + if (tw == NULL) { + /* tcp_twclose() has already been called */ + INP_WUNLOCK(inp); + INP_INFO_WUNLOCK(&V_tcbinfo); + continue; + } + + tcp_twclose(tw, reuse); INP_INFO_WUNLOCK(&V_tcbinfo); + if (reuse) + return tw; } else { - /* INP_INFO lock is busy; continue later. */ - tw_pcbrele(tw); + /* INP_INFO lock is busy, continue later. */ + INP_WLOCK(inp); + if (!in_pcbrele_wlocked(inp)) + INP_WUNLOCK(inp); break; } } + + return NULL; } Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Thu Oct 30 08:50:01 2014 (r273849) +++ head/sys/netinet/tcp_usrreq.c Thu Oct 30 08:53:56 2014 (r273850) @@ -183,6 +183,21 @@ tcp_detach(struct socket *so, struct inp * present until timewait ends. * * XXXRW: Would it be cleaner to free the tcptw here? + * + * Astute question indeed, from twtcp perspective there are + * three cases to consider: + * + * #1 tcp_detach is called at tcptw creation time by + * tcp_twstart, then do not discard the newly created tcptw + * and leave inpcb present until timewait ends + * #2 tcp_detach is called at timewait end (or reuse) by + * tcp_twclose, then the tcptw has already been discarded + * and inpcb is freed here + * #3 tcp_detach is called() after timewait ends (or reuse) + * (e.g. by soclose), then tcptw has already been discarded + * and inpcb is freed here + * + * In all three cases the tcptw should not be freed here. */ if (inp->inp_flags & INP_DROPPED) { KASSERT(tp == NULL, ("tcp_detach: INP_TIMEWAIT && " Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Thu Oct 30 08:50:01 2014 (r273849) +++ head/sys/netinet/tcp_var.h Thu Oct 30 08:53:56 2014 (r273850) @@ -358,7 +358,6 @@ struct tcptw { u_int t_starttime; int tw_time; TAILQ_ENTRY(tcptw) tw_2msl; - u_int tw_refcount; /* refcount */ }; #define intotcpcb(ip) ((struct tcpcb *)(ip)->inp_ppcb) @@ -651,7 +650,7 @@ struct tcpcb * tcp_close(struct tcpcb *); void tcp_discardcb(struct tcpcb *); void tcp_twstart(struct tcpcb *); -void tcp_twclose(struct tcptw *_tw, int _reuse); +void tcp_twclose(struct tcptw *, int); void tcp_ctlinput(int, struct sockaddr *, void *); int tcp_ctloutput(struct socket *, struct sockopt *); struct tcpcb * From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 09:06:53 2014 Return-Path: Delivered-To: svn-src-all@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 62885CF4; Thu, 30 Oct 2014 09:06:53 +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 4CED8BAB; Thu, 30 Oct 2014 09:06: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 s9U96r90001784; Thu, 30 Oct 2014 09:06:53 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9U96rfv001783; Thu, 30 Oct 2014 09:06:53 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410300906.s9U96rfv001783@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 30 Oct 2014 09:06:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273851 - head/sbin/mount_nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 09:06:53 -0000 Author: trasz Date: Thu Oct 30 09:06:52 2014 New Revision: 273851 URL: https://svnweb.freebsd.org/changeset/base/273851 Log: Note that the "timeout" nfs option is in tenths of a second. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sbin/mount_nfs/mount_nfs.8 Modified: head/sbin/mount_nfs/mount_nfs.8 ============================================================================== --- head/sbin/mount_nfs/mount_nfs.8 Thu Oct 30 08:53:56 2014 (r273850) +++ head/sbin/mount_nfs/mount_nfs.8 Thu Oct 30 09:06:52 2014 (r273851) @@ -370,7 +370,8 @@ LAN and WAN configurations compared to U Some old NFS servers do not support this method; UDP mounts may be required for interoperability. .It Cm timeout Ns = Ns Aq Ar value -Set the initial retransmit timeout to the specified value. +Set the initial retransmit timeout to the specified value, +expressed in tenths of a second. May be useful for fine tuning UDP mounts over internetworks with high packet loss rates or an overloaded server. Try increasing the interval if From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 09:25:03 2014 Return-Path: Delivered-To: svn-src-all@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 E971C213; Thu, 30 Oct 2014 09:25: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 D5A1ED8E; Thu, 30 Oct 2014 09:25: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 s9U9P34w012733; Thu, 30 Oct 2014 09:25:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9U9P32v012732; Thu, 30 Oct 2014 09:25:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410300925.s9U9P32v012732@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 30 Oct 2014 09:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273852 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 09:25:04 -0000 Author: trasz Date: Thu Oct 30 09:25:03 2014 New Revision: 273852 URL: https://svnweb.freebsd.org/changeset/base/273852 Log: Fix handling of "conn" mount_nfs(8) option. Reviewed by: rmacklem@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/nfsclient/nfs_clvfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Thu Oct 30 09:06:52 2014 (r273851) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Thu Oct 30 09:25:03 2014 (r273852) @@ -824,7 +824,7 @@ nfs_mount(struct mount *mp) if (vfs_getopt(mp->mnt_optnew, "noconn", NULL, NULL) == 0) args.flags |= NFSMNT_NOCONN; if (vfs_getopt(mp->mnt_optnew, "conn", NULL, NULL) == 0) - args.flags |= NFSMNT_NOCONN; + args.flags &= ~NFSMNT_NOCONN; if (vfs_getopt(mp->mnt_optnew, "nolockd", NULL, NULL) == 0) args.flags |= NFSMNT_NOLOCKD; if (vfs_getopt(mp->mnt_optnew, "lockd", NULL, NULL) == 0) From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 10:30:11 2014 Return-Path: Delivered-To: svn-src-all@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 A5BBB413; Thu, 30 Oct 2014 10:30:11 +0000 (UTC) Received: from mail-lb0-x230.google.com (mail-lb0-x230.google.com [IPv6:2a00:1450:4010:c04::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4871650; Thu, 30 Oct 2014 10:30:10 +0000 (UTC) Received: by mail-lb0-f176.google.com with SMTP id z11so2085515lbi.35 for ; Thu, 30 Oct 2014 03:30:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=6nqHwn2cID5jXY7kvram0Q2WrNCKZY/7CXkutnn41Lo=; b=GVFTK4As/Q3KVkUHBe7LNvGpX2cEAqxwvNqMCVUeTYkKx/TR2jSWHG75tsAebM24D7 IimQXEp6wVs28QgJqE7ho0rn9O37+JDfdVQKmzXR2pMSAZUX8Y2+bzQ0IDy+JT2XNknD ZbJFl1vsVTafR7876c3jAbh9490NnOB5jAC11GHR9zlwWESI/qy8n/xXHtGhsemuaBf6 JJO7qxTwcMAL2YFgyDJvy2oi/85FUTJWOwTNtZuXF0KrscjPDrxWW/j1eJnfrvgpkwVi YRNa2agVLWgivD5N/dlViWSfXgtWNnYADbS8ueH+PAxR0Wh+Qt/R8dxZq+vjueL4JN3i 5J4Q== X-Received: by 10.152.20.72 with SMTP id l8mr17963355lae.43.1414665008596; Thu, 30 Oct 2014 03:30:08 -0700 (PDT) Received: from brick.home (adgb135.neoplus.adsl.tpnet.pl. [79.184.131.135]) by mx.google.com with ESMTPSA id w10sm3039070lae.24.2014.10.30.03.30.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Oct 2014 03:30:07 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 30 Oct 2014 11:30:04 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r273806 - in head/contrib/ofed: libcxgb4 libcxgb4/src usr.lib usr.lib/libcxgb4 Message-ID: <20141030103004.GA2687@brick.home> Mail-Followup-To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201410290115.s9T1FnTv094112@svn.freebsd.org> <20141029095604.GA81110@brick.home> <20141029182354.GA8965@ox> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20141029182354.GA8965@ox> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 10:30:11 -0000 On 1029T1123, Navdeep Parhar wrote: > On Wed, Oct 29, 2014 at 10:56:04AM +0100, Edward Tomasz NapieraÅ‚a wrote: > > On 1029T0115, Navdeep Parhar wrote: > > > Author: np > > > Date: Wed Oct 29 01:15:48 2014 > > > New Revision: 273806 > > > URL: https://svnweb.freebsd.org/changeset/base/273806 > > > > > > Log: > > > Userspace library for Chelsio's Terminator 5 based iWARP RNICs (pretty > > > much every T5 card that does _not_ have "-SO" in its name is RDMA > > > capable). > > > > Yay! This means we could add iSER without using the ICL_PROXY hack. > > Well, assuming it's possible to "hand off" RDMA connection from userspace > > to the kernel. Is it? > > Yes, this should be doable. The connection is just another TCP endpoint > tracked like all others in the kernel. :-) > By the way, iSER is an unnecessary layer if you're using a T5 NIC. > It'll work, sure, but you'll run iSER/RDMA/TOE when you could simply run > iSCSI/TOE with full zero copy everywhere. Comes out to the same result > with a much simpler stack. I think iSER makes sense for gear that does > RDMA but not iSCSI natively. True. IMHO the biggest difference is that iWARP is universal, ie. the NIC doesn't need to have any iSCSI-specific functionality. On the other hand, iSER cannot talk to non-iSER, while iSCSI offload in your NICs talks ordinary iSCSI on the wire. From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 10:49:53 2014 Return-Path: Delivered-To: svn-src-all@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 58B21803; Thu, 30 Oct 2014 10:49:53 +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 39B39862; Thu, 30 Oct 2014 10:49: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 s9UAnrUe051084; Thu, 30 Oct 2014 10:49:53 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UAnpkK051071; Thu, 30 Oct 2014 10:49:51 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410301049.s9UAnpkK051071@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 30 Oct 2014 10:49:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273853 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 10:49:53 -0000 Author: trasz Date: Thu Oct 30 10:49:50 2014 New Revision: 273853 URL: https://svnweb.freebsd.org/changeset/base/273853 Log: Make it clear that ACL flags are NFSv4-only. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/posix1e/acl_add_flag_np.3 head/lib/libc/posix1e/acl_clear_flags_np.3 head/lib/libc/posix1e/acl_delete_flag_np.3 head/lib/libc/posix1e/acl_get_flag_np.3 head/lib/libc/posix1e/acl_get_flagset_np.3 head/lib/libc/posix1e/acl_set_entry_type_np.3 head/lib/libc/posix1e/acl_set_flagset_np.3 Modified: head/lib/libc/posix1e/acl_add_flag_np.3 ============================================================================== --- head/lib/libc/posix1e/acl_add_flag_np.3 Thu Oct 30 09:25:03 2014 (r273852) +++ head/lib/libc/posix1e/acl_add_flag_np.3 Thu Oct 30 10:49:50 2014 (r273853) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 25, 2009 +.Dd October 30, 2014 .Dt ACL_ADD_FLAG_NP 3 .Os .Sh NAME @@ -42,7 +42,7 @@ The .Fn acl_add_flag_np function -is a non-portable call that adds the flags contained in +is a non-portable call that adds the NFSv4 ACL flags contained in .Fa flags to the flagset .Fa flagset_d . Modified: head/lib/libc/posix1e/acl_clear_flags_np.3 ============================================================================== --- head/lib/libc/posix1e/acl_clear_flags_np.3 Thu Oct 30 09:25:03 2014 (r273852) +++ head/lib/libc/posix1e/acl_clear_flags_np.3 Thu Oct 30 10:49:50 2014 (r273853) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 25, 2009 +.Dd October 30, 2014 .Dt ACL_CLEAR_FLAGS_NP 3 .Os .Sh NAME @@ -42,7 +42,7 @@ The .Fn acl_clear_flags_np function -is a non-portable call that clears all flags from flagset +is a non-portable call that clears all NFSv4 ACL flags from flagset .Fa flagset_d . .Sh RETURN VALUES .Rv -std acl_clear_flags_np Modified: head/lib/libc/posix1e/acl_delete_flag_np.3 ============================================================================== --- head/lib/libc/posix1e/acl_delete_flag_np.3 Thu Oct 30 09:25:03 2014 (r273852) +++ head/lib/libc/posix1e/acl_delete_flag_np.3 Thu Oct 30 10:49:50 2014 (r273853) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 10, 2001 +.Dd October 30, 2014 .Dt ACL_DELETE_FLAG_NP 3 .Os .Sh NAME @@ -42,7 +42,7 @@ The .Fn acl_delete_flag_np function -is a non-portable call that removes specific flags from flagset +is a non-portable call that removes specific NFSv4 ACL flags from flagset .Fa flags . .Sh RETURN VALUES .Rv -std acl_delete_flag_np Modified: head/lib/libc/posix1e/acl_get_flag_np.3 ============================================================================== --- head/lib/libc/posix1e/acl_get_flag_np.3 Thu Oct 30 09:25:03 2014 (r273852) +++ head/lib/libc/posix1e/acl_get_flag_np.3 Thu Oct 30 10:49:50 2014 (r273853) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 25, 2009 +.Dd October 30, 2014 .Dt ACL_GET_FLAG_NP 3 .Os .Sh NAME @@ -42,7 +42,7 @@ The .Fn acl_get_flag_np function -is a non-portable function that checks if a flag is set in +is a non-portable function that checks if a NFSv4 ACL flag is set in a flagset. .Sh RETURN VALUES If the flag in Modified: head/lib/libc/posix1e/acl_get_flagset_np.3 ============================================================================== --- head/lib/libc/posix1e/acl_get_flagset_np.3 Thu Oct 30 09:25:03 2014 (r273852) +++ head/lib/libc/posix1e/acl_get_flagset_np.3 Thu Oct 30 10:49:50 2014 (r273853) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 25, 2009 +.Dd October 30, 2014 .Dt ACL_GET_FLAGSET_NP 3 .Os .Sh NAME @@ -44,7 +44,7 @@ The function is a non-portable call that returns via .Fa flagset_np_p -a descriptor to the flagset in the ACL entry +a descriptor to the flagset in the NFSv4 ACL entry .Fa entry_d . Subsequent operations using the returned flagset operate on the flagset within the ACL entry. Modified: head/lib/libc/posix1e/acl_set_entry_type_np.3 ============================================================================== --- head/lib/libc/posix1e/acl_set_entry_type_np.3 Thu Oct 30 09:25:03 2014 (r273852) +++ head/lib/libc/posix1e/acl_set_entry_type_np.3 Thu Oct 30 10:49:50 2014 (r273853) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 25, 2009 +.Dd October 30, 2014 .Dt ACL_SET_ENTRY_TYPE_NP 3 .Os .Sh NAME @@ -42,7 +42,7 @@ The .Fn acl_set_entry_type_np function -is a non-portable call that sets the type of the ACL entry +is a non-portable call that sets the type of the NFSv4 ACL entry .Fa entry_d to the value referred to by .Fa entry_type . Modified: head/lib/libc/posix1e/acl_set_flagset_np.3 ============================================================================== --- head/lib/libc/posix1e/acl_set_flagset_np.3 Thu Oct 30 09:25:03 2014 (r273852) +++ head/lib/libc/posix1e/acl_set_flagset_np.3 Thu Oct 30 10:49:50 2014 (r273853) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 25, 2009 +.Dd October 30, 2014 .Dt ACL_SET_FLAGSET_NP 3 .Os .Sh NAME @@ -42,7 +42,7 @@ The .Fn acl_set_flagset_np function -is a non-portable call that sets the flags of ACL entry +is a non-portable call that sets the flags of NFSv4 ACL entry .Fa entry_d with the flags contained in .Fa flagset_d . From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 10:56:39 2014 Return-Path: Delivered-To: svn-src-all@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 253C79D2; Thu, 30 Oct 2014 10:56: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 EBB4193C; Thu, 30 Oct 2014 10:56: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 s9UAucno055396; Thu, 30 Oct 2014 10:56:38 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UAucZ7055395; Thu, 30 Oct 2014 10:56:38 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410301056.s9UAucZ7055395@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 30 Oct 2014 10:56:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273854 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 10:56:39 -0000 Author: trasz Date: Thu Oct 30 10:56:38 2014 New Revision: 273854 URL: https://svnweb.freebsd.org/changeset/base/273854 Log: Update acl(3) to expand on NFSv4 ACL support. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/posix1e/acl.3 Modified: head/lib/libc/posix1e/acl.3 ============================================================================== --- head/lib/libc/posix1e/acl.3 Thu Oct 30 10:49:50 2014 (r273853) +++ head/lib/libc/posix1e/acl.3 Thu Oct 30 10:56:38 2014 (r273854) @@ -27,12 +27,12 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2013 +.Dd October 30, 2014 .Dt ACL 3 .Os .Sh NAME .Nm acl -.Nd introduction to the POSIX.1e ACL security API +.Nd introduction to the POSIX.1e/NFSv4 ACL security API .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -42,13 +42,15 @@ .Fx permits file systems to export Access Control Lists via the VFS, and provides a library for userland access to and manipulation of these ACLs. -Not all file systems provide support for ACLs, and some may require that +.Fx +supports POSIX.1e and NFSv4 ACLs, but +not all file systems provide support for ACLs, and some may require that ACL support be explicitly enabled by the administrator. The library calls include routines to allocate, duplicate, retrieve, set, and validate ACLs associated with file objects. As well as the POSIX.1e routines, there are a number of non-portable -extensions defined that allow for alternative ACL semantics than the -POSIX.1e semantics, such as NFSv4, AFS, NTFS, Coda, and NWFS semantics. +extensions defined that allow for ACL semantics alternative to +POSIX.1e, such as NFSv4. Where routines are non-standard, they are suffixed with _np to indicate that they are not portable. .Pp @@ -292,6 +294,8 @@ POSIX.1e support was introduced in .Fx 5.0 was the first version to include a complete ACL implementation based on extended attributes for the UFS and UFS2 file systems. +NFSv4 ACL support was introduced in +.Fx 8.0 . .Pp The .Xr getfacl 1 From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 10:59:58 2014 Return-Path: Delivered-To: svn-src-all@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 AE833B3A; Thu, 30 Oct 2014 10:59: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 9B0DD956; Thu, 30 Oct 2014 10:59: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 s9UAxwTi055813; Thu, 30 Oct 2014 10:59:58 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UAxwAg055812; Thu, 30 Oct 2014 10:59:58 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201410301059.s9UAxwAg055812@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 30 Oct 2014 10:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273855 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 10:59:58 -0000 Author: ae Date: Thu Oct 30 10:59:57 2014 New Revision: 273855 URL: https://svnweb.freebsd.org/changeset/base/273855 Log: Fix mbuf leak in IPv6 multicast code. When multicast capable interface goes away, it leaves multicast groups, this leads to generate MLD reports, but MLD code does deffered send and MLD reports are queued in the in6_multi's in6m_scq ifq. The problem is that in6_multi structures are freed when interface leaves multicast groups and thread that does deffered send will not take these queued packets. PR: 194577 MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netinet6/in6_mcast.c Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Thu Oct 30 10:56:38 2014 (r273854) +++ head/sys/netinet6/in6_mcast.c Thu Oct 30 10:59:57 2014 (r273855) @@ -526,6 +526,9 @@ in6m_release_locked(struct in6_multi *in in6m_purge(inm); + /* Free state-change requests that might be queued. */ + _IF_DRAIN(&inm->in6m_scq); + free(inm, M_IP6MADDR); if_delmulti_ifma(ifma); From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 11:27:04 2014 Return-Path: Delivered-To: svn-src-all@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 836E1296; Thu, 30 Oct 2014 11:27: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 64DBEC40; Thu, 30 Oct 2014 11:27: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 s9UBR4Ke069566; Thu, 30 Oct 2014 11:27:04 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UBR3Rn069564; Thu, 30 Oct 2014 11:27:03 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201410301127.s9UBR3Rn069564@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Thu, 30 Oct 2014 11:27:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273856 - head/sys/dev/agp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 11:27:04 -0000 Author: tijl Date: Thu Oct 30 11:27:03 2014 New Revision: 273856 URL: https://svnweb.freebsd.org/changeset/base/273856 Log: Add two new functions to the AGP driver KPI to bind/unbind arbitrary sets of pages into the GTT. Reviewed by: kib MFC after: 1 month Modified: head/sys/dev/agp/agp.c head/sys/dev/agp/agpvar.h Modified: head/sys/dev/agp/agp.c ============================================================================== --- head/sys/dev/agp/agp.c Thu Oct 30 10:59:57 2014 (r273855) +++ head/sys/dev/agp/agp.c Thu Oct 30 11:27:03 2014 (r273856) @@ -996,3 +996,76 @@ void agp_memory_info(device_t dev, void mi->ami_offset = mem->am_offset; mi->ami_is_bound = mem->am_is_bound; } + +int +agp_bind_pages(device_t dev, vm_page_t *pages, vm_size_t size, + vm_offset_t offset) +{ + struct agp_softc *sc; + vm_offset_t i, j, k, pa; + vm_page_t m; + int error; + + if ((size & (AGP_PAGE_SIZE - 1)) != 0 || + (offset & (AGP_PAGE_SIZE - 1)) != 0) + return (EINVAL); + + sc = device_get_softc(dev); + + mtx_lock(&sc->as_lock); + for (i = 0; i < size; i += PAGE_SIZE) { + m = pages[OFF_TO_IDX(i)]; + + /* + * Install entries in the GATT, making sure that if + * AGP_PAGE_SIZE < PAGE_SIZE and size is not + * aligned to PAGE_SIZE, we don't modify too many GATT + * entries. + */ + for (j = 0; j < PAGE_SIZE && i + j < size; j += AGP_PAGE_SIZE) { + pa = VM_PAGE_TO_PHYS(m) + j; + AGP_DPF("binding offset %#jx to pa %#jx\n", + (uintmax_t)offset + i + j, (uintmax_t)pa); + error = AGP_BIND_PAGE(dev, offset + i + j, pa); + if (error) { + /* + * Bail out. Reverse all the mappings. + */ + for (k = 0; k < i + j; k += AGP_PAGE_SIZE) + AGP_UNBIND_PAGE(dev, offset + k); + + mtx_unlock(&sc->as_lock); + return (error); + } + } + } + + agp_flush_cache(); + AGP_FLUSH_TLB(dev); + + mtx_unlock(&sc->as_lock); + return (0); +} + +int +agp_unbind_pages(device_t dev, vm_size_t size, vm_offset_t offset) +{ + struct agp_softc *sc; + vm_offset_t i; + + if ((size & (AGP_PAGE_SIZE - 1)) != 0 || + (offset & (AGP_PAGE_SIZE - 1)) != 0) + return (EINVAL); + + sc = device_get_softc(dev); + + mtx_lock(&sc->as_lock); + for (i = 0; i < size; i += AGP_PAGE_SIZE) + AGP_UNBIND_PAGE(dev, offset + i); + + agp_flush_cache(); + AGP_FLUSH_TLB(dev); + + mtx_unlock(&sc->as_lock); + return (0); +} Modified: head/sys/dev/agp/agpvar.h ============================================================================== --- head/sys/dev/agp/agpvar.h Thu Oct 30 10:59:57 2014 (r273855) +++ head/sys/dev/agp/agpvar.h Thu Oct 30 11:27:03 2014 (r273856) @@ -122,6 +122,19 @@ int agp_unbind_memory(device_t dev, void */ void agp_memory_info(device_t dev, void *handle, struct agp_memory_info *mi); +/* + * Bind a set of pages at a given offset within the AGP aperture. + * Returns EINVAL if the given size or offset is not at an AGP page boundary. + */ +int agp_bind_pages(device_t dev, vm_page_t *pages, vm_size_t size, + vm_offset_t offset); + +/* + * Unbind a set of pages from the AGP aperture. + * Returns EINVAL if the given size or offset is not at an AGP page boundary. + */ +int agp_unbind_pages(device_t dev, vm_size_t size, vm_offset_t offset); + #define AGP_NORMAL_MEMORY 0 #define AGP_USER_TYPES (1 << 16) From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 11:34:08 2014 Return-Path: Delivered-To: svn-src-all@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 C996F481; Thu, 30 Oct 2014 11:34: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 B6349D22; Thu, 30 Oct 2014 11:34: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 s9UBY81i073849; Thu, 30 Oct 2014 11:34:08 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UBY8LY073848; Thu, 30 Oct 2014 11:34:08 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201410301134.s9UBY8LY073848@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 30 Oct 2014 11:34:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273857 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 11:34:08 -0000 Author: ae Date: Thu Oct 30 11:34:07 2014 New Revision: 273857 URL: https://svnweb.freebsd.org/changeset/base/273857 Log: Move ifq drain into in6m_purge(). Suggested by: bms MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netinet6/in6_mcast.c Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Thu Oct 30 11:27:03 2014 (r273856) +++ head/sys/netinet6/in6_mcast.c Thu Oct 30 11:34:07 2014 (r273857) @@ -526,9 +526,6 @@ in6m_release_locked(struct in6_multi *in in6m_purge(inm); - /* Free state-change requests that might be queued. */ - _IF_DRAIN(&inm->in6m_scq); - free(inm, M_IP6MADDR); if_delmulti_ifma(ifma); @@ -1076,6 +1073,8 @@ in6m_purge(struct in6_multi *inm) free(ims, M_IP6MSOURCE); inm->in6m_nsrc--; } + /* Free state-change requests that might be queued. */ + _IF_DRAIN(&inm->in6m_scq); } /* From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 11:34:30 2014 Return-Path: Delivered-To: svn-src-all@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 6163D5BF for ; Thu, 30 Oct 2014 11:34:30 +0000 (UTC) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (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 2D18CD28 for ; Thu, 30 Oct 2014 11:34:30 +0000 (UTC) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 631DF20721 for ; Thu, 30 Oct 2014 07:34:29 -0400 (EDT) Received: from web6 ([10.202.2.216]) by compute5.internal (MEProxy); Thu, 30 Oct 2014 07:34:29 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= message-id:x-sasl-enc:from:to:mime-version :content-transfer-encoding:content-type:in-reply-to:references :subject:date; s=mesmtp; bh=4mb//SXTalTR6gapDaNTy3invFo=; b=PM6z 2vjlcvnGDdsV2rbQk0il56LRhFVYVsZIQoNAKsR6TULSReAg8Cw0VDlpYUxGqOXj SmouV8cs42qPYrhmgZKnJ+1PTKMHdcHMqay6+XBiDf/XTYJHGxG41/OoI49BCQYl nM7Bb77U4CT+VYxuPFdnB7r+XxaGG56fplbyWOs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:x-sasl-enc:from:to :mime-version:content-transfer-encoding:content-type:in-reply-to :references:subject:date; s=smtpout; bh=4mb//SXTalTR6gapDaNTy3in vFo=; b=oavS6+VeDdacSqhFMXssz1tVFMUSlPSify2+dnCEmmDlM2Ghg1aGsBrl WngJuMa9XEM75h+l6K20Hxi6TVzxcKpC0MQ8wgA3L/JR2Ln9G/DOrdGz/nVHS/3f MNikkzN4v7FNZUhHeH4mwBprWbPYWT6WACy5huNh02yHyCH9f/0= Received: by web6.nyi.internal (Postfix, from userid 99) id 3A62B59472; Thu, 30 Oct 2014 07:34:29 -0400 (EDT) Message-Id: <1414668869.979804.185070381.0D4C866C@webmail.messagingengine.com> X-Sasl-Enc: ZcL4GH+JsAMCish7GYR5qss3M3f4+c0xtrjG4kqeQCO5 1414668869 From: Bruce Simpson To: "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-c51dec4f In-Reply-To: <201410301059.s9UAxwAg055812@svn.freebsd.org> References: <201410301059.s9UAxwAg055812@svn.freebsd.org> Subject: Re: svn commit: r273855 - head/sys/netinet6 Date: Thu, 30 Oct 2014 11:34:29 +0000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 11:34:30 -0000 Hello, This is a really inconvenient time for me (I am up against a deadline) but I am not 100% comfortable with this change. On Thu, 30 Oct 2014, at 10:59, Andrey V. Elsukov wrote: > Log: > Fix mbuf leak in IPv6 multicast code. > When multicast capable interface goes away, it leaves multicast groups, > this leads to generate MLD reports, but MLD code does deffered send and > MLD reports are queued in the in6_multi's in6m_scq ifq. The problem is > that in6_multi structures are freed when interface leaves multicast > groups > and thread that does deffered send will not take these queued packets. A few comments: 1) Stylistic -- a change of this kind should probably be part of inm_purge() itself because it modifies state which is private to the group membership. 2) Logical -- The patch forces pending (queued) state change record fragments to be freed when the parent interface is taken down. Unfortunately, those are pending for a reason; there has been a state change, and MLD needs to communicate it upstream to on-link routers (and snooping switches). So - there is a risk with this approach that upstream MLD listener (e.g. router, switch) will be inconsistent, at least until the next General Query. A better approach might be to force an INCLUDE {} to be sent for the group (there are other parts of the code which try to do this for similar events), but if the parent interface has already been taken down, all bets are off. As of writing - The FreeBSD networking stack doesn't provide any hints either way about the nature of the teardown. Perhaps need to be a distinction between use cases where a hasty teardown is unlikely to have operational impact (e.g. an ephemeral VPN session between two nodes which is point-to-point in nature, and not generally used for forwarding traffic), and cases where it may impact other users (e.g. an MLD membership residing on a wireless interface, which might result in unwanted multicast traffic being relayed to an 802.11 ESS). -- BMS (sent via webmail) From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 12:44:47 2014 Return-Path: Delivered-To: svn-src-all@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 5BF6D321; Thu, 30 Oct 2014 12:44: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 3D19F6DD; Thu, 30 Oct 2014 12:44: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 s9UCilKG008811; Thu, 30 Oct 2014 12:44:47 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UCiljl008810; Thu, 30 Oct 2014 12:44:47 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201410301244.s9UCiljl008810@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 30 Oct 2014 12:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273858 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 12:44:47 -0000 Author: ae Date: Thu Oct 30 12:44:46 2014 New Revision: 273858 URL: https://svnweb.freebsd.org/changeset/base/273858 Log: Remove redundant code. if_detach already did these steps. Also, now we didn't keep routes to link-local addresses. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: head/sys/netinet6/in6_ifattach.c Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Thu Oct 30 11:34:07 2014 (r273857) +++ head/sys/netinet6/in6_ifattach.c Thu Oct 30 12:44:46 2014 (r273858) @@ -775,12 +775,7 @@ in6_ifattach(struct ifnet *ifp, struct i void in6_ifdetach(struct ifnet *ifp) { - struct in6_ifaddr *ia; struct ifaddr *ifa, *next; - struct radix_node_head *rnh; - struct rtentry *rt; - struct sockaddr_in6 sin6; - struct in6_multi_mship *imm; if (ifp->if_afdata[AF_INET6] == NULL) return; @@ -788,46 +783,15 @@ in6_ifdetach(struct ifnet *ifp) /* remove neighbor management table */ nd6_purge(ifp); - /* nuke any of IPv6 addresses we have */ + /* + * nuke any of IPv6 addresses we have + * XXX: all addresses should be already removed + */ TAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, next) { if (ifa->ifa_addr->sa_family != AF_INET6) continue; in6_purgeaddr(ifa); } - - /* undo everything done by in6_ifattach(), just in case */ - TAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, next) { - if (ifa->ifa_addr->sa_family != AF_INET6 - || !IN6_IS_ADDR_LINKLOCAL(&satosin6(&ifa->ifa_addr)->sin6_addr)) { - continue; - } - - ia = (struct in6_ifaddr *)ifa; - - /* - * leave from multicast groups we have joined for the interface - */ - while ((imm = LIST_FIRST(&ia->ia6_memberships)) != NULL) { - LIST_REMOVE(imm, i6mm_chain); - in6_leavegroup(imm); - } - - /* Remove link-local from the routing table. */ - if (ia->ia_flags & IFA_ROUTE) - (void)rtinit(&ia->ia_ifa, RTM_DELETE, ia->ia_flags); - - /* remove from the linked list */ - IF_ADDR_WLOCK(ifp); - TAILQ_REMOVE(&ifp->if_addrhead, ifa, ifa_link); - IF_ADDR_WUNLOCK(ifp); - ifa_free(ifa); /* if_addrhead */ - - IN6_IFADDR_WLOCK(); - TAILQ_REMOVE(&V_in6_ifaddrhead, ia, ia_link); - IN6_IFADDR_WUNLOCK(); - ifa_free(ifa); - } - in6_pcbpurgeif0(&V_udbinfo, ifp); in6_pcbpurgeif0(&V_ulitecbinfo, ifp); in6_pcbpurgeif0(&V_ripcbinfo, ifp); @@ -843,31 +807,6 @@ in6_ifdetach(struct ifnet *ifp) * (Or can we just delay calling nd6_purge until at this point?) */ nd6_purge(ifp); - - /* - * Remove route to link-local allnodes multicast (ff02::1). - * These only get automatically installed for the default FIB. - */ - bzero(&sin6, sizeof(sin6)); - sin6.sin6_len = sizeof(struct sockaddr_in6); - sin6.sin6_family = AF_INET6; - sin6.sin6_addr = in6addr_linklocal_allnodes; - if (in6_setscope(&sin6.sin6_addr, ifp, NULL)) - /* XXX: should not fail */ - return; - /* XXX grab lock first to avoid LOR */ - rnh = rt_tables_get_rnh(RT_DEFAULT_FIB, AF_INET6); - if (rnh != NULL) { - RADIX_NODE_HEAD_LOCK(rnh); - rt = in6_rtalloc1((struct sockaddr *)&sin6, 0, RTF_RNH_LOCKED, - RT_DEFAULT_FIB); - if (rt) { - if (rt->rt_ifp == ifp) - rt_expunge(rnh, rt); - RTFREE_LOCKED(rt); - } - RADIX_NODE_HEAD_UNLOCK(rnh); - } } int From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 13:53:58 2014 Return-Path: Delivered-To: svn-src-all@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 593C7205; Thu, 30 Oct 2014 13:53: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 4517EDB4; Thu, 30 Oct 2014 13:53: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 s9UDrwtq041577; Thu, 30 Oct 2014 13:53:58 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UDrvTu041575; Thu, 30 Oct 2014 13:53:57 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201410301353.s9UDrvTu041575@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 30 Oct 2014 13:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273859 - in stable/10/sys: net netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 13:53:58 -0000 Author: ae Date: Thu Oct 30 13:53:57 2014 New Revision: 273859 URL: https://svnweb.freebsd.org/changeset/base/273859 Log: MFC r272770: When tunneling interface is going to insert mbuf into netisr queue after stripping outer header, consider it as new packet and clear the protocols flags. This fixes problems when IPSEC traffic goes through various tunnels and router doesn't send ICMP/ICMPv6 errors. PR: 174602 Sponsored by: Yandex LLC Modified: stable/10/sys/net/if_gif.c stable/10/sys/netinet/ip_gre.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if_gif.c ============================================================================== --- stable/10/sys/net/if_gif.c Thu Oct 30 12:44:46 2014 (r273858) +++ stable/10/sys/net/if_gif.c Thu Oct 30 13:53:57 2014 (r273859) @@ -546,6 +546,7 @@ gif_input(m, af, ifp) } sc = ifp->if_softc; m->m_pkthdr.rcvif = ifp; + m_clrprotoflags(m); #ifdef MAC mac_ifnet_create_mbuf(ifp, m); Modified: stable/10/sys/netinet/ip_gre.c ============================================================================== --- stable/10/sys/netinet/ip_gre.c Thu Oct 30 12:44:46 2014 (r273858) +++ stable/10/sys/netinet/ip_gre.c Thu Oct 30 13:53:57 2014 (r273859) @@ -211,7 +211,7 @@ gre_input2(struct mbuf *m ,int hlen, u_c } m->m_pkthdr.rcvif = GRE2IFP(sc); - + m_clrprotoflags(m); netisr_queue(isr, m); /* Packet is done, no further processing needed. */ From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 13:59:30 2014 Return-Path: Delivered-To: svn-src-all@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 205CF3D7; Thu, 30 Oct 2014 13:59: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 0C908DF9; Thu, 30 Oct 2014 13:59: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 s9UDxTFn042416; Thu, 30 Oct 2014 13:59:29 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UDxTOS042414; Thu, 30 Oct 2014 13:59:29 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201410301359.s9UDxTOS042414@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 30 Oct 2014 13:59:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r273860 - in stable/9/sys: net netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 13:59:30 -0000 Author: ae Date: Thu Oct 30 13:59:28 2014 New Revision: 273860 URL: https://svnweb.freebsd.org/changeset/base/273860 Log: MFC r272770 (modified version): When tunneling interface is going to insert mbuf into netisr queue after stripping outer header, consider it as new packet and clear the protocols flags. This fixes problems when IPSEC traffic goes through various tunnels and router doesn't send ICMP/ICMPv6 errors. PR: 174602 Sponsored by: Yandex LLC Modified: stable/9/sys/net/if_gif.c stable/9/sys/netinet/ip_gre.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/net/ (props changed) Modified: stable/9/sys/net/if_gif.c ============================================================================== --- stable/9/sys/net/if_gif.c Thu Oct 30 13:53:57 2014 (r273859) +++ stable/9/sys/net/if_gif.c Thu Oct 30 13:59:28 2014 (r273860) @@ -500,6 +500,7 @@ gif_input(m, af, ifp) } sc = ifp->if_softc; m->m_pkthdr.rcvif = ifp; + m->m_flags &= ~(M_PROTOFLAGS); #ifdef MAC mac_ifnet_create_mbuf(ifp, m); Modified: stable/9/sys/netinet/ip_gre.c ============================================================================== --- stable/9/sys/netinet/ip_gre.c Thu Oct 30 13:53:57 2014 (r273859) +++ stable/9/sys/netinet/ip_gre.c Thu Oct 30 13:59:28 2014 (r273860) @@ -211,7 +211,7 @@ gre_input2(struct mbuf *m ,int hlen, u_c } m->m_pkthdr.rcvif = GRE2IFP(sc); - + m->m_flags &= ~(M_PROTOFLAGS); netisr_queue(isr, m); /* Packet is done, no further processing needed. */ From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 14:05:49 2014 Return-Path: Delivered-To: svn-src-all@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 B344E70C; Thu, 30 Oct 2014 14:05: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 9F990ECB; Thu, 30 Oct 2014 14:05: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 s9UE5ng2046897; Thu, 30 Oct 2014 14:05:49 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UE5nUO046896; Thu, 30 Oct 2014 14:05:49 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410301405.s9UE5nUO046896@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 30 Oct 2014 14:05:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273861 - head/sbin/mount_nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 14:05:49 -0000 Author: trasz Date: Thu Oct 30 14:05:48 2014 New Revision: 273861 URL: https://svnweb.freebsd.org/changeset/base/273861 Log: Remove two functions unused after r273848. Would be nice if clang or at least scan-build yelled about it. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sbin/mount_nfs/mount_nfs.c Modified: head/sbin/mount_nfs/mount_nfs.c ============================================================================== --- head/sbin/mount_nfs/mount_nfs.c Thu Oct 30 13:59:28 2014 (r273860) +++ head/sbin/mount_nfs/mount_nfs.c Thu Oct 30 14:05:48 2014 (r273861) @@ -477,35 +477,6 @@ main(int argc, char *argv[]) } static int -findopt(struct iovec *iov, int iovlen, const char *name, - char **valuep, int *lenp) -{ - int i; - - for (i = 0; i < iovlen/2; i++, iov += 2) { - if (strcmp(name, iov[0].iov_base) == 0) { - if (valuep) - *valuep = iov[1].iov_base; - if (lenp) - *lenp = iov[1].iov_len; - return (0); - } - } - return (ENOENT); -} - -static void -copyopt(struct iovec **newiov, int *newiovlen, - struct iovec *iov, int iovlen, const char *name) -{ - char *value; - int len; - - if (findopt(iov, iovlen, name, &value, &len) == 0) - build_iovec(newiov, newiovlen, name, value, len); -} - -static int sec_name_to_num(char *sec) { if (!strcmp(sec, "krb5")) From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 14:26:39 2014 Return-Path: Delivered-To: svn-src-all@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 23FADCB7; Thu, 30 Oct 2014 14:26: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 05320135; Thu, 30 Oct 2014 14:26: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 s9UEQcu1056782; Thu, 30 Oct 2014 14:26:38 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UEQbKE056775; Thu, 30 Oct 2014 14:26:37 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201410301426.s9UEQbKE056775@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Thu, 30 Oct 2014 14:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273862 - in head/sys/dev/drm2: . radeon ttm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 14:26:39 -0000 Author: tijl Date: Thu Oct 30 14:26:36 2014 New Revision: 273862 URL: https://svnweb.freebsd.org/changeset/base/273862 Log: Port the TTM AGP backend to the FreeBSD agp driver and enable AGP support in the radeonkms driver. Note: In PCI mode virtual addresses on the graphics card that map to system RAM are translated to physical addresses by the graphics card itself. In AGP mode address translation is done by the AGP chipset so fictitious addresses appear on the system bus. For the CPU cache management to work correctly when the CPU accesses this memory it needs to use the same fictitious addresses (and let the chipset translate them) instead of using the physical addresses directly. Reviewed by: kib MFC after: 1 month Modified: head/sys/dev/drm2/drm_agpsupport.c head/sys/dev/drm2/radeon/radeon.h head/sys/dev/drm2/radeon/radeon_device.c head/sys/dev/drm2/radeon/radeon_ttm.c head/sys/dev/drm2/ttm/ttm_agp_backend.c head/sys/dev/drm2/ttm/ttm_bo_driver.h head/sys/dev/drm2/ttm/ttm_page_alloc.c Modified: head/sys/dev/drm2/drm_agpsupport.c ============================================================================== --- head/sys/dev/drm2/drm_agpsupport.c Thu Oct 30 14:05:48 2014 (r273861) +++ head/sys/dev/drm2/drm_agpsupport.c Thu Oct 30 14:26:36 2014 (r273862) @@ -396,7 +396,7 @@ void *drm_agp_allocate_memory(size_t pag if (!agpdev) return NULL; - return agp_alloc_memory(agpdev, type, pages << AGP_PAGE_SHIFT); + return agp_alloc_memory(agpdev, type, pages << PAGE_SHIFT); } int drm_agp_free_memory(void *handle) Modified: head/sys/dev/drm2/radeon/radeon.h ============================================================================== --- head/sys/dev/drm2/radeon/radeon.h Thu Oct 30 14:05:48 2014 (r273861) +++ head/sys/dev/drm2/radeon/radeon.h Thu Oct 30 14:26:36 2014 (r273862) @@ -1618,6 +1618,7 @@ struct radeon_device { bool need_dma32; bool accel_working; bool fictitious_range_registered; + bool fictitious_agp_range_registered; struct radeon_surface_reg surface_regs[RADEON_GEM_MAX_SURFACES]; const struct firmware *me_fw; /* all family ME firmware */ const struct firmware *pfp_fw; /* r6/700 PFP firmware */ Modified: head/sys/dev/drm2/radeon/radeon_device.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_device.c Thu Oct 30 14:05:48 2014 (r273861) +++ head/sys/dev/drm2/radeon/radeon_device.c Thu Oct 30 14:26:36 2014 (r273862) @@ -1014,6 +1014,7 @@ int radeon_device_init(struct radeon_dev rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024; rdev->accel_working = false; rdev->fictitious_range_registered = false; + rdev->fictitious_agp_range_registered = false; /* set up ring ids */ for (i = 0; i < RADEON_NUM_RINGS; i++) { rdev->ring[i].idx = i; @@ -1168,6 +1169,24 @@ int radeon_device_init(struct radeon_dev return (-r); } rdev->fictitious_range_registered = true; +#if __OS_HAS_AGP + if (rdev->flags & RADEON_IS_AGP) { + DRM_INFO("%s: Taking over the fictitious range 0x%jx-0x%jx\n", + __func__, (uintmax_t)rdev->mc.agp_base, + (uintmax_t)rdev->mc.agp_base + rdev->mc.gtt_size); + r = vm_phys_fictitious_reg_range( + rdev->mc.agp_base, + rdev->mc.agp_base + rdev->mc.gtt_size, + VM_MEMATTR_WRITE_COMBINING); + if (r != 0) { + DRM_ERROR("Failed to register fictitious range " + "0x%jx-0x%jx (%d).\n", (uintmax_t)rdev->mc.agp_base, + (uintmax_t)rdev->mc.agp_base + rdev->mc.gtt_size, r); + return (-r); + } + rdev->fictitious_agp_range_registered = true; + } +#endif if ((radeon_testing & 1)) { radeon_test_moves(rdev); @@ -1205,6 +1224,13 @@ void radeon_device_fini(struct radeon_de rdev->mc.aper_base, rdev->mc.aper_base + rdev->mc.visible_vram_size); } +#if __OS_HAS_AGP + if (rdev->fictitious_agp_range_registered) { + vm_phys_fictitious_unreg_range( + rdev->mc.agp_base, + rdev->mc.agp_base + rdev->mc.gtt_size); + } +#endif radeon_fini(rdev); #ifdef DUMBBELL_WIP Modified: head/sys/dev/drm2/radeon/radeon_ttm.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_ttm.c Thu Oct 30 14:05:48 2014 (r273861) +++ head/sys/dev/drm2/radeon/radeon_ttm.c Thu Oct 30 14:26:36 2014 (r273862) @@ -560,12 +560,10 @@ static struct ttm_tt *radeon_ttm_tt_crea rdev = radeon_get_rdev(bdev); #if __OS_HAS_AGP -#ifdef DUMBBELL_WIP if (rdev->flags & RADEON_IS_AGP) { return ttm_agp_tt_create(bdev, rdev->ddev->agp->agpdev, size, page_flags, dummy_read_page); } -#endif /* DUMBBELL_WIP */ #endif gtt = malloc(sizeof(struct radeon_ttm_tt), @@ -610,11 +608,9 @@ static int radeon_ttm_tt_populate(struct rdev = radeon_get_rdev(ttm->bdev); #if __OS_HAS_AGP -#ifdef DUMBBELL_WIP if (rdev->flags & RADEON_IS_AGP) { return ttm_agp_tt_populate(ttm); } -#endif /* DUMBBELL_WIP */ #endif #ifdef CONFIG_SWIOTLB @@ -660,12 +656,10 @@ static void radeon_ttm_tt_unpopulate(str rdev = radeon_get_rdev(ttm->bdev); #if __OS_HAS_AGP -#ifdef DUMBBELL_WIP if (rdev->flags & RADEON_IS_AGP) { ttm_agp_tt_unpopulate(ttm); return; } -#endif /* DUMBBELL_WIP */ #endif #ifdef CONFIG_SWIOTLB Modified: head/sys/dev/drm2/ttm/ttm_agp_backend.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_agp_backend.c Thu Oct 30 14:05:48 2014 (r273861) +++ head/sys/dev/drm2/ttm/ttm_agp_backend.c Thu Oct 30 14:26:36 2014 (r273862) @@ -41,7 +41,8 @@ __FBSDID("$FreeBSD$"); struct ttm_agp_backend { struct ttm_tt ttm; - struct agp_memory *mem; + vm_offset_t offset; + vm_page_t *pages; device_t bridge; }; @@ -51,31 +52,23 @@ static int ttm_agp_bind(struct ttm_tt *t { struct ttm_agp_backend *agp_be = container_of(ttm, struct ttm_agp_backend, ttm); struct drm_mm_node *node = bo_mem->mm_node; - struct agp_memory *mem; - int ret, cached = (bo_mem->placement & TTM_PL_FLAG_CACHED); + int ret; unsigned i; - mem = agp_alloc_memory(agp_be->bridge, AGP_USER_MEMORY, ttm->num_pages); - if (unlikely(mem == NULL)) - return -ENOMEM; - - mem->page_count = 0; for (i = 0; i < ttm->num_pages; i++) { vm_page_t page = ttm->pages[i]; if (!page) page = ttm->dummy_read_page; - mem->pages[mem->page_count++] = page; + agp_be->pages[i] = page; } - agp_be->mem = mem; - - mem->is_flushed = 1; - mem->type = (cached) ? AGP_USER_CACHED_MEMORY : AGP_USER_MEMORY; - ret = agp_bind_memory(mem, node->start); + agp_be->offset = node->start * PAGE_SIZE; + ret = -agp_bind_pages(agp_be->bridge, agp_be->pages, + ttm->num_pages << PAGE_SHIFT, agp_be->offset); if (ret) - pr_err("AGP Bind memory failed\n"); + printf("[TTM] AGP Bind memory failed\n"); return ret; } @@ -84,22 +77,16 @@ static int ttm_agp_unbind(struct ttm_tt { struct ttm_agp_backend *agp_be = container_of(ttm, struct ttm_agp_backend, ttm); - if (agp_be->mem) { - if (agp_be->mem->is_bound) - return agp_unbind_memory(agp_be->mem); - agp_free_memory(agp_be->mem); - agp_be->mem = NULL; - } - return 0; + return -agp_unbind_pages(agp_be->bridge, ttm->num_pages << PAGE_SHIFT, + agp_be->offset); } static void ttm_agp_destroy(struct ttm_tt *ttm) { struct ttm_agp_backend *agp_be = container_of(ttm, struct ttm_agp_backend, ttm); - if (agp_be->mem) - ttm_agp_unbind(ttm); ttm_tt_fini(ttm); + free(agp_be->pages, M_TTM_AGP); free(agp_be, M_TTM_AGP); } @@ -118,14 +105,18 @@ struct ttm_tt *ttm_agp_tt_create(struct agp_be = malloc(sizeof(*agp_be), M_TTM_AGP, M_WAITOK | M_ZERO); - agp_be->mem = NULL; agp_be->bridge = bridge; agp_be->ttm.func = &ttm_agp_func; if (ttm_tt_init(&agp_be->ttm, bdev, size, page_flags, dummy_read_page)) { + free(agp_be, M_TTM_AGP); return NULL; } + agp_be->offset = 0; + agp_be->pages = malloc(agp_be->ttm.num_pages * sizeof(*agp_be->pages), + M_TTM_AGP, M_WAITOK); + return &agp_be->ttm; } Modified: head/sys/dev/drm2/ttm/ttm_bo_driver.h ============================================================================== --- head/sys/dev/drm2/ttm/ttm_bo_driver.h Thu Oct 30 14:05:48 2014 (r273861) +++ head/sys/dev/drm2/ttm/ttm_bo_driver.h Thu Oct 30 14:26:36 2014 (r273862) @@ -990,9 +990,8 @@ extern vm_memattr_t ttm_io_prot(uint32_t extern const struct ttm_mem_type_manager_func ttm_bo_manager_func; -#if (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE))) +#if __OS_HAS_AGP #define TTM_HAS_AGP -#include /** * ttm_agp_tt_create @@ -1009,7 +1008,7 @@ extern const struct ttm_mem_type_manager * bind and unbind memory backing a ttm_tt. */ extern struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev, - struct agp_bridge_data *bridge, + device_t bridge, unsigned long size, uint32_t page_flags, struct vm_page *dummy_read_page); int ttm_agp_tt_populate(struct ttm_tt *ttm); Modified: head/sys/dev/drm2/ttm/ttm_page_alloc.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_page_alloc.c Thu Oct 30 14:05:48 2014 (r273861) +++ head/sys/dev/drm2/ttm/ttm_page_alloc.c Thu Oct 30 14:26:36 2014 (r273862) @@ -45,10 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef TTM_HAS_AGP -#include -#endif - #define NUM_PAGES_TO_ALLOC (PAGE_SIZE/sizeof(vm_page_t)) #define SMALL_ALLOCATION 16 #define FREE_ALL_PAGES (~0U) @@ -220,46 +216,34 @@ static struct ttm_pool_manager *_manager static int set_pages_array_wb(vm_page_t *pages, int addrinarray) { - vm_page_t m; +#ifdef TTM_HAS_AGP int i; - for (i = 0; i < addrinarray; i++) { - m = pages[i]; -#ifdef TTM_HAS_AGP - unmap_page_from_agp(m); + for (i = 0; i < addrinarray; i++) + pmap_page_set_memattr(pages[i], VM_MEMATTR_WRITE_BACK); #endif - pmap_page_set_memattr(m, VM_MEMATTR_WRITE_BACK); - } return 0; } static int set_pages_array_wc(vm_page_t *pages, int addrinarray) { - vm_page_t m; +#ifdef TTM_HAS_AGP int i; - for (i = 0; i < addrinarray; i++) { - m = pages[i]; -#ifdef TTM_HAS_AGP - map_page_into_agp(pages[i]); + for (i = 0; i < addrinarray; i++) + pmap_page_set_memattr(pages[i], VM_MEMATTR_WRITE_COMBINING); #endif - pmap_page_set_memattr(m, VM_MEMATTR_WRITE_COMBINING); - } return 0; } static int set_pages_array_uc(vm_page_t *pages, int addrinarray) { - vm_page_t m; +#ifdef TTM_HAS_AGP int i; - for (i = 0; i < addrinarray; i++) { - m = pages[i]; -#ifdef TTM_HAS_AGP - map_page_into_agp(pages[i]); + for (i = 0; i < addrinarray; i++) + pmap_page_set_memattr(pages[i], VM_MEMATTR_UNCACHEABLE); #endif - pmap_page_set_memattr(m, VM_MEMATTR_UNCACHEABLE); - } return 0; } From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 14:36:28 2014 Return-Path: Delivered-To: svn-src-all@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 A53B2ED5; Thu, 30 Oct 2014 14:36: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 91E71225; Thu, 30 Oct 2014 14:36: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 s9UEaSHW061651; Thu, 30 Oct 2014 14:36:28 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UEaSHC061650; Thu, 30 Oct 2014 14:36:28 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201410301436.s9UEaSHC061650@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Thu, 30 Oct 2014 14:36:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273863 - head/sys/dev/agp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 14:36:28 -0000 Author: tijl Date: Thu Oct 30 14:36:27 2014 New Revision: 273863 URL: https://svnweb.freebsd.org/changeset/base/273863 Log: Avoid possible overflow in agp_generic_alloc_memory. MFC after: 1 week Modified: head/sys/dev/agp/agp.c Modified: head/sys/dev/agp/agp.c ============================================================================== --- head/sys/dev/agp/agp.c Thu Oct 30 14:26:36 2014 (r273862) +++ head/sys/dev/agp/agp.c Thu Oct 30 14:36:27 2014 (r273863) @@ -485,7 +485,7 @@ agp_generic_alloc_memory(device_t dev, i if ((size & (AGP_PAGE_SIZE - 1)) != 0) return 0; - if (sc->as_allocated + size > sc->as_maxmem) + if (size > sc->as_maxmem - sc->as_allocated) return 0; if (type != 0) { From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 14:43:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7B272E4; Thu, 30 Oct 2014 14:43:11 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id C82651900; Thu, 30 Oct 2014 14:43:10 +0000 (UTC) Message-ID: <54524E7A.1020802@FreeBSD.org> Date: Thu, 30 Oct 2014 17:43:06 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Bruce Simpson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r273855 - head/sys/netinet6 References: <201410301059.s9UAxwAg055812@svn.freebsd.org> <1414668869.979804.185070381.0D4C866C@webmail.messagingengine.com> In-Reply-To: <1414668869.979804.185070381.0D4C866C@webmail.messagingengine.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 14:43:12 -0000 On 30.10.2014 14:34, Bruce Simpson wrote: > Hello, > > This is a really inconvenient time for me (I am up against a deadline) > but I am not 100% comfortable with this change. > > On Thu, 30 Oct 2014, at 10:59, Andrey V. Elsukov wrote: >> Log: >> Fix mbuf leak in IPv6 multicast code. >> When multicast capable interface goes away, it leaves multicast groups, >> this leads to generate MLD reports, but MLD code does deffered send and >> MLD reports are queued in the in6_multi's in6m_scq ifq. The problem is >> that in6_multi structures are freed when interface leaves multicast >> groups >> and thread that does deffered send will not take these queued packets. > > A few comments: > > 1) Stylistic -- a change of this kind should probably be part of > inm_purge() itself because it modifies state which is private to the > group membership. > > 2) Logical -- The patch forces pending (queued) state change record > fragments to be freed when the parent interface is taken down. > Unfortunately, those are pending for a reason; there has been a state > change, and MLD needs to communicate it upstream to on-link routers (and > snooping switches). > > So - there is a risk with this approach that upstream MLD listener (e.g. > router, switch) will be inconsistent, at least until the next General > Query. I'm not quite sure, but I think that the leak happened only when interface disappeared. In case when system just leaves the group, MLD code takes reference to in6_multi and releases it when fasttimo handler dispatches packets. When interface is disappearing, in6_ifdetach() calls in6_purgemaddrs(), where all references to in6_multi released again. Now in6m_release_locked() will drain queue when in6_multi has no more references. -- WBR, Andrey V. Elsukov From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 14:47:23 2014 Return-Path: Delivered-To: svn-src-all@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 825554A7; Thu, 30 Oct 2014 14:47:23 +0000 (UTC) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4DB234D; Thu, 30 Oct 2014 14:47:22 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id q5so1364316wiv.5 for ; Thu, 30 Oct 2014 07:47:21 -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=z50LIWR5Ws2ed1nI3cws1iEWthar1FxACcFOy/CCJkY=; b=QcFCb5oxVqFW/m4hqDkdA6+lzjSalg0ZMo2eFwAXJxYLm8FJEvVTfqXm1ijakWCxHp xpHxlNS1ofw08rSJmn5W+D0ffFFnkSlESzffgxzLjo8QtNefJswLjAIbLkSr+LiL8dS8 gNE+ftvdPQVYNJmwTIV3H6XdWZAPfdPc6bsGrBZeVxxOdiIAjtEqoqXZhnlZIeCIlQYa ply5Zf4RYxdZKrlExSQh/4PVJHz+G5dT49m15BqvqZU4/pmYrKvuXHxb1A+1PH/FAHjg DhkELOEX54RpoguVDSedomhJjqxuYwFBLE4PaQ/RohF62k9mEIQuD169PjIQDzN7tJ3l fQ4Q== MIME-Version: 1.0 X-Received: by 10.180.9.103 with SMTP id y7mr2723535wia.5.1414680440582; Thu, 30 Oct 2014 07:47:20 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.216.53.68 with HTTP; Thu, 30 Oct 2014 07:47:20 -0700 (PDT) In-Reply-To: <201410301405.s9UE5nUO046896@svn.freebsd.org> References: <201410301405.s9UE5nUO046896@svn.freebsd.org> Date: Thu, 30 Oct 2014 18:47:20 +0400 X-Google-Sender-Auth: 3WvVv-ZdnWZK5PGg4hoOjtc-PgU Message-ID: Subject: Re: svn commit: r273861 - head/sbin/mount_nfs From: Sergey Kandaurov To: Edward Tomasz Napierala Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 14:47:23 -0000 On 30 October 2014 17:05, Edward Tomasz Napierala wrote: > Author: trasz > Date: Thu Oct 30 14:05:48 2014 > New Revision: 273861 > URL: https://svnweb.freebsd.org/changeset/base/273861 > > Log: > Remove two functions unused after r273848. Would be nice if clang > or at least scan-build yelled about it. It does but with WARNS=3, -Wunused-function is disabled. -- wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 15:41:30 2014 Return-Path: Delivered-To: svn-src-all@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 AD701265; Thu, 30 Oct 2014 15:41: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 93ACEB3D; Thu, 30 Oct 2014 15:41: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 s9UFfU3V093779; Thu, 30 Oct 2014 15:41:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UFfQ1P093755; Thu, 30 Oct 2014 15:41:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410301541.s9UFfQ1P093755@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 30 Oct 2014 15:41:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r273864 - in stable/9: contrib/ofed/libibverbs/examples contrib/ofed/libmlx4/src contrib/ofed/libsdp/src/linux contrib/ofed/management/infiniband-diags/src contrib/ofed/management/opens... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 15:41:30 -0000 Author: hselasky Date: Thu Oct 30 15:41:25 2014 New Revision: 273864 URL: https://svnweb.freebsd.org/changeset/base/273864 Log: MFC r254122, r254123, r256116, r255970, r247671, r269861, r268314, r256269, r255969, r256179, r230135, r254121, r255932, r255972, r255973, r256281, r256470, r257867, r259608, r269862, r271127, r272407, r257864, r256682, r258276, r254734, r247675, r254735 and r272683: Hardware driver update from Mellanox Technologies, including: - improved performance - better stability - new features - bugfixes Supported HCAs: - ConnectX-2 - ConnectX-3 - ConnectX-3 Pro NOTE: - TSO feature needs r271946, which is not yet merged. Sponsored by: Mellanox Technologies Added: stable/9/sys/modules/ibcore/ - copied from r255932, head/sys/modules/ibcore/ stable/9/sys/modules/ipoib/ - copied from r255932, head/sys/modules/ipoib/ stable/9/sys/ofed/drivers/infiniband/hw/mlx4/alias_GUID.c - copied, changed from r255932, head/sys/ofed/drivers/infiniband/hw/mlx4/alias_GUID.c stable/9/sys/ofed/drivers/infiniband/hw/mlx4/cm.c - copied, changed from r255932, head/sys/ofed/drivers/infiniband/hw/mlx4/cm.c stable/9/sys/ofed/drivers/infiniband/hw/mlx4/mcg.c - copied, changed from r255932, head/sys/ofed/drivers/infiniband/hw/mlx4/mcg.c stable/9/sys/ofed/drivers/infiniband/hw/mlx4/sysfs.c - copied, changed from r255932, head/sys/ofed/drivers/infiniband/hw/mlx4/sysfs.c stable/9/sys/ofed/drivers/net/mlx4/mlx4_stats.h - copied unchanged from r272407, stable/10/sys/ofed/drivers/net/mlx4/mlx4_stats.h stable/9/sys/ofed/drivers/net/mlx4/resource_tracker.c - copied, changed from r255932, head/sys/ofed/drivers/net/mlx4/resource_tracker.c stable/9/sys/ofed/drivers/net/mlx4/sys_tune.c - copied, changed from r255932, head/sys/ofed/drivers/net/mlx4/sys_tune.c stable/9/sys/ofed/drivers/net/mlx4/utils.c - copied unchanged from r272407, stable/10/sys/ofed/drivers/net/mlx4/utils.c stable/9/sys/ofed/drivers/net/mlx4/utils.h - copied unchanged from r272407, stable/10/sys/ofed/drivers/net/mlx4/utils.h stable/9/sys/ofed/include/linux/cache.h - copied unchanged from r271127, stable/10/sys/ofed/include/linux/cache.h stable/9/sys/ofed/include/linux/clocksource.h - copied, changed from r255932, head/sys/ofed/include/linux/clocksource.h stable/9/sys/ofed/include/linux/etherdevice.h - copied unchanged from r271127, stable/10/sys/ofed/include/linux/etherdevice.h stable/9/sys/ofed/include/linux/kmod.h - copied unchanged from r271127, stable/10/sys/ofed/include/linux/kmod.h stable/9/sys/ofed/include/linux/ktime.h - copied unchanged from r271127, stable/10/sys/ofed/include/linux/ktime.h stable/9/sys/ofed/include/linux/math64.h - copied unchanged from r271127, stable/10/sys/ofed/include/linux/math64.h stable/9/sys/ofed/include/net/if_inet6.h - copied unchanged from r271127, stable/10/sys/ofed/include/net/if_inet6.h stable/9/sys/ofed/include/rdma/ib_pma.h - copied unchanged from r255932, head/sys/ofed/include/rdma/ib_pma.h Deleted: stable/9/sys/ofed/include/asm/current.h stable/9/sys/ofed/include/asm/semaphore.h stable/9/sys/ofed/include/asm/system.h stable/9/sys/ofed/include/linux/bitmap.h stable/9/sys/ofed/include/linux/ctype.h stable/9/sys/ofed/include/linux/init.h stable/9/sys/ofed/include/linux/rtnetlink.h stable/9/sys/ofed/include/linux/stddef.h stable/9/sys/ofed/include/net/addrconf.h stable/9/sys/ofed/include/net/arp.h stable/9/sys/ofed/include/net/ip6_route.h stable/9/sys/ofed/include/net/neighbour.h Modified: stable/9/contrib/ofed/libibverbs/examples/asyncwatch.c stable/9/contrib/ofed/libibverbs/examples/device_list.c stable/9/contrib/ofed/libibverbs/examples/devinfo.c stable/9/contrib/ofed/libmlx4/src/mlx4-abi.h stable/9/contrib/ofed/libsdp/src/linux/sdp_inet.h stable/9/contrib/ofed/management/infiniband-diags/src/sminfo.c stable/9/contrib/ofed/management/opensm/opensm/osm_console.c stable/9/contrib/ofed/management/opensm/opensm/osm_subnet.c stable/9/sys/conf/files stable/9/sys/contrib/dev/npe/LICENSE stable/9/sys/contrib/dev/nve/amd64/nvenetlib.README stable/9/sys/contrib/dev/nve/i386/nvenetlib.README stable/9/sys/contrib/rdma/ib_umem.h stable/9/sys/contrib/rdma/krping/getopt.c stable/9/sys/contrib/rdma/krping/krping.c stable/9/sys/contrib/rdma/krping/krping.h stable/9/sys/contrib/rdma/krping/krping_dev.c stable/9/sys/dev/cxgb/cxgb_osdep.h stable/9/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c stable/9/sys/dev/vxge/include/vxgehal-ll.h stable/9/sys/modules/Makefile stable/9/sys/modules/mlx4/Makefile stable/9/sys/modules/mlx4ib/Makefile stable/9/sys/modules/mlxen/Makefile stable/9/sys/modules/rdma/Makefile stable/9/sys/ofed/drivers/infiniband/core/addr.c stable/9/sys/ofed/drivers/infiniband/core/cm.c stable/9/sys/ofed/drivers/infiniband/core/cma.c stable/9/sys/ofed/drivers/infiniband/core/core_priv.h stable/9/sys/ofed/drivers/infiniband/core/device.c stable/9/sys/ofed/drivers/infiniband/core/iwcm.c stable/9/sys/ofed/drivers/infiniband/core/local_sa.c stable/9/sys/ofed/drivers/infiniband/core/notice.c stable/9/sys/ofed/drivers/infiniband/core/sa_query.c stable/9/sys/ofed/drivers/infiniband/core/sysfs.c stable/9/sys/ofed/drivers/infiniband/core/ucm.c stable/9/sys/ofed/drivers/infiniband/core/umem.c stable/9/sys/ofed/drivers/infiniband/core/user_mad.c stable/9/sys/ofed/drivers/infiniband/core/uverbs_cmd.c stable/9/sys/ofed/drivers/infiniband/core/uverbs_main.c stable/9/sys/ofed/drivers/infiniband/core/verbs.c stable/9/sys/ofed/drivers/infiniband/hw/mlx4/Kconfig stable/9/sys/ofed/drivers/infiniband/hw/mlx4/Makefile stable/9/sys/ofed/drivers/infiniband/hw/mlx4/ah.c stable/9/sys/ofed/drivers/infiniband/hw/mlx4/cq.c stable/9/sys/ofed/drivers/infiniband/hw/mlx4/mad.c stable/9/sys/ofed/drivers/infiniband/hw/mlx4/main.c stable/9/sys/ofed/drivers/infiniband/hw/mlx4/mlx4_ib.h stable/9/sys/ofed/drivers/infiniband/hw/mlx4/mr.c stable/9/sys/ofed/drivers/infiniband/hw/mlx4/qp.c stable/9/sys/ofed/drivers/infiniband/hw/mlx4/srq.c stable/9/sys/ofed/drivers/infiniband/hw/mlx4/user.h stable/9/sys/ofed/drivers/infiniband/hw/mlx4/wc.c stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_allocator.c stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.c stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_main.c stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_provider.c stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c stable/9/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h stable/9/sys/ofed/drivers/net/mlx4/Makefile stable/9/sys/ofed/drivers/net/mlx4/alloc.c stable/9/sys/ofed/drivers/net/mlx4/catas.c stable/9/sys/ofed/drivers/net/mlx4/cmd.c stable/9/sys/ofed/drivers/net/mlx4/cq.c stable/9/sys/ofed/drivers/net/mlx4/en_cq.c stable/9/sys/ofed/drivers/net/mlx4/en_ethtool.c stable/9/sys/ofed/drivers/net/mlx4/en_main.c stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c stable/9/sys/ofed/drivers/net/mlx4/en_port.c stable/9/sys/ofed/drivers/net/mlx4/en_port.h stable/9/sys/ofed/drivers/net/mlx4/en_resources.c stable/9/sys/ofed/drivers/net/mlx4/en_rx.c stable/9/sys/ofed/drivers/net/mlx4/en_selftest.c stable/9/sys/ofed/drivers/net/mlx4/en_tx.c stable/9/sys/ofed/drivers/net/mlx4/eq.c stable/9/sys/ofed/drivers/net/mlx4/fw.c stable/9/sys/ofed/drivers/net/mlx4/fw.h stable/9/sys/ofed/drivers/net/mlx4/icm.c stable/9/sys/ofed/drivers/net/mlx4/icm.h stable/9/sys/ofed/drivers/net/mlx4/intf.c stable/9/sys/ofed/drivers/net/mlx4/main.c stable/9/sys/ofed/drivers/net/mlx4/mcg.c stable/9/sys/ofed/drivers/net/mlx4/mlx4.h stable/9/sys/ofed/drivers/net/mlx4/mlx4_en.h stable/9/sys/ofed/drivers/net/mlx4/mr.c stable/9/sys/ofed/drivers/net/mlx4/pd.c stable/9/sys/ofed/drivers/net/mlx4/port.c stable/9/sys/ofed/drivers/net/mlx4/profile.c stable/9/sys/ofed/drivers/net/mlx4/qp.c stable/9/sys/ofed/drivers/net/mlx4/reset.c stable/9/sys/ofed/drivers/net/mlx4/sense.c stable/9/sys/ofed/drivers/net/mlx4/srq.c stable/9/sys/ofed/drivers/net/mlx4/xrcd.c stable/9/sys/ofed/include/asm/atomic-long.h stable/9/sys/ofed/include/asm/atomic.h stable/9/sys/ofed/include/asm/byteorder.h stable/9/sys/ofed/include/asm/fcntl.h stable/9/sys/ofed/include/asm/io.h stable/9/sys/ofed/include/asm/page.h stable/9/sys/ofed/include/asm/pgtable.h stable/9/sys/ofed/include/asm/types.h stable/9/sys/ofed/include/asm/uaccess.h stable/9/sys/ofed/include/linux/bitops.h stable/9/sys/ofed/include/linux/cdev.h stable/9/sys/ofed/include/linux/compat.h stable/9/sys/ofed/include/linux/compiler.h stable/9/sys/ofed/include/linux/completion.h stable/9/sys/ofed/include/linux/delay.h stable/9/sys/ofed/include/linux/device.h stable/9/sys/ofed/include/linux/dma-attrs.h stable/9/sys/ofed/include/linux/dma-mapping.h stable/9/sys/ofed/include/linux/dmapool.h stable/9/sys/ofed/include/linux/err.h stable/9/sys/ofed/include/linux/errno.h stable/9/sys/ofed/include/linux/ethtool.h stable/9/sys/ofed/include/linux/file.h stable/9/sys/ofed/include/linux/fs.h stable/9/sys/ofed/include/linux/gfp.h stable/9/sys/ofed/include/linux/hardirq.h stable/9/sys/ofed/include/linux/idr.h stable/9/sys/ofed/include/linux/if_arp.h stable/9/sys/ofed/include/linux/if_ether.h stable/9/sys/ofed/include/linux/if_vlan.h stable/9/sys/ofed/include/linux/in.h stable/9/sys/ofed/include/linux/in6.h stable/9/sys/ofed/include/linux/inet.h stable/9/sys/ofed/include/linux/inetdevice.h stable/9/sys/ofed/include/linux/interrupt.h stable/9/sys/ofed/include/linux/io-mapping.h stable/9/sys/ofed/include/linux/io.h stable/9/sys/ofed/include/linux/ioctl.h stable/9/sys/ofed/include/linux/jiffies.h stable/9/sys/ofed/include/linux/kdev_t.h stable/9/sys/ofed/include/linux/kernel.h stable/9/sys/ofed/include/linux/kobject.h stable/9/sys/ofed/include/linux/kref.h stable/9/sys/ofed/include/linux/kthread.h stable/9/sys/ofed/include/linux/linux_compat.c stable/9/sys/ofed/include/linux/linux_idr.c stable/9/sys/ofed/include/linux/linux_radix.c stable/9/sys/ofed/include/linux/list.h stable/9/sys/ofed/include/linux/lockdep.h stable/9/sys/ofed/include/linux/log2.h stable/9/sys/ofed/include/linux/miscdevice.h stable/9/sys/ofed/include/linux/mlx4/cmd.h stable/9/sys/ofed/include/linux/mlx4/cq.h stable/9/sys/ofed/include/linux/mlx4/device.h stable/9/sys/ofed/include/linux/mlx4/driver.h stable/9/sys/ofed/include/linux/mlx4/qp.h stable/9/sys/ofed/include/linux/mlx4/srq.h stable/9/sys/ofed/include/linux/mm.h stable/9/sys/ofed/include/linux/module.h stable/9/sys/ofed/include/linux/moduleparam.h stable/9/sys/ofed/include/linux/mount.h stable/9/sys/ofed/include/linux/mutex.h stable/9/sys/ofed/include/linux/net.h stable/9/sys/ofed/include/linux/netdevice.h stable/9/sys/ofed/include/linux/notifier.h stable/9/sys/ofed/include/linux/page.h stable/9/sys/ofed/include/linux/pci.h stable/9/sys/ofed/include/linux/poll.h stable/9/sys/ofed/include/linux/radix-tree.h stable/9/sys/ofed/include/linux/random.h stable/9/sys/ofed/include/linux/rbtree.h stable/9/sys/ofed/include/linux/rwlock.h stable/9/sys/ofed/include/linux/rwsem.h stable/9/sys/ofed/include/linux/scatterlist.h stable/9/sys/ofed/include/linux/sched.h stable/9/sys/ofed/include/linux/semaphore.h stable/9/sys/ofed/include/linux/slab.h stable/9/sys/ofed/include/linux/socket.h stable/9/sys/ofed/include/linux/spinlock.h stable/9/sys/ofed/include/linux/string.h stable/9/sys/ofed/include/linux/sysfs.h stable/9/sys/ofed/include/linux/timer.h stable/9/sys/ofed/include/linux/types.h stable/9/sys/ofed/include/linux/uaccess.h stable/9/sys/ofed/include/linux/vmalloc.h stable/9/sys/ofed/include/linux/wait.h stable/9/sys/ofed/include/linux/workqueue.h stable/9/sys/ofed/include/net/ip.h stable/9/sys/ofed/include/net/ipv6.h stable/9/sys/ofed/include/net/netevent.h stable/9/sys/ofed/include/net/tcp.h stable/9/sys/ofed/include/rdma/ib_cm.h stable/9/sys/ofed/include/rdma/ib_mad.h stable/9/sys/ofed/include/rdma/ib_sa.h stable/9/sys/ofed/include/rdma/ib_umem.h stable/9/sys/ofed/include/rdma/ib_user_verbs.h stable/9/sys/ofed/include/rdma/ib_verbs.h stable/9/sys/ofed/include/rdma/sdp_socket.h stable/9/sys/sys/socket.h Directory Properties: stable/9/contrib/ (props changed) stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/contrib/ofed/libibverbs/examples/asyncwatch.c ============================================================================== --- stable/9/contrib/ofed/libibverbs/examples/asyncwatch.c Thu Oct 30 14:36:27 2014 (r273863) +++ stable/9/contrib/ofed/libibverbs/examples/asyncwatch.c Thu Oct 30 15:41:25 2014 (r273864) @@ -35,8 +35,6 @@ #endif /* HAVE_CONFIG_H */ #include -#include -#include #include Modified: stable/9/contrib/ofed/libibverbs/examples/device_list.c ============================================================================== --- stable/9/contrib/ofed/libibverbs/examples/device_list.c Thu Oct 30 14:36:27 2014 (r273863) +++ stable/9/contrib/ofed/libibverbs/examples/device_list.c Thu Oct 30 15:41:25 2014 (r273864) @@ -36,9 +36,6 @@ #include -#include -#include - #include #include Modified: stable/9/contrib/ofed/libibverbs/examples/devinfo.c ============================================================================== --- stable/9/contrib/ofed/libibverbs/examples/devinfo.c Thu Oct 30 14:36:27 2014 (r273863) +++ stable/9/contrib/ofed/libibverbs/examples/devinfo.c Thu Oct 30 15:41:25 2014 (r273864) @@ -41,8 +41,6 @@ #include #include #include -#include -#include #include #include Modified: stable/9/contrib/ofed/libmlx4/src/mlx4-abi.h ============================================================================== --- stable/9/contrib/ofed/libmlx4/src/mlx4-abi.h Thu Oct 30 14:36:27 2014 (r273863) +++ stable/9/contrib/ofed/libmlx4/src/mlx4-abi.h Thu Oct 30 15:41:25 2014 (r273864) @@ -36,7 +36,7 @@ #include #define MLX4_UVERBS_MIN_ABI_VERSION 2 -#define MLX4_UVERBS_MAX_ABI_VERSION 3 +#define MLX4_UVERBS_MAX_ABI_VERSION 4 struct mlx4_alloc_ucontext_resp { struct ibv_get_context_resp ibv_resp; Modified: stable/9/contrib/ofed/libsdp/src/linux/sdp_inet.h ============================================================================== --- stable/9/contrib/ofed/libsdp/src/linux/sdp_inet.h Thu Oct 30 14:36:27 2014 (r273863) +++ stable/9/contrib/ofed/libsdp/src/linux/sdp_inet.h Thu Oct 30 15:41:25 2014 (r273864) @@ -29,8 +29,12 @@ */ #ifndef SOLARIS_BUILD +#ifdef __FreeBSD__ +#include +#else #define AF_INET_SDP 27 /* SDP socket protocol family */ #define AF_INET6_SDP 28 /* SDP socket protocol family */ +#endif #else #define AF_INET_SDP 31 /* This is an invalid family on native solaris * and will only work using QuickTransit */ Modified: stable/9/contrib/ofed/management/infiniband-diags/src/sminfo.c ============================================================================== --- stable/9/contrib/ofed/management/infiniband-diags/src/sminfo.c Thu Oct 30 14:36:27 2014 (r273863) +++ stable/9/contrib/ofed/management/infiniband-diags/src/sminfo.c Thu Oct 30 15:41:25 2014 (r273864) @@ -72,10 +72,10 @@ enum { }; char *statestr[] = { - [SMINFO_NOTACT] "SMINFO_NOTACT", - [SMINFO_DISCOVER] "SMINFO_DISCOVER", - [SMINFO_STANDBY] "SMINFO_STANDBY", - [SMINFO_MASTER] "SMINFO_MASTER", + [SMINFO_NOTACT] = "SMINFO_NOTACT", + [SMINFO_DISCOVER] = "SMINFO_DISCOVER", + [SMINFO_STANDBY] = "SMINFO_STANDBY", + [SMINFO_MASTER] = "SMINFO_MASTER", }; #define STATESTR(s) (((unsigned)(s)) < SMINFO_STATE_LAST ? statestr[s] : "???") Modified: stable/9/contrib/ofed/management/opensm/opensm/osm_console.c ============================================================================== --- stable/9/contrib/ofed/management/opensm/opensm/osm_console.c Thu Oct 30 14:36:27 2014 (r273863) +++ stable/9/contrib/ofed/management/opensm/opensm/osm_console.c Thu Oct 30 15:41:25 2014 (r273864) @@ -67,7 +67,10 @@ static struct { time_t previous; void (*loop_function) (osm_opensm_t * p_osm, FILE * out); } loop_command = { -on: 0, delay_s: 2, loop_function:NULL}; + .on = 0, + .delay_s = 2, + .loop_function = NULL, +}; static const struct command console_cmds[]; Modified: stable/9/contrib/ofed/management/opensm/opensm/osm_subnet.c ============================================================================== --- stable/9/contrib/ofed/management/opensm/opensm/osm_subnet.c Thu Oct 30 14:36:27 2014 (r273863) +++ stable/9/contrib/ofed/management/opensm/opensm/osm_subnet.c Thu Oct 30 15:41:25 2014 (r273864) @@ -482,7 +482,7 @@ static void log_report(const char *fmt, va_start(args, fmt); vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); - printf(buf); + printf("%s", buf); cl_log_event("OpenSM", CL_LOG_INFO, buf, NULL, 0); } @@ -500,7 +500,7 @@ static void log_config_value(char *name, n = sizeof(buf); snprintf(buf + n, sizeof(buf) - n, "\n"); va_end(args); - printf(buf); + printf("%s", buf); cl_log_event("OpenSM", CL_LOG_INFO, buf, NULL, 0); } Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Thu Oct 30 14:36:27 2014 (r273863) +++ stable/9/sys/conf/files Thu Oct 30 15:41:25 2014 (r273864) @@ -3236,6 +3236,18 @@ ofed/drivers/infiniband/ulp/sdp/sdp_tx.c no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/" +ofed/drivers/infiniband/hw/mlx4/alias_GUID.c optional mlx4ib \ + no-depend obj-prefix "mlx4ib_" \ + compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" +ofed/drivers/infiniband/hw/mlx4/mcg.c optional mlx4ib \ + no-depend obj-prefix "mlx4ib_" \ + compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" +ofed/drivers/infiniband/hw/mlx4/sysfs.c optional mlx4ib \ + no-depend obj-prefix "mlx4ib_" \ + compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" +ofed/drivers/infiniband/hw/mlx4/cm.c optional mlx4ib \ + no-depend obj-prefix "mlx4ib_" \ + compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" ofed/drivers/infiniband/hw/mlx4/ah.c optional mlx4ib \ no-depend obj-prefix "mlx4ib_" \ compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" @@ -3318,14 +3330,17 @@ ofed/drivers/net/mlx4/sense.c optional ofed/drivers/net/mlx4/srq.c optional mlx4ib | mlxen \ no-depend obj-prefix "mlx4_" \ compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/xrcd.c optional mlx4ib | mlxen \ +ofed/drivers/net/mlx4/resource_tracker.c optional mlx4ib | mlxen \ + no-depend obj-prefix "mlx4_" \ + compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" +ofed/drivers/net/mlx4/sys_tune.c optional mlx4ib | mlxen \ no-depend obj-prefix "mlx4_" \ compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" 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/en_frag.c optional mlxen \ +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 \ Modified: stable/9/sys/contrib/dev/npe/LICENSE ============================================================================== --- stable/9/sys/contrib/dev/npe/LICENSE Thu Oct 30 14:36:27 2014 (r273863) +++ stable/9/sys/contrib/dev/npe/LICENSE Thu Oct 30 15:41:25 2014 (r273864) @@ -8,5 +8,5 @@ Redistribution. Redistribution and use i - Neither the name of Intel Corporation nor the names of its suppliers may be used to endorse or promote products derived from this software without specific prior written permission. - No reverse engineering, decompilation, or disassembly of this software is permitted. -Limited patent license. Intel Corporation grants a world-wide, royalty-free, non-exclusive license under patents it now or hereafter owns or controls to make, have made, use, import, offer to sell and sell (¿Utilize¿) this software, but solely to the extent that any such patent is necessary to Utilize the software alone. The patent license shall not apply to any combinations which include this software. No hardware per se is licensed hereunder. +Limited patent license. Intel Corporation grants a world-wide, royalty-free, non-exclusive license under patents it now or hereafter owns or controls to make, have made, use, import, offer to sell and sell ("Utilize") this software, but solely to the extent that any such patent is necessary to Utilize the software alone. The patent license shall not apply to any combinations which include this software. No hardware per se is licensed hereunder. DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Modified: stable/9/sys/contrib/dev/nve/amd64/nvenetlib.README ============================================================================== --- stable/9/sys/contrib/dev/nve/amd64/nvenetlib.README Thu Oct 30 14:36:27 2014 (r273863) +++ stable/9/sys/contrib/dev/nve/amd64/nvenetlib.README Thu Oct 30 15:41:25 2014 (r273864) @@ -4,7 +4,7 @@ The installation and use of this softwar License For Customer Use of NVIDIA Software -IMPORTANT NOTICE -- READ CAREFULLY: This License For Customer Use of NVIDIA Software ("LICENSE") is the agreement which governs use of the software of NVIDIA Corporation and its subsidiaries (“NVIDIA”) enclosed herewith, including computer software and associated printed materials ("SOFTWARE"). By downloading, installing, copying, or otherwise using the SOFTWARE, you agree to be bound by the terms of this LICENSE. If you do not agree to the terms of this LICENSE, do not download, install or use the SOFTWARE. +IMPORTANT NOTICE -- READ CAREFULLY: This License For Customer Use of NVIDIA Software ("LICENSE") is the agreement which governs use of the software of NVIDIA Corporation and its subsidiaries ("NVIDIA") enclosed herewith, including computer software and associated printed materials ("SOFTWARE"). By downloading, installing, copying, or otherwise using the SOFTWARE, you agree to be bound by the terms of this LICENSE. If you do not agree to the terms of this LICENSE, do not download, install or use the SOFTWARE. RECITALS Use of NVIDIA's products requires three elements: the SOFTWARE, the hardware on a computer motherboard, and a personal computer. The SOFTWARE is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE is not sold, and instead is only licensed for use, strictly in accordance with this document. The hardware is protected by various patents, and is sold, but this agreement does not cover that sale, since it may not necessarily be sold as a package with the SOFTWARE. This agreement sets forth the terms and conditions of the SOFTWARE LICENSE only. Modified: stable/9/sys/contrib/dev/nve/i386/nvenetlib.README ============================================================================== --- stable/9/sys/contrib/dev/nve/i386/nvenetlib.README Thu Oct 30 14:36:27 2014 (r273863) +++ stable/9/sys/contrib/dev/nve/i386/nvenetlib.README Thu Oct 30 15:41:25 2014 (r273864) @@ -4,7 +4,7 @@ The installation and use of this softwar License For Customer Use of NVIDIA Software -IMPORTANT NOTICE -- READ CAREFULLY: This License For Customer Use of NVIDIA Software ("LICENSE") is the agreement which governs use of the software of NVIDIA Corporation and its subsidiaries (“NVIDIA”) enclosed herewith, including computer software and associated printed materials ("SOFTWARE"). By downloading, installing, copying, or otherwise using the SOFTWARE, you agree to be bound by the terms of this LICENSE. If you do not agree to the terms of this LICENSE, do not download, install or use the SOFTWARE. +IMPORTANT NOTICE -- READ CAREFULLY: This License For Customer Use of NVIDIA Software ("LICENSE") is the agreement which governs use of the software of NVIDIA Corporation and its subsidiaries ("NVIDIA") enclosed herewith, including computer software and associated printed materials ("SOFTWARE"). By downloading, installing, copying, or otherwise using the SOFTWARE, you agree to be bound by the terms of this LICENSE. If you do not agree to the terms of this LICENSE, do not download, install or use the SOFTWARE. RECITALS Use of NVIDIA's products requires three elements: the SOFTWARE, the hardware on a computer motherboard, and a personal computer. The SOFTWARE is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE is not sold, and instead is only licensed for use, strictly in accordance with this document. The hardware is protected by various patents, and is sold, but this agreement does not cover that sale, since it may not necessarily be sold as a package with the SOFTWARE. This agreement sets forth the terms and conditions of the SOFTWARE LICENSE only. Modified: stable/9/sys/contrib/rdma/ib_umem.h ============================================================================== --- stable/9/sys/contrib/rdma/ib_umem.h Thu Oct 30 14:36:27 2014 (r273863) +++ stable/9/sys/contrib/rdma/ib_umem.h Thu Oct 30 15:41:25 2014 (r273864) @@ -28,21 +28,17 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. - * - * $FreeBSD$ */ #ifndef IB_UMEM_H #define IB_UMEM_H -struct ib_ucontext; +#include +#include +#include +#include -struct ib_umem_chunk { - TAILQ_ENTRY(ib_umem_chunk) entry; - int nents; - int nmap; - struct rdma_scatterlist page_list[0]; -}; +struct ib_ucontext; struct ib_umem { struct ib_ucontext *context; @@ -50,28 +46,76 @@ struct ib_umem { int offset; int page_size; int writable; - TAILQ_HEAD(, ib_umem_chunk) chunk_list; -#ifdef notyet + int hugetlb; + struct list_head chunk_list; struct work_struct work; struct mm_struct *mm; -#endif unsigned long diff; }; +/* contiguous memory structure */ +struct ib_cmem { + + struct ib_ucontext *context; + size_t length; + /* Link list of contiguous blocks being part of that cmem */ + struct list_head ib_cmem_block; + + /* Order of cmem block, 2^ block_order will equal number + of physical pages per block + */ + unsigned long block_order; + /* Refernce counter for that memory area + - When value became 0 pages will be returned to the kernel. + */ + struct kref refcount; +}; + + +struct ib_cmem_block { + + struct list_head list; + /* page will point to the page struct of the head page + in the current compound page. + block order is saved once as part of ib_cmem. + */ + struct page *page; +}; + + + +struct ib_umem_chunk { + struct list_head list; + int nents; + int nmap; + struct dma_attrs attrs; + struct scatterlist page_list[0]; +}; + #ifdef CONFIG_INFINIBAND_USER_MEM struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr, - size_t size, int access); + size_t size, int access, int dmasync); void ib_umem_release(struct ib_umem *umem); int ib_umem_page_count(struct ib_umem *umem); +int ib_cmem_map_contiguous_pages_to_vma(struct ib_cmem *ib_cmem, + struct vm_area_struct *vma); +struct ib_cmem *ib_cmem_alloc_contiguous_pages(struct ib_ucontext *context, + unsigned long total_size, + unsigned long page_size_order); +void ib_cmem_release_contiguous_pages(struct ib_cmem *cmem); +int ib_umem_map_to_vma(struct ib_umem *umem, + struct vm_area_struct *vma); + #else /* CONFIG_INFINIBAND_USER_MEM */ +#include static inline struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr, size_t size, - int access) { - return ERR_PTR(EINVAL); + int access, int dmasync) { + return ERR_PTR(-EINVAL); } static inline void ib_umem_release(struct ib_umem *umem) { } static inline int ib_umem_page_count(struct ib_umem *umem) { return 0; } Modified: stable/9/sys/contrib/rdma/krping/getopt.c ============================================================================== --- stable/9/sys/contrib/rdma/krping/getopt.c Thu Oct 30 14:36:27 2014 (r273863) +++ stable/9/sys/contrib/rdma/krping/getopt.c Thu Oct 30 15:41:25 2014 (r273864) @@ -5,9 +5,10 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include +#include +#include +#include + #include "getopt.h" /** @@ -49,29 +50,29 @@ int krping_getopt(const char *caller, ch if (opts->has_arg & OPT_NOPARAM) { return opts->val; } - printf("%s: the %s option requires " + printk(KERN_INFO "%s: the %s option requires " "an argument\n", caller, token); return -EINVAL; } if (opts->has_arg & OPT_INT) { char* v; - *value = strtoul(val, &v, 0); + *value = simple_strtoul(val, &v, 0); if (!*v) { return opts->val; } - printf("%s: invalid numeric value " + printk(KERN_INFO "%s: invalid numeric value " "in %s=%s\n", caller, token, val); return -EDOM; } if (opts->has_arg & OPT_STRING) { return opts->val; } - printf("%s: unexpected argument %s to the " + printk(KERN_INFO "%s: unexpected argument %s to the " "%s option\n", caller, val, token); return -EINVAL; } } - printf("%s: Unrecognized option %s\n", caller, token); + printk(KERN_INFO "%s: Unrecognized option %s\n", caller, token); return -EOPNOTSUPP; } Modified: stable/9/sys/contrib/rdma/krping/krping.c ============================================================================== --- stable/9/sys/contrib/rdma/krping/krping.c Thu Oct 30 14:36:27 2014 (r273863) +++ stable/9/sys/contrib/rdma/krping/krping.c Thu Oct 30 15:41:25 2014 (r273864) @@ -1,6 +1,6 @@ /* * Copyright (c) 2005 Ammasso, Inc. All rights reserved. - * Copyright (c) 2006 Open Grid Computing, Inc. All rights reserved. + * Copyright (c) 2006-2009 Open Grid Computing, Inc. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -34,39 +34,50 @@ #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 -#include -#include -#include -#include -#include -#include +#include -#include -#include - -#include +#include #include -#include "getopt.h" #include "krping.h" +#include "getopt.h" -#define PFX "krping: " +extern int krping_debug; +#define DEBUG_LOG(cb, x...) if (krping_debug) krping_printf((cb)->cookie, x) +#define PRINTF(cb, x...) krping_printf((cb)->cookie, x) -static int debug = 0; -#define DEBUG_LOG if (debug) printf +MODULE_AUTHOR("Steve Wise"); +MODULE_DESCRIPTION("RDMA ping client/server"); +MODULE_LICENSE("Dual BSD/GPL"); + +static __inline uint64_t +get_cycles(void) +{ + uint32_t low, high; + __asm __volatile("rdtsc" : "=a" (low), "=d" (high)); + return (low | ((u_int64_t)high << 32)); +} + +typedef uint64_t cycles_t; + +enum mem_type { + DMA = 1, + FASTREG = 2, + MW = 3, + MR = 4 +}; static const struct krping_option krping_opts[] = { {"count", OPT_INT, 'C'}, @@ -77,23 +88,29 @@ static const struct krping_option krping {"validate", OPT_NOPARAM, 'V'}, {"server", OPT_NOPARAM, 's'}, {"client", OPT_NOPARAM, 'c'}, - {"dmamr", OPT_NOPARAM, 'D'}, - {"debug", OPT_NOPARAM, 'd'}, - {"wlat", OPT_NOPARAM, 'l'}, - {"rlat", OPT_NOPARAM, 'L'}, - {"bw", OPT_NOPARAM, 'B'}, - {"tx-depth", OPT_INT, 't'}, - {"poll", OPT_NOPARAM, 'P'}, - {"memlimit", OPT_INT, 'm'}, + {"mem_mode", OPT_STRING, 'm'}, + {"server_inv", OPT_NOPARAM, 'I'}, + {"wlat", OPT_NOPARAM, 'l'}, + {"rlat", OPT_NOPARAM, 'L'}, + {"bw", OPT_NOPARAM, 'B'}, + {"duplex", OPT_NOPARAM, 'd'}, + {"txdepth", OPT_INT, 'T'}, + {"poll", OPT_NOPARAM, 'P'}, + {"local_dma_lkey", OPT_NOPARAM, 'Z'}, + {"read_inv", OPT_NOPARAM, 'R'}, + {"fr", OPT_NOPARAM, 'f'}, {NULL, 0, 0} }; -struct mtx krping_mutex; +#define htonll(x) cpu_to_be64((x)) +#define ntohll(x) cpu_to_be64((x)) + +static struct mutex krping_mutex; /* * List of running krping threads. */ -struct krping_cb_list krping_cbs; +static LIST_HEAD(krping_cbs); /* * krping "ping/pong" loop: @@ -109,24 +126,118 @@ struct krping_cb_list krping_cbs; */ /* + * These states are used to signal events between the completion handler + * and the main client or server thread. + * + * Once CONNECTED, they cycle through RDMA_READ_ADV, RDMA_WRITE_ADV, + * and RDMA_WRITE_COMPLETE for each ping. + */ +enum test_state { + IDLE = 1, + CONNECT_REQUEST, + ADDR_RESOLVED, + ROUTE_RESOLVED, + CONNECTED, + RDMA_READ_ADV, + RDMA_READ_COMPLETE, + RDMA_WRITE_ADV, + RDMA_WRITE_COMPLETE, + ERROR +}; + +struct krping_rdma_info { + uint64_t buf; + uint32_t rkey; + uint32_t size; +}; + +/* * Default max buffer size for IO... */ #define RPING_BUFSIZE 128*1024 -#define RPING_SQ_DEPTH 32 +#define RPING_SQ_DEPTH 64 -static void krping_wait(struct krping_cb *cb, int state) -{ - int rc; - mtx_lock(&cb->lock); - while (cb->state < state) { - rc = msleep(cb, &cb->lock, 0, "krping", 0); - if (rc && rc != ERESTART) { - cb->state = ERROR; - break; - } - } - mtx_unlock(&cb->lock); -} +/* + * Control block struct. + */ +struct krping_cb { + void *cookie; + int server; /* 0 iff client */ + struct ib_cq *cq; + struct ib_pd *pd; + struct ib_qp *qp; + + enum mem_type mem; + struct ib_mr *dma_mr; + + struct ib_fast_reg_page_list *page_list; + int page_list_len; + struct ib_send_wr fastreg_wr; + struct ib_send_wr invalidate_wr; + struct ib_mr *fastreg_mr; + int server_invalidate; + int read_inv; + u8 key; + + struct ib_mw *mw; + struct ib_mw_bind bind_attr; + + struct ib_recv_wr rq_wr; /* recv work request record */ + struct ib_sge recv_sgl; /* recv single SGE */ + struct krping_rdma_info recv_buf;/* malloc'd buffer */ + u64 recv_dma_addr; + DECLARE_PCI_UNMAP_ADDR(recv_mapping) + struct ib_mr *recv_mr; + + struct ib_send_wr sq_wr; /* send work requrest record */ + struct ib_sge send_sgl; + struct krping_rdma_info send_buf;/* single send buf */ + u64 send_dma_addr; + DECLARE_PCI_UNMAP_ADDR(send_mapping) + struct ib_mr *send_mr; + + struct ib_send_wr rdma_sq_wr; /* rdma work request record */ + struct ib_sge rdma_sgl; /* rdma single SGE */ + char *rdma_buf; /* used as rdma sink */ + u64 rdma_dma_addr; + DECLARE_PCI_UNMAP_ADDR(rdma_mapping) + struct ib_mr *rdma_mr; + + uint32_t remote_rkey; /* remote guys RKEY */ + uint64_t remote_addr; /* remote guys TO */ + uint32_t remote_len; /* remote guys LEN */ + + char *start_buf; /* rdma read src */ + u64 start_dma_addr; + DECLARE_PCI_UNMAP_ADDR(start_mapping) + struct ib_mr *start_mr; + + enum test_state state; /* used for cond/signalling */ + wait_queue_head_t sem; + struct krping_stats stats; + + uint16_t port; /* dst port in NBO */ + struct in_addr addr; /* dst addr in NBO */ + char *addr_str; /* dst addr string */ + int verbose; /* verbose logging */ + int count; /* ping count */ + int size; /* ping data size */ + int validate; /* validate ping data */ + int wlat; /* run wlat test */ + int rlat; /* run rlat test */ + int bw; /* run bw test */ + int duplex; /* run bw full duplex test */ + int poll; /* poll or block for rlat test */ + int txdepth; /* SQ depth */ + int local_dma_lkey; /* use 0 for lkey */ + int frtest; /* fastreg test */ + + /* CM stuff */ + struct rdma_cm_id *cm_id; /* connection on client side,*/ + /* listener on server side. */ + struct rdma_cm_id *child_cm_id; /* connection on server side */ + struct list_head list; +}; static int krping_cma_event_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) @@ -134,39 +245,37 @@ static int krping_cma_event_handler(stru int ret; struct krping_cb *cb = cma_id->context; - DEBUG_LOG(PFX "cma_event type %d cma_id %p (%s)\n", event->event, cma_id, - (cma_id == cb->cm_id) ? "parent" : "child"); + DEBUG_LOG(cb, "cma_event type %d cma_id %p (%s)\n", event->event, + cma_id, (cma_id == cb->cm_id) ? "parent" : "child"); - mtx_lock(&cb->lock); switch (event->event) { case RDMA_CM_EVENT_ADDR_RESOLVED: cb->state = ADDR_RESOLVED; ret = rdma_resolve_route(cma_id, 2000); if (ret) { - log(LOG_ERR, "rdma_resolve_route error %d\n", - ret); - wakeup(cb); + PRINTF(cb, "rdma_resolve_route error %d\n", ret); + wake_up_interruptible(&cb->sem); } break; case RDMA_CM_EVENT_ROUTE_RESOLVED: cb->state = ROUTE_RESOLVED; - wakeup(cb); + wake_up_interruptible(&cb->sem); break; case RDMA_CM_EVENT_CONNECT_REQUEST: cb->state = CONNECT_REQUEST; cb->child_cm_id = cma_id; - DEBUG_LOG(PFX "child cma %p\n", cb->child_cm_id); - wakeup(cb); + DEBUG_LOG(cb, "child cma %p\n", cb->child_cm_id); + wake_up_interruptible(&cb->sem); break; case RDMA_CM_EVENT_ESTABLISHED: - DEBUG_LOG(PFX "ESTABLISHED\n"); + DEBUG_LOG(cb, "ESTABLISHED\n"); if (!cb->server) { cb->state = CONNECTED; - wakeup(cb); } + wake_up_interruptible(&cb->sem); break; case RDMA_CM_EVENT_ADDR_ERROR: @@ -174,35 +283,34 @@ static int krping_cma_event_handler(stru case RDMA_CM_EVENT_CONNECT_ERROR: case RDMA_CM_EVENT_UNREACHABLE: case RDMA_CM_EVENT_REJECTED: - log(LOG_ERR, "cma event %d, error %d\n", event->event, + PRINTF(cb, "cma event %d, error %d\n", event->event, event->status); cb->state = ERROR; - wakeup(cb); + wake_up_interruptible(&cb->sem); break; case RDMA_CM_EVENT_DISCONNECTED: - DEBUG_LOG(PFX "DISCONNECT EVENT...\n"); + PRINTF(cb, "DISCONNECT EVENT...\n"); cb->state = ERROR; - wakeup(cb); + wake_up_interruptible(&cb->sem); break; case RDMA_CM_EVENT_DEVICE_REMOVAL: - DEBUG_LOG(PFX "cma detected device removal!!!!\n"); + PRINTF(cb, "cma detected device removal!!!!\n"); break; default: - log(LOG_ERR, "oof bad type!\n"); - wakeup(cb); + PRINTF(cb, "oof bad type!\n"); + wake_up_interruptible(&cb->sem); break; } - mtx_unlock(&cb->lock); return 0; } static int server_recv(struct krping_cb *cb, struct ib_wc *wc) { if (wc->byte_len != sizeof(cb->recv_buf)) { - log(LOG_ERR, "Received bogus data, size %d\n", + PRINTF(cb, "Received bogus data, size %d\n", wc->byte_len); return -1; } @@ -210,7 +318,7 @@ static int server_recv(struct krping_cb cb->remote_rkey = ntohl(cb->recv_buf.rkey); cb->remote_addr = ntohll(cb->recv_buf.buf); cb->remote_len = ntohl(cb->recv_buf.size); - DEBUG_LOG(PFX "Received rkey %x addr %llx len %d from peer\n", + DEBUG_LOG(cb, "Received rkey %x addr %llx len %d from peer\n", cb->remote_rkey, (unsigned long long)cb->remote_addr, cb->remote_len); @@ -225,7 +333,7 @@ static int server_recv(struct krping_cb static int client_recv(struct krping_cb *cb, struct ib_wc *wc) { if (wc->byte_len != sizeof(cb->recv_buf)) { - log(LOG_ERR, "Received bogus data, size %d\n", + PRINTF(cb, "Received bogus data, size %d\n", wc->byte_len); return -1; } @@ -245,11 +353,13 @@ static void krping_cq_event_handler(stru struct ib_recv_wr *bad_wr; int ret; - mtx_lock(&cb->lock); - KASSERT(cb->cq == cq, ("bad condition")); + BUG_ON(cb->cq != cq); if (cb->state == ERROR) { - log(LOG_ERR, "cq completion in ERROR state\n"); - mtx_unlock(&cb->lock); + PRINTF(cb, "cq completion in ERROR state\n"); + return; + } + if (cb->frtest) { + PRINTF(cb, "cq completion event in frtest!\n"); return; } if (!cb->wlat && !cb->rlat && !cb->bw) @@ -257,76 +367,77 @@ static void krping_cq_event_handler(stru while ((ret = ib_poll_cq(cb->cq, 1, &wc)) == 1) { if (wc.status) { if (wc.status == IB_WC_WR_FLUSH_ERR) { - DEBUG_LOG("cq flushed\n"); + DEBUG_LOG(cb, "cq flushed\n"); continue; } else { - log(LOG_CRIT, "cq completion failed status %d\n", - wc.status); + PRINTF(cb, "cq completion failed with " + "wr_id %Lx status %d opcode %d vender_err %x\n", + wc.wr_id, wc.status, wc.opcode, wc.vendor_err); goto error; } } switch (wc.opcode) { case IB_WC_SEND: - DEBUG_LOG(PFX "send completion\n"); + DEBUG_LOG(cb, "send completion\n"); cb->stats.send_bytes += cb->send_sgl.length; cb->stats.send_msgs++; break; case IB_WC_RDMA_WRITE: - DEBUG_LOG(PFX "rdma write completion\n"); + DEBUG_LOG(cb, "rdma write completion\n"); cb->stats.write_bytes += cb->rdma_sq_wr.sg_list->length; cb->stats.write_msgs++; cb->state = RDMA_WRITE_COMPLETE; - wakeup(cb); + wake_up_interruptible(&cb->sem); break; case IB_WC_RDMA_READ: - DEBUG_LOG(PFX "rdma read completion\n"); + DEBUG_LOG(cb, "rdma read completion\n"); cb->stats.read_bytes += cb->rdma_sq_wr.sg_list->length; cb->stats.read_msgs++; cb->state = RDMA_READ_COMPLETE; - wakeup(cb); + wake_up_interruptible(&cb->sem); break; case IB_WC_RECV: - DEBUG_LOG(PFX "recv completion\n"); + DEBUG_LOG(cb, "recv completion\n"); cb->stats.recv_bytes += sizeof(cb->recv_buf); cb->stats.recv_msgs++; if (cb->wlat || cb->rlat || cb->bw) ret = server_recv(cb, &wc); else ret = cb->server ? server_recv(cb, &wc) : - client_recv(cb, &wc); + client_recv(cb, &wc); if (ret) { - log(LOG_ERR, "recv wc error: %d\n", ret); + PRINTF(cb, "recv wc error: %d\n", ret); goto error; } ret = ib_post_recv(cb->qp, &cb->rq_wr, &bad_wr); if (ret) { - log(LOG_ERR, "post recv error: %d\n", + PRINTF(cb, "post recv error: %d\n", ret); goto error; } - wakeup(cb); + wake_up_interruptible(&cb->sem); break; default: - log(LOG_ERR, "unknown!!!!! completion\n"); + PRINTF(cb, + "%s:%d Unexpected opcode %d, Shutting down\n", + __func__, __LINE__, wc.opcode); goto error; } } if (ret) { - log(LOG_ERR, "poll error %d\n", ret); + PRINTF(cb, "poll error %d\n", ret); goto error; } - mtx_unlock(&cb->lock); return; error: cb->state = ERROR; - wakeup(cb); - mtx_unlock(&cb->lock); + wake_up_interruptible(&cb->sem); } static int krping_accept(struct krping_cb *cb) @@ -334,7 +445,7 @@ static int krping_accept(struct krping_c struct rdma_conn_param conn_param; int ret; - DEBUG_LOG(PFX "accepting client connection request\n"); + DEBUG_LOG(cb, "accepting client connection request\n"); memset(&conn_param, 0, sizeof conn_param); conn_param.responder_resources = 1; @@ -342,14 +453,15 @@ static int krping_accept(struct krping_c ret = rdma_accept(cb->child_cm_id, &conn_param); if (ret) { - log(LOG_ERR, "rdma_accept error: %d\n", ret); + PRINTF(cb, "rdma_accept error: %d\n", ret); return ret; } if (!cb->wlat && !cb->rlat && !cb->bw) { - krping_wait(cb, CONNECTED); + wait_event_interruptible(cb->sem, cb->state >= CONNECTED); if (cb->state == ERROR) { - log(LOG_ERR, "wait for CONNECTED state %d\n", cb->state); + PRINTF(cb, "wait for CONNECTED state %d\n", + cb->state); return -1; } } @@ -358,19 +470,22 @@ static int krping_accept(struct krping_c static void krping_setup_wr(struct krping_cb *cb) { - /* XXX X86 only here... not mapping for dma! */ - cb->recv_sgl.addr = vtophys(&cb->recv_buf); + cb->recv_sgl.addr = cb->recv_dma_addr; cb->recv_sgl.length = sizeof cb->recv_buf; - if (cb->use_dmamr) + if (cb->local_dma_lkey) + cb->recv_sgl.lkey = cb->qp->device->local_dma_lkey; + else if (cb->mem == DMA) cb->recv_sgl.lkey = cb->dma_mr->lkey; else cb->recv_sgl.lkey = cb->recv_mr->lkey; cb->rq_wr.sg_list = &cb->recv_sgl; cb->rq_wr.num_sge = 1; - cb->send_sgl.addr = vtophys(&cb->send_buf); + cb->send_sgl.addr = cb->send_dma_addr; cb->send_sgl.length = sizeof cb->send_buf; - if (cb->use_dmamr) + if (cb->local_dma_lkey) + cb->send_sgl.lkey = cb->qp->device->local_dma_lkey; + else if (cb->mem == DMA) cb->send_sgl.lkey = cb->dma_mr->lkey; else cb->send_sgl.lkey = cb->send_mr->lkey; @@ -380,18 +495,39 @@ static void krping_setup_wr(struct krpin cb->sq_wr.sg_list = &cb->send_sgl; cb->sq_wr.num_sge = 1; - cb->rdma_addr = vtophys(cb->rdma_buf); - cb->rdma_sgl.addr = cb->rdma_addr; - if (cb->use_dmamr) - cb->rdma_sgl.lkey = cb->dma_mr->lkey; - else - cb->rdma_sgl.lkey = cb->rdma_mr->lkey; - cb->rdma_sq_wr.send_flags = IB_SEND_SIGNALED; - cb->rdma_sq_wr.sg_list = &cb->rdma_sgl; - cb->rdma_sq_wr.num_sge = 1; + if (cb->server || cb->wlat || cb->rlat || cb->bw) { + cb->rdma_sgl.addr = cb->rdma_dma_addr; + if (cb->mem == MR) + cb->rdma_sgl.lkey = cb->rdma_mr->lkey; + cb->rdma_sq_wr.send_flags = IB_SEND_SIGNALED; + cb->rdma_sq_wr.sg_list = &cb->rdma_sgl; + cb->rdma_sq_wr.num_sge = 1; + } + + switch(cb->mem) { + case FASTREG: + + /* + * A chain of 2 WRs, INVALDATE_MR + FAST_REG_MR. + * both unsignaled. The client uses them to reregister + * the rdma buffers with a new key each iteration. + */ + cb->fastreg_wr.opcode = IB_WR_FAST_REG_MR; + cb->fastreg_wr.wr.fast_reg.page_shift = PAGE_SHIFT; + cb->fastreg_wr.wr.fast_reg.length = cb->size; + cb->fastreg_wr.wr.fast_reg.page_list = cb->page_list; + cb->fastreg_wr.wr.fast_reg.page_list_len = cb->page_list_len; - if (!cb->server || cb->wlat || cb->rlat || cb->bw) { - cb->start_addr = vtophys(cb->start_buf); + cb->invalidate_wr.next = &cb->fastreg_wr; + cb->invalidate_wr.opcode = IB_WR_LOCAL_INV; + break; + case MW: + cb->bind_attr.wr_id = 0xabbaabba; + cb->bind_attr.send_flags = 0; /* unsignaled */ + cb->bind_attr.length = cb->size; + break; + default: + break; } } @@ -401,134 +537,207 @@ static int krping_setup_buffers(struct k struct ib_phys_buf buf; u64 iovbase; - DEBUG_LOG(PFX "krping_setup_buffers called on cb %p\n", cb); + DEBUG_LOG(cb, "krping_setup_buffers called on cb %p\n", cb); + + cb->recv_dma_addr = dma_map_single(cb->pd->device->dma_device, + &cb->recv_buf, + sizeof(cb->recv_buf), DMA_BIDIRECTIONAL); + pci_unmap_addr_set(cb, recv_mapping, cb->recv_dma_addr); + cb->send_dma_addr = dma_map_single(cb->pd->device->dma_device, + &cb->send_buf, sizeof(cb->send_buf), + DMA_BIDIRECTIONAL); + pci_unmap_addr_set(cb, send_mapping, cb->send_dma_addr); - if (cb->use_dmamr) { + if (cb->mem == DMA) { cb->dma_mr = ib_get_dma_mr(cb->pd, IB_ACCESS_LOCAL_WRITE| IB_ACCESS_REMOTE_READ| IB_ACCESS_REMOTE_WRITE); if (IS_ERR(cb->dma_mr)) { - log(LOG_ERR, "reg_dmamr failed\n"); - return PTR_ERR(cb->dma_mr); + DEBUG_LOG(cb, "reg_dmamr failed\n"); + ret = PTR_ERR(cb->dma_mr); + goto bail; } } else { + if (!cb->local_dma_lkey) { + buf.addr = cb->recv_dma_addr; + buf.size = sizeof cb->recv_buf; + DEBUG_LOG(cb, "recv buf dma_addr %llx size %d\n", buf.addr, + (int)buf.size); + iovbase = cb->recv_dma_addr; + cb->recv_mr = ib_reg_phys_mr(cb->pd, &buf, 1, + IB_ACCESS_LOCAL_WRITE, + &iovbase); + + if (IS_ERR(cb->recv_mr)) { + DEBUG_LOG(cb, "recv_buf reg_mr failed\n"); + ret = PTR_ERR(cb->recv_mr); + goto bail; + } - buf.addr = vtophys(&cb->recv_buf); - buf.size = sizeof cb->recv_buf; - iovbase = vtophys(&cb->recv_buf); - cb->recv_mr = ib_reg_phys_mr(cb->pd, &buf, 1, - IB_ACCESS_LOCAL_WRITE, - &iovbase); - - if (IS_ERR(cb->recv_mr)) { - log(LOG_ERR, "recv_buf reg_mr failed\n"); - return PTR_ERR(cb->recv_mr); - } - - buf.addr = vtophys(&cb->send_buf); - buf.size = sizeof cb->send_buf; - iovbase = vtophys(&cb->send_buf); - cb->send_mr = ib_reg_phys_mr(cb->pd, &buf, 1, - 0, &iovbase); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 15:52:02 2014 Return-Path: Delivered-To: svn-src-all@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 9CD71571; Thu, 30 Oct 2014 15:52: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 7DEBFC46; Thu, 30 Oct 2014 15:52: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 s9UFq2bQ098956; Thu, 30 Oct 2014 15:52:02 GMT (envelope-from ambrisko@FreeBSD.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UFq1WV098951; Thu, 30 Oct 2014 15:52:01 GMT (envelope-from ambrisko@FreeBSD.org) Message-Id: <201410301552.s9UFq1WV098951@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ambrisko set sender to ambrisko@FreeBSD.org using -f From: Doug Ambrisko Date: Thu, 30 Oct 2014 15:52:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273865 - in head: sbin/fsck_msdosfs sys/boot/amd64/boot1.efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 15:52:02 -0000 Author: ambrisko Date: Thu Oct 30 15:52:01 2014 New Revision: 273865 URL: https://svnweb.freebsd.org/changeset/base/273865 Log: Make UEFI booting of 4Kn disks work: - convert boot1.efi to corrrectly calculate the lba for what the media reports and convert the size based on what FreeBSD uses. The existing code would use the 512 byte lba and convert the size using 4K byte size. - make fsck_msdosfs read the boot block as 4K so the read doesn't fail on a 4Kn drive since FreeBSD will error out parition reads of a block. Make the bpbBytesPerSec check a multiple of 512 since it can be 512 or 4K depending on the disk. This allows fsck to pass checking the EFI partition on a 4Kn disk. To create the EFI file system I used: newfs_msdos -F 32 -S 4096 -c 1 -m 0xf8 This works for booting 512 and 4Kn disks. Caveat is that loader.efi cannot read the 4Kn EFI partition. This isn't critical right now since boot1.efi will read loader.efi from the ufs partition. It looks like loader.efi can be fixed via making some of the 512 bytes reads more flexible. loader.efi doesn't have trouble reading the ufs partition. This is probably a simple fix. I now have FreeBSD installed on a system with 4Kn drives and tested the same code works on 512. MFC after: 1 week Modified: head/sbin/fsck_msdosfs/boot.c head/sbin/fsck_msdosfs/dosfs.h head/sys/boot/amd64/boot1.efi/boot1.c Modified: head/sbin/fsck_msdosfs/boot.c ============================================================================== --- head/sbin/fsck_msdosfs/boot.c Thu Oct 30 15:41:25 2014 (r273864) +++ head/sbin/fsck_msdosfs/boot.c Thu Oct 30 15:52:01 2014 (r273865) @@ -181,7 +181,7 @@ readboot(int dosfs, struct bootblock *bo boot->bpbResSectors + boot->bpbFATs * boot->FATsecs - CLUST_FIRST * boot->bpbSecPerClust; - if (boot->bpbBytesPerSec % DOSBOOTBLOCKSIZE != 0) { + if (boot->bpbBytesPerSec % DOSBOOTBLOCKSIZE_REAL != 0) { pfatal("Invalid sector size: %u", boot->bpbBytesPerSec); return FSFATAL; } Modified: head/sbin/fsck_msdosfs/dosfs.h ============================================================================== --- head/sbin/fsck_msdosfs/dosfs.h Thu Oct 30 15:41:25 2014 (r273864) +++ head/sbin/fsck_msdosfs/dosfs.h Thu Oct 30 15:52:01 2014 (r273865) @@ -30,7 +30,9 @@ #ifndef DOSFS_H #define DOSFS_H -#define DOSBOOTBLOCKSIZE 512 +/* support 4Kn disk reads */ +#define DOSBOOTBLOCKSIZE_REAL 512 +#define DOSBOOTBLOCKSIZE 4096 typedef u_int32_t cl_t; /* type holding a cluster number */ Modified: head/sys/boot/amd64/boot1.efi/boot1.c ============================================================================== --- head/sys/boot/amd64/boot1.efi/boot1.c Thu Oct 30 15:41:25 2014 (r273864) +++ head/sys/boot/amd64/boot1.efi/boot1.c Thu Oct 30 15:52:01 2014 (r273865) @@ -168,9 +168,12 @@ static int dskread(void *buf, u_int64_t lba, int nblk) { EFI_STATUS status; + int size; + lba = lba / (bootdev->Media->BlockSize / DEV_BSIZE); + size = nblk * DEV_BSIZE; status = bootdev->ReadBlocks(bootdev, bootdev->Media->MediaId, lba, - nblk * bootdev->Media->BlockSize, buf); + size, buf); if (EFI_ERROR(status)) return (-1); From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 16:06:00 2014 Return-Path: Delivered-To: svn-src-all@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 D1AE98F5; Thu, 30 Oct 2014 16:06:00 +0000 (UTC) Received: from mail-wg0-x22e.google.com (mail-wg0-x22e.google.com [IPv6:2a00:1450:400c:c00::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3EC7D72; Thu, 30 Oct 2014 16:05:59 +0000 (UTC) Received: by mail-wg0-f46.google.com with SMTP id x13so6019457wgg.5 for ; Thu, 30 Oct 2014 09:05:58 -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=kFnNidkO9mgcO10DmgkIfIOCEaiQywCHqpedEJSEkvw=; b=FHN1jlXIVtwOCTg1c17XuRJ4NOTfX5RTNraTIKq7QNKoI0vAdJFAQ3uDN6M5NjBzZV MLQcg/M1euEyXvkLsFViu3XxnwKtb+wiIJvVmPcnU2PlB2QH+8SZ6wZncKHge3gLsvbd L1/R8cifmapPUEYdZT+KmMwaWdvYPnGKOgamBc2+gvsZvYezBo1PdIAMLHbUWPw6NfXR mdcFFN55Zt6UhFmVKrZhMcdpnpojikmdsbpnJplEibsE3aO+AYMnluEpvP1FWHM/WusK 5fd9f/jyN4AwlRcm3nm69Ntsn+O9VsaS6wUVAlUkKGFMY6eQYPHxqCl/yTr2uTAml+/p +oCA== MIME-Version: 1.0 X-Received: by 10.180.83.98 with SMTP id p2mr12956404wiy.20.1414685158191; Thu, 30 Oct 2014 09:05:58 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Thu, 30 Oct 2014 09:05:58 -0700 (PDT) In-Reply-To: <54524E7A.1020802@FreeBSD.org> References: <201410301059.s9UAxwAg055812@svn.freebsd.org> <1414668869.979804.185070381.0D4C866C@webmail.messagingengine.com> <54524E7A.1020802@FreeBSD.org> Date: Thu, 30 Oct 2014 09:05:58 -0700 X-Google-Sender-Auth: 07BV6kgnY5Faqvg5MVqT0cjbQmg Message-ID: Subject: Re: svn commit: r273855 - head/sys/netinet6 From: Adrian Chadd To: "Andrey V. Elsukov" Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , Bruce Simpson , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 16:06:01 -0000 Btw - this is also a problem in the wifi stack. When you destroy an interface, do you want to make sure the STA "going away" frames go out and are ACKed before you finish tearing down the interface? We don't really have any framework / standards in place for how to put tearing down an interface on hold whilst we notify things and wait for packets to finish transmitting, so we don't bother. (I had the same issue with net80211 / ath and transmit buffers hanging around after I destroyed a VAP. They came from the "disassociate" packet being generated when the interface was being torn down.) -adrian On 30 October 2014 07:43, Andrey V. Elsukov wrote: > On 30.10.2014 14:34, Bruce Simpson wrote: >> Hello, >> >> This is a really inconvenient time for me (I am up against a deadline) >> but I am not 100% comfortable with this change. >> >> On Thu, 30 Oct 2014, at 10:59, Andrey V. Elsukov wrote: >>> Log: >>> Fix mbuf leak in IPv6 multicast code. >>> When multicast capable interface goes away, it leaves multicast groups, >>> this leads to generate MLD reports, but MLD code does deffered send and >>> MLD reports are queued in the in6_multi's in6m_scq ifq. The problem is >>> that in6_multi structures are freed when interface leaves multicast >>> groups >>> and thread that does deffered send will not take these queued packets. >> >> A few comments: >> >> 1) Stylistic -- a change of this kind should probably be part of >> inm_purge() itself because it modifies state which is private to the >> group membership. >> >> 2) Logical -- The patch forces pending (queued) state change record >> fragments to be freed when the parent interface is taken down. >> Unfortunately, those are pending for a reason; there has been a state >> change, and MLD needs to communicate it upstream to on-link routers (and >> snooping switches). >> >> So - there is a risk with this approach that upstream MLD listener (e.g. >> router, switch) will be inconsistent, at least until the next General >> Query. > > I'm not quite sure, but I think that the leak happened only when > interface disappeared. In case when system just leaves the group, MLD > code takes reference to in6_multi and releases it when fasttimo handler > dispatches packets. When interface is disappearing, in6_ifdetach() calls > in6_purgemaddrs(), where all references to in6_multi released again. Now > in6m_release_locked() will drain queue when in6_multi has no more > references. > > -- > WBR, Andrey V. Elsukov > From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 16:26:18 2014 Return-Path: Delivered-To: svn-src-all@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 89D529D; Thu, 30 Oct 2014 16:26: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 76000F7A; Thu, 30 Oct 2014 16:26: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 s9UGQIKA014235; Thu, 30 Oct 2014 16:26:18 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UGQIJS014234; Thu, 30 Oct 2014 16:26:18 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201410301626.s9UGQIJS014234@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Thu, 30 Oct 2014 16:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273866 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 16:26:18 -0000 Author: jpaetzel Date: Thu Oct 30 16:26:17 2014 New Revision: 273866 URL: https://svnweb.freebsd.org/changeset/base/273866 Log: Plug memory ordering holes in buf_ring_enqueue. For at least some users this patch eliminates the races previously discussed on the mailing list. Submitted by: oleg Reviewed by: kmacy MFC after: 2 weeks Tested by: kmacy,rpaulo Modified: head/sys/sys/buf_ring.h Modified: head/sys/sys/buf_ring.h ============================================================================== --- head/sys/sys/buf_ring.h Thu Oct 30 15:52:01 2014 (r273865) +++ head/sys/sys/buf_ring.h Thu Oct 30 16:26:17 2014 (r273866) @@ -64,8 +64,7 @@ struct buf_ring { static __inline int buf_ring_enqueue(struct buf_ring *br, void *buf) { - uint32_t prod_head, prod_next; - uint32_t cons_tail; + uint32_t prod_head, prod_next, cons_tail; #ifdef DEBUG_BUFRING int i; for (i = br->br_cons_head; i != br->br_prod_head; @@ -77,16 +76,20 @@ buf_ring_enqueue(struct buf_ring *br, vo critical_enter(); do { prod_head = br->br_prod_head; + prod_next = (prod_head + 1) & br->br_prod_mask; cons_tail = br->br_cons_tail; - prod_next = (prod_head + 1) & br->br_prod_mask; - if (prod_next == cons_tail) { - br->br_drops++; - critical_exit(); - return (ENOBUFS); + rmb(); + if (prod_head == br->br_prod_head && + cons_tail == br->br_cons_tail) { + br->br_drops++; + critical_exit(); + return (ENOBUFS); + } + continue; } - } while (!atomic_cmpset_int(&br->br_prod_head, prod_head, prod_next)); + } while (!atomic_cmpset_acq_int(&br->br_prod_head, prod_head, prod_next)); #ifdef DEBUG_BUFRING if (br->br_ring[prod_head] != NULL) panic("dangling value in enqueue"); @@ -94,19 +97,13 @@ buf_ring_enqueue(struct buf_ring *br, vo br->br_ring[prod_head] = buf; /* - * The full memory barrier also avoids that br_prod_tail store - * is reordered before the br_ring[prod_head] is full setup. - */ - mb(); - - /* * If there are other enqueues in progress * that preceeded us, we need to wait for them * to complete */ while (br->br_prod_tail != prod_head) cpu_spinwait(); - br->br_prod_tail = prod_next; + atomic_store_rel_int(&br->br_prod_tail, prod_next); critical_exit(); return (0); } @@ -119,37 +116,23 @@ static __inline void * buf_ring_dequeue_mc(struct buf_ring *br) { uint32_t cons_head, cons_next; - uint32_t prod_tail; void *buf; - int success; critical_enter(); do { cons_head = br->br_cons_head; - prod_tail = br->br_prod_tail; - cons_next = (cons_head + 1) & br->br_cons_mask; - - if (cons_head == prod_tail) { + + if (cons_head == br->br_prod_tail) { critical_exit(); return (NULL); } - - success = atomic_cmpset_int(&br->br_cons_head, cons_head, - cons_next); - } while (success == 0); + } while (!atomic_cmpset_acq_int(&br->br_cons_head, cons_head, cons_next)); buf = br->br_ring[cons_head]; #ifdef DEBUG_BUFRING br->br_ring[cons_head] = NULL; #endif - - /* - * The full memory barrier also avoids that br_ring[cons_read] - * load is reordered after br_cons_tail is set. - */ - mb(); - /* * If there are other dequeues in progress * that preceeded us, we need to wait for them @@ -158,7 +141,7 @@ buf_ring_dequeue_mc(struct buf_ring *br) while (br->br_cons_tail != cons_head) cpu_spinwait(); - br->br_cons_tail = cons_next; + atomic_store_rel_int(&br->br_cons_tail, cons_next); critical_exit(); return (buf); From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 16:36:40 2014 Return-Path: Delivered-To: svn-src-all@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 E4C608A4; Thu, 30 Oct 2014 16:36:40 +0000 (UTC) Received: from mail-pa0-x230.google.com (mail-pa0-x230.google.com [IPv6:2607:f8b0:400e:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A9AEA130; Thu, 30 Oct 2014 16:36:40 +0000 (UTC) Received: by mail-pa0-f48.google.com with SMTP id ey11so5800326pad.21 for ; Thu, 30 Oct 2014 09:36:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=a+tVQqbQJcxMyKZdkdH0Be/IXQwWqRVqBxs+FjP2j6w=; b=tO2VRPgjAHKmkeHM7VEC6LU6+WsYpB1KyhyiX7d+7jAQE1xEks3cC1ip3dLvhHRVFa JuwMSTr9YZvl1onseyryT3GEDihFIBTxoqV0kb9SNIlA/STyYvoGP0tgP9fo8ux2mxXW 3qredzPU5tKH0Co3ChKgj0Axy4n6w2lr1CJchpZZM8JWpNUuHPFmfiBdG0nFtrmEv+w7 ySFQ0f1gElVVdjyfdIJffbMjI/efKn3DQ0WL9JPTYXpujOKm/3OIuS4fixxQwvII9c3q KUYvxI1DBRXEZQZD70nGmEx6wuBd9P8B/Fs708Sad3jNkWkAkn3wptIgf/x3X1n0A3nb znqw== X-Received: by 10.66.150.164 with SMTP id uj4mr18704811pab.14.1414687000082; Thu, 30 Oct 2014 09:36:40 -0700 (PDT) Received: from ?IPv6:2601:8:ab80:7d6:8d37:6352:ed8b:4617? ([2601:8:ab80:7d6:8d37:6352:ed8b:4617]) by mx.google.com with ESMTPSA id c8sm7597409pds.48.2014.10.30.09.36.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 30 Oct 2014 09:36:39 -0700 (PDT) References: <201410301626.s9UGQIJS014234@svn.freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <201410301626.s9UGQIJS014234@svn.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <5EDC9AC8-D9DE-4C78-86CB-3A64E558633B@gmail.com> X-Mailer: iPhone Mail (12B411) From: Garrett Cooper Subject: Re: svn commit: r273866 - head/sys/sys Date: Thu, 30 Oct 2014 09:36:39 -0700 To: Josh Paetzel Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 16:36:41 -0000 > On Oct 30, 2014, at 09:26, Josh Paetzel wrote: > > Author: jpaetzel > Date: Thu Oct 30 16:26:17 2014 > New Revision: 273866 > URL: https://svnweb.freebsd.org/changeset/base/273866 > > Log: > Plug memory ordering holes in buf_ring_enqueue. For at least some > users this patch eliminates the races previously discussed on the > mailing list. Hi Josh! Do you have a link to the discussion thread you can provide? Thank you! From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 16:57:57 2014 Return-Path: Delivered-To: svn-src-all@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 CB28320B; Thu, 30 Oct 2014 16:57: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 B71E4382; Thu, 30 Oct 2014 16:57: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 s9UGvvpj029468; Thu, 30 Oct 2014 16:57:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UGvvA9029467; Thu, 30 Oct 2014 16:57:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410301657.s9UGvvA9029467@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 30 Oct 2014 16:57:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273867 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 16:57:57 -0000 Author: hselasky Date: Thu Oct 30 16:57:56 2014 New Revision: 273867 URL: https://svnweb.freebsd.org/changeset/base/273867 Log: Fix compile warning by removing unused variable. MFC: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/net/mlx4/mcg.c Modified: head/sys/ofed/drivers/net/mlx4/mcg.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/mcg.c Thu Oct 30 16:26:17 2014 (r273866) +++ head/sys/ofed/drivers/net/mlx4/mcg.c Thu Oct 30 16:57:56 2014 (r273867) @@ -39,9 +39,6 @@ #include "mlx4.h" - -static const u8 zero_gid[16]; /* automatically initialized to 0 */ - int mlx4_get_mgm_entry_size(struct mlx4_dev *dev) { return 1 << dev->oper_log_mgm_entry_size; From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 17:05:40 2014 Return-Path: Delivered-To: svn-src-all@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 5A543581; Thu, 30 Oct 2014 17:05: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 4204F655; Thu, 30 Oct 2014 17:05: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 s9UH5eoe034005; Thu, 30 Oct 2014 17:05:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UH5WXW033971; Thu, 30 Oct 2014 17:05:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410301705.s9UH5WXW033971@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 30 Oct 2014 17:05:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r273868 - in stable/9/sys: contrib/rdma/krping ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mlx4 ofed/drivers/infiniband/hw/mthca ofed/drivers/infiniband/ulp/ipoib ofed/drive... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 17:05:40 -0000 Author: hselasky Date: Thu Oct 30 17:05:32 2014 New Revision: 273868 URL: https://svnweb.freebsd.org/changeset/base/273868 Log: MFC r273135 and r273867: Update the OFED Linux compatibility layer and Mellanox hardware driver(s): - Properly name an inclusion guard. - Fix compile warnings regarding unsigned enums. - Fix compile warning regarding unused variable. - Add two new sysctl nodes. - Remove all empty linux header files. - Make an error printout more verbose. - Use "mod_delayed_work()" instead of cancelling and starting a timeout. - Implement more Linux scatterlist functions. - Don't forget to add "options OFED" to the kernel configuration file before using infiniband. Sponsored by: Mellanox Technologies Deleted: stable/9/sys/ofed/drivers/net/mlx4/en_params.c stable/9/sys/ofed/drivers/net/mlx4/xrcd.c stable/9/sys/ofed/include/asm/page.h stable/9/sys/ofed/include/linux/ethtool.h stable/9/sys/ofed/include/linux/inet.h stable/9/sys/ofed/include/linux/mount.h Modified: stable/9/sys/contrib/rdma/krping/krping.c stable/9/sys/ofed/drivers/infiniband/core/addr.c stable/9/sys/ofed/drivers/infiniband/core/agent.c stable/9/sys/ofed/drivers/infiniband/core/ucm.c stable/9/sys/ofed/drivers/infiniband/core/uverbs_main.c stable/9/sys/ofed/drivers/infiniband/hw/mlx4/ah.c stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_config_reg.h stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_uar.c stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_verbs.c stable/9/sys/ofed/drivers/net/mlx4/Makefile stable/9/sys/ofed/drivers/net/mlx4/en_ethtool.c stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c stable/9/sys/ofed/drivers/net/mlx4/en_selftest.c stable/9/sys/ofed/drivers/net/mlx4/en_tx.c stable/9/sys/ofed/drivers/net/mlx4/mcg.c stable/9/sys/ofed/drivers/net/mlx4/pd.c stable/9/sys/ofed/include/linux/completion.h stable/9/sys/ofed/include/linux/etherdevice.h stable/9/sys/ofed/include/linux/mlx4/device.h stable/9/sys/ofed/include/linux/mlx4/driver.h stable/9/sys/ofed/include/linux/netdevice.h stable/9/sys/ofed/include/linux/scatterlist.h stable/9/sys/ofed/include/linux/vmalloc.h stable/9/sys/ofed/include/rdma/ib_addr.h stable/9/sys/ofed/include/rdma/ib_smi.h stable/9/sys/ofed/include/rdma/ib_user_cm.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/contrib/rdma/krping/krping.c ============================================================================== --- stable/9/sys/contrib/rdma/krping/krping.c Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/contrib/rdma/krping/krping.c Thu Oct 30 17:05:32 2014 (r273868) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: stable/9/sys/ofed/drivers/infiniband/core/addr.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/core/addr.c Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/drivers/infiniband/core/addr.c Thu Oct 30 17:05:32 2014 (r273868) @@ -35,10 +35,15 @@ #include #include +#include #include +#include +#include #include #include #include +#include + MODULE_AUTHOR("Sean Hefty"); MODULE_DESCRIPTION("IB Address Translation"); @@ -189,13 +194,11 @@ static void set_timeout(unsigned long ti { unsigned long delay; - cancel_delayed_work(&work); - delay = time - jiffies; if ((long)delay <= 0) delay = 1; - queue_delayed_work(addr_wq, &work, delay); + mod_delayed_work(addr_wq, &work, delay); } static void queue_req(struct addr_req *req) @@ -620,7 +623,7 @@ static struct notifier_block nb = { .notifier_call = netevent_callback }; -static int addr_init(void) +static int __init addr_init(void) { INIT_DELAYED_WORK(&work, process_req); addr_wq = create_singlethread_workqueue("ib_addr"); @@ -631,7 +634,7 @@ static int addr_init(void) return 0; } -static void addr_cleanup(void) +static void __exit addr_cleanup(void) { unregister_netevent_notifier(&nb); destroy_workqueue(addr_wq); Modified: stable/9/sys/ofed/drivers/infiniband/core/agent.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/core/agent.c Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/drivers/infiniband/core/agent.c Thu Oct 30 17:05:32 2014 (r273868) @@ -101,7 +101,8 @@ void agent_send_response(struct ib_mad * agent = port_priv->agent[qpn]; ah = ib_create_ah_from_wc(agent->qp->pd, wc, grh, port_num); if (IS_ERR(ah)) { - printk(KERN_ERR SPFX "ib_create_ah_from_wc error\n"); + printk(KERN_ERR SPFX "ib_create_ah_from_wc error %ld\n", + PTR_ERR(ah)); return; } Modified: stable/9/sys/ofed/drivers/infiniband/core/ucm.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/core/ucm.c Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/drivers/infiniband/core/ucm.c Thu Oct 30 17:05:32 2014 (r273868) @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include Modified: stable/9/sys/ofed/drivers/infiniband/core/uverbs_main.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/core/uverbs_main.c Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/drivers/infiniband/core/uverbs_main.c Thu Oct 30 17:05:32 2014 (r273868) @@ -40,7 +40,6 @@ #include #include #include -#include #include #include Modified: stable/9/sys/ofed/drivers/infiniband/hw/mlx4/ah.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/hw/mlx4/ah.c Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/drivers/infiniband/hw/mlx4/ah.c Thu Oct 30 17:05:32 2014 (r273868) @@ -38,7 +38,6 @@ #include #include -#include #include #include "mlx4_ib.h" Modified: stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_config_reg.h ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_config_reg.h Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_config_reg.h Thu Oct 30 17:05:32 2014 (r273868) @@ -34,7 +34,7 @@ #ifndef MTHCA_CONFIG_REG_H #define MTHCA_CONFIG_REG_H -#include +#include #define MTHCA_HCR_BASE 0x80680 #define MTHCA_HCR_SIZE 0x0001c Modified: stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c Thu Oct 30 17:05:32 2014 (r273868) @@ -36,7 +36,7 @@ #include #include -#include +#include #include "mthca_memfree.h" #include "mthca_dev.h" Modified: stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_uar.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_uar.c Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_uar.c Thu Oct 30 17:05:32 2014 (r273868) @@ -30,7 +30,7 @@ * SOFTWARE. */ -#include /* PAGE_SHIFT */ +#include #include "mthca_dev.h" #include "mthca_memfree.h" Modified: stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c Thu Oct 30 17:05:32 2014 (r273868) @@ -31,7 +31,6 @@ */ #include -#include #include #include "ipoib.h" Modified: stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_verbs.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_verbs.c Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_verbs.c Thu Oct 30 17:05:32 2014 (r273868) @@ -32,7 +32,6 @@ */ #include "ipoib.h" -#include int ipoib_mcast_attach(struct ipoib_dev_priv *priv, u16 mlid, union ib_gid *mgid, int set_qkey) { Modified: stable/9/sys/ofed/drivers/net/mlx4/Makefile ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/Makefile Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/drivers/net/mlx4/Makefile Thu Oct 30 17:05:32 2014 (r273868) @@ -31,4 +31,3 @@ opt_inet6.h: .include CFLAGS+= -Wno-cast-qual -Wno-pointer-arith -fms-extensions - Modified: stable/9/sys/ofed/drivers/net/mlx4/en_ethtool.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_ethtool.c Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/drivers/net/mlx4/en_ethtool.c Thu Oct 30 17:05:32 2014 (r273868) @@ -32,7 +32,6 @@ */ #include -#include #include #include #include Modified: stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c Thu Oct 30 17:05:32 2014 (r273868) @@ -2335,9 +2335,11 @@ static void mlx4_en_sysctl_conf(struct m struct sysctl_oid_list *node_list; struct sysctl_oid *coal; struct sysctl_oid_list *coal_list; + const char *pnameunit; dev = priv->dev; ctx = &priv->conf_ctx; + pnameunit = device_get_nameunit(priv->mdev->pdev->dev.bsddev); sysctl_ctx_init(ctx); priv->sysctl = SYSCTL_ADD_NODE(ctx, SYSCTL_STATIC_CHILDREN(_hw), @@ -2350,10 +2352,10 @@ static void mlx4_en_sysctl_conf(struct m CTLFLAG_RW, &priv->msg_enable, 0, "Driver message enable bitfield"); SYSCTL_ADD_UINT(ctx, node_list, OID_AUTO, "rx_rings", - CTLTYPE_INT | CTLFLAG_RD, &priv->rx_ring_num, 0, + CTLFLAG_RD, &priv->rx_ring_num, 0, "Number of receive rings"); SYSCTL_ADD_UINT(ctx, node_list, OID_AUTO, "tx_rings", - CTLTYPE_INT | CTLFLAG_RD, &priv->tx_ring_num, 0, + CTLFLAG_RD, &priv->tx_ring_num, 0, "Number of transmit rings"); SYSCTL_ADD_PROC(ctx, node_list, OID_AUTO, "rx_size", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, priv, 0, @@ -2367,6 +2369,12 @@ static void mlx4_en_sysctl_conf(struct m SYSCTL_ADD_PROC(ctx, node_list, OID_AUTO, "rx_ppp", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, priv, 0, mlx4_en_set_rx_ppp, "I", "RX Per-priority pause"); + SYSCTL_ADD_UINT(ctx, node_list, OID_AUTO, "port_num", + CTLFLAG_RD, &priv->port, 0, + "Port Number"); + SYSCTL_ADD_STRING(ctx, node_list, OID_AUTO, "device_name", + CTLFLAG_RD, __DECONST(void *, pnameunit), 0, + "PCI device name"); /* Add coalescer configuration. */ coal = SYSCTL_ADD_NODE(ctx, node_list, OID_AUTO, Modified: stable/9/sys/ofed/drivers/net/mlx4/en_selftest.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_selftest.c Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/drivers/net/mlx4/en_selftest.c Thu Oct 30 17:05:32 2014 (r273868) @@ -32,7 +32,6 @@ */ #include -#include #include #include #include Modified: stable/9/sys/ofed/drivers/net/mlx4/en_tx.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_tx.c Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/drivers/net/mlx4/en_tx.c Thu Oct 30 17:05:32 2014 (r273868) @@ -31,7 +31,7 @@ * */ -#include +#include #include #include #include Modified: stable/9/sys/ofed/drivers/net/mlx4/mcg.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/mcg.c Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/drivers/net/mlx4/mcg.c Thu Oct 30 17:05:32 2014 (r273868) @@ -39,9 +39,6 @@ #include "mlx4.h" - -static const u8 zero_gid[16]; /* automatically initialized to 0 */ - int mlx4_get_mgm_entry_size(struct mlx4_dev *dev) { return 1 << dev->oper_log_mgm_entry_size; Modified: stable/9/sys/ofed/drivers/net/mlx4/pd.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/pd.c Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/drivers/net/mlx4/pd.c Thu Oct 30 17:05:32 2014 (r273868) @@ -35,7 +35,7 @@ #include #include -#include +#include #include "mlx4.h" #include "icm.h" Modified: stable/9/sys/ofed/include/linux/completion.h ============================================================================== --- stable/9/sys/ofed/include/linux/completion.h Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/include/linux/completion.h Thu Oct 30 17:05:32 2014 (r273868) @@ -27,8 +27,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _FBSD_COMPLETION_H_ -#define _FBSD_COMPLETION_H_ +#ifndef _LINUX_COMPLETION_H_ +#define _LINUX_COMPLETION_H_ #include Modified: stable/9/sys/ofed/include/linux/etherdevice.h ============================================================================== --- stable/9/sys/ofed/include/linux/etherdevice.h Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/include/linux/etherdevice.h Thu Oct 30 17:05:32 2014 (r273868) @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2014 Mellanox Technologies, Ltd. All rights reserved. * Modified: stable/9/sys/ofed/include/linux/mlx4/device.h ============================================================================== --- stable/9/sys/ofed/include/linux/mlx4/device.h Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/include/linux/mlx4/device.h Thu Oct 30 17:05:32 2014 (r273868) @@ -1036,6 +1036,7 @@ enum mlx4_net_trans_rule_id { MLX4_NET_TRANS_RULE_ID_TCP, MLX4_NET_TRANS_RULE_ID_UDP, MLX4_NET_TRANS_RULE_NUM, /* should be last */ + MLX4_NET_TRANS_RULE_DUMMY = -1, /* force enum to be signed */ }; extern const u16 __sw_id_hw[]; @@ -1058,6 +1059,7 @@ enum mlx4_net_trans_promisc_mode { MLX4_FS_UC_SNIFFER, MLX4_FS_MC_SNIFFER, MLX4_FS_MODE_NUM, /* should be last */ + MLX4_FS_MODE_DUMMY = -1, /* force enum to be signed */ }; struct mlx4_spec_eth { Modified: stable/9/sys/ofed/include/linux/mlx4/driver.h ============================================================================== --- stable/9/sys/ofed/include/linux/mlx4/driver.h Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/include/linux/mlx4/driver.h Thu Oct 30 17:05:32 2014 (r273868) @@ -121,7 +121,7 @@ void *mlx4_get_protocol_dev(struct mlx4_ #ifndef ETH_ALEN #define ETH_ALEN 6 #endif -static inline u64 mlx4_mac_to_u64(u8 *addr) +static inline u64 mlx4_mac_to_u64(const u8 *addr) { u64 mac = 0; int i; Modified: stable/9/sys/ofed/include/linux/netdevice.h ============================================================================== --- stable/9/sys/ofed/include/linux/netdevice.h Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/include/linux/netdevice.h Thu Oct 30 17:05:32 2014 (r273868) @@ -40,7 +40,6 @@ #include #include -#include #include #include #include Modified: stable/9/sys/ofed/include/linux/scatterlist.h ============================================================================== --- stable/9/sys/ofed/include/linux/scatterlist.h Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/include/linux/scatterlist.h Thu Oct 30 17:05:32 2014 (r273868) @@ -31,6 +31,21 @@ #define _LINUX_SCATTERLIST_H_ #include +#include + +/* + * SG table design. + * + * If flags bit 0 is set, then the sg field contains a pointer to the next sg + * table list. Otherwise the next entry is at sg + 1, can be determined using + * the sg_is_chain() function. + * + * If flags bit 1 is set, then this sg entry is the last element in a list, + * can be determined using the sg_is_last() function. + * + * See sg_next(). + * + */ struct scatterlist { union { @@ -49,6 +64,12 @@ struct sg_table { unsigned int orig_nents; /* original size of list */ }; +/* + * Maximum number of entries that will be allocated in one piece, if + * a list larger than this is required then chaining will be utilized. + */ +#define SG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist)) + #define sg_dma_address(sg) (sg)->address #define sg_dma_len(sg) (sg)->length #define sg_page(sg) (sg)->sl_un.page @@ -99,6 +120,212 @@ sg_phys(struct scatterlist *sg) return sg_page(sg)->phys_addr + sg->offset; } +/** + * sg_chain - Chain two sglists together + * @prv: First scatterlist + * @prv_nents: Number of entries in prv + * @sgl: Second scatterlist + * + * Description: + * Links @prv@ and @sgl@ together, to form a longer scatterlist. + * + **/ +static inline void +sg_chain(struct scatterlist *prv, unsigned int prv_nents, + struct scatterlist *sgl) +{ +/* + * offset and length are unused for chain entry. Clear them. + */ + struct scatterlist *sg = &prv[prv_nents - 1]; + + sg->offset = 0; + sg->length = 0; + + /* + * Indicate a link pointer, and set the link to the second list. + */ + sg->flags = SG_CHAIN; + sg->sl_un.sg = sgl; +} + +/** + * sg_mark_end - Mark the end of the scatterlist + * @sg: SG entryScatterlist + * + * Description: + * Marks the passed in sg entry as the termination point for the sg + * table. A call to sg_next() on this entry will return NULL. + * + **/ +static inline void sg_mark_end(struct scatterlist *sg) +{ + sg->flags = SG_END; +} + +/** + * __sg_free_table - Free a previously mapped sg table + * @table: The sg table header to use + * @max_ents: The maximum number of entries per single scatterlist + * + * Description: + * Free an sg table previously allocated and setup with + * __sg_alloc_table(). The @max_ents value must be identical to + * that previously used with __sg_alloc_table(). + * + **/ +static inline void +__sg_free_table(struct sg_table *table, unsigned int max_ents) +{ + struct scatterlist *sgl, *next; + + if (unlikely(!table->sgl)) + return; + + sgl = table->sgl; + while (table->orig_nents) { + unsigned int alloc_size = table->orig_nents; + unsigned int sg_size; + + /* + * If we have more than max_ents segments left, + * then assign 'next' to the sg table after the current one. + * sg_size is then one less than alloc size, since the last + * element is the chain pointer. + */ + if (alloc_size > max_ents) { + next = sgl[max_ents - 1].sl_un.sg; + alloc_size = max_ents; + sg_size = alloc_size - 1; + } else { + sg_size = alloc_size; + next = NULL; + } + + table->orig_nents -= sg_size; + kfree(sgl); + sgl = next; + } + + table->sgl = NULL; +} + +/** + * sg_free_table - Free a previously allocated sg table + * @table: The mapped sg table header + * + **/ +static inline void +sg_free_table(struct sg_table *table) +{ + __sg_free_table(table, SG_MAX_SINGLE_ALLOC); +} + +/** + * __sg_alloc_table - Allocate and initialize an sg table with given allocator + * @table: The sg table header to use + * @nents: Number of entries in sg list + * @max_ents: The maximum number of entries the allocator returns per call + * @gfp_mask: GFP allocation mask + * + * Description: + * This function returns a @table @nents long. The allocator is + * defined to return scatterlist chunks of maximum size @max_ents. + * Thus if @nents is bigger than @max_ents, the scatterlists will be + * chained in units of @max_ents. + * + * Notes: + * If this function returns non-0 (eg failure), the caller must call + * __sg_free_table() to cleanup any leftover allocations. + * + **/ +static inline int +__sg_alloc_table(struct sg_table *table, unsigned int nents, + unsigned int max_ents, gfp_t gfp_mask) +{ + struct scatterlist *sg, *prv; + unsigned int left; + + memset(table, 0, sizeof(*table)); + + if (nents == 0) + return -EINVAL; + left = nents; + prv = NULL; + do { + unsigned int sg_size, alloc_size = left; + + if (alloc_size > max_ents) { + alloc_size = max_ents; + sg_size = alloc_size - 1; + } else + sg_size = alloc_size; + + left -= sg_size; + + sg = kmalloc(alloc_size * sizeof(struct scatterlist), gfp_mask); + if (unlikely(!sg)) { + /* + * Adjust entry count to reflect that the last + * entry of the previous table won't be used for + * linkage. Without this, sg_kfree() may get + * confused. + */ + if (prv) + table->nents = ++table->orig_nents; + + return -ENOMEM; + } + + sg_init_table(sg, alloc_size); + table->nents = table->orig_nents += sg_size; + + /* + * If this is the first mapping, assign the sg table header. + * If this is not the first mapping, chain previous part. + */ + if (prv) + sg_chain(prv, max_ents, sg); + else + table->sgl = sg; + + /* + * If no more entries after this one, mark the end + */ + if (!left) + sg_mark_end(&sg[sg_size - 1]); + + prv = sg; + } while (left); + + return 0; +} + +/** + * sg_alloc_table - Allocate and initialize an sg table + * @table: The sg table header to use + * @nents: Number of entries in sg list + * @gfp_mask: GFP allocation mask + * + * Description: + * Allocate and initialize an sg table. If @nents@ is larger than + * SG_MAX_SINGLE_ALLOC a chained sg table will be setup. + * + **/ + +static inline int +sg_alloc_table(struct sg_table *table, unsigned int nents, gfp_t gfp_mask) +{ + int ret; + + ret = __sg_alloc_table(table, nents, SG_MAX_SINGLE_ALLOC, + gfp_mask); + if (unlikely(ret)) + __sg_free_table(table, SG_MAX_SINGLE_ALLOC); + + return ret; +} + #define for_each_sg(sglist, sg, sgmax, _itr) \ for (_itr = 0, sg = (sglist); _itr < (sgmax); _itr++, sg = sg_next(sg)) Modified: stable/9/sys/ofed/include/linux/vmalloc.h ============================================================================== --- stable/9/sys/ofed/include/linux/vmalloc.h Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/include/linux/vmalloc.h Thu Oct 30 17:05:32 2014 (r273868) @@ -30,7 +30,7 @@ #ifndef _LINUX_VMALLOC_H_ #define _LINUX_VMALLOC_H_ -#include +#include #define VM_MAP 0x0000 #define PAGE_KERNEL 0x0000 Modified: stable/9/sys/ofed/include/rdma/ib_addr.h ============================================================================== --- stable/9/sys/ofed/include/rdma/ib_addr.h Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/include/rdma/ib_addr.h Thu Oct 30 17:05:32 2014 (r273868) @@ -41,7 +41,6 @@ #include #include #include -#include #include struct rdma_addr_client { Modified: stable/9/sys/ofed/include/rdma/ib_smi.h ============================================================================== --- stable/9/sys/ofed/include/rdma/ib_smi.h Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/include/rdma/ib_smi.h Thu Oct 30 17:05:32 2014 (r273868) @@ -38,6 +38,7 @@ #define IB_SMI_H #include +#include #define IB_SMP_DATA_SIZE 64 #define IB_SMP_MAX_PATH_HOPS 64 Modified: stable/9/sys/ofed/include/rdma/ib_user_cm.h ============================================================================== --- stable/9/sys/ofed/include/rdma/ib_user_cm.h Thu Oct 30 16:57:56 2014 (r273867) +++ stable/9/sys/ofed/include/rdma/ib_user_cm.h Thu Oct 30 17:05:32 2014 (r273868) @@ -34,6 +34,7 @@ #ifndef IB_USER_CM_H #define IB_USER_CM_H +#include #include #define IB_USER_CM_ABI_VERSION 5 From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 17:06:16 2014 Return-Path: Delivered-To: svn-src-all@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 B46986EF; Thu, 30 Oct 2014 17:06:16 +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 76E8E662; Thu, 30 Oct 2014 17:06:16 +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 C56591FE022; Thu, 30 Oct 2014 18:06:13 +0100 (CET) Message-ID: <5452700E.7090406@selasky.org> Date: Thu, 30 Oct 2014 18:06:22 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r273867 - head/sys/ofed/drivers/net/mlx4 References: <201410301657.s9UGvvA9029467@svn.freebsd.org> In-Reply-To: <201410301657.s9UGvvA9029467@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 17:06:16 -0000 On 10/30/14 17:57, Hans Petter Selasky wrote: > Log: > Fix compile warning by removing unused variable. > > MFC: 3 days > Sponsored by: Mellanox Technologies ^^^ should be "MFC after:" --HPS From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 17:14:08 2014 Return-Path: Delivered-To: svn-src-all@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 86FDDE13; Thu, 30 Oct 2014 17:14: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 6F7BB7F3; Thu, 30 Oct 2014 17:14: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 s9UHE8e8038639; Thu, 30 Oct 2014 17:14:08 GMT (envelope-from jmmv@FreeBSD.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UHE7mp038635; Thu, 30 Oct 2014 17:14:07 GMT (envelope-from jmmv@FreeBSD.org) Message-Id: <201410301714.s9UHE7mp038635@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmmv set sender to jmmv@FreeBSD.org using -f From: Julio Merino Date: Thu, 30 Oct 2014 17:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r273869 - in vendor/atf/dist: . admin atf-c atf-c++ atf-c++/detail atf-c/detail atf-sh bootstrap doc m4 test-programs X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 17:14:08 -0000 Author: jmmv Date: Thu Oct 30 17:14:07 2014 New Revision: 273869 URL: https://svnweb.freebsd.org/changeset/base/273869 Log: Import atf-0.21: Released on October 23rd, 2014. * Restored the atf(7) manual page to serve as a reference to all the other manual pages shipped by ATF. * Added the -s flag to atf-sh to support specifying the shell interpreter to be used. * Removed ATF_WORKDIR. The only remaining consumers have been converted to use the standard TMPDIR environment variable. As a benefit, and because Kyua forces the TMPDIR to live within the test case's work directory, any stale files left behind by ATF will be automatically cleaned up. * Documented the environment variables recognized by each component in the relevant manual pages. This information was lost with the atf-config(1) removal. * Added a new "require.diskspace" metadata property to test cases so that they can specify the minimum amount of disk space required for the test to run. * Renamed the atf-{c,c++,sh}-api(3) manual pages to atf-{c,c++,sh}(3) for discoverability purposes. Symbolic links are provided for the time being to still make the old names visible. * Issue #5: Recommend the (expected, actual) idiom for calls to the test macros in the manual pages. * Issue #7: Stopped catching unhandled exceptions in atf-c++ tests. This propagates the crash to the caller, which in turn allows it to obtain proper debugging information. In particular, Kyua should now be able to extract a stacktrace pinpointing the problem. * Issue #8: Fixed atf-c/macros_test:use test failures spotted by the clang that ships with FreeBSD 11.0-CURRENT. * Issue #12: Improved documentation of atf-sh(3) and atf-check(1) by better explaining how they relate to each other. * Issue #14: Stopped setting 'set -e' in atf-sh. This setting was initially added as a way to enable a "strict" mode in the library and to make test cases fail fast when they run unprotected commands. However, doing so in the library is surprising as the responsibility of enabling 'set -e' should be on the user's code. Also, 'set -e' introduces inconsistent behavior on subshells and users do not expect that. * Issue #15: Fixed atf_utils_{fork,wait} to support nested calls. * Issue #16: Fixed test failures (by removing a long-standing hack) on systems that lack \e support in printf(1). * Issue #19: Removed stale references to atf-config and atf-run. Added: vendor/atf/dist/atf-c++/atf-c++.3 (contents, props changed) vendor/atf/dist/atf-c/atf-c.3 (contents, props changed) vendor/atf/dist/atf-sh/atf-sh.3 (contents, props changed) vendor/atf/dist/config.h.in (contents, props changed) vendor/atf/dist/doc/atf.7.in (contents, props changed) Deleted: vendor/atf/dist/atf-c++/atf-c++-api.3 vendor/atf/dist/atf-c++/config.cpp vendor/atf/dist/atf-c++/config.hpp vendor/atf/dist/atf-c++/config_test.cpp vendor/atf/dist/atf-c++/detail/sanity_test.cpp vendor/atf/dist/atf-c/atf-c-api.3 vendor/atf/dist/atf-c/config.c vendor/atf/dist/atf-c/config.h vendor/atf/dist/atf-c/config_test.c vendor/atf/dist/atf-sh/atf-sh-api.3 vendor/atf/dist/bconfig.h.in Modified: vendor/atf/dist/INSTALL vendor/atf/dist/Makefile.am vendor/atf/dist/Makefile.in vendor/atf/dist/NEWS vendor/atf/dist/admin/Makefile.am.inc vendor/atf/dist/admin/check-style-c.awk vendor/atf/dist/admin/check-style-common.awk vendor/atf/dist/admin/check-style-cpp.awk vendor/atf/dist/admin/check-style-man.awk vendor/atf/dist/admin/check-style-shell.awk vendor/atf/dist/admin/check-style.sh vendor/atf/dist/admin/config.guess vendor/atf/dist/admin/config.sub vendor/atf/dist/admin/install-sh vendor/atf/dist/admin/ltmain.sh vendor/atf/dist/atf-c++.hpp vendor/atf/dist/atf-c++/Kyuafile vendor/atf/dist/atf-c++/Makefile.am.inc vendor/atf/dist/atf-c++/atf-c++.m4 vendor/atf/dist/atf-c++/atf_c++_test.cpp vendor/atf/dist/atf-c++/build.cpp vendor/atf/dist/atf-c++/build.hpp vendor/atf/dist/atf-c++/build_test.cpp vendor/atf/dist/atf-c++/check.cpp vendor/atf/dist/atf-c++/check.hpp vendor/atf/dist/atf-c++/check_test.cpp vendor/atf/dist/atf-c++/detail/Kyuafile vendor/atf/dist/atf-c++/detail/Makefile.am.inc vendor/atf/dist/atf-c++/detail/application.cpp vendor/atf/dist/atf-c++/detail/application.hpp vendor/atf/dist/atf-c++/detail/application_test.cpp vendor/atf/dist/atf-c++/detail/auto_array.hpp vendor/atf/dist/atf-c++/detail/auto_array_test.cpp vendor/atf/dist/atf-c++/detail/env.cpp vendor/atf/dist/atf-c++/detail/env.hpp vendor/atf/dist/atf-c++/detail/env_test.cpp vendor/atf/dist/atf-c++/detail/exceptions.cpp vendor/atf/dist/atf-c++/detail/exceptions.hpp vendor/atf/dist/atf-c++/detail/exceptions_test.cpp vendor/atf/dist/atf-c++/detail/fs.cpp vendor/atf/dist/atf-c++/detail/fs.hpp vendor/atf/dist/atf-c++/detail/fs_test.cpp vendor/atf/dist/atf-c++/detail/process.cpp vendor/atf/dist/atf-c++/detail/process.hpp vendor/atf/dist/atf-c++/detail/process_test.cpp vendor/atf/dist/atf-c++/detail/sanity.hpp vendor/atf/dist/atf-c++/detail/test_helpers.cpp vendor/atf/dist/atf-c++/detail/test_helpers.hpp vendor/atf/dist/atf-c++/detail/text.cpp vendor/atf/dist/atf-c++/detail/text.hpp vendor/atf/dist/atf-c++/detail/text_test.cpp vendor/atf/dist/atf-c++/detail/version_helper.cpp vendor/atf/dist/atf-c++/macros.hpp vendor/atf/dist/atf-c++/macros_hpp_test.cpp vendor/atf/dist/atf-c++/macros_test.cpp vendor/atf/dist/atf-c++/pkg_config_test.sh vendor/atf/dist/atf-c++/tests.cpp vendor/atf/dist/atf-c++/tests.hpp vendor/atf/dist/atf-c++/tests_test.cpp vendor/atf/dist/atf-c++/unused_test.cpp vendor/atf/dist/atf-c++/utils.cpp vendor/atf/dist/atf-c++/utils.hpp vendor/atf/dist/atf-c++/utils_test.cpp vendor/atf/dist/atf-c.h vendor/atf/dist/atf-c/Kyuafile vendor/atf/dist/atf-c/Makefile.am.inc vendor/atf/dist/atf-c/atf-c.m4 vendor/atf/dist/atf-c/atf-common.m4 vendor/atf/dist/atf-c/atf_c_test.c vendor/atf/dist/atf-c/build.c vendor/atf/dist/atf-c/build.h vendor/atf/dist/atf-c/build_test.c vendor/atf/dist/atf-c/check.c vendor/atf/dist/atf-c/check.h vendor/atf/dist/atf-c/check_test.c vendor/atf/dist/atf-c/defs.h.in vendor/atf/dist/atf-c/detail/Makefile.am.inc vendor/atf/dist/atf-c/detail/dynstr.c vendor/atf/dist/atf-c/detail/dynstr.h vendor/atf/dist/atf-c/detail/dynstr_test.c vendor/atf/dist/atf-c/detail/env.c vendor/atf/dist/atf-c/detail/env.h vendor/atf/dist/atf-c/detail/env_test.c vendor/atf/dist/atf-c/detail/fs.c vendor/atf/dist/atf-c/detail/fs.h vendor/atf/dist/atf-c/detail/fs_test.c vendor/atf/dist/atf-c/detail/list.c vendor/atf/dist/atf-c/detail/list.h vendor/atf/dist/atf-c/detail/list_test.c vendor/atf/dist/atf-c/detail/map.c vendor/atf/dist/atf-c/detail/map.h vendor/atf/dist/atf-c/detail/map_test.c vendor/atf/dist/atf-c/detail/process.c vendor/atf/dist/atf-c/detail/process.h vendor/atf/dist/atf-c/detail/process_helpers.c vendor/atf/dist/atf-c/detail/process_test.c vendor/atf/dist/atf-c/detail/sanity.c vendor/atf/dist/atf-c/detail/sanity.h vendor/atf/dist/atf-c/detail/sanity_test.c vendor/atf/dist/atf-c/detail/test_helpers.c vendor/atf/dist/atf-c/detail/test_helpers.h vendor/atf/dist/atf-c/detail/text.c vendor/atf/dist/atf-c/detail/text.h vendor/atf/dist/atf-c/detail/text_test.c vendor/atf/dist/atf-c/detail/tp_main.c vendor/atf/dist/atf-c/detail/user.c vendor/atf/dist/atf-c/detail/user.h vendor/atf/dist/atf-c/detail/user_test.c vendor/atf/dist/atf-c/detail/version_helper.c vendor/atf/dist/atf-c/error.c vendor/atf/dist/atf-c/error.h vendor/atf/dist/atf-c/error_fwd.h vendor/atf/dist/atf-c/error_test.c vendor/atf/dist/atf-c/h_build.h vendor/atf/dist/atf-c/macros.h vendor/atf/dist/atf-c/macros_h_test.c vendor/atf/dist/atf-c/macros_test.c vendor/atf/dist/atf-c/pkg_config_test.sh vendor/atf/dist/atf-c/tc.c vendor/atf/dist/atf-c/tc.h vendor/atf/dist/atf-c/tc_test.c vendor/atf/dist/atf-c/tp.c vendor/atf/dist/atf-c/tp.h vendor/atf/dist/atf-c/tp_test.c vendor/atf/dist/atf-c/unused_test.c vendor/atf/dist/atf-c/utils.c vendor/atf/dist/atf-c/utils.h vendor/atf/dist/atf-c/utils_test.c vendor/atf/dist/atf-sh/Makefile.am.inc vendor/atf/dist/atf-sh/atf-check.1 vendor/atf/dist/atf-sh/atf-check.cpp vendor/atf/dist/atf-sh/atf-check_test.sh vendor/atf/dist/atf-sh/atf-sh.1 vendor/atf/dist/atf-sh/atf-sh.cpp vendor/atf/dist/atf-sh/atf-sh.m4 vendor/atf/dist/atf-sh/atf_check_test.sh vendor/atf/dist/atf-sh/config_test.sh vendor/atf/dist/atf-sh/integration_test.sh vendor/atf/dist/atf-sh/libatf-sh.subr vendor/atf/dist/atf-sh/misc_helpers.sh vendor/atf/dist/atf-sh/normalize_test.sh vendor/atf/dist/atf-sh/tc_test.sh vendor/atf/dist/atf-sh/tp_test.sh vendor/atf/dist/bootstrap/Makefile.am.inc vendor/atf/dist/bootstrap/h_tp_atf_check_sh.sh vendor/atf/dist/bootstrap/h_tp_basic_c.c vendor/atf/dist/bootstrap/h_tp_basic_cpp.cpp vendor/atf/dist/bootstrap/h_tp_basic_sh.sh vendor/atf/dist/bootstrap/h_tp_fail.sh vendor/atf/dist/bootstrap/h_tp_pass.sh vendor/atf/dist/bootstrap/package.m4 vendor/atf/dist/bootstrap/t_subr_atf_check.at vendor/atf/dist/bootstrap/t_test_program_compare.at vendor/atf/dist/bootstrap/t_test_program_filter.at vendor/atf/dist/bootstrap/t_test_program_list.at vendor/atf/dist/bootstrap/t_test_program_run.at vendor/atf/dist/bootstrap/testsuite vendor/atf/dist/bootstrap/testsuite.at vendor/atf/dist/configure vendor/atf/dist/configure.ac vendor/atf/dist/doc/Makefile.am.inc vendor/atf/dist/doc/atf-test-case.4 vendor/atf/dist/doc/atf-test-program.1 vendor/atf/dist/m4/cxx-std-funcs.m4 vendor/atf/dist/m4/libtool.m4 vendor/atf/dist/m4/ltoptions.m4 vendor/atf/dist/m4/ltsugar.m4 vendor/atf/dist/m4/ltversion.m4 vendor/atf/dist/m4/lt~obsolete.m4 vendor/atf/dist/m4/module-application.m4 vendor/atf/dist/m4/module-defs.m4 vendor/atf/dist/m4/module-env.m4 vendor/atf/dist/m4/module-fs.m4 vendor/atf/dist/m4/runtime-tool.m4 vendor/atf/dist/test-programs/Makefile.am.inc vendor/atf/dist/test-programs/c_helpers.c vendor/atf/dist/test-programs/common.sh vendor/atf/dist/test-programs/config_test.sh vendor/atf/dist/test-programs/cpp_helpers.cpp vendor/atf/dist/test-programs/expect_test.sh vendor/atf/dist/test-programs/meta_data_test.sh vendor/atf/dist/test-programs/result_test.sh vendor/atf/dist/test-programs/sh_helpers.sh vendor/atf/dist/test-programs/srcdir_test.sh Modified: vendor/atf/dist/INSTALL ============================================================================== --- vendor/atf/dist/INSTALL Thu Oct 30 17:05:32 2014 (r273868) +++ vendor/atf/dist/INSTALL Thu Oct 30 17:14:07 2014 (r273869) @@ -153,14 +153,6 @@ script: library. If empty, the configure script will try to find a suitable interpreter for you. -* ATF_WORKDIR - Possible values: empty, an absolute path. - Default: /tmp or /var/tmp, depending on availability. - - Specifies the directory that ATF will use to place its temporary files - and work directories for test cases. This is just a default and can be - overriden at run time. - The following flags are specific to ATF's 'configure' script: * --enable-developer Modified: vendor/atf/dist/Makefile.am ============================================================================== --- vendor/atf/dist/Makefile.am Thu Oct 30 17:05:32 2014 (r273868) +++ vendor/atf/dist/Makefile.am Thu Oct 30 17:14:07 2014 (r273869) @@ -1,6 +1,3 @@ -# -# Automated Testing Framework (atf) -# # Copyright (c) 2007 The NetBSD Foundation, Inc. # All rights reserved. # @@ -25,7 +22,6 @@ # 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. -# atf_aclocal_DATA = BUILT_SOURCES = @@ -68,6 +64,10 @@ EXTRA_DIST += $(doc_DATA) INSTALL README TESTS_ENVIRONMENT = PATH=$(prefix)/bin:$${PATH} \ PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig +# Allow the caller to override the configuration file to passed to our +# test runs below. +KYUA_TEST_CONFIG_FILE = none + testsdir = $(exec_prefix)/tests pkgtestsdir = $(testsdir)/$(PACKAGE) @@ -75,7 +75,8 @@ PHONY_TARGETS += installcheck-kyua if HAVE_KYUA INSTALLCHECK_TARGETS += installcheck-kyua installcheck-kyua: - cd $(pkgtestsdir) && $(TESTS_ENVIRONMENT) $(KYUA) test + cd $(pkgtestsdir) && $(TESTS_ENVIRONMENT) \ + $(KYUA) --config='$(KYUA_TEST_CONFIG_FILE)' test endif installcheck-local: $(INSTALLCHECK_TARGETS) @@ -84,10 +85,14 @@ pkgtests_DATA = Kyuafile EXTRA_DIST += $(pkgtests_DATA) BUILD_SH_TP = \ - echo "Creating $${dst}"; \ - echo "\#! $(bindir)/atf-sh" >$${dst}; \ - cat $${src} >>$${dst}; \ - chmod +x $${dst} + test -d "$$(dirname "$${dst}")" || mkdir -p "$$(dirname "$${dst}")"; \ + echo "\#! $(bindir)/atf-sh" >"$${dst}"; \ + if [ -n "$${substs}" ]; then \ + cat $${src} | sed $${substs} >>"$${dst}"; \ + else \ + cat $${src} >>"$${dst}"; \ + fi; \ + chmod +x "$${dst}" # # Custom targets. @@ -97,14 +102,14 @@ PHONY_TARGETS += clean-all clean-all: GIT="$(GIT)" $(SH) $(srcdir)/admin/clean-all.sh -PHONY_TARGETS += release -release: - $(SH) $(srcdir)/admin/release.sh $(PACKAGE_VERSION) $(DIST_ARCHIVES) - -PHONY_TARGETS += release-test -release-test: - $(SH) $(srcdir)/admin/release-test.sh $(DIST_ARCHIVES) - .PHONY: $(PHONY_TARGETS) +# TODO(jmmv): Remove after atf 0.22. +install-data-hook: + cd $(DESTDIR)$(man3dir) && \ + for binding in c c++ sh; do \ + rm -f "atf-$${binding}-api.3"; \ + $(LN_S) "atf-$${binding}.3" "atf-$${binding}-api.3"; \ + done + # vim: syntax=make:noexpandtab:shiftwidth=8:softtabstop=8 Modified: vendor/atf/dist/Makefile.in ============================================================================== --- vendor/atf/dist/Makefile.in Thu Oct 30 17:05:32 2014 (r273868) +++ vendor/atf/dist/Makefile.in Thu Oct 30 17:14:07 2014 (r273869) @@ -14,9 +14,6 @@ @SET_MAKE@ -# -# Automated Testing Framework (atf) -# # Copyright (c) 2007 The NetBSD Foundation, Inc. # All rights reserved. # @@ -41,11 +38,7 @@ # 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. -# -# -# Automated Testing Framework (atf) -# # Copyright (c) 2007 The NetBSD Foundation, Inc. # All rights reserved. # @@ -70,11 +63,7 @@ # 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. -# -# -# Automated Testing Framework (atf) -# # Copyright (c) 2007 The NetBSD Foundation, Inc. # All rights reserved. # @@ -99,11 +88,7 @@ # 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. -# -# -# Automated Testing Framework (atf) -# # Copyright (c) 2007 The NetBSD Foundation, Inc. # All rights reserved. # @@ -128,11 +113,7 @@ # 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. -# -# -# Automated Testing Framework (atf) -# # Copyright (c) 2007 The NetBSD Foundation, Inc. # All rights reserved. # @@ -157,11 +138,7 @@ # 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. -# -# -# Automated Testing Framework (atf) -# # Copyright (c) 2007 The NetBSD Foundation, Inc. # All rights reserved. # @@ -186,11 +163,7 @@ # 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. -# -# -# Automated Testing Framework (atf) -# # Copyright (c) 2007 The NetBSD Foundation, Inc. # All rights reserved. # @@ -215,11 +188,7 @@ # 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. -# -# -# Automated Testing Framework (atf) -# # Copyright (c) 2007 The NetBSD Foundation, Inc. # All rights reserved. # @@ -244,11 +213,7 @@ # 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. -# -# -# Automated Testing Framework (atf) -# # Copyright (c) 2007 The NetBSD Foundation, Inc. # All rights reserved. # @@ -273,11 +238,7 @@ # 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. -# -# -# Automated Testing Framework (atf) -# # Copyright (c) 2007 The NetBSD Foundation, Inc. # All rights reserved. # @@ -302,7 +263,6 @@ # 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. -# @@ -385,7 +345,7 @@ DIST_COMMON = $(srcdir)/admin/Makefile.a $(srcdir)/doc/Makefile.am.inc \ $(srcdir)/test-programs/Makefile.am.inc $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(srcdir)/bconfig.h.in \ + $(am__configure_deps) $(srcdir)/config.h.in \ $(top_srcdir)/atf-c/defs.h.in $(top_srcdir)/admin/depcomp \ $(dist_man_MANS) $(atf_c_HEADERS) $(atf_c___HEADERS) \ $(include_HEADERS) AUTHORS COPYING INSTALL NEWS README \ @@ -397,9 +357,9 @@ DIST_COMMON = $(srcdir)/admin/Makefile.a $(top_srcdir)/admin/ltmain.sh $(top_srcdir)/admin/missing tests_atf_c_PROGRAMS = atf-c/atf_c_test$(EXEEXT) \ atf-c/build_test$(EXEEXT) atf-c/check_test$(EXEEXT) \ - atf-c/config_test$(EXEEXT) atf-c/error_test$(EXEEXT) \ - atf-c/macros_test$(EXEEXT) atf-c/tc_test$(EXEEXT) \ - atf-c/tp_test$(EXEEXT) atf-c/utils_test$(EXEEXT) + atf-c/error_test$(EXEEXT) atf-c/macros_test$(EXEEXT) \ + atf-c/tc_test$(EXEEXT) atf-c/tp_test$(EXEEXT) \ + atf-c/utils_test$(EXEEXT) tests_atf_c_detail_PROGRAMS = atf-c/detail/dynstr_test$(EXEEXT) \ atf-c/detail/env_test$(EXEEXT) atf-c/detail/fs_test$(EXEEXT) \ atf-c/detail/list_test$(EXEEXT) atf-c/detail/map_test$(EXEEXT) \ @@ -411,8 +371,8 @@ tests_atf_c_detail_PROGRAMS = atf-c/deta atf-c/detail/version_helper$(EXEEXT) tests_atf_c___PROGRAMS = atf-c++/atf_c++_test$(EXEEXT) \ atf-c++/build_test$(EXEEXT) atf-c++/check_test$(EXEEXT) \ - atf-c++/config_test$(EXEEXT) atf-c++/macros_test$(EXEEXT) \ - atf-c++/tests_test$(EXEEXT) atf-c++/utils_test$(EXEEXT) + atf-c++/macros_test$(EXEEXT) atf-c++/tests_test$(EXEEXT) \ + atf-c++/utils_test$(EXEEXT) tests_atf_c___detail_PROGRAMS = \ atf-c++/detail/application_test$(EXEEXT) \ atf-c++/detail/auto_array_test$(EXEEXT) \ @@ -420,7 +380,6 @@ tests_atf_c___detail_PROGRAMS = \ atf-c++/detail/exceptions_test$(EXEEXT) \ atf-c++/detail/fs_test$(EXEEXT) \ atf-c++/detail/process_test$(EXEEXT) \ - atf-c++/detail/sanity_test$(EXEEXT) \ atf-c++/detail/text_test$(EXEEXT) \ atf-c++/detail/version_helper$(EXEEXT) check_PROGRAMS = bootstrap/h_tp_basic_c$(EXEEXT) \ @@ -444,7 +403,7 @@ am__configure_deps = $(am__aclocal_m4_de am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = bconfig.h +CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = atf-c/defs.h CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -484,7 +443,7 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(tests_atf_shdir)" \ "$(DESTDIR)$(tests_test_programsdir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man4dir)" \ - "$(DESTDIR)$(atf_aclocaldir)" \ + "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(atf_aclocaldir)" \ "$(DESTDIR)$(atf_c__dirpkgconfigdir)" \ "$(DESTDIR)$(atf_cpkgconfigdir)" "$(DESTDIR)$(atf_shdir)" \ "$(DESTDIR)$(atf_shpkgconfigdir)" "$(DESTDIR)$(docdir)" \ @@ -494,12 +453,12 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(tests_atf_c_detaildir)" \ "$(DESTDIR)$(tests_atf_shdir)" \ "$(DESTDIR)$(tests_test_programsdir)" "$(DESTDIR)$(atf_cdir)" \ - "$(DESTDIR)$(atf_c__dir)" "$(DESTDIR)$(includedir)" + "$(DESTDIR)$(atf_c__dir)" "$(DESTDIR)$(includedir)" \ + "$(DESTDIR)$(atf_cdir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) atf_c___detail_libtest_helpers_la_LIBADD = am__dirstamp = $(am__leading_dot)dirstamp -am_atf_c___detail_libtest_helpers_la_OBJECTS = \ - atf-c++/detail/test_helpers.lo +am_atf_c___detail_libtest_helpers_la_OBJECTS = atf-c++/detail/atf_c___detail_libtest_helpers_la-test_helpers.lo atf_c___detail_libtest_helpers_la_OBJECTS = \ $(am_atf_c___detail_libtest_helpers_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) @@ -513,7 +472,7 @@ atf_c_detail_libtest_helpers_la_OBJECTS $(am_atf_c_detail_libtest_helpers_la_OBJECTS) libatf_c___la_DEPENDENCIES = libatf-c.la am_libatf_c___la_OBJECTS = atf-c++/build.lo atf-c++/check.lo \ - atf-c++/config.lo atf-c++/tests.lo atf-c++/utils.lo \ + atf-c++/tests.lo atf-c++/utils.lo \ atf-c++/detail/application.lo atf-c++/detail/env.lo \ atf-c++/detail/exceptions.lo atf-c++/detail/fs.lo \ atf-c++/detail/process.lo atf-c++/detail/text.lo @@ -524,10 +483,9 @@ libatf_c___la_LINK = $(LIBTOOL) $(AM_V_l -o $@ libatf_c_la_LIBADD = am_libatf_c_la_OBJECTS = atf-c/libatf_c_la-build.lo \ - atf-c/libatf_c_la-check.lo atf-c/libatf_c_la-config.lo \ - atf-c/libatf_c_la-error.lo atf-c/libatf_c_la-tc.lo \ - atf-c/libatf_c_la-tp.lo atf-c/libatf_c_la-utils.lo \ - atf-c/detail/libatf_c_la-dynstr.lo \ + atf-c/libatf_c_la-check.lo atf-c/libatf_c_la-error.lo \ + atf-c/libatf_c_la-tc.lo atf-c/libatf_c_la-tp.lo \ + atf-c/libatf_c_la-utils.lo atf-c/detail/libatf_c_la-dynstr.lo \ atf-c/detail/libatf_c_la-env.lo atf-c/detail/libatf_c_la-fs.lo \ atf-c/detail/libatf_c_la-list.lo \ atf-c/detail/libatf_c_la-map.lo \ @@ -557,10 +515,6 @@ am_atf_c___check_test_OBJECTS = atf-c++/ atf_c___check_test_OBJECTS = $(am_atf_c___check_test_OBJECTS) atf_c___check_test_DEPENDENCIES = atf-c++/detail/libtest_helpers.la \ $(ATF_CXX_LIBS) -am_atf_c___config_test_OBJECTS = atf-c++/config_test.$(OBJEXT) -atf_c___config_test_OBJECTS = $(am_atf_c___config_test_OBJECTS) -atf_c___config_test_DEPENDENCIES = atf-c++/detail/libtest_helpers.la \ - $(ATF_CXX_LIBS) am_atf_c___detail_application_test_OBJECTS = \ atf-c++/detail/application_test.$(OBJEXT) atf_c___detail_application_test_OBJECTS = \ @@ -595,12 +549,6 @@ atf_c___detail_process_test_OBJECTS = \ $(am_atf_c___detail_process_test_OBJECTS) atf_c___detail_process_test_DEPENDENCIES = \ atf-c++/detail/libtest_helpers.la $(ATF_CXX_LIBS) -am_atf_c___detail_sanity_test_OBJECTS = \ - atf-c++/detail/sanity_test.$(OBJEXT) -atf_c___detail_sanity_test_OBJECTS = \ - $(am_atf_c___detail_sanity_test_OBJECTS) -atf_c___detail_sanity_test_DEPENDENCIES = \ - atf-c++/detail/libtest_helpers.la $(ATF_CXX_LIBS) am_atf_c___detail_text_test_OBJECTS = \ atf-c++/detail/text_test.$(OBJEXT) atf_c___detail_text_test_OBJECTS = \ @@ -636,10 +584,6 @@ am_atf_c_check_test_OBJECTS = atf-c/chec atf_c_check_test_OBJECTS = $(am_atf_c_check_test_OBJECTS) atf_c_check_test_DEPENDENCIES = atf-c/detail/libtest_helpers.la \ libatf-c.la -am_atf_c_config_test_OBJECTS = atf-c/config_test.$(OBJEXT) -atf_c_config_test_OBJECTS = $(am_atf_c_config_test_OBJECTS) -atf_c_config_test_DEPENDENCIES = atf-c/detail/libtest_helpers.la \ - libatf-c.la am_atf_c_detail_dynstr_test_OBJECTS = \ atf-c/detail/dynstr_test.$(OBJEXT) atf_c_detail_dynstr_test_OBJECTS = \ @@ -712,10 +656,11 @@ am_atf_c_utils_test_OBJECTS = atf-c/util atf_c_utils_test_OBJECTS = $(am_atf_c_utils_test_OBJECTS) atf_c_utils_test_DEPENDENCIES = atf-c/detail/libtest_helpers.la \ libatf-c.la -am_atf_sh_atf_check_OBJECTS = atf-sh/atf-check.$(OBJEXT) +am_atf_sh_atf_check_OBJECTS = \ + atf-sh/atf_sh_atf_check-atf-check.$(OBJEXT) atf_sh_atf_check_OBJECTS = $(am_atf_sh_atf_check_OBJECTS) atf_sh_atf_check_DEPENDENCIES = $(ATF_CXX_LIBS) -am_atf_sh_atf_sh_OBJECTS = atf-sh/atf-sh.$(OBJEXT) +am_atf_sh_atf_sh_OBJECTS = atf-sh/atf_sh_atf_sh-atf-sh.$(OBJEXT) atf_sh_atf_sh_OBJECTS = $(am_atf_sh_atf_sh_OBJECTS) atf_sh_atf_sh_DEPENDENCIES = $(ATF_CXX_LIBS) am_bootstrap_h_tp_basic_c_OBJECTS = bootstrap/h_tp_basic_c.$(OBJEXT) @@ -795,20 +740,17 @@ SOURCES = $(atf_c___detail_libtest_helpe $(libatf_c___la_SOURCES) $(libatf_c_la_SOURCES) \ $(nodist_libatf_c_la_SOURCES) $(atf_c___atf_c___test_SOURCES) \ $(atf_c___build_test_SOURCES) $(atf_c___check_test_SOURCES) \ - $(atf_c___config_test_SOURCES) \ $(atf_c___detail_application_test_SOURCES) \ $(atf_c___detail_auto_array_test_SOURCES) \ $(atf_c___detail_env_test_SOURCES) \ $(atf_c___detail_exceptions_test_SOURCES) \ $(atf_c___detail_fs_test_SOURCES) \ $(atf_c___detail_process_test_SOURCES) \ - $(atf_c___detail_sanity_test_SOURCES) \ $(atf_c___detail_text_test_SOURCES) \ $(atf_c___detail_version_helper_SOURCES) \ $(atf_c___macros_test_SOURCES) $(atf_c___tests_test_SOURCES) \ $(atf_c___utils_test_SOURCES) $(atf_c_atf_c_test_SOURCES) \ $(atf_c_build_test_SOURCES) $(atf_c_check_test_SOURCES) \ - $(atf_c_config_test_SOURCES) \ $(atf_c_detail_dynstr_test_SOURCES) \ $(atf_c_detail_env_test_SOURCES) \ $(atf_c_detail_fs_test_SOURCES) \ @@ -831,20 +773,18 @@ DIST_SOURCES = $(atf_c___detail_libtest_ $(atf_c_detail_libtest_helpers_la_SOURCES) \ $(libatf_c___la_SOURCES) $(libatf_c_la_SOURCES) \ $(atf_c___atf_c___test_SOURCES) $(atf_c___build_test_SOURCES) \ - $(atf_c___check_test_SOURCES) $(atf_c___config_test_SOURCES) \ + $(atf_c___check_test_SOURCES) \ $(atf_c___detail_application_test_SOURCES) \ $(atf_c___detail_auto_array_test_SOURCES) \ $(atf_c___detail_env_test_SOURCES) \ $(atf_c___detail_exceptions_test_SOURCES) \ $(atf_c___detail_fs_test_SOURCES) \ $(atf_c___detail_process_test_SOURCES) \ - $(atf_c___detail_sanity_test_SOURCES) \ $(atf_c___detail_text_test_SOURCES) \ $(atf_c___detail_version_helper_SOURCES) \ $(atf_c___macros_test_SOURCES) $(atf_c___tests_test_SOURCES) \ $(atf_c___utils_test_SOURCES) $(atf_c_atf_c_test_SOURCES) \ $(atf_c_build_test_SOURCES) $(atf_c_check_test_SOURCES) \ - $(atf_c_config_test_SOURCES) \ $(atf_c_detail_dynstr_test_SOURCES) \ $(atf_c_detail_env_test_SOURCES) \ $(atf_c_detail_fs_test_SOURCES) \ @@ -871,6 +811,7 @@ am__can_run_installinfo = \ man1dir = $(mandir)/man1 man3dir = $(mandir)/man3 man4dir = $(mandir)/man4 +man7dir = $(mandir)/man7 NROFF = nroff MANS = $(dist_man_MANS) $(man_MANS) DATA = $(atf_aclocal_DATA) $(atf_c__dirpkgconfig_DATA) \ @@ -879,9 +820,10 @@ DATA = $(atf_aclocal_DATA) $(atf_c__dirp $(tests_atf_c_DATA) $(tests_atf_c___DATA) \ $(tests_atf_c___detail_DATA) $(tests_atf_c_detail_DATA) \ $(tests_atf_sh_DATA) $(tests_test_programs_DATA) -HEADERS = $(atf_c_HEADERS) $(atf_c___HEADERS) $(include_HEADERS) +HEADERS = $(atf_c_HEADERS) $(atf_c___HEADERS) $(include_HEADERS) \ + $(nodist_atf_c_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ - $(LISP)bconfig.h.in + $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. @@ -930,7 +872,6 @@ ATF_BUILD_CPPFLAGS = @ATF_BUILD_CPPFLAGS ATF_BUILD_CXX = @ATF_BUILD_CXX@ ATF_BUILD_CXXFLAGS = @ATF_BUILD_CXXFLAGS@ ATF_SHELL = @ATF_SHELL@ -ATF_WORKDIR = @ATF_WORKDIR@ ATTRIBUTE_FORMAT_PRINTF = @ATTRIBUTE_FORMAT_PRINTF@ ATTRIBUTE_NORETURN = @ATTRIBUTE_NORETURN@ ATTRIBUTE_UNUSED = @ATTRIBUTE_UNUSED@ @@ -1067,7 +1008,7 @@ CLEANFILES = atf-c/atf-c.pc atf-c/pkg_co atf-sh/integration_test atf-sh/normalize_test atf-sh/tc_test \ atf-sh/tp_test bootstrap/h_tp_basic_sh \ bootstrap/h_tp_atf_check_sh bootstrap/h_tp_fail \ - bootstrap/h_tp_pass test-programs/sh_helpers \ + bootstrap/h_tp_pass doc/atf.7 test-programs/sh_helpers \ test-programs/config_test test-programs/expect_test \ test-programs/meta_data_test test-programs/result_test \ test-programs/srcdir_test @@ -1087,18 +1028,18 @@ EXTRA_DIST = admin/check-style-common.aw bootstrap/h_tp_basic_sh.sh bootstrap/h_tp_atf_check_sh.sh \ bootstrap/h_tp_fail.sh bootstrap/h_tp_pass.sh \ bootstrap/testsuite bootstrap/package.m4 \ - bootstrap/testsuite.at $(testsuite_incs) \ + bootstrap/testsuite.at $(testsuite_incs) doc/atf.7.in \ $(tests_test_programs_DATA) test-programs/common.sh \ test-programs/sh_helpers.sh test-programs/config_test.sh \ test-programs/expect_test.sh test-programs/meta_data_test.sh \ test-programs/result_test.sh test-programs/srcdir_test.sh \ $(doc_DATA) INSTALL README $(pkgtests_DATA) -dist_man_MANS = atf-c/atf-c-api.3 atf-c++/atf-c++-api.3 \ - atf-sh/atf-check.1 atf-sh/atf-sh.1 atf-sh/atf-sh-api.3 \ - doc/atf-test-case.4 doc/atf-test-program.1 +dist_man_MANS = atf-c/atf-c.3 atf-c++/atf-c++.3 atf-sh/atf-check.1 \ + atf-sh/atf-sh.1 atf-sh/atf-sh.3 doc/atf-test-case.4 \ + doc/atf-test-program.1 include_HEADERS = atf-c.h atf-c++.hpp lib_LTLIBRARIES = libatf-c.la libatf-c++.la -man_MANS = +man_MANS = doc/atf.7 noinst_DATA = INSTALL README noinst_LTLIBRARIES = atf-c/detail/libtest_helpers.la \ atf-c++/detail/libtest_helpers.la @@ -1108,38 +1049,31 @@ INSTALLCHECK_TARGETS = installcheck-boot # Custom targets. # PHONY_TARGETS = check-style installcheck-bootstrap installcheck-kyua \ - clean-all release release-test + clean-all ACLOCAL_AMFLAGS = -I m4 AM_DISTCHECK_CONFIGURE_FLAGS = --enable-tools libatf_c_la_SOURCES = atf-c/build.c atf-c/build.h atf-c/check.c \ - atf-c/check.h atf-c/config.c atf-c/config.h atf-c/error.c \ - atf-c/error.h atf-c/error_fwd.h atf-c/macros.h atf-c/tc.c \ - atf-c/tc.h atf-c/tp.c atf-c/tp.h atf-c/utils.c atf-c/utils.h \ - atf-c/detail/dynstr.c atf-c/detail/dynstr.h atf-c/detail/env.c \ - atf-c/detail/env.h atf-c/detail/fs.c atf-c/detail/fs.h \ - atf-c/detail/list.c atf-c/detail/list.h atf-c/detail/map.c \ - atf-c/detail/map.h atf-c/detail/process.c \ - atf-c/detail/process.h atf-c/detail/sanity.c \ - atf-c/detail/sanity.h atf-c/detail/text.c atf-c/detail/text.h \ - atf-c/detail/tp_main.c atf-c/detail/user.c atf-c/detail/user.h + atf-c/check.h atf-c/error.c atf-c/error.h atf-c/error_fwd.h \ + atf-c/macros.h atf-c/tc.c atf-c/tc.h atf-c/tp.c atf-c/tp.h \ + atf-c/utils.c atf-c/utils.h atf-c/detail/dynstr.c \ + atf-c/detail/dynstr.h atf-c/detail/env.c atf-c/detail/env.h \ + atf-c/detail/fs.c atf-c/detail/fs.h atf-c/detail/list.c \ + atf-c/detail/list.h atf-c/detail/map.c atf-c/detail/map.h \ + atf-c/detail/process.c atf-c/detail/process.h \ + atf-c/detail/sanity.c atf-c/detail/sanity.h \ + atf-c/detail/text.c atf-c/detail/text.h atf-c/detail/tp_main.c \ + atf-c/detail/user.c atf-c/detail/user.h nodist_libatf_c_la_SOURCES = atf-c/defs.h libatf_c_la_CPPFLAGS = "-DATF_BUILD_CC=\"$(ATF_BUILD_CC)\"" \ "-DATF_BUILD_CFLAGS=\"$(ATF_BUILD_CFLAGS)\"" \ "-DATF_BUILD_CPP=\"$(ATF_BUILD_CPP)\"" \ "-DATF_BUILD_CPPFLAGS=\"$(ATF_BUILD_CPPFLAGS)\"" \ "-DATF_BUILD_CXX=\"$(ATF_BUILD_CXX)\"" \ - "-DATF_BUILD_CXXFLAGS=\"$(ATF_BUILD_CXXFLAGS)\"" \ - "-DATF_INCLUDEDIR=\"$(includedir)\"" \ - "-DATF_LIBEXECDIR=\"$(libexecdir)\"" \ - "-DATF_PKGDATADIR=\"$(pkgdatadir)\"" \ - "-DATF_SHELL=\"$(ATF_SHELL)\"" \ - "-DATF_WORKDIR=\"$(ATF_WORKDIR)\"" + "-DATF_BUILD_CXXFLAGS=\"$(ATF_BUILD_CXXFLAGS)\"" -libatf_c_la_LDFLAGS = -version-info 0:0:0 +libatf_c_la_LDFLAGS = -version-info 1:0:0 atf_c_HEADERS = atf-c/build.h \ atf-c/check.h \ - atf-c/config.h \ - atf-c/defs.h \ atf-c/error.h \ atf-c/error_fwd.h \ atf-c/macros.h \ @@ -1147,6 +1081,7 @@ atf_c_HEADERS = atf-c/build.h \ atf-c/tp.h \ atf-c/utils.h +nodist_atf_c_HEADERS = atf-c/defs.h atf_cdir = $(includedir)/atf-c atf_cpkgconfigdir = $(atf_pkgconfigdir) atf_cpkgconfig_DATA = atf-c/atf-c.pc @@ -1161,8 +1096,6 @@ atf_c_build_test_SOURCES = atf-c/build_t atf_c_build_test_LDADD = atf-c/detail/libtest_helpers.la libatf-c.la atf_c_check_test_SOURCES = atf-c/check_test.c atf_c_check_test_LDADD = atf-c/detail/libtest_helpers.la libatf-c.la -atf_c_config_test_SOURCES = atf-c/config_test.c -atf_c_config_test_LDADD = atf-c/detail/libtest_helpers.la libatf-c.la atf_c_error_test_SOURCES = atf-c/error_test.c atf_c_error_test_LDADD = atf-c/detail/libtest_helpers.la libatf-c.la atf_c_macros_test_SOURCES = atf-c/macros_test.c @@ -1179,7 +1112,9 @@ tests_atf_c_detaildir = $(pkgtestsdir)/a atf_c_detail_libtest_helpers_la_SOURCES = atf-c/detail/test_helpers.c \ atf-c/detail/test_helpers.h -atf_c_detail_libtest_helpers_la_CPPFLAGS = -I$(srcdir)/atf-c +atf_c_detail_libtest_helpers_la_CPPFLAGS = -I$(srcdir)/atf-c \ + -DATF_INCLUDEDIR=\"$(includedir)\" + atf_c_detail_dynstr_test_SOURCES = atf-c/detail/dynstr_test.c atf_c_detail_dynstr_test_LDADD = atf-c/detail/libtest_helpers.la libatf-c.la atf_c_detail_env_test_SOURCES = atf-c/detail/env_test.c @@ -1203,20 +1138,19 @@ atf_c_detail_version_helper_SOURCES = at ATF_CXX_LIBS = libatf-c++.la libatf-c.la libatf_c___la_LIBADD = libatf-c.la libatf_c___la_SOURCES = atf-c++/build.cpp atf-c++/build.hpp \ - atf-c++/check.cpp atf-c++/check.hpp atf-c++/config.cpp \ - atf-c++/config.hpp atf-c++/macros.hpp atf-c++/tests.cpp \ - atf-c++/tests.hpp atf-c++/utils.cpp atf-c++/utils.hpp \ - atf-c++/detail/application.cpp atf-c++/detail/application.hpp \ - atf-c++/detail/auto_array.hpp atf-c++/detail/env.cpp \ - atf-c++/detail/env.hpp atf-c++/detail/exceptions.cpp \ - atf-c++/detail/exceptions.hpp atf-c++/detail/fs.cpp \ - atf-c++/detail/fs.hpp atf-c++/detail/process.cpp \ - atf-c++/detail/process.hpp atf-c++/detail/sanity.hpp \ - atf-c++/detail/text.cpp atf-c++/detail/text.hpp -libatf_c___la_LDFLAGS = -version-info 1:0:0 + atf-c++/check.cpp atf-c++/check.hpp atf-c++/macros.hpp \ + atf-c++/tests.cpp atf-c++/tests.hpp atf-c++/utils.cpp \ + atf-c++/utils.hpp atf-c++/detail/application.cpp \ + atf-c++/detail/application.hpp atf-c++/detail/auto_array.hpp \ + atf-c++/detail/env.cpp atf-c++/detail/env.hpp \ + atf-c++/detail/exceptions.cpp atf-c++/detail/exceptions.hpp \ + atf-c++/detail/fs.cpp atf-c++/detail/fs.hpp \ + atf-c++/detail/process.cpp atf-c++/detail/process.hpp \ + atf-c++/detail/sanity.hpp atf-c++/detail/text.cpp \ + atf-c++/detail/text.hpp +libatf_c___la_LDFLAGS = -version-info 2:0:0 atf_c___HEADERS = atf-c++/build.hpp \ atf-c++/check.hpp \ - atf-c++/config.hpp \ atf-c++/macros.hpp \ atf-c++/tests.hpp \ atf-c++/utils.hpp @@ -1235,8 +1169,6 @@ atf_c___build_test_SOURCES = atf-c++/bui atf_c___build_test_LDADD = atf-c++/detail/libtest_helpers.la $(ATF_CXX_LIBS) atf_c___check_test_SOURCES = atf-c++/check_test.cpp atf_c___check_test_LDADD = atf-c++/detail/libtest_helpers.la $(ATF_CXX_LIBS) -atf_c___config_test_SOURCES = atf-c++/config_test.cpp -atf_c___config_test_LDADD = atf-c++/detail/libtest_helpers.la $(ATF_CXX_LIBS) atf_c___macros_test_SOURCES = atf-c++/macros_test.cpp atf_c___macros_test_LDADD = atf-c++/detail/libtest_helpers.la $(ATF_CXX_LIBS) tests_atf_c___SCRIPTS = atf-c++/pkg_config_test @@ -1249,6 +1181,7 @@ tests_atf_c___detaildir = $(pkgtestsdir) atf_c___detail_libtest_helpers_la_SOURCES = atf-c++/detail/test_helpers.cpp \ atf-c++/detail/test_helpers.hpp +atf_c___detail_libtest_helpers_la_CPPFLAGS = -DATF_INCLUDEDIR=\"$(includedir)\" atf_c___detail_application_test_SOURCES = atf-c++/detail/application_test.cpp atf_c___detail_application_test_LDADD = atf-c++/detail/libtest_helpers.la $(ATF_CXX_LIBS) atf_c___detail_auto_array_test_SOURCES = atf-c++/detail/auto_array_test.cpp @@ -1261,14 +1194,17 @@ atf_c___detail_fs_test_SOURCES = atf-c++ atf_c___detail_fs_test_LDADD = atf-c++/detail/libtest_helpers.la $(ATF_CXX_LIBS) atf_c___detail_process_test_SOURCES = atf-c++/detail/process_test.cpp atf_c___detail_process_test_LDADD = atf-c++/detail/libtest_helpers.la $(ATF_CXX_LIBS) -atf_c___detail_sanity_test_SOURCES = atf-c++/detail/sanity_test.cpp -atf_c___detail_sanity_test_LDADD = atf-c++/detail/libtest_helpers.la $(ATF_CXX_LIBS) atf_c___detail_text_test_SOURCES = atf-c++/detail/text_test.cpp atf_c___detail_text_test_LDADD = atf-c++/detail/libtest_helpers.la $(ATF_CXX_LIBS) atf_c___detail_version_helper_SOURCES = atf-c++/detail/version_helper.cpp atf_sh_atf_check_SOURCES = atf-sh/atf-check.cpp atf_sh_atf_check_LDADD = $(ATF_CXX_LIBS) +atf_sh_atf_check_CPPFLAGS = -DATF_SHELL=\"$(ATF_SHELL)\" atf_sh_atf_sh_SOURCES = atf-sh/atf-sh.cpp +atf_sh_atf_sh_CPPFLAGS = -DATF_LIBEXECDIR=\"$(libexecdir)\" \ + -DATF_PKGDATADIR=\"$(pkgdatadir)\" \ + -DATF_SHELL=\"$(ATF_SHELL)\" + atf_sh_atf_sh_LDADD = $(ATF_CXX_LIBS) atf_sh_DATA = atf-sh/libatf-sh.subr atf_shdir = $(pkgdatadir) @@ -1320,16 +1256,24 @@ doc_DATA = AUTHORS COPYING NEWS README TESTS_ENVIRONMENT = PATH=$(prefix)/bin:$${PATH} \ PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig + +# Allow the caller to override the configuration file to passed to our +# test runs below. +KYUA_TEST_CONFIG_FILE = none testsdir = $(exec_prefix)/tests pkgtestsdir = $(testsdir)/$(PACKAGE) pkgtests_DATA = Kyuafile BUILD_SH_TP = \ - echo "Creating $${dst}"; \ - echo "\#! $(bindir)/atf-sh" >$${dst}; \ - cat $${src} >>$${dst}; \ - chmod +x $${dst} + test -d "$$(dirname "$${dst}")" || mkdir -p "$$(dirname "$${dst}")"; \ + echo "\#! $(bindir)/atf-sh" >"$${dst}"; \ + if [ -n "$${substs}" ]; then \ + cat $${src} | sed $${substs} >>"$${dst}"; \ + else \ + cat $${src} >>"$${dst}"; \ + fi; \ + chmod +x "$${dst}" -all: $(BUILT_SOURCES) bconfig.h +all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: @@ -1370,20 +1314,20 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): -bconfig.h: stamp-h1 +config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 -stamp-h1: $(srcdir)/bconfig.h.in $(top_builddir)/config.status +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status bconfig.h -$(srcdir)/bconfig.h.in: $(am__configure_deps) + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: - -rm -f bconfig.h stamp-h1 + -rm -f config.h stamp-h1 atf-c/defs.h: $(top_builddir)/config.status $(top_srcdir)/atf-c/defs.h.in cd $(top_builddir) && $(SHELL) ./config.status $@ @@ -1438,7 +1382,8 @@ atf-c++/detail/$(am__dirstamp): atf-c++/detail/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) atf-c++/detail/$(DEPDIR) @: > atf-c++/detail/$(DEPDIR)/$(am__dirstamp) -atf-c++/detail/test_helpers.lo: atf-c++/detail/$(am__dirstamp) \ +atf-c++/detail/atf_c___detail_libtest_helpers_la-test_helpers.lo: \ + atf-c++/detail/$(am__dirstamp) \ atf-c++/detail/$(DEPDIR)/$(am__dirstamp) atf-c++/detail/libtest_helpers.la: $(atf_c___detail_libtest_helpers_la_OBJECTS) $(atf_c___detail_libtest_helpers_la_DEPENDENCIES) $(EXTRA_atf_c___detail_libtest_helpers_la_DEPENDENCIES) atf-c++/detail/$(am__dirstamp) @@ -1465,8 +1410,6 @@ atf-c++/build.lo: atf-c++/$(am__dirstamp atf-c++/$(DEPDIR)/$(am__dirstamp) atf-c++/check.lo: atf-c++/$(am__dirstamp) \ atf-c++/$(DEPDIR)/$(am__dirstamp) -atf-c++/config.lo: atf-c++/$(am__dirstamp) \ - atf-c++/$(DEPDIR)/$(am__dirstamp) atf-c++/tests.lo: atf-c++/$(am__dirstamp) \ atf-c++/$(DEPDIR)/$(am__dirstamp) atf-c++/utils.lo: atf-c++/$(am__dirstamp) \ @@ -1496,8 +1439,6 @@ atf-c/libatf_c_la-build.lo: atf-c/$(am__ atf-c/$(DEPDIR)/$(am__dirstamp) atf-c/libatf_c_la-check.lo: atf-c/$(am__dirstamp) \ atf-c/$(DEPDIR)/$(am__dirstamp) -atf-c/libatf_c_la-config.lo: atf-c/$(am__dirstamp) \ - atf-c/$(DEPDIR)/$(am__dirstamp) atf-c/libatf_c_la-error.lo: atf-c/$(am__dirstamp) \ atf-c/$(DEPDIR)/$(am__dirstamp) atf-c/libatf_c_la-tc.lo: atf-c/$(am__dirstamp) \ @@ -1899,12 +1840,6 @@ atf-c++/check_test.$(OBJEXT): atf-c++/$( atf-c++/check_test$(EXEEXT): $(atf_c___check_test_OBJECTS) $(atf_c___check_test_DEPENDENCIES) $(EXTRA_atf_c___check_test_DEPENDENCIES) atf-c++/$(am__dirstamp) @rm -f atf-c++/check_test$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(atf_c___check_test_OBJECTS) $(atf_c___check_test_LDADD) $(LIBS) -atf-c++/config_test.$(OBJEXT): atf-c++/$(am__dirstamp) \ - atf-c++/$(DEPDIR)/$(am__dirstamp) - -atf-c++/config_test$(EXEEXT): $(atf_c___config_test_OBJECTS) $(atf_c___config_test_DEPENDENCIES) $(EXTRA_atf_c___config_test_DEPENDENCIES) atf-c++/$(am__dirstamp) - @rm -f atf-c++/config_test$(EXEEXT) - $(AM_V_CXXLD)$(CXXLINK) $(atf_c___config_test_OBJECTS) $(atf_c___config_test_LDADD) $(LIBS) atf-c++/detail/application_test.$(OBJEXT): \ atf-c++/detail/$(am__dirstamp) \ atf-c++/detail/$(DEPDIR)/$(am__dirstamp) @@ -1944,12 +1879,6 @@ atf-c++/detail/process_test.$(OBJEXT): a atf-c++/detail/process_test$(EXEEXT): $(atf_c___detail_process_test_OBJECTS) $(atf_c___detail_process_test_DEPENDENCIES) $(EXTRA_atf_c___detail_process_test_DEPENDENCIES) atf-c++/detail/$(am__dirstamp) @rm -f atf-c++/detail/process_test$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(atf_c___detail_process_test_OBJECTS) $(atf_c___detail_process_test_LDADD) $(LIBS) -atf-c++/detail/sanity_test.$(OBJEXT): atf-c++/detail/$(am__dirstamp) \ - atf-c++/detail/$(DEPDIR)/$(am__dirstamp) - -atf-c++/detail/sanity_test$(EXEEXT): $(atf_c___detail_sanity_test_OBJECTS) $(atf_c___detail_sanity_test_DEPENDENCIES) $(EXTRA_atf_c___detail_sanity_test_DEPENDENCIES) atf-c++/detail/$(am__dirstamp) - @rm -f atf-c++/detail/sanity_test$(EXEEXT) - $(AM_V_CXXLD)$(CXXLINK) $(atf_c___detail_sanity_test_OBJECTS) $(atf_c___detail_sanity_test_LDADD) $(LIBS) atf-c++/detail/text_test.$(OBJEXT): atf-c++/detail/$(am__dirstamp) \ atf-c++/detail/$(DEPDIR)/$(am__dirstamp) @@ -1999,12 +1928,6 @@ atf-c/check_test.$(OBJEXT): atf-c/$(am__ atf-c/check_test$(EXEEXT): $(atf_c_check_test_OBJECTS) $(atf_c_check_test_DEPENDENCIES) $(EXTRA_atf_c_check_test_DEPENDENCIES) atf-c/$(am__dirstamp) @rm -f atf-c/check_test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(atf_c_check_test_OBJECTS) $(atf_c_check_test_LDADD) $(LIBS) -atf-c/config_test.$(OBJEXT): atf-c/$(am__dirstamp) \ - atf-c/$(DEPDIR)/$(am__dirstamp) - -atf-c/config_test$(EXEEXT): $(atf_c_config_test_OBJECTS) $(atf_c_config_test_DEPENDENCIES) $(EXTRA_atf_c_config_test_DEPENDENCIES) atf-c/$(am__dirstamp) - @rm -f atf-c/config_test$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(atf_c_config_test_OBJECTS) $(atf_c_config_test_LDADD) $(LIBS) atf-c/detail/dynstr_test.$(OBJEXT): atf-c/detail/$(am__dirstamp) \ atf-c/detail/$(DEPDIR)/$(am__dirstamp) @@ -2107,13 +2030,13 @@ atf-sh/$(am__dirstamp): atf-sh/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) atf-sh/$(DEPDIR) @: > atf-sh/$(DEPDIR)/$(am__dirstamp) -atf-sh/atf-check.$(OBJEXT): atf-sh/$(am__dirstamp) \ +atf-sh/atf_sh_atf_check-atf-check.$(OBJEXT): atf-sh/$(am__dirstamp) \ atf-sh/$(DEPDIR)/$(am__dirstamp) atf-sh/atf-check$(EXEEXT): $(atf_sh_atf_check_OBJECTS) $(atf_sh_atf_check_DEPENDENCIES) $(EXTRA_atf_sh_atf_check_DEPENDENCIES) atf-sh/$(am__dirstamp) @rm -f atf-sh/atf-check$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(atf_sh_atf_check_OBJECTS) $(atf_sh_atf_check_LDADD) $(LIBS) -atf-sh/atf-sh.$(OBJEXT): atf-sh/$(am__dirstamp) \ +atf-sh/atf_sh_atf_sh-atf-sh.$(OBJEXT): atf-sh/$(am__dirstamp) \ atf-sh/$(DEPDIR)/$(am__dirstamp) atf-sh/atf-sh$(EXEEXT): $(atf_sh_atf_sh_OBJECTS) $(atf_sh_atf_sh_DEPENDENCIES) $(EXTRA_atf_sh_atf_sh_DEPENDENCIES) atf-sh/$(am__dirstamp) @@ -2318,8 +2241,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@atf-c++/$(DEPDIR)/build_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c++/$(DEPDIR)/check.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c++/$(DEPDIR)/check_test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@atf-c++/$(DEPDIR)/config.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@atf-c++/$(DEPDIR)/config_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c++/$(DEPDIR)/macros_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c++/$(DEPDIR)/tests.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c++/$(DEPDIR)/tests_test.Po@am__quote@ @@ -2327,6 +2248,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@atf-c++/$(DEPDIR)/utils_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c++/detail/$(DEPDIR)/application.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c++/detail/$(DEPDIR)/application_test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@atf-c++/detail/$(DEPDIR)/atf_c___detail_libtest_helpers_la-test_helpers.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c++/detail/$(DEPDIR)/auto_array_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c++/detail/$(DEPDIR)/env.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c++/detail/$(DEPDIR)/env_test.Po@am__quote@ @@ -2336,19 +2258,15 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@atf-c++/detail/$(DEPDIR)/fs_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c++/detail/$(DEPDIR)/process.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c++/detail/$(DEPDIR)/process_test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@atf-c++/detail/$(DEPDIR)/sanity_test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@atf-c++/detail/$(DEPDIR)/test_helpers.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c++/detail/$(DEPDIR)/text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c++/detail/$(DEPDIR)/text_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c++/detail/$(DEPDIR)/version_helper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c/$(DEPDIR)/atf_c_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c/$(DEPDIR)/build_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c/$(DEPDIR)/check_test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@atf-c/$(DEPDIR)/config_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c/$(DEPDIR)/error_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c/$(DEPDIR)/libatf_c_la-build.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c/$(DEPDIR)/libatf_c_la-check.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@atf-c/$(DEPDIR)/libatf_c_la-config.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c/$(DEPDIR)/libatf_c_la-error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c/$(DEPDIR)/libatf_c_la-tc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c/$(DEPDIR)/libatf_c_la-tp.Plo@am__quote@ @@ -2379,8 +2297,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@atf-c/detail/$(DEPDIR)/text_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c/detail/$(DEPDIR)/user_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@atf-c/detail/$(DEPDIR)/version_helper.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@atf-sh/$(DEPDIR)/atf-check.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@atf-sh/$(DEPDIR)/atf-sh.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@atf-sh/$(DEPDIR)/atf_sh_atf_check-atf-check.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@atf-sh/$(DEPDIR)/atf_sh_atf_sh-atf-sh.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@bootstrap/$(DEPDIR)/h_tp_basic_c.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@bootstrap/$(DEPDIR)/h_tp_basic_cpp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@test-programs/$(DEPDIR)/c_helpers.Po@am__quote@ @@ -2431,13 +2349,6 @@ atf-c/libatf_c_la-check.lo: atf-c/check. @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libatf_c_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o atf-c/libatf_c_la-check.lo `test -f 'atf-c/check.c' || echo '$(srcdir)/'`atf-c/check.c -atf-c/libatf_c_la-config.lo: atf-c/config.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libatf_c_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT atf-c/libatf_c_la-config.lo -MD -MP -MF atf-c/$(DEPDIR)/libatf_c_la-config.Tpo -c -o atf-c/libatf_c_la-config.lo `test -f 'atf-c/config.c' || echo '$(srcdir)/'`atf-c/config.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) atf-c/$(DEPDIR)/libatf_c_la-config.Tpo atf-c/$(DEPDIR)/libatf_c_la-config.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='atf-c/config.c' object='atf-c/libatf_c_la-config.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libatf_c_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o atf-c/libatf_c_la-config.lo `test -f 'atf-c/config.c' || echo '$(srcdir)/'`atf-c/config.c - atf-c/libatf_c_la-error.lo: atf-c/error.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libatf_c_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT atf-c/libatf_c_la-error.lo -MD -MP -MF atf-c/$(DEPDIR)/libatf_c_la-error.Tpo -c -o atf-c/libatf_c_la-error.lo `test -f 'atf-c/error.c' || echo '$(srcdir)/'`atf-c/error.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) atf-c/$(DEPDIR)/libatf_c_la-error.Tpo atf-c/$(DEPDIR)/libatf_c_la-error.Plo @@ -2560,6 +2471,41 @@ atf-c/detail/libatf_c_la-user.lo: atf-c/ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< +atf-c++/detail/atf_c___detail_libtest_helpers_la-test_helpers.lo: atf-c++/detail/test_helpers.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(atf_c___detail_libtest_helpers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT atf-c++/detail/atf_c___detail_libtest_helpers_la-test_helpers.lo -MD -MP -MF atf-c++/detail/$(DEPDIR)/atf_c___detail_libtest_helpers_la-test_helpers.Tpo -c -o atf-c++/detail/atf_c___detail_libtest_helpers_la-test_helpers.lo `test -f 'atf-c++/detail/test_helpers.cpp' || echo '$(srcdir)/'`atf-c++/detail/test_helpers.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) atf-c++/detail/$(DEPDIR)/atf_c___detail_libtest_helpers_la-test_helpers.Tpo atf-c++/detail/$(DEPDIR)/atf_c___detail_libtest_helpers_la-test_helpers.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='atf-c++/detail/test_helpers.cpp' object='atf-c++/detail/atf_c___detail_libtest_helpers_la-test_helpers.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(atf_c___detail_libtest_helpers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o atf-c++/detail/atf_c___detail_libtest_helpers_la-test_helpers.lo `test -f 'atf-c++/detail/test_helpers.cpp' || echo '$(srcdir)/'`atf-c++/detail/test_helpers.cpp + +atf-sh/atf_sh_atf_check-atf-check.o: atf-sh/atf-check.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(atf_sh_atf_check_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT atf-sh/atf_sh_atf_check-atf-check.o -MD -MP -MF atf-sh/$(DEPDIR)/atf_sh_atf_check-atf-check.Tpo -c -o atf-sh/atf_sh_atf_check-atf-check.o `test -f 'atf-sh/atf-check.cpp' || echo '$(srcdir)/'`atf-sh/atf-check.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) atf-sh/$(DEPDIR)/atf_sh_atf_check-atf-check.Tpo atf-sh/$(DEPDIR)/atf_sh_atf_check-atf-check.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='atf-sh/atf-check.cpp' object='atf-sh/atf_sh_atf_check-atf-check.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(atf_sh_atf_check_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o atf-sh/atf_sh_atf_check-atf-check.o `test -f 'atf-sh/atf-check.cpp' || echo '$(srcdir)/'`atf-sh/atf-check.cpp + +atf-sh/atf_sh_atf_check-atf-check.obj: atf-sh/atf-check.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(atf_sh_atf_check_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT atf-sh/atf_sh_atf_check-atf-check.obj -MD -MP -MF atf-sh/$(DEPDIR)/atf_sh_atf_check-atf-check.Tpo -c -o atf-sh/atf_sh_atf_check-atf-check.obj `if test -f 'atf-sh/atf-check.cpp'; then $(CYGPATH_W) 'atf-sh/atf-check.cpp'; else $(CYGPATH_W) '$(srcdir)/atf-sh/atf-check.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) atf-sh/$(DEPDIR)/atf_sh_atf_check-atf-check.Tpo atf-sh/$(DEPDIR)/atf_sh_atf_check-atf-check.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='atf-sh/atf-check.cpp' object='atf-sh/atf_sh_atf_check-atf-check.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(atf_sh_atf_check_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o atf-sh/atf_sh_atf_check-atf-check.obj `if test -f 'atf-sh/atf-check.cpp'; then $(CYGPATH_W) 'atf-sh/atf-check.cpp'; else $(CYGPATH_W) '$(srcdir)/atf-sh/atf-check.cpp'; fi` + +atf-sh/atf_sh_atf_sh-atf-sh.o: atf-sh/atf-sh.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(atf_sh_atf_sh_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT atf-sh/atf_sh_atf_sh-atf-sh.o -MD -MP -MF atf-sh/$(DEPDIR)/atf_sh_atf_sh-atf-sh.Tpo -c -o atf-sh/atf_sh_atf_sh-atf-sh.o `test -f 'atf-sh/atf-sh.cpp' || echo '$(srcdir)/'`atf-sh/atf-sh.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) atf-sh/$(DEPDIR)/atf_sh_atf_sh-atf-sh.Tpo atf-sh/$(DEPDIR)/atf_sh_atf_sh-atf-sh.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='atf-sh/atf-sh.cpp' object='atf-sh/atf_sh_atf_sh-atf-sh.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(atf_sh_atf_sh_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o atf-sh/atf_sh_atf_sh-atf-sh.o `test -f 'atf-sh/atf-sh.cpp' || echo '$(srcdir)/'`atf-sh/atf-sh.cpp + +atf-sh/atf_sh_atf_sh-atf-sh.obj: atf-sh/atf-sh.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(atf_sh_atf_sh_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT atf-sh/atf_sh_atf_sh-atf-sh.obj -MD -MP -MF atf-sh/$(DEPDIR)/atf_sh_atf_sh-atf-sh.Tpo -c -o atf-sh/atf_sh_atf_sh-atf-sh.obj `if test -f 'atf-sh/atf-sh.cpp'; then $(CYGPATH_W) 'atf-sh/atf-sh.cpp'; else $(CYGPATH_W) '$(srcdir)/atf-sh/atf-sh.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) atf-sh/$(DEPDIR)/atf_sh_atf_sh-atf-sh.Tpo atf-sh/$(DEPDIR)/atf_sh_atf_sh-atf-sh.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='atf-sh/atf-sh.cpp' object='atf-sh/atf_sh_atf_sh-atf-sh.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(atf_sh_atf_sh_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o atf-sh/atf_sh_atf_sh-atf-sh.obj `if test -f 'atf-sh/atf-sh.cpp'; then $(CYGPATH_W) 'atf-sh/atf-sh.cpp'; else $(CYGPATH_W) '$(srcdir)/atf-sh/atf-sh.cpp'; fi` + mostlyclean-libtool: -rm -f *.lo @@ -2704,6 +2650,49 @@ uninstall-man4: } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^4][0-9a-z]*$$,4,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man4dir)'; $(am__uninstall_files_from_dir) +install-man7: $(dist_man_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(dist_man_MANS) $(man_MANS)'; \ + test -n "$(man7dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man7dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man7dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.7[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man7dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man7dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man7dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man7dir)" || exit $$?; }; \ + done; } + +uninstall-man7: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man7dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(dist_man_MANS) $(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.7[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man7dir)'; $(am__uninstall_files_from_dir) install-atf_aclocalDATA: $(atf_aclocal_DATA) @$(NORMAL_INSTALL) @list='$(atf_aclocal_DATA)'; test -n "$(atf_aclocaldir)" || list=; \ @@ -3040,6 +3029,27 @@ uninstall-includeHEADERS: @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) +install-nodist_atf_cHEADERS: $(nodist_atf_c_HEADERS) + @$(NORMAL_INSTALL) + @list='$(nodist_atf_c_HEADERS)'; test -n "$(atf_cdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(atf_cdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(atf_cdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(atf_cdir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(atf_cdir)" || exit $$?; \ + done + +uninstall-nodist_atf_cHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(nodist_atf_c_HEADERS)'; test -n "$(atf_cdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(atf_cdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -3276,11 +3286,11 @@ check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) \ - $(HEADERS) bconfig.h + $(HEADERS) config.h install-binPROGRAMS: install-libLTLIBRARIES installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(tests_atf_cdir)" "$(DESTDIR)$(tests_atf_c__dir)" "$(DESTDIR)$(tests_atf_c___detaildir)" "$(DESTDIR)$(tests_atf_c_detaildir)" "$(DESTDIR)$(tests_test_programsdir)" "$(DESTDIR)$(tests_atf_cdir)" "$(DESTDIR)$(tests_atf_c__dir)" "$(DESTDIR)$(tests_atf_shdir)" "$(DESTDIR)$(tests_test_programsdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man4dir)" "$(DESTDIR)$(atf_aclocaldir)" "$(DESTDIR)$(atf_c__dirpkgconfigdir)" "$(DESTDIR)$(atf_cpkgconfigdir)" "$(DESTDIR)$(atf_shdir)" "$(DESTDIR)$(atf_shpkgconfigdir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgtestsdir)" "$(DESTDIR)$(tests_atf_cdir)" "$(DESTDIR)$(tests_atf_c__dir)" "$(DESTDIR)$(tests_atf_c___detaildir)" "$(DESTDIR)$(tests_atf_c_detaildir)" "$(DESTDIR)$(tests_atf_shdir)" "$(DESTDIR)$(tests_test_programsdir)" "$(DESTDIR)$(atf_cdir)" "$(DESTDIR)$(atf_c__dir)" "$(DESTDIR)$(includedir)"; do \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(tests_atf_cdir)" "$(DESTDIR)$(tests_atf_c__dir)" "$(DESTDIR)$(tests_atf_c___detaildir)" "$(DESTDIR)$(tests_atf_c_detaildir)" "$(DESTDIR)$(tests_test_programsdir)" "$(DESTDIR)$(tests_atf_cdir)" "$(DESTDIR)$(tests_atf_c__dir)" "$(DESTDIR)$(tests_atf_shdir)" "$(DESTDIR)$(tests_test_programsdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man4dir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(atf_aclocaldir)" "$(DESTDIR)$(atf_c__dirpkgconfigdir)" "$(DESTDIR)$(atf_cpkgconfigdir)" "$(DESTDIR)$(atf_shdir)" "$(DESTDIR)$(atf_shpkgconfigdir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgtestsdir)" "$(DESTDIR)$(tests_atf_cdir)" "$(DESTDIR)$(tests_atf_c__dir)" "$(DESTDIR)$(tests_atf_c___detaildir)" "$(DESTDIR)$(tests_atf_c_detaildir)" "$(DESTDIR)$(tests_atf_shdir)" "$(DESTDIR)$(tests_test_programsdir)" "$(DESTDIR)$(atf_cdir)" "$(DESTDIR)$(atf_c__dir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(atf_cdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) @@ -3363,18 +3373,19 @@ install-data-am: install-atf_aclocalDATA install-atf_c__HEADERS install-atf_c__dirpkgconfigDATA \ install-atf_cpkgconfigDATA install-atf_shDATA \ install-atf_shpkgconfigDATA install-docDATA \ - install-includeHEADERS install-man install-pkgtestsDATA \ - install-tests_atf_cDATA install-tests_atf_cPROGRAMS \ - install-tests_atf_cSCRIPTS install-tests_atf_c__DATA \ - install-tests_atf_c__PROGRAMS install-tests_atf_c__SCRIPTS \ - install-tests_atf_c___detailDATA \ + install-includeHEADERS install-man install-nodist_atf_cHEADERS \ + install-pkgtestsDATA install-tests_atf_cDATA \ + install-tests_atf_cPROGRAMS install-tests_atf_cSCRIPTS \ + install-tests_atf_c__DATA install-tests_atf_c__PROGRAMS \ + install-tests_atf_c__SCRIPTS install-tests_atf_c___detailDATA \ install-tests_atf_c___detailPROGRAMS \ install-tests_atf_c_detailDATA \ install-tests_atf_c_detailPROGRAMS install-tests_atf_shDATA \ install-tests_atf_shSCRIPTS install-tests_test_programsDATA \ install-tests_test_programsPROGRAMS \ install-tests_test_programsSCRIPTS - + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: @@ -3390,7 +3401,7 @@ install-info: install-info-am install-info-am: -install-man: install-man1 install-man3 install-man4 +install-man: install-man1 install-man3 install-man4 install-man7 install-pdf: install-pdf-am @@ -3428,7 +3439,8 @@ uninstall-am: uninstall-atf_aclocalDATA uninstall-atf_shpkgconfigDATA uninstall-binPROGRAMS \ uninstall-docDATA uninstall-includeHEADERS \ uninstall-libLTLIBRARIES uninstall-libexecPROGRAMS \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 17:14:51 2014 Return-Path: Delivered-To: svn-src-all@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 B4583F47; Thu, 30 Oct 2014 17:14: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 87FDC7FD; Thu, 30 Oct 2014 17:14: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 s9UHEpXT038775; Thu, 30 Oct 2014 17:14:51 GMT (envelope-from jmmv@FreeBSD.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UHEpf3038774; Thu, 30 Oct 2014 17:14:51 GMT (envelope-from jmmv@FreeBSD.org) Message-Id: <201410301714.s9UHEpf3038774@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmmv set sender to jmmv@FreeBSD.org using -f From: Julio Merino Date: Thu, 30 Oct 2014 17:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r273870 - vendor/atf/atf-0.21 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 17:14:51 -0000 Author: jmmv Date: Thu Oct 30 17:14:51 2014 New Revision: 273870 URL: https://svnweb.freebsd.org/changeset/base/273870 Log: Tag import of atf-0.21. Added: vendor/atf/atf-0.21/ - copied from r273869, vendor/atf/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 17:58:58 2014 Return-Path: Delivered-To: svn-src-all@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 89821B32; Thu, 30 Oct 2014 17:58: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 75E56CD4; Thu, 30 Oct 2014 17:58: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 s9UHww23057291; Thu, 30 Oct 2014 17:58:58 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UHww31057290; Thu, 30 Oct 2014 17:58:58 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201410301758.s9UHww31057290@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 30 Oct 2014 17:58:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273871 - head/sys/i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 17:58:58 -0000 Author: jhb Date: Thu Oct 30 17:58:57 2014 New Revision: 273871 URL: https://svnweb.freebsd.org/changeset/base/273871 Log: Skip the smap sysctl instead of panicing if no kernel metadata can be found. Submitted by: bde MFC after: 3 days Modified: head/sys/i386/i386/machdep.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Thu Oct 30 17:14:51 2014 (r273870) +++ head/sys/i386/i386/machdep.c Thu Oct 30 17:58:57 2014 (r273871) @@ -3428,6 +3428,8 @@ smap_sysctl_handler(SYSCTL_HANDLER_ARGS) kmdp = preload_search_by_type("elf kernel"); if (kmdp == NULL) kmdp = preload_search_by_type("elf32 kernel"); + if (kmdp == NULL) + return (0); smapbase = (struct bios_smap *)preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_SMAP); if (smapbase == NULL) From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 18:09:17 2014 Return-Path: Delivered-To: svn-src-all@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 55A1CF50; Thu, 30 Oct 2014 18:09:17 +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 95C67DE8; Thu, 30 Oct 2014 18:09:16 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id B1ABED41F86; Fri, 31 Oct 2014 05:09:07 +1100 (AEDT) Date: Fri, 31 Oct 2014 05:09:03 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Doug Ambrisko Subject: Re: svn commit: r273865 - in head: sbin/fsck_msdosfs sys/boot/amd64/boot1.efi In-Reply-To: <201410301552.s9UFq1WV098951@svn.freebsd.org> Message-ID: <20141031042846.V2490@besplex.bde.org> References: <201410301552.s9UFq1WV098951@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=BdjhjNd2 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=yY24FRAextMSWnk6TNUA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 18:09:17 -0000 On Thu, 30 Oct 2014, Doug Ambrisko wrote: > Log: > Make UEFI booting of 4Kn disks work: > - convert boot1.efi to corrrectly calculate the lba for what the > media reports and convert the size based on what FreeBSD uses. > The existing code would use the 512 byte lba and convert the > size using 4K byte size. > - make fsck_msdosfs read the boot block as 4K so the read doesn't > fail on a 4Kn drive since FreeBSD will error out parition reads > of a block. Make the bpbBytesPerSec check a multiple of 512 since > it can be 512 or 4K depending on the disk. This allows fsck to > pass checking the EFI partition on a 4Kn disk. > Modified: head/sbin/fsck_msdosfs/boot.c > ============================================================================== > --- head/sbin/fsck_msdosfs/boot.c Thu Oct 30 15:41:25 2014 (r273864) > +++ head/sbin/fsck_msdosfs/boot.c Thu Oct 30 15:52:01 2014 (r273865) > @@ -181,7 +181,7 @@ readboot(int dosfs, struct bootblock *bo > boot->bpbResSectors + boot->bpbFATs * boot->FATsecs - > CLUST_FIRST * boot->bpbSecPerClust; > > - if (boot->bpbBytesPerSec % DOSBOOTBLOCKSIZE != 0) { > + if (boot->bpbBytesPerSec % DOSBOOTBLOCKSIZE_REAL != 0) { > pfatal("Invalid sector size: %u", boot->bpbBytesPerSec); > return FSFATAL; > } > > Modified: head/sbin/fsck_msdosfs/dosfs.h > ============================================================================== > --- head/sbin/fsck_msdosfs/dosfs.h Thu Oct 30 15:41:25 2014 (r273864) > +++ head/sbin/fsck_msdosfs/dosfs.h Thu Oct 30 15:52:01 2014 (r273865) > @@ -30,7 +30,9 @@ > #ifndef DOSFS_H > #define DOSFS_H > > -#define DOSBOOTBLOCKSIZE 512 > +/* support 4Kn disk reads */ > +#define DOSBOOTBLOCKSIZE_REAL 512 > +#define DOSBOOTBLOCKSIZE 4096 > > typedef u_int32_t cl_t; /* type holding a cluster number */ This affects almost everywhere DOSBOOTBLOCKSIZE is used. You only adjusted one place. The others are: % boot.c: u_char fsinfo[2 * DOSBOOTBLOCKSIZE]; fsinfo is more incorrectly sized than before. The change allows i/o of fsinfo[] to work with 4K-sectors, but writes of it now clobber the area beyond what is reserved for it with 512-sectors. fsinfo actually has size 2 * 512, not 2 * sector_size, so reads and writes of it need to be padded if the sector size is larger than 1024. Old versions of msdosfs got fsinfo stuff wrong by laying it out naturally for sector_sized sectors, but its layout is coded for 512-sectors, so there are further complications. % boot.c: u_char backup[DOSBOOTBLOCKSIZE]; Probably OK. % boot.c: if (boot->bpbBytesPerSec % DOSBOOTBLOCKSIZE != 0) { Adjusted. % boot.c: u_char fsinfo[2 * DOSBOOTBLOCKSIZE]; Another fsinfo[] for writing. This is the dangerous one. It might work OK by read/modify write of the larger size provided the modifications are limited to the real fsinfo. I use the following fixes: % Index: boot.c % =================================================================== % RCS file: /home/ncvs/src/sbin/fsck_msdosfs/boot.c,v % retrieving revision 1.6 % diff -u -2 -r1.6 boot.c % --- boot.c 31 Jan 2008 13:16:29 -0000 1.6 % +++ boot.c 3 Jul 2010 16:53:33 -0000 % @@ -48,4 +48,6 @@ % #include "fsutil.h" % % +#define IOSIZE 65536 % + % int % readboot(dosfs, boot) % @@ -53,18 +55,48 @@ % struct bootblock *boot; % { % + u_char ioblock[IOSIZE]; % + u_char iofsinfo[IOSIZE]; % + u_char iobackup[IOSIZE]; % u_char block[DOSBOOTBLOCKSIZE]; % u_char fsinfo[2 * DOSBOOTBLOCKSIZE]; % u_char backup[DOSBOOTBLOCKSIZE]; % + u_char *infop; % + size_t iosize; % + u_int secsize; % int ret = FSOK; % % - if (read(dosfs, block, sizeof block) < sizeof block) { % + /* Search for an i/o size that works. */ % + for (iosize = IOSIZE; iosize >= DOSBOOTBLOCKSIZE; iosize >>= 1) { % + if (lseek(dosfs, (off_t)0, SEEK_SET) == 0 && % + read(dosfs, ioblock, iosize) == (ssize_t)iosize) % + break; % + } % + if (iosize < DOSBOOTBLOCKSIZE) { % perror("could not read boot block"); % return FSFATAL; % } % + memcpy(block, ioblock, sizeof block); Probe for a working size. This stuff is also buggy in ffs utilities and the kernel ffs and msdosfs. Most or all of these do a probe, but assume that 8K-blocks work. I needed better for a DCD-RW that does 2K-reads but only 32K-writes. Support for 4K- and 8K- blocks is only enough for reading the DVD. I only fixed this for fsck_msdosfs, as in this patch. Kernel msdosfs works on the DVD since it only assumes that 8K-blocks work for reading. fsck_msdosfs also assumed that 512-blocks works for writing at least fsinfo[]. % % - if (block[510] != 0x55 || block[511] != 0xaa) { % - pfatal("Invalid signature in boot block: %02x%02x", block[511], block[510]); % + /* % + * Preliminary decode to determine where the signature might be. % + * It is supposed to be at the end of a 512-block, but we used to % + * put it at the end of a sector. Accept the latter so as to fix % + * it someday. % + */ % + secsize = block[11] + (block[12] << 8); % + if (secsize < sizeof block || secsize > IOSIZE) { % + perror("Preposterous or unsupported sector size"); % return FSFATAL; % } % + if (block[510] != 0x55 || block[511] != 0xaa) { % + if (ioblock[secsize - 2] != 0x55 || % + ioblock[secsize - 1] != 0xaa) { % + pfatal("Invalid signature in boot block: %02x%02x", % + block[511], block[510]); % + return FSFATAL; % + } % + pwarn( % + "Invalid primary signature in boot block -- using secondary\n"); % + } % % memset(boot, 0, sizeof *boot); Allow misplaced signatures. % @@ -107,11 +139,12 @@ % boot->Backup = block[50] + (block[51] << 8); % % + iosize = (secsize >= sizeof fsinfo) ? secsize : sizeof fsinfo; % if (lseek(dosfs, boot->FSInfo * boot->BytesPerSec, SEEK_SET) % != boot->FSInfo * boot->BytesPerSec % - || read(dosfs, fsinfo, sizeof fsinfo) % - != sizeof fsinfo) { % + || read(dosfs, iofsinfo, iosize) != (ssize_t)iosize) { % perror("could not read fsinfo block"); % return FSFATAL; % } % + memcpy(fsinfo, iofsinfo, sizeof fsinfo); % if (memcmp(fsinfo, "RRaA", 4) % || memcmp(fsinfo + 0x1e4, "rrAa", 4) % @@ -124,4 +157,22 @@ % || fsinfo[0x3fe] != 0x55 % || fsinfo[0x3ff] != 0xaa) { % + infop = &iofsinfo[secsize - DOSBOOTBLOCKSIZE]; % + if (memcmp(fsinfo, "RRaA", 4) == 0 && % + memcmp(infop + 0x1e4, "rrAa", 4) == 0 && % + infop[0x1fc] == 0 && % + infop[0x1fd] == 0 && % + infop[0x1fe] == 0x55 && % + infop[0x1ff] == 0xaa) { % + pwarn( % + "Invalid signature in fsinfo block -- using secondary\n"); % + /* % + * Silently fix up the actual fsinfo data % + * (just 2 32-bit words) since this data % + * is advisory and the indentation is % + * already too painful to ask about this. % + */ % + memcpy(fsinfo + 0x1e8, infop + 0x1e8, 8); % + goto over; % + } % pwarn("Invalid signature in fsinfo block\n"); % if (ask(0, "Fix")) { % @@ -134,12 +185,14 @@ % fsinfo[0x3fe] = 0x55; % fsinfo[0x3ff] = 0xaa; % + memcpy(iofsinfo, fsinfo, sizeof fsinfo); % if (lseek(dosfs, boot->FSInfo * boot->BytesPerSec, SEEK_SET) % != boot->FSInfo * boot->BytesPerSec % - || write(dosfs, fsinfo, sizeof fsinfo) % - != sizeof fsinfo) { % + || write(dosfs, iofsinfo, iosize) % + != (ssize_t)iosize) { % perror("Unable to write FSInfo"); % return FSFATAL; % } % ret = FSBOOTMOD; % +over: ; % } else % boot->FSInfo = 0; Allow misplaced signatures (and data?) in fsinfo. newfs_msdos used to produce them. % @@ -107,11 +139,12 @@ % boot->Backup = block[50] + (block[51] << 8); % % + iosize = (secsize >= sizeof fsinfo) ? secsize : sizeof fsinfo; % if (lseek(dosfs, boot->FSInfo * boot->BytesPerSec, SEEK_SET) % != boot->FSInfo * boot->BytesPerSec % - || read(dosfs, fsinfo, sizeof fsinfo) % - != sizeof fsinfo) { % + || read(dosfs, iofsinfo, iosize) != (ssize_t)iosize) { % perror("could not read fsinfo block"); % return FSFATAL; % } % + memcpy(fsinfo, iofsinfo, sizeof fsinfo); % if (memcmp(fsinfo, "RRaA", 4) % || memcmp(fsinfo + 0x1e4, "rrAa", 4) % @@ -124,4 +157,22 @@ % || fsinfo[0x3fe] != 0x55 % || fsinfo[0x3ff] != 0xaa) { % + infop = &iofsinfo[secsize - DOSBOOTBLOCKSIZE]; % + if (memcmp(fsinfo, "RRaA", 4) == 0 && % + memcmp(infop + 0x1e4, "rrAa", 4) == 0 && % + infop[0x1fc] == 0 && % + infop[0x1fd] == 0 && % + infop[0x1fe] == 0x55 && % + infop[0x1ff] == 0xaa) { % + pwarn( % + "Invalid signature in fsinfo block -- using secondary\n"); % + /* % + * Silently fix up the actual fsinfo data % + * (just 2 32-bit words) since this data % @@ -156,8 +209,9 @@ % if (lseek(dosfs, boot->Backup * boot->BytesPerSec, SEEK_SET) % != boot->Backup * boot->BytesPerSec % - || read(dosfs, backup, sizeof backup) != sizeof backup) { % + || read(dosfs, iobackup, secsize) != (ssize_t)secsize) { % perror("could not read backup bootblock"); % return FSFATAL; % } % + memcpy(backup, iobackup, sizeof backup); % backup[65] = block[65]; /* XXX */ % if (memcmp(block + 11, backup + 11, 79)) { The backup boot block can be read directly, but I still do some re-blocking for it for some reason. % @@ -235,12 +299,18 @@ % struct bootblock *boot; % { % + u_char iofsinfo[IOSIZE]; % u_char fsinfo[2 * DOSBOOTBLOCKSIZE]; Here DOSBOOTBLOCKSIZE is an obfuscated spelling of 512 or IBM_PC_SECTOR_SIZE_IN_1982 though fsinfo didn't exist until 10(?) years later. (512 was advanced for the time. I used systems with mainly 256-byte sectors and some 128-byte sectors. Having both on the same disk was most complicated.) % + size_t iosize; % + u_int secsize; % % + secsize = boot->BytesPerSec; % + iosize = (secsize >= sizeof fsinfo) ? secsize : sizeof fsinfo; % if (lseek(dosfs, boot->FSInfo * boot->BytesPerSec, SEEK_SET) % != boot->FSInfo * boot->BytesPerSec % - || read(dosfs, fsinfo, sizeof fsinfo) != sizeof fsinfo) { % + || read(dosfs, iofsinfo, iosize) != (ssize_t)iosize) { % perror("could not read fsinfo block"); % return FSFATAL; % } % + memcpy(fsinfo, iofsinfo, sizeof fsinfo); % fsinfo[0x1e8] = (u_char)boot->FSFree; % fsinfo[0x1e9] = (u_char)(boot->FSFree >> 8); % @@ -251,8 +321,8 @@ % fsinfo[0x1ee] = (u_char)(boot->FSNext >> 16); % fsinfo[0x1ef] = (u_char)(boot->FSNext >> 24); % + memcpy(iofsinfo, fsinfo, sizeof fsinfo); % if (lseek(dosfs, boot->FSInfo * boot->BytesPerSec, SEEK_SET) % != boot->FSInfo * boot->BytesPerSec % - || write(dosfs, fsinfo, sizeof fsinfo) % - != sizeof fsinfo) { % + || write(dosfs, iofsinfo, iosize) != (ssize_t)iosize) { % perror("Unable to write FSInfo"); % return FSFATAL; I hardly tested fixing or writing back fsinfo. It is only advisory, so it can be replaced by garbage without much loss. fsck_msdosfs doesn't really understand it, and has bugs like asking whether to fix it but only writing the fixes accidentally if it needs to write for other reasons. Bruce From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 21:21:59 2014 Return-Path: Delivered-To: svn-src-all@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 473F786A; Thu, 30 Oct 2014 21:21: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 2F35460F; Thu, 30 Oct 2014 21:21: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 s9ULLxi8055652; Thu, 30 Oct 2014 21:21:59 GMT (envelope-from markm@FreeBSD.org) Received: (from markm@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9ULLsEw055630; Thu, 30 Oct 2014 21:21:54 GMT (envelope-from markm@FreeBSD.org) Message-Id: <201410302121.s9ULLsEw055630@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markm set sender to markm@FreeBSD.org using -f From: Mark Murray Date: Thu, 30 Oct 2014 21:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 21:21:59 -0000 Author: markm Date: Thu Oct 30 21:21:53 2014 New Revision: 273872 URL: https://svnweb.freebsd.org/changeset/base/273872 Log: This is the much-discussed major upgrade to the random(4) device, known to you all as /dev/random. This code has had an extensive rewrite and a good series of reviews, both by the author and other parties. This means a lot of code has been simplified. Pluggable structures for high-rate entropy generators are available, and it is most definitely not the case that /dev/random can be driven by only a hardware souce any more. This has been designed out of the device. Hardware sources are stirred into the CSPRNG (Yarrow, Fortuna) like any other entropy source. Pluggable modules may be written by third parties for additional sources. The harvesting structures and consequently the locking have been simplified. Entropy harvesting is done in a more general way (the documentation for this will follow). There is some GREAT entropy to be had in the UMA allocator, but it is disabled for now as messing with that is likely to annoy many people. The venerable (but effective) Yarrow algorithm, which is no longer supported by its authors now has an alternative, Fortuna. For now, Yarrow is retained as the default algorithm, but this may be changed using a kernel option. It is intended to make Fortuna the default algorithm for 11.0. Interested parties are encouraged to read ISBN 978-0-470-47424-2 "Cryptography Engineering" By Ferguson, Schneier and Kohno for Fortuna's gory details. Heck, read it anyway. Many thanks to Arthur Mesh who did early grunt work, and who got caught in the crossfire rather more than he deserved to. My thanks also to folks who helped me thresh this out on whiteboards and in the odd "Hallway track", or otherwise. My Nomex pants are on. Let the feedback commence! Reviewed by: trasz,des(partial),imp(partial?),rwatson(partial?) Approved by: so(des) Added: head/sys/dev/random/build.sh (contents, props changed) head/sys/dev/random/fortuna.c (contents, props changed) head/sys/dev/random/fortuna.h (contents, props changed) head/sys/dev/random/uint128.h (contents, props changed) head/sys/dev/random/unit_test.c (contents, props changed) head/sys/dev/random/unit_test.h (contents, props changed) head/sys/modules/padlock_rng/ head/sys/modules/padlock_rng/Makefile (contents, props changed) head/sys/modules/rdrand_rng/ head/sys/modules/rdrand_rng/Makefile (contents, props changed) Deleted: head/etc/rc.d/initrandom head/sys/dev/random/harvest.c head/sys/dev/random/rwfile.c head/sys/dev/random/rwfile.h Modified: head/etc/defaults/rc.conf head/etc/rc.d/Makefile head/etc/rc.d/geli head/etc/rc.d/postrandom head/etc/rc.d/random head/libexec/save-entropy/save-entropy.sh head/share/examples/kld/random_adaptor/random_adaptor_example.c head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/dev/glxsb/glxsb.c head/sys/dev/random/dummy_rng.c head/sys/dev/random/hash.c head/sys/dev/random/hash.h head/sys/dev/random/ivy.c head/sys/dev/random/live_entropy_sources.c head/sys/dev/random/live_entropy_sources.h head/sys/dev/random/nehemiah.c head/sys/dev/random/random_adaptors.c head/sys/dev/random/random_adaptors.h head/sys/dev/random/random_harvestq.c head/sys/dev/random/random_harvestq.h head/sys/dev/random/randomdev.c head/sys/dev/random/randomdev.h head/sys/dev/random/randomdev_soft.c head/sys/dev/random/randomdev_soft.h head/sys/dev/random/yarrow.c head/sys/dev/random/yarrow.h head/sys/kern/init_main.c head/sys/kern/kern_intr.c head/sys/kern/subr_bus.c head/sys/modules/Makefile head/sys/modules/random/Makefile head/sys/net/if_ethersubr.c head/sys/net/if_tun.c head/sys/netgraph/ng_iface.c head/sys/sys/random.h head/sys/vm/uma_core.c Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Thu Oct 30 17:58:57 2014 (r273871) +++ head/etc/defaults/rc.conf Thu Oct 30 21:21:53 2014 (r273872) @@ -645,7 +645,7 @@ update_motd="YES" # update version info entropy_file="/entropy" # Set to NO to disable caching entropy through reboots. # /var/db/entropy-file is preferred if / is not avail. entropy_dir="/var/db/entropy" # Set to NO to disable caching entropy via cron. -entropy_save_sz="2048" # Size of the entropy cache files. +entropy_save_sz="4096" # Size of the entropy cache files. entropy_save_num="8" # Number of entropy cache files to save. harvest_interrupt="YES" # Entropy device harvests interrupt randomness harvest_ethernet="YES" # Entropy device harvests ethernet randomness Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Thu Oct 30 17:58:57 2014 (r273871) +++ head/etc/rc.d/Makefile Thu Oct 30 21:21:53 2014 (r273872) @@ -57,7 +57,6 @@ FILES= DAEMON \ hostid_save \ hostname \ inetd \ - initrandom \ ip6addrctl \ ipfilter \ ipfs \ Modified: head/etc/rc.d/geli ============================================================================== --- head/etc/rc.d/geli Thu Oct 30 17:58:57 2014 (r273871) +++ head/etc/rc.d/geli Thu Oct 30 21:21:53 2014 (r273872) @@ -28,7 +28,7 @@ # # PROVIDE: disks -# REQUIRE: initrandom +# REQUIRE: random # KEYWORD: nojail . /etc/rc.subr Modified: head/etc/rc.d/postrandom ============================================================================== --- head/etc/rc.d/postrandom Thu Oct 30 17:58:57 2014 (r273871) +++ head/etc/rc.d/postrandom Thu Oct 30 21:21:53 2014 (r273872) @@ -4,7 +4,7 @@ # # PROVIDE: postrandom -# REQUIRE: initrandom random FILESYSTEMS +# REQUIRE: random FILESYSTEMS # BEFORE: LOGIN # KEYWORD: nojail Modified: head/etc/rc.d/random ============================================================================== --- head/etc/rc.d/random Thu Oct 30 17:58:57 2014 (r273871) +++ head/etc/rc.d/random Thu Oct 30 21:21:53 2014 (r273872) @@ -4,7 +4,7 @@ # # PROVIDE: random -# REQUIRE: initrandom FILESYSTEMS +# REQUIRE: FILESYSTEMS # BEFORE: netif # KEYWORD: nojail shutdown Modified: head/libexec/save-entropy/save-entropy.sh ============================================================================== --- head/libexec/save-entropy/save-entropy.sh Thu Oct 30 17:58:57 2014 (r273871) +++ head/libexec/save-entropy/save-entropy.sh Thu Oct 30 21:21:53 2014 (r273872) @@ -53,7 +53,7 @@ case ${entropy_dir} in ;; esac -entropy_save_sz=${entropy_save_sz:-2048} +entropy_save_sz=${entropy_save_sz:-4096} entropy_save_num=${entropy_save_num:-8} if [ ! -d "${entropy_dir}" ]; then Modified: head/share/examples/kld/random_adaptor/random_adaptor_example.c ============================================================================== --- head/share/examples/kld/random_adaptor/random_adaptor_example.c Thu Oct 30 17:58:57 2014 (r273871) +++ head/share/examples/kld/random_adaptor/random_adaptor_example.c Thu Oct 30 21:21:53 2014 (r273872) @@ -35,17 +35,20 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include +#include +#include +#include -static int random_example_read(void *, int); - -struct random_adaptor random_example = { - .ident = "Example RNG", - .source = RANDOM_PURE_BOGUS, /* Make sure this is in - * sys/random.h and is unique */ - .read = random_example_read, +static void live_random_example_init(void); +static void live_random_example_deinit(void); +static u_int live_random_example_read(void *, u_int); + +struct random_adaptor live_random_example = { + .les_ident = "Example RNG", + .les_source = RANDOM_PURE_BOGUS, /* Make sure this is in + * sys/random.h and is unique */ + .les_read = live_random_example_read, }; /* @@ -58,8 +61,26 @@ getRandomNumber(void) return 4; /* chosen by fair dice roll, guaranteed to be random */ } -static int -random_example_read(void *buf, int c) +static void +live_random_example_init(void) +{ + + /* Do initialisation stuff here */ +} + +static void +live_random_example_deinit(void) +{ + + /* Do de-initialisation stuff here */ +} + +/* get bytes of random stuff into . You may presume + * that is a multiple of 2^n, with n>=3. A typical value + * is c=16. + */ +static u_int +live_random_example_read(void *buf, u_int c) { uint8_t *b; int count; @@ -69,22 +90,23 @@ random_example_read(void *buf, int c) for (count = 0; count < c; count++) b[count] = getRandomNumber(); - printf("returning %d bytes of pure randomness\n", c); + /* printf("returning %d bytes of pure randomness\n", c); */ return (c); } +/* ARGSUSED */ static int -random_example_modevent(module_t mod, int type, void *unused) +live_random_example_modevent(module_t mod __unused, int type, void *unused __unused) { int error = 0; switch (type) { case MOD_LOAD: - live_entropy_source_register(&random_example); + live_entropy_source_register(&live_random_example); break; case MOD_UNLOAD: - live_entropy_source_deregister(&random_example); + live_entropy_source_deregister(&live_random_example); break; case MOD_SHUTDOWN: @@ -98,4 +120,6 @@ random_example_modevent(module_t mod, in return (error); } -LIVE_ENTROPY_SRC_MODULE(live_entropy_source_example, random_example_modevent, 1); +DEV_MODULE(live_random_example, live_random_example_modevent, NULL); +MODULE_VERSION(live_random_example, 1); +MODULE_DEPEND(live_random_example, randomdev, 1, 1, 1); Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Oct 30 17:58:57 2014 (r273871) +++ head/sys/conf/NOTES Thu Oct 30 21:21:53 2014 (r273872) @@ -2993,10 +2993,10 @@ options BROOKTREE_ALLOC_PAGES=(217*4+1) options MAXFILES=999 # Random number generator -options RANDOM_YARROW # Yarrow RNG -##options RANDOM_FORTUNA # Fortuna RNG - not yet implemented +# Only ONE of the below two may be used; they are mutually exclusive. +options RANDOM_YARROW # Yarrow CSPRNG (Default) +#options RANDOM_FORTUNA # Fortuna CSPRNG options RANDOM_DEBUG # Debugging messages -options RANDOM_RWFILE # Read and write entropy cache # Module to enable execution of application via emulators like QEMU options IMAGACT_BINMISC Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Oct 30 17:58:57 2014 (r273871) +++ head/sys/conf/files Thu Oct 30 21:21:53 2014 (r273872) @@ -2132,16 +2132,15 @@ rt2860.fw optional rt2860fw | ralfw \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "rt2860.fw" -dev/random/harvest.c standard -dev/random/dummy_rng.c standard +dev/random/randomdev.c standard dev/random/random_adaptors.c standard -dev/random/live_entropy_sources.c optional random -dev/random/random_harvestq.c optional random -dev/random/randomdev.c optional random +dev/random/dummy_rng.c standard +dev/random/live_entropy_sources.c standard +dev/random/random_harvestq.c standard dev/random/randomdev_soft.c optional random dev/random/yarrow.c optional random +dev/random/fortuna.c optional random dev/random/hash.c optional random -dev/random/rwfile.c optional random dev/rc/rc.c optional rc dev/re/if_re.c optional re dev/rl/if_rl.c optional rl pci Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Oct 30 17:58:57 2014 (r273871) +++ head/sys/conf/options Thu Oct 30 21:21:53 2014 (r273872) @@ -930,4 +930,3 @@ RCTL opt_global.h RANDOM_YARROW opt_random.h RANDOM_FORTUNA opt_random.h RANDOM_DEBUG opt_random.h -RANDOM_RWFILE opt_random.h Modified: head/sys/dev/glxsb/glxsb.c ============================================================================== --- head/sys/dev/glxsb/glxsb.c Thu Oct 30 17:58:57 2014 (r273871) +++ head/sys/dev/glxsb/glxsb.c Thu Oct 30 21:21:53 2014 (r273872) @@ -476,7 +476,7 @@ glxsb_rnd(void *v) if (status & SB_RNS_TRNG_VALID) { value = bus_read_4(sc->sc_sr, SB_RANDOM_NUM); /* feed with one uint32 */ - random_harvest(&value, 4, 32/2, RANDOM_PURE_GLXSB); + random_harvest(&value, sizeof(value), 32/2, RANDOM_PURE_GLXSB); } callout_reset(&sc->sc_rngco, sc->sc_rnghz, glxsb_rnd, sc); Added: head/sys/dev/random/build.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/random/build.sh Thu Oct 30 21:21:53 2014 (r273872) @@ -0,0 +1,24 @@ +# $FreeBSD$ +# +# Basic script to build crude unit tests. +# +cc -g -O0 -pthread -DRANDOM_DEBUG -DRANDOM_YARROW \ + -I../.. -lstdthreads -Wall \ + unit_test.c \ + yarrow.c \ + hash.c \ + ../../crypto/rijndael/rijndael-api-fst.c \ + ../../crypto/rijndael/rijndael-alg-fst.c \ + ../../crypto/sha2/sha2.c \ + ../../crypto/sha2/sha256c.c \ + -o yunit_test +cc -g -O0 -pthread -DRANDOM_DEBUG -DRANDOM_FORTUNA \ + -I../.. -lstdthreads -Wall \ + unit_test.c \ + fortuna.c \ + hash.c \ + ../../crypto/rijndael/rijndael-api-fst.c \ + ../../crypto/rijndael/rijndael-alg-fst.c \ + ../../crypto/sha2/sha2.c \ + ../../crypto/sha2/sha256c.c \ + -o funit_test Modified: head/sys/dev/random/dummy_rng.c ============================================================================== --- head/sys/dev/random/dummy_rng.c Thu Oct 30 17:58:57 2014 (r273871) +++ head/sys/dev/random/dummy_rng.c Thu Oct 30 21:21:53 2014 (r273872) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2013 Arthur Mesh + * Copyright (c) 2013 Mark R V Murray * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,98 +28,92 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_random.h" + #include +#include #include #include +#include #include -#include #include -#include +#include #include -#include -#include #include - -static struct mtx dummy_random_mtx; - -/* Used to fake out unused random calls in random_adaptor */ -static void -random_null_func(void) -{ -} +#include static int -dummy_random_poll(int events __unused, struct thread *td __unused) +dummy_random_zero(void) { return (0); } -static int -dummy_random_block(int flag) +static void +dummy_random(void) { - int error = 0; - - mtx_lock(&dummy_random_mtx); - - /* Blocking logic */ - while (!error) { - if (flag & O_NONBLOCK) - error = EWOULDBLOCK; - else { - printf("random: dummy device blocking on read.\n"); - error = msleep(&dummy_random_block, - &dummy_random_mtx, - PUSER | PCATCH, "block", 0); - } - } - mtx_unlock(&dummy_random_mtx); - - return (error); } +/* ARGSUSED */ static void dummy_random_init(void) { - mtx_init(&dummy_random_mtx, "sleep mtx for dummy_random", - NULL, MTX_DEF); -} - -static void -dummy_random_deinit(void) -{ +#ifdef RANDOM_DEBUG + printf("random: %s\n", __func__); +#endif - mtx_destroy(&dummy_random_mtx); + randomdev_init_reader(dummy_random_read_phony); } -struct random_adaptor dummy_random = { - .ident = "Dummy entropy device that always blocks", - .init = dummy_random_init, - .deinit = dummy_random_deinit, - .block = dummy_random_block, - .poll = dummy_random_poll, - .read = (random_read_func_t *)random_null_func, - .reseed = (random_reseed_func_t *)random_null_func, - .seeded = 0, /* This device can never be seeded */ - .priority = 1, /* Bottom priority, so goes to last position */ -}; - -static int -dummy_random_modevent(module_t mod __unused, int type, void *unused __unused) +/* This is used only by the internal read_random(9) call, and then only + * if no entropy processor is loaded. + * + * Make a token effort to provide _some_ kind of output. No warranty of + * the quality of this output is made, mainly because its lousy. + * + * This is only used by the internal read_random(9) call when no other + * adaptor is active. + * + * It has external scope due to the way things work in + * randomdev_[de]init_reader() that the rest of the world doesn't need to + * know about. + * + * Caveat Emptor. + */ +u_int +dummy_random_read_phony(uint8_t *buf, u_int count) { + /* If no entropy device is loaded, don't spam the console with warnings */ + static int warned = 0; + u_long randval; + size_t size, i; + + if (!warned) { + log(LOG_WARNING, "random device not loaded/active; using insecure pseudo-random number generator\n"); + warned = 1; + } - switch (type) { - case MOD_LOAD: - random_adaptor_register("dummy", &dummy_random); - EVENTHANDLER_INVOKE(random_adaptor_attach, - &dummy_random); + /* srandom() is called in kern/init_main.c:proc0_post() */ - return (0); + /* Fill buf[] with random(9) output */ + for (i = 0; i < count; i += sizeof(randval)) { + randval = random(); + size = MIN(count - i, sizeof(randval)); + memcpy(buf + i, &randval, (size_t)size); } - return (EINVAL); + return (count); } -RANDOM_ADAPTOR_MODULE(dummy, dummy_random_modevent, 1); +struct random_adaptor randomdev_dummy = { + .ra_ident = "Dummy", + .ra_priority = 1, /* Bottom priority, so goes to last position */ + .ra_reseed = dummy_random, + .ra_seeded = (random_adaptor_seeded_func_t *)dummy_random_zero, + .ra_read = (random_adaptor_read_func_t *)dummy_random_zero, + .ra_write = (random_adaptor_write_func_t *)dummy_random_zero, + .ra_init = dummy_random_init, + .ra_deinit = dummy_random, +}; Added: head/sys/dev/random/fortuna.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/random/fortuna.c Thu Oct 30 21:21:53 2014 (r273872) @@ -0,0 +1,433 @@ +/*- + * Copyright (c) 2013-2014 Mark R V Murray + * 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 + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#ifdef _KERNEL +#include "opt_random.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#else /* !_KERNEL */ +#include +#include +#include +#include +#include +#include +#include + +#include "unit_test.h" + +#include +#include + +#include +#include +#include +#endif /* _KERNEL */ + +#if !defined(RANDOM_YARROW) && !defined(RANDOM_FORTUNA) +#define RANDOM_YARROW +#elif defined(RANDOM_YARROW) && defined(RANDOM_FORTUNA) +#error "Must define either RANDOM_YARROW or RANDOM_FORTUNA" +#endif + +#if defined(RANDOM_FORTUNA) + +#define NPOOLS 32 +#define MINPOOLSIZE 64 +#define DEFPOOLSIZE 256 +#define MAXPOOLSIZE 65536 + +/* This algorithm (and code) presumes that KEYSIZE is twice as large as BLOCKSIZE */ +CTASSERT(BLOCKSIZE == sizeof(uint128_t)); +CTASSERT(KEYSIZE == 2*BLOCKSIZE); + +/* This is the beastie that needs protecting. It contains all of the + * state that we are excited about. + * Exactly one is instantiated. + */ +static struct fortuna_state { + /* P_i */ + struct pool { + u_int length; + struct randomdev_hash hash; + } pool[NPOOLS]; + + /* ReseedCnt */ + u_int reseedcount; + + /* C - 128 bits */ + union { + uint8_t byte[BLOCKSIZE]; + uint128_t whole; + } counter; + + /* K */ + struct randomdev_key key; + + /* Extras */ + u_int minpoolsize; + + /* Extras for the OS */ + +#ifdef _KERNEL + /* For use when 'pacing' the reseeds */ + sbintime_t lasttime; +#endif +} fortuna_state; + +/* The random_reseed_mtx mutex protects seeding and polling/blocking. */ +static mtx_t random_reseed_mtx; + +static struct fortuna_start_cache { + uint8_t junk[PAGE_SIZE]; + size_t length; + struct randomdev_hash hash; +} fortuna_start_cache; + +#ifdef _KERNEL +static struct sysctl_ctx_list random_clist; +RANDOM_CHECK_UINT(minpoolsize, MINPOOLSIZE, MAXPOOLSIZE); +#endif + +void +random_fortuna_init_alg(void) +{ + int i; +#ifdef _KERNEL + struct sysctl_oid *random_fortuna_o; +#endif + + memset(fortuna_start_cache.junk, 0, sizeof(fortuna_start_cache.junk)); + fortuna_start_cache.length = 0U; + randomdev_hash_init(&fortuna_start_cache.hash); + + /* Set up a lock for the reseed process */ +#ifdef _KERNEL + mtx_init(&random_reseed_mtx, "reseed mutex", NULL, MTX_DEF); +#else /* !_KERNEL */ + mtx_init(&random_reseed_mtx, mtx_plain); +#endif /* _KERNEL */ + +#ifdef _KERNEL + /* Fortuna parameters. Do not adjust these unless you have + * have a very good clue about what they do! + */ + random_fortuna_o = SYSCTL_ADD_NODE(&random_clist, + SYSCTL_STATIC_CHILDREN(_kern_random), + OID_AUTO, "fortuna", CTLFLAG_RW, 0, + "Fortuna Parameters"); + + SYSCTL_ADD_PROC(&random_clist, + SYSCTL_CHILDREN(random_fortuna_o), OID_AUTO, + "minpoolsize", CTLTYPE_UINT|CTLFLAG_RW, + &fortuna_state.minpoolsize, DEFPOOLSIZE, + random_check_uint_minpoolsize, "IU", + "Minimum pool size necessary to cause a reseed automatically"); + + fortuna_state.lasttime = 0U; +#endif + + fortuna_state.minpoolsize = DEFPOOLSIZE; + + /* F&S - InitializePRNG() */ + + /* F&S - P_i = \epsilon */ + for (i = 0; i < NPOOLS; i++) { + randomdev_hash_init(&fortuna_state.pool[i].hash); + fortuna_state.pool[i].length = 0U; + } + + /* F&S - ReseedCNT = 0 */ + fortuna_state.reseedcount = 0U; + + /* F&S - InitializeGenerator() */ + + /* F&S - C = 0 */ + uint128_clear(&fortuna_state.counter.whole); + + /* F&S - K = 0 */ + memset(&fortuna_state.key, 0, sizeof(fortuna_state.key)); +} + +void +random_fortuna_deinit_alg(void) +{ + + mtx_destroy(&random_reseed_mtx); + memset(&fortuna_state, 0, sizeof(fortuna_state)); +} + +/* F&S - AddRandomEvent() */ +/* Process a single stochastic event off the harvest queue */ +void +random_fortuna_process_event(struct harvest_event *event) +{ + u_int pl; + + /* We must be locked for all this as plenty of state gets messed with */ + mtx_lock(&random_reseed_mtx); + + /* Accumulate the event into the appropriate pool + * where each event carries the destination information + */ + /* F&S - P_i = P_i| */ + /* The hash_init and hash_finish are done in random_fortuna_read() below */ + pl = event->he_destination % NPOOLS; + randomdev_hash_iterate(&fortuna_state.pool[pl].hash, event, sizeof(*event)); + /* No point in counting above the outside maximum */ + fortuna_state.pool[pl].length += event->he_size; + fortuna_state.pool[pl].length = MIN(fortuna_state.pool[pl].length, MAXPOOLSIZE); + + /* Done with state-messing */ + mtx_unlock(&random_reseed_mtx); +} + +/* F&S - Reseed() */ +/* Reseed Mutex is held */ +static void +reseed(uint8_t *junk, u_int length) +{ + struct randomdev_hash context; + uint8_t hash[KEYSIZE], temp[KEYSIZE]; + + KASSERT(fortuna_state.minpoolsize > 0, ("random: Fortuna threshold = 0")); +#ifdef _KERNEL + mtx_assert(&random_reseed_mtx, MA_OWNED); +#endif + + /* F&S - temp = H(K|s) */ + randomdev_hash_init(&context); + randomdev_hash_iterate(&context, &fortuna_state.key, sizeof(fortuna_state.key)); + randomdev_hash_iterate(&context, junk, length); + randomdev_hash_finish(&context, temp); + + /* F&S - hash = H(temp) */ + randomdev_hash_init(&context); + randomdev_hash_iterate(&context, temp, KEYSIZE); + randomdev_hash_finish(&context, hash); + + /* F&S - K = hash */ + randomdev_encrypt_init(&fortuna_state.key, temp); + memset(temp, 0, sizeof(temp)); + memset(hash, 0, sizeof(hash)); + + /* Unblock the device if it was blocked due to being unseeded */ + if (uint128_is_zero(fortuna_state.counter.whole)) + random_adaptor_unblock(); + /* F&S - C = C + 1 */ + uint128_increment(&fortuna_state.counter.whole); +} + +/* F&S - GenerateBlocks() */ +/* Reseed Mutex is held, and buf points to a whole number of blocks. */ +static __inline void +random_fortuna_genblocks(uint8_t *buf, u_int blockcount) +{ + u_int i; + + for (i = 0u; i < blockcount; i++) { + /* F&S - r = r|E(K,C) */ + randomdev_encrypt(&fortuna_state.key, fortuna_state.counter.byte, buf, BLOCKSIZE); + buf += BLOCKSIZE; + + /* F&S - C = C + 1 */ + uint128_increment(&fortuna_state.counter.whole); + } +} + +/* F&S - PseudoRandomData() */ +/* Reseed Mutex is held, and buf points to a whole number of blocks. */ +static __inline void +random_fortuna_genrandom(uint8_t *buf, u_int bytecount) +{ + static uint8_t temp[BLOCKSIZE*(KEYSIZE/BLOCKSIZE)]; + u_int blockcount; + + /* F&S - assert(n < 2^20) */ + KASSERT((bytecount <= (1 << 20)), ("invalid single read request to fortuna of %d bytes", bytecount)); + + /* F&S - r = first-n-bytes(GenerateBlocks(ceil(n/16))) */ + blockcount = (bytecount + BLOCKSIZE - 1)/BLOCKSIZE; + random_fortuna_genblocks(buf, blockcount); + + /* F&S - K = GenerateBlocks(2) */ + random_fortuna_genblocks(temp, KEYSIZE/BLOCKSIZE); + randomdev_encrypt_init(&fortuna_state.key, temp); + memset(temp, 0, sizeof(temp)); +} + +/* F&S - RandomData() */ +/* Used to return processed entropy from the PRNG */ +/* The argument buf points to a whole number of blocks. */ +void +random_fortuna_read(uint8_t *buf, u_int bytecount) +{ +#ifdef _KERNEL + sbintime_t thistime; +#endif + struct randomdev_hash context; + uint8_t s[NPOOLS*KEYSIZE], temp[KEYSIZE]; + int i; + u_int seedlength; + + /* We must be locked for all this as plenty of state gets messed with */ + mtx_lock(&random_reseed_mtx); + + /* if buf == NULL and bytecount == 0 then this is the pre-read. */ + /* if buf == NULL and bytecount != 0 then this is the post-read; ignore. */ + if (buf == NULL) { + if (bytecount == 0) { + if (fortuna_state.pool[0].length >= fortuna_state.minpoolsize +#ifdef _KERNEL + /* F&S - Use 'getsbinuptime()' to prevent reseed-spamming. */ + && ((thistime = getsbinuptime()) - fortuna_state.lasttime > hz/10) +#endif + ) { +#ifdef _KERNEL + fortuna_state.lasttime = thistime; +#endif + + seedlength = 0U; + /* F&S - ReseedCNT = ReseedCNT + 1 */ + fortuna_state.reseedcount++; + /* s = \epsilon by default */ + for (i = 0; i < NPOOLS; i++) { + /* F&S - if Divides(ReseedCnt, 2^i) ... */ + if ((fortuna_state.reseedcount % (1 << i)) == 0U) { + seedlength += KEYSIZE; + /* F&S - temp = (P_i) */ + randomdev_hash_finish(&fortuna_state.pool[i].hash, temp); + /* F&S - P_i = \epsilon */ + randomdev_hash_init(&fortuna_state.pool[i].hash); + fortuna_state.pool[i].length = 0U; + /* F&S - s = s|H(temp) */ + randomdev_hash_init(&context); + randomdev_hash_iterate(&context, temp, KEYSIZE); + randomdev_hash_finish(&context, s + i*KEYSIZE); + } + else + break; + } +#ifdef RANDOM_DEBUG + printf("random: active reseed: reseedcount [%d] ", fortuna_state.reseedcount); + for (i = 0; i < NPOOLS; i++) + printf(" %d", fortuna_state.pool[i].length); + printf("\n"); +#endif + /* F&S */ + reseed(s, seedlength); + + /* Clean up */ + memset(s, 0, seedlength); + seedlength = 0U; + memset(temp, 0, sizeof(temp)); + memset(&context, 0, sizeof(context)); + } + } + } + /* if buf != NULL do a regular read. */ + else + random_fortuna_genrandom(buf, bytecount); + + mtx_unlock(&random_reseed_mtx); +} + +/* Internal function to hand external entropy to the PRNG */ +void +random_fortuna_write(uint8_t *buf, u_int count) +{ + uint8_t temp[KEYSIZE]; + int i; + uintmax_t timestamp; + + timestamp = get_cyclecount(); + randomdev_hash_iterate(&fortuna_start_cache.hash, ×tamp, sizeof(timestamp)); + randomdev_hash_iterate(&fortuna_start_cache.hash, buf, count); + timestamp = get_cyclecount(); + randomdev_hash_iterate(&fortuna_start_cache.hash, ×tamp, sizeof(timestamp)); + randomdev_hash_finish(&fortuna_start_cache.hash, temp); + for (i = 0; i < KEYSIZE; i++) + fortuna_start_cache.junk[(fortuna_start_cache.length + i)%PAGE_SIZE] ^= temp[i]; + fortuna_start_cache.length += KEYSIZE; + +#ifdef RANDOM_DEBUG + printf("random: %s - ", __func__); + for (i = 0; i < KEYSIZE; i++) + printf("%02X", temp[i]); + printf("\n"); +#endif + + memset(temp, 0, KEYSIZE); + + /* We must be locked for all this as plenty of state gets messed with */ + mtx_lock(&random_reseed_mtx); + + randomdev_hash_init(&fortuna_start_cache.hash); + + reseed(fortuna_start_cache.junk, MIN(PAGE_SIZE, fortuna_start_cache.length)); + memset(fortuna_start_cache.junk, 0, sizeof(fortuna_start_cache.junk)); + + mtx_unlock(&random_reseed_mtx); +} + +void +random_fortuna_reseed(void) +{ + + /* CWOT */ +} + +int +random_fortuna_seeded(void) +{ + + return (!uint128_is_zero(fortuna_state.counter.whole)); +} + +#endif /* RANDOM_FORTUNA */ Added: head/sys/dev/random/fortuna.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/random/fortuna.h Thu Oct 30 21:21:53 2014 (r273872) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2013 Mark R V Murray + * 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 + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef SYS_DEV_RANDOM_FORTUNA_H_INCLUDED +#define SYS_DEV_RANDOM_FORTUNA_H_INCLUDED + +#ifdef _KERNEL +typedef struct mtx mtx_t; +#endif + +void random_fortuna_init_alg(void); +void random_fortuna_deinit_alg(void); +void random_fortuna_read(uint8_t *, u_int); +void random_fortuna_write(uint8_t *, u_int); +void random_fortuna_reseed(void); +int random_fortuna_seeded(void); +void random_fortuna_process_event(struct harvest_event *event); + +#endif Modified: head/sys/dev/random/hash.c ============================================================================== --- head/sys/dev/random/hash.c Thu Oct 30 17:58:57 2014 (r273871) +++ head/sys/dev/random/hash.c Thu Oct 30 21:21:53 2014 (r273872) @@ -28,18 +28,33 @@ #include __FBSDID("$FreeBSD$"); +#ifdef _KERNEL #include #include +#else /* !_KERNEL */ +#include +#include +#include +#include +#include +#include +#include +#include "unit_test.h" +#endif /* _KERNEL */ #include #include #include +/* This code presumes that KEYSIZE is twice as large as BLOCKSIZE */ +CTASSERT(KEYSIZE == 2*BLOCKSIZE); + /* Initialise the hash */ void randomdev_hash_init(struct randomdev_hash *context) { + SHA256_Init(&context->sha); } @@ -47,6 +62,7 @@ randomdev_hash_init(struct randomdev_has void randomdev_hash_iterate(struct randomdev_hash *context, void *data, size_t size) { + SHA256_Update(&context->sha, data, size); } @@ -56,6 +72,7 @@ randomdev_hash_iterate(struct randomdev_ void randomdev_hash_finish(struct randomdev_hash *context, void *buf) { + SHA256_Final(buf, &context->sha); } @@ -66,6 +83,7 @@ randomdev_hash_finish(struct randomdev_h void randomdev_encrypt_init(struct randomdev_key *context, void *data) { + rijndael_cipherInit(&context->cipher, MODE_CBC, NULL); rijndael_makeKey(&context->key, DIR_ENCRYPT, KEYSIZE*8, data); } @@ -75,7 +93,8 @@ randomdev_encrypt_init(struct randomdev_ * a multiple of BLOCKSIZE. */ void -randomdev_encrypt(struct randomdev_key *context, void *d_in, void *d_out, unsigned length) +randomdev_encrypt(struct randomdev_key *context, void *d_in, void *d_out, u_int length) { + rijndael_blockEncrypt(&context->cipher, &context->key, d_in, length*8, d_out); } Modified: head/sys/dev/random/hash.h ============================================================================== --- head/sys/dev/random/hash.h Thu Oct 30 17:58:57 2014 (r273871) +++ head/sys/dev/random/hash.h Thu Oct 30 21:21:53 2014 (r273872) @@ -45,6 +45,6 @@ void randomdev_hash_init(struct randomde void randomdev_hash_iterate(struct randomdev_hash *, void *, size_t); void randomdev_hash_finish(struct randomdev_hash *, void *); void randomdev_encrypt_init(struct randomdev_key *, void *); -void randomdev_encrypt(struct randomdev_key *context, void *, void *, unsigned); +void randomdev_encrypt(struct randomdev_key *context, void *, void *, u_int); #endif Modified: head/sys/dev/random/ivy.c ============================================================================== --- head/sys/dev/random/ivy.c Thu Oct 30 17:58:57 2014 (r273871) +++ head/sys/dev/random/ivy.c Thu Oct 30 21:21:53 2014 (r273872) @@ -35,11 +35,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include -#include #include #include @@ -47,18 +47,17 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include +#include #define RETRY_COUNT 10 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 22:02:19 2014 Return-Path: Delivered-To: svn-src-all@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 F0385CB1; Thu, 30 Oct 2014 22:02:18 +0000 (UTC) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B60C79BC; Thu, 30 Oct 2014 22:02:18 +0000 (UTC) Received: by mail-pa0-f50.google.com with SMTP id eu11so6383674pac.9 for ; Thu, 30 Oct 2014 15:02:18 -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=I992PKFa96mO5HMzoKUsBjaT9V7mxMgiALHm7pYDNR4=; b=e22QAKsd2OSVnmdtAqQWfWhhxiVwqdCBaudTIOSDPSzG0P9s+NPLT9JJNElYINR66O MmZJ9P7U9jOLP6xOBnpYM0bC1TV4nvjLBfmQZ+/3S9mpNhNnaOtCOumsUe1bHQqvNRGt da2aOyT/cRoLf7eSdQQg2E0sxIemaEUKWqx38ndaSzSXn44rMOWottS2DwWThyabe3g8 YKOcvOl0zISunskYOuFZfrEh4pL2jRTwIwHnWldpyUFVQAtqTaHhBariciEkkJeFP/BZ h2uMGHBrcvAyG5vgg/PO3XHJuAuUNV4bOP3D6vk+T0oHgunq+SM/O8rmhM/0NApRPnL4 NV5Q== MIME-Version: 1.0 X-Received: by 10.70.133.72 with SMTP id pa8mr19979523pdb.59.1414706538240; Thu, 30 Oct 2014 15:02:18 -0700 (PDT) Received: by 10.70.9.132 with HTTP; Thu, 30 Oct 2014 15:02:18 -0700 (PDT) In-Reply-To: <201410261942.s9QJgjch081623@svn.freebsd.org> References: <201410261942.s9QJgjch081623@svn.freebsd.org> Date: Thu, 30 Oct 2014 18:02:18 -0400 Message-ID: Subject: Re: svn commit: r273707 - in head/sys: compat/freebsd32 kern kgssapi netinet nfs nlm sys From: Benjamin Kaduk To: Mateusz Guzik 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 22:02:19 -0000 On Sun, Oct 26, 2014 at 3:42 PM, Mateusz Guzik wrote: > Author: mjg > Date: Sun Oct 26 19:42:44 2014 > New Revision: 273707 > URL: https://svnweb.freebsd.org/changeset/base/273707 > > Log: > Avoid dynamic syscall overhead for statically compiled modules. > > --- head/sys/sys/sysent.h Sun Oct 26 19:03:06 2014 (r273706) > +++ head/sys/sys/sysent.h Sun Oct 26 19:42:44 2014 (r273707) > @@ -242,10 +248,10 @@ struct syscall_helper_data { > } > > int syscall_register(int *offset, struct sysent *new_sysent, > - struct sysent *old_sysent); > + struct sysent *old_sysent, int flags); > Should __FreeBSD_version have been bumped for the KPI change? I am getting pkg-fallout mail that net/openafs fails to build, now. -Ben From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 22:07:30 2014 Return-Path: Delivered-To: svn-src-all@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 88873F33; Thu, 30 Oct 2014 22:07: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 748919F4; Thu, 30 Oct 2014 22:07: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 s9UM7Uw8075120; Thu, 30 Oct 2014 22:07:30 GMT (envelope-from jmmv@FreeBSD.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UM7UUD075119; Thu, 30 Oct 2014 22:07:30 GMT (envelope-from jmmv@FreeBSD.org) Message-Id: <201410302207.s9UM7UUD075119@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmmv set sender to jmmv@FreeBSD.org using -f From: Julio Merino Date: Thu, 30 Oct 2014 22:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273873 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 22:07:30 -0000 Author: jmmv Date: Thu Oct 30 22:07:29 2014 New Revision: 273873 URL: https://svnweb.freebsd.org/changeset/base/273873 Log: Use the right depend file for each program. bsd.progs.mk generates a separate depend file for every program being built, but then it does not properly tell each submake to use those individual files. Properly propagate the depend file to use. Discovered while preparing the update of atf to 0.21 and noticing that the test programs were not being relinked to the new library. This change is "make tinderbox" clean. Modified: head/share/mk/bsd.progs.mk Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Thu Oct 30 21:21:53 2014 (r273872) +++ head/share/mk/bsd.progs.mk Thu Oct 30 22:07:29 2014 (r273873) @@ -90,12 +90,16 @@ x.$p= PROG_CXX=$p $p ${p}_p: .PHONY .MAKE (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \ - SUBDIR= PROG=$p ${x.$p}) + SUBDIR= PROG=$p \ + DEPENDFILE=.depend.$p .MAKE.DEPENDFILE=.depend.$p \ + ${x.$p}) .for t in ${PROGS_TARGETS:O:u} $p.$t: .PHONY .MAKE (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \ - SUBDIR= PROG=$p ${x.$p} ${@:E}) + SUBDIR= PROG=$p \ + DEPENDFILE=.depend.$p .MAKE.DEPENDFILE=.depend.$p \ + ${x.$p} ${@:E}) .endfor .endfor From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 22:18:50 2014 Return-Path: Delivered-To: svn-src-all@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 074152CB; Thu, 30 Oct 2014 22:18:50 +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 D9F19AD4; Thu, 30 Oct 2014 22:18:49 +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.14.9/8.14.9) with ESMTP id s9UMIenU021663 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 30 Oct 2014 15:18:41 -0700 Message-ID: <5452B940.1090609@freebsd.org> Date: Thu, 30 Oct 2014 15:18:40 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Doug Ambrisko , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r273865 - in head: sbin/fsck_msdosfs sys/boot/amd64/boot1.efi References: <201410301552.s9UFq1WV098951@svn.freebsd.org> In-Reply-To: <201410301552.s9UFq1WV098951@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVZnTPuQG0D/ijmDfOCi8A8ruBFO5wSSymW02lkfHCSoiH01fLNO9+CQOOcSzf8NKC2uVKXYVPtkXIIWrujFzh6n1XntWfA3xXk= X-Sonic-ID: C;4j6Us4Jg5BG90IkFBSAIFQ== M;HK4ItIJg5BG90IkFBSAIFQ== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 22:18:50 -0000 You may want to change the generation of boot1.efifat to have a 4096 byte sector size. We also need to find out if all EFI BIOSes can deal with 4096-byte FAT filesystems on 512-byte disks. -Nathan On 10/30/14 08:52, Doug Ambrisko wrote: > Author: ambrisko > Date: Thu Oct 30 15:52:01 2014 > New Revision: 273865 > URL: https://svnweb.freebsd.org/changeset/base/273865 > > Log: > Make UEFI booting of 4Kn disks work: > - convert boot1.efi to corrrectly calculate the lba for what the > media reports and convert the size based on what FreeBSD uses. > The existing code would use the 512 byte lba and convert the > size using 4K byte size. > - make fsck_msdosfs read the boot block as 4K so the read doesn't > fail on a 4Kn drive since FreeBSD will error out parition reads > of a block. Make the bpbBytesPerSec check a multiple of 512 since > it can be 512 or 4K depending on the disk. This allows fsck to > pass checking the EFI partition on a 4Kn disk. > > To create the EFI file system I used: > newfs_msdos -F 32 -S 4096 -c 1 -m 0xf8 > This works for booting 512 and 4Kn disks. > > Caveat is that loader.efi cannot read the 4Kn EFI partition. This isn't > critical right now since boot1.efi will read loader.efi from the ufs > partition. It looks like loader.efi can be fixed via making some of the > 512 bytes reads more flexible. loader.efi doesn't have trouble reading > the ufs partition. This is probably a simple fix. > > I now have FreeBSD installed on a system with 4Kn drives and tested the > same code works on 512. > > MFC after: 1 week > > Modified: > head/sbin/fsck_msdosfs/boot.c > head/sbin/fsck_msdosfs/dosfs.h > head/sys/boot/amd64/boot1.efi/boot1.c > > Modified: head/sbin/fsck_msdosfs/boot.c > ============================================================================== > --- head/sbin/fsck_msdosfs/boot.c Thu Oct 30 15:41:25 2014 (r273864) > +++ head/sbin/fsck_msdosfs/boot.c Thu Oct 30 15:52:01 2014 (r273865) > @@ -181,7 +181,7 @@ readboot(int dosfs, struct bootblock *bo > boot->bpbResSectors + boot->bpbFATs * boot->FATsecs - > CLUST_FIRST * boot->bpbSecPerClust; > > - if (boot->bpbBytesPerSec % DOSBOOTBLOCKSIZE != 0) { > + if (boot->bpbBytesPerSec % DOSBOOTBLOCKSIZE_REAL != 0) { > pfatal("Invalid sector size: %u", boot->bpbBytesPerSec); > return FSFATAL; > } > > Modified: head/sbin/fsck_msdosfs/dosfs.h > ============================================================================== > --- head/sbin/fsck_msdosfs/dosfs.h Thu Oct 30 15:41:25 2014 (r273864) > +++ head/sbin/fsck_msdosfs/dosfs.h Thu Oct 30 15:52:01 2014 (r273865) > @@ -30,7 +30,9 @@ > #ifndef DOSFS_H > #define DOSFS_H > > -#define DOSBOOTBLOCKSIZE 512 > +/* support 4Kn disk reads */ > +#define DOSBOOTBLOCKSIZE_REAL 512 > +#define DOSBOOTBLOCKSIZE 4096 > > typedef u_int32_t cl_t; /* type holding a cluster number */ > > > Modified: head/sys/boot/amd64/boot1.efi/boot1.c > ============================================================================== > --- head/sys/boot/amd64/boot1.efi/boot1.c Thu Oct 30 15:41:25 2014 (r273864) > +++ head/sys/boot/amd64/boot1.efi/boot1.c Thu Oct 30 15:52:01 2014 (r273865) > @@ -168,9 +168,12 @@ static int > dskread(void *buf, u_int64_t lba, int nblk) > { > EFI_STATUS status; > + int size; > > + lba = lba / (bootdev->Media->BlockSize / DEV_BSIZE); > + size = nblk * DEV_BSIZE; > status = bootdev->ReadBlocks(bootdev, bootdev->Media->MediaId, lba, > - nblk * bootdev->Media->BlockSize, buf); > + size, buf); > > if (EFI_ERROR(status)) > return (-1); > From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 22:21:13 2014 Return-Path: Delivered-To: svn-src-all@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 6A127440; Thu, 30 Oct 2014 22:21: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 56272B79; Thu, 30 Oct 2014 22:21: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 s9UMLDPm081030; Thu, 30 Oct 2014 22:21:13 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UMLDsu081029; Thu, 30 Oct 2014 22:21:13 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201410302221.s9UMLDsu081029@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 30 Oct 2014 22:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r273874 - releng/10.1/sys/conf X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 22:21:13 -0000 Author: gjb Date: Thu Oct 30 22:21:12 2014 New Revision: 273874 URL: https://svnweb.freebsd.org/changeset/base/273874 Log: Update releng/10.1 to -RC4 as part of the 10.1-RELEASE cycle. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/10.1/sys/conf/newvers.sh Modified: releng/10.1/sys/conf/newvers.sh ============================================================================== --- releng/10.1/sys/conf/newvers.sh Thu Oct 30 22:07:29 2014 (r273873) +++ releng/10.1/sys/conf/newvers.sh Thu Oct 30 22:21:12 2014 (r273874) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.1" -BRANCH="RC3" +BRANCH="RC4" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 22:29:54 2014 Return-Path: Delivered-To: svn-src-all@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 AF3F980C; Thu, 30 Oct 2014 22:29:54 +0000 (UTC) Received: from mail-ie0-x22e.google.com (mail-ie0-x22e.google.com [IPv6:2607:f8b0:4001:c03::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 75776BE9; Thu, 30 Oct 2014 22:29:54 +0000 (UTC) Received: by mail-ie0-f174.google.com with SMTP id x19so136263ier.5 for ; Thu, 30 Oct 2014 15:29:54 -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=5bHuJK/i9JkPRmigXtxGUAjHbQBPREfydF5+rn/HCWg=; b=sId72A17jaqbX6RZmqDBpeVc2THTgw6tOhOX66KEuax6ZTk3wQLxFmIMFe/6bToPXE 2QGi5hAIv2ASFZNBVfY/cTvCRbUtKsS8B4EAh7lY0GcKKEAZzKfIfwTRrMXi53aq7SWX MX+x3PxfjPYjUELgFylcfxQFbqJWMO5e9gmRc35OEek6GllCPUb2rRs2+ExOVMCnPVyf OUvZxs2zv25dldTL1BIjLrGzIQjx14zYX/FnjKuSoMxQyq/BHXAiYgxbxPjLScx0epJ+ DtHfxXn4iFBL7S8iOvRpu8Drz3Eez5ejLA2IYcj3tBolCzKgnlROPaSoiMrxd3icdCL7 7K2Q== MIME-Version: 1.0 X-Received: by 10.107.164.129 with SMTP id d1mr23680213ioj.37.1414708193915; Thu, 30 Oct 2014 15:29:53 -0700 (PDT) Received: by 10.50.193.135 with HTTP; Thu, 30 Oct 2014 15:29:53 -0700 (PDT) In-Reply-To: <5EDC9AC8-D9DE-4C78-86CB-3A64E558633B@gmail.com> References: <201410301626.s9UGQIJS014234@svn.freebsd.org> <5EDC9AC8-D9DE-4C78-86CB-3A64E558633B@gmail.com> Date: Thu, 30 Oct 2014 15:29:53 -0700 Message-ID: Subject: Re: svn commit: r273866 - head/sys/sys From: NGie Cooper To: Josh Paetzel 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 22:29:54 -0000 On Thu, Oct 30, 2014 at 9:36 AM, Garrett Cooper wrote: > >> On Oct 30, 2014, at 09:26, Josh Paetzel wrote: >> >> Author: jpaetzel >> Date: Thu Oct 30 16:26:17 2014 >> New Revision: 273866 >> URL: https://svnweb.freebsd.org/changeset/base/273866 >> >> Log: >> Plug memory ordering holes in buf_ring_enqueue. For at least some >> users this patch eliminates the races previously discussed on the >> mailing list. > > Hi Josh! > Do you have a link to the discussion thread you can provide? > Thank you! Josh sent me the link offline; just for the record it was http://lists.freebsd.org/pipermail/freebsd-net/2013-December/037267.html . From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 22:47:33 2014 Return-Path: Delivered-To: svn-src-all@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 9803CE61; Thu, 30 Oct 2014 22:47: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 84A3FDC8; Thu, 30 Oct 2014 22:47: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 s9UMlXBk095073; Thu, 30 Oct 2014 22:47:33 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UMlXIL095072; Thu, 30 Oct 2014 22:47:33 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410302247.s9UMlXIL095072@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Oct 2014 22:47:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273875 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 22:47:33 -0000 Author: mjg Date: Thu Oct 30 22:47:32 2014 New Revision: 273875 URL: https://svnweb.freebsd.org/changeset/base/273875 Log: Bump FreeBSD_version due to syscall*_register API changes in r273707 Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Oct 30 22:21:12 2014 (r273874) +++ head/sys/sys/param.h Thu Oct 30 22:47:32 2014 (r273875) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100040 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100041 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 22:50:17 2014 Return-Path: Delivered-To: svn-src-all@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 171F6101; Thu, 30 Oct 2014 22:50:17 +0000 (UTC) Received: from mail-wg0-x232.google.com (mail-wg0-x232.google.com [IPv6:2a00:1450:400c:c00::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3371EDE8; Thu, 30 Oct 2014 22:50:16 +0000 (UTC) Received: by mail-wg0-f50.google.com with SMTP id z12so5273888wgg.23 for ; Thu, 30 Oct 2014 15:50:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=WToyaNnulDXkAYef5IE0fVpdIOGOzPbXPkbuWn2zt58=; b=vEI5ty8+CN4+SIG0B20WVOZsM2Td1XSI1l33F5U8FmIb6kqW62p27Zp/4IytmzM1LI cJJRgLEANkxsC3+gy5xNgdCt6EKRtm+Lu/AYSwTVYB8moHE4p21Xys488wTrnmjjK3za 3orhSTqbZK0vJKaP/JDI9rynNaCAIrE6+xy/ufVphToVlMfvSO80zizvfgx/v+CKo3VC dkImO+0kjijOVeP734SeeFR3o24AKKmew9CXa6GU/g2y61Ha7oXWoluonL0PbUcJnCLl zMwd7uEc0sDrad2BJNG4l1eBGjyZWbtZG9Yy7tBDRCgRLNDT2rIC47VV2wZubyIwrCwH WDfQ== X-Received: by 10.180.8.233 with SMTP id u9mr23220739wia.19.1414709414377; Thu, 30 Oct 2014 15:50:14 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id 10sm10192035wjs.21.2014.10.30.15.50.13 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 30 Oct 2014 15:50:13 -0700 (PDT) Date: Thu, 30 Oct 2014 23:50:11 +0100 From: Mateusz Guzik To: Benjamin Kaduk Subject: Re: svn commit: r273707 - in head/sys: compat/freebsd32 kern kgssapi netinet nfs nlm sys Message-ID: <20141030225011.GA22357@dft-labs.eu> References: <201410261942.s9QJgjch081623@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Mateusz Guzik X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 22:50:17 -0000 On Thu, Oct 30, 2014 at 06:02:18PM -0400, Benjamin Kaduk wrote: > On Sun, Oct 26, 2014 at 3:42 PM, Mateusz Guzik wrote: > > > Author: mjg > > Date: Sun Oct 26 19:42:44 2014 > > New Revision: 273707 > > URL: https://svnweb.freebsd.org/changeset/base/273707 > > > > Log: > > Avoid dynamic syscall overhead for statically compiled modules. > > > > > > --- head/sys/sys/sysent.h Sun Oct 26 19:03:06 2014 (r273706) > > +++ head/sys/sys/sysent.h Sun Oct 26 19:42:44 2014 (r273707) > > @@ -242,10 +248,10 @@ struct syscall_helper_data { > > } > > > > int syscall_register(int *offset, struct sysent *new_sysent, > > - struct sysent *old_sysent); > > + struct sysent *old_sysent, int flags); > > > > Should __FreeBSD_version have been bumped for the KPI change? > I am getting pkg-fallout mail that net/openafs fails to build, now. > Right, bumped in https://svnweb.freebsd.org/changeset/base/273875 Thanks for reporting. -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 23:12:56 2014 Return-Path: Delivered-To: svn-src-all@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 025D75C8; Thu, 30 Oct 2014 23:12:56 +0000 (UTC) Received: from mail.ambrisko.com (mail.ambrisko.com [70.91.206.90]) by mx1.freebsd.org (Postfix) with ESMTP id B73FCB5; Thu, 30 Oct 2014 23:12:55 +0000 (UTC) X-Ambrisko-Me: Yes Received: from server2.ambrisko.com (HELO internal.ambrisko.com) ([192.168.1.2]) by ironport.ambrisko.com with ESMTP; 30 Oct 2014 16:16:32 -0700 Received: from ambrisko.com (localhost [127.0.0.1]) by internal.ambrisko.com (8.14.4/8.14.4) with ESMTP id s9UNCrpG051590; Thu, 30 Oct 2014 16:12:53 -0700 (PDT) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.14.4/8.14.4/Submit) id s9UNCrW1051589; Thu, 30 Oct 2014 16:12:53 -0700 (PDT) (envelope-from ambrisko) Date: Thu, 30 Oct 2014 16:12:53 -0700 From: Doug Ambrisko To: Nathan Whitehorn Subject: Re: svn commit: r273865 - in head: sbin/fsck_msdosfs sys/boot/amd64/boot1.efi Message-ID: <20141030231253.GA50728@ambrisko.com> References: <201410301552.s9UFq1WV098951@svn.freebsd.org> <5452B940.1090609@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5452B940.1090609@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Doug Ambrisko , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 23:12:56 -0000 On Thu, Oct 30, 2014 at 03:18:40PM -0700, Nathan Whitehorn wrote: | You may want to change the generation of boot1.efifat to have a 4096 | byte sector size. We also need to find out if all EFI BIOSes can deal | with 4096-byte FAT filesystems on 512-byte disks. Yes, there is more work in general to make this fully working. Atleast this give people a starting point. It looks like we should be able to test this with Qemu since it takes a physical sector size as an argument. Hopefully makefs can learn to do FAT32 and avoid these issues. Bruce's comments are good and I'll take a look his suggested changes. Right now I'm trying to figure out why UEFI PXE is hanging after the first file is looked up on some machines. Thanks, Doug A. | On 10/30/14 08:52, Doug Ambrisko wrote: | >Author: ambrisko | >Date: Thu Oct 30 15:52:01 2014 | >New Revision: 273865 | >URL: https://svnweb.freebsd.org/changeset/base/273865 | > | >Log: | > Make UEFI booting of 4Kn disks work: | > - convert boot1.efi to corrrectly calculate the lba for what | > the | > media reports and convert the size based on what FreeBSD uses. | > The existing code would use the 512 byte lba and convert the | > size using 4K byte size. | > - make fsck_msdosfs read the boot block as 4K so the read | > doesn't | > fail on a 4Kn drive since FreeBSD will error out parition reads | > of a block. Make the bpbBytesPerSec check a multiple of 512 since | > it can be 512 or 4K depending on the disk. This allows fsck to | > pass checking the EFI partition on a 4Kn disk. | > | > To create the EFI file system I used: | > newfs_msdos -F 32 -S 4096 -c 1 -m 0xf8 | > This works for booting 512 and 4Kn disks. | > | > Caveat is that loader.efi cannot read the 4Kn EFI partition. This isn't | > critical right now since boot1.efi will read loader.efi from the ufs | > partition. It looks like loader.efi can be fixed via making some of the | > 512 bytes reads more flexible. loader.efi doesn't have trouble reading | > the ufs partition. This is probably a simple fix. | > | > I now have FreeBSD installed on a system with 4Kn drives and tested the | > same code works on 512. | > | > MFC after: 1 week | > | >Modified: | > head/sbin/fsck_msdosfs/boot.c | > head/sbin/fsck_msdosfs/dosfs.h | > head/sys/boot/amd64/boot1.efi/boot1.c | > | >Modified: head/sbin/fsck_msdosfs/boot.c | >============================================================================== | >--- head/sbin/fsck_msdosfs/boot.c Thu Oct 30 15:41:25 2014 (r273864) | >+++ head/sbin/fsck_msdosfs/boot.c Thu Oct 30 15:52:01 2014 (r273865) | >@@ -181,7 +181,7 @@ readboot(int dosfs, struct bootblock *bo | > boot->bpbResSectors + boot->bpbFATs * boot->FATsecs - | > CLUST_FIRST * boot->bpbSecPerClust; | > | >- if (boot->bpbBytesPerSec % DOSBOOTBLOCKSIZE != 0) { | >+ if (boot->bpbBytesPerSec % DOSBOOTBLOCKSIZE_REAL != 0) { | > pfatal("Invalid sector size: %u", boot->bpbBytesPerSec); | > return FSFATAL; | > } | > | >Modified: head/sbin/fsck_msdosfs/dosfs.h | >============================================================================== | >--- head/sbin/fsck_msdosfs/dosfs.h Thu Oct 30 15:41:25 2014 (r273864) | >+++ head/sbin/fsck_msdosfs/dosfs.h Thu Oct 30 15:52:01 2014 (r273865) | >@@ -30,7 +30,9 @@ | > #ifndef DOSFS_H | > #define DOSFS_H | > | >-#define DOSBOOTBLOCKSIZE 512 | >+/* support 4Kn disk reads */ | >+#define DOSBOOTBLOCKSIZE_REAL 512 | >+#define DOSBOOTBLOCKSIZE 4096 | > | > typedef u_int32_t cl_t; /* type holding a cluster number */ | > | > | >Modified: head/sys/boot/amd64/boot1.efi/boot1.c | >============================================================================== | >--- head/sys/boot/amd64/boot1.efi/boot1.c Thu Oct 30 15:41:25 2014 | >(r273864) | >+++ head/sys/boot/amd64/boot1.efi/boot1.c Thu Oct 30 15:52:01 2014 | >(r273865) | >@@ -168,9 +168,12 @@ static int | > dskread(void *buf, u_int64_t lba, int nblk) | > { | > EFI_STATUS status; | >+ int size; | > | >+ lba = lba / (bootdev->Media->BlockSize / DEV_BSIZE); | >+ size = nblk * DEV_BSIZE; | > status = bootdev->ReadBlocks(bootdev, bootdev->Media->MediaId, lba, | >- nblk * bootdev->Media->BlockSize, buf); | >+ size, buf); | > | > if (EFI_ERROR(status)) | > return (-1); | > From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 23:47:29 2014 Return-Path: Delivered-To: svn-src-all@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 BDE4E9F8; Thu, 30 Oct 2014 23:47: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 AA15D38F; Thu, 30 Oct 2014 23:47: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 s9UNlTcu026158; Thu, 30 Oct 2014 23:47:29 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UNlTY5026157; Thu, 30 Oct 2014 23:47:29 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201410302347.s9UNlTY5026157@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Thu, 30 Oct 2014 23:47:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273876 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 23:47:29 -0000 Author: hiren Date: Thu Oct 30 23:47:28 2014 New Revision: 273876 URL: https://svnweb.freebsd.org/changeset/base/273876 Log: Use search method instead of fixed offsets for finding rootfs. This unbreaks recent images for picostation by allowing to find rootfs at correct location. Suggested by: loos MFC after: 1 month Modified: head/sys/mips/conf/PICOSTATION_M2HP.hints Modified: head/sys/mips/conf/PICOSTATION_M2HP.hints ============================================================================== --- head/sys/mips/conf/PICOSTATION_M2HP.hints Thu Oct 30 22:47:32 2014 (r273875) +++ head/sys/mips/conf/PICOSTATION_M2HP.hints Thu Oct 30 23:47:28 2014 (r273876) @@ -80,13 +80,13 @@ hint.map.1.readonly=1 hint.map.2.at="flash/spi0" hint.map.2.start=0x00050000 -hint.map.2.end=0x00130000 # 896k kernel +hint.map.2.end="search:0x00100000:0x10000:.!/bin/sh" hint.map.2.name="kernel" hint.map.2.readonly=1 hint.map.3.at="flash/spi0" -hint.map.3.start=0x130000 -hint.map.3.end=0x007b0000 # 6656k rootfs +hint.map.3.start="search:0x00100000:0x10000:.!/bin/sh" +hint.map.3.end=0x007b0000 hint.map.3.name="rootfs" hint.map.3.readonly=0 From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 03:24:47 2014 Return-Path: Delivered-To: svn-src-all@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 8E4A2D7B for ; Fri, 31 Oct 2014 03:24:47 +0000 (UTC) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com [209.85.215.52]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 111FBBF3 for ; Fri, 31 Oct 2014 03:24:46 +0000 (UTC) Received: by mail-la0-f52.google.com with SMTP id pv20so3642194lab.39 for ; Thu, 30 Oct 2014 20:24:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=ppamuKD1BoTDWSslMyUaFEf+HWc8D/aWt0zhkQEAw+A=; b=JO9B4ygoRzrH9shEe26v3lh5cb+ME4lLatbjS2Acox3PGNaLjnCVjuEErPDj0P/pq9 Xaj21DYPIMza9ypE4n6HPqU4tM8fHwRhzseNv34+F99QVdCZo2Gghp5r/pBtQuf5LiJU uixZ4CVJIECz/vNujUMTMBa61DUOd16N/7sGwDVkVokl/rsI6g5OhT4hhgy1FbjBpRSz mSIBv/vGyJ8LUjxe+u3ETjqSPwiq1725zco2YmTH658zCLeGnUK88GrQrOjQgjEGOvX5 e9Xg4OwQGJU4/L251Fdv3Mr/Wp+8marLFcbYOg+WaFscETlCmiuxjtJzSlx6h6N6f06K pNqw== X-Gm-Message-State: ALoCoQlJUUK27ivMj4ZVaoYws6l7TfzIrvatXPR0aVID9sqhPHqI7OW05h1zD7vzR2fRMjSz1wVD X-Received: by 10.152.5.129 with SMTP id s1mr23500551las.59.1414725879537; Thu, 30 Oct 2014 20:24:39 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id ak7sm3913337lbc.12.2014.10.30.20.24.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Oct 2014 20:24:38 -0700 (PDT) Message-ID: <545300F6.9070306@freebsd.org> Date: Fri, 31 Oct 2014 06:24:38 +0300 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Mark Murray , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... References: <201410302121.s9ULLsEw055630@svn.freebsd.org> In-Reply-To: <201410302121.s9ULLsEw055630@svn.freebsd.org> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 03:24:47 -0000 On 31.10.2014 0:21, Mark Murray wrote: > Deleted: > head/etc/rc.d/initrandom It should be added to ObsoleteFiles.inc -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 04:01:10 2014 Return-Path: Delivered-To: svn-src-all@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 EDE6E185; Fri, 31 Oct 2014 04:01: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 C0946EE2; Fri, 31 Oct 2014 04:01: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 s9V41A3G054630; Fri, 31 Oct 2014 04:01:10 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V41AVV054629; Fri, 31 Oct 2014 04:01:10 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201410310401.s9V41AVV054629@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 31 Oct 2014 04:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273877 - stable/10/sys/fs/nfsserver X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 04:01:11 -0000 Author: araujo (ports committer) Date: Fri Oct 31 04:01:10 2014 New Revision: 273877 URL: https://svnweb.freebsd.org/changeset/base/273877 Log: MFC r273159: Add two sysctl(8) to enable/disable NFSv4 server to check when setting user nobody and/or setting group nogroup as owner of a file or directory. Usually at the client side, if there is an username that is not in the client's passwd database, some clients will send 'nobody@' in the wire and the NFSv4 server will treat it as an ERROR. However, if you have a valid user nobody in your passwd database, the NFSv4 server will treat it as a NFSERR_BADOWNER as its believes the client doesn't has the username mapped. Submitted by: Loic Blot Reviewed by: rmacklem Approved by: rmacklem Sponsored by: QNAP Systems Inc. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdsubs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdsubs.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdsubs.c Thu Oct 30 23:47:28 2014 (r273876) +++ stable/10/sys/fs/nfsserver/nfs_nfsdsubs.c Fri Oct 31 04:01:10 2014 (r273877) @@ -66,6 +66,16 @@ SYSCTL_INT(_vfs_nfsd, OID_AUTO, disable_ &disable_checkutf8, 0, "Disable the NFSv4 check for a UTF8 compliant name"); +static int enable_nobodycheck = 1; +SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_nobodycheck, CTLFLAG_RW, + &enable_nobodycheck, 0, + "Enable the NFSv4 check when setting user nobody as owner"); + +static int enable_nogroupcheck = 1; +SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_nogroupcheck, CTLFLAG_RW, + &enable_nogroupcheck, 0, + "Enable the NFSv4 check when setting group nogroup as owner"); + static char nfsrv_hexdigit(char, int *); /* @@ -1543,8 +1553,10 @@ nfsrv_checkuidgid(struct nfsrv_descript */ if (NFSVNO_NOTSETUID(nvap) && NFSVNO_NOTSETGID(nvap)) goto out; - if ((NFSVNO_ISSETUID(nvap) && nvap->na_uid == nfsrv_defaultuid) - || (NFSVNO_ISSETGID(nvap) && nvap->na_gid == nfsrv_defaultgid)) { + if ((NFSVNO_ISSETUID(nvap) && nvap->na_uid == nfsrv_defaultuid && + enable_nobodycheck == 1) + || (NFSVNO_ISSETGID(nvap) && nvap->na_gid == nfsrv_defaultgid && + enable_nogroupcheck == 1)) { error = NFSERR_BADOWNER; goto out; } From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 04:01:44 2014 Return-Path: Delivered-To: svn-src-all@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 42D572B9; Fri, 31 Oct 2014 04:01:44 +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 BC3CBEEC; Fri, 31 Oct 2014 04:01:42 +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 s9V41XgD019492 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 31 Oct 2014 07:01:33 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s9V41X4l019491; Fri, 31 Oct 2014 07:01:33 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 31 Oct 2014 07:01:33 +0300 From: Gleb Smirnoff To: John Baldwin Subject: Re: svn commit: r273834 - head/usr.sbin/etcupdate Message-ID: <20141031040133.GF1031@FreeBSD.org> References: <201410291801.s9TI1Ap0068710@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201410291801.s9TI1Ap0068710@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 04:01:44 -0000 On Wed, Oct 29, 2014 at 06:01:10PM +0000, John Baldwin wrote: J> Author: jhb J> Date: Wed Oct 29 18:01:09 2014 J> New Revision: 273834 J> URL: https://svnweb.freebsd.org/changeset/base/273834 J> J> Log: J> Rework the EXAMPLES section to be a bit clearer. J> - Add an example of using etcupdate diff. J> - Create a subsection on bootstrapping that is below the simple J> examples. This should make it clearer that 'etcupdate extract' is J> a one-time operation and not part of the common workflow. It also J> adds more suggestions on when bootstrapping is needed and additional J> steps to make future merges simpler. J> J> Reviewed by: adrian J> MFC after: 3 days Thanks a lot for clarification! -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 05:41:28 2014 Return-Path: Delivered-To: svn-src-all@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 2E51F95; Fri, 31 Oct 2014 05: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 1A5F0919; Fri, 31 Oct 2014 05: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 s9V5fRRn001797; Fri, 31 Oct 2014 05:41:27 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V5fRll001796; Fri, 31 Oct 2014 05:41:27 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410310541.s9V5fRll001796@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 31 Oct 2014 05:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273878 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 05:41:28 -0000 Author: mjg Date: Fri Oct 31 05:41:27 2014 New Revision: 273878 URL: https://svnweb.freebsd.org/changeset/base/273878 Log: filedesc: tidy up fdcopy a little bit Test for file availability by fde_file != NULL instead of fdisused, this is consistent with similar checks later. Drop badfileops check. badfileops don't have DFLAG_PASSABLE set, so it was never reached in practice. fdiused is now only used in some KASSERTS, so ifdef it under INVARIANTS. No functional changes. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Oct 31 04:01:10 2014 (r273877) +++ head/sys/kern/kern_descrip.c Fri Oct 31 05:41:27 2014 (r273878) @@ -233,6 +233,7 @@ fd_last_used(struct filedesc *fdp, int s return (-1); } +#ifdef INVARIANTS static int fdisused(struct filedesc *fdp, int fd) { @@ -244,6 +245,7 @@ fdisused(struct filedesc *fdp, int fd) return ((fdp->fd_map[NDSLOT(fd)] & NDBIT(fd)) != 0); } +#endif /* * Mark a file descriptor as used. @@ -1920,9 +1922,8 @@ fdcopy(struct filedesc *fdp) newfdp->fd_freefile = -1; for (i = 0; i <= fdp->fd_lastfile; ++i) { ofde = &fdp->fd_ofiles[i]; - if (fdisused(fdp, i) && - (ofde->fde_file->f_ops->fo_flags & DFLAG_PASSABLE) && - ofde->fde_file->f_ops != &badfileops) { + if (ofde->fde_file != NULL && + ofde->fde_file->f_ops->fo_flags & DFLAG_PASSABLE) { nfde = &newfdp->fd_ofiles[i]; *nfde = *ofde; filecaps_copy(&ofde->fde_caps, &nfde->fde_caps); From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 07:04:26 2014 Return-Path: Delivered-To: svn-src-all@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 A47FD867; Fri, 31 Oct 2014 07:04: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 758C719C; Fri, 31 Oct 2014 07:04: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 s9V74QaQ039201; Fri, 31 Oct 2014 07:04:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V74QX0039200; Fri, 31 Oct 2014 07:04:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410310704.s9V74QX0039200@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 31 Oct 2014 07:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273879 - stable/10/sys/ofed/drivers/net/mlx4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 07:04:26 -0000 Author: hselasky Date: Fri Oct 31 07:04:25 2014 New Revision: 273879 URL: https://svnweb.freebsd.org/changeset/base/273879 Log: MFC r273593: Update the network interface baudrate integer according to the actual line rate. Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Fri Oct 31 05:41:27 2014 (r273878) +++ stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Fri Oct 31 07:04:25 2014 (r273879) @@ -970,6 +970,9 @@ static void mlx4_en_do_set_rx_mode(struc /* Important note: the following call for if_link_state_change * is needed for interface up scenario (start port, link state * change) */ + /* update netif baudrate */ + priv->dev->if_baudrate = + IF_Mbps(priv->port_state.link_speed); if_link_state_change(priv->dev, LINK_STATE_UP); en_dbg(HW, priv, "Link Up\n"); } @@ -1186,6 +1189,9 @@ static void mlx4_en_linkstate(struct wor if (linkstate == MLX4_DEV_EVENT_PORT_DOWN) { en_info(priv, "Link Down\n"); if_link_state_change(priv->dev, LINK_STATE_DOWN); + /* update netif baudrate */ + priv->dev->if_baudrate = 0; + /* make sure the port is up before notifying the OS. * This is tricky since we get here on INIT_PORT and * in such case we can't tell the OS the port is up. @@ -1193,6 +1199,10 @@ static void mlx4_en_linkstate(struct wor * in set_rx_mode. * */ } else if (priv->port_up && (linkstate == MLX4_DEV_EVENT_PORT_UP)){ + if (mlx4_en_QUERY_PORT(priv->mdev, priv->port)) + en_info(priv, "Query port failed\n"); + priv->dev->if_baudrate = + IF_Mbps(priv->port_state.link_speed); en_info(priv, "Link Up\n"); if_link_state_change(priv->dev, LINK_STATE_UP); } @@ -1978,7 +1988,6 @@ int mlx4_en_init_netdev(struct mlx4_en_d dev->if_softc = priv; if_initname(dev, "mlxen", atomic_fetchadd_int(&mlx4_en_unit, 1)); dev->if_mtu = ETHERMTU; - dev->if_baudrate = 1000000000; dev->if_init = mlx4_en_open; dev->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; dev->if_ioctl = mlx4_en_ioctl; From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 07:08:33 2014 Return-Path: Delivered-To: svn-src-all@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 243509BF; Fri, 31 Oct 2014 07:08: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 0EFCC1BC; Fri, 31 Oct 2014 07:08: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 s9V78WUw039729; Fri, 31 Oct 2014 07:08:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V78Wv4039728; Fri, 31 Oct 2014 07:08:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410310708.s9V78Wv4039728@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 31 Oct 2014 07:08:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273880 - stable/10/sys/ofed/drivers/net/mlx4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 07:08:33 -0000 Author: hselasky Date: Fri Oct 31 07:08:32 2014 New Revision: 273880 URL: https://svnweb.freebsd.org/changeset/base/273880 Log: MFC r273867: Fix compile warning by removing unused variable. Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/drivers/net/mlx4/mcg.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/drivers/net/mlx4/mcg.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/mcg.c Fri Oct 31 07:04:25 2014 (r273879) +++ stable/10/sys/ofed/drivers/net/mlx4/mcg.c Fri Oct 31 07:08:32 2014 (r273880) @@ -39,9 +39,6 @@ #include "mlx4.h" - -static const u8 zero_gid[16]; /* automatically initialized to 0 */ - int mlx4_get_mgm_entry_size(struct mlx4_dev *dev) { return 1 << dev->oper_log_mgm_entry_size; From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 07:18:28 2014 Return-Path: Delivered-To: svn-src-all@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 A1F39C3F; Fri, 31 Oct 2014 07:18: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 73A50312; Fri, 31 Oct 2014 07:18: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 s9V7ISRa044406; Fri, 31 Oct 2014 07:18:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V7ISGZ044405; Fri, 31 Oct 2014 07:18:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410310718.s9V7ISGZ044405@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 31 Oct 2014 07:18:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r273881 - stable/9/sys/ofed/drivers/net/mlx4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 07:18:28 -0000 Author: hselasky Date: Fri Oct 31 07:18:27 2014 New Revision: 273881 URL: https://svnweb.freebsd.org/changeset/base/273881 Log: MFC r273593: Update the network interface baudrate integer according to the actual line rate. Sponsored by: Mellanox Technologies Modified: stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c Fri Oct 31 07:08:32 2014 (r273880) +++ stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c Fri Oct 31 07:18:27 2014 (r273881) @@ -970,6 +970,9 @@ static void mlx4_en_do_set_rx_mode(struc /* Important note: the following call for if_link_state_change * is needed for interface up scenario (start port, link state * change) */ + /* update netif baudrate */ + priv->dev->if_baudrate = + IF_Mbps(priv->port_state.link_speed); if_link_state_change(priv->dev, LINK_STATE_UP); en_dbg(HW, priv, "Link Up\n"); } @@ -1186,6 +1189,9 @@ static void mlx4_en_linkstate(struct wor if (linkstate == MLX4_DEV_EVENT_PORT_DOWN) { en_info(priv, "Link Down\n"); if_link_state_change(priv->dev, LINK_STATE_DOWN); + /* update netif baudrate */ + priv->dev->if_baudrate = 0; + /* make sure the port is up before notifying the OS. * This is tricky since we get here on INIT_PORT and * in such case we can't tell the OS the port is up. @@ -1193,6 +1199,10 @@ static void mlx4_en_linkstate(struct wor * in set_rx_mode. * */ } else if (priv->port_up && (linkstate == MLX4_DEV_EVENT_PORT_UP)){ + if (mlx4_en_QUERY_PORT(priv->mdev, priv->port)) + en_info(priv, "Query port failed\n"); + priv->dev->if_baudrate = + IF_Mbps(priv->port_state.link_speed); en_info(priv, "Link Up\n"); if_link_state_change(priv->dev, LINK_STATE_UP); } @@ -1978,7 +1988,6 @@ int mlx4_en_init_netdev(struct mlx4_en_d dev->if_softc = priv; if_initname(dev, "mlxen", atomic_fetchadd_int(&mlx4_en_unit, 1)); dev->if_mtu = ETHERMTU; - dev->if_baudrate = 1000000000; dev->if_init = mlx4_en_open; dev->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; dev->if_ioctl = mlx4_en_ioctl; From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 07:33:59 2014 Return-Path: Delivered-To: svn-src-all@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 BBD28FFA; Fri, 31 Oct 2014 07:33: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 9D9026EB; Fri, 31 Oct 2014 07:33: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 s9V7Xx6N053099; Fri, 31 Oct 2014 07:33:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V7XvO3053087; Fri, 31 Oct 2014 07:33:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410310733.s9V7XvO3053087@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 31 Oct 2014 07:33:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273882 - in stable/10: share/man/man4 sys/conf sys/dev/usb sys/dev/usb/misc sys/dev/usb/quirk sys/modules/usb sys/modules/usb/uled X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 07:33:59 -0000 Author: hselasky Date: Fri Oct 31 07:33:56 2014 New Revision: 273882 URL: https://svnweb.freebsd.org/changeset/base/273882 Log: MFC r271159, r271168 and r271680: Add USB LED driver for the Dream Cheeky WebMail Notifier. Added: stable/10/share/man/man4/uled.4 - copied unchanged from r271159, head/share/man/man4/uled.4 stable/10/sys/dev/usb/misc/uled.c - copied, changed from r271159, head/sys/dev/usb/misc/uled.c stable/10/sys/dev/usb/uled_ioctl.h - copied unchanged from r271159, head/sys/dev/usb/uled_ioctl.h stable/10/sys/modules/usb/uled/ - copied from r271159, head/sys/modules/usb/uled/ Modified: stable/10/share/man/man4/Makefile stable/10/sys/conf/NOTES stable/10/sys/conf/files stable/10/sys/dev/usb/quirk/usb_quirk.c stable/10/sys/dev/usb/usbdevs stable/10/sys/modules/usb/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Fri Oct 31 07:18:27 2014 (r273881) +++ stable/10/share/man/man4/Makefile Fri Oct 31 07:33:56 2014 (r273882) @@ -528,6 +528,7 @@ MAN= aac.4 \ uhso.4 \ uipaq.4 \ ukbd.4 \ + uled.4 \ ulpt.4 \ umass.4 \ umcs.4 \ Copied: stable/10/share/man/man4/uled.4 (from r271159, head/share/man/man4/uled.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/uled.4 Fri Oct 31 07:33:56 2014 (r273882, copy of r271159, head/share/man/man4/uled.4) @@ -0,0 +1,95 @@ +.\" +.\" Copyright (c) 2014 Kevin Lo +.\" 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 September 5, 2014 +.Dt ULED 4 +.Os +.Sh NAME +.Nm uled +.Nd USB LED driver +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines into +your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device uled" +.Cd "device usb" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, +place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +uled_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the Dream Cheeky WebMail Notifier device. +.Pp +Subsequently, the +.Pa /dev/uled0 +device can be used by userland applications. +.Sh IOCTLS +The following +.Xr ioctl 2 +commands can be performed on +.Pa /dev/uled0 , +which are defined in +.In dev/usb/uled_ioctl.h : +.Bl -tag -width indent +.It Dv ULED_GET_COLOR +The command returns LED colors with values for RGB. +This +.Xr ioctl 2 +takes the following structure: +.Bd -literal +struct uled_color { + uint8_t red; + uint8_t green; + uint8_t blue; +}; +.Ed +.Pp +.It Dv ULED_SET_COLOR +The command sets LED colors with values for RGB. +It uses the same structure as above. +.El +.Sh FILES +.Bl -tag -width ".Pa /dev/uled0" -compact +.It Pa /dev/uled0 +blocking device node +.El +.Sh SEE ALSO +.Xr ohci 4 , +.Xr uhci 4 , +.Xr usb 4 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Kevin Lo Aq Mt kevlo@FreeBSD.org . Modified: stable/10/sys/conf/NOTES ============================================================================== --- stable/10/sys/conf/NOTES Fri Oct 31 07:18:27 2014 (r273881) +++ stable/10/sys/conf/NOTES Fri Oct 31 07:33:56 2014 (r273882) @@ -2644,6 +2644,8 @@ device usb device udbp # USB Fm Radio device ufm +# USB LED +device uled # Human Interface Device (anything with buttons and dials) device uhid # USB keyboard Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Fri Oct 31 07:18:27 2014 (r273881) +++ stable/10/sys/conf/files Fri Oct 31 07:33:56 2014 (r273882) @@ -2489,6 +2489,7 @@ dev/usb/serial/usb_serial.c optional uc # dev/usb/misc/ufm.c optional ufm dev/usb/misc/udbp.c optional udbp +dev/usb/misc/uled.c optional uled # # USB input drivers # Copied and modified: stable/10/sys/dev/usb/misc/uled.c (from r271159, head/sys/dev/usb/misc/uled.c) ============================================================================== --- head/sys/dev/usb/misc/uled.c Fri Sep 5 11:25:58 2014 (r271159, copy source) +++ stable/10/sys/dev/usb/misc/uled.c Fri Oct 31 07:33:56 2014 (r273882) @@ -231,7 +231,7 @@ uled_close(struct usb_fifo *fifo, int ff sc->sc_state &= ~ULED_ENABLED; } } - + static int uled_ioctl(struct usb_fifo *fifo, u_long cmd, void *addr, int fflags) { Modified: stable/10/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/10/sys/dev/usb/quirk/usb_quirk.c Fri Oct 31 07:18:27 2014 (r273881) +++ stable/10/sys/dev/usb/quirk/usb_quirk.c Fri Oct 31 07:33:56 2014 (r273882) @@ -110,6 +110,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(CYBERPOWER, 1500CAVRLCD, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(CYPRESS, SILVERSHIELD, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(DELORME, EARTHMATE, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(DREAMLINK, DL100B, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(ITUNERNET, USBLCD2X20, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(ITUNERNET, USBLCD4X20, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(LIEBERT, POWERSURE_PXT, 0x0000, 0xffff, UQ_HID_IGNORE), Copied: stable/10/sys/dev/usb/uled_ioctl.h (from r271159, head/sys/dev/usb/uled_ioctl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/usb/uled_ioctl.h Fri Oct 31 07:33:56 2014 (r273882, copy of r271159, head/sys/dev/usb/uled_ioctl.h) @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2014 Kevin Lo + * 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 _ULED_IOCTL_H_ +#define _ULED_IOCTL_H_ + +#include + +struct uled_color { + uint8_t red; + uint8_t green; + uint8_t blue; +}; + +#define ULED_GET_COLOR _IOR('U', 205, struct uled_color) +#define ULED_SET_COLOR _IOW('U', 206, struct uled_color) + +#endif /* _ULED_IOCTL_H_ */ Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Fri Oct 31 07:18:27 2014 (r273881) +++ stable/10/sys/dev/usb/usbdevs Fri Oct 31 07:33:56 2014 (r273882) @@ -713,6 +713,7 @@ vendor LONGCHEER 0x1c9e Longcheer Holdin vendor MPMAN 0x1cae MpMan vendor DRESDENELEKTRONIK 0x1cf1 dresden elektronik vendor NEOTEL 0x1d09 Neotel +vendor DREAMLINK 0x1d34 Dream Link vendor PEGATRON 0x1d4d Pegatron vendor QISDA 0x1da5 Qisda vendor METAGEEK2 0x1dd5 MetaGeek @@ -1657,6 +1658,9 @@ product DMI DISK 0x2bcf Generic Disk /* DrayTek products */ product DRAYTEK VIGOR550 0x0550 Vigor550 +/* Dream Link products */ +product DREAMLINK DL100B 0x0004 USB Webmail Notifier + /* dresden elektronik products */ product DRESDENELEKTRONIK SENSORTERMINALBOARD 0x0001 SensorTerminalBoard product DRESDENELEKTRONIK WIRELESSHANDHELDTERMINAL 0x0004 Wireless Handheld Terminal Modified: stable/10/sys/modules/usb/Makefile ============================================================================== --- stable/10/sys/modules/usb/Makefile Fri Oct 31 07:18:27 2014 (r273881) +++ stable/10/sys/modules/usb/Makefile Fri Oct 31 07:33:56 2014 (r273882) @@ -35,7 +35,7 @@ SUBDIR += ${_dwc_otg} ehci ${_musb} ohci ${_atmegadci} ${_avr32dci} ${_rsu} ${_rsufw} SUBDIR += ${_rum} ${_run} ${_runfw} ${_uath} upgt usie ural ${_zyd} ${_urtw} SUBDIR += ${_urtwn} ${_urtwnfw} -SUBDIR += atp uhid ukbd ums udbp ufm uep wsp +SUBDIR += atp uhid ukbd ums udbp ufm uep wsp uled SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ umct umcs umodem umoscom uplcom uslcom uvisor uvscom SUBDIR += uether aue axe axge cdce cue ${_kue} mos rue smsc udav uhso ipheth From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 07:38:51 2014 Return-Path: Delivered-To: svn-src-all@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 E1B0A1FB; Fri, 31 Oct 2014 07:38: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 CC0FA76A; Fri, 31 Oct 2014 07:38: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 s9V7cooC053735; Fri, 31 Oct 2014 07:38:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V7cnxO053731; Fri, 31 Oct 2014 07:38:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410310738.s9V7cnxO053731@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 31 Oct 2014 07:38:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273883 - in stable/10/sys/dev/usb: controller serial wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 07:38:51 -0000 Author: hselasky Date: Fri Oct 31 07:38:49 2014 New Revision: 273883 URL: https://svnweb.freebsd.org/changeset/base/273883 Log: MFC r269569: Remove unused defines. Fix some device_printf's that were missing '\n' at the end or had spelling errors. PR: 145319 Modified: stable/10/sys/dev/usb/controller/ehci.c stable/10/sys/dev/usb/serial/u3g.c stable/10/sys/dev/usb/serial/uftdi.c stable/10/sys/dev/usb/wlan/if_upgt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/ehci.c ============================================================================== --- stable/10/sys/dev/usb/controller/ehci.c Fri Oct 31 07:33:56 2014 (r273882) +++ stable/10/sys/dev/usb/controller/ehci.c Fri Oct 31 07:38:49 2014 (r273883) @@ -215,7 +215,7 @@ ehci_reset(ehci_softc_t *sc) return (0); } } - device_printf(sc->sc_bus.bdev, "Reset timeout\n"); + device_printf(sc->sc_bus.bdev, "reset timeout\n"); return (USB_ERR_IOERROR); } @@ -290,7 +290,7 @@ ehci_init_sub(struct ehci_softc *sc) } } if (hcr) { - device_printf(sc->sc_bus.bdev, "Run timeout\n"); + device_printf(sc->sc_bus.bdev, "run timeout\n"); return (USB_ERR_IOERROR); } return (USB_ERR_NORMAL_COMPLETION); Modified: stable/10/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/10/sys/dev/usb/serial/u3g.c Fri Oct 31 07:33:56 2014 (r273882) +++ stable/10/sys/dev/usb/serial/u3g.c Fri Oct 31 07:38:49 2014 (r273883) @@ -78,15 +78,6 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, #define U3G_TXSIZE (U3G_BSIZE / U3G_TXFRAMES) #define U3G_TXFRAMES 4 -#define U3GSP_GPRS 0 -#define U3GSP_EDGE 1 -#define U3GSP_CDMA 2 -#define U3GSP_UMTS 3 -#define U3GSP_HSDPA 4 -#define U3GSP_HSUPA 5 -#define U3GSP_HSPA 6 -#define U3GSP_MAX 7 - /* Eject methods; See also usb_quirks.h:UQ_MSC_EJECT_* */ #define U3GINIT_HUAWEI 1 /* Requires Huawei init command */ #define U3GINIT_SIERRA 2 /* Requires Sierra init command */ @@ -895,7 +886,7 @@ u3g_attach(device_t dev) sc->sc_iface[nports] = id->bInterfaceNumber; if (bootverbose && sc->sc_xfer[nports][U3G_INTR]) { - device_printf(dev, "port %d supports modem control", + device_printf(dev, "port %d supports modem control\n", nports); } Modified: stable/10/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/10/sys/dev/usb/serial/uftdi.c Fri Oct 31 07:33:56 2014 (r273882) +++ stable/10/sys/dev/usb/serial/uftdi.c Fri Oct 31 07:38:49 2014 (r273883) @@ -979,7 +979,7 @@ uftdi_devtype_setup(struct uftdi_softc * } else { sc->sc_devtype = DEVT_232R; device_printf(sc->sc_dev, "Warning: unknown FTDI " - "device type, bcdDevice=0x%04x, assuming 232R", + "device type, bcdDevice=0x%04x, assuming 232R\n", uaa->info.bcdDevice); } sc->sc_ucom.sc_portno = 0; Modified: stable/10/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_upgt.c Fri Oct 31 07:33:56 2014 (r273882) +++ stable/10/sys/dev/usb/wlan/if_upgt.c Fri Oct 31 07:38:49 2014 (r273883) @@ -428,7 +428,7 @@ upgt_get_stats(struct upgt_softc *sc) data_cmd = upgt_getbuf(sc); if (data_cmd == NULL) { - device_printf(sc->sc_dev, "%s: out of buffer.\n", __func__); + device_printf(sc->sc_dev, "%s: out of buffers.\n", __func__); return; } From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 07:41:29 2014 Return-Path: Delivered-To: svn-src-all@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 11B5F352; Fri, 31 Oct 2014 07:41: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 EE696806; Fri, 31 Oct 2014 07: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 s9V7fSdj056000; Fri, 31 Oct 2014 07:41:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V7fS0H055998; Fri, 31 Oct 2014 07:41:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410310741.s9V7fS0H055998@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 31 Oct 2014 07:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273884 - stable/10/sys/dev/usb/serial X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 07:41:29 -0000 Author: hselasky Date: Fri Oct 31 07:41:28 2014 New Revision: 273884 URL: https://svnweb.freebsd.org/changeset/base/273884 Log: MFC r264923: Remove device type from the uftdi_devs table, enhance the jtag-skip feature. Modified: stable/10/sys/dev/usb/serial/uftdi.c stable/10/sys/dev/usb/serial/uftdi_reg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/10/sys/dev/usb/serial/uftdi.c Fri Oct 31 07:38:49 2014 (r273883) +++ stable/10/sys/dev/usb/serial/uftdi.c Fri Oct 31 07:41:28 2014 (r273884) @@ -82,16 +82,15 @@ __FBSDID("$FreeBSD$"); #include #include +static SYSCTL_NODE(_hw_usb, OID_AUTO, uftdi, CTLFLAG_RW, 0, "USB uftdi"); + #ifdef USB_DEBUG static int uftdi_debug = 0; - -static SYSCTL_NODE(_hw_usb, OID_AUTO, uftdi, CTLFLAG_RW, 0, "USB uftdi"); SYSCTL_INT(_hw_usb_uftdi, OID_AUTO, debug, CTLFLAG_RW, &uftdi_debug, 0, "Debug level"); #endif #define UFTDI_CONFIG_INDEX 0 -#define UFTDI_IFACE_INDEX_JTAG 0 /* * IO buffer sizes and FTDI device procotol sizes. @@ -273,645 +272,701 @@ MODULE_VERSION(uftdi, 1); static const STRUCT_USB_HOST_ID uftdi_devs[] = { #define UFTDI_DEV(v, p, i) \ { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } - UFTDI_DEV(ACTON, SPECTRAPRO, UFTDI_TYPE_AUTO), - UFTDI_DEV(ALTI2, N3, UFTDI_TYPE_AUTO), - UFTDI_DEV(ANALOGDEVICES, GNICE, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(ANALOGDEVICES, GNICEPLUS, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(ATMEL, STK541, UFTDI_TYPE_8U232AM), - UFTDI_DEV(BAYER, CONTOUR_CABLE, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, 232USB9M, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, 485USB9F_2W, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, 485USB9F_4W, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, 485USBTB_2W, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, 485USBTB_4W, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, TTL3USB9M, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, TTL5USB9M, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USO9ML2, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USO9ML2DR, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USO9ML2DR_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USOPTL4, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USOPTL4DR, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USOPTL4DR2, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USOTL4, UFTDI_TYPE_8U232AM), - UFTDI_DEV(BBELECTRONICS, USPTL4, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USTL4, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, ZZ_PROG1_USB, UFTDI_TYPE_AUTO), - UFTDI_DEV(CONTEC, COM1USBH, UFTDI_TYPE_AUTO), - UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, UFTDI_TYPE_8U232AM), - UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, UFTDI_TYPE_8U232AM), - UFTDI_DEV(DRESDENELEKTRONIK, LEVELSHIFTERSTICKLOWCOST, UFTDI_TYPE_8U232AM), - UFTDI_DEV(ELEKTOR, FT323R, UFTDI_TYPE_AUTO), - UFTDI_DEV(EVOLUTION, ER1, UFTDI_TYPE_AUTO), - UFTDI_DEV(EVOLUTION, HYBRID, UFTDI_TYPE_AUTO), - UFTDI_DEV(EVOLUTION, RCM4, UFTDI_TYPE_AUTO), - UFTDI_DEV(FALCOM, SAMBA, UFTDI_TYPE_AUTO), - UFTDI_DEV(FALCOM, TWIST, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FIC, NEO1973_DEBUG, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FIC, NEO1973_DEBUG, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, 232EX, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, 232H, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, 232RL, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, 4N_GALAXY_DE_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, 4N_GALAXY_DE_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, 4N_GALAXY_DE_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, 8U232AM_ALT, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ACCESSO, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ACG_HFDUAL, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ACTIVE_ROBOTS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ACTZWAVE, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, AMC232, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ARTEMIS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ASK_RDR400, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ATIK_ATK16, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ATIK_ATK16C, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ATIK_ATK16HR, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ATIK_ATK16HRC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ATIK_ATK16IC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, BCS_SE923, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, BEAGLEBONE, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, CANDAPTER, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CANUSB, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CCSICDU20_0, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CCSICDU40_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CCSICDU64_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CCSLOAD_N_GO_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CCSMACHX_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CCSPRIME8_5, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CFA_631, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, CFA_632, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, CFA_633, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, CFA_634, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, CFA_635, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, CHAMSYS_24_MASTER_WING, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CHAMSYS_MAXI_WING, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CHAMSYS_MEDIA_WING, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CHAMSYS_MIDI_TIMECODE, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CHAMSYS_MINI_WING, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CHAMSYS_PC_WING, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CHAMSYS_USB_DMX, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CHAMSYS_WING, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, COM4SM, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_0, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_5, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_6, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_7, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CTI_USB_MINI_485, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, CTI_USB_NANO_485, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, DMX4ALL, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, DOMINTELL_DGQG, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, DOMINTELL_DUSB, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, DOTEC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ECLO_COM_1WIRE, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ECO_PRO_CDS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, EISCOU, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, ELSTER_UNICOM, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_ALC8500, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_CLI7000, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_CSI8, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_EC3000, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_EM1000DL, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_EM1010PC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_FEM, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_FHZ1000PC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_FHZ1300PC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_FM3RX, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_FS20SIG, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_HS485, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_KL100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_MSM1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_PCD200, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_PCK100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_PPS7330, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_RFP500, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_T1100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_TFD128, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_TFM100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_TWS550, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UAD8, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UDA7, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UDF77, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UIO88, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_ULA200, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UM100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UMS100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UO100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UR100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_USI2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_USR, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UTP8, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_WS300PC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_WS444PC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_WS500, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_WS550, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_WS777, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_WS888, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, EMCU2D, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, EMCU2H, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, FUTURE_0, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, FUTURE_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, FUTURE_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GAMMASCOUT, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, GENERIC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E808, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E809, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E80A, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E80B, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E80C, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E80D, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E80E, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E80F, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E88D, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E88E, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E88F, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, HD_RADIO, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, HO720, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, HO730, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, HO820, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, HO870, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_APP70, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_PCMCIA, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_PEDO, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_PICPRO, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_PK1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_PROD, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_RS232MON, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_US485, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IPLUS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IPLUS2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IRTRANS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, KBS, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, KTLINK, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, LENZ_LIUSB, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, LK202, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, LK204, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, LM3S_DEVEL_BOARD, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, LM3S_EVAL_BOARD, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, LM3S_ICDI_B_BOARD, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, MASTERDEVEL2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MAXSTREAM, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, MHAM_DB9, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MHAM_IC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MHAM_KW, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MHAM_RS232, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MHAM_Y6, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MHAM_Y8, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MHAM_Y9, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MHAM_YS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MICRO_CHAMELEON, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MTXORB_5, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MTXORB_6, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MX2_3, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, MX4_5, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, NXTCAM, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, OCEANIC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, OOCDLINK, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, OPENDCC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, OPENDCC_GATEWAY, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, OPENDCC_GBM, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, OPENDCC_SNIFFER, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, OPENDCC_THROTTLE, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, PCDJ_DAC2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, PCMSFU, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, PERLE_ULTRAPORT, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, PHI_FISCO, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, PIEGROUP, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, PROPOX_JTAGCABLEII, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, R2000KU_TRUE_RNG, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, R2X0, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, RELAIS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, REU_TINY, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, RMP200, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, RM_CANVIEW, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, RRCIRKITS_LOCOBUFFER, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCIENCESCOPE_HS_LOGBOOK, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCIENCESCOPE_LOGBOOKML, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCIENCESCOPE_LS_LOGBOOK, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_0, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_5, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_6, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_7, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SDMUSBQSS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SEMC_DSS20, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, SERIAL_2232C, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, SERIAL_2232D, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, SERIAL_232RL, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SERIAL_4232H, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, SERIAL_8U100AX, UFTDI_TYPE_SIO), - UFTDI_DEV(FTDI, SERIAL_8U232AM, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, SERIAL_8U232AM4, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, SIGNALYZER_SH2, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, SIGNALYZER_SH4, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, SIGNALYZER_SLITE, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, SIGNALYZER_ST, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, SPECIAL_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SPECIAL_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SPECIAL_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SPROG_II, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SR_RADIO, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SUUNTO_SPORTS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13M, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13S, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13U, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, TAVIR_STK500, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, TERATRONIK_D2XX, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, TERATRONIK_VCP, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, THORLABS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, TNC_X, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, TTUSB, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, TURTELIZER2, UFTDI_TYPE_8U232AM | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, UOPTBR, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, USBSERIAL, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, USBX_707, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, USB_UIRT, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, USINT_CAT, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, USINT_RS232, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, USINT_WKEY, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, VARDAAN, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, VNHCPCUSB_D, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, WESTREX_MODEL_777, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, WESTREX_MODEL_8900F, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, XF_547, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, XF_640, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, XF_642, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, XM_RADIO, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, YEI_SERVOCENTER31, UFTDI_TYPE_AUTO), - UFTDI_DEV(GNOTOMETRICS, USB, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, SP1, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, OPC_U_UC, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP2C1, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP2C2, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP2D, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP2KVR, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP2KVT, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP2VR, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP2VT, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP4KVR, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP4KVT, UFTDI_TYPE_AUTO), - UFTDI_DEV(IDTECH, IDT1221U, UFTDI_TYPE_AUTO), - UFTDI_DEV(INTERBIOMETRICS, IOBOARD, UFTDI_TYPE_AUTO), - UFTDI_DEV(INTERBIOMETRICS, MINI_IOBOARD, UFTDI_TYPE_AUTO), - UFTDI_DEV(INTREPIDCS, NEOVI, UFTDI_TYPE_8U232AM), - UFTDI_DEV(INTREPIDCS, VALUECAN, UFTDI_TYPE_8U232AM), - UFTDI_DEV(IONICS, PLUGCOMPUTER, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(JETI, SPC1201, UFTDI_TYPE_AUTO), - UFTDI_DEV(KOBIL, CONV_B1, UFTDI_TYPE_AUTO), - UFTDI_DEV(KOBIL, CONV_KAAN, UFTDI_TYPE_AUTO), - UFTDI_DEV(LARSENBRUSGAARD, ALTITRACK, UFTDI_TYPE_AUTO), - UFTDI_DEV(MARVELL, SHEEVAPLUG, UFTDI_TYPE_8U232AM), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0100, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0101, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0102, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0103, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0104, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0105, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0106, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0107, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0108, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0109, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0110, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0111, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0112, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0113, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0114, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0115, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0116, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0117, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0118, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0119, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0120, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0121, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0122, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0123, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0124, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0125, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0126, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0128, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0129, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0130, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0131, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0132, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0133, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0134, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0135, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0136, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0137, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0138, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0139, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0140, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0141, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0142, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0143, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0144, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0145, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0146, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0147, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0148, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0149, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0150, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0151, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0152, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0159, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0160, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0161, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0162, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0163, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0164, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0165, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0166, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0167, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0168, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0169, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0170, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0171, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0172, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0173, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0174, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0175, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0176, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0177, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0178, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0179, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0180, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0181, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0182, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0183, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0184, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0185, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0186, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0187, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0188, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0189, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0190, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0191, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0192, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0193, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0194, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0195, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0196, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0197, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0198, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0199, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A0, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A1, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A2, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A3, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A4, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A5, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A6, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A7, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A8, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A9, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AA, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AB, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AC, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AD, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AE, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AF, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B0, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B1, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B2, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B3, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B4, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B5, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B6, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B7, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B8, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B9, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BA, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BB, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BC, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BD, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BE, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BF, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C0, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C1, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C2, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C3, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C4, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C5, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C6, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C7, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C8, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C9, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CA, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CB, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CC, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CD, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CE, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CF, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D0, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D1, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D2, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D3, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D4, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D5, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D6, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D7, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D8, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D9, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DA, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DB, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DC, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DD, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DE, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DF, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E0, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E1, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E2, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E3, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E4, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E5, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E6, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E7, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E8, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E9, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01EA, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01EB, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01EC, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01ED, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01EE, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01EF, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F0, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F1, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F2, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F3, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F4, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F5, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F6, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F7, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F8, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F9, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FA, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FB, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FC, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FD, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FE, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FF, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, MOUA, UFTDI_TYPE_8U232AM), - UFTDI_DEV(MELCO, PCOPRS1, UFTDI_TYPE_8U232AM), - UFTDI_DEV(METAGEEK, TELLSTICK, UFTDI_TYPE_AUTO), - UFTDI_DEV(MOBILITY, USB_SERIAL, UFTDI_TYPE_AUTO), - UFTDI_DEV(OLIMEX, ARM_USB_OCD, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(OLIMEX, ARM_USB_OCD_H, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(OPTO, CRD7734, UFTDI_TYPE_AUTO), - UFTDI_DEV(OPTO, CRD7734_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, AD4USB, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, AP485, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, AP485_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, DRAK5, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, DRAK6, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, GMSR, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, GMUX, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, IRAMP, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, LEC, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, MU, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO10X1, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO2X16, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO2X2, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO30X3, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO3X32, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO4X4, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO60X3, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO8X8, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SB232, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SB422, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SB422_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SB485, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SB485C, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SB485S, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SB485_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SIMUKEY, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, TMU, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, UPSUSB, UFTDI_TYPE_AUTO), - UFTDI_DEV(POSIFLEX, PP7000, UFTDI_TYPE_AUTO), - UFTDI_DEV(QIHARDWARE, JTAGSERIAL, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(RATOC, REXUSB60F, UFTDI_TYPE_8U232AM), - UFTDI_DEV(RTSYSTEMS, CT29B, UFTDI_TYPE_AUTO), - UFTDI_DEV(RTSYSTEMS, SERIAL_VX7, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2101, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2102, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2103, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2104, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2106, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2201_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2201_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2202_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2202_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2203_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2203_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2401_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2401_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2401_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2401_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2402_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2402_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2402_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2402_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2403_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2403_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2403_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2403_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_5, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_6, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_7, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_8, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_5, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_6, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_7, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_8, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_5, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_6, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_7, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_8, UFTDI_TYPE_AUTO), - UFTDI_DEV(SIIG2, DK201, UFTDI_TYPE_AUTO), - UFTDI_DEV(SIIG2, US2308, UFTDI_TYPE_8U232AM), - UFTDI_DEV(TESTO, USB_INTERFACE, UFTDI_TYPE_AUTO), - UFTDI_DEV(TML, USB_SERIAL, UFTDI_TYPE_AUTO), - UFTDI_DEV(TTI, QL355P, UFTDI_TYPE_AUTO), - UFTDI_DEV(UNKNOWN4, NF_RIC, UFTDI_TYPE_AUTO), + UFTDI_DEV(ACTON, SPECTRAPRO, 0), + UFTDI_DEV(ALTI2, N3, 0), + UFTDI_DEV(ANALOGDEVICES, GNICE, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(ANALOGDEVICES, GNICEPLUS, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(ATMEL, STK541, 0), + UFTDI_DEV(BAYER, CONTOUR_CABLE, 0), + UFTDI_DEV(BBELECTRONICS, 232USB9M, 0), + UFTDI_DEV(BBELECTRONICS, 485USB9F_2W, 0), + UFTDI_DEV(BBELECTRONICS, 485USB9F_4W, 0), + UFTDI_DEV(BBELECTRONICS, 485USBTB_2W, 0), + UFTDI_DEV(BBELECTRONICS, 485USBTB_4W, 0), + UFTDI_DEV(BBELECTRONICS, TTL3USB9M, 0), + UFTDI_DEV(BBELECTRONICS, TTL5USB9M, 0), + UFTDI_DEV(BBELECTRONICS, USO9ML2, 0), + UFTDI_DEV(BBELECTRONICS, USO9ML2DR, 0), + UFTDI_DEV(BBELECTRONICS, USO9ML2DR_2, 0), + UFTDI_DEV(BBELECTRONICS, USOPTL4, 0), + UFTDI_DEV(BBELECTRONICS, USOPTL4DR, 0), + UFTDI_DEV(BBELECTRONICS, USOPTL4DR2, 0), + UFTDI_DEV(BBELECTRONICS, USOTL4, 0), + UFTDI_DEV(BBELECTRONICS, USPTL4, 0), + UFTDI_DEV(BBELECTRONICS, USTL4, 0), + UFTDI_DEV(BBELECTRONICS, ZZ_PROG1_USB, 0), + UFTDI_DEV(CONTEC, COM1USBH, 0), + UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, 0), + UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, 0), + UFTDI_DEV(DRESDENELEKTRONIK, LEVELSHIFTERSTICKLOWCOST, 0), + UFTDI_DEV(ELEKTOR, FT323R, 0), + UFTDI_DEV(EVOLUTION, ER1, 0), + UFTDI_DEV(EVOLUTION, HYBRID, 0), + UFTDI_DEV(EVOLUTION, RCM4, 0), + UFTDI_DEV(FALCOM, SAMBA, 0), + UFTDI_DEV(FALCOM, TWIST, 0), + UFTDI_DEV(FIC, NEO1973_DEBUG, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FIC, NEO1973_DEBUG, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, 232EX, 0), + UFTDI_DEV(FTDI, 232H, 0), + UFTDI_DEV(FTDI, 232RL, 0), + UFTDI_DEV(FTDI, 4N_GALAXY_DE_1, 0), + UFTDI_DEV(FTDI, 4N_GALAXY_DE_2, 0), + UFTDI_DEV(FTDI, 4N_GALAXY_DE_3, 0), + UFTDI_DEV(FTDI, 8U232AM_ALT, 0), + UFTDI_DEV(FTDI, ACCESSO, 0), + UFTDI_DEV(FTDI, ACG_HFDUAL, 0), + UFTDI_DEV(FTDI, ACTIVE_ROBOTS, 0), + UFTDI_DEV(FTDI, ACTZWAVE, 0), + UFTDI_DEV(FTDI, AMC232, 0), + UFTDI_DEV(FTDI, ARTEMIS, 0), + UFTDI_DEV(FTDI, ASK_RDR400, 0), + UFTDI_DEV(FTDI, ATIK_ATK16, 0), + UFTDI_DEV(FTDI, ATIK_ATK16C, 0), + UFTDI_DEV(FTDI, ATIK_ATK16HR, 0), + UFTDI_DEV(FTDI, ATIK_ATK16HRC, 0), + UFTDI_DEV(FTDI, ATIK_ATK16IC, 0), + UFTDI_DEV(FTDI, BCS_SE923, 0), + UFTDI_DEV(FTDI, BEAGLEBONE, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, CANDAPTER, 0), + UFTDI_DEV(FTDI, CANUSB, 0), + UFTDI_DEV(FTDI, CCSICDU20_0, 0), + UFTDI_DEV(FTDI, CCSICDU40_1, 0), + UFTDI_DEV(FTDI, CCSICDU64_4, 0), + UFTDI_DEV(FTDI, CCSLOAD_N_GO_3, 0), + UFTDI_DEV(FTDI, CCSMACHX_2, 0), + UFTDI_DEV(FTDI, CCSPRIME8_5, 0), + UFTDI_DEV(FTDI, CFA_631, 0), + UFTDI_DEV(FTDI, CFA_632, 0), + UFTDI_DEV(FTDI, CFA_633, 0), + UFTDI_DEV(FTDI, CFA_634, 0), + UFTDI_DEV(FTDI, CFA_635, 0), + UFTDI_DEV(FTDI, CHAMSYS_24_MASTER_WING, 0), + UFTDI_DEV(FTDI, CHAMSYS_MAXI_WING, 0), + UFTDI_DEV(FTDI, CHAMSYS_MEDIA_WING, 0), + UFTDI_DEV(FTDI, CHAMSYS_MIDI_TIMECODE, 0), + UFTDI_DEV(FTDI, CHAMSYS_MINI_WING, 0), + UFTDI_DEV(FTDI, CHAMSYS_PC_WING, 0), + UFTDI_DEV(FTDI, CHAMSYS_USB_DMX, 0), + UFTDI_DEV(FTDI, CHAMSYS_WING, 0), + UFTDI_DEV(FTDI, COM4SM, 0), + UFTDI_DEV(FTDI, CONVERTER_0, 0), + UFTDI_DEV(FTDI, CONVERTER_1, 0), + UFTDI_DEV(FTDI, CONVERTER_2, 0), + UFTDI_DEV(FTDI, CONVERTER_3, 0), + UFTDI_DEV(FTDI, CONVERTER_4, 0), + UFTDI_DEV(FTDI, CONVERTER_5, 0), + UFTDI_DEV(FTDI, CONVERTER_6, 0), + UFTDI_DEV(FTDI, CONVERTER_7, 0), + UFTDI_DEV(FTDI, CTI_USB_MINI_485, 0), + UFTDI_DEV(FTDI, CTI_USB_NANO_485, 0), + UFTDI_DEV(FTDI, DMX4ALL, 0), + UFTDI_DEV(FTDI, DOMINTELL_DGQG, 0), + UFTDI_DEV(FTDI, DOMINTELL_DUSB, 0), + UFTDI_DEV(FTDI, DOTEC, 0), + UFTDI_DEV(FTDI, ECLO_COM_1WIRE, 0), + UFTDI_DEV(FTDI, ECO_PRO_CDS, 0), + UFTDI_DEV(FTDI, EISCOU, 0), + UFTDI_DEV(FTDI, ELSTER_UNICOM, 0), + UFTDI_DEV(FTDI, ELV_ALC8500, 0), + UFTDI_DEV(FTDI, ELV_CLI7000, 0), + UFTDI_DEV(FTDI, ELV_CSI8, 0), + UFTDI_DEV(FTDI, ELV_EC3000, 0), + UFTDI_DEV(FTDI, ELV_EM1000DL, 0), + UFTDI_DEV(FTDI, ELV_EM1010PC, 0), + UFTDI_DEV(FTDI, ELV_FEM, 0), + UFTDI_DEV(FTDI, ELV_FHZ1000PC, 0), + UFTDI_DEV(FTDI, ELV_FHZ1300PC, 0), + UFTDI_DEV(FTDI, ELV_FM3RX, 0), + UFTDI_DEV(FTDI, ELV_FS20SIG, 0), + UFTDI_DEV(FTDI, ELV_HS485, 0), + UFTDI_DEV(FTDI, ELV_KL100, 0), + UFTDI_DEV(FTDI, ELV_MSM1, 0), + UFTDI_DEV(FTDI, ELV_PCD200, 0), + UFTDI_DEV(FTDI, ELV_PCK100, 0), + UFTDI_DEV(FTDI, ELV_PPS7330, 0), + UFTDI_DEV(FTDI, ELV_RFP500, 0), + UFTDI_DEV(FTDI, ELV_T1100, 0), + UFTDI_DEV(FTDI, ELV_TFD128, 0), + UFTDI_DEV(FTDI, ELV_TFM100, 0), + UFTDI_DEV(FTDI, ELV_TWS550, 0), + UFTDI_DEV(FTDI, ELV_UAD8, 0), + UFTDI_DEV(FTDI, ELV_UDA7, 0), + UFTDI_DEV(FTDI, ELV_UDF77, 0), + UFTDI_DEV(FTDI, ELV_UIO88, 0), + UFTDI_DEV(FTDI, ELV_ULA200, 0), + UFTDI_DEV(FTDI, ELV_UM100, 0), + UFTDI_DEV(FTDI, ELV_UMS100, 0), + UFTDI_DEV(FTDI, ELV_UO100, 0), + UFTDI_DEV(FTDI, ELV_UR100, 0), + UFTDI_DEV(FTDI, ELV_USI2, 0), + UFTDI_DEV(FTDI, ELV_USR, 0), + UFTDI_DEV(FTDI, ELV_UTP8, 0), + UFTDI_DEV(FTDI, ELV_WS300PC, 0), + UFTDI_DEV(FTDI, ELV_WS444PC, 0), + UFTDI_DEV(FTDI, ELV_WS500, 0), + UFTDI_DEV(FTDI, ELV_WS550, 0), + UFTDI_DEV(FTDI, ELV_WS777, 0), + UFTDI_DEV(FTDI, ELV_WS888, 0), + UFTDI_DEV(FTDI, EMCU2D, 0), + UFTDI_DEV(FTDI, EMCU2H, 0), + UFTDI_DEV(FTDI, FUTURE_0, 0), + UFTDI_DEV(FTDI, FUTURE_1, 0), + UFTDI_DEV(FTDI, FUTURE_2, 0), + UFTDI_DEV(FTDI, GAMMASCOUT, 0), + UFTDI_DEV(FTDI, GENERIC, 0), + UFTDI_DEV(FTDI, GUDEADS_E808, 0), + UFTDI_DEV(FTDI, GUDEADS_E809, 0), + UFTDI_DEV(FTDI, GUDEADS_E80A, 0), + UFTDI_DEV(FTDI, GUDEADS_E80B, 0), + UFTDI_DEV(FTDI, GUDEADS_E80C, 0), + UFTDI_DEV(FTDI, GUDEADS_E80D, 0), + UFTDI_DEV(FTDI, GUDEADS_E80E, 0), + UFTDI_DEV(FTDI, GUDEADS_E80F, 0), + UFTDI_DEV(FTDI, GUDEADS_E88D, 0), + UFTDI_DEV(FTDI, GUDEADS_E88E, 0), + UFTDI_DEV(FTDI, GUDEADS_E88F, 0), + UFTDI_DEV(FTDI, HD_RADIO, 0), + UFTDI_DEV(FTDI, HO720, 0), + UFTDI_DEV(FTDI, HO730, 0), + UFTDI_DEV(FTDI, HO820, 0), + UFTDI_DEV(FTDI, HO870, 0), + UFTDI_DEV(FTDI, IBS_APP70, 0), + UFTDI_DEV(FTDI, IBS_PCMCIA, 0), + UFTDI_DEV(FTDI, IBS_PEDO, 0), + UFTDI_DEV(FTDI, IBS_PICPRO, 0), + UFTDI_DEV(FTDI, IBS_PK1, 0), + UFTDI_DEV(FTDI, IBS_PROD, 0), + UFTDI_DEV(FTDI, IBS_RS232MON, 0), + UFTDI_DEV(FTDI, IBS_US485, 0), + UFTDI_DEV(FTDI, IPLUS, 0), + UFTDI_DEV(FTDI, IPLUS2, 0), + UFTDI_DEV(FTDI, IRTRANS, 0), + UFTDI_DEV(FTDI, KBS, 0), + UFTDI_DEV(FTDI, KTLINK, 0), + UFTDI_DEV(FTDI, LENZ_LIUSB, 0), + UFTDI_DEV(FTDI, LK202, 0), + UFTDI_DEV(FTDI, LK204, 0), + UFTDI_DEV(FTDI, LM3S_DEVEL_BOARD, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, LM3S_EVAL_BOARD, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, LM3S_ICDI_B_BOARD, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, MASTERDEVEL2, 0), + UFTDI_DEV(FTDI, MAXSTREAM, 0), + UFTDI_DEV(FTDI, MHAM_DB9, 0), + UFTDI_DEV(FTDI, MHAM_IC, 0), + UFTDI_DEV(FTDI, MHAM_KW, 0), + UFTDI_DEV(FTDI, MHAM_RS232, 0), + UFTDI_DEV(FTDI, MHAM_Y6, 0), + UFTDI_DEV(FTDI, MHAM_Y8, 0), + UFTDI_DEV(FTDI, MHAM_Y9, 0), + UFTDI_DEV(FTDI, MHAM_YS, 0), + UFTDI_DEV(FTDI, MICRO_CHAMELEON, 0), + UFTDI_DEV(FTDI, MTXORB_5, 0), + UFTDI_DEV(FTDI, MTXORB_6, 0), + UFTDI_DEV(FTDI, MX2_3, 0), + UFTDI_DEV(FTDI, MX4_5, 0), + UFTDI_DEV(FTDI, NXTCAM, 0), + UFTDI_DEV(FTDI, OCEANIC, 0), + UFTDI_DEV(FTDI, OOCDLINK, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, OPENDCC, 0), + UFTDI_DEV(FTDI, OPENDCC_GATEWAY, 0), + UFTDI_DEV(FTDI, OPENDCC_GBM, 0), + UFTDI_DEV(FTDI, OPENDCC_SNIFFER, 0), + UFTDI_DEV(FTDI, OPENDCC_THROTTLE, 0), + UFTDI_DEV(FTDI, PCDJ_DAC2, 0), + UFTDI_DEV(FTDI, PCMSFU, 0), + UFTDI_DEV(FTDI, PERLE_ULTRAPORT, 0), + UFTDI_DEV(FTDI, PHI_FISCO, 0), + UFTDI_DEV(FTDI, PIEGROUP, 0), + UFTDI_DEV(FTDI, PROPOX_JTAGCABLEII, 0), + UFTDI_DEV(FTDI, R2000KU_TRUE_RNG, 0), + UFTDI_DEV(FTDI, R2X0, 0), + UFTDI_DEV(FTDI, RELAIS, 0), + UFTDI_DEV(FTDI, REU_TINY, 0), + UFTDI_DEV(FTDI, RMP200, 0), + UFTDI_DEV(FTDI, RM_CANVIEW, 0), + UFTDI_DEV(FTDI, RRCIRKITS_LOCOBUFFER, 0), + UFTDI_DEV(FTDI, SCIENCESCOPE_HS_LOGBOOK, 0), + UFTDI_DEV(FTDI, SCIENCESCOPE_LOGBOOKML, 0), + UFTDI_DEV(FTDI, SCIENCESCOPE_LS_LOGBOOK, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_0, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_1, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_2, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_3, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_4, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_5, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_6, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_7, 0), + UFTDI_DEV(FTDI, SDMUSBQSS, 0), + UFTDI_DEV(FTDI, SEMC_DSS20, 0), + UFTDI_DEV(FTDI, SERIAL_2232C, UFTDI_JTAG_CHECK_STRING), + UFTDI_DEV(FTDI, SERIAL_2232D, 0), + UFTDI_DEV(FTDI, SERIAL_232RL, 0), + UFTDI_DEV(FTDI, SERIAL_4232H, 0), + UFTDI_DEV(FTDI, SERIAL_8U100AX, 0), + UFTDI_DEV(FTDI, SERIAL_8U232AM, 0), + UFTDI_DEV(FTDI, SERIAL_8U232AM4, 0), + UFTDI_DEV(FTDI, SIGNALYZER_SH2, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, SIGNALYZER_SH4, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, SIGNALYZER_SLITE, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, SIGNALYZER_ST, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, SPECIAL_1, 0), + UFTDI_DEV(FTDI, SPECIAL_3, 0), + UFTDI_DEV(FTDI, SPECIAL_4, 0), + UFTDI_DEV(FTDI, SPROG_II, 0), + UFTDI_DEV(FTDI, SR_RADIO, 0), + UFTDI_DEV(FTDI, SUUNTO_SPORTS, 0), + UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13M, 0), + UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13S, 0), + UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13U, 0), + UFTDI_DEV(FTDI, TAVIR_STK500, 0), + UFTDI_DEV(FTDI, TERATRONIK_D2XX, 0), + UFTDI_DEV(FTDI, TERATRONIK_VCP, 0), + UFTDI_DEV(FTDI, THORLABS, 0), + UFTDI_DEV(FTDI, TNC_X, 0), + UFTDI_DEV(FTDI, TTUSB, 0), + UFTDI_DEV(FTDI, TURTELIZER2, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, UOPTBR, 0), + UFTDI_DEV(FTDI, USBSERIAL, 0), + UFTDI_DEV(FTDI, USBX_707, 0), + UFTDI_DEV(FTDI, USB_UIRT, 0), + UFTDI_DEV(FTDI, USINT_CAT, 0), + UFTDI_DEV(FTDI, USINT_RS232, 0), + UFTDI_DEV(FTDI, USINT_WKEY, 0), + UFTDI_DEV(FTDI, VARDAAN, 0), + UFTDI_DEV(FTDI, VNHCPCUSB_D, 0), + UFTDI_DEV(FTDI, WESTREX_MODEL_777, 0), + UFTDI_DEV(FTDI, WESTREX_MODEL_8900F, 0), + UFTDI_DEV(FTDI, XF_547, 0), + UFTDI_DEV(FTDI, XF_640, 0), + UFTDI_DEV(FTDI, XF_642, 0), + UFTDI_DEV(FTDI, XM_RADIO, 0), + UFTDI_DEV(FTDI, YEI_SERVOCENTER31, 0), + UFTDI_DEV(GNOTOMETRICS, USB, 0), + UFTDI_DEV(ICOM, SP1, 0), + UFTDI_DEV(ICOM, OPC_U_UC, 0), + UFTDI_DEV(ICOM, RP2C1, 0), + UFTDI_DEV(ICOM, RP2C2, 0), + UFTDI_DEV(ICOM, RP2D, 0), + UFTDI_DEV(ICOM, RP2KVR, 0), + UFTDI_DEV(ICOM, RP2KVT, 0), + UFTDI_DEV(ICOM, RP2VR, 0), + UFTDI_DEV(ICOM, RP2VT, 0), + UFTDI_DEV(ICOM, RP4KVR, 0), + UFTDI_DEV(ICOM, RP4KVT, 0), + UFTDI_DEV(IDTECH, IDT1221U, 0), + UFTDI_DEV(INTERBIOMETRICS, IOBOARD, 0), + UFTDI_DEV(INTERBIOMETRICS, MINI_IOBOARD, 0), + UFTDI_DEV(INTREPIDCS, NEOVI, 0), + UFTDI_DEV(INTREPIDCS, VALUECAN, 0), + UFTDI_DEV(IONICS, PLUGCOMPUTER, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(JETI, SPC1201, 0), + UFTDI_DEV(KOBIL, CONV_B1, 0), + UFTDI_DEV(KOBIL, CONV_KAAN, 0), + UFTDI_DEV(LARSENBRUSGAARD, ALTITRACK, 0), + UFTDI_DEV(MARVELL, SHEEVAPLUG, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0100, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0101, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0102, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0103, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0104, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0105, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0106, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0107, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0108, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0109, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010A, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010B, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010C, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010D, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010E, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010F, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0110, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0111, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0112, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0113, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0114, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0115, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0116, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0117, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0118, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0119, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011A, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011B, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011C, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011D, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011E, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011F, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0120, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0121, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0122, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0123, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0124, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0125, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0126, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0128, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0129, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012A, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012B, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012D, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012E, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012F, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0130, 0), *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 07:51:07 2014 Return-Path: Delivered-To: svn-src-all@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 09B47529; Fri, 31 Oct 2014 07:51: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 DDFBC8D2; Fri, 31 Oct 2014 07:51: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 s9V7p6rM061167; Fri, 31 Oct 2014 07:51:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V7p5mC061162; Fri, 31 Oct 2014 07:51:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410310751.s9V7p5mC061162@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 31 Oct 2014 07:51:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273885 - in stable/10/sys/dev/usb: . quirk serial X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 07:51:07 -0000 Author: hselasky Date: Fri Oct 31 07:51:05 2014 New Revision: 273885 URL: https://svnweb.freebsd.org/changeset/base/273885 Log: MFC r269575, r269576 and r269578: - Add a second Huawei SCSI eject command as USB mode switch config files sometimes use one or the other. Maybe newer Huawei modems switched. - Return USB_ERR_INVAL if the eject method is not known. PR: 145319 Modified: stable/10/sys/dev/usb/quirk/usb_quirk.c stable/10/sys/dev/usb/quirk/usb_quirk.h stable/10/sys/dev/usb/serial/u3g.c stable/10/sys/dev/usb/usb_msctest.c stable/10/sys/dev/usb/usb_msctest.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/10/sys/dev/usb/quirk/usb_quirk.c Fri Oct 31 07:41:28 2014 (r273884) +++ stable/10/sys/dev/usb/quirk/usb_quirk.c Fri Oct 31 07:51:05 2014 (r273885) @@ -562,6 +562,7 @@ static const char *usb_quirk_str[USB_QUI [UQ_MSC_EJECT_WAIT] = "UQ_MSC_EJECT_WAIT", [UQ_MSC_EJECT_SAEL_M460] = "UQ_MSC_EJECT_SAEL_M460", [UQ_MSC_EJECT_HUAWEISCSI] = "UQ_MSC_EJECT_HUAWEISCSI", + [UQ_MSC_EJECT_HUAWEISCSI2] = "UQ_MSC_EJECT_HUAWEISCSI2", [UQ_MSC_EJECT_TCT] = "UQ_MSC_EJECT_TCT", [UQ_BAD_MIDI] = "UQ_BAD_MIDI", [UQ_AU_VENDOR_CLASS] = "UQ_AU_VENDOR_CLASS", Modified: stable/10/sys/dev/usb/quirk/usb_quirk.h ============================================================================== --- stable/10/sys/dev/usb/quirk/usb_quirk.h Fri Oct 31 07:41:28 2014 (r273884) +++ stable/10/sys/dev/usb/quirk/usb_quirk.h Fri Oct 31 07:51:05 2014 (r273885) @@ -102,6 +102,7 @@ enum { UQ_MSC_EJECT_WAIT, /* wait for the device to eject */ UQ_MSC_EJECT_SAEL_M460, /* ejects after Sael USB commands */ UQ_MSC_EJECT_HUAWEISCSI, /* ejects after Huawei SCSI command */ + UQ_MSC_EJECT_HUAWEISCSI2, /* ejects after Huawei SCSI 2 command */ UQ_MSC_EJECT_TCT, /* ejects after TCT SCSI command */ UQ_BAD_MIDI, /* device claims MIDI class, but isn't */ Modified: stable/10/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/10/sys/dev/usb/serial/u3g.c Fri Oct 31 07:41:28 2014 (r273884) +++ stable/10/sys/dev/usb/serial/u3g.c Fri Oct 31 07:51:05 2014 (r273885) @@ -88,7 +88,8 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, #define U3GINIT_WAIT 7 /* Device reappears after a delay */ #define U3GINIT_SAEL_M460 8 /* Requires vendor init */ #define U3GINIT_HUAWEISCSI 9 /* Requires Huawei SCSI init command */ -#define U3GINIT_TCT 10 /* Requires TCT Mobile init command */ +#define U3GINIT_HUAWEISCSI2 10 /* Requires Huawei SCSI init command (2) */ +#define U3GINIT_TCT 11 /* Requires TCT Mobile init command */ enum { U3G_BULK_WR, @@ -724,6 +725,8 @@ u3g_test_autoinst(void *arg, struct usb_ method = U3GINIT_WAIT; else if (usb_test_quirk(uaa, UQ_MSC_EJECT_HUAWEISCSI)) method = U3GINIT_HUAWEISCSI; + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_HUAWEISCSI2)) + method = U3GINIT_HUAWEISCSI2; else if (usb_test_quirk(uaa, UQ_MSC_EJECT_TCT)) method = U3GINIT_TCT; else if (usbd_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa) == 0) @@ -744,6 +747,9 @@ u3g_test_autoinst(void *arg, struct usb_ case U3GINIT_HUAWEISCSI: error = usb_msc_eject(udev, 0, MSC_EJECT_HUAWEI); break; + case U3GINIT_HUAWEISCSI2: + error = usb_msc_eject(udev, 0, MSC_EJECT_HUAWEI2); + break; case U3GINIT_SCSIEJECT: error = usb_msc_eject(udev, 0, MSC_EJECT_STOPUNIT); break; Modified: stable/10/sys/dev/usb/usb_msctest.c ============================================================================== --- stable/10/sys/dev/usb/usb_msctest.c Fri Oct 31 07:41:28 2014 (r273884) +++ stable/10/sys/dev/usb/usb_msctest.c Fri Oct 31 07:51:05 2014 (r273885) @@ -102,6 +102,9 @@ static uint8_t scsi_cmotech_eject[] = static uint8_t scsi_huawei_eject[] = { 0x11, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static uint8_t scsi_huawei_eject2[] = { 0x11, 0x06, 0x20, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }; static uint8_t scsi_tct_eject[] = { 0x06, 0xf5, 0x04, 0x02, 0x52, 0x70 }; static uint8_t scsi_sync_cache[] = { 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; @@ -481,6 +484,7 @@ bbb_command_start(struct bbb_transfer *s sc->data_rem = data_len; sc->data_timeout = (data_timeout + USB_MS_HZ); sc->actlen = 0; + sc->error = 0; sc->cmd_len = cmd_len; memset(&sc->cbw->CBWCDB, 0, sizeof(sc->cbw->CBWCDB)); memcpy(&sc->cbw->CBWCDB, cmd_ptr, cmd_len); @@ -832,6 +836,11 @@ usb_msc_eject(struct usb_device *udev, u &scsi_huawei_eject, sizeof(scsi_huawei_eject), USB_MS_HZ); break; + case MSC_EJECT_HUAWEI2: + err = bbb_command_start(sc, DIR_IN, 0, NULL, 0, + &scsi_huawei_eject2, sizeof(scsi_huawei_eject2), + USB_MS_HZ); + break; case MSC_EJECT_TCT: /* * TCTMobile needs DIR_IN flag. To get it, we @@ -843,9 +852,10 @@ usb_msc_eject(struct usb_device *udev, u break; default: DPRINTF("Unknown eject method (%d)\n", method); - err = 0; - break; + bbb_detach(sc); + return (USB_ERR_INVAL); } + DPRINTF("Eject CD command status: %s\n", usbd_errstr(err)); bbb_detach(sc); Modified: stable/10/sys/dev/usb/usb_msctest.h ============================================================================== --- stable/10/sys/dev/usb/usb_msctest.h Fri Oct 31 07:41:28 2014 (r273884) +++ stable/10/sys/dev/usb/usb_msctest.h Fri Oct 31 07:51:05 2014 (r273885) @@ -33,6 +33,7 @@ enum { MSC_EJECT_ZTESTOR, MSC_EJECT_CMOTECH, MSC_EJECT_HUAWEI, + MSC_EJECT_HUAWEI2, MSC_EJECT_TCT, }; From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 07:55:44 2014 Return-Path: Delivered-To: svn-src-all@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 371406C8; Fri, 31 Oct 2014 07:55: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 175BF902; Fri, 31 Oct 2014 07:55: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 s9V7thJa062678; Fri, 31 Oct 2014 07:55:43 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V7thPJ062675; Fri, 31 Oct 2014 07:55:43 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410310755.s9V7thPJ062675@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 31 Oct 2014 07:55:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273886 - in stable/10/sys/dev/usb: . serial X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 07:55:44 -0000 Author: hselasky Date: Fri Oct 31 07:55:42 2014 New Revision: 273886 URL: https://svnweb.freebsd.org/changeset/base/273886 Log: MFC r264801, r264802, r264934, r273181, r273216 and r273252: Add more USB IDs. Modified: stable/10/sys/dev/usb/serial/u3g.c stable/10/sys/dev/usb/serial/uftdi.c stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/10/sys/dev/usb/serial/u3g.c Fri Oct 31 07:51:05 2014 (r273885) +++ stable/10/sys/dev/usb/serial/u3g.c Fri Oct 31 07:55:42 2014 (r273886) @@ -317,6 +317,8 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(HUAWEI, MOBILE, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E1752, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, E1820, U3GINIT_HUAWEISCSI), + U3G_DEV(HUAWEI, K3772, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, K3772_INIT, U3GINIT_HUAWEISCSI2), U3G_DEV(HUAWEI, K3765, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, K3765_INIT, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, K3770, U3GINIT_HUAWEI), @@ -465,7 +467,8 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QUALCOMMINC, SURFSTICK, 0), U3G_DEV(QUALCOMMINC, E2002, 0), U3G_DEV(QUALCOMMINC, E2003, 0), - U3G_DEV(QUALCOMMINC, K3772_Z, U3GINIT_SCSIEJECT), + U3G_DEV(QUALCOMMINC, K3772_Z, 0), + U3G_DEV(QUALCOMMINC, K3772_Z_INIT, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMMINC, MF626, 0), U3G_DEV(QUALCOMMINC, MF628, 0), U3G_DEV(QUALCOMMINC, MF633R, 0), Modified: stable/10/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/10/sys/dev/usb/serial/uftdi.c Fri Oct 31 07:51:05 2014 (r273885) +++ stable/10/sys/dev/usb/serial/uftdi.c Fri Oct 31 07:55:42 2014 (r273886) @@ -298,6 +298,7 @@ static const STRUCT_USB_HOST_ID uftdi_de UFTDI_DEV(CONTEC, COM1USBH, 0), UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, 0), UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, 0), + UFTDI_DEV(DRESDENELEKTRONIK, DE_RFNODE, 0), UFTDI_DEV(DRESDENELEKTRONIK, LEVELSHIFTERSTICKLOWCOST, 0), UFTDI_DEV(ELEKTOR, FT323R, 0), UFTDI_DEV(EVOLUTION, ER1, 0), @@ -327,7 +328,6 @@ static const STRUCT_USB_HOST_ID uftdi_de UFTDI_DEV(FTDI, ATIK_ATK16HRC, 0), UFTDI_DEV(FTDI, ATIK_ATK16IC, 0), UFTDI_DEV(FTDI, BCS_SE923, 0), - UFTDI_DEV(FTDI, BEAGLEBONE, UFTDI_JTAG_IFACE(0)), UFTDI_DEV(FTDI, CANDAPTER, 0), UFTDI_DEV(FTDI, CANUSB, 0), UFTDI_DEV(FTDI, CCSICDU20_0, 0), @@ -537,6 +537,8 @@ static const STRUCT_USB_HOST_ID uftdi_de UFTDI_DEV(FTDI, VNHCPCUSB_D, 0), UFTDI_DEV(FTDI, WESTREX_MODEL_777, 0), UFTDI_DEV(FTDI, WESTREX_MODEL_8900F, 0), + UFTDI_DEV(FTDI, XDS100V2, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, XDS100V3, UFTDI_JTAG_IFACE(0)), UFTDI_DEV(FTDI, XF_547, 0), UFTDI_DEV(FTDI, XF_640, 0), UFTDI_DEV(FTDI, XF_642, 0), Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Fri Oct 31 07:51:05 2014 (r273885) +++ stable/10/sys/dev/usb/usbdevs Fri Oct 31 07:55:42 2014 (r273886) @@ -1664,6 +1664,7 @@ product DREAMLINK DL100B 0x0004 USB Webm /* dresden elektronik products */ product DRESDENELEKTRONIK SENSORTERMINALBOARD 0x0001 SensorTerminalBoard product DRESDENELEKTRONIK WIRELESSHANDHELDTERMINAL 0x0004 Wireless Handheld Terminal +product DRESDENELEKTRONIK DE_RFNODE 0x001c deRFnode product DRESDENELEKTRONIK LEVELSHIFTERSTICKLOWCOST 0x0022 Levelshifter Stick Low Cost /* Dynastream Innovations */ @@ -1675,7 +1676,7 @@ product DYNASTREAM ANTDEVBOARD2 0x1006 A product EDIMAX EW7318USG 0x7318 USB Wireless dongle product EDIMAX RTL8192SU_1 0x7611 RTL8192SU product EDIMAX RTL8192SU_2 0x7612 RTL8192SU -product EDIMAX RTL8192SU_3 0x7622 RTL8192SU +product EDIMAX EW7622UMN 0x7622 EW-7622UMn product EDIMAX RT2870_1 0x7711 RT2870 product EDIMAX EW7717 0x7717 EW-7717 product EDIMAX EW7718 0x7718 EW-7718 @@ -1852,7 +1853,8 @@ product FTDI 232H 0x6014 FTDI compatibl product FTDI 232EX 0x6015 FTDI compatible adapter product FTDI SERIAL_2232D 0x9e90 FT2232D Dual port Serial product FTDI SERIAL_4232H 0x6011 FT4232H Quad port Serial -product FTDI BEAGLEBONE 0xa6d0 BeagleBone +product FTDI XDS100V2 0xa6d0 TI XDS100V1/V2 and early Beaglebones +product FTDI XDS100V3 0xa6d1 TI XDS100V3 product FTDI KTLINK 0xbbe2 KT-LINK Embedded Hackers Multitool product FTDI TURTELIZER2 0xbdc8 egnite Turtelizer 2 JTAG/RS232 Adapter /* Gude Analog- und Digitalsysteme products also uses FTDI's id: */ @@ -2345,15 +2347,21 @@ product HUAWEI K4505 0x1464 3G modem product HUAWEI K3765 0x1465 3G modem product HUAWEI E1820 0x14ac E1820 HSPA+ USB Slider product HUAWEI K3770 0x14c9 3G modem +product HUAWEI K3772 0x14cf K3772 product HUAWEI K3770_INIT 0x14d1 K3770 Initial product HUAWEI E3131_INIT 0x14fe 3G modem initial product HUAWEI E392 0x1505 LTE modem product HUAWEI E3131 0x1506 3G modem product HUAWEI K3765_INIT 0x1520 K3765 Initial product HUAWEI K4505_INIT 0x1521 K4505 Initial +product HUAWEI K3772_INIT 0x1526 K3772 Initial +product HUAWEI E3272_INIT 0x155b LTE modem initial +product HUAWEI R215_INIT 0x1582 LTE modem initial +product HUAWEI R215 0x1588 LTE modem product HUAWEI ETS2055 0x1803 CDMA modem product HUAWEI E173 0x1c05 3G modem product HUAWEI E173_INIT 0x1c0b 3G modem initial +product HUAWEI E3272 0x1c1e LTE modem /* HUAWEI 3com products */ product HUAWEI3COM WUB320G 0x0009 Aolynk WUB320g @@ -3240,6 +3248,7 @@ product NOVATEL EU740 0x2410 Expedite E product NOVATEL EU870D 0x2420 Expedite EU870D product NOVATEL U727 0x4100 Merlin U727 CDMA product NOVATEL MC950D 0x4400 Novatel MC950D HSUPA +product NOVATEL MC990D 0x7001 Novatel MC990D product NOVATEL ZEROCD 0x5010 Novatel ZeroCD product NOVATEL MIFI2200V 0x5020 Novatel MiFi 2200 CDMA Virgin Mobile product NOVATEL ZEROCD2 0x5030 Novatel ZeroCD @@ -3629,7 +3638,8 @@ product QUALCOMMINC E0078 0x0078 3G mode product QUALCOMMINC E0082 0x0082 3G modem product QUALCOMMINC E0086 0x0086 3G modem product QUALCOMMINC SURFSTICK 0x0117 1&1 Surf Stick -product QUALCOMMINC K3772_Z 0x1179 3G modem +product QUALCOMMINC K3772_Z_INIT 0x1179 K3772-Z Initial +product QUALCOMMINC K3772_Z 0x1181 K3772-Z product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage product QUALCOMMINC E2002 0x2002 3G modem product QUALCOMMINC E2003 0x2003 3G modem @@ -3791,6 +3801,7 @@ product SANDISK SDDR05 0x0005 ImageMate product SANDISK SDDR12 0x0100 ImageMate SDDR-12 product SANDISK SDDR09 0x0200 ImageMate SDDR-09 product SANDISK SDDR75 0x0810 ImageMate SDDR-75 +product SANDISK SDCZ2_128 0x7100 Cruzer Mini 128MB product SANDISK SDCZ2_256 0x7104 Cruzer Mini 256MB product SANDISK SDCZ4_128 0x7112 Cruzer Micro 128MB product SANDISK SDCZ4_256 0x7113 Cruzer Micro 256MB @@ -4131,6 +4142,23 @@ product SMC 2862WG 0xee13 EZ Connect Wi product SMC2 2020HUB 0x2020 USB Hub product SMC2 2514HUB 0x2514 USB Hub product SMC3 2662WUSB 0xa002 2662W-AR Wireless +product SMC2 LAN9500_ETH 0x9500 USB/Ethernet +product SMC2 LAN9505_ETH 0x9505 USB/Ethernet +product SMC2 LAN9530_ETH 0x9530 USB/Ethernet +product SMC2 LAN9730_ETH 0x9730 USB/Ethernet +product SMC2 LAN9500_SAL10 0x9900 USB/Ethernet +product SMC2 LAN9505_SAL10 0x9901 USB/Ethernet +product SMC2 LAN9500A_SAL10 0x9902 USB/Ethernet +product SMC2 LAN9505A_SAL10 0x9903 USB/Ethernet +product SMC2 LAN9514_SAL10 0x9904 USB/Ethernet +product SMC2 LAN9500A_HAL 0x9905 USB/Ethernet +product SMC2 LAN9505A_HAL 0x9906 USB/Ethernet +product SMC2 LAN9500_ETH_2 0x9907 USB/Ethernet +product SMC2 LAN9500A_ETH_2 0x9908 USB/Ethernet +product SMC2 LAN9514_ETH_2 0x9909 USB/Ethernet +product SMC2 LAN9500A_ETH 0x9e00 USB/Ethernet +product SMC2 LAN9505A_ETH 0x9e01 USB/Ethernet +product SMC2 LAN89530_ETH 0x9e08 USB/Ethernet product SMC2 LAN9514_ETH 0xec00 USB/Ethernet /* SOHOware products */ @@ -4552,5 +4580,6 @@ product ZYXEL G220V2 0x340f G-220 v2 product ZYXEL G202 0x3410 G-202 product ZYXEL RT2870_1 0x3416 RT2870 product ZYXEL RT2870_2 0x341a RT2870 +product ZYXEL RT3070 0x341e NWD2105 product ZYXEL RTL8192CU 0x341f RTL8192CU product ZYXEL NWD2705 0x3421 NWD2705 From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 07:59:09 2014 Return-Path: Delivered-To: svn-src-all@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 12CE497F; Fri, 31 Oct 2014 07:59: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 F0F46930; Fri, 31 Oct 2014 07:59: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 s9V7x804063115; Fri, 31 Oct 2014 07:59:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V7x8KY063111; Fri, 31 Oct 2014 07:59:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410310759.s9V7x8KY063111@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 31 Oct 2014 07:59:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r273887 - in stable/9/sys/dev/usb: controller serial wlan X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 07:59:09 -0000 Author: hselasky Date: Fri Oct 31 07:59:07 2014 New Revision: 273887 URL: https://svnweb.freebsd.org/changeset/base/273887 Log: MFC r269569: Remove unused defines. Fix some device_printf's that were missing '\n' at the end or had spelling errors. PR: 145319 Modified: stable/9/sys/dev/usb/controller/ehci.c stable/9/sys/dev/usb/serial/u3g.c stable/9/sys/dev/usb/serial/uftdi.c stable/9/sys/dev/usb/wlan/if_upgt.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/ehci.c ============================================================================== --- stable/9/sys/dev/usb/controller/ehci.c Fri Oct 31 07:55:42 2014 (r273886) +++ stable/9/sys/dev/usb/controller/ehci.c Fri Oct 31 07:59:07 2014 (r273887) @@ -212,7 +212,7 @@ ehci_reset(ehci_softc_t *sc) return (0); } } - device_printf(sc->sc_bus.bdev, "Reset timeout\n"); + device_printf(sc->sc_bus.bdev, "reset timeout\n"); return (USB_ERR_IOERROR); } @@ -287,7 +287,7 @@ ehci_init_sub(struct ehci_softc *sc) } } if (hcr) { - device_printf(sc->sc_bus.bdev, "Run timeout\n"); + device_printf(sc->sc_bus.bdev, "run timeout\n"); return (USB_ERR_IOERROR); } return (USB_ERR_NORMAL_COMPLETION); Modified: stable/9/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/9/sys/dev/usb/serial/u3g.c Fri Oct 31 07:55:42 2014 (r273886) +++ stable/9/sys/dev/usb/serial/u3g.c Fri Oct 31 07:59:07 2014 (r273887) @@ -78,15 +78,6 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, #define U3G_TXSIZE (U3G_BSIZE / U3G_TXFRAMES) #define U3G_TXFRAMES 4 -#define U3GSP_GPRS 0 -#define U3GSP_EDGE 1 -#define U3GSP_CDMA 2 -#define U3GSP_UMTS 3 -#define U3GSP_HSDPA 4 -#define U3GSP_HSUPA 5 -#define U3GSP_HSPA 6 -#define U3GSP_MAX 7 - /* Eject methods; See also usb_quirks.h:UQ_MSC_EJECT_* */ #define U3GINIT_HUAWEI 1 /* Requires Huawei init command */ #define U3GINIT_SIERRA 2 /* Requires Sierra init command */ @@ -896,7 +887,7 @@ u3g_attach(device_t dev) sc->sc_iface[nports] = id->bInterfaceNumber; if (bootverbose && sc->sc_xfer[nports][U3G_INTR]) { - device_printf(dev, "port %d supports modem control", + device_printf(dev, "port %d supports modem control\n", nports); } Modified: stable/9/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/9/sys/dev/usb/serial/uftdi.c Fri Oct 31 07:55:42 2014 (r273886) +++ stable/9/sys/dev/usb/serial/uftdi.c Fri Oct 31 07:59:07 2014 (r273887) @@ -979,7 +979,7 @@ uftdi_devtype_setup(struct uftdi_softc * } else { sc->sc_devtype = DEVT_232R; device_printf(sc->sc_dev, "Warning: unknown FTDI " - "device type, bcdDevice=0x%04x, assuming 232R", + "device type, bcdDevice=0x%04x, assuming 232R\n", uaa->info.bcdDevice); } sc->sc_ucom.sc_portno = 0; Modified: stable/9/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_upgt.c Fri Oct 31 07:55:42 2014 (r273886) +++ stable/9/sys/dev/usb/wlan/if_upgt.c Fri Oct 31 07:59:07 2014 (r273887) @@ -428,7 +428,7 @@ upgt_get_stats(struct upgt_softc *sc) data_cmd = upgt_getbuf(sc); if (data_cmd == NULL) { - device_printf(sc->sc_dev, "%s: out of buffer.\n", __func__); + device_printf(sc->sc_dev, "%s: out of buffers.\n", __func__); return; } From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 08:00:22 2014 Return-Path: Delivered-To: svn-src-all@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 BCA45B18; Fri, 31 Oct 2014 08:00:22 +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 A5A899CF; Fri, 31 Oct 2014 08:00:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9V80MeY065981; Fri, 31 Oct 2014 08:00:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V80MlS065979; Fri, 31 Oct 2014 08:00:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410310800.s9V80MlS065979@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 31 Oct 2014 08:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r273888 - stable/9/sys/dev/usb/serial X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 08:00:22 -0000 Author: hselasky Date: Fri Oct 31 08:00:22 2014 New Revision: 273888 URL: https://svnweb.freebsd.org/changeset/base/273888 Log: MFC r264923: Remove device type from the uftdi_devs table, enhance the jtag-skip feature. Modified: stable/9/sys/dev/usb/serial/uftdi.c stable/9/sys/dev/usb/serial/uftdi_reg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/9/sys/dev/usb/serial/uftdi.c Fri Oct 31 07:59:07 2014 (r273887) +++ stable/9/sys/dev/usb/serial/uftdi.c Fri Oct 31 08:00:22 2014 (r273888) @@ -82,16 +82,15 @@ __FBSDID("$FreeBSD$"); #include #include +static SYSCTL_NODE(_hw_usb, OID_AUTO, uftdi, CTLFLAG_RW, 0, "USB uftdi"); + #ifdef USB_DEBUG static int uftdi_debug = 0; - -static SYSCTL_NODE(_hw_usb, OID_AUTO, uftdi, CTLFLAG_RW, 0, "USB uftdi"); SYSCTL_INT(_hw_usb_uftdi, OID_AUTO, debug, CTLFLAG_RW, &uftdi_debug, 0, "Debug level"); #endif #define UFTDI_CONFIG_INDEX 0 -#define UFTDI_IFACE_INDEX_JTAG 0 /* * IO buffer sizes and FTDI device procotol sizes. @@ -273,645 +272,701 @@ MODULE_VERSION(uftdi, 1); static const STRUCT_USB_HOST_ID uftdi_devs[] = { #define UFTDI_DEV(v, p, i) \ { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } - UFTDI_DEV(ACTON, SPECTRAPRO, UFTDI_TYPE_AUTO), - UFTDI_DEV(ALTI2, N3, UFTDI_TYPE_AUTO), - UFTDI_DEV(ANALOGDEVICES, GNICE, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(ANALOGDEVICES, GNICEPLUS, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(ATMEL, STK541, UFTDI_TYPE_8U232AM), - UFTDI_DEV(BAYER, CONTOUR_CABLE, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, 232USB9M, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, 485USB9F_2W, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, 485USB9F_4W, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, 485USBTB_2W, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, 485USBTB_4W, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, TTL3USB9M, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, TTL5USB9M, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USO9ML2, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USO9ML2DR, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USO9ML2DR_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USOPTL4, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USOPTL4DR, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USOPTL4DR2, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USOTL4, UFTDI_TYPE_8U232AM), - UFTDI_DEV(BBELECTRONICS, USPTL4, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USTL4, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, ZZ_PROG1_USB, UFTDI_TYPE_AUTO), - UFTDI_DEV(CONTEC, COM1USBH, UFTDI_TYPE_AUTO), - UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, UFTDI_TYPE_8U232AM), - UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, UFTDI_TYPE_8U232AM), - UFTDI_DEV(DRESDENELEKTRONIK, LEVELSHIFTERSTICKLOWCOST, UFTDI_TYPE_8U232AM), - UFTDI_DEV(ELEKTOR, FT323R, UFTDI_TYPE_AUTO), - UFTDI_DEV(EVOLUTION, ER1, UFTDI_TYPE_AUTO), - UFTDI_DEV(EVOLUTION, HYBRID, UFTDI_TYPE_AUTO), - UFTDI_DEV(EVOLUTION, RCM4, UFTDI_TYPE_AUTO), - UFTDI_DEV(FALCOM, SAMBA, UFTDI_TYPE_AUTO), - UFTDI_DEV(FALCOM, TWIST, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FIC, NEO1973_DEBUG, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FIC, NEO1973_DEBUG, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, 232EX, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, 232H, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, 232RL, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, 4N_GALAXY_DE_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, 4N_GALAXY_DE_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, 4N_GALAXY_DE_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, 8U232AM_ALT, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ACCESSO, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ACG_HFDUAL, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ACTIVE_ROBOTS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ACTZWAVE, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, AMC232, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ARTEMIS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ASK_RDR400, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ATIK_ATK16, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ATIK_ATK16C, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ATIK_ATK16HR, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ATIK_ATK16HRC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ATIK_ATK16IC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, BCS_SE923, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, BEAGLEBONE, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, CANDAPTER, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CANUSB, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CCSICDU20_0, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CCSICDU40_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CCSICDU64_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CCSLOAD_N_GO_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CCSMACHX_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CCSPRIME8_5, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CFA_631, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, CFA_632, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, CFA_633, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, CFA_634, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, CFA_635, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, CHAMSYS_24_MASTER_WING, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CHAMSYS_MAXI_WING, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CHAMSYS_MEDIA_WING, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CHAMSYS_MIDI_TIMECODE, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CHAMSYS_MINI_WING, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CHAMSYS_PC_WING, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CHAMSYS_USB_DMX, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CHAMSYS_WING, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, COM4SM, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_0, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_5, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_6, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_7, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CTI_USB_MINI_485, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, CTI_USB_NANO_485, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, DMX4ALL, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, DOMINTELL_DGQG, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, DOMINTELL_DUSB, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, DOTEC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ECLO_COM_1WIRE, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ECO_PRO_CDS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, EISCOU, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, ELSTER_UNICOM, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_ALC8500, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_CLI7000, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_CSI8, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_EC3000, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_EM1000DL, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_EM1010PC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_FEM, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_FHZ1000PC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_FHZ1300PC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_FM3RX, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_FS20SIG, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_HS485, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_KL100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_MSM1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_PCD200, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_PCK100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_PPS7330, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_RFP500, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_T1100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_TFD128, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_TFM100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_TWS550, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UAD8, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UDA7, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UDF77, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UIO88, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_ULA200, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UM100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UMS100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UO100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UR100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_USI2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_USR, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UTP8, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_WS300PC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_WS444PC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_WS500, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_WS550, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_WS777, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_WS888, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, EMCU2D, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, EMCU2H, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, FUTURE_0, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, FUTURE_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, FUTURE_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GAMMASCOUT, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, GENERIC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E808, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E809, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E80A, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E80B, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E80C, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E80D, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E80E, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E80F, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E88D, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E88E, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E88F, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, HD_RADIO, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, HO720, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, HO730, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, HO820, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, HO870, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_APP70, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_PCMCIA, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_PEDO, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_PICPRO, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_PK1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_PROD, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_RS232MON, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_US485, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IPLUS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IPLUS2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IRTRANS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, KBS, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, KTLINK, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, LENZ_LIUSB, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, LK202, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, LK204, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, LM3S_DEVEL_BOARD, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, LM3S_EVAL_BOARD, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, LM3S_ICDI_B_BOARD, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, MASTERDEVEL2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MAXSTREAM, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, MHAM_DB9, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MHAM_IC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MHAM_KW, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MHAM_RS232, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MHAM_Y6, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MHAM_Y8, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MHAM_Y9, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MHAM_YS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MICRO_CHAMELEON, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MTXORB_5, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MTXORB_6, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MX2_3, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, MX4_5, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, NXTCAM, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, OCEANIC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, OOCDLINK, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, OPENDCC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, OPENDCC_GATEWAY, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, OPENDCC_GBM, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, OPENDCC_SNIFFER, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, OPENDCC_THROTTLE, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, PCDJ_DAC2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, PCMSFU, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, PERLE_ULTRAPORT, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, PHI_FISCO, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, PIEGROUP, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, PROPOX_JTAGCABLEII, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, R2000KU_TRUE_RNG, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, R2X0, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, RELAIS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, REU_TINY, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, RMP200, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, RM_CANVIEW, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, RRCIRKITS_LOCOBUFFER, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCIENCESCOPE_HS_LOGBOOK, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCIENCESCOPE_LOGBOOKML, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCIENCESCOPE_LS_LOGBOOK, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_0, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_5, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_6, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_7, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SDMUSBQSS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SEMC_DSS20, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, SERIAL_2232C, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, SERIAL_2232D, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, SERIAL_232RL, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SERIAL_4232H, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, SERIAL_8U100AX, UFTDI_TYPE_SIO), - UFTDI_DEV(FTDI, SERIAL_8U232AM, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, SERIAL_8U232AM4, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, SIGNALYZER_SH2, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, SIGNALYZER_SH4, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, SIGNALYZER_SLITE, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, SIGNALYZER_ST, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, SPECIAL_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SPECIAL_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SPECIAL_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SPROG_II, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SR_RADIO, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SUUNTO_SPORTS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13M, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13S, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13U, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, TAVIR_STK500, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, TERATRONIK_D2XX, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, TERATRONIK_VCP, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, THORLABS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, TNC_X, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, TTUSB, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, TURTELIZER2, UFTDI_TYPE_8U232AM | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, UOPTBR, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, USBSERIAL, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, USBX_707, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, USB_UIRT, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, USINT_CAT, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, USINT_RS232, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, USINT_WKEY, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, VARDAAN, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, VNHCPCUSB_D, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, WESTREX_MODEL_777, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, WESTREX_MODEL_8900F, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, XF_547, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, XF_640, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, XF_642, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, XM_RADIO, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, YEI_SERVOCENTER31, UFTDI_TYPE_AUTO), - UFTDI_DEV(GNOTOMETRICS, USB, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, SP1, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, OPC_U_UC, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP2C1, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP2C2, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP2D, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP2KVR, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP2KVT, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP2VR, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP2VT, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP4KVR, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP4KVT, UFTDI_TYPE_AUTO), - UFTDI_DEV(IDTECH, IDT1221U, UFTDI_TYPE_AUTO), - UFTDI_DEV(INTERBIOMETRICS, IOBOARD, UFTDI_TYPE_AUTO), - UFTDI_DEV(INTERBIOMETRICS, MINI_IOBOARD, UFTDI_TYPE_AUTO), - UFTDI_DEV(INTREPIDCS, NEOVI, UFTDI_TYPE_8U232AM), - UFTDI_DEV(INTREPIDCS, VALUECAN, UFTDI_TYPE_8U232AM), - UFTDI_DEV(IONICS, PLUGCOMPUTER, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(JETI, SPC1201, UFTDI_TYPE_AUTO), - UFTDI_DEV(KOBIL, CONV_B1, UFTDI_TYPE_AUTO), - UFTDI_DEV(KOBIL, CONV_KAAN, UFTDI_TYPE_AUTO), - UFTDI_DEV(LARSENBRUSGAARD, ALTITRACK, UFTDI_TYPE_AUTO), - UFTDI_DEV(MARVELL, SHEEVAPLUG, UFTDI_TYPE_8U232AM), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0100, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0101, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0102, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0103, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0104, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0105, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0106, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0107, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0108, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0109, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0110, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0111, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0112, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0113, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0114, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0115, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0116, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0117, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0118, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0119, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0120, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0121, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0122, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0123, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0124, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0125, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0126, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0128, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0129, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0130, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0131, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0132, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0133, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0134, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0135, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0136, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0137, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0138, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0139, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0140, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0141, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0142, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0143, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0144, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0145, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0146, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0147, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0148, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0149, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0150, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0151, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0152, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0159, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0160, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0161, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0162, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0163, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0164, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0165, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0166, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0167, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0168, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0169, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0170, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0171, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0172, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0173, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0174, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0175, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0176, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0177, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0178, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0179, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0180, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0181, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0182, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0183, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0184, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0185, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0186, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0187, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0188, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0189, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0190, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0191, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0192, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0193, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0194, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0195, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0196, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0197, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0198, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0199, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A0, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A1, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A2, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A3, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A4, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A5, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A6, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A7, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A8, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A9, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AA, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AB, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AC, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AD, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AE, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AF, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B0, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B1, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B2, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B3, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B4, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B5, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B6, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B7, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B8, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B9, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BA, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BB, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BC, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BD, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BE, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BF, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C0, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C1, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C2, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C3, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C4, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C5, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C6, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C7, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C8, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C9, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CA, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CB, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CC, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CD, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CE, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CF, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D0, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D1, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D2, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D3, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D4, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D5, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D6, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D7, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D8, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D9, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DA, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DB, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DC, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DD, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DE, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DF, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E0, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E1, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E2, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E3, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E4, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E5, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E6, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E7, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E8, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E9, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01EA, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01EB, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01EC, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01ED, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01EE, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01EF, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F0, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F1, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F2, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F3, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F4, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F5, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F6, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F7, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F8, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F9, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FA, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FB, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FC, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FD, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FE, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FF, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, MOUA, UFTDI_TYPE_8U232AM), - UFTDI_DEV(MELCO, PCOPRS1, UFTDI_TYPE_8U232AM), - UFTDI_DEV(METAGEEK, TELLSTICK, UFTDI_TYPE_AUTO), - UFTDI_DEV(MOBILITY, USB_SERIAL, UFTDI_TYPE_AUTO), - UFTDI_DEV(OLIMEX, ARM_USB_OCD, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(OLIMEX, ARM_USB_OCD_H, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(OPTO, CRD7734, UFTDI_TYPE_AUTO), - UFTDI_DEV(OPTO, CRD7734_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, AD4USB, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, AP485, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, AP485_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, DRAK5, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, DRAK6, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, GMSR, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, GMUX, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, IRAMP, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, LEC, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, MU, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO10X1, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO2X16, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO2X2, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO30X3, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO3X32, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO4X4, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO60X3, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO8X8, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SB232, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SB422, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SB422_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SB485, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SB485C, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SB485S, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SB485_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SIMUKEY, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, TMU, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, UPSUSB, UFTDI_TYPE_AUTO), - UFTDI_DEV(POSIFLEX, PP7000, UFTDI_TYPE_AUTO), - UFTDI_DEV(QIHARDWARE, JTAGSERIAL, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(RATOC, REXUSB60F, UFTDI_TYPE_8U232AM), - UFTDI_DEV(RTSYSTEMS, CT29B, UFTDI_TYPE_AUTO), - UFTDI_DEV(RTSYSTEMS, SERIAL_VX7, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2101, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2102, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2103, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2104, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2106, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2201_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2201_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2202_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2202_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2203_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2203_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2401_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2401_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2401_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2401_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2402_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2402_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2402_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2402_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2403_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2403_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2403_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2403_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_5, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_6, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_7, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_8, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_5, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_6, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_7, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_8, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_5, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_6, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_7, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_8, UFTDI_TYPE_AUTO), - UFTDI_DEV(SIIG2, DK201, UFTDI_TYPE_AUTO), - UFTDI_DEV(SIIG2, US2308, UFTDI_TYPE_8U232AM), - UFTDI_DEV(TESTO, USB_INTERFACE, UFTDI_TYPE_AUTO), - UFTDI_DEV(TML, USB_SERIAL, UFTDI_TYPE_AUTO), - UFTDI_DEV(TTI, QL355P, UFTDI_TYPE_AUTO), - UFTDI_DEV(UNKNOWN4, NF_RIC, UFTDI_TYPE_AUTO), + UFTDI_DEV(ACTON, SPECTRAPRO, 0), + UFTDI_DEV(ALTI2, N3, 0), + UFTDI_DEV(ANALOGDEVICES, GNICE, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(ANALOGDEVICES, GNICEPLUS, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(ATMEL, STK541, 0), + UFTDI_DEV(BAYER, CONTOUR_CABLE, 0), + UFTDI_DEV(BBELECTRONICS, 232USB9M, 0), + UFTDI_DEV(BBELECTRONICS, 485USB9F_2W, 0), + UFTDI_DEV(BBELECTRONICS, 485USB9F_4W, 0), + UFTDI_DEV(BBELECTRONICS, 485USBTB_2W, 0), + UFTDI_DEV(BBELECTRONICS, 485USBTB_4W, 0), + UFTDI_DEV(BBELECTRONICS, TTL3USB9M, 0), + UFTDI_DEV(BBELECTRONICS, TTL5USB9M, 0), + UFTDI_DEV(BBELECTRONICS, USO9ML2, 0), + UFTDI_DEV(BBELECTRONICS, USO9ML2DR, 0), + UFTDI_DEV(BBELECTRONICS, USO9ML2DR_2, 0), + UFTDI_DEV(BBELECTRONICS, USOPTL4, 0), + UFTDI_DEV(BBELECTRONICS, USOPTL4DR, 0), + UFTDI_DEV(BBELECTRONICS, USOPTL4DR2, 0), + UFTDI_DEV(BBELECTRONICS, USOTL4, 0), + UFTDI_DEV(BBELECTRONICS, USPTL4, 0), + UFTDI_DEV(BBELECTRONICS, USTL4, 0), + UFTDI_DEV(BBELECTRONICS, ZZ_PROG1_USB, 0), + UFTDI_DEV(CONTEC, COM1USBH, 0), + UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, 0), + UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, 0), + UFTDI_DEV(DRESDENELEKTRONIK, LEVELSHIFTERSTICKLOWCOST, 0), + UFTDI_DEV(ELEKTOR, FT323R, 0), + UFTDI_DEV(EVOLUTION, ER1, 0), + UFTDI_DEV(EVOLUTION, HYBRID, 0), + UFTDI_DEV(EVOLUTION, RCM4, 0), + UFTDI_DEV(FALCOM, SAMBA, 0), + UFTDI_DEV(FALCOM, TWIST, 0), + UFTDI_DEV(FIC, NEO1973_DEBUG, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FIC, NEO1973_DEBUG, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, 232EX, 0), + UFTDI_DEV(FTDI, 232H, 0), + UFTDI_DEV(FTDI, 232RL, 0), + UFTDI_DEV(FTDI, 4N_GALAXY_DE_1, 0), + UFTDI_DEV(FTDI, 4N_GALAXY_DE_2, 0), + UFTDI_DEV(FTDI, 4N_GALAXY_DE_3, 0), + UFTDI_DEV(FTDI, 8U232AM_ALT, 0), + UFTDI_DEV(FTDI, ACCESSO, 0), + UFTDI_DEV(FTDI, ACG_HFDUAL, 0), + UFTDI_DEV(FTDI, ACTIVE_ROBOTS, 0), + UFTDI_DEV(FTDI, ACTZWAVE, 0), + UFTDI_DEV(FTDI, AMC232, 0), + UFTDI_DEV(FTDI, ARTEMIS, 0), + UFTDI_DEV(FTDI, ASK_RDR400, 0), + UFTDI_DEV(FTDI, ATIK_ATK16, 0), + UFTDI_DEV(FTDI, ATIK_ATK16C, 0), + UFTDI_DEV(FTDI, ATIK_ATK16HR, 0), + UFTDI_DEV(FTDI, ATIK_ATK16HRC, 0), + UFTDI_DEV(FTDI, ATIK_ATK16IC, 0), + UFTDI_DEV(FTDI, BCS_SE923, 0), + UFTDI_DEV(FTDI, BEAGLEBONE, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, CANDAPTER, 0), + UFTDI_DEV(FTDI, CANUSB, 0), + UFTDI_DEV(FTDI, CCSICDU20_0, 0), + UFTDI_DEV(FTDI, CCSICDU40_1, 0), + UFTDI_DEV(FTDI, CCSICDU64_4, 0), + UFTDI_DEV(FTDI, CCSLOAD_N_GO_3, 0), + UFTDI_DEV(FTDI, CCSMACHX_2, 0), + UFTDI_DEV(FTDI, CCSPRIME8_5, 0), + UFTDI_DEV(FTDI, CFA_631, 0), + UFTDI_DEV(FTDI, CFA_632, 0), + UFTDI_DEV(FTDI, CFA_633, 0), + UFTDI_DEV(FTDI, CFA_634, 0), + UFTDI_DEV(FTDI, CFA_635, 0), + UFTDI_DEV(FTDI, CHAMSYS_24_MASTER_WING, 0), + UFTDI_DEV(FTDI, CHAMSYS_MAXI_WING, 0), + UFTDI_DEV(FTDI, CHAMSYS_MEDIA_WING, 0), + UFTDI_DEV(FTDI, CHAMSYS_MIDI_TIMECODE, 0), + UFTDI_DEV(FTDI, CHAMSYS_MINI_WING, 0), + UFTDI_DEV(FTDI, CHAMSYS_PC_WING, 0), + UFTDI_DEV(FTDI, CHAMSYS_USB_DMX, 0), + UFTDI_DEV(FTDI, CHAMSYS_WING, 0), + UFTDI_DEV(FTDI, COM4SM, 0), + UFTDI_DEV(FTDI, CONVERTER_0, 0), + UFTDI_DEV(FTDI, CONVERTER_1, 0), + UFTDI_DEV(FTDI, CONVERTER_2, 0), + UFTDI_DEV(FTDI, CONVERTER_3, 0), + UFTDI_DEV(FTDI, CONVERTER_4, 0), + UFTDI_DEV(FTDI, CONVERTER_5, 0), + UFTDI_DEV(FTDI, CONVERTER_6, 0), + UFTDI_DEV(FTDI, CONVERTER_7, 0), + UFTDI_DEV(FTDI, CTI_USB_MINI_485, 0), + UFTDI_DEV(FTDI, CTI_USB_NANO_485, 0), + UFTDI_DEV(FTDI, DMX4ALL, 0), + UFTDI_DEV(FTDI, DOMINTELL_DGQG, 0), + UFTDI_DEV(FTDI, DOMINTELL_DUSB, 0), + UFTDI_DEV(FTDI, DOTEC, 0), + UFTDI_DEV(FTDI, ECLO_COM_1WIRE, 0), + UFTDI_DEV(FTDI, ECO_PRO_CDS, 0), + UFTDI_DEV(FTDI, EISCOU, 0), + UFTDI_DEV(FTDI, ELSTER_UNICOM, 0), + UFTDI_DEV(FTDI, ELV_ALC8500, 0), + UFTDI_DEV(FTDI, ELV_CLI7000, 0), + UFTDI_DEV(FTDI, ELV_CSI8, 0), + UFTDI_DEV(FTDI, ELV_EC3000, 0), + UFTDI_DEV(FTDI, ELV_EM1000DL, 0), + UFTDI_DEV(FTDI, ELV_EM1010PC, 0), + UFTDI_DEV(FTDI, ELV_FEM, 0), + UFTDI_DEV(FTDI, ELV_FHZ1000PC, 0), + UFTDI_DEV(FTDI, ELV_FHZ1300PC, 0), + UFTDI_DEV(FTDI, ELV_FM3RX, 0), + UFTDI_DEV(FTDI, ELV_FS20SIG, 0), + UFTDI_DEV(FTDI, ELV_HS485, 0), + UFTDI_DEV(FTDI, ELV_KL100, 0), + UFTDI_DEV(FTDI, ELV_MSM1, 0), + UFTDI_DEV(FTDI, ELV_PCD200, 0), + UFTDI_DEV(FTDI, ELV_PCK100, 0), + UFTDI_DEV(FTDI, ELV_PPS7330, 0), + UFTDI_DEV(FTDI, ELV_RFP500, 0), + UFTDI_DEV(FTDI, ELV_T1100, 0), + UFTDI_DEV(FTDI, ELV_TFD128, 0), + UFTDI_DEV(FTDI, ELV_TFM100, 0), + UFTDI_DEV(FTDI, ELV_TWS550, 0), + UFTDI_DEV(FTDI, ELV_UAD8, 0), + UFTDI_DEV(FTDI, ELV_UDA7, 0), + UFTDI_DEV(FTDI, ELV_UDF77, 0), + UFTDI_DEV(FTDI, ELV_UIO88, 0), + UFTDI_DEV(FTDI, ELV_ULA200, 0), + UFTDI_DEV(FTDI, ELV_UM100, 0), + UFTDI_DEV(FTDI, ELV_UMS100, 0), + UFTDI_DEV(FTDI, ELV_UO100, 0), + UFTDI_DEV(FTDI, ELV_UR100, 0), + UFTDI_DEV(FTDI, ELV_USI2, 0), + UFTDI_DEV(FTDI, ELV_USR, 0), + UFTDI_DEV(FTDI, ELV_UTP8, 0), + UFTDI_DEV(FTDI, ELV_WS300PC, 0), + UFTDI_DEV(FTDI, ELV_WS444PC, 0), + UFTDI_DEV(FTDI, ELV_WS500, 0), + UFTDI_DEV(FTDI, ELV_WS550, 0), + UFTDI_DEV(FTDI, ELV_WS777, 0), + UFTDI_DEV(FTDI, ELV_WS888, 0), + UFTDI_DEV(FTDI, EMCU2D, 0), + UFTDI_DEV(FTDI, EMCU2H, 0), + UFTDI_DEV(FTDI, FUTURE_0, 0), + UFTDI_DEV(FTDI, FUTURE_1, 0), + UFTDI_DEV(FTDI, FUTURE_2, 0), + UFTDI_DEV(FTDI, GAMMASCOUT, 0), + UFTDI_DEV(FTDI, GENERIC, 0), + UFTDI_DEV(FTDI, GUDEADS_E808, 0), + UFTDI_DEV(FTDI, GUDEADS_E809, 0), + UFTDI_DEV(FTDI, GUDEADS_E80A, 0), + UFTDI_DEV(FTDI, GUDEADS_E80B, 0), + UFTDI_DEV(FTDI, GUDEADS_E80C, 0), + UFTDI_DEV(FTDI, GUDEADS_E80D, 0), + UFTDI_DEV(FTDI, GUDEADS_E80E, 0), + UFTDI_DEV(FTDI, GUDEADS_E80F, 0), + UFTDI_DEV(FTDI, GUDEADS_E88D, 0), + UFTDI_DEV(FTDI, GUDEADS_E88E, 0), + UFTDI_DEV(FTDI, GUDEADS_E88F, 0), + UFTDI_DEV(FTDI, HD_RADIO, 0), + UFTDI_DEV(FTDI, HO720, 0), + UFTDI_DEV(FTDI, HO730, 0), + UFTDI_DEV(FTDI, HO820, 0), + UFTDI_DEV(FTDI, HO870, 0), + UFTDI_DEV(FTDI, IBS_APP70, 0), + UFTDI_DEV(FTDI, IBS_PCMCIA, 0), + UFTDI_DEV(FTDI, IBS_PEDO, 0), + UFTDI_DEV(FTDI, IBS_PICPRO, 0), + UFTDI_DEV(FTDI, IBS_PK1, 0), + UFTDI_DEV(FTDI, IBS_PROD, 0), + UFTDI_DEV(FTDI, IBS_RS232MON, 0), + UFTDI_DEV(FTDI, IBS_US485, 0), + UFTDI_DEV(FTDI, IPLUS, 0), + UFTDI_DEV(FTDI, IPLUS2, 0), + UFTDI_DEV(FTDI, IRTRANS, 0), + UFTDI_DEV(FTDI, KBS, 0), + UFTDI_DEV(FTDI, KTLINK, 0), + UFTDI_DEV(FTDI, LENZ_LIUSB, 0), + UFTDI_DEV(FTDI, LK202, 0), + UFTDI_DEV(FTDI, LK204, 0), + UFTDI_DEV(FTDI, LM3S_DEVEL_BOARD, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, LM3S_EVAL_BOARD, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, LM3S_ICDI_B_BOARD, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, MASTERDEVEL2, 0), + UFTDI_DEV(FTDI, MAXSTREAM, 0), + UFTDI_DEV(FTDI, MHAM_DB9, 0), + UFTDI_DEV(FTDI, MHAM_IC, 0), + UFTDI_DEV(FTDI, MHAM_KW, 0), + UFTDI_DEV(FTDI, MHAM_RS232, 0), + UFTDI_DEV(FTDI, MHAM_Y6, 0), + UFTDI_DEV(FTDI, MHAM_Y8, 0), + UFTDI_DEV(FTDI, MHAM_Y9, 0), + UFTDI_DEV(FTDI, MHAM_YS, 0), + UFTDI_DEV(FTDI, MICRO_CHAMELEON, 0), + UFTDI_DEV(FTDI, MTXORB_5, 0), + UFTDI_DEV(FTDI, MTXORB_6, 0), + UFTDI_DEV(FTDI, MX2_3, 0), + UFTDI_DEV(FTDI, MX4_5, 0), + UFTDI_DEV(FTDI, NXTCAM, 0), + UFTDI_DEV(FTDI, OCEANIC, 0), + UFTDI_DEV(FTDI, OOCDLINK, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, OPENDCC, 0), + UFTDI_DEV(FTDI, OPENDCC_GATEWAY, 0), + UFTDI_DEV(FTDI, OPENDCC_GBM, 0), + UFTDI_DEV(FTDI, OPENDCC_SNIFFER, 0), + UFTDI_DEV(FTDI, OPENDCC_THROTTLE, 0), + UFTDI_DEV(FTDI, PCDJ_DAC2, 0), + UFTDI_DEV(FTDI, PCMSFU, 0), + UFTDI_DEV(FTDI, PERLE_ULTRAPORT, 0), + UFTDI_DEV(FTDI, PHI_FISCO, 0), + UFTDI_DEV(FTDI, PIEGROUP, 0), + UFTDI_DEV(FTDI, PROPOX_JTAGCABLEII, 0), + UFTDI_DEV(FTDI, R2000KU_TRUE_RNG, 0), + UFTDI_DEV(FTDI, R2X0, 0), + UFTDI_DEV(FTDI, RELAIS, 0), + UFTDI_DEV(FTDI, REU_TINY, 0), + UFTDI_DEV(FTDI, RMP200, 0), + UFTDI_DEV(FTDI, RM_CANVIEW, 0), + UFTDI_DEV(FTDI, RRCIRKITS_LOCOBUFFER, 0), + UFTDI_DEV(FTDI, SCIENCESCOPE_HS_LOGBOOK, 0), + UFTDI_DEV(FTDI, SCIENCESCOPE_LOGBOOKML, 0), + UFTDI_DEV(FTDI, SCIENCESCOPE_LS_LOGBOOK, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_0, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_1, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_2, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_3, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_4, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_5, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_6, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_7, 0), + UFTDI_DEV(FTDI, SDMUSBQSS, 0), + UFTDI_DEV(FTDI, SEMC_DSS20, 0), + UFTDI_DEV(FTDI, SERIAL_2232C, UFTDI_JTAG_CHECK_STRING), + UFTDI_DEV(FTDI, SERIAL_2232D, 0), + UFTDI_DEV(FTDI, SERIAL_232RL, 0), + UFTDI_DEV(FTDI, SERIAL_4232H, 0), + UFTDI_DEV(FTDI, SERIAL_8U100AX, 0), + UFTDI_DEV(FTDI, SERIAL_8U232AM, 0), + UFTDI_DEV(FTDI, SERIAL_8U232AM4, 0), + UFTDI_DEV(FTDI, SIGNALYZER_SH2, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, SIGNALYZER_SH4, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, SIGNALYZER_SLITE, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, SIGNALYZER_ST, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, SPECIAL_1, 0), + UFTDI_DEV(FTDI, SPECIAL_3, 0), + UFTDI_DEV(FTDI, SPECIAL_4, 0), + UFTDI_DEV(FTDI, SPROG_II, 0), + UFTDI_DEV(FTDI, SR_RADIO, 0), + UFTDI_DEV(FTDI, SUUNTO_SPORTS, 0), + UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13M, 0), + UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13S, 0), + UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13U, 0), + UFTDI_DEV(FTDI, TAVIR_STK500, 0), + UFTDI_DEV(FTDI, TERATRONIK_D2XX, 0), + UFTDI_DEV(FTDI, TERATRONIK_VCP, 0), + UFTDI_DEV(FTDI, THORLABS, 0), + UFTDI_DEV(FTDI, TNC_X, 0), + UFTDI_DEV(FTDI, TTUSB, 0), + UFTDI_DEV(FTDI, TURTELIZER2, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, UOPTBR, 0), + UFTDI_DEV(FTDI, USBSERIAL, 0), + UFTDI_DEV(FTDI, USBX_707, 0), + UFTDI_DEV(FTDI, USB_UIRT, 0), + UFTDI_DEV(FTDI, USINT_CAT, 0), + UFTDI_DEV(FTDI, USINT_RS232, 0), + UFTDI_DEV(FTDI, USINT_WKEY, 0), + UFTDI_DEV(FTDI, VARDAAN, 0), + UFTDI_DEV(FTDI, VNHCPCUSB_D, 0), + UFTDI_DEV(FTDI, WESTREX_MODEL_777, 0), + UFTDI_DEV(FTDI, WESTREX_MODEL_8900F, 0), + UFTDI_DEV(FTDI, XF_547, 0), + UFTDI_DEV(FTDI, XF_640, 0), + UFTDI_DEV(FTDI, XF_642, 0), + UFTDI_DEV(FTDI, XM_RADIO, 0), + UFTDI_DEV(FTDI, YEI_SERVOCENTER31, 0), + UFTDI_DEV(GNOTOMETRICS, USB, 0), + UFTDI_DEV(ICOM, SP1, 0), + UFTDI_DEV(ICOM, OPC_U_UC, 0), + UFTDI_DEV(ICOM, RP2C1, 0), + UFTDI_DEV(ICOM, RP2C2, 0), + UFTDI_DEV(ICOM, RP2D, 0), + UFTDI_DEV(ICOM, RP2KVR, 0), + UFTDI_DEV(ICOM, RP2KVT, 0), + UFTDI_DEV(ICOM, RP2VR, 0), + UFTDI_DEV(ICOM, RP2VT, 0), + UFTDI_DEV(ICOM, RP4KVR, 0), + UFTDI_DEV(ICOM, RP4KVT, 0), + UFTDI_DEV(IDTECH, IDT1221U, 0), + UFTDI_DEV(INTERBIOMETRICS, IOBOARD, 0), + UFTDI_DEV(INTERBIOMETRICS, MINI_IOBOARD, 0), + UFTDI_DEV(INTREPIDCS, NEOVI, 0), + UFTDI_DEV(INTREPIDCS, VALUECAN, 0), + UFTDI_DEV(IONICS, PLUGCOMPUTER, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(JETI, SPC1201, 0), + UFTDI_DEV(KOBIL, CONV_B1, 0), + UFTDI_DEV(KOBIL, CONV_KAAN, 0), + UFTDI_DEV(LARSENBRUSGAARD, ALTITRACK, 0), + UFTDI_DEV(MARVELL, SHEEVAPLUG, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0100, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0101, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0102, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0103, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0104, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0105, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0106, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0107, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0108, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0109, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010A, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010B, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010C, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010D, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010E, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010F, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0110, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0111, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0112, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0113, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0114, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0115, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0116, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0117, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0118, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0119, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011A, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011B, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011C, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011D, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011E, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011F, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0120, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0121, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0122, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0123, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0124, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0125, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0126, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0128, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0129, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012A, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012B, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012D, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012E, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012F, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0130, 0), *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 08:06:23 2014 Return-Path: Delivered-To: svn-src-all@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 2022AE11; Fri, 31 Oct 2014 08:06: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 E10A79FF; Fri, 31 Oct 2014 08:06:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9V86MiC067647; Fri, 31 Oct 2014 08:06:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V86LVG067643; Fri, 31 Oct 2014 08:06:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410310806.s9V86LVG067643@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 31 Oct 2014 08:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r273889 - stable/9/sys/dev/usb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 08:06:23 -0000 Author: hselasky Date: Fri Oct 31 08:06:21 2014 New Revision: 273889 URL: https://svnweb.freebsd.org/changeset/base/273889 Log: MFC r246360: Fix some nits. Modified: stable/9/sys/dev/usb/usb_dynamic.c stable/9/sys/dev/usb/usb_msctest.c stable/9/sys/dev/usb/usb_process.c stable/9/sys/dev/usb/usb_request.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/usb_dynamic.c ============================================================================== --- stable/9/sys/dev/usb/usb_dynamic.c Fri Oct 31 08:00:22 2014 (r273888) +++ stable/9/sys/dev/usb/usb_dynamic.c Fri Oct 31 08:06:21 2014 (r273889) @@ -64,7 +64,7 @@ usb_temp_setup_by_index_t *usb_temp_setu usb_temp_unsetup_t *usb_temp_unsetup_p = &usb_temp_unsetup_w; usb_test_quirk_t *usb_test_quirk_p = &usb_test_quirk_w; usb_quirk_ioctl_t *usb_quirk_ioctl_p = &usb_quirk_ioctl_w; -devclass_t usb_devclass_ptr = NULL; +devclass_t usb_devclass_ptr; static usb_error_t usb_temp_setup_by_index_w(struct usb_device *udev, uint16_t index) Modified: stable/9/sys/dev/usb/usb_msctest.c ============================================================================== --- stable/9/sys/dev/usb/usb_msctest.c Fri Oct 31 08:00:22 2014 (r273888) +++ stable/9/sys/dev/usb/usb_msctest.c Fri Oct 31 08:06:21 2014 (r273889) @@ -839,7 +839,7 @@ usb_msc_eject(struct usb_device *udev, u sizeof(scsi_tct_eject), USB_MS_HZ); break; default: - printf("usb_msc_eject: unknown eject method (%d)\n", method); + DPRINTF("Unknown eject method (%d)\n", method); break; } DPRINTF("Eject CD command status: %s\n", usbd_errstr(err)); Modified: stable/9/sys/dev/usb/usb_process.c ============================================================================== --- stable/9/sys/dev/usb/usb_process.c Fri Oct 31 08:00:22 2014 (r273888) +++ stable/9/sys/dev/usb/usb_process.c Fri Oct 31 08:06:21 2014 (r273889) @@ -24,8 +24,6 @@ * SUCH DAMAGE. */ -#define USB_DEBUG_VAR usb_proc_debug - #include #include #include @@ -49,6 +47,8 @@ #include #include #include + +#define USB_DEBUG_VAR usb_proc_debug #include #include Modified: stable/9/sys/dev/usb/usb_request.c ============================================================================== --- stable/9/sys/dev/usb/usb_request.c Fri Oct 31 08:00:22 2014 (r273888) +++ stable/9/sys/dev/usb/usb_request.c Fri Oct 31 08:06:21 2014 (r273889) @@ -804,8 +804,6 @@ usbd_req_reset_port(struct usb_device *u /* check for errors */ if (err) goto done; -#ifdef USB_DEBUG -#endif n = 0; while (1) { /* wait for the device to recover from reset */ From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 08:10:28 2014 Return-Path: Delivered-To: svn-src-all@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 30B8FDA; Fri, 31 Oct 2014 08:10: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 01AA3A2F; Fri, 31 Oct 2014 08:10: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 s9V8ARsv071228; Fri, 31 Oct 2014 08:10:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V8ARO6071225; Fri, 31 Oct 2014 08:10:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410310810.s9V8ARO6071225@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 31 Oct 2014 08:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r273890 - stable/9/sys/dev/usb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 08:10:28 -0000 Author: hselasky Date: Fri Oct 31 08:10:26 2014 New Revision: 273890 URL: https://svnweb.freebsd.org/changeset/base/273890 Log: MFC r250986: Fix some statical clang analyzer warnings. Modified: stable/9/sys/dev/usb/usb_device.c stable/9/sys/dev/usb/usb_hub.c stable/9/sys/dev/usb/usb_msctest.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/usb_device.c ============================================================================== --- stable/9/sys/dev/usb/usb_device.c Fri Oct 31 08:06:21 2014 (r273889) +++ stable/9/sys/dev/usb/usb_device.c Fri Oct 31 08:10:26 2014 (r273890) @@ -845,9 +845,6 @@ usb_config_parse(struct usb_device *udev /* find maximum number of endpoints */ if (ep_max < temp) ep_max = temp; - - /* optimalisation */ - id = (struct usb_interface_descriptor *)ed; } } Modified: stable/9/sys/dev/usb/usb_hub.c ============================================================================== --- stable/9/sys/dev/usb/usb_hub.c Fri Oct 31 08:06:21 2014 (r273889) +++ stable/9/sys/dev/usb/usb_hub.c Fri Oct 31 08:10:26 2014 (r273890) @@ -601,7 +601,6 @@ uhub_reattach_port(struct uhub_softc *sc DPRINTF("reattaching port %d\n", portno); - err = 0; timeout = 0; udev = sc->sc_udev; child = usb_bus_port_get_device(udev->bus, Modified: stable/9/sys/dev/usb/usb_msctest.c ============================================================================== --- stable/9/sys/dev/usb/usb_msctest.c Fri Oct 31 08:06:21 2014 (r273889) +++ stable/9/sys/dev/usb/usb_msctest.c Fri Oct 31 08:10:26 2014 (r273890) @@ -798,7 +798,6 @@ usb_msc_eject(struct usb_device *udev, u if (sc == NULL) return (USB_ERR_INVAL); - err = 0; switch (method) { case MSC_EJECT_STOPUNIT: err = bbb_command_start(sc, DIR_IN, 0, NULL, 0, @@ -840,6 +839,7 @@ usb_msc_eject(struct usb_device *udev, u break; default: DPRINTF("Unknown eject method (%d)\n", method); + err = 0; break; } DPRINTF("Eject CD command status: %s\n", usbd_errstr(err)); From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 08:12:06 2014 Return-Path: Delivered-To: svn-src-all@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 C5825238; Fri, 31 Oct 2014 08:12: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 A5913AC3; Fri, 31 Oct 2014 08:12: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 s9V8C6cg071982; Fri, 31 Oct 2014 08:12:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V8C5dj071974; Fri, 31 Oct 2014 08:12:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410310812.s9V8C5dj071974@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 31 Oct 2014 08:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r273891 - in stable/9/sys/dev/usb: . quirk serial X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 08:12:07 -0000 Author: hselasky Date: Fri Oct 31 08:12:04 2014 New Revision: 273891 URL: https://svnweb.freebsd.org/changeset/base/273891 Log: MFC r269575, r269576 and r269578: - Add a second Huawei SCSI eject command as USB mode switch config files sometimes use one or the other. Maybe newer Huawei modems switched. - Return USB_ERR_INVAL if the eject method is not known. PR: 145319 Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c stable/9/sys/dev/usb/quirk/usb_quirk.h stable/9/sys/dev/usb/serial/u3g.c stable/9/sys/dev/usb/usb_msctest.c stable/9/sys/dev/usb/usb_msctest.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/9/sys/dev/usb/quirk/usb_quirk.c Fri Oct 31 08:10:26 2014 (r273890) +++ stable/9/sys/dev/usb/quirk/usb_quirk.c Fri Oct 31 08:12:04 2014 (r273891) @@ -565,6 +565,7 @@ static const char *usb_quirk_str[USB_QUI [UQ_MSC_EJECT_WAIT] = "UQ_MSC_EJECT_WAIT", [UQ_MSC_EJECT_SAEL_M460] = "UQ_MSC_EJECT_SAEL_M460", [UQ_MSC_EJECT_HUAWEISCSI] = "UQ_MSC_EJECT_HUAWEISCSI", + [UQ_MSC_EJECT_HUAWEISCSI2] = "UQ_MSC_EJECT_HUAWEISCSI2", [UQ_MSC_EJECT_TCT] = "UQ_MSC_EJECT_TCT", [UQ_BAD_MIDI] = "UQ_BAD_MIDI", [UQ_AU_VENDOR_CLASS] = "UQ_AU_VENDOR_CLASS", Modified: stable/9/sys/dev/usb/quirk/usb_quirk.h ============================================================================== --- stable/9/sys/dev/usb/quirk/usb_quirk.h Fri Oct 31 08:10:26 2014 (r273890) +++ stable/9/sys/dev/usb/quirk/usb_quirk.h Fri Oct 31 08:12:04 2014 (r273891) @@ -103,6 +103,7 @@ enum { UQ_MSC_EJECT_WAIT, /* wait for the device to eject */ UQ_MSC_EJECT_SAEL_M460, /* ejects after Sael USB commands */ UQ_MSC_EJECT_HUAWEISCSI, /* ejects after Huawei SCSI command */ + UQ_MSC_EJECT_HUAWEISCSI2, /* ejects after Huawei SCSI 2 command */ UQ_MSC_EJECT_TCT, /* ejects after TCT SCSI command */ UQ_BAD_MIDI, /* device claims MIDI class, but isn't */ Modified: stable/9/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/9/sys/dev/usb/serial/u3g.c Fri Oct 31 08:10:26 2014 (r273890) +++ stable/9/sys/dev/usb/serial/u3g.c Fri Oct 31 08:12:04 2014 (r273891) @@ -88,7 +88,8 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, #define U3GINIT_WAIT 7 /* Device reappears after a delay */ #define U3GINIT_SAEL_M460 8 /* Requires vendor init */ #define U3GINIT_HUAWEISCSI 9 /* Requires Huawei SCSI init command */ -#define U3GINIT_TCT 10 /* Requires TCT Mobile init command */ +#define U3GINIT_HUAWEISCSI2 10 /* Requires Huawei SCSI init command (2) */ +#define U3GINIT_TCT 11 /* Requires TCT Mobile init command */ enum { U3G_BULK_WR, @@ -725,6 +726,8 @@ u3g_test_autoinst(void *arg, struct usb_ method = U3GINIT_WAIT; else if (usb_test_quirk(uaa, UQ_MSC_EJECT_HUAWEISCSI)) method = U3GINIT_HUAWEISCSI; + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_HUAWEISCSI2)) + method = U3GINIT_HUAWEISCSI2; else if (usb_test_quirk(uaa, UQ_MSC_EJECT_TCT)) method = U3GINIT_TCT; else if (usbd_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa) == 0) @@ -745,6 +748,9 @@ u3g_test_autoinst(void *arg, struct usb_ case U3GINIT_HUAWEISCSI: error = usb_msc_eject(udev, 0, MSC_EJECT_HUAWEI); break; + case U3GINIT_HUAWEISCSI2: + error = usb_msc_eject(udev, 0, MSC_EJECT_HUAWEI2); + break; case U3GINIT_SCSIEJECT: error = usb_msc_eject(udev, 0, MSC_EJECT_STOPUNIT); break; Modified: stable/9/sys/dev/usb/usb_msctest.c ============================================================================== --- stable/9/sys/dev/usb/usb_msctest.c Fri Oct 31 08:10:26 2014 (r273890) +++ stable/9/sys/dev/usb/usb_msctest.c Fri Oct 31 08:12:04 2014 (r273891) @@ -98,6 +98,9 @@ static uint8_t scsi_cmotech_eject[] = static uint8_t scsi_huawei_eject[] = { 0x11, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static uint8_t scsi_huawei_eject2[] = { 0x11, 0x06, 0x20, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }; static uint8_t scsi_tct_eject[] = { 0x06, 0xf5, 0x04, 0x02, 0x52, 0x70 }; static uint8_t scsi_sync_cache[] = { 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; @@ -477,6 +480,7 @@ bbb_command_start(struct bbb_transfer *s sc->data_rem = data_len; sc->data_timeout = (data_timeout + USB_MS_HZ); sc->actlen = 0; + sc->error = 0; sc->cmd_len = cmd_len; memset(&sc->cbw->CBWCDB, 0, sizeof(sc->cbw->CBWCDB)); memcpy(&sc->cbw->CBWCDB, cmd_ptr, cmd_len); @@ -828,6 +832,11 @@ usb_msc_eject(struct usb_device *udev, u &scsi_huawei_eject, sizeof(scsi_huawei_eject), USB_MS_HZ); break; + case MSC_EJECT_HUAWEI2: + err = bbb_command_start(sc, DIR_IN, 0, NULL, 0, + &scsi_huawei_eject2, sizeof(scsi_huawei_eject2), + USB_MS_HZ); + break; case MSC_EJECT_TCT: /* * TCTMobile needs DIR_IN flag. To get it, we @@ -839,9 +848,10 @@ usb_msc_eject(struct usb_device *udev, u break; default: DPRINTF("Unknown eject method (%d)\n", method); - err = 0; - break; + bbb_detach(sc); + return (USB_ERR_INVAL); } + DPRINTF("Eject CD command status: %s\n", usbd_errstr(err)); bbb_detach(sc); Modified: stable/9/sys/dev/usb/usb_msctest.h ============================================================================== --- stable/9/sys/dev/usb/usb_msctest.h Fri Oct 31 08:10:26 2014 (r273890) +++ stable/9/sys/dev/usb/usb_msctest.h Fri Oct 31 08:12:04 2014 (r273891) @@ -33,6 +33,7 @@ enum { MSC_EJECT_ZTESTOR, MSC_EJECT_CMOTECH, MSC_EJECT_HUAWEI, + MSC_EJECT_HUAWEI2, MSC_EJECT_TCT, }; From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 08:14:15 2014 Return-Path: Delivered-To: svn-src-all@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 5F813390; Fri, 31 Oct 2014 08:14: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 40020AD9; Fri, 31 Oct 2014 08:14: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 s9V8EF6b072357; Fri, 31 Oct 2014 08:14:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V8EEPY072354; Fri, 31 Oct 2014 08:14:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410310814.s9V8EEPY072354@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 31 Oct 2014 08:14:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r273892 - in stable/9/sys/dev/usb: . serial X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 08:14:15 -0000 Author: hselasky Date: Fri Oct 31 08:14:13 2014 New Revision: 273892 URL: https://svnweb.freebsd.org/changeset/base/273892 Log: MFC r264801, r264802, r264934, r273181, r273216 and r273252: Add more USB IDs. Modified: stable/9/sys/dev/usb/serial/u3g.c stable/9/sys/dev/usb/serial/uftdi.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/9/sys/dev/usb/serial/u3g.c Fri Oct 31 08:12:04 2014 (r273891) +++ stable/9/sys/dev/usb/serial/u3g.c Fri Oct 31 08:14:13 2014 (r273892) @@ -317,6 +317,8 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(HUAWEI, MOBILE, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E1752, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, E1820, U3GINIT_HUAWEISCSI), + U3G_DEV(HUAWEI, K3772, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, K3772_INIT, U3GINIT_HUAWEISCSI2), U3G_DEV(HUAWEI, K3765, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, K3765_INIT, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, K3770, U3GINIT_HUAWEI), @@ -466,7 +468,8 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QUALCOMMINC, SURFSTICK, 0), U3G_DEV(QUALCOMMINC, E2002, 0), U3G_DEV(QUALCOMMINC, E2003, 0), - U3G_DEV(QUALCOMMINC, K3772_Z, U3GINIT_SCSIEJECT), + U3G_DEV(QUALCOMMINC, K3772_Z, 0), + U3G_DEV(QUALCOMMINC, K3772_Z_INIT, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMMINC, MF626, 0), U3G_DEV(QUALCOMMINC, MF628, 0), U3G_DEV(QUALCOMMINC, MF633R, 0), Modified: stable/9/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/9/sys/dev/usb/serial/uftdi.c Fri Oct 31 08:12:04 2014 (r273891) +++ stable/9/sys/dev/usb/serial/uftdi.c Fri Oct 31 08:14:13 2014 (r273892) @@ -298,6 +298,7 @@ static const STRUCT_USB_HOST_ID uftdi_de UFTDI_DEV(CONTEC, COM1USBH, 0), UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, 0), UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, 0), + UFTDI_DEV(DRESDENELEKTRONIK, DE_RFNODE, 0), UFTDI_DEV(DRESDENELEKTRONIK, LEVELSHIFTERSTICKLOWCOST, 0), UFTDI_DEV(ELEKTOR, FT323R, 0), UFTDI_DEV(EVOLUTION, ER1, 0), @@ -327,7 +328,6 @@ static const STRUCT_USB_HOST_ID uftdi_de UFTDI_DEV(FTDI, ATIK_ATK16HRC, 0), UFTDI_DEV(FTDI, ATIK_ATK16IC, 0), UFTDI_DEV(FTDI, BCS_SE923, 0), - UFTDI_DEV(FTDI, BEAGLEBONE, UFTDI_JTAG_IFACE(0)), UFTDI_DEV(FTDI, CANDAPTER, 0), UFTDI_DEV(FTDI, CANUSB, 0), UFTDI_DEV(FTDI, CCSICDU20_0, 0), @@ -537,6 +537,8 @@ static const STRUCT_USB_HOST_ID uftdi_de UFTDI_DEV(FTDI, VNHCPCUSB_D, 0), UFTDI_DEV(FTDI, WESTREX_MODEL_777, 0), UFTDI_DEV(FTDI, WESTREX_MODEL_8900F, 0), + UFTDI_DEV(FTDI, XDS100V2, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, XDS100V3, UFTDI_JTAG_IFACE(0)), UFTDI_DEV(FTDI, XF_547, 0), UFTDI_DEV(FTDI, XF_640, 0), UFTDI_DEV(FTDI, XF_642, 0), Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Fri Oct 31 08:12:04 2014 (r273891) +++ stable/9/sys/dev/usb/usbdevs Fri Oct 31 08:14:13 2014 (r273892) @@ -713,6 +713,7 @@ vendor LONGCHEER 0x1c9e Longcheer Holdin vendor MPMAN 0x1cae MpMan vendor DRESDENELEKTRONIK 0x1cf1 dresden elektronik vendor NEOTEL 0x1d09 Neotel +vendor DREAMLINK 0x1d34 Dream Link vendor PEGATRON 0x1d4d Pegatron vendor QISDA 0x1da5 Qisda vendor METAGEEK2 0x1dd5 MetaGeek @@ -1173,6 +1174,7 @@ product ASIX AX88772B_1 0x7e2b AX88772B /* ASUS products */ product ASUS2 USBN11 0x0b05 USB-N11 +product ASUS RT2570 0x1706 RT2500USB Wireless Adapter product ASUS WL167G 0x1707 WL-167g Wireless Adapter product ASUS WL159G 0x170c WL-159g product ASUS A9T_WIFI 0x171b A9T wireless @@ -1186,16 +1188,17 @@ product ASUS RT2870_3 0x1742 RT2870 product ASUS RT2870_4 0x1760 RT2870 product ASUS RT2870_5 0x1761 RT2870 product ASUS USBN13 0x1784 USB-N13 -product ASUS RT3070_1 0x1790 RT3070 product ASUS USBN10 0x1786 USB-N10 +product ASUS RT3070_1 0x1790 RT3070 +product ASUS RTL8192SU 0x1791 RTL8192SU +product ASUS USB_N53 0x179d ASUS Black Diamond Dual Band USB-N53 product ASUS RTL8192CU 0x17ab RTL8192CU product ASUS USBN66 0x17ad USB-N66 -product ASUS RTL8192SU 0x1791 RTL8192SU +product ASUS USBN10NANO 0x17ba USB-N10 Nano +product ASUS USBAC51 0x17d1 USB-AC51 product ASUS A730W 0x4202 ASUS MyPal A730W product ASUS P535 0x420f ASUS P535 PDA -product ASUS GMSC 0x422f ASUS Generic Mass Storage -product ASUS RT2570 0x1706 RT2500USB Wireless Adapter -product ASUS USB_N53 0x179d ASUS Black Diamond Dual Band USB-N53 +product ASUS GMSC 0x422f ASUS Generic Mass Storage /* ATen products */ product ATEN UC1284 0x2001 Parallel printer @@ -1378,6 +1381,7 @@ product CHIC CYPRESS 0x0003 Cypress USB product CHICONY KB8933 0x0001 KB-8933 keyboard product CHICONY KU0325 0x0116 KU-0325 keyboard product CHICONY CNF7129 0xb071 Notebook Web Camera +product CHICONY HDUVCCAM 0xb40a HD UVC WebCam product CHICONY RTL8188CUS_1 0xaff7 RTL8188CUS product CHICONY RTL8188CUS_2 0xaff8 RTL8188CUS product CHICONY RTL8188CUS_3 0xaff9 RTL8188CUS @@ -1591,6 +1595,7 @@ product DLINK DUBE100 0x1a00 10/100 Eth product DLINK DUBE100C1 0x1a02 DUB-E100 rev C1 product DLINK DSB650TX4 0x200c 10/100 Ethernet product DLINK DWL120E 0x3200 DWL-120 rev E +product DLINK DWA125D1 0x330f DWA-125 rev D1 product DLINK DWL122 0x3700 DWL-122 product DLINK DWLG120 0x3701 DWL-G120 product DLINK DWL120F 0x3702 DWL-120 rev F @@ -1653,9 +1658,13 @@ product DMI DISK 0x2bcf Generic Disk /* DrayTek products */ product DRAYTEK VIGOR550 0x0550 Vigor550 +/* Dream Link products */ +product DREAMLINK DL100B 0x0004 USB Webmail Notifier + /* dresden elektronik products */ product DRESDENELEKTRONIK SENSORTERMINALBOARD 0x0001 SensorTerminalBoard product DRESDENELEKTRONIK WIRELESSHANDHELDTERMINAL 0x0004 Wireless Handheld Terminal +product DRESDENELEKTRONIK DE_RFNODE 0x001c deRFnode product DRESDENELEKTRONIK LEVELSHIFTERSTICKLOWCOST 0x0022 Levelshifter Stick Low Cost /* Dynastream Innovations */ @@ -1844,7 +1853,8 @@ product FTDI 232H 0x6014 FTDI compatibl product FTDI 232EX 0x6015 FTDI compatible adapter product FTDI SERIAL_2232D 0x9e90 FT2232D Dual port Serial product FTDI SERIAL_4232H 0x6011 FT4232H Quad port Serial -product FTDI BEAGLEBONE 0xa6d0 BeagleBone +product FTDI XDS100V2 0xa6d0 TI XDS100V1/V2 and early Beaglebones +product FTDI XDS100V3 0xa6d1 TI XDS100V3 product FTDI KTLINK 0xbbe2 KT-LINK Embedded Hackers Multitool product FTDI TURTELIZER2 0xbdc8 egnite Turtelizer 2 JTAG/RS232 Adapter /* Gude Analog- und Digitalsysteme products also uses FTDI's id: */ @@ -2337,15 +2347,21 @@ product HUAWEI K4505 0x1464 3G modem product HUAWEI K3765 0x1465 3G modem product HUAWEI E1820 0x14ac E1820 HSPA+ USB Slider product HUAWEI K3770 0x14c9 3G modem +product HUAWEI K3772 0x14cf K3772 product HUAWEI K3770_INIT 0x14d1 K3770 Initial product HUAWEI E3131_INIT 0x14fe 3G modem initial product HUAWEI E392 0x1505 LTE modem product HUAWEI E3131 0x1506 3G modem product HUAWEI K3765_INIT 0x1520 K3765 Initial product HUAWEI K4505_INIT 0x1521 K4505 Initial +product HUAWEI K3772_INIT 0x1526 K3772 Initial +product HUAWEI E3272_INIT 0x155b LTE modem initial +product HUAWEI R215_INIT 0x1582 LTE modem initial +product HUAWEI R215 0x1588 LTE modem product HUAWEI ETS2055 0x1803 CDMA modem product HUAWEI E173 0x1c05 3G modem product HUAWEI E173_INIT 0x1c0b 3G modem initial +product HUAWEI E3272 0x1c1e LTE modem /* HUAWEI 3com products */ product HUAWEI3COM WUB320G 0x0009 Aolynk WUB320g @@ -3232,6 +3248,7 @@ product NOVATEL EU740 0x2410 Expedite E product NOVATEL EU870D 0x2420 Expedite EU870D product NOVATEL U727 0x4100 Merlin U727 CDMA product NOVATEL MC950D 0x4400 Novatel MC950D HSUPA +product NOVATEL MC990D 0x7001 Novatel MC990D product NOVATEL ZEROCD 0x5010 Novatel ZeroCD product NOVATEL MIFI2200V 0x5020 Novatel MiFi 2200 CDMA Virgin Mobile product NOVATEL ZEROCD2 0x5030 Novatel ZeroCD @@ -3621,7 +3638,8 @@ product QUALCOMMINC E0078 0x0078 3G mode product QUALCOMMINC E0082 0x0082 3G modem product QUALCOMMINC E0086 0x0086 3G modem product QUALCOMMINC SURFSTICK 0x0117 1&1 Surf Stick -product QUALCOMMINC K3772_Z 0x1179 3G modem +product QUALCOMMINC K3772_Z_INIT 0x1179 K3772-Z Initial +product QUALCOMMINC K3772_Z 0x1181 K3772-Z product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage product QUALCOMMINC E2002 0x2002 3G modem product QUALCOMMINC E2003 0x2003 3G modem @@ -3681,6 +3699,7 @@ product RATOC REXUSB60F 0xb020 USB seri /* Green House and CompUSA OEM this part */ product REALTEK DUMMY 0x0000 Dummy product product REALTEK USB20CRW 0x0158 USB20CRW Card Reader +product REALTEK RTL8188ETV 0x0179 RTL8188ETV product REALTEK RTL8188CTV 0x018a RTL8188CTV product REALTEK USBKR100 0x8150 USBKR100 USB Ethernet product REALTEK RTL8188CE_0 0x8170 RTL8188CE @@ -3704,6 +3723,7 @@ product REALTEK RTL8191CU 0x8177 RTL8191 product REALTEK RTL8192CU 0x8178 RTL8192CU product REALTEK RTL8192CE 0x817c RTL8192CE product REALTEK RTL8188RU_1 0x817d RTL8188RU +product REALTEK RTL8188RU_3 0x817f RTL8188RU product REALTEK RTL8712 0x8712 RTL8712 product REALTEK RTL8713 0x8712 RTL8713 product REALTEK RTL8188RU_2 0x317f RTL8188RU @@ -4122,6 +4142,23 @@ product SMC 2862WG 0xee13 EZ Connect Wi product SMC2 2020HUB 0x2020 USB Hub product SMC2 2514HUB 0x2514 USB Hub product SMC3 2662WUSB 0xa002 2662W-AR Wireless +product SMC2 LAN9500_ETH 0x9500 USB/Ethernet +product SMC2 LAN9505_ETH 0x9505 USB/Ethernet +product SMC2 LAN9530_ETH 0x9530 USB/Ethernet +product SMC2 LAN9730_ETH 0x9730 USB/Ethernet +product SMC2 LAN9500_SAL10 0x9900 USB/Ethernet +product SMC2 LAN9505_SAL10 0x9901 USB/Ethernet +product SMC2 LAN9500A_SAL10 0x9902 USB/Ethernet +product SMC2 LAN9505A_SAL10 0x9903 USB/Ethernet +product SMC2 LAN9514_SAL10 0x9904 USB/Ethernet +product SMC2 LAN9500A_HAL 0x9905 USB/Ethernet +product SMC2 LAN9505A_HAL 0x9906 USB/Ethernet +product SMC2 LAN9500_ETH_2 0x9907 USB/Ethernet +product SMC2 LAN9500A_ETH_2 0x9908 USB/Ethernet +product SMC2 LAN9514_ETH_2 0x9909 USB/Ethernet +product SMC2 LAN9500A_ETH 0x9e00 USB/Ethernet +product SMC2 LAN9505A_ETH 0x9e01 USB/Ethernet +product SMC2 LAN89530_ETH 0x9e08 USB/Ethernet product SMC2 LAN9514_ETH 0xec00 USB/Ethernet /* SOHOware products */ @@ -4543,5 +4580,6 @@ product ZYXEL G220V2 0x340f G-220 v2 product ZYXEL G202 0x3410 G-202 product ZYXEL RT2870_1 0x3416 RT2870 product ZYXEL RT2870_2 0x341a RT2870 +product ZYXEL RT3070 0x341e NWD2105 product ZYXEL RTL8192CU 0x341f RTL8192CU product ZYXEL NWD2705 0x3421 NWD2705 From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 09:16:00 2014 Return-Path: Delivered-To: svn-src-all@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 D8A71478; Fri, 31 Oct 2014 09:16: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 AA7C7D6; Fri, 31 Oct 2014 09:16: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 s9V9G0tN001506; Fri, 31 Oct 2014 09:16:00 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V9G0VT001505; Fri, 31 Oct 2014 09:16:00 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410310916.s9V9G0VT001505@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 31 Oct 2014 09:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273893 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 09:16:01 -0000 Author: mjg Date: Fri Oct 31 09:15:59 2014 New Revision: 273893 URL: https://svnweb.freebsd.org/changeset/base/273893 Log: filedesc: tidy up fdfree Implement fdefree_last variant and get rid of 'last' parameter. No functional changes. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Oct 31 08:14:13 2014 (r273892) +++ head/sys/kern/kern_descrip.c Fri Oct 31 09:15:59 2014 (r273893) @@ -291,18 +291,22 @@ fdunused(struct filedesc *fdp, int fd) * Avoid some work if fdp is about to be destroyed. */ static inline void -_fdfree(struct filedesc *fdp, int fd, int last) +fdefree_last(struct filedescent *fde) +{ + + filecaps_free(&fde->fde_caps); +} + +static inline void +fdfree(struct filedesc *fdp, int fd) { struct filedescent *fde; fde = &fdp->fd_ofiles[fd]; #ifdef CAPABILITIES - if (!last) - seq_write_begin(&fde->fde_seq); + seq_write_begin(&fde->fde_seq); #endif - filecaps_free(&fde->fde_caps); - if (last) - return; + fdefree_last(fde); bzero(fde, fde_change_size); fdunused(fdp, fd); #ifdef CAPABILITIES @@ -310,20 +314,6 @@ _fdfree(struct filedesc *fdp, int fd, in #endif } -static inline void -fdfree(struct filedesc *fdp, int fd) -{ - - _fdfree(fdp, fd, 0); -} - -static inline void -fdfree_last(struct filedesc *fdp, int fd) -{ - - _fdfree(fdp, fd, 1); -} - /* * System calls on descriptors. */ @@ -1956,6 +1946,7 @@ fdescfree(struct thread *td) struct filedesc *fdp; int i; struct filedesc_to_leader *fdtol; + struct filedescent *fde; struct file *fp; struct vnode *cdir, *jdir, *rdir, *vp; struct flock lf; @@ -2055,9 +2046,10 @@ fdescfree(struct thread *td) FILEDESC_XUNLOCK(fdp); for (i = 0; i <= fdp->fd_lastfile; i++) { - fp = fdp->fd_ofiles[i].fde_file; + fde = &fdp->fd_ofiles[i]; + fp = fde->fde_file; if (fp != NULL) { - fdfree_last(fdp, i); + fdefree_last(fde); (void) closef(fp, td); } } From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 09:19:47 2014 Return-Path: Delivered-To: svn-src-all@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 D89F26C7; Fri, 31 Oct 2014 09:19: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 AAB25100; Fri, 31 Oct 2014 09:19: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 s9V9JlXx002154; Fri, 31 Oct 2014 09:19:47 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V9JlOd002153; Fri, 31 Oct 2014 09:19:47 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410310919.s9V9JlOd002153@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 31 Oct 2014 09:19:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273894 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 09:19:48 -0000 Author: mjg Date: Fri Oct 31 09:19:46 2014 New Revision: 273894 URL: https://svnweb.freebsd.org/changeset/base/273894 Log: filedesc: iterate over fd table only once in fdcopy While here add 'fdused_init' which does not perform unnecessary work. Drop FILEDESC_LOCK_ASSERT from fdisused and rely on callers to hold it when appropriate. This function is only used with INVARIANTS. No functional changes intended. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Oct 31 09:15:59 2014 (r273893) +++ head/sys/kern/kern_descrip.c Fri Oct 31 09:19:46 2014 (r273894) @@ -238,8 +238,6 @@ static int fdisused(struct filedesc *fdp, int fd) { - FILEDESC_LOCK_ASSERT(fdp); - KASSERT(fd >= 0 && fd < fdp->fd_nfiles, ("file descriptor %d out of range (0, %d)", fd, fdp->fd_nfiles)); @@ -251,14 +249,21 @@ fdisused(struct filedesc *fdp, int fd) * Mark a file descriptor as used. */ static void -fdused(struct filedesc *fdp, int fd) +fdused_init(struct filedesc *fdp, int fd) { - FILEDESC_XLOCK_ASSERT(fdp); - KASSERT(!fdisused(fdp, fd), ("fd=%d is already used", fd)); fdp->fd_map[NDSLOT(fd)] |= NDBIT(fd); +} + +static void +fdused(struct filedesc *fdp, int fd) +{ + + FILEDESC_XLOCK_ASSERT(fdp); + + fdused_init(fdp, fd); if (fd > fdp->fd_lastfile) fdp->fd_lastfile = fd; if (fd == fdp->fd_freefile) @@ -1912,28 +1917,23 @@ fdcopy(struct filedesc *fdp) newfdp->fd_freefile = -1; for (i = 0; i <= fdp->fd_lastfile; ++i) { ofde = &fdp->fd_ofiles[i]; - if (ofde->fde_file != NULL && - ofde->fde_file->f_ops->fo_flags & DFLAG_PASSABLE) { - nfde = &newfdp->fd_ofiles[i]; - *nfde = *ofde; - filecaps_copy(&ofde->fde_caps, &nfde->fde_caps); - fhold(nfde->fde_file); - newfdp->fd_lastfile = i; - } else { + if (ofde->fde_file == NULL || + (ofde->fde_file->f_ops->fo_flags & DFLAG_PASSABLE) == 0) { if (newfdp->fd_freefile == -1) newfdp->fd_freefile = i; + continue; } - } - newfdp->fd_cmask = fdp->fd_cmask; - FILEDESC_SUNLOCK(fdp); - FILEDESC_XLOCK(newfdp); - for (i = 0; i <= newfdp->fd_lastfile; ++i) { - if (newfdp->fd_ofiles[i].fde_file != NULL) - fdused(newfdp, i); + nfde = &newfdp->fd_ofiles[i]; + *nfde = *ofde; + filecaps_copy(&ofde->fde_caps, &nfde->fde_caps); + fhold(nfde->fde_file); + fdused_init(newfdp, i); + newfdp->fd_lastfile = i; } if (newfdp->fd_freefile == -1) newfdp->fd_freefile = i; - FILEDESC_XUNLOCK(newfdp); + newfdp->fd_cmask = fdp->fd_cmask; + FILEDESC_SUNLOCK(fdp); return (newfdp); } From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 09:25:29 2014 Return-Path: Delivered-To: svn-src-all@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 35FBAB6F; Fri, 31 Oct 2014 09:25: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 21A7A1ED; Fri, 31 Oct 2014 09:25: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 s9V9PTLc006496; Fri, 31 Oct 2014 09:25:29 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V9PT62006495; Fri, 31 Oct 2014 09:25:29 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410310925.s9V9PT62006495@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 31 Oct 2014 09:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273895 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 09:25:29 -0000 Author: mjg Date: Fri Oct 31 09:25:28 2014 New Revision: 273895 URL: https://svnweb.freebsd.org/changeset/base/273895 Log: filedesc: make fdinit return with source filedesc locked and new one sized appropriately Assert FILEDESC_XLOCK_ASSERT only for already used tables in fdgrowtable. We don't have to call it with the lock held if we are just creating new filedesc. As a side note, strictly speaking processes can have fdtables with fd_lastfile = -1, but then they cannot enter fdgrowtable. Very first file descriptor they get will be 0 and the only syscall allowing to choose fd number requires an active file descriptor. Should this ever change, we can add an 'init' (or similar) parameter to fdgrowtable. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Oct 31 09:19:46 2014 (r273894) +++ head/sys/kern/kern_descrip.c Fri Oct 31 09:25:28 2014 (r273895) @@ -1524,7 +1524,13 @@ fdgrowtable(struct filedesc *fdp, int nf int nnfiles, onfiles; NDSLOTTYPE *nmap, *omap; - FILEDESC_XLOCK_ASSERT(fdp); + /* + * If lastfile is -1 this struct filedesc was just allocated and we are + * growing it to accomodate for the one we are going to copy from. There + * is no need to have a lock on this one as it's not visible to anyone. + */ + if (fdp->fd_lastfile != -1) + FILEDESC_XLOCK_ASSERT(fdp); KASSERT(fdp->fd_nfiles > 0, ("zero-length file table")); @@ -1791,37 +1797,52 @@ finstall(struct thread *td, struct file /* * Build a new filedesc structure from another. * Copy the current, root, and jail root vnode references. + * + * If fdp is not NULL, return with it shared locked. */ struct filedesc * fdinit(struct filedesc *fdp) { - struct filedesc0 *newfdp; + struct filedesc0 *newfdp0; + struct filedesc *newfdp; - newfdp = malloc(sizeof *newfdp, M_FILEDESC, M_WAITOK | M_ZERO); - FILEDESC_LOCK_INIT(&newfdp->fd_fd); - if (fdp != NULL) { - FILEDESC_SLOCK(fdp); - newfdp->fd_fd.fd_cdir = fdp->fd_cdir; - if (newfdp->fd_fd.fd_cdir) - VREF(newfdp->fd_fd.fd_cdir); - newfdp->fd_fd.fd_rdir = fdp->fd_rdir; - if (newfdp->fd_fd.fd_rdir) - VREF(newfdp->fd_fd.fd_rdir); - newfdp->fd_fd.fd_jdir = fdp->fd_jdir; - if (newfdp->fd_fd.fd_jdir) - VREF(newfdp->fd_fd.fd_jdir); + newfdp0 = malloc(sizeof *newfdp0, M_FILEDESC, M_WAITOK | M_ZERO); + newfdp = &newfdp0->fd_fd; + + /* Create the file descriptor table. */ + FILEDESC_LOCK_INIT(newfdp); + newfdp->fd_refcnt = 1; + newfdp->fd_holdcnt = 1; + newfdp->fd_cmask = CMASK; + newfdp->fd_map = newfdp0->fd_dmap; + newfdp->fd_lastfile = -1; + newfdp->fd_files = (struct fdescenttbl *)&newfdp0->fd_dfiles; + newfdp->fd_files->fdt_nfiles = NDFILE; + + if (fdp == NULL) + return (newfdp); + + if (fdp->fd_lastfile >= newfdp->fd_nfiles) + fdgrowtable(newfdp, fdp->fd_lastfile + 1); + + FILEDESC_SLOCK(fdp); + newfdp->fd_cdir = fdp->fd_cdir; + if (newfdp->fd_cdir) + VREF(newfdp->fd_cdir); + newfdp->fd_rdir = fdp->fd_rdir; + if (newfdp->fd_rdir) + VREF(newfdp->fd_rdir); + newfdp->fd_jdir = fdp->fd_jdir; + if (newfdp->fd_jdir) + VREF(newfdp->fd_jdir); + + while (fdp->fd_lastfile >= newfdp->fd_nfiles) { FILEDESC_SUNLOCK(fdp); + fdgrowtable(newfdp, fdp->fd_lastfile + 1); + FILEDESC_SLOCK(fdp); } - /* Create the file descriptor table. */ - newfdp->fd_fd.fd_refcnt = 1; - newfdp->fd_fd.fd_holdcnt = 1; - newfdp->fd_fd.fd_cmask = CMASK; - newfdp->fd_dfiles.fdt_nfiles = NDFILE; - newfdp->fd_fd.fd_files = (struct fdescenttbl *)&newfdp->fd_dfiles; - newfdp->fd_fd.fd_map = newfdp->fd_dmap; - newfdp->fd_fd.fd_lastfile = -1; - return (&newfdp->fd_fd); + return (newfdp); } static struct filedesc * @@ -1905,14 +1926,6 @@ fdcopy(struct filedesc *fdp) return (NULL); newfdp = fdinit(fdp); - FILEDESC_SLOCK(fdp); - while (fdp->fd_lastfile >= newfdp->fd_nfiles) { - FILEDESC_SUNLOCK(fdp); - FILEDESC_XLOCK(newfdp); - fdgrowtable(newfdp, fdp->fd_lastfile + 1); - FILEDESC_XUNLOCK(newfdp); - FILEDESC_SLOCK(fdp); - } /* copy all passable descriptors (i.e. not kqueue) */ newfdp->fd_freefile = -1; for (i = 0; i <= fdp->fd_lastfile; ++i) { From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 09:51:56 2014 Return-Path: Delivered-To: svn-src-all@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 E791B812; Fri, 31 Oct 2014 09:51: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 C81A27B3; Fri, 31 Oct 2014 09:51: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 s9V9ptp5020442; Fri, 31 Oct 2014 09:51:55 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V9ptoj020440; Fri, 31 Oct 2014 09:51:55 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410310951.s9V9ptoj020440@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 31 Oct 2014 09:51:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273896 - head/sbin/mount_nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 09:51:56 -0000 Author: trasz Date: Fri Oct 31 09:51:54 2014 New Revision: 273896 URL: https://svnweb.freebsd.org/changeset/base/273896 Log: Build mount_nfs(8) with WARNS=6. Reviewed by: rmacklem@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sbin/mount_nfs/Makefile head/sbin/mount_nfs/mount_nfs.c Modified: head/sbin/mount_nfs/Makefile ============================================================================== --- head/sbin/mount_nfs/Makefile Fri Oct 31 09:25:28 2014 (r273895) +++ head/sbin/mount_nfs/Makefile Fri Oct 31 09:51:54 2014 (r273896) @@ -10,7 +10,6 @@ MLINKS= mount_nfs.8 mount_oldnfs.8 MOUNT= ${.CURDIR}/../mount UMNTALL= ${.CURDIR}/../../usr.sbin/rpc.umntall CFLAGS+= -DNFS -I${MOUNT} -I${UMNTALL} -WARNS?= 3 LINKS= ${BINDIR}/mount_nfs ${BINDIR}/mount_oldnfs Modified: head/sbin/mount_nfs/mount_nfs.c ============================================================================== --- head/sbin/mount_nfs/mount_nfs.c Fri Oct 31 09:25:28 2014 (r273895) +++ head/sbin/mount_nfs/mount_nfs.c Fri Oct 31 09:51:54 2014 (r273896) @@ -79,7 +79,7 @@ __FBSDID("$FreeBSD$"); #include "mounttab.h" /* Table for af,sotype -> netid conversions. */ -struct nc_protos { +static struct nc_protos { const char *netid; int af; int sotype; @@ -102,20 +102,21 @@ struct nfhret { #define ISBGRND 2 #define OF_NOINET4 4 #define OF_NOINET6 8 -int retrycnt = -1; -int opflags = 0; -int nfsproto = IPPROTO_TCP; -int mnttcp_ok = 1; -int noconn = 0; -char *portspec = NULL; /* Server nfs port; NULL means look up via rpcbind. */ -struct sockaddr *addr; -int addrlen = 0; -u_char *fh = NULL; -int fhsize = 0; -int secflavor = -1; -int got_principal = 0; +static int retrycnt = -1; +static int opflags = 0; +static int nfsproto = IPPROTO_TCP; +static int mnttcp_ok = 1; +static int noconn = 0; +/* The 'portspec' is the server nfs port; NULL means look up via rpcbind. */ +static const char *portspec = NULL; +static struct sockaddr *addr; +static int addrlen = 0; +static u_char *fh = NULL; +static int fhsize = 0; +static int secflavor = -1; +static int got_principal = 0; -enum mountmode { +static enum mountmode { ANY, V2, V3, @@ -130,8 +131,8 @@ enum tryret { TRYRET_LOCALERR /* Local failure. */ }; -static int sec_name_to_num(char *sec); -static char *sec_num_to_name(int num); +static int sec_name_to_num(const char *sec); +static const char *sec_num_to_name(int num); static int getnfsargs(char *, struct iovec **iov, int *iovlen); /* void set_rpc_maxgrouplist(int); */ static struct netconfig *getnetconf_cached(const char *netid); @@ -149,9 +150,10 @@ main(int argc, char *argv[]) int c; struct iovec *iov; int num, iovlen; - char *name, *p, *spec, *fstype; + char *mntname, *p, *spec, *tmp; char mntpath[MAXPATHLEN], errmsg[255]; - char hostname[MAXHOSTNAMELEN + 1], *gssname, gssn[MAXHOSTNAMELEN + 50]; + char hostname[MAXHOSTNAMELEN + 1], gssn[MAXHOSTNAMELEN + 50]; + const char *fstype, *gssname; iov = NULL; iovlen = 0; @@ -226,7 +228,7 @@ main(int argc, char *argv[]) while (opt) { char *pval = NULL; char *pnextopt = NULL; - char *val = ""; + const char *val = ""; pass_flag_to_nmount = 1; pnextopt = strchr(opt, ','); if (pnextopt != NULL) { @@ -276,10 +278,10 @@ main(int argc, char *argv[]) portspec = "2049"; } else if (strcmp(opt, "port") == 0) { pass_flag_to_nmount=0; - asprintf(&portspec, "%d", - atoi(val)); - if (portspec == NULL) + asprintf(&tmp, "%d", atoi(val)); + if (tmp == NULL) err(1, "asprintf"); + portspec = tmp; } else if (strcmp(opt, "principal") == 0) { got_principal = 1; } else if (strcmp(opt, "proto") == 0) { @@ -364,9 +366,11 @@ main(int argc, char *argv[]) } pass_flag_to_nmount=0; } - if (pass_flag_to_nmount) - build_iovec(&iov, &iovlen, opt, val, + if (pass_flag_to_nmount) { + build_iovec(&iov, &iovlen, opt, + __DECONST(void *, val), strlen(val) + 1); + } opt = pnextopt; } } @@ -426,7 +430,7 @@ main(int argc, char *argv[]) } spec = *argv++; - name = *argv; + mntname = *argv; if (retrycnt == -1) /* The default is to keep retrying forever. */ @@ -455,18 +459,19 @@ main(int argc, char *argv[]) hostname); gssname = gssn; } - build_iovec(&iov, &iovlen, "gssname", gssname, - strlen(gssname) + 1); + build_iovec(&iov, &iovlen, "gssname", + __DECONST(void *, gssname), strlen(gssname) + 1); } if (!getnfsargs(spec, &iov, &iovlen)) exit(1); /* resolve the mountpoint with realpath(3) */ - if (checkpath(name, mntpath) != 0) + if (checkpath(mntname, mntpath) != 0) err(1, "%s", mntpath); - build_iovec(&iov, &iovlen, "fstype", fstype, (size_t)-1); + build_iovec(&iov, &iovlen, "fstype", + __DECONST(void *, fstype), (size_t)-1); build_iovec(&iov, &iovlen, "fspath", mntpath, (size_t)-1); build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); @@ -477,7 +482,7 @@ main(int argc, char *argv[]) } static int -sec_name_to_num(char *sec) +sec_name_to_num(const char *sec) { if (!strcmp(sec, "krb5")) return (RPCSEC_GSS_KRB5); @@ -490,7 +495,7 @@ sec_name_to_num(char *sec) return (-1); } -static char * +static const char * sec_num_to_name(int flavor) { switch (flavor) { @@ -674,10 +679,9 @@ nfs_tryproto(struct addrinfo *ai, char * struct rpc_err rpcerr; CLIENT *clp; struct netconfig *nconf, *nconf_mnt; - const char *netid, *netid_mnt; - char *secname; + const char *netid, *netid_mnt, *secname; int doconnect, nfsvers, mntvers, sotype; - enum clnt_stat stat; + enum clnt_stat clntstat; enum mountmode trymntmode; sotype = 0; @@ -721,6 +725,7 @@ nfs_tryproto(struct addrinfo *ai, char * tryagain: if (trymntmode == V4) { nfsvers = 4; + mntvers = 3; /* Workaround for GCC. */ } else if (trymntmode == V2) { nfsvers = 2; mntvers = 1; @@ -780,10 +785,10 @@ tryagain: try.tv_sec = 10; try.tv_usec = 0; - stat = clnt_call(clp, NFSPROC_NULL, (xdrproc_t)xdr_void, NULL, + clntstat = clnt_call(clp, NFSPROC_NULL, (xdrproc_t)xdr_void, NULL, (xdrproc_t)xdr_void, NULL, try); - if (stat != RPC_SUCCESS) { - if (stat == RPC_PROGVERSMISMATCH && trymntmode == ANY) { + if (clntstat != RPC_SUCCESS) { + if (clntstat == RPC_PROGVERSMISMATCH && trymntmode == ANY) { clnt_destroy(clp); trymntmode = V2; goto tryagain; @@ -792,7 +797,7 @@ tryagain: snprintf(errbuf, sizeof errbuf, "[%s] %s:%s: %s", netid, hostp, spec, clnt_sperror(clp, "NFSPROC_NULL")); clnt_destroy(clp); - return (returncode(stat, &rpcerr)); + return (returncode(clntstat, &rpcerr)); } clnt_destroy(clp); @@ -812,8 +817,10 @@ tryagain: build_iovec(iov, iovlen, "addr", addr, addrlen); secname = sec_num_to_name(secflavor); - if (secname != NULL) - build_iovec(iov, iovlen, "sec", secname, (size_t)-1); + if (secname != NULL) { + build_iovec(iov, iovlen, "sec", + __DECONST(void *, secname), (size_t)-1); + } build_iovec(iov, iovlen, "nfsv4", NULL, 0); build_iovec(iov, iovlen, "dirpath", spec, (size_t)-1); @@ -833,12 +840,12 @@ tryagain: clp->cl_auth = authsys_create_default(); nfhret.auth = secflavor; nfhret.vers = mntvers; - stat = clnt_call(clp, MOUNTPROC_MNT, (xdrproc_t)xdr_dir, spec, + clntstat = clnt_call(clp, MOUNTPROC_MNT, (xdrproc_t)xdr_dir, spec, (xdrproc_t)xdr_fh, &nfhret, try); auth_destroy(clp->cl_auth); - if (stat != RPC_SUCCESS) { - if (stat == RPC_PROGVERSMISMATCH && trymntmode == ANY) { + if (clntstat != RPC_SUCCESS) { + if (clntstat == RPC_PROGVERSMISMATCH && trymntmode == ANY) { clnt_destroy(clp); trymntmode = V2; goto tryagain; @@ -847,7 +854,7 @@ tryagain: snprintf(errbuf, sizeof errbuf, "[%s] %s:%s: %s", netid_mnt, hostp, spec, clnt_sperror(clp, "RPCPROG_MNT")); clnt_destroy(clp); - return (returncode(stat, &rpcerr)); + return (returncode(clntstat, &rpcerr)); } clnt_destroy(clp); @@ -873,8 +880,10 @@ tryagain: build_iovec(iov, iovlen, "addr", addr, addrlen); build_iovec(iov, iovlen, "fh", fh, fhsize); secname = sec_num_to_name(nfhret.auth); - if (secname) - build_iovec(iov, iovlen, "sec", secname, (size_t)-1); + if (secname) { + build_iovec(iov, iovlen, "sec", + __DECONST(void *, secname), (size_t)-1); + } if (nfsvers == 3) build_iovec(iov, iovlen, "nfsv3", NULL, 0); @@ -886,9 +895,10 @@ tryagain: * return code. */ static enum tryret -returncode(enum clnt_stat stat, struct rpc_err *rpcerr) +returncode(enum clnt_stat clntstat, struct rpc_err *rpcerr) { - switch (stat) { + + switch (clntstat) { case RPC_TIMEDOUT: return (TRYRET_TIMEOUT); case RPC_PMAPFAILURE: From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 09:53:10 2014 Return-Path: Delivered-To: svn-src-all@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 760369B4; Fri, 31 Oct 2014 09:53:10 +0000 (UTC) Received: from mail-lb0-x229.google.com (mail-lb0-x229.google.com [IPv6:2a00:1450:4010:c04::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A7AE7CA; Fri, 31 Oct 2014 09:53:09 +0000 (UTC) Received: by mail-lb0-f169.google.com with SMTP id p9so121360lbv.14 for ; Fri, 31 Oct 2014 02:53:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=UADyE3XsXLiB6OWB+kup+Ks/o7cz7WgsTdzkq8ReVOY=; b=CEnCqSRtf3OFC3L9JD3CNwbUz1GdDyXiQVRVkKPGgYE8jK5xYmgWexRcn7pc9qXSLf cLdHzaeAP5/b3pq7lHKUGiIBV4cFWlns/0HEkRhhpVaIBZqFNRkUbBqohjil0VTBTHJn oykZGuQWEsjXbdkBX+uCi/SeSRwyLnCBGz2nz66/bU27ewPGW4jGc2qUykRqmgTpBC3g AcxAfB/cnc1DhU113PgePh3cSuWHESs72qYye+AJ0HqCRsZ6bUsheSTvB1+GRd1fRHRV /JJ5UpMQhQsSd8mBX2HhAa85fymO3bnxW0h3ArOxKneVM21ykLgBZmLfCDtuZV4iA54U nChQ== X-Received: by 10.112.47.37 with SMTP id a5mr24911981lbn.31.1414749187289; Fri, 31 Oct 2014 02:53:07 -0700 (PDT) Received: from brick.home (adbf36.neoplus.adsl.tpnet.pl. [79.184.5.36]) by mx.google.com with ESMTPSA id t5sm4242331lat.46.2014.10.31.02.53.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Oct 2014 02:53:06 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Fri, 31 Oct 2014 10:53:03 +0100 From: Edward Tomasz Napierala To: Sergey Kandaurov Subject: Re: svn commit: r273861 - head/sbin/mount_nfs Message-ID: <20141031095303.GA7150@brick.home> Mail-Followup-To: Sergey Kandaurov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201410301405.s9UE5nUO046896@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) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 09:53:10 -0000 On 1030T1847, Sergey Kandaurov wrote: > On 30 October 2014 17:05, Edward Tomasz Napierala wrote: > > Author: trasz > > Date: Thu Oct 30 14:05:48 2014 > > New Revision: 273861 > > URL: https://svnweb.freebsd.org/changeset/base/273861 > > > > Log: > > Remove two functions unused after r273848. Would be nice if clang > > or at least scan-build yelled about it. > > It does but with WARNS=3, -Wunused-function is disabled. Ah, right. Fixed :-) From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 09:56:01 2014 Return-Path: Delivered-To: svn-src-all@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 5A8A9B88; Fri, 31 Oct 2014 09:56: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 467227EF; Fri, 31 Oct 2014 09:56: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 s9V9u132021010; Fri, 31 Oct 2014 09:56:01 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9V9u09i021005; Fri, 31 Oct 2014 09:56:00 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410310956.s9V9u09i021005@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 31 Oct 2014 09:56:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273897 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 09:56:01 -0000 Author: mjg Date: Fri Oct 31 09:56:00 2014 New Revision: 273897 URL: https://svnweb.freebsd.org/changeset/base/273897 Log: filedesc: fix missed comments about fdsetugidsafety While here just note that both fdsetugidsafety and fdcheckstd take sleepable locks. Modified: head/sys/kern/kern_descrip.c head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Oct 31 09:51:54 2014 (r273896) +++ head/sys/kern/kern_descrip.c Fri Oct 31 09:56:00 2014 (r273897) @@ -2088,7 +2088,7 @@ fdescfree(struct thread *td) * otherwise be off-limits to the process. We check for filesystems where * the vnode can change out from under us after execve (like [lin]procfs). * - * Since setugidsafety calls this only for fd 0, 1 and 2, this check is + * Since fdsetugidsafety calls this only for fd 0, 1 and 2, this check is * sufficient. We also don't check for setugidness since we know we are. */ static bool Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Fri Oct 31 09:51:54 2014 (r273896) +++ head/sys/kern/kern_exec.c Fri Oct 31 09:56:00 2014 (r273897) @@ -688,10 +688,8 @@ interpret: * Close any file descriptors 0..2 that reference procfs, * then make sure file descriptors 0..2 are in use. * - * setugidsafety() may call closef() and then pfind() - * which may grab the process lock. - * fdcheckstd() may call falloc() which may block to - * allocate memory, so temporarily drop the process lock. + * Both fdsetugidsafety() and fdcheckstd() may call functions + * taking sleepable locks, so temporarily drop our locks. */ PROC_UNLOCK(p); VOP_UNLOCK(imgp->vp, 0); From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 10:07:57 2014 Return-Path: Delivered-To: svn-src-all@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 F2C2A21C; Fri, 31 Oct 2014 10:07: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 D423096D; Fri, 31 Oct 2014 10:07: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 s9VA7ucD026094; Fri, 31 Oct 2014 10:07:56 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VA7uRl026093; Fri, 31 Oct 2014 10:07:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410311007.s9VA7uRl026093@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 31 Oct 2014 10:07:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273898 - stable/10/sys/dev/usb/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 10:07:57 -0000 Author: hselasky Date: Fri Oct 31 10:07:56 2014 New Revision: 273898 URL: https://svnweb.freebsd.org/changeset/base/273898 Log: MFC 258028: Unbreak build of RSU module. Use the real product name for Edimax rsu(4) id. Modified: stable/10/sys/dev/usb/wlan/if_rsu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_rsu.c Fri Oct 31 09:56:00 2014 (r273897) +++ stable/10/sys/dev/usb/wlan/if_rsu.c Fri Oct 31 10:07:56 2014 (r273898) @@ -102,7 +102,7 @@ static const STRUCT_USB_HOST_ID rsu_devs RSU_DEV_HT(DLINK2, RTL8192SU_2), RSU_DEV_HT(EDIMAX, RTL8192SU_1), RSU_DEV_HT(EDIMAX, RTL8192SU_2), - RSU_DEV_HT(EDIMAX, RTL8192SU_3), + RSU_DEV_HT(EDIMAX, EW7622UMN), RSU_DEV_HT(GUILLEMOT, HWGUN54), RSU_DEV_HT(GUILLEMOT, HWNUM300), RSU_DEV_HT(HAWKING, RTL8192SU_1), From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 10:19:00 2014 Return-Path: Delivered-To: svn-src-all@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 F1839823; Fri, 31 Oct 2014 10:18: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 D2195AA0; Fri, 31 Oct 2014 10:18: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 s9VAIxEQ031517; Fri, 31 Oct 2014 10:18:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VAIx9j031516; Fri, 31 Oct 2014 10:18:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410311018.s9VAIx9j031516@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 31 Oct 2014 10:18:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273899 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 10:19:00 -0000 Author: hselasky Date: Fri Oct 31 10:18:58 2014 New Revision: 273899 URL: https://svnweb.freebsd.org/changeset/base/273899 Log: Only put one CTASSERT() inside each macro to avoid compile issues. The problem is that the __LINE__ macro is constant inside a macro and results in identical assert statements when the compiler does not support the static builtin assert function. MFC: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/sys/sysctl.h Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Fri Oct 31 10:07:56 2014 (r273898) +++ head/sys/sys/sysctl.h Fri Oct 31 10:18:58 2014 (r273899) @@ -324,9 +324,9 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e SYSCTL_OID(parent, nbr, name, \ CTLTYPE_INT | CTLFLAG_MPSAFE | (access), \ ptr, val, sysctl_handle_int, "I", descr); \ - CTASSERT(((access) & CTLTYPE) == 0 || \ - ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT); \ - CTASSERT(sizeof(int) == sizeof(*(ptr))) + CTASSERT((((access) & CTLTYPE) == 0 || \ + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT) && \ + sizeof(int) == sizeof(*(ptr))) #define SYSCTL_ADD_INT(ctx, parent, nbr, name, access, ptr, val, descr) \ ({ \ @@ -344,9 +344,9 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e SYSCTL_OID(parent, nbr, name, \ CTLTYPE_UINT | CTLFLAG_MPSAFE | (access), \ ptr, val, sysctl_handle_int, "IU", descr); \ - CTASSERT(((access) & CTLTYPE) == 0 || \ - ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_UINT);\ - CTASSERT(sizeof(unsigned) == sizeof(*(ptr))) + CTASSERT((((access) & CTLTYPE) == 0 || \ + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_UINT) && \ + sizeof(unsigned) == sizeof(*(ptr))) #define SYSCTL_ADD_UINT(ctx, parent, nbr, name, access, ptr, val, descr) \ ({ \ @@ -364,9 +364,9 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e SYSCTL_OID(parent, nbr, name, \ CTLTYPE_LONG | CTLFLAG_MPSAFE | (access), \ ptr, val, sysctl_handle_long, "L", descr); \ - CTASSERT(((access) & CTLTYPE) == 0 || \ - ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_LONG);\ - CTASSERT(sizeof(long) == sizeof(*(ptr))) + CTASSERT((((access) & CTLTYPE) == 0 || \ + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_LONG) && \ + sizeof(long) == sizeof(*(ptr))) #define SYSCTL_ADD_LONG(ctx, parent, nbr, name, access, ptr, descr) \ ({ \ @@ -384,9 +384,9 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e SYSCTL_OID(parent, nbr, name, \ CTLTYPE_ULONG | CTLFLAG_MPSAFE | (access), \ ptr, val, sysctl_handle_long, "LU", descr); \ - CTASSERT(((access) & CTLTYPE) == 0 || \ - ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_ULONG); \ - CTASSERT(sizeof(unsigned long) == sizeof(*(ptr))) + CTASSERT((((access) & CTLTYPE) == 0 || \ + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_ULONG) && \ + sizeof(unsigned long) == sizeof(*(ptr))) #define SYSCTL_ADD_ULONG(ctx, parent, nbr, name, access, ptr, descr) \ ({ \ @@ -404,9 +404,9 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e SYSCTL_OID(parent, nbr, name, \ CTLTYPE_S64 | CTLFLAG_MPSAFE | (access), \ ptr, val, sysctl_handle_64, "Q", descr); \ - CTASSERT(((access) & CTLTYPE) == 0 || \ - ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S64); \ - CTASSERT(sizeof(int64_t) == sizeof(*(ptr))) + CTASSERT((((access) & CTLTYPE) == 0 || \ + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S64) && \ + sizeof(int64_t) == sizeof(*(ptr))) #define SYSCTL_ADD_QUAD(ctx, parent, nbr, name, access, ptr, descr) \ ({ \ @@ -423,9 +423,9 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e SYSCTL_OID(parent, nbr, name, \ CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \ ptr, val, sysctl_handle_64, "QU", descr); \ - CTASSERT(((access) & CTLTYPE) == 0 || \ - ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64); \ - CTASSERT(sizeof(uint64_t) == sizeof(*(ptr))) + CTASSERT((((access) & CTLTYPE) == 0 || \ + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64) && \ + sizeof(uint64_t) == sizeof(*(ptr))) #define SYSCTL_ADD_UQUAD(ctx, parent, nbr, name, access, ptr, descr) \ ({ \ @@ -441,9 +441,9 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e #define SYSCTL_ADD_UAUTO(ctx, parent, nbr, name, access, ptr, descr) \ ({ \ struct sysctl_oid *__ret; \ - CTASSERT(sizeof(uint64_t) == sizeof(*(ptr)) || \ - sizeof(unsigned) == sizeof(*(ptr))); \ - CTASSERT(((access) & CTLTYPE) == 0); \ + CTASSERT((sizeof(uint64_t) == sizeof(*(ptr)) || \ + sizeof(unsigned) == sizeof(*(ptr))) && \ + ((access) & CTLTYPE) == 0); \ if (sizeof(uint64_t) == sizeof(*(ptr))) { \ __ret = sysctl_add_oid(ctx, parent, nbr, name, \ CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \ @@ -463,10 +463,10 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e SYSCTL_OID(parent, nbr, name, \ CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \ (ptr), 0, sysctl_handle_counter_u64, "QU", descr); \ - CTASSERT(((access) & CTLTYPE) == 0 || \ - ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64); \ - CTASSERT(sizeof(counter_u64_t) == sizeof(*(ptr))); \ - CTASSERT(sizeof(uint64_t) == sizeof(**(ptr))) + CTASSERT((((access) & CTLTYPE) == 0 || \ + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64) && \ + sizeof(counter_u64_t) == sizeof(*(ptr)) && \ + sizeof(uint64_t) == sizeof(**(ptr))) #define SYSCTL_ADD_COUNTER_U64(ctx, parent, nbr, name, access, ptr, descr) \ ({ \ From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 10:35:02 2014 Return-Path: Delivered-To: svn-src-all@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 0BC7FCFB; Fri, 31 Oct 2014 10:35: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 EA8DBC4D; Fri, 31 Oct 2014 10:35: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 s9VAZ1KH041480; Fri, 31 Oct 2014 10:35:01 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VAZ1cu041479; Fri, 31 Oct 2014 10:35:01 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410311035.s9VAZ1cu041479@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 31 Oct 2014 10:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273901 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 10:35:02 -0000 Author: mjg Date: Fri Oct 31 10:35:01 2014 New Revision: 273901 URL: https://svnweb.freebsd.org/changeset/base/273901 Log: filedesc: drop retval argument from do_dup It was almost always td_retval anyway. For the one case where it is not, preserve the old value across the call. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Oct 31 10:25:31 2014 (r273900) +++ head/sys/kern/kern_descrip.c Fri Oct 31 10:35:01 2014 (r273901) @@ -101,8 +101,7 @@ static uma_zone_t file_zone; static int closefp(struct filedesc *fdp, int fd, struct file *fp, struct thread *td, int holdleaders); -static int do_dup(struct thread *td, int flags, int old, int new, - register_t *retval); +static int do_dup(struct thread *td, int flags, int old, int new); static int fd_first_free(struct filedesc *fdp, int low, int size); static int fd_last_used(struct filedesc *fdp, int size); static void fdgrowtable(struct filedesc *fdp, int nfd); @@ -361,8 +360,7 @@ int sys_dup2(struct thread *td, struct dup2_args *uap) { - return (do_dup(td, DUP_FIXED, (int)uap->from, (int)uap->to, - td->td_retval)); + return (do_dup(td, DUP_FIXED, (int)uap->from, (int)uap->to)); } /* @@ -378,7 +376,7 @@ int sys_dup(struct thread *td, struct dup_args *uap) { - return (do_dup(td, 0, (int)uap->fd, 0, td->td_retval)); + return (do_dup(td, 0, (int)uap->fd, 0)); } /* @@ -487,24 +485,22 @@ kern_fcntl(struct thread *td, int fd, in switch (cmd) { case F_DUPFD: tmp = arg; - error = do_dup(td, DUP_FCNTL, fd, tmp, td->td_retval); + error = do_dup(td, DUP_FCNTL, fd, tmp); break; case F_DUPFD_CLOEXEC: tmp = arg; - error = do_dup(td, DUP_FCNTL | DUP_CLOEXEC, fd, tmp, - td->td_retval); + error = do_dup(td, DUP_FCNTL | DUP_CLOEXEC, fd, tmp); break; case F_DUP2FD: tmp = arg; - error = do_dup(td, DUP_FIXED, fd, tmp, td->td_retval); + error = do_dup(td, DUP_FIXED, fd, tmp); break; case F_DUP2FD_CLOEXEC: tmp = arg; - error = do_dup(td, DUP_FIXED | DUP_CLOEXEC, fd, tmp, - td->td_retval); + error = do_dup(td, DUP_FIXED | DUP_CLOEXEC, fd, tmp); break; case F_GETFD: @@ -803,8 +799,7 @@ getmaxfd(struct proc *p) * Common code for dup, dup2, fcntl(F_DUPFD) and fcntl(F_DUP2FD). */ static int -do_dup(struct thread *td, int flags, int old, int new, - register_t *retval) +do_dup(struct thread *td, int flags, int old, int new) { struct filedesc *fdp; struct filedescent *oldfde, *newfde; @@ -836,7 +831,7 @@ do_dup(struct thread *td, int flags, int } oldfde = &fdp->fd_ofiles[old]; if (flags & DUP_FIXED && old == new) { - *retval = new; + td->td_retval[0] = new; if (flags & DUP_CLOEXEC) fdp->fd_ofiles[new].fde_flags |= UF_EXCLOSE; FILEDESC_XUNLOCK(fdp); @@ -906,7 +901,7 @@ do_dup(struct thread *td, int flags, int #ifdef CAPABILITIES seq_write_end(&newfde->fde_seq); #endif - *retval = new; + td->td_retval[0] = new; if (delfp != NULL) { (void) closefp(fdp, new, delfp, td, 1); @@ -2191,7 +2186,7 @@ int fdcheckstd(struct thread *td) { struct filedesc *fdp; - register_t retval, save; + register_t save; int i, error, devnull; fdp = td->td_proc->p_fd; @@ -2211,7 +2206,9 @@ fdcheckstd(struct thread *td) break; KASSERT(devnull == i, ("oof, we didn't get our fd")); } else { - error = do_dup(td, DUP_FIXED, devnull, i, &retval); + save = td->td_retval[0]; + error = do_dup(td, DUP_FIXED, devnull, i); + td->td_retval[0] = save; if (error != 0) break; } From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 10:45:35 2014 Return-Path: Delivered-To: svn-src-all@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 780675B7; Fri, 31 Oct 2014 10:45: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 64D3ED83; Fri, 31 Oct 2014 10:45: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 s9VAjZ7s046469; Fri, 31 Oct 2014 10:45:35 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VAjZAk046468; Fri, 31 Oct 2014 10:45:35 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201410311045.s9VAjZAk046468@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Fri, 31 Oct 2014 10:45:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273902 - head/sys/modules/drm2/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 10:45:35 -0000 Author: tijl Date: Fri Oct 31 10:45:34 2014 New Revision: 273902 URL: https://svnweb.freebsd.org/changeset/base/273902 Log: Build ttm_agp_backend.c. Reported by: dumbbell MFC after: 1 month Modified: head/sys/modules/drm2/drm2/Makefile Modified: head/sys/modules/drm2/drm2/Makefile ============================================================================== --- head/sys/modules/drm2/drm2/Makefile Fri Oct 31 10:35:01 2014 (r273901) +++ head/sys/modules/drm2/drm2/Makefile Fri Oct 31 10:45:34 2014 (r273902) @@ -35,6 +35,7 @@ SRCS = \ drm_stub.c \ drm_sysctl.c \ drm_vm.c \ + ttm_agp_backend.c \ ttm_lock.c \ ttm_object.c \ ttm_tt.c \ @@ -46,7 +47,6 @@ SRCS = \ ttm_page_alloc.c \ ttm_bo_vm.c \ ati_pcigart.c -#ttm_agp_backend.c #ttm_page_alloc_dma.c .if ${MACHINE_CPUARCH} == "amd64" From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 11:40:50 2014 Return-Path: Delivered-To: svn-src-all@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 30F568D0; Fri, 31 Oct 2014 11:40: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 1D92836D; Fri, 31 Oct 2014 11:40: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 s9VBenjw070928; Fri, 31 Oct 2014 11:40:49 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VBenaH070927; Fri, 31 Oct 2014 11:40:49 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201410311140.s9VBenaH070927@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 31 Oct 2014 11:40:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273903 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 11:40:50 -0000 Author: ae Date: Fri Oct 31 11:40:49 2014 New Revision: 273903 URL: https://svnweb.freebsd.org/changeset/base/273903 Log: Fix typo. Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Fri Oct 31 10:45:34 2014 (r273902) +++ head/sys/netinet/tcp_syncache.c Fri Oct 31 11:40:49 2014 (r273903) @@ -1519,7 +1519,7 @@ syncache_respond(struct syncache *sc, st /* * We've got SCF_SIGNATURE flag * inherited from listening socket, - * but to SADB key for given source + * but no SADB key for given source * address. Assume signature is not * required and remove signature flag * instead of silently dropping From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 12:19:23 2014 Return-Path: Delivered-To: svn-src-all@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 5E1B848F; Fri, 31 Oct 2014 12:19: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 47BC9992; Fri, 31 Oct 2014 12:19: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 s9VCJN3M089508; Fri, 31 Oct 2014 12:19:23 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VCJNAl089507; Fri, 31 Oct 2014 12:19:23 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201410311219.s9VCJNAl089507@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 31 Oct 2014 12:19:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273904 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 12:19:23 -0000 Author: ae Date: Fri Oct 31 12:19:22 2014 New Revision: 273904 URL: https://svnweb.freebsd.org/changeset/base/273904 Log: Use in_localip() instead of handmade implementation. MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netipsec/key.c Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Fri Oct 31 11:40:49 2014 (r273903) +++ head/sys/netipsec/key.c Fri Oct 31 12:19:22 2014 (r273904) @@ -3906,33 +3906,14 @@ key_dup_lifemsg(const struct sadb_lifeti * 0: false */ int -key_ismyaddr(sa) - struct sockaddr *sa; +key_ismyaddr(struct sockaddr *sa) { -#ifdef INET - struct sockaddr_in *sin; - struct in_ifaddr *ia; -#endif IPSEC_ASSERT(sa != NULL, ("null sockaddr")); - switch (sa->sa_family) { #ifdef INET case AF_INET: - sin = (struct sockaddr_in *)sa; - IN_IFADDR_RLOCK(); - TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) - { - if (sin->sin_family == ia->ia_addr.sin_family && - sin->sin_len == ia->ia_addr.sin_len && - sin->sin_addr.s_addr == ia->ia_addr.sin_addr.s_addr) - { - IN_IFADDR_RUNLOCK(); - return 1; - } - } - IN_IFADDR_RUNLOCK(); - break; + return (in_localip(satosin(sa)->sin_addr)); #endif #ifdef INET6 case AF_INET6: From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 13:37:48 2014 Return-Path: Delivered-To: svn-src-all@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 075AFFEB; Fri, 31 Oct 2014 13:37: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 E79FD1C5; Fri, 31 Oct 2014 13:37: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 s9VDbl6B028921; Fri, 31 Oct 2014 13:37:47 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VDblDt028920; Fri, 31 Oct 2014 13:37:47 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201410311337.s9VDblDt028920@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Fri, 31 Oct 2014 13:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273906 - head/sbin/route X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 13:37:48 -0000 Author: melifaro Date: Fri Oct 31 13:37:47 2014 New Revision: 273906 URL: https://svnweb.freebsd.org/changeset/base/273906 Log: Print human-readable error for "route not found" case. Submitted by: vsevolod (initial version) MFC after: 2 weeks Sponsored by: Yandex LLC Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Fri Oct 31 12:21:43 2014 (r273905) +++ head/sbin/route/route.c Fri Oct 31 13:37:47 2014 (r273906) @@ -1533,9 +1533,18 @@ rtmsg(int cmd, int flags, int fib) if (debugonly) return (0); if ((rlen = write(s, (char *)&m_rtmsg, l)) < 0) { - if (errno == EPERM) + switch (errno) { + case EPERM: err(1, "writing to routing socket"); - warn("writing to routing socket"); + case ESRCH: + warnx("route has not been found"); + break; + case EEXIST: + /* Handled by newroute() */ + break; + default: + warn("writing to routing socket"); + } return (-1); } if (cmd == RTM_GET) { From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 14:22:12 2014 Return-Path: Delivered-To: svn-src-all@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 40640343; Fri, 31 Oct 2014 14:22:12 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 01ADB8F2; Fri, 31 Oct 2014 14:22:11 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id C19D2A1E0; Fri, 31 Oct 2014 14:22:10 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 848B010935; Fri, 31 Oct 2014 15:22:12 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Mark Murray Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... References: <201410302121.s9ULLsEw055630@svn.freebsd.org> Date: Fri, 31 Oct 2014 15:22:12 +0100 In-Reply-To: <201410302121.s9ULLsEw055630@svn.freebsd.org> (Mark Murray's message of "Thu, 30 Oct 2014 21:21:54 +0000 (UTC)") Message-ID: <8638a4b9pn.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 14:22:12 -0000 Mark Murray writes: > Log: > This is the much-discussed major upgrade to the random(4) device, > known to you all as /dev/random. Much discussed and long-awaited :) Thank you for your hard work and persistence! > Reviewed by: trasz,des(partial),imp(partial?),rwatson(partial?) Must... resist... tentation to make a joke about "imp(partial?)"... DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 14:22:27 2014 Return-Path: Delivered-To: svn-src-all@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 6D833483; Fri, 31 Oct 2014 14:22: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 59D538F8; Fri, 31 Oct 2014 14:22: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 s9VEMRij052876; Fri, 31 Oct 2014 14:22:27 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VEMRNg052875; Fri, 31 Oct 2014 14:22:27 GMT (envelope-from des@FreeBSD.org) Message-Id: <201410311422.s9VEMRNg052875@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Fri, 31 Oct 2014 14:22:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273907 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 14:22:27 -0000 Author: des Date: Fri Oct 31 14:22:26 2014 New Revision: 273907 URL: https://svnweb.freebsd.org/changeset/base/273907 Log: Add /etc/rc.d/initrandom, which was removed in r273872. Noticed by: ache@ Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Oct 31 13:37:47 2014 (r273906) +++ head/ObsoleteFiles.inc Fri Oct 31 14:22:26 2014 (r273907) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20141031: initrandom obsoleted by new /dev/random code +OLD_FILES+=etc/rc.d/initrandom # 20141028: debug files accidentally installed as directory name OLD_FILES+=usr/lib/debug/usr/lib/i18n OLD_FILES+=usr/lib/debug/usr/lib/private From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 14:22:53 2014 Return-Path: Delivered-To: svn-src-all@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 507965D5; Fri, 31 Oct 2014 14:22:53 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 0ED14900; Fri, 31 Oct 2014 14:22:53 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 675CDA1F3; Fri, 31 Oct 2014 14:22:52 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 2E7AB10937; Fri, 31 Oct 2014 15:22:54 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Andrey Chernov Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <545300F6.9070306@freebsd.org> Date: Fri, 31 Oct 2014 15:22:54 +0100 In-Reply-To: <545300F6.9070306@freebsd.org> (Andrey Chernov's message of "Fri, 31 Oct 2014 06:24:38 +0300") Message-ID: <86y4rw9v41.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mark Murray X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 14:22:53 -0000 Andrey Chernov writes: > Mark Murray writes: > > Deleted: > > head/etc/rc.d/initrandom > It should be added to ObsoleteFiles.inc Good catch, fixed in r273907. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 14:24:18 2014 Return-Path: Delivered-To: svn-src-all@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 1B995742; Fri, 31 Oct 2014 14:24:18 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id CE383912; Fri, 31 Oct 2014 14:24:17 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id F19B5A200; Fri, 31 Oct 2014 14:24:16 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id B947C10939; Fri, 31 Oct 2014 15:24:18 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Mark Murray Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <8638a4b9pn.fsf@nine.des.no> Date: Fri, 31 Oct 2014 15:24:18 +0100 In-Reply-To: <8638a4b9pn.fsf@nine.des.no> ("Dag-Erling =?utf-8?Q?Sm=C3=B8r?= =?utf-8?Q?grav=22's?= message of "Fri, 31 Oct 2014 15:22:12 +0100") Message-ID: <86r3xo9v1p.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 14:24:18 -0000 Dag-Erling Sm=C3=B8rgrav writes: > Must... resist... tentation to make a joke about "imp(partial?)"... Ouch, *temptation. French leaking into my English. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 14:28:57 2014 Return-Path: Delivered-To: svn-src-all@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 326E9ACB; Fri, 31 Oct 2014 14:28:57 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0: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 EC9EC95A; Fri, 31 Oct 2014 14:28:56 +0000 (UTC) Received: from [2001:470:9174:1:681e:d987:e29c:eb12] by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.84 (FreeBSD)) (envelope-from ) id 1XkDCA-000Dq8-MJ; Fri, 31 Oct 2014 14:28:55 +0000 Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <86y4rw9v41.fsf@nine.des.no> Date: Fri, 31 Oct 2014 14:28:53 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <61E474E4-FA62-4E1E-B0C1-C70E21850E75@FreeBSD.org> References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <545300F6.9070306@freebsd.org> <86y4rw9v41.fsf@nine.des.no> To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= X-Mailer: Apple Mail (2.1990.1) X-SA-Score: -1.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andrey Chernov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 14:28:57 -0000 > On 31 Oct 2014, at 14:22, Dag-Erling Sm=C3=B8rgrav wrote: >=20 > Andrey Chernov writes: >> Mark Murray writes: >>> Deleted: >>> head/etc/rc.d/initrandom >> It should be added to ObsoleteFiles.inc >=20 > Good catch, fixed in r273907. Thanks! M --=20 Mark R V Murray From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 14:29:38 2014 Return-Path: Delivered-To: svn-src-all@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 CBE4CC1B; Fri, 31 Oct 2014 14:29:38 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0: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 933BE969; Fri, 31 Oct 2014 14:29:38 +0000 (UTC) Received: from [2001:470:9174:1:681e:d987:e29c:eb12] by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.84 (FreeBSD)) (envelope-from ) id 1XkDCq-000Dq8-W5; Fri, 31 Oct 2014 14:29:37 +0000 Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <8638a4b9pn.fsf@nine.des.no> Date: Fri, 31 Oct 2014 14:29:36 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <426CD89D-0D26-4B26-A4F0-C958D378D969@FreeBSD.org> References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <8638a4b9pn.fsf@nine.des.no> To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= X-Mailer: Apple Mail (2.1990.1) X-SA-Score: -1.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 14:29:38 -0000 > On 31 Oct 2014, at 14:22, Dag-Erling Sm=C3=B8rgrav wrote: >=20 > Mark Murray writes: >> Log: >> This is the much-discussed major upgrade to the random(4) device, >> known to you all as /dev/random. >=20 > Much discussed and long-awaited :) Thank you for your hard work and > persistence! Thank you! >> Reviewed by: = trasz,des(partial),imp(partial?),rwatson(partial?) >=20 > Must... resist... tentation to make a joke about "imp(partial?)"=E2=80= =A6 *snigger* :-) M --=20 Mark R V Murray From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 15:07:52 2014 Return-Path: Delivered-To: svn-src-all@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 A3DCA46F; Fri, 31 Oct 2014 15:07: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 901F9D7A; Fri, 31 Oct 2014 15:07: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 s9VF7qEk074290; Fri, 31 Oct 2014 15:07:52 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VF7qMo074289; Fri, 31 Oct 2014 15:07:52 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201410311507.s9VF7qMo074289@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 31 Oct 2014 15:07:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273908 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 15:07:52 -0000 Author: kevlo Date: Fri Oct 31 15:07:51 2014 New Revision: 273908 URL: https://svnweb.freebsd.org/changeset/base/273908 Log: Fix usage of kern_getenv(). Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Fri Oct 31 14:22:26 2014 (r273907) +++ head/sys/arm/arm/machdep.c Fri Oct 31 15:07:51 2014 (r273908) @@ -1246,8 +1246,10 @@ initarm(struct arm_boot_params *abp) print_kenv(); env = kern_getenv("kernelname"); - if (env != NULL) + if (env != NULL) { strlcpy(kernelname, env, sizeof(kernelname)); + freeenv(env); + } if (err_devmap != 0) printf("WARNING: could not fully configure devmap, error=%d\n", From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 15:23:25 2014 Return-Path: Delivered-To: svn-src-all@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 6468DA39; Fri, 31 Oct 2014 15:23: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 50732F74; Fri, 31 Oct 2014 15:23: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 s9VFNP6n083498; Fri, 31 Oct 2014 15:23:25 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VFNPcJ083497; Fri, 31 Oct 2014 15:23:25 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201410311523.s9VFNPcJ083497@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 31 Oct 2014 15:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273909 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 15:23:25 -0000 Author: ae Date: Fri Oct 31 15:23:24 2014 New Revision: 273909 URL: https://svnweb.freebsd.org/changeset/base/273909 Log: Remove the check for packets with broadcast source from if_gif's encapcheck. The check was recommened in the draft-ietf-ngtrans-mech-05.txt. But it isn't clear, should it compare the source with all direct broadcast addresses in the system or not. RFC 4213 says it is enough to verify that the source address is the address of the encapsulator, as configured on the decapsulator. And this verification can be extended by administrator with any other forms of IPv4 ingress filtering. Discussed with: glebius, melifaro Sponsored by: Yandex LLC Modified: head/sys/netinet/in_gif.c Modified: head/sys/netinet/in_gif.c ============================================================================== --- head/sys/netinet/in_gif.c Fri Oct 31 15:07:51 2014 (r273908) +++ head/sys/netinet/in_gif.c Fri Oct 31 15:23:24 2014 (r273909) @@ -167,7 +167,6 @@ in_gif_input(struct mbuf **mp, int *offp static int gif_validate4(const struct ip *ip, struct gif_softc *sc, struct ifnet *ifp) { - struct in_ifaddr *ia4; GIF_RLOCK_ASSERT(sc); @@ -186,19 +185,6 @@ gif_validate4(const struct ip *ip, struc return (0); } - /* reject packets with broadcast on source */ - /* XXXRW: should use hash lists? */ - IN_IFADDR_RLOCK(); - TAILQ_FOREACH(ia4, &V_in_ifaddrhead, ia_link) { - if ((ia4->ia_ifa.ifa_ifp->if_flags & IFF_BROADCAST) == 0) - continue; - if (ip->ip_src.s_addr == ia4->ia_broadaddr.sin_addr.s_addr) { - IN_IFADDR_RUNLOCK(); - return (0); - } - } - IN_IFADDR_RUNLOCK(); - /* ingress filters on outer source */ if ((GIF2IFP(sc)->if_flags & IFF_LINK2) == 0 && ifp) { struct sockaddr_in sin; From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 16:00:46 2014 Return-Path: Delivered-To: svn-src-all@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 AEF3EC8E; Fri, 31 Oct 2014 16:00: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 9024F619; Fri, 31 Oct 2014 16:00: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 s9VG0kmr002045; Fri, 31 Oct 2014 16:00:46 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VG0kOA002044; Fri, 31 Oct 2014 16:00:46 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201410311600.s9VG0kOA002044@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 31 Oct 2014 16:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273910 - head/sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 16:00:46 -0000 Author: glebius Date: Fri Oct 31 16:00:45 2014 New Revision: 273910 URL: https://svnweb.freebsd.org/changeset/base/273910 Log: Use macro ERROUT() to make code more laconic and follow style of other netgraph code. Submitted by: Dmitry Luhtionov Modified: head/sys/netgraph/ng_frame_relay.c Modified: head/sys/netgraph/ng_frame_relay.c ============================================================================== --- head/sys/netgraph/ng_frame_relay.c Fri Oct 31 15:23:24 2014 (r273909) +++ head/sys/netgraph/ng_frame_relay.c Fri Oct 31 16:00:45 2014 (r273910) @@ -148,6 +148,8 @@ static struct ng_type typestruct = { }; NETGRAPH_INIT(framerelay, &typestruct); +#define ERROUT(x) do { error = (x); goto done; } while (0) + /* * Given a DLCI, return the index of the context table entry for it, * Allocating a new one if needs be, or -1 if none available. @@ -335,10 +337,8 @@ ngfrm_rcvdata(hook_p hook, item_p item) char *data; /* Data doesn't come in from just anywhere (e.g debug hook) */ - if (ctxp == NULL) { - error = ENETDOWN; - goto bad; - } + if (ctxp == NULL) + ERROUT(ENETDOWN); /* If coming from downstream, decode it to a channel */ dlci = ctxp->dlci; @@ -351,20 +351,16 @@ ngfrm_rcvdata(hook_p hook, item_p item) /* If there is no live channel, throw it away */ if ((sc->downstream.hook == NULL) - || ((ctxp->flags & CHAN_ACTIVE) == 0)) { - error = ENETDOWN; - goto bad; - } + || ((ctxp->flags & CHAN_ACTIVE) == 0)) + ERROUT(ENETDOWN); /* Store the DLCI on the front of the packet */ alen = sc->addrlen; if (alen == 0) alen = 2; /* default value for transmit */ M_PREPEND(m, alen, M_NOWAIT); - if (m == NULL) { - error = ENOBUFS; - goto bad; - } + if (m == NULL) + ERROUT(ENOBUFS); data = mtod(m, char *); /* @@ -401,7 +397,7 @@ ngfrm_rcvdata(hook_p hook, item_p item) NG_FWD_NEW_DATA(error, item, sc->downstream.hook, m); return (error); -bad: +done: NG_FREE_ITEM(item); NG_FREE_M(m); return (error); @@ -422,10 +418,8 @@ ngfrm_decode(node_p node, item_p item) struct mbuf *m; NGI_GET_M(item, m); - if (m->m_len < 4 && (m = m_pullup(m, 4)) == NULL) { - error = ENOBUFS; - goto out; - } + if (m->m_len < 4 && (m = m_pullup(m, 4)) == NULL) + ERROUT(ENOBUFS); data = mtod(m, char *); if ((alen = sc->addrlen) == 0) { sc->addrlen = alen = ngfrm_addrlen(data); @@ -447,14 +441,11 @@ ngfrm_decode(node_p node, item_p item) SHIFTIN(makeup + 3, data[3], dlci); break; default: - error = EINVAL; - goto out; + ERROUT(EINVAL); } - if (dlci > 1023) { - error = EINVAL; - goto out; - } + if (dlci > 1023) + ERROUT(EINVAL); ctxnum = sc->ALT[dlci]; if ((ctxnum & CTX_VALID) && sc->channel[ctxnum &= CTX_VALUE].hook) { /* Send it */ @@ -464,7 +455,7 @@ ngfrm_decode(node_p node, item_p item) } else { error = ENETDOWN; } -out: +done: NG_FREE_ITEM(item); NG_FREE_M(m); return (error); From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 17:43:23 2014 Return-Path: Delivered-To: svn-src-all@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 5E9F913F; Fri, 31 Oct 2014 17:43: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 498DA369; Fri, 31 Oct 2014 17:43: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 s9VHhNg1056518; Fri, 31 Oct 2014 17:43:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VHhLk8056512; Fri, 31 Oct 2014 17:43:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201410311743.s9VHhLk8056512@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 31 Oct 2014 17:43:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273911 - in head: share/man/man9 sys/kern sys/powerpc/powerpc 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 17:43:23 -0000 Author: kib Date: Fri Oct 31 17:43:21 2014 New Revision: 273911 URL: https://svnweb.freebsd.org/changeset/base/273911 Log: Add type qualifier volatile to the base (userspace) address argument of fuword(9) and suword(9). This makes the functions type-compatible with volatile objects and does not require devolatile force, e.g. in kern_umtx.c. Requested by: bde Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Modified: head/share/man/man9/fetch.9 head/share/man/man9/store.9 head/sys/kern/kern_umtx.c head/sys/kern/subr_uio.c head/sys/powerpc/powerpc/copyinout.c head/sys/sys/systm.h Modified: head/share/man/man9/fetch.9 ============================================================================== --- head/share/man/man9/fetch.9 Fri Oct 31 16:00:45 2014 (r273910) +++ head/share/man/man9/fetch.9 Fri Oct 31 17:43:21 2014 (r273911) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 21, 2014 +.Dd October 29, 2014 .Dt FETCH 9 .Os .Sh NAME @@ -53,21 +53,21 @@ .In sys/types.h .In sys/systm.h .Ft int -.Fn fubyte "const void *base" +.Fn fubyte "volatile const void *base" .Ft long -.Fn fuword "const void *base" +.Fn fuword "volatile const void *base" .Ft int -.Fn fuword16 "void *base" +.Fn fuword16 "volatile const void *base" .Ft int32_t -.Fn fuword32 "const void *base" +.Fn fuword32 "volatile const void *base" .Ft int64_t -.Fn fuword64 "const void *base" +.Fn fuword64 "volatile const void *base" .Ft long -.Fn fueword "const void *base" "long *val" +.Fn fueword "volatile const void *base" "long *val" .Ft int32_t -.Fn fueword32 "const void *base" "int32_t *val" +.Fn fueword32 "volatile const void *base" "int32_t *val" .Ft int64_t -.Fn fueword64 "const void *base" "int64_t *val" +.Fn fueword64 "volatile const void *base" "int64_t *val" .In sys/resourcevar.h .Ft int .Fn fuswintr "void *base" Modified: head/share/man/man9/store.9 ============================================================================== --- head/share/man/man9/store.9 Fri Oct 31 16:00:45 2014 (r273910) +++ head/share/man/man9/store.9 Fri Oct 31 17:43:21 2014 (r273911) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2009 +.Dd October 29, 2014 .Dt STORE 9 .Os .Sh NAME @@ -48,15 +48,15 @@ .In sys/time.h .In sys/systm.h .Ft int -.Fn subyte "void *base" "int byte" +.Fn subyte "volatile void *base" "int byte" .Ft int -.Fn suword "void *base" "long word" +.Fn suword "volatile void *base" "long word" .Ft int -.Fn suword16 "void *base" "int word" +.Fn suword16 "volatile void *base" "int word" .Ft int -.Fn suword32 "void *base" "int32_t word" +.Fn suword32 "volatile void *base" "int32_t word" .Ft int -.Fn suword64 "void *base" "int64_t word" +.Fn suword64 "volatile void *base" "int64_t word" .In sys/resourcevar.h .Ft int .Fn suswintr "void *base" "int word" @@ -64,6 +64,8 @@ The .Nm functions are designed to copy small amounts of data to user-space. +If write is successful, it is performed atomically. +The data written must be naturally aligned. .Pp The .Nm Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Fri Oct 31 16:00:45 2014 (r273910) +++ head/sys/kern/kern_umtx.c Fri Oct 31 17:43:21 2014 (r273911) @@ -942,7 +942,7 @@ do_lock_normal(struct thread *td, struct * can fault on any access. */ for (;;) { - rv = fueword32(__DEVOLATILE(void *, &m->m_owner), &owner); + rv = fueword32(&m->m_owner, &owner); if (rv == -1) return (EFAULT); if (mode == _UMUTEX_WAIT) { @@ -1057,7 +1057,7 @@ do_unlock_normal(struct thread *td, stru /* * Make sure we own this mtx. */ - error = fueword32(__DEVOLATILE(uint32_t *, &m->m_owner), &owner); + error = fueword32(&m->m_owner, &owner); if (error == -1) return (EFAULT); @@ -1115,7 +1115,7 @@ do_wake_umutex(struct thread *td, struct int error; int count; - error = fueword32(__DEVOLATILE(uint32_t *, &m->m_owner), &owner); + error = fueword32(&m->m_owner, &owner); if (error == -1) return (EFAULT); @@ -1192,8 +1192,7 @@ do_wake2_umutex(struct thread *td, struc * any memory. */ if (count > 1) { - error = fueword32(__DEVOLATILE(uint32_t *, &m->m_owner), - &owner); + error = fueword32(&m->m_owner, &owner); if (error == -1) error = EFAULT; while (error == 0 && (owner & UMUTEX_CONTESTED) == 0) { @@ -1211,8 +1210,7 @@ do_wake2_umutex(struct thread *td, struc break; } } else if (count == 1) { - error = fueword32(__DEVOLATILE(uint32_t *, &m->m_owner), - &owner); + error = fueword32(&m->m_owner, &owner); if (error == -1) error = EFAULT; while (error == 0 && (owner & ~UMUTEX_CONTESTED) != 0 && @@ -1776,7 +1774,7 @@ do_unlock_pi(struct thread *td, struct u /* * Make sure we own this mtx. */ - error = fueword32(__DEVOLATILE(uint32_t *, &m->m_owner), &owner); + error = fueword32(&m->m_owner, &owner); if (error == -1) return (EFAULT); @@ -2008,7 +2006,7 @@ do_unlock_pp(struct thread *td, struct u /* * Make sure we own this mtx. */ - error = fueword32(__DEVOLATILE(uint32_t *, &m->m_owner), &owner); + error = fueword32(&m->m_owner, &owner); if (error == -1) return (EFAULT); @@ -2040,8 +2038,7 @@ do_unlock_pp(struct thread *td, struct u * to lock the mutex, it is necessary because thread priority * has to be adjusted for such mutex. */ - error = suword32(__DEVOLATILE(uint32_t *, &m->m_owner), - UMUTEX_CONTESTED); + error = suword32(&m->m_owner, UMUTEX_CONTESTED); umtxq_lock(&key); if (error == 0) @@ -2116,8 +2113,7 @@ do_set_ceiling(struct thread *td, struct if (owner == UMUTEX_CONTESTED) { suword32(&m->m_ceilings[0], ceiling); - suword32(__DEVOLATILE(uint32_t *, &m->m_owner), - UMUTEX_CONTESTED); + suword32(&m->m_owner, UMUTEX_CONTESTED); error = 0; break; } @@ -2263,10 +2259,9 @@ do_cv_wait(struct thread *td, struct uco * Set c_has_waiters to 1 before releasing user mutex, also * don't modify cache line when unnecessary. */ - error = fueword32(__DEVOLATILE(uint32_t *, &cv->c_has_waiters), - &hasw); + error = fueword32(&cv->c_has_waiters, &hasw); if (error == 0 && hasw == 0) - suword32(__DEVOLATILE(uint32_t *, &cv->c_has_waiters), 1); + suword32(&cv->c_has_waiters, 1); umtxq_unbusy_unlocked(&uq->uq_key); @@ -2296,9 +2291,7 @@ do_cv_wait(struct thread *td, struct uco umtxq_remove(uq); if (oldlen == 1) { umtxq_unlock(&uq->uq_key); - suword32( - __DEVOLATILE(uint32_t *, - &cv->c_has_waiters), 0); + suword32(&cv->c_has_waiters, 0); umtxq_lock(&uq->uq_key); } } @@ -2333,8 +2326,7 @@ do_cv_signal(struct thread *td, struct u nwake = umtxq_signal(&key, 1); if (cnt <= nwake) { umtxq_unlock(&key); - error = suword32( - __DEVOLATILE(uint32_t *, &cv->c_has_waiters), 0); + error = suword32(&cv->c_has_waiters, 0); if (error == -1) error = EFAULT; umtxq_lock(&key); @@ -2363,7 +2355,7 @@ do_cv_broadcast(struct thread *td, struc umtxq_signal(&key, INT_MAX); umtxq_unlock(&key); - error = suword32(__DEVOLATILE(uint32_t *, &cv->c_has_waiters), 0); + error = suword32(&cv->c_has_waiters, 0); if (error == -1) error = EFAULT; @@ -2399,8 +2391,7 @@ do_rw_rdlock(struct thread *td, struct u wrflags |= URWLOCK_WRITE_WAITERS; for (;;) { - rv = fueword32(__DEVOLATILE(int32_t *, &rwlock->rw_state), - &state); + rv = fueword32(&rwlock->rw_state, &state); if (rv == -1) { umtx_key_release(&uq->uq_key); return (EFAULT); @@ -2440,8 +2431,7 @@ do_rw_rdlock(struct thread *td, struct u * re-read the state, in case it changed between the try-lock above * and the check below */ - rv = fueword32(__DEVOLATILE(int32_t *, &rwlock->rw_state), - &state); + rv = fueword32(&rwlock->rw_state, &state); if (rv == -1) error = EFAULT; @@ -2499,8 +2489,7 @@ sleep: umtxq_unlock(&uq->uq_key); if (error) break; - rv = fueword32(__DEVOLATILE(int32_t *, - &rwlock->rw_state), &state); + rv = fueword32(&rwlock->rw_state, &state); if (rv == -1) { error = EFAULT; break; @@ -2517,8 +2506,7 @@ sleep: } suword32(&rwlock->rw_blocked_readers, blocked_readers-1); if (blocked_readers == 1) { - rv = fueword32(__DEVOLATILE(int32_t *, - &rwlock->rw_state), &state); + rv = fueword32(&rwlock->rw_state, &state); if (rv == -1) error = EFAULT; while (error == 0) { @@ -2569,8 +2557,7 @@ do_rw_wrlock(struct thread *td, struct u blocked_readers = 0; for (;;) { - rv = fueword32(__DEVOLATILE(int32_t *, &rwlock->rw_state), - &state); + rv = fueword32(&rwlock->rw_state, &state); if (rv == -1) { umtx_key_release(&uq->uq_key); return (EFAULT); @@ -2614,8 +2601,7 @@ do_rw_wrlock(struct thread *td, struct u * re-read the state, in case it changed between the try-lock above * and the check below */ - rv = fueword32(__DEVOLATILE(int32_t *, &rwlock->rw_state), - &state); + rv = fueword32(&rwlock->rw_state, &state); if (rv == -1) error = EFAULT; @@ -2670,8 +2656,7 @@ sleep: umtxq_unlock(&uq->uq_key); if (error) break; - rv = fueword32(__DEVOLATILE(int32_t *, - &rwlock->rw_state), &state); + rv = fueword32(&rwlock->rw_state, &state); if (rv == -1) { error = EFAULT; break; @@ -2687,8 +2672,7 @@ sleep: } suword32(&rwlock->rw_blocked_writers, blocked_writers-1); if (blocked_writers == 1) { - rv = fueword32(__DEVOLATILE(int32_t *, - &rwlock->rw_state), &state); + rv = fueword32(&rwlock->rw_state, &state); if (rv == -1) { umtxq_unbusy_unlocked(&uq->uq_key); error = EFAULT; @@ -2748,7 +2732,7 @@ do_rw_unlock(struct thread *td, struct u if (error != 0) return (error); - error = fueword32(__DEVOLATILE(int32_t *, &rwlock->rw_state), &state); + error = fueword32(&rwlock->rw_state, &state); if (error == -1) { error = EFAULT; goto out; @@ -2856,7 +2840,7 @@ do_sem_wait(struct thread *td, struct _u umtxq_unlock(&uq->uq_key); rv = casueword32(&sem->_has_waiters, 0, &count1, 1); if (rv == 0) - rv = fueword32(__DEVOLATILE(uint32_t *, &sem->_count), &count); + rv = fueword32(&sem->_count, &count); if (rv == -1 || count != 0) { umtxq_lock(&uq->uq_key); umtxq_unbusy(&uq->uq_key); @@ -2911,8 +2895,7 @@ do_sem_wake(struct thread *td, struct _u */ if (cnt == 1) { umtxq_unlock(&key); - error = suword32( - __DEVOLATILE(uint32_t *, &sem->_has_waiters), 0); + error = suword32(&sem->_has_waiters, 0); umtxq_lock(&key); if (error == -1) error = EFAULT; @@ -2946,7 +2929,7 @@ do_sem2_wait(struct thread *td, struct _ umtxq_busy(&uq->uq_key); umtxq_insert(uq); umtxq_unlock(&uq->uq_key); - rv = fueword32(__DEVOLATILE(uint32_t *, &sem->_count), &count); + rv = fueword32(&sem->_count, &count); if (rv == -1) { umtxq_lock(&uq->uq_key); umtxq_unbusy(&uq->uq_key); @@ -3024,8 +3007,7 @@ do_sem2_wake(struct thread *td, struct _ */ if (cnt == 1) { umtxq_unlock(&key); - rv = fueword32(__DEVOLATILE(uint32_t *, &sem->_count), - &count); + rv = fueword32(&sem->_count, &count); while (rv != -1 && count & USEM_HAS_WAITERS) rv = casueword32(&sem->_count, count, &count, count & ~USEM_HAS_WAITERS); Modified: head/sys/kern/subr_uio.c ============================================================================== --- head/sys/kern/subr_uio.c Fri Oct 31 16:00:45 2014 (r273910) +++ head/sys/kern/subr_uio.c Fri Oct 31 17:43:21 2014 (r273911) @@ -453,7 +453,7 @@ copyout_unmap(struct thread *td, vm_offs */ int -fueword(const void *base, long *val) +fueword(volatile const void *base, long *val) { long res; @@ -465,7 +465,7 @@ fueword(const void *base, long *val) } int -fueword32(const void *base, int32_t *val) +fueword32(volatile const void *base, int32_t *val) { int32_t res; @@ -478,7 +478,7 @@ fueword32(const void *base, int32_t *val #ifdef _LP64 int -fueword64(const void *base, int64_t *val) +fueword64(volatile const void *base, int64_t *val) { int32_t res; @@ -516,7 +516,7 @@ casueword(volatile u_long *p, u_long old } #else /* NO_FUEWORD */ int32_t -fuword32(const void *addr) +fuword32(volatile const void *addr) { int rv; int32_t val; @@ -527,7 +527,7 @@ fuword32(const void *addr) #ifdef _LP64 int64_t -fuword64(const void *addr) +fuword64(volatile const void *addr) { int rv; int64_t val; @@ -538,7 +538,7 @@ fuword64(const void *addr) #endif /* _LP64 */ long -fuword(const void *addr) +fuword(volatile const void *addr) { long val; int rv; Modified: head/sys/powerpc/powerpc/copyinout.c ============================================================================== --- head/sys/powerpc/powerpc/copyinout.c Fri Oct 31 16:00:45 2014 (r273910) +++ head/sys/powerpc/powerpc/copyinout.c Fri Oct 31 17:43:21 2014 (r273911) @@ -80,7 +80,7 @@ int setfault(faultbuf); /* defined in lo #ifdef __powerpc64__ static __inline void -set_user_sr(pmap_t pm, const void *addr) +set_user_sr(pmap_t pm, volatile const void *addr) { struct slb *slb; register_t slbv; @@ -113,7 +113,7 @@ set_user_sr(pmap_t pm, const void *addr) } #else static __inline void -set_user_sr(pmap_t pm, const void *addr) +set_user_sr(pmap_t pm, volatile const void *addr) { register_t vsid; @@ -135,7 +135,7 @@ set_user_sr(pmap_t pm, const void *addr) #endif static __inline int -map_user_ptr(pmap_t pm, const void *uaddr, void **kaddr, size_t ulen, +map_user_ptr(pmap_t pm, volatile const void *uaddr, void **kaddr, size_t ulen, size_t *klen) { size_t l; @@ -156,7 +156,7 @@ map_user_ptr(pmap_t pm, const void *uadd } #else /* Book-E uses a combined kernel/user mapping */ static __inline int -map_user_ptr(pmap_t pm, const void *uaddr, void **kaddr, size_t ulen, +map_user_ptr(pmap_t pm, volatile const void *uaddr, void **kaddr, size_t ulen, size_t *klen) { @@ -281,7 +281,7 @@ copyinstr(const void *udaddr, void *kadd } int -subyte(void *addr, int byte) +subyte(volatile void *addr, int byte) { struct thread *td; pmap_t pm; @@ -309,7 +309,7 @@ subyte(void *addr, int byte) #ifdef __powerpc64__ int -suword32(void *addr, int word) +suword32(volatile void *addr, int word) { struct thread *td; pmap_t pm; @@ -337,7 +337,7 @@ suword32(void *addr, int word) #endif int -suword(void *addr, long word) +suword(volatile void *addr, long word) { struct thread *td; pmap_t pm; @@ -365,20 +365,20 @@ suword(void *addr, long word) #ifdef __powerpc64__ int -suword64(void *addr, int64_t word) +suword64(volatile void *addr, int64_t word) { return (suword(addr, (long)word)); } #else int -suword32(void *addr, int32_t word) +suword32(volatile void *addr, int32_t word) { return (suword(addr, (long)word)); } #endif int -fubyte(const void *addr) +fubyte(volatile const void *addr) { struct thread *td; pmap_t pm; @@ -406,7 +406,7 @@ fubyte(const void *addr) } int -fuword16(const void *addr) +fuword16(volatile const void *addr) { struct thread *td; pmap_t pm; @@ -433,7 +433,7 @@ fuword16(const void *addr) } int -fueword32(const void *addr, int32_t *val) +fueword32(volatile const void *addr, int32_t *val) { struct thread *td; pmap_t pm; @@ -461,7 +461,7 @@ fueword32(const void *addr, int32_t *val #ifdef __powerpc64__ int -fueword64(const void *addr, int64_t *val) +fueword64(volatile const void *addr, int64_t *val) { struct thread *td; pmap_t pm; @@ -489,7 +489,7 @@ fueword64(const void *addr, int64_t *val #endif int -fueword(const void *addr, long *val) +fueword(volatile const void *addr, long *val) { struct thread *td; pmap_t pm; Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri Oct 31 16:00:45 2014 (r273910) +++ head/sys/sys/systm.h Fri Oct 31 17:43:21 2014 (r273911) @@ -252,19 +252,19 @@ int copyout(const void * __restrict kadd int copyout_nofault(const void * __restrict kaddr, void * __restrict udaddr, size_t len) __nonnull(1) __nonnull(2); -int fubyte(const void *base); -long fuword(const void *base); -int fuword16(const void *base); -int32_t fuword32(const void *base); -int64_t fuword64(const void *base); -int fueword(const void *base, long *val); -int fueword32(const void *base, int32_t *val); -int fueword64(const void *base, int64_t *val); -int subyte(void *base, int byte); -int suword(void *base, long word); -int suword16(void *base, int word); -int suword32(void *base, int32_t word); -int suword64(void *base, int64_t word); +int fubyte(volatile const void *base); +long fuword(volatile const void *base); +int fuword16(volatile const void *base); +int32_t fuword32(volatile const void *base); +int64_t fuword64(volatile const void *base); +int fueword(volatile const void *base, long *val); +int fueword32(volatile const void *base, int32_t *val); +int fueword64(volatile const void *base, int64_t *val); +int subyte(volatile void *base, int byte); +int suword(volatile void *base, long word); +int suword16(volatile void *base, int word); +int suword32(volatile void *base, int32_t word); +int suword64(volatile void *base, int64_t word); uint32_t casuword32(volatile uint32_t *base, uint32_t oldval, uint32_t newval); u_long casuword(volatile u_long *p, u_long oldval, u_long newval); int casueword32(volatile uint32_t *base, uint32_t oldval, uint32_t *oldvalp, From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 18:18:12 2014 Return-Path: Delivered-To: svn-src-all@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 BC558ED; Fri, 31 Oct 2014 18:18: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 A3A759BD; Fri, 31 Oct 2014 18:18: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 s9VIICu0074288; Fri, 31 Oct 2014 18:18:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VII5iI074233; Fri, 31 Oct 2014 18:18:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410311818.s9VII5iI074233@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 31 Oct 2014 18:18:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r273912 - in stable/9/sys: amd64/amd64 arm/arm cddl/contrib/opensolaris/uts/common/fs/zfs cddl/dev/dtrace compat/ndis dev/acpi_support dev/bxe dev/cxgb dev/cxgbe dev/e1000 dev/hatm dev/... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 18:18:12 -0000 Author: hselasky Date: Fri Oct 31 18:18:04 2014 New Revision: 273912 URL: https://svnweb.freebsd.org/changeset/base/273912 Log: MFC r228478, r263710, r273377, r273378, r273423, r273455 and r273899: - Reimplement CTASSERT() using _Static_assert(). - De-vnet hash sizes and hash masks. - Fix multiple issues related to arguments passed to SYSCTL macros. Sponsored by: Mellanox Technologies Modified: stable/9/sys/amd64/amd64/fpu.c stable/9/sys/arm/arm/busdma_machdep.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/9/sys/cddl/dev/dtrace/dtrace_sysctl.c stable/9/sys/compat/ndis/kern_ndis.c stable/9/sys/dev/acpi_support/acpi_asus.c stable/9/sys/dev/acpi_support/acpi_hp.c stable/9/sys/dev/acpi_support/acpi_ibm.c stable/9/sys/dev/acpi_support/acpi_sony.c stable/9/sys/dev/bxe/bxe.c stable/9/sys/dev/cxgb/cxgb_sge.c stable/9/sys/dev/cxgbe/t4_main.c stable/9/sys/dev/e1000/if_em.c stable/9/sys/dev/e1000/if_igb.c stable/9/sys/dev/e1000/if_lem.c stable/9/sys/dev/hatm/if_hatm.c stable/9/sys/dev/ixgbe/ixgbe.c stable/9/sys/dev/ixgbe/ixv.c stable/9/sys/dev/mpr/mpr.c stable/9/sys/dev/mps/mps.c stable/9/sys/dev/mrsas/mrsas.c stable/9/sys/dev/mrsas/mrsas.h stable/9/sys/dev/mxge/if_mxge.c stable/9/sys/dev/oce/oce_sysctl.c stable/9/sys/dev/qlxgbe/ql_os.c stable/9/sys/dev/rt/if_rt.c stable/9/sys/dev/sound/pci/hda/hdaa.c stable/9/sys/dev/vxge/vxge.c stable/9/sys/dev/xen/netfront/netfront.c stable/9/sys/fs/devfs/devfs_devs.c stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c stable/9/sys/geom/geom_kern.c stable/9/sys/kern/kern_cpuset.c stable/9/sys/kern/kern_mib.c stable/9/sys/kern/kern_synch.c stable/9/sys/kern/subr_devstat.c stable/9/sys/kern/subr_kdb.c stable/9/sys/kern/subr_uio.c stable/9/sys/kern/vfs_cache.c stable/9/sys/mips/mips/busdma_machdep.c stable/9/sys/net/if_lagg.c stable/9/sys/net80211/ieee80211_ht.c stable/9/sys/net80211/ieee80211_hwmp.c stable/9/sys/net80211/ieee80211_mesh.c stable/9/sys/net80211/ieee80211_superg.c stable/9/sys/netgraph/bluetooth/common/ng_bluetooth.c stable/9/sys/netgraph/ng_base.c stable/9/sys/netgraph/ng_socket.c stable/9/sys/netinet/cc/cc_chd.c stable/9/sys/netinet/tcp_reass.c stable/9/sys/netipsec/ipsec.h stable/9/sys/netipx/ipx_proto.c stable/9/sys/ofed/drivers/net/mlx4/mlx4_en.h stable/9/sys/powerpc/powermac/fcu.c stable/9/sys/powerpc/powermac/smu.c stable/9/sys/powerpc/powerpc/busdma_machdep.c stable/9/sys/powerpc/powerpc/cpu.c stable/9/sys/sys/sysctl.h stable/9/sys/sys/systm.h stable/9/sys/vm/memguard.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/forth/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/i386/gptboot/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/dev/run/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/dev/puc/ (props changed) stable/9/sys/dev/usb/wlan/if_run.c (props changed) stable/9/sys/dev/usb/wlan/if_runreg.h (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) stable/9/sys/modules/ixgbe/ (props changed) stable/9/sys/modules/svr4/ (props changed) stable/9/sys/net/ (props changed) stable/9/sys/netpfil/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/fpu.c ============================================================================== --- stable/9/sys/amd64/amd64/fpu.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/amd64/amd64/fpu.c Fri Oct 31 18:18:04 2014 (r273912) @@ -130,7 +130,7 @@ CTASSERT(sizeof(struct pcb) % XSAVE_AREA static void fpu_clean_state(void); SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, - NULL, 1, "Floating point instructions executed in hardware"); + SYSCTL_NULL_INT_PTR, 1, "Floating point instructions executed in hardware"); int use_xsave; /* non-static for cpu_switch.S */ uint64_t xsave_mask; /* the same */ Modified: stable/9/sys/arm/arm/busdma_machdep.c ============================================================================== --- stable/9/sys/arm/arm/busdma_machdep.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/arm/arm/busdma_machdep.c Fri Oct 31 18:18:04 2014 (r273912) @@ -1352,9 +1352,9 @@ alloc_bounce_zone(bus_dma_tag_t dmat) SYSCTL_ADD_STRING(busdma_sysctl_tree(bz), SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO, "lowaddr", CTLFLAG_RD, bz->lowaddrid, 0, ""); - SYSCTL_ADD_INT(busdma_sysctl_tree(bz), + SYSCTL_ADD_ULONG(busdma_sysctl_tree(bz), SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO, - "alignment", CTLFLAG_RD, &bz->alignment, 0, ""); + "alignment", CTLFLAG_RD, &bz->alignment, ""); return (0); } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Fri Oct 31 18:18:04 2014 (r273912) @@ -67,8 +67,8 @@ #include "zfs_comutil.h" /* Used by fstat(1). */ -SYSCTL_INT(_debug_sizeof, OID_AUTO, znode, CTLFLAG_RD, 0, sizeof(znode_t), - "sizeof(znode_t)"); +SYSCTL_INT(_debug_sizeof, OID_AUTO, znode, CTLFLAG_RD, + SYSCTL_NULL_INT_PTR, sizeof(znode_t), "sizeof(znode_t)"); /* * Define ZNODE_STATS to turn on statistic gathering. By default, it is only Modified: stable/9/sys/cddl/dev/dtrace/dtrace_sysctl.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_sysctl.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/cddl/dev/dtrace/dtrace_sysctl.c Fri Oct 31 18:18:04 2014 (r273912) @@ -84,10 +84,10 @@ SYSCTL_PROC(_debug_dtrace, OID_AUTO, pro SYSCTL_NODE(_kern, OID_AUTO, dtrace, CTLFLAG_RD, 0, "DTrace parameters"); -SYSCTL_LONG(_kern_dtrace, OID_AUTO, dof_maxsize, CTLFLAG_RW, +SYSCTL_QUAD(_kern_dtrace, OID_AUTO, dof_maxsize, CTLFLAG_RW, &dtrace_dof_maxsize, 0, "largest allowed DOF table"); -SYSCTL_LONG(_kern_dtrace, OID_AUTO, helper_actions_max, CTLFLAG_RW, +SYSCTL_QUAD(_kern_dtrace, OID_AUTO, helper_actions_max, CTLFLAG_RW, &dtrace_helper_actions_max, 0, "maximum number of allowed helper actions"); SYSCTL_INT(_kern_dtrace, OID_AUTO, memstr_max, CTLFLAG_RW, &dtrace_memstr_max, Modified: stable/9/sys/compat/ndis/kern_ndis.c ============================================================================== --- stable/9/sys/compat/ndis/kern_ndis.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/compat/ndis/kern_ndis.c Fri Oct 31 18:18:04 2014 (r273912) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #define NDIS_DUMMY_PATH "\\\\some\\bogus\\path" +#define NDIS_FLAG_RDONLY 1 static void ndis_status_func(ndis_handle, ndis_status, void *, uint32_t); static void ndis_statusdone_func(ndis_handle); @@ -325,48 +326,48 @@ ndis_create_sysctls(arg) * We qualify as the latter. */ ndis_add_sysctl(sc, "Environment", - "Windows environment", "1", CTLFLAG_RD); + "Windows environment", "1", NDIS_FLAG_RDONLY); /* NDIS version should be 5.1. */ ndis_add_sysctl(sc, "NdisVersion", - "NDIS API Version", "0x00050001", CTLFLAG_RD); + "NDIS API Version", "0x00050001", NDIS_FLAG_RDONLY); /* * Some miniport drivers rely on the existence of the SlotNumber, * NetCfgInstanceId and DriverDesc keys. */ - ndis_add_sysctl(sc, "SlotNumber", "Slot Numer", "01", CTLFLAG_RD); + ndis_add_sysctl(sc, "SlotNumber", "Slot Numer", "01", NDIS_FLAG_RDONLY); ndis_add_sysctl(sc, "NetCfgInstanceId", "NetCfgInstanceId", - "{12345678-1234-5678-CAFE0-123456789ABC}", CTLFLAG_RD); + "{12345678-1234-5678-CAFE0-123456789ABC}", NDIS_FLAG_RDONLY); ndis_add_sysctl(sc, "DriverDesc", "Driver Description", - "NDIS Network Adapter", CTLFLAG_RD); + "NDIS Network Adapter", NDIS_FLAG_RDONLY); /* Bus type (PCI, PCMCIA, etc...) */ sprintf(buf, "%d", (int)sc->ndis_iftype); - ndis_add_sysctl(sc, "BusType", "Bus Type", buf, CTLFLAG_RD); + ndis_add_sysctl(sc, "BusType", "Bus Type", buf, NDIS_FLAG_RDONLY); if (sc->ndis_res_io != NULL) { sprintf(buf, "0x%lx", rman_get_start(sc->ndis_res_io)); ndis_add_sysctl(sc, "IOBaseAddress", - "Base I/O Address", buf, CTLFLAG_RD); + "Base I/O Address", buf, NDIS_FLAG_RDONLY); } if (sc->ndis_irq != NULL) { sprintf(buf, "%lu", rman_get_start(sc->ndis_irq)); ndis_add_sysctl(sc, "InterruptNumber", - "Interrupt Number", buf, CTLFLAG_RD); + "Interrupt Number", buf, NDIS_FLAG_RDONLY); } return (0); } int -ndis_add_sysctl(arg, key, desc, val, flag) +ndis_add_sysctl(arg, key, desc, val, flag_rdonly) void *arg; char *key; char *desc; char *val; - int flag; + int flag_rdonly; { struct ndis_softc *sc; struct ndis_cfglist *cfg; @@ -391,13 +392,21 @@ ndis_add_sysctl(arg, key, desc, val, fla TAILQ_INSERT_TAIL(&sc->ndis_cfglist_head, cfg, link); - cfg->ndis_oid = - SYSCTL_ADD_STRING(device_get_sysctl_ctx(sc->ndis_dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ndis_dev)), - OID_AUTO, cfg->ndis_cfg.nc_cfgkey, flag, - cfg->ndis_cfg.nc_val, sizeof(cfg->ndis_cfg.nc_val), - cfg->ndis_cfg.nc_cfgdesc); - + if (flag_rdonly != 0) { + cfg->ndis_oid = + SYSCTL_ADD_STRING(device_get_sysctl_ctx(sc->ndis_dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ndis_dev)), + OID_AUTO, cfg->ndis_cfg.nc_cfgkey, CTLFLAG_RD, + cfg->ndis_cfg.nc_val, sizeof(cfg->ndis_cfg.nc_val), + cfg->ndis_cfg.nc_cfgdesc); + } else { + cfg->ndis_oid = + SYSCTL_ADD_STRING(device_get_sysctl_ctx(sc->ndis_dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ndis_dev)), + OID_AUTO, cfg->ndis_cfg.nc_cfgkey, CTLFLAG_RW, + cfg->ndis_cfg.nc_val, sizeof(cfg->ndis_cfg.nc_val), + cfg->ndis_cfg.nc_cfgdesc); + } return (0); } Modified: stable/9/sys/dev/acpi_support/acpi_asus.c ============================================================================== --- stable/9/sys/dev/acpi_support/acpi_asus.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/dev/acpi_support/acpi_asus.c Fri Oct 31 18:18:04 2014 (r273912) @@ -465,43 +465,39 @@ static struct { char *name; char *description; int method; - int flags; + int flag_anybody; } acpi_asus_sysctls[] = { { .name = "lcd_backlight", .method = ACPI_ASUS_METHOD_LCD, .description = "state of the lcd backlight", - .flags = CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY + .flag_anybody = 1 }, { .name = "lcd_brightness", .method = ACPI_ASUS_METHOD_BRN, .description = "brightness of the lcd panel", - .flags = CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY + .flag_anybody = 1 }, { .name = "video_output", .method = ACPI_ASUS_METHOD_DISP, .description = "display output state", - .flags = CTLTYPE_INT | CTLFLAG_RW }, { .name = "camera", .method = ACPI_ASUS_METHOD_CAMERA, .description = "internal camera state", - .flags = CTLTYPE_INT | CTLFLAG_RW }, { .name = "cardreader", .method = ACPI_ASUS_METHOD_CARDRD, .description = "internal card reader state", - .flags = CTLTYPE_INT | CTLFLAG_RW }, { .name = "wlan", .method = ACPI_ASUS_METHOD_WLAN, .description = "wireless lan state", - .flags = CTLTYPE_INT | CTLFLAG_RW }, { .name = NULL } @@ -741,12 +737,21 @@ acpi_asus_attach(device_t dev) if (!acpi_asus_sysctl_init(sc, acpi_asus_sysctls[i].method)) continue; - SYSCTL_ADD_PROC(&sc->sysctl_ctx, - SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, - acpi_asus_sysctls[i].name, - acpi_asus_sysctls[i].flags, - sc, i, acpi_asus_sysctl, "I", - acpi_asus_sysctls[i].description); + if (acpi_asus_sysctls[i].flag_anybody != 0) { + SYSCTL_ADD_PROC(&sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + acpi_asus_sysctls[i].name, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY, + sc, i, acpi_asus_sysctl, "I", + acpi_asus_sysctls[i].description); + } else { + SYSCTL_ADD_PROC(&sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + acpi_asus_sysctls[i].name, + CTLTYPE_INT | CTLFLAG_RW, + sc, i, acpi_asus_sysctl, "I", + acpi_asus_sysctls[i].description); + } } /* Attach leds */ Modified: stable/9/sys/dev/acpi_support/acpi_hp.c ============================================================================== --- stable/9/sys/dev/acpi_support/acpi_hp.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/dev/acpi_support/acpi_hp.c Fri Oct 31 18:18:04 2014 (r273912) @@ -152,135 +152,123 @@ static struct { char *name; int method; char *description; - int access; + int flag_rdonly; } acpi_hp_sysctls[] = { { .name = "wlan_enabled", .method = ACPI_HP_METHOD_WLAN_ENABLED, .description = "Enable/Disable WLAN (WiFi)", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "wlan_radio", .method = ACPI_HP_METHOD_WLAN_RADIO, .description = "WLAN radio status", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "wlan_on_air", .method = ACPI_HP_METHOD_WLAN_ON_AIR, .description = "WLAN radio ready to use (enabled and radio)", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "wlan_enable_if_radio_on", .method = ACPI_HP_METHOD_WLAN_ENABLE_IF_RADIO_ON, .description = "Enable WLAN if radio is turned on", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "wlan_disable_if_radio_off", .method = ACPI_HP_METHOD_WLAN_DISABLE_IF_RADIO_OFF, .description = "Disable WLAN if radio is turned off", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "bt_enabled", .method = ACPI_HP_METHOD_BLUETOOTH_ENABLED, .description = "Enable/Disable Bluetooth", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "bt_radio", .method = ACPI_HP_METHOD_BLUETOOTH_RADIO, .description = "Bluetooth radio status", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "bt_on_air", .method = ACPI_HP_METHOD_BLUETOOTH_ON_AIR, .description = "Bluetooth radio ready to use" " (enabled and radio)", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "bt_enable_if_radio_on", .method = ACPI_HP_METHOD_BLUETOOTH_ENABLE_IF_RADIO_ON, .description = "Enable bluetooth if radio is turned on", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "bt_disable_if_radio_off", .method = ACPI_HP_METHOD_BLUETOOTH_DISABLE_IF_RADIO_OFF, .description = "Disable bluetooth if radio is turned off", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "wwan_enabled", .method = ACPI_HP_METHOD_WWAN_ENABLED, .description = "Enable/Disable WWAN (UMTS)", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "wwan_radio", .method = ACPI_HP_METHOD_WWAN_RADIO, .description = "WWAN radio status", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "wwan_on_air", .method = ACPI_HP_METHOD_WWAN_ON_AIR, .description = "WWAN radio ready to use (enabled and radio)", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "wwan_enable_if_radio_on", .method = ACPI_HP_METHOD_WWAN_ENABLE_IF_RADIO_ON, .description = "Enable WWAN if radio is turned on", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "wwan_disable_if_radio_off", .method = ACPI_HP_METHOD_WWAN_DISABLE_IF_RADIO_OFF, .description = "Disable WWAN if radio is turned off", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "als_enabled", .method = ACPI_HP_METHOD_ALS, .description = "Enable/Disable ALS (Ambient light sensor)", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "display", .method = ACPI_HP_METHOD_DISPLAY, .description = "Display status", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "hdd_temperature", .method = ACPI_HP_METHOD_HDDTEMP, .description = "HDD temperature", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "is_docked", .method = ACPI_HP_METHOD_DOCK, .description = "Docking station status", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "cmi_detail", .method = ACPI_HP_METHOD_CMI_DETAIL, .description = "Details shown in CMI output " "(cat /dev/hpcmi)", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "verbose", .method = ACPI_HP_METHOD_VERBOSE, .description = "Verbosity level", - .access = CTLTYPE_INT | CTLFLAG_RW }, { NULL, 0, NULL, 0 } @@ -559,11 +547,19 @@ acpi_hp_attach(device_t dev) sc->was_wwan_on_air = arg; } - SYSCTL_ADD_PROC(sc->sysctl_ctx, - SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, - acpi_hp_sysctls[i].name, acpi_hp_sysctls[i].access, - sc, i, acpi_hp_sysctl, "I", - acpi_hp_sysctls[i].description); + if (acpi_hp_sysctls[i].flag_rdonly != 0) { + SYSCTL_ADD_PROC(sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + acpi_hp_sysctls[i].name, CTLTYPE_INT | CTLFLAG_RD, + sc, i, acpi_hp_sysctl, "I", + acpi_hp_sysctls[i].description); + } else { + SYSCTL_ADD_PROC(sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + acpi_hp_sysctls[i].name, CTLTYPE_INT | CTLFLAG_RW, + sc, i, acpi_hp_sysctl, "I", + acpi_hp_sysctls[i].description); + } } ACPI_SERIAL_END(hp); Modified: stable/9/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- stable/9/sys/dev/acpi_support/acpi_ibm.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/dev/acpi_support/acpi_ibm.c Fri Oct 31 18:18:04 2014 (r273912) @@ -192,79 +192,70 @@ static struct { char *name; int method; char *description; - int access; + int flag_rdonly; } acpi_ibm_sysctls[] = { { .name = "events", .method = ACPI_IBM_METHOD_EVENTS, .description = "ACPI events enable", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "eventmask", .method = ACPI_IBM_METHOD_EVENTMASK, .description = "ACPI eventmask", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "hotkey", .method = ACPI_IBM_METHOD_HOTKEY, .description = "Key Status", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "lcd_brightness", .method = ACPI_IBM_METHOD_BRIGHTNESS, .description = "LCD Brightness", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "volume", .method = ACPI_IBM_METHOD_VOLUME, .description = "Volume", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "mute", .method = ACPI_IBM_METHOD_MUTE, .description = "Mute", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "thinklight", .method = ACPI_IBM_METHOD_THINKLIGHT, .description = "Thinklight enable", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "bluetooth", .method = ACPI_IBM_METHOD_BLUETOOTH, .description = "Bluetooth enable", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "wlan", .method = ACPI_IBM_METHOD_WLAN, .description = "WLAN enable", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "fan_speed", .method = ACPI_IBM_METHOD_FANSPEED, .description = "Fan speed", - .access = CTLTYPE_INT | CTLFLAG_RD + .flag_rdonly = 1 }, { .name = "fan_level", .method = ACPI_IBM_METHOD_FANLEVEL, .description = "Fan level", - .access = CTLTYPE_INT | CTLFLAG_RW }, { .name = "fan", .method = ACPI_IBM_METHOD_FANSTATUS, .description = "Fan enable", - .access = CTLTYPE_INT | CTLFLAG_RW }, { NULL, 0, NULL, 0 } @@ -415,11 +406,19 @@ acpi_ibm_attach(device_t dev) if (!acpi_ibm_sysctl_init(sc, acpi_ibm_sysctls[i].method)) continue; - SYSCTL_ADD_PROC(sc->sysctl_ctx, - SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, - acpi_ibm_sysctls[i].name, acpi_ibm_sysctls[i].access, - sc, i, acpi_ibm_sysctl, "I", - acpi_ibm_sysctls[i].description); + if (acpi_ibm_sysctls[i].flag_rdonly != 0) { + SYSCTL_ADD_PROC(sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + acpi_ibm_sysctls[i].name, CTLTYPE_INT | CTLFLAG_RD, + sc, i, acpi_ibm_sysctl, "I", + acpi_ibm_sysctls[i].description); + } else { + SYSCTL_ADD_PROC(sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + acpi_ibm_sysctls[i].name, CTLTYPE_INT | CTLFLAG_RW, + sc, i, acpi_ibm_sysctl, "I", + acpi_ibm_sysctls[i].description); + } } /* Hook up thermal node */ @@ -483,15 +482,10 @@ acpi_ibm_resume(device_t dev) for (int i = 0; acpi_ibm_sysctls[i].name != NULL; i++) { int val; - if ((acpi_ibm_sysctls[i].access & CTLFLAG_RD) == 0) { - continue; - } - val = acpi_ibm_sysctl_get(sc, i); - if ((acpi_ibm_sysctls[i].access & CTLFLAG_WR) == 0) { + if (acpi_ibm_sysctls[i].flag_rdonly != 0) continue; - } acpi_ibm_sysctl_set(sc, i, val); } Modified: stable/9/sys/dev/acpi_support/acpi_sony.c ============================================================================== --- stable/9/sys/dev/acpi_support/acpi_sony.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/dev/acpi_support/acpi_sony.c Fri Oct 31 18:18:04 2014 (r273912) @@ -132,13 +132,22 @@ acpi_sony_attach(device_t dev) sc = device_get_softc(dev); acpi_GetInteger(acpi_get_handle(dev), ACPI_SONY_GET_PID, &sc->pid); device_printf(dev, "PID %x\n", sc->pid); - for (i = 0 ; acpi_sony_oids[i].nodename != NULL; i++){ - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - i, acpi_sony_oids[i].nodename , CTLTYPE_INT | - ((acpi_sony_oids[i].setmethod)? CTLFLAG_RW: CTLFLAG_RD), - dev, i, sysctl_acpi_sony_gen_handler, "I", - acpi_sony_oids[i].comment); + for (i = 0 ; acpi_sony_oids[i].nodename != NULL; i++) { + if (acpi_sony_oids[i].setmethod != NULL) { + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + i, acpi_sony_oids[i].nodename , + CTLTYPE_INT | CTLFLAG_RW, + dev, i, sysctl_acpi_sony_gen_handler, "I", + acpi_sony_oids[i].comment); + } else { + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + i, acpi_sony_oids[i].nodename , + CTLTYPE_INT | CTLFLAG_RD, + dev, i, sysctl_acpi_sony_gen_handler, "I", + acpi_sony_oids[i].comment); + } } return (0); } Modified: stable/9/sys/dev/bxe/bxe.c ============================================================================== --- stable/9/sys/dev/bxe/bxe.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/dev/bxe/bxe.c Fri Oct 31 18:18:04 2014 (r273912) @@ -16229,7 +16229,7 @@ bxe_add_sysctls(struct bxe_softc *sc) "version"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "bc_version", - CTLFLAG_RD, &sc->devinfo.bc_ver_str, 0, + CTLFLAG_RD, sc->devinfo.bc_ver_str, 0, "bootcode version"); snprintf(sc->fw_ver_str, sizeof(sc->fw_ver_str), "%d.%d.%d.%d", @@ -16238,7 +16238,7 @@ bxe_add_sysctls(struct bxe_softc *sc) BCM_5710_FW_REVISION_VERSION, BCM_5710_FW_ENGINEERING_VERSION); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "fw_version", - CTLFLAG_RD, &sc->fw_ver_str, 0, + CTLFLAG_RD, sc->fw_ver_str, 0, "firmware version"); snprintf(sc->mf_mode_str, sizeof(sc->mf_mode_str), "%s", @@ -16248,7 +16248,7 @@ bxe_add_sysctls(struct bxe_softc *sc) (sc->devinfo.mf_info.mf_mode == MULTI_FUNCTION_AFEX) ? "MF-AFEX" : "Unknown")); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mf_mode", - CTLFLAG_RD, &sc->mf_mode_str, 0, + CTLFLAG_RD, sc->mf_mode_str, 0, "multifunction mode"); SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "mf_vnics", @@ -16256,7 +16256,7 @@ bxe_add_sysctls(struct bxe_softc *sc) "multifunction vnics per port"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mac_addr", - CTLFLAG_RD, &sc->mac_addr_str, 0, + CTLFLAG_RD, sc->mac_addr_str, 0, "mac address"); snprintf(sc->pci_link_str, sizeof(sc->pci_link_str), "%s x%d", @@ -16266,12 +16266,12 @@ bxe_add_sysctls(struct bxe_softc *sc) "???GT/s"), sc->devinfo.pcie_link_width); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "pci_link", - CTLFLAG_RD, &sc->pci_link_str, 0, + CTLFLAG_RD, sc->pci_link_str, 0, "pci link status"); sc->debug = bxe_debug; - SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "debug", - CTLFLAG_RW, &sc->debug, 0, + SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "debug", + CTLFLAG_RW, &sc->debug, "debug logging mode"); sc->rx_budget = bxe_rx_budget; Modified: stable/9/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- stable/9/sys/dev/cxgb/cxgb_sge.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/dev/cxgb/cxgb_sge.c Fri Oct 31 18:18:04 2014 (r273912) @@ -3371,7 +3371,7 @@ t3_add_attach_sysctls(adapter_t *sc) /* random information */ SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "firmware_version", - CTLFLAG_RD, &sc->fw_version, + CTLFLAG_RD, sc->fw_version, 0, "firmware version"); SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "hw_revision", @@ -3379,7 +3379,7 @@ t3_add_attach_sysctls(adapter_t *sc) 0, "chip model"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "port_types", - CTLFLAG_RD, &sc->port_types, + CTLFLAG_RD, sc->port_types, 0, "type of ports"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "enable_debug", @@ -3510,7 +3510,7 @@ t3_add_configured_sysctls(adapter_t *sc) SYSCTL_ADD_UINT(ctx, rspqpoidlist, OID_AUTO, "starved", CTLFLAG_RD, &qs->rspq.starved, 0, "#times starved"); - SYSCTL_ADD_ULONG(ctx, rspqpoidlist, OID_AUTO, "phys_addr", + SYSCTL_ADD_UAUTO(ctx, rspqpoidlist, OID_AUTO, "phys_addr", CTLFLAG_RD, &qs->rspq.phys_addr, "physical_address_of the queue"); SYSCTL_ADD_UINT(ctx, rspqpoidlist, OID_AUTO, "dump_start", @@ -3546,7 +3546,7 @@ t3_add_configured_sysctls(adapter_t *sc) SYSCTL_ADD_UINT(ctx, txqpoidlist, OID_AUTO, "in_use", CTLFLAG_RD, &txq->in_use, 0, "#tunneled packet slots in use"); - SYSCTL_ADD_ULONG(ctx, txqpoidlist, OID_AUTO, "frees", + SYSCTL_ADD_UQUAD(ctx, txqpoidlist, OID_AUTO, "frees", CTLFLAG_RD, &txq->txq_frees, "#tunneled packets freed"); SYSCTL_ADD_UINT(ctx, txqpoidlist, OID_AUTO, "skipped", @@ -3561,7 +3561,7 @@ t3_add_configured_sysctls(adapter_t *sc) SYSCTL_ADD_UINT(ctx, txqpoidlist, OID_AUTO, "stopped_flags", CTLFLAG_RD, &qs->txq_stopped, 0, "tx queues stopped"); - SYSCTL_ADD_ULONG(ctx, txqpoidlist, OID_AUTO, "phys_addr", + SYSCTL_ADD_UAUTO(ctx, txqpoidlist, OID_AUTO, "phys_addr", CTLFLAG_RD, &txq->phys_addr, "physical_address_of the queue"); SYSCTL_ADD_UINT(ctx, txqpoidlist, OID_AUTO, "qgen", Modified: stable/9/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/9/sys/dev/cxgbe/t4_main.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/dev/cxgbe/t4_main.c Fri Oct 31 18:18:04 2014 (r273912) @@ -4237,10 +4237,10 @@ t4_sysctls(struct adapter *sc) NULL, chip_rev(sc), "chip hardware revision"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "firmware_version", - CTLFLAG_RD, &sc->fw_version, 0, "firmware version"); + CTLFLAG_RD, sc->fw_version, 0, "firmware version"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "cf", - CTLFLAG_RD, &sc->cfg_file, 0, "configuration file"); + CTLFLAG_RD, sc->cfg_file, 0, "configuration file"); SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "cfcsum", CTLFLAG_RD, NULL, sc->cfcsum, "config file checksum"); Modified: stable/9/sys/dev/e1000/if_em.c ============================================================================== --- stable/9/sys/dev/e1000/if_em.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/dev/e1000/if_em.c Fri Oct 31 18:18:04 2014 (r273912) @@ -5680,7 +5680,7 @@ em_set_sysctl_value(struct adapter *adap *limit = value; SYSCTL_ADD_INT(device_get_sysctl_ctx(adapter->dev), SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)), - OID_AUTO, name, CTLTYPE_INT|CTLFLAG_RW, limit, value, description); + OID_AUTO, name, CTLFLAG_RW, limit, value, description); } Modified: stable/9/sys/dev/e1000/if_igb.c ============================================================================== --- stable/9/sys/dev/e1000/if_igb.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/dev/e1000/if_igb.c Fri Oct 31 18:18:04 2014 (r273912) @@ -5590,8 +5590,8 @@ igb_add_hw_stats(struct adapter *adapter char namebuf[QUEUE_NAME_LEN]; /* Driver Statistics */ - SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "link_irq", - CTLFLAG_RD, &adapter->link_irq, 0, + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "link_irq", + CTLFLAG_RD, &adapter->link_irq, "Link MSIX IRQ Handled"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "dropped", CTLFLAG_RD, &adapter->dropped_pkts, @@ -5640,17 +5640,17 @@ igb_add_hw_stats(struct adapter *adapter queue_list = SYSCTL_CHILDREN(queue_node); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "interrupt_rate", - CTLFLAG_RD, &adapter->queues[i], + CTLTYPE_UINT | CTLFLAG_RD, &adapter->queues[i], sizeof(&adapter->queues[i]), igb_sysctl_interrupt_rate_handler, "IU", "Interrupt Rate"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_head", - CTLFLAG_RD, adapter, E1000_TDH(txr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_TDH(txr->me), igb_sysctl_reg_handler, "IU", "Transmit Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_tail", - CTLFLAG_RD, adapter, E1000_TDT(txr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_TDT(txr->me), igb_sysctl_reg_handler, "IU", "Transmit Descriptor Tail"); SYSCTL_ADD_QUAD(ctx, queue_list, OID_AUTO, "no_desc_avail", @@ -5661,11 +5661,11 @@ igb_add_hw_stats(struct adapter *adapter "Queue Packets Transmitted"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_head", - CTLFLAG_RD, adapter, E1000_RDH(rxr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_RDH(rxr->me), igb_sysctl_reg_handler, "IU", "Receive Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_tail", - CTLFLAG_RD, adapter, E1000_RDT(rxr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_RDT(rxr->me), igb_sysctl_reg_handler, "IU", "Receive Descriptor Tail"); SYSCTL_ADD_QUAD(ctx, queue_list, OID_AUTO, "rx_packets", @@ -6015,7 +6015,7 @@ igb_set_sysctl_value(struct adapter *ada *limit = value; SYSCTL_ADD_INT(device_get_sysctl_ctx(adapter->dev), SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)), - OID_AUTO, name, CTLTYPE_INT|CTLFLAG_RW, limit, value, description); + OID_AUTO, name, CTLFLAG_RW, limit, value, description); } /* Modified: stable/9/sys/dev/e1000/if_lem.c ============================================================================== --- stable/9/sys/dev/e1000/if_lem.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/dev/e1000/if_lem.c Fri Oct 31 18:18:04 2014 (r273912) @@ -4648,7 +4648,7 @@ lem_set_flow_cntrl(struct adapter *adapt *limit = value; SYSCTL_ADD_INT(device_get_sysctl_ctx(adapter->dev), SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)), - OID_AUTO, name, CTLTYPE_INT|CTLFLAG_RW, limit, value, description); + OID_AUTO, name, CTLFLAG_RW, limit, value, description); } static void @@ -4658,5 +4658,5 @@ lem_add_rx_process_limit(struct adapter *limit = value; SYSCTL_ADD_INT(device_get_sysctl_ctx(adapter->dev), SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)), - OID_AUTO, name, CTLTYPE_INT|CTLFLAG_RW, limit, value, description); + OID_AUTO, name, CTLFLAG_RW, limit, value, description); } Modified: stable/9/sys/dev/hatm/if_hatm.c ============================================================================== --- stable/9/sys/dev/hatm/if_hatm.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/dev/hatm/if_hatm.c Fri Oct 31 18:18:04 2014 (r273912) @@ -1311,9 +1311,17 @@ kenv_getuint(struct hatm_softc *sc, cons *ptr = def; - if (SYSCTL_ADD_UINT(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), - OID_AUTO, var, rw ? CTLFLAG_RW : CTLFLAG_RD, ptr, 0, "") == NULL) - return (ENOMEM); + if (rw != 0) { + if (SYSCTL_ADD_UINT(&sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, var, + CTLFLAG_RW, ptr, 0, "") == NULL) + return (ENOMEM); + } else { + if (SYSCTL_ADD_UINT(&sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, var, + CTLFLAG_RD, ptr, 0, "") == NULL) + return (ENOMEM); + } snprintf(full, sizeof(full), "hw.%s.%s", device_get_nameunit(sc->dev), var); Modified: stable/9/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/dev/ixgbe/ixgbe.c Fri Oct 31 18:18:04 2014 (r273912) @@ -462,7 +462,7 @@ ixgbe_attach(device_t dev) SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "enable_aim", CTLTYPE_INT|CTLFLAG_RW, + OID_AUTO, "enable_aim", CTLFLAG_RW, &ixgbe_enable_aim, 1, "Interrupt Moderation"); /* Modified: stable/9/sys/dev/ixgbe/ixv.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixv.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/dev/ixgbe/ixv.c Fri Oct 31 18:18:04 2014 (r273912) @@ -322,7 +322,7 @@ ixv_attach(device_t dev) SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "enable_aim", CTLTYPE_INT|CTLFLAG_RW, + OID_AUTO, "enable_aim", CTLFLAG_RW, &ixv_enable_aim, 1, "Interrupt Moderation"); /* Set up the timer callout */ @@ -4002,6 +4002,6 @@ ixv_add_rx_process_limit(struct adapter *limit = value; SYSCTL_ADD_INT(device_get_sysctl_ctx(adapter->dev), SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)), - OID_AUTO, name, CTLTYPE_INT|CTLFLAG_RW, limit, value, description); + OID_AUTO, name, CTLFLAG_RW, limit, value, description); } Modified: stable/9/sys/dev/mpr/mpr.c ============================================================================== --- stable/9/sys/dev/mpr/mpr.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/dev/mpr/mpr.c Fri Oct 31 18:18:04 2014 (r273912) @@ -1447,7 +1447,7 @@ mpr_setup_sysctl(struct mpr_softc *sc) "Disable the use of MSI interrupts"); SYSCTL_ADD_STRING(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), - OID_AUTO, "firmware_version", CTLFLAG_RW, &sc->fw_version, + OID_AUTO, "firmware_version", CTLFLAG_RW, sc->fw_version, strlen(sc->fw_version), "firmware version"); SYSCTL_ADD_STRING(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), Modified: stable/9/sys/dev/mps/mps.c ============================================================================== --- stable/9/sys/dev/mps/mps.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/dev/mps/mps.c Fri Oct 31 18:18:04 2014 (r273912) @@ -1416,7 +1416,7 @@ mps_setup_sysctl(struct mps_softc *sc) "Disable the use of MSI interrupts"); SYSCTL_ADD_STRING(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), - OID_AUTO, "firmware_version", CTLFLAG_RW, &sc->fw_version, + OID_AUTO, "firmware_version", CTLFLAG_RW, sc->fw_version, strlen(sc->fw_version), "firmware version"); SYSCTL_ADD_STRING(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), Modified: stable/9/sys/dev/mrsas/mrsas.c ============================================================================== --- stable/9/sys/dev/mrsas/mrsas.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/dev/mrsas/mrsas.c Fri Oct 31 18:18:04 2014 (r273912) @@ -393,7 +393,7 @@ mrsas_setup_sysctl(struct mrsas_softc *s SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "fw_outstanding", CTLFLAG_RD, - &sc->fw_outstanding, 0, "FW outstanding commands"); + &sc->fw_outstanding.val_rdonly, 0, "FW outstanding commands"); SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "io_cmds_highwater", CTLFLAG_RD, Modified: stable/9/sys/dev/mrsas/mrsas.h ============================================================================== --- stable/9/sys/dev/mrsas/mrsas.h Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/dev/mrsas/mrsas.h Fri Oct 31 18:18:04 2014 (r273912) @@ -529,8 +529,9 @@ typedef union _MPI2_REPLY_DESCRIPTORS_UN } MPI2_REPLY_DESCRIPTORS_UNION, MPI2_POINTER PTR_MPI2_REPLY_DESCRIPTORS_UNION, Mpi2ReplyDescriptorsUnion_t, MPI2_POINTER pMpi2ReplyDescriptorsUnion_t; -typedef struct { +typedef union { volatile unsigned int val; + unsigned int val_rdonly; } atomic_t; #define atomic_read(v) atomic_load_acq_int(&(v)->val) @@ -2406,7 +2407,7 @@ struct mrsas_softc { void *ctlr_info_mem; // get ctlr info cmd virtual addr bus_addr_t ctlr_info_phys_addr; //get ctlr info cmd physical addr u_int32_t max_sectors_per_req; - u_int8_t disableOnlineCtrlReset; + u_int32_t disableOnlineCtrlReset; atomic_t fw_outstanding; u_int32_t mrsas_debug; u_int32_t mrsas_io_timeout; Modified: stable/9/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/9/sys/dev/mxge/if_mxge.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/dev/mxge/if_mxge.c Fri Oct 31 18:18:04 2014 (r273912) @@ -1466,15 +1466,15 @@ mxge_add_sysctls(mxge_softc_t *sc) /* random information */ SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "firmware_version", - CTLFLAG_RD, &sc->fw_version, + CTLFLAG_RD, sc->fw_version, 0, "firmware version"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "serial_number", - CTLFLAG_RD, &sc->serial_number_string, + CTLFLAG_RD, sc->serial_number_string, 0, "serial number"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "product_code", - CTLFLAG_RD, &sc->product_code_string, + CTLFLAG_RD, sc->product_code_string, 0, "product_code"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "pcie_link_width", Modified: stable/9/sys/dev/oce/oce_sysctl.c ============================================================================== --- stable/9/sys/dev/oce/oce_sysctl.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/dev/oce/oce_sysctl.c Fri Oct 31 18:18:04 2014 (r273912) @@ -84,21 +84,21 @@ oce_add_sysctls(POCE_SOFTC sc) SYSCTL_ADD_STRING(ctx, child, OID_AUTO, "component_revision", - CTLTYPE_INT | CTLFLAG_RD, - &component_revision, + CTLFLAG_RD, + component_revision, sizeof(component_revision), "EMULEX One-Connect device driver revision"); SYSCTL_ADD_STRING(ctx, child, OID_AUTO, "firmware_version", - CTLTYPE_INT | CTLFLAG_RD, - &sc->fw_version, + CTLFLAG_RD, + sc->fw_version, sizeof(sc->fw_version), "EMULEX One-Connect Firmware Version"); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "max_rsp_handled", - CTLTYPE_INT | CTLFLAG_RW, + CTLFLAG_RW, &oce_max_rsp_handled, sizeof(oce_max_rsp_handled), "Maximum receive frames handled per interupt"); @@ -957,11 +957,11 @@ oce_add_stats_sysctls_xe201(POCE_SOFTC s SYSCTL_ADD_UINT(ctx, rx_stat_list, OID_AUTO, "total_rxcp_errs", CTLFLAG_RD, &stats->rx.t_rxcp_errs, 0, "Total Receive completion errors"); - SYSCTL_ADD_UINT(ctx, rx_stat_list, OID_AUTO, "pause_frames", - CTLFLAG_RD, &stats->u0.xe201.rx_pause_frames, 0, + SYSCTL_ADD_UQUAD(ctx, rx_stat_list, OID_AUTO, "pause_frames", + CTLFLAG_RD, &stats->u0.xe201.rx_pause_frames, "Pause Frames"); - SYSCTL_ADD_UINT(ctx, rx_stat_list, OID_AUTO, "control_frames", - CTLFLAG_RD, &stats->u0.xe201.rx_control_frames, 0, + SYSCTL_ADD_UQUAD(ctx, rx_stat_list, OID_AUTO, "control_frames", + CTLFLAG_RD, &stats->u0.xe201.rx_control_frames, "Control Frames"); for (i = 0; i < sc->nrqs; i++) { @@ -1001,11 +1001,11 @@ oce_add_stats_sysctls_xe201(POCE_SOFTC s NULL, "Receive Error Stats"); rx_stat_list = SYSCTL_CHILDREN(rx_stats_node); - SYSCTL_ADD_UINT(ctx, rx_stat_list, OID_AUTO, "crc_errs", - CTLFLAG_RD, &stats->u0.xe201.rx_crc_errors, 0, + SYSCTL_ADD_UQUAD(ctx, rx_stat_list, OID_AUTO, "crc_errs", + CTLFLAG_RD, &stats->u0.xe201.rx_crc_errors, "CRC Errors"); - SYSCTL_ADD_UINT(ctx, rx_stat_list, OID_AUTO, "alignment_errors", - CTLFLAG_RD, &stats->u0.xe201.rx_alignment_errors, 0, + SYSCTL_ADD_UQUAD(ctx, rx_stat_list, OID_AUTO, "alignment_errors", + CTLFLAG_RD, &stats->u0.xe201.rx_alignment_errors, "RX Alignmnet Errors"); SYSCTL_ADD_UINT(ctx, rx_stat_list, OID_AUTO, "in_range_errors", CTLFLAG_RD, &stats->u0.xe201.rx_in_range_errors, 0, @@ -1013,8 +1013,8 @@ oce_add_stats_sysctls_xe201(POCE_SOFTC s SYSCTL_ADD_UINT(ctx, rx_stat_list, OID_AUTO, "out_range_errors", CTLFLAG_RD, &stats->u0.xe201.rx_out_of_range_errors, 0, "Out Range Errors"); - SYSCTL_ADD_UINT(ctx, rx_stat_list, OID_AUTO, "frame_too_long", - CTLFLAG_RD, &stats->u0.xe201.rx_frames_too_long, 0, + SYSCTL_ADD_UQUAD(ctx, rx_stat_list, OID_AUTO, "frame_too_long", + CTLFLAG_RD, &stats->u0.xe201.rx_frames_too_long, "Frame Too Long"); SYSCTL_ADD_UINT(ctx, rx_stat_list, OID_AUTO, "address_match_errors", CTLFLAG_RD, &stats->u0.xe201.rx_address_match_errors, 0, @@ -1077,11 +1077,11 @@ oce_add_stats_sysctls_xe201(POCE_SOFTC s "total_ipv6_ext_hdr_tx_drop", CTLFLAG_RD, &stats->tx.t_ipv6_ext_hdr_tx_drop, 0, "Total Transmit IPV6 Drops"); - SYSCTL_ADD_UINT(ctx, tx_stat_list, OID_AUTO, "pauseframes", - CTLFLAG_RD, &stats->u0.xe201.tx_pause_frames, 0, + SYSCTL_ADD_UQUAD(ctx, tx_stat_list, OID_AUTO, "pauseframes", + CTLFLAG_RD, &stats->u0.xe201.tx_pause_frames, "Pause Frames"); - SYSCTL_ADD_UINT(ctx, tx_stat_list, OID_AUTO, "controlframes", - CTLFLAG_RD, &stats->u0.xe201.tx_control_frames, 0, + SYSCTL_ADD_UQUAD(ctx, tx_stat_list, OID_AUTO, "controlframes", + CTLFLAG_RD, &stats->u0.xe201.tx_control_frames, "Tx Control Frames"); for (i = 0; i < sc->nwqs; i++) { Modified: stable/9/sys/dev/qlxgbe/ql_os.c ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_os.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/dev/qlxgbe/ql_os.c Fri Oct 31 18:18:04 2014 (r273912) @@ -160,7 +160,7 @@ qla_add_sysctls(qla_host_t *ha) SYSCTL_ADD_STRING(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "fw_version", CTLFLAG_RD, - &ha->fw_ver_str, 0, "firmware version"); + ha->fw_ver_str, 0, "firmware version"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), Modified: stable/9/sys/dev/rt/if_rt.c ============================================================================== --- stable/9/sys/dev/rt/if_rt.c Fri Oct 31 17:43:21 2014 (r273911) +++ stable/9/sys/dev/rt/if_rt.c Fri Oct 31 18:18:04 2014 (r273912) @@ -2344,45 +2344,45 @@ rt_sysctl_attach(struct rt_softc *sc) stats = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "stats", CTLFLAG_RD, 0, "statistic"); - SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(stats), OID_AUTO, - "interrupts", CTLFLAG_RD, &sc->interrupts, 0, + SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 18:20:40 2014 Return-Path: Delivered-To: svn-src-all@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 875FB275; Fri, 31 Oct 2014 18:20: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 737E2A64; Fri, 31 Oct 2014 18:20: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 s9VIKeNO075062; Fri, 31 Oct 2014 18:20:40 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VIKew2075061; Fri, 31 Oct 2014 18:20:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201410311820.s9VIKew2075061@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 31 Oct 2014 18:20:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273913 - head/sys/boot/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 18:20:40 -0000 Author: andrew Date: Fri Oct 31 18:20:39 2014 New Revision: 273913 URL: https://svnweb.freebsd.org/changeset/base/273913 Log: Clean up the types of a few strings to make them const when they are never written to. Modified: head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Fri Oct 31 18:18:04 2014 (r273912) +++ head/sys/boot/fdt/fdt_loader_cmd.c Fri Oct 31 18:20:39 2014 (r273913) @@ -364,11 +364,11 @@ fdt_setup_fdtp() (cellbuf), (lim), (cellsize), 16); static int -_fdt_strtovect(char *str, void *cellbuf, int lim, unsigned char cellsize, +_fdt_strtovect(const char *str, void *cellbuf, int lim, unsigned char cellsize, uint8_t base) { - char *buf = str; - char *end = str + strlen(str) - 2; + const char *buf = str; + const char *end = str + strlen(str) - 2; uint32_t *u32buf = NULL; uint8_t *u8buf = NULL; int cnt = 0; @@ -411,7 +411,8 @@ _fdt_strtovect(char *str, void *cellbuf, static void fixup_ethernet(const char *env, char *ethstr, int *eth_no, int len) { - char *end, *str; + const char *str; + char *end; uint8_t tmp_addr[6]; int i, n; @@ -1347,7 +1348,7 @@ static int fdt_modprop(int nodeoff, char *propname, void *value, char mode) { uint32_t cells[100]; - char *buf; + const char *buf; int len, rv; const struct fdt_property *p; @@ -1365,7 +1366,7 @@ fdt_modprop(int nodeoff, char *propname, } len = strlen(value); rv = 0; - buf = (char *)value; + buf = value; switch (*buf) { case '&': From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 18:35:03 2014 Return-Path: Delivered-To: svn-src-all@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 CAA37690; Fri, 31 Oct 2014 18:35: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 B6C2EBB5; Fri, 31 Oct 2014 18:35: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 s9VIZ30t083716; Fri, 31 Oct 2014 18:35:03 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VIZ3qH083715; Fri, 31 Oct 2014 18:35:03 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201410311835.s9VIZ3qH083715@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 31 Oct 2014 18:35:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273914 - head/sys/boot/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 18:35:03 -0000 Author: andrew Date: Fri Oct 31 18:35:03 2014 New Revision: 273914 URL: https://svnweb.freebsd.org/changeset/base/273914 Log: The command name is a constant, use the correct type. MFC after: 1 week Modified: head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Fri Oct 31 18:20:39 2014 (r273913) +++ head/sys/boot/fdt/fdt_loader_cmd.c Fri Oct 31 18:35:03 2014 (r273914) @@ -93,9 +93,9 @@ static int fdt_cmd_mres(int argc, char * typedef int cmdf_t(int, char *[]); struct cmdtab { - char *name; - cmdf_t *handler; - int flags; + const char *name; + cmdf_t *handler; + int flags; }; static const struct cmdtab commands[] = { From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 18:42:58 2014 Return-Path: Delivered-To: svn-src-all@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 01D42AE1; Fri, 31 Oct 2014 18:42: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 E06FDCB8; Fri, 31 Oct 2014 18:42: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 s9VIgvHC088071; Fri, 31 Oct 2014 18:42:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VIgvjD088067; Fri, 31 Oct 2014 18:42:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410311842.s9VIgvjD088067@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 31 Oct 2014 18:42:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r273915 - stable/9/sys/dev/asmc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 18:42:58 -0000 Author: hselasky Date: Fri Oct 31 18:42:56 2014 New Revision: 273915 URL: https://svnweb.freebsd.org/changeset/base/273915 Log: MFC r271975: Improvements to asmc(4): 1. changed the code so that 2**16 keys are supported 2. changed the number of possible fans in a system from 2 to 6 3. added write support for some fan sysctls 4. added a new sysctl which shows the ID of the fan 5. added four more apple models with their temperature keys 6. changed the maxnumber of temperature keys from 36 to 80 7. replaced several fixed buf sizes to sizeof buf Obtained from: Denis Ahrens denis at h3q.com Modified: stable/9/sys/dev/asmc/asmc.c stable/9/sys/dev/asmc/asmcvar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/asmc/asmc.c ============================================================================== --- stable/9/sys/dev/asmc/asmc.c Fri Oct 31 18:35:03 2014 (r273914) +++ stable/9/sys/dev/asmc/asmc.c Fri Oct 31 18:42:56 2014 (r273915) @@ -77,6 +77,7 @@ static int asmc_key_read(device_t dev, uint8_t); static int asmc_fan_count(device_t dev); static int asmc_fan_getvalue(device_t dev, const char *key, int fan); +static int asmc_fan_setvalue(device_t dev, const char *key, int fan, int speed); static int asmc_temp_getvalue(device_t dev, const char *key); static int asmc_sms_read(device_t, const char *key, int16_t *val); static void asmc_sms_calibrate(device_t dev); @@ -94,6 +95,7 @@ static int asmc_key_dump(device_t, int); /* * Model functions. */ +static int asmc_mb_sysctl_fanid(SYSCTL_HANDLER_ARGS); static int asmc_mb_sysctl_fanspeed(SYSCTL_HANDLER_ARGS); static int asmc_mb_sysctl_fansafespeed(SYSCTL_HANDLER_ARGS); static int asmc_mb_sysctl_fanminspeed(SYSCTL_HANDLER_ARGS); @@ -115,6 +117,7 @@ struct asmc_model { int (*smc_sms_x)(SYSCTL_HANDLER_ARGS); int (*smc_sms_y)(SYSCTL_HANDLER_ARGS); int (*smc_sms_z)(SYSCTL_HANDLER_ARGS); + int (*smc_fan_id)(SYSCTL_HANDLER_ARGS); int (*smc_fan_speed)(SYSCTL_HANDLER_ARGS); int (*smc_fan_safespeed)(SYSCTL_HANDLER_ARGS); int (*smc_fan_minspeed)(SYSCTL_HANDLER_ARGS); @@ -134,7 +137,7 @@ static struct asmc_model *asmc_match(dev #define ASMC_SMS_FUNCS asmc_mb_sysctl_sms_x, asmc_mb_sysctl_sms_y, \ asmc_mb_sysctl_sms_z -#define ASMC_FAN_FUNCS asmc_mb_sysctl_fanspeed, asmc_mb_sysctl_fansafespeed, \ +#define ASMC_FAN_FUNCS asmc_mb_sysctl_fanid, asmc_mb_sysctl_fanspeed, asmc_mb_sysctl_fansafespeed, \ asmc_mb_sysctl_fanminspeed, \ asmc_mb_sysctl_fanmaxspeed, \ asmc_mb_sysctl_fantargetspeed @@ -196,6 +199,18 @@ struct asmc_model asmc_models[] = { ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, ASMC_LIGHT_FUNCS, ASMC_MBP4_TEMPS, ASMC_MBP4_TEMPNAMES, ASMC_MBP4_TEMPDESCS }, + + { + "MacBookPro8,2", "Apple SMC MacBook Pro (early 2011)", + ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, ASMC_LIGHT_FUNCS, + ASMC_MBP8_TEMPS, ASMC_MBP8_TEMPNAMES, ASMC_MBP8_TEMPDESCS + }, + + { + "MacBookPro11,3", "Apple SMC MacBook Pro Retina Core i7 (2013/2014)", + ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, ASMC_LIGHT_FUNCS, + ASMC_MBP11_TEMPS, ASMC_MBP11_TEMPNAMES, ASMC_MBP11_TEMPDESCS + }, /* The Mac Mini has no SMS */ { @@ -224,12 +239,27 @@ struct asmc_model asmc_models[] = { ASMC_MP_TEMPS, ASMC_MP_TEMPNAMES, ASMC_MP_TEMPDESCS }, + /* Idem for the MacPro 2010*/ + { + "MacPro5,1", "Apple SMC MacPro (2010)", + NULL, NULL, NULL, + ASMC_FAN_FUNCS, + NULL, NULL, NULL, + ASMC_MP5_TEMPS, ASMC_MP5_TEMPNAMES, ASMC_MP5_TEMPDESCS + }, + { "MacBookAir1,1", "Apple SMC MacBook Air", ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, NULL, NULL, NULL, ASMC_MBA_TEMPS, ASMC_MBA_TEMPNAMES, ASMC_MBA_TEMPDESCS }, + { + "MacBookAir3,1", "Apple SMC MacBook Air Core 2 Duo (Late 2010)", + ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, NULL, NULL, NULL, + ASMC_MBA3_TEMPS, ASMC_MBA3_TEMPNAMES, ASMC_MBA3_TEMPDESCS + }, + { NULL, NULL } }; @@ -361,6 +391,12 @@ asmc_attach(device_t dev) SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_fan_tree[i]), + OID_AUTO, "id", CTLTYPE_STRING | CTLFLAG_RD, + dev, j, model->smc_fan_id, "I", + "Fan ID"); + + SYSCTL_ADD_PROC(sysctlctx, + SYSCTL_CHILDREN(sc->sc_fan_tree[i]), OID_AUTO, "speed", CTLTYPE_INT | CTLFLAG_RD, dev, j, model->smc_fan_speed, "I", "Fan speed in RPM"); @@ -375,21 +411,21 @@ asmc_attach(device_t dev) SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_fan_tree[i]), OID_AUTO, "minspeed", - CTLTYPE_INT | CTLFLAG_RD, + CTLTYPE_INT | CTLFLAG_RW, dev, j, model->smc_fan_minspeed, "I", "Fan minimum speed in RPM"); SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_fan_tree[i]), OID_AUTO, "maxspeed", - CTLTYPE_INT | CTLFLAG_RD, + CTLTYPE_INT | CTLFLAG_RW, dev, j, model->smc_fan_maxspeed, "I", "Fan maximum speed in RPM"); SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_fan_tree[i]), OID_AUTO, "targetspeed", - CTLTYPE_INT | CTLFLAG_RD, + CTLTYPE_INT | CTLFLAG_RW, dev, j, model->smc_fan_targetspeed, "I", "Fan target speed in RPM"); } @@ -641,11 +677,10 @@ nosms: if (bootverbose) { /* - * XXX: The number of keys is a 32 bit buffer, but - * right now Apple only uses the last 8 bit. + * The number of keys is a 32 bit buffer */ asmc_key_read(dev, ASMC_NKEYS, buf, 4); - device_printf(dev, "number of keys: %d\n", buf[3]); + device_printf(dev, "number of keys: %d\n", ntohl(*(uint32_t*)buf)); } #ifdef DEBUG @@ -906,7 +941,7 @@ asmc_fan_count(device_t dev) { uint8_t buf[1]; - if (asmc_key_read(dev, ASMC_KEY_FANCOUNT, buf, 1) < 0) + if (asmc_key_read(dev, ASMC_KEY_FANCOUNT, buf, sizeof buf) < 0) return (-1); return (buf[0]); @@ -920,13 +955,46 @@ asmc_fan_getvalue(device_t dev, const ch char fankey[5]; snprintf(fankey, sizeof(fankey), key, fan); - if (asmc_key_read(dev, fankey, buf, 2) < 0) + if (asmc_key_read(dev, fankey, buf, sizeof buf) < 0) return (-1); speed = (buf[0] << 6) | (buf[1] >> 2); return (speed); } +static char* +asmc_fan_getstring(device_t dev, const char *key, int fan) +{ + uint8_t buf[16]; + char fankey[5]; + char* desc; + + snprintf(fankey, sizeof(fankey), key, fan); + if (asmc_key_read(dev, fankey, buf, sizeof buf) < 0) + return (NULL); + desc = buf+4; + + return (desc); +} + +static int +asmc_fan_setvalue(device_t dev, const char *key, int fan, int speed) +{ + uint8_t buf[2]; + char fankey[5]; + + speed *= 4; + + buf[0] = speed>>8; + buf[1] = speed; + + snprintf(fankey, sizeof(fankey), key, fan); + if (asmc_key_write(dev, fankey, buf, sizeof buf) < 0) + return (-1); + + return (0); +} + static int asmc_mb_sysctl_fanspeed(SYSCTL_HANDLER_ARGS) { @@ -942,6 +1010,22 @@ asmc_mb_sysctl_fanspeed(SYSCTL_HANDLER_A } static int +asmc_mb_sysctl_fanid(SYSCTL_HANDLER_ARGS) +{ + device_t dev = (device_t) arg1; + int fan = arg2; + int error = true; + char* desc; + + desc = asmc_fan_getstring(dev, ASMC_KEY_FANID, fan); + + if (desc != NULL) + error = sysctl_handle_string(oidp, desc, 0, req); + + return (error); +} + +static int asmc_mb_sysctl_fansafespeed(SYSCTL_HANDLER_ARGS) { device_t dev = (device_t) arg1; @@ -967,6 +1051,11 @@ asmc_mb_sysctl_fanminspeed(SYSCTL_HANDLE v = asmc_fan_getvalue(dev, ASMC_KEY_FANMINSPEED, fan); error = sysctl_handle_int(oidp, &v, 0, req); + if (error == 0 && req->newptr != NULL) { + unsigned int newspeed = *(unsigned int *)req->newptr; + asmc_fan_setvalue(dev, ASMC_KEY_FANMINSPEED, fan, newspeed); + } + return (error); } @@ -981,6 +1070,11 @@ asmc_mb_sysctl_fanmaxspeed(SYSCTL_HANDLE v = asmc_fan_getvalue(dev, ASMC_KEY_FANMAXSPEED, fan); error = sysctl_handle_int(oidp, &v, 0, req); + if (error == 0 && req->newptr != NULL) { + unsigned int newspeed = *(unsigned int *)req->newptr; + asmc_fan_setvalue(dev, ASMC_KEY_FANMAXSPEED, fan, newspeed); + } + return (error); } @@ -995,6 +1089,11 @@ asmc_mb_sysctl_fantargetspeed(SYSCTL_HAN v = asmc_fan_getvalue(dev, ASMC_KEY_FANTARGETSPEED, fan); error = sysctl_handle_int(oidp, &v, 0, req); + if (error == 0 && req->newptr != NULL) { + unsigned int newspeed = *(unsigned int *)req->newptr; + asmc_fan_setvalue(dev, ASMC_KEY_FANTARGETSPEED, fan, newspeed); + } + return (error); } @@ -1009,7 +1108,7 @@ asmc_temp_getvalue(device_t dev, const c /* * Check for invalid temperatures. */ - if (asmc_key_read(dev, key, buf, 2) < 0) + if (asmc_key_read(dev, key, buf, sizeof buf) < 0) return (-1); return (buf[0]); @@ -1042,7 +1141,7 @@ asmc_sms_read(device_t dev, const char * case 'X': case 'Y': case 'Z': - error = asmc_key_read(dev, key, buf, 2); + error = asmc_key_read(dev, key, buf, sizeof buf); break; default: device_printf(dev, "%s called with invalid argument %s\n", @@ -1197,7 +1296,7 @@ asmc_mbp_sysctl_light_left(SYSCTL_HANDLE int error; int32_t v; - asmc_key_read(dev, ASMC_KEY_LIGHTLEFT, buf, 6); + asmc_key_read(dev, ASMC_KEY_LIGHTLEFT, buf, sizeof buf); v = buf[2]; error = sysctl_handle_int(oidp, &v, sizeof(v), req); @@ -1212,7 +1311,7 @@ asmc_mbp_sysctl_light_right(SYSCTL_HANDL int error; int32_t v; - asmc_key_read(dev, ASMC_KEY_LIGHTRIGHT, buf, 6); + asmc_key_read(dev, ASMC_KEY_LIGHTRIGHT, buf, sizeof buf); v = buf[2]; error = sysctl_handle_int(oidp, &v, sizeof(v), req); @@ -1236,7 +1335,7 @@ asmc_mbp_sysctl_light_control(SYSCTL_HAN v = level; buf[0] = level; buf[1] = 0x00; - asmc_key_write(dev, ASMC_KEY_LIGHTVALUE, buf, 2); + asmc_key_write(dev, ASMC_KEY_LIGHTVALUE, buf, sizeof buf); } return (error); Modified: stable/9/sys/dev/asmc/asmcvar.h ============================================================================== --- stable/9/sys/dev/asmc/asmcvar.h Fri Oct 31 18:35:03 2014 (r273914) +++ stable/9/sys/dev/asmc/asmcvar.h Fri Oct 31 18:42:56 2014 (r273915) @@ -27,7 +27,7 @@ * */ -#define ASMC_MAXFANS 2 +#define ASMC_MAXFANS 6 struct asmc_softc { device_t sc_dev; @@ -83,6 +83,7 @@ struct asmc_softc { */ #define ASMC_KEY_FANCOUNT "FNum" /* RO; 1 byte */ #define ASMC_KEY_FANMANUAL "FS! " /* RW; 2 bytes */ +#define ASMC_KEY_FANID "F%dID" /* RO; 16 bytes */ #define ASMC_KEY_FANSPEED "F%dAc" /* RO; 2 bytes */ #define ASMC_KEY_FANMINSPEED "F%dMn" /* RO; 2 bytes */ #define ASMC_KEY_FANMAXSPEED "F%dMx" /* RO; 2 bytes */ @@ -132,7 +133,7 @@ struct asmc_softc { * */ /* maximum array size for temperatures including the last NULL */ -#define ASMC_TEMP_MAX 36 +#define ASMC_TEMP_MAX 80 #define ASMC_MB_TEMPS { "TB0T", "TN0P", "TN1P", "Th0H", "Th1H", \ "TM0P", NULL } #define ASMC_MB_TEMPNAMES { "enclosure", "northbridge1", \ @@ -175,6 +176,57 @@ struct asmc_softc { "Unknown", "Unknown", \ "Wireless Module", } +#define ASMC_MBP8_TEMPS { "TB0T", "TB1T", "TB2T", "TC0C", "TC0D", \ + "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \ + "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \ + "TCTD", "TG0D", "TG0P", "THSP", "TM0S", \ + "TMBS", "TP0P", "TPCD", "TW0P", "Th1H", \ + "Th2H", "Tm0P", "Ts0P", "Ts0S", NULL } + +#define ASMC_MBP8_TEMPNAMES { "enclosure", "TB1T", "TB2T", "TC0C", "TC0D", \ + "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \ + "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \ + "TCTD", "graphics", "TG0P", "THSP", "TM0S", \ + "TMBS", "TP0P", "TPCD", "wireless", "Th1H", \ + "Th2H", "memory", "Ts0P", "Ts0S" } + +#define ASMC_MBP8_TEMPDESCS { "Enclosure Bottomside", "TB1T", "TB2T", "TC0C", "TC0D", \ + "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \ + "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \ + "TCTD", "TG0D", "TG0P", "THSP", "TM0S", \ + "TMBS", "TP0P", "TPCD", "TW0P", "Th1H", \ + "Th2H", "Tm0P", "Ts0P", "Ts0S" } + +#define ASMC_MBP11_TEMPS { "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \ + "TC0F", "TC0P", "TC1C", "TC2C", "TC3C", \ + "TC4C", "TCFC", "TCGC", "TCSA", "TCTD", \ + "TCXC", "TG0D", "TG0P", "TG1D", "TG1F", \ + "TG1d", "TH0A", "TH0B", "TH0F", "TH0R", \ + "TH0V", "TH0a", "TH0b", "TH0c", "TM0P", \ + "TM0S", "TP0P", "TPCD", "TW0P", "Ta0P", \ + "TaSP", "Th1H", "Th2H", "Ts0P", "Ts0S", \ + "Ts1S", NULL } + +#define ASMC_MBP11_TEMPNAMES { "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \ + "TC0F", "TC0P", "TC1C", "TC2C", "TC3C", \ + "TC4C", "TCFC", "TCGC", "TCSA", "TCTD", \ + "TCXC", "TG0D", "TG0P", "TG1D", "TG1F", \ + "TG1d", "TH0A", "TH0B", "TH0F", "TH0R", \ + "TH0V", "TH0a", "TH0b", "TH0c", "TM0P", \ + "TM0S", "TP0P", "TPCD", "TW0P", "Ta0P", \ + "TaSP", "Th1H", "Th2H", "Ts0P", "Ts0S", \ + "Ts1S" } + +#define ASMC_MBP11_TEMPDESCS { "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \ + "TC0F", "TC0P", "TC1C", "TC2C", "TC3C", \ + "TC4C", "TCFC", "TCGC", "TCSA", "TCTD", \ + "TCXC", "TG0D", "TG0P", "TG1D", "TG1F", \ + "TG1d", "TH0A", "TH0B", "TH0F", "TH0R", \ + "TH0V", "TH0a", "TH0b", "TH0c", "TM0P", \ + "TM0S", "TP0P", "TPCD", "TW0P", "Ta0P", \ + "TaSP", "Th1H", "Th2H", "Ts0P", "Ts0S", \ + "Ts1S" } + #define ASMC_MM_TEMPS { "TN0P", "TN1P", NULL } #define ASMC_MM_TEMPNAMES { "northbridge1", "northbridge2" } #define ASMC_MM_TEMPDESCS { "Northbridge Point 1", \ @@ -214,8 +266,7 @@ struct asmc_softc { "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \ "TMAS", "TMBS", "TM0P", "TM0S", "TM1P", \ "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", \ - "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", \ - NULL } + "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", } #define ASMC_MP_TEMPDESCS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ @@ -223,9 +274,66 @@ struct asmc_softc { "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \ "TMAS", "TMBS", "TM0P", "TM0S", "TM1P", \ "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", \ - "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", \ + "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", } + +#define ASMC_MP5_TEMPS { "TA0P", "TCAC", "TCAD", "TCAG", "TCAH", \ + "TCAS", "TCBC", "TCBD", "TCBG", "TCBH", \ + "TCBS", "TH1F", "TH1P", "TH1V", "TH2F", \ + "TH2P", "TH2V", "TH3F", "TH3P", "TH3V", \ + "TH4F", "TH4P", "TH4V", "THPS", "THTG", \ + "TM1P", "TM2P", "TM2V", "TM3P", "TM3V", \ + "TM4P", "TM5P", "TM6P", "TM6V", "TM7P", \ + "TM7V", "TM8P", "TM8V", "TM9V", "TMA1", \ + "TMA2", "TMA3", "TMA4", "TMB1", "TMB2", \ + "TMB3", "TMB4", "TMHS", "TMLS", "TMPS", \ + "TMPV", "TMTG", "TN0D", "TN0H", "TNTG", \ + "Te1F", "Te1P", "Te1S", "Te2F", "Te2S", \ + "Te3F", "Te3S", "Te4F", "Te4S", "Te5F", \ + "Te5S", "TeGG", "TeGP", "TeRG", "TeRP", \ + "TeRV", "Tp0C", "Tp1C", "TpPS", "TpTG", \ NULL } +#define ASMC_MP5_TEMPNAMES { "ambient", "TCAC", "TCAD", "TCAG", "TCAH", \ + "TCAS", "TCBC", "TCBD", "TCBG", "TCBH", \ + "TCBS", "TH1F", "TH1P", "TH1V", "TH2F", \ + "TH2P", "TH2V", "TH3F", "TH3P", "TH3V", \ + "TH4F", "TH4P", "TH4V", "THPS", "THTG", \ + "TM1P", "TM2P", "TM2V", "TM3P", "TM3V", \ + "TM4P", "TM5P", "TM6P", "TM6V", "TM7P", \ + "TM7V", "TM8P", "TM8V", "TM9V", "ram_a1", \ + "ram_a2", "ram_a3", "ram_a4", "ram_b1", "ram_b2", \ + "ram_b3", "ram_b4", "TMHS", "TMLS", "TMPS", \ + "TMPV", "TMTG", "TN0D", "TN0H", "TNTG", \ + "Te1F", "Te1P", "Te1S", "Te2F", "Te2S", \ + "Te3F", "Te3S", "Te4F", "Te4S", "Te5F", \ + "Te5S", "TeGG", "TeGP", "TeRG", "TeRP", \ + "TeRV", "Tp0C", "Tp1C", "TpPS", "TpTG", } + +#define ASMC_MP5_TEMPDESCS { "TA0P", "TCAC", "TCAD", "TCAG", "TCAH", \ + "TCAS", "TCBC", "TCBD", "TCBG", "TCBH", \ + "TCBS", "TH1F", "TH1P", "TH1V", "TH2F", \ + "TH2P", "TH2V", "TH3F", "TH3P", "TH3V", \ + "TH4F", "TH4P", "TH4V", "THPS", "THTG", \ + "TM1P", "TM2P", "TM2V", "TM3P", "TM3V", \ + "TM4P", "TM5P", "TM6P", "TM6V", "TM7P", \ + "TM7V", "TM8P", "TM8V", "TM9V", "TMA1", \ + "TMA2", "TMA3", "TMA4", "TMB1", "TMB2", \ + "TMB3", "TMB4", "TMHS", "TMLS", "TMPS", \ + "TMPV", "TMTG", "TN0D", "TN0H", "TNTG", \ + "Te1F", "Te1P", "Te1S", "Te2F", "Te2S", \ + "Te3F", "Te3S", "Te4F", "Te4S", "Te5F", \ + "Te5S", "TeGG", "TeGP", "TeRG", "TeRP", \ + "TeRV", "Tp0C", "Tp1C", "TpPS", "TpTG", } + #define ASMC_MBA_TEMPS { "TB0T", NULL } #define ASMC_MBA_TEMPNAMES { "enclosure" } #define ASMC_MBA_TEMPDESCS { "Enclosure Bottom" } + +#define ASMC_MBA3_TEMPS { "TB0T", "TB1T", "TB2T", \ + "TC0D", "TC0E", "TC0P", NULL } + +#define ASMC_MBA3_TEMPNAMES { "enclosure", "TB1T", "TB2T", \ + "TC0D", "TC0E", "TC0P" } + +#define ASMC_MBA3_TEMPDESCS { "Enclosure Bottom", "TB1T", "TB2T", \ + "TC0D", "TC0E", "TC0P" } From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 18:53:19 2014 Return-Path: Delivered-To: svn-src-all@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 10F9BE2F; Fri, 31 Oct 2014 18:53: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 EE6B3DCF; Fri, 31 Oct 2014 18:53: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 s9VIrI3T092919; Fri, 31 Oct 2014 18:53:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VIrHml092912; Fri, 31 Oct 2014 18:53:17 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410311853.s9VIrHml092912@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 31 Oct 2014 18:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r273916 - in stable/9/sys: dev/acpi_support dev/acpica dev/asmc net netinet netinet/cc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 18:53:19 -0000 Author: hselasky Date: Fri Oct 31 18:53:16 2014 New Revision: 273916 URL: https://svnweb.freebsd.org/changeset/base/273916 Log: MFC r273733, r273740 and r273773: The SYSCTL data pointers can come from userspace and must not be directly accessed. Although this will work on some platforms, it can throw an exception if the pointer is invalid and then panic the kernel. Sponsored by: Mellanox Technologies Modified: stable/9/sys/dev/acpi_support/acpi_ibm.c stable/9/sys/dev/acpica/acpi.c stable/9/sys/dev/asmc/asmc.c stable/9/sys/net/bpf.c stable/9/sys/netinet/cc/cc.c stable/9/sys/netinet/sctp_sysctl.c stable/9/sys/netinet/siftr.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/net/ (props changed) Modified: stable/9/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- stable/9/sys/dev/acpi_support/acpi_ibm.c Fri Oct 31 18:42:56 2014 (r273915) +++ stable/9/sys/dev/acpi_support/acpi_ibm.c Fri Oct 31 18:53:16 2014 (r273916) @@ -899,6 +899,7 @@ acpi_ibm_handlerevents_sysctl(SYSCTL_HAN char *cp, *ep; int l, val; unsigned int handler_events; + char temp[128]; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -920,17 +921,18 @@ acpi_ibm_handlerevents_sysctl(SYSCTL_HAN sbuf_trim(&sb); sbuf_finish(&sb); - - /* Copy out the old values to the user. */ - error = SYSCTL_OUT(req, sbuf_data(&sb), sbuf_len(&sb)); + strlcpy(temp, sbuf_data(&sb), sizeof(temp)); sbuf_delete(&sb); + error = sysctl_handle_string(oidp, temp, sizeof(temp), req); + + /* Check for error or no change */ if (error != 0 || req->newptr == NULL) goto out; /* If the user is setting a string, parse it. */ handler_events = 0; - cp = (char *)req->newptr; + cp = temp; while (*cp) { if (isspace(*cp)) { cp++; Modified: stable/9/sys/dev/acpica/acpi.c ============================================================================== --- stable/9/sys/dev/acpica/acpi.c Fri Oct 31 18:42:56 2014 (r273915) +++ stable/9/sys/dev/acpica/acpi.c Fri Oct 31 18:53:16 2014 (r273916) @@ -3744,6 +3744,7 @@ acpi_debug_sysctl(SYSCTL_HANDLER_ARGS) int error, *dbg; struct debugtag *tag; struct sbuf sb; + char temp[128]; if (sbuf_new(&sb, NULL, 128, SBUF_AUTOEXTEND) == NULL) return (ENOMEM); @@ -3767,15 +3768,15 @@ acpi_debug_sysctl(SYSCTL_HANDLER_ARGS) } sbuf_trim(&sb); sbuf_finish(&sb); - - /* Copy out the old values to the user. */ - error = SYSCTL_OUT(req, sbuf_data(&sb), sbuf_len(&sb)); + strlcpy(temp, sbuf_data(&sb), sizeof(temp)); sbuf_delete(&sb); - /* If the user is setting a string, parse it. */ + error = sysctl_handle_string(oidp, temp, sizeof(temp), req); + + /* Check for error or no change */ if (error == 0 && req->newptr != NULL) { *dbg = 0; - setenv((char *)oidp->oid_arg1, (char *)req->newptr); + setenv((char *)oidp->oid_arg1, temp); acpi_set_debugging(NULL); } ACPI_SERIAL_END(acpi); Modified: stable/9/sys/dev/asmc/asmc.c ============================================================================== --- stable/9/sys/dev/asmc/asmc.c Fri Oct 31 18:42:56 2014 (r273915) +++ stable/9/sys/dev/asmc/asmc.c Fri Oct 31 18:53:16 2014 (r273916) @@ -1052,7 +1052,7 @@ asmc_mb_sysctl_fanminspeed(SYSCTL_HANDLE error = sysctl_handle_int(oidp, &v, 0, req); if (error == 0 && req->newptr != NULL) { - unsigned int newspeed = *(unsigned int *)req->newptr; + unsigned int newspeed = v; asmc_fan_setvalue(dev, ASMC_KEY_FANMINSPEED, fan, newspeed); } @@ -1071,7 +1071,7 @@ asmc_mb_sysctl_fanmaxspeed(SYSCTL_HANDLE error = sysctl_handle_int(oidp, &v, 0, req); if (error == 0 && req->newptr != NULL) { - unsigned int newspeed = *(unsigned int *)req->newptr; + unsigned int newspeed = v; asmc_fan_setvalue(dev, ASMC_KEY_FANMAXSPEED, fan, newspeed); } @@ -1090,7 +1090,7 @@ asmc_mb_sysctl_fantargetspeed(SYSCTL_HAN error = sysctl_handle_int(oidp, &v, 0, req); if (error == 0 && req->newptr != NULL) { - unsigned int newspeed = *(unsigned int *)req->newptr; + unsigned int newspeed = v; asmc_fan_setvalue(dev, ASMC_KEY_FANTARGETSPEED, fan, newspeed); } @@ -1283,7 +1283,7 @@ asmc_mb_sysctl_sms_z(SYSCTL_HANDLER_ARGS asmc_sms_read(dev, ASMC_KEY_SMS_Z, &val); v = (int32_t) val; - error = sysctl_handle_int(oidp, &v, sizeof(v), req); + error = sysctl_handle_int(oidp, &v, 0, req); return (error); } @@ -1298,7 +1298,7 @@ asmc_mbp_sysctl_light_left(SYSCTL_HANDLE asmc_key_read(dev, ASMC_KEY_LIGHTLEFT, buf, sizeof buf); v = buf[2]; - error = sysctl_handle_int(oidp, &v, sizeof(v), req); + error = sysctl_handle_int(oidp, &v, 0, req); return (error); } @@ -1313,7 +1313,7 @@ asmc_mbp_sysctl_light_right(SYSCTL_HANDL asmc_key_read(dev, ASMC_KEY_LIGHTRIGHT, buf, sizeof buf); v = buf[2]; - error = sysctl_handle_int(oidp, &v, sizeof(v), req); + error = sysctl_handle_int(oidp, &v, 0, req); return (error); } @@ -1324,19 +1324,19 @@ asmc_mbp_sysctl_light_control(SYSCTL_HAN device_t dev = (device_t) arg1; uint8_t buf[2]; int error; - unsigned int level; - static int32_t v; - - error = sysctl_handle_int(oidp, &v, sizeof(v), req); + static unsigned int level; + int v; + + v = level; + error = sysctl_handle_int(oidp, &v, 0, req); + if (error == 0 && req->newptr != NULL) { - level = *(unsigned int *)req->newptr; - if (level > 255) + if (v < 0 || v > 255) return (EINVAL); - v = level; + level = v; buf[0] = level; buf[1] = 0x00; asmc_key_write(dev, ASMC_KEY_LIGHTVALUE, buf, sizeof buf); } - return (error); } Modified: stable/9/sys/net/bpf.c ============================================================================== --- stable/9/sys/net/bpf.c Fri Oct 31 18:42:56 2014 (r273915) +++ stable/9/sys/net/bpf.c Fri Oct 31 18:53:16 2014 (r273916) @@ -2758,7 +2758,8 @@ bpfstats_fill_xbpf(struct xbpf_d *d, str static int bpf_stats_sysctl(SYSCTL_HANDLER_ARGS) { - struct xbpf_d *xbdbuf, *xbd, zerostats; + static const struct xbpf_d zerostats; + struct xbpf_d *xbdbuf, *xbd, tempstats; int index, error; struct bpf_if *bp; struct bpf_d *bd; @@ -2778,11 +2779,13 @@ bpf_stats_sysctl(SYSCTL_HANDLER_ARGS) * as we aren't allowing the user to set the counters currently. */ if (req->newptr != NULL) { - if (req->newlen != sizeof(zerostats)) + if (req->newlen != sizeof(tempstats)) return (EINVAL); - bzero(&zerostats, sizeof(zerostats)); - xbd = req->newptr; - if (bcmp(xbd, &zerostats, sizeof(*xbd)) != 0) + memset(&tempstats, 0, sizeof(tempstats)); + error = SYSCTL_IN(req, &tempstats, sizeof(tempstats)); + if (error) + return (error); + if (bcmp(&tempstats, &zerostats, sizeof(tempstats)) != 0) return (EINVAL); bpf_zero_counters(); return (0); Modified: stable/9/sys/netinet/cc/cc.c ============================================================================== --- stable/9/sys/netinet/cc/cc.c Fri Oct 31 18:42:56 2014 (r273915) +++ stable/9/sys/netinet/cc/cc.c Fri Oct 31 18:53:16 2014 (r273916) @@ -92,33 +92,33 @@ cc_default_algo(SYSCTL_HANDLER_ARGS) { char default_cc[TCP_CA_NAME_MAX]; struct cc_algo *funcs; - int err, found; + int error; - err = found = 0; + /* Get the current default: */ + CC_LIST_RLOCK(); + strlcpy(default_cc, CC_DEFAULT()->name, sizeof(default_cc)); + CC_LIST_RUNLOCK(); - if (req->newptr == NULL) { - /* Just print the current default. */ - CC_LIST_RLOCK(); - strlcpy(default_cc, CC_DEFAULT()->name, TCP_CA_NAME_MAX); - CC_LIST_RUNLOCK(); - err = sysctl_handle_string(oidp, default_cc, 0, req); - } else { - /* Find algo with specified name and set it to default. */ - CC_LIST_RLOCK(); - STAILQ_FOREACH(funcs, &cc_list, entries) { - if (strncmp((char *)req->newptr, funcs->name, - TCP_CA_NAME_MAX) == 0) { - found = 1; - V_default_cc_ptr = funcs; - } - } - CC_LIST_RUNLOCK(); + error = sysctl_handle_string(oidp, default_cc, sizeof(default_cc), req); - if (!found) - err = ESRCH; - } + /* Check for error or no change */ + if (error != 0 || req->newptr == NULL) + goto done; - return (err); + error = ESRCH; + + /* Find algo with specified name and set it to default. */ + CC_LIST_RLOCK(); + STAILQ_FOREACH(funcs, &cc_list, entries) { + if (strncmp(default_cc, funcs->name, sizeof(default_cc))) + continue; + V_default_cc_ptr = funcs; + error = 0; + break; + } + CC_LIST_RUNLOCK(); +done: + return (error); } /* Modified: stable/9/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.c Fri Oct 31 18:42:56 2014 (r273915) +++ stable/9/sys/netinet/sctp_sysctl.c Fri Oct 31 18:53:16 2014 (r273916) @@ -684,14 +684,18 @@ static int sysctl_stat_get(SYSCTL_HANDLER_ARGS) { int cpu, error; - struct sctpstat sb, *sarry, *cpin = NULL; + struct sctpstat sb, sb_temp, *sarry, *cpin = NULL; if ((req->newptr) && (req->newlen == sizeof(struct sctpstat))) { /* * User wants us to clear or at least reset the counters to * the specified values. */ - cpin = (struct sctpstat *)req->newptr; + cpin = &sb_temp; + memset(&sb_temp, 0, sizeof(sb_temp)); + error = SYSCTL_IN(req, &sb_temp, sizeof(sb_temp)); + if (error != 0) + return (error); } else if (req->newptr) { /* Must be a stat structure */ return (EINVAL); Modified: stable/9/sys/netinet/siftr.c ============================================================================== --- stable/9/sys/netinet/siftr.c Fri Oct 31 18:42:56 2014 (r273915) +++ stable/9/sys/netinet/siftr.c Fri Oct 31 18:53:16 2014 (r273916) @@ -266,6 +266,7 @@ static unsigned int siftr_pkts_per_log = static unsigned int siftr_generate_hashes = 0; /* static unsigned int siftr_binary_log = 0; */ static char siftr_logfile[PATH_MAX] = "/var/log/siftr.log"; +static char siftr_logfile_shadow[PATH_MAX] = "/var/log/siftr.log"; static u_long siftr_hashmask; STAILQ_HEAD(pkthead, pkt_node) pkt_queue = STAILQ_HEAD_INITIALIZER(pkt_queue); LIST_HEAD(listhead, flow_hash_node) *counter_hash; @@ -297,7 +298,7 @@ SYSCTL_PROC(_net_inet_siftr, OID_AUTO, e "switch siftr module operations on/off"); SYSCTL_PROC(_net_inet_siftr, OID_AUTO, logfile, CTLTYPE_STRING|CTLFLAG_RW, - &siftr_logfile, sizeof(siftr_logfile), &siftr_sysctl_logfile_name_handler, + &siftr_logfile_shadow, sizeof(siftr_logfile_shadow), &siftr_sysctl_logfile_name_handler, "A", "file to save siftr log messages to"); SYSCTL_UINT(_net_inet_siftr, OID_AUTO, ppl, CTLFLAG_RW, @@ -1142,38 +1143,38 @@ siftr_sysctl_logfile_name_handler(SYSCTL struct alq *new_alq; int error; - if (req->newptr == NULL) - goto skip; - - /* If old filename and new filename are different. */ - if (strncmp(siftr_logfile, (char *)req->newptr, PATH_MAX)) { - - error = alq_open(&new_alq, req->newptr, curthread->td_ucred, - SIFTR_LOG_FILE_MODE, SIFTR_ALQ_BUFLEN, 0); + error = sysctl_handle_string(oidp, arg1, arg2, req); - /* Bail if unable to create new alq. */ - if (error) - return (1); + /* Check for error or same filename */ + if (error != 0 || req->newptr == NULL || + strncmp(siftr_logfile, arg1, arg2) == 0) + goto done; + + /* Filname changed */ + error = alq_open(&new_alq, arg1, curthread->td_ucred, + SIFTR_LOG_FILE_MODE, SIFTR_ALQ_BUFLEN, 0); + if (error != 0) + goto done; - /* - * If disabled, siftr_alq == NULL so we simply close - * the alq as we've proved it can be opened. - * If enabled, close the existing alq and switch the old - * for the new. - */ - if (siftr_alq == NULL) - alq_close(new_alq); - else { - alq_close(siftr_alq); - siftr_alq = new_alq; - } + /* + * If disabled, siftr_alq == NULL so we simply close + * the alq as we've proved it can be opened. + * If enabled, close the existing alq and switch the old + * for the new. + */ + if (siftr_alq == NULL) { + alq_close(new_alq); + } else { + alq_close(siftr_alq); + siftr_alq = new_alq; } -skip: - return (sysctl_handle_string(oidp, arg1, arg2, req)); + /* Update filename upon success */ + strlcpy(siftr_logfile, arg1, arg2); +done: + return (error); } - static int siftr_manage_ops(uint8_t action) { From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 19:15:16 2014 Return-Path: Delivered-To: svn-src-all@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 30E5BFF2; Fri, 31 Oct 2014 19:15: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 1CBE2DF; Fri, 31 Oct 2014 19:15: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 s9VJFFbX003535; Fri, 31 Oct 2014 19:15:15 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VJFEDZ003525; Fri, 31 Oct 2014 19:15:14 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201410311915.s9VJFEDZ003525@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 31 Oct 2014 19:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273917 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 19:15:16 -0000 Author: loos Date: Fri Oct 31 19:15:14 2014 New Revision: 273917 URL: https://svnweb.freebsd.org/changeset/base/273917 Log: Fix the gpiobus locking by using a more sane model where it isn't necessary hold the gpiobus lock between the gpio calls. gpiobus_acquire_lock() now accepts a third parameter which tells gpiobus what to do when the bus is already busy. When GPIOBUS_WAIT wait is used, the calling thread will be put to sleep until the bus became free. With GPIOBUS_DONTWAIT the calling thread will receive EWOULDBLOCK right away and then it can act upon. This fixes the gpioiic(4) locking issues that arises when doing multiple concurrent access on the bus. Modified: head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobus_if.m head/sys/dev/gpio/gpiobusvar.h head/sys/dev/gpio/gpioiic.c head/sys/dev/gpio/gpioled.c Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Fri Oct 31 18:53:16 2014 (r273916) +++ head/sys/dev/gpio/gpiobus.c Fri Oct 31 19:15:14 2014 (r273917) @@ -53,9 +53,7 @@ static void gpiobus_hinted_child(device_ /* * GPIOBUS interface */ -static void gpiobus_lock_bus(device_t); -static void gpiobus_unlock_bus(device_t); -static void gpiobus_acquire_bus(device_t, device_t); +static int gpiobus_acquire_bus(device_t, device_t, int); static void gpiobus_release_bus(device_t, device_t); static int gpiobus_pin_setflags(device_t, device_t, uint32_t, uint32_t); static int gpiobus_pin_getflags(device_t, device_t, uint32_t, uint32_t*); @@ -326,37 +324,26 @@ gpiobus_hinted_child(device_t bus, const device_delete_child(bus, child); } -static void -gpiobus_lock_bus(device_t busdev) +static int +gpiobus_acquire_bus(device_t busdev, device_t child, int how) { struct gpiobus_softc *sc; sc = device_get_softc(busdev); GPIOBUS_ASSERT_UNLOCKED(sc); GPIOBUS_LOCK(sc); -} - -static void -gpiobus_unlock_bus(device_t busdev) -{ - struct gpiobus_softc *sc; - - sc = device_get_softc(busdev); - GPIOBUS_ASSERT_LOCKED(sc); + if (sc->sc_owner != NULL) { + if (how == GPIOBUS_DONTWAIT) { + GPIOBUS_UNLOCK(sc); + return (EWOULDBLOCK); + } + while (sc->sc_owner != NULL) + mtx_sleep(sc, &sc->sc_mtx, 0, "gpiobuswait", 0); + } + sc->sc_owner = child; GPIOBUS_UNLOCK(sc); -} -static void -gpiobus_acquire_bus(device_t busdev, device_t child) -{ - struct gpiobus_softc *sc; - - sc = device_get_softc(busdev); - GPIOBUS_ASSERT_LOCKED(sc); - - if (sc->sc_owner) - panic("gpiobus: cannot serialize the access to device."); - sc->sc_owner = child; + return (0); } static void @@ -365,14 +352,15 @@ gpiobus_release_bus(device_t busdev, dev struct gpiobus_softc *sc; sc = device_get_softc(busdev); - GPIOBUS_ASSERT_LOCKED(sc); - - if (!sc->sc_owner) + GPIOBUS_ASSERT_UNLOCKED(sc); + GPIOBUS_LOCK(sc); + if (sc->sc_owner == NULL) panic("gpiobus: releasing unowned bus."); if (sc->sc_owner != child) panic("gpiobus: you don't own the bus. game over."); - sc->sc_owner = NULL; + wakeup(sc); + GPIOBUS_UNLOCK(sc); } static int @@ -469,8 +457,6 @@ static device_method_t gpiobus_methods[] DEVMETHOD(bus_hinted_child, gpiobus_hinted_child), /* GPIO protocol */ - DEVMETHOD(gpiobus_lock_bus, gpiobus_lock_bus), - DEVMETHOD(gpiobus_unlock_bus, gpiobus_unlock_bus), DEVMETHOD(gpiobus_acquire_bus, gpiobus_acquire_bus), DEVMETHOD(gpiobus_release_bus, gpiobus_release_bus), DEVMETHOD(gpiobus_pin_getflags, gpiobus_pin_getflags), Modified: head/sys/dev/gpio/gpiobus_if.m ============================================================================== --- head/sys/dev/gpio/gpiobus_if.m Fri Oct 31 18:53:16 2014 (r273916) +++ head/sys/dev/gpio/gpiobus_if.m Fri Oct 31 19:15:14 2014 (r273917) @@ -32,25 +32,12 @@ INTERFACE gpiobus; # -# Lock the gpio bus -# -METHOD void lock_bus { - device_t busdev; -}; - -# -# Unlock the gpio bus -# -METHOD void unlock_bus { - device_t busdev; -}; - -# # Dedicate the gpio bus control for a child # -METHOD void acquire_bus { +METHOD int acquire_bus { device_t busdev; device_t dev; + int how; }; # Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Fri Oct 31 18:53:16 2014 (r273916) +++ head/sys/dev/gpio/gpiobusvar.h Fri Oct 31 19:15:14 2014 (r273917) @@ -56,6 +56,9 @@ #define GPIOBUS_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED) #define GPIOBUS_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED) +#define GPIOBUS_WAIT 1 +#define GPIOBUS_DONTWAIT 2 + struct gpiobus_softc { struct mtx sc_mtx; /* bus mutex */ Modified: head/sys/dev/gpio/gpioiic.c ============================================================================== --- head/sys/dev/gpio/gpioiic.c Fri Oct 31 18:53:16 2014 (r273916) +++ head/sys/dev/gpio/gpioiic.c Fri Oct 31 19:15:14 2014 (r273917) @@ -154,18 +154,18 @@ static int gpioiic_callback(device_t dev, int index, caddr_t data) { struct gpioiic_softc *sc = device_get_softc(dev); - int error = 0; + int error, how; + how = GPIOBUS_DONTWAIT; + if (data != NULL && (int)*data == IIC_WAIT) + how = GPIOBUS_WAIT; + error = 0; switch (index) { case IIC_REQUEST_BUS: - GPIOBUS_LOCK_BUS(sc->sc_busdev); - GPIOBUS_ACQUIRE_BUS(sc->sc_busdev, sc->sc_dev); - GPIOBUS_UNLOCK_BUS(sc->sc_busdev); + error = GPIOBUS_ACQUIRE_BUS(sc->sc_busdev, sc->sc_dev, how); break; case IIC_RELEASE_BUS: - GPIOBUS_LOCK_BUS(sc->sc_busdev); GPIOBUS_RELEASE_BUS(sc->sc_busdev, sc->sc_dev); - GPIOBUS_UNLOCK_BUS(sc->sc_busdev); break; default: error = EINVAL; Modified: head/sys/dev/gpio/gpioled.c ============================================================================== --- head/sys/dev/gpio/gpioled.c Fri Oct 31 18:53:16 2014 (r273916) +++ head/sys/dev/gpio/gpioled.c Fri Oct 31 19:15:14 2014 (r273917) @@ -79,16 +79,23 @@ static int gpioled_detach(device_t); static void gpioled_control(void *priv, int onoff) { - struct gpioled_softc *sc = priv; + int error; + struct gpioled_softc *sc; + + sc = (struct gpioled_softc *)priv; GPIOLED_LOCK(sc); - GPIOBUS_LOCK_BUS(sc->sc_busdev); - GPIOBUS_ACQUIRE_BUS(sc->sc_busdev, sc->sc_dev); - GPIOBUS_PIN_SETFLAGS(sc->sc_busdev, sc->sc_dev, GPIOLED_PIN, - GPIO_PIN_OUTPUT); - GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, GPIOLED_PIN, - onoff ? GPIO_PIN_HIGH : GPIO_PIN_LOW); + error = GPIOBUS_ACQUIRE_BUS(sc->sc_busdev, sc->sc_dev, + GPIOBUS_DONTWAIT); + if (error != 0) { + GPIOLED_UNLOCK(sc); + return; + } + error = GPIOBUS_PIN_SETFLAGS(sc->sc_busdev, sc->sc_dev, + GPIOLED_PIN, GPIO_PIN_OUTPUT); + if (error == 0) + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, GPIOLED_PIN, + onoff ? GPIO_PIN_HIGH : GPIO_PIN_LOW); GPIOBUS_RELEASE_BUS(sc->sc_busdev, sc->sc_dev); - GPIOBUS_UNLOCK_BUS(sc->sc_busdev); GPIOLED_UNLOCK(sc); } From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 19:26:13 2014 Return-Path: Delivered-To: svn-src-all@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 BDE13A30; Fri, 31 Oct 2014 19:26: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 9AE9525A; Fri, 31 Oct 2014 19:26: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 s9VJQDB1008825; Fri, 31 Oct 2014 19:26:13 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VJQDXJ008824; Fri, 31 Oct 2014 19:26:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410311926.s9VJQDXJ008824@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 31 Oct 2014 19:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273918 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 19:26:13 -0000 Author: trasz Date: Fri Oct 31 19:26:12 2014 New Revision: 273918 URL: https://svnweb.freebsd.org/changeset/base/273918 Log: Change the default log level for iSCSI target from 3 to 1. It should have been 1 from the beginning; not sure how it ended up at 3. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Fri Oct 31 19:15:14 2014 (r273917) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Fri Oct 31 19:26:12 2014 (r273918) @@ -84,7 +84,7 @@ static uma_zone_t cfiscsi_data_wait_zone SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, iscsi, CTLFLAG_RD, 0, "CAM Target Layer iSCSI Frontend"); -static int debug = 3; +static int debug = 1; SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, debug, CTLFLAG_RWTUN, &debug, 1, "Enable debug messages"); static int ping_timeout = 5; From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 21:05:00 2014 Return-Path: Delivered-To: svn-src-all@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 04DE2306; Fri, 31 Oct 2014 21:05:00 +0000 (UTC) Received: from mail-pd0-x22d.google.com (mail-pd0-x22d.google.com [IPv6:2607:f8b0:400e:c02::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B78DF17D; Fri, 31 Oct 2014 21:04:59 +0000 (UTC) Received: by mail-pd0-f173.google.com with SMTP id v10so7946164pde.18 for ; Fri, 31 Oct 2014 14:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=syo7zTDGrExCqopBxWbuq9HnJi1zRyVZ5m+uXq0WjM4=; b=uboQ4oe8SG9ZQIA2IZHJ42N2jNrxozx5nW9mTVFA69F1P+JyI1kBEXNbMIH+98wtvx v9wuMj2UBlgpI7bMu5qV70ucMLJgWAURVyuEmH/Nf86RCWSImDOo0TdN7wiitnrSBwqG HKgK+fHm6kXdtTmqfaTbkfk5OdoIpjQ0w9sUd1tJTvtJibnBlrjQYFLzHzekSul1jbUu tTlHA7LkvlYrFZLZtK8gc31bfK8t8BpQciK3+Tec31f6qsr9dq5+aBMl8knLC2oKLNqi jLyrCkiVZgfi3zJFmcGf7IbBQN2rYNNkviV4rjy036ap0+x5DEW5et/oqdTy/HofTCTk r9zg== X-Received: by 10.68.135.33 with SMTP id pp1mr26851133pbb.120.1414789499340; Fri, 31 Oct 2014 14:04:59 -0700 (PDT) Received: from [192.168.20.5] (c-98-247-240-204.hsd1.wa.comcast.net. [98.247.240.204]) by mx.google.com with ESMTPSA id ny9sm10782581pab.25.2014.10.31.14.04.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Oct 2014 14:04:58 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_784D8CF4-A843-45CA-8987-B30DD87FD416"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... From: Garrett Cooper In-Reply-To: <201410302121.s9ULLsEw055630@svn.freebsd.org> Date: Fri, 31 Oct 2014 14:04:57 -0700 Message-Id: <9D38CD22-6BFC-4D55-8E8F-622EC2997723@gmail.com> References: <201410302121.s9ULLsEw055630@svn.freebsd.org> To: Mark Murray X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 21:05:00 -0000 --Apple-Mail=_784D8CF4-A843-45CA-8987-B30DD87FD416 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Oct 30, 2014, at 14:21, Mark Murray wrote: > Author: markm > Date: Thu Oct 30 21:21:53 2014 > New Revision: 273872 > URL: https://svnweb.freebsd.org/changeset/base/273872 >=20 > Log: > This is the much-discussed major upgrade to the random(4) device, = known to you all as /dev/random. >=20 > This code has had an extensive rewrite and a good series of reviews, = both by the author and other parties. This means a lot of code has been = simplified. Pluggable structures for high-rate entropy generators are = available, and it is most definitely not the case that /dev/random can = be driven by only a hardware souce any more. This has been designed out = of the device. Hardware sources are stirred into the CSPRNG (Yarrow, = Fortuna) like any other entropy source. Pluggable modules may be written = by third parties for additional sources. >=20 > The harvesting structures and consequently the locking have been = simplified. Entropy harvesting is done in a more general way (the = documentation for this will follow). There is some GREAT entropy to be = had in the UMA allocator, but it is disabled for now as messing with = that is likely to annoy many people. >=20 > The venerable (but effective) Yarrow algorithm, which is no longer = supported by its authors now has an alternative, Fortuna. For now, = Yarrow is retained as the default algorithm, but this may be changed = using a kernel option. It is intended to make Fortuna the default = algorithm for 11.0. Interested parties are encouraged to read ISBN = 978-0-470-47424-2 "Cryptography Engineering" By Ferguson, Schneier and = Kohno for Fortuna's gory details. Heck, read it anyway. >=20 > Many thanks to Arthur Mesh who did early grunt work, and who got = caught in the crossfire rather more than he deserved to. >=20 > My thanks also to folks who helped me thresh this out on whiteboards = and in the odd "Hallway track", or otherwise. >=20 > My Nomex pants are on. Let the feedback commence! >=20 > Reviewed by: trasz,des(partial),imp(partial?),rwatson(partial?) > Approved by: so(des) Hi Mark, Could you please add an UPDATING entry for this? Some users (like me) = who do make installworld from old kernels are experiencing issues (some = dealing with filesystem corruption). Please see this thread on -current@ = for more details: = https://lists.freebsd.org/pipermail/freebsd-current/2014-October/053039.ht= ml This also should have had =93Relnotes: yes=94 in the commit message = because this deserves to be put in the release notes for 11.0 Thanks! --Apple-Mail=_784D8CF4-A843-45CA-8987-B30DD87FD416 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 iQEcBAEBCgAGBQJUU/l5AAoJEMZr5QU6S73eUAAH/iIxf9FQWxQJF0aAhyoq62eV kax0hHoHARYNtgGQBfifv6y7sjjHx8p3EgfNoW0W5IIuYftoE33WWzmMnp9HPMQE Owepj7sNxTKLvIJNSxJXzDOLH71fqRSliqEdI9n3SfuQTholg9dsqus9k+28zj2X Y+hNOav9M8xR6YdccGG7K4FyJTnafxadWxqjMifvwCbEjDPQkvcd4xoMRLjiaiD9 R/xbkzyz5iLQXPH4o7+vbOe6fXn55sj1/ApTmwLoVrH2iUZZXQVDV8ybFQkQEzLl uDDG40mmBePQun2+u0rEunNs+KikHaXOysi8zZoy6eZ8KNvtM/ytrGzyFzc8dkU= =eYUg -----END PGP SIGNATURE----- --Apple-Mail=_784D8CF4-A843-45CA-8987-B30DD87FD416-- From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 21:30:40 2014 Return-Path: Delivered-To: svn-src-all@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 543B39C3; Fri, 31 Oct 2014 21:30:40 +0000 (UTC) Received: from mail-pd0-x231.google.com (mail-pd0-x231.google.com [IPv6:2607:f8b0:400e:c02::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0ED793D7; Fri, 31 Oct 2014 21:30:40 +0000 (UTC) Received: by mail-pd0-f177.google.com with SMTP id v10so7936986pde.22 for ; Fri, 31 Oct 2014 14:30:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=QOzae4tdRYGSi7lxNg78gh+ogXveLpFaYV+R8/06iTI=; b=sHzN4+b0LRqOpFsNN56IusC6+sTQkccXw9EbKeGyQkXYD+O4bAT0kw/qZRl3uN1s0F o7+qtv/JfJawprHycRIfQY9QKK4ZZ9D8dcx/zFAY6s1nULrkKLKt/SCona/wb3VMFN06 4QQ7KSymnlLodCcVQWlNMvm2nIPQEkPuKHqedz//lkCSDm7XDciMUkasQYtewuqUh24h IT0DyvX3kjNr54+iDoMHQ+4PKGdKLxgO9bzG2tyQKErBdaE7rUpjZNBV9gEaNB/B5Ie8 wD8qzW+LzrPBsNEC+iPFJVyic2oPgJB/HaAIwd2Y0v0yt88UuFmciVb7eGhGi8WRby5i d9uA== X-Received: by 10.68.135.65 with SMTP id pq1mr27210329pbb.18.1414791039647; Fri, 31 Oct 2014 14:30:39 -0700 (PDT) Received: from [192.168.20.5] (c-98-247-240-204.hsd1.wa.comcast.net. [98.247.240.204]) by mx.google.com with ESMTPSA id v4sm4115327pbs.64.2014.10.31.14.30.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Oct 2014 14:30:38 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_537C600A-464D-4B99-B286-17F6C1C194DB"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r273734 - head/bin/dd From: Garrett Cooper In-Reply-To: <20141028210830.L1034@besplex.bde.org> Date: Fri, 31 Oct 2014 14:30:37 -0700 Message-Id: References: <201410271138.s9RBcHrA002447@svn.freebsd.org> <20141027153957.GZ1877@kib.kiev.ua> <20141027155427.GM1492@f10.opsec.eu> <86vbn4egjt.fsf@nine.des.no> <20141028200418.E849@besplex.bde.org> <86mw8ged20.fsf@nine.des.no> <20141028210830.L1034@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1878.6) Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Kurt Jaeger , Konstantin Belousov , =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 21:30:40 -0000 --Apple-Mail=_537C600A-464D-4B99-B286-17F6C1C194DB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Oct 28, 2014, at 4:33, Bruce Evans wrote: > On Tue, 28 Oct 2014, [utf-8] Dag-Erling Sm=F8rgrav wrote: >=20 >> Bruce Evans writes: >>> Dag-Erling Sm=F8rgrav writes: >>>> This is a bug on all platforms, and both clang and (recent) gcc >>>> should complain about it. That printf() call will print garbage. >>> No, this is only a bug on 32-bit arches. The is is SSIZE_MAX. >>=20 >> If you mean "it only has consequences on 32-bit arches", then I agree = - >> but it is still a bug to pass an int to %jd. >=20 > This is machine-dependent. intmax_t may be int. The only requirement > on intmax_t is that it can represent any value of any signed integer > type. This is possible if the largest integer type is 64 bits (the > smallest permitted largest type) and int is also 64 bits (and there > are no complications for padding bits). intmax_t can even be signed > char if that is wide enough (not in POSIX starting 10-15 years ago, > since signed char is now required to be 8 bits. It is weird for > intmax_t to have the lowest rank (not counting Bool), but FreeBSD uses > this loophole to make it have second highest rank on 64-bit arches. Indeed. For some giggles, look at this bug: = https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D191674 = ("printf("%tu", (intmax_t)-1) returns UINT64_MAX on i386, not = UINT32_MAX=94). Cheers, --Apple-Mail=_537C600A-464D-4B99-B286-17F6C1C194DB 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 iQEcBAEBCgAGBQJUU/99AAoJEMZr5QU6S73eaPoIAJoklajBANchbv1dj1yHfslz lOOA+QBzOHsVnc/6mncytOZeu2lUxN86n3EnEkRanyzs0csxMZI2DI+BXdBf3SnT 85WyoiBLMgv+7rqdkUc7xWzmRNQl7uV1CK464sFdpv1rYAaVT1gSCkZmXvKQALgg qPiyBUz4M03P8yNT2tiJPPvK1NYw5e8NYatTaR81Qp9NgTUHvSO0s38oQMHziQ2g MhuWhWWOySzF6NhW/dcBOzB5Hzp8Rbwnio8WIcuwy/zlK5Jeozgb+zQulqEP96UK Q+OJ1AMIJ7WNIy17Ts1kRMdVCdJu3lOrquJ8rdy96tppP0wDAeKYUYIRdtXrVZM= =LbDi -----END PGP SIGNATURE----- --Apple-Mail=_537C600A-464D-4B99-B286-17F6C1C194DB-- From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 22:20:28 2014 Return-Path: Delivered-To: svn-src-all@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 2DB011AC; Fri, 31 Oct 2014 22:20: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 1A206C64; Fri, 31 Oct 2014 22:20: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 s9VMKRdg096415; Fri, 31 Oct 2014 22:20:27 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VMKRaO096404; Fri, 31 Oct 2014 22:20:27 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410312220.s9VMKRaO096404@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 31 Oct 2014 22:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273919 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 22:20:28 -0000 Author: delphij Date: Fri Oct 31 22:20:27 2014 New Revision: 273919 URL: https://svnweb.freebsd.org/changeset/base/273919 Log: rc.d/geli should not depend on random, as the attach functionality do not require additional entropy to function. It would create a circular dependency (not immediately obvious: geli provides 'disks' and requires 'random' as of r273872, 'random' requires 'FILESYSTEMS', 'FILESYSTEMS' requires 'root', 'root' requires 'swap', and finally 'swap' requires 'disk'). Modified: head/etc/rc.d/geli Modified: head/etc/rc.d/geli ============================================================================== --- head/etc/rc.d/geli Fri Oct 31 19:26:12 2014 (r273918) +++ head/etc/rc.d/geli Fri Oct 31 22:20:27 2014 (r273919) @@ -28,7 +28,6 @@ # # PROVIDE: disks -# REQUIRE: random # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 22:28:11 2014 Return-Path: Delivered-To: svn-src-all@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 EA17C4CC; Fri, 31 Oct 2014 22:28: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 BC48AD20; Fri, 31 Oct 2014 22:28: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 s9VMSBKU099777; Fri, 31 Oct 2014 22:28:11 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VMSBkP099774; Fri, 31 Oct 2014 22:28:11 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201410312228.s9VMSBkP099774@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 31 Oct 2014 22:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273920 - in head/bin/sh: . tests/expansion X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 22:28:12 -0000 Author: jilles Date: Fri Oct 31 22:28:10 2014 New Revision: 273920 URL: https://svnweb.freebsd.org/changeset/base/273920 Log: sh: Fix corruption of CTL* bytes in positional parameters in redirection. EXP_REDIR was not being checked for while expanding positional parameters in redirection, so CTL* bytes were not being prefixed where they should be. MFC after: 1 week Added: head/bin/sh/tests/expansion/redir1.0 (contents, props changed) Modified: head/bin/sh/expand.c head/bin/sh/tests/expansion/Makefile Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Fri Oct 31 22:20:27 2014 (r273919) +++ head/bin/sh/expand.c Fri Oct 31 22:28:10 2014 (r273920) @@ -862,7 +862,7 @@ varisset(const char *name, int nulok) static void strtodest(const char *p, int flag, int subtype, int quoted) { - if (flag & (EXP_FULL | EXP_CASE) && subtype != VSLENGTH) + if (flag & (EXP_FULL | EXP_CASE | EXP_REDIR) && subtype != VSLENGTH) STPUTS_QUOTES(p, quoted ? DQSYNTAX : BASESYNTAX, expdest); else STPUTS(p, expdest); Modified: head/bin/sh/tests/expansion/Makefile ============================================================================== --- head/bin/sh/tests/expansion/Makefile Fri Oct 31 22:20:27 2014 (r273919) +++ head/bin/sh/tests/expansion/Makefile Fri Oct 31 22:28:10 2014 (r273920) @@ -72,6 +72,7 @@ FILES+= plus-minus7.0 FILES+= plus-minus8.0 FILES+= question1.0 FILES+= readonly1.0 +FILES+= redir1.0 FILES+= set-u1.0 FILES+= set-u2.0 FILES+= set-u3.0 Added: head/bin/sh/tests/expansion/redir1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/expansion/redir1.0 Fri Oct 31 22:28:10 2014 (r273920) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +bad=0 +for i in 0 1 2 3; do + for j in 0 1 2 3 4 5 6 7; do + for k in 0 1 2 3 4 5 6 7; do + case $i$j$k in + 000) continue ;; + esac + set -- "$(printf \\$i$j$k@)" + set -- "${1%@}" + ff= + for f in /dev/null /dev/zero /; do + if [ -e "$f" ] && [ ! -e "$f$1" ]; then + ff=$f + fi + done + [ -n "$ff" ] || continue + if { true <$ff$1; } 2>/dev/null; then + echo "Bad: $i$j$k ($ff)" >&2 + : $((bad += 1)) + fi + done + done +done +exit $((bad ? 2 : 0)) From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 23:09:54 2014 Return-Path: Delivered-To: svn-src-all@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 5D94981E; Fri, 31 Oct 2014 23:09:54 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E448136; Fri, 31 Oct 2014 23:09:53 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s9VN9lSm045630 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 31 Oct 2014 16:09:47 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s9VN9lCE045629; Fri, 31 Oct 2014 16:09:47 -0700 (PDT) (envelope-from jmg) Date: Fri, 31 Oct 2014 16:09:47 -0700 From: John-Mark Gurney To: Garrett Cooper Subject: Re: svn commit: r273734 - head/bin/dd Message-ID: <20141031230947.GT8852@funkthat.com> References: <201410271138.s9RBcHrA002447@svn.freebsd.org> <20141027153957.GZ1877@kib.kiev.ua> <20141027155427.GM1492@f10.opsec.eu> <86vbn4egjt.fsf@nine.des.no> <20141028200418.E849@besplex.bde.org> <86mw8ged20.fsf@nine.des.no> <20141028210830.L1034@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Fri, 31 Oct 2014 16:09:48 -0700 (PDT) Cc: src-committers@freebsd.org, Bruce Evans , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Kurt Jaeger , Konstantin Belousov , Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 23:09:54 -0000 Garrett Cooper wrote this message on Fri, Oct 31, 2014 at 14:30 -0700: > On Oct 28, 2014, at 4:33, Bruce Evans wrote: > > > On Tue, 28 Oct 2014, [utf-8] Dag-Erling Smørgrav wrote: > > > >> Bruce Evans writes: > >>> Dag-Erling Smørgrav writes: > >>>> This is a bug on all platforms, and both clang and (recent) gcc > >>>> should complain about it. That printf() call will print garbage. > >>> No, this is only a bug on 32-bit arches. The is is SSIZE_MAX. > >> > >> If you mean "it only has consequences on 32-bit arches", then I agree - > >> but it is still a bug to pass an int to %jd. > > > > This is machine-dependent. intmax_t may be int. The only requirement > > on intmax_t is that it can represent any value of any signed integer > > type. This is possible if the largest integer type is 64 bits (the > > smallest permitted largest type) and int is also 64 bits (and there > > are no complications for padding bits). intmax_t can even be signed > > char if that is wide enough (not in POSIX starting 10-15 years ago, > > since signed char is now required to be 8 bits. It is weird for > > intmax_t to have the lowest rank (not counting Bool), but FreeBSD uses > > this loophole to make it have second highest rank on 64-bit arches. > > Indeed. For some giggles, look at this bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191674 ("printf("%tu", (intmax_t)-1) returns UINT64_MAX on i386, not UINT32_MAX?). That isn't surprising.. because you're sign extending -1 via intmax_t... Even if you didn't mix unsigned and signed in your printf, and casted to uintmax_t, you'd still get UINT64_MAX... This is just how casting of signed numbers work and conversion from signed to unsigned... The bug (from 191674) is in [SU]JARG casting ptrdiff_t to intmax_t if anywhere... It should be cast to the correct intXX_t sized value instead.. In the SJARG case, a simple cast to ptrdiff_t is sufficient.. Now bde will have better idea on the UJARG case, but that needs to go be casted to uintXX_t, and no further casting is needed... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 23:10:59 2014 Return-Path: Delivered-To: svn-src-all@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 CB2E0967; Fri, 31 Oct 2014 23:10: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 ABF9A1D0; Fri, 31 Oct 2014 23:10: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 s9VNAxLq022693; Fri, 31 Oct 2014 23:10:59 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VNAwCs022688; Fri, 31 Oct 2014 23:10:58 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201410312310.s9VNAwCs022688@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Fri, 31 Oct 2014 23:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273921 - in stable/10: sys/dev/vt sys/sys usr.sbin/vidcontrol X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 23:10:59 -0000 Author: dumbbell Date: Fri Oct 31 23:10:58 2014 New Revision: 273921 URL: https://svnweb.freebsd.org/changeset/base/273921 Log: vt(4): Add PIO_VFONT_DEFAULT ioctl to restore the default builtin font To restore the default font using vidcontrol(1), use the "-f" flag without an argument: vidcontrol -f < /dev/ttyv0 PR: 193910 Differential Revision: https://reviews.freebsd.org/D971 Submitted by: Marcin Cieslak Reviewed by: ray@, emaste@ Approved by: ray@ MFC of: r273544 Modified: stable/10/sys/dev/vt/vt_core.c stable/10/sys/sys/consio.h stable/10/usr.sbin/vidcontrol/vidcontrol.1 stable/10/usr.sbin/vidcontrol/vidcontrol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vt/vt_core.c ============================================================================== --- stable/10/sys/dev/vt/vt_core.c Fri Oct 31 22:28:10 2014 (r273920) +++ stable/10/sys/dev/vt/vt_core.c Fri Oct 31 23:10:58 2014 (r273921) @@ -2211,6 +2211,11 @@ skip_thunk: vtfont_unref(vf); return (error); } + case PIO_VFONT_DEFAULT: { + /* Reset to default font. */ + error = vt_change_font(vw, &vt_font_default); + return (error); + } case GIO_SCRNMAP: { scrmap_t *sm = (scrmap_t *)data; Modified: stable/10/sys/sys/consio.h ============================================================================== --- stable/10/sys/sys/consio.h Fri Oct 31 22:28:10 2014 (r273920) +++ stable/10/sys/sys/consio.h Fri Oct 31 23:10:58 2014 (r273921) @@ -239,6 +239,7 @@ typedef struct vfnt vfnt_t; #define GIO_FONT8x16 _IOR('c', 69, fnt16_t) #define PIO_VFONT _IOW('c', 70, vfnt_t) #define GIO_VFONT _IOR('c', 71, vfnt_t) +#define PIO_VFONT_DEFAULT _IO('c', 72) /* get video mode information */ struct colors { Modified: stable/10/usr.sbin/vidcontrol/vidcontrol.1 ============================================================================== --- stable/10/usr.sbin/vidcontrol/vidcontrol.1 Fri Oct 31 22:28:10 2014 (r273920) +++ stable/10/usr.sbin/vidcontrol/vidcontrol.1 Fri Oct 31 23:10:58 2014 (r273921) @@ -26,9 +26,11 @@ .Op Fl c Ar appearance .Oo .Fl f +.Oo .Op Ar size .Ar file .Oc +.Oc .Op Fl g Ar geometry .Op Fl h Ar size .Op Fl i Cm adapter | mode @@ -136,8 +138,10 @@ The latter is actually a simulation. Print out current output screen map. .It Xo .Fl f +.Oo .Op Ar size .Ar file +.Oc .Xc Load font .Ar file @@ -158,6 +162,14 @@ may be omitted, in this case .Nm will try to guess it from the size of font file. .Pp +When using +.Xr vt 4 +both +.Ar size +and +.Ar font +can be omitted, and the default font will be loaded. +.Pp Note that older video cards, such as MDA and CGA, do not support software font. See also Modified: stable/10/usr.sbin/vidcontrol/vidcontrol.c ============================================================================== --- stable/10/usr.sbin/vidcontrol/vidcontrol.c Fri Oct 31 22:28:10 2014 (r273920) +++ stable/10/usr.sbin/vidcontrol/vidcontrol.c Fri Oct 31 23:10:58 2014 (r273921) @@ -197,7 +197,7 @@ usage(void) { if (vt4_mode) fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", -"usage: vidcontrol [-CHPpx] [-b color] [-c appearance] [-f [size] file]", +"usage: vidcontrol [-CHPpx] [-b color] [-c appearance] [-f [[size] file]]", " [-g geometry] [-h size] [-i adapter | mode]", " [-M char] [-m on | off] [-r foreground background]", " [-S on | off] [-s number] [-T xterm | cons25] [-t N | off]", @@ -409,6 +409,19 @@ load_vt4mappingtable(unsigned int nmappi return (t); } +/* + * Set the default vt font. + */ + +static void +load_default_vt4font(void) +{ + if (ioctl(0, PIO_VFONT_DEFAULT) == -1) { + revert(); + errc(1, errno, "loading default vt font"); + } +} + static int load_vt4font(FILE *f) { @@ -1328,7 +1341,7 @@ main(int argc, char **argv) dumpopt = DUMP_FBF; termmode = NULL; if (vt4_mode) - opts = "b:Cc:f:g:h:Hi:M:m:pPr:S:s:T:t:x"; + opts = "b:Cc:fg:h:Hi:M:m:pPr:S:s:T:t:x"; else opts = "b:Cc:df:g:h:Hi:l:LM:m:pPr:S:s:T:t:x"; @@ -1349,15 +1362,23 @@ main(int argc, char **argv) print_scrnmap(); break; case 'f': - type = optarg; - font = nextarg(argc, argv, &optind, 'f', 0); + optarg = nextarg(argc, argv, &optind, 'f', 0); + if (optarg != NULL) { + font = nextarg(argc, argv, &optind, 'f', 0); + + if (font == NULL) { + type = NULL; + font = optarg; + } else + type = optarg; - if (font == NULL) { - type = NULL; - font = optarg; - } + load_font(type, font); + } else { + if (!vt4_mode) + usage(); /* Switch syscons to ROM? */ - load_font(type, font); + load_default_vt4font(); + } break; case 'g': if (sscanf(optarg, "%dx%d", From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 23:41:29 2014 Return-Path: Delivered-To: svn-src-all@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 AFE5AD55; Fri, 31 Oct 2014 23:41:29 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (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 7C9AE633; Fri, 31 Oct 2014 23:41:29 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XkLot-000Cjb-LM; Fri, 31 Oct 2014 23:41:27 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id s9VNfP4I086083; Fri, 31 Oct 2014 17:41:26 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19kc7ugBiFf3qtJymHQ9VJt X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r273734 - head/bin/dd From: Ian Lepore To: Garrett Cooper In-Reply-To: References: <201410271138.s9RBcHrA002447@svn.freebsd.org> <20141027153957.GZ1877@kib.kiev.ua> <20141027155427.GM1492@f10.opsec.eu> <86vbn4egjt.fsf@nine.des.no> <20141028200418.E849@besplex.bde.org> <86mw8ged20.fsf@nine.des.no> <20141028210830.L1034@besplex.bde.org> Content-Type: text/plain; charset="iso-8859-13" Date: Fri, 31 Oct 2014 17:41:25 -0600 Message-ID: <1414798885.17308.198.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by ilsoft.org id s9VNfP4I086083 Cc: src-committers@freebsd.org, Bruce Evans , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Kurt Jaeger , Konstantin Belousov , Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 23:41:29 -0000 On Fri, 2014-10-31 at 14:30 -0700, Garrett Cooper wrote: > On Oct 28, 2014, at 4:33, Bruce Evans wrote: >=20 > > On Tue, 28 Oct 2014, [utf-8] Dag-Erling Sm=B8rgrav wrote: > >=20 > >> Bruce Evans writes: > >>> Dag-Erling Sm=B8rgrav writes: > >>>> This is a bug on all platforms, and both clang and (recent) gcc > >>>> should complain about it. That printf() call will print garbage. > >>> No, this is only a bug on 32-bit arches. The is is SSIZE_MAX. > >>=20 > >> If you mean "it only has consequences on 32-bit arches", then I agre= e - > >> but it is still a bug to pass an int to %jd. > >=20 > > This is machine-dependent. intmax_t may be int. The only requiremen= t > > on intmax_t is that it can represent any value of any signed integer > > type. This is possible if the largest integer type is 64 bits (the > > smallest permitted largest type) and int is also 64 bits (and there > > are no complications for padding bits). intmax_t can even be signed > > char if that is wide enough (not in POSIX starting 10-15 years ago, > > since signed char is now required to be 8 bits. It is weird for > > intmax_t to have the lowest rank (not counting Bool), but FreeBSD use= s > > this loophole to make it have second highest rank on 64-bit arches. >=20 > Indeed. For some giggles, look at this bug: https://bugs.freebsd.org/bu= gzilla/show_bug.cgi?id=3D191674 ("printf("%tu", (intmax_t)-1) returns UIN= T64_MAX on i386, not UINT32_MAX=A1). > Cheers, Isn't the problem in that bug that the cast doesn't match the printf format, and the correct code would be something like the following? printf("%tu", (ptrdiff_t)-1); -- Ian From owner-svn-src-all@FreeBSD.ORG Fri Oct 31 23:52:03 2014 Return-Path: Delivered-To: svn-src-all@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 95D7C730; Fri, 31 Oct 2014 23:52: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 81832805; Fri, 31 Oct 2014 23:52: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 s9VNq3C9044766; Fri, 31 Oct 2014 23:52:03 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9VNq3iO044765; Fri, 31 Oct 2014 23:52:03 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201410312352.s9VNq3iO044765@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 31 Oct 2014 23:52:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273922 - head/usr.sbin/bsdinstall X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2014 23:52:03 -0000 Author: nwhitehorn Date: Fri Oct 31 23:52:02 2014 New Revision: 273922 URL: https://svnweb.freebsd.org/changeset/base/273922 Log: Rewrite some of the disk setup documentation to be clearer and contain less obsolete information. Also move the entropy command down the list -- the list is ordered by likelihood of use rather than alphabetically. MFC after: 1 week Modified: head/usr.sbin/bsdinstall/bsdinstall.8 Modified: head/usr.sbin/bsdinstall/bsdinstall.8 ============================================================================== --- head/usr.sbin/bsdinstall/bsdinstall.8 Fri Oct 31 23:10:58 2014 (r273921) +++ head/usr.sbin/bsdinstall/bsdinstall.8 Fri Oct 31 23:52:02 2014 (r273922) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 15, 2013 +.Dd October 31, 2014 .Dt BSDINSTALL 8 .Os .Sh NAME @@ -73,10 +73,6 @@ targets. .Bl -tag -width ".Cm jail Ar destination" .It Cm auto Run the standard interactive installation, including disk partitioning. -.It Cm entropy -Reads a small amount of data from -.Pa /dev/random -and stores it in a file in the new system's root directory. .It Cm jail Ar destination Sets up a new chroot system at .Pa destination , @@ -119,32 +115,28 @@ If is set, also configures the network interfaces of the current system to match. .It Cm autopart Provides the installer's interactive guided disk partitioner for single-disk -installations. Partitions disks, runs -.Xr newfs 8 , -and writes the new system's -.Pa fstab . +installations. Defaults to UFS. .It Cm zfsboot -Provides the installer's -.Pq experimental -interactive/scriptable ZFS partitioner for multi-disk installations. +Provides an alternative ZFS-only automatic interactive disk partitioner. Creates a single .Ic zpool -with datasets and writes to the new system's -.Pa rc.conf , -.Pa loader.conf , +with separate datasets for +.Pa /tmp , +.Pa /usr , +.Pa /usr/home , +.Pa /usr/ports , +.Pa /usr/src , and -.Pa fstab . -Supports -.Xr geli 8 , -.Xr gnop 8 , -and many other features. +.Pa /var . +Optionally can set up +.Xr geli 8 +to encrypt the disk. .It Cm partedit -Provides the installer's interactive manual disk partitioner, with support -for multi disk setups, non-UFS file systems, and manual selection of -partition schemes. Partitions disks, runs -.Xr newfs 8 , -and writes the new system's -.Pa fstab . +Provides the installer's interactive manual disk partitioner with an interface +identical to +.Xr sade 8 . +Supports multiple disks as well as UFS, ZFS, and FAT file systems. ZFS +is set up with one pool and dataset per partition. .It Cm scriptedpart Ar parameters Sets up disks like .Cm autopart @@ -190,13 +182,19 @@ keyword causes the partition to take all .Ar type option chooses the .Xr gpart 8 -filesystem type (e.g. freebsd-ufs or freebsd-swap). +filesystem type (e.g. freebsd-ufs, freebsd-zfs, or freebsd-swap). The optional .Ar mount point argument sets where the created partition is to be mounted in the installed system. As an example, a typical invocation looks like: .Pp bsdinstall scriptedpart ada0 { 20G freebsd-ufs /, 4G freebsd-swap, 20G freebsd-ufs /var, auto freebsd-ufs /usr } +.Pp +A shorter invocation to use the default partitioning (as +.Cm autopart +would have used) on the same disk: +.Pp +bsdinstall scriptedpart ada0 .It Cm mount Mounts the file systems previously configured by .Cm autopart , @@ -235,6 +233,10 @@ Interactively sets the time, date, and t Queries the user for the system daemons to begin at system startup, writing the result into the new system's .Pa rc.conf . +.It Cm entropy +Reads a small amount of data from +.Pa /dev/random +and stores it in a file in the new system's root directory. .It Cm config Installs the configuration files destined for the new system (e.g. rc.conf fragments generated by @@ -346,14 +348,14 @@ which is passed to the .Cm scriptedpart target to control disk setup. Alternatively, +to use +.Cm zfsboot instead of -.Ev PARTITIONS , +.Cm partedit , the preamble can contain the variable .Ev ZFSBOOT_DATASETS -which is parsed by the -.Pq experimental -.Cm zfsboot -target to control ZFS datasets/options of the boot pool setup. +instead of +.Ev PARTITIONS . .Ss SETUP SCRIPT Following the preamble is an optional shell script, beginning with a #! declaration. This script will be run at the end of the installation process From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 00:51:41 2014 Return-Path: Delivered-To: svn-src-all@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 44DEA6FF; Sat, 1 Nov 2014 00:51:41 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 08971D48; Sat, 1 Nov 2014 00:51:40 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 0CEA7A28A; Sat, 1 Nov 2014 00:51:40 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 0AC6C109F8; Sat, 1 Nov 2014 01:51:41 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Xin LI Subject: Re: svn commit: r273919 - head/etc/rc.d References: <201410312220.s9VMKRaO096404@svn.freebsd.org> Date: Sat, 01 Nov 2014 01:51:41 +0100 In-Reply-To: <201410312220.s9VMKRaO096404@svn.freebsd.org> (Xin LI's message of "Fri, 31 Oct 2014 22:20:27 +0000 (UTC)") Message-ID: <86bnor9202.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 00:51:41 -0000 Xin LI writes: > Log: > rc.d/geli should not depend on random, as the attach functionality > do not require additional entropy to function. >=20=20=20 > It would create a circular dependency (not immediately obvious: > geli provides 'disks' and requires 'random' as of r273872, > 'random' requires 'FILESYSTEMS', 'FILESYSTEMS' requires 'root', > 'root' requires 'swap', and finally 'swap' requires 'disk'). My first instinct was: shouldn't rcorder warn about this? It turns out that it does, but in a very cryptic fashion: des@nine ~head/etc/rc.d% svn up -qr273871=20=20 des@nine ~head/etc/rc.d% rcorder * >/dev/null des@nine ~head/etc/rc.d% svn up -qr273872=20=20=20=20 des@nine ~head/etc/rc.d% rcorder * >/dev/null rcorder: Circular dependency on file `zfs'. rcorder: Circular dependency on provision `mountcritlocal' in file `zfs'. rcorder: Circular dependency on provision `mountcritlocal' in file `var'. rcorder: Circular dependency on provision `mountcritlocal' in file `FILESYS= TEMS'. rcorder: Circular dependency on provision `root' in file `FILESYSTEMS'. des@nine ~head/etc/rc.d% svn up -qr273919=20=20=20=20 des@nine ~head/etc/rc.d% rcorder * >/dev/null des@nine ~head/etc/rc.d%=20 DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 00:54:10 2014 Return-Path: Delivered-To: svn-src-all@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 41E8D855; Sat, 1 Nov 2014 00:54:10 +0000 (UTC) Received: from mail-pa0-x230.google.com (mail-pa0-x230.google.com [IPv6:2607:f8b0:400e:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 020B1D54; Sat, 1 Nov 2014 00:54:09 +0000 (UTC) Received: by mail-pa0-f48.google.com with SMTP id ey11so8689180pad.35 for ; Fri, 31 Oct 2014 17:54:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=j121buUndlL354zFkCva1wNdNn1Yw/O4DsxkMpMy6gY=; b=J/N49T7jX1B0iuV/wnP5zTbrom2A1IIlMVEjN/3GSGHV4SjQBcslL9/jTlz838dHqM UU5hFrGMLgp16dQ8aGN6Hb/v6eSeL+KQVNZUDI6aO44765jrnCme7iVPSSZ8VsRXW1S4 esSR4/SUtmUy45La1T6yD1cLowWWWsg/uyVsB7QpXQdDh6U0NKhMr2fM5nSEYkoHRp6q 3cnsi0BL08ThliXyJrRWw7bfA9lRWYrd1CWj+7cVUGvQ6dWfWXnVEbtr11J37XYgoN7H PqDJwL3Ruyum8LZqY6lJ5F7YQcLHZmutCl31ow9lkVRoqgdFbqGaCZ73JIN0jNT7D/92 F4Ow== X-Received: by 10.70.37.101 with SMTP id x5mr28566927pdj.24.1414803249225; Fri, 31 Oct 2014 17:54:09 -0700 (PDT) Received: from ?IPv6:2601:8:ab80:7d6:34d4:4abd:64bb:590a? ([2601:8:ab80:7d6:34d4:4abd:64bb:590a]) by mx.google.com with ESMTPSA id ri9sm10980947pbc.5.2014.10.31.17.54.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Oct 2014 17:54:08 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_DF1385D1-9A8E-43B3-A633-733B5E8017FC"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r273919 - head/etc/rc.d From: Garrett Cooper In-Reply-To: <86bnor9202.fsf@nine.des.no> Date: Fri, 31 Oct 2014 17:54:07 -0700 Message-Id: <0577B462-91E9-4E46-BF9E-085B50EDE09C@gmail.com> References: <201410312220.s9VMKRaO096404@svn.freebsd.org> <86bnor9202.fsf@nine.des.no> To: =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 00:54:10 -0000 --Apple-Mail=_DF1385D1-9A8E-43B3-A633-733B5E8017FC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 On Oct 31, 2014, at 17:51, Dag-Erling Sm=F8rgrav wrote: > Xin LI writes: >> Log: >> rc.d/geli should not depend on random, as the attach functionality >> do not require additional entropy to function. >>=20 >> It would create a circular dependency (not immediately obvious: >> geli provides 'disks' and requires 'random' as of r273872, >> 'random' requires 'FILESYSTEMS', 'FILESYSTEMS' requires 'root', >> 'root' requires 'swap', and finally 'swap' requires 'disk'). >=20 > My first instinct was: shouldn't rcorder warn about this? It turns = out > that it does, but in a very cryptic fashion: >=20 > des@nine ~head/etc/rc.d% svn up -qr273871 =20 > des@nine ~head/etc/rc.d% rcorder * >/dev/null > des@nine ~head/etc/rc.d% svn up -qr273872 =20 > des@nine ~head/etc/rc.d% rcorder * >/dev/null > rcorder: Circular dependency on file `zfs'. > rcorder: Circular dependency on provision `mountcritlocal' in file = `zfs'. > rcorder: Circular dependency on provision `mountcritlocal' in file = `var'. > rcorder: Circular dependency on provision `mountcritlocal' in file = `FILESYSTEMS'. > rcorder: Circular dependency on provision `root' in file = `FILESYSTEMS'. > des@nine ~head/etc/rc.d% svn up -qr273919 =20 > des@nine ~head/etc/rc.d% rcorder * >/dev/null > des@nine ~head/etc/rc.d%=20 rcorder errors are indeed cryptic/confusing. I can quickly add a = testcase for this if you like (basically check for all the scenarios = that need to be covered via /etc/rc). Does that sound good? Thanks! --Apple-Mail=_DF1385D1-9A8E-43B3-A633-733B5E8017FC 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 iQEcBAEBCgAGBQJUVC8vAAoJEMZr5QU6S73eH4AH/0x96qlsz3AdSPeCxTjNU1cE 7xJPuln401K/ORTt28vnzyw8uPQ2ldvfzqmwuR5ijSl3o1lW/jMWMPbwCuSkFP2w xgviOSsqzdqhPifOb5VCoRP95kuCyq9+k9Cdrs9Q3jlC7ijBAla7cxYCGtRK2xQW qgVI4v/a+/P1Q+rHS2XC5fh9qBXUH/U7Ybq5CrAfPCh57BpUfWtArmYHyGubcDew m/c172ERAiG035IJeTdoBC/dX2NMCOwQiy3wxNkSq7OCMeLirv04GK5tOOZIHaaZ HXPBcyFQfAtB5ugILC4/rjIWznaTMZg3+n6WdJs6643fJ2qLCeSHlHlmhjohoZY= =AsJe -----END PGP SIGNATURE----- --Apple-Mail=_DF1385D1-9A8E-43B3-A633-733B5E8017FC-- From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 05:45:06 2014 Return-Path: Delivered-To: svn-src-all@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 4CD3468D; Sat, 1 Nov 2014 05:45: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 381D086D; Sat, 1 Nov 2014 05:45: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 sA15j6XR010797; Sat, 1 Nov 2014 05:45:06 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA15j6l2010796; Sat, 1 Nov 2014 05:45:06 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201411010545.sA15j6l2010796@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Sat, 1 Nov 2014 05:45:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273923 - stable/10/sys/dev/puc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 05:45:06 -0000 Author: rpaulo Date: Sat Nov 1 05:45:05 2014 New Revision: 273923 URL: https://svnweb.freebsd.org/changeset/base/273923 Log: MFC r273551: puc(4): add an entry for the Oxford Semiconductor OXPCIe952 1S1P card. Submitted by: Alex Burlyga Modified: stable/10/sys/dev/puc/pucdata.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/puc/pucdata.c ============================================================================== --- stable/10/sys/dev/puc/pucdata.c Fri Oct 31 23:52:02 2014 (r273922) +++ stable/10/sys/dev/puc/pucdata.c Sat Nov 1 05:45:05 2014 (r273923) @@ -838,6 +838,13 @@ const struct puc_cfg puc_pci_devices[] = * */ + { 0x1415, 0xc11b, 0xffff, 0, + "Oxford Semiconductor OXPCIe952 1S1P", + DEFAULT_RCLK * 0x22, + PUC_PORT_NONSTANDARD, 0x10, 0, -1, + .config_function = puc_config_oxford_pcie + }, + { 0x1415, 0xc138, 0xffff, 0, "Oxford Semiconductor OXPCIe952 UARTs", DEFAULT_RCLK * 0x22, From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 09:10:22 2014 Return-Path: Delivered-To: svn-src-all@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 4E111C39; Sat, 1 Nov 2014 09:10:22 +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 39D93C11; Sat, 1 Nov 2014 09:10:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA19AMLb005106; Sat, 1 Nov 2014 09:10:22 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA19AMDu005105; Sat, 1 Nov 2014 09:10:22 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411010910.sA19AMDu005105@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Sat, 1 Nov 2014 09:10:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273924 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 09:10:22 -0000 Author: des Date: Sat Nov 1 09:10:21 2014 New Revision: 273924 URL: https://svnweb.freebsd.org/changeset/base/273924 Log: is a superset of and must always come first. Coincidentally, today is the 11th anniversary of this man page's (and this bug's) first appearance in FreeBSD. MFC after: 3 days Modified: head/lib/libc/sys/utrace.2 Modified: head/lib/libc/sys/utrace.2 ============================================================================== --- head/lib/libc/sys/utrace.2 Sat Nov 1 05:45:05 2014 (r273923) +++ head/lib/libc/sys/utrace.2 Sat Nov 1 09:10:21 2014 (r273924) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 28, 2000 +.Dd November 1, 2014 .Dt UTRACE 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/param.h .In sys/time.h .In sys/uio.h From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 09:11:39 2014 Return-Path: Delivered-To: svn-src-all@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 20B68DED; Sat, 1 Nov 2014 09:11:39 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id D6A36CB1; Sat, 1 Nov 2014 09:11:38 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 93AFDA893; Sat, 1 Nov 2014 09:11:36 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id BA62F10A46; Sat, 1 Nov 2014 10:11:38 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Garrett Cooper Subject: Re: svn commit: r273919 - head/etc/rc.d References: <201410312220.s9VMKRaO096404@svn.freebsd.org> <86bnor9202.fsf@nine.des.no> <0577B462-91E9-4E46-BF9E-085B50EDE09C@gmail.com> Date: Sat, 01 Nov 2014 10:11:38 +0100 In-Reply-To: <0577B462-91E9-4E46-BF9E-085B50EDE09C@gmail.com> (Garrett Cooper's message of "Fri, 31 Oct 2014 17:54:07 -0700") Message-ID: <867fzf8eut.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 09:11:39 -0000 Garrett Cooper writes: > rcorder errors are indeed cryptic/confusing. I can quickly add a > testcase for this if you like (basically check for all the scenarios > that need to be covered via /etc/rc). Does that sound good? Yes, that sounds great. I'll look into adding a loop detection and reporting mode to rcorder so we can get a better error message. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 09:56:43 2014 Return-Path: Delivered-To: svn-src-all@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 32DC7A38; Sat, 1 Nov 2014 09:56:43 +0000 (UTC) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A54EE4; Sat, 1 Nov 2014 09:56:41 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 4B4B925D37C3; Sat, 1 Nov 2014 09:56:32 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 394FCC770C2; Sat, 1 Nov 2014 09:56:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id x8GJ3MbGfcPH; Sat, 1 Nov 2014 09:56:28 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id CEBE2C77057; Sat, 1 Nov 2014 09:56:25 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r273917 - head/sys/dev/gpio From: "Bjoern A. Zeeb" In-Reply-To: <201410311915.s9VJFEDZ003525@svn.freebsd.org> Date: Sat, 1 Nov 2014 09:56:23 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201410311915.s9VJFEDZ003525@svn.freebsd.org> To: Luiz Otavio O Souza X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 09:56:43 -0000 On 31 Oct 2014, at 19:15 , Luiz Otavio O Souza wrote: > Author: loos > Date: Fri Oct 31 19:15:14 2014 > New Revision: 273917 > URL: https://svnweb.freebsd.org/changeset/base/273917 >=20 > Log: > Fix the gpiobus locking by using a more sane model where it isn't = necessary > hold the gpiobus lock between the gpio calls. >=20 > gpiobus_acquire_lock() now accepts a third parameter which tells = gpiobus > what to do when the bus is already busy. >=20 > When GPIOBUS_WAIT wait is used, the calling thread will be put to = sleep > until the bus became free. >=20 > With GPIOBUS_DONTWAIT the calling thread will receive EWOULDBLOCK = right > away and then it can act upon. >=20 > This fixes the gpioiic(4) locking issues that arises when doing = multiple > concurrent access on the bus. I guess it was this commit that broke things: /scratch/tmp/bz/head.svn/sys/dev/gpio/gpioled.c: In function = 'gpioled_control': /scratch/tmp/bz/head.svn/sys/dev/gpio/gpioled.c:88: error: = 'GPIOBUS_DONTWAIT' undeclared (first use in this function) /scratch/tmp/bz/head.svn/sys/dev/gpio/gpioled.c:88: error: (Each = undeclared identifier is reported only once /scratch/tmp/bz/head.svn/sys/dev/gpio/gpioled.c:88: error: for each = function it appears in.) --- gpioled.o --- *** [gpioled.o] Error code 1 bmake: stopped in = /storage/head/obj/mips.mips/scratch/tmp/bz/head.svn/sys/AP121 --- buildkernel --- *** [buildkernel] Error code 1 >=20 > Modified: > head/sys/dev/gpio/gpiobus.c > head/sys/dev/gpio/gpiobus_if.m > head/sys/dev/gpio/gpiobusvar.h > head/sys/dev/gpio/gpioiic.c > head/sys/dev/gpio/gpioled.c >=20 > Modified: head/sys/dev/gpio/gpiobus.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/gpio/gpiobus.c Fri Oct 31 18:53:16 2014 = (r273916) > +++ head/sys/dev/gpio/gpiobus.c Fri Oct 31 19:15:14 2014 = (r273917) > @@ -53,9 +53,7 @@ static void gpiobus_hinted_child(device_ > /* > * GPIOBUS interface > */ > -static void gpiobus_lock_bus(device_t); > -static void gpiobus_unlock_bus(device_t); > -static void gpiobus_acquire_bus(device_t, device_t); > +static int gpiobus_acquire_bus(device_t, device_t, int); > static void gpiobus_release_bus(device_t, device_t); > static int gpiobus_pin_setflags(device_t, device_t, uint32_t, = uint32_t); > static int gpiobus_pin_getflags(device_t, device_t, uint32_t, = uint32_t*); > @@ -326,37 +324,26 @@ gpiobus_hinted_child(device_t bus, const > device_delete_child(bus, child); > } >=20 > -static void > -gpiobus_lock_bus(device_t busdev) > +static int > +gpiobus_acquire_bus(device_t busdev, device_t child, int how) > { > struct gpiobus_softc *sc; >=20 > sc =3D device_get_softc(busdev); > GPIOBUS_ASSERT_UNLOCKED(sc); > GPIOBUS_LOCK(sc); > -} > - > -static void > -gpiobus_unlock_bus(device_t busdev) > -{ > - struct gpiobus_softc *sc; > - > - sc =3D device_get_softc(busdev); > - GPIOBUS_ASSERT_LOCKED(sc); > + if (sc->sc_owner !=3D NULL) { > + if (how =3D=3D GPIOBUS_DONTWAIT) { > + GPIOBUS_UNLOCK(sc); > + return (EWOULDBLOCK); > + } > + while (sc->sc_owner !=3D NULL) > + mtx_sleep(sc, &sc->sc_mtx, 0, "gpiobuswait", 0); > + } > + sc->sc_owner =3D child; > GPIOBUS_UNLOCK(sc); > -} >=20 > -static void > -gpiobus_acquire_bus(device_t busdev, device_t child) > -{ > - struct gpiobus_softc *sc; > - > - sc =3D device_get_softc(busdev); > - GPIOBUS_ASSERT_LOCKED(sc); > - > - if (sc->sc_owner) > - panic("gpiobus: cannot serialize the access to = device."); > - sc->sc_owner =3D child; > + return (0); > } >=20 > static void > @@ -365,14 +352,15 @@ gpiobus_release_bus(device_t busdev, dev > struct gpiobus_softc *sc; >=20 > sc =3D device_get_softc(busdev); > - GPIOBUS_ASSERT_LOCKED(sc); > - > - if (!sc->sc_owner) > + GPIOBUS_ASSERT_UNLOCKED(sc); > + GPIOBUS_LOCK(sc); > + if (sc->sc_owner =3D=3D NULL) > panic("gpiobus: releasing unowned bus."); > if (sc->sc_owner !=3D child) > panic("gpiobus: you don't own the bus. game over."); > - > sc->sc_owner =3D NULL; > + wakeup(sc); > + GPIOBUS_UNLOCK(sc); > } >=20 > static int > @@ -469,8 +457,6 @@ static device_method_t gpiobus_methods[] > DEVMETHOD(bus_hinted_child, gpiobus_hinted_child), >=20 > /* GPIO protocol */ > - DEVMETHOD(gpiobus_lock_bus, gpiobus_lock_bus), > - DEVMETHOD(gpiobus_unlock_bus, gpiobus_unlock_bus), > DEVMETHOD(gpiobus_acquire_bus, gpiobus_acquire_bus), > DEVMETHOD(gpiobus_release_bus, gpiobus_release_bus), > DEVMETHOD(gpiobus_pin_getflags, gpiobus_pin_getflags), >=20 > Modified: head/sys/dev/gpio/gpiobus_if.m > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/dev/gpio/gpiobus_if.m Fri Oct 31 18:53:16 2014 = (r273916) > +++ head/sys/dev/gpio/gpiobus_if.m Fri Oct 31 19:15:14 2014 = (r273917) > @@ -32,25 +32,12 @@ > INTERFACE gpiobus; >=20 > # > -# Lock the gpio bus > -# > -METHOD void lock_bus { > - device_t busdev; > -}; > - > -# > -# Unlock the gpio bus > -# > -METHOD void unlock_bus { > - device_t busdev; > -}; > - > -# > # Dedicate the gpio bus control for a child > # > -METHOD void acquire_bus { > +METHOD int acquire_bus { > device_t busdev; > device_t dev; > + int how; > }; >=20 > # >=20 > Modified: head/sys/dev/gpio/gpiobusvar.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/gpio/gpiobusvar.h Fri Oct 31 18:53:16 2014 = (r273916) > +++ head/sys/dev/gpio/gpiobusvar.h Fri Oct 31 19:15:14 2014 = (r273917) > @@ -56,6 +56,9 @@ > #define GPIOBUS_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, = MA_OWNED) > #define GPIOBUS_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, = MA_NOTOWNED) >=20 > +#define GPIOBUS_WAIT 1 > +#define GPIOBUS_DONTWAIT 2 > + > struct gpiobus_softc > { > struct mtx sc_mtx; /* bus mutex */ >=20 > Modified: head/sys/dev/gpio/gpioiic.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/gpio/gpioiic.c Fri Oct 31 18:53:16 2014 = (r273916) > +++ head/sys/dev/gpio/gpioiic.c Fri Oct 31 19:15:14 2014 = (r273917) > @@ -154,18 +154,18 @@ static int > gpioiic_callback(device_t dev, int index, caddr_t data) > { > struct gpioiic_softc *sc =3D device_get_softc(dev); > - int error =3D 0; > + int error, how; >=20 > + how =3D GPIOBUS_DONTWAIT; > + if (data !=3D NULL && (int)*data =3D=3D IIC_WAIT) > + how =3D GPIOBUS_WAIT; > + error =3D 0; > switch (index) { > case IIC_REQUEST_BUS: > - GPIOBUS_LOCK_BUS(sc->sc_busdev); > - GPIOBUS_ACQUIRE_BUS(sc->sc_busdev, sc->sc_dev); > - GPIOBUS_UNLOCK_BUS(sc->sc_busdev); > + error =3D GPIOBUS_ACQUIRE_BUS(sc->sc_busdev, sc->sc_dev, = how); > break; > case IIC_RELEASE_BUS: > - GPIOBUS_LOCK_BUS(sc->sc_busdev); > GPIOBUS_RELEASE_BUS(sc->sc_busdev, sc->sc_dev); > - GPIOBUS_UNLOCK_BUS(sc->sc_busdev); > break; > default: > error =3D EINVAL; >=20 > Modified: head/sys/dev/gpio/gpioled.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/gpio/gpioled.c Fri Oct 31 18:53:16 2014 = (r273916) > +++ head/sys/dev/gpio/gpioled.c Fri Oct 31 19:15:14 2014 = (r273917) > @@ -79,16 +79,23 @@ static int gpioled_detach(device_t); > static void=20 > gpioled_control(void *priv, int onoff) > { > - struct gpioled_softc *sc =3D priv; > + int error; > + struct gpioled_softc *sc; > + > + sc =3D (struct gpioled_softc *)priv; > GPIOLED_LOCK(sc); > - GPIOBUS_LOCK_BUS(sc->sc_busdev); > - GPIOBUS_ACQUIRE_BUS(sc->sc_busdev, sc->sc_dev); > - GPIOBUS_PIN_SETFLAGS(sc->sc_busdev, sc->sc_dev, GPIOLED_PIN, > - GPIO_PIN_OUTPUT); > - GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, GPIOLED_PIN,=20 > - onoff ? GPIO_PIN_HIGH : GPIO_PIN_LOW); > + error =3D GPIOBUS_ACQUIRE_BUS(sc->sc_busdev, sc->sc_dev, > + GPIOBUS_DONTWAIT); > + if (error !=3D 0) { > + GPIOLED_UNLOCK(sc); > + return; > + } > + error =3D GPIOBUS_PIN_SETFLAGS(sc->sc_busdev, sc->sc_dev, > + GPIOLED_PIN, GPIO_PIN_OUTPUT); > + if (error =3D=3D 0) > + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, GPIOLED_PIN, > + onoff ? GPIO_PIN_HIGH : GPIO_PIN_LOW); > GPIOBUS_RELEASE_BUS(sc->sc_busdev, sc->sc_dev); > - GPIOBUS_UNLOCK_BUS(sc->sc_busdev); > GPIOLED_UNLOCK(sc); > } >=20 >=20 =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 10:35:46 2014 Return-Path: Delivered-To: svn-src-all@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 BEF31498; Sat, 1 Nov 2014 10:35: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 90FB2666; Sat, 1 Nov 2014 10:35: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 sA1AZk1c046362; Sat, 1 Nov 2014 10:35:46 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1AZkFu046361; Sat, 1 Nov 2014 10:35:46 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201411011035.sA1AZkFu046361@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 1 Nov 2014 10:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273925 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 10:35:46 -0000 Author: tuexen Date: Sat Nov 1 10:35:45 2014 New Revision: 273925 URL: https://svnweb.freebsd.org/changeset/base/273925 Log: Don't zero the stats before they are read out. MFC after: 3 days Modified: head/sys/netinet/sctp_sysctl.c Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Sat Nov 1 09:10:21 2014 (r273924) +++ head/sys/netinet/sctp_sysctl.c Sat Nov 1 10:35:45 2014 (r273925) @@ -636,26 +636,27 @@ sctp_sysctl_handle_stats(SYSCTL_HANDLER_ int error; #if defined(SMP) && defined(SCTP_USE_PERCPU_STAT) - struct sctpstat sb_temp; struct sctpstat *sarry; struct sctpstat sb; int cpu; + #endif + struct sctpstat sb_temp; if ((req->newptr != NULL) && (req->newlen != sizeof(struct sctpstat))) { return (EINVAL); } - -#if defined(SMP) && defined(SCTP_USE_PERCPU_STAT) - memset(&sb, 0, sizeof(sb)); - memset(&sb_temp, 0, sizeof(sb_temp)); + memset(&sb_temp, 0, sizeof(struct sctpstat)); if (req->newptr != NULL) { - error = SYSCTL_IN(req, &sb_temp, sizeof(sb_temp)); - if (error != 0) + error = SYSCTL_IN(req, &sb_temp, sizeof(struct sctpstat)); + if (error != 0) { return (error); + } } +#if defined(SMP) && defined(SCTP_USE_PERCPU_STAT) + memset(&sb, 0, sizeof(sb)); for (cpu = 0; cpu < mp_maxid; cpu++) { sarry = &SCTP_BASE_STATS[cpu]; if (sarry->sctps_discontinuitytime.tv_sec > sb.sctps_discontinuitytime.tv_sec) { @@ -783,15 +784,19 @@ sctp_sysctl_handle_stats(SYSCTL_HANDLER_ sb.sctps_send_burst_avoid += sarry->sctps_send_burst_avoid; sb.sctps_send_cwnd_avoid += sarry->sctps_send_cwnd_avoid; sb.sctps_fwdtsn_map_over += sarry->sctps_fwdtsn_map_over; - if (req->newptr != NULL) + if (req->newptr != NULL) { memcpy(sarry, &sb_temp, sizeof(struct sctpstat)); + } } error = SYSCTL_OUT(req, &sb, sizeof(struct sctpstat)); #else - error = SYSCTL_IN(req, &SCTP_BASE_STATS, sizeof(struct sctpstat)); - if (error) - return (error); error = SYSCTL_OUT(req, &SCTP_BASE_STATS, sizeof(struct sctpstat)); + if (error != 0) { + return (error); + } + if (req->newptr != NULL) { + memcpy(&SCTP_BASE_STATS, &sb_temp, sizeof(struct sctpstat)); + } #endif return (error); } From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 10:40:29 2014 Return-Path: Delivered-To: svn-src-all@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 EB927720; Sat, 1 Nov 2014 10:40: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 D8639690; Sat, 1 Nov 2014 10:40: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 sA1AeTbe050015; Sat, 1 Nov 2014 10:40:29 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1AeT2Z050014; Sat, 1 Nov 2014 10:40:29 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201411011040.sA1AeT2Z050014@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sat, 1 Nov 2014 10:40:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273926 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 10:40:30 -0000 Author: loos Date: Sat Nov 1 10:40:29 2014 New Revision: 273926 URL: https://svnweb.freebsd.org/changeset/base/273926 Log: Fix the build of non-FDT systems by moving the gpiobusvar.h header outside the FDT #ifdef. While here remove a few unused headers. Modified: head/sys/dev/gpio/gpioled.c Modified: head/sys/dev/gpio/gpioled.c ============================================================================== --- head/sys/dev/gpio/gpioled.c Sat Nov 1 10:35:45 2014 (r273925) +++ head/sys/dev/gpio/gpioled.c Sat Nov 1 10:40:29 2014 (r273926) @@ -31,11 +31,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include -#include +#include #include -#include #include #include #include @@ -43,12 +41,12 @@ __FBSDID("$FreeBSD$"); #ifdef FDT #include -#include #include #endif +#include #include -#include + #include "gpiobus_if.h" /* From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 10:47:19 2014 Return-Path: Delivered-To: svn-src-all@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 3A36CAE3; Sat, 1 Nov 2014 10:47:19 +0000 (UTC) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [IPv6:2a00:1450:400c:c00::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 36E4C7C6; Sat, 1 Nov 2014 10:47:18 +0000 (UTC) Received: by mail-wg0-f49.google.com with SMTP id x13so9395032wgg.8 for ; Sat, 01 Nov 2014 03:47:16 -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=pp1CEaeEw664mEeIafBfq59Vpt/rr3fS1rCOIocKIPc=; b=vCRACRnaX5SSSmJxg3PUqYXGgcLuNOGDuXtt4qaZCNDngl3C2mecNrPikMUOmA2wn5 xG7Is/8eKrloMtD9zDZElWgMyb8lwnqfvlyzu52wVItft6lDw31VMS+WxOo4OTk16fs9 V8aW2NGeE//NyRcBE7CXPYCskR676t0w79IV1Yj9TQJtobAyL0lq9UdUxfAAZtG+0te7 izp1bem7UU5u6lrvsCG1P/0MXDrDGrw76CODCQLgCXPH5XGWEqcYpHo8NAZ+iFW49MF3 i6abuHGfdVPhD35ZVnxVj9JZJCMpnQYR+j4LQVQLtsoL8qHDS5P8x08PY/fzvTtAEBRc XLSg== MIME-Version: 1.0 X-Received: by 10.195.12.76 with SMTP id eo12mr34472393wjd.22.1414838836369; Sat, 01 Nov 2014 03:47:16 -0700 (PDT) Received: by 10.216.204.71 with HTTP; Sat, 1 Nov 2014 03:47:16 -0700 (PDT) In-Reply-To: References: <201410311915.s9VJFEDZ003525@svn.freebsd.org> Date: Sat, 1 Nov 2014 08:47:16 -0200 Message-ID: Subject: Re: svn commit: r273917 - head/sys/dev/gpio From: Luiz Otavio O Souza To: "Bjoern A. Zeeb" Content-Type: text/plain; charset=UTF-8 Cc: Luiz Otavio O Souza , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 10:47:19 -0000 On Sat, Nov 1, 2014 at 7:56 AM, Bjoern A. Zeeb wrote: > > On 31 Oct 2014, at 19:15 , Luiz Otavio O Souza wrote: > >> Author: loos >> Date: Fri Oct 31 19:15:14 2014 >> New Revision: 273917 >> URL: https://svnweb.freebsd.org/changeset/base/273917 >> >> Log: >> Fix the gpiobus locking by using a more sane model where it isn't necessary >> hold the gpiobus lock between the gpio calls. >> >> gpiobus_acquire_lock() now accepts a third parameter which tells gpiobus >> what to do when the bus is already busy. >> >> When GPIOBUS_WAIT wait is used, the calling thread will be put to sleep >> until the bus became free. >> >> With GPIOBUS_DONTWAIT the calling thread will receive EWOULDBLOCK right >> away and then it can act upon. >> >> This fixes the gpioiic(4) locking issues that arises when doing multiple >> concurrent access on the bus. > > I guess it was this commit that broke things: > > /scratch/tmp/bz/head.svn/sys/dev/gpio/gpioled.c: In function 'gpioled_control': > /scratch/tmp/bz/head.svn/sys/dev/gpio/gpioled.c:88: error: 'GPIOBUS_DONTWAIT' undeclared (first use in this function) > /scratch/tmp/bz/head.svn/sys/dev/gpio/gpioled.c:88: error: (Each undeclared identifier is reported only once > /scratch/tmp/bz/head.svn/sys/dev/gpio/gpioled.c:88: error: for each function it appears in.) > --- gpioled.o --- > *** [gpioled.o] Error code 1 > > bmake: stopped in /storage/head/obj/mips.mips/scratch/tmp/bz/head.svn/sys/AP121 > --- buildkernel --- > *** [buildkernel] Error code 1 Fixed in r273926. Sorry for the breakage. Luiz From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 10:50:20 2014 Return-Path: Delivered-To: svn-src-all@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 AA586C6A; Sat, 1 Nov 2014 10:50: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 8B6AE7DD; Sat, 1 Nov 2014 10:50: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 sA1AoKDe051777; Sat, 1 Nov 2014 10:50:20 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1AoJji051771; Sat, 1 Nov 2014 10:50:19 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201411011050.sA1AoJji051771@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 1 Nov 2014 10:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273927 - in head/sys/boot: fdt uboot/common uboot/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 10:50:20 -0000 Author: andrew Date: Sat Nov 1 10:50:18 2014 New Revision: 273927 URL: https://svnweb.freebsd.org/changeset/base/273927 Log: Move the definitions of the fdt functions from a uboot header to a new fdt header. There is nothing in the fdt spec that ties it to U-Boot. While here sort and fix the signature of fdt_setup_fdtp. MFC after: 1 week Added: head/sys/boot/fdt/fdt_platform.h (contents, props changed) Modified: head/sys/boot/fdt/fdt_loader_cmd.c head/sys/boot/uboot/common/metadata.c head/sys/boot/uboot/lib/Makefile head/sys/boot/uboot/lib/libuboot.h head/sys/boot/uboot/lib/module.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Sat Nov 1 10:40:29 2014 (r273926) +++ head/sys/boot/fdt/fdt_loader_cmd.c Sat Nov 1 10:50:18 2014 (r273927) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include "bootstrap.h" +#include "fdt_platform.h" #include "glue.h" #ifdef DEBUG Added: head/sys/boot/fdt/fdt_platform.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/fdt_platform.h Sat Nov 1 10:50:18 2014 (r273927) @@ -0,0 +1,35 @@ +/*- + * Copyright (c) 2014 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. + * + * $FreeBSD$ + */ + +#ifndef FDT_PLATFORM_H +#define FDT_PLATFORM_H + +extern int fdt_copy(vm_offset_t); +extern int fdt_setup_fdtp(void); + +#endif /* FDT_PLATFORM_H */ Modified: head/sys/boot/uboot/common/metadata.c ============================================================================== --- head/sys/boot/uboot/common/metadata.c Sat Nov 1 10:40:29 2014 (r273926) +++ head/sys/boot/uboot/common/metadata.c Sat Nov 1 10:50:18 2014 (r273927) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include "glue.h" #if defined(LOADER_FDT_SUPPORT) -#include "libuboot.h" +#include #endif static int Modified: head/sys/boot/uboot/lib/Makefile ============================================================================== --- head/sys/boot/uboot/lib/Makefile Sat Nov 1 10:40:29 2014 (r273926) +++ head/sys/boot/uboot/lib/Makefile Sat Nov 1 10:50:18 2014 (r273927) @@ -27,7 +27,7 @@ LOADER_FDT_SUPPORT= no .endif .if ${LOADER_FDT_SUPPORT} == "yes" -CFLAGS+= -DLOADER_FDT_SUPPORT +CFLAGS+= -DLOADER_FDT_SUPPORT -I${.CURDIR}/../../fdt .endif # Pick up FDT includes Modified: head/sys/boot/uboot/lib/libuboot.h ============================================================================== --- head/sys/boot/uboot/lib/libuboot.h Sat Nov 1 10:40:29 2014 (r273926) +++ head/sys/boot/uboot/lib/libuboot.h Sat Nov 1 10:50:18 2014 (r273927) @@ -72,8 +72,3 @@ void reboot(void); int uboot_diskgetunit(int type, int type_unit); -#if defined(LOADER_FDT_SUPPORT) -extern int fdt_setup_fdtp(); -extern int fdt_copy(vm_offset_t); -#endif - Modified: head/sys/boot/uboot/lib/module.c ============================================================================== --- head/sys/boot/uboot/lib/module.c Sat Nov 1 10:40:29 2014 (r273926) +++ head/sys/boot/uboot/lib/module.c Sat Nov 1 10:50:18 2014 (r273927) @@ -34,6 +34,10 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined(LOADER_FDT_SUPPORT) +#include +#endif + #include "bootstrap.h" #include "libuboot.h" From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 11:08:00 2014 Return-Path: Delivered-To: svn-src-all@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 50DB519D; Sat, 1 Nov 2014 11:08: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 3D7D996F; Sat, 1 Nov 2014 11:08: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 sA1B80G2060855; Sat, 1 Nov 2014 11:08:00 GMT (envelope-from jmmv@FreeBSD.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1B80vU060849; Sat, 1 Nov 2014 11:08:00 GMT (envelope-from jmmv@FreeBSD.org) Message-Id: <201411011108.sA1B80vU060849@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmmv set sender to jmmv@FreeBSD.org using -f From: Julio Merino Date: Sat, 1 Nov 2014 11:08:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273928 - head/contrib/netbsd-tests/usr.sbin/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 11:08:00 -0000 Author: jmmv Date: Sat Nov 1 11:07:59 2014 New Revision: 273928 URL: https://svnweb.freebsd.org/changeset/base/273928 Log: Put mtree test files into a subdirectory. Kyua 0.11 points TMPDIR to the test's work directory, and atf_check creates auxiliary files in TMPDIR. This confuses a couple of mtree tests that were using the work directory's root to validate the contents of the directory. Fix the two affected tests by creating an auxiliary directory to use for the mtree tests. (Kyua should probably do this on its own; filed bug #133 upstream to take a look at this.) Modified: head/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh Modified: head/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh ============================================================================== --- head/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh Sat Nov 1 10:50:18 2014 (r273927) +++ head/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh Sat Nov 1 11:07:59 2014 (r273928) @@ -284,6 +284,13 @@ ignore_head() ignore_body() { + # Kyua 0.11 and above point TMPDIR to our work directory and atf-check + # generates a temporary file, which confuses mtree. Put the mtree files + # into a subdirectory. + # + # See https://github.com/jmmv/kyua/issues/133 for details. + mkdir root && cd root + mkdir newdir mtree -F ${FLAVOR} -c | mtree -F ${FLAVOR} -Ck uid,gid,mode > mtree.spec ln -s newdir otherdir @@ -313,6 +320,13 @@ mtree_ignore_body() } netbsd6_ignore_body() { + # Kyua 0.11 and above point TMPDIR to our work directory and atf-check + # generates a temporary file, which confuses mtree. Put the mtree files + # into a subdirectory. + # + # See https://github.com/jmmv/kyua/issues/133 for details. + mkdir root && cd root + FLAVOR=netbsd6 ignore_body } From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 11:17:58 2014 Return-Path: Delivered-To: svn-src-all@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 3E99648D; Sat, 1 Nov 2014 11:17: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 26C95A49; Sat, 1 Nov 2014 11:17: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 sA1BHwfr065758; Sat, 1 Nov 2014 11:17:58 GMT (envelope-from jmmv@FreeBSD.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1BHtuQ065740; Sat, 1 Nov 2014 11:17:55 GMT (envelope-from jmmv@FreeBSD.org) Message-Id: <201411011117.sA1BHtuQ065740@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmmv set sender to jmmv@FreeBSD.org using -f From: Julio Merino Date: Sat, 1 Nov 2014 11:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273929 - in head: . contrib/atf contrib/atf/atf-c contrib/atf/atf-c++ contrib/atf/atf-c++/detail contrib/atf/atf-c/detail contrib/atf/atf-sh contrib/atf/doc contrib/atf/test-programs l... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 11:17:58 -0000 Author: jmmv Date: Sat Nov 1 11:17:54 2014 New Revision: 273929 URL: https://svnweb.freebsd.org/changeset/base/273929 Log: MFV: Import atf-0.21. Added: head/contrib/atf/atf-c++/atf-c++.3 - copied unchanged from r273873, vendor/atf/dist/atf-c++/atf-c++.3 head/contrib/atf/atf-c/atf-c.3 - copied unchanged from r273873, vendor/atf/dist/atf-c/atf-c.3 head/contrib/atf/atf-sh/atf-sh.3 - copied unchanged from r273873, vendor/atf/dist/atf-sh/atf-sh.3 head/contrib/atf/config.h - copied, changed from r273922, head/contrib/atf/bconfig.h head/contrib/atf/doc/atf.7.in - copied unchanged from r273873, vendor/atf/dist/doc/atf.7.in Deleted: head/contrib/atf/atf-c++/config.cpp head/contrib/atf/atf-c++/config.hpp head/contrib/atf/atf-c++/config_test.cpp head/contrib/atf/atf-c++/detail/sanity_test.cpp head/contrib/atf/atf-c/config.c head/contrib/atf/atf-c/config.h head/contrib/atf/atf-c/config_test.c head/contrib/atf/bconfig.h Modified: head/ObsoleteFiles.inc head/contrib/atf/FREEBSD-Xlist head/contrib/atf/NEWS head/contrib/atf/atf-c++.hpp head/contrib/atf/atf-c++/Kyuafile head/contrib/atf/atf-c++/atf_c++_test.cpp head/contrib/atf/atf-c++/build.cpp head/contrib/atf/atf-c++/build.hpp head/contrib/atf/atf-c++/build_test.cpp head/contrib/atf/atf-c++/check.cpp head/contrib/atf/atf-c++/check.hpp head/contrib/atf/atf-c++/check_test.cpp head/contrib/atf/atf-c++/detail/Kyuafile head/contrib/atf/atf-c++/detail/application.cpp head/contrib/atf/atf-c++/detail/application.hpp head/contrib/atf/atf-c++/detail/application_test.cpp head/contrib/atf/atf-c++/detail/auto_array.hpp head/contrib/atf/atf-c++/detail/auto_array_test.cpp head/contrib/atf/atf-c++/detail/env.cpp head/contrib/atf/atf-c++/detail/env.hpp head/contrib/atf/atf-c++/detail/env_test.cpp head/contrib/atf/atf-c++/detail/exceptions.cpp head/contrib/atf/atf-c++/detail/exceptions.hpp head/contrib/atf/atf-c++/detail/exceptions_test.cpp head/contrib/atf/atf-c++/detail/fs.cpp head/contrib/atf/atf-c++/detail/fs.hpp head/contrib/atf/atf-c++/detail/fs_test.cpp head/contrib/atf/atf-c++/detail/process.cpp head/contrib/atf/atf-c++/detail/process.hpp head/contrib/atf/atf-c++/detail/process_test.cpp head/contrib/atf/atf-c++/detail/sanity.hpp head/contrib/atf/atf-c++/detail/test_helpers.cpp head/contrib/atf/atf-c++/detail/test_helpers.hpp head/contrib/atf/atf-c++/detail/text.cpp head/contrib/atf/atf-c++/detail/text.hpp head/contrib/atf/atf-c++/detail/text_test.cpp head/contrib/atf/atf-c++/detail/version_helper.cpp head/contrib/atf/atf-c++/macros.hpp head/contrib/atf/atf-c++/macros_hpp_test.cpp head/contrib/atf/atf-c++/macros_test.cpp head/contrib/atf/atf-c++/pkg_config_test.sh head/contrib/atf/atf-c++/tests.cpp head/contrib/atf/atf-c++/tests.hpp head/contrib/atf/atf-c++/tests_test.cpp head/contrib/atf/atf-c++/unused_test.cpp head/contrib/atf/atf-c++/utils.cpp head/contrib/atf/atf-c++/utils.hpp head/contrib/atf/atf-c++/utils_test.cpp head/contrib/atf/atf-c.h head/contrib/atf/atf-c/Kyuafile head/contrib/atf/atf-c/atf_c_test.c head/contrib/atf/atf-c/build.c head/contrib/atf/atf-c/build.h head/contrib/atf/atf-c/build_test.c head/contrib/atf/atf-c/check.c head/contrib/atf/atf-c/check.h head/contrib/atf/atf-c/check_test.c head/contrib/atf/atf-c/defs.h.in head/contrib/atf/atf-c/detail/dynstr.c head/contrib/atf/atf-c/detail/dynstr.h head/contrib/atf/atf-c/detail/dynstr_test.c head/contrib/atf/atf-c/detail/env.c head/contrib/atf/atf-c/detail/env.h head/contrib/atf/atf-c/detail/env_test.c head/contrib/atf/atf-c/detail/fs.c head/contrib/atf/atf-c/detail/fs.h head/contrib/atf/atf-c/detail/fs_test.c head/contrib/atf/atf-c/detail/list.c head/contrib/atf/atf-c/detail/list.h head/contrib/atf/atf-c/detail/list_test.c head/contrib/atf/atf-c/detail/map.c head/contrib/atf/atf-c/detail/map.h head/contrib/atf/atf-c/detail/map_test.c head/contrib/atf/atf-c/detail/process.c head/contrib/atf/atf-c/detail/process.h head/contrib/atf/atf-c/detail/process_helpers.c head/contrib/atf/atf-c/detail/process_test.c head/contrib/atf/atf-c/detail/sanity.c head/contrib/atf/atf-c/detail/sanity.h head/contrib/atf/atf-c/detail/sanity_test.c head/contrib/atf/atf-c/detail/test_helpers.c head/contrib/atf/atf-c/detail/test_helpers.h head/contrib/atf/atf-c/detail/text.c head/contrib/atf/atf-c/detail/text.h head/contrib/atf/atf-c/detail/text_test.c head/contrib/atf/atf-c/detail/tp_main.c head/contrib/atf/atf-c/detail/user.c head/contrib/atf/atf-c/detail/user.h head/contrib/atf/atf-c/detail/user_test.c head/contrib/atf/atf-c/detail/version_helper.c head/contrib/atf/atf-c/error.c head/contrib/atf/atf-c/error.h head/contrib/atf/atf-c/error_fwd.h head/contrib/atf/atf-c/error_test.c head/contrib/atf/atf-c/h_build.h head/contrib/atf/atf-c/macros.h head/contrib/atf/atf-c/macros_h_test.c head/contrib/atf/atf-c/macros_test.c head/contrib/atf/atf-c/pkg_config_test.sh head/contrib/atf/atf-c/tc.c head/contrib/atf/atf-c/tc.h head/contrib/atf/atf-c/tc_test.c head/contrib/atf/atf-c/tp.c head/contrib/atf/atf-c/tp.h head/contrib/atf/atf-c/tp_test.c head/contrib/atf/atf-c/unused_test.c head/contrib/atf/atf-c/utils.c head/contrib/atf/atf-c/utils.h head/contrib/atf/atf-c/utils_test.c head/contrib/atf/atf-sh/atf-check.1 head/contrib/atf/atf-sh/atf-check.cpp head/contrib/atf/atf-sh/atf-check_test.sh head/contrib/atf/atf-sh/atf-sh.1 head/contrib/atf/atf-sh/atf-sh.cpp head/contrib/atf/atf-sh/atf_check_test.sh head/contrib/atf/atf-sh/config_test.sh head/contrib/atf/atf-sh/integration_test.sh head/contrib/atf/atf-sh/libatf-sh.subr head/contrib/atf/atf-sh/misc_helpers.sh head/contrib/atf/atf-sh/normalize_test.sh head/contrib/atf/atf-sh/tc_test.sh head/contrib/atf/atf-sh/tp_test.sh head/contrib/atf/doc/atf-test-case.4 head/contrib/atf/doc/atf-test-program.1 head/contrib/atf/test-programs/c_helpers.c head/contrib/atf/test-programs/common.sh head/contrib/atf/test-programs/config_test.sh head/contrib/atf/test-programs/cpp_helpers.cpp head/contrib/atf/test-programs/expect_test.sh head/contrib/atf/test-programs/meta_data_test.sh head/contrib/atf/test-programs/result_test.sh head/contrib/atf/test-programs/sh_helpers.sh head/contrib/atf/test-programs/srcdir_test.sh head/lib/atf/Makefile.inc head/lib/atf/common.mk head/lib/atf/libatf-c++/Makefile head/lib/atf/libatf-c++/tests/Makefile head/lib/atf/libatf-c++/tests/detail/Makefile head/lib/atf/libatf-c/Makefile head/lib/atf/libatf-c/tests/Makefile head/lib/atf/libatf-c/tests/detail/Makefile head/libexec/atf/atf-check/Makefile head/libexec/atf/atf-sh/Makefile head/libexec/atf/atf-sh/tests/Makefile head/share/man/man7/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: head/contrib/atf/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Nov 1 11:07:59 2014 (r273928) +++ head/ObsoleteFiles.inc Sat Nov 1 11:17:54 2014 (r273929) @@ -374,7 +374,6 @@ OLD_FILES+=usr/share/man/man1/atf-report OLD_FILES+=usr/share/man/man1/atf-run.1.gz OLD_FILES+=usr/share/man/man1/atf-version.1.gz OLD_FILES+=usr/share/man/man5/atf-formats.5.gz -OLD_FILES+=usr/share/man/man7/atf.7.gz OLD_FILES+=usr/share/xml/atf/tests-results.dtd OLD_FILES+=usr/share/xsl/atf/tests-results.xsl # 20131009: freebsd-version moved from /libexec to /bin Modified: head/contrib/atf/FREEBSD-Xlist ============================================================================== --- head/contrib/atf/FREEBSD-Xlist Sat Nov 1 11:07:59 2014 (r273928) +++ head/contrib/atf/FREEBSD-Xlist Sat Nov 1 11:17:54 2014 (r273929) @@ -1,22 +1,12 @@ -*/*/Atffile */*/Makefile* -*/Atffile */Makefile* */*.m4 */*.pc.in -Atffile INSTALL Makefile* aclocal.m4 admin/ -atf-config/ -atf-report/ -atf-run/ -atf-version/ -bconfig.h.in +config.h.in bootstrap/ configure* -doc/atf-formats.5 -doc/atf.7.in m4/ -tools/ Modified: head/contrib/atf/NEWS ============================================================================== --- head/contrib/atf/NEWS Sat Nov 1 11:07:59 2014 (r273928) +++ head/contrib/atf/NEWS Sat Nov 1 11:17:54 2014 (r273929) @@ -1,6 +1,62 @@ Major changes between releases Automated Testing Framework =========================================================================== +Changes in version 0.21 +*********************** + +Released on October 23rd, 2014. + +* Restored the atf(7) manual page to serve as a reference to all the other + manual pages shipped by ATF. + +* Added the -s flag to atf-sh to support specifying the shell interpreter + to be used. + +* Removed ATF_WORKDIR. The only remaining consumers have been converted to + use the standard TMPDIR environment variable. As a benefit, and because + Kyua forces the TMPDIR to live within the test case's work directory, + any stale files left behind by ATF will be automatically cleaned up. + +* Documented the environment variables recognized by each component in the + relevant manual pages. This information was lost with the atf-config(1) + removal. + +* Added a new "require.diskspace" metadata property to test cases so that + they can specify the minimum amount of disk space required for the test + to run. + +* Renamed the atf-{c,c++,sh}-api(3) manual pages to atf-{c,c++,sh}(3) for + discoverability purposes. Symbolic links are provided for the time + being to still make the old names visible. + +* Issue #5: Recommend the (expected, actual) idiom for calls to the test + macros in the manual pages. + +* Issue #7: Stopped catching unhandled exceptions in atf-c++ tests. This + propagates the crash to the caller, which in turn allows it to obtain + proper debugging information. In particular, Kyua should now be able to + extract a stacktrace pinpointing the problem. + +* Issue #8: Fixed atf-c/macros_test:use test failures spotted by the clang + that ships with FreeBSD 11.0-CURRENT. + +* Issue #12: Improved documentation of atf-sh(3) and atf-check(1) by better + explaining how they relate to each other. + +* Issue #14: Stopped setting 'set -e' in atf-sh. This setting was + initially added as a way to enable a "strict" mode in the library and to + make test cases fail fast when they run unprotected commands. However, + doing so in the library is surprising as the responsibility of enabling + 'set -e' should be on the user's code. Also, 'set -e' introduces + inconsistent behavior on subshells and users do not expect that. + +* Issue #15: Fixed atf_utils_{fork,wait} to support nested calls. + +* Issue #16: Fixed test failures (by removing a long-standing hack) on + systems that lack \e support in printf(1). + +* Issue #19: Removed stale references to atf-config and atf-run. + Changes in version 0.20 *********************** Modified: head/contrib/atf/atf-c++.hpp ============================================================================== --- head/contrib/atf/atf-c++.hpp Sat Nov 1 11:07:59 2014 (r273928) +++ head/contrib/atf/atf-c++.hpp Sat Nov 1 11:17:54 2014 (r273929) @@ -1,6 +1,3 @@ -// -// Automated Testing Framework (atf) -// // Copyright (c) 2007 The NetBSD Foundation, Inc. // All rights reserved. // @@ -25,12 +22,11 @@ // 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. -// -#if !defined(_ATF_CXX_HPP_) -#define _ATF_CXX_HPP_ +#if !defined(ATF_CXX_HPP) +#define ATF_CXX_HPP #include #include -#endif // !defined(_ATF_CXX_HPP_) +#endif // !defined(ATF_CXX_HPP) Modified: head/contrib/atf/atf-c++/Kyuafile ============================================================================== --- head/contrib/atf/atf-c++/Kyuafile Sat Nov 1 11:07:59 2014 (r273928) +++ head/contrib/atf/atf-c++/Kyuafile Sat Nov 1 11:17:54 2014 (r273929) @@ -5,7 +5,6 @@ test_suite("atf") atf_test_program{name="atf_c++_test"} atf_test_program{name="build_test"} atf_test_program{name="check_test"} -atf_test_program{name="config_test"} atf_test_program{name="macros_test"} atf_test_program{name="pkg_config_test"} atf_test_program{name="tests_test"} Copied: head/contrib/atf/atf-c++/atf-c++.3 (from r273873, vendor/atf/dist/atf-c++/atf-c++.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/atf/atf-c++/atf-c++.3 Sat Nov 1 11:17:54 2014 (r273929, copy of r273873, vendor/atf/dist/atf-c++/atf-c++.3) @@ -0,0 +1,649 @@ +.\" Copyright (c) 2008 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND +.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY +.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.Dd October 13, 2014 +.Dt ATF-C++ 3 +.Os +.Sh NAME +.Nm atf-c++ , +.Nm ATF_ADD_TEST_CASE , +.Nm ATF_CHECK_ERRNO , +.Nm ATF_FAIL , +.Nm ATF_INIT_TEST_CASES , +.Nm ATF_PASS , +.Nm ATF_REQUIRE , +.Nm ATF_REQUIRE_EQ , +.Nm ATF_REQUIRE_ERRNO , +.Nm ATF_REQUIRE_IN , +.Nm ATF_REQUIRE_MATCH , +.Nm ATF_REQUIRE_NOT_IN , +.Nm ATF_REQUIRE_THROW , +.Nm ATF_REQUIRE_THROW_RE , +.Nm ATF_SKIP , +.Nm ATF_TEST_CASE , +.Nm ATF_TEST_CASE_BODY , +.Nm ATF_TEST_CASE_CLEANUP , +.Nm ATF_TEST_CASE_HEAD , +.Nm ATF_TEST_CASE_NAME , +.Nm ATF_TEST_CASE_USE , +.Nm ATF_TEST_CASE_WITH_CLEANUP , +.Nm ATF_TEST_CASE_WITHOUT_HEAD , +.Nm atf::utils::cat_file , +.Nm atf::utils::compare_file , +.Nm atf::utils::copy_file , +.Nm atf::utils::create_file , +.Nm atf::utils::file_exists , +.Nm atf::utils::fork , +.Nm atf::utils::grep_collection , +.Nm atf::utils::grep_file , +.Nm atf::utils::grep_string , +.Nm atf::utils::redirect , +.Nm atf::utils::wait +.Nd C++ API to write ATF-based test programs +.Sh SYNOPSIS +.In atf-c++.hpp +.Fn ATF_ADD_TEST_CASE "tcs" "name" +.Fn ATF_CHECK_ERRNO "expected_errno" "bool_expression" +.Fn ATF_FAIL "reason" +.Fn ATF_INIT_TEST_CASES "tcs" +.Fn ATF_PASS +.Fn ATF_REQUIRE "expression" +.Fn ATF_REQUIRE_EQ "expected_expression" "actual_expression" +.Fn ATF_REQUIRE_ERRNO "expected_errno" "bool_expression" +.Fn ATF_REQUIRE_IN "element" "collection" +.Fn ATF_REQUIRE_MATCH "regexp" "string_expression" +.Fn ATF_REQUIRE_NOT_IN "element" "collection" +.Fn ATF_REQUIRE_THROW "expected_exception" "statement" +.Fn ATF_REQUIRE_THROW_RE "expected_exception" "regexp" "statement" +.Fn ATF_SKIP "reason" +.Fn ATF_TEST_CASE "name" +.Fn ATF_TEST_CASE_BODY "name" +.Fn ATF_TEST_CASE_CLEANUP "name" +.Fn ATF_TEST_CASE_HEAD "name" +.Fn ATF_TEST_CASE_NAME "name" +.Fn ATF_TEST_CASE_USE "name" +.Fn ATF_TEST_CASE_WITH_CLEANUP "name" +.Fn ATF_TEST_CASE_WITHOUT_HEAD "name" +.Ft void +.Fo atf::utils::cat_file +.Fa "const std::string& path" +.Fa "const std::string& prefix" +.Fc +.Ft bool +.Fo atf::utils::compare_file +.Fa "const std::string& path" +.Fa "const std::string& contents" +.Fc +.Ft void +.Fo atf::utils::copy_file +.Fa "const std::string& source" +.Fa "const std::string& destination" +.Fc +.Ft void +.Fo atf::utils::create_file +.Fa "const std::string& path" +.Fa "const std::string& contents" +.Fc +.Ft void +.Fo atf::utils::file_exists +.Fa "const std::string& path" +.Fc +.Ft pid_t +.Fo atf::utils::fork +.Fa "void" +.Fc +.Ft bool +.Fo atf::utils::grep_collection +.Fa "const std::string& regexp" +.Fa "const Collection& collection" +.Fc +.Ft bool +.Fo atf::utils::grep_file +.Fa "const std::string& regexp" +.Fa "const std::string& path" +.Fc +.Ft bool +.Fo atf::utils::grep_string +.Fa "const std::string& regexp" +.Fa "const std::string& path" +.Fc +.Ft void +.Fo atf::utils::redirect +.Fa "const int fd" +.Fa "const std::string& path" +.Fc +.Ft void +.Fo atf::utils::wait +.Fa "const pid_t pid" +.Fa "const int expected_exit_status" +.Fa "const std::string& expected_stdout" +.Fa "const std::string& expected_stderr" +.Fc +.Sh DESCRIPTION +ATF provides a C++ programming interface to implement test programs. +C++-based test programs follow this template: +.Bd -literal -offset indent +extern "C" { +.Ns ... C-specific includes go here ... +} + +.Ns ... C++-specific includes go here ... + +#include + +ATF_TEST_CASE(tc1); +ATF_TEST_CASE_HEAD(tc1) +{ + ... first test case's header ... +} +ATF_TEST_CASE_BODY(tc1) +{ + ... first test case's body ... +} + +ATF_TEST_CASE_WITH_CLEANUP(tc2); +ATF_TEST_CASE_HEAD(tc2) +{ + ... second test case's header ... +} +ATF_TEST_CASE_BODY(tc2) +{ + ... second test case's body ... +} +ATF_TEST_CASE_CLEANUP(tc2) +{ + ... second test case's cleanup ... +} + +ATF_TEST_CASE(tc3); +ATF_TEST_CASE_BODY(tc3) +{ + ... third test case's body ... +} + +.Ns ... additional test cases ... + +ATF_INIT_TEST_CASES(tcs) +{ + ATF_ADD_TEST_CASE(tcs, tc1); + ATF_ADD_TEST_CASE(tcs, tc2); + ATF_ADD_TEST_CASE(tcs, tc3); + ... add additional test cases ... +} +.Ed +.Ss Definition of test cases +Test cases have an identifier and are composed of three different parts: +the header, the body and an optional cleanup routine, all of which are +described in +.Xr atf-test-case 4 . +To define test cases, one can use the +.Fn ATF_TEST_CASE , +.Fn ATF_TEST_CASE_WITH_CLEANUP +or the +.Fn ATF_TEST_CASE_WITHOUT_HEAD +macros, which take a single parameter specifiying the test case's +name. +.Fn ATF_TEST_CASE , +requires to define a head and a body for the test case, +.Fn ATF_TEST_CASE_WITH_CLEANUP +requires to define a head, a body and a cleanup for the test case and +.Fn ATF_TEST_CASE_WITHOUT_HEAD +requires only a body for the test case. +It is important to note that these +.Em do not +set the test case up for execution when the program is run. +In order to do so, a later registration is needed through the +.Fn ATF_ADD_TEST_CASE +macro detailed in +.Sx Program initialization . +.Pp +Later on, one must define the three parts of the body by means of three +functions. +Their headers are given by the +.Fn ATF_TEST_CASE_HEAD , +.Fn ATF_TEST_CASE_BODY +and +.Fn ATF_TEST_CASE_CLEANUP +macros, all of which take the test case's name. +Following each of these, a block of code is expected, surrounded by the +opening and closing brackets. +.Pp +Additionally, the +.Fn ATF_TEST_CASE_NAME +macro can be used to obtain the name of the class corresponding to a +particular test case, as the name is internally manged by the library to +prevent clashes with other user identifiers. +Similarly, the +.Fn ATF_TEST_CASE_USE +macro can be executed on a particular test case to mark it as "used" and +thus prevent compiler warnings regarding unused symbols. +Note that +.Em you should never have to use these macros during regular operation. +.Ss Program initialization +The library provides a way to easily define the test program's +.Fn main +function. +You should never define one on your own, but rely on the +library to do it for you. +This is done by using the +.Fn ATF_INIT_TEST_CASES +macro, which is passed the name of the list that will hold the test cases. +This name can be whatever you want as long as it is a valid variable value. +.Pp +After the macro, you are supposed to provide the body of a function, which +should only use the +.Fn ATF_ADD_TEST_CASE +macro to register the test cases the test program will execute. +The first parameter of this macro matches the name you provided in the +former call. +.Ss Header definitions +The test case's header can define the meta-data by using the +.Fn set_md_var +method, which takes two parameters: the first one specifies the +meta-data variable to be set and the second one specifies its value. +Both of them are strings. +.Ss Configuration variables +The test case has read-only access to the current configuration variables +by means of the +.Ft bool +.Fn has_config_var +and the +.Ft std::string +.Fn get_config_var +methods, which can be called in any of the three parts of a test case. +.Ss Access to the source directory +It is possible to get the path to the test case's source directory from any +of its three components by querying the +.Sq srcdir +configuration variable. +.Ss Requiring programs +Aside from the +.Va require.progs +meta-data variable available in the header only, one can also check for +additional programs in the test case's body by using the +.Fn require_prog +function, which takes the base name or full path of a single binary. +Relative paths are forbidden. +If it is not found, the test case will be automatically skipped. +.Ss Test case finalization +The test case finalizes either when the body reaches its end, at which +point the test is assumed to have +.Em passed , +or at any explicit call to +.Fn ATF_PASS , +.Fn ATF_FAIL +or +.Fn ATF_SKIP . +These three macros terminate the execution of the test case immediately. +The cleanup routine will be processed afterwards in a completely automated +way, regardless of the test case's termination reason. +.Pp +.Fn ATF_PASS +does not take any parameters. +.Fn ATF_FAIL +and +.Fn ATF_SKIP +take a single string that describes why the test case failed or +was skipped, respectively. +It is very important to provide a clear error message in both cases so that +the user can quickly know why the test did not pass. +.Ss Expectations +Everything explained in the previous section changes when the test case +expectations are redefined by the programmer. +.Pp +Each test case has an internal state called +.Sq expect +that describes what the test case expectations are at any point in time. +The value of this property can change during execution by any of: +.Bl -tag -width indent +.It Fn expect_death "reason" +Expects the test case to exit prematurely regardless of the nature of the +exit. +.It Fn expect_exit "exitcode" "reason" +Expects the test case to exit cleanly. +If +.Va exitcode +is not +.Sq -1 , +the runtime engine will validate that the exit code of the test case +matches the one provided in this call. +Otherwise, the exact value will be ignored. +.It Fn expect_fail "reason" +Any failure (be it fatal or non-fatal) raised in this mode is recorded. +However, such failures do not report the test case as failed; instead, the +test case finalizes cleanly and is reported as +.Sq expected failure ; +this report includes the provided +.Fa reason +as part of it. +If no error is raised while running in this mode, then the test case is +reported as +.Sq failed . +.Pp +This mode is useful to reproduce actual known bugs in tests. +Whenever the developer fixes the bug later on, the test case will start +reporting a failure, signaling the developer that the test case must be +adjusted to the new conditions. +In this situation, it is useful, for example, to set +.Fa reason +as the bug number for tracking purposes. +.It Fn expect_pass +This is the normal mode of execution. +In this mode, any failure is reported as such to the user and the test case +is marked as +.Sq failed . +.It Fn expect_race "reason" +Any failure or timeout during the execution of the test case will be +considered as if a race condition has been triggered and reported as such. +If no problems arise, the test will continue execution as usual. +.It Fn expect_signal "signo" "reason" +Expects the test case to terminate due to the reception of a signal. +If +.Va signo +is not +.Sq -1 , +the runtime engine will validate that the signal that terminated the test +case matches the one provided in this call. +Otherwise, the exact value will be ignored. +.It Fn expect_timeout "reason" +Expects the test case to execute for longer than its timeout. +.El +.Ss Helper macros for common checks +The library provides several macros that are very handy in multiple +situations. +These basically check some condition after executing a given statement or +processing a given expression and, if the condition is not met, they +automatically call +.Fn ATF_FAIL +with an appropriate error message. +.Pp +.Fn ATF_REQUIRE +takes an expression and raises a failure if it evaluates to false. +.Pp +.Fn ATF_REQUIRE_EQ +takes two expressions and raises a failure if the two do not evaluate to +the same exact value. +The common style is to put the expected value in the first parameter and the +actual value in the second parameter. +.Pp +.Fn ATF_REQUIRE_IN +takes an element and a collection and validates that the element is present in +the collection. +.Pp +.Fn ATF_REQUIRE_MATCH +takes a regular expression and a string and raises a failure if the regular +expression does not match the string. +.Pp +.Fn ATF_REQUIRE_NOT_IN +takes an element and a collection and validates that the element is not present +in the collection. +.Pp +.Fn ATF_REQUIRE_THROW +takes the name of an exception and a statement and raises a failure if +the statement does not throw the specified exception. +.Fn ATF_REQUIRE_THROW_RE +takes the name of an exception, a regular expresion and a statement and raises a +failure if the statement does not throw the specified exception and if the +message of the exception does not match the regular expression. +.Pp +.Fn ATF_CHECK_ERRNO +and +.Fn ATF_REQUIRE_ERRNO +take, first, the error code that the check is expecting to find in the +.Va errno +variable and, second, a boolean expression that, if evaluates to true, +means that a call failed and +.Va errno +has to be checked against the first value. +.Ss Utility functions +The following functions are provided as part of the +.Nm +API to simplify the creation of a variety of tests. +In particular, these are useful to write tests for command-line interfaces. +.Pp +.Ft void +.Fo atf::utils::cat_file +.Fa "const std::string& path" +.Fa "const std::string& prefix" +.Fc +.Bd -ragged -offset indent +Prints the contents of +.Fa path +to the standard output, prefixing every line with the string in +.Fa prefix . +.Ed +.Pp +.Ft bool +.Fo atf::utils::compare_file +.Fa "const std::string& path" +.Fa "const std::string& contents" +.Fc +.Bd -ragged -offset indent +Returns true if the given +.Fa path +matches exactly the expected inlined +.Fa contents . +.Ed +.Pp +.Ft void +.Fo atf::utils::copy_file +.Fa "const std::string& source" +.Fa "const std::string& destination" +.Fc +.Bd -ragged -offset indent +Copies the file +.Fa source +to +.Fa destination . +The permissions of the file are preserved during the code. +.Ed +.Pp +.Ft void +.Fo atf::utils::create_file +.Fa "const std::string& path" +.Fa "const std::string& contents" +.Fc +.Bd -ragged -offset indent +Creates +.Fa file +with the text given in +.Fa contents . +.Ed +.Pp +.Ft void +.Fo atf::utils::file_exists +.Fa "const std::string& path" +.Fc +.Bd -ragged -offset indent +Checks if +.Fa path +exists. +.Ed +.Pp +.Ft pid_t +.Fo atf::utils::fork +.Fa "void" +.Fc +.Bd -ragged -offset indent +Forks a process and redirects the standard output and standard error of the +child to files for later validation with +.Fn atf::utils::wait . +Fails the test case if the fork fails, so this does not return an error. +.Ed +.Pp +.Ft bool +.Fo atf::utils::grep_collection +.Fa "const std::string& regexp" +.Fa "const Collection& collection" +.Fc +.Bd -ragged -offset indent +Searches for the regular expression +.Fa regexp +in any of the strings contained in the +.Fa collection . +This is a template that accepts any one-dimensional container of strings. +.Ed +.Pp +.Ft bool +.Fo atf::utils::grep_file +.Fa "const std::string& regexp" +.Fa "const std::string& path" +.Fc +.Bd -ragged -offset indent +Searches for the regular expression +.Fa regexp +in the file +.Fa path . +The variable arguments are used to construct the regular expression. +.Ed +.Pp +.Ft bool +.Fo atf::utils::grep_string +.Fa "const std::string& regexp" +.Fa "const std::string& str" +.Fc +.Bd -ragged -offset indent +Searches for the regular expression +.Fa regexp +in the string +.Fa str . +.Ed +.Ft void +.Fo atf::utils::redirect +.Fa "const int fd" +.Fa "const std::string& path" +.Fc +.Bd -ragged -offset indent +Redirects the given file descriptor +.Fa fd +to the file +.Fa path . +This function exits the process in case of an error and does not properly mark +the test case as failed. +As a result, it should only be used in subprocesses of the test case; specially +those spawned by +.Fn atf::utils::fork . +.Ed +.Pp +.Ft void +.Fo atf::utils::wait +.Fa "const pid_t pid" +.Fa "const int expected_exit_status" +.Fa "const std::string& expected_stdout" +.Fa "const std::string& expected_stderr" +.Fc +.Bd -ragged -offset indent +Waits and validates the result of a subprocess spawned with +.Fn atf::utils::wait . +The validation involves checking that the subprocess exited cleanly and returned +the code specified in +.Fa expected_exit_status +and that its standard output and standard error match the strings given in +.Fa expected_stdout +and +.Fa expected_stderr . +.Pp +If any of the +.Fa expected_stdout +or +.Fa expected_stderr +strings are prefixed with +.Sq save: , +then they specify the name of the file into which to store the stdout or stderr +of the subprocess, and no comparison is performed. +.Ed +.Sh ENVIRONMENT +The following variables are recognized by +.Nm +but should not be overridden other than for testing purposes: +.Pp +.Bl -tag -width ATFXBUILDXCXXFLAGSXX -compact +.It Va ATF_BUILD_CC +Path to the C compiler. +.It Va ATF_BUILD_CFLAGS +C compiler flags. +.It Va ATF_BUILD_CPP +Path to the C/C++ preprocessor. +.It Va ATF_BUILD_CPPFLAGS +C/C++ preprocessor flags. +.It Va ATF_BUILD_CXX +Path to the C++ compiler. +.It Va ATF_BUILD_CXXFLAGS +C++ compiler flags. +.El +.Sh EXAMPLES +The following shows a complete test program with a single test case that +validates the addition operator: +.Bd -literal -offset indent +#include + +ATF_TEST_CASE(addition); +ATF_TEST_CASE_HEAD(addition) +{ + set_md_var("descr", "Sample tests for the addition operator"); +} +ATF_TEST_CASE_BODY(addition) +{ + ATF_REQUIRE_EQ(0, 0 + 0); + ATF_REQUIRE_EQ(1, 0 + 1); + ATF_REQUIRE_EQ(1, 1 + 0); + + ATF_REQUIRE_EQ(2, 1 + 1); + + ATF_REQUIRE_EQ(300, 100 + 200); +} + +ATF_TEST_CASE(open_failure); +ATF_TEST_CASE_HEAD(open_failure) +{ + set_md_var("descr", "Sample tests for the open function"); +} +ATF_TEST_CASE_BODY(open_failure) +{ + ATF_REQUIRE_ERRNO(ENOENT, open("non-existent", O_RDONLY) == -1); +} + +ATF_TEST_CASE(known_bug); +ATF_TEST_CASE_HEAD(known_bug) +{ + set_md_var("descr", "Reproduces a known bug"); +} +ATF_TEST_CASE_BODY(known_bug) +{ + expect_fail("See bug number foo/bar"); + ATF_REQUIRE_EQ(3, 1 + 1); + expect_pass(); + ATF_REQUIRE_EQ(3, 1 + 2); +} + +ATF_INIT_TEST_CASES(tcs) +{ + ATF_ADD_TEST_CASE(tcs, addition); + ATF_ADD_TEST_CASE(tcs, open_failure); + ATF_ADD_TEST_CASE(tcs, known_bug); +} +.Ed +.Sh SEE ALSO +.Xr atf-test-program 1 , +.Xr atf-test-case 4 Modified: head/contrib/atf/atf-c++/atf_c++_test.cpp ============================================================================== --- head/contrib/atf/atf-c++/atf_c++_test.cpp Sat Nov 1 11:07:59 2014 (r273928) +++ head/contrib/atf/atf-c++/atf_c++_test.cpp Sat Nov 1 11:17:54 2014 (r273929) @@ -1,6 +1,3 @@ -// -// Automated Testing Framework (atf) -// // Copyright (c) 2009 The NetBSD Foundation, Inc. // All rights reserved. // @@ -25,11 +22,10 @@ // 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 "macros.hpp" +#include -#include "detail/test_helpers.hpp" +#include "atf-c++/detail/test_helpers.hpp" // ------------------------------------------------------------------------ // Tests cases for the header file. Modified: head/contrib/atf/atf-c++/build.cpp ============================================================================== --- head/contrib/atf/atf-c++/build.cpp Sat Nov 1 11:07:59 2014 (r273928) +++ head/contrib/atf/atf-c++/build.cpp Sat Nov 1 11:17:54 2014 (r273929) @@ -1,6 +1,3 @@ -// -// Automated Testing Framework (atf) -// // Copyright (c) 2009 The NetBSD Foundation, Inc. // All rights reserved. // @@ -25,7 +22,8 @@ // 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 "atf-c++/build.hpp" extern "C" { #include "atf-c/build.h" @@ -33,10 +31,8 @@ extern "C" { #include "atf-c/utils.h" } -#include "build.hpp" - -#include "detail/exceptions.hpp" -#include "detail/process.hpp" +#include "atf-c++/detail/exceptions.hpp" +#include "atf-c++/detail/process.hpp" namespace impl = atf::build; #define IMPL_NAME "atf::build" Modified: head/contrib/atf/atf-c++/build.hpp ============================================================================== --- head/contrib/atf/atf-c++/build.hpp Sat Nov 1 11:07:59 2014 (r273928) +++ head/contrib/atf/atf-c++/build.hpp Sat Nov 1 11:17:54 2014 (r273929) @@ -1,6 +1,3 @@ -// -// Automated Testing Framework (atf) -// // Copyright (c) 2009 The NetBSD Foundation, Inc. // All rights reserved. // @@ -25,10 +22,9 @@ // 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. -// -#if !defined(_ATF_CXX_BUILD_HPP_) -#define _ATF_CXX_BUILD_HPP_ +#if !defined(ATF_CXX_BUILD_HPP) +#define ATF_CXX_BUILD_HPP #include @@ -54,4 +50,4 @@ process::argv_array cxx_o(const std::str } // namespace build } // namespace atf -#endif // !defined(_ATF_CXX_BUILD_HPP_) +#endif // !defined(ATF_CXX_BUILD_HPP) Modified: head/contrib/atf/atf-c++/build_test.cpp ============================================================================== --- head/contrib/atf/atf-c++/build_test.cpp Sat Nov 1 11:07:59 2014 (r273928) +++ head/contrib/atf/atf-c++/build_test.cpp Sat Nov 1 11:17:54 2014 (r273929) @@ -1,6 +1,3 @@ -// -// Automated Testing Framework (atf) -// // Copyright (c) 2009 The NetBSD Foundation, Inc. // All rights reserved. // @@ -25,31 +22,25 @@ // 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 "atf-c++/build.hpp" #include #include -#include "../atf-c/h_build.h" +#include -#include "build.hpp" -#include "config.hpp" -#include "macros.hpp" - -#include "detail/env.hpp" -#include "detail/process.hpp" -#include "detail/test_helpers.hpp" +extern "C" { +#include "atf-c/h_build.h" +} + +#include "atf-c++/detail/env.hpp" +#include "atf-c++/detail/process.hpp" // ------------------------------------------------------------------------ // Auxiliary functions. // ------------------------------------------------------------------------ -namespace atf { - namespace config { - void __reinit(void); - } -} - template< class C > void print_col(const char* prefix, const C& c) @@ -168,7 +159,6 @@ ATF_TEST_CASE_BODY(c_o) verbose_set_env("ATF_BUILD_CC", test->cc); verbose_set_env("ATF_BUILD_CFLAGS", test->cflags); verbose_set_env("ATF_BUILD_CPPFLAGS", test->cppflags); - atf::config::__reinit(); atf::process::argv_array argv = atf::build::c_o(test->sfile, test->ofile, @@ -190,7 +180,6 @@ ATF_TEST_CASE_BODY(cpp) verbose_set_env("ATF_BUILD_CPP", test->cpp); verbose_set_env("ATF_BUILD_CPPFLAGS", test->cppflags); - atf::config::__reinit(); atf::process::argv_array argv = atf::build::cpp(test->sfile, test->ofile, @@ -213,7 +202,6 @@ ATF_TEST_CASE_BODY(cxx_o) verbose_set_env("ATF_BUILD_CXX", test->cxx); verbose_set_env("ATF_BUILD_CXXFLAGS", test->cxxflags); verbose_set_env("ATF_BUILD_CPPFLAGS", test->cppflags); - atf::config::__reinit(); atf::process::argv_array argv = atf::build::cxx_o(test->sfile, test->ofile, @@ -223,12 +211,6 @@ ATF_TEST_CASE_BODY(cxx_o) } // ------------------------------------------------------------------------ -// Tests cases for the header file. -// ------------------------------------------------------------------------ - -HEADER_TC(include, "atf-c++/build.hpp"); - -// ------------------------------------------------------------------------ // Main. // ------------------------------------------------------------------------ @@ -241,7 +223,4 @@ ATF_INIT_TEST_CASES(tcs) ATF_ADD_TEST_CASE(tcs, c_o); ATF_ADD_TEST_CASE(tcs, cpp); ATF_ADD_TEST_CASE(tcs, cxx_o); - - // Add the test cases for the header file. - ATF_ADD_TEST_CASE(tcs, include); } Modified: head/contrib/atf/atf-c++/check.cpp ============================================================================== --- head/contrib/atf/atf-c++/check.cpp Sat Nov 1 11:07:59 2014 (r273928) +++ head/contrib/atf/atf-c++/check.cpp Sat Nov 1 11:17:54 2014 (r273929) @@ -1,6 +1,3 @@ -// -// Automated Testing Framework (atf) -// // Copyright (c) 2007 The NetBSD Foundation, Inc. // All rights reserved. // @@ -25,7 +22,8 @@ // 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 "atf-c++/check.hpp" #include @@ -34,11 +32,9 @@ extern "C" { #include "atf-c/error.h" } -#include "check.hpp" - -#include "detail/exceptions.hpp" -#include "detail/process.hpp" -#include "detail/sanity.hpp" +#include "atf-c++/detail/exceptions.hpp" +#include "atf-c++/detail/process.hpp" +#include "atf-c++/detail/sanity.hpp" namespace impl = atf::check; #define IMPL_NAME "atf::check" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 11:19:50 2014 Return-Path: Delivered-To: svn-src-all@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 B56235D6; Sat, 1 Nov 2014 11:19: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 9FD25A51; Sat, 1 Nov 2014 11:19: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 sA1BJo1g066048; Sat, 1 Nov 2014 11:19:50 GMT (envelope-from jmmv@FreeBSD.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1BJo69066047; Sat, 1 Nov 2014 11:19:50 GMT (envelope-from jmmv@FreeBSD.org) Message-Id: <201411011119.sA1BJo69066047@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmmv set sender to jmmv@FreeBSD.org using -f From: Julio Merino Date: Sat, 1 Nov 2014 11:19:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r273930 - in vendor/atf: atf-0.20/atf-config atf-0.20/atf-report atf-0.20/atf-run atf-0.20/atf-version atf-0.20/tools atf-0.21/atf-config atf-0.21/atf-report atf-0.21/atf-run atf-0.21/a... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 11:19:50 -0000 Author: jmmv Date: Sat Nov 1 11:19:50 2014 New Revision: 273930 URL: https://svnweb.freebsd.org/changeset/base/273930 Log: Remove empty directories for the deprecated (now gone) tools. The tools-related directories should have been removed with the import of atf-0.20 months ago, but I missed the bit in the Subversion Primer saying that emptied directories require manual removal. Do so now. Deleted: vendor/atf/atf-0.20/atf-config/ vendor/atf/atf-0.20/atf-report/ vendor/atf/atf-0.20/atf-run/ vendor/atf/atf-0.20/atf-version/ vendor/atf/atf-0.20/tools/ vendor/atf/atf-0.21/atf-config/ vendor/atf/atf-0.21/atf-report/ vendor/atf/atf-0.21/atf-run/ vendor/atf/atf-0.21/atf-version/ vendor/atf/atf-0.21/tools/ vendor/atf/dist/atf-config/ vendor/atf/dist/atf-report/ vendor/atf/dist/atf-run/ vendor/atf/dist/atf-version/ vendor/atf/dist/tools/ From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 13:45:03 2014 Return-Path: Delivered-To: svn-src-all@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 894D4383; Sat, 1 Nov 2014 13:45: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 5AB6B91B; Sat, 1 Nov 2014 13:45: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 sA1Dj3uW035624; Sat, 1 Nov 2014 13:45:03 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1Dj38Z035623; Sat, 1 Nov 2014 13:45:03 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411011345.sA1Dj38Z035623@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 1 Nov 2014 13:45:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r273931 - in stable: 10/lib/libutil 7/lib/libutil 8/lib/libutil 9/lib/libutil X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 13:45:03 -0000 Author: dim Date: Sat Nov 1 13:45:01 2014 New Revision: 273931 URL: https://svnweb.freebsd.org/changeset/base/273931 Log: MFC r273837: Fix a clang 3.5 warning about abs(3) being given an argument of type quad_t in setusercontext(). While here, sanitize the clamping of the priority value, and use the correct type for the return value of login_getcapnum(). Reviewed by: kib Modified: stable/8/lib/libutil/login_class.c Directory Properties: stable/8/lib/libutil/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/libutil/login_class.c stable/7/lib/libutil/login_class.c stable/9/lib/libutil/login_class.c Directory Properties: stable/10/ (props changed) stable/7/lib/libutil/ (props changed) stable/9/lib/libutil/ (props changed) Modified: stable/8/lib/libutil/login_class.c ============================================================================== --- stable/8/lib/libutil/login_class.c Sat Nov 1 11:19:50 2014 (r273930) +++ stable/8/lib/libutil/login_class.c Sat Nov 1 13:45:01 2014 (r273931) @@ -422,7 +422,7 @@ setlogincontext(login_cap_t *lc, const s int setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned int flags) { - quad_t p; + rlim_t p; mode_t mymask; login_cap_t *llc = NULL; struct rtprio rtp; @@ -446,16 +446,16 @@ setusercontext(login_cap_t *lc, const st if (p > PRIO_MAX) { rtp.type = RTP_PRIO_IDLE; - rtp.prio = p - PRIO_MAX - 1; - p = (rtp.prio > RTP_PRIO_MAX) ? 31 : p; + p -= PRIO_MAX + 1; + rtp.prio = p > RTP_PRIO_MAX ? RTP_PRIO_MAX : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", pwd ? pwd->pw_name : "-", lc ? lc->lc_class : LOGIN_DEFCLASS); } else if (p < PRIO_MIN) { rtp.type = RTP_PRIO_REALTIME; - rtp.prio = abs(p - PRIO_MIN + RTP_PRIO_MAX); - p = (rtp.prio > RTP_PRIO_MAX) ? 1 : p; + p -= PRIO_MIN - RTP_PRIO_MAX; + rtp.prio = p < RTP_PRIO_MIN ? RTP_PRIO_MIN : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", pwd ? pwd->pw_name : "-", From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 13:45:02 2014 Return-Path: Delivered-To: svn-src-all@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 E875E382; Sat, 1 Nov 2014 13:45: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 B97DF91A; Sat, 1 Nov 2014 13:45: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 sA1Dj2b4035611; Sat, 1 Nov 2014 13:45:02 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1Dj2DL035610; Sat, 1 Nov 2014 13:45:02 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411011345.sA1Dj2DL035610@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 1 Nov 2014 13:45:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r273931 - in stable: 10/lib/libutil 7/lib/libutil 8/lib/libutil 9/lib/libutil X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 13:45:03 -0000 Author: dim Date: Sat Nov 1 13:45:01 2014 New Revision: 273931 URL: https://svnweb.freebsd.org/changeset/base/273931 Log: MFC r273837: Fix a clang 3.5 warning about abs(3) being given an argument of type quad_t in setusercontext(). While here, sanitize the clamping of the priority value, and use the correct type for the return value of login_getcapnum(). Reviewed by: kib Modified: stable/9/lib/libutil/login_class.c Directory Properties: stable/9/lib/libutil/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/libutil/login_class.c stable/7/lib/libutil/login_class.c stable/8/lib/libutil/login_class.c Directory Properties: stable/10/ (props changed) stable/7/lib/libutil/ (props changed) stable/8/lib/libutil/ (props changed) Modified: stable/9/lib/libutil/login_class.c ============================================================================== --- stable/9/lib/libutil/login_class.c Sat Nov 1 11:19:50 2014 (r273930) +++ stable/9/lib/libutil/login_class.c Sat Nov 1 13:45:01 2014 (r273931) @@ -423,7 +423,7 @@ setlogincontext(login_cap_t *lc, const s int setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned int flags) { - quad_t p; + rlim_t p; mode_t mymask; login_cap_t *llc = NULL; struct sigaction sa, prevsa; @@ -448,16 +448,16 @@ setusercontext(login_cap_t *lc, const st if (p > PRIO_MAX) { rtp.type = RTP_PRIO_IDLE; - rtp.prio = p - PRIO_MAX - 1; - p = (rtp.prio > RTP_PRIO_MAX) ? 31 : p; + p -= PRIO_MAX + 1; + rtp.prio = p > RTP_PRIO_MAX ? RTP_PRIO_MAX : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", pwd ? pwd->pw_name : "-", lc ? lc->lc_class : LOGIN_DEFCLASS); } else if (p < PRIO_MIN) { rtp.type = RTP_PRIO_REALTIME; - rtp.prio = abs(p - PRIO_MIN + RTP_PRIO_MAX); - p = (rtp.prio > RTP_PRIO_MAX) ? 1 : p; + p -= PRIO_MIN - RTP_PRIO_MAX; + rtp.prio = p < RTP_PRIO_MIN ? RTP_PRIO_MIN : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", pwd ? pwd->pw_name : "-", From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 13:45:04 2014 Return-Path: Delivered-To: svn-src-all@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 2A0DA384; Sat, 1 Nov 2014 13:45: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 EF5A491C; Sat, 1 Nov 2014 13:45: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 sA1Dj377035633; Sat, 1 Nov 2014 13:45:03 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1Dj3s3035632; Sat, 1 Nov 2014 13:45:03 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411011345.sA1Dj3s3035632@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 1 Nov 2014 13:45:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273931 - in stable: 10/lib/libutil 7/lib/libutil 8/lib/libutil 9/lib/libutil X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 13:45:04 -0000 Author: dim Date: Sat Nov 1 13:45:01 2014 New Revision: 273931 URL: https://svnweb.freebsd.org/changeset/base/273931 Log: MFC r273837: Fix a clang 3.5 warning about abs(3) being given an argument of type quad_t in setusercontext(). While here, sanitize the clamping of the priority value, and use the correct type for the return value of login_getcapnum(). Reviewed by: kib Modified: stable/10/lib/libutil/login_class.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/7/lib/libutil/login_class.c stable/8/lib/libutil/login_class.c stable/9/lib/libutil/login_class.c Directory Properties: stable/7/lib/libutil/ (props changed) stable/8/lib/libutil/ (props changed) stable/9/lib/libutil/ (props changed) Modified: stable/10/lib/libutil/login_class.c ============================================================================== --- stable/10/lib/libutil/login_class.c Sat Nov 1 11:19:50 2014 (r273930) +++ stable/10/lib/libutil/login_class.c Sat Nov 1 13:45:01 2014 (r273931) @@ -423,7 +423,7 @@ setlogincontext(login_cap_t *lc, const s int setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned int flags) { - quad_t p; + rlim_t p; mode_t mymask; login_cap_t *llc = NULL; struct sigaction sa, prevsa; @@ -448,16 +448,16 @@ setusercontext(login_cap_t *lc, const st if (p > PRIO_MAX) { rtp.type = RTP_PRIO_IDLE; - rtp.prio = p - PRIO_MAX - 1; - p = (rtp.prio > RTP_PRIO_MAX) ? 31 : p; + p -= PRIO_MAX + 1; + rtp.prio = p > RTP_PRIO_MAX ? RTP_PRIO_MAX : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", pwd ? pwd->pw_name : "-", lc ? lc->lc_class : LOGIN_DEFCLASS); } else if (p < PRIO_MIN) { rtp.type = RTP_PRIO_REALTIME; - rtp.prio = abs(p - PRIO_MIN + RTP_PRIO_MAX); - p = (rtp.prio > RTP_PRIO_MAX) ? 1 : p; + p -= PRIO_MIN - RTP_PRIO_MAX; + rtp.prio = p < RTP_PRIO_MIN ? RTP_PRIO_MIN : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", pwd ? pwd->pw_name : "-", From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 13:45:04 2014 Return-Path: Delivered-To: svn-src-all@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 CA63C457; Sat, 1 Nov 2014 13:45: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 86B4D91D; Sat, 1 Nov 2014 13:45: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 sA1Dj4pw035642; Sat, 1 Nov 2014 13:45:04 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1Dj4tl035641; Sat, 1 Nov 2014 13:45:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411011345.sA1Dj4tl035641@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 1 Nov 2014 13:45:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r273931 - in stable: 10/lib/libutil 7/lib/libutil 8/lib/libutil 9/lib/libutil X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 13:45:04 -0000 Author: dim Date: Sat Nov 1 13:45:01 2014 New Revision: 273931 URL: https://svnweb.freebsd.org/changeset/base/273931 Log: MFC r273837: Fix a clang 3.5 warning about abs(3) being given an argument of type quad_t in setusercontext(). While here, sanitize the clamping of the priority value, and use the correct type for the return value of login_getcapnum(). Reviewed by: kib Modified: stable/7/lib/libutil/login_class.c Directory Properties: stable/7/lib/libutil/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/libutil/login_class.c stable/8/lib/libutil/login_class.c stable/9/lib/libutil/login_class.c Directory Properties: stable/10/ (props changed) stable/8/lib/libutil/ (props changed) stable/9/lib/libutil/ (props changed) Modified: stable/7/lib/libutil/login_class.c ============================================================================== --- stable/7/lib/libutil/login_class.c Sat Nov 1 11:19:50 2014 (r273930) +++ stable/7/lib/libutil/login_class.c Sat Nov 1 13:45:01 2014 (r273931) @@ -420,7 +420,7 @@ setlogincontext(login_cap_t *lc, const s int setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned int flags) { - quad_t p; + rlim_t p; mode_t mymask; login_cap_t *llc = NULL; struct rtprio rtp; @@ -444,16 +444,16 @@ setusercontext(login_cap_t *lc, const st if (p > PRIO_MAX) { rtp.type = RTP_PRIO_IDLE; - rtp.prio = p - PRIO_MAX - 1; - p = (rtp.prio > RTP_PRIO_MAX) ? 31 : p; + p -= PRIO_MAX + 1; + rtp.prio = p > RTP_PRIO_MAX ? RTP_PRIO_MAX : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", pwd ? pwd->pw_name : "-", lc ? lc->lc_class : LOGIN_DEFCLASS); } else if (p < PRIO_MIN) { rtp.type = RTP_PRIO_REALTIME; - rtp.prio = abs(p - PRIO_MIN + RTP_PRIO_MAX); - p = (rtp.prio > RTP_PRIO_MAX) ? 1 : p; + p -= PRIO_MIN - RTP_PRIO_MAX; + rtp.prio = p < RTP_PRIO_MIN ? RTP_PRIO_MIN : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", pwd ? pwd->pw_name : "-", From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 15:55:18 2014 Return-Path: Delivered-To: svn-src-all@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 DDC8C183; Sat, 1 Nov 2014 15:55:18 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0: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 A4F7D64A; Sat, 1 Nov 2014 15:55:18 +0000 (UTC) Received: from [2001:470:9174:1:99:daa4:a52e:9610] by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.84 (FreeBSD)) (envelope-from ) id 1Xkb1I-000FL1-Pl; Sat, 01 Nov 2014 15:55:17 +0000 Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: text/plain; charset=windows-1252 From: Mark R V Murray In-Reply-To: <9D38CD22-6BFC-4D55-8E8F-622EC2997723@gmail.com> Date: Sat, 1 Nov 2014 15:55:15 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <931AE051-9ED8-46FB-B6D2-5FD5BD78FE8F@FreeBSD.org> References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <9D38CD22-6BFC-4D55-8E8F-622EC2997723@gmail.com> To: Garrett Cooper X-Mailer: Apple Mail (2.1990.1) X-SA-Score: -1.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 15:55:19 -0000 Hi Garrett, > On 31 Oct 2014, at 21:04, Garrett Cooper = wrote: > Could you please add an UPDATING entry for this? Some users (like me) = who do make installworld from old kernels are experiencing issues (some = dealing with filesystem corruption). Please see this thread on -current@ = for more details: = https://lists.freebsd.org/pipermail/freebsd-current/2014-October/053039.ht= ml Will do. Thanks for the reminder. > This also should have had =93Relnotes: yes=94 in the commit message = because this deserves to be put in the release notes for 11.0 Oops. :-( M --=20 Mark R V Murray From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 16:24:34 2014 Return-Path: Delivered-To: svn-src-all@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 CE160A5B for ; Sat, 1 Nov 2014 16:24:34 +0000 (UTC) Received: from vfemail.net (nine.vfemail.net [108.76.175.9]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D9A292F for ; Sat, 1 Nov 2014 16:24:33 +0000 (UTC) Received: (qmail 3041 invoked by uid 89); 1 Nov 2014 16:05:42 -0000 Received: from localhost (HELO freequeue.vfemail.net) (127.0.0.1) by localhost with (DHE-RSA-AES256-SHA encrypted) SMTP; 1 Nov 2014 16:05:38 -0000 Received: (qmail 85633 invoked by uid 89); 31 Oct 2014 15:19:19 -0000 Received: by simscan 1.3.1 ppid: 85625, pid: 85629, t: 0.1028s scanners:none Received: from unknown (HELO smtp102-2.vfemail.net) (172.16.100.62) by FreeQueue with SMTP; 31 Oct 2014 15:19:19 -0000 Received: (qmail 30168 invoked by uid 89); 31 Oct 2014 15:19:19 -0000 Received: by simscan 1.4.0 ppid: 30127, pid: 30164, t: 0.6638s scanners:none Received: from unknown (HELO nil) (amJlaWNoQHZmZW1haWwubmV0@172.16.100.27) by 172.16.100.62 with ESMTPA; 31 Oct 2014 15:19:18 -0000 From: Jan Beich To: Julian Elischer Subject: Re: svn commit: r273762 - head/sys/modules/dtrace/dtraceall References: <201410280418.s9S4I9qh094390@svn.freebsd.org> Date: Fri, 31 Oct 2014 16:19:13 +0100 In-Reply-To: <201410280418.s9S4I9qh094390@svn.freebsd.org> (Julian Elischer's message of "Tue, 28 Oct 2014 04:18:09 +0000 (UTC)") Message-ID: MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 16:24:34 -0000 Julian Elischer writes: > Log: > Allow loading of dtraceall without nfscl if what you really wnat is nfsclient ... or if what you really want is neither, no NFS by default. > > Obtained from: Panzura tree > MFC after: 1 week > > Modified: > head/sys/modules/dtrace/dtraceall/dtraceall.c > > Modified: head/sys/modules/dtrace/dtraceall/dtraceall.c > ============================================================================== > --- head/sys/modules/dtrace/dtraceall/dtraceall.c Tue Oct 28 03:42:09 2014 (r273761) > +++ head/sys/modules/dtrace/dtraceall/dtraceall.c Tue Oct 28 04:18:09 2014 (r273762) > @@ -67,7 +67,9 @@ MODULE_DEPEND(dtraceall, cyclic, 1, 1, 1 > MODULE_DEPEND(dtraceall, opensolaris, 1, 1, 1); > MODULE_DEPEND(dtraceall, dtrace, 1, 1, 1); > MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, 1); > +#if defined(NFSCLIENT) Did you mean #if defined(NFSCL) ? Otherwise, dtraceall.ko with GENERIC kernel wouldn't pull dtnfscl.ko despite nfscl.ko being compiled in. > MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1); > +#endif > #if defined(NFSCLIENT) > MODULE_DEPEND(dtraceall, dtnfsclient, 1, 1, 1); > #endif ------------------------------------------------- VFEmail.net - http://www.vfemail.net ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands! $24.95 ONETIME Lifetime accounts with Privacy Features! 15GB disk! No bandwidth quotas! Commercial and Bulk Mail Options! From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 17:05:17 2014 Return-Path: Delivered-To: svn-src-all@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 791ECF59; Sat, 1 Nov 2014 17:05: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 647E3C9B; Sat, 1 Nov 2014 17:05: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 sA1H5HVR030104; Sat, 1 Nov 2014 17:05:17 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1H5GrM030099; Sat, 1 Nov 2014 17:05:16 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201411011705.sA1H5GrM030099@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Sat, 1 Nov 2014 17:05:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273932 - in head/sys: dev/vt 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 17:05:17 -0000 Author: dumbbell Date: Sat Nov 1 17:05:15 2014 New Revision: 273932 URL: https://svnweb.freebsd.org/changeset/base/273932 Log: vt(4): Adjust the cursor position after changing the window size A new terminal_set_cursor() is added: it wraps the existing teken_set_cursor() function. In vtbuf_grow(), the cursor position is adjusted at the end of the function. In vt_change_font(), we call terminal_set_cursor() just after terminal_set_winsize_blank(), while the terminal is mute. This fixes a bug where, after loading a kernel video driver which increases the terminal window size, the cursor remains at its old position, in other words, in the middle of the display content. PR: 194421 MFC after: 1 week Modified: head/sys/dev/vt/vt_buf.c head/sys/dev/vt/vt_core.c head/sys/kern/subr_terminal.c head/sys/sys/terminal.h Modified: head/sys/dev/vt/vt_buf.c ============================================================================== --- head/sys/dev/vt/vt_buf.c Sat Nov 1 13:45:01 2014 (r273931) +++ head/sys/dev/vt/vt_buf.c Sat Nov 1 17:05:15 2014 (r273932) @@ -562,6 +562,18 @@ vtbuf_grow(struct vt_buf *vb, const term vb->vb_roffset = vb->vb_curroffset; } + /* Adjust cursor position. */ + if (vb->vb_cursor.tp_col > p->tp_col - 1) + /* + * Move cursor to the last column, in case its previous + * position is outside of the new screen area. + */ + vb->vb_cursor.tp_col = p->tp_col - 1; + + if (vb->vb_curroffset > 0 || vb->vb_cursor.tp_row > p->tp_row - 1) + /* Move cursor to the last line on the screen. */ + vb->vb_cursor.tp_row = p->tp_row - 1; + vtbuf_make_undirty(vb); VTBUF_UNLOCK(vb); Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Sat Nov 1 13:45:01 2014 (r273931) +++ head/sys/dev/vt/vt_core.c Sat Nov 1 17:05:15 2014 (r273932) @@ -1532,6 +1532,7 @@ vt_change_font(struct vt_window *vw, str terminal_mute(tm, 1); vtbuf_grow(&vw->vw_buf, &size, vw->vw_buf.vb_history_size); terminal_set_winsize_blank(tm, &wsz, 0, NULL); + terminal_set_cursor(tm, &vw->vw_buf.vb_cursor); terminal_mute(tm, 0); /* Actually apply the font to the current window. */ Modified: head/sys/kern/subr_terminal.c ============================================================================== --- head/sys/kern/subr_terminal.c Sat Nov 1 13:45:01 2014 (r273931) +++ head/sys/kern/subr_terminal.c Sat Nov 1 17:05:15 2014 (r273932) @@ -190,6 +190,13 @@ terminal_maketty(struct terminal *tm, co } void +terminal_set_cursor(struct terminal *tm, const term_pos_t *pos) +{ + + teken_set_cursor(&tm->tm_emulator, pos); +} + +void terminal_set_winsize_blank(struct terminal *tm, const struct winsize *size, int blank, const term_attr_t *attr) { Modified: head/sys/sys/terminal.h ============================================================================== --- head/sys/sys/terminal.h Sat Nov 1 13:45:01 2014 (r273931) +++ head/sys/sys/terminal.h Sat Nov 1 17:05:15 2014 (r273932) @@ -207,6 +207,7 @@ struct terminal { struct terminal *terminal_alloc(const struct terminal_class *tc, void *softc); void terminal_maketty(struct terminal *tm, const char *fmt, ...); +void terminal_set_cursor(struct terminal *tm, const term_pos_t *pos); void terminal_set_winsize_blank(struct terminal *tm, const struct winsize *size, int blank, const term_attr_t *attr); void terminal_set_winsize(struct terminal *tm, const struct winsize *size); From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 17:09:40 2014 Return-Path: Delivered-To: svn-src-all@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 392261BC; Sat, 1 Nov 2014 17: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 25431CD2; Sat, 1 Nov 2014 17: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 sA1H9eMR030766; Sat, 1 Nov 2014 17:09:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1H9eHd030765; Sat, 1 Nov 2014 17:09:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411011709.sA1H9eHd030765@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 1 Nov 2014 17:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273933 - head/contrib/netbsd-tests/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 17:09:40 -0000 Author: ngie Date: Sat Nov 1 17:09:39 2014 New Revision: 273933 URL: https://svnweb.freebsd.org/changeset/base/273933 Log: Don't prune duplicate services in the expected output from /etc/services on FreeBSD Submitted by: pho Modified: head/contrib/netbsd-tests/lib/libc/net/t_servent.sh Modified: head/contrib/netbsd-tests/lib/libc/net/t_servent.sh ============================================================================== --- head/contrib/netbsd-tests/lib/libc/net/t_servent.sh Sat Nov 1 17:05:15 2014 (r273932) +++ head/contrib/netbsd-tests/lib/libc/net/t_servent.sh Sat Nov 1 17:09:39 2014 (r273933) @@ -81,6 +81,24 @@ servent_body() } ' | sort >exp + case "$(uname)" in + FreeBSD) + # (3) Don't prune duplicates + tr '\t' ' ' < /etc/services | + sed 's/#.*//;s/ */ /g; /^$/d;s#\([0-9]\)/#\1 #;s/ *$//' | + sort | + while read l; do + set $l + name=$1; shift + port=$1; shift + proto=$1; shift + alias="$@" + printf "name=%s, port=%s, proto=%s, aliases=%s\n" \ + $name $port $proto "$alias" + done > exp + ;; + esac + # run test program "$(atf_get_srcdir)/h_servent" | sed 's/ *$//' | sort >out From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 17:12:47 2014 Return-Path: Delivered-To: svn-src-all@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 1F90936B; Sat, 1 Nov 2014 17:12: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 09F85D7B; Sat, 1 Nov 2014 17:12: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 sA1HClXA034632; Sat, 1 Nov 2014 17:12:47 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1HCjEt034620; Sat, 1 Nov 2014 17:12:45 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201411011712.sA1HCjEt034620@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 1 Nov 2014 17:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273934 - in head/sys/boot: arm/uboot fdt powerpc/uboot uboot uboot/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 17:12:47 -0000 Author: andrew Date: Sat Nov 1 17:12:44 2014 New Revision: 273934 URL: https://svnweb.freebsd.org/changeset/base/273934 Log: Start to allow platforms other than U-Boot to use the FDT code in loader by moving U-Boot specific code from libfdt.a to a new libuboot_fdt.a. This needs to be a new library for linking to work correctly. Differential Revision: https://reviews.freebsd.org/D1054 Reviewed by: ian, rpaulo (earlier version) MFC after: 1 week Added: head/sys/boot/uboot/fdt/ head/sys/boot/uboot/fdt/Makefile (contents, props changed) head/sys/boot/uboot/fdt/uboot_fdt.c (contents, props changed) Modified: head/sys/boot/arm/uboot/Makefile head/sys/boot/fdt/Makefile head/sys/boot/fdt/fdt_loader_cmd.c head/sys/boot/fdt/fdt_platform.h head/sys/boot/powerpc/uboot/Makefile head/sys/boot/uboot/Makefile Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Sat Nov 1 17:09:39 2014 (r273933) +++ head/sys/boot/arm/uboot/Makefile Sat Nov 1 17:12:44 2014 (r273934) @@ -72,6 +72,7 @@ CFLAGS+= -DLOADER_TFTP_SUPPORT CFLAGS+= -I${.CURDIR}/../../fdt CFLAGS+= -I${.OBJDIR}/../../fdt CFLAGS+= -DLOADER_FDT_SUPPORT +LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt/libuboot_fdt.a LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif @@ -112,8 +113,8 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li # clang doesn't understand %D as a specifier to printf NO_WERROR.clang= -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} -lstand +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} -lstand vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} Modified: head/sys/boot/fdt/Makefile ============================================================================== --- head/sys/boot/fdt/Makefile Sat Nov 1 17:09:39 2014 (r273933) +++ head/sys/boot/fdt/Makefile Sat Nov 1 17:12:44 2014 (r273934) @@ -11,8 +11,7 @@ SRCS+= fdt.c fdt_ro.c fdt_wip.c fdt_sw. # Loader's fdt commands extension sources. SRCS+= fdt_loader_cmd.c -CFLAGS+= -I${.CURDIR}/../../contrib/libfdt/ -I${.CURDIR}/../common/ \ - -I${.CURDIR}/../uboot/lib +CFLAGS+= -I${.CURDIR}/../../contrib/libfdt/ -I${.CURDIR}/../common/ CFLAGS+= -ffreestanding Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Sat Nov 1 17:09:39 2014 (r273933) +++ head/sys/boot/fdt/fdt_loader_cmd.c Sat Nov 1 17:12:44 2014 (r273934) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "fdt_platform.h" -#include "glue.h" #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); \ @@ -53,9 +52,6 @@ __FBSDID("$FreeBSD$"); #define FDT_PROP_SEP " = " -#define STR(number) #number -#define STRINGIFY(number) STR(number) - #define COPYOUT(s,d,l) archsw.arch_copyout(s, d, l) #define COPYIN(s,d,l) archsw.arch_copyin(s, d, l) @@ -229,7 +225,7 @@ fdt_load_dtb(vm_offset_t va) return (0); } -static int +int fdt_load_dtb_addr(struct fdt_header *header) { int err; @@ -254,7 +250,7 @@ fdt_load_dtb_addr(struct fdt_header *hea return (0); } -static int +int fdt_load_dtb_file(const char * filename) { struct preloaded_file *bfp, *oldbfp; @@ -284,9 +280,6 @@ int fdt_setup_fdtp() { struct preloaded_file *bfp; - struct fdt_header *hdr; - const char *s; - char *p; vm_offset_t va; debugf("fdt_setup_fdtp()\n"); @@ -309,41 +302,8 @@ fdt_setup_fdtp() } } - /* - * If the U-boot environment contains a variable giving the address of a - * valid blob in memory, use it. The U-boot README says the right - * variable for fdt data loaded into ram is fdt_addr_r, so try that - * first. Board vendors also use both fdtaddr and fdt_addr names. - */ - s = ub_env_get("fdt_addr_r"); - if (s == NULL) - s = ub_env_get("fdtaddr"); - if (s == NULL) - s = ub_env_get("fdt_addr"); - if (s != NULL && *s != '\0') { - hdr = (struct fdt_header *)strtoul(s, &p, 16); - if (*p == '\0') { - if (fdt_load_dtb_addr(hdr) == 0) { - printf("Using DTB provided by U-Boot at " - "address %p.\n", hdr); - return (0); - } - } - } - - /* - * If the U-boot environment contains a variable giving the name of a - * file, use it if we can load and validate it. - */ - s = ub_env_get("fdtfile"); - if (s == NULL) - s = ub_env_get("fdt_file"); - if (s != NULL && *s != '\0') { - if (fdt_load_dtb_file(s) == 0) { - printf("Loaded DTB from file '%s'.\n", s); - return (0); - } - } + if (fdt_platform_load_dtb() == 0) + return (0); /* If there is a dtb compiled into the kernel, use it. */ if ((va = fdt_find_static_dtb()) != 0) { @@ -407,48 +367,20 @@ _fdt_strtovect(const char *str, void *ce return (cnt); } -#define TMP_MAX_ETH 8 - -static void -fixup_ethernet(const char *env, char *ethstr, int *eth_no, int len) +void +fdt_fixup_ethernet(const char *str, char *ethstr, int len) { - const char *str; - char *end; uint8_t tmp_addr[6]; - int i, n; - - /* Extract interface number */ - i = strtol(env + 3, &end, 10); - if (end == (env + 3)) - /* 'ethaddr' means interface 0 address */ - n = 0; - else - n = i; - - if (n > TMP_MAX_ETH) - return; - - str = ub_env_get(env); /* Convert macaddr string into a vector of uints */ fdt_strtovectx(str, &tmp_addr, 6, sizeof(uint8_t)); - if (n != 0) { - i = strlen(env) - 7; - strncpy(ethstr + 8, env + 3, i); - } /* Set actual property to a value from vect */ fdt_setprop(fdtp, fdt_path_offset(fdtp, ethstr), "local-mac-address", &tmp_addr, 6 * sizeof(uint8_t)); - - /* Clear ethernet..XXXX.. string */ - bzero(ethstr + 8, len - 8); - - if (n + 1 > *eth_no) - *eth_no = n + 1; } -static void -fixup_cpubusfreqs(unsigned long cpufreq, unsigned long busfreq) +void +fdt_fixup_cpubusfreqs(unsigned long cpufreq, unsigned long busfreq) { int lo, o = 0, o2, maxo = 0, depth; const uint32_t zero = 0; @@ -527,13 +459,14 @@ fdt_reg_valid(uint32_t *reg, int len, in return (0); } -static void -fixup_memory(struct sys_info *si) +void +fdt_fixup_memory(struct fdt_mem_region *region, size_t num) { - struct mem_region *curmr; + struct fdt_mem_region *curmr; uint32_t addr_cells, size_cells; uint32_t *addr_cellsp, *reg, *size_cellsp; - int err, i, len, memory, realmrno, root; + int err, i, len, memory, root; + size_t realmrno; uint8_t *buf, *sb; uint64_t rstart, rsize; int reserved; @@ -591,7 +524,6 @@ fixup_memory(struct sys_info *si) bzero(buf, len); for (i = 0; i < reserved; i++) { - curmr = &si->mr[i]; if (fdt_get_mem_rsv(fdtp, i, &rstart, &rsize)) break; if (rsize) { @@ -623,9 +555,9 @@ fixup_memory(struct sys_info *si) } /* Count valid memory regions entries in sysinfo. */ - realmrno = si->mr_no; - for (i = 0; i < si->mr_no; i++) - if (si->mr[i].start == 0 && si->mr[i].size == 0) + realmrno = num; + for (i = 0; i < num; i++) + if (region[i].start == 0 && region[i].size == 0) realmrno--; if (realmrno == 0) { @@ -652,8 +584,8 @@ fixup_memory(struct sys_info *si) bzero(buf, len); - for (i = 0; i < si->mr_no; i++) { - curmr = &si->mr[i]; + for (i = 0; i < num; i++) { + curmr = ®ion[i]; if (curmr->size != 0) { /* Ensure endianess, and put cells into a buffer */ if (addr_cells == 2) @@ -682,17 +614,15 @@ fixup_memory(struct sys_info *si) free(sb); } -static void -fixup_stdout(const char *env) +void +fdt_fixup_stdout(const char *str) { - const char *str; char *ptr; int serialno; int len, no, sero; const struct fdt_property *prop; char *tmp[10]; - str = ub_env_get(env); ptr = (char *)str + strlen(str) - 1; while (ptr > str && isdigit(*(str - 1))) str--; @@ -738,14 +668,8 @@ fixup_stdout(const char *env) static int fdt_fixup(void) { - const char *env; - char *ethstr; - int chosen, eth_no, len; - struct sys_info *si; - - env = NULL; - eth_no = 0; - ethstr = NULL; + int chosen, len; + len = 0; debugf("fdt_fixup()\n"); @@ -762,45 +686,7 @@ fdt_fixup(void) if (fdt_getprop(fdtp, chosen, "fixup-applied", NULL)) return (1); - /* Acquire sys_info */ - si = ub_get_sys_info(); - - while ((env = ub_env_enum(env)) != NULL) { - if (strncmp(env, "eth", 3) == 0 && - strncmp(env + (strlen(env) - 4), "addr", 4) == 0) { - /* - * Handle Ethernet addrs: parse uboot env eth%daddr - */ - - if (!eth_no) { - /* - * Check how many chars we will need to store - * maximal eth iface number. - */ - len = strlen(STRINGIFY(TMP_MAX_ETH)) + - strlen("ethernet"); - - /* - * Reserve mem for string "ethernet" and len - * chars for iface no. - */ - ethstr = (char *)malloc(len * sizeof(char)); - bzero(ethstr, len * sizeof(char)); - strcpy(ethstr, "ethernet0"); - } - - /* Modify blob */ - fixup_ethernet(env, ethstr, ð_no, len); - - } else if (strcmp(env, "consoledev") == 0) - fixup_stdout(env); - } - - /* Modify cpu(s) and bus clock frequenties in /cpus node [Hz] */ - fixup_cpubusfreqs(si->clk_cpu, si->clk_bus); - - /* Fixup memory regions */ - fixup_memory(si); + fdt_platform_fixups(); fdt_setprop(fdtp, chosen, "fixup-applied", NULL, 0); return (1); Modified: head/sys/boot/fdt/fdt_platform.h ============================================================================== --- head/sys/boot/fdt/fdt_platform.h Sat Nov 1 17:09:39 2014 (r273933) +++ head/sys/boot/fdt/fdt_platform.h Sat Nov 1 17:12:44 2014 (r273934) @@ -29,7 +29,26 @@ #ifndef FDT_PLATFORM_H #define FDT_PLATFORM_H -extern int fdt_copy(vm_offset_t); -extern int fdt_setup_fdtp(void); +struct fdt_header; + +struct fdt_mem_region { + unsigned long start; + unsigned long size; +}; + +#define TMP_MAX_ETH 8 + +int fdt_copy(vm_offset_t); +void fdt_fixup_cpubusfreqs(unsigned long, unsigned long); +void fdt_fixup_ethernet(const char *, char *, int); +void fdt_fixup_memory(struct fdt_mem_region *, size_t); +void fdt_fixup_stdout(const char *); +int fdt_load_dtb_addr(struct fdt_header *); +int fdt_load_dtb_file(const char *); +int fdt_setup_fdtp(void); + +/* The platform library needs to implement these functions */ +int fdt_platform_load_dtb(void); +void fdt_platform_fixups(void); #endif /* FDT_PLATFORM_H */ Modified: head/sys/boot/powerpc/uboot/Makefile ============================================================================== --- head/sys/boot/powerpc/uboot/Makefile Sat Nov 1 17:09:39 2014 (r273933) +++ head/sys/boot/powerpc/uboot/Makefile Sat Nov 1 17:12:44 2014 (r273934) @@ -62,6 +62,7 @@ CFLAGS+= -DLOADER_TFTP_SUPPORT CFLAGS+= -I${.CURDIR}/../../fdt CFLAGS+= -I${.OBJDIR}/../../fdt CFLAGS+= -DLOADER_FDT_SUPPORT +LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt/libuboot_fdt.a LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif @@ -98,8 +99,8 @@ CFLAGS+= -I${.OBJDIR}/../../uboot/lib LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} Modified: head/sys/boot/uboot/Makefile ============================================================================== --- head/sys/boot/uboot/Makefile Sat Nov 1 17:09:39 2014 (r273933) +++ head/sys/boot/uboot/Makefile Sat Nov 1 17:12:44 2014 (r273934) @@ -1,5 +1,11 @@ # $FreeBSD$ +.include + SUBDIR= lib +.if ${MK_FDT} != "no" +SUBDIR+=fdt +.endif + .include Added: head/sys/boot/uboot/fdt/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/uboot/fdt/Makefile Sat Nov 1 17:12:44 2014 (r273934) @@ -0,0 +1,33 @@ +# $FreeBSD$ + +.include + +.PATH: ${.CURDIR}/../../common + +LIB= uboot_fdt +INTERNALLIB= +WARNS?= 2 + +SRCS= uboot_fdt.c + +CFLAGS+= -ffreestanding -msoft-float + +CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ + +# U-Boot library headers +CFLAGS+= -I${.CURDIR}/../lib + +# libfdt headers +CFLAGS+= -I${.CURDIR}/../../fdt + +# Pick up the bootstrap header for some interface items +CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. + +machine: + ln -sf ${.CURDIR}/../../../${MACHINE_CPUARCH}/include machine + +CLEANFILES+= machine + +.include + +beforedepend ${OBJS}: machine Added: head/sys/boot/uboot/fdt/uboot_fdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/uboot/fdt/uboot_fdt.c Sat Nov 1 17:12:44 2014 (r273934) @@ -0,0 +1,181 @@ +/*- + * Copyright (c) 2009-2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include "glue.h" + +#define STR(number) #number +#define STRINGIFY(number) STR(number) + +int +fdt_platform_load_dtb(void) +{ + struct fdt_header *hdr; + const char *s; + char *p; + + /* + * If the U-boot environment contains a variable giving the address of a + * valid blob in memory, use it. The U-boot README says the right + * variable for fdt data loaded into ram is fdt_addr_r, so try that + * first. Board vendors also use both fdtaddr and fdt_addr names. + */ + s = ub_env_get("fdt_addr_r"); + if (s == NULL) + s = ub_env_get("fdtaddr"); + if (s == NULL) + s = ub_env_get("fdt_addr"); + if (s != NULL && *s != '\0') { + hdr = (struct fdt_header *)strtoul(s, &p, 16); + if (*p == '\0') { + if (fdt_load_dtb_addr(hdr) == 0) { + printf("Using DTB provided by U-Boot at " + "address %p.\n", hdr); + return (0); + } + } + } + + /* + * If the U-boot environment contains a variable giving the name of a + * file, use it if we can load and validate it. + */ + s = ub_env_get("fdtfile"); + if (s == NULL) + s = ub_env_get("fdt_file"); + if (s != NULL && *s != '\0') { + if (fdt_load_dtb_file(s) == 0) { + printf("Loaded DTB from file '%s'.\n", s); + return (0); + } + } + + return (1); +} + +void +fdt_platform_fixups(void) +{ + struct fdt_mem_region regions[3]; + const char *env, *str; + char *end, *ethstr; + int eth_no, i, len, n; + struct sys_info *si; + + env = NULL; + eth_no = 0; + ethstr = NULL; + + /* Acquire sys_info */ + si = ub_get_sys_info(); + + while ((env = ub_env_enum(env)) != NULL) { + if (strncmp(env, "eth", 3) == 0 && + strncmp(env + (strlen(env) - 4), "addr", 4) == 0) { + /* + * Handle Ethernet addrs: parse uboot env eth%daddr + */ + + if (!eth_no) { + /* + * Check how many chars we will need to store + * maximal eth iface number. + */ + len = strlen(STRINGIFY(TMP_MAX_ETH)) + + strlen("ethernet") + 1; + + /* + * Reserve mem for string "ethernet" and len + * chars for iface no. + */ + ethstr = (char *)malloc(len * sizeof(char)); + bzero(ethstr, len * sizeof(char)); + strcpy(ethstr, "ethernet0"); + } + + /* Extract interface number */ + i = strtol(env + 3, &end, 10); + if (end == (env + 3)) + /* 'ethaddr' means interface 0 address */ + n = 0; + else + n = i; + + if (n > TMP_MAX_ETH) + continue; + + str = ub_env_get(env); + + if (n != 0) { + /* + * Find the lenght of the interface id by + * taking in to account the first 3 and + * last 4 characters. + */ + i = strlen(env) - 7; + strncpy(ethstr + 8, env + 3, i); + } + + /* Modify blob */ + fdt_fixup_ethernet(str, ethstr, len); + + /* Clear ethernet..XXXX.. string */ + bzero(ethstr + 8, len - 8); + + if (n + 1 > eth_no) + eth_no = n + 1; + } else if (strcmp(env, "consoledev") == 0) { + str = ub_env_get(env); + fdt_fixup_stdout(str); + } + } + + /* Modify cpu(s) and bus clock frequenties in /cpus node [Hz] */ + fdt_fixup_cpubusfreqs(si->clk_cpu, si->clk_bus); + + /* Copy the data into a useful form */ + for (i = 0; i < si->mr_no; i++) { + if (i > nitems(regions)) { + i = nitems(regions); + break; + } + + regions[i].start = si->mr[i].start; + regions[i].size = si->mr[i].size; + } + + /* Fixup memory regions */ + fdt_fixup_memory(regions, i); +} From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 17:13:14 2014 Return-Path: Delivered-To: svn-src-all@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 5838C4B5; Sat, 1 Nov 2014 17:13: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 2B21DD87; Sat, 1 Nov 2014 17:13: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 sA1HDEvP034749; Sat, 1 Nov 2014 17:13:14 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1HDE14034748; Sat, 1 Nov 2014 17:13:14 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411011713.sA1HDE14034748@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 1 Nov 2014 17:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273935 - head/contrib/netbsd-tests/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 17:13:14 -0000 Author: ngie Date: Sat Nov 1 17:13:13 2014 New Revision: 273935 URL: https://svnweb.freebsd.org/changeset/base/273935 Log: Port tests to FreeBSD/Linux Some of the testcases don't work outside of NetBSD, and the behavior of ether_aton_r differs between FreeBSD, Linux, and NetBSD, and the calls to the API need to be massaged for FreeBSD and Linux. Submitted by: pho Modified: head/contrib/netbsd-tests/lib/libc/net/t_ether_aton.c Modified: head/contrib/netbsd-tests/lib/libc/net/t_ether_aton.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/net/t_ether_aton.c Sat Nov 1 17:12:44 2014 (r273934) +++ head/contrib/netbsd-tests/lib/libc/net/t_ether_aton.c Sat Nov 1 17:13:13 2014 (r273935) @@ -46,9 +46,18 @@ __RCSID("$NetBSD: t_ether_aton.c,v 1.1 2 #include #include +#if !defined(__NetBSD__) +#if defined(__linux__) +#include +#endif +#include +#endif + +#if defined(__NetBSD__) #define ETHER_ADDR_LEN 6 int ether_aton_r(u_char *dest, size_t len, const char *str); +#endif static const struct { u_char res[ETHER_ADDR_LEN]; @@ -56,9 +65,11 @@ static const struct { int error; } tests[] = { { { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab }, "01:23:45:67:89:ab", 0 }, +#if defined(__NetBSD__) { { 0x00, 0x01, 0x22, 0x03, 0x14, 0x05 }, "0:1:22-3:14:05", 0 }, { { 0x00, 0x01, 0x22, 0x03, 0x14, 0x05 }, "000122031405", 0 }, { { 0x0a, 0x0B, 0xcc, 0xdD, 0xEE, 0x0f }, "0a0BccdDEE0f", 0 }, +#endif #define ZERO { 0, 0, 0, 0, 0, 0 } { ZERO, "0:1:2-3:04:05:06", ENAMETOOLONG }, { ZERO, "0:1:2-3:04:", ENOBUFS }, @@ -75,22 +86,44 @@ ATF_TC_HEAD(tc_ether_aton, tc) ATF_TC_BODY(tc_ether_aton, tc) { +#if defined(__NetBSD__) u_char dest[ETHER_ADDR_LEN]; +#else + struct ether_addr dest; +#endif size_t t; +#if defined(__NetBSD__) int e, r; +#else + int e; + struct ether_addr *r; +#endif const char *s; for (t = 0; tests[t].str; t++) { s = tests[t].str; if ((e = tests[t].error) == 0) { +#if defined(__NetBSD__) if (ether_aton_r(dest, sizeof(dest), s) != e) atf_tc_fail("failed on `%s'", s); if (memcmp(dest, tests[t].res, sizeof(dest)) != 0) atf_tc_fail("unexpected result on `%s'", s); +#else + if (ether_aton_r(s, &dest) == NULL && e == 0) + atf_tc_fail("failed on `%s'", s); + if (memcmp(&dest, tests[t].res, sizeof(dest)) != 0) + atf_tc_fail("unexpected result on `%s'", s); +#endif } else { +#if defined(__NetBSD__) if ((r = ether_aton_r(dest, sizeof(dest), s)) != e) atf_tc_fail("unexpectedly succeeded on `%s' " "(%d != %d)", s, r, e); +#else + if ((r = ether_aton_r(s, &dest)) != NULL && e != 0) + atf_tc_fail("unexpectedly succeeded on `%s' " + "(%p != %d)", s, r, e); +#endif } } } From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 17:14:30 2014 Return-Path: Delivered-To: svn-src-all@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 42C1060D; Sat, 1 Nov 2014 17:14: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 2EA17D9A; Sat, 1 Nov 2014 17:14: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 sA1HEUKJ034960; Sat, 1 Nov 2014 17:14:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1HEUso034959; Sat, 1 Nov 2014 17:14:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411011714.sA1HEUso034959@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 1 Nov 2014 17:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273936 - head/contrib/netbsd-tests/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 17:14:30 -0000 Author: ngie Date: Sat Nov 1 17:14:29 2014 New Revision: 273936 URL: https://svnweb.freebsd.org/changeset/base/273936 Log: Port lib/libc/net/h_dns_server to FreeBSD Submitted by: pho Modified: head/contrib/netbsd-tests/lib/libc/net/h_dns_server.c Modified: head/contrib/netbsd-tests/lib/libc/net/h_dns_server.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/net/h_dns_server.c Sat Nov 1 17:13:13 2014 (r273935) +++ head/contrib/netbsd-tests/lib/libc/net/h_dns_server.c Sat Nov 1 17:14:29 2014 (r273936) @@ -49,7 +49,13 @@ __RCSID("$NetBSD: h_dns_server.c,v 1.4 2 #include #include +#ifdef __NetBSD__ #include +#endif + +#ifdef __FreeBSD__ +#include +#endif union sockaddr_either { struct sockaddr s; @@ -164,6 +170,106 @@ name2str(const void *v, char *buf, size_ } #endif +#ifdef __FreeBSD__ +/* XXX the daemon2_* functions should be in a library */ + +int __daemon2_detach_pipe[2]; + +static int +daemon2_fork(void) +{ + int r; + int fd; + int i; + + /* + * Set up the pipe, making sure the write end does not + * get allocated one of the file descriptors that will + * be closed in daemon2_detach(). + */ + for (i = 0; i < 3; i++) { + r = pipe(__daemon2_detach_pipe); + if (r < 0) + return -1; + if (__daemon2_detach_pipe[1] <= STDERR_FILENO && + (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { + (void)dup2(fd, __daemon2_detach_pipe[0]); + (void)dup2(fd, __daemon2_detach_pipe[1]); + if (fd > STDERR_FILENO) + (void)close(fd); + continue; + } + break; + } + + r = fork(); + if (r < 0) { + return -1; + } else if (r == 0) { + /* child */ + close(__daemon2_detach_pipe[0]); + return 0; + } + /* Parent */ + + (void) close(__daemon2_detach_pipe[1]); + + for (;;) { + char dummy; + r = read(__daemon2_detach_pipe[0], &dummy, 1); + if (r < 0) { + if (errno == EINTR) + continue; + _exit(1); + } else if (r == 0) { + _exit(1); + } else { /* r > 0 */ + _exit(0); + } + } +} + +static int +daemon2_detach(int nochdir, int noclose) +{ + int r; + int fd; + + if (setsid() == -1) + return -1; + + if (!nochdir) + (void)chdir("/"); + + if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { + (void)dup2(fd, STDIN_FILENO); + (void)dup2(fd, STDOUT_FILENO); + (void)dup2(fd, STDERR_FILENO); + if (fd > STDERR_FILENO) + (void)close(fd); + } + + while (1) { + r = write(__daemon2_detach_pipe[1], "", 1); + if (r < 0) { + if (errno == EINTR) + continue; + /* May get "broken pipe" here if parent is killed */ + return -1; + } else if (r == 0) { + /* Should not happen */ + return -1; + } else { + break; + } + } + + (void) close(__daemon2_detach_pipe[1]); + + return 0; +} +#endif + int main(int argc, char **argv) { int s, r, protocol; union sockaddr_either saddr; @@ -176,6 +282,9 @@ int main(int argc, char **argv) { char buf1[1024], buf2[1024]; #endif +#ifdef __FreeBSD__ + daemon2_fork(); +#endif if (argc < 2 || ((protocol = argv[1][0]) != '4' && protocol != '6')) errx(1, "usage: dns_server 4 | 6"); s = socket(protocol == '4' ? PF_INET : PF_INET6, SOCK_DGRAM, IPPROTO_UDP); @@ -212,11 +321,19 @@ int main(int argc, char **argv) { f = fopen(pidfile_name, "w"); fprintf(f, "%d", getpid()); fclose(f); +#ifdef __FreeBSD__ +#ifdef DEBUG + daemon2_detach(0, 1); +#else + daemon2_detach(0, 0); +#endif +#else #ifdef DEBUG daemon(0, 1); #else daemon(0, 0); #endif +#endif for (;;) { unsigned char buf[512]; From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 17:19:44 2014 Return-Path: Delivered-To: svn-src-all@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 47D627A1; Sat, 1 Nov 2014 17:19: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 341D6DC7; Sat, 1 Nov 2014 17:19: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 sA1HJitW035651; Sat, 1 Nov 2014 17:19:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1HJiua035650; Sat, 1 Nov 2014 17:19:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411011719.sA1HJiua035650@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 1 Nov 2014 17:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273937 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 17:19:44 -0000 Author: ngie Date: Sat Nov 1 17:19:43 2014 New Revision: 273937 URL: https://svnweb.freebsd.org/changeset/base/273937 Log: Port lib/libc/sys/t_dup to FreeBSD/Linux - The requirements differ between FreeBSD/Linux when dealing with oldd/newd being equal (both fail with EINVAL, not EBADF) - Add an EBADF testcase - Fix compilation issues on clang In collaboration with: pho Modified: head/contrib/netbsd-tests/lib/libc/sys/t_dup.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_dup.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_dup.c Sat Nov 1 17:14:29 2014 (r273936) +++ head/contrib/netbsd-tests/lib/libc/sys/t_dup.c Sat Nov 1 17:19:43 2014 (r273937) @@ -45,8 +45,14 @@ __RCSID("$NetBSD: t_dup.c,v 1.8 2012/03/ #include #include +#ifdef __FreeBSD__ +#include +#endif + static char path[] = "dup"; +#ifdef __NetBSD__ static void check_mode(bool, bool, bool); +#endif static void check_mode(bool _dup, bool _dup2, bool _dup3) @@ -207,10 +213,24 @@ ATF_TC_BODY(dup3_err, tc) ATF_REQUIRE(fd >= 0); errno = 0; +#if defined(__FreeBSD__) || defined(__linux__) + /* + * FreeBSD and linux return EINVAL, because... + * + * [EINVAL] The oldd argument is equal to the newd argument. + */ + ATF_REQUIRE(dup3(fd, fd, O_CLOEXEC) == -1); +#else ATF_REQUIRE(dup3(fd, fd, O_CLOEXEC) != -1); +#endif errno = 0; +#if defined(__FreeBSD__) || defined(__linux__) + ATF_REQUIRE_ERRNO(EINVAL, dup3(-1, -1, O_CLOEXEC) == -1); + ATF_REQUIRE_ERRNO(EBADF, dup3(fd, -1, O_CLOEXEC) == -1); +#else ATF_REQUIRE_ERRNO(EBADF, dup3(-1, -1, O_CLOEXEC) == -1); +#endif errno = 0; ATF_REQUIRE_ERRNO(EBADF, dup3(fd, -1, O_CLOEXEC) == -1); From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 17:22:53 2014 Return-Path: Delivered-To: svn-src-all@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 C0EE4909; Sat, 1 Nov 2014 17:22:53 +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 AD1F8E6A; Sat, 1 Nov 2014 17:22: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 sA1HMrHw039523; Sat, 1 Nov 2014 17:22:53 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1HMrOZ039522; Sat, 1 Nov 2014 17:22:53 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411011722.sA1HMrOZ039522@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 1 Nov 2014 17:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273938 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 17:22:53 -0000 Author: ngie Date: Sat Nov 1 17:22:53 2014 New Revision: 273938 URL: https://svnweb.freebsd.org/changeset/base/273938 Log: getitimer on FreeBSD returns the last set time instead of the remaining time; test for that instead Submitted by: pho Modified: head/contrib/netbsd-tests/lib/libc/sys/t_getitimer.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_getitimer.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_getitimer.c Sat Nov 1 17:19:43 2014 (r273937) +++ head/contrib/netbsd-tests/lib/libc/sys/t_getitimer.c Sat Nov 1 17:22:53 2014 (r273938) @@ -194,8 +194,13 @@ ATF_TC_BODY(setitimer_old, tc) ATF_REQUIRE(setitimer(ITIMER_REAL, &it, &ot) == 0); +#ifdef __FreeBSD__ + if (ot.it_value.tv_sec == 4 && ot.it_value.tv_usec == 3) + atf_tc_fail("setitimer(2) did not return remaining time"); +#else if (ot.it_value.tv_sec != 4 || ot.it_value.tv_usec != 3) atf_tc_fail("setitimer(2) did not store old values"); +#endif } ATF_TP_ADD_TCS(tp) From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 17:52:05 2014 Return-Path: Delivered-To: svn-src-all@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 8D7ADDF8; Sat, 1 Nov 2014 17:52: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 79D9316C; Sat, 1 Nov 2014 17:52: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 sA1Hq5Bj053535; Sat, 1 Nov 2014 17:52:05 GMT (envelope-from markm@FreeBSD.org) Received: (from markm@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1Hq59P053534; Sat, 1 Nov 2014 17:52:05 GMT (envelope-from markm@FreeBSD.org) Message-Id: <201411011752.sA1Hq59P053534@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markm set sender to markm@FreeBSD.org using -f From: Mark Murray Date: Sat, 1 Nov 2014 17:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273939 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 17:52:05 -0000 Author: markm Date: Sat Nov 1 17:52:04 2014 New Revision: 273939 URL: https://svnweb.freebsd.org/changeset/base/273939 Log: Remove duplicate macro settings (probably due to an SVN merge /faux pas/ on my part. Spotted by: DES Approved by: DES(implicit) Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sat Nov 1 17:22:53 2014 (r273938) +++ head/sys/modules/Makefile Sat Nov 1 17:52:04 2014 (r273939) @@ -606,17 +606,6 @@ _x86bios= x86bios _ixl= ixl _ixlv= ixlv _ntb= ntb -_nvd= nvd -_nvme= nvme -_nvram= nvram -_nxge= nxge -.if ${MK_CDDL} != "no" || defined(ALL_MODULES) -_opensolaris= opensolaris -.endif -.if ${MK_CRYPT} != "no" || defined(ALL_MODULES) -_padlock= padlock -.endif -_pccard= pccard _qlxge= qlxge _qlxgb= qlxgb _qlxgbe= qlxgbe From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 18:51:49 2014 Return-Path: Delivered-To: svn-src-all@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 8D557C05; Sat, 1 Nov 2014 18:51: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 795238F1; Sat, 1 Nov 2014 18:51: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 sA1Ipn8e082127; Sat, 1 Nov 2014 18:51:49 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1IpnCB082126; Sat, 1 Nov 2014 18:51:49 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201411011851.sA1IpnCB082126@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sat, 1 Nov 2014 18:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273940 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 18:51:49 -0000 Author: marcel Date: Sat Nov 1 18:51:48 2014 New Revision: 273940 URL: https://svnweb.freebsd.org/changeset/base/273940 Log: Change the order of the arguments to file_loadraw(). They were swapped as of r262345 when file_loadraw() was made public and this little detail got overlooked during porting. Obtained from: Juniper Networks, Inc. Modified: head/sys/boot/common/install.c Modified: head/sys/boot/common/install.c ============================================================================== --- head/sys/boot/common/install.c Sat Nov 1 17:52:04 2014 (r273939) +++ head/sys/boot/common/install.c Sat Nov 1 18:51:48 2014 (r273940) @@ -286,7 +286,7 @@ install(char *pkgname) } s = (inst_rootfs == NULL) ? "/install.iso" : inst_rootfs; - if (file_loadraw("mfs_root", s) == NULL) { + if (file_loadraw(s, "mfs_root") == NULL) { error = errno; command_errmsg = "cannot load root file system"; goto fail; From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 20:07:33 2014 Return-Path: Delivered-To: svn-src-all@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 44F6AD8F; Sat, 1 Nov 2014 20: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 16CD6F0E; Sat, 1 Nov 2014 20: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 sA1K7Wbf017317; Sat, 1 Nov 2014 20:07:32 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1K7WS6017316; Sat, 1 Nov 2014 20:07:32 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201411012007.sA1K7WS6017316@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Sat, 1 Nov 2014 20:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273941 - head/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 20:07:33 -0000 Author: gavin Date: Sat Nov 1 20:07:32 2014 New Revision: 273941 URL: https://svnweb.freebsd.org/changeset/base/273941 Log: Updates to the list of CPUs supported by the amd64 platform MFC after: 3 days Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Sat Nov 1 18:51:48 2014 (r273940) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Sat Nov 1 20:07:32 2014 (r273941) @@ -76,7 +76,7 @@ Note that there are two names for this architecture, AMD64 (AMD) and Intel EM64T (Extended Memory 64-bit Technology). 64-bit mode of the two architectures are almost compatible - with each other, and &os;/&arch.amd64; should support them + with each other, and &os;/&arch.amd64; supports them both. As of this writing, the following processors are @@ -92,6 +92,18 @@ + &amd.sempron;. + + + + &amd.turion;. + + + + &amd.phenom;. + + + All multi-core &intel; &xeon; processors except Sossaman have EM64T support. @@ -104,22 +116,30 @@ - All &intel; Core 2 (not Core Duo) and later + All &intel; &core; 2 (not &core; Duo) and later processors + All &intel; &core; i range of processors + + + All &intel; &pentium; D processors - &intel; &pentium; 4s and Celeron Ds using + All &intel; ¢rino; Duo and ¢rino; Pro platforms + + + + &intel; &pentium; 4s and &celeron; Ds using the Cedar Mill core have EM64T support. - Some &intel; &pentium; 4s and Celeron Ds using + Some &intel; &pentium; 4s and &celeron; Ds using the Prescott core have EM64T support. See the Intel Processor Spec Finder for the definitive answer about From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 20:33:42 2014 Return-Path: Delivered-To: svn-src-all@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 D666CA20; Sat, 1 Nov 2014 20:33: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 C2521226; Sat, 1 Nov 2014 20:33: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 sA1KXgSA031733; Sat, 1 Nov 2014 20:33:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1KXgBn031732; Sat, 1 Nov 2014 20:33:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411012033.sA1KXgBn031732@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 1 Nov 2014 20:33:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273942 - head/contrib/netbsd-tests/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 20:33:43 -0000 Author: ngie Date: Sat Nov 1 20:33:42 2014 New Revision: 273942 URL: https://svnweb.freebsd.org/changeset/base/273942 Log: Skip :sethostname_basic because it messes up the test host's hostname Convert code from #if defined(__FreeBSD__) to #ifdef __FreeBSD__ Modified: head/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c Modified: head/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c Sat Nov 1 20:07:32 2014 (r273941) +++ head/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c Sat Nov 1 20:33:42 2014 (r273942) @@ -59,11 +59,13 @@ ATF_TC_BODY(sethostname_basic, tc) char name[MAXHOSTNAMELEN]; size_t i; + atf_tc_skip("screws up the test host's hostname on FreeBSD"); + for (i = 0; i < __arraycount(hosts); i++) { (void)memset(name, 0, sizeof(name)); -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ /* * Sanity checks to ensure that the wrong invariant isn't being * tested for per PR # 181127 @@ -106,7 +108,7 @@ ATF_TC_BODY(sethostname_limit, tc) ATF_TC_CLEANUP(sethostname_limit, tc) { -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ ATF_REQUIRE(sethostname(host, MAXHOSTNAMELEN - 1 ) == 0); ATF_REQUIRE(sethostname(host, MAXHOSTNAMELEN) == -1); #endif From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 20:41:41 2014 Return-Path: Delivered-To: svn-src-all@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 168D6D11; Sat, 1 Nov 2014 20:41: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 DC971315; Sat, 1 Nov 2014 20:41: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 sA1KfeYl034451; Sat, 1 Nov 2014 20:41:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1Kfeiw034450; Sat, 1 Nov 2014 20:41:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411012041.sA1Kfeiw034450@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 1 Nov 2014 20:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273943 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 20:41:41 -0000 Author: ngie Date: Sat Nov 1 20:41:40 2014 New Revision: 273943 URL: https://svnweb.freebsd.org/changeset/base/273943 Log: Port t_kevent to FreeBSD Submitted by: pho Modified: head/contrib/netbsd-tests/lib/libc/sys/t_kevent.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_kevent.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_kevent.c Sat Nov 1 20:33:42 2014 (r273942) +++ head/contrib/netbsd-tests/lib/libc/sys/t_kevent.c Sat Nov 1 20:41:40 2014 (r273943) @@ -43,12 +43,18 @@ __RCSID("$NetBSD: t_kevent.c,v 1.6 2012/ #include #include #include +#ifdef __NetBSD__ #include +#endif #include #include #include #include +#ifdef __FreeBSD__ +#define DRVCTLDEV "/nonexistent" +#endif + ATF_TC(kevent_zerotimer); ATF_TC_HEAD(kevent_zerotimer, tc) { @@ -108,9 +114,15 @@ ATF_TC_BODY(kqueue_desc_passing, tc) if (recvmsg(s[1], &m, 0) == -1) err(1, "child: could not recvmsg"); +#ifdef __FreeBSD__ + bcopy(CMSG_DATA(msg), &kq, sizeof(kq)); + printf("child (pid %d): received kq fd %d\n", getpid(), kq); + _exit(0); +#else kq = *(int *)CMSG_DATA(msg); printf("child (pid %d): received kq fd %d\n", getpid(), kq); exit(0); +#endif } close(s[1]); @@ -122,15 +134,29 @@ ATF_TC_BODY(kqueue_desc_passing, tc) msg->cmsg_type = SCM_RIGHTS; msg->cmsg_len = CMSG_LEN(sizeof(int)); +#ifdef __FreeBSD__ + /* + * What is should have been + * bcopy(&s[0], CMSG_DATA(msg), sizeof(kq)); + */ + bcopy(&kq, CMSG_DATA(msg), sizeof(kq)); +#else *(int *)CMSG_DATA(msg) = kq; +#endif EV_SET(&ev, 1, EVFILT_TIMER, EV_ADD|EV_ENABLE, 0, 1, 0); ATF_CHECK(kevent(kq, &ev, 1, NULL, 0, NULL) != -1); printf("parent (pid %d): sending kq fd %d\n", getpid(), kq); if (sendmsg(s[0], &m, 0) == -1) { +#if defined(__NetBSD__) ATF_REQUIRE_EQ_MSG(errno, EBADF, "errno is %d", errno); atf_tc_skip("PR kern/46523"); +#endif +#if defined(__FreeBSD__) + ATF_REQUIRE_EQ_MSG(errno, EOPNOTSUPP, "errno is %d", errno); + close(s[0]); +#endif } close(kq); From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 20:45:46 2014 Return-Path: Delivered-To: svn-src-all@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 260ADF91; Sat, 1 Nov 2014 20:45: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 EC04F338; Sat, 1 Nov 2014 20: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 sA1Kjjxd036934; Sat, 1 Nov 2014 20:45:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1KjjgO036933; Sat, 1 Nov 2014 20:45:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411012045.sA1KjjgO036933@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 1 Nov 2014 20:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273945 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 20:45:46 -0000 Author: ngie Date: Sat Nov 1 20:45:45 2014 New Revision: 273945 URL: https://svnweb.freebsd.org/changeset/base/273945 Log: Port t_mincore to FreeBSD Mark :mincore_resid as atf_tc_expect_fail on FreeBSD because of new bug discovered in running the tests (it succeeded from earlier on in the year to September/October on FreeBSD, at least) Submitted by: pho Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Sat Nov 1 20:41:47 2014 (r273944) +++ head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Sat Nov 1 20:45:45 2014 (r273945) @@ -74,6 +74,10 @@ __RCSID("$NetBSD: t_mincore.c,v 1.8 2012 #include #include +#ifdef __FreeBSD__ +#include +#endif + static long page = 0; static const char path[] = "mincore"; static size_t check_residency(void *, size_t); @@ -121,8 +125,10 @@ ATF_TC_BODY(mincore_err, tc) ATF_REQUIRE(vec != NULL); ATF_REQUIRE(map != MAP_FAILED); +#ifdef __NetBSD__ errno = 0; ATF_REQUIRE_ERRNO(EINVAL, mincore(map, 0, vec) == -1); +#endif errno = 0; ATF_REQUIRE_ERRNO(ENOMEM, mincore(0, page, vec) == -1); @@ -187,13 +193,24 @@ ATF_TC_BODY(mincore_resid, tc) npgs = 128; +#ifdef __FreeBSD__ + addr = mmap(NULL, npgs * page, PROT_READ | PROT_WRITE, + MAP_ANON | MAP_PRIVATE, -1, (off_t)0); +#else addr = mmap(NULL, npgs * page, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE | MAP_WIRED, -1, (off_t)0); +#endif if (addr == MAP_FAILED) atf_tc_skip("could not mmap wired anonymous test area, system " "might be low on memory"); +#ifdef __FreeBSD__ + atf_tc_expect_fail("the following calls fail; this seems to be a new " + "issue (didn't occur in 07/2014)"); + + ATF_REQUIRE(mlock(addr, npgs * page) == 0); +#endif ATF_REQUIRE(check_residency(addr, npgs) == npgs); ATF_REQUIRE(munmap(addr, npgs * page) == 0); @@ -238,12 +255,16 @@ ATF_TC_BODY(mincore_resid, tc) (void)munlockall(); ATF_REQUIRE(madvise(addr2, npgs * page, MADV_FREE) == 0); +#ifdef __NetBSD__ ATF_REQUIRE(check_residency(addr2, npgs) == 0); +#endif (void)memset(addr, 0, npgs * page); ATF_REQUIRE(madvise(addr, npgs * page, MADV_FREE) == 0); +#ifdef __NetBSD__ ATF_REQUIRE(check_residency(addr, npgs) == 0); +#endif (void)munmap(addr, npgs * page); (void)munmap(addr2, npgs * page); From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 20:50:40 2014 Return-Path: Delivered-To: svn-src-all@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 E5DD22DA; Sat, 1 Nov 2014 20:50: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 C707E359; Sat, 1 Nov 2014 20:50: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 sA1KodmY039969; Sat, 1 Nov 2014 20:50:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1KodEq039948; Sat, 1 Nov 2014 20:50:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411012050.sA1KodEq039948@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 1 Nov 2014 20:50:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273946 - head/contrib/netbsd-tests/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 20:50:40 -0000 Author: ngie Date: Sat Nov 1 20:50:39 2014 New Revision: 273946 URL: https://svnweb.freebsd.org/changeset/base/273946 Log: Port h_atexit to FreeBSD __cxa_atexit varies between FreeBSD and NetBSD, and thus we must use pointers instead of static fields in the BSS. More extensive discussion is included in the source code In collaboration with: kib Submitted by: pho Modified: head/contrib/netbsd-tests/lib/libc/stdlib/h_atexit.c Modified: head/contrib/netbsd-tests/lib/libc/stdlib/h_atexit.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/stdlib/h_atexit.c Sat Nov 1 20:45:45 2014 (r273945) +++ head/contrib/netbsd-tests/lib/libc/stdlib/h_atexit.c Sat Nov 1 20:50:39 2014 (r273946) @@ -42,9 +42,33 @@ __RCSID("$NetBSD: h_atexit.c,v 1.1 2011/ extern int __cxa_atexit(void (*func)(void *), void *, void *); extern void __cxa_finalize(void *); +#if defined(__FreeBSD__) +/* + * On shared object unload, in __cxa_finalize, call and clear all installed + * atexit and __cxa_atexit handlers that are either installed by unloaded + * dso, or points to the functions provided by the dso. + * + * The reason of the change is to ensure that there is no lingering pointers + * to the unloaded code after the dlclose(3). It is known reason for infinite + * stream of the crash reports for many programs which use loadable modules + * and fail to properly clean on module unload. Examples are apache, php, + * perl etc. + * + * You pass the &dso_handle_1 and &dso_handle_2, which points inside the + * main binary, to the registration function. The code from r211706, + * correctly detects that they are for the main binary, and on the first + * call to __cxa_finalize(), which also pass pointer to main binary, all + * registered functions from the main binary are executed. + */ + +static void *dso_handle_1 = (void *)1; +static void *dso_handle_2 = (void *)2; +static void *dso_handle_3 = (void *)3; +#else static int dso_handle_1; static int dso_handle_2; static int dso_handle_3; +#endif static int arg_1; static int arg_2; @@ -167,6 +191,15 @@ main(int argc, char *argv[]) ASSERT(0 == atexit(normal_handler_0)); ASSERT(0 == atexit(normal_handler_1)); +#if defined(__FreeBSD__) + ASSERT(0 == __cxa_atexit(cxa_handler_4, &arg_1, dso_handle_1)); + ASSERT(0 == __cxa_atexit(cxa_handler_5, &arg_1, dso_handle_1)); + ASSERT(0 == __cxa_atexit(cxa_handler_3, &arg_2, dso_handle_2)); + ASSERT(0 == __cxa_atexit(cxa_handler_2, &arg_3, dso_handle_3)); + + __cxa_finalize(dso_handle_1); + __cxa_finalize(dso_handle_2); +#else ASSERT(0 == __cxa_atexit(cxa_handler_4, &arg_1, &dso_handle_1)); ASSERT(0 == __cxa_atexit(cxa_handler_5, &arg_1, &dso_handle_1)); ASSERT(0 == __cxa_atexit(cxa_handler_3, &arg_2, &dso_handle_2)); @@ -174,5 +207,6 @@ main(int argc, char *argv[]) __cxa_finalize(&dso_handle_1); __cxa_finalize(&dso_handle_2); +#endif exit(0); } From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 21:00:41 2014 Return-Path: Delivered-To: svn-src-all@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 56161507; Sat, 1 Nov 2014 21:00: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 41F44612; Sat, 1 Nov 2014 21:00: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 sA1L0fTT043138; Sat, 1 Nov 2014 21:00:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1L0fU0043137; Sat, 1 Nov 2014 21:00:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411012100.sA1L0fU0043137@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 1 Nov 2014 21:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273947 - head/contrib/netbsd-tests/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 21:00:41 -0000 Author: ngie Date: Sat Nov 1 21:00:40 2014 New Revision: 273947 URL: https://svnweb.freebsd.org/changeset/base/273947 Log: Expect :snprintf_posarg_error to blow up with a SIGSEGV on !NetBSD OSes Modified: head/contrib/netbsd-tests/lib/libc/stdio/t_printf.c Modified: head/contrib/netbsd-tests/lib/libc/stdio/t_printf.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/stdio/t_printf.c Sat Nov 1 20:50:39 2014 (r273946) +++ head/contrib/netbsd-tests/lib/libc/stdio/t_printf.c Sat Nov 1 21:00:40 2014 (r273947) @@ -36,6 +36,10 @@ #include #include +#ifndef __NetBSD__ +#include +#endif + ATF_TC(snprintf_c99); ATF_TC_HEAD(snprintf_c99, tc) { @@ -116,6 +120,12 @@ ATF_TC_BODY(snprintf_posarg_error, tc) { char s[16], fmt[32]; +#ifndef __NetBSD__ + atf_tc_expect_signal(SIGSEGV, + "some non-NetBSD platforms including FreeBSD don't validate " + "negative size; testcase blows up with SIGSEGV"); +#endif + snprintf(fmt, sizeof(fmt), "%%%zu$d", SIZE_MAX / sizeof(size_t)); ATF_CHECK(snprintf(s, sizeof(s), fmt, -23) == -1); From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 21:21:07 2014 Return-Path: Delivered-To: svn-src-all@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 47CC87E1; Sat, 1 Nov 2014 21:21: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 19B7589A; Sat, 1 Nov 2014 21:21: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 sA1LL6RP054708; Sat, 1 Nov 2014 21:21:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1LL6wS054707; Sat, 1 Nov 2014 21:21:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411012121.sA1LL6wS054707@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 1 Nov 2014 21:21:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273948 - head/contrib/netbsd-tests/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 21:21:07 -0000 Author: ngie Date: Sat Nov 1 21:21:06 2014 New Revision: 273948 URL: https://svnweb.freebsd.org/changeset/base/273948 Log: Disable testcases 12 and 15-22 on FreeBSD Submitted by: pho Modified: head/contrib/netbsd-tests/lib/libc/stdio/t_fmemopen.c Modified: head/contrib/netbsd-tests/lib/libc/stdio/t_fmemopen.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/stdio/t_fmemopen.c Sat Nov 1 21:00:40 2014 (r273947) +++ head/contrib/netbsd-tests/lib/libc/stdio/t_fmemopen.c Sat Nov 1 21:21:06 2014 (r273948) @@ -27,7 +27,7 @@ * */ -#if defined(__NetBSD__) +#if defined(__FreeBSD__) || defined(__NetBSD__) #include #else #if defined(__linux__) @@ -563,6 +563,7 @@ ATF_TC_BODY(test11, tc) } } +#ifndef __FreeBSD__ ATF_TC(test12); ATF_TC_HEAD(test12, tc) { @@ -620,6 +621,7 @@ ATF_TC_BODY(test12, tc) } } } +#endif ATF_TC(test13); ATF_TC_HEAD(test13, tc) @@ -629,7 +631,9 @@ ATF_TC_HEAD(test13, tc) ATF_TC_BODY(test13, tc) { struct testcase *t; +#ifndef __FreeBSD__ off_t i; +#endif const char **p; char buf[BUFSIZ]; FILE *fp; @@ -659,7 +663,9 @@ ATF_TC_BODY(test13, tc) /* negative + OOB */ ATF_CHECK(fseeko(fp, -1, SEEK_END) == -1); ATF_CHECK(ftello(fp) == (off_t)0); +#endif +#ifndef __FreeBSD__ /* positive */ for (i = 1; i <= t->n; ++i) { ATF_CHECK(fseeko(fp, i, SEEK_END) == 0); @@ -711,11 +717,13 @@ ATF_TC_BODY(test14, tc) ATF_CHECK(fseeko(fp, -(len + 1), SEEK_END) == -1); ATF_CHECK(ftello(fp) == len); +#ifndef __FreeBSD__ /* positive */ for (i = 1; i <= rest; ++i) { ATF_CHECK(fseeko(fp, i, SEEK_END) == 0); ATF_CHECK(ftello(fp) == len + i); } +#endif /* negative */ for (i = 1; i < len; ++i) { @@ -734,6 +742,8 @@ const char *mode_rw1[] = { NULL }; +#ifndef __FreeBSD__ + /* test15 - 18: * When a stream open for writing is flushed or closed, a null byte is written * at the current position or at the end of the buffer, depending on the size @@ -1135,6 +1145,7 @@ ATF_TC_BODY(test22, tc) } } } +#endif ATF_TP_ADD_TCS(tp) { @@ -1150,9 +1161,12 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, test09); ATF_TP_ADD_TC(tp, test10); ATF_TP_ADD_TC(tp, test11); +#ifndef __FreeBSD__ ATF_TP_ADD_TC(tp, test12); +#endif ATF_TP_ADD_TC(tp, test13); ATF_TP_ADD_TC(tp, test14); +#ifndef __FreeBSD__ ATF_TP_ADD_TC(tp, test15); ATF_TP_ADD_TC(tp, test16); ATF_TP_ADD_TC(tp, test17); @@ -1161,6 +1175,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, test20); ATF_TP_ADD_TC(tp, test21); ATF_TP_ADD_TC(tp, test22); +#endif return atf_no_error(); } From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 21:23:27 2014 Return-Path: Delivered-To: svn-src-all@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 EB380937; Sat, 1 Nov 2014 21:23: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 D58B28B1; Sat, 1 Nov 2014 21:23: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 sA1LNR8e055976; Sat, 1 Nov 2014 21:23:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1LNROd055975; Sat, 1 Nov 2014 21:23:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411012123.sA1LNROd055975@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 1 Nov 2014 21:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273949 - head/contrib/netbsd-tests/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 21:23:28 -0000 Author: ngie Date: Sat Nov 1 21:23:27 2014 New Revision: 273949 URL: https://svnweb.freebsd.org/changeset/base/273949 Log: Add new atf_tc_expect_fail to fflush_err; this is a new (within the past couple months) bug Modified: head/contrib/netbsd-tests/lib/libc/stdio/t_fflush.c Modified: head/contrib/netbsd-tests/lib/libc/stdio/t_fflush.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/stdio/t_fflush.c Sat Nov 1 21:21:06 2014 (r273948) +++ head/contrib/netbsd-tests/lib/libc/stdio/t_fflush.c Sat Nov 1 21:23:27 2014 (r273949) @@ -48,6 +48,10 @@ ATF_TC_BODY(fflush_err, tc) { FILE *f; +#ifdef __FreeBSD__ + atf_tc_expect_fail("the EOF invariant fails on FreeBSD; this is new"); +#endif + f = fopen(path, "w"); ATF_REQUIRE(f != NULL); From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 21:25:22 2014 Return-Path: Delivered-To: svn-src-all@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 CAB15A81; Sat, 1 Nov 2014 21:25:22 +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 B6E6F8BC; Sat, 1 Nov 2014 21:25:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA1LPMO8056289; Sat, 1 Nov 2014 21:25:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1LPM2X056288; Sat, 1 Nov 2014 21:25:22 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411012125.sA1LPM2X056288@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 1 Nov 2014 21:25:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273950 - head/contrib/netbsd-tests/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 21:25:22 -0000 Author: ngie Date: Sat Nov 1 21:25:22 2014 New Revision: 273950 URL: https://svnweb.freebsd.org/changeset/base/273950 Log: Skip :fopen_regular on !NetBSD because it's a NetBSD specific test Submitted by: pho Modified: head/contrib/netbsd-tests/lib/libc/stdio/t_fopen.c Modified: head/contrib/netbsd-tests/lib/libc/stdio/t_fopen.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/stdio/t_fopen.c Sat Nov 1 21:23:27 2014 (r273949) +++ head/contrib/netbsd-tests/lib/libc/stdio/t_fopen.c Sat Nov 1 21:25:22 2014 (r273950) @@ -434,7 +434,9 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, fopen_err); ATF_TP_ADD_TC(tp, fopen_mode); ATF_TP_ADD_TC(tp, fopen_perm); +#ifdef __NetBSD__ ATF_TP_ADD_TC(tp, fopen_regular); +#endif ATF_TP_ADD_TC(tp, fopen_seek); ATF_TP_ADD_TC(tp, freopen_std); From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 21:30:19 2014 Return-Path: Delivered-To: svn-src-all@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 26B1CBEE; Sat, 1 Nov 2014 21:30: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 12D768DD; Sat, 1 Nov 2014 21:30: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 sA1LUI2m057639; Sat, 1 Nov 2014 21:30:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1LUIs5057638; Sat, 1 Nov 2014 21:30:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411012130.sA1LUIs5057638@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 1 Nov 2014 21:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273951 - head/contrib/netbsd-tests/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 21:30:19 -0000 Author: ngie Date: Sat Nov 1 21:30:18 2014 New Revision: 273951 URL: https://svnweb.freebsd.org/changeset/base/273951 Log: Expect :sscanf_whitespace to fail on !NetBSD OSes Submitted by: pho Modified: head/contrib/netbsd-tests/lib/libc/stdio/t_scanf.c Modified: head/contrib/netbsd-tests/lib/libc/stdio/t_scanf.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/stdio/t_scanf.c Sat Nov 1 21:25:22 2014 (r273950) +++ head/contrib/netbsd-tests/lib/libc/stdio/t_scanf.c Sat Nov 1 21:30:18 2014 (r273951) @@ -64,6 +64,10 @@ ATF_TC_BODY(sscanf_whitespace, tc) const char str[] = "\f\n\r\t\v%z"; char c; +#ifndef __NetBSD__ + atf_tc_expect_fail("fails on FreeBSD and some variants of Linux"); +#endif + /* set of "white space" symbols from isspace(3) */ c = 0; (void)sscanf(str, "%%%c", &c); From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 21:57:05 2014 Return-Path: Delivered-To: svn-src-all@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 7451C186; Sat, 1 Nov 2014 21:57:05 +0000 (UTC) Received: from mail-wg0-x233.google.com (mail-wg0-x233.google.com [IPv6:2a00:1450:400c:c00::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 609DEB2F; Sat, 1 Nov 2014 21:57:04 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id l18so8615578wgh.38 for ; Sat, 01 Nov 2014 14:57:02 -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:content-transfer-encoding; bh=Ffap2AVWXrksIFyRxialRswZF9014k3xu3RoF9N3AzU=; b=XDkV9wJQkgayfNnagCL28AeG4vt4pVGzzqrR8hF6TUmC10pQmLFBQcqoCQdMwFiIxF pEauny195vCbzQu+XknrwWGFe9Wml6GQ4zWFSqRT7McXLNABamSYZGZ2VS+g4zp4xwMn De/eliH0nxXbwGi9iAGYzNYwuUuPbTjFL59hXAygVQKPcuCYFplmM0UVxs42JyMcXlEe 0zg7fm+2vErhRn8qFphDRejM1/S7LhgNPw3oMZAeXpNIvPWHHYyGBhX7sG+ssjgP212B g6uBMpQKhwPEst5Emv0jWypZePWsVPQjkLvI7A2ui3TfCXqFhb9gCzWyrrFFaYMUWqja ND4Q== MIME-Version: 1.0 X-Received: by 10.180.92.169 with SMTP id cn9mr6128094wib.26.1414879022525; Sat, 01 Nov 2014 14:57:02 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Sat, 1 Nov 2014 14:57:02 -0700 (PDT) In-Reply-To: <201410302121.s9ULLsEw055630@svn.freebsd.org> References: <201410302121.s9ULLsEw055630@svn.freebsd.org> Date: Sat, 1 Nov 2014 14:57:02 -0700 X-Google-Sender-Auth: pA62k5IsyGHW4cFPAK8zZdCi5a4 Message-ID: Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... From: Adrian Chadd To: Mark Murray Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 21:57:05 -0000 Hi, I'm having a problem with this on MIPS router boards now: db> bt 277 Tracing pid 277 tid 100034 td 0x80d7b9c0 cpu_switch+90 (?,?,?,?) ra ca90db6800000000 sp 0 sz 0 sched_switch+224 (?,?,?,?) ra ca90db6800000028 sp 0 sz 0 mi_switch+27c (?,?,?,?) ra ca90db9000000020 sp 0 sz 0 80176358+1a0 (?,?,?,?) ra ca90dbb000000028 sp 0 sz 0 801765dc+2d0 (?,?,?,?) ra ca90dbd800000030 sp 0 sz 0 sleepq_timedwait_sig+18 (?,?,?,?) ra ca90dc0800000020 sp 0 sz 0 _sleep+3b8 (?,?,?,803199e0) ra ca90dc2800000068 sp 0 sz 0 random_adaptor_read+114 (?,?,?,?) ra ca90dc9000000038 sp 0 sz 0 800b1898+c0 (?,?,?,?) ra ca90dcc800000048 sp 0 sz 0 80187450+6c (?,?,?,?) ra ca90dd1000000028 sp 0 sz 0 kern_readv+8c (?,?,?,?) ra ca90dd3800000050 sp 0 sz 0 sys_read+48 (?,?,?,?) ra ca90dd8800000040 sp 0 sz 0 trap+7f0 (?,?,?,?) ra ca90ddc8000000b8 sp 0 sz 0 MipsUserGenException+10c (?,?,?,408ed960) ra ca90de8000000000 sp 0 sz 0 ... I've included "random" into the kernel rather than as a module now. This -looks- like it's not getting enough entropy now? -adrian On 30 October 2014 14:21, Mark Murray wrote: > Author: markm > Date: Thu Oct 30 21:21:53 2014 > New Revision: 273872 > URL: https://svnweb.freebsd.org/changeset/base/273872 > > Log: > This is the much-discussed major upgrade to the random(4) device, known= to you all as /dev/random. > > This code has had an extensive rewrite and a good series of reviews, bo= th by the author and other parties. This means a lot of code has been simpl= ified. Pluggable structures for high-rate entropy generators are available,= and it is most definitely not the case that /dev/random can be driven by o= nly a hardware souce any more. This has been designed out of the device. Ha= rdware sources are stirred into the CSPRNG (Yarrow, Fortuna) like any other= entropy source. Pluggable modules may be written by third parties for addi= tional sources. > > The harvesting structures and consequently the locking have been simpli= fied. Entropy harvesting is done in a more general way (the documentation f= or this will follow). There is some GREAT entropy to be had in the UMA allo= cator, but it is disabled for now as messing with that is likely to annoy m= any people. > > The venerable (but effective) Yarrow algorithm, which is no longer supp= orted by its authors now has an alternative, Fortuna. For now, Yarrow is re= tained as the default algorithm, but this may be changed using a kernel opt= ion. It is intended to make Fortuna the default algorithm for 11.0. Interes= ted parties are encouraged to read ISBN 978-0-470-47424-2 "Cryptography Eng= ineering" By Ferguson, Schneier and Kohno for Fortuna's gory details. Heck,= read it anyway. > > Many thanks to Arthur Mesh who did early grunt work, and who got caught= in the crossfire rather more than he deserved to. > > My thanks also to folks who helped me thresh this out on whiteboards an= d in the odd "Hallway track", or otherwise. > > My Nomex pants are on. Let the feedback commence! > > Reviewed by: trasz,des(partial),imp(partial?),rwatson(partial?) > Approved by: so(des) > > Added: > head/sys/dev/random/build.sh (contents, props changed) > head/sys/dev/random/fortuna.c (contents, props changed) > head/sys/dev/random/fortuna.h (contents, props changed) > head/sys/dev/random/uint128.h (contents, props changed) > head/sys/dev/random/unit_test.c (contents, props changed) > head/sys/dev/random/unit_test.h (contents, props changed) > head/sys/modules/padlock_rng/ > head/sys/modules/padlock_rng/Makefile (contents, props changed) > head/sys/modules/rdrand_rng/ > head/sys/modules/rdrand_rng/Makefile (contents, props changed) > Deleted: > head/etc/rc.d/initrandom > head/sys/dev/random/harvest.c > head/sys/dev/random/rwfile.c > head/sys/dev/random/rwfile.h > Modified: > head/etc/defaults/rc.conf > head/etc/rc.d/Makefile > head/etc/rc.d/geli > head/etc/rc.d/postrandom > head/etc/rc.d/random > head/libexec/save-entropy/save-entropy.sh > head/share/examples/kld/random_adaptor/random_adaptor_example.c > head/sys/conf/NOTES > head/sys/conf/files > head/sys/conf/options > head/sys/dev/glxsb/glxsb.c > head/sys/dev/random/dummy_rng.c > head/sys/dev/random/hash.c > head/sys/dev/random/hash.h > head/sys/dev/random/ivy.c > head/sys/dev/random/live_entropy_sources.c > head/sys/dev/random/live_entropy_sources.h > head/sys/dev/random/nehemiah.c > head/sys/dev/random/random_adaptors.c > head/sys/dev/random/random_adaptors.h > head/sys/dev/random/random_harvestq.c > head/sys/dev/random/random_harvestq.h > head/sys/dev/random/randomdev.c > head/sys/dev/random/randomdev.h > head/sys/dev/random/randomdev_soft.c > head/sys/dev/random/randomdev_soft.h > head/sys/dev/random/yarrow.c > head/sys/dev/random/yarrow.h > head/sys/kern/init_main.c > head/sys/kern/kern_intr.c > head/sys/kern/subr_bus.c > head/sys/modules/Makefile > head/sys/modules/random/Makefile > head/sys/net/if_ethersubr.c > head/sys/net/if_tun.c > head/sys/netgraph/ng_iface.c > head/sys/sys/random.h > head/sys/vm/uma_core.c > > Modified: head/etc/defaults/rc.conf > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/etc/defaults/rc.conf Thu Oct 30 17:58:57 2014 (r273871) > +++ head/etc/defaults/rc.conf Thu Oct 30 21:21:53 2014 (r273872) > @@ -645,7 +645,7 @@ update_motd=3D"YES" # update version info > entropy_file=3D"/entropy" # Set to NO to disable caching entropy = through reboots. > # /var/db/entropy-file is preferred if / is not a= vail. > entropy_dir=3D"/var/db/entropy" # Set to NO to disable caching entropy v= ia cron. > -entropy_save_sz=3D"2048" # Size of the entropy cache files. > +entropy_save_sz=3D"4096" # Size of the entropy cache files. > entropy_save_num=3D"8" # Number of entropy cache files to save. > harvest_interrupt=3D"YES" # Entropy device harvests interrupt ran= domness > harvest_ethernet=3D"YES" # Entropy device harvests ethernet randomness > > Modified: head/etc/rc.d/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/etc/rc.d/Makefile Thu Oct 30 17:58:57 2014 (r273871) > +++ head/etc/rc.d/Makefile Thu Oct 30 21:21:53 2014 (r273872) > @@ -57,7 +57,6 @@ FILES=3D DAEMON \ > hostid_save \ > hostname \ > inetd \ > - initrandom \ > ip6addrctl \ > ipfilter \ > ipfs \ > > Modified: head/etc/rc.d/geli > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/etc/rc.d/geli Thu Oct 30 17:58:57 2014 (r273871) > +++ head/etc/rc.d/geli Thu Oct 30 21:21:53 2014 (r273872) > @@ -28,7 +28,7 @@ > # > > # PROVIDE: disks > -# REQUIRE: initrandom > +# REQUIRE: random > # KEYWORD: nojail > > . /etc/rc.subr > > Modified: head/etc/rc.d/postrandom > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/etc/rc.d/postrandom Thu Oct 30 17:58:57 2014 (r273871) > +++ head/etc/rc.d/postrandom Thu Oct 30 21:21:53 2014 (r273872) > @@ -4,7 +4,7 @@ > # > > # PROVIDE: postrandom > -# REQUIRE: initrandom random FILESYSTEMS > +# REQUIRE: random FILESYSTEMS > # BEFORE: LOGIN > # KEYWORD: nojail > > > Modified: head/etc/rc.d/random > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/etc/rc.d/random Thu Oct 30 17:58:57 2014 (r273871) > +++ head/etc/rc.d/random Thu Oct 30 21:21:53 2014 (r273872) > @@ -4,7 +4,7 @@ > # > > # PROVIDE: random > -# REQUIRE: initrandom FILESYSTEMS > +# REQUIRE: FILESYSTEMS > # BEFORE: netif > # KEYWORD: nojail shutdown > > > Modified: head/libexec/save-entropy/save-entropy.sh > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/libexec/save-entropy/save-entropy.sh Thu Oct 30 17:58:57 2014 = (r273871) > +++ head/libexec/save-entropy/save-entropy.sh Thu Oct 30 21:21:53 2014 = (r273872) > @@ -53,7 +53,7 @@ case ${entropy_dir} in > ;; > esac > > -entropy_save_sz=3D${entropy_save_sz:-2048} > +entropy_save_sz=3D${entropy_save_sz:-4096} > entropy_save_num=3D${entropy_save_num:-8} > > if [ ! -d "${entropy_dir}" ]; then > > Modified: head/share/examples/kld/random_adaptor/random_adaptor_example.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/examples/kld/random_adaptor/random_adaptor_example.c T= hu Oct 30 17:58:57 2014 (r273871) > +++ head/share/examples/kld/random_adaptor/random_adaptor_example.c T= hu Oct 30 21:21:53 2014 (r273872) > @@ -35,17 +35,20 @@ __FBSDID("$FreeBSD$"); > #include > #include > > -#include > -#include > #include > +#include > +#include > +#include > > -static int random_example_read(void *, int); > - > -struct random_adaptor random_example =3D { > - .ident =3D "Example RNG", > - .source =3D RANDOM_PURE_BOGUS, /* Make sure this is in > - * sys/random.h and is unique */ > - .read =3D random_example_read, > +static void live_random_example_init(void); > +static void live_random_example_deinit(void); > +static u_int live_random_example_read(void *, u_int); > + > +struct random_adaptor live_random_example =3D { > + .les_ident =3D "Example RNG", > + .les_source =3D RANDOM_PURE_BOGUS, /* Make sure this is in > + * sys/random.h and is unique */ > + .les_read =3D live_random_example_read, > }; > > /* > @@ -58,8 +61,26 @@ getRandomNumber(void) > return 4; /* chosen by fair dice roll, guaranteed to be random = */ > } > > -static int > -random_example_read(void *buf, int c) > +static void > +live_random_example_init(void) > +{ > + > + /* Do initialisation stuff here */ > +} > + > +static void > +live_random_example_deinit(void) > +{ > + > + /* Do de-initialisation stuff here */ > +} > + > +/* get bytes of random stuff into . You may presume > + * that is a multiple of 2^n, with n>=3D3. A typical value > + * is c=3D16. > + */ > +static u_int > +live_random_example_read(void *buf, u_int c) > { > uint8_t *b; > int count; > @@ -69,22 +90,23 @@ random_example_read(void *buf, int c) > for (count =3D 0; count < c; count++) > b[count] =3D getRandomNumber(); > > - printf("returning %d bytes of pure randomness\n", c); > + /* printf("returning %d bytes of pure randomness\n", c); */ > return (c); > } > > +/* ARGSUSED */ > static int > -random_example_modevent(module_t mod, int type, void *unused) > +live_random_example_modevent(module_t mod __unused, int type, void *unus= ed __unused) > { > int error =3D 0; > > switch (type) { > case MOD_LOAD: > - live_entropy_source_register(&random_example); > + live_entropy_source_register(&live_random_example); > break; > > case MOD_UNLOAD: > - live_entropy_source_deregister(&random_example); > + live_entropy_source_deregister(&live_random_example); > break; > > case MOD_SHUTDOWN: > @@ -98,4 +120,6 @@ random_example_modevent(module_t mod, in > return (error); > } > > -LIVE_ENTROPY_SRC_MODULE(live_entropy_source_example, random_example_mode= vent, 1); > +DEV_MODULE(live_random_example, live_random_example_modevent, NULL); > +MODULE_VERSION(live_random_example, 1); > +MODULE_DEPEND(live_random_example, randomdev, 1, 1, 1); > > Modified: head/sys/conf/NOTES > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/NOTES Thu Oct 30 17:58:57 2014 (r273871) > +++ head/sys/conf/NOTES Thu Oct 30 21:21:53 2014 (r273872) > @@ -2993,10 +2993,10 @@ options BROOKTREE_ALLOC_PAGES=3D(217*4+1) > options MAXFILES=3D999 > > # Random number generator > -options RANDOM_YARROW # Yarrow RNG > -##options RANDOM_FORTUNA # Fortuna RNG - not yet implemented > +# Only ONE of the below two may be used; they are mutually exclusive. > +options RANDOM_YARROW # Yarrow CSPRNG (Default) > +#options RANDOM_FORTUNA # Fortuna CSPRNG > options RANDOM_DEBUG # Debugging messages > -options RANDOM_RWFILE # Read and write entropy cache > > # Module to enable execution of application via emulators like QEMU > options IMAGACT_BINMISC > > Modified: head/sys/conf/files > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/files Thu Oct 30 17:58:57 2014 (r273871) > +++ head/sys/conf/files Thu Oct 30 21:21:53 2014 (r273872) > @@ -2132,16 +2132,15 @@ rt2860.fw optional rt2860fw= | ralfw \ > compile-with "${NORMAL_FW}" \ > no-obj no-implicit-rule \ > clean "rt2860.fw" > -dev/random/harvest.c standard > -dev/random/dummy_rng.c standard > +dev/random/randomdev.c standard > dev/random/random_adaptors.c standard > -dev/random/live_entropy_sources.c optional random > -dev/random/random_harvestq.c optional random > -dev/random/randomdev.c optional random > +dev/random/dummy_rng.c standard > +dev/random/live_entropy_sources.c standard > +dev/random/random_harvestq.c standard > dev/random/randomdev_soft.c optional random > dev/random/yarrow.c optional random > +dev/random/fortuna.c optional random > dev/random/hash.c optional random > -dev/random/rwfile.c optional random > dev/rc/rc.c optional rc > dev/re/if_re.c optional re > dev/rl/if_rl.c optional rl pci > > Modified: head/sys/conf/options > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/options Thu Oct 30 17:58:57 2014 (r273871) > +++ head/sys/conf/options Thu Oct 30 21:21:53 2014 (r273872) > @@ -930,4 +930,3 @@ RCTL opt_global.h > RANDOM_YARROW opt_random.h > RANDOM_FORTUNA opt_random.h > RANDOM_DEBUG opt_random.h > -RANDOM_RWFILE opt_random.h > > Modified: head/sys/dev/glxsb/glxsb.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/glxsb/glxsb.c Thu Oct 30 17:58:57 2014 (r273871) > +++ head/sys/dev/glxsb/glxsb.c Thu Oct 30 21:21:53 2014 (r273872) > @@ -476,7 +476,7 @@ glxsb_rnd(void *v) > if (status & SB_RNS_TRNG_VALID) { > value =3D bus_read_4(sc->sc_sr, SB_RANDOM_NUM); > /* feed with one uint32 */ > - random_harvest(&value, 4, 32/2, RANDOM_PURE_GLXSB); > + random_harvest(&value, sizeof(value), 32/2, RANDOM_PURE_G= LXSB); > } > > callout_reset(&sc->sc_rngco, sc->sc_rnghz, glxsb_rnd, sc); > > Added: head/sys/dev/random/build.sh > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/random/build.sh Thu Oct 30 21:21:53 2014 (= r273872) > @@ -0,0 +1,24 @@ > +# $FreeBSD$ > +# > +# Basic script to build crude unit tests. > +# > +cc -g -O0 -pthread -DRANDOM_DEBUG -DRANDOM_YARROW \ > + -I../.. -lstdthreads -Wall \ > + unit_test.c \ > + yarrow.c \ > + hash.c \ > + ../../crypto/rijndael/rijndael-api-fst.c \ > + ../../crypto/rijndael/rijndael-alg-fst.c \ > + ../../crypto/sha2/sha2.c \ > + ../../crypto/sha2/sha256c.c \ > + -o yunit_test > +cc -g -O0 -pthread -DRANDOM_DEBUG -DRANDOM_FORTUNA \ > + -I../.. -lstdthreads -Wall \ > + unit_test.c \ > + fortuna.c \ > + hash.c \ > + ../../crypto/rijndael/rijndael-api-fst.c \ > + ../../crypto/rijndael/rijndael-alg-fst.c \ > + ../../crypto/sha2/sha2.c \ > + ../../crypto/sha2/sha256c.c \ > + -o funit_test > > Modified: head/sys/dev/random/dummy_rng.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/random/dummy_rng.c Thu Oct 30 17:58:57 2014 (= r273871) > +++ head/sys/dev/random/dummy_rng.c Thu Oct 30 21:21:53 2014 (= r273872) > @@ -1,5 +1,6 @@ > /*- > * Copyright (c) 2013 Arthur Mesh > + * Copyright (c) 2013 Mark R V Murray > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -27,98 +28,92 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include "opt_random.h" > + > #include > +#include > #include > #include > +#include > #include > -#include > #include > -#include > +#include > #include > -#include > > -#include > #include > - > -static struct mtx dummy_random_mtx; > - > -/* Used to fake out unused random calls in random_adaptor */ > -static void > -random_null_func(void) > -{ > -} > +#include > > static int > -dummy_random_poll(int events __unused, struct thread *td __unused) > +dummy_random_zero(void) > { > > return (0); > } > > -static int > -dummy_random_block(int flag) > +static void > +dummy_random(void) > { > - int error =3D 0; > - > - mtx_lock(&dummy_random_mtx); > - > - /* Blocking logic */ > - while (!error) { > - if (flag & O_NONBLOCK) > - error =3D EWOULDBLOCK; > - else { > - printf("random: dummy device blocking on read.\n"= ); > - error =3D msleep(&dummy_random_block, > - &dummy_random_mtx, > - PUSER | PCATCH, "block", 0); > - } > - } > - mtx_unlock(&dummy_random_mtx); > - > - return (error); > } > > +/* ARGSUSED */ > static void > dummy_random_init(void) > { > > - mtx_init(&dummy_random_mtx, "sleep mtx for dummy_random", > - NULL, MTX_DEF); > -} > - > -static void > -dummy_random_deinit(void) > -{ > +#ifdef RANDOM_DEBUG > + printf("random: %s\n", __func__); > +#endif > > - mtx_destroy(&dummy_random_mtx); > + randomdev_init_reader(dummy_random_read_phony); > } > > -struct random_adaptor dummy_random =3D { > - .ident =3D "Dummy entropy device that always blocks", > - .init =3D dummy_random_init, > - .deinit =3D dummy_random_deinit, > - .block =3D dummy_random_block, > - .poll =3D dummy_random_poll, > - .read =3D (random_read_func_t *)random_null_func, > - .reseed =3D (random_reseed_func_t *)random_null_func, > - .seeded =3D 0, /* This device can never be seeded */ > - .priority =3D 1, /* Bottom priority, so goes to last position */ > -}; > - > -static int > -dummy_random_modevent(module_t mod __unused, int type, void *unused __un= used) > +/* This is used only by the internal read_random(9) call, and then only > + * if no entropy processor is loaded. > + * > + * Make a token effort to provide _some_ kind of output. No warranty of > + * the quality of this output is made, mainly because its lousy. > + * > + * This is only used by the internal read_random(9) call when no other > + * adaptor is active. > + * > + * It has external scope due to the way things work in > + * randomdev_[de]init_reader() that the rest of the world doesn't need t= o > + * know about. > + * > + * Caveat Emptor. > + */ > +u_int > +dummy_random_read_phony(uint8_t *buf, u_int count) > { > + /* If no entropy device is loaded, don't spam the console with wa= rnings */ > + static int warned =3D 0; > + u_long randval; > + size_t size, i; > + > + if (!warned) { > + log(LOG_WARNING, "random device not loaded/active; using = insecure pseudo-random number generator\n"); > + warned =3D 1; > + } > > - switch (type) { > - case MOD_LOAD: > - random_adaptor_register("dummy", &dummy_random); > - EVENTHANDLER_INVOKE(random_adaptor_attach, > - &dummy_random); > + /* srandom() is called in kern/init_main.c:proc0_post() */ > > - return (0); > + /* Fill buf[] with random(9) output */ > + for (i =3D 0; i < count; i +=3D sizeof(randval)) { > + randval =3D random(); > + size =3D MIN(count - i, sizeof(randval)); > + memcpy(buf + i, &randval, (size_t)size); > } > > - return (EINVAL); > + return (count); > } > > -RANDOM_ADAPTOR_MODULE(dummy, dummy_random_modevent, 1); > +struct random_adaptor randomdev_dummy =3D { > + .ra_ident =3D "Dummy", > + .ra_priority =3D 1, /* Bottom priority, so goes to last position = */ > + .ra_reseed =3D dummy_random, > + .ra_seeded =3D (random_adaptor_seeded_func_t *)dummy_random_zero, > + .ra_read =3D (random_adaptor_read_func_t *)dummy_random_zero, > + .ra_write =3D (random_adaptor_write_func_t *)dummy_random_zero, > + .ra_init =3D dummy_random_init, > + .ra_deinit =3D dummy_random, > +}; > > Added: head/sys/dev/random/fortuna.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/random/fortuna.c Thu Oct 30 21:21:53 2014 (= r273872) > @@ -0,0 +1,433 @@ > +/*- > + * Copyright (c) 2013-2014 Mark R V Murray > + * 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 > + * in this position and unchanged. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in th= e > + * documentation and/or other materials provided with the distributio= n. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRAN= TIES > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIME= D. > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, = BUT > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF = USE, > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE= OF > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + * > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#ifdef _KERNEL > +#include "opt_random.h" > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#else /* !_KERNEL */ > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "unit_test.h" > + > +#include > +#include > + > +#include > +#include > +#include > +#endif /* _KERNEL */ > + > +#if !defined(RANDOM_YARROW) && !defined(RANDOM_FORTUNA) > +#define RANDOM_YARROW > +#elif defined(RANDOM_YARROW) && defined(RANDOM_FORTUNA) > +#error "Must define either RANDOM_YARROW or RANDOM_FORTUNA" > +#endif > + > +#if defined(RANDOM_FORTUNA) > + > +#define NPOOLS 32 > +#define MINPOOLSIZE 64 > +#define DEFPOOLSIZE 256 > +#define MAXPOOLSIZE 65536 > + > +/* This algorithm (and code) presumes that KEYSIZE is twice as large as = BLOCKSIZE */ > +CTASSERT(BLOCKSIZE =3D=3D sizeof(uint128_t)); > +CTASSERT(KEYSIZE =3D=3D 2*BLOCKSIZE); > + > +/* This is the beastie that needs protecting. It contains all of the > + * state that we are excited about. > + * Exactly one is instantiated. > + */ > +static struct fortuna_state { > + /* P_i */ > + struct pool { > + u_int length; > + struct randomdev_hash hash; > + } pool[NPOOLS]; > + > + /* ReseedCnt */ > + u_int reseedcount; > + > + /* C - 128 bits */ > + union { > + uint8_t byte[BLOCKSIZE]; > + uint128_t whole; > + } counter; > + > + /* K */ > + struct randomdev_key key; > + > + /* Extras */ > + u_int minpoolsize; > + > + /* Extras for the OS */ > + > +#ifdef _KERNEL > + /* For use when 'pacing' the reseeds */ > + sbintime_t lasttime; > +#endif > +} fortuna_state; > + > +/* The random_reseed_mtx mutex protects seeding and polling/blocking. *= / > +static mtx_t random_reseed_mtx; > + > +static struct fortuna_start_cache { > + uint8_t junk[PAGE_SIZE]; > + size_t length; > + struct randomdev_hash hash; > +} fortuna_start_cache; > + > +#ifdef _KERNEL > +static struct sysctl_ctx_list random_clist; > +RANDOM_CHECK_UINT(minpoolsize, MINPOOLSIZE, MAXPOOLSIZE); > +#endif > + > +void > +random_fortuna_init_alg(void) > +{ > + int i; > +#ifdef _KERNEL > + struct sysctl_oid *random_fortuna_o; > +#endif > + > + memset(fortuna_start_cache.junk, 0, sizeof(fortuna_start_cache.ju= nk)); > + fortuna_start_cache.length =3D 0U; > + randomdev_hash_init(&fortuna_start_cache.hash); > + > + /* Set up a lock for the reseed process */ > +#ifdef _KERNEL > + mtx_init(&random_reseed_mtx, "reseed mutex", NULL, MTX_DEF); > +#else /* !_KERNEL */ > + mtx_init(&random_reseed_mtx, mtx_plain); > +#endif /* _KERNEL */ > + > +#ifdef _KERNEL > + /* Fortuna parameters. Do not adjust these unless you have > + * have a very good clue about what they do! > + */ > + random_fortuna_o =3D SYSCTL_ADD_NODE(&random_clist, > + SYSCTL_STATIC_CHILDREN(_kern_random), > + OID_AUTO, "fortuna", CTLFLAG_RW, 0, > + "Fortuna Parameters"); > + > + SYSCTL_ADD_PROC(&random_clist, > + SYSCTL_CHILDREN(random_fortuna_o), OID_AUTO, > + "minpoolsize", CTLTYPE_UINT|CTLFLAG_RW, > + &fortuna_state.minpoolsize, DEFPOOLSIZE, > + random_check_uint_minpoolsize, "IU", > + "Minimum pool size necessary to cause a reseed automatica= lly"); > + > + fortuna_state.lasttime =3D 0U; > +#endif > + > + fortuna_state.minpoolsize =3D DEFPOOLSIZE; > + > + /* F&S - InitializePRNG() */ > + > + /* F&S - P_i =3D \epsilon */ > + for (i =3D 0; i < NPOOLS; i++) { > + randomdev_hash_init(&fortuna_state.pool[i].hash); > + fortuna_state.pool[i].length =3D 0U; > + } > + > + /* F&S - ReseedCNT =3D 0 */ > + fortuna_state.reseedcount =3D 0U; > + > + /* F&S - InitializeGenerator() */ > + > + /* F&S - C =3D 0 */ > + uint128_clear(&fortuna_state.counter.whole); > + > + /* F&S - K =3D 0 */ > + memset(&fortuna_state.key, 0, sizeof(fortuna_state.key)); > +} > + > +void > +random_fortuna_deinit_alg(void) > +{ > + > + mtx_destroy(&random_reseed_mtx); > + memset(&fortuna_state, 0, sizeof(fortuna_state)); > +} > + > +/* F&S - AddRandomEvent() */ > +/* Process a single stochastic event off the harvest queue */ > +void > +random_fortuna_process_event(struct harvest_event *event) > +{ > + u_int pl; > + > + /* We must be locked for all this as plenty of state gets messed = with */ > + mtx_lock(&random_reseed_mtx); > + > + /* Accumulate the event into the appropriate pool > + * where each event carries the destination information > + */ > + /* F&S - P_i =3D P_i| */ > + /* The hash_init and hash_finish are done in random_fortuna_read(= ) below */ > + pl =3D event->he_destination % NPOOLS; > + randomdev_hash_iterate(&fortuna_state.pool[pl].hash, event, sizeo= f(*event)); > + /* No point in counting above the outside maximum */ > + fortuna_state.pool[pl].length +=3D event->he_size; > + fortuna_state.pool[pl].length =3D MIN(fortuna_state.pool[pl].leng= th, MAXPOOLSIZE); > + > + /* Done with state-messing */ > + mtx_unlock(&random_reseed_mtx); > +} > + > +/* F&S - Reseed() */ > +/* Reseed Mutex is held */ > +static void > +reseed(uint8_t *junk, u_int length) > +{ > + struct randomdev_hash context; > + uint8_t hash[KEYSIZE], temp[KEYSIZE]; > + > + KASSERT(fortuna_state.minpoolsize > 0, ("random: Fortuna threshol= d =3D 0")); > +#ifdef _KERNEL > + mtx_assert(&random_reseed_mtx, MA_OWNED); > +#endif > + > + /* F&S - temp =3D H(K|s) */ > + randomdev_hash_init(&context); > + randomdev_hash_iterate(&context, &fortuna_state.key, sizeof(fortu= na_state.key)); > + randomdev_hash_iterate(&context, junk, length); > + randomdev_hash_finish(&context, temp); > + > + /* F&S - hash =3D H(temp) */ > + randomdev_hash_init(&context); > + randomdev_hash_iterate(&context, temp, KEYSIZE); > + randomdev_hash_finish(&context, hash); > + > + /* F&S - K =3D hash */ > + randomdev_encrypt_init(&fortuna_state.key, temp); > + memset(temp, 0, sizeof(temp)); > + memset(hash, 0, sizeof(hash)); > + > + /* Unblock the device if it was blocked due to being unseeded */ > + if (uint128_is_zero(fortuna_state.counter.whole)) > + random_adaptor_unblock(); > + /* F&S - C =3D C + 1 */ > + uint128_increment(&fortuna_state.counter.whole); > +} > + > +/* F&S - GenerateBlocks() */ > +/* Reseed Mutex is held, and buf points to a whole number of blocks. */ > +static __inline void > +random_fortuna_genblocks(uint8_t *buf, u_int blockcount) > +{ > + u_int i; > + > + for (i =3D 0u; i < blockcount; i++) { > + /* F&S - r =3D r|E(K,C) */ > + randomdev_encrypt(&fortuna_state.key, fortuna_state.count= er.byte, buf, BLOCKSIZE); > + buf +=3D BLOCKSIZE; > + > + /* F&S - C =3D C + 1 */ > + uint128_increment(&fortuna_state.counter.whole); > + } > +} > + > +/* F&S - PseudoRandomData() */ > +/* Reseed Mutex is held, and buf points to a whole number of blocks. */ > +static __inline void > +random_fortuna_genrandom(uint8_t *buf, u_int bytecount) > +{ > + static uint8_t temp[BLOCKSIZE*(KEYSIZE/BLOCKSIZE)]; > + u_int blockcount; > + > + /* F&S - assert(n < 2^20) */ > + KASSERT((bytecount <=3D (1 << 20)), ("invalid single read request= to fortuna of %d bytes", bytecount)); > + > + /* F&S - r =3D first-n-bytes(GenerateBlocks(ceil(n/16))) */ > + blockcount =3D (bytecount + BLOCKSIZE - 1)/BLOCKSIZE; > + random_fortuna_genblocks(buf, blockcount); > + > + /* F&S - K =3D GenerateBlocks(2) */ > + random_fortuna_genblocks(temp, KEYSIZE/BLOCKSIZE); > + randomdev_encrypt_init(&fortuna_state.key, temp); > + memset(temp, 0, sizeof(temp)); > +} > + > +/* F&S - RandomData() */ > +/* Used to return processed entropy from the PRNG */ > +/* The argument buf points to a whole number of blocks. */ > +void > +random_fortuna_read(uint8_t *buf, u_int bytecount) > +{ > +#ifdef _KERNEL > + sbintime_t thistime; > +#endif > + struct randomdev_hash context; > + uint8_t s[NPOOLS*KEYSIZE], temp[KEYSIZE]; > + int i; > + u_int seedlength; > + > + /* We must be locked for all this as plenty of state gets messed = with */ > + mtx_lock(&random_reseed_mtx); > + > + /* if buf =3D=3D NULL and bytecount =3D=3D 0 then this is the pre= -read. */ > + /* if buf =3D=3D NULL and bytecount !=3D 0 then this is the post-= read; ignore. */ > + if (buf =3D=3D NULL) { > + if (bytecount =3D=3D 0) { > + if (fortuna_state.pool[0].length >=3D fortuna_sta= te.minpoolsize > +#ifdef _KERNEL > + /* F&S - Use 'getsbinuptime()' to prevent reseed-= spamming. */ > + && ((thistime =3D getsbinuptime()) - fortuna_stat= e.lasttime > hz/10) > +#endif > + ) { > +#ifdef _KERNEL > + fortuna_state.lasttime =3D thistime; > +#endif > + > + seedlength =3D 0U; > + /* F&S - ReseedCNT =3D ReseedCNT + 1 */ > + fortuna_state.reseedcount++; > + /* s =3D \epsilon by default */ > + for (i =3D 0; i < NPOOLS; i++) { > + /* F&S - if Divides(ReseedCnt, 2^= i) ... */ > + if ((fortuna_state.reseedcount % = (1 << i)) =3D=3D 0U) { > + seedlength +=3D KEYSIZE; > + /* F&S - temp =3D (P_i) *= / > + randomdev_hash_finish(&fo= rtuna_state.pool[i].hash, temp); > + /* F&S - P_i =3D \epsilon= */ > + randomdev_hash_init(&fort= una_state.pool[i].hash); > + fortuna_state.pool[i].len= gth =3D 0U; > + /* F&S - s =3D s|H(temp) = */ > + randomdev_hash_init(&cont= ext); > + randomdev_hash_iterate(&c= ontext, temp, KEYSIZE); > + randomdev_hash_finish(&co= ntext, s + i*KEYSIZE); > + } > + else > + break; > + } > +#ifdef RANDOM_DEBUG > + printf("random: active reseed: reseedcoun= t [%d] ", fortuna_state.reseedcount); > + for (i =3D 0; i < NPOOLS; i++) > + printf(" %d", fortuna_state.pool[= i].length); > + printf("\n"); > +#endif > + /* F&S */ > + reseed(s, seedlength); > + > + /* Clean up */ > + memset(s, 0, seedlength); > + seedlength =3D 0U; > + memset(temp, 0, sizeof(temp)); > + memset(&context, 0, sizeof(context)); > + } > + } > + } > + /* if buf !=3D NULL do a regular read. */ > + else > + random_fortuna_genrandom(buf, bytecount); > + > + mtx_unlock(&random_reseed_mtx); > +} > + > +/* Internal function to hand external entropy to the PRNG */ > +void > +random_fortuna_write(uint8_t *buf, u_int count) > +{ > + uint8_t temp[KEYSIZE]; > + int i; > + uintmax_t timestamp; > + > + timestamp =3D get_cyclecount(); > + randomdev_hash_iterate(&fortuna_start_cache.hash, ×tamp, siz= eof(timestamp)); > + randomdev_hash_iterate(&fortuna_start_cache.hash, buf, count); > + timestamp =3D get_cyclecount(); > + randomdev_hash_iterate(&fortuna_start_cache.hash, ×tamp, siz= eof(timestamp)); > + randomdev_hash_finish(&fortuna_start_cache.hash, temp); > + for (i =3D 0; i < KEYSIZE; i++) > + fortuna_start_cache.junk[(fortuna_start_cache.length + i)= %PAGE_SIZE] ^=3D temp[i]; > + fortuna_start_cache.length +=3D KEYSIZE; > + > +#ifdef RANDOM_DEBUG > + printf("random: %s - ", __func__); > + for (i =3D 0; i < KEYSIZE; i++) > + printf("%02X", temp[i]); > + printf("\n"); > +#endif > + > + memset(temp, 0, KEYSIZE); > + > + /* We must be locked for all this as plenty of state gets messed = with */ > + mtx_lock(&random_reseed_mtx); > + > + randomdev_hash_init(&fortuna_start_cache.hash); > + > + reseed(fortuna_start_cache.junk, MIN(PAGE_SIZE, fortuna_start_cac= he.length)); > + memset(fortuna_start_cache.junk, 0, sizeof(fortuna_start_cache.ju= nk)); > + > + mtx_unlock(&random_reseed_mtx); > +} > + > +void > +random_fortuna_reseed(void) > +{ > + > + /* CWOT */ > +} > + > +int > +random_fortuna_seeded(void) > +{ > + > + return (!uint128_is_zero(fortuna_state.counter.whole)); > +} > + > +#endif /* RANDOM_FORTUNA */ > > Added: head/sys/dev/random/fortuna.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/random/fortuna.h Thu Oct 30 21:21:53 2014 (= r273872) > @@ -0,0 +1,44 @@ > +/*- > + * Copyright (c) 2013 Mark R V Murray > + * 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 > + * in this position and unchanged. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in th= e > + * documentation and/or other materials provided with the distributio= n. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRAN= TIES > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIME= D. > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, = BUT > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF = USE, > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE= OF > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#ifndef SYS_DEV_RANDOM_FORTUNA_H_INCLUDED > +#define SYS_DEV_RANDOM_FORTUNA_H_INCLUDED > + > +#ifdef _KERNEL > +typedef struct mtx mtx_t; > +#endif > + > +void random_fortuna_init_alg(void); > +void random_fortuna_deinit_alg(void); > +void random_fortuna_read(uint8_t *, u_int); > +void random_fortuna_write(uint8_t *, u_int); > +void random_fortuna_reseed(void); > +int random_fortuna_seeded(void); > +void random_fortuna_process_event(struct harvest_event *event); > + > +#endif > > Modified: head/sys/dev/random/hash.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/random/hash.c Thu Oct 30 17:58:57 2014 (r273871) > +++ head/sys/dev/random/hash.c Thu Oct 30 21:21:53 2014 (r273872) > @@ -28,18 +28,33 @@ > #include > __FBSDID("$FreeBSD$"); > > +#ifdef _KERNEL > #include > #include > +#else /* !_KERNEL */ > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include "unit_test.h" > +#endif /* _KERNEL */ > > #include > #include > > #include > > +/* This code presumes that KEYSIZE is twice as large as BLOCKSIZE */ > +CTASSERT(KEYSIZE =3D=3D 2*BLOCKSIZE); > + > /* Initialise the hash */ > void > randomdev_hash_init(struct randomdev_hash *context) > { > + > SHA256_Init(&context->sha); > } > > @@ -47,6 +62,7 @@ randomdev_hash_init(struct randomdev_has > void > randomdev_hash_iterate(struct randomdev_hash *context, void *data, size_= t size) > { > + > SHA256_Update(&context->sha, data, size); > } > > @@ -56,6 +72,7 @@ randomdev_hash_iterate(struct randomdev_ > void > randomdev_hash_finish(struct randomdev_hash *context, void *buf) > { > + > SHA256_Final(buf, &context->sha); > } > > @@ -66,6 +83,7 @@ randomdev_hash_finish(struct randomdev_h > void > randomdev_encrypt_init(struct randomdev_key *context, void *data) > { > + > rijndael_cipherInit(&context->cipher, MODE_CBC, NULL); > rijndael_makeKey(&context->key, DIR_ENCRYPT, KEYSIZE*8, data); > } > @@ -75,7 +93,8 @@ randomdev_encrypt_init(struct randomdev_ > * a multiple of BLOCKSIZE. > */ > void > -randomdev_encrypt(struct randomdev_key *context, void *d_in, void *d_out= , unsigned length) > +randomdev_encrypt(struct randomdev_key *context, void *d_in, void *d_out= , u_int length) > { > + > rijndael_blockEncrypt(&context->cipher, &context->key, d_in, leng= th*8, d_out); > } > > Modified: head/sys/dev/random/hash.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/random/hash.h Thu Oct 30 17:58:57 2014 (r273871) > +++ head/sys/dev/random/hash.h Thu Oct 30 21:21:53 2014 (r273872) > @@ -45,6 +45,6 @@ void randomdev_hash_init(struct randomde > void randomdev_hash_iterate(struct randomdev_hash *, void *, size_t); > void randomdev_hash_finish(struct randomdev_hash *, void *); > void randomdev_encrypt_init(struct randomdev_key *, void *); > -void randomdev_encrypt(struct randomdev_key *context, void *, void *, un= signed); > +void randomdev_encrypt(struct randomdev_key *context, void *, void *, u_= int); > > #endif > > Modified: head/sys/dev/random/ivy.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/random/ivy.c Thu Oct 30 17:58:57 2014 (r273871) > +++ head/sys/dev/random/ivy.c Thu Oct 30 21:21:53 2014 (r273872) > @@ -35,11 +35,11 @@ __FBSDID("$FreeBSD$"); > > #include > #include > +#include > #include > #include > #include > #include > -#include > #include > > #include > @@ -47,18 +47,17 @@ __FBSDID("$FreeBSD$"); > > #include > #include > -#include > -#include > #include > +#include > > #define RETRY_COUNT 10 > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 22:00:47 2014 Return-Path: Delivered-To: svn-src-all@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 4A9012E5; Sat, 1 Nov 2014 22: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 1CA33B4F; Sat, 1 Nov 2014 22: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 sA1M0kd6072175; Sat, 1 Nov 2014 22:00:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1M0kMc072172; Sat, 1 Nov 2014 22:00:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411012200.sA1M0kMc072172@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 1 Nov 2014 22:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273952 - head/contrib/netbsd-tests/lib/libc/hash X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 22:00:47 -0000 Author: ngie Date: Sat Nov 1 22:00:46 2014 New Revision: 273952 URL: https://svnweb.freebsd.org/changeset/base/273952 Log: Port h_hash and t_sha2 to FreeBSD t_sha2 contains dirty copy-paste hacks that need to be fixed with the openssh OpenBSD compat layer Submitted by: pho Modified: head/contrib/netbsd-tests/lib/libc/hash/h_hash.c head/contrib/netbsd-tests/lib/libc/hash/t_sha2.c Modified: head/contrib/netbsd-tests/lib/libc/hash/h_hash.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/hash/h_hash.c Sat Nov 1 21:30:18 2014 (r273951) +++ head/contrib/netbsd-tests/lib/libc/hash/h_hash.c Sat Nov 1 22:00:46 2014 (r273952) @@ -35,8 +35,13 @@ #include #include #include +#ifdef __NetBSD__ #include +#endif +#ifdef __FreeBSD__ +#include +#endif int mflag, rflag, sflag, tflag; @@ -102,17 +107,32 @@ regress(void) MD5Final(out, &ctx); outlen = 16; } else { +#ifdef __FreeBSD__ + SHA_CTX ctx; + + SHA1_Init(&ctx); + SHA1_Update(&ctx, buf, len); +#else SHA1_CTX ctx; SHA1Init(&ctx); SHA1Update(&ctx, buf, len); +#endif while (!last && fgets((char *)buf, sizeof(buf), stdin) != NULL) { len = strlen((char *)buf); CHOMP(buf, len, last); +#ifdef __FreeBSD__ + SHA1_Update(&ctx, buf, len); +#else SHA1Update(&ctx, buf, len); +#endif } +#ifdef __FreeBSD__ + SHA1_Final(out, &ctx); +#else SHA1Final(out, &ctx); +#endif outlen = 20; } hexdump(out, outlen); Modified: head/contrib/netbsd-tests/lib/libc/hash/t_sha2.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/hash/t_sha2.c Sat Nov 1 21:30:18 2014 (r273951) +++ head/contrib/netbsd-tests/lib/libc/hash/t_sha2.c Sat Nov 1 22:00:46 2014 (r273952) @@ -36,9 +36,23 @@ __RCSID("$NetBSD: t_sha2.c,v 1.3 2012/09 #include #include +#ifdef __NetBSD__ #include +#endif #include +#ifdef __FreeBSD__ +#include +typedef SHA512_CTX SHA384_CTX; +/* From /usr/src/crypto/openssh/openbsd-compat/sha2.h */ +#define SHA256_DIGEST_LENGTH 32 +#define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1) +#define SHA384_DIGEST_LENGTH 48 +#define SHA384_DIGEST_STRING_LENGTH (SHA384_DIGEST_LENGTH * 2 + 1) +#define SHA512_DIGEST_LENGTH 64 +#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1) +#endif + ATF_TC(t_sha256); ATF_TC(t_sha384); ATF_TC(t_sha512); From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 22:15:45 2014 Return-Path: Delivered-To: svn-src-all@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 8090D618; Sat, 1 Nov 2014 22:15:45 +0000 (UTC) Received: from mail-qa0-x22f.google.com (mail-qa0-x22f.google.com [IPv6:2607:f8b0:400d:c00::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9F44CD7; Sat, 1 Nov 2014 22:15:44 +0000 (UTC) Received: by mail-qa0-f47.google.com with SMTP id dc16so6783737qab.6 for ; Sat, 01 Nov 2014 15:15:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; bh=bJQYtBErg0XgVuA43QffL+t8beInSk7nkScW7xwoUco=; b=UtuQ18W71HQX6890dM4fJnH2uE1AvxUh0e4y6iP4hVa787Sv0mx1jPhD9HF+Vp4pCO FIbYKP8Oc98AkTf5AIIj9s+SF0NI25jKZlDUlMTERtYQiLDORgQPf5g1I+pHf6B5PEYZ r+XFrJJGH/uLtafTenIWTHzeAHYhy/e4cutpGRGkvXVxFsg1/RUHg9egDp/86sDuqGvq ICC++sKFmfWWaJ7J83Qca0rmaHCaaUaRC8z6xWkHjmz81gB8ypDlu9YqFhfo7eHoC7vb hP3Fx0LmaUDWpJs4fHfeyBwXuA1y7qiYO/Em1HH2DKPeyL9+FT0mpNSfAvkziTQIpxLF PUOQ== X-Received: by 10.229.193.5 with SMTP id ds5mr26386987qcb.30.1414880144077; Sat, 01 Nov 2014 15:15:44 -0700 (PDT) Received: from kan ([2601:6:6780:7d0:226:18ff:fe00:232e]) by mx.google.com with ESMTPSA id w8sm13049763qag.2.2014.11.01.15.15.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Nov 2014 15:15:43 -0700 (PDT) Date: Sat, 1 Nov 2014 18:15:36 -0400 From: Alexander Kabaev To: Adrian Chadd Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... Message-ID: <20141101181536.2b6a5911@kan> In-Reply-To: References: <201410302121.s9ULLsEw055630@svn.freebsd.org> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.22; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/Kh.GeyVy052Vm8/aZJ+I8VS"; protocol="application/pgp-signature" Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Mark Murray X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 22:15:45 -0000 --Sig_/Kh.GeyVy052Vm8/aZJ+I8VS Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sat, 1 Nov 2014 14:57:02 -0700 Adrian Chadd wrote: > Hi, >=20 > I'm having a problem with this on MIPS router boards now: >=20 > db> bt 277 > Tracing pid 277 tid 100034 td 0x80d7b9c0 > cpu_switch+90 (?,?,?,?) ra ca90db6800000000 sp 0 sz 0 > sched_switch+224 (?,?,?,?) ra ca90db6800000028 sp 0 sz 0 > mi_switch+27c (?,?,?,?) ra ca90db9000000020 sp 0 sz 0 > 80176358+1a0 (?,?,?,?) ra ca90dbb000000028 sp 0 sz 0 > 801765dc+2d0 (?,?,?,?) ra ca90dbd800000030 sp 0 sz 0 > sleepq_timedwait_sig+18 (?,?,?,?) ra ca90dc0800000020 sp 0 sz 0 > _sleep+3b8 (?,?,?,803199e0) ra ca90dc2800000068 sp 0 sz 0 > random_adaptor_read+114 (?,?,?,?) ra ca90dc9000000038 sp 0 sz 0 > 800b1898+c0 (?,?,?,?) ra ca90dcc800000048 sp 0 sz 0 > 80187450+6c (?,?,?,?) ra ca90dd1000000028 sp 0 sz 0 > kern_readv+8c (?,?,?,?) ra ca90dd3800000050 sp 0 sz 0 > sys_read+48 (?,?,?,?) ra ca90dd8800000040 sp 0 sz 0 > trap+7f0 (?,?,?,?) ra ca90ddc8000000b8 sp 0 sz 0 > MipsUserGenException+10c (?,?,?,408ed960) ra ca90de8000000000 sp 0 sz > 0 >=20 > ... I've included "random" into the kernel rather than as a module > now. >=20 > This -looks- like it's not getting enough entropy now? >=20 >=20 >=20 > -adrian >=20 Me too, on amd64 box. The machine gets hung for several minutes after 'writing entropy file' until random is unblocked. Anecdotally, banging on the keyboard trying to help the entropy gathering along seems to speed the process up. --=20 Alexander Kabaev --Sig_/Kh.GeyVy052Vm8/aZJ+I8VS Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iD8DBQFUVVuNQ6z1jMm+XZYRAkhPAJ4xHpOnjMgjOdcL+FGSnltcBycnAwCeIWvN ttbm5jQe0y/BNPBvwJ6MWU0= =lAAD -----END PGP SIGNATURE----- --Sig_/Kh.GeyVy052Vm8/aZJ+I8VS-- From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 22:29:58 2014 Return-Path: Delivered-To: svn-src-all@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 13EEE864; Sat, 1 Nov 2014 22:29:58 +0000 (UTC) Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [IPv6:2a00:1450:400c:c05::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35C11DB1; Sat, 1 Nov 2014 22:29:57 +0000 (UTC) Received: by mail-wi0-f171.google.com with SMTP id q5so3804914wiv.10 for ; Sat, 01 Nov 2014 15:29:55 -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=LBAvlIU7HuOKmnAfsIKCtt3fC5YcKlLp9bhOnFBj4WY=; b=igy8PPdIs+//6xTld44Uch5FG+b9MdmuEuirjGJKmuVSFYd9kbUEXInmMrbo7YbqOw hXAK+dM4JAx01mvp26TCA6mVAfKESj+P5nbHy0fqJaf89H+F6m/zc29T6MH8VgpTsYW7 nfvfN9pr+0Fv6W0LgDQocK3hjpb2nzHQUhfbu2aUzKIFqIb3FUOwDx310qU6VqDeB9PQ 0IL2OPqedjs1J+g1lJaXc9etyulH+JnG6Fmefjc7/GakzC+/ydIzlryWUyOxggBfug6E Ol5WsIGUIKhUOIZbMgopVPAeqWoR++CfJSCytJ4hIPHElvGdzKDz+QyiCloDtjoVfFuB 2qQQ== MIME-Version: 1.0 X-Received: by 10.180.83.98 with SMTP id p2mr6151819wiy.20.1414880995553; Sat, 01 Nov 2014 15:29:55 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Sat, 1 Nov 2014 15:29:55 -0700 (PDT) In-Reply-To: <20141101181536.2b6a5911@kan> References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> Date: Sat, 1 Nov 2014 15:29:55 -0700 X-Google-Sender-Auth: zI-U6BoCAIXWrEWfYp8e9FypQGY Message-ID: Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... From: Adrian Chadd To: Alexander Kabaev Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Mark Murray X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 22:29:58 -0000 Yeah I can't do that for a wireless AP. Oh, and if I hit Ctrl-C, the whole system hangs! :( -adrian On 1 November 2014 15:15, Alexander Kabaev wrote: > On Sat, 1 Nov 2014 14:57:02 -0700 > Adrian Chadd wrote: > >> Hi, >> >> I'm having a problem with this on MIPS router boards now: >> >> db> bt 277 >> Tracing pid 277 tid 100034 td 0x80d7b9c0 >> cpu_switch+90 (?,?,?,?) ra ca90db6800000000 sp 0 sz 0 >> sched_switch+224 (?,?,?,?) ra ca90db6800000028 sp 0 sz 0 >> mi_switch+27c (?,?,?,?) ra ca90db9000000020 sp 0 sz 0 >> 80176358+1a0 (?,?,?,?) ra ca90dbb000000028 sp 0 sz 0 >> 801765dc+2d0 (?,?,?,?) ra ca90dbd800000030 sp 0 sz 0 >> sleepq_timedwait_sig+18 (?,?,?,?) ra ca90dc0800000020 sp 0 sz 0 >> _sleep+3b8 (?,?,?,803199e0) ra ca90dc2800000068 sp 0 sz 0 >> random_adaptor_read+114 (?,?,?,?) ra ca90dc9000000038 sp 0 sz 0 >> 800b1898+c0 (?,?,?,?) ra ca90dcc800000048 sp 0 sz 0 >> 80187450+6c (?,?,?,?) ra ca90dd1000000028 sp 0 sz 0 >> kern_readv+8c (?,?,?,?) ra ca90dd3800000050 sp 0 sz 0 >> sys_read+48 (?,?,?,?) ra ca90dd8800000040 sp 0 sz 0 >> trap+7f0 (?,?,?,?) ra ca90ddc8000000b8 sp 0 sz 0 >> MipsUserGenException+10c (?,?,?,408ed960) ra ca90de8000000000 sp 0 sz >> 0 >> >> ... I've included "random" into the kernel rather than as a module >> now. >> >> This -looks- like it's not getting enough entropy now? >> >> >> >> -adrian >> > > Me too, on amd64 box. The machine gets hung for several minutes after > 'writing entropy file' until random is unblocked. Anecdotally, banging > on the keyboard trying to help the entropy gathering along seems to > speed the process up. > > -- > Alexander Kabaev From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 22:36:42 2014 Return-Path: Delivered-To: svn-src-all@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 2E8AEAB7; Sat, 1 Nov 2014 22:36: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 00D96E89; Sat, 1 Nov 2014 22:36: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 sA1MafJr089794; Sat, 1 Nov 2014 22:36:41 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1Mafe2089791; Sat, 1 Nov 2014 22:36:41 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201411012236.sA1Mafe2089791@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 1 Nov 2014 22:36:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273953 - in head/sys: dev/hwpmc 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 22:36:42 -0000 Author: mjg Date: Sat Nov 1 22:36:40 2014 New Revision: 273953 URL: https://svnweb.freebsd.org/changeset/base/273953 Log: Fix up module unload for syscall_module_handler consumers. After r273707 it was registering syscalls as static. This fixes hwpmc module unload. Reported by: markj Modified: head/sys/dev/hwpmc/hwpmc_mod.c head/sys/kern/kern_syscalls.c head/sys/sys/sysent.h Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Sat Nov 1 22:00:46 2014 (r273952) +++ head/sys/dev/hwpmc/hwpmc_mod.c Sat Nov 1 22:36:40 2014 (r273953) @@ -320,7 +320,8 @@ static struct syscall_module_data pmc_sy NULL, &pmc_syscall_num, &pmc_sysent, - { 0, NULL } + { 0, NULL }, + SY_THR_STATIC_KLD, }; static moduledata_t pmc_mod = { Modified: head/sys/kern/kern_syscalls.c ============================================================================== --- head/sys/kern/kern_syscalls.c Sat Nov 1 22:00:46 2014 (r273952) +++ head/sys/kern/kern_syscalls.c Sat Nov 1 22:36:40 2014 (r273953) @@ -160,7 +160,7 @@ syscall_module_handler(struct module *mo switch (what) { case MOD_LOAD: error = syscall_register(data->offset, data->new_sysent, - &data->old_sysent, SY_THR_STATIC_KLD); + &data->old_sysent, data->flags); if (error) { /* Leave a mark so we know to safely unload below. */ data->offset = NULL; Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Sat Nov 1 22:00:46 2014 (r273952) +++ head/sys/sys/sysent.h Sat Nov 1 22:36:40 2014 (r273953) @@ -175,6 +175,7 @@ struct syscall_module_data { int *offset; /* offset into sysent */ struct sysent *new_sysent; /* new sysent */ struct sysent old_sysent; /* old sysent */ + int flags; /* flags for syscall_register */ }; #define MAKE_SYSENT(syscallname) \ From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 22:39:21 2014 Return-Path: Delivered-To: svn-src-all@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 DAA81C20; Sat, 1 Nov 2014 22:39:21 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0: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 9F413EA2; Sat, 1 Nov 2014 22:39:21 +0000 (UTC) Received: from [2001:470:9174:1:407c:4bb6:6af1:63e2] by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.84 (FreeBSD)) (envelope-from ) id 1XkhKJ-000FhB-Ly; Sat, 01 Nov 2014 22:39:20 +0000 Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <20141101181536.2b6a5911@kan> Date: Sat, 1 Nov 2014 22:39:17 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> To: Alexander Kabaev X-Mailer: Apple Mail (2.1990.1) X-SA-Score: -1.0 Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 22:39:22 -0000 Hi I=E2=80=99m not sure what you are showing me here? How yo you draw the =E2=80=9Cnot enough entropy=E2=80=9D conclusion? The writing happens at shutdown; before you do the shutdown could you = please do a =E2=80=98sysctl kern.random=E2=80=99 and post the result? Do you have anything random-related in your rc.conf? Could you please do a verbose boot on a kernel with =E2=80=9Coptions = RANDOM_DEBUG=E2=80=9D set and send me the dmesg output from a failing = box. M > On 1 Nov 2014, at 22:15, Alexander Kabaev wrote: >=20 > On Sat, 1 Nov 2014 14:57:02 -0700 > Adrian Chadd wrote: >=20 >> Hi, >>=20 >> I'm having a problem with this on MIPS router boards now: >>=20 >> db> bt 277 >> Tracing pid 277 tid 100034 td 0x80d7b9c0 >> cpu_switch+90 (?,?,?,?) ra ca90db6800000000 sp 0 sz 0 >> sched_switch+224 (?,?,?,?) ra ca90db6800000028 sp 0 sz 0 >> mi_switch+27c (?,?,?,?) ra ca90db9000000020 sp 0 sz 0 >> 80176358+1a0 (?,?,?,?) ra ca90dbb000000028 sp 0 sz 0 >> 801765dc+2d0 (?,?,?,?) ra ca90dbd800000030 sp 0 sz 0 >> sleepq_timedwait_sig+18 (?,?,?,?) ra ca90dc0800000020 sp 0 sz 0 >> _sleep+3b8 (?,?,?,803199e0) ra ca90dc2800000068 sp 0 sz 0 >> random_adaptor_read+114 (?,?,?,?) ra ca90dc9000000038 sp 0 sz 0 >> 800b1898+c0 (?,?,?,?) ra ca90dcc800000048 sp 0 sz 0 >> 80187450+6c (?,?,?,?) ra ca90dd1000000028 sp 0 sz 0 >> kern_readv+8c (?,?,?,?) ra ca90dd3800000050 sp 0 sz 0 >> sys_read+48 (?,?,?,?) ra ca90dd8800000040 sp 0 sz 0 >> trap+7f0 (?,?,?,?) ra ca90ddc8000000b8 sp 0 sz 0 >> MipsUserGenException+10c (?,?,?,408ed960) ra ca90de8000000000 sp 0 sz >> 0 >>=20 >> ... I've included "random" into the kernel rather than as a module >> now. >>=20 >> This -looks- like it's not getting enough entropy now? >>=20 >>=20 >>=20 >> -adrian >>=20 >=20 > Me too, on amd64 box. The machine gets hung for several minutes after > 'writing entropy file' until random is unblocked. Anecdotally, banging > on the keyboard trying to help the entropy gathering along seems to > speed the process up. >=20 > --=20 > Alexander Kabaev --=20 Mark R V Murray From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 22:49:49 2014 Return-Path: Delivered-To: svn-src-all@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 14833178; Sat, 1 Nov 2014 22:49:49 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (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 D4882FD8; Sat, 1 Nov 2014 22:49:48 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XkhUQ-00067l-I7; Sat, 01 Nov 2014 22:49:46 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sA1MnjZj088146; Sat, 1 Nov 2014 16:49:45 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19pLjWHkJSTZjzpMxaQMHZ0 X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... From: Ian Lepore To: Mark R V Murray In-Reply-To: <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> Content-Type: text/plain; charset="windows-1251" Date: Sat, 01 Nov 2014 16:49:45 -0600 Message-ID: <1414882185.17308.221.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by ilsoft.org id sA1MnjZj088146 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , Alexander Kabaev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 22:49:49 -0000 On Sat, 2014-11-01 at 22:39 +0000, Mark R V Murray wrote: > Hi >=20 > I=92m not sure what you are showing me here? >=20 > How yo you draw the =93not enough entropy=94 conclusion? >=20 > The writing happens at shutdown; before you do the shutdown could you p= lease do a =91sysctl kern.random=92 and post the result? >=20 I'm not sure where you're getting "at shutdown" from. Everyone reporting these problems has been pretty clear that it's happening at boot time: ... warning: no time-of-day clock registered, system time will not be set acc= urately warning: no time-of-day clock registered, system time will not be set acc= urately Interface ue0 IP-Address 172.22.42.28 Broadcast 172.22.42.255=20 Setting hostuuid: 1d295353-1dd2-11b2-9f30-653cd80a9fc4. Setting hostid: 0x2896f513. No suitable dump device was found. Starting file system checks: mount_nfs: can't update /var/db/mounttab for 172.22.42.240:/rpi Mounting local file systems:. Writing entropy file: And there it hangs, I guess maybe forever. In this case it's an R-Pi running -current that I just sync'd and built fresh from scratch a few minutes ago: FreeBSD 11.0-CURRENT #0 r273952: Sat Nov 1 16:27:00 MDT 2014 -- Ian From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 22:50:01 2014 Return-Path: Delivered-To: svn-src-all@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 793452DD; Sat, 1 Nov 2014 22:50:01 +0000 (UTC) Received: from mail-wg0-x236.google.com (mail-wg0-x236.google.com [IPv6:2a00:1450:400c:c00::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92C55FDA; Sat, 1 Nov 2014 22:50:00 +0000 (UTC) Received: by mail-wg0-f54.google.com with SMTP id n12so3340695wgh.13 for ; Sat, 01 Nov 2014 15:49:58 -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:content-transfer-encoding; bh=rvxb6nSe6BUVm/kklI60Zolhou0h+PMMQ5WwsnFhcrY=; b=TqCiF6kqkBtaPx8vOmWONyPBG+SUlPh+4SWWfZjsB1uYe8frDxSyfimtLYHp/lvjle sgrF0mFQTYw6TN7ae1+L7nzpvM1mNFcrmGJ/z427owpYQeQcgvb9qcg9pAOiHOGvMh7J 4gnYM2unbc9TWupv4jwjMQzBwkpM1tbwlxugK1FEr1qBtNeK47014xpziNUPOR2Hc31I IY+k+rHHi50Tt44WprgkkSBYKLYsomJjB5fWFHWR7yb2Hk0JWl+iieMBB4HKUtpswQrZ GJKar12qFnngU7WDzuG4vpUGVkQPqD3+Uy652CgpuPj8wmto10X9l4PN/KEAoZDkxJAG MT6g== MIME-Version: 1.0 X-Received: by 10.194.221.105 with SMTP id qd9mr37686840wjc.51.1414882198888; Sat, 01 Nov 2014 15:49:58 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Sat, 1 Nov 2014 15:49:58 -0700 (PDT) In-Reply-To: <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> Date: Sat, 1 Nov 2014 15:49:58 -0700 X-Google-Sender-Auth: 8m1S2wUh2f-vsU4178lfHUsU9tQ Message-ID: Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... From: Adrian Chadd To: Mark R V Murray Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Alexander Kabaev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 22:50:01 -0000 On 1 November 2014 15:39, Mark R V Murray wrote: > Hi > > I=E2=80=99m not sure what you are showing me here? > > How yo you draw the =E2=80=9Cnot enough entropy=E2=80=9D conclusion? This is a kernel backtrace from the hostap process. It's stuck in that particular read, waiting somewhere in random_adaptor_read(). If I hit ctrl-C on this process, the whole kernel hangs. I'll see if I can get some ddb output from that. > The writing happens at shutdown; before you do the shutdown could you ple= ase do a =E2=80=98sysctl kern.random=E2=80=99 and post the result? It won't ever get to that point, as it's hanging at startup. :) > Do you have anything random-related in your rc.conf? Nope. > Could you please do a verbose boot on a kernel with =E2=80=9Coptions RAND= OM_DEBUG=E2=80=9D set and send me the dmesg output from a failing box. Ok, I'll give that a go. Thanks, -adrian From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 22:58:49 2014 Return-Path: Delivered-To: svn-src-all@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 0EBA04F1; Sat, 1 Nov 2014 22:58:49 +0000 (UTC) Received: from mail-qc0-x232.google.com (mail-qc0-x232.google.com [IPv6:2607:f8b0:400d:c01::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77EC5142; Sat, 1 Nov 2014 22:58:48 +0000 (UTC) Received: by mail-qc0-f178.google.com with SMTP id b13so8607558qcw.9 for ; Sat, 01 Nov 2014 15:58:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; bh=yWYGa6jKBQeQEY2b0BaeJBQ4a9yKZhHCxYjErx9GoS0=; b=tgl1KR6BuimS+GnzHOuFrpfO6Kh9cYhdKDDe2yZVS8jTUYoeEz4KZGgslkrOwrIXyl kAY74Na0d6yRcW3LIzflQ/75ge2UU6x/WceYSfQ1M0OZZQ8T9K2IEzAA4ZPJpfV82B2c /WEkNXrJRb0WNxKwqys5sg1JjoGcFbzgbPzBh+K5oEltT2Y0l5IO6HVu50gRnoZ6H3FF qispoIqtXbeNcTGqfZpDQaTNNvEcxVMBjkhFKwk6/sRmD76QK9oL6JBU84dulw/fbpUZ ktSrYmL3ZKDBaR0wijWOoR8mjxLmaiyJc9HHtSD78vTbumf5N20qmwu1iVBKI/R/wpC4 6PeQ== X-Received: by 10.224.120.67 with SMTP id c3mr50872573qar.84.1414882727605; Sat, 01 Nov 2014 15:58:47 -0700 (PDT) Received: from kan ([2601:6:6780:7d0:226:18ff:fe00:232e]) by mx.google.com with ESMTPSA id e8sm13083705qai.33.2014.11.01.15.58.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Nov 2014 15:58:46 -0700 (PDT) Date: Sat, 1 Nov 2014 18:58:40 -0400 From: Alexander Kabaev To: Mark R V Murray Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... Message-ID: <20141101185840.59e24ba8@kan> In-Reply-To: <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.22; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/PG7gzn/8+1ttDIWRlGWKNpx"; protocol="application/pgp-signature" Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 22:58:49 -0000 --Sig_/PG7gzn/8+1ttDIWRlGWKNpx Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On Sat, 1 Nov 2014 22:39:17 +0000 Mark R V Murray wrote: > Hi >=20 > I'm not sure what you are showing me here? >=20 > How yo you draw the "not enough entropy" conclusion? >=20 > The writing happens at shutdown; before you do the shutdown could you > please do a 'sysctl kern.random' and post the result? >=20 > Do you have anything random-related in your rc.conf? >=20 > Could you please do a verbose boot on a kernel with "options > RANDOM_DEBUG" set and send me the dmesg output from a failing box. >=20 > M >=20 > > On 1 Nov 2014, at 22:15, Alexander Kabaev wrote: > >=20 > > On Sat, 1 Nov 2014 14:57:02 -0700 > > Adrian Chadd wrote: > >=20 > >> Hi, > >>=20 > >> I'm having a problem with this on MIPS router boards now: > >>=20 > >> db> bt 277 > >> Tracing pid 277 tid 100034 td 0x80d7b9c0 > >> cpu_switch+90 (?,?,?,?) ra ca90db6800000000 sp 0 sz 0 > >> sched_switch+224 (?,?,?,?) ra ca90db6800000028 sp 0 sz 0 > >> mi_switch+27c (?,?,?,?) ra ca90db9000000020 sp 0 sz 0 > >> 80176358+1a0 (?,?,?,?) ra ca90dbb000000028 sp 0 sz 0 > >> 801765dc+2d0 (?,?,?,?) ra ca90dbd800000030 sp 0 sz 0 > >> sleepq_timedwait_sig+18 (?,?,?,?) ra ca90dc0800000020 sp 0 sz 0 > >> _sleep+3b8 (?,?,?,803199e0) ra ca90dc2800000068 sp 0 sz 0 > >> random_adaptor_read+114 (?,?,?,?) ra ca90dc9000000038 sp 0 sz 0 > >> 800b1898+c0 (?,?,?,?) ra ca90dcc800000048 sp 0 sz 0 > >> 80187450+6c (?,?,?,?) ra ca90dd1000000028 sp 0 sz 0 > >> kern_readv+8c (?,?,?,?) ra ca90dd3800000050 sp 0 sz 0 > >> sys_read+48 (?,?,?,?) ra ca90dd8800000040 sp 0 sz 0 > >> trap+7f0 (?,?,?,?) ra ca90ddc8000000b8 sp 0 sz 0 > >> MipsUserGenException+10c (?,?,?,408ed960) ra ca90de8000000000 sp 0 > >> sz 0 > >>=20 > >> ... I've included "random" into the kernel rather than as a module > >> now. > >>=20 > >> This -looks- like it's not getting enough entropy now? > >>=20 > >>=20 > >>=20 > >> -adrian > >>=20 > >=20 > > Me too, on amd64 box. The machine gets hung for several minutes > > after 'writing entropy file' until random is unblocked. > > Anecdotally, banging on the keyboard trying to help the entropy > > gathering along seems to speed the process up. > >=20 > > --=20 > > Alexander Kabaev >=20 > --=20 > Mark R V Murray Nothing related to random in my rc.conf % sysctl kern.random kern.random.adaptors: yarrow(90),dummy(1) kern.random.active_adaptor: yarrow kern.random.live_entropy_sources:=20 kern.random.yarrow.gengateinterval: 10 kern.random.yarrow.bins: 10 kern.random.yarrow.fastthresh: 96 kern.random.yarrow.slowthresh: 128 kern.random.yarrow.slowoverthresh: 2 kern.random.harvest.mask: 1023 kern.random.harvest.mask_bin: 1111111111 kern.random.harvest.mask_symbolic: UMA_ALLOC,SWI,INTERRUPT,NET_NG,NET_ETHER,NET_TUN,MOUSE,KEYBOARD,ATTACH,CACH= ED --=20 Alexander Kabaev --Sig_/PG7gzn/8+1ttDIWRlGWKNpx Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iD8DBQFUVWWlQ6z1jMm+XZYRAgU6AKDl/7BmncyOUTcVpj02fyyh3W9W5gCfWi9X iHOOhZX5ONxxqjLrp3BB3eA= =GnCF -----END PGP SIGNATURE----- --Sig_/PG7gzn/8+1ttDIWRlGWKNpx-- From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 23:03:00 2014 Return-Path: Delivered-To: svn-src-all@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 242EF6BA; Sat, 1 Nov 2014 23:03:00 +0000 (UTC) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37D38200; Sat, 1 Nov 2014 23:02:59 +0000 (UTC) Received: by mail-wi0-f172.google.com with SMTP id bs8so3817638wib.17 for ; Sat, 01 Nov 2014 16:02:57 -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=kBNAe7mFAqWk6LjHlN7/UKSxvPOHGhapzk+pEOEmBM0=; b=cIaLxaM7tXBOMUk8QLxMs64bgrCJR3+IPzkWpUSVS1z9sW78juWjLNxWHSWr0Mz0cX dHqQvB4pFxTIv+5kutzYfSuXvrQY6Qo18B8kuE2uTpaXYwwTp9pmJ6Tb/ZUDmiQKTGex pkaD0NiQkccskJv0aMAqEQrbz+yLFM0NT0LHf7KfVs/fKFJGOt0rzq/Xg4TQGvTMn1od vxog5vCWTyWKW9yid2APVzrflCswVLzF8I4bc2K0f9D0OUm7WVFY5WBBJSaIdbHO4WFg qVpCx8R+ytcuOhZQeH3/63t9frwnKa9f3cEgkwoEkX0SS5mOHrd9sSbgT8i8qXbY8u2f 8EfQ== MIME-Version: 1.0 X-Received: by 10.180.92.169 with SMTP id cn9mr6354588wib.26.1414882977321; Sat, 01 Nov 2014 16:02:57 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Sat, 1 Nov 2014 16:02:57 -0700 (PDT) In-Reply-To: <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> Date: Sat, 1 Nov 2014 16:02:57 -0700 X-Google-Sender-Auth: aPvGKy4Om7EkkAFLVA8zhDN2hME Message-ID: Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... From: Adrian Chadd To: Mark R V Murray Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Alexander Kabaev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 23:03:00 -0000 Here's what I have so far: # sysctl kern.random kern.random.adaptors: yarrow(90),dummy(1) kern.random.active_adaptor: yarrow kern.random.live_entropy_sources: kern.random.yarrow.gengateinterval: 10 kern.random.yarrow.bins: 10 kern.random.yarrow.fastthresh: 96 kern.random.yarrow.slowthresh: 128 kern.random.yarrow.slowoverthresh: 2 kern.random.harvest.mask: 1023 kern.random.harvest.mask_bin: 1111111111 kern.random.harvest.mask_symbolic: UMA_ALLOC,SWI,INTERRUPT,NET_NG,NET_ETHER,NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED .. that's after boot, before I run hostapd and it hangs. CPU platform: Atheros AR7161 rev 2 CPU Frequency=680 MHz CPU DDR Frequency=340 MHz CPU AHB Frequency=170 MHz platform frequency: 680 MHz CPU reference clock: 40 MHz CPU MDIO clock: 40 MHz arguments: a0 = 00000007 a1 = a3f77fb0 a2 = a3f78460 a3 = 00000008 Cmd line:argv is invalid Environment: envp is invalid Cache info: picache_stride = 4096 picache_loopcount = 16 pdcache_stride = 4096 pdcache_loopcount = 8 cpu0: MIPS Technologies processor v116.147 MMU: Standard TLB, 16 entries L1 i-cache: 4 ways of 512 sets, 32 bytes per line L1 d-cache: 4 ways of 256 sets, 32 bytes per line Config1=0x9ee3519e Config3=0x20 KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2014 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 11.0-CURRENT #12 r273952M: Sat Nov 1 15:51:09 PDT 2014 adrian@lucy-11i386:/usr/home/adrian/work/freebsd/head-embedded/obj/mips/mips.mips/usr/home/adrian/work/freebsd/head-embedded/src/sys/DIR-825B1 mips gcc version 4.2.1 20070831 patched [FreeBSD] WARNING: WITNESS option enabled, expect reduced performance. MEMGUARD DEBUGGING ALLOCATOR INITIALIZED: MEMGUARD map base: 0xc0800000 MEMGUARD map size: 104860 KBytes real memory = 67108864 (65536K bytes) avail memory = 53735424 (51MB) random device not loaded/active; using insecure pseudo-random number generator random: entropy device infrastructure driver random: random_adaptors_init random: selecting highest priority adaptor random: random_adaptor_choose - changing from NULL to Dummy random: dummy_random_init random: SOFT: yarrow init() random: selecting highest priority adaptor random: random_adaptor_choose - changing from Dummy to Yarrow random: random_harvestq_init nexus0: clock0: on nexus0 Timecounter "MIPS32" frequency 340000000 Hz quality 800 Event timer "MIPS32" frequency 340000000 Hz quality 800 random: device_attach(): feeding 4 bit(s) of entropy from clock0 apb0 at irq 4 on nexus0 uart0: <16550 or compatible> at mem 0x18020003-0x1802001a irq 3 on apb0 uart0: console (115200,n,8,1) random: device_attach(): feeding 4 bit(s) of entropy from uart0 random: device_attach(): feeding 4 bit(s) of entropy from apb0 pcib0 at irq 0 on nexus0 pcib0: ar71xx_pci_attach: missing hint 'baseslot', default to AR71XX_PCI_BASE_SLOT pcib0: found EEPROM at 0x1f661000 on 0.17.0 reg: 6000, val=29168c reg: 6008, val=2800001 reg: 602c, val=a095168c reg: 5000, val=2a168c reg: 5008, val=2800001 reg: 502c, val=a095168c reg: 5064, val=5040cc0 reg: 506c, val=33811 reg: 4004, val=40073b reg: 4074, val=3 reg: 4000, val=1c20000 reg: 6034, val=44 pcib0: EEPROM firmware: 0x1f661000 @ 4096 bytes pcib0: device EEPROM 'pcib.0.bus.0.17.0.eeprom_firmware' registered pcib0: found EEPROM at 0x1f665000 on 0.18.0 reg: 6000, val=29168c reg: 6008, val=2800001 reg: 602c, val=a094168c reg: 5000, val=2a168c reg: 5008, val=2800001 reg: 502c, val=a094168c reg: 5064, val=5040cc0 reg: 506c, val=33811 reg: 4004, val=40073b reg: 4074, val=3 reg: 4000, val=1c20000 reg: 6034, val=44 pcib0: EEPROM firmware: 0x1f665000 @ 4096 bytes pcib0: device EEPROM 'pcib.0.bus.0.18.0.eeprom_firmware' registered pci0: on pcib0 pci0: at device 17.0 (no driver attached) pci0: at device 18.0 (no driver attached) random: device_attach(): feeding 4 bit(s) of entropy from pci0 random: device_attach(): feeding 4 bit(s) of entropy from pcib0 arge0: at mem 0x19000000-0x19000fff irq 2 on nexus0 arge0: Overriding MAC from EEPROM arge0: Vendor stores MAC in ASCII format arge0: finishing attachment, phymask 0000, proxy null arge0: Ethernet address: 00:18:e7:dd:39:97 random: device_attach(): feeding 4 bit(s) of entropy from arge0 arge1: at mem 0x1a000000-0x1a000fff irq 3 on nexus0 arge1: Overriding MAC from EEPROM arge1: Vendor stores MAC in ASCII format arge1: finishing attachment, phymask 0000, proxy null arge1: Ethernet address: 00:18:e7:dd:39:98 random: device_attach(): feeding 4 bit(s) of entropy from arge1 spi0: at mem 0x1f000000-0x1f00000f on nexus0 spibus0: on spi0 mx25l0: at cs 0 on spibus0 mx25l0: m25p64, sector 65536 bytes, 128 sectors random: device_attach(): feeding 4 bit(s) of entropy from mx25l0 random: device_attach(): feeding 4 bit(s) of entropy from spibus0 random: device_attach(): feeding 4 bit(s) of entropy from spi0 ar71xx_wdog0: on nexus0 random: device_attach(): feeding 4 bit(s) of entropy from ar71xx_wdog0 random: device_attach(): feeding 4 bit(s) of entropy from nexus0 Timecounters tick every 1.000 msec map/rootfs.uncompress: GEOM_ULZMA image found map/rootfs.uncompress: 166 x 131072 blocks WARNING: WITNESS option enabled, expect reduced performance. Trying to mount root from ufs:/dev/map/rootfs.uncompress []... warning: no time-of-day clock registered, system time will not be set accurately Nov 1 22:51:16 init: login_getclass: unknown class 'daemon' *** Populating /var .. *** Loading configuration files .. *** Restoring from /dev/map/cfg .. 1+0 records in 1+0 records out 65536 bytes transferred in 1.177255 secs (55668 bytes/sec) gunzip: invalid compressed data--crc error etc/cfg/manifest etc/master.passwd etc/group etc/cfg/rc.conf etc/cfg/hostapd.wlan0.conf etc/cfg/hostapd.wlan1.conf 11 blocks *** Completed. *** setting up hostname *** Load kernel modules interface yarrow.1 already present in the KLD 'kernel'! linker_load_file: Unsupported file type kldload: an error occurred while loading the module. Please check dmesg(8) for more details. ath0: irq 0 at device 17.0 on pci0 ath0: ath_pci_attach: EEPROM firmware @ 0xc6ee6000 ath0: [HT] enabling HT modes ath0: [HT] 1 stream STBC receive enabled ath0: [HT] 1 stream STBC transmit enabled ath0: [HT] 2 RX streams; 2 TX streams ath0: AR9220 mac 128.2 RF5133 phy 13.0 ath0: 2GHz radio: 0x0000; 5GHz radio: 0x00c0 random: device_attach(): feeding 4 bit(s) of entropy from ath0 ath1: irq 1 at device 18.0 on pci0 ath1: ath_pci_attach: EEPROM firmware @ 0xc6ee9000 [ath] enabling AN_TOP2_FIXUP ath1: [HT] enabling HT modes ath1: [HT] 1 stream STBC receive enabled ath1: [HT] 1 stream STBC transmit enabled ath1: [HT] 2 RX streams; 2 TX streams ath1: AR9220 mac 128.2 RF5133 phy 13.0 ath1: 2GHz radio: 0x0000; 5GHz radio: 0x00c0 random: device_attach(): feeding 4 bit(s) of entropy from ath1 *** bringing up loopback .. *** Starting networking via /etc/rc.d/base/net dev.ath.0.txq_mcastq_maxdepth: 512 -> 32 dev.ath.1.txq_mcastq_maxdepth: 512 -> 32 *** Interface: arge0: start *** Interface: arge0: done *** Interface: arge1: start *** Interface: arge1: done *** Interface: bridge0: start bridge0: Ethernet address: de:6f:cf:39:d0:77 ifconfig: BRDGADD wlan0: No such file or directory ifconfig: BRDGADD wlan1: No such file or directory arge0: promiscuous mode enabled bridge0: link state changed to UP arge1: promiscuous mode enabled *** Interface: bridge0: done *** Default password/login databases .. *** inetd *** Done! FreeBSD/mips (freebsd-dir825) (ttyu0) login: root Password: No home directory. Logging in with home = "/". # sysctl kern.random kern.random.adaptors: yarrow(90),dummy(1) kern.random.active_adaptor: yarrow kern.random.live_entropy_sources: kern.random.yarrow.gengateinterval: 10 kern.random.yarrow.bins: 10 kern.random.yarrow.fastthresh: 96 kern.random.yarrow.slowthresh: 128 kern.random.yarrow.slowoverthresh: 2 kern.random.harvest.mask: 1023 kern.random.harvest.mask_bin: 1111111111 kern.random.harvest.mask_symbolic: UMA_ALLOC,SWI,INTERRUPT,NET_NG,NET_ETHER,NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 23:09:10 2014 Return-Path: Delivered-To: svn-src-all@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 BEF339BE; Sat, 1 Nov 2014 23:09:10 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (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 77FAF257; Sat, 1 Nov 2014 23:09:10 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XkhnB-000I21-7z; Sat, 01 Nov 2014 23:09:09 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sA1N980d088184; Sat, 1 Nov 2014 17:09:08 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+g92vZD6F+D1rf8eBfdMf6 X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... From: Ian Lepore To: Mark R V Murray In-Reply-To: <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> Content-Type: text/plain; charset="windows-1251" Date: Sat, 01 Nov 2014 17:09:08 -0600 Message-ID: <1414883348.17308.223.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by ilsoft.org id sA1N980d088184 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , Alexander Kabaev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 23:09:11 -0000 On Sat, 2014-11-01 at 22:39 +0000, Mark R V Murray wrote: > Hi >=20 > I=92m not sure what you are showing me here? >=20 > How yo you draw the =93not enough entropy=94 conclusion? >=20 > The writing happens at shutdown; before you do the shutdown could you p= lease do a =91sysctl kern.random=92 and post the result? >=20 > Do you have anything random-related in your rc.conf? >=20 > Could you please do a verbose boot on a kernel with =93options RANDOM_D= EBUG=94 set and send me the dmesg output from a failing box. >=20 > M Nothing related to random in rc.conf for me. Here's a verbose dmesg: Type '?' for a list of commands, 'help' for more detailed help. loader> set boot_verbose=3D1 loader> boot Using DTB compiled into kernel. Waiting for Ethernet connection... done. Kernel entry at 0x100100... Kernel args: (null) KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2014 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 11.0-CURRENT #1 r273952: Sat Nov 1 16:55:50 MDT 2014 ilepore@revolution.hippie.lan:/local/build/staging/freebsd/rpi/obj/arm.ar= mv6/local/build/staging/freebsd/rpi/src/sys/RPI-B-serial arm FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 Preloaded elf kernel "/boot/kernel/kernel" at 0xc066d000. CPU: ARM1176JZ-S rev 7 (ARM11J core) Supported features: ARM_ISA THUMB2 JAZELLE ARMv4 Security_Ext WB enabled LABT branch prediction enabled 16KB/32B 4-way instruction cache 16KB/32B 4-way write-back-locking-C data cache real memory =3D 134213632 (127 MB) avail memory =3D 123449344 (117 MB) Physical memory chunk(s): 0x00001000 - 0x07ffffff, 127 MB ( 32767 pages) Excluded memory regions: 0x00100000 - 0x007a4fff, 6 MB ( 1701 pages) NoAlloc=20 0x08000000 - 0x0fffffff, 128 MB ( 32768 pages) NoAlloc NoDump Static device mappings: 0x20000000 - 0x20ffffff mapped at VA 0xfef00000 random device not loaded/active; using insecure pseudo-random number generator random: entropy device infrastructure driver random: random_adaptors_init random: selecting highest priority adaptor random: random_adaptor_choose - changing from NULL to Dummy random: dummy_random_init openfirm: random: SOFT: yarrow init() random: selecting highest priority adaptor random: random_adaptor_choose - changing from Dummy to Yarrow random: random_harvestq_init mem: nfslock: pseudo-device null: random: device_attach(): feeding 4 bit(s) of entropy from nexus0 ofwbus0: simplebus0: mem 0x20000000-0x20ffffff on ofwbus0 random: device_attach(): feeding 4 bit(s) of entropy from simplebus0 random: device_attach(): feeding 4 bit(s) of entropy from ofwbus0 ofwbus0: type unknown (no driver attached) intc0: mem 0xb200-0xb3ff on simplebus0 random: device_attach(): feeding 4 bit(s) of entropy from intc0 systimer0: mem 0x3000-0x3fff irq 8,9,10,11 on simplebus0 Event timer "BCM2835 Event Timer 3" frequency 1000000 Hz quality 1000 Timecounter "BCM2835 Timecounter" frequency 1000000 Hz quality 1000 random: device_attach(): feeding 4 bit(s) of entropy from systimer0 simplebus0: mem 0xb400-0xb423 irq 0 compat broadcom,bcm2835-sp804 (no driver attached) bcmwd0: mem 0x10001c-0x100027 on simplebus0 random: device_attach(): feeding 4 bit(s) of entropy from bcmwd0 gpio0: mem 0x200000-0x2000af irq 57,59,58,60 on simplebus0 gpio0: read-only pins: 46,47,48,49,50,51,52,53. gpio0: reserved pins: 48,49,50,51,52,53. gpioc0: on gpio0 random: device_attach(): feeding 4 bit(s) of entropy from gpioc0 gpiobus0: on gpio0 gpioled0: at pin(s) 16 on gpiobus0 random: device_attach(): feeding 4 bit(s) of entropy from gpioled0 random: device_attach(): feeding 4 bit(s) of entropy from gpiobus0 random: device_attach(): feeding 4 bit(s) of entropy from gpio0 simplebus0: mem 0x205000-0x20501f irq 61 compat broadcom,bcm2835-bsc (no driver attached) simplebus0: mem 0x804000-0x80401f irq 61 compat broadcom,bcm2835-bsc (no driver attached) simplebus0: mem 0x204000-0x20401f irq 62 compat broadcom,bcm2835-spi (no driver attached) bcm_dma0: mem 0x7000-0x7fff,0xe05000-0xe05fff irq 24,25,26,27,28,29,30,31,32,33,34,35,36 on simplebus0 random: device_attach(): feeding 4 bit(s) of entropy from bcm_dma0 mbox0: mem 0xb880-0xb8bf irq 1 on simplebus0 random: device_attach(): feeding 4 bit(s) of entropy from mbox0 sdhci_bcm0: mem 0x300000-0x3000ff irq 70 on simplebus0 sdhci_bcm0-slot0: 50MHz HS 4bits 3.3V 1.8V PIO sdhci_bcm0-slot0: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D REGISTER DUM= P =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D sdhci_bcm0-slot0: Sys addr: 0x00000000 | Version: 0x00009902 sdhci_bcm0-slot0: Blk size: 0x00000000 | Blk cnt: 0x00000000 sdhci_bcm0-slot0: Argument: 0x00000000 | Trn mode: 0x00000000 sdhci_bcm0-slot0: Present: 0x01ff0000 | Host ctl: 0x00000000 sdhci_bcm0-slot0: Power: 0x00000000 | Blk gap: 0x00000000 sdhci_bcm0-slot0: Wake-up: 0x00000000 | Clock: 0x00000000 sdhci_bcm0-slot0: Timeout: 0x00000000 | Int stat: 0x00000000 sdhci_bcm0-slot0: Int enab: 0x01ff00fb | Sig enab: 0x01ff00fb sdhci_bcm0-slot0: AC12 err: 0x00000000 | Slot int: 0x00000000 sdhci_bcm0-slot0: Caps: 0x00000000 | Max curr: 0x00000001 sdhci_bcm0-slot0: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D mmc0: on sdhci_bcm0 random: device_attach(): feeding 4 bit(s) of entropy from mmc0 random: device_attach(): feeding 4 bit(s) of entropy from sdhci_bcm0 uart0: mem 0x201000-0x201fff irq 65 on simplebus0 uart0: console (115200,n,8,1) uart0: fast interrupt random: device_attach(): feeding 4 bit(s) of entropy from uart0 simplebus0: mem 0xb800-0xb84f irq 2 compat broadcom,bcm2835-vchiq (no driver attached) dwcotg0: mem 0x980000-0x99ffff irq 17 on simplebus0 usbus0 on dwcotg0 dwcotg0: usbpf: Attached random: device_attach(): feeding 4 bit(s) of entropy from usbus0 random: device_attach(): feeding 4 bit(s) of entropy from dwcotg0 ofwbus0: type unknown (no driver attached) ofwbus0: type unknown (no driver attached) ofwbus0: type unknown (no driver attached) ofwbus0: type unknown (no driver attached) Timecounters tick every 10.000 msec tcp_init: net.inet.tcp.tcbhashsize auto tuned to 1024 lo0: bpf attached sdhci_bcm0-slot0: Divider 63 for freq 396825 (max 50000000) mmc0: Probing bus usbus0: 480Mbps High Speed USB v2.0 mmc0: SD 2.0 interface conditions: OK mmc0: SD probe: OK (OCR: 0x00ff8000) mmc0: Current OCR: 0x00ff8000 ugen0.1: at usbus0 uhub0: on usbus0 mmc0: Probing cards mmc0: New card detected (CID 02544d5341303847049cce24e3009a00) mmc0: New card detected (CSD 400e00325b5900003b677f800a400000) mmc0: Card at relative address 0x1234 added: mmc0: card: SDHC SA08G 0.4 SN 9CCE24E3 MFG 10/2009 by 2 TM mmc0: bus: 4bit, 50MHz, high speed timing mmc0: memory: 15572992 blocks, erase sector 8192 blocks mmc0: setting transfer rate to 50.000MHz (high speed timing) sdhci_bcm0-slot0: Divider 0 for freq 50000000 (max 50000000) mmcsd0: 8GB at mmc0 50.0MHz/4bit/65535-block random: device_attach(): feeding 4 bit(s) of entropy from mmcsd0 bootpc_init: wired to interface 'ue0' GEOM: new disk mmcsd0 mmc0: setting bus width to 4 bits mmcsd0: Error indicated: 2 Bad CRC uhub_attach: Turning port 1 power on uhub0: 1 port with 1 removable, self powered random: device_attach(): feeding 4 bit(s) of entropy from uhub0 ugen0.2: at usbus0 uhub1: on usbus0 uhub1: MTT enabled uhub_attach: Turning port 1 power on uhub_attach: Turning port 2 power on uhub_attach: Turning port 3 power on uhub1: 3 ports with 2 removable, self powered random: device_attach(): feeding 4 bit(s) of entropy from uhub1 ugen0.3: at usbus0 smsc0: on usbus0 random: device_attach(): feeding 4 bit(s) of entropy from smsc0 smsc0: chip 0xec00, rev. 0002 miibus0: on smsc0 ukphy0: PHY 1 on miibus0 ukphy0: OUI 0x00800f, model 0x000c, rev. 3 ukphy0: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto random: device_attach(): feeding 4 bit(s) of entropy from ukphy0 random: device_attach(): feeding 4 bit(s) of entropy from miibus0 ue0: on smsc0 ue0: bpf attached ue0: Ethernet address: f6:00:e5:4b:c0:fb smsc0: chip 0xec00, rev. 0002 ue0: link state changed to DOWN Sending DHCP Discover packet from interface ue0 (f6:00:e5:4b:c0:fb) ue0: link state changed to UP Received DHCP Offer packet on ue0 from 0.0.0.0 (accepted) Sending DHCP Request packet from interface ue0 (f6:00:e5:4b:c0:fb) Received DHCP Ack packet on ue0 from 0.0.0.0 (accepted) ue0 at 172.22.42.29 server 0.0.0.0 subnet mask 255.255.255.0 router 172.22.42.254 rootfs 172.22.42.240:/rpi=20 Adjusted interface ue0 Trying to mount root from nfs:172.22.42.240:/rpi [ro,noatime]... NFS ROOT: 172.22.42.240:/rpi warning: no time-of-day clock registered, system time will not be set accurately warning: no time-of-day clock registered, system time will not be set accurately start_init: trying /sbin/init Interface ue0 IP-Address 172.22.42.29 Broadcast 172.22.42.255=20 Setting hostuuid: 1d295353-1dd2-11b2-9f30-653cd80a9fc4. Setting hostid: 0x2896f513. No suitable dump device was found. Starting file system checks: mount_nfs: can't update /var/db/mounttab for 172.22.42.240:/rpi Mounting local file systems:. Writing entropy file: It hangs forever here. If I break into the debugger it's in cpu_idle(). -- Ian From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 23:24:20 2014 Return-Path: Delivered-To: svn-src-all@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 F2EECE20; Sat, 1 Nov 2014 23:24:19 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id AC6AD5F5; Sat, 1 Nov 2014 23:24:19 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id CC083A58B; Sat, 1 Nov 2014 23:24:18 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 47CBD10ABE; Sun, 2 Nov 2014 00:24:21 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Ian Lepore Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> <1414882185.17308.221.camel@revolution.hippie.lan> Date: Sun, 02 Nov 2014 00:24:21 +0100 In-Reply-To: <1414882185.17308.221.camel@revolution.hippie.lan> (Ian Lepore's message of "Sat, 01 Nov 2014 16:49:45 -0600") Message-ID: <86r3xm5wt6.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Mark R V Murray , Alexander Kabaev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 23:24:20 -0000 Ian Lepore writes: > Mark R V Murray writes: > > The writing happens at shutdown; before you do the shutdown could > > you please do a =E2=80=98sysctl kern.random=E2=80=99 and post the resul= t? > I'm not sure where you're getting "at shutdown" from. >From the code. This is a portion of the rc script that only runs at shutdown. If random_stop() runs during boot, something is seriously wrong *somewhere else* and you are welcome to help find out what. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 23:33:27 2014 Return-Path: Delivered-To: svn-src-all@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 2E6FFFA0; Sat, 1 Nov 2014 23:33:27 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id DC5B26AF; Sat, 1 Nov 2014 23:33:26 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 0AC3DA595; Sat, 1 Nov 2014 23:33:26 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id AF8BD10AC2; Sun, 2 Nov 2014 00:33:27 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Ian Lepore Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> <1414882185.17308.221.camel@revolution.hippie.lan> <86r3xm5wt6.fsf@nine.des.no> Date: Sun, 02 Nov 2014 00:33:27 +0100 In-Reply-To: <86r3xm5wt6.fsf@nine.des.no> ("Dag-Erling =?utf-8?Q?Sm=C3=B8r?= =?utf-8?Q?grav=22's?= message of "Sun, 02 Nov 2014 00:24:21 +0100") Message-ID: <86mw8a5we0.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Mark R V Murray , Alexander Kabaev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 23:33:27 -0000 Dag-Erling Sm=C3=B8rgrav writes: > From the code. This is a portion of the rc script that only runs at > shutdown. If random_stop() runs during boot, something is seriously > wrong *somewhere else* and you are welcome to help find out what. I found it - postrandom triggers it. For now, just remove /etc/rc.d/postrandom (I'm not sure it's really needed, there are better ways to do this). DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 23:35:04 2014 Return-Path: Delivered-To: svn-src-all@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 F015716B; Sat, 1 Nov 2014 23:35:03 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (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 BAFA16B4; Sat, 1 Nov 2014 23:35:03 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XkiC8-000KQR-AN; Sat, 01 Nov 2014 23:34:56 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sA1NYsI6088214; Sat, 1 Nov 2014 17:34:54 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX180Odeh89Ia+JmcTnUGcxPg X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... From: Ian Lepore To: Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?= In-Reply-To: <86r3xm5wt6.fsf@nine.des.no> References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> <1414882185.17308.221.camel@revolution.hippie.lan> <86r3xm5wt6.fsf@nine.des.no> Content-Type: text/plain; charset="iso-2022-jp" Date: Sat, 01 Nov 2014 17:34:54 -0600 Message-ID: <1414884894.17308.229.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Mark R V Murray , Alexander Kabaev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 23:35:04 -0000 On Sun, 2014-11-02 at 00:24 +0100, Dag-Erling Smrgrav wrote: > Ian Lepore writes: > > Mark R V Murray writes: > > > The writing happens at shutdown; before you do the shutdown could > > > you please do a $B!F(Bsysctl kern.random$B!G(B and post the result? > > I'm not sure where you're getting "at shutdown" from. > > From the code. This is a portion of the rc script that only runs at > shutdown. If random_stop() runs during boot, something is seriously > wrong *somewhere else* and you are welcome to help find out what. > > DES Well that took all of 90 seconds... In rc.d/random we have: extra_commands="saveseed" saveseed_cmd="${name}_stop" and in rc.d/postrandom we have: postrandom_start() { /etc/rc.d/random fastsaveseed ... and so it tries to write an entropy file at startup and hangs, presumably because /dev/random hasn't been sufficiently fed to generate that much random output? -- Ian From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 23:42:17 2014 Return-Path: Delivered-To: svn-src-all@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 385FA32E; Sat, 1 Nov 2014 23:42:17 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id E70E97C9; Sat, 1 Nov 2014 23:42:16 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 8F07DA5AB; Sat, 1 Nov 2014 23:42:15 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 095E510AC4; Sun, 2 Nov 2014 00:42:18 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Ian Lepore Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> <1414882185.17308.221.camel@revolution.hippie.lan> <86r3xm5wt6.fsf@nine.des.no> <1414884894.17308.229.camel@revolution.hippie.lan> Date: Sun, 02 Nov 2014 00:42:17 +0100 In-Reply-To: <1414884894.17308.229.camel@revolution.hippie.lan> (Ian Lepore's message of "Sat, 01 Nov 2014 17:34:54 -0600") Message-ID: <86ioiy5vza.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Mark R V Murray , Alexander Kabaev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 23:42:17 -0000 Ian Lepore writes: > and so it tries to write an entropy file at startup and hangs, > presumably because /dev/random hasn't been sufficiently fed to > generate that much random output? That's problem #2, /dev/random *should* be unblocked by then. BTW, there is no such thing as being "sufficiently fed to generate that much random output". Yarrow doesn't work that way. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 23:44:11 2014 Return-Path: Delivered-To: svn-src-all@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 8F1DF478; Sat, 1 Nov 2014 23:44:11 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (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 58BD47D3; Sat, 1 Nov 2014 23:44:10 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XkiL4-000EnE-1r; Sat, 01 Nov 2014 23:44:10 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sA1Ni88m088239; Sat, 1 Nov 2014 17:44:08 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/JBjgXZsncOZnMBkx1DFOa X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... From: Ian Lepore To: Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?= In-Reply-To: <86mw8a5we0.fsf@nine.des.no> References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> <1414882185.17308.221.camel@revolution.hippie.lan> <86r3xm5wt6.fsf@nine.des.no> <86mw8a5we0.fsf@nine.des.no> Content-Type: text/plain; charset="ISO-8859-1" Date: Sat, 01 Nov 2014 17:44:08 -0600 Message-ID: <1414885448.17308.236.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by ilsoft.org id sA1Ni88m088239 Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Mark R V Murray , Alexander Kabaev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 23:44:11 -0000 On Sun, 2014-11-02 at 00:33 +0100, Dag-Erling Sm=F8rgrav wrote: > Dag-Erling Sm=F8rgrav writes: > > From the code. This is a portion of the rc script that only runs at > > shutdown. If random_stop() runs during boot, something is seriously > > wrong *somewhere else* and you are welcome to help find out what. >=20 > I found it - postrandom triggers it. For now, just remove > /etc/rc.d/postrandom (I'm not sure it's really needed, there are better > ways to do this). >=20 > DES Yeah. I vaguely remember discussion about this something like 12-18 months ago. As I remember it, there was a desire to avoid using the same startup saved entropy on a rapid series of reboots and the thinking was to combat that by generating some fresh saved entropy on each boot. It seems like that should work if the old saved entropy were stirred in with the modicum of boot-time entropy before generating a new save file. Hmmm, but what if there is no saved entropy? Maybe that's what's happening here, given that a freshly created varmfs is involved. I was thinking maybe postrandom should only try to save a new file if there are some existing files to avoid the possibility of hanging. But when I look at postrandom more closely, it seems to be generating a save file, then deleting it along with all the other save files. -- Ian From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 23:57:15 2014 Return-Path: Delivered-To: svn-src-all@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 509AF620; Sat, 1 Nov 2014 23:57:15 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (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 1A65F89A; Sat, 1 Nov 2014 23:57:14 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XkiXh-000NBp-4r; Sat, 01 Nov 2014 23:57:13 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sA1NvBwc088262; Sat, 1 Nov 2014 17:57:11 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18Wb+tbfa4wR6OWKjShkWOV X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... From: Ian Lepore To: Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?= In-Reply-To: <86mw8a5we0.fsf@nine.des.no> References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> <1414882185.17308.221.camel@revolution.hippie.lan> <86r3xm5wt6.fsf@nine.des.no> <86mw8a5we0.fsf@nine.des.no> Content-Type: text/plain; charset="ISO-8859-1" Date: Sat, 01 Nov 2014 17:57:11 -0600 Message-ID: <1414886231.17308.238.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by ilsoft.org id sA1NvBwc088262 Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Mark R V Murray , Alexander Kabaev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 23:57:15 -0000 On Sun, 2014-11-02 at 00:33 +0100, Dag-Erling Sm=F8rgrav wrote: > Dag-Erling Sm=F8rgrav writes: > > From the code. This is a portion of the rc script that only runs at > > shutdown. If random_stop() runs during boot, something is seriously > > wrong *somewhere else* and you are welcome to help find out what. >=20 > I found it - postrandom triggers it. For now, just remove > /etc/rc.d/postrandom (I'm not sure it's really needed, there are better > ways to do this). >=20 > DES It appears another quick easy workaround is to set entropy_file=3DNO in rc.conf, which may be the right thing to do for people using a varmfs that isn't going to survive a reboot anyway, even after this glitch is fixed. -- Ian