From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 03:51:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2E7535C3; Sun, 21 Jul 2013 03:51:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1FA66A8; Sun, 21 Jul 2013 03:51:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6L3pO0a056825; Sun, 21 Jul 2013 03:51:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6L3pOQv056824; Sun, 21 Jul 2013 03:51:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307210351.r6L3pOQv056824@svn.freebsd.org> From: Adrian Chadd Date: Sun, 21 Jul 2013 03:51:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253507 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 03:51:25 -0000 Author: adrian Date: Sun Jul 21 03:51:24 2013 New Revision: 253507 URL: http://svnweb.freebsd.org/changeset/base/253507 Log: Add two new CPU specific definitions - the watchdog clock frequency and the UART clock frequency. The AR933x and AR934x have separate PLL settings for these. Modified: head/sys/mips/atheros/ar71xx_cpudef.h Modified: head/sys/mips/atheros/ar71xx_cpudef.h ============================================================================== --- head/sys/mips/atheros/ar71xx_cpudef.h Sat Jul 20 22:35:32 2013 (r253506) +++ head/sys/mips/atheros/ar71xx_cpudef.h Sun Jul 21 03:51:24 2013 (r253507) @@ -121,10 +121,14 @@ extern uint32_t u_ar71xx_refclk; extern uint32_t u_ar71xx_cpu_freq; extern uint32_t u_ar71xx_ahb_freq; extern uint32_t u_ar71xx_ddr_freq; +extern uint32_t u_ar71xx_uart_freq; +extern uint32_t u_ar71xx_wdt_freq; static inline uint64_t ar71xx_refclk(void) { return u_ar71xx_refclk; } static inline uint64_t ar71xx_cpu_freq(void) { return u_ar71xx_cpu_freq; } static inline uint64_t ar71xx_ahb_freq(void) { return u_ar71xx_ahb_freq; } static inline uint64_t ar71xx_ddr_freq(void) { return u_ar71xx_ddr_freq; } - +static inline uint64_t ar71xx_uart_freq(void) { return u_ar71xx_uart_freq; } +static inline uint64_t ar71xx_wdt_freq(void) { return u_ar71xx_wdt_freq; } + #endif From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 03:52:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3F218735; Sun, 21 Jul 2013 03:52:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 21268D3; Sun, 21 Jul 2013 03:52:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6L3qrRJ057023; Sun, 21 Jul 2013 03:52:53 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6L3qqRS057016; Sun, 21 Jul 2013 03:52:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307210352.r6L3qqRS057016@svn.freebsd.org> From: Adrian Chadd Date: Sun, 21 Jul 2013 03:52:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253508 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 03:52:53 -0000 Author: adrian Date: Sun Jul 21 03:52:52 2013 New Revision: 253508 URL: http://svnweb.freebsd.org/changeset/base/253508 Log: Initialise the watchdog and UART frequencies. For all pre-AR933x chips, the frequency is just the APB frequency. For the AR933x, the UART frequency is different but we just hacked around it. For the AR934x, there's a different PLL setting for these, so they have to be broken out. Modified: head/sys/mips/atheros/ar71xx_chip.c head/sys/mips/atheros/ar724x_chip.c head/sys/mips/atheros/ar91xx_chip.c head/sys/mips/atheros/ar933x_chip.c Modified: head/sys/mips/atheros/ar71xx_chip.c ============================================================================== --- head/sys/mips/atheros/ar71xx_chip.c Sun Jul 21 03:51:24 2013 (r253507) +++ head/sys/mips/atheros/ar71xx_chip.c Sun Jul 21 03:52:52 2013 (r253508) @@ -78,6 +78,8 @@ __FBSDID("$FreeBSD$"); uint32_t u_ar71xx_cpu_freq; uint32_t u_ar71xx_ahb_freq; uint32_t u_ar71xx_ddr_freq; +uint32_t u_ar71xx_uart_freq; +uint32_t u_ar71xx_wdt_freq; uint32_t u_ar71xx_refclk; static void @@ -107,6 +109,8 @@ ar71xx_chip_detect_sys_frequency(void) div = (((pll >> AR71XX_AHB_DIV_SHIFT) & AR71XX_AHB_DIV_MASK) + 1) * 2; u_ar71xx_ahb_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_wdt_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_uart_freq = u_ar71xx_cpu_freq / div; } /* Modified: head/sys/mips/atheros/ar724x_chip.c ============================================================================== --- head/sys/mips/atheros/ar724x_chip.c Sun Jul 21 03:51:24 2013 (r253507) +++ head/sys/mips/atheros/ar724x_chip.c Sun Jul 21 03:52:52 2013 (r253508) @@ -90,6 +90,8 @@ ar724x_chip_detect_sys_frequency(void) div = (((pll >> AR724X_AHB_DIV_SHIFT) & AR724X_AHB_DIV_MASK) + 1) * 2; u_ar71xx_ahb_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_wdt_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_uart_freq = u_ar71xx_cpu_freq / div; } static void Modified: head/sys/mips/atheros/ar91xx_chip.c ============================================================================== --- head/sys/mips/atheros/ar91xx_chip.c Sun Jul 21 03:51:24 2013 (r253507) +++ head/sys/mips/atheros/ar91xx_chip.c Sun Jul 21 03:52:52 2013 (r253508) @@ -84,6 +84,8 @@ ar91xx_chip_detect_sys_frequency(void) div = (((pll >> AR91XX_AHB_DIV_SHIFT) & AR91XX_AHB_DIV_MASK) + 1) * 2; u_ar71xx_ahb_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_uart_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_wdt_freq = u_ar71xx_cpu_freq / div; } static void Modified: head/sys/mips/atheros/ar933x_chip.c ============================================================================== --- head/sys/mips/atheros/ar933x_chip.c Sun Jul 21 03:51:24 2013 (r253507) +++ head/sys/mips/atheros/ar933x_chip.c Sun Jul 21 03:52:52 2013 (r253508) @@ -114,6 +114,10 @@ ar933x_chip_detect_sys_frequency(void) AR933X_PLL_CLOCK_CTRL_AHB_DIV_MASK) + 1; u_ar71xx_ahb_freq = freq / t; } + + /* XXX uart should be the refclk, no? */ + u_ar71xx_uart_freq = u_ar71xx_ahb_freq; + u_ar71xx_wdt_freq = u_ar71xx_ahb_freq; } static void From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 03:54:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 32A92875; Sun, 21 Jul 2013 03:54:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0A44DDC; Sun, 21 Jul 2013 03:54:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6L3seIY057259; Sun, 21 Jul 2013 03:54:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6L3sesJ057255; Sun, 21 Jul 2013 03:54:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307210354.r6L3sesJ057255@svn.freebsd.org> From: Adrian Chadd Date: Sun, 21 Jul 2013 03:54:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253509 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 03:54:41 -0000 Author: adrian Date: Sun Jul 21 03:54:39 2013 New Revision: 253509 URL: http://svnweb.freebsd.org/changeset/base/253509 Log: Use the UART frequency when programming the UART clock. This allows the 16550 support to work correctly on the upcoming AR934x support. Modified: head/sys/mips/atheros/uart_bus_ar71xx.c head/sys/mips/atheros/uart_bus_ar933x.c head/sys/mips/atheros/uart_cpu_ar71xx.c head/sys/mips/atheros/uart_cpu_ar933x.c Modified: head/sys/mips/atheros/uart_bus_ar71xx.c ============================================================================== --- head/sys/mips/atheros/uart_bus_ar71xx.c Sun Jul 21 03:52:52 2013 (r253508) +++ head/sys/mips/atheros/uart_bus_ar71xx.c Sun Jul 21 03:54:39 2013 (r253509) @@ -70,7 +70,7 @@ uart_ar71xx_probe(device_t dev) struct uart_softc *sc; uint64_t freq; - freq = ar71xx_ahb_freq(); + freq = ar71xx_uart_freq(); sc = device_get_softc(dev); sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs); Modified: head/sys/mips/atheros/uart_bus_ar933x.c ============================================================================== --- head/sys/mips/atheros/uart_bus_ar933x.c Sun Jul 21 03:52:52 2013 (r253508) +++ head/sys/mips/atheros/uart_bus_ar933x.c Sun Jul 21 03:54:39 2013 (r253509) @@ -72,7 +72,7 @@ uart_ar933x_probe(device_t dev) struct uart_softc *sc; uint64_t freq; - freq = ar71xx_refclk(); + freq = ar71xx_uart_freq(); sc = device_get_softc(dev); sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs); Modified: head/sys/mips/atheros/uart_cpu_ar71xx.c ============================================================================== --- head/sys/mips/atheros/uart_cpu_ar71xx.c Sun Jul 21 03:52:52 2013 (r253508) +++ head/sys/mips/atheros/uart_cpu_ar71xx.c Sun Jul 21 03:54:39 2013 (r253509) @@ -56,7 +56,7 @@ uart_cpu_getdev(int devtype, struct uart { uint64_t freq; - freq = ar71xx_ahb_freq(); + freq = ar71xx_uart_freq(); di->ops = uart_getops(&uart_ns8250_class); di->bas.chan = 0; Modified: head/sys/mips/atheros/uart_cpu_ar933x.c ============================================================================== --- head/sys/mips/atheros/uart_cpu_ar933x.c Sun Jul 21 03:52:52 2013 (r253508) +++ head/sys/mips/atheros/uart_cpu_ar933x.c Sun Jul 21 03:54:39 2013 (r253509) @@ -58,7 +58,7 @@ uart_cpu_getdev(int devtype, struct uart { uint64_t freq; - freq = ar71xx_refclk(); + freq = ar71xx_uart_freq(); di->ops = uart_getops(&uart_ar933x_class); di->bas.chan = 0; From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 03:55:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3C2799B1; Sun, 21 Jul 2013 03:55:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2E869E6; Sun, 21 Jul 2013 03:55:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6L3tJNO057438; Sun, 21 Jul 2013 03:55:19 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6L3tJZS057437; Sun, 21 Jul 2013 03:55:19 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307210355.r6L3tJZS057437@svn.freebsd.org> From: Adrian Chadd Date: Sun, 21 Jul 2013 03:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253510 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 03:55:19 -0000 Author: adrian Date: Sun Jul 21 03:55:18 2013 New Revision: 253510 URL: http://svnweb.freebsd.org/changeset/base/253510 Log: Teach the GPIO code about the AR934x GPIO register and pin counts. Modified: head/sys/mips/atheros/ar71xx_gpio.c Modified: head/sys/mips/atheros/ar71xx_gpio.c ============================================================================== --- head/sys/mips/atheros/ar71xx_gpio.c Sun Jul 21 03:54:39 2013 (r253509) +++ head/sys/mips/atheros/ar71xx_gpio.c Sun Jul 21 03:55:18 2013 (r253510) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "gpio_if.h" @@ -90,13 +91,23 @@ static int ar71xx_gpio_pin_toggle(device static void ar71xx_gpio_function_enable(struct ar71xx_gpio_softc *sc, uint32_t mask) { - GPIO_SET_BITS(sc, AR71XX_GPIO_FUNCTION, mask); + if (ar71xx_soc == AR71XX_SOC_AR9341 || + ar71xx_soc == AR71XX_SOC_AR9342 || + ar71xx_soc == AR71XX_SOC_AR9344) + GPIO_SET_BITS(sc, AR934X_GPIO_REG_FUNC, mask); + else + GPIO_SET_BITS(sc, AR71XX_GPIO_FUNCTION, mask); } static void ar71xx_gpio_function_disable(struct ar71xx_gpio_softc *sc, uint32_t mask) { - GPIO_CLEAR_BITS(sc, AR71XX_GPIO_FUNCTION, mask); + if (ar71xx_soc == AR71XX_SOC_AR9341 || + ar71xx_soc == AR71XX_SOC_AR9342 || + ar71xx_soc == AR71XX_SOC_AR9344) + GPIO_CLEAR_BITS(sc, AR934X_GPIO_REG_FUNC, mask); + else + GPIO_CLEAR_BITS(sc, AR71XX_GPIO_FUNCTION, mask); } static void @@ -141,6 +152,10 @@ ar71xx_gpio_pin_max(device_t dev, int *m case AR71XX_SOC_AR9331: *maxpin = AR933X_GPIO_COUNT - 1; break; + case AR71XX_SOC_AR9341: + case AR71XX_SOC_AR9342: + case AR71XX_SOC_AR9344: + *maxpin = AR934X_GPIO_COUNT - 1; default: *maxpin = AR71XX_GPIO_PINS - 1; } From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 03:56:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 35A33AF4; Sun, 21 Jul 2013 03:56:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 267DAEF; Sun, 21 Jul 2013 03:56:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6L3uwkI057652; Sun, 21 Jul 2013 03:56:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6L3uvS2057648; Sun, 21 Jul 2013 03:56:57 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307210356.r6L3uvS2057648@svn.freebsd.org> From: Adrian Chadd Date: Sun, 21 Jul 2013 03:56:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253511 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 03:56:58 -0000 Author: adrian Date: Sun Jul 21 03:56:57 2013 New Revision: 253511 URL: http://svnweb.freebsd.org/changeset/base/253511 Log: Implement some initial AR934x support routines. This code reads the PLL configuration registers and correctly programs things so the UART and such can come up. There's MIPS74k platform issues that need fixing; but this at least brings things up enough to echo stuff out the serial port and allow for interactive debugging with ddb. Tested: * AR71xx SoCs * AR933x SoC * AR9344 board (DB120) Obtained from: Qualcomm Atheros; Linux/OpenWRT Added: head/sys/mips/atheros/ar934x_chip.c (contents, props changed) head/sys/mips/atheros/ar934x_chip.h (contents, props changed) Modified: head/sys/mips/atheros/ar71xx_setup.c head/sys/mips/atheros/files.ar71xx Modified: head/sys/mips/atheros/ar71xx_setup.c ============================================================================== --- head/sys/mips/atheros/ar71xx_setup.c Sun Jul 21 03:55:18 2013 (r253510) +++ head/sys/mips/atheros/ar71xx_setup.c Sun Jul 21 03:56:57 2013 (r253511) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include @@ -62,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define AR71XX_SYS_TYPE_LEN 128 @@ -158,6 +160,30 @@ ar71xx_detect_sys_type(void) ar71xx_cpu_ops = &ar933x_chip_def; break; + case REV_ID_MAJOR_AR9341: + minor = 0; + rev = (id & AR934X_REV_ID_REVISION_MASK); + chip = "9341"; + ar71xx_soc = AR71XX_SOC_AR9341; + ar71xx_cpu_ops = &ar934x_chip_def; + break; + + case REV_ID_MAJOR_AR9342: + minor = 0; + rev = (id & AR934X_REV_ID_REVISION_MASK); + chip = "9342"; + ar71xx_soc = AR71XX_SOC_AR9342; + ar71xx_cpu_ops = &ar934x_chip_def; + break; + + case REV_ID_MAJOR_AR9344: + minor = 0; + rev = (id & AR934X_REV_ID_REVISION_MASK); + chip = "9344"; + ar71xx_soc = AR71XX_SOC_AR9344; + ar71xx_cpu_ops = &ar934x_chip_def; + break; + default: panic("ar71xx: unknown chip id:0x%08x\n", id); } Added: head/sys/mips/atheros/ar934x_chip.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/atheros/ar934x_chip.c Sun Jul 21 03:56:57 2013 (r253511) @@ -0,0 +1,333 @@ +/*- + * Copyright (c) 2013 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_ddb.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +static void +ar934x_chip_detect_mem_size(void) +{ +} + +static uint32_t +ar934x_get_pll_freq(uint32_t ref, uint32_t ref_div, uint32_t nint, + uint32_t nfrac, uint32_t frac, uint32_t out_div) +{ + uint64_t t; + uint32_t ret; + + t = u_ar71xx_refclk; + t *= nint; + t = t / ref_div; + ret = t; + + t = u_ar71xx_refclk; + t *= nfrac; + t = t / (ref_div * frac); + ret += t; + + ret /= (1 << out_div); + return (ret); +} + +static void +ar934x_chip_detect_sys_frequency(void) +{ + uint32_t pll, out_div, ref_div, nint, nfrac, frac, clk_ctrl, postdiv; + uint32_t cpu_pll, ddr_pll; + uint32_t bootstrap; + + bootstrap = ATH_READ_REG(AR934X_RESET_REG_BOOTSTRAP); + if (bootstrap & AR934X_BOOTSTRAP_REF_CLK_40) + u_ar71xx_refclk = 40 * 1000 * 1000; + else + u_ar71xx_refclk = 25 * 1000 * 1000; + + pll = ATH_READ_REG(AR934X_SRIF_CPU_DPLL2_REG); + if (pll & AR934X_SRIF_DPLL2_LOCAL_PLL) { + out_div = (pll >> AR934X_SRIF_DPLL2_OUTDIV_SHIFT) & + AR934X_SRIF_DPLL2_OUTDIV_MASK; + pll = ATH_READ_REG(AR934X_SRIF_CPU_DPLL1_REG); + nint = (pll >> AR934X_SRIF_DPLL1_NINT_SHIFT) & + AR934X_SRIF_DPLL1_NINT_MASK; + nfrac = pll & AR934X_SRIF_DPLL1_NFRAC_MASK; + ref_div = (pll >> AR934X_SRIF_DPLL1_REFDIV_SHIFT) & + AR934X_SRIF_DPLL1_REFDIV_MASK; + frac = 1 << 18; + } else { + pll = ATH_READ_REG(AR934X_PLL_CPU_CONFIG_REG); + out_div = (pll >> AR934X_PLL_CPU_CONFIG_OUTDIV_SHIFT) & + AR934X_PLL_CPU_CONFIG_OUTDIV_MASK; + ref_div = (pll >> AR934X_PLL_CPU_CONFIG_REFDIV_SHIFT) & + AR934X_PLL_CPU_CONFIG_REFDIV_MASK; + nint = (pll >> AR934X_PLL_CPU_CONFIG_NINT_SHIFT) & + AR934X_PLL_CPU_CONFIG_NINT_MASK; + nfrac = (pll >> AR934X_PLL_CPU_CONFIG_NFRAC_SHIFT) & + AR934X_PLL_CPU_CONFIG_NFRAC_MASK; + frac = 1 << 6; + } + + cpu_pll = ar934x_get_pll_freq(u_ar71xx_refclk, ref_div, nint, + nfrac, frac, out_div); + + pll = ATH_READ_REG(AR934X_SRIF_DDR_DPLL2_REG); + if (pll & AR934X_SRIF_DPLL2_LOCAL_PLL) { + out_div = (pll >> AR934X_SRIF_DPLL2_OUTDIV_SHIFT) & + AR934X_SRIF_DPLL2_OUTDIV_MASK; + pll = ATH_READ_REG(AR934X_SRIF_DDR_DPLL1_REG); + nint = (pll >> AR934X_SRIF_DPLL1_NINT_SHIFT) & + AR934X_SRIF_DPLL1_NINT_MASK; + nfrac = pll & AR934X_SRIF_DPLL1_NFRAC_MASK; + ref_div = (pll >> AR934X_SRIF_DPLL1_REFDIV_SHIFT) & + AR934X_SRIF_DPLL1_REFDIV_MASK; + frac = 1 << 18; + } else { + pll = ATH_READ_REG(AR934X_PLL_DDR_CONFIG_REG); + out_div = (pll >> AR934X_PLL_DDR_CONFIG_OUTDIV_SHIFT) & + AR934X_PLL_DDR_CONFIG_OUTDIV_MASK; + ref_div = (pll >> AR934X_PLL_DDR_CONFIG_REFDIV_SHIFT) & + AR934X_PLL_DDR_CONFIG_REFDIV_MASK; + nint = (pll >> AR934X_PLL_DDR_CONFIG_NINT_SHIFT) & + AR934X_PLL_DDR_CONFIG_NINT_MASK; + nfrac = (pll >> AR934X_PLL_DDR_CONFIG_NFRAC_SHIFT) & + AR934X_PLL_DDR_CONFIG_NFRAC_MASK; + frac = 1 << 10; + } + + ddr_pll = ar934x_get_pll_freq(u_ar71xx_refclk, ref_div, nint, + nfrac, frac, out_div); + + clk_ctrl = ATH_READ_REG(AR934X_PLL_CPU_DDR_CLK_CTRL_REG); + + postdiv = (clk_ctrl >> AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_POST_DIV_SHIFT) & + AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_POST_DIV_MASK; + + if (clk_ctrl & AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_PLL_BYPASS) + u_ar71xx_cpu_freq = u_ar71xx_refclk; + else if (clk_ctrl & AR934X_PLL_CPU_DDR_CLK_CTRL_CPUCLK_FROM_CPUPLL) + u_ar71xx_cpu_freq = cpu_pll / (postdiv + 1); + else + u_ar71xx_cpu_freq = ddr_pll / (postdiv + 1); + + postdiv = (clk_ctrl >> AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_POST_DIV_SHIFT) & + AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_POST_DIV_MASK; + + if (clk_ctrl & AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_PLL_BYPASS) + u_ar71xx_ddr_freq = u_ar71xx_refclk; + else if (clk_ctrl & AR934X_PLL_CPU_DDR_CLK_CTRL_DDRCLK_FROM_DDRPLL) + u_ar71xx_ddr_freq = ddr_pll / (postdiv + 1); + else + u_ar71xx_ddr_freq = cpu_pll / (postdiv + 1); + + postdiv = (clk_ctrl >> AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_POST_DIV_SHIFT) & + AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_POST_DIV_MASK; + + if (clk_ctrl & AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_PLL_BYPASS) + u_ar71xx_ahb_freq = u_ar71xx_refclk; + else if (clk_ctrl & AR934X_PLL_CPU_DDR_CLK_CTRL_AHBCLK_FROM_DDRPLL) + u_ar71xx_ahb_freq = ddr_pll / (postdiv + 1); + else + u_ar71xx_ahb_freq = cpu_pll / (postdiv + 1); + + u_ar71xx_wdt_freq = u_ar71xx_refclk; + u_ar71xx_uart_freq = u_ar71xx_refclk; +} + +static void +ar934x_chip_device_stop(uint32_t mask) +{ + uint32_t reg; + + reg = ATH_READ_REG(AR934X_RESET_REG_RESET_MODULE); + ATH_WRITE_REG(AR934X_RESET_REG_RESET_MODULE, reg | mask); +} + +static void +ar934x_chip_device_start(uint32_t mask) +{ + uint32_t reg; + + reg = ATH_READ_REG(AR934X_RESET_REG_RESET_MODULE); + ATH_WRITE_REG(AR934X_RESET_REG_RESET_MODULE, reg & ~mask); +} + +static int +ar934x_chip_device_stopped(uint32_t mask) +{ + uint32_t reg; + + reg = ATH_READ_REG(AR934X_RESET_REG_RESET_MODULE); + return ((reg & mask) == mask); +} + +static void +ar934x_chip_set_mii_speed(uint32_t unit, uint32_t speed) +{ + + /* XXX TODO */ + return; +} + +/* + * XXX TODO !! + */ +static void +ar934x_chip_set_pll_ge(int unit, int speed, uint32_t pll) +{ + + switch (unit) { + case 0: + /* XXX TODO */ + break; + case 1: + /* XXX TODO */ + break; + default: + printf("%s: invalid PLL set for arge unit: %d\n", + __func__, unit); + return; + } +} + +static void +ar934x_chip_ddr_flush_ge(int unit) +{ + + switch (unit) { + case 0: + ar71xx_ddr_flush(AR934X_DDR_REG_FLUSH_GE0); + break; + case 1: + ar71xx_ddr_flush(AR934X_DDR_REG_FLUSH_GE1); + break; + default: + printf("%s: invalid DDR flush for arge unit: %d\n", + __func__, unit); + return; + } +} + +static void +ar934x_chip_ddr_flush_ip2(void) +{ + + ar71xx_ddr_flush(AR934X_DDR_REG_FLUSH_WMAC); +} + +static uint32_t +ar934x_chip_get_eth_pll(unsigned int mac, int speed) +{ +#if 0 + uint32_t pll; + + switch (speed) { + case 10: + pll = AR933X_PLL_VAL_10; + break; + case 100: + pll = AR933X_PLL_VAL_100; + break; + case 1000: + pll = AR933X_PLL_VAL_1000; + break; + default: + printf("%s%d: invalid speed %d\n", __func__, mac, speed); + pll = 0; + } + return (pll); +#endif + return (0); +} + +static void +ar934x_chip_init_usb_peripheral(void) +{ + uint32_t reg; + + reg = ATH_READ_REG(AR934X_RESET_REG_BOOTSTRAP); + if (reg & AR934X_BOOTSTRAP_USB_MODE_DEVICE) + return; + + ar71xx_device_stop(AR934X_RESET_USBSUS_OVERRIDE); + DELAY(100); + + ar71xx_device_start(AR934X_RESET_USB_PHY); + DELAY(100); + + ar71xx_device_start(AR934X_RESET_USB_PHY_ANALOG); + DELAY(100); + + ar71xx_device_start(AR934X_RESET_USB_HOST); + DELAY(100); +} + +struct ar71xx_cpu_def ar934x_chip_def = { + &ar934x_chip_detect_mem_size, + &ar934x_chip_detect_sys_frequency, + &ar934x_chip_device_stop, + &ar934x_chip_device_start, + &ar934x_chip_device_stopped, + &ar934x_chip_set_pll_ge, + &ar934x_chip_set_mii_speed, + &ar71xx_chip_set_mii_if, + &ar934x_chip_ddr_flush_ge, + &ar934x_chip_get_eth_pll, + &ar934x_chip_ddr_flush_ip2, + &ar934x_chip_init_usb_peripheral +}; Added: head/sys/mips/atheros/ar934x_chip.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/atheros/ar934x_chip.h Sun Jul 21 03:56:57 2013 (r253511) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2013 Adrian Chadd + * 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 __AR934X_CHIP_H__ +#define __AR934X_CHIP_H__ + +extern struct ar71xx_cpu_def ar934x_chip_def; + +#endif Modified: head/sys/mips/atheros/files.ar71xx ============================================================================== --- head/sys/mips/atheros/files.ar71xx Sun Jul 21 03:55:18 2013 (r253510) +++ head/sys/mips/atheros/files.ar71xx Sun Jul 21 03:56:57 2013 (r253511) @@ -25,6 +25,7 @@ mips/atheros/ar71xx_chip.c standard mips/atheros/ar724x_chip.c standard mips/atheros/ar91xx_chip.c standard mips/atheros/ar933x_chip.c standard +mips/atheros/ar934x_chip.c standard mips/atheros/ar71xx_fixup.c optional ar71xx_ath_eeprom dev/hwpmc/hwpmc_mips24k.c optional hwpmc_mips24k From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 04:00:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D1C12C4B; Sun, 21 Jul 2013 04:00:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B2F85106; Sun, 21 Jul 2013 04:00:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6L40n8o059820; Sun, 21 Jul 2013 04:00:49 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6L40mXC059815; Sun, 21 Jul 2013 04:00:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307210400.r6L40mXC059815@svn.freebsd.org> From: Adrian Chadd Date: Sun, 21 Jul 2013 04:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253512 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 04:00:49 -0000 Author: adrian Date: Sun Jul 21 04:00:48 2013 New Revision: 253512 URL: http://svnweb.freebsd.org/changeset/base/253512 Log: Add some initial board support for the AR934x and the Qualcomm Atheros DB120 development board. The AR934x SoCs are a MIPS74k based system with increased RAM addressing space, some scratch-pad RAM, an improved gige switch PHY and 2x2 or 3x3 on-board dual-band wifi. This support isn't complete by any stretch; it's just enough to bring the board up for others to tinker with. Notably, the MIPS74k support is broken. However it boots enough to echo some basic probe/attach messages, before dying somewhere in the TLB code. Thankyou to Qualcomm Atheros for their continued support of me doing open source work with their hardware. Tested: * AR9344, mips74k Added: head/sys/mips/conf/AR934X_BASE (contents, props changed) head/sys/mips/conf/AR934X_BASE.hints (contents, props changed) head/sys/mips/conf/DB120 (contents, props changed) head/sys/mips/conf/DB120.hints (contents, props changed) Added: head/sys/mips/conf/AR934X_BASE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/AR934X_BASE Sun Jul 21 04:00:48 2013 (r253512) @@ -0,0 +1,124 @@ +# +# AR91XX -- Kernel configuration base file for the Atheros AR913x SoC. +# +# This file (and the hints file accompanying it) are not designed to be +# used by themselves. Instead, users of this file should create a kernel +# config file which includes this file (which gets the basic hints), then +# override the default options (adding devices as needed) and adding +# hints as needed (for example, the GPIO and LAN PHY.) +# +# $FreeBSD$ +# + +machine mips mips +ident AR934X_BASE +cpu CPU_MIPS4KC +makeoptions KERNLOADADDR=0x80050000 +options HZ=1000 + +files "../atheros/files.ar71xx" +hints "AR934X_BASE.hints" + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +# makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_ahb hwpmc" +makeoptions MODULES_OVERRIDE="" + +options DDB +options KDB +options ALQ + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +#options INET6 #InterNETworking +#options NFSCL #Network Filesystem Client +options PSEUDOFS #Pseudo-filesystem framework +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions + +# Don't include the SCSI/CAM strings in the default build +options SCSI_NO_SENSE_STRINGS +options SCSI_NO_OP_STRINGS + +# .. And no sysctl strings +options NO_SYSCTL_DESCR + +# Limit IO size +options NBUF=128 + +# Limit UMTX hash size +# options UMTX_NUM_CHAINS=64 + +# PMC +#options HWPMC_HOOKS +#device hwpmc +#device hwpmc_mips24k + +# options NFS_LEGACYRPC +# Debugging for use in -current +#options INVARIANTS +#options INVARIANT_SUPPORT +#options WITNESS +#options WITNESS_SKIPSPIN +options FFS #Berkeley Fast Filesystem +#options SOFTUPDATES #Enable FFS soft updates support +#options UFS_ACL #Support for access control lists +#options UFS_DIRHASH #Improve performance on big directories +options NO_FFS_SNAPSHOT # We don't require snapshot support + +# Wireless NIC cards +options IEEE80211_DEBUG +options IEEE80211_SUPPORT_MESH +options IEEE80211_SUPPORT_TDMA +options IEEE80211_SUPPORT_SUPERG +options IEEE80211_ALQ # 802.11 ALQ logging support +device wlan # 802.11 support +device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support +device wlan_xauth # 802.11 hostap support + +# ath(4) +device ath # Atheros network device +device ath_rate_sample +device ath_ahb # Atheros host bus glue +options ATH_DEBUG +options ATH_DIAGAPI +option ATH_ENABLE_11N +option AH_DEBUG_ALQ + +#device ath_hal +device ath_ar9300 # AR9330 HAL; no need for the others +option AH_DEBUG +option AH_SUPPORT_AR5416 # 11n HAL support +option AH_SUPPORT_AR9340 # Chipset support +option AH_DEBUG_ALQ +option AH_AR5416_INTERRUPT_MITIGATION + +device mii +device arge + +device usb +options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order +options USB_DEBUG +options USB_HOST_ALIGN=32 # AR71XX (MIPS in general?) requires this +device ehci + +device scbus +device umass +device da + +device spibus +device ar71xx_spi +device mx25l +device ar71xx_wdog + +device uart +device uart_ar71xx + +device loop +device ether +device md +device bpf +device random +device if_bridge +device gpio +device gpioled Added: head/sys/mips/conf/AR934X_BASE.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/AR934X_BASE.hints Sun Jul 21 04:00:48 2013 (r253512) @@ -0,0 +1,61 @@ +# This file (and the kernel config file accompanying it) are not designed +# to be used by themselves. Instead, users of this file should create a +# kernel # config file which includes this file (which gets the basic hints), +# then override the default options (adding devices as needed) and adding +# hints as needed (for example, the GPIO and LAN PHY.) + +# $FreeBSD$ + +hint.apb.0.at="nexus0" +hint.apb.0.irq=4 + +# uart0 +hint.uart.0.at="apb0" +# NB: This isn't an ns8250 UART +hint.uart.0.maddr=0x18020003 +hint.uart.0.msize=0x18 +hint.uart.0.irq=3 + +#ehci - note the 0x100 offset for the AR913x/AR724x +hint.ehci.0.at="nexus0" +hint.ehci.0.maddr=0x1b000100 +hint.ehci.0.msize=0x00001000 +hint.ehci.0.irq=1 + +hint.arge.0.at="nexus0" +hint.arge.0.maddr=0x19000000 +hint.arge.0.msize=0x1000 +hint.arge.0.irq=2 + +hint.arge.1.at="nexus0" +hint.arge.1.maddr=0x1a000000 +hint.arge.1.msize=0x1000 +hint.arge.1.irq=3 + +# XXX The ath device hangs off of the AHB, rather than the Nexus. +hint.ath.0.at="nexus0" +hint.ath.0.maddr=0x18100000 +hint.ath.0.msize=0x20000 +hint.ath.0.irq=0 +hint.ath.0.vendor_id=0x168c +hint.ath.0.device_id=0x0031 +# Set this to define where the ath calibration data +# should be fetched from in physical memory. +# hint.ath.0.eepromaddr=0x1fff1000 + +# SPI flash +hint.spi.0.at="nexus0" +hint.spi.0.maddr=0x1f000000 +hint.spi.0.msize=0x10 + +hint.mx25l.0.at="spibus0" +hint.mx25l.0.cs=0 + +# Watchdog +hint.ar71xx_wdog.0.at="nexus0" + +# The GPIO function and pin mask is configured per-board +hint.gpio.0.at="apb0" +hint.gpio.0.maddr=0x18040000 +hint.gpio.0.msize=0x1000 +hint.gpio.0.irq=2 Added: head/sys/mips/conf/DB120 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/DB120 Sun Jul 21 04:00:48 2013 (r253512) @@ -0,0 +1,46 @@ +# +# DB120 - the AR9344 SoC reference design +# +# $FreeBSD$ +# + +# Include the default AR934x parameters +include "AR934X_BASE" + +ident DB120 + +# Override hints with board values +hints "DB120.hints" + +# Force the board memory - the base DB120 has 128MB RAM +options AR71XX_REALMEM=(32*1024*1024) + +# i2c GPIO bus +#device gpioiic +#device iicbb +#device iicbus +#device iic + +# Options required for miiproxy and mdiobus +options ARGE_MDIO # Export an MDIO bus separate from arge +device miiproxy # MDIO bus <-> MII PHY rendezvous + +device etherswitch +device arswitch + +# read MSDOS formatted disks - USB +#options MSDOSFS + +# Enable the uboot environment stuff rather then the +# redboot stuff. +options AR71XX_ENV_UBOOT + +# uzip - to boot natively from flash +device geom_uncompress +options GEOM_UNCOMPRESS + +# Used for the static uboot partition map +device geom_map + +# Boot off of the rootfs, as defined in the geom_map setup. +options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" Added: head/sys/mips/conf/DB120.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/DB120.hints Sun Jul 21 04:00:48 2013 (r253512) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +# This is a placeholder until the hardware support is complete. From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 05:23:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C6995658; Sun, 21 Jul 2013 05:23:34 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B13FD295; Sun, 21 Jul 2013 05:23:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6L5NYwK084680; Sun, 21 Jul 2013 05:23:34 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6L5NYqh084679; Sun, 21 Jul 2013 05:23:34 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201307210523.r6L5NYqh084679@svn.freebsd.org> From: Glen Barber Date: Sun, 21 Jul 2013 05:23:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253513 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 05:23:34 -0000 Author: gjb Date: Sun Jul 21 05:23:34 2013 New Revision: 253513 URL: http://svnweb.freebsd.org/changeset/base/253513 Log: Create memstick images with the '.img' filename extension. Requested by: many Approved by: kib (mentor) MFC after: 3 days X-MFC-To: stable/9 only Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Sun Jul 21 04:00:48 2013 (r253512) +++ head/release/Makefile Sun Jul 21 05:23:34 2013 (r253513) @@ -4,7 +4,7 @@ # # User-driven targets: # cdrom: Builds release CD-ROM media (release.iso) -# memstick: Builds memory stick image (memstick) +# memstick: Builds memory stick image (memstick.img) # ftp: Sets up FTP distribution area (ftp) # release: Build all media and FTP distribution area # install: Copies all release media into ${DESTDIR} @@ -73,8 +73,8 @@ RELEASE_TARGETS+= cdrom IMAGES+= release.iso bootonly.iso .endif .if exists(${.CURDIR}/${TARGET}/make-memstick.sh) -RELEASE_TARGETS+= memstick -IMAGES+= memstick +RELEASE_TARGETS+= memstick.img +IMAGES+= memstick.img .endif .include @@ -167,7 +167,8 @@ release.iso: system bootonly.iso: bootonly sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.TARGET} bootonly -memstick: system +memstick: memstick.img +memstick.img: system sh ${.CURDIR}/${TARGET}/make-memstick.sh release ${.TARGET} packagesystem: base.txz kernel.txz ${EXTRA_PACKAGES} @@ -191,7 +192,7 @@ clean: rm -f *.txz MANIFEST rm -f system rm -rf release bootonly - rm -f release.iso bootonly.iso memstick + rm -f release.iso bootonly.iso memstick.img install: .if defined(DESTDIR) && !empty(DESTDIR) From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 06:59:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 71969723; Sun, 21 Jul 2013 06:59:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6567477B; Sun, 21 Jul 2013 06:59:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6L6xvaM012362; Sun, 21 Jul 2013 06:59:57 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6L6xvHX012361; Sun, 21 Jul 2013 06:59:57 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201307210659.r6L6xvHX012361@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 21 Jul 2013 06:59:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253514 - head/lib/libfetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 06:59:57 -0000 Author: des Date: Sun Jul 21 06:59:56 2013 New Revision: 253514 URL: http://svnweb.freebsd.org/changeset/base/253514 Log: Use the correct request syntax for proxied (tunneled) HTTPS requests. PR: bin/180666 MFC after: 3 days Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Sun Jul 21 05:23:34 2013 (r253513) +++ head/lib/libfetch/http.c Sun Jul 21 06:59:56 2013 (r253514) @@ -1581,7 +1581,7 @@ http_request(struct url *URL, const char if (verbose) fetch_info("requesting %s://%s%s", url->scheme, host, url->doc); - if (purl) { + if (purl && strcasecmp(URL->scheme, SCHEME_HTTPS) != 0) { http_cmd(conn, "%s %s://%s%s HTTP/1.1", op, url->scheme, host, url->doc); } else { From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 07:24:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A5FC4D88; Sun, 21 Jul 2013 07:24:26 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7E0C786C; Sun, 21 Jul 2013 07:24:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6L7OQ7c021119; Sun, 21 Jul 2013 07:24:26 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6L7OQOC021118; Sun, 21 Jul 2013 07:24:26 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201307210724.r6L7OQOC021118@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 21 Jul 2013 07:24:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253515 - head/usr.bin/fetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 07:24:26 -0000 Author: des Date: Sun Jul 21 07:24:25 2013 New Revision: 253515 URL: http://svnweb.freebsd.org/changeset/base/253515 Log: mdoc nit Modified: head/usr.bin/fetch/fetch.1 Modified: head/usr.bin/fetch/fetch.1 ============================================================================== --- head/usr.bin/fetch/fetch.1 Sun Jul 21 06:59:56 2013 (r253514) +++ head/usr.bin/fetch/fetch.1 Sun Jul 21 07:24:25 2013 (r253515) @@ -249,7 +249,8 @@ for a description of additional environm .Ev HTTP_REFERER , .Ev HTTP_USER_AGENT , .Ev NETRC , -.Ev NO_PROXY No and +.Ev NO_PROXY +and .Ev no_proxy . .Sh EXIT STATUS The From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 08:05:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5DA4F575; Sun, 21 Jul 2013 08:05:04 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from mail.made4.biz (unknown [IPv6:2001:41d0:1:7018::1:3]) by mx1.freebsd.org (Postfix) with ESMTP id 294C59FF; Sun, 21 Jul 2013 08:05:04 +0000 (UTC) Received: from 141.7.19.93.rev.sfr.net ([93.19.7.141] helo=[192.168.1.176]) by mail.made4.biz with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1V0odb-000G6K-2s; Sun, 21 Jul 2013 10:05:03 +0200 Message-ID: <51EB962E.3090405@FreeBSD.org> Date: Sun, 21 Jul 2013 10:05:02 +0200 From: =?ISO-8859-1?Q?Jean-S=E9bastien_P=E9dron?= User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Neel Natu Subject: Re: svn commit: r252646 - head/sys/amd64/amd64 References: <201307032321.r63NLP3w059509@svn.freebsd.org> <51EABABD.8050906@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, neel@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 08:05:04 -0000 Le 20/07/2013 20:26, Neel Natu a écrit : > I would start looking by looking at the value of the page table entry > in question (this would be 'tpte' in pmap_remove_pages()). > > In particular, it would be useful to identify whether this is pointing > to a superpage mapping and if so what page within the superpage is > triggering the "vm_page_dirty: page is invalid" panic. Here's what was logged by your patch: va = 0x8007da000 tpte = 0x80000000d2f834f7 m->phys_addr = 0xd2eaf000 m->valid = 0 m->dirty= 0 m->flags = 4, aflags = 0, oflags = 0 panic: vm_page_dirty: page is invalid! So it corresponds to page m[175] in the superpage. I don't know if it helps but I checked the remaining pages: they all have '->valid = 0', except a few ones (265 to 267, 345, 361 to 363, 379 to 387 and 425 to 431 have '->valid = VM_PAGE_BITS_ALL'). -- Jean-Sébastien Pédron From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 11:59:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 57A59ACA; Sun, 21 Jul 2013 11:59:42 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 394EB6E7; Sun, 21 Jul 2013 11:59:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LBxfiA001976; Sun, 21 Jul 2013 11:59:41 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LBxfMd001975; Sun, 21 Jul 2013 11:59:41 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201307211159.r6LBxfMd001975@svn.freebsd.org> From: Hiroki Sato Date: Sun, 21 Jul 2013 11:59:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253517 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 11:59:42 -0000 Author: hrs Date: Sun Jul 21 11:59:41 2013 New Revision: 253517 URL: http://svnweb.freebsd.org/changeset/base/253517 Log: - Fix nflag in routename(). - Display a AF_LINK address in #linkN when sdl_{nlen,alen,slen) == 0 and sdl_index != 0. - Reduce unnecessary loop in pmsg_addrs(). - Remove iso_ntoa(). This is not used. Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Sun Jul 21 10:48:50 2013 (r253516) +++ head/sbin/route/route.c Sun Jul 21 11:59:41 2013 (r253517) @@ -120,7 +120,6 @@ static void set_metric(char *, int); static int set_sofib(int); static void sockaddr(char *, struct sockaddr *, size_t); static void sodump(struct sockaddr *, const char *); -extern char *iso_ntoa(void); struct fibl { TAILQ_ENTRY(fibl) fl_next; @@ -493,6 +492,7 @@ retry: const char * routename(struct sockaddr *sa) { + struct sockaddr_dl *sdl; const char *cp; static char line[MAXHOSTNAMELEN + 1]; #ifdef INET @@ -523,7 +523,7 @@ routename(struct sockaddr *sa) cp = NULL; if (in.s_addr == INADDR_ANY && nflag == 0) return ("default"); - if (nflag != 0) { + if (nflag == 0) { hp = gethostbyaddr((char *)&in, sizeof (struct in_addr), AF_INET); if (hp != NULL) { @@ -574,7 +574,18 @@ routename(struct sockaddr *sa) break; case AF_LINK: - return (link_ntoa((struct sockaddr_dl *)(void *)sa)); + sdl = (struct sockaddr_dl *)(void *)sa; + + if (sdl->sdl_nlen == 0 && + sdl->sdl_alen == 0 && + sdl->sdl_slen == 0) { + n = snprintf(line, sizeof(line), "link#%d", + sdl->sdl_index); + if (n > (int)sizeof(line)) + line[0] = '\0'; + return (line); + } else + return (link_ntoa(sdl)); break; default: @@ -602,6 +613,7 @@ routename(struct sockaddr *sa) const char * netname(struct sockaddr *sa) { + struct sockaddr_dl *sdl; static char line[MAXHOSTNAMELEN + 1]; int n; #ifdef INET @@ -670,7 +682,18 @@ netname(struct sockaddr *sa) break; case AF_LINK: - return (link_ntoa((struct sockaddr_dl *)(void *)sa)); + sdl = (struct sockaddr_dl *)(void *)sa; + + if (sdl->sdl_nlen == 0 && + sdl->sdl_alen == 0 && + sdl->sdl_slen == 0) { + n = snprintf(line, sizeof(line), "link#%d", + sdl->sdl_index); + if (n > (int)sizeof(line)) + line[0] = '\0'; + return (line); + } else + return (link_ntoa(sdl)); break; default: @@ -1560,7 +1583,7 @@ print_rtmsg(struct rt_msghdr *rtm, size_ rtm->rtm_version); return; } - if (rtm->rtm_type < sizeof(msgtypes) / sizeof(msgtypes[0])) + if (rtm->rtm_type < nitems(msgtypes)) (void)printf("%s: ", msgtypes[rtm->rtm_type]); else (void)printf("unknown type %d: ", rtm->rtm_type); @@ -1660,6 +1683,7 @@ print_getmsg(struct rt_msghdr *rtm, int if (rtm->rtm_msglen > msglen) { warnx("message length mismatch, in packet %d, returned %d", rtm->rtm_msglen, msglen); + return; } if (rtm->rtm_errno) { errno = rtm->rtm_errno; @@ -1696,9 +1720,8 @@ print_getmsg(struct rt_msghdr *rtm, int #define lock(f) ((rtm->rtm_rmx.rmx_locks & __CONCAT(RTV_,f)) ? 'L' : ' ') #define msec(u) (((u) + 500) / 1000) /* usec to msec */ - - printf("\n%s\n", "\ - recvpipe sendpipe ssthresh rtt,msec mtu weight expire"); + printf("\n%9s %9s %9s %9s %9s %10s %9s\n", "recvpipe", + "sendpipe", "ssthresh", "rtt,msec", "mtu ", "weight", "expire"); printf("%8ld%c ", rtm->rtm_rmx.rmx_recvpipe, lock(RPIPE)); printf("%8ld%c ", rtm->rtm_rmx.rmx_sendpipe, lock(SPIPE)); printf("%8ld%c ", rtm->rtm_rmx.rmx_ssthresh, lock(SSTHRESH)); @@ -1749,8 +1772,8 @@ pmsg_addrs(char *cp, int addrs, size_t l (void)printf("\nsockaddrs: "); printb(addrs, addrnames); putchar('\n'); - for (i = 1; i != 0; i <<= 1) - if (i & addrs) { + for (i = 0; i < RTAX_MAX; i++) + if (addrs & (1 << i)) { sa = (struct sockaddr *)cp; if (len == 0 || len < SA_SIZE(sa)) { (void)printf(errfmt, __func__, len); From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 12:47:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 43CF3641; Sun, 21 Jul 2013 12:47:34 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 363EC9D0; Sun, 21 Jul 2013 12:47:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LClYAt016961; Sun, 21 Jul 2013 12:47:34 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LClYvj016960; Sun, 21 Jul 2013 12:47:34 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201307211247.r6LClYvj016960@svn.freebsd.org> From: Andrew Turner Date: Sun, 21 Jul 2013 12:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253518 - head/lib/libc/arm/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 12:47:34 -0000 Author: andrew Date: Sun Jul 21 12:47:33 2013 New Revision: 253518 URL: http://svnweb.freebsd.org/changeset/base/253518 Log: Teach siglongjmp about the VFP version of the setjmp buffer. This fixes a bug where a call to sigsetjmp followed by siglongjmp may fail when run on a machine with VFP enabled. Modified: head/lib/libc/arm/gen/sigsetjmp.S Modified: head/lib/libc/arm/gen/sigsetjmp.S ============================================================================== --- head/lib/libc/arm/gen/sigsetjmp.S Sun Jul 21 11:59:41 2013 (r253517) +++ head/lib/libc/arm/gen/sigsetjmp.S Sun Jul 21 12:47:33 2013 (r253518) @@ -57,8 +57,10 @@ ENTRY(sigsetjmp) WEAK_ALIAS(__siglongjmp, siglongjmp) ENTRY(siglongjmp) - ldr r2, .L_setjmp_magic - ldr r3, [r0] - teq r2, r3 + ldr r2, .L_setjmp_magic /* load magic */ + ldr r3, [r0] /* get magic from jmp_buf */ + bic r3, r3, #(_JB_MAGIC__SETJMP ^ _JB_MAGIC__SETJMP_VFP) + /* ignore VFP-ness of magic */ + teq r2, r3 /* magic correct? */ beq PIC_SYM(_C_LABEL(_longjmp), PLT) b PIC_SYM(_C_LABEL(longjmp), PLT) From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 13:39:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 10F26687; Sun, 21 Jul 2013 13:39:16 +0000 (UTC) Date: Sun, 21 Jul 2013 13:39:16 +0000 From: Alexey Dokuchaev To: Glen Barber Subject: Re: svn commit: r253513 - head/release Message-ID: <20130721133915.GA36573@FreeBSD.org> References: <201307210523.r6L5NYqh084679@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201307210523.r6L5NYqh084679@svn.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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 13:39:16 -0000 On Sun, Jul 21, 2013 at 05:23:34AM +0000, Glen Barber wrote: > New Revision: 253513 > URL: http://svnweb.freebsd.org/changeset/base/253513 > > Log: > Create memstick images with the '.img' filename extension. > > Requested by: many > [...] Is there any work being done to merge the .iso and .img into single, hybrid bootable image (c.g. Haiku)? I've asked this question before, but I cannot recall now what was the outcome if it... ./danfe From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 14:27:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 03DB3B3B; Sun, 21 Jul 2013 14:27:08 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EA349FF4; Sun, 21 Jul 2013 14:27:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LER7i2048227; Sun, 21 Jul 2013 14:27:07 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LER7gk048225; Sun, 21 Jul 2013 14:27:07 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201307211427.r6LER7gk048225@svn.freebsd.org> From: Hiroki Sato Date: Sun, 21 Jul 2013 14:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253519 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 14:27:08 -0000 Author: hrs Date: Sun Jul 21 14:27:07 2013 New Revision: 253519 URL: http://svnweb.freebsd.org/changeset/base/253519 Log: - Use getnameinfo() for both of AF_INET and AF_INET6 in routename(). - Add missing "static". Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Sun Jul 21 12:47:33 2013 (r253518) +++ head/sbin/route/route.c Sun Jul 21 14:27:07 2013 (r253519) @@ -135,7 +135,7 @@ static int fiboptlist_range(const char * static void usage(const char *) __dead2; -void +static void usage(const char *cp) { if (cp != NULL) @@ -489,15 +489,12 @@ retry: return (error); } -const char * +static const char * routename(struct sockaddr *sa) { struct sockaddr_dl *sdl; const char *cp; - static char line[MAXHOSTNAMELEN + 1]; -#ifdef INET - struct hostent *hp; -#endif + static char line[NI_MAXHOST]; static char domain[MAXHOSTNAMELEN + 1]; static int first = 1, n; @@ -511,63 +508,71 @@ routename(struct sockaddr *sa) domain[0] = '\0'; } + /* If the address is zero-filled, use "default". */ if (sa->sa_len == 0 && nflag == 0) return ("default"); +#if defined(INET) || defined(INET6) switch (sa->sa_family) { #ifdef INET case AF_INET: - { - struct in_addr in; - - in = ((struct sockaddr_in *)(void *)sa)->sin_addr; - cp = NULL; - if (in.s_addr == INADDR_ANY && nflag == 0) - return ("default"); - if (nflag == 0) { - hp = gethostbyaddr((char *)&in, sizeof (struct in_addr), - AF_INET); - if (hp != NULL) { - char *cptr; - cptr = strchr(hp->h_name, '.'); - if (cptr != NULL && - strcmp(cptr + 1, domain) == 0) - *cptr = '\0'; - cp = hp->h_name; - } - } - if (cp != NULL) { - strncpy(line, cp, sizeof(line) - 1); - line[sizeof(line) - 1] = '\0'; - } else - (void)sprintf(line, "%s", inet_ntoa(in)); + /* If the address is zero-filled, use "default". */ + if (nflag == 0 && + ((struct sockaddr_in *)(void *)sa)->sin_addr.s_addr == + INADDR_ANY) + return("default"); break; - } - #endif #ifdef INET6 case AF_INET6: - { - struct sockaddr_in6 sin6; /* use static var for safety */ - int niflags = 0; - - /* Check if the address is ::. If true, use "default". */ + /* If the address is zero-filled, use "default". */ if (nflag == 0 && IN6_IS_ADDR_UNSPECIFIED(&((struct sockaddr_in6 *)(void *)sa)->sin6_addr)) return("default"); - memset(&sin6, 0, sizeof(sin6)); - memcpy(&sin6, sa, sa->sa_len); - sin6.sin6_len = sizeof(struct sockaddr_in6); - sin6.sin6_family = AF_INET6; - if (nflag) - niflags |= NI_NUMERICHOST; - if (getnameinfo((struct sockaddr *)&sin6, sin6.sin6_len, - line, sizeof(line), NULL, 0, niflags) != 0) + break; +#endif + } +#endif + + switch (sa->sa_family) { +#if defined(INET) || defined(INET6) +#ifdef INET + case AF_INET: +#endif +#ifdef INET6 + case AF_INET6: +#endif + { + struct sockaddr_storage ss; + int error; + char *p; + + memset(&ss, 0, sizeof(ss)); + if (sa->sa_len == 0) + ss.ss_family = sa->sa_family; + else + memcpy(&ss, sa, sa->sa_len); + /* Expand sa->sa_len because it could be shortened. */ + if (sa->sa_family == AF_INET) + ss.ss_len = sizeof(struct sockaddr_in); + else if (sa->sa_family == AF_INET6) + ss.ss_len = sizeof(struct sockaddr_in6); + error = getnameinfo((struct sockaddr *)&ss, ss.ss_len, + line, sizeof(line), NULL, 0, + (nflag == 0) ? 0 : NI_NUMERICHOST); + if (error) { + warnx("getnameinfo(): %s", gai_strerror(error)); strncpy(line, "invalid", sizeof(line)); + } + + /* Remove the domain part if any. */ + p = strchr(line, '.'); + if (p != NULL && strcmp(p + 1, domain) == 0) + *p = '\0'; return (line); + break; } #endif - case AF_APPLETALK: (void)snprintf(line, sizeof(line), "atalk %s", atalk_ntoa(((struct sockaddr_at *)(void *)sa)->sat_addr)); @@ -610,7 +615,7 @@ routename(struct sockaddr *sa) * Return the name of the network whose address is given. * The address is assumed to be that of a net, not a host. */ -const char * +static const char * netname(struct sockaddr *sa) { struct sockaddr_dl *sdl; @@ -1153,6 +1158,9 @@ getaddr(int idx, char *str, struct hoste aflen = sizeof(struct sockaddr_dl); #endif } +#ifndef INET + hpp = NULL; +#endif rtm_addrs |= (1 << idx); if (idx > RTAX_MAX) From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 15:26:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0A338D33; Sun, 21 Jul 2013 15:26:26 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F1BEE3E0; Sun, 21 Jul 2013 15:26:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LFQP6a066799; Sun, 21 Jul 2013 15:26:25 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LFQPXY066798; Sun, 21 Jul 2013 15:26:25 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201307211526.r6LFQPXY066798@svn.freebsd.org> From: Hiroki Sato Date: Sun, 21 Jul 2013 15:26:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253520 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 15:26:26 -0000 Author: hrs Date: Sun Jul 21 15:26:25 2013 New Revision: 253520 URL: http://svnweb.freebsd.org/changeset/base/253520 Log: Do not set ND6_IFF_ACCEPT_RTADV on if_bridge(4) interfaces when ipv6_enable=yes. MFC after: 3 days Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Sun Jul 21 14:27:07 2013 (r253519) +++ head/etc/network.subr Sun Jul 21 15:26:25 2013 (r253520) @@ -113,9 +113,18 @@ ifconfig_up() # backward compatibility: $ipv6_enable case $ipv6_enable in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) - if ! checkyesno ipv6_gateway_enable; then - _ipv6_opts="${_ipv6_opts} accept_rtadv" - fi + case $1 in + bridge[0-9]*) + # No accept_rtadv by default on if_bridge(4) + # to avoid a conflict with the member + # interfaces. + ;; + *) + if ! checkyesno ipv6_gateway_enable; then + _ipv6_opts="${_ipv6_opts} accept_rtadv" + fi + ;; + esac ;; esac @@ -550,9 +559,18 @@ ipv6_autoconfif() [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) if checkyesno ipv6_gateway_enable; then return 1 - else - return 0 fi + case $1 in + bridge[0-9]*) + # No accept_rtadv by default on if_bridge(4) + # to avoid a conflict with the member + # interfaces. + return 1 + ;; + *) + return 0 + ;; + esac ;; esac From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 16:17:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 82E0AB02; Sun, 21 Jul 2013 16:17:37 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id 49F258B6; Sun, 21 Jul 2013 16:17:36 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.17]) by ltcfislmsgpa06.fnfis.com (8.14.5/8.14.5) with ESMTP id r6LGHSnx002205 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sun, 21 Jul 2013 11:17:28 -0500 Received: from LTCFISWMSGMB21.FNFIS.com ([10.132.99.23]) by LTCFISWMSGHT06.FNFIS.com ([10.132.206.17]) with mapi id 14.02.0309.002; Sun, 21 Jul 2013 11:17:27 -0500 From: "Teske, Devin" To: Alexey Dokuchaev Subject: Re: svn commit: r253513 - head/release Thread-Topic: svn commit: r253513 - head/release Thread-Index: AQHOhdJ2FlUUZwfcZkq9aC0Vc2SteZlvd48AgAAsMQA= Date: Sun, 21 Jul 2013 16:17:26 +0000 Message-ID: <13CA24D6AB415D428143D44749F57D7201FD2BF2@ltcfiswmsgmb21> References: <201307210523.r6L5NYqh084679@svn.freebsd.org> <20130721133915.GA36573@FreeBSD.org> In-Reply-To: <20130721133915.GA36573@FreeBSD.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.121] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-07-20_06:2013-07-19,2013-07-20,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , Glen Barber , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Devin Teske X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 16:17:37 -0000 On Jul 21, 2013, at 6:39 AM, Alexey Dokuchaev wrote: > On Sun, Jul 21, 2013 at 05:23:34AM +0000, Glen Barber wrote: >> New Revision: 253513 >> URL: http://svnweb.freebsd.org/changeset/base/253513 >>=20 >> Log: >> Create memstick images with the '.img' filename extension. >>=20 >> Requested by: many >> [...] >=20 > Is there any work being done to merge the .iso and .img into single, > hybrid bootable image (c.g. Haiku)? I've asked this question before, > but I cannot recall now what was the outcome if it... >=20 I have been doing this for years @ $work with sysinstall. Since the death o= f sysinstall, I've been working on the replacement. However, you can downlo= ad Hybrid ISO/IMG images here: http://druidbsd.sourceforge.net/download.shtml#FreeBSD_Druid or here: http://sourceforge.net/projects/druidbsd/files/ and here's PDF documentation on how to use it: http://druidbsd.cvs.sourceforge.net/viewvc/druidbsd/druidbsd/druid/src/doc/= FreeBSD_Druid_User_Guide.pdf?view=3Dlog and here's the instructions on how to "burn" it (including full instruction= s for pretty much every Operating System; and even some tools for Windoze): http://druidbsd.cvs.sourceforge.net/viewvc/druidbsd/druidbsd/druid/src/tool= s/ Please... Feel free to ask questions. --=20 Devin P.S. It's *so* much more than *just* taking the installer and Hybridizing i= t to work with CD versus USB seamlessly. The "Druid" line is a master-work = that took 7 years to produce. P.P.S. Been working on rewriting other aspects of the installer before we r= evisit the idea of merging Druid components to achieve what you're asking. = For now, we have the Druid to show us a proof-of-concept that it's not only= achievable, but it's damned slick when you do get to the hybridized arena. _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 16:38:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 16ABAFE7; Sun, 21 Jul 2013 16:38:17 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id D248F961; Sun, 21 Jul 2013 16:38:16 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa07.fnfis.com (8.14.5/8.14.5) with ESMTP id r6LGcFjG017887 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sun, 21 Jul 2013 11:38:15 -0500 Received: from LTCFISWMSGMB21.FNFIS.com ([10.132.99.23]) by LTCFISWMSGHT04.FNFIS.com ([10.132.206.15]) with mapi id 14.02.0309.002; Sun, 21 Jul 2013 11:38:14 -0500 From: "Teske, Devin" To: Alexey Dokuchaev Subject: Re: svn commit: r253513 - head/release Thread-Topic: svn commit: r253513 - head/release Thread-Index: AQHOhdJ2FlUUZwfcZkq9aC0Vc2SteZlvd48AgAAyAIA= Date: Sun, 21 Jul 2013 16:38:13 +0000 Message-ID: <13CA24D6AB415D428143D44749F57D7201FD2CDB@ltcfiswmsgmb21> References: <201307210523.r6L5NYqh084679@svn.freebsd.org> <20130721133915.GA36573@FreeBSD.org> In-Reply-To: <20130721133915.GA36573@FreeBSD.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.121] Content-Type: text/plain; charset="us-ascii" Content-ID: <43948B66A5E7A44EBBCCA904BDDD08CB@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-07-20_06:2013-07-19,2013-07-20,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , Glen Barber , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Devin Teske X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 16:38:17 -0000 On Jul 21, 2013, at 6:39 AM, Alexey Dokuchaev wrote: > On Sun, Jul 21, 2013 at 05:23:34AM +0000, Glen Barber wrote: >> New Revision: 253513 >> URL: http://svnweb.freebsd.org/changeset/base/253513 >>=20 >> Log: >> Create memstick images with the '.img' filename extension. >>=20 >> Requested by: many >> [...] >=20 > Is there any work being done to merge the .iso and .img into single, > hybrid bootable image (c.g. Haiku)? I wonder how Haiku does it. I use ISOLINUX (part of the SYSLINUX family) as my boot loader. The ISO9660 layer boots ISOLINUX and then chain-loads the mfsroot, displayi= ng my beastie Forth menu. Then from the mfsroot boot environment, sysinstall runs /install.cfg: http://druidbsd.cvs.sourceforge.net/viewvc/druidbsd/druidbsd/druid/dep/free= bsd/mfsroot/standard/src/install.cfg?revision=3D1.1&view=3Dmarkup which runs a small script: http://druidbsd.cvs.sourceforge.net/viewvc/druidbsd/druidbsd/druid/dep/free= bsd/mfsroot/standard/src/fis/load_menu?revision=3D1.1&view=3Dmarkup Which looks for /dev/iso9660/VOL_ID Where VOL_ID is set by the mkisofs(8) `-V VOL_ID' flag when producing the = boot media. See "BOOT_VOLID" in my GNUMakefile that calls mkisofs(8): http://druidbsd.cvs.sourceforge.net/viewvc/druidbsd/druidbsd/druid/GNUmakef= ile.in?revision=3D1.7&view=3Dmarkup Now here's the trick... It doesn't matter whether you burned the ISO to a CD/DVD or you imaged it t= o a USB Thumb... ... phk's GEOM layer picks up and creates /dev/iso9660/VOL_ID regardless of= what medium you booted from (so-long as it was an ISO that was post-proces= sed with the ISOLINUX utility "isohybrid"). So in my hybridized installer, I have a bootstrap script that runs before s= ysinstall that mounts /dev/iso9660/VOL_ID to /cdrom and I end up using /cdr= om always. That's the very basic *gist* of how I achieve hybrid booting for FreeBSD. O= f course... that's only the *start*. Of course, to get sysinstall to instal= l from /cdrom, I had to code a new media access module called "mediaSetNull= FS": http://druidbsd.cvs.sourceforge.net/viewvc/druidbsd/druidbsd/druid/dep/free= bsd/patches/local_patches/usr.sbin%3A%3Asysinstall%3A%3Anullfs.c.patch?view= =3Dmarkup Whose job is (when you configure your installation to use this access metho= d) is to take the path given and do a mount_nullfs from point-A to point-B = *prior* to doing the chroot into the formatted disk (here, like all media a= ccess methods, the point-B is "/dist" within the chroot environment). Of course... moving forward... we would need to re-apply logistics to bsdin= stall to work with ISOLINUX and isohybrid images -- though I gather it woul= d be even easier than making sysinstall work. > I've asked this question before, > but I cannot recall now what was the outcome if it... >=20 Did I answer you last time? Just curious. I've been doing this for a while. --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 16:56:13 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C20F94CD; Sun, 21 Jul 2013 16:56:13 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) by mx1.freebsd.org (Postfix) with ESMTP id AC19F9E6; Sun, 21 Jul 2013 16:56:12 +0000 (UTC) Received: from alph.d.allbsd.org (p2049-ipbf1102funabasi.chiba.ocn.ne.jp [122.26.101.49]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id r6LGttLL081606 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 22 Jul 2013 01:56:05 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.5/8.14.5) with ESMTP id r6LGtrq7016671; Mon, 22 Jul 2013 01:55:55 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Mon, 22 Jul 2013 01:55:46 +0900 (JST) Message-Id: <20130722.015546.1238134239830261918.hrs@allbsd.org> To: danfe@FreeBSD.org, dteske@FreeBSD.org Subject: Re: svn commit: r253513 - head/release From: Hiroki Sato In-Reply-To: <13CA24D6AB415D428143D44749F57D7201FD2BF2@ltcfiswmsgmb21> References: <201307210523.r6L5NYqh084679@svn.freebsd.org> <20130721133915.GA36573@FreeBSD.org> <13CA24D6AB415D428143D44749F57D7201FD2BF2@ltcfiswmsgmb21> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Mon_Jul_22_01_55_46_2013_986)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Mon, 22 Jul 2013 01:56:05 +0900 (JST) X-Spam-Status: No, score=-90.6 required=13.0 tests=CONTENT_TYPE_PRESENT, DIRECTOCNDYN,DYN_PBL,RCVD_IN_PBL,SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, gjb@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 16:56:13 -0000 ----Security_Multipart(Mon_Jul_22_01_55_46_2013_986)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit "Teske, Devin" wrote in <13CA24D6AB415D428143D44749F57D7201FD2BF2@ltcfiswmsgmb21>: De> De> On Jul 21, 2013, at 6:39 AM, Alexey Dokuchaev wrote: De> De> > On Sun, Jul 21, 2013 at 05:23:34AM +0000, Glen Barber wrote: De> >> New Revision: 253513 De> >> URL: http://svnweb.freebsd.org/changeset/base/253513 De> >> De> >> Log: De> >> Create memstick images with the '.img' filename extension. De> >> De> >> Requested by: many De> >> [...] De> > De> > Is there any work being done to merge the .iso and .img into single, De> > hybrid bootable image (c.g. Haiku)? I've asked this question before, De> > but I cannot recall now what was the outcome if it... De> > De> De> I have been doing this for years @ $work with sysinstall. Since the De> death of sysinstall, I've been working on the replacement. However, De> you can download Hybrid ISO/IMG images here: It is possible to create a hybrid image of ISO9660 and USB memory image because ISO images for sparc64 have a similar structure and we can reuse the build procedure. I have a patch to create such images, but there is a concern that recent memory images become >700MB. Is it still useful? -- Hiroki ----Security_Multipart(Mon_Jul_22_01_55_46_2013_986)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (FreeBSD) iEYEABECAAYFAlHsEpIACgkQTyzT2CeTzy0oGgCfR4FuVHwqrJRECezOp0/6ZtxR A+8AoIW+84gCRZPRk9+7FQ1ObI3jwZfY =Sx6h -----END PGP SIGNATURE----- ----Security_Multipart(Mon_Jul_22_01_55_46_2013_986)---- From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 18:18:24 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 84E32986; Sun, 21 Jul 2013 18:18:24 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id 491FAC45; Sun, 21 Jul 2013 18:18:23 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa07.fnfis.com (8.14.5/8.14.5) with ESMTP id r6LIIMWS030541 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sun, 21 Jul 2013 13:18:22 -0500 Received: from LTCFISWMSGMB21.FNFIS.com ([10.132.99.23]) by LTCFISWMSGHT04.FNFIS.com ([10.132.206.15]) with mapi id 14.02.0309.002; Sun, 21 Jul 2013 13:18:20 -0500 From: "Teske, Devin" To: Hiroki Sato Subject: Re: svn commit: r253513 - head/release Thread-Topic: svn commit: r253513 - head/release Thread-Index: AQHOhdJ2FlUUZwfcZkq9aC0Vc2SteZlvd48AgAAsMQCAAAq2AIAAFw8A Date: Sun, 21 Jul 2013 18:18:18 +0000 Message-ID: <13CA24D6AB415D428143D44749F57D7201FD2F7D@ltcfiswmsgmb21> References: <201307210523.r6L5NYqh084679@svn.freebsd.org> <20130721133915.GA36573@FreeBSD.org> <13CA24D6AB415D428143D44749F57D7201FD2BF2@ltcfiswmsgmb21> <20130722.015546.1238134239830261918.hrs@allbsd.org> In-Reply-To: <20130722.015546.1238134239830261918.hrs@allbsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.121] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-07-21_06:2013-07-19,2013-07-21,1970-01-01 signatures=0 Cc: Alexey Dokuchaev , "src-committers@FreeBSD.org" , "svn-src-all@FreeBSD.org" , Glen Barber , "svn-src-head@FreeBSD.org" , Devin Teske X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 18:18:24 -0000 On Jul 21, 2013, at 9:55 AM, Hiroki Sato wrote: > "Teske, Devin" wrote > in <13CA24D6AB415D428143D44749F57D7201FD2BF2@ltcfiswmsgmb21>: >=20 > De> > De> On Jul 21, 2013, at 6:39 AM, Alexey Dokuchaev wrote: > De> > De> > On Sun, Jul 21, 2013 at 05:23:34AM +0000, Glen Barber wrote: > De> >> New Revision: 253513 > De> >> URL: https://urldefense.proofpoint.com/v1/url?u=3Dhttp://svnweb.fr= eebsd.org/changeset/base/253513&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r= =3DMrjs6vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=3DICzrrPRprsUfeSXmW22PbvhR4zFtb5xx= NHgyzQmaW38%3D%0A&s=3Dab088fdca0bfa1bc85c9bae0aaa04a30f6c37b8815a87d255b1e0= 26794ecbccf > De> >> > De> >> Log: > De> >> Create memstick images with the '.img' filename extension. > De> >> > De> >> Requested by: many > De> >> [...] > De> > > De> > Is there any work being done to merge the .iso and .img into single, > De> > hybrid bootable image (c.g. Haiku)? I've asked this question befor= e, > De> > but I cannot recall now what was the outcome if it... > De> > > De> > De> I have been doing this for years @ $work with sysinstall. Since the > De> death of sysinstall, I've been working on the replacement. However, > De> you can download Hybrid ISO/IMG images here: >=20 > It is possible to create a hybrid image of ISO9660 and USB memory > image because ISO images for sparc64 have a similar structure and we > can reuse the build procedure. I have a patch to create such images, > but there is a concern that recent memory images become >700MB. Is > it still useful? >=20 Yes. Because we can burn them to DVD for read-only optical and we can use 2= GB, 4GB, or greater-sized USB Thumbs. @ $work we've been able to keep the size of the ISOs down by using sysinsta= ll from an mfsroot. =3D=3D=3D ASIDE: I recently analyzed what we would need to put bsdinstall+bsdconfig i= nto an mfsroot to do similar things as sysinstall... (sorted alphabetically) /bin/sh /usr/sbin/pkg_add* awk bsdlabel** cat cdcontrol chmod chown cksum c= mp cp=20 date df dhclient dialog dumpfs ee fdisk fetch find ftp grep host hostname i= d=20 ifconfig kill ldconfig ln ls md5 mkdir mktemp mount mount_cd9660 mount_msdo= sfs=20 mount_nfs moused mv nc pkg_delete* pw rm route rtsol sed sleep sort stat st= ty=20 sysctl tail tr umount uname vidcontrol (optional functionality requirements; not required in mfsroot) Xdialog logger su sudo touch xauth xterm * bsdconfig(8) yet to be updated for pkg (for configPackages) ** bsdconfig(8) yet to be updated to use gpart to probe for disks (for medi= aSet*) =3D=3D=3D Despite the fact that what we've only published builds under 600MB, in-hous= e @ $work, I've made so-called "super discs" that contain multiple arches += multiple releases. For example, I once made a multi-GB DVD that contained = 4.11, 8.1-32, 8.1-64, 8.3-32, 8.3-64, 9.0-32, and 9.0-64 (plus several util= ities like memtest86, memtest86+, memtest86+SMP, windiag, Derik's Boot-And-= Nuke, TuffTest Pro, SpinRite, WD Velociraptor FW updates, Seagate SeaTools = (both GUI and Txt version), and yet even more. I think the resulting ISO wa= s about 2.7GB. It fit nicely on a 3GB thumb-drive I had and it burned well = to DVD. It was very nice being able to walk around with one disc or one thu= mb drive and be prepared for anything/everything. (I carry one one me at all times in my coat pocket ^_^) So yeah... >700MB shouldn't be a problem. --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 18:37:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 32393E54; Sun, 21 Jul 2013 18:37:39 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id E7F02CC5; Sun, 21 Jul 2013 18:37:38 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id r6LIbWsr033546; Sun, 21 Jul 2013 18:37:32 GMT (envelope-from kientzle@freebsd.org) Received: from [192.168.2.123] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id ykvsiua35miqa6f8jyngie3ay6; Sun, 21 Jul 2013 18:37:31 +0000 (UTC) (envelope-from kientzle@freebsd.org) Subject: Re: svn commit: r251709 - head/sys/vm Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Tim Kientzle In-Reply-To: <0AA48233-11CD-482E-82DE-E0F8C833E36E@kientzle.com> Date: Sun, 21 Jul 2013 11:37:30 -0700 Content-Transfer-Encoding: 7bit Message-Id: <49DCB494-32B5-46D7-89FC-8B03477EC945@freebsd.org> References: <201306132105.r5DL5c4F013089@svn.freebsd.org> <20130615113503.4f5509dd@bender.Home> <20130618233450.71d9d03b@bender.Home> <0AA48233-11CD-482E-82DE-E0F8C833E36E@kientzle.com> To: Andrew Turner , Jeff Roberson X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 18:37:39 -0000 >> On Sat, 15 Jun 2013 11:35:03 +0100 >> Andrew Turner wrote: >> >>> On Thu, 13 Jun 2013 21:05:38 +0000 (UTC) >>> Jeff Roberson wrote: >>> >>>> Author: jeff >>>> Date: Thu Jun 13 21:05:38 2013 >>>> New Revision: 251709 >>>> URL: http://svnweb.freebsd.org/changeset/base/251709 >>>> >>>> Log: >>>> - Convert the slab free item list from a linked array of indices >>>> to a bitmap using sys/bitset. This is much simpler, has lower space >>>> overhead and is cheaper in most cases. >>>> - Use a second bitmap for invariants asserts and improve the >>>> quality of the asserts as well as the number of erroneous conditions >>>> that we will catch. >>>> - Drastically simplify sizing code. Special case refcnt zones >>>> since they will be going away. >>>> - Update stale comments. >>> >>> This broke booting for my on the Raspberry Pi for me. If I revert just >>> this change the board boots as expected. Kernel output from the boot >>> failure follows. As Andrew pointed out some time ago, this broke armv6 with: panic: lock "vm map (user)" 0xc09cc050 already initialized I put in some debug printfs and verified that this is actually the first time that vm_map_zinit is called. So I don't think the lock is actually being re-initialized; rather I think it's a problem with uninitialized memory. The following seems to fix it for me: Index: sys/vm/vm_map.c =================================================================== --- sys/vm/vm_map.c (revision 253514) +++ sys/vm/vm_map.c (working copy) @@ -239,8 +239,7 @@ vm_map_t map; map = (vm_map_t)mem; - map->nentries = 0; - map->size = 0; + memset(map, 0, sizeof(*map)); mtx_init(&map->system_mtx, "vm map (system)", NULL, MTX_DEF | MTX_DUPOK); sx_init(&map->lock, "vm map (user)"); return (0); From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 19:17:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5F1EFD93; Sun, 21 Jul 2013 19:17:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 50B4CE57; Sun, 21 Jul 2013 19:17:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LJHl0d041111; Sun, 21 Jul 2013 19:17:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LJHlKu041110; Sun, 21 Jul 2013 19:17:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307211917.r6LJHlKu041110@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Jul 2013 19:17:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253525 - head/sys/compat/freebsd32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 19:17:47 -0000 Author: kib Date: Sun Jul 21 19:17:46 2013 New Revision: 253525 URL: http://svnweb.freebsd.org/changeset/base/253525 Log: Cosmetic change, use the same union name on the left and right sides of the conversion. Tested by: Petr Salinger Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/compat/freebsd32/freebsd32_misc.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sun Jul 21 17:23:49 2013 (r253524) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sun Jul 21 19:17:46 2013 (r253525) @@ -2410,7 +2410,7 @@ siginfo_to_siginfo32(const siginfo_t *sr dst->si_uid = src->si_uid; dst->si_status = src->si_status; dst->si_addr = (uintptr_t)src->si_addr; - dst->si_value.sigval_int = src->si_value.sival_int; + dst->si_value.sival_int = src->si_value.sival_int; dst->si_timerid = src->si_timerid; dst->si_overrun = src->si_overrun; } From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 19:21:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 87202F07; Sun, 21 Jul 2013 19:21:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5EDE3E64; Sun, 21 Jul 2013 19:21:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LJLJ3U043601; Sun, 21 Jul 2013 19:21:19 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LJLJZt043600; Sun, 21 Jul 2013 19:21:19 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307211921.r6LJLJZt043600@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Jul 2013 19:21:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253526 - head/tools/regression/aio/aiotest X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 19:21:19 -0000 Author: kib Date: Sun Jul 21 19:21:18 2013 New Revision: 253526 URL: http://svnweb.freebsd.org/changeset/base/253526 Log: Fix several warnings. Fix crash in aio_pty_cleanup() by initializing the pointer before dereferencing. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/tools/regression/aio/aiotest/aiotest.c Modified: head/tools/regression/aio/aiotest/aiotest.c ============================================================================== --- head/tools/regression/aio/aiotest/aiotest.c Sun Jul 21 19:17:46 2013 (r253525) +++ head/tools/regression/aio/aiotest/aiotest.c Sun Jul 21 19:21:18 2013 (r253526) @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -269,7 +270,7 @@ aio_write_test(struct aio_context *ac) if (len != ac->ac_buflen) { aio_cleanup(ac); errx(-1, "FAIL: %s: aio_write_test: aio_waitcomplete: short " - "write (%d)", ac->ac_test, len); + "write (%jd)", ac->ac_test, (intmax_t)len); } } @@ -329,7 +330,7 @@ aio_read_test(struct aio_context *ac) if (len != ac->ac_buflen) { aio_cleanup(ac); errx(-1, "FAIL: %s: aio_read_test: aio_waitcomplete: short " - "read (%d)", ac->ac_test, len); + "read (%jd)", ac->ac_test, (intmax_t)len); } if (aio_test_buffer(ac->ac_buffer, ac->ac_buflen, ac->ac_seed) == 0) { @@ -366,7 +367,7 @@ aio_file_cleanup(void *arg) #define FILE_LEN GLOBAL_MAX #define FILE_TIMEOUT 30 -static int +static void aio_file_test(void) { char pathname[PATH_MAX]; @@ -414,7 +415,7 @@ aio_fifo_cleanup(void *arg) #define FIFO_LEN 256 #define FIFO_TIMEOUT 30 -static int +static void aio_fifo_test(void) { int error, read_fd = -1, write_fd = -1; @@ -481,7 +482,7 @@ aio_unix_socketpair_cleanup(void *arg) #define UNIX_SOCKETPAIR_LEN 256 #define UNIX_SOCKETPAIR_TIMEOUT 30 -static int +static void aio_unix_socketpair_test(void) { struct aio_unix_socketpair_arg arg; @@ -515,13 +516,14 @@ aio_pty_cleanup(void *arg) { struct aio_pty_arg *apa; + apa = arg; close(apa->apa_read_fd); close(apa->apa_write_fd); }; #define PTY_LEN 256 #define PTY_TIMEOUT 30 -static int +static void aio_pty_test(void) { struct aio_pty_arg arg; @@ -573,7 +575,7 @@ aio_pipe_cleanup(void *arg) #define PIPE_LEN 256 #define PIPE_TIMEOUT 30 -static int +static void aio_pipe_test(void) { struct aio_context ac; @@ -628,7 +630,7 @@ aio_md_cleanup(void *arg) #define MD_LEN GLOBAL_MAX #define MD_TIMEOUT 30 -static int +static void aio_md_test(void) { int error, fd, i, mdctl_fd, unit; From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 19:33:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 47A2A35B; Sun, 21 Jul 2013 19:33:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 289A8ED7; Sun, 21 Jul 2013 19:33:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LJXnX9048711; Sun, 21 Jul 2013 19:33:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LJXm5p048706; Sun, 21 Jul 2013 19:33:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307211933.r6LJXm5p048706@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Jul 2013 19:33:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253527 - in head/sys: compat/freebsd32 kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 19:33:49 -0000 Author: kib Date: Sun Jul 21 19:33:48 2013 New Revision: 253527 URL: http://svnweb.freebsd.org/changeset/base/253527 Log: Move the convert_sigevent32() utility function into freebsd32_misc.c for consumption outside the vfs_aio.c. For SIGEV_THREAD_ID and SIGEV_SIGNAL notification delivery methods, also copy in the sigev_value, since librt event pumping loop compares note generation number with the value passed through sigev_value. Tested by: Petr Salinger Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/freebsd32/freebsd32_signal.h head/sys/kern/vfs_aio.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sun Jul 21 19:21:18 2013 (r253526) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sun Jul 21 19:33:48 2013 (r253527) @@ -2912,3 +2912,29 @@ freebsd32_posix_fadvise(struct thread *t return (kern_posix_fadvise(td, uap->fd, PAIR32TO64(off_t, uap->offset), PAIR32TO64(off_t, uap->len), uap->advice)); } + +int +convert_sigevent32(struct sigevent32 *sig32, struct sigevent *sig) +{ + + CP(*sig32, *sig, sigev_notify); + switch (sig->sigev_notify) { + case SIGEV_NONE: + break; + case SIGEV_THREAD_ID: + CP(*sig32, *sig, sigev_notify_thread_id); + /* FALLTHROUGH */ + case SIGEV_SIGNAL: + CP(*sig32, *sig, sigev_signo); + PTRIN_CP(*sig32, *sig, sigev_value.sival_ptr); + break; + case SIGEV_KEVENT: + CP(*sig32, *sig, sigev_notify_kqueue); + CP(*sig32, *sig, sigev_notify_kevent_flags); + PTRIN_CP(*sig32, *sig, sigev_value.sival_ptr); + break; + default: + return (EINVAL); + } + return (0); +} Modified: head/sys/compat/freebsd32/freebsd32_signal.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_signal.h Sun Jul 21 19:21:18 2013 (r253526) +++ head/sys/compat/freebsd32/freebsd32_signal.h Sun Jul 21 19:33:48 2013 (r253527) @@ -97,6 +97,8 @@ struct sigevent32 { } _sigev_un; }; +struct sigevent; +int convert_sigevent32(struct sigevent32 *sig32, struct sigevent *sig); void siginfo_to_siginfo32(const siginfo_t *src, struct siginfo32 *dst); #endif /* !_COMPAT_FREEBSD32_SIGNAL_H_ */ Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Sun Jul 21 19:21:18 2013 (r253526) +++ head/sys/kern/vfs_aio.c Sun Jul 21 19:33:48 2013 (r253527) @@ -2755,31 +2755,6 @@ aiocb32_copyin_old_sigevent(struct aiocb } static int -convert_sigevent32(struct sigevent32 *sig32, struct sigevent *sig) -{ - - CP(*sig32, *sig, sigev_notify); - switch (sig->sigev_notify) { - case SIGEV_NONE: - break; - case SIGEV_THREAD_ID: - CP(*sig32, *sig, sigev_notify_thread_id); - /* FALLTHROUGH */ - case SIGEV_SIGNAL: - CP(*sig32, *sig, sigev_signo); - break; - case SIGEV_KEVENT: - CP(*sig32, *sig, sigev_notify_kqueue); - CP(*sig32, *sig, sigev_notify_kevent_flags); - PTRIN_CP(*sig32, *sig, sigev_value.sival_ptr); - break; - default: - return (EINVAL); - } - return (0); -} - -static int aiocb32_copyin(struct aiocb *ujob, struct aiocb *kjob) { struct aiocb32 job32; From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 19:36:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3726E4BC; Sun, 21 Jul 2013 19:36:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 27869EEF; Sun, 21 Jul 2013 19:36:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LJasiK049364; Sun, 21 Jul 2013 19:36:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LJasor049363; Sun, 21 Jul 2013 19:36:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307211936.r6LJasor049363@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Jul 2013 19:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253528 - head/sys/compat/freebsd32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 19:36:54 -0000 Author: kib Date: Sun Jul 21 19:36:53 2013 New Revision: 253528 URL: http://svnweb.freebsd.org/changeset/base/253528 Log: The freebsd32_lio_listio() compat syscall takes the struct sigevent32. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/compat/freebsd32/syscalls.master Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Sun Jul 21 19:33:48 2013 (r253527) +++ head/sys/compat/freebsd32/syscalls.master Sun Jul 21 19:36:53 2013 (r253528) @@ -476,7 +476,7 @@ struct aiocb32 *aiocbp); } 257 AUE_NULL NOSTD { int freebsd32_lio_listio(int mode, \ struct aiocb32 * const *acb_list, \ - int nent, struct sigevent *sig); } + int nent, struct sigevent32 *sig); } 258 AUE_NULL UNIMPL nosys 259 AUE_NULL UNIMPL nosys 260 AUE_NULL UNIMPL nosys From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 19:40:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 93A246F4; Sun, 21 Jul 2013 19:40:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 76485F08; Sun, 21 Jul 2013 19:40:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LJeVwZ052057; Sun, 21 Jul 2013 19:40:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LJeVMs052054; Sun, 21 Jul 2013 19:40:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307211940.r6LJeVMs052054@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Jul 2013 19:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253529 - in head/sys: compat/freebsd32 kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 19:40:31 -0000 Author: kib Date: Sun Jul 21 19:40:30 2013 New Revision: 253529 URL: http://svnweb.freebsd.org/changeset/base/253529 Log: Wrap kmq_notify(2) for compat32 to properly consume struct sigevent32 argument. Reviewed and tested by: Petr Salinger Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/compat/freebsd32/syscalls.master head/sys/kern/uipc_mqueue.c Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Sun Jul 21 19:36:53 2013 (r253528) +++ head/sys/compat/freebsd32/syscalls.master Sun Jul 21 19:40:30 2013 (r253529) @@ -825,8 +825,8 @@ const char *msg_ptr, size_t msg_len,\ unsigned msg_prio, \ const struct timespec32 *abs_timeout);} -461 AUE_NULL NOPROTO|NOSTD { int kmq_notify(int mqd, \ - const struct sigevent *sigev); } +461 AUE_NULL NOSTD { int freebsd32_kmq_notify(int mqd, \ + const struct sigevent32 *sigev); } 462 AUE_NULL NOPROTO|NOSTD { int kmq_unlink(const char *path); } 463 AUE_NULL NOPROTO { int abort2(const char *why, int nargs, void **args); } 464 AUE_NULL NOPROTO { int thr_set_name(long id, const char *name); } Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Sun Jul 21 19:36:53 2013 (r253528) +++ head/sys/kern/uipc_mqueue.c Sun Jul 21 19:40:30 2013 (r253529) @@ -2235,10 +2235,9 @@ sys_kmq_timedsend(struct thread *td, str return (error); } -int -sys_kmq_notify(struct thread *td, struct kmq_notify_args *uap) +static int +kern_kmq_notify(struct thread *td, int mqd, struct sigevent *sigev) { - struct sigevent ev; struct filedesc *fdp; struct proc *p; struct mqueue *mq; @@ -2246,34 +2245,31 @@ sys_kmq_notify(struct thread *td, struct struct mqueue_notifier *nt, *newnt = NULL; int error; - p = td->td_proc; - fdp = td->td_proc->p_fd; - if (uap->sigev) { - error = copyin(uap->sigev, &ev, sizeof(ev)); - if (error) - return (error); - if (ev.sigev_notify != SIGEV_SIGNAL && - ev.sigev_notify != SIGEV_THREAD_ID && - ev.sigev_notify != SIGEV_NONE) + if (sigev != NULL) { + if (sigev->sigev_notify != SIGEV_SIGNAL && + sigev->sigev_notify != SIGEV_THREAD_ID && + sigev->sigev_notify != SIGEV_NONE) return (EINVAL); - if ((ev.sigev_notify == SIGEV_SIGNAL || - ev.sigev_notify == SIGEV_THREAD_ID) && - !_SIG_VALID(ev.sigev_signo)) + if ((sigev->sigev_notify == SIGEV_SIGNAL || + sigev->sigev_notify == SIGEV_THREAD_ID) && + !_SIG_VALID(sigev->sigev_signo)) return (EINVAL); } - error = getmq(td, uap->mqd, &fp, NULL, &mq); + p = td->td_proc; + fdp = td->td_proc->p_fd; + error = getmq(td, mqd, &fp, NULL, &mq); if (error) return (error); again: FILEDESC_SLOCK(fdp); - fp2 = fget_locked(fdp, uap->mqd); + fp2 = fget_locked(fdp, mqd); if (fp2 == NULL) { FILEDESC_SUNLOCK(fdp); error = EBADF; goto out; } #ifdef CAPABILITIES - error = cap_check(cap_rights(fdp, uap->mqd), CAP_POLL_EVENT); + error = cap_check(cap_rights(fdp, mqd), CAP_POLL_EVENT); if (error) { FILEDESC_SUNLOCK(fdp); goto out; @@ -2286,12 +2282,12 @@ again: } mtx_lock(&mq->mq_mutex); FILEDESC_SUNLOCK(fdp); - if (uap->sigev != NULL) { + if (sigev != NULL) { if (mq->mq_notifier != NULL) { error = EBUSY; } else { PROC_LOCK(p); - nt = notifier_search(p, uap->mqd); + nt = notifier_search(p, mqd); if (nt == NULL) { if (newnt == NULL) { PROC_UNLOCK(p); @@ -2314,10 +2310,10 @@ again: nt->nt_ksi.ksi_flags |= KSI_INS | KSI_EXT; nt->nt_ksi.ksi_code = SI_MESGQ; nt->nt_proc = p; - nt->nt_ksi.ksi_mqd = uap->mqd; + nt->nt_ksi.ksi_mqd = mqd; notifier_insert(p, nt); } - nt->nt_sigev = ev; + nt->nt_sigev = *sigev; mq->mq_notifier = nt; PROC_UNLOCK(p); /* @@ -2330,7 +2326,7 @@ again: mqueue_send_notification(mq); } } else { - notifier_remove(p, mq, uap->mqd); + notifier_remove(p, mq, mqd); } mtx_unlock(&mq->mq_mutex); @@ -2341,6 +2337,23 @@ out: return (error); } +int +sys_kmq_notify(struct thread *td, struct kmq_notify_args *uap) +{ + struct sigevent ev, *evp; + int error; + + if (uap->sigev == NULL) { + evp = NULL; + } else { + error = copyin(uap->sigev, &ev, sizeof(ev)); + if (error != 0) + return (error); + evp = &ev; + } + return (kern_kmq_notify(td, uap->mqd, evp)); +} + static void mqueue_fdclose(struct thread *td, int fd, struct file *fp) { @@ -2637,6 +2650,7 @@ static struct syscall_helper_data mq_sys #ifdef COMPAT_FREEBSD32 #include #include +#include #include #include @@ -2763,12 +2777,33 @@ freebsd32_kmq_timedreceive(struct thread return (error); } +int +freebsd32_kmq_notify(struct thread *td, struct freebsd32_kmq_notify_args *uap) +{ + struct sigevent ev, *evp; + struct sigevent32 ev32; + int error; + + if (uap->sigev == NULL) { + evp = NULL; + } else { + error = copyin(uap->sigev, &ev32, sizeof(ev32)); + if (error != 0) + return (error); + error = convert_sigevent32(&ev32, &ev); + if (error != 0) + return (error); + evp = &ev; + } + return (kern_kmq_notify(td, uap->mqd, evp)); +} + static struct syscall_helper_data mq32_syscalls[] = { SYSCALL32_INIT_HELPER(freebsd32_kmq_open), SYSCALL32_INIT_HELPER(freebsd32_kmq_setattr), SYSCALL32_INIT_HELPER(freebsd32_kmq_timedsend), SYSCALL32_INIT_HELPER(freebsd32_kmq_timedreceive), - SYSCALL32_INIT_HELPER_COMPAT(kmq_notify), + SYSCALL32_INIT_HELPER(freebsd32_kmq_notify), SYSCALL32_INIT_HELPER_COMPAT(kmq_unlink), SYSCALL_INIT_LAST }; From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 19:43:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3BF1887D; Sun, 21 Jul 2013 19:43:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1E7A6F20; Sun, 21 Jul 2013 19:43:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LJhsU6052868; Sun, 21 Jul 2013 19:43:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LJhr5q052860; Sun, 21 Jul 2013 19:43:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307211943.r6LJhr5q052860@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Jul 2013 19:43:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253530 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 19:43:54 -0000 Author: kib Date: Sun Jul 21 19:43:52 2013 New Revision: 253530 URL: http://svnweb.freebsd.org/changeset/base/253530 Log: Implement compat32 wrappers for the ktimer_* syscalls. Reported, reviewed and tested by: Petr Salinger Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/compat/freebsd32/freebsd32.h head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/freebsd32/syscalls.master head/sys/kern/kern_time.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/freebsd32/freebsd32.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32.h Sun Jul 21 19:40:30 2013 (r253529) +++ head/sys/compat/freebsd32/freebsd32.h Sun Jul 21 19:43:52 2013 (r253530) @@ -69,6 +69,15 @@ struct timespec32 { CP((src).fld,(dst).fld,tv_nsec); \ } while (0) +struct itimerspec32 { + struct timespec32 it_interval; + struct timespec32 it_value; +}; +#define ITS_CP(src, dst) do { \ + TS_CP((src), (dst), it_interval); \ + TS_CP((src), (dst), it_value); \ +} while (0) + struct rusage32 { struct timeval32 ru_utime; struct timeval32 ru_stime; Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sun Jul 21 19:40:30 2013 (r253529) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sun Jul 21 19:43:52 2013 (r253530) @@ -2331,6 +2331,70 @@ freebsd32_clock_getres(struct thread *td return (error); } +int freebsd32_ktimer_create(struct thread *td, + struct freebsd32_ktimer_create_args *uap) +{ + struct sigevent32 ev32; + struct sigevent ev, *evp; + int error, id; + + if (uap->evp == NULL) { + evp = NULL; + } else { + evp = &ev; + error = copyin(uap->evp, &ev32, sizeof(ev32)); + if (error != 0) + return (error); + error = convert_sigevent32(&ev32, &ev); + if (error != 0) + return (error); + } + error = kern_ktimer_create(td, uap->clock_id, evp, &id, -1); + if (error == 0) { + error = copyout(&id, uap->timerid, sizeof(int)); + if (error != 0) + kern_ktimer_delete(td, id); + } + return (error); +} + +int +freebsd32_ktimer_settime(struct thread *td, + struct freebsd32_ktimer_settime_args *uap) +{ + struct itimerspec32 val32, oval32; + struct itimerspec val, oval, *ovalp; + int error; + + error = copyin(uap->value, &val32, sizeof(val32)); + if (error != 0) + return (error); + ITS_CP(val32, val); + ovalp = uap->ovalue != NULL ? &oval : NULL; + error = kern_ktimer_settime(td, uap->timerid, uap->flags, &val, ovalp); + if (error == 0 && uap->ovalue != NULL) { + ITS_CP(oval, oval32); + error = copyout(&oval32, uap->ovalue, sizeof(oval32)); + } + return (error); +} + +int +freebsd32_ktimer_gettime(struct thread *td, + struct freebsd32_ktimer_gettime_args *uap) +{ + struct itimerspec32 val32; + struct itimerspec val; + int error; + + error = kern_ktimer_gettime(td, uap->timerid, &val); + if (error == 0) { + ITS_CP(val, val32); + error = copyout(&val32, uap->value, sizeof(val32)); + } + return (error); +} + int freebsd32_clock_getcpuclockid2(struct thread *td, struct freebsd32_clock_getcpuclockid2_args *uap) Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Sun Jul 21 19:40:30 2013 (r253529) +++ head/sys/compat/freebsd32/syscalls.master Sun Jul 21 19:43:52 2013 (r253530) @@ -441,11 +441,17 @@ const struct timespec32 *tp); } 234 AUE_NULL STD { int freebsd32_clock_getres(clockid_t clock_id, \ struct timespec32 *tp); } -235 AUE_NULL UNIMPL timer_create -236 AUE_NULL UNIMPL timer_delete -237 AUE_NULL UNIMPL timer_settime -238 AUE_NULL UNIMPL timer_gettime -239 AUE_NULL UNIMPL timer_getoverrun +235 AUE_NULL STD { int freebsd32_ktimer_create(\ + clockid_t clock_id, \ + struct sigevent32 *evp, int *timerid); } +236 AUE_NULL NOPROTO { int ktimer_delete(int timerid); } +237 AUE_NULL STD { int freebsd32_ktimer_settime(int timerid,\ + int flags, \ + const struct itimerspec32 *value, \ + struct itimerspec32 *ovalue); } +238 AUE_NULL STD { int freebsd32_ktimer_gettime(int timerid,\ + struct itimerspec32 *value); } +239 AUE_NULL NOPROTO { int ktimer_getoverrun(int timerid); } 240 AUE_NULL STD { int freebsd32_nanosleep( \ const struct timespec32 *rqtp, \ struct timespec32 *rmtp); } Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Sun Jul 21 19:40:30 2013 (r253529) +++ head/sys/kern/kern_time.c Sun Jul 21 19:43:52 2013 (r253530) @@ -98,9 +98,6 @@ static int realtimer_settime(struct itim static int realtimer_delete(struct itimer *); static void realtimer_clocktime(clockid_t, struct timespec *); static void realtimer_expire(void *); -static int kern_timer_create(struct thread *, clockid_t, - struct sigevent *, int *, int); -static int kern_timer_delete(struct thread *, int); int register_posix_clock(int, struct kclock *); void itimer_fire(struct itimer *it); @@ -1067,31 +1064,30 @@ struct ktimer_create_args { int sys_ktimer_create(struct thread *td, struct ktimer_create_args *uap) { - struct sigevent *evp1, ev; + struct sigevent *evp, ev; int id; int error; - if (uap->evp != NULL) { + if (uap->evp == NULL) { + evp = NULL; + } else { error = copyin(uap->evp, &ev, sizeof(ev)); if (error != 0) return (error); - evp1 = &ev; - } else - evp1 = NULL; - - error = kern_timer_create(td, uap->clock_id, evp1, &id, -1); - + evp = &ev; + } + error = kern_ktimer_create(td, uap->clock_id, evp, &id, -1); if (error == 0) { error = copyout(&id, uap->timerid, sizeof(int)); if (error != 0) - kern_timer_delete(td, id); + kern_ktimer_delete(td, id); } return (error); } -static int -kern_timer_create(struct thread *td, clockid_t clock_id, - struct sigevent *evp, int *timerid, int preset_id) +int +kern_ktimer_create(struct thread *td, clockid_t clock_id, struct sigevent *evp, + int *timerid, int preset_id) { struct proc *p = td->td_proc; struct itimer *it; @@ -1206,7 +1202,8 @@ struct ktimer_delete_args { int sys_ktimer_delete(struct thread *td, struct ktimer_delete_args *uap) { - return (kern_timer_delete(td, uap->timerid)); + + return (kern_ktimer_delete(td, uap->timerid)); } static struct itimer * @@ -1228,8 +1225,8 @@ itimer_find(struct proc *p, int timerid) return (it); } -static int -kern_timer_delete(struct thread *td, int timerid) +int +kern_ktimer_delete(struct thread *td, int timerid) { struct proc *p = td->td_proc; struct itimer *it; @@ -1271,35 +1268,40 @@ struct ktimer_settime_args { int sys_ktimer_settime(struct thread *td, struct ktimer_settime_args *uap) { - struct proc *p = td->td_proc; - struct itimer *it; struct itimerspec val, oval, *ovalp; int error; error = copyin(uap->value, &val, sizeof(val)); if (error != 0) return (error); - - if (uap->ovalue != NULL) - ovalp = &oval; - else - ovalp = NULL; + ovalp = uap->ovalue != NULL ? &oval : NULL; + error = kern_ktimer_settime(td, uap->timerid, uap->flags, &val, ovalp); + if (error == 0 && uap->ovalue != NULL) + error = copyout(ovalp, uap->ovalue, sizeof(*ovalp)); + return (error); +} + +int +kern_ktimer_settime(struct thread *td, int timer_id, int flags, + struct itimerspec *val, struct itimerspec *oval) +{ + struct proc *p; + struct itimer *it; + int error; + p = td->td_proc; PROC_LOCK(p); - if (uap->timerid < 3 || - (it = itimer_find(p, uap->timerid)) == NULL) { + if (timer_id < 3 || (it = itimer_find(p, timer_id)) == NULL) { PROC_UNLOCK(p); error = EINVAL; } else { PROC_UNLOCK(p); itimer_enter(it); - error = CLOCK_CALL(it->it_clockid, timer_settime, - (it, uap->flags, &val, ovalp)); + error = CLOCK_CALL(it->it_clockid, timer_settime, (it, + flags, val, oval)); itimer_leave(it); ITIMER_UNLOCK(it); } - if (error == 0 && uap->ovalue != NULL) - error = copyout(ovalp, uap->ovalue, sizeof(*ovalp)); return (error); } @@ -1312,26 +1314,34 @@ struct ktimer_gettime_args { int sys_ktimer_gettime(struct thread *td, struct ktimer_gettime_args *uap) { - struct proc *p = td->td_proc; - struct itimer *it; struct itimerspec val; int error; + error = kern_ktimer_gettime(td, uap->timerid, &val); + if (error == 0) + error = copyout(&val, uap->value, sizeof(val)); + return (error); +} + +int +kern_ktimer_gettime(struct thread *td, int timer_id, struct itimerspec *val) +{ + struct proc *p; + struct itimer *it; + int error; + + p = td->td_proc; PROC_LOCK(p); - if (uap->timerid < 3 || - (it = itimer_find(p, uap->timerid)) == NULL) { + if (timer_id < 3 || (it = itimer_find(p, timer_id)) == NULL) { PROC_UNLOCK(p); error = EINVAL; } else { PROC_UNLOCK(p); itimer_enter(it); - error = CLOCK_CALL(it->it_clockid, timer_gettime, - (it, &val)); + error = CLOCK_CALL(it->it_clockid, timer_gettime, (it, val)); itimer_leave(it); ITIMER_UNLOCK(it); } - if (error == 0) - error = copyout(&val, uap->value, sizeof(val)); return (error); } @@ -1626,7 +1636,7 @@ itimers_event_hook_exit(void *arg, struc panic("unhandled event"); for (; i < TIMER_MAX; ++i) { if ((it = its->its_timers[i]) != NULL) - kern_timer_delete(curthread, i); + kern_ktimer_delete(curthread, i); } if (its->its_timers[0] == NULL && its->its_timers[1] == NULL && Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Sun Jul 21 19:40:30 2013 (r253529) +++ head/sys/sys/syscallsubr.h Sun Jul 21 19:43:52 2013 (r253530) @@ -228,6 +228,13 @@ int kern_symlink(struct thread *td, char enum uio_seg segflg); int kern_symlinkat(struct thread *td, char *path1, int fd, char *path2, enum uio_seg segflg); +int kern_ktimer_create(struct thread *td, clockid_t clock_id, + struct sigevent *evp, int *timerid, int preset_id); +int kern_ktimer_delete(struct thread *, int); +int kern_ktimer_settime(struct thread *td, int timer_id, int flags, + struct itimerspec *val, struct itimerspec *oval); +int kern_ktimer_gettime(struct thread *td, int timer_id, + struct itimerspec *val); int kern_thr_new(struct thread *td, struct thr_param *param); int kern_thr_suspend(struct thread *td, struct timespec *tsp); int kern_truncate(struct thread *td, char *path, enum uio_seg pathseg, From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 19:44:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 36DDE9C5; Sun, 21 Jul 2013 19:44:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 28268F2D; Sun, 21 Jul 2013 19:44:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LJitD5053222; Sun, 21 Jul 2013 19:44:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LJisO7053215; Sun, 21 Jul 2013 19:44:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307211944.r6LJisO7053215@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Jul 2013 19:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253531 - head/sys/compat/freebsd32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 19:44:55 -0000 Author: kib Date: Sun Jul 21 19:44:53 2013 New Revision: 253531 URL: http://svnweb.freebsd.org/changeset/base/253531 Log: Regenerate. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Sun Jul 21 19:43:52 2013 (r253530) +++ head/sys/compat/freebsd32/freebsd32_proto.h Sun Jul 21 19:44:53 2013 (r253531) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253494 2013-07-20 13:39:41Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253530 2013-07-21 19:43:52Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -208,6 +208,21 @@ struct freebsd32_clock_getres_args { char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)]; char tp_l_[PADL_(struct timespec32 *)]; struct timespec32 * tp; char tp_r_[PADR_(struct timespec32 *)]; }; +struct freebsd32_ktimer_create_args { + char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)]; + char evp_l_[PADL_(struct sigevent32 *)]; struct sigevent32 * evp; char evp_r_[PADR_(struct sigevent32 *)]; + char timerid_l_[PADL_(int *)]; int * timerid; char timerid_r_[PADR_(int *)]; +}; +struct freebsd32_ktimer_settime_args { + char timerid_l_[PADL_(int)]; int timerid; char timerid_r_[PADR_(int)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char value_l_[PADL_(const struct itimerspec32 *)]; const struct itimerspec32 * value; char value_r_[PADR_(const struct itimerspec32 *)]; + char ovalue_l_[PADL_(struct itimerspec32 *)]; struct itimerspec32 * ovalue; char ovalue_r_[PADR_(struct itimerspec32 *)]; +}; +struct freebsd32_ktimer_gettime_args { + char timerid_l_[PADL_(int)]; int timerid; char timerid_r_[PADR_(int)]; + char value_l_[PADL_(struct itimerspec32 *)]; struct itimerspec32 * value; char value_r_[PADR_(struct itimerspec32 *)]; +}; struct freebsd32_nanosleep_args { char rqtp_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * rqtp; char rqtp_r_[PADR_(const struct timespec32 *)]; char rmtp_l_[PADL_(struct timespec32 *)]; struct timespec32 * rmtp; char rmtp_r_[PADR_(struct timespec32 *)]; @@ -228,7 +243,7 @@ struct freebsd32_lio_listio_args { char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; char acb_list_l_[PADL_(struct aiocb32 *const *)]; struct aiocb32 *const * acb_list; char acb_list_r_[PADR_(struct aiocb32 *const *)]; char nent_l_[PADL_(int)]; int nent; char nent_r_[PADR_(int)]; - char sig_l_[PADL_(struct sigevent *)]; struct sigevent * sig; char sig_r_[PADR_(struct sigevent *)]; + char sig_l_[PADL_(struct sigevent32 *)]; struct sigevent32 * sig; char sig_r_[PADR_(struct sigevent32 *)]; }; struct freebsd32_lutimes_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; @@ -400,6 +415,10 @@ struct freebsd32_kmq_timedsend_args { char msg_prio_l_[PADL_(unsigned)]; unsigned msg_prio; char msg_prio_r_[PADR_(unsigned)]; char abs_timeout_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * abs_timeout; char abs_timeout_r_[PADR_(const struct timespec32 *)]; }; +struct freebsd32_kmq_notify_args { + char mqd_l_[PADL_(int)]; int mqd; char mqd_r_[PADR_(int)]; + char sigev_l_[PADL_(const struct sigevent32 *)]; const struct sigevent32 * sigev; char sigev_r_[PADR_(const struct sigevent32 *)]; +}; struct freebsd32_aio_fsync_args { char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; @@ -673,6 +692,9 @@ int freebsd32_msgrcv(struct thread *, st int freebsd32_clock_gettime(struct thread *, struct freebsd32_clock_gettime_args *); int freebsd32_clock_settime(struct thread *, struct freebsd32_clock_settime_args *); int freebsd32_clock_getres(struct thread *, struct freebsd32_clock_getres_args *); +int freebsd32_ktimer_create(struct thread *, struct freebsd32_ktimer_create_args *); +int freebsd32_ktimer_settime(struct thread *, struct freebsd32_ktimer_settime_args *); +int freebsd32_ktimer_gettime(struct thread *, struct freebsd32_ktimer_gettime_args *); int freebsd32_nanosleep(struct thread *, struct freebsd32_nanosleep_args *); int freebsd32_clock_getcpuclockid2(struct thread *, struct freebsd32_clock_getcpuclockid2_args *); int freebsd32_aio_read(struct thread *, struct freebsd32_aio_read_args *); @@ -714,6 +736,7 @@ int freebsd32_kmq_open(struct thread *, int freebsd32_kmq_setattr(struct thread *, struct freebsd32_kmq_setattr_args *); int freebsd32_kmq_timedreceive(struct thread *, struct freebsd32_kmq_timedreceive_args *); int freebsd32_kmq_timedsend(struct thread *, struct freebsd32_kmq_timedsend_args *); +int freebsd32_kmq_notify(struct thread *, struct freebsd32_kmq_notify_args *); int freebsd32_aio_fsync(struct thread *, struct freebsd32_aio_fsync_args *); #ifdef PAD64_REQUIRED int freebsd32_pread(struct thread *, struct freebsd32_pread_args *); @@ -1072,6 +1095,9 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_clock_gettime AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_clock_settime AUE_CLOCK_SETTIME #define FREEBSD32_SYS_AUE_freebsd32_clock_getres AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_ktimer_create AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_ktimer_settime AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_ktimer_gettime AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_nanosleep AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_clock_getcpuclockid2 AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_aio_read AUE_NULL @@ -1117,6 +1143,7 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_kmq_setattr AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_kmq_timedreceive AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_kmq_timedsend AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_kmq_notify AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_aio_fsync AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_pread AUE_PREAD #define FREEBSD32_SYS_AUE_freebsd32_pwrite AUE_PWRITE Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Sun Jul 21 19:43:52 2013 (r253530) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Sun Jul 21 19:44:53 2013 (r253531) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253494 2013-07-20 13:39:41Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253530 2013-07-21 19:43:52Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -206,6 +206,11 @@ #define FREEBSD32_SYS_freebsd32_clock_gettime 232 #define FREEBSD32_SYS_freebsd32_clock_settime 233 #define FREEBSD32_SYS_freebsd32_clock_getres 234 +#define FREEBSD32_SYS_freebsd32_ktimer_create 235 +#define FREEBSD32_SYS_ktimer_delete 236 +#define FREEBSD32_SYS_freebsd32_ktimer_settime 237 +#define FREEBSD32_SYS_freebsd32_ktimer_gettime 238 +#define FREEBSD32_SYS_ktimer_getoverrun 239 #define FREEBSD32_SYS_freebsd32_nanosleep 240 #define FREEBSD32_SYS_ffclock_getcounter 241 #define FREEBSD32_SYS_ffclock_setestimate 242 @@ -360,7 +365,7 @@ #define FREEBSD32_SYS_freebsd32_kmq_setattr 458 #define FREEBSD32_SYS_freebsd32_kmq_timedreceive 459 #define FREEBSD32_SYS_freebsd32_kmq_timedsend 460 -#define FREEBSD32_SYS_kmq_notify 461 +#define FREEBSD32_SYS_freebsd32_kmq_notify 461 #define FREEBSD32_SYS_kmq_unlink 462 #define FREEBSD32_SYS_abort2 463 #define FREEBSD32_SYS_thr_set_name 464 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Sun Jul 21 19:43:52 2013 (r253530) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Sun Jul 21 19:44:53 2013 (r253531) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253494 2013-07-20 13:39:41Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253530 2013-07-21 19:43:52Z kib */ const char *freebsd32_syscallnames[] = { @@ -245,11 +245,11 @@ const char *freebsd32_syscallnames[] = { "freebsd32_clock_gettime", /* 232 = freebsd32_clock_gettime */ "freebsd32_clock_settime", /* 233 = freebsd32_clock_settime */ "freebsd32_clock_getres", /* 234 = freebsd32_clock_getres */ - "#235", /* 235 = timer_create */ - "#236", /* 236 = timer_delete */ - "#237", /* 237 = timer_settime */ - "#238", /* 238 = timer_gettime */ - "#239", /* 239 = timer_getoverrun */ + "freebsd32_ktimer_create", /* 235 = freebsd32_ktimer_create */ + "ktimer_delete", /* 236 = ktimer_delete */ + "freebsd32_ktimer_settime", /* 237 = freebsd32_ktimer_settime */ + "freebsd32_ktimer_gettime", /* 238 = freebsd32_ktimer_gettime */ + "ktimer_getoverrun", /* 239 = ktimer_getoverrun */ "freebsd32_nanosleep", /* 240 = freebsd32_nanosleep */ "ffclock_getcounter", /* 241 = ffclock_getcounter */ "ffclock_setestimate", /* 242 = ffclock_setestimate */ @@ -471,7 +471,7 @@ const char *freebsd32_syscallnames[] = { "freebsd32_kmq_setattr", /* 458 = freebsd32_kmq_setattr */ "freebsd32_kmq_timedreceive", /* 459 = freebsd32_kmq_timedreceive */ "freebsd32_kmq_timedsend", /* 460 = freebsd32_kmq_timedsend */ - "kmq_notify", /* 461 = kmq_notify */ + "freebsd32_kmq_notify", /* 461 = freebsd32_kmq_notify */ "kmq_unlink", /* 462 = kmq_unlink */ "abort2", /* 463 = abort2 */ "thr_set_name", /* 464 = thr_set_name */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Sun Jul 21 19:43:52 2013 (r253530) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Sun Jul 21 19:44:53 2013 (r253531) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253494 2013-07-20 13:39:41Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253530 2013-07-21 19:43:52Z kib */ #include "opt_compat.h" @@ -282,11 +282,11 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_clock_gettime_args), (sy_call_t *)freebsd32_clock_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 232 = freebsd32_clock_gettime */ { AS(freebsd32_clock_settime_args), (sy_call_t *)freebsd32_clock_settime, AUE_CLOCK_SETTIME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 233 = freebsd32_clock_settime */ { AS(freebsd32_clock_getres_args), (sy_call_t *)freebsd32_clock_getres, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 234 = freebsd32_clock_getres */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 235 = timer_create */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 236 = timer_delete */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 237 = timer_settime */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 238 = timer_gettime */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 239 = timer_getoverrun */ + { AS(freebsd32_ktimer_create_args), (sy_call_t *)freebsd32_ktimer_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 235 = freebsd32_ktimer_create */ + { AS(ktimer_delete_args), (sy_call_t *)sys_ktimer_delete, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 236 = ktimer_delete */ + { AS(freebsd32_ktimer_settime_args), (sy_call_t *)freebsd32_ktimer_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 237 = freebsd32_ktimer_settime */ + { AS(freebsd32_ktimer_gettime_args), (sy_call_t *)freebsd32_ktimer_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 238 = freebsd32_ktimer_gettime */ + { AS(ktimer_getoverrun_args), (sy_call_t *)sys_ktimer_getoverrun, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 239 = ktimer_getoverrun */ { AS(freebsd32_nanosleep_args), (sy_call_t *)freebsd32_nanosleep, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 240 = freebsd32_nanosleep */ { AS(ffclock_getcounter_args), (sy_call_t *)sys_ffclock_getcounter, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 241 = ffclock_getcounter */ { AS(ffclock_setestimate_args), (sy_call_t *)sys_ffclock_setestimate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 242 = ffclock_setestimate */ @@ -508,7 +508,7 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_kmq_setattr_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 458 = freebsd32_kmq_setattr */ { AS(freebsd32_kmq_timedreceive_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 459 = freebsd32_kmq_timedreceive */ { AS(freebsd32_kmq_timedsend_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 460 = freebsd32_kmq_timedsend */ - { AS(kmq_notify_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 461 = kmq_notify */ + { AS(freebsd32_kmq_notify_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 461 = freebsd32_kmq_notify */ { AS(kmq_unlink_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 462 = kmq_unlink */ { AS(abort2_args), (sy_call_t *)sys_abort2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 463 = abort2 */ { AS(thr_set_name_args), (sy_call_t *)sys_thr_set_name, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 464 = thr_set_name */ Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Sun Jul 21 19:43:52 2013 (r253530) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Sun Jul 21 19:44:53 2013 (r253531) @@ -1195,6 +1195,47 @@ systrace_args(int sysnum, void *params, *n_args = 2; break; } + /* freebsd32_ktimer_create */ + case 235: { + struct freebsd32_ktimer_create_args *p = params; + iarg[0] = p->clock_id; /* clockid_t */ + uarg[1] = (intptr_t) p->evp; /* struct sigevent32 * */ + uarg[2] = (intptr_t) p->timerid; /* int * */ + *n_args = 3; + break; + } + /* ktimer_delete */ + case 236: { + struct ktimer_delete_args *p = params; + iarg[0] = p->timerid; /* int */ + *n_args = 1; + break; + } + /* freebsd32_ktimer_settime */ + case 237: { + struct freebsd32_ktimer_settime_args *p = params; + iarg[0] = p->timerid; /* int */ + iarg[1] = p->flags; /* int */ + uarg[2] = (intptr_t) p->value; /* const struct itimerspec32 * */ + uarg[3] = (intptr_t) p->ovalue; /* struct itimerspec32 * */ + *n_args = 4; + break; + } + /* freebsd32_ktimer_gettime */ + case 238: { + struct freebsd32_ktimer_gettime_args *p = params; + iarg[0] = p->timerid; /* int */ + uarg[1] = (intptr_t) p->value; /* struct itimerspec32 * */ + *n_args = 2; + break; + } + /* ktimer_getoverrun */ + case 239: { + struct ktimer_getoverrun_args *p = params; + iarg[0] = p->timerid; /* int */ + *n_args = 1; + break; + } /* freebsd32_nanosleep */ case 240: { struct freebsd32_nanosleep_args *p = params; @@ -1293,7 +1334,7 @@ systrace_args(int sysnum, void *params, iarg[0] = p->mode; /* int */ uarg[1] = (intptr_t) p->acb_list; /* struct aiocb32 *const * */ iarg[2] = p->nent; /* int */ - uarg[3] = (intptr_t) p->sig; /* struct sigevent * */ + uarg[3] = (intptr_t) p->sig; /* struct sigevent32 * */ *n_args = 4; break; } @@ -2406,11 +2447,11 @@ systrace_args(int sysnum, void *params, *n_args = 5; break; } - /* kmq_notify */ + /* freebsd32_kmq_notify */ case 461: { - struct kmq_notify_args *p = params; + struct freebsd32_kmq_notify_args *p = params; iarg[0] = p->mqd; /* int */ - uarg[1] = (intptr_t) p->sigev; /* const struct sigevent * */ + uarg[1] = (intptr_t) p->sigev; /* const struct sigevent32 * */ *n_args = 2; break; } @@ -5110,6 +5151,74 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* freebsd32_ktimer_create */ + case 235: + switch(ndx) { + case 0: + p = "clockid_t"; + break; + case 1: + p = "struct sigevent32 *"; + break; + case 2: + p = "int *"; + break; + default: + break; + }; + break; + /* ktimer_delete */ + case 236: + switch(ndx) { + case 0: + p = "int"; + break; + default: + break; + }; + break; + /* freebsd32_ktimer_settime */ + case 237: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "int"; + break; + case 2: + p = "const struct itimerspec32 *"; + break; + case 3: + p = "struct itimerspec32 *"; + break; + default: + break; + }; + break; + /* freebsd32_ktimer_gettime */ + case 238: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "struct itimerspec32 *"; + break; + default: + break; + }; + break; + /* ktimer_getoverrun */ + case 239: + switch(ndx) { + case 0: + p = "int"; + break; + default: + break; + }; + break; /* freebsd32_nanosleep */ case 240: switch(ndx) { @@ -5266,7 +5375,7 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 3: - p = "struct sigevent *"; + p = "struct sigevent32 *"; break; default: break; @@ -7121,14 +7230,14 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* kmq_notify */ + /* freebsd32_kmq_notify */ case 461: switch(ndx) { case 0: p = "int"; break; case 1: - p = "const struct sigevent *"; + p = "const struct sigevent32 *"; break; default: break; @@ -9336,6 +9445,31 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* freebsd32_ktimer_create */ + case 235: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* ktimer_delete */ + case 236: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* freebsd32_ktimer_settime */ + case 237: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* freebsd32_ktimer_gettime */ + case 238: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* ktimer_getoverrun */ + case 239: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* freebsd32_nanosleep */ case 240: if (ndx == 0 || ndx == 1) @@ -10056,7 +10190,7 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; - /* kmq_notify */ + /* freebsd32_kmq_notify */ case 461: if (ndx == 0 || ndx == 1) p = "int"; From owner-svn-src-head@FreeBSD.ORG Sun Jul 21 20:45:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9006E575; Sun, 21 Jul 2013 20:45:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 66A72191; Sun, 21 Jul 2013 20:45:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LKjNEd077667; Sun, 21 Jul 2013 20:45:23 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6LKjNMU077666; Sun, 21 Jul 2013 20:45:23 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201307212045.r6LKjNMU077666@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 21 Jul 2013 20:45:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253532 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 20:45:24 -0000 Author: hselasky Date: Sun Jul 21 20:45:23 2013 New Revision: 253532 URL: http://svnweb.freebsd.org/changeset/base/253532 Log: Fix an XHCI regression: The Block Event Interrupts, BEI, feature does not work like expected with the Renesas XHCI chipsets. Revert feature. While at it correct the TD SIZE computation in case of Zero Length Packet, ZLP, in the end of a multi frame USB transfer. MFC after: 1 week PR: usb/180726 Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Sun Jul 21 19:44:53 2013 (r253531) +++ head/sys/dev/usb/controller/xhci.c Sun Jul 21 20:45:23 2013 (r253532) @@ -1682,7 +1682,6 @@ restart: /* fill out buffer pointers */ if (average == 0) { - npkt = 0; memset(&buf_res, 0, sizeof(buf_res)); } else { usbd_get_page(temp->pc, temp->offset + @@ -1697,15 +1696,17 @@ restart: buf_res.length = XHCI_TD_PAGE_SIZE; npkt_off += buf_res.length; - - /* setup npkt */ - npkt = (len_old - npkt_off + temp->max_packet_size - 1) / - temp->max_packet_size; - - if (npkt > 31) - npkt = 31; } + /* setup npkt */ + npkt = (len_old - npkt_off + temp->max_packet_size - 1) / + temp->max_packet_size; + + if (npkt == 0) + npkt = 1; + else if (npkt > 31) + npkt = 31; + /* fill out TRB's */ td->td_trb[x].qwTrb0 = htole64((uint64_t)buf_res.physaddr); @@ -1719,9 +1720,7 @@ restart: switch (temp->trb_type) { case XHCI_TRB_TYPE_ISOCH: - /* BEI: Interrupts are inhibited until EOT */ dword = XHCI_TRB_3_CHAIN_BIT | XHCI_TRB_3_CYCLE_BIT | - XHCI_TRB_3_BEI_BIT | XHCI_TRB_3_TBC_SET(temp->tbc) | XHCI_TRB_3_TLBPC_SET(temp->tlbpc); if (td != td_first) { @@ -1756,10 +1755,8 @@ restart: dword |= XHCI_TRB_3_DIR_IN; break; default: /* XHCI_TRB_TYPE_NORMAL */ - /* BEI: Interrupts are inhibited until EOT */ dword = XHCI_TRB_3_CHAIN_BIT | XHCI_TRB_3_CYCLE_BIT | XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_NORMAL) | - XHCI_TRB_3_BEI_BIT | XHCI_TRB_3_TBC_SET(temp->tbc) | XHCI_TRB_3_TLBPC_SET(temp->tlbpc); if (temp->direction == UE_DIR_IN) @@ -1838,6 +1835,7 @@ restart: usb_pc_cpu_flush(td_first->page_cache); } + /* clear TD SIZE to zero, hence this is the last TRB */ /* remove chain bit because this is the last TRB in the chain */ td->td_trb[td->ntrb - 1].dwTrb2 &= ~htole32(XHCI_TRB_2_TDSZ_SET(15)); td->td_trb[td->ntrb - 1].dwTrb3 &= ~htole32(XHCI_TRB_3_CHAIN_BIT); From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 00:44:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 327AB5B0; Mon, 22 Jul 2013 00:44:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 245381AE1; Mon, 22 Jul 2013 00:44:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6M0icm7002016; Mon, 22 Jul 2013 00:44:38 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6M0ibWR002015; Mon, 22 Jul 2013 00:44:37 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201307220044.r6M0ibWR002015@svn.freebsd.org> From: Mateusz Guzik Date: Mon, 22 Jul 2013 00:44:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253537 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 00:44:38 -0000 Author: mjg Date: Mon Jul 22 00:44:37 2013 New Revision: 253537 URL: http://svnweb.freebsd.org/changeset/base/253537 Log: Remove duplicate assertion from tdsendsignal. MFC after: 2 weeks Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sun Jul 21 23:10:45 2013 (r253536) +++ head/sys/kern/kern_sig.c Mon Jul 22 00:44:37 2013 (r253537) @@ -2063,10 +2063,8 @@ tdsendsignal(struct proc *p, struct thre if (td == NULL) { td = sigtd(p, sig, prop); sigqueue = &p->p_sigqueue; - } else { - KASSERT(td->td_proc == p, ("invalid thread")); + } else sigqueue = &td->td_sigqueue; - } SDT_PROBE(proc, kernel, , signal_send, td, p, sig, 0, 0 ); From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 02:07:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 531B3D99; Mon, 22 Jul 2013 02:07:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 43BD41CB6; Mon, 22 Jul 2013 02:07:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6M27Gvn068483; Mon, 22 Jul 2013 02:07:16 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6M27Gt2068482; Mon, 22 Jul 2013 02:07:16 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201307220207.r6M27Gt2068482@svn.freebsd.org> From: Mateusz Guzik Date: Mon, 22 Jul 2013 02:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253538 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 02:07:16 -0000 Author: mjg Date: Mon Jul 22 02:07:15 2013 New Revision: 253538 URL: http://svnweb.freebsd.org/changeset/base/253538 Log: Remove cr_prison NULL check from proc_to_reap. Userspace processes always have a prison. MFC after: 2 weeks Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Mon Jul 22 00:44:37 2013 (r253537) +++ head/sys/kern/kern_exit.c Mon Jul 22 02:07:15 2013 (r253538) @@ -918,8 +918,7 @@ proc_to_reap(struct thread *td, struct p } break; case P_JAILID: - if (p->p_ucred->cr_prison == NULL || - (p->p_ucred->cr_prison->pr_id != (int)id)) { + if (p->p_ucred->cr_prison->pr_id != (int)id) { PROC_UNLOCK(p); return (0); } From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 03:55:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A894D7A9; Mon, 22 Jul 2013 03:55:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9AABF2095; Mon, 22 Jul 2013 03:55:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6M3tFLP002069; Mon, 22 Jul 2013 03:55:15 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6M3tF7O002068; Mon, 22 Jul 2013 03:55:15 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201307220355.r6M3tF7O002068@svn.freebsd.org> From: Warner Losh Date: Mon, 22 Jul 2013 03:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253539 - head/sys/mips/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 03:55:15 -0000 Author: imp Date: Mon Jul 22 03:55:15 2013 New Revision: 253539 URL: http://svnweb.freebsd.org/changeset/base/253539 Log: This file isn't derived from anything delivered by Berkeley, so remove this statement. Modified: head/sys/mips/cavium/std.octeon1 Modified: head/sys/mips/cavium/std.octeon1 ============================================================================== --- head/sys/mips/cavium/std.octeon1 Mon Jul 22 02:07:15 2013 (r253538) +++ head/sys/mips/cavium/std.octeon1 Mon Jul 22 03:55:15 2013 (r253539) @@ -1,7 +1,3 @@ -# /* -# * This product includes software developed by the University of -# * California, Berkeley and its contributors." -# */ # $FreeBSD$ # files "../cavium/files.octeon1" From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 05:45:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A8E7B532; Mon, 22 Jul 2013 05:45:55 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 80F9B22DE; Mon, 22 Jul 2013 05:45:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6M5jtvs035021; Mon, 22 Jul 2013 05:45:55 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6M5js9g035020; Mon, 22 Jul 2013 05:45:54 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307220545.r6M5js9g035020@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 22 Jul 2013 05:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253540 - head/sys/dev/bge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 05:45:55 -0000 Author: yongari Date: Mon Jul 22 05:45:54 2013 New Revision: 253540 URL: http://svnweb.freebsd.org/changeset/base/253540 Log: 5725 family of devices corrupts TSO packets when TSO DMA buffers cross into regions which are within MSS bytes of a 4GB boundary. If we encounter the condition, drop the packet. Reviewed by: Geans Pin geanspin@Broacom Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Mon Jul 22 03:55:15 2013 (r253539) +++ head/sys/dev/bge/if_bge.c Mon Jul 22 05:45:54 2013 (r253540) @@ -5257,17 +5257,51 @@ bge_encap(struct bge_softc *sc, struct m csum_flags |= BGE_TXBDFLAG_VLAN_TAG; vlan_tag = m->m_pkthdr.ether_vtag; } - for (i = 0; ; i++) { - d = &sc->bge_ldata.bge_tx_ring[idx]; - d->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[i].ds_addr); - d->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[i].ds_addr); - d->bge_len = segs[i].ds_len; - d->bge_flags = csum_flags; - d->bge_vlan_tag = vlan_tag; - d->bge_mss = mss; - if (i == nsegs - 1) - break; - BGE_INC(idx, BGE_TX_RING_CNT); + + if (sc->bge_asicrev == BGE_ASICREV_BCM5762 && + (m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { + /* + * 5725 family of devices corrupts TSO packets when TSO DMA + * buffers cross into regions which are within MSS bytes of + * a 4GB boundary. If we encounter the condition, drop the + * packet. + */ + for (i = 0; ; i++) { + d = &sc->bge_ldata.bge_tx_ring[idx]; + d->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[i].ds_addr); + d->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[i].ds_addr); + d->bge_len = segs[i].ds_len; + if (d->bge_addr.bge_addr_lo + segs[i].ds_len + mss < + d->bge_addr.bge_addr_lo) + break; + d->bge_flags = csum_flags; + d->bge_vlan_tag = vlan_tag; + d->bge_mss = mss; + if (i == nsegs - 1) + break; + BGE_INC(idx, BGE_TX_RING_CNT); + } + if (i != nsegs - 1) { + bus_dmamap_sync(sc->bge_cdata.bge_tx_mtag, map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->bge_cdata.bge_tx_mtag, map); + m_freem(*m_head); + *m_head = NULL; + return (EIO); + } + } else { + for (i = 0; ; i++) { + d = &sc->bge_ldata.bge_tx_ring[idx]; + d->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[i].ds_addr); + d->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[i].ds_addr); + d->bge_len = segs[i].ds_len; + d->bge_flags = csum_flags; + d->bge_vlan_tag = vlan_tag; + d->bge_mss = mss; + if (i == nsegs - 1) + break; + BGE_INC(idx, BGE_TX_RING_CNT); + } } /* Mark the last segment as end of packet... */ From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 06:55:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id EC0FEF5A; Mon, 22 Jul 2013 06:55:40 +0000 (UTC) Date: Mon, 22 Jul 2013 06:55:40 +0000 From: Alexey Dokuchaev To: Devin Teske Subject: Re: svn commit: r253513 - head/release Message-ID: <20130722065540.GA74176@FreeBSD.org> References: <201307210523.r6L5NYqh084679@svn.freebsd.org> <20130721133915.GA36573@FreeBSD.org> <13CA24D6AB415D428143D44749F57D7201FD2BF2@ltcfiswmsgmb21> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <13CA24D6AB415D428143D44749F57D7201FD2BF2@ltcfiswmsgmb21> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "svn-src-head@freebsd.org" , Glen Barber , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 06:55:41 -0000 On Sun, Jul 21, 2013 at 04:17:26PM +0000, Teske, Devin wrote: > On Jul 21, 2013, at 6:39 AM, Alexey Dokuchaev wrote: > > Is there any work being done to merge the .iso and .img into single, > > hybrid bootable image (c.g. Haiku)? I've asked this question before, > > but I cannot recall now what was the outcome if it... > > I have been doing this for years @ $work with sysinstall. [...] > > P.S. It's *so* much more than *just* taking the installer and Hybridizing > it to work with CD versus USB seamlessly. The "Druid" line is a master- > work that took 7 years to produce. > > P.P.S. Been working on rewriting other aspects of the installer before we > revisit the idea of merging Druid components to achieve what you're > asking. For now, we have the Druid to show us a proof-of-concept that it's > not only achievable, but it's damned slick when you do get to the > hybridized arena. Undersood, thanks for the info. Looking forward to see it merged one day to both installer and release generation code. ./danfe From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 08:46:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E6536B72; Mon, 22 Jul 2013 08:46:15 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BEBA32AE2; Mon, 22 Jul 2013 08:46:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6M8kFhX090047; Mon, 22 Jul 2013 08:46:15 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6M8kFOw090046; Mon, 22 Jul 2013 08:46:15 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201307220846.r6M8kFOw090046@svn.freebsd.org> From: Colin Percival Date: Mon, 22 Jul 2013 08:46:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253541 - head/contrib/openbsm/m4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 08:46:16 -0000 Author: cperciva Date: Mon Jul 22 08:46:15 2013 New Revision: 253541 URL: http://svnweb.freebsd.org/changeset/base/253541 Log: Remove weirdly-named autofoo file. This is not needed for the (FreeBSD) build, and freebsd-update chokes on it. 9.2-RELEASE candidate. Approved by: rwatson MFC after: 3 days Deleted: head/contrib/openbsm/m4/lt~obsolete.m4 From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 12:07:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 422E5F67; Mon, 22 Jul 2013 12:07:58 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3379529FD; Mon, 22 Jul 2013 12:07:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MC7wwp050440; Mon, 22 Jul 2013 12:07:58 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MC7wZa050439; Mon, 22 Jul 2013 12:07:58 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201307221207.r6MC7wZa050439@svn.freebsd.org> From: Glen Barber Date: Mon, 22 Jul 2013 12:07:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253542 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 12:07:58 -0000 Author: gjb Date: Mon Jul 22 12:07:57 2013 New Revision: 253542 URL: http://svnweb.freebsd.org/changeset/base/253542 Log: For consistency with previous releases, name the cdrom install cd 'disc1.iso'. Discussed with: re@ team Approved by: kib (mentor) MFC after: 3 days X-MFC-To: stable/9 only Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Mon Jul 22 08:46:15 2013 (r253541) +++ head/release/Makefile Mon Jul 22 12:07:57 2013 (r253542) @@ -3,7 +3,7 @@ # Makefile for building releases and release media. # # User-driven targets: -# cdrom: Builds release CD-ROM media (release.iso) +# cdrom: Builds release CD-ROM media (disc1.iso) # memstick: Builds memory stick image (memstick.img) # ftp: Sets up FTP distribution area (ftp) # release: Build all media and FTP distribution area @@ -70,7 +70,7 @@ RELEASE_TARGETS= ftp IMAGES= .if exists(${.CURDIR}/${TARGET}/mkisoimages.sh) RELEASE_TARGETS+= cdrom -IMAGES+= release.iso bootonly.iso +IMAGES+= disc1.iso bootonly.iso .endif .if exists(${.CURDIR}/${TARGET}/make-memstick.sh) RELEASE_TARGETS+= memstick.img @@ -161,7 +161,8 @@ bootonly: packagesystem echo hostid_enable=\"NO\" >> bootonly/etc/rc.conf cp ${.CURDIR}/rc.local bootonly/etc -release.iso: system +release.iso: disc1.iso +disc1.iso: system sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.TARGET} release bootonly.iso: bootonly @@ -175,7 +176,7 @@ packagesystem: base.txz kernel.txz ${EXT sh ${.CURDIR}/scripts/make-manifest.sh *.txz > MANIFEST touch ${.TARGET} -cdrom: release.iso bootonly.iso +cdrom: disc1.iso bootonly.iso ftp: packagesystem rm -rf ftp mkdir -p ftp @@ -192,7 +193,7 @@ clean: rm -f *.txz MANIFEST rm -f system rm -rf release bootonly - rm -f release.iso bootonly.iso memstick.img + rm -f disc1.iso bootonly.iso memstick.img install: .if defined(DESTDIR) && !empty(DESTDIR) From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 12:56:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BEBE51F7; Mon, 22 Jul 2013 12:56:50 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ABE102C84; Mon, 22 Jul 2013 12:56:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MCuoqq065265; Mon, 22 Jul 2013 12:56:50 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MCuoge065264; Mon, 22 Jul 2013 12:56:50 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201307221256.r6MCuoge065264@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 22 Jul 2013 12:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253543 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 12:56:50 -0000 Author: gavin Date: Mon Jul 22 12:56:50 2013 New Revision: 253543 URL: http://svnweb.freebsd.org/changeset/base/253543 Log: Update mirror list to more closely match http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/mirrors-ftp.html MFC after: 1 week Modified: head/usr.sbin/bsdinstall/scripts/mirrorselect Modified: head/usr.sbin/bsdinstall/scripts/mirrorselect ============================================================================== --- head/usr.sbin/bsdinstall/scripts/mirrorselect Mon Jul 22 12:07:57 2013 (r253542) +++ head/usr.sbin/bsdinstall/scripts/mirrorselect Mon Jul 22 12:56:50 2013 (r253543) @@ -41,7 +41,6 @@ MIRROR=`dialog --backtitle "FreeBSD Inst ftp://ftp.freebsd.org "Main Site"\ ftp://ftp.freebsd.org "IPv6 Main Site"\ ftp://ftp3.ie.freebsd.org "IPv6 Ireland"\ - ftp://ftp.il.freebsd.org "IPv6 Israel"\ ftp://ftp2.jp.freebsd.org "IPv6 Japan"\ ftp://ftp4.se.freebsd.org "IPv6 Sweden"\ ftp://ftp4.us.freebsd.org "IPv6 USA"\ @@ -53,45 +52,34 @@ MIRROR=`dialog --backtitle "FreeBSD Inst ftp://ftp5.freebsd.org "Primary #5"\ ftp://ftp6.freebsd.org "Primary #6"\ ftp://ftp7.freebsd.org "Primary #7"\ - ftp://ftp8.freebsd.org "Primary #8"\ - ftp://ftp9.freebsd.org "Primary #9"\ ftp://ftp10.freebsd.org "Primary #10"\ ftp://ftp11.freebsd.org "Primary #11"\ ftp://ftp12.freebsd.org "Primary #12"\ ftp://ftp13.freebsd.org "Primary #13"\ ftp://ftp14.freebsd.org "Primary #14"\ - ftp://ftp.ar.freebsd.org "Argentina"\ + ftp://ftp1.am.freebsd.org "Armenia"\ ftp://ftp.au.freebsd.org "Australia"\ ftp://ftp2.au.freebsd.org "Australia #2"\ ftp://ftp3.au.freebsd.org "Australia #3"\ ftp://ftp.at.freebsd.org "Austria"\ - ftp://ftp2.at.freebsd.org "Austria #2"\ - ftp://ftp.br.freebsd.org "Brazil"\ ftp://ftp2.br.freebsd.org "Brazil #2"\ ftp://ftp3.br.freebsd.org "Brazil #3"\ ftp://ftp4.br.freebsd.org "Brazil #4"\ - ftp://ftp5.br.freebsd.org "Brazil #5"\ - ftp://ftp6.br.freebsd.org "Brazil #6"\ - ftp://ftp7.br.freebsd.org "Brazil #7"\ ftp://ftp.ca.freebsd.org "Canada"\ ftp://ftp.cn.freebsd.org "China"\ - ftp://ftp2.cn.freebsd.org "China #2"\ - ftp://ftp.hr.freebsd.org "Croatia"\ ftp://ftp.cz.freebsd.org "Czech Republic"\ ftp://ftp.dk.freebsd.org "Denmark"\ - ftp://ftp2.dk.freebsd.org "Denmark #2"\ ftp://ftp.ee.freebsd.org "Estonia"\ ftp://ftp.fi.freebsd.org "Finland"\ ftp://ftp.fr.freebsd.org "France"\ - ftp://ftp2.fr.freebsd.org "IPv6 France #2"\ ftp://ftp3.fr.freebsd.org "France #3"\ ftp://ftp4.fr.freebsd.org "IPv6 France #4"\ ftp://ftp5.fr.freebsd.org "France #5"\ ftp://ftp6.fr.freebsd.org "France #6"\ + ftp://ftp7.fr.freebsd.org "France #7"\ ftp://ftp8.fr.freebsd.org "IPv6 France #8"\ ftp://ftp.de.freebsd.org "Germany"\ ftp://ftp2.de.freebsd.org "Germany #2"\ - ftp://ftp3.de.freebsd.org "Germany #3"\ ftp://ftp4.de.freebsd.org "Germany #4"\ ftp://ftp5.de.freebsd.org "Germany #5"\ ftp://ftp6.de.freebsd.org "Germany #6"\ @@ -99,10 +87,7 @@ MIRROR=`dialog --backtitle "FreeBSD Inst ftp://ftp8.de.freebsd.org "Germany #8"\ ftp://ftp.gr.freebsd.org "Greece"\ ftp://ftp2.gr.freebsd.org "Greece #2"\ - ftp://ftp.hu.freebsd.org "Hungary"\ ftp://ftp.is.freebsd.org "Iceland"\ - ftp://ftp.ie.freebsd.org "Ireland"\ - ftp://ftp2.ie.freebsd.org "Ireland #2"\ ftp://ftp3.ie.freebsd.org "Ireland #3"\ ftp://ftp.il.freebsd.org "Israel"\ ftp://ftp.it.freebsd.org "Italy"\ @@ -117,32 +102,26 @@ MIRROR=`dialog --backtitle "FreeBSD Inst ftp://ftp9.jp.freebsd.org "Japan #9"\ ftp://ftp.kr.freebsd.org "Korea"\ ftp://ftp2.kr.freebsd.org "Korea #2"\ + ftp://ftp.lv.freebsd.org "Latvia"\ ftp://ftp.lt.freebsd.org "Lithuania"\ ftp://ftp.nl.freebsd.org "Netherlands"\ ftp://ftp2.nl.freebsd.org "Netherlands #2"\ + ftp://ftp.nz.freebsd.org "New Zealand"\ ftp://ftp.no.freebsd.org "Norway"\ - ftp://ftp3.no.freebsd.org "Norway #3"\ ftp://ftp.pl.freebsd.org "Poland"\ ftp://ftp2.pl.freebsd.org "Poland #2"\ - ftp://ftp5.pl.freebsd.org "Poland #5"\ - ftp://ftp.pt.freebsd.org "Portugal"\ - ftp://ftp2.pt.freebsd.org "Portugal #2"\ - ftp://ftp4.pt.freebsd.org "Portugal #4"\ - ftp://ftp.ro.freebsd.org "Romania"\ ftp://ftp.ru.freebsd.org "Russia"\ ftp://ftp2.ru.freebsd.org "Russia #2"\ - ftp://ftp3.ru.freebsd.org "Russia #3"\ ftp://ftp4.ru.freebsd.org "Russia #4"\ - ftp://ftp.sg.freebsd.org "Singapore"\ + ftp://ftp5.ru.freebsd.org "Russia #5"\ + ftp://ftp6.ru.freebsd.org "Russia #6"\ ftp://ftp.sk.freebsd.org "Slovak Republic"\ + ftp://ftp2.sk.freebsd.org "Slovak Republic #2"\ ftp://ftp.si.freebsd.org "Slovenia"\ - ftp://ftp2.si.freebsd.org "Slovenia #2"\ ftp://ftp.za.freebsd.org "South Africa"\ ftp://ftp2.za.freebsd.org "South Africa #2"\ - ftp://ftp3.za.freebsd.org "South Africa #3"\ ftp://ftp4.za.freebsd.org "South Africa #4"\ ftp://ftp.es.freebsd.org "Spain"\ - ftp://ftp2.es.freebsd.org "Spain #2"\ ftp://ftp3.es.freebsd.org "Spain #3"\ ftp://ftp.se.freebsd.org "Sweden"\ ftp://ftp2.se.freebsd.org "Sweden #2"\ @@ -151,39 +130,29 @@ MIRROR=`dialog --backtitle "FreeBSD Inst ftp://ftp5.se.freebsd.org "Sweden #5"\ ftp://ftp6.se.freebsd.org "Sweden #6"\ ftp://ftp.ch.freebsd.org "Switzerland"\ - ftp://ftp2.ch.freebsd.org "Switzerland #2"\ ftp://ftp.tw.freebsd.org "Taiwan"\ ftp://ftp2.tw.freebsd.org "Taiwan #2"\ ftp://ftp3.tw.freebsd.org "Taiwan #3"\ ftp://ftp4.tw.freebsd.org "Taiwan #4"\ ftp://ftp6.tw.freebsd.org "Taiwan #6"\ ftp://ftp11.tw.freebsd.org "Taiwan #11"\ - ftp://ftp.tr.freebsd.org "Turkey"\ ftp://ftp2.tr.freebsd.org "Turkey #2"\ ftp://ftp.uk.freebsd.org "UK"\ ftp://ftp2.uk.freebsd.org "UK #2"\ ftp://ftp3.uk.freebsd.org "UK #3"\ ftp://ftp4.uk.freebsd.org "UK #4"\ ftp://ftp5.uk.freebsd.org "UK #5"\ - ftp://ftp6.uk.freebsd.org "UK #6"\ ftp://ftp.ua.freebsd.org "Ukraine"\ - ftp://ftp2.ua.freebsd.org "Ukraine #2"\ - ftp://ftp5.ua.freebsd.org "Ukraine #5"\ - ftp://ftp6.ua.freebsd.org "Ukraine #6"\ ftp://ftp7.ua.freebsd.org "Ukraine #7"\ - ftp://ftp8.ua.freebsd.org "Ukraine #8"\ ftp://ftp1.us.freebsd.org "USA #1"\ ftp://ftp2.us.freebsd.org "USA #2"\ ftp://ftp3.us.freebsd.org "USA #3"\ ftp://ftp4.us.freebsd.org "USA #4"\ ftp://ftp5.us.freebsd.org "USA #5"\ ftp://ftp6.us.freebsd.org "USA #6"\ - ftp://ftp7.us.freebsd.org "USA #7"\ ftp://ftp8.us.freebsd.org "USA #8"\ - ftp://ftp9.us.freebsd.org "USA #9"\ ftp://ftp10.us.freebsd.org "USA #10"\ ftp://ftp11.us.freebsd.org "USA #11"\ - ftp://ftp12.us.freebsd.org "USA #12"\ ftp://ftp13.us.freebsd.org "USA #13"\ ftp://ftp14.us.freebsd.org "USA #14"\ ftp://ftp15.us.freebsd.org "USA #15"\ From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 13:39:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 627D7D0E; Mon, 22 Jul 2013 13:39:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 441A42ECE; Mon, 22 Jul 2013 13:39:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MDdY6C078042; Mon, 22 Jul 2013 13:39:34 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MDdXWc078038; Mon, 22 Jul 2013 13:39:33 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201307221339.r6MDdXWc078038@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 22 Jul 2013 13:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253544 - in head/sys: dev/usb/gadget modules/usb modules/usb/g_audio modules/usb/g_keyboard modules/usb/g_modem modules/usb/g_mouse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 13:39:34 -0000 Author: hselasky Date: Mon Jul 22 13:39:33 2013 New Revision: 253544 URL: http://svnweb.freebsd.org/changeset/base/253544 Log: Add some USB gadget example drivers for USB audio, USB keyboard, USB mouse and USB modem classes. Hopefully someone will find these examples useful when implementing USB device side drivers using the FreeBSD USB stack. Added: head/sys/dev/usb/gadget/ head/sys/dev/usb/gadget/g_audio.c (contents, props changed) head/sys/dev/usb/gadget/g_audio.h (contents, props changed) head/sys/dev/usb/gadget/g_keyboard.c (contents, props changed) head/sys/dev/usb/gadget/g_keyboard.h (contents, props changed) head/sys/dev/usb/gadget/g_modem.c (contents, props changed) head/sys/dev/usb/gadget/g_modem.h (contents, props changed) head/sys/dev/usb/gadget/g_mouse.c (contents, props changed) head/sys/dev/usb/gadget/g_mouse.h (contents, props changed) head/sys/modules/usb/g_audio/ head/sys/modules/usb/g_audio/Makefile (contents, props changed) head/sys/modules/usb/g_keyboard/ head/sys/modules/usb/g_keyboard/Makefile (contents, props changed) head/sys/modules/usb/g_modem/ head/sys/modules/usb/g_modem/Makefile (contents, props changed) head/sys/modules/usb/g_mouse/ head/sys/modules/usb/g_mouse/Makefile (contents, props changed) Modified: head/sys/modules/usb/Makefile Added: head/sys/dev/usb/gadget/g_audio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/gadget/g_audio.c Mon Jul 22 13:39:33 2013 (r253544) @@ -0,0 +1,613 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * USB audio specs: http://www.usb.org/developers/devclass_docs/audio10.pdf + * http://www.usb.org/developers/devclass_docs/frmts10.pdf + * http://www.usb.org/developers/devclass_docs/termt10.pdf + */ + +#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 "usb_if.h" + +#define USB_DEBUG_VAR g_audio_debug +#include + +#include + +enum { + G_AUDIO_ISOC0_RD, + G_AUDIO_ISOC1_RD, + G_AUDIO_ISOC0_WR, + G_AUDIO_ISOC1_WR, + G_AUDIO_N_TRANSFER, +}; + +struct g_audio_softc { + struct mtx sc_mtx; + struct usb_callout sc_callout; + struct usb_callout sc_watchdog; + struct usb_xfer *sc_xfer[G_AUDIO_N_TRANSFER]; + + int sc_mode; + int sc_pattern_len; + int sc_throughput; + int sc_tx_interval; + int sc_state; + int sc_noise_rem; + + int8_t sc_pattern[G_AUDIO_MAX_STRLEN]; + + uint16_t sc_data_len[2][G_AUDIO_FRAMES]; + + int16_t sc_data_buf[2][G_AUDIO_BUFSIZE / 2]; + + uint8_t sc_volume_setting[32]; + uint8_t sc_volume_limit[32]; + uint8_t sc_sample_rate[32]; +}; + +static SYSCTL_NODE(_hw_usb, OID_AUTO, g_audio, CTLFLAG_RW, 0, "USB audio gadget"); + +#ifdef USB_DEBUG +static int g_audio_debug = 0; + +SYSCTL_INT(_hw_usb_g_audio, OID_AUTO, debug, CTLFLAG_RW, + &g_audio_debug, 0, "Debug level"); +#endif + +static int g_audio_mode = 0; + +SYSCTL_INT(_hw_usb_g_audio, OID_AUTO, mode, CTLFLAG_RW, + &g_audio_mode, 0, "Mode selection"); + +static int g_audio_pattern_interval = 1000; + +SYSCTL_INT(_hw_usb_g_audio, OID_AUTO, pattern_interval, CTLFLAG_RW, + &g_audio_pattern_interval, 0, "Pattern interval in milliseconds"); + +static char g_audio_pattern_data[G_AUDIO_MAX_STRLEN]; + +SYSCTL_STRING(_hw_usb_g_audio, OID_AUTO, pattern, CTLFLAG_RW, + &g_audio_pattern_data, sizeof(g_audio_pattern_data), "Data pattern"); + +static int g_audio_throughput; + +SYSCTL_INT(_hw_usb_g_audio, OID_AUTO, throughput, CTLFLAG_RD, + &g_audio_throughput, sizeof(g_audio_throughput), "Throughput in bytes per second"); + +static device_probe_t g_audio_probe; +static device_attach_t g_audio_attach; +static device_detach_t g_audio_detach; +static usb_handle_request_t g_audio_handle_request; + +static usb_callback_t g_audio_isoc_read_callback; +static usb_callback_t g_audio_isoc_write_callback; + +static devclass_t g_audio_devclass; + +static void g_audio_watchdog(void *arg); +static void g_audio_timeout(void *arg); + +static device_method_t g_audio_methods[] = { + /* USB interface */ + DEVMETHOD(usb_handle_request, g_audio_handle_request), + + /* Device interface */ + DEVMETHOD(device_probe, g_audio_probe), + DEVMETHOD(device_attach, g_audio_attach), + DEVMETHOD(device_detach, g_audio_detach), + + DEVMETHOD_END +}; + +static driver_t g_audio_driver = { + .name = "g_audio", + .methods = g_audio_methods, + .size = sizeof(struct g_audio_softc), +}; + +DRIVER_MODULE(g_audio, uhub, g_audio_driver, g_audio_devclass, 0, 0); +MODULE_DEPEND(g_audio, usb, 1, 1, 1); + +static const struct usb_config g_audio_config[G_AUDIO_N_TRANSFER] = { + + [G_AUDIO_ISOC0_RD] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_RX, + .flags = {.ext_buffer = 1,.pipe_bof = 1,.short_xfer_ok = 1,}, + .bufsize = G_AUDIO_BUFSIZE, + .callback = &g_audio_isoc_read_callback, + .frames = G_AUDIO_FRAMES, + .usb_mode = USB_MODE_DEVICE, + .if_index = 1, + }, + + [G_AUDIO_ISOC1_RD] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_RX, + .flags = {.ext_buffer = 1,.pipe_bof = 1,.short_xfer_ok = 1,}, + .bufsize = G_AUDIO_BUFSIZE, + .callback = &g_audio_isoc_read_callback, + .frames = G_AUDIO_FRAMES, + .usb_mode = USB_MODE_DEVICE, + .if_index = 1, + }, + + [G_AUDIO_ISOC0_WR] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_TX, + .flags = {.ext_buffer = 1,.pipe_bof = 1,}, + .bufsize = G_AUDIO_BUFSIZE, + .callback = &g_audio_isoc_write_callback, + .frames = G_AUDIO_FRAMES, + .usb_mode = USB_MODE_DEVICE, + .if_index = 2, + }, + + [G_AUDIO_ISOC1_WR] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_TX, + .flags = {.ext_buffer = 1,.pipe_bof = 1,}, + .bufsize = G_AUDIO_BUFSIZE, + .callback = &g_audio_isoc_write_callback, + .frames = G_AUDIO_FRAMES, + .usb_mode = USB_MODE_DEVICE, + .if_index = 2, + }, +}; + +static void +g_audio_timeout_reset(struct g_audio_softc *sc) +{ + int i = g_audio_pattern_interval; + + sc->sc_tx_interval = i; + + if (i <= 0) + i = 1; + else if (i > 1023) + i = 1023; + + i = USB_MS_TO_TICKS(i); + + usb_callout_reset(&sc->sc_callout, i, &g_audio_timeout, sc); +} + +static void +g_audio_timeout(void *arg) +{ + struct g_audio_softc *sc = arg; + + sc->sc_mode = g_audio_mode; + + memcpy(sc->sc_pattern, g_audio_pattern_data, sizeof(sc->sc_pattern)); + + sc->sc_pattern[G_AUDIO_MAX_STRLEN - 1] = 0; + + sc->sc_pattern_len = strlen(sc->sc_pattern); + + if (sc->sc_mode != G_AUDIO_MODE_LOOP) { + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC0_WR]); + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC1_WR]); + } + g_audio_timeout_reset(sc); +} + +static void +g_audio_watchdog_reset(struct g_audio_softc *sc) +{ + usb_callout_reset(&sc->sc_watchdog, hz, &g_audio_watchdog, sc); +} + +static void +g_audio_watchdog(void *arg) +{ + struct g_audio_softc *sc = arg; + int i; + + i = sc->sc_throughput; + + sc->sc_throughput = 0; + + g_audio_throughput = i; + + g_audio_watchdog_reset(sc); +} + +static int +g_audio_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + + DPRINTFN(11, "\n"); + + if (uaa->usb_mode != USB_MODE_DEVICE) + return (ENXIO); + + if ((uaa->info.bInterfaceClass == UICLASS_AUDIO) && + (uaa->info.bInterfaceSubClass == UISUBCLASS_AUDIOCONTROL)) + return (0); + + return (ENXIO); +} + +static int +g_audio_attach(device_t dev) +{ + struct g_audio_softc *sc = device_get_softc(dev); + struct usb_attach_arg *uaa = device_get_ivars(dev); + int error; + int i; + uint8_t iface_index[3]; + + DPRINTFN(11, "\n"); + + device_set_usb_desc(dev); + + mtx_init(&sc->sc_mtx, "g_audio", NULL, MTX_DEF); + + usb_callout_init_mtx(&sc->sc_callout, &sc->sc_mtx, 0); + usb_callout_init_mtx(&sc->sc_watchdog, &sc->sc_mtx, 0); + + sc->sc_mode = G_AUDIO_MODE_SILENT; + + sc->sc_noise_rem = 1; + + for (i = 0; i != G_AUDIO_FRAMES; i++) { + sc->sc_data_len[0][i] = G_AUDIO_BUFSIZE / G_AUDIO_FRAMES; + sc->sc_data_len[1][i] = G_AUDIO_BUFSIZE / G_AUDIO_FRAMES; + } + + iface_index[0] = uaa->info.bIfaceIndex; + iface_index[1] = uaa->info.bIfaceIndex + 1; + iface_index[2] = uaa->info.bIfaceIndex + 2; + + error = usbd_set_alt_interface_index(uaa->device, iface_index[1], 1); + if (error) { + DPRINTF("alt iface setting error=%s\n", usbd_errstr(error)); + goto detach; + } + error = usbd_set_alt_interface_index(uaa->device, iface_index[2], 1); + if (error) { + DPRINTF("alt iface setting error=%s\n", usbd_errstr(error)); + goto detach; + } + error = usbd_transfer_setup(uaa->device, + iface_index, sc->sc_xfer, g_audio_config, + G_AUDIO_N_TRANSFER, sc, &sc->sc_mtx); + + if (error) { + DPRINTF("error=%s\n", usbd_errstr(error)); + goto detach; + } + usbd_set_parent_iface(uaa->device, iface_index[1], iface_index[0]); + usbd_set_parent_iface(uaa->device, iface_index[2], iface_index[0]); + + mtx_lock(&sc->sc_mtx); + + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC0_RD]); + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC1_RD]); + + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC0_WR]); + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC1_WR]); + + g_audio_timeout_reset(sc); + + g_audio_watchdog_reset(sc); + + mtx_unlock(&sc->sc_mtx); + + return (0); /* success */ + +detach: + g_audio_detach(dev); + + return (ENXIO); /* error */ +} + +static int +g_audio_detach(device_t dev) +{ + struct g_audio_softc *sc = device_get_softc(dev); + + DPRINTF("\n"); + + mtx_lock(&sc->sc_mtx); + usb_callout_stop(&sc->sc_callout); + usb_callout_stop(&sc->sc_watchdog); + mtx_unlock(&sc->sc_mtx); + + usbd_transfer_unsetup(sc->sc_xfer, G_AUDIO_N_TRANSFER); + + usb_callout_drain(&sc->sc_callout); + usb_callout_drain(&sc->sc_watchdog); + + mtx_destroy(&sc->sc_mtx); + + return (0); +} + + +static int32_t +g_noise(struct g_audio_softc *sc) +{ + uint32_t temp; + const uint32_t prime = 0xFFFF1D; + + if (sc->sc_noise_rem & 1) { + sc->sc_noise_rem += prime; + } + sc->sc_noise_rem /= 2; + + temp = sc->sc_noise_rem; + + /* unsigned to signed conversion */ + + temp ^= 0x800000; + if (temp & 0x800000) { + temp |= (-0x800000); + } + return temp; +} + +static void +g_audio_make_samples(struct g_audio_softc *sc, int16_t *ptr, int samples) +{ + int i; + int j; + + for (i = 0; i != samples; i++) { + + j = g_noise(sc); + + if ((sc->sc_state < 0) || (sc->sc_state >= sc->sc_pattern_len)) + sc->sc_state = 0; + + if (sc->sc_pattern_len != 0) { + j = (j * sc->sc_pattern[sc->sc_state]) >> 16; + sc->sc_state++; + } + *ptr++ = j / 256; + *ptr++ = j / 256; + } +} + +static void +g_audio_isoc_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct g_audio_softc *sc = usbd_xfer_softc(xfer); + int actlen; + int aframes; + int nr = (xfer == sc->sc_xfer[G_AUDIO_ISOC0_WR]) ? 0 : 1; + int16_t *ptr; + int i; + + usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL); + + DPRINTF("st=%d aframes=%d actlen=%d bytes\n", + USB_GET_STATE(xfer), aframes, actlen); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + + sc->sc_throughput += actlen; + + if (sc->sc_mode == G_AUDIO_MODE_LOOP) + break; /* sync with RX */ + + case USB_ST_SETUP: +tr_setup: + + ptr = sc->sc_data_buf[nr]; + + if (sc->sc_mode == G_AUDIO_MODE_PATTERN) { + + for (i = 0; i != G_AUDIO_FRAMES; i++) { + + usbd_xfer_set_frame_data(xfer, i, ptr, sc->sc_data_len[nr][i]); + + g_audio_make_samples(sc, ptr, (G_AUDIO_BUFSIZE / G_AUDIO_FRAMES) / 2); + + ptr += (G_AUDIO_BUFSIZE / G_AUDIO_FRAMES) / 2; + } + } else if (sc->sc_mode == G_AUDIO_MODE_LOOP) { + + for (i = 0; i != G_AUDIO_FRAMES; i++) { + + usbd_xfer_set_frame_data(xfer, i, ptr, sc->sc_data_len[nr][i] & ~3); + + g_audio_make_samples(sc, ptr, sc->sc_data_len[nr][i] / 4); + + ptr += (G_AUDIO_BUFSIZE / G_AUDIO_FRAMES) / 2; + } + } + break; + + default: /* Error */ + DPRINTF("error=%s\n", usbd_errstr(error)); + + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; + } +} + +static void +g_audio_isoc_read_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct g_audio_softc *sc = usbd_xfer_softc(xfer); + int actlen; + int aframes; + int nr = (xfer == sc->sc_xfer[G_AUDIO_ISOC0_RD]) ? 0 : 1; + int16_t *ptr; + int i; + + usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL); + + DPRINTF("st=%d aframes=%d actlen=%d bytes\n", + USB_GET_STATE(xfer), aframes, actlen); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + + sc->sc_throughput += actlen; + + for (i = 0; i != G_AUDIO_FRAMES; i++) { + sc->sc_data_len[nr][i] = usbd_xfer_frame_len(xfer, i); + } + + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC0_WR]); + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC1_WR]); + + break; + + case USB_ST_SETUP: +tr_setup: + ptr = sc->sc_data_buf[nr]; + + for (i = 0; i != G_AUDIO_FRAMES; i++) { + + usbd_xfer_set_frame_data(xfer, i, ptr, + G_AUDIO_BUFSIZE / G_AUDIO_FRAMES); + + ptr += (G_AUDIO_BUFSIZE / G_AUDIO_FRAMES) / 2; + } + + usbd_transfer_submit(xfer); + break; + + default: /* Error */ + DPRINTF("error=%s\n", usbd_errstr(error)); + + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; + } +} + + +static int +g_audio_handle_request(device_t dev, + const void *preq, void **pptr, uint16_t *plen, + uint16_t offset, uint8_t *pstate) +{ + struct g_audio_softc *sc = device_get_softc(dev); + const struct usb_device_request *req = preq; + uint8_t is_complete = *pstate; + + if (!is_complete) { + if ((req->bmRequestType == UT_READ_CLASS_INTERFACE) && + (req->bRequest == 0x82 /* get min */ )) { + + if (offset == 0) { + USETW(sc->sc_volume_limit, 0); + *plen = 2; + *pptr = &sc->sc_volume_limit; + } else { + *plen = 0; + } + return (0); + } else if ((req->bmRequestType == UT_READ_CLASS_INTERFACE) && + (req->bRequest == 0x83 /* get max */ )) { + + if (offset == 0) { + USETW(sc->sc_volume_limit, 0x2000); + *plen = 2; + *pptr = &sc->sc_volume_limit; + } else { + *plen = 0; + } + return (0); + } else if ((req->bmRequestType == UT_READ_CLASS_INTERFACE) && + (req->bRequest == 0x84 /* get residue */ )) { + + if (offset == 0) { + USETW(sc->sc_volume_limit, 0); + *plen = 2; + *pptr = &sc->sc_volume_limit; + } else { + *plen = 0; + } + return (0); + } else if ((req->bmRequestType == UT_WRITE_CLASS_INTERFACE) && + (req->bRequest == 0x01 /* set value */ )) { + + if (offset == 0) { + *plen = sizeof(sc->sc_volume_setting); + *pptr = &sc->sc_volume_setting; + } else { + *plen = 0; + } + return (0); + } else if ((req->bmRequestType == UT_WRITE_CLASS_ENDPOINT) && + (req->bRequest == 0x01 /* set value */ )) { + + if (offset == 0) { + *plen = sizeof(sc->sc_sample_rate); + *pptr = &sc->sc_sample_rate; + } else { + *plen = 0; + } + return (0); + } + } + return (ENXIO); /* use builtin handler */ +} Added: head/sys/dev/usb/gadget/g_audio.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/gadget/g_audio.h Mon Jul 22 13:39:33 2013 (r253544) @@ -0,0 +1,40 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _G_AUDIO_H_ +#define _G_AUDIO_H_ + +#define G_AUDIO_MAX_STRLEN 32 /* chars */ +#define G_AUDIO_FRAMES 8 +#define G_AUDIO_BUFSIZE (G_AUDIO_FRAMES * 2 * 2 * 48) /* units */ + +#define G_AUDIO_MODE_SILENT 0 +#define G_AUDIO_MODE_DUMP 1 +#define G_AUDIO_MODE_LOOP 2 +#define G_AUDIO_MODE_PATTERN 3 +#define G_AUDIO_MODE_MAX 4 + +#endif /* _G_AUDIO_H_ */ Added: head/sys/dev/usb/gadget/g_keyboard.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/gadget/g_keyboard.c Mon Jul 22 13:39:33 2013 (r253544) @@ -0,0 +1,411 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * HID spec: http://www.usb.org/developers/devclass_docs/HID1_11.pdf + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include "usb_if.h" + +#define USB_DEBUG_VAR g_keyboard_debug +#include + +#include + +static SYSCTL_NODE(_hw_usb, OID_AUTO, g_keyboard, CTLFLAG_RW, 0, "USB keyboard gadget"); + +#ifdef USB_DEBUG +static int g_keyboard_debug = 0; + +SYSCTL_INT(_hw_usb_g_keyboard, OID_AUTO, debug, CTLFLAG_RW, + &g_keyboard_debug, 0, "Debug level"); +#endif + +static int g_keyboard_mode = 0; + +SYSCTL_INT(_hw_usb_g_keyboard, OID_AUTO, mode, CTLFLAG_RW, + &g_keyboard_mode, 0, "Mode selection"); + +static int g_keyboard_key_press_interval = 1000; + +SYSCTL_INT(_hw_usb_g_keyboard, OID_AUTO, key_press_interval, CTLFLAG_RW, + &g_keyboard_key_press_interval, 0, "Key Press Interval in milliseconds"); + +static char g_keyboard_key_press_pattern[G_KEYBOARD_MAX_STRLEN]; + +SYSCTL_STRING(_hw_usb_g_keyboard, OID_AUTO, key_press_pattern, CTLFLAG_RW, + g_keyboard_key_press_pattern, sizeof(g_keyboard_key_press_pattern), + "Key Press Patterns"); + +#define UPROTO_BOOT_KEYBOARD 1 + +#define G_KEYBOARD_NMOD 8 /* units */ +#define G_KEYBOARD_NKEYCODE 6 /* units */ + +struct g_keyboard_data { + uint8_t modifiers; +#define MOD_CONTROL_L 0x01 +#define MOD_CONTROL_R 0x10 +#define MOD_SHIFT_L 0x02 +#define MOD_SHIFT_R 0x20 +#define MOD_ALT_L 0x04 +#define MOD_ALT_R 0x40 +#define MOD_WIN_L 0x08 +#define MOD_WIN_R 0x80 + uint8_t reserved; + uint8_t keycode[G_KEYBOARD_NKEYCODE]; +}; + +enum { + G_KEYBOARD_INTR_DT, + G_KEYBOARD_N_TRANSFER, +}; + +struct g_keyboard_softc { + struct mtx sc_mtx; + struct usb_callout sc_callout; + struct g_keyboard_data sc_data[2]; + struct usb_xfer *sc_xfer[G_KEYBOARD_N_TRANSFER]; + + int sc_mode; + int sc_state; + int sc_pattern_len; + + char sc_pattern[G_KEYBOARD_MAX_STRLEN]; + + uint8_t sc_led_state[4]; +}; + +static device_probe_t g_keyboard_probe; +static device_attach_t g_keyboard_attach; +static device_detach_t g_keyboard_detach; +static usb_handle_request_t g_keyboard_handle_request; +static usb_callback_t g_keyboard_intr_callback; + +static devclass_t g_keyboard_devclass; + +static device_method_t g_keyboard_methods[] = { + /* USB interface */ + DEVMETHOD(usb_handle_request, g_keyboard_handle_request), + + /* Device interface */ + DEVMETHOD(device_probe, g_keyboard_probe), + DEVMETHOD(device_attach, g_keyboard_attach), + DEVMETHOD(device_detach, g_keyboard_detach), + + DEVMETHOD_END +}; + +static driver_t g_keyboard_driver = { + .name = "g_keyboard", + .methods = g_keyboard_methods, + .size = sizeof(struct g_keyboard_softc), +}; + +DRIVER_MODULE(g_keyboard, uhub, g_keyboard_driver, g_keyboard_devclass, 0, 0); +MODULE_DEPEND(g_keyboard, usb, 1, 1, 1); + +static const struct usb_config g_keyboard_config[G_KEYBOARD_N_TRANSFER] = { + [G_KEYBOARD_INTR_DT] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .flags = {.ext_buffer = 1,.pipe_bof = 1,}, + .bufsize = sizeof(struct g_keyboard_data), + .callback = &g_keyboard_intr_callback, + .frames = 2, + .usb_mode = USB_MODE_DEVICE, + }, +}; + +static void g_keyboard_timeout(void *arg); + +static void +g_keyboard_timeout_reset(struct g_keyboard_softc *sc) +{ + int i = g_keyboard_key_press_interval; + + if (i <= 0) + i = 1; + else if (i > 1023) + i = 1023; + + i = USB_MS_TO_TICKS(i); + + usb_callout_reset(&sc->sc_callout, i, &g_keyboard_timeout, sc); +} + +static void +g_keyboard_timeout(void *arg) +{ + struct g_keyboard_softc *sc = arg; + + sc->sc_mode = g_keyboard_mode; + + memcpy(sc->sc_pattern, g_keyboard_key_press_pattern, sizeof(sc->sc_pattern)); + + sc->sc_pattern[G_KEYBOARD_MAX_STRLEN - 1] = 0; + + sc->sc_pattern_len = strlen(sc->sc_pattern); + + DPRINTFN(11, "Timeout %p\n", sc->sc_xfer[G_KEYBOARD_INTR_DT]); + + usbd_transfer_start(sc->sc_xfer[G_KEYBOARD_INTR_DT]); + + g_keyboard_timeout_reset(sc); +} + +static int +g_keyboard_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + + DPRINTFN(11, "\n"); + + if (uaa->usb_mode != USB_MODE_DEVICE) + return (ENXIO); + + if ((uaa->info.bInterfaceClass == UICLASS_HID) && + (uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) && + (uaa->info.bInterfaceProtocol == UPROTO_BOOT_KEYBOARD)) + return (0); + + return (ENXIO); +} + +static int +g_keyboard_attach(device_t dev) +{ + struct g_keyboard_softc *sc = device_get_softc(dev); + struct usb_attach_arg *uaa = device_get_ivars(dev); + int error; + + DPRINTFN(11, "\n"); + + device_set_usb_desc(dev); + + mtx_init(&sc->sc_mtx, "g_keyboard", NULL, MTX_DEF); + + usb_callout_init_mtx(&sc->sc_callout, &sc->sc_mtx, 0); + + sc->sc_mode = G_KEYBOARD_MODE_SILENT; + + error = usbd_transfer_setup(uaa->device, + &uaa->info.bIfaceIndex, sc->sc_xfer, g_keyboard_config, + G_KEYBOARD_N_TRANSFER, sc, &sc->sc_mtx); + + if (error) { + DPRINTF("error=%s\n", usbd_errstr(error)); + goto detach; + } + mtx_lock(&sc->sc_mtx); + g_keyboard_timeout_reset(sc); + mtx_unlock(&sc->sc_mtx); + + return (0); /* success */ + +detach: + g_keyboard_detach(dev); + + return (ENXIO); /* error */ +} + +static int +g_keyboard_detach(device_t dev) +{ + struct g_keyboard_softc *sc = device_get_softc(dev); + + DPRINTF("\n"); + + mtx_lock(&sc->sc_mtx); + usb_callout_stop(&sc->sc_callout); + mtx_unlock(&sc->sc_mtx); + + usbd_transfer_unsetup(sc->sc_xfer, G_KEYBOARD_N_TRANSFER); + + usb_callout_drain(&sc->sc_callout); + + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +static uint8_t +g_keyboard_get_keycode(struct g_keyboard_softc *sc, int index) +{ + int key; + int mod = sc->sc_pattern_len; + + if (mod == 0) + index = 0; + else + index %= mod; + + if ((index >= 0) && (index < sc->sc_pattern_len)) + key = sc->sc_pattern[index]; + else + key = 'a'; + + if (key >= 'a' && key <= 'z') + return (key - 'a' + 0x04); + else + return (0x04); +} + +static void +g_keyboard_intr_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct g_keyboard_softc *sc = usbd_xfer_softc(xfer); + int actlen; + int aframes; + + usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL); + + DPRINTF("st=%d aframes=%d actlen=%d bytes\n", + USB_GET_STATE(xfer), aframes, actlen); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + break; + + case USB_ST_SETUP: +tr_setup: + if (sc->sc_mode == G_KEYBOARD_MODE_SILENT) { + memset(&sc->sc_data, 0, sizeof(sc->sc_data)); + usbd_xfer_set_frame_data(xfer, 0, &sc->sc_data[0], sizeof(sc->sc_data[0])); + usbd_xfer_set_frame_data(xfer, 1, &sc->sc_data[1], sizeof(sc->sc_data[1])); + usbd_xfer_set_frames(xfer, 2); + usbd_transfer_submit(xfer); + + } else if (sc->sc_mode == G_KEYBOARD_MODE_PATTERN) { + + memset(&sc->sc_data, 0, sizeof(sc->sc_data)); + + if ((sc->sc_state < 0) || (sc->sc_state >= G_KEYBOARD_MAX_STRLEN)) + sc->sc_state = 0; + + switch (sc->sc_state % 6) { + case 0: + sc->sc_data[0].keycode[0] = + g_keyboard_get_keycode(sc, sc->sc_state + 0); + case 1: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 13:56:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C0BF5728; Mon, 22 Jul 2013 13:56:36 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A2CFC2FC8; Mon, 22 Jul 2013 13:56:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MDuaKF083659; Mon, 22 Jul 2013 13:56:36 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MDuaX1083657; Mon, 22 Jul 2013 13:56:36 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307221356.r6MDuaX1083657@svn.freebsd.org> From: Devin Teske Date: Mon, 22 Jul 2013 13:56:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253545 - in head/usr.sbin/bsdconfig: include share/media X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 13:56:36 -0000 Author: dteske Date: Mon Jul 22 13:56:35 2013 New Revision: 253545 URL: http://svnweb.freebsd.org/changeset/base/253545 Log: Sync-up with bsdinstall(8) FTP mirrorselect changes. SVN r224656: Add back ftp4, a new machine has taken its place. ftp2 and ftp8 are both IPv6 capable mirrors. cvsup4/ftp4 have already been added to the handbook. NOTE: Except put IPv6 entries in IPv6 section at the top of the list SVN r225467: Add ftp4.se.freebsd.org to the IPv4 and IPv6 mirror lists. SVN r235228: Add the IPv6 tag to ftp4.fr.freebsd.org. NOTE: Except dup entry into IPv6 section. SVN r243832: - Remove snapshots.se.freebsd.org [1] - Add ftp6.se.freebsd.org SVN r243854: Remove snapshots.jp.freebsd.org. It stopped working years ago. SVN r253543: Update mirror list to more closely match http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/mirrors-ftp.html MFC after: 1 week Modified: head/usr.sbin/bsdconfig/include/messages.subr head/usr.sbin/bsdconfig/share/media/ftp.subr Modified: head/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/include/messages.subr Mon Jul 22 13:39:33 2013 (r253544) +++ head/usr.sbin/bsdconfig/include/messages.subr Mon Jul 22 13:56:35 2013 (r253545) @@ -42,7 +42,7 @@ msg_all_desc="All available packages in msg_always_try_sudo_when_run_as="Always try sudo(8) when run as %s" msg_arabic_desc="Ported software for Arab countries." msg_archivers_desc="Utilities for archiving and unarchiving data." -msg_argentina="Argentina" +msg_armenia="Armenia" msg_assume_network_is_already_configured="Running multi-user, assume that the network is already configured?" msg_assume_yes_to_all_non_critical_dialogs="Assume \"Yes\" answers to all non-critical dialogs" msg_astro_desc="Applications related to astronomy." @@ -92,7 +92,6 @@ msg_couldnt_connect_to_proxy="Couldn't c msg_couldnt_connect_to_server="Couldn't connect to server" msg_couldnt_open_ftp_connection="Couldn't open FTP connection to %s:\n %s." msg_created_path="Created %s" -msg_croatia="Croatia" msg_czech_republic="Czech Republic" msg_databases_desc="Database software." msg_debugging="Debugging" @@ -154,7 +153,6 @@ msg_hostname_variable_not_set="WARNING: msg_http_direct="HTTP Direct" msg_http_proxy="HTTP Proxy" msg_hungarian_desc="Ported software for the Hungarian market." -msg_hungary="Hungary" msg_iceland="Iceland" msg_install_from_a_dos_partition="Install from a DOS partition" msg_install_from_a_floppy_disk_set="Install from a floppy disk set" @@ -195,6 +193,7 @@ msg_kld_desc="Kernel loadable modules." msg_korea="Korea" msg_korean_desc="Ported software for the Korean market." msg_lang_desc="Computer languages." +msg_latvia="Latvia" msg_length_of_specified_url_is_too_long="Length of specified URL is %u characters. Allowable maximum is %u." msg_linux_desc="Linux programs that can run under binary compatibility." msg_lisp_desc="Software related to the Lisp language." @@ -226,6 +225,7 @@ msg_netherlands="Netherlands" msg_netmask="Netmask" msg_network_configuration="Network Configuration" msg_network_interface_information_required="Network interface information required" +msg_new_zealand="New Zealand" msg_news_desc="USENET News support software." msg_next_page="Next page" msg_nfailed_attempts="%u incorrect password attempts" @@ -298,7 +298,6 @@ msg_please_specify_url_of_freebsd_http_d msg_poland="Poland" msg_polish_desc="Ported software for the Polish market." msg_ports_mgmt_desc="Utilities for managing ports and packages." -msg_portugal="Portugal" msg_portuguese_desc="Ported software for the Portuguese market." msg_previous_page="Previous page" msg_previous_syntax_errors="%s: Not overwriting \`%s' due to previous syntax errors" @@ -323,7 +322,6 @@ msg_review="Review" msg_review_desc="Review/perform pending actions" msg_review_help="Install, Re-Install, or Un-install selected packages and dependencies" msg_reviewing_selected_packages="Reviewing %u selected packages:" -msg_romania="Romania" msg_ruby_desc="Software related to the Ruby language." msg_rubygems_desc="Ports of RubyGems packages." msg_russia="Russia" @@ -340,11 +338,8 @@ msg_select_a_site_thats_close="Select a msg_selected="selected" msg_server_error_when_requesting_url="Server error when requesting %s, you could try an other server" msg_shells_desc="Various shells (tcsh, bash, etc)." -msg_singapore="Singapore" msg_slovak_republic="Slovak Republic" msg_slovenia="Slovenia" -msg_snapshots_server_japan="Snapshots Server Japan" -msg_snapshots_server_sweden="Snapshots Server Sweden" msg_sorry_invalid_url="Sorry, %s is an invalid URL!" msg_sorry_package_was_not_found_in_the_index="Sorry, package %s was not found in the INDEX." msg_sorry_try_again="Sorry, try again." Modified: head/usr.sbin/bsdconfig/share/media/ftp.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/ftp.subr Mon Jul 22 13:39:33 2013 (r253544) +++ head/usr.sbin/bsdconfig/share/media/ftp.subr Mon Jul 22 13:56:35 2013 (r253545) @@ -75,14 +75,12 @@ f_dialog_menu_media_ftp() local menu_list=" '$msg_main_site' 'ftp.freebsd.org' 'URL' '$msg_specify_some_other_ftp_site' - '$msg_snapshots_server_japan' - 'snapshots.jp.freebsd.org' - '$msg_snapshots_server_sweden' - 'snapshots.se.freebsd.org' 'IPv6 $msg_main_site' 'ftp.freebsd.org' + ' IPv6 $msg_france' 'ftp4.fr.freebsd.org' + ' IPv6 $msg_france #8' 'ftp8.fr.freebsd.org' ' IPv6 $msg_ireland' 'ftp3.ie.freebsd.org' - ' IPv6 $msg_israel' 'ftp.il.freebsd.org' ' IPv6 $msg_japan' 'ftp2.jp.freebsd.org' + ' IPv6 $msg_sweden' 'ftp4.se.freebsd.org' ' IPv6 $msg_usa' 'ftp4.us.freebsd.org' ' IPv6 $msg_turkey' 'ftp2.tr.freebsd.org' '$msg_primary' 'ftp1.freebsd.org' @@ -92,44 +90,34 @@ f_dialog_menu_media_ftp() ' $msg_primary #5' 'ftp5.freebsd.org' ' $msg_primary #6' 'ftp6.freebsd.org' ' $msg_primary #7' 'ftp7.freebsd.org' - ' $msg_primary #8' 'ftp8.freebsd.org' - ' $msg_primary #9' 'ftp9.freebsd.org' ' $msg_primary #10' 'ftp10.freebsd.org' ' $msg_primary #11' 'ftp11.freebsd.org' ' $msg_primary #12' 'ftp12.freebsd.org' ' $msg_primary #13' 'ftp13.freebsd.org' ' $msg_primary #14' 'ftp14.freebsd.org' - '$msg_argentina' 'ftp.ar.freebsd.org' + '$msg_armenia' 'ftp1.am.freebsd.org' '$msg_australia' 'ftp.au.freebsd.org' ' $msg_australia #2' 'ftp2.au.freebsd.org' ' $msg_australia #3' 'ftp3.au.freebsd.org' '$msg_austria' 'ftp.at.freebsd.org' - ' $msg_austria #2' 'ftp2.at.freebsd.org' - '$msg_brazil' 'ftp.br.freebsd.org' - ' $msg_brazil #2' 'ftp2.br.freebsd.org' + '$msg_brazil' 'ftp2.br.freebsd.org' ' $msg_brazil #3' 'ftp3.br.freebsd.org' ' $msg_brazil #4' 'ftp4.br.freebsd.org' - ' $msg_brazil #5' 'ftp5.br.freebsd.org' - ' $msg_brazil #6' 'ftp6.br.freebsd.org' - ' $msg_brazil #7' 'ftp7.br.freebsd.org' '$msg_canada' 'ftp.ca.freebsd.org' '$msg_china' 'ftp.cn.freebsd.org' - ' $msg_china #2' 'ftp2.cn.freebsd.org' - '$msg_croatia' 'ftp.hr.freebsd.org' '$msg_czech_republic' 'ftp.cz.freebsd.org' '$msg_denmark' 'ftp.dk.freebsd.org' - ' $msg_denmark #2' 'ftp2.dk.freebsd.org' '$msg_estonia' 'ftp.ee.freebsd.org' '$msg_finland' 'ftp.fi.freebsd.org' '$msg_france' 'ftp.fr.freebsd.org' - ' $msg_france #2' 'ftp2.fr.freebsd.org' ' $msg_france #3' 'ftp3.fr.freebsd.org' + ' $msg_france #4' 'ftp4.fr.freebsd.org' ' $msg_france #5' 'ftp5.fr.freebsd.org' ' $msg_france #6' 'ftp6.fr.freebsd.org' + ' $msg_france #7' 'ftp7.fr.freebsd.org' ' $msg_france #8' 'ftp8.fr.freebsd.org' '$msg_germany' 'ftp.de.freebsd.org' ' $msg_germany #2' 'ftp2.de.freebsd.org' - ' $msg_germany #3' 'ftp3.de.freebsd.org' ' $msg_germany #4' 'ftp4.de.freebsd.org' ' $msg_germany #5' 'ftp5.de.freebsd.org' ' $msg_germany #6' 'ftp6.de.freebsd.org' @@ -137,11 +125,8 @@ f_dialog_menu_media_ftp() ' $msg_germany #8' 'ftp8.de.freebsd.org' '$msg_greece' 'ftp.gr.freebsd.org' ' $msg_greece #2' 'ftp2.gr.freebsd.org' - '$msg_hungary' 'ftp.hu.freebsd.org' '$msg_iceland' 'ftp.is.freebsd.org' - '$msg_ireland' 'ftp.ie.freebsd.org' - ' $msg_ireland #2' 'ftp2.ie.freebsd.org' - ' $msg_ireland #3' 'ftp3.ie.freebsd.org' + '$msg_ireland' 'ftp3.ie.freebsd.org' '$msg_israel' 'ftp.il.freebsd.org' '$msg_italy' 'ftp.it.freebsd.org' '$msg_japan' 'ftp.jp.freebsd.org' @@ -155,72 +140,57 @@ f_dialog_menu_media_ftp() ' $msg_japan #9' 'ftp9.jp.freebsd.org' '$msg_korea' 'ftp.kr.freebsd.org' ' $msg_korea #2' 'ftp2.kr.freebsd.org' + '$msg_latvia' 'ftp.lv.freebsd.org' '$msg_lithuania' 'ftp.lt.freebsd.org' '$msg_netherlands' 'ftp.nl.freebsd.org' ' $msg_netherlands #2' 'ftp2.nl.freebsd.org' + '$msg_new_zealand' 'ftp.nz.freebsd.org' '$msg_norway' 'ftp.no.freebsd.org' - ' $msg_norway #3' 'ftp3.no.freebsd.org' '$msg_poland' 'ftp.pl.freebsd.org' ' $msg_poland #2' 'ftp2.pl.freebsd.org' - ' $msg_poland #5' 'ftp5.pl.freebsd.org' - '$msg_portugal' 'ftp.pt.freebsd.org' - ' $msg_portugal #2' 'ftp2.pt.freebsd.org' - ' $msg_portugal #4' 'ftp4.pt.freebsd.org' - '$msg_romania' 'ftp.ro.freebsd.org' '$msg_russia' 'ftp.ru.freebsd.org' ' $msg_russia #2' 'ftp2.ru.freebsd.org' - ' $msg_russia #3' 'ftp3.ru.freebsd.org' ' $msg_russia #4' 'ftp4.ru.freebsd.org' - '$msg_singapore' 'ftp.sg.freebsd.org' + ' $msg_russia #5' 'ftp5.ru.freebsd.org' + ' $msg_russia #6' 'ftp6.ru.freebsd.org' '$msg_slovak_republic' 'ftp.sk.freebsd.org' + ' $msg_slovak_republic #2' 'ftp2.sk.freebsd.org' '$msg_slovenia' 'ftp.si.freebsd.org' - ' $msg_slovenia #2' 'ftp2.si.freebsd.org' '$msg_south_africa' 'ftp.za.freebsd.org' ' $msg_south_africa #2' 'ftp2.za.freebsd.org' - ' $msg_south_africa #3' 'ftp3.za.freebsd.org' ' $msg_south_africa #4' 'ftp4.za.freebsd.org' '$msg_spain' 'ftp.es.freebsd.org' - ' $msg_spain #2' 'ftp2.es.freebsd.org' ' $msg_spain #3' 'ftp3.es.freebsd.org' '$msg_sweden' 'ftp.se.freebsd.org' ' $msg_sweden #2' 'ftp2.se.freebsd.org' ' $msg_sweden #3' 'ftp3.se.freebsd.org' ' $msg_sweden #4' 'ftp4.se.freebsd.org' ' $msg_sweden #5' 'ftp5.se.freebsd.org' + ' $msg_sweden #6' 'ftp6.se.freebsd.org' '$msg_switzerland' 'ftp.ch.freebsd.org' - ' $msg_switzerland #2' 'ftp2.ch.freebsd.org' '$msg_taiwan' 'ftp.tw.freebsd.org' ' $msg_taiwan #2' 'ftp2.tw.freebsd.org' ' $msg_taiwan #3' 'ftp3.tw.freebsd.org' ' $msg_taiwan #4' 'ftp4.tw.freebsd.org' ' $msg_taiwan #6' 'ftp6.tw.freebsd.org' ' $msg_taiwan #11' 'ftp11.tw.freebsd.org' - '$msg_turkey' 'ftp.tr.freebsd.org' - ' $msg_turkey #2' 'ftp2.tr.freebsd.org' + '$msg_turkey' 'ftp2.tr.freebsd.org' '$msg_uk' 'ftp.uk.freebsd.org' ' $msg_uk #2' 'ftp2.uk.freebsd.org' ' $msg_uk #3' 'ftp3.uk.freebsd.org' ' $msg_uk #4' 'ftp4.uk.freebsd.org' ' $msg_uk #5' 'ftp5.uk.freebsd.org' - ' $msg_uk #6' 'ftp6.uk.freebsd.org' '$msg_ukraine' 'ftp.ua.freebsd.org' - ' $msg_ukraine #2' 'ftp2.ua.freebsd.org' - ' $msg_ukraine #5' 'ftp5.ua.freebsd.org' - ' $msg_ukraine #6' 'ftp6.ua.freebsd.org' ' $msg_ukraine #7' 'ftp7.ua.freebsd.org' - ' $msg_ukraine #8' 'ftp8.ua.freebsd.org' '$msg_usa #1' 'ftp1.us.freebsd.org' ' $msg_usa #2' 'ftp2.us.freebsd.org' ' $msg_usa #3' 'ftp3.us.freebsd.org' ' $msg_usa #4' 'ftp4.us.freebsd.org' ' $msg_usa #5' 'ftp5.us.freebsd.org' ' $msg_usa #6' 'ftp6.us.freebsd.org' - ' $msg_usa #7' 'ftp7.us.freebsd.org' ' $msg_usa #8' 'ftp8.us.freebsd.org' - ' $msg_usa #9' 'ftp9.us.freebsd.org' ' $msg_usa #10' 'ftp10.us.freebsd.org' ' $msg_usa #11' 'ftp11.us.freebsd.org' - ' $msg_usa #12' 'ftp12.us.freebsd.org' ' $msg_usa #13' 'ftp13.us.freebsd.org' ' $msg_usa #14' 'ftp14.us.freebsd.org' ' $msg_usa #15' 'ftp15.us.freebsd.org' From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 14:23:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7F254412; Mon, 22 Jul 2013 14:23:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4DE55215E; Mon, 22 Jul 2013 14:23:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MENlGk092854; Mon, 22 Jul 2013 14:23:47 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MENlwa092853; Mon, 22 Jul 2013 14:23:47 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201307221423.r6MENlwa092853@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 22 Jul 2013 14:23:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253546 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 14:23:47 -0000 Author: glebius Date: Mon Jul 22 14:23:46 2013 New Revision: 253546 URL: http://svnweb.freebsd.org/changeset/base/253546 Log: Fix build. Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Mon Jul 22 13:56:35 2013 (r253545) +++ head/share/mk/bsd.own.mk Mon Jul 22 14:23:46 2013 (r253546) @@ -385,7 +385,8 @@ __DEFAULT_NO_OPTIONS = \ OFED \ OPENSSH_NONE_CIPHER \ SHARED_TOOLCHAIN \ - SVN + SVN \ + USB_GADGET_EXAMPLES # # Default behaviour of some options depends on the architecture. Unfortunately From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 15:49:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3B777A3B; Mon, 22 Jul 2013 15:49:02 +0000 (UTC) (envelope-from hps@bitfrost.no) Received: from mta.bitpro.no (mta.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id ED8872586; Mon, 22 Jul 2013 15:49:01 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta.bitpro.no (Postfix) with ESMTP id 39E7E7A0D7; Mon, 22 Jul 2013 17:49:00 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id C09858EF83C; Mon, 22 Jul 2013 17:49:03 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id url6sFQZrK1K; Mon, 22 Jul 2013 17:48:57 +0200 (CEST) Received: from laptop015.hselasky.homeunix.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) by mail.lockless.no (Postfix) with ESMTPSA id 6A2C28EF83B; Mon, 22 Jul 2013 17:48:57 +0200 (CEST) Message-ID: <51ED54C4.8050206@bitfrost.no> Date: Mon, 22 Jul 2013 17:50:28 +0200 From: Hans Petter Selasky Organization: Bitfrost A/S User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130522 Thunderbird/17.0.6 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r253546 - head/share/mk References: <201307221423.r6MENlwa092853@svn.freebsd.org> In-Reply-To: <201307221423.r6MENlwa092853@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 15:49:02 -0000 On 07/22/13 16:23, Gleb Smirnoff wrote: > Author: glebius > Date: Mon Jul 22 14:23:46 2013 > New Revision: 253546 > URL: http://svnweb.freebsd.org/changeset/base/253546 > > Log: > Fix build. > > Modified: > head/share/mk/bsd.own.mk > > Modified: head/share/mk/bsd.own.mk > ============================================================================== > --- head/share/mk/bsd.own.mk Mon Jul 22 13:56:35 2013 (r253545) > +++ head/share/mk/bsd.own.mk Mon Jul 22 14:23:46 2013 (r253546) > @@ -385,7 +385,8 @@ __DEFAULT_NO_OPTIONS = \ > OFED \ > OPENSSH_NONE_CIPHER \ > SHARED_TOOLCHAIN \ > - SVN > + SVN \ > + USB_GADGET_EXAMPLES > > # > # Default behaviour of some options depends on the architecture. Unfortunately > > Thanks! --HPS From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 18:18:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 15C7646F; Mon, 22 Jul 2013 18:18:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 05D992CF3; Mon, 22 Jul 2013 18:18:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MIILgZ067624; Mon, 22 Jul 2013 18:18:21 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MIILsK067623; Mon, 22 Jul 2013 18:18:21 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201307221818.r6MIILsK067623@svn.freebsd.org> From: Ed Maste Date: Mon, 22 Jul 2013 18:18:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253548 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 18:18:22 -0000 Author: emaste Date: Mon Jul 22 18:18:21 2013 New Revision: 253548 URL: http://svnweb.freebsd.org/changeset/base/253548 Log: Document EINVAL error return from PT_LWPINFO Modified: head/lib/libc/sys/ptrace.2 Modified: head/lib/libc/sys/ptrace.2 ============================================================================== --- head/lib/libc/sys/ptrace.2 Mon Jul 22 15:02:55 2013 (r253547) +++ head/lib/libc/sys/ptrace.2 Mon Jul 22 18:18:21 2013 (r253548) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd February 7, 2013 +.Dd July 22, 2013 .Dt PTRACE 2 .Os .Sh NAME @@ -556,6 +556,14 @@ was attempted on a process with no valid was given an invalid value for .Fa pve_entry . This can also be caused by changes to the VM map of the process. +.It +The size (in +.Fa data ) +provided to +.Dv PT_LWPINFO +was less than or equal to zero, or larger than the +.Vt ptrace_lwpinfo +structure known to the kernel. .El .It Bq Er EBUSY .Bl -bullet -compact From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 18:37:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C4C67773; Mon, 22 Jul 2013 18:37:08 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B4CF82DC1; Mon, 22 Jul 2013 18:37:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MIb8q7073392; Mon, 22 Jul 2013 18:37:08 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MIb7bX073383; Mon, 22 Jul 2013 18:37:07 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201307221837.r6MIb7bX073383@svn.freebsd.org> From: "Kenneth D. Merry" Date: Mon, 22 Jul 2013 18:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253549 - in head/sys: cam dev/mps sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 18:37:08 -0000 Author: ken Date: Mon Jul 22 18:37:07 2013 New Revision: 253549 URL: http://svnweb.freebsd.org/changeset/base/253549 Log: CAM and mps(4) driver scanning changes. Add a PIM_NOSCAN flag to the CAM path inquiry CCB. This tells CAM not to perform a rescan on a bus when it is registered. We now use this flag in the mps(4) driver. Since it knows what devices it has attached, it is more efficient for it to just issue a target rescan on the targets that are attached. Also, remove the private rescan thread from the mps(4) driver in favor of the rescan thread already built into CAM. Without this change, but with the change above, the MPS scanner could run before or during CAM's initial setup, which would cause duplicate device reprobes and announcements. sys/param.h: Bump __FreeBSD_version to 1000039 for the inclusion of the PIM_RESCAN CAM path inquiry flag. sys/cam/cam_ccb.h: sys/cam/cam_xpt.c: Added a PIM_NOSCAN flag. If a SIM sets this in the path inquiry ccb, then CAM won't rescan the bus in xpt_bus_regsister. sys/dev/mps/mps_sas.c For versions of FreeBSD that have the PIM_NOSCAN path inquiry flag, don't freeze the sim queue during scanning, because CAM won't be scanning this bus. Instead, hold up the boot. Don't call mpssas_rescan_target in mpssas_startup_decrement; it's redundant and I don't know why it was in there. Set PIM_NOSCAN in path inquiry CCBs. Remove methods related to the internal rescan daemon. Always use async events to trigger a probe for EEDP support. In older versions of FreeBSD where AC_ADVINFO_CHANGED is not available, use AC_FOUND_DEVICE and issue the necessary READ CAPACITY manually. Provide a path to xpt_register_async() so that we only receive events for our own SCSI domain. Improve error reporting in cases where setup for EEDP detection fails. sys/dev/mps/mps_sas.h: Remove softc flags and data related to the scanner thread. sys/dev/mps/mps_sas_lsi.c: Unconditionally rescan the target whenever a device is added. Sponsored by: Spectra Logic MFC after: 1 week Modified: head/sys/cam/cam_ccb.h head/sys/cam/cam_xpt.c head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mps_sas.h head/sys/dev/mps/mps_sas_lsi.c head/sys/sys/param.h Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Mon Jul 22 18:18:21 2013 (r253548) +++ head/sys/cam/cam_ccb.h Mon Jul 22 18:37:07 2013 (r253549) @@ -571,6 +571,7 @@ typedef enum { PIM_NO_6_BYTE = 0x08, /* Do not send 6-byte commands */ PIM_SEQSCAN = 0x04, /* Do bus scans sequentially, not in parallel */ PIM_UNMAPPED = 0x02, + PIM_NOSCAN = 0x01 /* SIM does its own scanning */ } pi_miscflag; /* Path Inquiry CCB */ Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Mon Jul 22 18:18:21 2013 (r253548) +++ head/sys/cam/cam_xpt.c Mon Jul 22 18:37:07 2013 (r253549) @@ -3895,18 +3895,23 @@ xpt_bus_register(struct cam_sim *sim, de /* Notify interested parties */ if (sim->path_id != CAM_XPT_PATH_ID) { - union ccb *scan_ccb; xpt_async(AC_PATH_REGISTERED, path, &cpi); - /* Initiate bus rescan. */ - scan_ccb = xpt_alloc_ccb_nowait(); - if (scan_ccb != NULL) { - scan_ccb->ccb_h.path = path; - scan_ccb->ccb_h.func_code = XPT_SCAN_BUS; - scan_ccb->crcn.flags = 0; - xpt_rescan(scan_ccb); + if ((cpi.hba_misc & PIM_NOSCAN) == 0) { + union ccb *scan_ccb; + + /* Initiate bus rescan. */ + scan_ccb = xpt_alloc_ccb_nowait(); + if (scan_ccb != NULL) { + scan_ccb->ccb_h.path = path; + scan_ccb->ccb_h.func_code = XPT_SCAN_BUS; + scan_ccb->crcn.flags = 0; + xpt_rescan(scan_ccb); + } else + xpt_print(path, + "Can't allocate CCB to scan bus\n"); } else - xpt_print(path, "Can't allocate CCB to scan bus\n"); + xpt_free_path(path); } else xpt_free_path(path); return (CAM_SUCCESS); Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Mon Jul 22 18:18:21 2013 (r253548) +++ head/sys/dev/mps/mps_sas.c Mon Jul 22 18:37:07 2013 (r253549) @@ -136,14 +136,12 @@ static void mpssas_action_smpio(struct m static void mpssas_resetdev_complete(struct mps_softc *, struct mps_command *); static int mpssas_send_abort(struct mps_softc *sc, struct mps_command *tm, struct mps_command *cm); static int mpssas_send_reset(struct mps_softc *sc, struct mps_command *tm, uint8_t type); -static void mpssas_rescan(struct mpssas_softc *sassc, union ccb *ccb); -static void mpssas_rescan_done(struct cam_periph *periph, union ccb *done_ccb); -static void mpssas_scanner_thread(void *arg); -#if __FreeBSD_version >= 1000006 static void mpssas_async(void *callback_arg, uint32_t code, struct cam_path *path, void *arg); -#else -static void mpssas_check_eedp(struct mpssas_softc *sassc); +#if (__FreeBSD_version < 901503) || \ + ((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000006)) +static void mpssas_check_eedp(struct mps_softc *sc, struct cam_path *path, + struct ccb_getdev *cgd); static void mpssas_read_cap_done(struct cam_periph *periph, union ccb *done_ccb); #endif static int mpssas_send_portenable(struct mps_softc *sc); @@ -202,8 +200,12 @@ mpssas_startup_decrement(struct mpssas_s mps_dprint(sassc->sc, MPS_INIT, "%s releasing simq\n", __func__); sassc->flags &= ~MPSSAS_IN_STARTUP; +#if __FreeBSD_version >= 1000039 + xpt_release_boot(); +#else xpt_release_simq(sassc->sim, 1); mpssas_rescan_target(sassc->sc, NULL); +#endif } mps_dprint(sassc->sc, MPS_INIT, "%s refcount %u\n", __func__, sassc->startup_refcount); @@ -254,7 +256,6 @@ mpssas_free_tm(struct mps_softc *sc, str mps_free_high_priority_command(sc, tm); } - void mpssas_rescan_target(struct mps_softc *sc, struct mpssas_target *targ) { @@ -292,7 +293,7 @@ mpssas_rescan_target(struct mps_softc *s ccb->ccb_h.func_code = XPT_SCAN_TGT; mps_dprint(sc, MPS_TRACE, "%s targetid %u\n", __func__, targetid); - mpssas_rescan(sassc, ccb); + xpt_rescan(ccb); } static void @@ -690,9 +691,7 @@ int mps_attach_sas(struct mps_softc *sc) { struct mpssas_softc *sassc; -#if __FreeBSD_version >= 1000006 cam_status status; -#endif int unit, error = 0; MPS_FUNCTRACE(sc); @@ -740,16 +739,7 @@ mps_attach_sas(struct mps_softc *sc) taskqueue_start_threads(&sassc->ev_tq, 1, 255, "%s taskq", device_get_nameunit(sc->mps_dev)); - TAILQ_INIT(&sassc->ccb_scanq); - error = mps_kproc_create(mpssas_scanner_thread, sassc, - &sassc->rescan_thread, 0, 0, "mps_scan%d", unit); - if (error) { - mps_printf(sc, "Error %d starting rescan thread\n", error); - goto out; - } - mps_lock(sc); - sassc->flags |= MPSSAS_SCANTHREAD; /* * XXX There should be a bus for every port on the adapter, but since @@ -764,12 +754,16 @@ mps_attach_sas(struct mps_softc *sc) } /* - * Assume that discovery events will start right away. Freezing - * the simq will prevent the CAM boottime scanner from running - * before discovery is complete. + * Assume that discovery events will start right away. + * + * Hold off boot until discovery is complete. */ sassc->flags |= MPSSAS_IN_STARTUP | MPSSAS_IN_DISCOVERY; +#if __FreeBSD_version >= 1000039 + xpt_hold_boot(); +#else xpt_freeze_simq(sassc->sim, 1); +#endif sc->sassc->startup_refcount = 0; callout_init(&sassc->discovery_callout, 1 /*mpsafe*/); @@ -777,14 +771,42 @@ mps_attach_sas(struct mps_softc *sc) sassc->tm_count = 0; -#if __FreeBSD_version >= 1000006 - status = xpt_register_async(AC_ADVINFO_CHANGED, mpssas_async, sc, NULL); + /* + * Register for async events so we can determine the EEDP + * capabilities of devices. + */ + status = xpt_create_path(&sassc->path, /*periph*/NULL, + cam_sim_path(sc->sassc->sim), CAM_TARGET_WILDCARD, + CAM_LUN_WILDCARD); if (status != CAM_REQ_CMP) { - mps_dprint(sc, MPS_ERROR, - "Error %#x registering async handler for " - "AC_ADVINFO_CHANGED events\n", status); - } + mps_printf(sc, "Error %#x creating sim path\n", status); + sassc->path = NULL; + } else { + int event; + +#if (__FreeBSD_version >= 1000006) || \ + ((__FreeBSD_version >= 901503) && (__FreeBSD_version < 1000000)) + event = AC_ADVINFO_CHANGED; +#else + event = AC_FOUND_DEVICE; #endif + status = xpt_register_async(event, mpssas_async, sc, + sassc->path); + if (status != CAM_REQ_CMP) { + mps_dprint(sc, MPS_ERROR, + "Error %#x registering async handler for " + "AC_ADVINFO_CHANGED events\n", status); + xpt_free_path(sassc->path); + sassc->path = NULL; + } + } + if (status != CAM_REQ_CMP) { + /* + * EEDP use is the exception, not the rule. + * Warn the user, but do not fail to attach. + */ + mps_printf(sc, "EEDP capabilities disabled.\n"); + } mps_unlock(sc); @@ -823,9 +845,11 @@ mps_detach_sas(struct mps_softc *sc) mps_lock(sc); /* Deregister our async handler */ -#if __FreeBSD_version >= 1000006 - xpt_register_async(0, mpssas_async, sc, NULL); -#endif + if (sassc->path != NULL) { + xpt_register_async(0, mpssas_async, sc, sassc->path); + xpt_free_path(sassc->path); + sassc->path = NULL; + } if (sassc->flags & MPSSAS_IN_STARTUP) xpt_release_simq(sassc->sim, 1); @@ -835,15 +859,7 @@ mps_detach_sas(struct mps_softc *sc) cam_sim_free(sassc->sim, FALSE); } - if (sassc->flags & MPSSAS_SCANTHREAD) { - sassc->flags |= MPSSAS_SHUTDOWN; - wakeup(&sassc->ccb_scanq); - - if (sassc->flags & MPSSAS_SCANTHREAD) { - msleep(&sassc->flags, &sc->mps_mtx, PRIBIO, - "mps_shutdown", 30 * hz); - } - } + sassc->flags |= MPSSAS_SHUTDOWN; mps_unlock(sc); if (sassc->devq != NULL) @@ -934,7 +950,11 @@ mpssas_action(struct cam_sim *sim, union cpi->version_num = 1; cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16; cpi->target_sprt = 0; +#if __FreeBSD_version >= 1000039 + cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED | PIM_NOSCAN; +#else cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; +#endif cpi->hba_eng_cnt = 0; cpi->max_target = sassc->sc->facts->MaxTargets - 1; cpi->max_lun = 255; @@ -3126,114 +3146,6 @@ mpssas_poll(struct cam_sim *sim) } static void -mpssas_rescan_done(struct cam_periph *periph, union ccb *done_ccb) -{ - struct mpssas_softc *sassc; - char path_str[64]; - - if (done_ccb == NULL) - return; - - sassc = (struct mpssas_softc *)done_ccb->ccb_h.ppriv_ptr1; - - mtx_assert(&sassc->sc->mps_mtx, MA_OWNED); - - xpt_path_string(done_ccb->ccb_h.path, path_str, sizeof(path_str)); - mps_dprint(sassc->sc, MPS_XINFO, "Completing rescan for %s\n", path_str); - - xpt_free_path(done_ccb->ccb_h.path); - xpt_free_ccb(done_ccb); - -#if __FreeBSD_version < 1000006 - /* - * Before completing scan, get EEDP stuff for all of the existing - * targets. - */ - mpssas_check_eedp(sassc); -#endif - -} - -/* thread to handle bus rescans */ -static void -mpssas_scanner_thread(void *arg) -{ - struct mpssas_softc *sassc; - struct mps_softc *sc; - union ccb *ccb; - - sassc = (struct mpssas_softc *)arg; - sc = sassc->sc; - - MPS_FUNCTRACE(sc); - - mps_lock(sc); - for (;;) { - /* Sleep for 1 second and check the queue status*/ - msleep(&sassc->ccb_scanq, &sc->mps_mtx, PRIBIO, - "mps_scanq", 1 * hz); - if (sassc->flags & MPSSAS_SHUTDOWN) { - mps_dprint(sc, MPS_XINFO, "Scanner shutting down\n"); - break; - } -next_work: - // Get first work. - ccb = (union ccb *)TAILQ_FIRST(&sassc->ccb_scanq); - if (ccb == NULL) - continue; - // Got first work. - TAILQ_REMOVE(&sassc->ccb_scanq, &ccb->ccb_h, sim_links.tqe); - xpt_action(ccb); - if (sassc->flags & MPSSAS_SHUTDOWN) { - mps_dprint(sc, MPS_XINFO, "Scanner shutting down\n"); - break; - } - goto next_work; - } - - sassc->flags &= ~MPSSAS_SCANTHREAD; - wakeup(&sassc->flags); - mps_unlock(sc); - mps_dprint(sc, MPS_TRACE, "Scanner exiting\n"); - mps_kproc_exit(0); -} - -/* - * This function will send READ_CAP_16 to find out EEDP protection mode. - * It will check inquiry data before sending READ_CAP_16. - * Callback for READ_CAP_16 is "mpssas_read_cap_done". - * This is insternal scsi command and we need to take care release of devq, if - * CAM_DEV_QFRZN is set. Driver needs to release devq if it has frozen any. - * xpt_release_devq is called from mpssas_read_cap_done. - * - * All other commands will be handled by periph layer and there it will - * check for "CAM_DEV_QFRZN" and release of devq will be done. - */ -static void -mpssas_rescan(struct mpssas_softc *sassc, union ccb *ccb) -{ - char path_str[64]; - - MPS_FUNCTRACE(sassc->sc); - - mtx_assert(&sassc->sc->mps_mtx, MA_OWNED); - - if (ccb == NULL) - return; - - xpt_path_string(ccb->ccb_h.path, path_str, sizeof(path_str)); - mps_dprint(sassc->sc, MPS_XINFO, "Queueing rescan for %s\n", path_str); - - /* Prepare request */ - ccb->ccb_h.ppriv_ptr1 = sassc; - ccb->ccb_h.cbfcnp = mpssas_rescan_done; - xpt_setup_ccb(&ccb->ccb_h, ccb->ccb_h.path, MPS_PRIORITY_XPT); - TAILQ_INSERT_TAIL(&sassc->ccb_scanq, &ccb->ccb_h, sim_links.tqe); - wakeup(&sassc->ccb_scanq); -} - -#if __FreeBSD_version >= 1000006 -static void mpssas_async(void *callback_arg, uint32_t code, struct cam_path *path, void *arg) { @@ -3242,6 +3154,8 @@ mpssas_async(void *callback_arg, uint32_ sc = (struct mps_softc *)callback_arg; switch (code) { +#if (__FreeBSD_version >= 1000006) || \ + ((__FreeBSD_version >= 901503) && (__FreeBSD_version < 1000000)) case AC_ADVINFO_CHANGED: { struct mpssas_target *target; struct mpssas_softc *sassc; @@ -3264,13 +3178,6 @@ mpssas_async(void *callback_arg, uint32_ break; /* - * We're only interested in devices that are attached to - * this controller. - */ - if (xpt_path_path_id(path) != sassc->sim->path_id) - break; - - /* * We should have a handle for this, but check to make sure. */ target = &sassc->targets[xpt_path_target_id(path)]; @@ -3321,177 +3228,147 @@ mpssas_async(void *callback_arg, uint32_ } break; } +#else + case AC_FOUND_DEVICE: { + struct ccb_getdev *cgd; + + cgd = arg; + mpssas_check_eedp(sc, path, cgd); + break; + } +#endif default: break; } } -#else /* __FreeBSD_version >= 1000006 */ +#if (__FreeBSD_version < 901503) || \ + ((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000006)) static void -mpssas_check_eedp(struct mpssas_softc *sassc) +mpssas_check_eedp(struct mps_softc *sc, struct cam_path *path, + struct ccb_getdev *cgd) { - struct mps_softc *sc = sassc->sc; + struct mpssas_softc *sassc = sc->sassc; struct ccb_scsiio *csio; struct scsi_read_capacity_16 *scsi_cmd; struct scsi_read_capacity_eedp *rcap_buf; - union ccb *ccb; - path_id_t pathid = cam_sim_path(sassc->sim); + path_id_t pathid; target_id_t targetid; lun_id_t lunid; - struct cam_periph *found_periph; + union ccb *ccb; + struct cam_path *local_path; struct mpssas_target *target; struct mpssas_lun *lun; uint8_t found_lun; - struct ccb_getdev cgd; char path_str[64]; - /* - * Issue a READ CAPACITY 16 command to each LUN of each target. This - * info is used to determine if the LUN is formatted for EEDP support. - */ - for (targetid = 0; targetid < sc->facts->MaxTargets; targetid++) { - target = &sassc->targets[targetid]; - if (target->handle == 0x0) { - continue; - } - - lunid = 0; - do { - ccb = xpt_alloc_ccb_nowait(); - if (ccb == NULL) { - mps_dprint(sc, MPS_ERROR, "Unable to alloc CCB " - "for EEDP support.\n"); - return; - } + sassc = sc->sassc; + pathid = cam_sim_path(sassc->sim); + targetid = xpt_path_target_id(path); + lunid = xpt_path_lun_id(path); - if (xpt_create_path(&ccb->ccb_h.path, NULL, - pathid, targetid, lunid) != CAM_REQ_CMP) { - mps_dprint(sc, MPS_ERROR, "Unable to create " - "path for EEDP support\n"); - xpt_free_ccb(ccb); - return; - } + target = &sassc->targets[targetid]; + if (target->handle == 0x0) + return; - /* - * If a periph is returned, the LUN exists. Create an - * entry in the target's LUN list. - */ - if ((found_periph = cam_periph_find(ccb->ccb_h.path, - NULL)) != NULL) { - /* - * If LUN is already in list, don't create a new - * one. - */ - found_lun = FALSE; - SLIST_FOREACH(lun, &target->luns, lun_link) { - if (lun->lun_id == lunid) { - found_lun = TRUE; - break; - } - } - if (!found_lun) { - lun = malloc(sizeof(struct mpssas_lun), - M_MPT2, M_NOWAIT | M_ZERO); - if (lun == NULL) { - mps_dprint(sc, MPS_ERROR, - "Unable to alloc LUN for " - "EEDP support.\n"); - xpt_free_path(ccb->ccb_h.path); - xpt_free_ccb(ccb); - return; - } - lun->lun_id = lunid; - SLIST_INSERT_HEAD(&target->luns, lun, - lun_link); - } - lunid++; - /* Before Issuing READ CAPACITY 16, - * check Device type. - */ - xpt_setup_ccb(&cgd.ccb_h, ccb->ccb_h.path, - CAM_PRIORITY_NORMAL); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)&cgd); + /* + * Determine if the device is EEDP capable. + * + * If this flag is set in the inquiry data, + * the device supports protection information, + * and must support the 16 byte read + * capacity command, otherwise continue without + * sending read cap 16 + */ + if ((cgd->inq_data.spc3_flags & SPC3_SID_PROTECT) == 0) + return; - /* - * If this flag is set in the inquiry data, - * the device supports protection information, - * and must support the 16 byte read - * capacity command, otherwise continue without - * sending read cap 16 - */ + /* + * Issue a READ CAPACITY 16 command. This info + * is used to determine if the LUN is formatted + * for EEDP support. + */ + ccb = xpt_alloc_ccb_nowait(); + if (ccb == NULL) { + mps_dprint(sc, MPS_ERROR, "Unable to alloc CCB " + "for EEDP support.\n"); + return; + } - xpt_path_string(ccb->ccb_h.path, path_str, - sizeof(path_str)); + if (xpt_create_path(&local_path, xpt_periph, + pathid, targetid, lunid) != CAM_REQ_CMP) { + mps_dprint(sc, MPS_ERROR, "Unable to create " + "path for EEDP support\n"); + xpt_free_ccb(ccb); + return; + } - if ((cgd.inq_data.spc3_flags & - SPC3_SID_PROTECT) == 0) { - xpt_free_path(ccb->ccb_h.path); - xpt_free_ccb(ccb); - continue; - } - - mps_dprint(sc, MPS_XINFO, - "Sending read cap: path %s" - " handle %d\n", path_str, target->handle ); - - /* - * Issue a READ CAPACITY 16 command for the LUN. - * The mpssas_read_cap_done function will load - * the read cap info into the LUN struct. - */ - rcap_buf = - malloc(sizeof(struct scsi_read_capacity_eedp), - M_MPT2, M_NOWAIT| M_ZERO); - if (rcap_buf == NULL) { - mps_dprint(sc, MPS_ERROR, "Unable to alloc read " - "capacity buffer for EEDP support.\n"); - xpt_free_path(ccb->ccb_h.path); - xpt_free_ccb(ccb); - return; - } - csio = &ccb->csio; - csio->ccb_h.func_code = XPT_SCSI_IO; - csio->ccb_h.flags = CAM_DIR_IN; - csio->ccb_h.retry_count = 4; - csio->ccb_h.cbfcnp = mpssas_read_cap_done; - csio->ccb_h.timeout = 60000; - csio->data_ptr = (uint8_t *)rcap_buf; - csio->dxfer_len = sizeof(struct - scsi_read_capacity_eedp); - csio->sense_len = MPS_SENSE_LEN; - csio->cdb_len = sizeof(*scsi_cmd); - csio->tag_action = MSG_SIMPLE_Q_TAG; - - scsi_cmd = (struct scsi_read_capacity_16 *) - &csio->cdb_io.cdb_bytes; - bzero(scsi_cmd, sizeof(*scsi_cmd)); - scsi_cmd->opcode = 0x9E; - scsi_cmd->service_action = SRC16_SERVICE_ACTION; - ((uint8_t *)scsi_cmd)[13] = sizeof(struct - scsi_read_capacity_eedp); + /* + * If LUN is already in list, don't create a new + * one. + */ + found_lun = FALSE; + SLIST_FOREACH(lun, &target->luns, lun_link) { + if (lun->lun_id == lunid) { + found_lun = TRUE; + break; + } + } + if (!found_lun) { + lun = malloc(sizeof(struct mpssas_lun), M_MPT2, + M_NOWAIT | M_ZERO); + if (lun == NULL) { + mps_dprint(sc, MPS_ERROR, + "Unable to alloc LUN for EEDP support.\n"); + xpt_free_path(local_path); + xpt_free_ccb(ccb); + return; + } + lun->lun_id = lunid; + SLIST_INSERT_HEAD(&target->luns, lun, + lun_link); + } - /* - * Set the path, target and lun IDs for the READ - * CAPACITY request. - */ - ccb->ccb_h.path_id = - xpt_path_path_id(ccb->ccb_h.path); - ccb->ccb_h.target_id = - xpt_path_target_id(ccb->ccb_h.path); - ccb->ccb_h.target_lun = - xpt_path_lun_id(ccb->ccb_h.path); + xpt_path_string(local_path, path_str, sizeof(path_str)); + mps_dprint(sc, MPS_INFO, "Sending read cap: path %s handle %d\n", + path_str, target->handle); - ccb->ccb_h.ppriv_ptr1 = sassc; - xpt_action(ccb); - } else { - xpt_free_path(ccb->ccb_h.path); - xpt_free_ccb(ccb); - } - } while (found_periph); + /* + * Issue a READ CAPACITY 16 command for the LUN. + * The mpssas_read_cap_done function will load + * the read cap info into the LUN struct. + */ + rcap_buf = malloc(sizeof(struct scsi_read_capacity_eedp), + M_MPT2, M_NOWAIT | M_ZERO); + if (rcap_buf == NULL) { + mps_dprint(sc, MPS_FAULT, + "Unable to alloc read capacity buffer for EEDP support.\n"); + xpt_free_path(ccb->ccb_h.path); + xpt_free_ccb(ccb); + return; } -} + xpt_setup_ccb(&ccb->ccb_h, local_path, CAM_PRIORITY_XPT); + csio = &ccb->csio; + csio->ccb_h.func_code = XPT_SCSI_IO; + csio->ccb_h.flags = CAM_DIR_IN; + csio->ccb_h.retry_count = 4; + csio->ccb_h.cbfcnp = mpssas_read_cap_done; + csio->ccb_h.timeout = 60000; + csio->data_ptr = (uint8_t *)rcap_buf; + csio->dxfer_len = sizeof(struct scsi_read_capacity_eedp); + csio->sense_len = MPS_SENSE_LEN; + csio->cdb_len = sizeof(*scsi_cmd); + csio->tag_action = MSG_SIMPLE_Q_TAG; + + scsi_cmd = (struct scsi_read_capacity_16 *)&csio->cdb_io.cdb_bytes; + bzero(scsi_cmd, sizeof(*scsi_cmd)); + scsi_cmd->opcode = 0x9E; + scsi_cmd->service_action = SRC16_SERVICE_ACTION; + ((uint8_t *)scsi_cmd)[13] = sizeof(struct scsi_read_capacity_eedp); + ccb->ccb_h.ppriv_ptr1 = sassc; + xpt_action(ccb); +} static void mpssas_read_cap_done(struct cam_periph *periph, union ccb *done_ccb) @@ -3556,7 +3433,8 @@ mpssas_read_cap_done(struct cam_periph * xpt_free_path(done_ccb->ccb_h.path); xpt_free_ccb(done_ccb); } -#endif /* __FreeBSD_version >= 1000006 */ +#endif /* (__FreeBSD_version < 901503) || \ + ((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000006)) */ int mpssas_startup(struct mps_softc *sc) Modified: head/sys/dev/mps/mps_sas.h ============================================================================== --- head/sys/dev/mps/mps_sas.h Mon Jul 22 18:18:21 2013 (r253548) +++ head/sys/dev/mps/mps_sas.h Mon Jul 22 18:37:07 2013 (r253549) @@ -87,7 +87,6 @@ struct mpssas_softc { #define MPSSAS_DISCOVERY_TIMEOUT_PENDING (1 << 2) #define MPSSAS_QUEUE_FROZEN (1 << 3) #define MPSSAS_SHUTDOWN (1 << 4) -#define MPSSAS_SCANTHREAD (1 << 5) struct mpssas_target *targets; struct cam_devq *devq; struct cam_sim *sim; @@ -101,9 +100,6 @@ struct mpssas_softc { u_int tm_count; struct proc *sysctl_proc; - TAILQ_HEAD(, ccb_hdr) ccb_scanq; - struct proc *rescan_thread; - struct taskqueue *ev_tq; struct task ev_task; TAILQ_HEAD(, mps_fw_event_work) ev_queue; Modified: head/sys/dev/mps/mps_sas_lsi.c ============================================================================== --- head/sys/dev/mps/mps_sas_lsi.c Mon Jul 22 18:18:21 2013 (r253548) +++ head/sys/dev/mps/mps_sas_lsi.c Mon Jul 22 18:37:07 2013 (r253549) @@ -699,7 +699,10 @@ mpssas_add_device(struct mps_softc *sc, mps_dprint(sc, MPS_MAPPING, "Found device <%s> <%s> <0x%04x> <%d/%d>\n", devstring, mps_describe_table(mps_linkrate_names, targ->linkrate), targ->handle, targ->encl_handle, targ->encl_slot); + +#if __FreeBSD_version < 1000039 if ((sassc->flags & MPSSAS_IN_STARTUP) == 0) +#endif mpssas_rescan_target(sc, targ); mps_dprint(sc, MPS_MAPPING, "Target id 0x%x added\n", targ->tid); out: Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Jul 22 18:18:21 2013 (r253548) +++ head/sys/sys/param.h Mon Jul 22 18:37:07 2013 (r253549) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000038 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000039 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 18:41:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 79A4EAAD; Mon, 22 Jul 2013 18:41:54 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6A0BB2DF4; Mon, 22 Jul 2013 18:41:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MIfs52075670; Mon, 22 Jul 2013 18:41:54 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MIfsoQ075667; Mon, 22 Jul 2013 18:41:54 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201307221841.r6MIfsoQ075667@svn.freebsd.org> From: "Kenneth D. Merry" Date: Mon, 22 Jul 2013 18:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253550 - head/sys/dev/mps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 18:41:54 -0000 Author: ken Date: Mon Jul 22 18:41:53 2013 New Revision: 253550 URL: http://svnweb.freebsd.org/changeset/base/253550 Log: Merge in phase 14+ -> 16 mps driver fixes from LSI: --------------------------------------------------------------- System panics during a Port reset with ouststanding I/O --------------------------------------------------------------- It is possible to call mps_mapping_free_memory after this memory is already freed, causing a panic. Removed this extra call to mps_mappiing_free_memory and call mps_mapping_exit in place of the mps_mapping_free_memory call so that any outstanding mapping items can be flushed before memory is freed. --------------------------------------------------------------- Correct memory leak during a Port reset with ouststanding I/O --------------------------------------------------------------- In mps_reinit function, the mapping memory was not being freed before being re-allocated. Added line to call the memory free function for mapping memory. --------------------------------------------------------------- Use CAM_SIM_QUEUED flag in Driver IO path. --------------------------------------------------------------- This flag informs the XPT that successful abort of a CCB requires an abort ccb to be issued to the SIM. While processing SCSI IO's, set the CAM_SIM_QUEUED flag in the status for the IO. When the command completes, clear this flag. --------------------------------------------------------------- Check for CAM_REQ_INPROG in I/O path. --------------------------------------------------------------- Added a check in mpssas_action_scsiio for the In Progress status for the IO. If this flag is set, the IO has already been aborted by the upper layer (before CAM_SIM_QUEUED was set) and there is no need to send the IO. The request will be completed without error. --------------------------------------------------------------- Improve "doorbell handshake method" for mps_get_iocfacts --------------------------------------------------------------- Removed call to get Port Facts since this information is not used currently. Added mps_iocfacts_allocate function to allocate memory that is based on IOC Facts data. Added mps_iocfacts_free function to free memory that is based on IOC Facts data. Both of the functions are used when a Diag Reset is performed or when the driver is attached/detached. This is needed in case IOC Facts changes after a Diag Reset, which could happen if FW is upgraded. Moved call of mps_bases_static_config_pages from the attach routine to after the IOC is ready to process accesses based on the new memory allocations (instead of polling through the Doorbell). --------------------------------------------------------------- Set TimeStamp in INIT message in millisecond format Set the IOC --------------------------------------------------------------- --------------------------------------------------------------- Prefer mps_wait_command to mps_request_polled --------------------------------------------------------------- Instead of using mps_request_polled, call mps_wait_command whenever possible. Change the mps_wait_command function to check the current context and either use interrupt context or poll if required by using the pause or DELAY function. Added a check after waiting 50mSecs to see if the command has timed out. This is only done if polliing, the msleep command will automatically timeout if the command has taken too long to complete. --------------------------------------------------------------- Integrated RAID: Volume Activation Failed error message is displayed though the volume has been activated. --------------------------------------------------------------- Instead of failing an IOCTL request that does not have a large enough buffer to hold the complete reply, copy as much data from the reply as possible into the user's buffer and log a message saying that the user's buffer was smaller than the returned data. --------------------------------------------------------------- mapping_add_new_device failure due to persistent table FULL --------------------------------------------------------------- When a new device is added, if it is determined that the device persistent table is being used and is full, instead of displaying a message for this condition every time, only log a message if the MPS_INFO bit is set in the debug_flags. Submitted by: LSI MFC after: 1 week Modified: head/sys/dev/mps/mps.c head/sys/dev/mps/mps_config.c head/sys/dev/mps/mps_mapping.c head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mps_sas_lsi.c head/sys/dev/mps/mps_user.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Mon Jul 22 18:37:07 2013 (r253549) +++ head/sys/dev/mps/mps.c Mon Jul 22 18:41:53 2013 (r253550) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -61,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -73,13 +75,19 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include static int mps_diag_reset(struct mps_softc *sc, int sleep_flag); static int mps_init_queues(struct mps_softc *sc); static int mps_message_unit_reset(struct mps_softc *sc, int sleep_flag); static int mps_transition_operational(struct mps_softc *sc); +static int mps_iocfacts_allocate(struct mps_softc *sc, uint8_t attaching); +static void mps_iocfacts_free(struct mps_softc *sc); static void mps_startup(void *arg); static int mps_send_iocinit(struct mps_softc *sc); +static int mps_alloc_queues(struct mps_softc *sc); +static int mps_alloc_replies(struct mps_softc *sc); +static int mps_alloc_requests(struct mps_softc *sc); static int mps_attach_log(struct mps_softc *sc); static __inline void mps_complete_command(struct mps_softc *sc, struct mps_command *cm); @@ -89,6 +97,7 @@ static void mps_config_complete(struct m static void mps_periodic(void *); static int mps_reregister_events(struct mps_softc *sc); static void mps_enqueue_request(struct mps_softc *sc, struct mps_command *cm); +static int mps_get_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts); static int mps_wait_db_ack(struct mps_softc *sc, int timeout, int sleep_flag); SYSCTL_NODE(_hw, OID_AUTO, mps, CTLFLAG_RD, 0, "MPS Driver Parameters"); @@ -149,7 +158,8 @@ mps_diag_reset(struct mps_softc *sc,int mpt2_reset_magic[i]); /* wait 100 msec */ if (mtx_owned(&sc->mps_mtx) && sleep_flag == CAN_SLEEP) - msleep(&sc->msleep_fake_chan, &sc->mps_mtx, 0, "mpsdiag", hz/10); + msleep(&sc->msleep_fake_chan, &sc->mps_mtx, 0, + "mpsdiag", hz/10); else if (sleep_flag == CAN_SLEEP) pause("mpsdiag", hz/10); else @@ -173,7 +183,8 @@ mps_diag_reset(struct mps_softc *sc,int for (i = 0; i < 60000; i++) { /* wait 50 msec */ if (mtx_owned(&sc->mps_mtx) && sleep_flag == CAN_SLEEP) - msleep(&sc->msleep_fake_chan, &sc->mps_mtx, 0, "mpsdiag", hz/20); + msleep(&sc->msleep_fake_chan, &sc->mps_mtx, 0, + "mpsdiag", hz/20); else if (sleep_flag == CAN_SLEEP) pause("mpsdiag", hz/20); else @@ -303,9 +314,357 @@ mps_transition_operational(struct mps_so return (error); } +/* + * This is called during attach and when re-initializing due to a Diag Reset. + * IOC Facts is used to allocate many of the structures needed by the driver. + * If called from attach, de-allocation is not required because the driver has + * not allocated any structures yet, but if called from a Diag Reset, previously + * allocated structures based on IOC Facts will need to be freed and re- + * allocated bases on the latest IOC Facts. + */ +static int +mps_iocfacts_allocate(struct mps_softc *sc, uint8_t attaching) +{ + int error, i; + Mpi2IOCFactsReply_t saved_facts; + uint8_t saved_mode, reallocating; + struct mpssas_lun *lun, *lun_tmp; + struct mpssas_target *targ; + + mps_dprint(sc, MPS_TRACE, "%s\n", __func__); + + /* Save old IOC Facts and then only reallocate if Facts have changed */ + if (!attaching) { + bcopy(sc->facts, &saved_facts, sizeof(MPI2_IOC_FACTS_REPLY)); + } + + /* + * Get IOC Facts. In all cases throughout this function, panic if doing + * a re-initialization and only return the error if attaching so the OS + * can handle it. + */ + if ((error = mps_get_iocfacts(sc, sc->facts)) != 0) { + if (attaching) { + mps_dprint(sc, MPS_FAULT, "%s failed to get IOC Facts " + "with error %d\n", __func__, error); + return (error); + } else { + panic("%s failed to get IOC Facts with error %d\n", + __func__, error); + } + } + + mps_print_iocfacts(sc, sc->facts); + + snprintf(sc->fw_version, sizeof(sc->fw_version), + "%02d.%02d.%02d.%02d", + sc->facts->FWVersion.Struct.Major, + sc->facts->FWVersion.Struct.Minor, + sc->facts->FWVersion.Struct.Unit, + sc->facts->FWVersion.Struct.Dev); + + mps_printf(sc, "Firmware: %s, Driver: %s\n", sc->fw_version, + MPS_DRIVER_VERSION); + mps_printf(sc, "IOCCapabilities: %b\n", sc->facts->IOCCapabilities, + "\20" "\3ScsiTaskFull" "\4DiagTrace" "\5SnapBuf" "\6ExtBuf" + "\7EEDP" "\10BiDirTarg" "\11Multicast" "\14TransRetry" "\15IR" + "\16EventReplay" "\17RaidAccel" "\20MSIXIndex" "\21HostDisc"); + + /* + * If the chip doesn't support event replay then a hard reset will be + * required to trigger a full discovery. Do the reset here then + * retransition to Ready. A hard reset might have already been done, + * but it doesn't hurt to do it again. Only do this if attaching, not + * for a Diag Reset. + */ + if (attaching) { + if ((sc->facts->IOCCapabilities & + MPI2_IOCFACTS_CAPABILITY_EVENT_REPLAY) == 0) { + mps_diag_reset(sc, NO_SLEEP); + if ((error = mps_transition_ready(sc)) != 0) { + mps_dprint(sc, MPS_FAULT, "%s failed to " + "transition to ready with error %d\n", + __func__, error); + return (error); + } + } + } + + /* + * Set flag if IR Firmware is loaded. If the RAID Capability has + * changed from the previous IOC Facts, log a warning, but only if + * checking this after a Diag Reset and not during attach. + */ + saved_mode = sc->ir_firmware; + if (sc->facts->IOCCapabilities & + MPI2_IOCFACTS_CAPABILITY_INTEGRATED_RAID) + sc->ir_firmware = 1; + if (!attaching) { + if (sc->ir_firmware != saved_mode) { + mps_dprint(sc, MPS_FAULT, "%s new IR/IT mode in IOC " + "Facts does not match previous mode\n", __func__); + } + } + + /* Only deallocate and reallocate if relevant IOC Facts have changed */ + reallocating = FALSE; + if ((!attaching) && + ((saved_facts.MsgVersion != sc->facts->MsgVersion) || + (saved_facts.HeaderVersion != sc->facts->HeaderVersion) || + (saved_facts.MaxChainDepth != sc->facts->MaxChainDepth) || + (saved_facts.RequestCredit != sc->facts->RequestCredit) || + (saved_facts.ProductID != sc->facts->ProductID) || + (saved_facts.IOCCapabilities != sc->facts->IOCCapabilities) || + (saved_facts.IOCRequestFrameSize != + sc->facts->IOCRequestFrameSize) || + (saved_facts.MaxTargets != sc->facts->MaxTargets) || + (saved_facts.MaxSasExpanders != sc->facts->MaxSasExpanders) || + (saved_facts.MaxEnclosures != sc->facts->MaxEnclosures) || + (saved_facts.HighPriorityCredit != sc->facts->HighPriorityCredit) || + (saved_facts.MaxReplyDescriptorPostQueueDepth != + sc->facts->MaxReplyDescriptorPostQueueDepth) || + (saved_facts.ReplyFrameSize != sc->facts->ReplyFrameSize) || + (saved_facts.MaxVolumes != sc->facts->MaxVolumes) || + (saved_facts.MaxPersistentEntries != + sc->facts->MaxPersistentEntries))) { + reallocating = TRUE; + } + + /* + * Some things should be done if attaching or re-allocating after a Diag + * Reset, but are not needed after a Diag Reset if the FW has not + * changed. + */ + if (attaching || reallocating) { + /* + * Check if controller supports FW diag buffers and set flag to + * enable each type. + */ + if (sc->facts->IOCCapabilities & + MPI2_IOCFACTS_CAPABILITY_DIAG_TRACE_BUFFER) + sc->fw_diag_buffer_list[MPI2_DIAG_BUF_TYPE_TRACE]. + enabled = TRUE; + if (sc->facts->IOCCapabilities & + MPI2_IOCFACTS_CAPABILITY_SNAPSHOT_BUFFER) + sc->fw_diag_buffer_list[MPI2_DIAG_BUF_TYPE_SNAPSHOT]. + enabled = TRUE; + if (sc->facts->IOCCapabilities & + MPI2_IOCFACTS_CAPABILITY_EXTENDED_BUFFER) + sc->fw_diag_buffer_list[MPI2_DIAG_BUF_TYPE_EXTENDED]. + enabled = TRUE; + + /* + * Set flag if EEDP is supported and if TLR is supported. + */ + if (sc->facts->IOCCapabilities & MPI2_IOCFACTS_CAPABILITY_EEDP) + sc->eedp_enabled = TRUE; + if (sc->facts->IOCCapabilities & MPI2_IOCFACTS_CAPABILITY_TLR) + sc->control_TLR = TRUE; + + /* + * Size the queues. Since the reply queues always need one free + * entry, we'll just deduct one reply message here. + */ + sc->num_reqs = MIN(MPS_REQ_FRAMES, sc->facts->RequestCredit); + sc->num_replies = MIN(MPS_REPLY_FRAMES + MPS_EVT_REPLY_FRAMES, + sc->facts->MaxReplyDescriptorPostQueueDepth) - 1; + + /* + * Initialize all Tail Queues + */ + TAILQ_INIT(&sc->req_list); + TAILQ_INIT(&sc->high_priority_req_list); + TAILQ_INIT(&sc->chain_list); + TAILQ_INIT(&sc->tm_list); + } + + /* + * If doing a Diag Reset and the FW is significantly different + * (reallocating will be set above in IOC Facts comparison), then all + * buffers based on the IOC Facts will need to be freed before they are + * reallocated. + */ + if (reallocating) { + mps_iocfacts_free(sc); + + /* + * The number of targets is based on IOC Facts, so free all of + * the allocated LUNs for each target and then the target buffer + * itself. + */ + for (i=0; i< saved_facts.MaxTargets; i++) { + targ = &sc->sassc->targets[i]; + SLIST_FOREACH_SAFE(lun, &targ->luns, lun_link, + lun_tmp) { + free(lun, M_MPT2); + } + } + free(sc->sassc->targets, M_MPT2); + + sc->sassc->targets = malloc(sizeof(struct mpssas_target) * + sc->facts->MaxTargets, M_MPT2, M_WAITOK|M_ZERO); + if (!sc->sassc->targets) { + panic("%s failed to alloc targets with error %d\n", + __func__, ENOMEM); + } + } + + /* + * Any deallocation has been completed. Now start reallocating + * if needed. Will only need to reallocate if attaching or if the new + * IOC Facts are different from the previous IOC Facts after a Diag + * Reset. Targets have already been allocated above if needed. + */ + if (attaching || reallocating) { + if (((error = mps_alloc_queues(sc)) != 0) || + ((error = mps_alloc_replies(sc)) != 0) || + ((error = mps_alloc_requests(sc)) != 0)) { + if (attaching ) { + mps_dprint(sc, MPS_FAULT, "%s failed to alloc " + "queues with error %d\n", __func__, error); + mps_free(sc); + return (error); + } else { + panic("%s failed to alloc queues with error " + "%d\n", __func__, error); + } + } + } + + /* Always initialize the queues */ + bzero(sc->free_queue, sc->fqdepth * 4); + mps_init_queues(sc); + + /* + * Always get the chip out of the reset state, but only panic if not + * attaching. If attaching and there is an error, that is handled by + * the OS. + */ + error = mps_transition_operational(sc); + if (error != 0) { + if (attaching) { + mps_printf(sc, "%s failed to transition to operational " + "with error %d\n", __func__, error); + mps_free(sc); + return (error); + } else { + panic("%s failed to transition to operational with " + "error %d\n", __func__, error); + } + } + + /* + * Finish the queue initialization. + * These are set here instead of in mps_init_queues() because the + * IOC resets these values during the state transition in + * mps_transition_operational(). The free index is set to 1 + * because the corresponding index in the IOC is set to 0, and the + * IOC treats the queues as full if both are set to the same value. + * Hence the reason that the queue can't hold all of the possible + * replies. + */ + sc->replypostindex = 0; + mps_regwrite(sc, MPI2_REPLY_FREE_HOST_INDEX_OFFSET, sc->replyfreeindex); + mps_regwrite(sc, MPI2_REPLY_POST_HOST_INDEX_OFFSET, 0); + + /* + * Attach the subsystems so they can prepare their event masks. + */ + /* XXX Should be dynamic so that IM/IR and user modules can attach */ + if (attaching) { + if (((error = mps_attach_log(sc)) != 0) || + ((error = mps_attach_sas(sc)) != 0) || + ((error = mps_attach_user(sc)) != 0)) { + mps_printf(sc, "%s failed to attach all subsystems: " + "error %d\n", __func__, error); + mps_free(sc); + return (error); + } + + if ((error = mps_pci_setup_interrupts(sc)) != 0) { + mps_printf(sc, "%s failed to setup interrupts\n", + __func__); + mps_free(sc); + return (error); + } + } + + /* + * Set flag if this is a WD controller. This shouldn't ever change, but + * reset it after a Diag Reset, just in case. + */ + sc->WD_available = FALSE; + if (pci_get_device(sc->mps_dev) == MPI2_MFGPAGE_DEVID_SSS6200) + sc->WD_available = TRUE; + + return (error); +} + +/* + * This is called if memory is being free (during detach for example) and when + * buffers need to be reallocated due to a Diag Reset. + */ +static void +mps_iocfacts_free(struct mps_softc *sc) +{ + struct mps_command *cm; + int i; + + mps_dprint(sc, MPS_TRACE, "%s\n", __func__); + + if (sc->post_busaddr != 0) + bus_dmamap_unload(sc->queues_dmat, sc->queues_map); + if (sc->post_queue != NULL) + bus_dmamem_free(sc->queues_dmat, sc->post_queue, + sc->queues_map); + if (sc->queues_dmat != NULL) + bus_dma_tag_destroy(sc->queues_dmat); + + if (sc->chain_busaddr != 0) + bus_dmamap_unload(sc->chain_dmat, sc->chain_map); + if (sc->chain_frames != NULL) + bus_dmamem_free(sc->chain_dmat, sc->chain_frames, + sc->chain_map); + if (sc->chain_dmat != NULL) + bus_dma_tag_destroy(sc->chain_dmat); + + if (sc->sense_busaddr != 0) + bus_dmamap_unload(sc->sense_dmat, sc->sense_map); + if (sc->sense_frames != NULL) + bus_dmamem_free(sc->sense_dmat, sc->sense_frames, + sc->sense_map); + if (sc->sense_dmat != NULL) + bus_dma_tag_destroy(sc->sense_dmat); + + if (sc->reply_busaddr != 0) + bus_dmamap_unload(sc->reply_dmat, sc->reply_map); + if (sc->reply_frames != NULL) + bus_dmamem_free(sc->reply_dmat, sc->reply_frames, + sc->reply_map); + if (sc->reply_dmat != NULL) + bus_dma_tag_destroy(sc->reply_dmat); + + if (sc->req_busaddr != 0) + bus_dmamap_unload(sc->req_dmat, sc->req_map); + if (sc->req_frames != NULL) + bus_dmamem_free(sc->req_dmat, sc->req_frames, sc->req_map); + if (sc->req_dmat != NULL) + bus_dma_tag_destroy(sc->req_dmat); + + if (sc->chains != NULL) + free(sc->chains, M_MPT2); + if (sc->commands != NULL) { + for (i = 1; i < sc->num_reqs; i++) { + cm = &sc->commands[i]; + bus_dmamap_destroy(sc->buffer_dmat, cm->cm_dmamap); + } + free(sc->commands, M_MPT2); + } + if (sc->buffer_dmat != NULL) + bus_dma_tag_destroy(sc->buffer_dmat); +} + /* - * XXX Some of this should probably move to mps.c - * * The terms diag reset and hard reset are used interchangeably in the MPI * docs to mean resetting the controller chip. In this code diag reset * cleans everything up, and the hard reset function just sends the reset @@ -317,7 +676,6 @@ int mps_reinit(struct mps_softc *sc) { int error; - uint32_t db; MPS_FUNCTRACE(sc); @@ -335,6 +693,9 @@ mps_reinit(struct mps_softc *sc) */ sc->mps_flags |= MPS_FLAGS_DIAGRESET; + /* + * Mask interrupts here. + */ mps_dprint(sc, MPS_INIT, "%s mask interrupts\n", __func__); mps_mask_intr(sc); @@ -351,39 +712,42 @@ mps_reinit(struct mps_softc *sc) /* Give the I/O subsystem special priority to get itself prepared */ mpssas_handle_reinit(sc); - /* reinitialize queues after the reset */ - bzero(sc->free_queue, sc->fqdepth * 4); - mps_init_queues(sc); - - /* get the chip out of the reset state */ - error = mps_transition_operational(sc); - if (error != 0) - /* XXXSL No need to panic here */ - panic("%s transition operational failed with error %d\n", + /* + * Get IOC Facts and allocate all structures based on this information. + * The attach function will also call mps_iocfacts_allocate at startup. + * If relevant values have changed in IOC Facts, this function will free + * all of the memory based on IOC Facts and reallocate that memory. + */ + if ((error = mps_iocfacts_allocate(sc, FALSE)) != 0) { + panic("%s IOC Facts based allocation failed with error %d\n", __func__, error); + } - /* Reinitialize the reply queue. This is delicate because this - * function is typically invoked by task mgmt completion callbacks, - * which are called by the interrupt thread. We need to make sure - * the interrupt handler loop will exit when we return to it, and - * that it will recognize the indexes we've changed. + /* + * Mapping structures will be re-allocated after getting IOC Page8, so + * free these structures here. */ - sc->replypostindex = 0; - mps_regwrite(sc, MPI2_REPLY_FREE_HOST_INDEX_OFFSET, sc->replyfreeindex); - mps_regwrite(sc, MPI2_REPLY_POST_HOST_INDEX_OFFSET, sc->replypostindex); - - db = mps_regread(sc, MPI2_DOORBELL_OFFSET); - mps_dprint(sc, MPS_INIT, "%s doorbell 0x%08x\n", __func__, db); - - mps_dprint(sc, MPS_INIT, "%s unmask interrupts post %u free %u\n", - __func__, sc->replypostindex, sc->replyfreeindex); + mps_mapping_exit(sc); + /* + * The static page function currently read is IOC Page8. Others can be + * added in future. It's possible that the values in IOC Page8 have + * changed after a Diag Reset due to user modification, so always read + * these. Interrupts are masked, so unmask them before getting config + * pages. + */ mps_unmask_intr(sc); + sc->mps_flags &= ~MPS_FLAGS_DIAGRESET; + mps_base_static_config_pages(sc); - mps_dprint(sc, MPS_INIT, "%s restarting post %u free %u\n", __func__, - sc->replypostindex, sc->replyfreeindex); + /* + * Some mapping info is based in IOC Page8 data, so re-initialize the + * mapping tables. + */ + mps_mapping_initialize(sc); - /* restart will reload the event masks clobbered by the reset, and + /* + * Restart will reload the event masks clobbered by the reset, and * then enable the port. */ mps_reregister_events(sc); @@ -392,8 +756,6 @@ mps_reinit(struct mps_softc *sc) mps_dprint(sc, MPS_INFO, "%s finished sc %p post %u free %u\n", __func__, sc, sc->replypostindex, sc->replyfreeindex); - sc->mps_flags &= ~MPS_FLAGS_DIAGRESET; - return 0; } @@ -639,48 +1001,13 @@ mps_get_iocfacts(struct mps_softc *sc, M } static int -mps_get_portfacts(struct mps_softc *sc, MPI2_PORT_FACTS_REPLY *facts, int port) -{ - MPI2_PORT_FACTS_REQUEST *request; - MPI2_PORT_FACTS_REPLY *reply; - struct mps_command *cm; - int error; - - MPS_FUNCTRACE(sc); - - if ((cm = mps_alloc_command(sc)) == NULL) - return (EBUSY); - request = (MPI2_PORT_FACTS_REQUEST *)cm->cm_req; - request->Function = MPI2_FUNCTION_PORT_FACTS; - request->PortNumber = port; - cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; - cm->cm_data = NULL; - error = mps_request_polled(sc, cm); - reply = (MPI2_PORT_FACTS_REPLY *)cm->cm_reply; - if (reply == NULL) { - mps_printf(sc, "%s NULL reply\n", __func__); - goto done; - } - if ((reply->IOCStatus & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) { - mps_printf(sc, - "%s error %d iocstatus 0x%x iocloginfo 0x%x type 0x%x\n", - __func__, error, reply->IOCStatus, reply->IOCLogInfo, - reply->PortType); - error = ENXIO; - } - bcopy(reply, facts, sizeof(MPI2_PORT_FACTS_REPLY)); -done: - mps_free_command(sc, cm); - - return (error); -} - -static int mps_send_iocinit(struct mps_softc *sc) { MPI2_IOC_INIT_REQUEST init; MPI2_DEFAULT_REPLY reply; int req_sz, reply_sz, error; + struct timeval now; + uint64_t time_in_msec; MPS_FUNCTRACE(sc); @@ -709,8 +1036,10 @@ mps_send_iocinit(struct mps_softc *sc) init.ReplyDescriptorPostQueueAddress.Low = htole32((uint32_t)sc->post_busaddr); init.ReplyFreeQueueAddress.High = 0; init.ReplyFreeQueueAddress.Low = htole32((uint32_t)sc->free_busaddr); - init.TimeStamp.High = 0; - init.TimeStamp.Low = htole32((uint32_t)time_uptime); + getmicrotime(&now); + time_in_msec = (now.tv_sec * 1000 + now.tv_usec/1000); + init.TimeStamp.High = htole32((time_in_msec >> 32) & 0xFFFFFFFF); + init.TimeStamp.Low = htole32(time_in_msec & 0xFFFFFFFF); error = mps_request_sync(sc, &init, &reply, req_sz, reply_sz, 5); if ((reply.IOCStatus & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) @@ -1124,7 +1453,7 @@ mps_setup_sysctl(struct mps_softc *sc) int mps_attach(struct mps_softc *sc) { - int i, error; + int error; mps_get_tunables(sc); @@ -1146,151 +1475,20 @@ mps_attach(struct mps_softc *sc) __func__, __LINE__); return (ENOMEM); } - if ((error = mps_get_iocfacts(sc, sc->facts)) != 0) - return (error); - - mps_print_iocfacts(sc, sc->facts); - - snprintf(sc->fw_version, sizeof(sc->fw_version), - "%02d.%02d.%02d.%02d", - sc->facts->FWVersion.Struct.Major, - sc->facts->FWVersion.Struct.Minor, - sc->facts->FWVersion.Struct.Unit, - sc->facts->FWVersion.Struct.Dev); - - mps_printf(sc, "Firmware: %s, Driver: %s\n", sc->fw_version, - MPS_DRIVER_VERSION); - mps_printf(sc, "IOCCapabilities: %b\n", sc->facts->IOCCapabilities, - "\20" "\3ScsiTaskFull" "\4DiagTrace" "\5SnapBuf" "\6ExtBuf" - "\7EEDP" "\10BiDirTarg" "\11Multicast" "\14TransRetry" "\15IR" - "\16EventReplay" "\17RaidAccel" "\20MSIXIndex" "\21HostDisc"); /* - * If the chip doesn't support event replay then a hard reset will be - * required to trigger a full discovery. Do the reset here then - * retransition to Ready. A hard reset might have already been done, - * but it doesn't hurt to do it again. - */ - if ((sc->facts->IOCCapabilities & - MPI2_IOCFACTS_CAPABILITY_EVENT_REPLAY) == 0) { - mps_diag_reset(sc, NO_SLEEP); - if ((error = mps_transition_ready(sc)) != 0) - return (error); - } - - /* - * Set flag if IR Firmware is loaded. - */ - if (sc->facts->IOCCapabilities & - MPI2_IOCFACTS_CAPABILITY_INTEGRATED_RAID) - sc->ir_firmware = 1; - - /* - * Check if controller supports FW diag buffers and set flag to enable - * each type. - */ - if (sc->facts->IOCCapabilities & - MPI2_IOCFACTS_CAPABILITY_DIAG_TRACE_BUFFER) - sc->fw_diag_buffer_list[MPI2_DIAG_BUF_TYPE_TRACE].enabled = - TRUE; - if (sc->facts->IOCCapabilities & - MPI2_IOCFACTS_CAPABILITY_SNAPSHOT_BUFFER) - sc->fw_diag_buffer_list[MPI2_DIAG_BUF_TYPE_SNAPSHOT].enabled = - TRUE; - if (sc->facts->IOCCapabilities & - MPI2_IOCFACTS_CAPABILITY_EXTENDED_BUFFER) - sc->fw_diag_buffer_list[MPI2_DIAG_BUF_TYPE_EXTENDED].enabled = - TRUE; - - /* - * Set flag if EEDP is supported and if TLR is supported. - */ - if (sc->facts->IOCCapabilities & MPI2_IOCFACTS_CAPABILITY_EEDP) - sc->eedp_enabled = TRUE; - if (sc->facts->IOCCapabilities & MPI2_IOCFACTS_CAPABILITY_TLR) - sc->control_TLR = TRUE; - - /* - * Size the queues. Since the reply queues always need one free entry, - * we'll just deduct one reply message here. - */ - sc->num_reqs = MIN(MPS_REQ_FRAMES, sc->facts->RequestCredit); - sc->num_replies = MIN(MPS_REPLY_FRAMES + MPS_EVT_REPLY_FRAMES, - sc->facts->MaxReplyDescriptorPostQueueDepth) - 1; - TAILQ_INIT(&sc->req_list); - TAILQ_INIT(&sc->high_priority_req_list); - TAILQ_INIT(&sc->chain_list); - TAILQ_INIT(&sc->tm_list); - - if (((error = mps_alloc_queues(sc)) != 0) || - ((error = mps_alloc_replies(sc)) != 0) || - ((error = mps_alloc_requests(sc)) != 0)) { - mps_printf(sc, "%s failed to alloc\n", __func__); - mps_free(sc); - return (error); - } - - if (((error = mps_init_queues(sc)) != 0) || - ((error = mps_transition_operational(sc)) != 0)) { - mps_printf(sc, "%s failed to transition operational\n", __func__); - mps_free(sc); - return (error); - } - - /* - * Finish the queue initialization. - * These are set here instead of in mps_init_queues() because the - * IOC resets these values during the state transition in - * mps_transition_operational(). The free index is set to 1 - * because the corresponding index in the IOC is set to 0, and the - * IOC treats the queues as full if both are set to the same value. - * Hence the reason that the queue can't hold all of the possible - * replies. - */ - sc->replypostindex = 0; - mps_regwrite(sc, MPI2_REPLY_FREE_HOST_INDEX_OFFSET, sc->replyfreeindex); - mps_regwrite(sc, MPI2_REPLY_POST_HOST_INDEX_OFFSET, 0); - - sc->pfacts = malloc(sizeof(MPI2_PORT_FACTS_REPLY) * - sc->facts->NumberOfPorts, M_MPT2, M_ZERO|M_WAITOK); - if(!sc->pfacts) { - device_printf(sc->mps_dev, "Cannot allocate memory %s %d\n", - __func__, __LINE__); - return (ENOMEM); - } - for (i = 0; i < sc->facts->NumberOfPorts; i++) { - if ((error = mps_get_portfacts(sc, &sc->pfacts[i], i)) != 0) { - mps_printf(sc, "%s failed to get portfacts for port %d\n", - __func__, i); - mps_free(sc); - return (error); - } - mps_print_portfacts(sc, &sc->pfacts[i]); - } - - /* Attach the subsystems so they can prepare their event masks. */ - /* XXX Should be dynamic so that IM/IR and user modules can attach */ - if (((error = mps_attach_log(sc)) != 0) || - ((error = mps_attach_sas(sc)) != 0) || - ((error = mps_attach_user(sc)) != 0)) { - mps_printf(sc, "%s failed to attach all subsystems: error %d\n", - __func__, error); - mps_free(sc); - return (error); - } - - if ((error = mps_pci_setup_interrupts(sc)) != 0) { - mps_printf(sc, "%s failed to setup interrupts\n", __func__); - mps_free(sc); + * Get IOC Facts and allocate all structures based on this information. + * A Diag Reset will also call mps_iocfacts_allocate and re-read the IOC + * Facts. If relevant values have changed in IOC Facts, this function + * will free all of the memory based on IOC Facts and reallocate that + * memory. If this fails, any allocated memory should already be freed. + */ + if ((error = mps_iocfacts_allocate(sc, TRUE)) != 0) { + mps_dprint(sc, MPS_FAULT, "%s IOC Facts based allocation " + "failed with error %d\n", __func__, error); return (error); } - /* - * The static page function currently read is ioc page8. Others can be - * added in future. - */ - mps_base_static_config_pages(sc); - /* Start the periodic watchdog check on the IOC Doorbell */ mps_periodic(sc); @@ -1333,7 +1531,9 @@ mps_startup(void *arg) mps_lock(sc); mps_unmask_intr(sc); + /* initialize device mapping tables */ + mps_base_static_config_pages(sc); mps_mapping_initialize(sc); mpssas_startup(sc); mps_unlock(sc); @@ -1416,8 +1616,7 @@ mps_detach_log(struct mps_softc *sc) int mps_free(struct mps_softc *sc) { - struct mps_command *cm; - int i, error; + int error; /* Turn off the watchdog */ mps_lock(sc); @@ -1443,62 +1642,15 @@ mps_free(struct mps_softc *sc) if (sc->facts != NULL) free(sc->facts, M_MPT2); - if (sc->pfacts != NULL) - free(sc->pfacts, M_MPT2); - - if (sc->post_busaddr != 0) - bus_dmamap_unload(sc->queues_dmat, sc->queues_map); - if (sc->post_queue != NULL) - bus_dmamem_free(sc->queues_dmat, sc->post_queue, - sc->queues_map); - if (sc->queues_dmat != NULL) - bus_dma_tag_destroy(sc->queues_dmat); - - if (sc->chain_busaddr != 0) - bus_dmamap_unload(sc->chain_dmat, sc->chain_map); - if (sc->chain_frames != NULL) - bus_dmamem_free(sc->chain_dmat, sc->chain_frames,sc->chain_map); - if (sc->chain_dmat != NULL) - bus_dma_tag_destroy(sc->chain_dmat); - - if (sc->sense_busaddr != 0) - bus_dmamap_unload(sc->sense_dmat, sc->sense_map); - if (sc->sense_frames != NULL) - bus_dmamem_free(sc->sense_dmat, sc->sense_frames,sc->sense_map); - if (sc->sense_dmat != NULL) - bus_dma_tag_destroy(sc->sense_dmat); - - if (sc->reply_busaddr != 0) - bus_dmamap_unload(sc->reply_dmat, sc->reply_map); - if (sc->reply_frames != NULL) - bus_dmamem_free(sc->reply_dmat, sc->reply_frames,sc->reply_map); - if (sc->reply_dmat != NULL) - bus_dma_tag_destroy(sc->reply_dmat); - - if (sc->req_busaddr != 0) - bus_dmamap_unload(sc->req_dmat, sc->req_map); - if (sc->req_frames != NULL) - bus_dmamem_free(sc->req_dmat, sc->req_frames, sc->req_map); - if (sc->req_dmat != NULL) - bus_dma_tag_destroy(sc->req_dmat); - - if (sc->chains != NULL) - free(sc->chains, M_MPT2); - if (sc->commands != NULL) { - for (i = 1; i < sc->num_reqs; i++) { - cm = &sc->commands[i]; - bus_dmamap_destroy(sc->buffer_dmat, cm->cm_dmamap); - } - free(sc->commands, M_MPT2); - } - if (sc->buffer_dmat != NULL) - bus_dma_tag_destroy(sc->buffer_dmat); + /* + * Free all buffers that are based on IOC Facts. A Diag Reset may need + * to free these buffers too. + */ + mps_iocfacts_free(sc); if (sc->sysctl_tree != NULL) sysctl_ctx_free(&sc->sysctl_ctx); - mps_mapping_free_memory(sc); - /* Deregister the shutdown function */ if (sc->shutdown_eh != NULL) EVENTHANDLER_DEREGISTER(shutdown_final, sc->shutdown_eh); @@ -1925,7 +2077,7 @@ mps_reregister_events(struct mps_softc * /* first, reregister events */ - for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) + for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) sc->event_mask[i] = -1; TAILQ_FOREACH(eh, &sc->event_list, eh_list) { @@ -1957,7 +2109,8 @@ mps_reregister_events(struct mps_softc * error = mps_map_command(sc, cm); - mps_dprint(sc, MPS_TRACE, "%s finished with error %d\n", __func__, error); + mps_dprint(sc, MPS_TRACE, "%s finished with error %d\n", __func__, + error); return (error); } @@ -2313,26 +2466,50 @@ mps_map_command(struct mps_softc *sc, st * be executed and enqueued automatically. Other errors come from msleep(). */ int -mps_wait_command(struct mps_softc *sc, struct mps_command *cm, int timeout) +mps_wait_command(struct mps_softc *sc, struct mps_command *cm, int timeout, + int sleep_flag) { int error, rc; + struct timeval cur_time, start_time; - mtx_assert(&sc->mps_mtx, MA_OWNED); - - if(sc->mps_flags & MPS_FLAGS_DIAGRESET) + if (sc->mps_flags & MPS_FLAGS_DIAGRESET) return EBUSY; cm->cm_complete = NULL; - cm->cm_flags |= MPS_CM_FLAGS_WAKEUP; + cm->cm_flags |= (MPS_CM_FLAGS_WAKEUP + MPS_CM_FLAGS_POLLED); error = mps_map_command(sc, cm); if ((error != 0) && (error != EINPROGRESS)) return (error); - error = msleep(cm, &sc->mps_mtx, 0, "mpswait", timeout*hz); + + // Check for context and wait for 50 mSec at a time until time has + // expired or the command has finished. If msleep can't be used, need + // to poll. + if (curthread->td_no_sleeping != 0) + sleep_flag = NO_SLEEP; + getmicrotime(&start_time); + if (mtx_owned(&sc->mps_mtx) && sleep_flag == CAN_SLEEP) { + error = msleep(cm, &sc->mps_mtx, 0, "mpswait", timeout*hz); + } else { + while ((cm->cm_flags & MPS_CM_FLAGS_COMPLETE) == 0) { + mps_intr_locked(sc); + if (sleep_flag == CAN_SLEEP) + pause("mpswait", hz/20); + else + DELAY(50000); + + getmicrotime(&cur_time); + if ((cur_time.tv_sec - start_time.tv_sec) > timeout) { + error = EWOULDBLOCK; + break; + } + } + } + if (error == EWOULDBLOCK) { mps_dprint(sc, MPS_FAULT, "Calling Reinit from %s\n", __func__); rc = mps_reinit(sc); - mps_dprint(sc, MPS_FAULT, "Reinit %s\n", - (rc == 0) ? "success" : "failed"); + mps_dprint(sc, MPS_FAULT, "Reinit %s\n", (rc == 0) ? "success" : + "failed"); error = ETIMEDOUT; } return (error); @@ -2432,7 +2609,7 @@ mps_read_config_page(struct mps_softc *s cm->cm_complete = mps_config_complete; return (mps_map_command(sc, cm)); } else { - error = mps_wait_command(sc, cm, 0); + error = mps_wait_command(sc, cm, 0, CAN_SLEEP); if (error) { mps_dprint(sc, MPS_FAULT, "Error %d reading config page\n", error); Modified: head/sys/dev/mps/mps_config.c ============================================================================== --- head/sys/dev/mps/mps_config.c Mon Jul 22 18:37:07 2013 (r253549) +++ head/sys/dev/mps/mps_config.c Mon Jul 22 18:41:53 2013 (r253550) @@ -93,12 +93,15 @@ mps_config_get_ioc_pg8(struct mps_softc request->Header.PageVersion = MPI2_IOCPAGE8_PAGEVERSION; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; - error = mps_request_polled(sc, cm); + error = mps_wait_command(sc, cm, 60, CAN_SLEEP); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ - printf("%s: poll for header completed with error %d", + /* + * If the request returns an error then we need to do a diag + * reset + */ + printf("%s: request for header completed with error %d", __func__, error); error = ENXIO; goto out; @@ -107,7 +110,10 @@ mps_config_get_ioc_pg8(struct mps_softc bcopy(reply, mpi_reply, sizeof(MPI2_CONFIG_REPLY)); if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ + /* + * If the request returns an error then we need to do a diag + * reset + */ printf("%s: header read with error; iocstatus = 0x%x\n", __func__, ioc_status); error = ENXIO; @@ -144,12 +150,16 @@ mps_config_get_ioc_pg8(struct mps_softc goto out; } cm->cm_data = page; - error = mps_request_polled(sc, cm); + + error = mps_wait_command(sc, cm, 60, CAN_SLEEP); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ - printf("%s: poll for page completed with error %d", + /* + * If the request returns an error then we need to do a diag + * reset + */ + printf("%s: request for page completed with error %d", __func__, error); error = ENXIO; goto out; @@ -158,7 +168,10 @@ mps_config_get_ioc_pg8(struct mps_softc bcopy(reply, mpi_reply, sizeof(MPI2_CONFIG_REPLY)); if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ + /* + * If the request returns an error then we need to do a diag + * reset + */ printf("%s: page read with error; iocstatus = 0x%x\n", __func__, ioc_status); error = ENXIO; @@ -211,6 +224,11 @@ mps_config_get_man_pg10(struct mps_softc request->Header.PageVersion = MPI2_MANUFACTURING10_PAGEVERSION; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 19:21:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6900664A; Mon, 22 Jul 2013 19:21:29 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5A4182FA0; Mon, 22 Jul 2013 19:21:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MJLTe0088261; Mon, 22 Jul 2013 19:21:29 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MJLT4Y088260; Mon, 22 Jul 2013 19:21:29 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201307221921.r6MJLT4Y088260@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 22 Jul 2013 19:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253551 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 19:21:29 -0000 Author: pluknet Date: Mon Jul 22 19:21:28 2013 New Revision: 253551 URL: http://svnweb.freebsd.org/changeset/base/253551 Log: Update chipset support list for ath_hal. This adds "device ath_ar9300". PR: docs/180743 Reviewed by: adrian Modified: head/share/man/man4/ath_hal.4 Modified: head/share/man/man4/ath_hal.4 ============================================================================== --- head/share/man/man4/ath_hal.4 Mon Jul 22 18:41:53 2013 (r253550) +++ head/share/man/man4/ath_hal.4 Mon Jul 22 19:21:28 2013 (r253551) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd August 28, 2011 +.Dd July 22, 2013 .Dt ATH_HAL 4 .Os .Sh NAME @@ -56,11 +56,13 @@ or .Cd "device ath_ar9280" .Cd "device ath_ar9285" .Cd "device ath_ar9287" +.Cd "device ath_ar9300" .Cd "options AH_SUPPORT_AR5416" .Sh DESCRIPTION The hal provides hardware support for wireless network adapters based on the Atheros AR5210, AR5211, AR5212, AR5213, AR2413, AR2417, AR2425, -AR5413, AR5416, AR5418, AR5424, AR9160, AR9220, AR9280, AR9285 and AR9287 +AR5413, AR5416, AR5418, AR5424, AR9160, AR9220, AR9280, AR9285, AR9287, +AR9380, AR9390, AR9580, AR9590, AR9562 and QCA9565 chips (and companion RF/baseband parts). This code is part of the .Xr ath 4 From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 19:32:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AE71BA2C; Mon, 22 Jul 2013 19:32:42 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A02812030; Mon, 22 Jul 2013 19:32:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MJWgRi091346; Mon, 22 Jul 2013 19:32:42 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MJWgPB091345; Mon, 22 Jul 2013 19:32:42 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201307221932.r6MJWgPB091345@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 22 Jul 2013 19:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253552 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 19:32:42 -0000 Author: pluknet Date: Mon Jul 22 19:32:42 2013 New Revision: 253552 URL: http://svnweb.freebsd.org/changeset/base/253552 Log: Add TP-LINK TL-WDN4800. PR: docs/180743 Reviewed by: adrian Modified: head/share/man/man4/ath_hal.4 Modified: head/share/man/man4/ath_hal.4 ============================================================================== --- head/share/man/man4/ath_hal.4 Mon Jul 22 19:21:28 2013 (r253551) +++ head/share/man/man4/ath_hal.4 Mon Jul 22 19:32:42 2013 (r253552) @@ -130,6 +130,7 @@ module: .It "Sony PCWA-C300S AR5212 Cardbus b/g" .It "Sony PCWA-C500 AR5210 Cardbus a" .It "3Com 3CRPAG175 AR5212 CardBus a/b/g" +.It "TP-LINK TL-WDN4800 AR9380 PCIe a/b/g/n" .El .Sh SEE ALSO .Xr ath 4 From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 21:22:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 094AB964; Mon, 22 Jul 2013 21:22:31 +0000 (UTC) (envelope-from neelnatu@gmail.com) Received: from mail-ie0-x22c.google.com (mail-ie0-x22c.google.com [IPv6:2607:f8b0:4001:c03::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C06542592; Mon, 22 Jul 2013 21:22:30 +0000 (UTC) Received: by mail-ie0-f172.google.com with SMTP id 17so4227825iea.31 for ; Mon, 22 Jul 2013 14:22:30 -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:content-transfer-encoding; bh=k5QWXOCsYy/t8Txj4k2rX7RFdkn9OJ5c8QVSdy4oNmI=; b=K5thC2+8TuZf86I/g7p7IFtIAuEeahrT7F7GL7kccp82KisjSUN9fVvRwqvs+LyNMm WP4b6u5iNb79oaVFzU5k5XDlummu3dxJ1Mce2NcEn53Z/kIeJvamXg3Q9K4FJVyN0Qpy pmmPYLxHU1PEqxmKm2pdh6qjeBNKt4SJYiUmH0UcmYuyNBgyFBrN29NPmfF4dmPHMa/5 S4wPL2lJT95RSPQ1ANiOaYqcfCzNq4DA8Xf+ERow5yXYqpjZN8Mgsxnf/nLYB5ZM4pU3 upt4RW5v0VERqAGYxPEYrLfIHFAuCX1F1MtfQ20odmBdt0cZKYGsQmqtMkn61hprWOjq +j+g== MIME-Version: 1.0 X-Received: by 10.50.126.99 with SMTP id mx3mr20113282igb.48.1374528150338; Mon, 22 Jul 2013 14:22:30 -0700 (PDT) Received: by 10.42.151.74 with HTTP; Mon, 22 Jul 2013 14:22:30 -0700 (PDT) In-Reply-To: <51EB962E.3090405@FreeBSD.org> References: <201307032321.r63NLP3w059509@svn.freebsd.org> <51EABABD.8050906@FreeBSD.org> <51EB962E.3090405@FreeBSD.org> Date: Mon, 22 Jul 2013 14:22:30 -0700 Message-ID: Subject: Re: svn commit: r252646 - head/sys/amd64/amd64 From: Neel Natu To: =?ISO-8859-1?Q?Jean=2DS=E9bastien_P=E9dron?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, neel@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 21:22:31 -0000 Hi Jean-Sebastien, On Sun, Jul 21, 2013 at 1:05 AM, Jean-S=E9bastien P=E9dron wrote: > Le 20/07/2013 20:26, Neel Natu a =E9crit : > >> I would start looking by looking at the value of the page table entry >> in question (this would be 'tpte' in pmap_remove_pages()). >> >> In particular, it would be useful to identify whether this is pointing >> to a superpage mapping and if so what page within the superpage is >> triggering the "vm_page_dirty: page is invalid" panic. > > > Here's what was logged by your patch: > > va =3D 0x8007da000 > tpte =3D 0x80000000d2f834f7 > m->phys_addr =3D 0xd2eaf000 > m->valid =3D 0 > m->dirty=3D 0 > m->flags =3D 4, aflags =3D 0, oflags =3D 0 > panic: vm_page_dirty: page is invalid! > > So it corresponds to page m[175] in the superpage. I don't know if it hel= ps > but I checked the remaining pages: they all have '->valid =3D 0', except = a few > ones (265 to 267, 345, 361 to 363, 379 to 387 and 425 to 431 have '->vali= d =3D > VM_PAGE_BITS_ALL'). > Thanks a lot for that - it helped a lot! Could you revert the debug patch earlier and apply the following patch and give it a spin? Index: pmap.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 --- pmap.c (revision 253553) +++ pmap.c (working copy) @@ -4400,7 +4400,7 @@ struct rwlock *lock; int64_t bit; uint64_t inuse, bitmask; - int allfree, field, freed, idx; + int allfree, field, freed, idx, superpage; vm_paddr_t pa; if (pmap !=3D PCPU_GET(curpmap)) { @@ -4427,12 +4427,15 @@ pte =3D pmap_pdpe_to_pde(pte, pv->pv_va); tpte =3D *pte; if ((tpte & (PG_PS | PG_V)) =3D=3D PG_V) { + superpage =3D 0; ptepde =3D tpte; pte =3D (pt_entry_t *)PHYS_TO_DMAP(tpte & PG_FRAME); pte =3D &pte[pmap_pte_index(pv->pv_va)]; tpte =3D *pte; - } + } else + superpage =3D 1; + if ((tpte & PG_V) =3D=3D 0) { panic("bad pte va %lx pte %lx", pv->pv_va, tpte); @@ -4446,7 +4449,7 @@ continue; } - if (tpte & PG_PS) + if (superpage) pa =3D tpte & PG_PS_FRAME; else pa =3D tpte & PG_FRAME; @@ -4468,7 +4471,7 @@ * Update the vm_page_t clean/reference bits. */ if ((tpte & (PG_M | PG_RW)) =3D=3D (PG_M | PG_RW)) { - if ((tpte & PG_PS) !=3D 0) { + if (superpage) { for (mt =3D m; mt < &m[NBPDR / PAGE_SIZE]; mt++) vm_page_dirty(mt); } else @@ -4479,7 +4482,7 @@ /* Mark free */ pc->pc_map[field] |=3D bitmask; - if ((tpte & PG_PS) !=3D 0) { + if (superpage) { pmap_resident_count_dec(pmap, NBPDR / PAGE_SIZE); pvh =3D pa_to_pvh(tpte & PG_PS_FRAME); TAILQ_REMOVE(&pvh->pv_list, pv, pv_next); best Neel > -- > Jean-S=E9bastien P=E9dron From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 21:47:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 89DF828D; Mon, 22 Jul 2013 21:47:15 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7AEDD26D4; Mon, 22 Jul 2013 21:47:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MLlFB3031685; Mon, 22 Jul 2013 21:47:15 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MLlFaX031684; Mon, 22 Jul 2013 21:47:15 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201307222147.r6MLlFaX031684@svn.freebsd.org> From: Jeremie Le Hen Date: Mon, 22 Jul 2013 21:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253554 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 21:47:15 -0000 Author: jlh Date: Mon Jul 22 21:47:14 2013 New Revision: 253554 URL: http://svnweb.freebsd.org/changeset/base/253554 Log: Fix a panic in the racct code when munlock(2) is called with incorrect values. The racct code in sys_munlock() assumed that the boundaries provided by the userland were correct as long as vm_map_unwire() returned successfully. However the latter contains its own logic and sometimes manages to do something out of those boundaries, even if they are buggy. This change makes the racct code to use the accounting done by the vm layer, as it is done in other places such as vm_mlock(). Despite fixing the panic, Alan Cox pointed that this code is still race-y though: two simultaneous callers will produce incorrect values. Reviewed by: alc MFC after: 7 days Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Mon Jul 22 19:38:21 2013 (r253553) +++ head/sys/vm/vm_mmap.c Mon Jul 22 21:47:14 2013 (r253554) @@ -1224,6 +1224,7 @@ sys_munlock(td, uap) { vm_offset_t addr, end, last, start; vm_size_t size; + vm_map_t map; int error; error = priv_check(td, PRIV_VM_MUNLOCK); @@ -1241,7 +1242,9 @@ sys_munlock(td, uap) #ifdef RACCT if (error == KERN_SUCCESS) { PROC_LOCK(td->td_proc); - racct_sub(td->td_proc, RACCT_MEMLOCK, ptoa(end - start)); + map = &td->td_proc->p_vmspace->vm_map; + racct_set(td->td_proc, RACCT_MEMLOCK, + ptoa(pmap_wired_count(map->pmap))); PROC_UNLOCK(td->td_proc); } #endif From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 22:04:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 36A3B65D; Mon, 22 Jul 2013 22:04:03 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from mail.made4.biz (unknown [IPv6:2001:41d0:1:7018::1:3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F06372771; Mon, 22 Jul 2013 22:04:02 +0000 (UTC) Received: from 141.7.19.93.rev.sfr.net ([93.19.7.141] helo=magellan.dumbbell.fr) by mail.made4.biz with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1V1OD1-000CNA-Mc; Tue, 23 Jul 2013 00:04:00 +0200 Message-ID: <51EDAC45.8050501@FreeBSD.org> Date: Tue, 23 Jul 2013 00:03:49 +0200 From: =?ISO-8859-1?Q?Jean-S=E9bastien_P=E9dron?= User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130701 Thunderbird/17.0.7 MIME-Version: 1.0 To: Neel Natu Subject: Re: svn commit: r252646 - head/sys/amd64/amd64 References: <201307032321.r63NLP3w059509@svn.freebsd.org> <51EABABD.8050906@FreeBSD.org> <51EB962E.3090405@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2LHQVEBHPPPJGMJTKLQMG" Cc: svn-src-head@freebsd.org, neel@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 22:04:03 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2LHQVEBHPPPJGMJTKLQMG Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 22.07.2013 23:22, Neel Natu wrote: > Could you revert the debug patch earlier and apply the following patch > and give it a spin? I can't reproduce the panic with this patch :) Thank you very much, Neel!= --=20 Jean-S=E9bastien P=E9dron ------enig2LHQVEBHPPPJGMJTKLQMG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlHtrE8ACgkQa+xGJsFYOlMXpQCghhdgN+rF2pqCkXUXFKzFknsP 9OYAoJ7op3XbexQgyNSHkyWqyz61HrIu =7egS -----END PGP SIGNATURE----- ------enig2LHQVEBHPPPJGMJTKLQMG-- From owner-svn-src-head@FreeBSD.ORG Mon Jul 22 22:16:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 19773A9F; Mon, 22 Jul 2013 22:16:48 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 098F327F4; Mon, 22 Jul 2013 22:16:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MMGlQH041448; Mon, 22 Jul 2013 22:16:47 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MMGlPX041447; Mon, 22 Jul 2013 22:16:47 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201307222216.r6MMGlPX041447@svn.freebsd.org> From: Jeremie Le Hen Date: Mon, 22 Jul 2013 22:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253556 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 22:16:48 -0000 Author: jlh Date: Mon Jul 22 22:16:47 2013 New Revision: 253556 URL: http://svnweb.freebsd.org/changeset/base/253556 Log: Fix previous commit when option RACCT is not used. MFC after: 7 days Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Mon Jul 22 22:09:27 2013 (r253555) +++ head/sys/vm/vm_mmap.c Mon Jul 22 22:16:47 2013 (r253556) @@ -1224,7 +1224,9 @@ sys_munlock(td, uap) { vm_offset_t addr, end, last, start; vm_size_t size; +#ifdef RACCT vm_map_t map; +#endif int error; error = priv_check(td, PRIV_VM_MUNLOCK); From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 02:11:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AEBDF1F3; Tue, 23 Jul 2013 02:11:22 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E7CD2F8A; Tue, 23 Jul 2013 02:11:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6N2BMaS014082; Tue, 23 Jul 2013 02:11:22 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6N2BMsJ014081; Tue, 23 Jul 2013 02:11:22 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201307230211.r6N2BMsJ014081@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 23 Jul 2013 02:11:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253558 - head/sys/ia64/ia64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 02:11:22 -0000 Author: marcel Date: Tue Jul 23 02:11:22 2013 New Revision: 253558 URL: http://svnweb.freebsd.org/changeset/base/253558 Log: In pmap_mapdev(), if the physical memory range is not covered by an EFI memory descriptor, don't return NULL as the virtual address, return the direct-mapped uncacheable virtual address for it. At first, this was needed only for the Altix 350, but now even some high-end HP machines have devices mapped to physical addresses that aren't covered by the EFI memory map. Modified: head/sys/ia64/ia64/pmap.c Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Mon Jul 22 23:08:36 2013 (r253557) +++ head/sys/ia64/ia64/pmap.c Tue Jul 23 02:11:22 2013 (r253558) @@ -2451,7 +2451,7 @@ pmap_mapdev(vm_paddr_t pa, vm_size_t sz) if (md == NULL) { printf("%s: [%#lx..%#lx] not covered by memory descriptor\n", __func__, pa, pa + sz - 1); - return (NULL); + return ((void *)IA64_PHYS_TO_RR6(pa)); } if (md->md_type == EFI_MD_TYPE_FREE) { From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 02:38:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2C4B0805; Tue, 23 Jul 2013 02:38:24 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1DFC0204F; Tue, 23 Jul 2013 02:38:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6N2cNrK021051; Tue, 23 Jul 2013 02:38:23 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6N2cNtg021050; Tue, 23 Jul 2013 02:38:23 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201307230238.r6N2cNtg021050@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 23 Jul 2013 02:38:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253559 - head/sys/ia64/ia64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 02:38:24 -0000 Author: marcel Date: Tue Jul 23 02:38:23 2013 New Revision: 253559 URL: http://svnweb.freebsd.org/changeset/base/253559 Log: In ia64_mca_init(), don't limit the allocation of the info block to fall within the first 256MB of memory. The origin/reason for that limitation is not known, but it's not believed to be required for proper initialization. What is known is that the Altix 350 does not have physical memory at that address (by virtue of the address space bits). Keep the boundary at 256MB so that the info block will be covered by a single direct-mapped translation. While here, change the flags to M_NOWAIT to eliminate confusion. It does not change the behaviour of contigmalloc(). What is does is makes the flags argument explicitly say what the actual behaviour is. Modified: head/sys/ia64/ia64/mca.c Modified: head/sys/ia64/ia64/mca.c ============================================================================== --- head/sys/ia64/ia64/mca.c Tue Jul 23 02:11:22 2013 (r253558) +++ head/sys/ia64/ia64/mca.c Tue Jul 23 02:38:23 2013 (r253559) @@ -284,8 +284,8 @@ ia64_mca_init(void) } max_size = round_page(max_size); - p = (max_size) ? contigmalloc(max_size, M_TEMP, 0, 0ul, - 256*1024*1024 - 1, PAGE_SIZE, 256*1024*1024) : NULL; + p = (max_size) ? contigmalloc(max_size, M_TEMP, M_NOWAIT, 0ul, ~0ul, + PAGE_SIZE, 256*1024*1024) : NULL; if (p != NULL) { mca_info_block = IA64_PHYS_TO_RR7(ia64_tpa((u_int64_t)p)); From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 03:03:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4182DEC0; Tue, 23 Jul 2013 03:03:18 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 32FE52237; Tue, 23 Jul 2013 03:03:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6N33IJi030661; Tue, 23 Jul 2013 03:03:18 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6N33Hi1030660; Tue, 23 Jul 2013 03:03:17 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201307230303.r6N33Hi1030660@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 23 Jul 2013 03:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253560 - head/sys/ia64/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 03:03:18 -0000 Author: marcel Date: Tue Jul 23 03:03:17 2013 New Revision: 253560 URL: http://svnweb.freebsd.org/changeset/base/253560 Log: In pci_cfgregread() and pci_cfgregwrite(), multiplex the domain and bus number into the bus argument. The bus number occupies the least significant 8 bits. The PCI domain occupies the most significant 24 bits. On the Altix 350, the PCI domain is a required parameter, but changing the prototype of the pci_cfgreg*() functions to include a separate domain argument has wide-spread consequences across the supported architectures. We'd be changing a known interface. Multiplexing is an acceptable kluge to give us what we need with manageable impact. Note that the PCI bus number fits in 8 bits, so the multiplexing of the domain is a backward compatible change. Modified: head/sys/ia64/pci/pci_cfgreg.c Modified: head/sys/ia64/pci/pci_cfgreg.c ============================================================================== --- head/sys/ia64/pci/pci_cfgreg.c Tue Jul 23 02:38:23 2013 (r253559) +++ head/sys/ia64/pci/pci_cfgreg.c Tue Jul 23 03:03:17 2013 (r253560) @@ -70,7 +70,7 @@ pci_cfgregread(int bus, int slot, int fu register_t is; u_long addr; - addr = pci_sal_address(0, bus, slot, func, reg); + addr = pci_sal_address(bus >> 8, bus & 0xff, slot, func, reg); if (addr == ~0ul) return (~0); @@ -91,7 +91,7 @@ pci_cfgregwrite(int bus, int slot, int f register_t is; u_long addr; - addr = pci_sal_address(0, bus, slot, func, reg); + addr = pci_sal_address(bus >> 8, bus & 0xff, slot, func, reg); if (addr == ~0ul) return; From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 10:23:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E875D6CF; Tue, 23 Jul 2013 10:23:43 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D9E9C2561; Tue, 23 Jul 2013 10:23:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NANhIF065714; Tue, 23 Jul 2013 10:23:43 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NANhGf065713; Tue, 23 Jul 2013 10:23:43 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201307231023.r6NANhGf065713@svn.freebsd.org> From: David Chisnall Date: Tue, 23 Jul 2013 10:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253563 - head/contrib/libstdc++/include/c_std X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 10:23:44 -0000 Author: theraven Date: Tue Jul 23 10:23:43 2013 New Revision: 253563 URL: http://svnweb.freebsd.org/changeset/base/253563 Log: Add isnan() and isinf() to the global namespace in libstdc++'s . The standard (n3242, section 17.6.1.1, paragraph 4) says that, because these are declared as macros in the C specification (even though they are implemented as functions in the C++ library) they should be in the global namespace. A surprising number of configure checks rely on this. It was broken by recent cleanups to math.h. Modified: head/contrib/libstdc++/include/c_std/std_cmath.h Modified: head/contrib/libstdc++/include/c_std/std_cmath.h ============================================================================== --- head/contrib/libstdc++/include/c_std/std_cmath.h Tue Jul 23 05:11:22 2013 (r253562) +++ head/contrib/libstdc++/include/c_std/std_cmath.h Tue Jul 23 10:23:43 2013 (r253563) @@ -589,6 +589,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) { return ::__gnu_cxx::__capture_isunordered(__f1, __f2); } _GLIBCXX_END_NAMESPACE +using std::isnan; +using std::isinf; #endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */ #endif From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 10:25:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EC67793B; Tue, 23 Jul 2013 10:25:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DCAC0257A; Tue, 23 Jul 2013 10:25:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NAPYwm065987; Tue, 23 Jul 2013 10:25:34 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NAPYw8065985; Tue, 23 Jul 2013 10:25:34 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201307231025.r6NAPYw8065985@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 23 Jul 2013 10:25:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253564 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 10:25:35 -0000 Author: glebius Date: Tue Jul 23 10:25:34 2013 New Revision: 253564 URL: http://svnweb.freebsd.org/changeset/base/253564 Log: Add constant for PPP-Max-PayLoad tag. Submitted by: Dmitry Luhtionov Modified: head/sys/netgraph/ng_pppoe.c head/sys/netgraph/ng_pppoe.h Modified: head/sys/netgraph/ng_pppoe.c ============================================================================== --- head/sys/netgraph/ng_pppoe.c Tue Jul 23 10:23:43 2013 (r253563) +++ head/sys/netgraph/ng_pppoe.c Tue Jul 23 10:25:34 2013 (r253564) @@ -1887,6 +1887,7 @@ scan_tags(sessp sp, const struct pppoe_h case PTT_SRV_ERR: case PTT_SYS_ERR: case PTT_GEN_ERR: + case PTT_MAX_PAYL: break; } pt = (const struct pppoe_tag*)ptn; Modified: head/sys/netgraph/ng_pppoe.h ============================================================================== --- head/sys/netgraph/ng_pppoe.h Tue Jul 23 10:23:43 2013 (r253563) +++ head/sys/netgraph/ng_pppoe.h Tue Jul 23 10:25:34 2013 (r253564) @@ -172,6 +172,7 @@ struct ngpppoe_sts { #define PTT_AC_COOKIE (0x0104) #define PTT_VENDOR (0x0105) #define PTT_RELAY_SID (0x0110) +#define PTT_MAX_PAYL (0x0120) /* PPP-Max-Payload (RFC4638) */ #define PTT_SRV_ERR (0x0201) #define PTT_SYS_ERR (0x0202) #define PTT_GEN_ERR (0x0203) @@ -188,6 +189,7 @@ struct ngpppoe_sts { #define PTT_AC_COOKIE (0x0401) #define PTT_VENDOR (0x0501) #define PTT_RELAY_SID (0x1001) +#define PTT_MAX_PAYL (0x2001) /* PPP-Max-Payload (RFC4638) */ #define PTT_SRV_ERR (0x0102) #define PTT_SYS_ERR (0x0202) #define PTT_GEN_ERR (0x0302) From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 11:16:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 141E35BB; Tue, 23 Jul 2013 11:16:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 058D02846; Tue, 23 Jul 2013 11:16:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NBGenq081218; Tue, 23 Jul 2013 11:16:40 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NBGe6E081216; Tue, 23 Jul 2013 11:16:40 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201307231116.r6NBGe6E081216@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 23 Jul 2013 11:16:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253565 - in head/sys: kern vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 11:16:41 -0000 Author: glebius Date: Tue Jul 23 11:16:40 2013 New Revision: 253565 URL: http://svnweb.freebsd.org/changeset/base/253565 Log: Revert r249590 and in case if mp_ncpus isn't initialized use MAXCPU. This allows us to init counter zone at early stage of boot. Reviewed by: kib Tested by: Lytochkin Boris Modified: head/sys/kern/subr_counter.c head/sys/vm/uma_core.c Modified: head/sys/kern/subr_counter.c ============================================================================== --- head/sys/kern/subr_counter.c Tue Jul 23 10:25:34 2013 (r253564) +++ head/sys/kern/subr_counter.c Tue Jul 23 11:16:40 2013 (r253565) @@ -104,4 +104,4 @@ counter_startup(void) uint64_pcpu_zone = uma_zcreate("uint64 pcpu", sizeof(uint64_t), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU); } -SYSINIT(counter, SI_SUB_CPU, SI_ORDER_FOURTH, counter_startup, NULL); +SYSINIT(counter, SI_SUB_KMEM, SI_ORDER_ANY, counter_startup, NULL); Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Jul 23 10:25:34 2013 (r253564) +++ head/sys/vm/uma_core.c Tue Jul 23 11:16:40 2013 (r253565) @@ -1139,9 +1139,10 @@ keg_small_init(uma_keg_t keg) u_int shsize; if (keg->uk_flags & UMA_ZONE_PCPU) { - KASSERT(mp_ncpus > 0, ("%s: ncpus %d\n", __func__, mp_ncpus)); + u_int ncpus = mp_ncpus ? mp_ncpus : MAXCPU; + keg->uk_slabsize = sizeof(struct pcpu); - keg->uk_ppera = howmany(mp_ncpus * sizeof(struct pcpu), + keg->uk_ppera = howmany(ncpus * sizeof(struct pcpu), PAGE_SIZE); } else { keg->uk_slabsize = UMA_SLAB_SIZE; From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 12:20:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B9F72BF0; Tue, 23 Jul 2013 12:20:28 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 909272B57; Tue, 23 Jul 2013 12:20:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NCKSG1001600; Tue, 23 Jul 2013 12:20:28 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NCKSCJ001596; Tue, 23 Jul 2013 12:20:28 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201307231220.r6NCKSCJ001596@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 23 Jul 2013 12:20:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253566 - in head/usr.sbin: bsdconfig/include bsdconfig/share/media bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 12:20:28 -0000 Author: gavin Date: Tue Jul 23 12:20:27 2013 New Revision: 253566 URL: http://svnweb.freebsd.org/changeset/base/253566 Log: Remove ftp2.tr.freebsd.org, it is out of date. MFC after: 3 days Modified: head/usr.sbin/bsdconfig/include/messages.subr head/usr.sbin/bsdconfig/share/media/ftp.subr head/usr.sbin/bsdinstall/scripts/mirrorselect Modified: head/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/include/messages.subr Tue Jul 23 11:16:40 2013 (r253565) +++ head/usr.sbin/bsdconfig/include/messages.subr Tue Jul 23 12:20:27 2013 (r253566) @@ -360,7 +360,6 @@ msg_tk_desc="Tk and packages that depend msg_try_dhcp_configuration="Do you want to try DHCP configuration of the interface?" msg_try_ipv6_configuration="Do you want to try IPv6 configuration of the interface?" msg_try_sudo_only_this_once="Try sudo(8) only this once" -msg_turkey="Turkey" msg_ufs="UFS" msg_uk="UK" msg_ukraine="Ukraine" Modified: head/usr.sbin/bsdconfig/share/media/ftp.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/ftp.subr Tue Jul 23 11:16:40 2013 (r253565) +++ head/usr.sbin/bsdconfig/share/media/ftp.subr Tue Jul 23 12:20:27 2013 (r253566) @@ -174,7 +174,6 @@ f_dialog_menu_media_ftp() ' $msg_taiwan #4' 'ftp4.tw.freebsd.org' ' $msg_taiwan #6' 'ftp6.tw.freebsd.org' ' $msg_taiwan #11' 'ftp11.tw.freebsd.org' - '$msg_turkey' 'ftp2.tr.freebsd.org' '$msg_uk' 'ftp.uk.freebsd.org' ' $msg_uk #2' 'ftp2.uk.freebsd.org' ' $msg_uk #3' 'ftp3.uk.freebsd.org' Modified: head/usr.sbin/bsdinstall/scripts/mirrorselect ============================================================================== --- head/usr.sbin/bsdinstall/scripts/mirrorselect Tue Jul 23 11:16:40 2013 (r253565) +++ head/usr.sbin/bsdinstall/scripts/mirrorselect Tue Jul 23 12:20:27 2013 (r253566) @@ -136,7 +136,6 @@ MIRROR=`dialog --backtitle "FreeBSD Inst ftp://ftp4.tw.freebsd.org "Taiwan #4"\ ftp://ftp6.tw.freebsd.org "Taiwan #6"\ ftp://ftp11.tw.freebsd.org "Taiwan #11"\ - ftp://ftp2.tr.freebsd.org "Turkey #2"\ ftp://ftp.uk.freebsd.org "UK"\ ftp://ftp2.uk.freebsd.org "UK #2"\ ftp://ftp3.uk.freebsd.org "UK #3"\ From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 13:40:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D2C36368; Tue, 23 Jul 2013 13:40:27 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C39AA2EEF; Tue, 23 Jul 2013 13:40:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NDeRDi024192; Tue, 23 Jul 2013 13:40:27 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NDeRHu024191; Tue, 23 Jul 2013 13:40:27 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201307231340.r6NDeRHu024191@svn.freebsd.org> From: Luiz Otavio O Souza Date: Tue, 23 Jul 2013 13:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253568 - head/sbin/etherswitchcfg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 13:40:27 -0000 Author: loos Date: Tue Jul 23 13:40:26 2013 New Revision: 253568 URL: http://svnweb.freebsd.org/changeset/base/253568 Log: Fix the usage error message. The valid range is up to max. vlan - 1 since vlangroups starts at 0. Approved by: adrian (mentor) Modified: head/sbin/etherswitchcfg/etherswitchcfg.c Modified: head/sbin/etherswitchcfg/etherswitchcfg.c ============================================================================== --- head/sbin/etherswitchcfg/etherswitchcfg.c Tue Jul 23 12:22:37 2013 (r253567) +++ head/sbin/etherswitchcfg/etherswitchcfg.c Tue Jul 23 13:40:26 2013 (r253568) @@ -626,7 +626,9 @@ main(int argc, char *argv[]) newmode(&cfg, MODE_PORT); } else if (sscanf(argv[0], "vlangroup%d", &cfg.unit) == 1) { if (cfg.unit < 0 || cfg.unit >= cfg.info.es_nvlangroups) - errx(EX_USAGE, "port unit must be between 0 and %d", cfg.info.es_nvlangroups); + errx(EX_USAGE, + "vlangroup unit must be between 0 and %d", + cfg.info.es_nvlangroups - 1); newmode(&cfg, MODE_VLANGROUP); } else if (strcmp(argv[0], "config") == 0) { newmode(&cfg, MODE_CONFIG); From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 13:56:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EFEF5A82; Tue, 23 Jul 2013 13:56:39 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DDF672FCB; Tue, 23 Jul 2013 13:56:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NDuddN029464; Tue, 23 Jul 2013 13:56:39 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NDuc4I029458; Tue, 23 Jul 2013 13:56:38 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201307231356.r6NDuc4I029458@svn.freebsd.org> From: Luiz Otavio O Souza Date: Tue, 23 Jul 2013 13:56:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253569 - in head: sbin/etherswitchcfg sys/dev/etherswitch sys/dev/etherswitch/ip17x sys/dev/etherswitch/rtl8366 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 13:56:40 -0000 Author: loos Date: Tue Jul 23 13:56:38 2013 New Revision: 253569 URL: http://svnweb.freebsd.org/changeset/base/253569 Log: Add a new flag (ETHERSWITCH_VID_VALID) to say what vlangroups are in use. This fix the case when etherswitch is printing the information of port 0 vlan group (in port based vlan mode) with no member ports. Add the ETHERSWITCH_VID_VALID support to ip17x driver. Add the ETHERSWITCH_VID_VALID support to rt8366 driver. arswitch doesn't need to be updated as it doesn't support vlans management yet. Approved by: adrian (mentor) Modified: head/sbin/etherswitchcfg/etherswitchcfg.c head/sys/dev/etherswitch/etherswitch.h head/sys/dev/etherswitch/ip17x/ip175c.c head/sys/dev/etherswitch/ip17x/ip175d.c head/sys/dev/etherswitch/ip17x/ip17x_vlans.c head/sys/dev/etherswitch/rtl8366/rtl8366rb.c Modified: head/sbin/etherswitchcfg/etherswitchcfg.c ============================================================================== --- head/sbin/etherswitchcfg/etherswitchcfg.c Tue Jul 23 13:40:26 2013 (r253568) +++ head/sbin/etherswitchcfg/etherswitchcfg.c Tue Jul 23 13:56:38 2013 (r253569) @@ -471,8 +471,9 @@ print_vlangroup(struct cfg *cfg, int vla vg.es_vlangroup = vlangroup; if (ioctl(cfg->fd, IOETHERSWITCHGETVLANGROUP, &vg) != 0) err(EX_OSERR, "ioctl(IOETHERSWITCHGETVLANGROUP)"); - if (vg.es_vid == 0 && vg.es_member_ports == 0) + if ((vg.es_vid & ETHERSWITCH_VID_VALID) == 0) return; + vg.es_vid &= ETHERSWITCH_VID_MASK; printf("vlangroup%d:\n", vlangroup); if (cfg->conf.vlan_mode == ETHERSWITCH_VLAN_PORT) printf("\tport: %d\n", vg.es_vid); Modified: head/sys/dev/etherswitch/etherswitch.h ============================================================================== --- head/sys/dev/etherswitch/etherswitch.h Tue Jul 23 13:40:26 2013 (r253568) +++ head/sys/dev/etherswitch/etherswitch.h Tue Jul 23 13:56:38 2013 (r253569) @@ -26,6 +26,8 @@ struct etherswitch_phyreg { typedef struct etherswitch_phyreg etherswitch_phyreg_t; #define ETHERSWITCH_NAMEMAX 64 +#define ETHERSWITCH_VID_MASK 0xfff +#define ETHERSWITCH_VID_VALID (1 << 12) #define ETHERSWITCH_VLAN_ISL (1 << 0) /* ISL */ #define ETHERSWITCH_VLAN_PORT (1 << 1) /* Port based vlan */ #define ETHERSWITCH_VLAN_DOT1Q (1 << 2) /* 802.1q */ Modified: head/sys/dev/etherswitch/ip17x/ip175c.c ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip175c.c Tue Jul 23 13:40:26 2013 (r253568) +++ head/sys/dev/etherswitch/ip17x/ip175c.c Tue Jul 23 13:56:38 2013 (r253569) @@ -147,9 +147,9 @@ ip175c_dot1q_vlan_setup(struct ip17x_sof memset(vlans, 0, sizeof(vlans)); for (i = 0; i < IP17X_MAX_VLANS; i++) { v = &sc->vlan[i]; - if (v->vlanid == 0) + if ((v->vlanid & ETHERSWITCH_VID_VALID) == 0) continue; - vlans[v->vlanid] = v->ports; + vlans[v->vlanid & ETHERSWITCH_VID_MASK] = v->ports; } for (j = 0, i = 1; i <= IP17X_MAX_VLANS / 2; i++) { Modified: head/sys/dev/etherswitch/ip17x/ip175d.c ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip175d.c Tue Jul 23 13:40:26 2013 (r253568) +++ head/sys/dev/etherswitch/ip17x/ip175d.c Tue Jul 23 13:56:38 2013 (r253569) @@ -94,7 +94,8 @@ ip175d_hw_setup(struct ip17x_softc *sc) striptag[i] = 0; v = &sc->vlan[i]; - if (v->vlanid == 0 || sc->vlan_mode == 0) { + if ((v->vlanid & ETHERSWITCH_VID_VALID) == 0 || + sc->vlan_mode == 0) { /* Vlangroup disabled. Reset the filter. */ ip17x_writephy(sc->sc_dev, 22, 14 + i, i + 1); ports[i] = 0x3f; @@ -105,7 +106,8 @@ ip175d_hw_setup(struct ip17x_softc *sc) ports[i] = v->ports; /* Setup the filter, write the VLAN id. */ - ip17x_writephy(sc->sc_dev, 22, 14 + i, v->vlanid); + ip17x_writephy(sc->sc_dev, 22, 14 + i, + v->vlanid & ETHERSWITCH_VID_MASK); for (j = 0; j < MII_NPHY; j++) { if ((ports[i] & (1 << j)) == 0) Modified: head/sys/dev/etherswitch/ip17x/ip17x_vlans.c ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip17x_vlans.c Tue Jul 23 13:40:26 2013 (r253568) +++ head/sys/dev/etherswitch/ip17x/ip17x_vlans.c Tue Jul 23 13:56:38 2013 (r253569) @@ -74,7 +74,7 @@ ip17x_reset_vlans(struct ip17x_softc *sc if (((1 << phy) & sc->phymask) == 0) continue; v = &sc->vlan[i]; - v->vlanid = i++; + v->vlanid = i++ | ETHERSWITCH_VID_VALID; v->ports = (1 << sc->cpuport); for (j = 0; j < MII_NPHY; j++) { if (((1 << j) & sc->phymask) == 0) @@ -90,10 +90,10 @@ ip17x_reset_vlans(struct ip17x_softc *sc * members of vlan 1. */ v = &sc->vlan[0]; - v->vlanid = 1; - /* Set PVID for everyone. */ + v->vlanid = 1 | ETHERSWITCH_VID_VALID; + /* Set PVID to 1 for everyone. */ for (i = 0; i < sc->numports; i++) - sc->pvid[i] = v->vlanid; + sc->pvid[i] = 1; for (i = 0; i < MII_NPHY; i++) { if ((sc->phymask & (1 << i)) == 0) continue; @@ -148,11 +148,29 @@ ip17x_setvgroup(device_t dev, etherswitc return (EINVAL); /* IP175C don't support VLAN IDs > 15. */ - if (IP17X_IS_SWITCH(sc, IP175C) && vg->es_vid > IP175C_LAST_VLAN) + if (IP17X_IS_SWITCH(sc, IP175C) && + (vg->es_vid & ETHERSWITCH_VID_MASK) > IP175C_LAST_VLAN) return (EINVAL); /* Vlan ID. */ - sc->vlan[vg->es_vlangroup].vlanid = vg->es_vid; + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + for (i = 0; i < sc->info.es_nvlangroups; i++) { + /* Is this Vlan ID already set in another vlangroup ? */ + if (i != vg->es_vlangroup && + sc->vlan[i].vlanid & ETHERSWITCH_VID_VALID && + (sc->vlan[i].vlanid & ETHERSWITCH_VID_MASK) == + (vg->es_vid & ETHERSWITCH_VID_MASK)) + return (EINVAL); + } + sc->vlan[vg->es_vlangroup].vlanid = vg->es_vid & + ETHERSWITCH_VID_MASK; + /* Setting the vlanid to zero disables the vlangroup. */ + if (sc->vlan[vg->es_vlangroup].vlanid == 0) { + sc->vlan[vg->es_vlangroup].ports = 0; + return (sc->hal.ip17x_hw_setup(sc)); + } + sc->vlan[vg->es_vlangroup].vlanid |= ETHERSWITCH_VID_VALID; + } /* Member Ports. */ sc->vlan[vg->es_vlangroup].ports = 0; Modified: head/sys/dev/etherswitch/rtl8366/rtl8366rb.c ============================================================================== --- head/sys/dev/etherswitch/rtl8366/rtl8366rb.c Tue Jul 23 13:40:26 2013 (r253568) +++ head/sys/dev/etherswitch/rtl8366/rtl8366rb.c Tue Jul 23 13:56:38 2013 (r253569) @@ -619,7 +619,7 @@ rtl_getvgroup(device_t dev, etherswitch_ for (i=0; i<3; i++) vmcr[i] = rtl_readreg(dev, RTL8366RB_VMCR(i, vg->es_vlangroup)); - vg->es_vid = RTL8366RB_VMCR_VID(vmcr); + vg->es_vid = RTL8366RB_VMCR_VID(vmcr) | ETHERSWITCH_VID_VALID; vg->es_member_ports = RTL8366RB_VMCR_MEMBER(vmcr); vg->es_untagged_ports = RTL8366RB_VMCR_UNTAG(vmcr); vg->es_fid = RTL8366RB_VMCR_FID(vmcr); From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 14:02:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D26F3D12; Tue, 23 Jul 2013 14:02:39 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C35552021; Tue, 23 Jul 2013 14:02:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NE2dUN032099; Tue, 23 Jul 2013 14:02:39 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NE2dr2032094; Tue, 23 Jul 2013 14:02:39 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201307231402.r6NE2dr2032094@svn.freebsd.org> From: Luiz Otavio O Souza Date: Tue, 23 Jul 2013 14:02:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253570 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 14:02:40 -0000 Author: loos Date: Tue Jul 23 14:02:38 2013 New Revision: 253570 URL: http://svnweb.freebsd.org/changeset/base/253570 Log: Fix the arswitch instability problem. It turns out that the arswitch_writereg() routine was writing the registers in the wrong order. Revert -r241918 as the root problem is now fixed. Remove another workaround from arswitch_ar7240.c. Simplify and fix the code on arswitch_writephy() by using arswitch_writereg(). While here remove a redundant declaration from arswitchvar.h. Approved by: adrian (mentor) Modified: head/sys/dev/etherswitch/arswitch/arswitch_7240.c head/sys/dev/etherswitch/arswitch/arswitch_phy.c head/sys/dev/etherswitch/arswitch/arswitch_reg.c head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/dev/etherswitch/arswitch/arswitch_7240.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_7240.c Tue Jul 23 13:56:38 2013 (r253569) +++ head/sys/dev/etherswitch/arswitch/arswitch_7240.c Tue Jul 23 14:02:38 2013 (r253570) @@ -75,12 +75,6 @@ ar7240_hw_setup(struct arswitch_softc *s arswitch_writereg(sc->sc_dev, AR8X16_REG_CPU_PORT, AR8X16_CPU_PORT_EN | AR8X16_CPU_MIRROR_DIS); - /* - * Let things settle; probing PHY4 doesn't seem reliable - * without a litle delay. - */ - DELAY(1000); - return (0); } Modified: head/sys/dev/etherswitch/arswitch/arswitch_phy.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_phy.c Tue Jul 23 13:56:38 2013 (r253569) +++ head/sys/dev/etherswitch/arswitch/arswitch_phy.c Tue Jul 23 14:02:38 2013 (r253570) @@ -127,16 +127,13 @@ arswitch_writephy(device_t dev, int phy, return (ENXIO); ARSWITCH_LOCK(sc); - err = arswitch_writereg_lsb(dev, AR8X16_REG_MDIO_CTRL, - (data & AR8X16_MDIO_CTRL_DATA_MASK)); - if (err != 0) - goto out; - err = arswitch_writereg_msb(dev, AR8X16_REG_MDIO_CTRL, + err = arswitch_writereg(dev, AR8X16_REG_MDIO_CTRL, AR8X16_MDIO_CTRL_BUSY | AR8X16_MDIO_CTRL_MASTER_EN | AR8X16_MDIO_CTRL_CMD_WRITE | (phy << AR8X16_MDIO_CTRL_PHY_ADDR_SHIFT) | - (reg << AR8X16_MDIO_CTRL_REG_ADDR_SHIFT)); + (reg << AR8X16_MDIO_CTRL_REG_ADDR_SHIFT) | + (data & AR8X16_MDIO_CTRL_DATA_MASK)); if (err != 0) goto out; for (timeout = 100; timeout--; ) { Modified: head/sys/dev/etherswitch/arswitch/arswitch_reg.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_reg.c Tue Jul 23 13:56:38 2013 (r253569) +++ head/sys/dev/etherswitch/arswitch/arswitch_reg.c Tue Jul 23 14:02:38 2013 (r253570) @@ -72,17 +72,10 @@ arswitch_split_setpage(device_t dev, uin *phy = (((addr) >> 6) & 0x07) | 0x10; *reg = ((addr) >> 1) & 0x1f; - /* - * The earlier code would only switch the page - * over if the page were different. Experiments have - * shown that this is unstable. - * - * Hence, the page is always set here. - * - * See PR kern/172968 - */ - MDIO_WRITEREG(device_get_parent(dev), 0x18, 0, page); - sc->page = page; + if (sc->page != page) { + MDIO_WRITEREG(device_get_parent(dev), 0x18, 0, page); + sc->page = page; + } } /* @@ -171,8 +164,8 @@ arswitch_writereg(device_t dev, int addr { /* XXX Check the first write too? */ - arswitch_writereg_lsb(dev, addr, value); - return (arswitch_writereg_msb(dev, addr, value)); + arswitch_writereg_msb(dev, addr, value); + return (arswitch_writereg_lsb(dev, addr, value)); } int Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchvar.h Tue Jul 23 13:56:38 2013 (r253569) +++ head/sys/dev/etherswitch/arswitch/arswitchvar.h Tue Jul 23 14:02:38 2013 (r253570) @@ -42,8 +42,6 @@ typedef enum { #define AR8X16_IS_SWITCH(_sc, _type) \ (!!((_sc)->sc_switchtype == AR8X16_SWITCH_ ## _type)) -struct arswitch_softc; - struct arswitch_softc { struct mtx sc_mtx; /* serialize access to softc */ device_t sc_dev; From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 14:14:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C63F1347; Tue, 23 Jul 2013 14:14:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B609F20CD; Tue, 23 Jul 2013 14:14:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NEEQS2035684; Tue, 23 Jul 2013 14:14:26 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NEEP5l035673; Tue, 23 Jul 2013 14:14:25 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201307231414.r6NEEP5l035673@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 23 Jul 2013 14:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253571 - in head: sys/netinet sys/netinet6 sys/netipsec usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 14:14:27 -0000 Author: ae Date: Tue Jul 23 14:14:24 2013 New Revision: 253571 URL: http://svnweb.freebsd.org/changeset/base/253571 Log: Remove the large part of struct ipsecstat. Only few fields of this structure is used, but they already have equal fields in the struct newipsecstat, that was introduced with FAST_IPSEC and then was merged together with old ipsecstat structure. This fixes kernel stack overflow on some architectures after migration ipsecstat to PCPU counters. Reported by: Taku YAMAMOTO, Maciej Milewski Modified: head/sys/netinet/sctp_input.c head/sys/netinet/tcp_input.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/ip6_forward.c head/sys/netinet6/raw_ip6.c head/sys/netinet6/udp6_usrreq.c head/sys/netipsec/ipsec.h head/usr.bin/netstat/ipsec.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue Jul 23 14:02:38 2013 (r253570) +++ head/sys/netinet/sctp_input.c Tue Jul 23 14:14:24 2013 (r253571) @@ -5705,7 +5705,7 @@ sctp_common_input_processing(struct mbuf #ifdef INET case AF_INET: if (ipsec4_in_reject(m, &inp->ip_inp.inp)) { - IPSECSTAT_INC(in_polvio); + IPSECSTAT_INC(ips_in_polvio); SCTP_STAT_INCR(sctps_hdrops); goto out; } @@ -5714,7 +5714,7 @@ sctp_common_input_processing(struct mbuf #ifdef INET6 case AF_INET6: if (ipsec6_in_reject(m, &inp->ip_inp.inp)) { - IPSEC6STAT_INC(in_polvio); + IPSEC6STAT_INC(ips_in_polvio); SCTP_STAT_INCR(sctps_hdrops); goto out; } Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Jul 23 14:02:38 2013 (r253570) +++ head/sys/netinet/tcp_input.c Tue Jul 23 14:14:24 2013 (r253571) @@ -899,12 +899,12 @@ findpcb: #ifdef IPSEC #ifdef INET6 if (isipv6 && ipsec6_in_reject(m, inp)) { - IPSEC6STAT_INC(in_polvio); + IPSEC6STAT_INC(ips_in_polvio); goto dropunlock; } else #endif /* INET6 */ if (ipsec4_in_reject(m, inp) != 0) { - IPSECSTAT_INC(in_polvio); + IPSECSTAT_INC(ips_in_polvio); goto dropunlock; } #endif /* IPSEC */ Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Tue Jul 23 14:02:38 2013 (r253570) +++ head/sys/netinet/udp_usrreq.c Tue Jul 23 14:14:24 2013 (r253571) @@ -282,7 +282,7 @@ udp_append(struct inpcb *inp, struct ip /* Check AH/ESP integrity. */ if (ipsec4_in_reject(n, inp)) { m_freem(n); - IPSECSTAT_INC(in_polvio); + IPSECSTAT_INC(ips_in_polvio); return; } #ifdef IPSEC_NAT_T @@ -1294,7 +1294,7 @@ udp4_espdecap(struct inpcb *inp, struct if (minlen > m->m_pkthdr.len) minlen = m->m_pkthdr.len; if ((m = m_pullup(m, minlen)) == NULL) { - IPSECSTAT_INC(in_inval); + IPSECSTAT_INC(ips_in_inval); return (NULL); /* Bypass caller processing. */ } data = mtod(m, caddr_t); /* Points to ip header. */ @@ -1334,7 +1334,7 @@ udp4_espdecap(struct inpcb *inp, struct uint32_t spi; if (payload <= sizeof(struct esp)) { - IPSECSTAT_INC(in_inval); + IPSECSTAT_INC(ips_in_inval); m_freem(m); return (NULL); /* Discard. */ } @@ -1355,7 +1355,7 @@ udp4_espdecap(struct inpcb *inp, struct tag = m_tag_get(PACKET_TAG_IPSEC_NAT_T_PORTS, 2 * sizeof(uint16_t), M_NOWAIT); if (tag == NULL) { - IPSECSTAT_INC(in_nomem); + IPSECSTAT_INC(ips_in_nomem); m_freem(m); return (NULL); /* Discard. */ } Modified: head/sys/netinet6/ip6_forward.c ============================================================================== --- head/sys/netinet6/ip6_forward.c Tue Jul 23 14:02:38 2013 (r253570) +++ head/sys/netinet6/ip6_forward.c Tue Jul 23 14:14:24 2013 (r253571) @@ -120,7 +120,7 @@ ip6_forward(struct mbuf *m, int srcrt) * before forwarding packet actually. */ if (ipsec6_in_reject(m, NULL)) { - IPSEC6STAT_INC(in_polvio); + IPSEC6STAT_INC(ips_in_polvio); m_freem(m); return; } @@ -182,7 +182,7 @@ ip6_forward(struct mbuf *m, int srcrt) sp = ipsec_getpolicybyaddr(m, IPSEC_DIR_OUTBOUND, IP_FORWARDING, &error); if (sp == NULL) { - IPSEC6STAT_INC(out_inval); + IPSEC6STAT_INC(ips_out_inval); IP6STAT_INC(ip6s_cantforward); if (mcopy) { #if 0 @@ -203,7 +203,7 @@ ip6_forward(struct mbuf *m, int srcrt) /* * This packet is just discarded. */ - IPSEC6STAT_INC(out_polvio); + IPSEC6STAT_INC(ips_out_polvio); IP6STAT_INC(ip6s_cantforward); KEY_FREESP(&sp); if (mcopy) { Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Tue Jul 23 14:02:38 2013 (r253570) +++ head/sys/netinet6/raw_ip6.c Tue Jul 23 14:14:24 2013 (r253571) @@ -269,7 +269,7 @@ rip6_input(struct mbuf **mp, int *offp, */ if (n && ipsec6_in_reject(n, last)) { m_freem(n); - IPSEC6STAT_INC(in_polvio); + IPSEC6STAT_INC(ips_in_polvio); /* Do not inject data into pcb. */ } else #endif /* IPSEC */ @@ -301,7 +301,7 @@ rip6_input(struct mbuf **mp, int *offp, */ if ((last != NULL) && ipsec6_in_reject(m, last)) { m_freem(m); - IPSEC6STAT_INC(in_polvio); + IPSEC6STAT_INC(ips_in_polvio); IP6STAT_DEC(ip6s_delivered); /* Do not inject data into pcb. */ INP_RUNLOCK(last); Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Tue Jul 23 14:02:38 2013 (r253570) +++ head/sys/netinet6/udp6_usrreq.c Tue Jul 23 14:14:24 2013 (r253571) @@ -141,7 +141,7 @@ udp6_append(struct inpcb *inp, struct mb /* Check AH/ESP integrity. */ if (ipsec6_in_reject(n, inp)) { m_freem(n); - IPSEC6STAT_INC(in_polvio); + IPSEC6STAT_INC(ips_in_polvio); return; } #endif /* IPSEC */ Modified: head/sys/netipsec/ipsec.h ============================================================================== --- head/sys/netipsec/ipsec.h Tue Jul 23 14:02:38 2013 (r253570) +++ head/sys/netipsec/ipsec.h Tue Jul 23 14:14:24 2013 (r253571) @@ -217,43 +217,17 @@ struct secspacq { /* statistics for ipsec processing */ struct ipsecstat { - uint64_t in_success; /* succeeded inbound process */ - uint64_t in_polvio; - /* security policy violation for inbound process */ - uint64_t in_nosa; /* inbound SA is unavailable */ - uint64_t in_inval; /* inbound processing failed due to EINVAL */ - uint64_t in_nomem; /* inbound processing failed due to ENOBUFS */ - uint64_t in_badspi; /* failed getting a SPI */ - uint64_t in_ahreplay; /* AH replay check failed */ - uint64_t in_espreplay; /* ESP replay check failed */ - uint64_t in_ahauthsucc; /* AH authentication success */ - uint64_t in_ahauthfail; /* AH authentication failure */ - uint64_t in_espauthsucc; /* ESP authentication success */ - uint64_t in_espauthfail; /* ESP authentication failure */ - uint64_t in_esphist[256]; - uint64_t in_ahhist[256]; - uint64_t in_comphist[256]; - uint64_t out_success; /* succeeded outbound process */ - uint64_t out_polvio; - /* security policy violation for outbound process */ - uint64_t out_nosa; /* outbound SA is unavailable */ - uint64_t out_inval; /* outbound process failed due to EINVAL */ - uint64_t out_nomem; /* inbound processing failed due to ENOBUFS */ - uint64_t out_noroute; /* there is no route */ - uint64_t out_esphist[256]; - uint64_t out_ahhist[256]; - uint64_t out_comphist[256]; - - uint64_t spdcachelookup; - uint64_t spdcachemiss; - uint64_t ips_in_polvio; /* input: sec policy violation */ + uint64_t ips_in_nomem; /* input: no memory available */ + uint64_t ips_in_inval; /* input: generic error */ + uint64_t ips_out_polvio; /* output: sec policy violation */ uint64_t ips_out_nosa; /* output: SA unavailable */ uint64_t ips_out_nomem; /* output: no memory available */ uint64_t ips_out_noroute; /* output: no route available */ uint64_t ips_out_inval; /* output: generic error */ uint64_t ips_out_bundlesa; /* output: bundled SA processed */ + uint64_t ips_mbcoalesced; /* mbufs coalesced during clone */ uint64_t ips_clcoalesced; /* clusters coalesced during clone */ uint64_t ips_clcopied; /* clusters copied during clone */ Modified: head/usr.bin/netstat/ipsec.c ============================================================================== --- head/usr.bin/netstat/ipsec.c Tue Jul 23 14:02:38 2013 (r253570) +++ head/usr.bin/netstat/ipsec.c Tue Jul 23 14:14:24 2013 (r253571) @@ -166,84 +166,18 @@ static struct val2str ipsec_compnames[] { -1, NULL }, }; -static void ipsec_hist(const u_quad_t *hist, size_t histmax, - const struct val2str *name, const char *title); static void print_ipsecstats(const struct ipsecstat *ipsecstat); - -/* - * Dump IPSEC statistics structure. - */ -static void -ipsec_hist(const u_quad_t *hist, size_t histmax, const struct val2str *name, - const char *title) -{ - int first; - size_t proto; - const struct val2str *p; - - first = 1; - for (proto = 0; proto < histmax; proto++) { - if (hist[proto] <= 0) - continue; - if (first) { - printf("\t%s histogram:\n", title); - first = 0; - } - for (p = name; p && p->str; p++) { - if (p->val == (int)proto) - break; - } - if (p && p->str) { - printf("\t\t%s: %ju\n", p->str, (uintmax_t)hist[proto]); - } else { - printf("\t\t#%ld: %ju\n", (long)proto, - (uintmax_t)hist[proto]); - } - } -} - static void print_ipsecstats(const struct ipsecstat *ipsecstat) { #define p(f, m) if (ipsecstat->f || sflag <= 1) \ printf(m, (uintmax_t)ipsecstat->f, plural(ipsecstat->f)) -#define pes(f, m) if (ipsecstat->f || sflag <= 1) \ - printf(m, (uintmax_t)ipsecstat->f, plurales(ipsecstat->f)) -#define hist(f, n, t) \ - ipsec_hist((f), sizeof(f)/sizeof(f[0]), (n), (t)); - - p(in_success, "\t%ju inbound packet%s processed successfully\n"); - p(in_polvio, "\t%ju inbound packet%s violated process security " - "policy\n"); - p(in_nosa, "\t%ju inbound packet%s with no SA available\n"); - p(in_inval, "\t%ju invalid inbound packet%s\n"); - p(in_nomem, "\t%ju inbound packet%s failed due to insufficient memory\n"); - p(in_badspi, "\t%ju inbound packet%s failed getting SPI\n"); - p(in_ahreplay, "\t%ju inbound packet%s failed on AH replay check\n"); - p(in_espreplay, "\t%ju inbound packet%s failed on ESP replay check\n"); - p(in_ahauthsucc, "\t%ju inbound packet%s considered authentic\n"); - p(in_ahauthfail, "\t%ju inbound packet%s failed on authentication\n"); - hist(ipsecstat->in_ahhist, ipsec_ahnames, "AH input"); - hist(ipsecstat->in_esphist, ipsec_espnames, "ESP input"); - hist(ipsecstat->in_comphist, ipsec_compnames, "IPComp input"); - - p(out_success, "\t%ju outbound packet%s processed successfully\n"); - p(out_polvio, "\t%ju outbound packet%s violated process security " - "policy\n"); - p(out_nosa, "\t%ju outbound packet%s with no SA available\n"); - p(out_inval, "\t%ju invalid outbound packet%s\n"); - p(out_nomem, "\t%ju outbound packet%s failed due to insufficient memory\n"); - p(out_noroute, "\t%ju outbound packet%s with no route\n"); - hist(ipsecstat->out_ahhist, ipsec_ahnames, "AH output"); - hist(ipsecstat->out_esphist, ipsec_espnames, "ESP output"); - hist(ipsecstat->out_comphist, ipsec_compnames, "IPComp output"); - p(spdcachelookup, "\t%ju SPD cache lookup%s\n"); - pes(spdcachemiss, "\t%ju SPD cache miss%s\n"); -#undef pes -#undef hist p(ips_in_polvio, "\t%ju inbound packet%s violated process " "security policy\n"); + p(ips_in_nomem, "\t%ju inbound packet%s failed due to " + "insufficient memory\n"); + p(ips_in_inval, "\t%ju invalid inbound packet%s\n"); p(ips_out_polvio, "\t%ju outbound packet%s violated process " "security policy\n"); p(ips_out_nosa, "\t%ju outbound packet%s with no SA available\n"); From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 14:24:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 00DD977C; Tue, 23 Jul 2013 14:24:24 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E280B2152; Tue, 23 Jul 2013 14:24:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NEOOSa038598; Tue, 23 Jul 2013 14:24:24 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NEOMHD038582; Tue, 23 Jul 2013 14:24:22 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201307231424.r6NEOMHD038582@svn.freebsd.org> From: Luiz Otavio O Souza Date: Tue, 23 Jul 2013 14:24:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253572 - in head/sys: conf dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 14:24:25 -0000 Author: loos Date: Tue Jul 23 14:24:22 2013 New Revision: 253572 URL: http://svnweb.freebsd.org/changeset/base/253572 Log: Add the support for 802.1q and port based vlans for arswitch. Tested on: RB450G (standalone ar8316), RSPRO (standalone ar8316) and TPLink MR-3220 (ar724x integrated switch). Approved by: adrian (mentor) Obtained from: zrouter Added: head/sys/dev/etherswitch/arswitch/arswitch_vlans.c (contents, props changed) head/sys/dev/etherswitch/arswitch/arswitch_vlans.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/etherswitch/arswitch/arswitch.c head/sys/dev/etherswitch/arswitch/arswitch_7240.c head/sys/dev/etherswitch/arswitch/arswitch_8216.c head/sys/dev/etherswitch/arswitch/arswitch_8226.c head/sys/dev/etherswitch/arswitch/arswitch_8316.c head/sys/dev/etherswitch/arswitch/arswitch_reg.c head/sys/dev/etherswitch/arswitch/arswitch_reg.h head/sys/dev/etherswitch/arswitch/arswitchreg.h head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Jul 23 14:14:24 2013 (r253571) +++ head/sys/conf/files Tue Jul 23 14:24:22 2013 (r253572) @@ -1368,6 +1368,7 @@ dev/etherswitch/arswitch/arswitch_8216.c dev/etherswitch/arswitch/arswitch_8226.c optional arswitch dev/etherswitch/arswitch/arswitch_8316.c optional arswitch dev/etherswitch/arswitch/arswitch_7240.c optional arswitch +dev/etherswitch/arswitch/arswitch_vlans.c optional arswitch dev/etherswitch/etherswitch.c optional etherswitch dev/etherswitch/etherswitch_if.m optional etherswitch dev/etherswitch/ip17x/ip17x.c optional ip17x Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Tue Jul 23 14:14:24 2013 (r253571) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Tue Jul 23 14:24:22 2013 (r253572) @@ -58,6 +58,7 @@ #include #include #include +#include #include #include @@ -162,6 +163,74 @@ arswitch_attach_phys(struct arswitch_sof } static int +arswitch_reset(device_t dev) +{ + + arswitch_writereg(dev, AR8X16_REG_MASK_CTRL, + AR8X16_MASK_CTRL_SOFT_RESET); + DELAY(1000); + if (arswitch_readreg(dev, AR8X16_REG_MASK_CTRL) & + AR8X16_MASK_CTRL_SOFT_RESET) { + device_printf(dev, "unable to reset switch\n"); + return (-1); + } + return (0); +} + +static int +arswitch_set_vlan_mode(struct arswitch_softc *sc, uint32_t mode) +{ + + /* Check for invalid modes. */ + if ((mode & sc->info.es_vlan_caps) != mode) + return (EINVAL); + + switch (mode) { + case ETHERSWITCH_VLAN_DOT1Q: + sc->vlan_mode = ETHERSWITCH_VLAN_DOT1Q; + break; + case ETHERSWITCH_VLAN_PORT: + sc->vlan_mode = ETHERSWITCH_VLAN_PORT; + break; + default: + sc->vlan_mode = 0; + }; + + /* Reset VLANs. */ + arswitch_reset_vlans(sc); + + return (0); +} + +static void +arswitch_ports_init(struct arswitch_softc *sc) +{ + int port; + + /* Port0 - CPU */ + arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_STS(0), + (AR8X16_IS_SWITCH(sc, AR8216) ? + AR8X16_PORT_STS_SPEED_100 : AR8X16_PORT_STS_SPEED_1000) | + (AR8X16_IS_SWITCH(sc, AR8216) ? 0 : AR8X16_PORT_STS_RXFLOW) | + (AR8X16_IS_SWITCH(sc, AR8216) ? 0 : AR8X16_PORT_STS_TXFLOW) | + AR8X16_PORT_STS_RXMAC | + AR8X16_PORT_STS_TXMAC | + AR8X16_PORT_STS_DUPLEX); + arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_CTRL(0), + arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(0)) & + ~AR8X16_PORT_CTRL_HEADER); + + for (port = 1; port <= sc->numphys; port++) { + /* Set ports to auto negotiation. */ + arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_STS(port), + AR8X16_PORT_STS_LINK_AUTO); + arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_CTRL(port), + arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(port)) & + ~AR8X16_PORT_CTRL_HEADER); + } +} + +static int arswitch_attach(device_t dev) { struct arswitch_softc *sc; @@ -190,11 +259,8 @@ arswitch_attach(device_t dev) else return (ENXIO); - /* - * XXX these two should be part of the switch attach function - */ + /* Common defaults. */ sc->info.es_nports = 5; /* XXX technically 6, but 6th not used */ - sc->info.es_nvlangroups = 16; /* XXX Defaults for externally connected AR8316 */ sc->numphys = 4; @@ -211,34 +277,20 @@ arswitch_attach(device_t dev) (void) resource_int_value(device_get_name(dev), device_get_unit(dev), "is_gmii", &sc->is_gmii); - /* - * This requires much more setup depending upon each chip, including: - * - * + Proper reinitialisation of the PHYs; - * + Initialising the VLAN table; - * + Initialising the port access table and CPU flood/broadcast - * configuration; - * + Other things I haven't yet thought of. - */ -#ifdef NOTYET - arswitch_writereg(dev, AR8X16_REG_MASK_CTRL, - AR8X16_MASK_CTRL_SOFT_RESET); - DELAY(1000); - if (arswitch_readreg(dev, AR8X16_REG_MASK_CTRL) & - AR8X16_MASK_CTRL_SOFT_RESET) { - device_printf(dev, "unable to reset switch\n"); - return (ENXIO); - } -#endif + if (sc->numphys > AR8X16_NUM_PHYS) + sc->numphys = AR8X16_NUM_PHYS; - err = sc->hal.arswitch_hw_setup(sc); - if (err != 0) - return (err); + /* Reset the switch. */ + if (arswitch_reset(dev)) + return (ENXIO); err = sc->hal.arswitch_hw_global_setup(sc); if (err != 0) return (err); + /* Initialize the switch ports. */ + arswitch_ports_init(sc); + /* * Attach the PHYs and complete the bus enumeration. */ @@ -246,6 +298,15 @@ arswitch_attach(device_t dev) if (err != 0) return (err); + /* Default to ingress filters off. */ + err = arswitch_set_vlan_mode(sc, 0); + if (err != 0) + return (err); + + err = sc->hal.arswitch_hw_setup(sc); + if (err != 0) + return (err); + bus_generic_probe(dev); bus_enumerate_hinted_children(dev); err = bus_generic_attach(dev); @@ -428,19 +489,37 @@ arswitch_getinfo(device_t dev) static int arswitch_getport(device_t dev, etherswitch_port_t *p) { - struct arswitch_softc *sc = device_get_softc(dev); + struct arswitch_softc *sc; + struct ifmediareq *ifmr; struct mii_data *mii; - struct ifmediareq *ifmr = &p->es_ifmr; + uint32_t reg; int err; - - if (p->es_port < 0 || p->es_port >= AR8X16_NUM_PORTS) + + sc = device_get_softc(dev); + if (p->es_port < 0 || p->es_port > sc->numphys) return (ENXIO); - p->es_pvid = 0; + + ARSWITCH_LOCK(sc); + + /* Retrieve the PVID. */ + arswitch_get_pvid(sc, p->es_port, &p->es_pvid); + + /* Port flags. */ + reg = arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(p->es_port)); + if (reg & AR8X16_PORT_CTRL_DOUBLE_TAG) + p->es_flags |= ETHERSWITCH_PORT_DOUBLE_TAG; + reg >>= AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_SHIFT; + if ((reg & 0x3) == AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_ADD) + p->es_flags |= ETHERSWITCH_PORT_ADDTAG; + if ((reg & 0x3) == AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_STRIP) + p->es_flags |= ETHERSWITCH_PORT_STRIPTAG; + ARSWITCH_UNLOCK(sc); mii = arswitch_miiforport(sc, p->es_port); if (p->es_port == 0) { /* fill in fixed values for CPU port */ p->es_flags |= ETHERSWITCH_PORT_CPU; + ifmr = &p->es_ifmr; ifmr->ifm_count = 0; ifmr->ifm_current = ifmr->ifm_active = IFM_ETHER | IFM_1000_T | IFM_FDX; @@ -457,29 +536,58 @@ arswitch_getport(device_t dev, etherswit return (0); } -/* - * XXX doesn't yet work? - */ static int arswitch_setport(device_t dev, etherswitch_port_t *p) { int err; + uint32_t reg; struct arswitch_softc *sc; struct ifmedia *ifm; struct mii_data *mii; struct ifnet *ifp; - /* - * XXX check the sc numphys, or the #define ? - */ - if (p->es_port < 0 || p->es_port >= AR8X16_NUM_PHYS) + sc = device_get_softc(dev); + if (p->es_port < 0 || p->es_port > sc->numphys) return (ENXIO); - sc = device_get_softc(dev); + /* Port flags. */ + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { - /* - * XXX TODO: don't set the CPU port? - */ + ARSWITCH_LOCK(sc); + /* Set the PVID. */ + if (p->es_pvid != 0) + arswitch_set_pvid(sc, p->es_port, p->es_pvid); + + /* Mutually exclusive. */ + if (p->es_flags & ETHERSWITCH_PORT_ADDTAG && + p->es_flags & ETHERSWITCH_PORT_STRIPTAG) { + ARSWITCH_UNLOCK(sc); + return (EINVAL); + } + + reg = 0; + if (p->es_flags & ETHERSWITCH_PORT_DOUBLE_TAG) + reg |= AR8X16_PORT_CTRL_DOUBLE_TAG; + if (p->es_flags & ETHERSWITCH_PORT_ADDTAG) + reg |= AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_ADD << + AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_SHIFT; + if (p->es_flags & ETHERSWITCH_PORT_STRIPTAG) + reg |= AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_STRIP << + AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_SHIFT; + + err = arswitch_modifyreg(sc->sc_dev, + AR8X16_REG_PORT_CTRL(p->es_port), + 0x3 << AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_SHIFT | + AR8X16_PORT_CTRL_DOUBLE_TAG, reg); + + ARSWITCH_UNLOCK(sc); + if (err) + return (err); + } + + /* Do not allow media changes on CPU port. */ + if (p->es_port == AR8X16_PORT_CPU) + return (0); mii = arswitch_miiforport(sc, p->es_port); if (mii == NULL) @@ -488,28 +596,7 @@ arswitch_setport(device_t dev, etherswit ifp = arswitch_ifpforport(sc, p->es_port); ifm = &mii->mii_media; - err = ifmedia_ioctl(ifp, &p->es_ifr, ifm, SIOCSIFMEDIA); - return (err); -} - -static int -arswitch_getvgroup(device_t dev, etherswitch_vlangroup_t *vg) -{ - - /* XXX not implemented yet */ - vg->es_vid = 0; - vg->es_member_ports = 0; - vg->es_untagged_ports = 0; - vg->es_fid = 0; - return (0); -} - -static int -arswitch_setvgroup(device_t dev, etherswitch_vlangroup_t *vg) -{ - - /* XXX not implemented yet */ - return (0); + return (ifmedia_ioctl(ifp, &p->es_ifr, ifm, SIOCSIFMEDIA)); } static void @@ -546,6 +633,38 @@ arswitch_ifmedia_sts(struct ifnet *ifp, ifmr->ifm_status = mii->mii_media_status; } +static int +arswitch_getconf(device_t dev, etherswitch_conf_t *conf) +{ + struct arswitch_softc *sc; + + sc = device_get_softc(dev); + + /* Return the VLAN mode. */ + conf->cmd = ETHERSWITCH_CONF_VLAN_MODE; + conf->vlan_mode = sc->vlan_mode; + + return (0); +} + +static int +arswitch_setconf(device_t dev, etherswitch_conf_t *conf) +{ + struct arswitch_softc *sc; + int err; + + sc = device_get_softc(dev); + + /* Set the VLAN mode. */ + if (conf->cmd & ETHERSWITCH_CONF_VLAN_MODE) { + err = arswitch_set_vlan_mode(sc, conf->vlan_mode); + if (err != 0) + return (err); + } + + return (0); +} + static device_method_t arswitch_methods[] = { /* Device interface */ DEVMETHOD(device_probe, arswitch_probe), @@ -576,6 +695,8 @@ static device_method_t arswitch_methods[ DEVMETHOD(etherswitch_setport, arswitch_setport), DEVMETHOD(etherswitch_getvgroup, arswitch_getvgroup), DEVMETHOD(etherswitch_setvgroup, arswitch_setvgroup), + DEVMETHOD(etherswitch_getconf, arswitch_getconf), + DEVMETHOD(etherswitch_setconf, arswitch_setconf), DEVMETHOD_END }; Modified: head/sys/dev/etherswitch/arswitch/arswitch_7240.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_7240.c Tue Jul 23 14:14:24 2013 (r253571) +++ head/sys/dev/etherswitch/arswitch/arswitch_7240.c Tue Jul 23 14:24:22 2013 (r253572) @@ -71,10 +71,6 @@ static int ar7240_hw_setup(struct arswitch_softc *sc) { - /* Enable CPU port; disable mirror port */ - arswitch_writereg(sc->sc_dev, AR8X16_REG_CPU_PORT, - AR8X16_CPU_PORT_EN | AR8X16_CPU_MIRROR_DIS); - return (0); } @@ -85,6 +81,10 @@ static int ar7240_hw_global_setup(struct arswitch_softc *sc) { + /* Enable CPU port; disable mirror port */ + arswitch_writereg(sc->sc_dev, AR8X16_REG_CPU_PORT, + AR8X16_CPU_PORT_EN | AR8X16_CPU_MIRROR_DIS); + /* Setup TAG priority mapping */ arswitch_writereg(sc->sc_dev, AR8X16_REG_TAG_PRIO, 0xfa50); @@ -133,4 +133,9 @@ ar7240_attach(struct arswitch_softc *sc) sc->hal.arswitch_hw_setup = ar7240_hw_setup; sc->hal.arswitch_hw_global_setup = ar7240_hw_global_setup; + + /* Set the switch vlan capabilities. */ + sc->info.es_vlan_caps = ETHERSWITCH_VLAN_DOT1Q | + ETHERSWITCH_VLAN_PORT | ETHERSWITCH_VLAN_DOUBLE_TAG; + sc->info.es_nvlangroups = AR8X16_MAX_VLANS; } Modified: head/sys/dev/etherswitch/arswitch/arswitch_8216.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8216.c Tue Jul 23 14:14:24 2013 (r253571) +++ head/sys/dev/etherswitch/arswitch/arswitch_8216.c Tue Jul 23 14:24:22 2013 (r253572) @@ -89,4 +89,6 @@ ar8216_attach(struct arswitch_softc *sc) sc->hal.arswitch_hw_setup = ar8216_hw_setup; sc->hal.arswitch_hw_global_setup = ar8216_hw_global_setup; + + sc->info.es_nvlangroups = 0; } Modified: head/sys/dev/etherswitch/arswitch/arswitch_8226.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8226.c Tue Jul 23 14:14:24 2013 (r253571) +++ head/sys/dev/etherswitch/arswitch/arswitch_8226.c Tue Jul 23 14:24:22 2013 (r253572) @@ -89,4 +89,6 @@ ar8226_attach(struct arswitch_softc *sc) sc->hal.arswitch_hw_setup = ar8226_hw_setup; sc->hal.arswitch_hw_global_setup = ar8226_hw_global_setup; + + sc->info.es_nvlangroups = 0; } Modified: head/sys/dev/etherswitch/arswitch/arswitch_8316.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8316.c Tue Jul 23 14:14:24 2013 (r253571) +++ head/sys/dev/etherswitch/arswitch/arswitch_8316.c Tue Jul 23 14:24:22 2013 (r253572) @@ -127,7 +127,18 @@ static int ar8316_hw_global_setup(struct arswitch_softc *sc) { - arswitch_writereg(sc->sc_dev, 0x38, 0xc000050e); + arswitch_writereg(sc->sc_dev, 0x38, AR8X16_MAGIC); + + /* Enable CPU port and disable mirror port. */ + arswitch_writereg(sc->sc_dev, AR8X16_REG_CPU_PORT, + AR8X16_CPU_PORT_EN | AR8X16_CPU_MIRROR_DIS); + + /* Setup TAG priority mapping. */ + arswitch_writereg(sc->sc_dev, AR8X16_REG_TAG_PRIO, 0xfa50); + + /* Enable ARP frame acknowledge. */ + arswitch_modifyreg(sc->sc_dev, AR8X16_REG_AT_CTRL, 0, + AR8X16_AT_CTRL_ARP_EN); /* * Flood address table misses to all ports, and enable forwarding of @@ -136,9 +147,14 @@ ar8316_hw_global_setup(struct arswitch_s arswitch_writereg(sc->sc_dev, AR8X16_REG_FLOOD_MASK, AR8X16_FLOOD_MASK_BCAST_TO_CPU | 0x003f003f); + /* Enable jumbo frames. */ arswitch_modifyreg(sc->sc_dev, AR8X16_REG_GLOBAL_CTRL, AR8316_GLOBAL_CTRL_MTU_MASK, 9018 + 8 + 2); + /* Setup service TAG. */ + arswitch_modifyreg(sc->sc_dev, AR8X16_REG_SERVICE_TAG, + AR8X16_SERVICE_TAG_MASK, 0); + return (0); } @@ -148,4 +164,9 @@ ar8316_attach(struct arswitch_softc *sc) sc->hal.arswitch_hw_setup = ar8316_hw_setup; sc->hal.arswitch_hw_global_setup = ar8316_hw_global_setup; + + /* Set the switch vlan capabilities. */ + sc->info.es_vlan_caps = ETHERSWITCH_VLAN_DOT1Q | + ETHERSWITCH_VLAN_PORT | ETHERSWITCH_VLAN_DOUBLE_TAG; + sc->info.es_nvlangroups = AR8X16_MAX_VLANS; } Modified: head/sys/dev/etherswitch/arswitch/arswitch_reg.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_reg.c Tue Jul 23 14:14:24 2013 (r253571) +++ head/sys/dev/etherswitch/arswitch/arswitch_reg.c Tue Jul 23 14:24:22 2013 (r253572) @@ -178,3 +178,24 @@ arswitch_modifyreg(device_t dev, int add value |= set; return (arswitch_writereg(dev, addr, value)); } + +int +arswitch_waitreg(device_t dev, int addr, int mask, int val, int timeout) +{ + int err, v; + + err = -1; + while (1) { + v = arswitch_readreg(dev, addr); + v &= mask; + if (v == val) { + err = 0; + break; + } + if (!timeout) + break; + DELAY(1); + timeout--; + } + return (err); +} Modified: head/sys/dev/etherswitch/arswitch/arswitch_reg.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_reg.h Tue Jul 23 14:14:24 2013 (r253571) +++ head/sys/dev/etherswitch/arswitch/arswitch_reg.h Tue Jul 23 14:24:22 2013 (r253572) @@ -34,6 +34,7 @@ extern void arswitch_writedbg(device_t d extern int arswitch_readreg(device_t dev, int addr); extern int arswitch_writereg(device_t dev, int addr, int value); extern int arswitch_modifyreg(device_t dev, int addr, int mask, int set); +extern int arswitch_waitreg(device_t, int, int, int, int); extern int arswitch_readreg_lsb(device_t dev, int addr); extern int arswitch_readreg_msb(device_t dev, int addr); Added: head/sys/dev/etherswitch/arswitch/arswitch_vlans.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/etherswitch/arswitch/arswitch_vlans.c Tue Jul 23 14:24:22 2013 (r253572) @@ -0,0 +1,375 @@ +/*- + * Copyright (c) 2013 Luiz Otavio O Souza. + * Copyright (c) 2011-2012 Stefan Bethke. + * Copyright (c) 2012 Adrian Chadd. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include + +#include "mdio_if.h" +#include "miibus_if.h" +#include "etherswitch_if.h" + +static int +arswitch_vlan_op(struct arswitch_softc *sc, uint32_t op, uint32_t vid, + uint32_t data) +{ + int err; + + if (arswitch_waitreg(sc->sc_dev, AR8X16_REG_VLAN_CTRL, + AR8X16_VLAN_ACTIVE, 0, 5)) + return (EBUSY); + + /* Load the vlan data if needed. */ + if (op == AR8X16_VLAN_OP_LOAD) { + err = arswitch_writereg(sc->sc_dev, AR8X16_REG_VLAN_DATA, + (data & AR8X16_VLAN_MEMBER) | AR8X16_VLAN_VALID); + if (err) + return (err); + } + + if (vid != 0) + op |= ((vid & ETHERSWITCH_VID_MASK) << AR8X16_VLAN_VID_SHIFT); + op |= AR8X16_VLAN_ACTIVE; + arswitch_writereg(sc->sc_dev, AR8X16_REG_VLAN_CTRL, op); + + /* Wait for command processing. */ + if (arswitch_waitreg(sc->sc_dev, AR8X16_REG_VLAN_CTRL, + AR8X16_VLAN_ACTIVE, 0, 5)) + return (EBUSY); + + return (0); +} + +static int +arswitch_flush_dot1q_vlan(struct arswitch_softc *sc) +{ + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + return (arswitch_vlan_op(sc, AR8X16_VLAN_OP_FLUSH, 0, 0)); +} + +static int +arswitch_purge_dot1q_vlan(struct arswitch_softc *sc, int vid) +{ + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + return (arswitch_vlan_op(sc, AR8X16_VLAN_OP_PURGE, vid, 0)); +} + +static int +arswitch_get_dot1q_vlan(struct arswitch_softc *sc, uint32_t *ports, int vid) +{ + uint32_t reg; + int err; + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + err = arswitch_vlan_op(sc, AR8X16_VLAN_OP_GET, vid, 0); + if (err) + return (err); + + reg = arswitch_readreg(sc->sc_dev, AR8X16_REG_VLAN_DATA); + if ((reg & AR8X16_VLAN_VALID) == 0) { + *ports = 0; + return (EINVAL); + } + reg &= ((1 << (sc->numphys + 1)) - 1); + *ports = reg; + return (0); +} + +static int +arswitch_set_dot1q_vlan(struct arswitch_softc *sc, uint32_t ports, int vid) +{ + int err; + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + err = arswitch_vlan_op(sc, AR8X16_VLAN_OP_LOAD, vid, ports); + if (err) + return (err); + return (0); +} + +static int +arswitch_get_port_vlan(struct arswitch_softc *sc, uint32_t *ports, int vid) +{ + int port; + uint32_t reg; + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + /* For port based vlans the vlanid is the same as the port index. */ + port = vid & ETHERSWITCH_VID_MASK; + reg = arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_VLAN(port)); + *ports = (reg >> AR8X16_PORT_VLAN_DEST_PORTS_SHIFT); + *ports &= AR8X16_VLAN_MEMBER; + return (0); +} + +static int +arswitch_set_port_vlan(struct arswitch_softc *sc, uint32_t ports, int vid) +{ + int err, port; + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + /* For port based vlans the vlanid is the same as the port index. */ + port = vid & ETHERSWITCH_VID_MASK; + err = arswitch_modifyreg(sc->sc_dev, AR8X16_REG_PORT_VLAN(port), + AR8X16_VLAN_MEMBER << AR8X16_PORT_VLAN_DEST_PORTS_SHIFT, + (ports & AR8X16_VLAN_MEMBER) << AR8X16_PORT_VLAN_DEST_PORTS_SHIFT); + if (err) + return (err); + return (0); +} + +/* + * Reset vlans to default state. + */ +void +arswitch_reset_vlans(struct arswitch_softc *sc) +{ + uint32_t ports; + int i, j; + + ARSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + + ARSWITCH_LOCK(sc); + + /* Reset all vlan data. */ + memset(sc->vid, 0, sizeof(sc->vid)); + + /* Disable the QinQ and egress filters for all ports. */ + for (i = 0; i <= sc->numphys; i++) { + if (arswitch_modifyreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(i), + 0x3 << AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_SHIFT | + AR8X16_PORT_CTRL_DOUBLE_TAG, 0)) { + ARSWITCH_UNLOCK(sc); + return; + } + } + + if (arswitch_flush_dot1q_vlan(sc)) { + ARSWITCH_UNLOCK(sc); + return; + } + + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + /* + * Reset the port based vlan settings and turn on the + * ingress filter for all ports. + */ + ports = 0; + for (i = 0; i <= sc->numphys; i++) + arswitch_modifyreg(sc->sc_dev, + AR8X16_REG_PORT_VLAN(i), + AR8X16_PORT_VLAN_MODE_MASK | + AR8X16_VLAN_MEMBER << + AR8X16_PORT_VLAN_DEST_PORTS_SHIFT, + AR8X16_PORT_VLAN_MODE_SECURE << + AR8X16_PORT_VLAN_MODE_SHIFT); + + /* + * Setup vlan 1 as PVID for all switch ports. Add all ports + * as members of vlan 1. + */ + sc->vid[0] = 1; + /* Set PVID for everyone. */ + for (i = 0; i <= sc->numphys; i++) + arswitch_set_pvid(sc, i, sc->vid[0]); + ports = 0; + for (i = 0; i <= sc->numphys; i++) + ports |= (1 << i); + arswitch_set_dot1q_vlan(sc, ports, sc->vid[0]); + sc->vid[0] |= ETHERSWITCH_VID_VALID; + } else if (sc->vlan_mode == ETHERSWITCH_VLAN_PORT) { + /* Initialize the port based vlans. */ + for (i = 0; i <= sc->numphys; i++) { + sc->vid[i] = i | ETHERSWITCH_VID_VALID; + ports = 0; + for (j = 0; j <= sc->numphys; j++) + ports |= (1 << j); + arswitch_modifyreg(sc->sc_dev, + AR8X16_REG_PORT_VLAN(i), + AR8X16_PORT_VLAN_MODE_MASK | + AR8X16_VLAN_MEMBER << + AR8X16_PORT_VLAN_DEST_PORTS_SHIFT, + ports << AR8X16_PORT_VLAN_DEST_PORTS_SHIFT | + AR8X16_PORT_VLAN_MODE_SECURE << + AR8X16_PORT_VLAN_MODE_PORT_ONLY); + } + } else { + /* Disable the ingress filter and get everyone on all vlans. */ + for (i = 0; i <= sc->numphys; i++) + arswitch_modifyreg(sc->sc_dev, + AR8X16_REG_PORT_VLAN(i), + AR8X16_PORT_VLAN_MODE_MASK | + AR8X16_VLAN_MEMBER << + AR8X16_PORT_VLAN_DEST_PORTS_SHIFT, + AR8X16_VLAN_MEMBER << + AR8X16_PORT_VLAN_DEST_PORTS_SHIFT | + AR8X16_PORT_VLAN_MODE_SECURE << + AR8X16_PORT_VLAN_MODE_PORT_ONLY); + } + ARSWITCH_UNLOCK(sc); +} + +int +arswitch_getvgroup(device_t dev, etherswitch_vlangroup_t *vg) +{ + struct arswitch_softc *sc; + int err; + + sc = device_get_softc(dev); + ARSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + + if (vg->es_vlangroup > sc->info.es_nvlangroups) + return (EINVAL); + + /* Reset the members ports. */ + vg->es_untagged_ports = 0; + vg->es_member_ports = 0; + + /* Not supported. */ + vg->es_fid = 0; + + /* Vlan ID. */ + ARSWITCH_LOCK(sc); + vg->es_vid = sc->vid[vg->es_vlangroup]; + if ((vg->es_vid & ETHERSWITCH_VID_VALID) == 0) { + ARSWITCH_UNLOCK(sc); + return (0); + } + + /* Member Ports. */ + switch (sc->vlan_mode) { + case ETHERSWITCH_VLAN_DOT1Q: + err = arswitch_get_dot1q_vlan(sc, &vg->es_member_ports, + vg->es_vid); + break; + case ETHERSWITCH_VLAN_PORT: + err = arswitch_get_port_vlan(sc, &vg->es_member_ports, + vg->es_vid); + break; + default: + vg->es_member_ports = 0; + err = -1; + } + ARSWITCH_UNLOCK(sc); + vg->es_untagged_ports = vg->es_member_ports; + return (err); +} + +int +arswitch_setvgroup(device_t dev, etherswitch_vlangroup_t *vg) +{ + struct arswitch_softc *sc; + int err, vid; + + sc = device_get_softc(dev); + ARSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + + /* Check VLAN mode. */ + if (sc->vlan_mode == 0) + return (EINVAL); + + /* + * Check if we are changing the vlanid for an already used vtu entry. + * Then purge the entry first. + */ + ARSWITCH_LOCK(sc); + vid = sc->vid[vg->es_vlangroup]; + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q && + (vid & ETHERSWITCH_VID_VALID) != 0 && + (vid & ETHERSWITCH_VID_MASK) != + (vg->es_vid & ETHERSWITCH_VID_MASK)) { + err = arswitch_purge_dot1q_vlan(sc, vid); + if (err) { + ARSWITCH_UNLOCK(sc); + return (err); + } + } + + /* Vlan ID. */ + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + sc->vid[vg->es_vlangroup] = vg->es_vid & ETHERSWITCH_VID_MASK; + /* Setting the vlanid to zero disables the vlangroup. */ + if (sc->vid[vg->es_vlangroup] == 0) { + ARSWITCH_UNLOCK(sc); + return (0); + } + sc->vid[vg->es_vlangroup] |= ETHERSWITCH_VID_VALID; + vid = sc->vid[vg->es_vlangroup]; + } + + /* Member Ports. */ + switch (sc->vlan_mode) { + case ETHERSWITCH_VLAN_DOT1Q: + err = arswitch_set_dot1q_vlan(sc, vg->es_member_ports, vid); + break; + case ETHERSWITCH_VLAN_PORT: + err = arswitch_set_port_vlan(sc, vg->es_member_ports, vid); + break; + default: + err = -1; + } + ARSWITCH_UNLOCK(sc); + return (err); +} + +int +arswitch_get_pvid(struct arswitch_softc *sc, int port, int *pvid) +{ + uint32_t reg; + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + reg = arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_VLAN(port)); + *pvid = reg & 0xfff; + return (0); +} + +int +arswitch_set_pvid(struct arswitch_softc *sc, int port, int pvid) +{ + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + return (arswitch_modifyreg(sc->sc_dev, + AR8X16_REG_PORT_VLAN(port), 0xfff, pvid)); +} Added: head/sys/dev/etherswitch/arswitch/arswitch_vlans.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/etherswitch/arswitch/arswitch_vlans.h Tue Jul 23 14:24:22 2013 (r253572) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2013 Luiz Otavio O Souza. + * Copyright (c) 2011-2012 Stefan Bethke. + * 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 __ARSWITCH_VLANS_H__ +#define __ARSWITCH_VLANS_H__ + +void arswitch_reset_vlans(struct arswitch_softc *); +int arswitch_getvgroup(device_t, etherswitch_vlangroup_t *); +int arswitch_setvgroup(device_t, etherswitch_vlangroup_t *); +int arswitch_get_pvid(struct arswitch_softc *, int, int *); +int arswitch_set_pvid(struct arswitch_softc *, int, int); + +#endif /* __ARSWITCH_VLANS_H__ */ Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchreg.h Tue Jul 23 14:14:24 2013 (r253571) +++ head/sys/dev/etherswitch/arswitch/arswitchreg.h Tue Jul 23 14:24:22 2013 (r253572) @@ -114,7 +114,7 @@ #define AR8X16_VLAN_PRIO_EN (1 << 31) #define AR8X16_REG_VLAN_DATA 0x0044 -#define AR8X16_VLAN_MEMBER 0x000003ff +#define AR8X16_VLAN_MEMBER 0x0000003f #define AR8X16_VLAN_VALID (1 << 11) #define AR8X16_REG_ARL_CTRL0 0x0050 Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchvar.h Tue Jul 23 14:14:24 2013 (r253571) +++ head/sys/dev/etherswitch/arswitch/arswitchvar.h Tue Jul 23 14:24:22 2013 (r253572) @@ -57,6 +57,10 @@ struct arswitch_softc { struct callout callout_tick; etherswitch_info_t info; + /* VLANs support */ + int vid[AR8X16_MAX_VLANS]; + uint32_t vlan_mode; + struct { int (* arswitch_hw_setup) (struct arswitch_softc *); int (* arswitch_hw_global_setup) (struct arswitch_softc *); From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 14:48:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 22191FBA; Tue, 23 Jul 2013 14:48:38 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 13AE82269; Tue, 23 Jul 2013 14:48:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NEmbDJ044824; Tue, 23 Jul 2013 14:48:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NEmbeo044823; Tue, 23 Jul 2013 14:48:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201307231448.r6NEmbeo044823@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 23 Jul 2013 14:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253573 - head/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 14:48:38 -0000 Author: nwhitehorn Date: Tue Jul 23 14:48:37 2013 New Revision: 253573 URL: http://svnweb.freebsd.org/changeset/base/253573 Log: tmpfs works perfectly fine with -o union -- there is no reason to exclude it from the list of options. Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Tue Jul 23 14:24:22 2013 (r253572) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Tue Jul 23 14:48:37 2013 (r253573) @@ -79,7 +79,7 @@ static int tmpfs_statfs(struct mount *, static const char *tmpfs_opts[] = { "from", "size", "maxfilesize", "inodes", "uid", "gid", "mode", "export", - NULL + "union", NULL }; static const char *tmpfs_updateopts[] = { From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 16:49:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 88D8180; Tue, 23 Jul 2013 16:49:24 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 16A41296B; Tue, 23 Jul 2013 16:49:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id r6NGnKt3080776; Tue, 23 Jul 2013 20:49:20 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Tue, 23 Jul 2013 20:49:20 +0400 (MSK) From: Dmitry Morozovsky To: Nathan Whitehorn Subject: Re: svn commit: r253573 - head/sys/fs/tmpfs In-Reply-To: <201307231448.r6NEmbeo044823@svn.freebsd.org> Message-ID: References: <201307231448.r6NEmbeo044823@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Tue, 23 Jul 2013 20:49:20 +0400 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 16:49:24 -0000 Nathan, On Tue, 23 Jul 2013, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Tue Jul 23 14:48:37 2013 > New Revision: 253573 > URL: http://svnweb.freebsd.org/changeset/base/253573 > > Log: > tmpfs works perfectly fine with -o union -- there is no reason to exclude it > from the list of options. Any plans to MFC this, at least to stable/9 after 9.2-R (or preferably before ;) ? -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 19:34:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A19D54E5; Tue, 23 Jul 2013 19:34:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 799B1210C; Tue, 23 Jul 2013 19:34:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NJY92C035203; Tue, 23 Jul 2013 19:34:09 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NJY9gU035202; Tue, 23 Jul 2013 19:34:09 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201307231934.r6NJY9gU035202@svn.freebsd.org> From: Ed Maste Date: Tue, 23 Jul 2013 19:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253580 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 19:34:09 -0000 Author: emaste Date: Tue Jul 23 19:34:09 2013 New Revision: 253580 URL: http://svnweb.freebsd.org/changeset/base/253580 Log: Generate debug data release dist sets If WITH_DEBUG_FILES is set the standalone debug data will be excluded from each ${dist}.txz and placed in a ${dist}.debug.txz. Submitted by: gjb Reviewed by: brooks Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Jul 23 16:17:46 2013 (r253579) +++ head/Makefile.inc1 Tue Jul 23 19:34:09 2013 (r253580) @@ -833,6 +833,18 @@ distributeworld installworld: installche awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \ ${DESTDIR}/${DISTDIR}/${dist}.meta .endfor +.if ${MK_DEBUG_FILES} != "no" +. for dist in base ${EXTRA_DISTRIBUTIONS} + @# For each file that exists in this dist, print the corresponding + @# line from the METALOG. This relies on the fact that + @# a line containing only the filename will sort immediatly before + @# the relevant mtree line. + cd ${DESTDIR}/${DISTDIR}; \ + find ./${dist}/usr/lib/debug | sort -u ${METALOG} - | \ + awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \ + ${DESTDIR}/${DISTDIR}/${dist}.debug.meta +. endfor +.endif .endif .endif @@ -841,13 +853,29 @@ packageworld: .if defined(NO_ROOT) ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz \ + --exclude usr/lib/debug \ @${DESTDIR}/${DISTDIR}/${dist}.meta .else ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ - tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz . + tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz \ + --exclude usr/lib/debug . .endif .endfor +.if ${MK_DEBUG_FILES} != "no" +. for dist in base ${EXTRA_DISTRIBUTIONS} +. if defined(NO_ROOT) + ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ + tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.debug.txz \ + @${DESTDIR}/${DISTDIR}/${dist}.debug.meta +. else + ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ + tar cvJfL ${DESTDIR}/${DISTDIR}/${dist}.debug.txz \ + usr/lib/debug +. endif +. endfor +.endif + # # reinstall # From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 21:09:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1E797E96; Tue, 23 Jul 2013 21:09:27 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0F19E255A; Tue, 23 Jul 2013 21:09:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NL9Q7Q064054; Tue, 23 Jul 2013 21:09:26 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NL9QJ7064052; Tue, 23 Jul 2013 21:09:26 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307232109.r6NL9QJ7064052@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 23 Jul 2013 21:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253581 - in head: lib/libc/gen tools/regression/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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 21:09:27 -0000 Author: jilles Date: Tue Jul 23 21:09:26 2013 New Revision: 253581 URL: http://svnweb.freebsd.org/changeset/base/253581 Log: wordexp(): Fix syntax validation for backslashes in single-quotes. Modified: head/lib/libc/gen/wordexp.c head/tools/regression/lib/libc/gen/test-wordexp.c Modified: head/lib/libc/gen/wordexp.c ============================================================================== --- head/lib/libc/gen/wordexp.c Tue Jul 23 19:34:09 2013 (r253580) +++ head/lib/libc/gen/wordexp.c Tue Jul 23 21:09:26 2013 (r253581) @@ -251,7 +251,8 @@ we_check(const char *words, int flags) while ((c = *words++) != '\0') { switch (c) { case '\\': - quote ^= 1; + if (squote == 0) + quote ^= 1; continue; case '\'': if (quote + dquote == 0) Modified: head/tools/regression/lib/libc/gen/test-wordexp.c ============================================================================== --- head/tools/regression/lib/libc/gen/test-wordexp.c Tue Jul 23 19:34:09 2013 (r253580) +++ head/tools/regression/lib/libc/gen/test-wordexp.c Tue Jul 23 21:09:26 2013 (r253581) @@ -195,6 +195,18 @@ main(int argc, char *argv[]) r = wordexp("test } test", &we, 0); assert(r == WRDE_BADCHAR); + /* WRDE_SYNTAX */ + r = wordexp("'", &we, 0); + assert(r == WRDE_SYNTAX); + r = wordexp("'", &we, WRDE_UNDEF); + assert(r == WRDE_SYNTAX); + r = wordexp("'\\'", &we, 0); + assert(r == 0); + assert(we.we_wordc == 1); + assert(strcmp(we.we_wordv[0], "\\") == 0); + assert(we.we_wordv[1] == NULL); + wordfree(&we); + /* With a SIGCHLD handler that reaps all zombies. */ sa.sa_flags = 0; sigemptyset(&sa.sa_mask); From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 22:17:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C9762452; Tue, 23 Jul 2013 22:17:01 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A00D328A4; Tue, 23 Jul 2013 22:17:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NMH1uw085272; Tue, 23 Jul 2013 22:17:01 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NMH1Ln085270; Tue, 23 Jul 2013 22:17:01 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201307232217.r6NMH1Ln085270@svn.freebsd.org> From: Neel Natu Date: Tue, 23 Jul 2013 22:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253582 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 22:17:01 -0000 Author: neel Date: Tue Jul 23 22:17:00 2013 New Revision: 253582 URL: http://svnweb.freebsd.org/changeset/base/253582 Log: Fix a bug introduced in r252646 that causes a page with the PG_PTE_PAT bit set to be interpreted as a superpage. This is because PG_PTE_PAT is at the same bit position in PTE as PG_PS is in a PDE. This caused a number of regressions on amd64 systems: panic when starting X applications, freeze during shutdown etc. Pointy hat to: me Tested by: gperez@entel.upc.edu, joel, dumbbell Reviewed by: kib Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Jul 23 21:09:26 2013 (r253581) +++ head/sys/amd64/amd64/pmap.c Tue Jul 23 22:17:00 2013 (r253582) @@ -4401,6 +4401,7 @@ pmap_remove_pages(pmap_t pmap) int64_t bit; uint64_t inuse, bitmask; int allfree, field, freed, idx; + boolean_t superpage; vm_paddr_t pa; if (pmap != PCPU_GET(curpmap)) { @@ -4427,12 +4428,26 @@ pmap_remove_pages(pmap_t pmap) pte = pmap_pdpe_to_pde(pte, pv->pv_va); tpte = *pte; if ((tpte & (PG_PS | PG_V)) == PG_V) { + superpage = FALSE; ptepde = tpte; pte = (pt_entry_t *)PHYS_TO_DMAP(tpte & PG_FRAME); pte = &pte[pmap_pte_index(pv->pv_va)]; tpte = *pte; + } else { + /* + * Keep track whether 'tpte' is a + * superpage explicitly instead of + * relying on PG_PS being set. + * + * This is because PG_PS is numerically + * identical to PG_PTE_PAT and thus a + * regular page could be mistaken for + * a superpage. + */ + superpage = TRUE; } + if ((tpte & PG_V) == 0) { panic("bad pte va %lx pte %lx", pv->pv_va, tpte); @@ -4446,7 +4461,7 @@ pmap_remove_pages(pmap_t pmap) continue; } - if (tpte & PG_PS) + if (superpage) pa = tpte & PG_PS_FRAME; else pa = tpte & PG_FRAME; @@ -4468,7 +4483,7 @@ pmap_remove_pages(pmap_t pmap) * Update the vm_page_t clean/reference bits. */ if ((tpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) { - if ((tpte & PG_PS) != 0) { + if (superpage) { for (mt = m; mt < &m[NBPDR / PAGE_SIZE]; mt++) vm_page_dirty(mt); } else @@ -4479,7 +4494,7 @@ pmap_remove_pages(pmap_t pmap) /* Mark free */ pc->pc_map[field] |= bitmask; - if ((tpte & PG_PS) != 0) { + if (superpage) { pmap_resident_count_dec(pmap, NBPDR / PAGE_SIZE); pvh = pa_to_pvh(tpte & PG_PS_FRAME); TAILQ_REMOVE(&pvh->pv_list, pv, pv_next); From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 22:39:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1E145B67; Tue, 23 Jul 2013 22:39:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D68D32A0E; Tue, 23 Jul 2013 22:39:26 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::edc1:b60c:f542:38d1] (unknown [IPv6:2001:7b8:3a7:0:edc1:b60c:f542:38d1]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id A6EC85C5A; Wed, 24 Jul 2013 00:39:16 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r253504 - head/sbin/route From: Dimitry Andric In-Reply-To: <201307201646.r6KGkpM6054344@svn.freebsd.org> Date: Wed, 24 Jul 2013 00:39:15 +0200 Content-Transfer-Encoding: 7bit Message-Id: <36E48152-1A64-432D-A32D-75059A56E181@FreeBSD.org> References: <201307201646.r6KGkpM6054344@svn.freebsd.org> To: Hiroki Sato X-Mailer: Apple Mail (2.1508) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 22:39:27 -0000 On Jul 20, 2013, at 18:46, Hiroki Sato wrote: > Author: hrs > Date: Sat Jul 20 16:46:51 2013 > New Revision: 253504 > URL: http://svnweb.freebsd.org/changeset/base/253504 > > Log: > - Simplify getaddr() and print_getmsg() by using RTAX_* instead of RTA_* > as the argument. > - Reduce unnecessary loop in print_getmsg(). > > Modified: > head/sbin/route/route.c Hi, This breaks /etc/rc.d/defaultroute, since it relies on "route -n get -inet default" printing a line with "interface:" in it. Before r253504 it prints: route to: 0.0.0.0 destination: 0.0.0.0 mask: 56.18.1.0 gateway: router.example.com fib: 0 interface: em0 flags: recvpipe sendpipe ssthresh rtt,msec mtu weight expire 0 0 0 0 1500 1 0 (note also the mask seems to be busted, and even though -n is given, the hostname of the gateway is printed, but this is another issue) At r253504 it gives: route to: 0.0.0.0 destination: 0.0.0.0 mask: 56.18.1.0 gateway: router.example.com fib: 0 flags: recvpipe sendpipe ssthresh rtt,msec mtu weight expire 0 0 0 0 1500 1 0 So for some reason, the interface: line is gone.. -Dimitry From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 22:52:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 475533FB; Tue, 23 Jul 2013 22:52:39 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 390552AD8; Tue, 23 Jul 2013 22:52:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NMqdI6096649; Tue, 23 Jul 2013 22:52:39 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NMqdF0096648; Tue, 23 Jul 2013 22:52:39 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201307232252.r6NMqdF0096648@svn.freebsd.org> From: Jeff Roberson Date: Tue, 23 Jul 2013 22:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253583 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 22:52:39 -0000 Author: jeff Date: Tue Jul 23 22:52:38 2013 New Revision: 253583 URL: http://svnweb.freebsd.org/changeset/base/253583 Log: - Correct a stale comment. We don't have vclean() anymore. The work is done by vgonel() and destroy_vobject() should only be called once from VOP_INACTIVE(). Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Tue Jul 23 22:17:00 2013 (r253582) +++ head/sys/vm/vnode_pager.c Tue Jul 23 22:52:38 2013 (r253583) @@ -158,11 +158,6 @@ vnode_destroy_vobject(struct vnode *vp) VM_OBJECT_WLOCK(obj); if (obj->ref_count == 0) { /* - * vclean() may be called twice. The first time - * removes the primary reference to the object, - * the second time goes one further and is a - * special-case to terminate the object. - * * don't double-terminate the object */ if ((obj->flags & OBJ_DEAD) == 0) From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 23:43:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C722122A; Tue, 23 Jul 2013 23:43:01 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A85972CD0; Tue, 23 Jul 2013 23:43:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NNh1Vl012545; Tue, 23 Jul 2013 23:43:01 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NNh1Th012542; Tue, 23 Jul 2013 23:43:01 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201307232343.r6NNh1Th012542@svn.freebsd.org> From: Neel Natu Date: Tue, 23 Jul 2013 23:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253585 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 23:43:02 -0000 Author: neel Date: Tue Jul 23 23:43:00 2013 New Revision: 253585 URL: http://svnweb.freebsd.org/changeset/base/253585 Log: Add support for emulation of the "or r/m, imm8" instruction. Submitted by: Zhixiang Yu (zxyu.core@gmail.com) Obtained from: GSoC 2013 (AHCI device emulation for bhyve) Modified: head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Tue Jul 23 22:53:01 2013 (r253584) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Tue Jul 23 23:43:00 2013 (r253585) @@ -60,6 +60,7 @@ enum { VIE_OP_TYPE_NONE = 0, VIE_OP_TYPE_MOV, VIE_OP_TYPE_AND, + VIE_OP_TYPE_OR, VIE_OP_TYPE_LAST }; @@ -94,7 +95,13 @@ static const struct vie_op one_byte_opco .op_byte = 0x81, .op_type = VIE_OP_TYPE_AND, .op_flags = VIE_OP_F_IMM, - } + }, + [0x83] = { + /* XXX Group 1 extended opcode - not just OR */ + .op_byte = 0x83, + .op_type = VIE_OP_TYPE_OR, + .op_flags = VIE_OP_F_IMM8, + }, }; /* struct vie.mod */ @@ -338,8 +345,8 @@ emulate_and(void *vm, int vcpuid, uint64 break; case 0x81: /* - * AND reg (ModRM:reg) with immediate and store the - * result in reg + * AND mem (ModRM:r/m) with immediate and store the + * result in mem. * * 81/ and r/m32, imm32 * REX.W + 81/ and r/m64, imm32 sign-extended to 64 @@ -371,6 +378,52 @@ emulate_and(void *vm, int vcpuid, uint64 return (error); } +static int +emulate_or(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, + mem_region_read_t memread, mem_region_write_t memwrite, void *arg) +{ + int error, size; + uint64_t val1; + + size = 4; + error = EINVAL; + + switch (vie->op.op_byte) { + case 0x83: + /* + * OR mem (ModRM:r/m) with immediate and store the + * result in mem. + * + * 83/ OR r/m32, imm8 sign-extended to 32 + * REX.W + 83/ OR r/m64, imm8 sign-extended to 64 + * + * Currently, only the OR operation of the 0x83 opcode + * is implemented (ModRM:reg = b001). + */ + if ((vie->reg & 7) != 1) + break; + + if (vie->rex_w) + size = 8; + + /* get the first operand */ + error = memread(vm, vcpuid, gpa, &val1, size, arg); + if (error) + break; + + /* + * perform the operation with the pre-fetched immediate + * operand and write the result + */ + val1 |= vie->immediate; + error = memwrite(vm, vcpuid, gpa, val1, size, arg); + break; + default: + break; + } + return (error); +} + int vmm_emulate_instruction(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, mem_region_read_t memread, mem_region_write_t memwrite, @@ -390,6 +443,10 @@ vmm_emulate_instruction(void *vm, int vc error = emulate_and(vm, vcpuid, gpa, vie, memread, memwrite, memarg); break; + case VIE_OP_TYPE_OR: + error = emulate_or(vm, vcpuid, gpa, vie, + memread, memwrite, memarg); + break; default: error = EINVAL; break; From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 23:56:48 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 42B47AB6; Tue, 23 Jul 2013 23:56:48 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 33A1E2D79; Tue, 23 Jul 2013 23:56:47 +0000 (UTC) Received: from alph.d.allbsd.org (p2049-ipbf1102funabasi.chiba.ocn.ne.jp [122.26.101.49]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id r6NNuPA5020016 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 24 Jul 2013 08:56:35 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.5/8.14.5) with ESMTP id r6NNuNqY059916; Wed, 24 Jul 2013 08:56:24 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Wed, 24 Jul 2013 08:56:14 +0900 (JST) Message-Id: <20130724.085614.2164169266116807765.hrs@allbsd.org> To: dim@FreeBSD.org Subject: Re: svn commit: r253504 - head/sbin/route From: Hiroki Sato In-Reply-To: <36E48152-1A64-432D-A32D-75059A56E181@FreeBSD.org> References: <201307201646.r6KGkpM6054344@svn.freebsd.org> <36E48152-1A64-432D-A32D-75059A56E181@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Wed_Jul_24_08_56_14_2013_916)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Wed, 24 Jul 2013 08:56:35 +0900 (JST) X-Spam-Status: No, score=-90.6 required=13.0 tests=CONTENT_TYPE_PRESENT, DIRECTOCNDYN,DYN_PBL,RCVD_IN_PBL,SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 23:56:48 -0000 ----Security_Multipart(Wed_Jul_24_08_56_14_2013_916)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Dimitry Andric wrote in <36E48152-1A64-432D-A32D-75059A56E181@FreeBSD.org>: di> On Jul 20, 2013, at 18:46, Hiroki Sato wrote: di> > Author: hrs di> > Date: Sat Jul 20 16:46:51 2013 di> > New Revision: 253504 di> > URL: http://svnweb.freebsd.org/changeset/base/253504 di> > di> > Log: di> > - Simplify getaddr() and print_getmsg() by using RTAX_* instead of RTA_* di> > as the argument. di> > - Reduce unnecessary loop in print_getmsg(). di> > di> > Modified: di> > head/sbin/route/route.c di> di> Hi, di> di> This breaks /etc/rc.d/defaultroute, since it relies on "route -n get di> -inet default" printing a line with "interface:" in it. Before r253504 di> it prints: di> di> route to: 0.0.0.0 di> destination: 0.0.0.0 di> mask: 56.18.1.0 di> gateway: router.example.com di> fib: 0 di> interface: em0 di> flags: di> recvpipe sendpipe ssthresh rtt,msec mtu weight expire di> 0 0 0 0 1500 1 0 di> di> (note also the mask seems to be busted, and even though -n is given, the di> hostname of the gateway is printed, but this is another issue) di> di> At r253504 it gives: di> di> route to: 0.0.0.0 di> destination: 0.0.0.0 di> mask: 56.18.1.0 di> gateway: router.example.com di> fib: 0 di> flags: di> recvpipe sendpipe ssthresh rtt,msec mtu weight expire di> 0 0 0 0 1500 1 0 di> di> So for some reason, the interface: line is gone.. Gr, sorry. This is my fault. I will fix it soon. -- Hiroki ----Security_Multipart(Wed_Jul_24_08_56_14_2013_916)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (FreeBSD) iEYEABECAAYFAlHvGB4ACgkQTyzT2CeTzy26JgCgjUCXO+5qutYBakFiliwrv6oZ RgIAoMH/g1s4xWbWmrv1O/tCoa2wVw/j =g5Pa -----END PGP SIGNATURE----- ----Security_Multipart(Wed_Jul_24_08_56_14_2013_916)---- From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 01:12:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 23B4BCE7; Wed, 24 Jul 2013 01:12:29 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (pancho.soaustin.net [76.74.250.40]) by mx1.freebsd.org (Postfix) with ESMTP id 08580207F; Wed, 24 Jul 2013 01:12:28 +0000 (UTC) Received: by mail.soaustin.net (Postfix, from userid 502) id 6D85C5606D; Tue, 23 Jul 2013 20:12:28 -0500 (CDT) Date: Tue, 23 Jul 2013 20:12:28 -0500 From: Mark Linimon To: David Chisnall Subject: Re: svn commit: r253563 - head/contrib/libstdc++/include/c_std Message-ID: <20130724011228.GB20455@lonesome.com> References: <201307231023.r6NANhGf065713@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201307231023.r6NANhGf065713@svn.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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 01:12:29 -0000 On Tue, Jul 23, 2013 at 10:23:43AM +0000, David Chisnall wrote: > A surprising number of configure checks rely on this. It was broken by recent > cleanups to math.h. Once you have the experiences with the ports tree that I have had, you will no longer assume anything about how ports configure checks work (or many other similar items.) Whatever the number, I would hardly find it surprising. The quality of code in the ports collection varies wildly. Some of it is truly professional-quality. Some of it is written by people who cannot even tie their own shoelaces. The bulk of it is somewhere in the middle -- and many of those people simply do not have the patience or aptitude to understand the multitude of build and configure systems that are out there. We simply don't have the several thousand people that it would probably take to audit the tens of millions of lines of code involved. I would like to very politely suggest that regression testing such changes beforehand is a far more effective strategy -- both technical and inter-personal -- than simply assuming that either port authors or maintainers will get such issues correct. They can be subtle, and there are an indefinite number of them. mcl From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 01:25:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F400C6C; Wed, 24 Jul 2013 01:25:56 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E5A7A20F3; Wed, 24 Jul 2013 01:25:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6O1PuOq043671; Wed, 24 Jul 2013 01:25:56 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6O1PuQG043670; Wed, 24 Jul 2013 01:25:56 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201307240125.r6O1PuQG043670@svn.freebsd.org> From: Jeff Roberson Date: Wed, 24 Jul 2013 01:25:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253587 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 01:25:57 -0000 Author: jeff Date: Wed Jul 24 01:25:56 2013 New Revision: 253587 URL: http://svnweb.freebsd.org/changeset/base/253587 Log: - Remove the long obsolete 'vm_pageout_algorithm' experiment. Discussed with: alc Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Wed Jul 24 01:08:45 2013 (r253586) +++ head/sys/vm/vm_pageout.c Wed Jul 24 01:25:56 2013 (r253587) @@ -157,7 +157,6 @@ static int vm_pageout_stats; static int vm_pageout_stats_interval; static int vm_pageout_full_stats; static int vm_pageout_full_stats_interval; -static int vm_pageout_algorithm; static int defer_swap_pageouts; static int disable_swap_pageouts; @@ -169,9 +168,6 @@ static int vm_swap_enabled = 1; static int vm_swap_idle_enabled = 0; #endif -SYSCTL_INT(_vm, VM_PAGEOUT_ALGORITHM, pageout_algorithm, - CTLFLAG_RW, &vm_pageout_algorithm, 0, "LRU page mgmt"); - SYSCTL_INT(_vm, OID_AUTO, max_launder, CTLFLAG_RW, &vm_max_launder, 0, "Limit dirty flushes in pageout"); @@ -756,9 +752,7 @@ vm_pageout_object_deactivate_pages(pmap_ if (actcount == 0) { p->act_count -= min(p->act_count, ACT_DECLINE); - if (!remove_mode && - (vm_pageout_algorithm || - p->act_count == 0)) { + if (!remove_mode && p->act_count == 0) { pmap_remove_all(p); vm_page_deactivate(p); } else @@ -1356,8 +1350,7 @@ relock_queues: vm_page_requeue_locked(m); else { m->act_count -= min(m->act_count, ACT_DECLINE); - if (vm_pageout_algorithm || - object->ref_count == 0 || + if (object->ref_count == 0 || m->act_count == 0) { page_shortage--; /* Dequeue to avoid later lock recursion. */ From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 02:01:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3B16D4BA; Wed, 24 Jul 2013 02:01:02 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2B89721F0; Wed, 24 Jul 2013 02:01:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6O212j9055868; Wed, 24 Jul 2013 02:01:02 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6O212L9055867; Wed, 24 Jul 2013 02:01:02 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201307240201.r6O212L9055867@svn.freebsd.org> From: Justin Hibbits Date: Wed, 24 Jul 2013 02:01:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253588 - head/sys/powerpc/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 02:01:02 -0000 Author: jhibbits Date: Wed Jul 24 02:01:01 2013 New Revision: 253588 URL: http://svnweb.freebsd.org/changeset/base/253588 Log: Increase the size of the OFW bounce buffer to 4 pages. With this I can now run 'ofwdump -ap' on my quad G5. MFC after: 9.2 branch Modified: head/sys/powerpc/ofw/ofw_real.c Modified: head/sys/powerpc/ofw/ofw_real.c ============================================================================== --- head/sys/powerpc/ofw/ofw_real.c Wed Jul 24 01:25:56 2013 (r253587) +++ head/sys/powerpc/ofw/ofw_real.c Wed Jul 24 02:01:01 2013 (r253588) @@ -210,12 +210,12 @@ ofw_real_bounce_alloc(void *junk) mtx_lock(&of_bounce_mtx); - of_bounce_virt = contigmalloc(PAGE_SIZE, M_OFWREAL, 0, 0, + of_bounce_virt = contigmalloc(4 * PAGE_SIZE, M_OFWREAL, 0, 0, ulmin(platform_real_maxaddr(), BUS_SPACE_MAXADDR_32BIT), PAGE_SIZE, - PAGE_SIZE); + 4 * PAGE_SIZE); of_bounce_phys = vtophys(of_bounce_virt); - of_bounce_size = PAGE_SIZE; + of_bounce_size = 4 * PAGE_SIZE; /* * For virtual-mode OF, direct map this physical address so that From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 04:05:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2909789E; Wed, 24 Jul 2013 04:05:49 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1AE152763; Wed, 24 Jul 2013 04:05:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6O45mo7094916; Wed, 24 Jul 2013 04:05:48 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6O45mD9094915; Wed, 24 Jul 2013 04:05:48 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201307240405.r6O45mD9094915@svn.freebsd.org> From: Hiroki Sato Date: Wed, 24 Jul 2013 04:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253589 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 04:05:49 -0000 Author: hrs Date: Wed Jul 24 04:05:48 2013 New Revision: 253589 URL: http://svnweb.freebsd.org/changeset/base/253589 Log: Fix a bug in cp += SA_SIZE() in RTA_* loop. This could prevent RTA_IFP from displaying correctly in route get subcommand. Spotted by: dim Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Wed Jul 24 02:01:01 2013 (r253588) +++ head/sbin/route/route.c Wed Jul 24 04:05:48 2013 (r253589) @@ -1699,16 +1699,15 @@ print_getmsg(struct rt_msghdr *rtm, int return; } cp = ((char *)(rtm + 1)); - for (i = 0; i < RTAX_MAX; i++) { - if (rtm->rtm_addrs & (1 << i)) + for (i = 0; i < RTAX_MAX; i++) + if (rtm->rtm_addrs & (1 << i)) { sp[i] = (struct sockaddr *)cp; - cp += SA_SIZE((struct sockaddr *)cp); - } - if (rtm->rtm_addrs & RTA_IFP) { - if (sp[RTAX_IFP]->sa_family != AF_LINK || - ((struct sockaddr_dl *)(void *)sp[RTAX_IFP])->sdl_nlen == 0) + cp += SA_SIZE((struct sockaddr *)cp); + } + if ((rtm->rtm_addrs & RTA_IFP) && + (sp[RTAX_IFP]->sa_family != AF_LINK || + ((struct sockaddr_dl *)(void *)sp[RTAX_IFP])->sdl_nlen == 0)) sp[RTAX_IFP] = NULL; - } if (sp[RTAX_DST] && sp[RTAX_NETMASK]) sp[RTAX_NETMASK]->sa_family = sp[RTAX_DST]->sa_family; /* XXX */ if (sp[RTAX_DST]) From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 04:06:50 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 428CD9F2; Wed, 24 Jul 2013 04:06:50 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 38C9D2773; Wed, 24 Jul 2013 04:06:49 +0000 (UTC) Received: from alph.d.allbsd.org (p2049-ipbf1102funabasi.chiba.ocn.ne.jp [122.26.101.49]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id r6O46UZq048032 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 24 Jul 2013 13:06:40 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.5/8.14.5) with ESMTP id r6O46SVF062121; Wed, 24 Jul 2013 13:06:29 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Wed, 24 Jul 2013 13:06:20 +0900 (JST) Message-Id: <20130724.130620.474995323688503714.hrs@allbsd.org> To: dim@FreeBSD.org Subject: Re: svn commit: r253504 - head/sbin/route From: Hiroki Sato In-Reply-To: <36E48152-1A64-432D-A32D-75059A56E181@FreeBSD.org> References: <201307201646.r6KGkpM6054344@svn.freebsd.org> <36E48152-1A64-432D-A32D-75059A56E181@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Wed_Jul_24_13_06_20_2013_456)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Wed, 24 Jul 2013 13:06:40 +0900 (JST) X-Spam-Status: No, score=-90.6 required=13.0 tests=CONTENT_TYPE_PRESENT, DIRECTOCNDYN,DYN_PBL,RCVD_IN_PBL,SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 04:06:50 -0000 ----Security_Multipart(Wed_Jul_24_13_06_20_2013_456)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Dimitry Andric wrote in <36E48152-1A64-432D-A32D-75059A56E181@FreeBSD.org>: di> On Jul 20, 2013, at 18:46, Hiroki Sato wrote: di> > Author: hrs di> > Date: Sat Jul 20 16:46:51 2013 di> > New Revision: 253504 di> > URL: http://svnweb.freebsd.org/changeset/base/253504 di> > di> > Log: di> > - Simplify getaddr() and print_getmsg() by using RTAX_* instead of RTA_* di> > as the argument. di> > - Reduce unnecessary loop in print_getmsg(). di> > di> > Modified: di> > head/sbin/route/route.c di> di> Hi, di> di> This breaks /etc/rc.d/defaultroute, since it relies on "route -n get di> -inet default" printing a line with "interface:" in it. Before r253504 di> it prints: di> di> route to: 0.0.0.0 di> destination: 0.0.0.0 di> mask: 56.18.1.0 di> gateway: router.example.com di> fib: 0 di> interface: em0 di> flags: di> recvpipe sendpipe ssthresh rtt,msec mtu weight expire di> 0 0 0 0 1500 1 0 di> di> (note also the mask seems to be busted, and even though -n is given, the di> hostname of the gateway is printed, but this is another issue) di> di> At r253504 it gives: di> di> route to: 0.0.0.0 di> destination: 0.0.0.0 di> mask: 56.18.1.0 di> gateway: router.example.com di> fib: 0 di> flags: di> recvpipe sendpipe ssthresh rtt,msec mtu weight expire di> 0 0 0 0 1500 1 0 di> di> So for some reason, the interface: line is gone.. Should be fixed in r253589. Sorry for the breakage. -- Hiroki ----Security_Multipart(Wed_Jul_24_13_06_20_2013_456)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (FreeBSD) iEYEABECAAYFAlHvUrwACgkQTyzT2CeTzy3gwQCgxvuFVfYCWBcgBdTzAn+TCGPd VcgAoJ2Rx+OLSwmpYC9OCUNBn26O5cMo =7oXP -----END PGP SIGNATURE----- ----Security_Multipart(Wed_Jul_24_13_06_20_2013_456)---- From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 04:24:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 062BAD70; Wed, 24 Jul 2013 04:24:22 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E9CA1280A; Wed, 24 Jul 2013 04:24:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6O4OLPL000916; Wed, 24 Jul 2013 04:24:21 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6O4OLEZ000913; Wed, 24 Jul 2013 04:24:21 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201307240424.r6O4OLEZ000913@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 24 Jul 2013 04:24:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253590 - in head/sys: kern net sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 04:24:22 -0000 Author: marcel Date: Wed Jul 24 04:24:21 2013 New Revision: 253590 URL: http://svnweb.freebsd.org/changeset/base/253590 Log: Decouple the UUID generator from network interfaces by having MAC addresses added to the UUID generator using uuid_ether_add(). The UUID generator keeps an arbitrary number of MAC addresses, under the assumption that they are rarely removed (= uuid_ether_del()). This achieves the following: 1. It brings up closer to having the network stack as a loadable module. 2. It allows the UUID generator to filter MAC addresses for best results (= highest chance of uniqeness). 3. MAC addresses can come from anywhere, irrespactive of whether it's used for an interface or not. A side-effect of the change is that when no MAC addresses have been added, a random multicast MAC address is created once and re-used if needed. Previusly, when a random MAC address was needed, it was created for every call. Thus, a change in behaviour is introduced for when no MAC addresses exist. Obtained from: Juniper Networks, Inc. Modified: head/sys/kern/kern_uuid.c head/sys/net/if_ethersubr.c head/sys/sys/uuid.h Modified: head/sys/kern/kern_uuid.c ============================================================================== --- head/sys/kern/kern_uuid.c Wed Jul 24 04:05:48 2013 (r253589) +++ head/sys/kern/kern_uuid.c Wed Jul 24 04:24:21 2013 (r253590) @@ -71,54 +71,41 @@ struct uuid_private { CTASSERT(sizeof(struct uuid_private) == 16); +struct uuid_macaddr { + uint16_t state; +#define UUID_ETHER_EMPTY 0 +#define UUID_ETHER_RANDOM 1 +#define UUID_ETHER_UNIQUE 2 + uint16_t node[UUID_NODE_LEN>>1]; +}; + static struct uuid_private uuid_last; +#define UUID_NETHER 4 +static struct uuid_macaddr uuid_ether[UUID_NETHER]; + static struct mtx uuid_mutex; MTX_SYSINIT(uuid_lock, &uuid_mutex, "UUID generator mutex lock", MTX_DEF); /* - * Return the first MAC address we encounter or, if none was found, - * construct a sufficiently random multicast address. We don't try - * to return the same MAC address as previously returned. We always - * generate a new multicast address if no MAC address exists in the - * system. - * It would be nice to know if 'ifnet' or any of its sub-structures - * has been changed in any way. If not, we could simply skip the - * scan and safely return the MAC address we returned before. + * Return the first MAC address added in the array. If it's empty, then + * construct a sufficiently random multicast MAC address first. Any + * addresses added later will bump the random MAC address up tp the next + * index. */ static void uuid_node(uint16_t *node) { - struct ifnet *ifp; - struct ifaddr *ifa; - struct sockaddr_dl *sdl; int i; - CURVNET_SET(TD_TO_VNET(curthread)); - IFNET_RLOCK_NOSLEEP(); - TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - /* Walk the address list */ - IF_ADDR_RLOCK(ifp); - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - sdl = (struct sockaddr_dl*)ifa->ifa_addr; - if (sdl != NULL && sdl->sdl_family == AF_LINK && - sdl->sdl_type == IFT_ETHER) { - /* Got a MAC address. */ - bcopy(LLADDR(sdl), node, UUID_NODE_LEN); - IF_ADDR_RUNLOCK(ifp); - IFNET_RUNLOCK_NOSLEEP(); - CURVNET_RESTORE(); - return; - } - } - IF_ADDR_RUNLOCK(ifp); + if (uuid_ether[0].state == UUID_ETHER_EMPTY) { + for (i = 0; i < (UUID_NODE_LEN>>1); i++) + uuid_ether[0].node[i] = (uint16_t)arc4random(); + *((uint8_t*)uuid_ether[0].node) |= 0x01; + uuid_ether[0].state = UUID_ETHER_RANDOM; } - IFNET_RUNLOCK_NOSLEEP(); - for (i = 0; i < (UUID_NODE_LEN>>1); i++) - node[i] = (uint16_t)arc4random(); - *((uint8_t*)node) |= 0x01; - CURVNET_RESTORE(); + node[i] = uuid_ether[0].node[i]; } /* @@ -211,6 +198,77 @@ sys_uuidgen(struct thread *td, struct uu } int +uuid_ether_add(const uint8_t *addr) +{ + int i; + uint8_t c; + + /* + * Validate input. No multicast addresses and no addresses that + * are all zeroes. + */ + if (addr[0] & 0x01) + return (EINVAL); + c = 0; + for (i = 0; i < UUID_NODE_LEN; i++) + c += addr[i]; + if (c == 0) + return (EINVAL); + + mtx_lock(&uuid_mutex); + + /* Make sure the MAC isn't known already and that there's space. */ + i = 0; + while (i < UUID_NETHER && uuid_ether[i].state == UUID_ETHER_UNIQUE) { + if (!bcmp(addr, uuid_ether[i].node, UUID_NODE_LEN)) { + mtx_unlock(&uuid_mutex); + return (EEXIST); + } + i++; + } + if (i == UUID_NETHER) { + mtx_unlock(&uuid_mutex); + return (ENOSPC); + } + + /* Insert MAC at index, moving the non-empty entry if possible. */ + if (uuid_ether[i].state == UUID_ETHER_RANDOM && i < UUID_NETHER - 1) + uuid_ether[i + 1] = uuid_ether[i]; + uuid_ether[i].state = UUID_ETHER_UNIQUE; + bcopy(addr, uuid_ether[i].node, UUID_NODE_LEN); + mtx_unlock(&uuid_mutex); + return (0); +} + +int +uuid_ether_del(const uint8_t *addr) +{ + int i; + + mtx_lock(&uuid_mutex); + i = 0; + while (i < UUID_NETHER && uuid_ether[i].state == UUID_ETHER_UNIQUE && + bcmp(addr, uuid_ether[i].node, UUID_NODE_LEN)) + i++; + if (i == UUID_NETHER || uuid_ether[i].state != UUID_ETHER_UNIQUE) { + mtx_unlock(&uuid_mutex); + return (ENOENT); + } + + /* Remove it by shifting higher index entries down. */ + while (i < UUID_NETHER - 1 && uuid_ether[i].state != UUID_ETHER_EMPTY) { + uuid_ether[i] = uuid_ether[i + 1]; + i++; + } + if (uuid_ether[i].state != UUID_ETHER_EMPTY) { + uuid_ether[i].state = UUID_ETHER_EMPTY; + bzero(uuid_ether[i].node, UUID_NODE_LEN); + } + mtx_unlock(&uuid_mutex); + return (0); +} + +int snprintf_uuid(char *buf, size_t sz, struct uuid *uuid) { struct uuid_private *id; Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Wed Jul 24 04:05:48 2013 (r253589) +++ head/sys/net/if_ethersubr.c Wed Jul 24 04:24:21 2013 (r253590) @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -926,6 +927,8 @@ ether_ifattach(struct ifnet *ifp, const break; if (i != ifp->if_addrlen) if_printf(ifp, "Ethernet address: %6D\n", lla, ":"); + + uuid_ether_add(LLADDR(sdl)); } /* @@ -934,6 +937,11 @@ ether_ifattach(struct ifnet *ifp, const void ether_ifdetach(struct ifnet *ifp) { + struct sockaddr_dl *sdl; + + sdl = (struct sockaddr_dl *)(ifp->if_addr->ifa_addr); + uuid_ether_del(LLADDR(sdl)); + if (IFP2AC(ifp)->ac_netgraph != NULL) { KASSERT(ng_ether_detach_p != NULL, ("ng_ether_detach_p is NULL")); Modified: head/sys/sys/uuid.h ============================================================================== --- head/sys/sys/uuid.h Wed Jul 24 04:05:48 2013 (r253589) +++ head/sys/sys/uuid.h Wed Jul 24 04:24:21 2013 (r253590) @@ -58,6 +58,9 @@ struct sbuf; struct uuid *kern_uuidgen(struct uuid *, size_t); +int uuid_ether_add(const uint8_t *); +int uuid_ether_del(const uint8_t *); + int snprintf_uuid(char *, size_t, struct uuid *); int printf_uuid(struct uuid *); int sbuf_printf_uuid(struct sbuf *, struct uuid *); From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 06:13:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B0C5C467; Wed, 24 Jul 2013 06:13:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A27B92B69; Wed, 24 Jul 2013 06:13:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6O6D0wi034130; Wed, 24 Jul 2013 06:13:00 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6O6D09Y034129; Wed, 24 Jul 2013 06:13:00 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201307240613.r6O6D09Y034129@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 24 Jul 2013 06:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253591 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 06:13:01 -0000 Author: glebius Date: Wed Jul 24 06:13:00 2013 New Revision: 253591 URL: http://svnweb.freebsd.org/changeset/base/253591 Log: Since r251709 a slab no longer use 8-bit indicies to manage items, thus remove a stale comment. Reviewed by: jeff Modified: head/sys/vm/uma_int.h Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Wed Jul 24 04:24:21 2013 (r253590) +++ head/sys/vm/uma_int.h Wed Jul 24 06:13:00 2013 (r253591) @@ -49,14 +49,6 @@ * 10% memory waste we potentially allocate a separate uma_slab_t if this will * improve the number of items per slab that will fit. * - * Other potential space optimizations are storing the 8bit of linkage in space - * wasted between items due to alignment problems. This may yield a much better - * memory footprint for certain sizes of objects. Another alternative is to - * increase the UMA_SLAB_SIZE, or allow for dynamic slab sizes. I prefer - * dynamic slab sizes because we could stick with 8 bit indices and only use - * large slab sizes for zones with a lot of waste per slab. This may create - * inefficiencies in the vm subsystem due to fragmentation in the address space. - * * The only really gross cases, with regards to memory waste, are for those * items that are just over half the page size. You can get nearly 50% waste, * so you fall back to the memory footprint of the power of two allocator. I From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 08:02:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6C001B19; Wed, 24 Jul 2013 08:02:57 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5DA292FBA; Wed, 24 Jul 2013 08:02:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6O82vNu068311; Wed, 24 Jul 2013 08:02:57 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6O82v5p068310; Wed, 24 Jul 2013 08:02:57 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201307240802.r6O82v5p068310@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 24 Jul 2013 08:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253596 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 08:02:57 -0000 Author: glebius Date: Wed Jul 24 08:02:56 2013 New Revision: 253596 URL: http://svnweb.freebsd.org/changeset/base/253596 Log: Remove unused argument from vmem_add1(). Reviewed by: jeff Modified: head/sys/kern/subr_vmem.c Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Wed Jul 24 07:48:08 2013 (r253595) +++ head/sys/kern/subr_vmem.c Wed Jul 24 08:02:56 2013 (r253596) @@ -650,7 +650,7 @@ vmem_start_callout(void *unused) SYSINIT(vfs, SI_SUB_CONFIGURE, SI_ORDER_ANY, vmem_start_callout, NULL); static void -vmem_add1(vmem_t *vm, vmem_addr_t addr, vmem_size_t size, int flags, int type) +vmem_add1(vmem_t *vm, vmem_addr_t addr, vmem_size_t size, int type) { bt_t *btspan; bt_t *btfree; @@ -726,7 +726,7 @@ vmem_import(vmem_t *vm, vmem_size_t size if (error) return ENOMEM; - vmem_add1(vm, addr, size, flags, BT_TYPE_SPAN); + vmem_add1(vm, addr, size, BT_TYPE_SPAN); return 0; } @@ -1176,7 +1176,7 @@ vmem_add(vmem_t *vm, vmem_addr_t addr, v flags &= VMEM_FLAGS; VMEM_LOCK(vm); if (vm->vm_nfreetags >= BT_MAXALLOC || bt_fill(vm, flags) == 0) - vmem_add1(vm, addr, size, flags, BT_TYPE_SPAN_STATIC); + vmem_add1(vm, addr, size, BT_TYPE_SPAN_STATIC); else error = ENOMEM; VMEM_UNLOCK(vm); From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 08:36:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3186F79A; Wed, 24 Jul 2013 08:36:30 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2336821FE; Wed, 24 Jul 2013 08:36:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6O8aTmi080167; Wed, 24 Jul 2013 08:36:29 GMT (envelope-from se@svn.freebsd.org) Received: (from se@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6O8aT7V080166; Wed, 24 Jul 2013 08:36:29 GMT (envelope-from se@svn.freebsd.org) Message-Id: <201307240836.r6O8aT7V080166@svn.freebsd.org> From: Stefan Esser Date: Wed, 24 Jul 2013 08:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253597 - head/sbin/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 08:36:30 -0000 Author: se Date: Wed Jul 24 08:36:29 2013 New Revision: 253597 URL: http://svnweb.freebsd.org/changeset/base/253597 Log: Remove duplicated parapgraph. MFC after: 3 days Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Wed Jul 24 08:02:56 2013 (r253596) +++ head/sbin/ipfw/ipfw.8 Wed Jul 24 08:36:29 2013 (r253597) @@ -3049,16 +3049,6 @@ option could be used to (re)mark user tr by adding the following to the appropriate place in ruleset: .Pp .Dl "ipfw add setdscp be ip from any to any dscp af11,af21" -.Pp -This rule drops all incoming packets that appear to be coming from another -directly connected system but on the wrong interface. -For example, a packet with a source address of -.Li 192.168.0.0/24 , -configured on -.Li fxp0 , -but coming in on -.Li fxp1 -would be dropped. .Ss DYNAMIC RULES In order to protect a site from flood attacks involving fake TCP packets, it is safer to use dynamic rules: From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 09:05:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 73FF9298; Wed, 24 Jul 2013 09:05:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 653F3238E; Wed, 24 Jul 2013 09:05:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6O955wm089025; Wed, 24 Jul 2013 09:05:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6O955dB089024; Wed, 24 Jul 2013 09:05:05 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307240905.r6O955dB089024@svn.freebsd.org> From: Andriy Gapon Date: Wed, 24 Jul 2013 09:05:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253601 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 09:05:05 -0000 Author: avg Date: Wed Jul 24 09:05:04 2013 New Revision: 253601 URL: http://svnweb.freebsd.org/changeset/base/253601 Log: newvers.sh: fix the fallback case of git-svn detection MFC after: 5 days Sponsored by: HybridCluster Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Wed Jul 24 08:56:59 2013 (r253600) +++ head/sys/conf/newvers.sh Wed Jul 24 09:05:04 2013 (r253601) @@ -132,7 +132,7 @@ if [ -n "$git_cmd" ] ; then else svn=`$git_cmd log | fgrep 'git-svn-id:' | head -1 | \ sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` - if [ -n $svn ] ; then + if [ -n "$svn" ] ; then svn=" r${svn}" git="+${git}" else From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 09:06:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0CAE840C; Wed, 24 Jul 2013 09:06:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F282C23A8; Wed, 24 Jul 2013 09:06:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6O96o5s089338; Wed, 24 Jul 2013 09:06:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6O96oba089337; Wed, 24 Jul 2013 09:06:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307240906.r6O96oba089337@svn.freebsd.org> From: Andriy Gapon Date: Wed, 24 Jul 2013 09:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253602 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 09:06:51 -0000 Author: avg Date: Wed Jul 24 09:06:50 2013 New Revision: 253602 URL: http://svnweb.freebsd.org/changeset/base/253602 Log: newvers.sh: add another git-svn fallback This time it is for a git mirror that stores svn revisions as git notes, e.g. https://github.com/freebsd/freebsd MFC after: 10 days Sponsored by: HybridCluster Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Wed Jul 24 09:05:04 2013 (r253601) +++ head/sys/conf/newvers.sh Wed Jul 24 09:06:50 2013 (r253602) @@ -132,6 +132,11 @@ if [ -n "$git_cmd" ] ; then else svn=`$git_cmd log | fgrep 'git-svn-id:' | head -1 | \ sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` + if [ -z "$svn" ] ; then + svn=`$git_cmd log --format='format:%N' | \ + grep '^svn ' | head -1 | \ + sed -n 's/^.*revision=\([0-9][0-9]*\).*$/\1/p'` + fi if [ -n "$svn" ] ; then svn=" r${svn}" git="+${git}" From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 09:15:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B610892C; Wed, 24 Jul 2013 09:15:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7DBCC243B; Wed, 24 Jul 2013 09:15:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6O9FxvL092647; Wed, 24 Jul 2013 09:15:59 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6O9Fxeo092646; Wed, 24 Jul 2013 09:15:59 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307240915.r6O9Fxeo092646@svn.freebsd.org> From: Andriy Gapon Date: Wed, 24 Jul 2013 09:15:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253603 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 09:15:59 -0000 Author: avg Date: Wed Jul 24 09:15:59 2013 New Revision: 253603 URL: http://svnweb.freebsd.org/changeset/base/253603 Log: zfs: move vnode creation from zfs_znode_cache_constructor to zfs_znode_alloc All other places where a znode is allocated do not need z_vnode at all. These are: - zfs_create_share_dir - zfs_create_fs This chnage ensures two things: - VN_LOCK_ASHARE is not erroneously called for VFIFO vnodes - vn_lock is called on a fully constructed vnode with correct v_ops The change also allows to make zfs_znode_cache_constructor a normal kmem_cache constructor again (as it is in upstream). This allows to avoid a problem where zfs_znode_cache_destructor may be called on un-constructed znodes. MFC after: 17 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Jul 24 09:06:50 2013 (r253602) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Jul 24 09:15:59 2013 (r253603) @@ -113,37 +113,12 @@ extern struct vop_vector zfs_vnodeops; extern struct vop_vector zfs_fifoops; extern struct vop_vector zfs_shareops; -/* - * XXX: We cannot use this function as a cache constructor, because - * there is one global cache for all file systems and we need - * to pass vfsp here, which is not possible, because argument - * 'cdrarg' is defined at kmem_cache_create() time. - */ -/*ARGSUSED*/ static int zfs_znode_cache_constructor(void *buf, void *arg, int kmflags) { znode_t *zp = buf; - vnode_t *vp; - vfs_t *vfsp = arg; - int error; POINTER_INVALIDATE(&zp->z_zfsvfs); - ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs)); - - if (vfsp != NULL) { - error = getnewvnode("zfs", vfsp, &zfs_vnodeops, &vp); - if (error != 0 && (kmflags & KM_NOSLEEP)) - return (-1); - ASSERT(error == 0); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - zp->z_vnode = vp; - vp->v_data = (caddr_t)zp; - VN_LOCK_AREC(vp); - VN_LOCK_ASHARE(vp); - } else { - zp->z_vnode = NULL; - } list_link_init(&zp->z_link_node); @@ -158,6 +133,7 @@ zfs_znode_cache_constructor(void *buf, v zp->z_dirlocks = NULL; zp->z_acl_cached = NULL; + zp->z_vnode = NULL; zp->z_moved = 0; return (0); } @@ -377,7 +353,7 @@ zfs_znode_init(void) rw_init(&zfsvfs_lock, NULL, RW_DEFAULT, NULL); ASSERT(znode_cache == NULL); znode_cache = kmem_cache_create("zfs_znode_cache", - sizeof (znode_t), 0, /* zfs_znode_cache_constructor */ NULL, + sizeof (znode_t), 0, zfs_znode_cache_constructor, zfs_znode_cache_destructor, NULL, NULL, NULL, 0); kmem_cache_set_move(znode_cache, zfs_znode_move); } @@ -501,7 +477,6 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, d zfs_acl_ids_t acl_ids; vattr_t vattr; znode_t *sharezp; - vnode_t *vp, vnode; znode_t *zp; int error; @@ -512,7 +487,6 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, d vattr.va_gid = crgetgid(kcred); sharezp = kmem_cache_alloc(znode_cache, KM_SLEEP); - zfs_znode_cache_constructor(sharezp, zfsvfs->z_parent->z_vfs, 0); ASSERT(!POINTER_IS_VALID(sharezp->z_zfsvfs)); sharezp->z_moved = 0; sharezp->z_unlinked = 0; @@ -520,12 +494,6 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, d sharezp->z_zfsvfs = zfsvfs; sharezp->z_is_sa = zfsvfs->z_use_sa; - sharezp->z_vnode = &vnode; - vnode.v_data = sharezp; - - vp = ZTOV(sharezp); - vp->v_type = VDIR; - VERIFY(0 == zfs_acl_ids_create(sharezp, IS_ROOT_NODE, &vattr, kcred, NULL, &acl_ids)); zfs_mknode(sharezp, &vattr, tx, kcred, IS_ROOT_NODE, &zp, &acl_ids); @@ -536,12 +504,7 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, d zfsvfs->z_shares_dir = sharezp->z_id; zfs_acl_ids_free(&acl_ids); - ZTOV(sharezp)->v_data = NULL; - ZTOV(sharezp)->v_count = 0; - ZTOV(sharezp)->v_holdcnt = 0; - zp->z_vnode = NULL; sa_handle_destroy(sharezp->z_sa_hdl); - sharezp->z_vnode = NULL; kmem_cache_free(znode_cache, sharezp); return (error); @@ -657,9 +620,17 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu uint64_t parent; sa_bulk_attr_t bulk[9]; int count = 0; + int error; zp = kmem_cache_alloc(znode_cache, KM_SLEEP); - zfs_znode_cache_constructor(zp, zfsvfs->z_parent->z_vfs, 0); + + error = getnewvnode("zfs", zfsvfs->z_parent->z_vfs, &zfs_vnodeops, &vp); + if (error != 0) { + kmem_cache_free(znode_cache, zp); + return (NULL); + } + zp->z_vnode = vp; + vp->v_data = zp; ASSERT(zp->z_dirlocks == NULL); ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs)); @@ -749,8 +720,6 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu break; #endif /* sun */ } - if (vp->v_type != VFIFO) - VN_LOCK_ASHARE(vp); mutex_enter(&zfsvfs->z_znodes_lock); list_insert_tail(&zfsvfs->z_all_znodes, zp); @@ -762,6 +731,14 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu zp->z_zfsvfs = zfsvfs; mutex_exit(&zfsvfs->z_znodes_lock); + /* + * Acquire vnode lock before making it available to the world. + */ + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + VN_LOCK_AREC(vp); + if (vp->v_type != VFIFO) + VN_LOCK_ASHARE(vp); + VFS_HOLD(zfsvfs->z_vfs); return (zp); } @@ -1830,7 +1807,6 @@ zfs_create_fs(objset_t *os, cred_t *cr, int error; int i; znode_t *rootzp = NULL; - vnode_t vnode; vattr_t vattr; znode_t *zp; zfs_acl_ids_t acl_ids; @@ -1909,17 +1885,12 @@ zfs_create_fs(objset_t *os, cred_t *cr, bzero(&zfsvfs, sizeof (zfsvfs_t)); rootzp = kmem_cache_alloc(znode_cache, KM_SLEEP); - zfs_znode_cache_constructor(rootzp, NULL, 0); ASSERT(!POINTER_IS_VALID(rootzp->z_zfsvfs)); rootzp->z_moved = 0; rootzp->z_unlinked = 0; rootzp->z_atime_dirty = 0; rootzp->z_is_sa = USE_SA(version, os); - vnode.v_type = VDIR; - vnode.v_data = rootzp; - rootzp->z_vnode = &vnode; - zfsvfs.z_os = os; zfsvfs.z_parent = &zfsvfs; zfsvfs.z_version = version; @@ -1957,7 +1928,6 @@ zfs_create_fs(objset_t *os, cred_t *cr, POINTER_INVALIDATE(&rootzp->z_zfsvfs); sa_handle_destroy(rootzp->z_sa_hdl); - rootzp->z_vnode = NULL; kmem_cache_free(znode_cache, rootzp); /* From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 09:45:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0DE4D649; Wed, 24 Jul 2013 09:45:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E3E9025F4; Wed, 24 Jul 2013 09:45:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6O9jXhx002141; Wed, 24 Jul 2013 09:45:33 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6O9jWkR002132; Wed, 24 Jul 2013 09:45:32 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307240945.r6O9jWkR002132@svn.freebsd.org> From: Andriy Gapon Date: Wed, 24 Jul 2013 09:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253604 - in head/sys: gdb kern ofed/include/linux sys vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 09:45:34 -0000 Author: avg Date: Wed Jul 24 09:45:31 2013 New Revision: 253604 URL: http://svnweb.freebsd.org/changeset/base/253604 Log: rename scheduler->swapper and SI_SUB_RUN_SCHEDULER->SI_SUB_LAST Also directly call swapper() at the end of mi_startup instead of relying on swapper being the last thing in sysinits order. Rationale: - "RUN_SCHEDULER" was misleading, scheduling already takes place at that stage - "scheduler" was misleading, the function swaps in the swapped out processes - another SYSINIT(SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY) could never be invoked depending on its relative order with scheduler; this was not obvious and the bug actually used to exist Reviewed by: kib (ealier version) MFC after: 14 days Modified: head/sys/gdb/gdb_cons.c head/sys/kern/init_main.c head/sys/kern/kern_ntptime.c head/sys/kern/sched_4bsd.c head/sys/ofed/include/linux/module.h head/sys/sys/kernel.h head/sys/sys/sched.h head/sys/vm/vm.h head/sys/vm/vm_glue.c Modified: head/sys/gdb/gdb_cons.c ============================================================================== --- head/sys/gdb/gdb_cons.c Wed Jul 24 09:15:59 2013 (r253603) +++ head/sys/gdb/gdb_cons.c Wed Jul 24 09:45:31 2013 (r253604) @@ -136,7 +136,7 @@ oktousecallout(void *data __unused) { calloutok = 1; } -SYSINIT(gdbhack, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, oktousecallout, NULL); +SYSINIT(gdbhack, SI_SUB_LAST, SI_ORDER_MIDDLE, oktousecallout, NULL); static void gdb_cnputc(struct consdev *cp, int c) Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Wed Jul 24 09:15:59 2013 (r253603) +++ head/sys/kern/init_main.c Wed Jul 24 09:45:31 2013 (r253604) @@ -243,9 +243,6 @@ restart: /* * Traverse the (now) ordered list of system initialization tasks. * Perform each task, and continue on to the next task. - * - * The last item on the list is expected to be the scheduler, - * which will not return. */ for (sipp = sysinit; sipp < sysinit_end; sipp++) { @@ -303,7 +300,13 @@ restart: } } - panic("Shouldn't get here!"); + mtx_assert(&Giant, MA_OWNED | MA_NOTRECURSED); + mtx_unlock(&Giant); + + /* + * Now hand over this thread to swapper. + */ + swapper(); /* NOTREACHED*/ } @@ -346,7 +349,7 @@ static char wit_warn[] = "WARNING: WITNESS option enabled, expect reduced performance.\n"; SYSINIT(witwarn, SI_SUB_COPYRIGHT, SI_ORDER_THIRD + 1, print_caddr_t, wit_warn); -SYSINIT(witwarn2, SI_SUB_RUN_SCHEDULER, SI_ORDER_THIRD + 1, +SYSINIT(witwarn2, SI_SUB_LAST, SI_ORDER_THIRD + 1, print_caddr_t, wit_warn); #endif @@ -355,7 +358,7 @@ static char diag_warn[] = "WARNING: DIAGNOSTIC option enabled, expect reduced performance.\n"; SYSINIT(diagwarn, SI_SUB_COPYRIGHT, SI_ORDER_THIRD + 2, print_caddr_t, diag_warn); -SYSINIT(diagwarn2, SI_SUB_RUN_SCHEDULER, SI_ORDER_THIRD + 2, +SYSINIT(diagwarn2, SI_SUB_LAST, SI_ORDER_THIRD + 2, print_caddr_t, diag_warn); #endif Modified: head/sys/kern/kern_ntptime.c ============================================================================== --- head/sys/kern/kern_ntptime.c Wed Jul 24 09:15:59 2013 (r253603) +++ head/sys/kern/kern_ntptime.c Wed Jul 24 09:45:31 2013 (r253604) @@ -1051,5 +1051,5 @@ start_periodic_resettodr(void *arg __unu periodic_resettodr, NULL); } -SYSINIT(periodic_resettodr, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, +SYSINIT(periodic_resettodr, SI_SUB_LAST, SI_ORDER_MIDDLE, start_periodic_resettodr, NULL); Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Wed Jul 24 09:15:59 2013 (r253603) +++ head/sys/kern/sched_4bsd.c Wed Jul 24 09:45:31 2013 (r253604) @@ -143,7 +143,7 @@ static struct kproc_desc sched_kp = { schedcpu_thread, NULL }; -SYSINIT(schedcpu, SI_SUB_RUN_SCHEDULER, SI_ORDER_FIRST, kproc_start, +SYSINIT(schedcpu, SI_SUB_LAST, SI_ORDER_FIRST, kproc_start, &sched_kp); SYSINIT(sched_setup, SI_SUB_RUN_QUEUE, SI_ORDER_FIRST, sched_setup, NULL); Modified: head/sys/ofed/include/linux/module.h ============================================================================== --- head/sys/ofed/include/linux/module.h Wed Jul 24 09:15:59 2013 (r253603) +++ head/sys/ofed/include/linux/module.h Wed Jul 24 09:45:31 2013 (r253604) @@ -68,17 +68,17 @@ _module_run(void *arg) } #define module_init(fn) \ - SYSINIT(fn, SI_SUB_RUN_SCHEDULER, SI_ORDER_FIRST, _module_run, (fn)) + SYSINIT(fn, SI_SUB_LAST, SI_ORDER_FIRST, _module_run, (fn)) /* * XXX This is a freebsdism designed to work around not having a module * load order resolver built in. */ #define module_init_order(fn, order) \ - SYSINIT(fn, SI_SUB_RUN_SCHEDULER, (order), _module_run, (fn)) + SYSINIT(fn, SI_SUB_LAST, (order), _module_run, (fn)) #define module_exit(fn) \ - SYSUNINIT(fn, SI_SUB_RUN_SCHEDULER, SI_ORDER_FIRST, _module_run, (fn)) + SYSUNINIT(fn, SI_SUB_LAST, SI_ORDER_FIRST, _module_run, (fn)) #define module_get(module) #define module_put(module) Modified: head/sys/sys/kernel.h ============================================================================== --- head/sys/sys/kernel.h Wed Jul 24 09:15:59 2013 (r253603) +++ head/sys/sys/kernel.h Wed Jul 24 09:45:31 2013 (r253604) @@ -79,7 +79,7 @@ extern volatile int ticks; * enumeration values are explicit rather than implicit to provide * for binary compatibility with inserted elements. * - * The SI_SUB_RUN_SCHEDULER value must have the highest lexical value. + * The SI_SUB_LAST value must have the highest lexical value. * * The SI_SUB_SWAP values represent a value used by * the BSD 4.4Lite but not by FreeBSD; it is maintained in dependent @@ -165,7 +165,7 @@ enum sysinit_sub_id { SI_SUB_KTHREAD_IDLE = 0xee00000, /* idle procs*/ SI_SUB_SMP = 0xf000000, /* start the APs*/ SI_SUB_RACCTD = 0xf100000, /* start raccd*/ - SI_SUB_RUN_SCHEDULER = 0xfffffff /* scheduler*/ + SI_SUB_LAST = 0xfffffff /* final initialization */ }; Modified: head/sys/sys/sched.h ============================================================================== --- head/sys/sys/sched.h Wed Jul 24 09:15:59 2013 (r253603) +++ head/sys/sys/sched.h Wed Jul 24 09:45:31 2013 (r253604) @@ -182,7 +182,7 @@ static void name ## _add_proc(void *dumm #name, CTLTYPE_LONG|CTLFLAG_RD|CTLFLAG_MPSAFE, \ ptr, 0, sysctl_dpcpu_long, "LU", descr); \ } \ -SYSINIT(name, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, name ## _add_proc, NULL); +SYSINIT(name, SI_SUB_LAST, SI_ORDER_MIDDLE, name ## _add_proc, NULL); #define SCHED_STAT_DEFINE(name, descr) \ DPCPU_DEFINE(unsigned long, name); \ Modified: head/sys/vm/vm.h ============================================================================== --- head/sys/vm/vm.h Wed Jul 24 09:15:59 2013 (r253603) +++ head/sys/vm/vm.h Wed Jul 24 09:45:31 2013 (r253604) @@ -147,6 +147,7 @@ int swap_reserve_by_cred(vm_ooffset_t in void swap_reserve_force(vm_ooffset_t incr); void swap_release(vm_ooffset_t decr); void swap_release_by_cred(vm_ooffset_t decr, struct ucred *cred); +void swapper(void); #endif /* VM_H */ Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Wed Jul 24 09:15:59 2013 (r253603) +++ head/sys/vm/vm_glue.c Wed Jul 24 09:45:31 2013 (r253604) @@ -96,16 +96,6 @@ __FBSDID("$FreeBSD$"); #include #include -/* - * System initialization - * - * THIS MUST BE THE LAST INITIALIZATION ITEM!!! - * - * Note: run scheduling should be divorced from the vm system. - */ -static void scheduler(void *); -SYSINIT(scheduler, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY, scheduler, NULL); - #ifndef NO_SWAPPING static int swapout(struct proc *); static void swapclear(struct proc *); @@ -695,10 +685,8 @@ faultin(p) * * Giant is held on entry. */ -/* ARGSUSED*/ -static void -scheduler(dummy) - void *dummy; +void +swapper(void) { struct proc *p; struct thread *td; @@ -708,9 +696,6 @@ scheduler(dummy) int ppri; int pri; - mtx_assert(&Giant, MA_OWNED | MA_NOTRECURSED); - mtx_unlock(&Giant); - loop: if (vm_page_count_min()) { VM_WAIT; @@ -761,7 +746,7 @@ loop: * Nothing to do, back to sleep. */ if ((p = pp) == NULL) { - tsleep(&proc0, PVM, "sched", MAXSLP * hz / 2); + tsleep(&proc0, PVM, "swapin", MAXSLP * hz / 2); goto loop; } PROC_LOCK(p); From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 09:50:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2B3F79AA; Wed, 24 Jul 2013 09:50:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1CBF8262C; Wed, 24 Jul 2013 09:50:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6O9oirQ003191; Wed, 24 Jul 2013 09:50:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6O9oiqD003190; Wed, 24 Jul 2013 09:50:44 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307240950.r6O9oiqD003190@svn.freebsd.org> From: Andriy Gapon Date: Wed, 24 Jul 2013 09:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253605 - head/tools/tools/zfsboottest X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 09:50:45 -0000 Author: avg Date: Wed Jul 24 09:50:44 2013 New Revision: 253605 URL: http://svnweb.freebsd.org/changeset/base/253605 Log: zfsboottest: remove explicit -Werror Unfortunately sys/boot is compliled without -Werror at the moment. MFC after: 7 days Modified: head/tools/tools/zfsboottest/Makefile Modified: head/tools/tools/zfsboottest/Makefile ============================================================================== --- head/tools/tools/zfsboottest/Makefile Wed Jul 24 09:45:31 2013 (r253604) +++ head/tools/tools/zfsboottest/Makefile Wed Jul 24 09:50:44 2013 (r253605) @@ -15,8 +15,7 @@ CFLAGS= -O1 \ -I${.CURDIR}/../../../sys/cddl/boot/zfs \ -I. \ -fdiagnostics-show-option \ - -W -Wextra -Wno-sign-compare -Wno-unused-parameter \ - -Werror + -W -Wextra -Wno-sign-compare -Wno-unused-parameter LDFLAGS+=-lmd .if ${MACHINE_CPUARCH} == "amd64" From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 09:59:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C8A52EF3; Wed, 24 Jul 2013 09:59:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B9F7226A2; Wed, 24 Jul 2013 09:59:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6O9xGDw005671; Wed, 24 Jul 2013 09:59:16 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6O9xGQe005670; Wed, 24 Jul 2013 09:59:16 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307240959.r6O9xGQe005670@svn.freebsd.org> From: Andriy Gapon Date: Wed, 24 Jul 2013 09:59:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253606 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 09:59:17 -0000 Author: avg Date: Wed Jul 24 09:59:16 2013 New Revision: 253606 URL: http://svnweb.freebsd.org/changeset/base/253606 Log: zfs module: perform cleanup during shutdown in addition to module unload - move init and fini code into separate functions (like it is done upstream) - invoke fini code via shutdown_post_sync event hook This should make zfs close its underlying devices during shutdown, which may be important for their drivers. MFC after: 20 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Jul 24 09:50:44 2013 (r253605) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Jul 24 09:59:16 2013 (r253606) @@ -6187,54 +6187,96 @@ _info(struct modinfo *modinfop) } #endif /* sun */ -static int -zfs_modevent(module_t mod, int type, void *unused __unused) +static int zfs__init(void); +static int zfs__fini(void); +static void zfs_shutdown(void *, int); + +static eventhandler_tag zfs_shutdown_event_tag; + +int +zfs__init(void) { - int error = 0; - switch (type) { - case MOD_LOAD: - zfs_root_token = root_mount_hold("ZFS"); + zfs_root_token = root_mount_hold("ZFS"); - mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); + mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); - spa_init(FREAD | FWRITE); - zfs_init(); - zvol_init(); - zfs_ioctl_init(); + spa_init(FREAD | FWRITE); + zfs_init(); + zvol_init(); + zfs_ioctl_init(); - tsd_create(&zfs_fsyncer_key, NULL); - tsd_create(&rrw_tsd_key, rrw_tsd_destroy); - tsd_create(&zfs_allow_log_key, zfs_allow_log_destroy); + tsd_create(&zfs_fsyncer_key, NULL); + tsd_create(&rrw_tsd_key, rrw_tsd_destroy); + tsd_create(&zfs_allow_log_key, zfs_allow_log_destroy); - printf("ZFS storage pool version: features support (" SPA_VERSION_STRING ")\n"); - root_mount_rel(zfs_root_token); + printf("ZFS storage pool version: features support (" SPA_VERSION_STRING ")\n"); + root_mount_rel(zfs_root_token); - zfsdev_init(); - break; - case MOD_UNLOAD: - if (spa_busy() || zfs_busy() || zvol_busy() || - zio_injection_enabled) { - error = EBUSY; - break; - } - - zfsdev_fini(); - zvol_fini(); - zfs_fini(); - spa_fini(); - - tsd_destroy(&zfs_fsyncer_key); - tsd_destroy(&rrw_tsd_key); - tsd_destroy(&zfs_allow_log_key); + zfsdev_init(); - mutex_destroy(&zfs_share_lock); - break; + return (0); +} + +int +zfs__fini(void) +{ + if (spa_busy() || zfs_busy() || zvol_busy() || + zio_injection_enabled) { + return (EBUSY); + } + + zfsdev_fini(); + zvol_fini(); + zfs_fini(); + spa_fini(); + + tsd_destroy(&zfs_fsyncer_key); + tsd_destroy(&rrw_tsd_key); + tsd_destroy(&zfs_allow_log_key); + + mutex_destroy(&zfs_share_lock); + + return (0); +} + +static void +zfs_shutdown(void *arg __unused, int howto __unused) +{ + + /* + * ZFS fini routines can not properly work in a panic-ed system. + */ + if (panicstr == NULL) + (void)zfs__fini(); +} + + +static int +zfs_modevent(module_t mod, int type, void *unused __unused) +{ + int err; + + switch (type) { + case MOD_LOAD: + err = zfs__init(); + if (err == 0) + zfs_shutdown_event_tag = EVENTHANDLER_REGISTER( + shutdown_post_sync, zfs_shutdown, NULL, + SHUTDOWN_PRI_FIRST); + return (err); + case MOD_UNLOAD: + err = zfs__fini(); + if (err == 0 && zfs_shutdown_event_tag != NULL) + EVENTHANDLER_DEREGISTER(shutdown_post_sync, + zfs_shutdown_event_tag); + return (err); + case MOD_SHUTDOWN: + return (0); default: - error = EOPNOTSUPP; break; } - return (error); + return (EOPNOTSUPP); } static moduledata_t zfs_mod = { From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 12:35:57 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 469254E0; Wed, 24 Jul 2013 12:35:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0A6902D70; Wed, 24 Jul 2013 12:35:56 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::e19a:aba2:ebe3:e203] (unknown [IPv6:2001:7b8:3a7:0:e19a:aba2:ebe3:e203]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id AC4C65C5A; Wed, 24 Jul 2013 14:35:53 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r253504 - head/sbin/route From: Dimitry Andric In-Reply-To: <20130724.130620.474995323688503714.hrs@allbsd.org> Date: Wed, 24 Jul 2013 14:35:50 +0200 Content-Transfer-Encoding: 7bit Message-Id: <345854C3-836D-4C40-AA72-D0D4484CD7B1@FreeBSD.org> References: <201307201646.r6KGkpM6054344@svn.freebsd.org> <36E48152-1A64-432D-A32D-75059A56E181@FreeBSD.org> <20130724.130620.474995323688503714.hrs@allbsd.org> To: Hiroki Sato X-Mailer: Apple Mail (2.1508) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 12:35:57 -0000 On Jul 24, 2013, at 06:06, Hiroki Sato wrote: > Dimitry Andric wrote > in <36E48152-1A64-432D-A32D-75059A56E181@FreeBSD.org>: ... > di> This breaks /etc/rc.d/defaultroute, since it relies on "route -n get > di> -inet default" printing a line with "interface:" in it. ... > Should be fixed in r253589. Sorry for the breakage. It works fine now. Thanks for the quick fix! -Dimitry From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 12:53:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8BE87A6E; Wed, 24 Jul 2013 12:53:35 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0A3602E30; Wed, 24 Jul 2013 12:53:34 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.7/8.14.7) with ESMTP id r6OCrW16001576 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 24 Jul 2013 14:53:33 +0200 (CEST) (envelope-from uqs@FreeBSD.org) Date: Wed, 24 Jul 2013 14:53:32 +0200 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Pawel Jakub Dawidek Subject: Re: svn commit: r253457 - head/usr.bin/uniq Message-ID: <20130724125332.GC9092@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , Pawel Jakub Dawidek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201307182211.r6IMBRYC091291@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201307182211.r6IMBRYC091291@svn.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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 12:53:35 -0000 On Thu, 2013-07-18 at 22:11:27 +0000, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Thu Jul 18 22:11:27 2013 > New Revision: 253457 > URL: http://svnweb.freebsd.org/changeset/base/253457 > > Log: > Close uniq(1) in the capability mode sandbox and limit descriptors using > capability rights. > > Modified: > head/usr.bin/uniq/uniq.c > > Modified: head/usr.bin/uniq/uniq.c > ============================================================================== > --- head/usr.bin/uniq/uniq.c Thu Jul 18 21:56:10 2013 (r253456) > +++ head/usr.bin/uniq/uniq.c Thu Jul 18 22:11:27 2013 (r253457) > @@ -128,8 +145,34 @@ main (int argc, char *argv[]) > ofp = stdout; > if (argc > 0 && strcmp(argv[0], "-") != 0) > ifp = file(ifn = argv[0], "r"); > + if (cap_rights_limit(fileno(ifp), CAP_FSTAT | CAP_READ) < 0 && > + errno != ENOSYS) { > + err(1, "unable to limit rights for %s", ifn); > + } > + rights = CAP_FSTAT | CAP_WRITE; > if (argc > 1) > ofp = file(argv[1], "w"); > + else > + rights |= CAP_IOCTL; > + if (cap_rights_limit(fileno(ofp), rights) < 0 && errno != ENOSYS) { > + err(1, "unable to limit rights for %s", > + argc > 1 ? argv[1] : "stdout"); > + } > + if ((rights & CAP_IOCTL) != 0) { > + unsigned long cmd; > + > + cmd = TIOCGETA; /* required by isatty(3) in printf(3) */ > + > + if (cap_ioctls_limit(fileno(ofp), &cmd, 1) < 0 && > + errno != ENOSYS) { > + err(1, "unable to limit ioctls for %s", > + argc > 1 ? argv[1] : "stdout"); > + } > + } Deadcode, found by Coverity Scan, CID 1054780 (please mention in your fix-commit). You check for argc > 1 at line 153, only if that is false (meaning argc==1) do you set CAP_IOCTL. So on line 169 argc cannot be >1 and the result is always "stdout". Cheers, Uli From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 13:00:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B062ACE3; Wed, 24 Jul 2013 13:00:49 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 33AB92E77; Wed, 24 Jul 2013 13:00:49 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.7/8.14.7) with ESMTP id r6OD0lYZ002878 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 24 Jul 2013 15:00:47 +0200 (CEST) (envelope-from uqs@FreeBSD.org) Date: Wed, 24 Jul 2013 15:00:47 +0200 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Hiroki Sato Subject: Re: svn commit: r253504 - head/sbin/route Message-ID: <20130724130046.GD9092@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , Hiroki Sato , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201307201646.r6KGkpM6054344@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201307201646.r6KGkpM6054344@svn.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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 13:00:49 -0000 On Sat, 2013-07-20 at 16:46:51 +0000, Hiroki Sato wrote: > Author: hrs > Date: Sat Jul 20 16:46:51 2013 > New Revision: 253504 > URL: http://svnweb.freebsd.org/changeset/base/253504 > > Log: > - Simplify getaddr() and print_getmsg() by using RTAX_* instead of RTA_* > as the argument. > - Reduce unnecessary loop in print_getmsg(). > > Modified: > head/sbin/route/route.c > > Modified: head/sbin/route/route.c > ============================================================================== > --- head/sbin/route/route.c Sat Jul 20 15:58:43 2013 (r253503) > +++ head/sbin/route/route.c Sat Jul 20 16:46:51 2013 (r253504) > @@ -1105,7 +1105,7 @@ inet6_makenetandmask(struct sockaddr_in6 > * returning 1 if a host address, 0 if a network address. > */ > static int > -getaddr(int which, char *str, struct hostent **hpp, int nrflags) > +getaddr(int idx, char *str, struct hostent **hpp, int nrflags) > { > struct sockaddr *sa; > #if defined(INET) > @@ -1130,36 +1130,16 @@ getaddr(int which, char *str, struct hos > aflen = sizeof(struct sockaddr_dl); > #endif > } > - rtm_addrs |= which; > + rtm_addrs |= (1 << idx); > > - switch (which) { > - case RTA_DST: > - sa = (struct sockaddr *)&so[RTAX_DST]; > - break; > - case RTA_GATEWAY: > - sa = (struct sockaddr *)&so[RTAX_GATEWAY]; > - break; > - case RTA_NETMASK: > - sa = (struct sockaddr *)&so[RTAX_NETMASK]; > - break; > - case RTA_GENMASK: > - sa = (struct sockaddr *)&so[RTAX_GENMASK]; > - break; > - case RTA_IFA: > - sa = (struct sockaddr *)&so[RTAX_IFA]; > - break; > - case RTA_IFP: > - sa = (struct sockaddr *)&so[RTAX_IFP]; > - break; > - default: > + if (idx > RTAX_MAX) > usage("internal error"); > - /*NOTREACHED*/ > - } > + sa = (struct sockaddr *)&so[idx]; Coverity Scan flags this as an out-of-bounds write. RTAX_MAX is 8, so idx can be up to 8 (inclusive) in the check above. Do you want to check for idx >= RTAX_MAX maybe? idx is also signed ... Coverity CID is 1054779, btw. Cheers, Uli From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 13:20:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C3E0A6C5; Wed, 24 Jul 2013 13:20:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B3C132F80; Wed, 24 Jul 2013 13:20:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6ODKjmn069644; Wed, 24 Jul 2013 13:20:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6ODKji0069643; Wed, 24 Jul 2013 13:20:45 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307241320.r6ODKji0069643@svn.freebsd.org> From: Adrian Chadd Date: Wed, 24 Jul 2013 13:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253611 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 13:20:45 -0000 Author: adrian Date: Wed Jul 24 13:20:45 2013 New Revision: 253611 URL: http://svnweb.freebsd.org/changeset/base/253611 Log: Add new IDs for The Intel 2230 wireless NIC. Submitted by: Cedric GROSS Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Wed Jul 24 13:07:29 2013 (r253610) +++ head/sys/dev/iwn/if_iwn.c Wed Jul 24 13:20:45 2013 (r253611) @@ -93,6 +93,8 @@ static const struct iwn_ident iwn_ident_ { 0x8086, 0x0091, "Intel Centrino Advanced-N 6230" }, { 0x8086, 0x0885, "Intel Centrino Wireless-N + WiMAX 6150" }, { 0x8086, 0x0886, "Intel Centrino Wireless-N + WiMAX 6150" }, + { 0x8086, 0x0887, "Intel Centrino Wireless-N 2230" }, + { 0x8086, 0x0888, "Intel Centrino Wireless-N 2230" }, { 0x8086, 0x0896, "Intel Centrino Wireless-N 130" }, { 0x8086, 0x0897, "Intel Centrino Wireless-N 130" }, { 0x8086, 0x08ae, "Intel Centrino Wireless-N 100" }, From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 13:31:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DAC248D1; Wed, 24 Jul 2013 13:31:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CC9A52FE5; Wed, 24 Jul 2013 13:31:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6ODVV8U072685; Wed, 24 Jul 2013 13:31:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6ODVVDQ072684; Wed, 24 Jul 2013 13:31:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307241331.r6ODVVDQ072684@svn.freebsd.org> From: Adrian Chadd Date: Wed, 24 Jul 2013 13:31:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253612 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 13:31:31 -0000 Author: adrian Date: Wed Jul 24 13:31:31 2013 New Revision: 253612 URL: http://svnweb.freebsd.org/changeset/base/253612 Log: Support setting up the iwn debug flags during probe/attach by checking "hint.iwn.X.debug". Submitted by: Cedric GROSS Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Wed Jul 24 13:20:45 2013 (r253611) +++ head/sys/dev/iwn/if_iwn.c Wed Jul 24 13:31:31 2013 (r253612) @@ -447,6 +447,15 @@ iwn_attach(device_t dev) sc->sc_dev = dev; +#ifdef IWN_DEBUG + error = resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), "debug", &(sc->sc_debug)); + if (error != 0) + sc->sc_debug = 0; +#else + sc->sc_debug = 0; +#endif + /* * Get the offset of the PCI Express Capability Structure in PCI * Configuration Space. @@ -846,13 +855,13 @@ iwn_radiotap_attach(struct iwn_softc *sc static void iwn_sysctlattach(struct iwn_softc *sc) { +#ifdef IWN_DEBUG struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->sc_dev); struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev); -#ifdef IWN_DEBUG - sc->sc_debug = 0; SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "debug", CTLFLAG_RW, &sc->sc_debug, 0, "control debugging printfs"); + "debug", CTLFLAG_RW, &sc->sc_debug, sc->sc_debug, + "control debugging printfs"); #endif } From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 14:52:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AE46056B; Wed, 24 Jul 2013 14:52:33 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3113D23DA; Wed, 24 Jul 2013 14:52:33 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.7/8.14.7) with ESMTP id r6OEqU3e053775 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 24 Jul 2013 16:52:31 +0200 (CEST) (envelope-from uqs@FreeBSD.org) Date: Wed, 24 Jul 2013 16:52:30 +0200 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: "Andrey V. Elsukov" Subject: Re: svn commit: r253351 - in head: sys/arm/arm sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/aim sys/powerpc/booke sys/sparc64/sparc64 sys/sys usr.bin/netstat Message-ID: <20130724145230.GE9092@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201307150616.r6F6GvOV066908@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201307150616.r6F6GvOV066908@svn.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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 14:52:33 -0000 On Mon, 2013-07-15 at 06:16:57 +0000, Andrey V. Elsukov wrote: > Author: ae > Date: Mon Jul 15 06:16:57 2013 > New Revision: 253351 > URL: http://svnweb.freebsd.org/changeset/base/253351 > > Log: > Introduce new structure sfstat for collecting sendfile's statistics > and remove corresponding fields from struct mbstat. Use PCPU counters > and SFSTAT_INC() macro for update these statistics. > > Discussed with: glebius > > Modified: > head/sys/arm/arm/vm_machdep.c > head/sys/i386/i386/vm_machdep.c > head/sys/kern/kern_mbuf.c > head/sys/kern/uipc_syscalls.c > head/sys/mips/mips/vm_machdep.c > head/sys/powerpc/aim/vm_machdep.c > head/sys/powerpc/booke/vm_machdep.c > head/sys/sparc64/sparc64/vm_machdep.c > head/sys/sys/mbuf.h > head/sys/sys/sf_buf.h > head/usr.bin/netstat/main.c > head/usr.bin/netstat/mbuf.c > > Modified: head/usr.bin/netstat/mbuf.c > ============================================================================== > --- head/usr.bin/netstat/mbuf.c Mon Jul 15 05:09:13 2013 (r253350) > +++ head/usr.bin/netstat/mbuf.c Mon Jul 15 06:16:57 2013 (r253351) > @@ -308,20 +309,21 @@ mbpr(void *kvmd, u_long mbaddr) > &mlen, NULL, 0)) > printf("%d/%d/%d sfbufs in use (current/peak/max)\n", > nsfbufsused, nsfbufspeak, nsfbufs); > - mlen = sizeof(mbstat); > - if (sysctlbyname("kern.ipc.mbstat", &mbstat, &mlen, NULL, 0)) { > - warn("kern.ipc.mbstat"); > + mlen = sizeof(sfstat); > + if (sysctlbyname("kern.ipc.sfstat", &sfstat, &mlen, NULL, 0)) { > + warn("kern.ipc.sfstat"); > goto out; > } > } else { Hmm, Coverity flags the sysctlbyname() as an OVERRUN, claiming: overrun-buffer-val: Overrunning struct type sfstat of 24 bytes by passing it to a function which accesses it at byte offset 37. So sysctlbyname.c basically calls sysctl(3) and Coverity thinks that name[1] is USER_CS_PATH in this case, entering the case statement on line 69, which then clobbers oldlenp with sizeof(_PATH_STDPATH) at line 74 in lib/libc/gen/sysctl.c, which is 37 bytes (sizeof("/rescue:/usr/bin:/bin:/usr/sbin:/sbin")). Then it calls memmove(oldp, _PATH_STDPATH, sizeof(_PATH_STDPATH)); where the oldp only has space for the aforementioned 24 bytes of struct sfstat. Any thoughts on this? It's CID 1054778 at scan.coverity.com, if you wanna have a look yourself. Cheers, Uli From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 15:46:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8B411C46; Wed, 24 Jul 2013 15:46:50 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7882129D1; Wed, 24 Jul 2013 15:46:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6OFkoav016985; Wed, 24 Jul 2013 15:46:50 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6OFkok8016984; Wed, 24 Jul 2013 15:46:50 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307241546.r6OFkok8016984@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 24 Jul 2013 15:46:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253614 - head/usr.bin/patch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 15:46:50 -0000 Author: pfg Date: Wed Jul 24 15:46:49 2013 New Revision: 253614 URL: http://svnweb.freebsd.org/changeset/base/253614 Log: patch: style fix Submitted by: gogolok Modified: head/usr.bin/patch/patch.c Modified: head/usr.bin/patch/patch.c ============================================================================== --- head/usr.bin/patch/patch.c Wed Jul 24 13:43:09 2013 (r253613) +++ head/usr.bin/patch/patch.c Wed Jul 24 15:46:49 2013 (r253614) @@ -239,8 +239,10 @@ main(int argc, char *argv[]) if (!skip_rest_of_patch) scan_input(filearg[0]); - /* from here on, open no standard i/o files, because malloc */ - /* might misfire and we can't catch it easily */ + /* + * from here on, open no standard i/o files, because + * malloc might misfire and we can't catch it easily + */ /* apply each hunk of patch */ hunk = 0; From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 16:22:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D93EB62C; Wed, 24 Jul 2013 16:22:27 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C6CEC2B92; Wed, 24 Jul 2013 16:22:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6OGMR3W034203; Wed, 24 Jul 2013 16:22:27 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6OGMRGO034202; Wed, 24 Jul 2013 16:22:27 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201307241622.r6OGMRGO034202@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 24 Jul 2013 16:22:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253615 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 16:22:27 -0000 Author: marcel Date: Wed Jul 24 16:22:27 2013 New Revision: 253615 URL: http://svnweb.freebsd.org/changeset/base/253615 Log: In uuid_ether_add(), avoid false positives due to the limited type used to hold the sum of the bytes of the MAC address. While here, rename the variable that holds the sum from 'c' to 'sum'. Pointed out by: thompsa@ Modified: head/sys/kern/kern_uuid.c Modified: head/sys/kern/kern_uuid.c ============================================================================== --- head/sys/kern/kern_uuid.c Wed Jul 24 15:46:49 2013 (r253614) +++ head/sys/kern/kern_uuid.c Wed Jul 24 16:22:27 2013 (r253615) @@ -200,8 +200,7 @@ sys_uuidgen(struct thread *td, struct uu int uuid_ether_add(const uint8_t *addr) { - int i; - uint8_t c; + int i, sum; /* * Validate input. No multicast addresses and no addresses that @@ -209,10 +208,10 @@ uuid_ether_add(const uint8_t *addr) */ if (addr[0] & 0x01) return (EINVAL); - c = 0; + sum = 0; for (i = 0; i < UUID_NODE_LEN; i++) - c += addr[i]; - if (c == 0) + sum += addr[i]; + if (sum == 0) return (EINVAL); mtx_lock(&uuid_mutex); From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 16:52:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 3A584E56; Wed, 24 Jul 2013 16:52:43 +0000 (UTC) Date: Wed, 24 Jul 2013 16:52:43 +0000 From: Alexey Dokuchaev To: "Pedro F. Giffuni" Subject: Re: svn commit: r253614 - head/usr.bin/patch Message-ID: <20130724165243.GB3049@FreeBSD.org> References: <201307241546.r6OFkok8016984@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201307241546.r6OFkok8016984@svn.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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 16:52:43 -0000 On Wed, Jul 24, 2013 at 03:46:50PM +0000, Pedro F. Giffuni wrote: > New Revision: 253614 > URL: http://svnweb.freebsd.org/changeset/base/253614 > > Log: > patch: style fix It's still broken: bad use of capital letters (lack thereof), missing full stop (terminating dot). > Submitted by: gogolok $ finger gogolok@freebsd.org [...] finger: gogolok: no such user ?? ./danfe From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 17:55:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 561C13C2; Wed, 24 Jul 2013 17:55:09 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3452B2220; Wed, 24 Jul 2013 17:55:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6OHt9ng062689; Wed, 24 Jul 2013 17:55:09 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6OHt9jt062688; Wed, 24 Jul 2013 17:55:09 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201307241755.r6OHt9jt062688@svn.freebsd.org> From: "Simon J. Gerraty" Date: Wed, 24 Jul 2013 17:55:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253616 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 17:55:09 -0000 Author: sjg Date: Wed Jul 24 17:55:08 2013 New Revision: 253616 URL: http://svnweb.freebsd.org/changeset/base/253616 Log: Fix bug in universe where if upgrade_checks wants a new make, it gets built 16 times in parallel in the same location. While we are at it, until we finish getting rid of fmake, be explicit about the make we want to use, thus avoid the problem of the temp make being the wrong version. Reviewed by: obrien Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Wed Jul 24 16:22:27 2013 (r253615) +++ head/Makefile Wed Jul 24 17:55:08 2013 (r253616) @@ -130,11 +130,34 @@ _MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH .error MAKEOBJDIRPREFIX can only be set in environment, not as a global\ (in make.conf(5)) or command-line variable. .endif -MAKEPATH= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE} -BINMAKE= \ - `if [ -x ${MAKEPATH}/make ]; then echo ${MAKEPATH}/make; else echo ${MAKE}; fi` \ + +# We often need to use the tree's version of make to build it. +# Choices add to complexity though. +# We cannot blindly use a make which may not be the one we want +# so be exlicit - until all choice is removed. +.if !defined(WITHOUT_BMAKE) +WANT_MAKE= bmake +.else +WANT_MAKE= fmake +.endif +MYMAKE= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE}/${WANT_MAKE} +.if defined(.PARSEDIR) +HAVE_MAKE= bmake +.else +HAVE_MAKE= fmake +.endif +.if exists(${MYMAKE}) +SUB_MAKE:= ${MYMAKE} -m ${.CURDIR}/share/mk +.elif ${WANT_MAKE} != ${HAVE_MAKE} || ${WANT_MAKE} != "bmake" +# It may not exist yet but we may cause it to. +# In the case of fmake, upgrade_checks may cause a newer version to be built. +SUB_MAKE= `test -x ${MYMAKE} && echo ${MYMAKE} || echo ${MAKE}` \ -m ${.CURDIR}/share/mk -_MAKE= PATH=${PATH} ${BINMAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} +.else +SUB_MAKE= ${MAKE} -m ${.CURDIR}/share/mk +.endif + +_MAKE= PATH=${PATH} ${SUB_MAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} # Guess machine architecture from machine type, and vice versa. .if !defined(TARGET_ARCH) && defined(TARGET) @@ -291,11 +314,13 @@ kernel: buildkernel installkernel # Perform a few tests to determine if the installed tools are adequate # for building the world. # +# Note: if we ever need to care about the version of bmake, simply testing +# MAKE_VERSION against a required version should suffice. +# upgrade_checks: -.if !defined(.PARSEDIR) -.if !defined(WITHOUT_BMAKE) - (cd ${.CURDIR} && ${MAKE} bmake) -.else +.if ${HAVE_MAKE} != ${WANT_MAKE} + @(cd ${.CURDIR} && ${MAKE} ${WANT_MAKE:S,^f,,}) +.elif ${WANT_MAKE} == "fmake" @if ! (cd ${.CURDIR}/tools/build/make_check && \ PATH=${PATH} ${BINMAKE} obj >/dev/null 2>&1 && \ PATH=${PATH} ${BINMAKE} >/dev/null 2>&1); \ @@ -303,14 +328,13 @@ upgrade_checks: (cd ${.CURDIR} && ${MAKE} make); \ fi .endif -.endif # # Upgrade make(1) to the current version using the installed # headers, libraries and tools. Also, allow the location of # the system bsdmake-like utility to be overridden. # -MMAKEENV= MAKEOBJDIRPREFIX=${MAKEPATH} \ +MMAKEENV= MAKEOBJDIRPREFIX=${MYMAKE:H} \ DESTDIR= \ INSTALL="sh ${.CURDIR}/tools/install.sh" MMAKE= ${MMAKEENV} ${MAKE} \ @@ -327,7 +351,7 @@ make bmake: .PHONY ${MMAKE} obj && \ ${MMAKE} depend && \ ${MMAKE} all && \ - ${MMAKE} install DESTDIR=${MAKEPATH} BINDIR= + ${MMAKE} install DESTDIR=${MYMAKE:H} BINDIR= PROGNAME=${MYMAKE:T} tinderbox: @cd ${.CURDIR} && ${MAKE} DOING_TINDERBOX=YES universe @@ -377,7 +401,8 @@ MAKEFAIL=tee -a ${FAILFILE} MAKEFAIL=cat .endif -universe: universe_prologue upgrade_checks +universe_prologue: upgrade_checks +universe: universe_prologue universe_prologue: @echo "--------------------------------------------------------------" @echo ">>> make universe started on ${STARTTIME}" @@ -387,9 +412,9 @@ universe_prologue: .endif .for target in ${TARGETS} universe: universe_${target} -.ORDER: universe_prologue upgrade_checks universe_${target} universe_epilogue +universe_epilogue: universe_${target} universe_${target}: universe_${target}_prologue -universe_${target}_prologue: +universe_${target}_prologue: universe_prologue @echo ">> ${target} started on `LC_ALL=C date`" .if !defined(MAKE_JUST_KERNELS) .for target_arch in ${TARGET_ARCHES_${target}} @@ -397,7 +422,7 @@ universe_${target}: universe_${target}_$ universe_${target}_${target_arch}: universe_${target}_prologue @echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} started on `LC_ALL=C date`" @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ - ${MAKE} ${JFLAG} ${UNIVERSE_TARGET} \ + ${SUB_MAKE} ${JFLAG} ${UNIVERSE_TARGET} \ TARGET=${target} \ TARGET_ARCH=${target_arch} \ > _.${target}.${target_arch}.${UNIVERSE_TARGET} 2>&1 || \ @@ -418,11 +443,11 @@ universe_${target}: universe_${target}_k universe_${target}_kernels: universe_${target}_prologue .if exists(${KERNSRCDIR}/${target}/conf/NOTES) @(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \ - ${MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ + ${SUB_MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ (echo "${target} 'make LINT' failed," \ "check _.${target}.makeLINT for details"| ${MAKEFAIL})) .endif - @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} TARGET=${target} \ + @cd ${.CURDIR} && ${SUB_MAKE} ${.MAKEFLAGS} TARGET=${target} \ universe_kernels .endif @echo ">> ${target} completed on `LC_ALL=C date`" @@ -445,7 +470,7 @@ TARGET_ARCH_${kernel}!= cd ${KERNSRCDIR} universe_kernconfs: universe_kernconf_${TARGET}_${kernel} universe_kernconf_${TARGET}_${kernel}: @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ - ${MAKE} ${JFLAG} buildkernel \ + ${SUB_MAKE} ${JFLAG} buildkernel \ TARGET=${TARGET} \ TARGET_ARCH=${TARGET_ARCH_${kernel}} \ KERNCONF=${kernel} \ From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 18:13:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9864EB82; Wed, 24 Jul 2013 18:13:43 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 85C4F2342; Wed, 24 Jul 2013 18:13:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6OIDh89069070; Wed, 24 Jul 2013 18:13:43 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6OIDhpH069069; Wed, 24 Jul 2013 18:13:43 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201307241813.r6OIDhpH069069@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 24 Jul 2013 18:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253617 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 18:13:43 -0000 Author: marcel Date: Wed Jul 24 18:13:43 2013 New Revision: 253617 URL: http://svnweb.freebsd.org/changeset/base/253617 Log: Further restrict the MAC addresses that we use for UUID generation to those that are universally administered. While it is possible to add locally administered MAC addresses, it's unclear whether those are (expected) to be more unique than random multicast MAC addresses or not. With many U-Boot configurations assigning fixed and non-official MAC addresses to ethernet ports and without setting the 'X' flag, this change may have very little value in the embedded (development) space. Uniqueness of the universally administered addresses is non- existent on the (H/W) bench and questionable under the (S/W) desk. In short: this change is aimed at production environments... Modified: head/sys/kern/kern_uuid.c Modified: head/sys/kern/kern_uuid.c ============================================================================== --- head/sys/kern/kern_uuid.c Wed Jul 24 17:55:08 2013 (r253616) +++ head/sys/kern/kern_uuid.c Wed Jul 24 18:13:43 2013 (r253617) @@ -203,10 +203,10 @@ uuid_ether_add(const uint8_t *addr) int i, sum; /* - * Validate input. No multicast addresses and no addresses that - * are all zeroes. + * Validate input. No multicast (flag 0x1), no locally administered + * (flag 0x2) and no 'all-zeroes' addresses. */ - if (addr[0] & 0x01) + if (addr[0] & 0x03) return (EINVAL); sum = 0; for (i = 0; i < UUID_NODE_LEN; i++) From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 18:20:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C3FB8ECA for ; Wed, 24 Jul 2013 18:20:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm40-vm10.bullet.mail.gq1.yahoo.com (nm40-vm10.bullet.mail.gq1.yahoo.com [98.136.216.251]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8A28623A4 for ; Wed, 24 Jul 2013 18:20:30 +0000 (UTC) Received: from [98.137.12.60] by nm40.bullet.mail.gq1.yahoo.com with NNFMP; 24 Jul 2013 18:14:30 -0000 Received: from [98.136.164.69] by tm5.bullet.mail.gq1.yahoo.com with NNFMP; 24 Jul 2013 18:14:30 -0000 Received: from [127.0.0.1] by smtp231.mail.gq1.yahoo.com with NNFMP; 24 Jul 2013 18:14:30 -0000 X-Yahoo-Newman-Id: 529793.76084.bm@smtp231.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: dgzrap4VM1mRjiGwqEM1fSmOPcV9JkLBGRKEMb1uCK62i3k wdnJTj9_jCZXoRIhk2AXfaCigsCqL9OhiZO8zOidPOLPon9GtMu9IYQLVe6P SL5AbT8UVMPcNLp.r4jMTFrk6O8leA8yGyb2bMpoWXk3u1XaHHcmIV5EGzXm F8vQC5W30madfYM8oLRFC68PUmHIcjQbJRTpYUUih0ZeaJRX5TdH0BK.Jmdl NSqtF7UDxJvFgml4PcyVn3aPKfiJWW2stcgbA6W9d1QhrVN.J73UQ_RBCyWn Jf8sGwr76ogBrA3p_sDPMJeopyJ8_CCLD3lkzqqYbGNLLVKVzf1t6YBpPP_2 ILmPmcn14EC0lM_hrmMA_Xp2_.XXsrR43Q2JmjVbEzYwW79SiLBN1AuMcEbH q7EhJxm.MVIeoGdHq_cTAIpdrUHA13Yo3Lf4t0.zH6D2Jc.8G7V7lCeZxWRN I7F3wLglEnOHTgOcVDaAMZj_hyJi0Q3iA2BWPSsZ1QOEuIMglcLD9MqimZh8 5iWl.2t_tGQF2yiLodA13D.JuPP3RqOoHe3bRvFZF.uHN81gGoSQLXr3hK1f fLC590R1ghqBjiqW3Nwyi1B4OEno5xrVm4SGLAIzStjNC7fyxSwtfyOhUwa4 3iUwGq4gk3FeeWKDsz1jL4HK7jB9AHQ-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with ) by smtp231.mail.gq1.yahoo.com with SMTP; 24 Jul 2013 18:14:30 +0000 UTC Message-ID: <51F01981.3060603@FreeBSD.org> Date: Wed, 24 Jul 2013 13:14:25 -0500 From: Pedro Giffuni Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Alexey Dokuchaev Subject: Re: svn commit: r253614 - head/usr.bin/patch References: <201307241546.r6OFkok8016984@svn.freebsd.org> <20130724165243.GB3049@FreeBSD.org> In-Reply-To: <20130724165243.GB3049@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 18:20:30 -0000 El 24/07/2013 11:52 a. m., Alexey Dokuchaev escribió: > On Wed, Jul 24, 2013 at 03:46:50PM +0000, Pedro F. Giffuni wrote: >> New Revision: 253614 >> URL: http://svnweb.freebsd.org/changeset/base/253614 >> >> Log: >> patch: style fix > > It's still broken: bad use of capital letters (lack thereof), missing full > stop (terminating dot). > All the comments in that file have that same problem. At least now we are consistently inconsistent. >> Submitted by: gogolok > > $ finger gogolok@freebsd.org > [...] > finger: gogolok: no such user > > ?? > @google ... I actually don't have more information about the submitter: https://code.google.com/p/bsd-patch/issues/detail?id=1&can=1 And as soon as I solve the two regressions in the ports tree the google code project is will be killed. Pedro. From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 18:32:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6605447B; Wed, 24 Jul 2013 18:32:16 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 52CC02433; Wed, 24 Jul 2013 18:32:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6OIWGou074922; Wed, 24 Jul 2013 18:32:16 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6OIWFGc074918; Wed, 24 Jul 2013 18:32:15 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201307241832.r6OIWFGc074918@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 24 Jul 2013 18:32:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253618 - head/sys/dev/usb/gadget X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 18:32:16 -0000 Author: obrien Date: Wed Jul 24 18:32:15 2013 New Revision: 253618 URL: http://svnweb.freebsd.org/changeset/base/253618 Log: per style(9): Kernel include files (i.e. sys/*.h) come first; normally, include OR , but not both. includes , and it is okay to depend on that. Modified: head/sys/dev/usb/gadget/g_audio.c head/sys/dev/usb/gadget/g_keyboard.c head/sys/dev/usb/gadget/g_modem.c head/sys/dev/usb/gadget/g_mouse.c Modified: head/sys/dev/usb/gadget/g_audio.c ============================================================================== --- head/sys/dev/usb/gadget/g_audio.c Wed Jul 24 18:13:43 2013 (r253617) +++ head/sys/dev/usb/gadget/g_audio.c Wed Jul 24 18:32:15 2013 (r253618) @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /*- * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. * @@ -30,11 +29,12 @@ * http://www.usb.org/developers/devclass_docs/termt10.pdf */ +#include +__FBSDID("$FreeBSD$"); + #include #include -#include #include -#include #include #include #include Modified: head/sys/dev/usb/gadget/g_keyboard.c ============================================================================== --- head/sys/dev/usb/gadget/g_keyboard.c Wed Jul 24 18:13:43 2013 (r253617) +++ head/sys/dev/usb/gadget/g_keyboard.c Wed Jul 24 18:32:15 2013 (r253618) @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /*- * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. * @@ -28,11 +27,12 @@ * HID spec: http://www.usb.org/developers/devclass_docs/HID1_11.pdf */ +#include +__FBSDID("$FreeBSD$"); + #include #include -#include #include -#include #include #include #include Modified: head/sys/dev/usb/gadget/g_modem.c ============================================================================== --- head/sys/dev/usb/gadget/g_modem.c Wed Jul 24 18:13:43 2013 (r253617) +++ head/sys/dev/usb/gadget/g_modem.c Wed Jul 24 18:32:15 2013 (r253618) @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /*- * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. * @@ -30,11 +29,12 @@ * http://www.usb.org/developers/devclass_docs/cdc_wmc10.zip */ +#include +__FBSDID("$FreeBSD$"); + #include #include -#include #include -#include #include #include #include Modified: head/sys/dev/usb/gadget/g_mouse.c ============================================================================== --- head/sys/dev/usb/gadget/g_mouse.c Wed Jul 24 18:13:43 2013 (r253617) +++ head/sys/dev/usb/gadget/g_mouse.c Wed Jul 24 18:32:15 2013 (r253618) @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /*- * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. * @@ -28,11 +27,12 @@ * HID spec: http://www.usb.org/developers/devclass_docs/HID1_11.pdf */ +#include +__FBSDID("$FreeBSD$"); + #include #include -#include #include -#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 19:08:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 69C4192E; Wed, 24 Jul 2013 19:08:45 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 2EE832725; Wed, 24 Jul 2013 19:08:44 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 78367DFB; Wed, 24 Jul 2013 20:55:21 +0200 (CEST) Date: Wed, 24 Jul 2013 21:01:01 +0200 From: Pawel Jakub Dawidek To: Ulrich =?iso-8859-1?Q?Sp=F6rlein?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r253457 - head/usr.bin/uniq Message-ID: <20130724190101.GA1400@garage.freebsd.pl> References: <201307182211.r6IMBRYC091291@svn.freebsd.org> <20130724125332.GC9092@acme.spoerlein.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="J/dobhs11T7y2rNN" Content-Disposition: inline In-Reply-To: <20130724125332.GC9092@acme.spoerlein.net> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 19:08:45 -0000 --J/dobhs11T7y2rNN Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 24, 2013 at 02:53:32PM +0200, Ulrich Sp=F6rlein wrote: > On Thu, 2013-07-18 at 22:11:27 +0000, Pawel Jakub Dawidek wrote: > > Author: pjd > > Date: Thu Jul 18 22:11:27 2013 > > New Revision: 253457 > > URL: http://svnweb.freebsd.org/changeset/base/253457 > >=20 > > Log: > > Close uniq(1) in the capability mode sandbox and limit descriptors us= ing > > capability rights. > >=20 > > Modified: > > head/usr.bin/uniq/uniq.c > >=20 > > Modified: head/usr.bin/uniq/uniq.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/usr.bin/uniq/uniq.c Thu Jul 18 21:56:10 2013 (r253456) > > +++ head/usr.bin/uniq/uniq.c Thu Jul 18 22:11:27 2013 (r253457) > > @@ -128,8 +145,34 @@ main (int argc, char *argv[]) > > ofp =3D stdout; > > if (argc > 0 && strcmp(argv[0], "-") !=3D 0) > > ifp =3D file(ifn =3D argv[0], "r"); > > + if (cap_rights_limit(fileno(ifp), CAP_FSTAT | CAP_READ) < 0 && > > + errno !=3D ENOSYS) { > > + err(1, "unable to limit rights for %s", ifn); > > + } > > + rights =3D CAP_FSTAT | CAP_WRITE; > > if (argc > 1) > > ofp =3D file(argv[1], "w"); > > + else > > + rights |=3D CAP_IOCTL; > > + if (cap_rights_limit(fileno(ofp), rights) < 0 && errno !=3D ENOSYS) { > > + err(1, "unable to limit rights for %s", > > + argc > 1 ? argv[1] : "stdout"); > > + } > > + if ((rights & CAP_IOCTL) !=3D 0) { > > + unsigned long cmd; > > + > > + cmd =3D TIOCGETA; /* required by isatty(3) in printf(3) */ > > + > > + if (cap_ioctls_limit(fileno(ofp), &cmd, 1) < 0 && > > + errno !=3D ENOSYS) { > > + err(1, "unable to limit ioctls for %s", > > + argc > 1 ? argv[1] : "stdout"); > > + } > > + } >=20 > Deadcode, found by Coverity Scan, CID 1054780 (please mention in your > fix-commit). You check for argc > 1 at line 153, only if that is false > (meaning argc=3D=3D1) do you set CAP_IOCTL. So on line 169 argc cannot be= >1 > and the result is always "stdout". Interesting. I was aware of this, but left this err() call for consistency in case the condition changes in the future. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --J/dobhs11T7y2rNN Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlHwJG0ACgkQForvXbEpPzQk2wCg8RdABUGsLeO5sChcbppoOC73 deoAn3pTLpgpHsDGkpRq6fBnldn8Naua =2EPc -----END PGP SIGNATURE----- --J/dobhs11T7y2rNN-- From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 20:21:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D2CC0A85; Wed, 24 Jul 2013 20:21:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B17D729D7; Wed, 24 Jul 2013 20:21:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6OKLT6F008330; Wed, 24 Jul 2013 20:21:29 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6OKLTKc008329; Wed, 24 Jul 2013 20:21:29 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307242021.r6OKLTKc008329@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 24 Jul 2013 20:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253619 - head/sys/fs/fuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 20:21:29 -0000 Author: pfg Date: Wed Jul 24 20:21:29 2013 New Revision: 253619 URL: http://svnweb.freebsd.org/changeset/base/253619 Log: fuse: revert kernel_header update. It seems to be causing problems due to the lack of the new features. Found by: bapt Pointed hat: pfg Modified: head/sys/fs/fuse/fuse_kernel.h Modified: head/sys/fs/fuse/fuse_kernel.h ============================================================================== --- head/sys/fs/fuse/fuse_kernel.h Wed Jul 24 18:32:15 2013 (r253618) +++ head/sys/fs/fuse/fuse_kernel.h Wed Jul 24 20:21:29 2013 (r253619) @@ -34,32 +34,14 @@ * $FreeBSD$ */ -/* - * This file defines the kernel interface of FUSE - * - * Protocol changelog: - * - * 7.9: - * - new fuse_getattr_in input argument of GETATTR - * - add lk_flags in fuse_lk_in - * - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in - * - add blksize field to fuse_attr - * - add file flags field to fuse_read_in and fuse_write_in - * - * 7.10 - * - add nonseekable open flag - */ - -#ifndef _FS_FUSE_FUSE_KERNEL_H_ -#define _FS_FUSE_FUSE_KERNEL_H_ - #ifndef linux #include #define __u64 uint64_t #define __u32 uint32_t #define __s32 int32_t #else -#include +#include +#include #endif /** Version number of this interface */ @@ -71,6 +53,12 @@ /** The node ID of the root inode */ #define FUSE_ROOT_ID 1 +/** The major number of the fuse character device */ +#define FUSE_MAJOR MISC_MAJOR + +/** The minor number of the fuse character device */ +#define FUSE_MINOR 229 + /* Make sure all structures are padded to 64bit boundary, so 32bit userspace works under 64bit kernels */ @@ -89,8 +77,6 @@ struct fuse_attr { __u32 uid; __u32 gid; __u32 rdev; - __u32 blksize; - __u32 padding; }; struct fuse_kstatfs { @@ -123,62 +109,27 @@ struct fuse_file_lock { #define FATTR_ATIME (1 << 4) #define FATTR_MTIME (1 << 5) #define FATTR_FH (1 << 6) -#define FATTR_ATIME_NOW (1 << 7) -#define FATTR_MTIME_NOW (1 << 8) -#define FATTR_LOCKOWNER (1 << 9) /** * Flags returned by the OPEN request * * FOPEN_DIRECT_IO: bypass page cache for this open file * FOPEN_KEEP_CACHE: don't invalidate the data cache on open - * FOPEN_NONSEEKABLE: the file is not seekable */ #define FOPEN_DIRECT_IO (1 << 0) #define FOPEN_KEEP_CACHE (1 << 1) -#define FOPEN_NONSEEKABLE (1 << 2) /** * INIT request/reply flags - * - * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".." */ #define FUSE_ASYNC_READ (1 << 0) #define FUSE_POSIX_LOCKS (1 << 1) -#define FUSE_FILE_OPS (1 << 2) -#define FUSE_ATOMIC_O_TRUNC (1 << 3) -#define FUSE_EXPORT_SUPPORT (1 << 4) -#define FUSE_BIG_WRITES (1 << 5) /** * Release flags */ #define FUSE_RELEASE_FLUSH (1 << 0) -/** - * Getattr flags - */ -#define FUSE_GETATTR_FH (1 << 0) - -/** - * Lock flags - */ -#define FUSE_LK_FLOCK (1 << 0) - -/** - * WRITE flags - * - * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed - * FUSE_WRITE_LOCKOWNER: lock_owner field is valid - */ -#define FUSE_WRITE_CACHE (1 << 0) -#define FUSE_WRITE_LOCKOWNER (1 << 1) - -/** - * Read flags - */ -#define FUSE_READ_LOCKOWNER (1 << 1) - enum fuse_opcode { FUSE_LOOKUP = 1, FUSE_FORGET = 2, /* no reply */ @@ -221,8 +172,6 @@ enum fuse_opcode { /* The read buffer is required to be at least 8k, but may be much larger */ #define FUSE_MIN_READ_BUFFER 8192 -#define FUSE_COMPAT_ENTRY_OUT_SIZE 120 - struct fuse_entry_out { __u64 nodeid; /* Inode ID */ __u64 generation; /* Inode generation: nodeid:gen must @@ -238,14 +187,6 @@ struct fuse_forget_in { __u64 nlookup; }; -struct fuse_getattr_in { - __u32 getattr_flags; - __u32 dummy; - __u64 fh; -}; - -#define FUSE_COMPAT_ATTR_OUT_SIZE 96 - struct fuse_attr_out { __u64 attr_valid; /* Cache timeout for the attributes */ __u32 attr_valid_nsec; @@ -253,11 +194,6 @@ struct fuse_attr_out { struct fuse_attr attr; }; -struct fuse_mknod_in { - __u32 mode; - __u32 rdev; -}; - struct fuse_mkdir_in { __u32 mode; __u32 padding; @@ -276,7 +212,7 @@ struct fuse_setattr_in { __u32 padding; __u64 fh; __u64 size; - __u64 lock_owner; + __u64 unused1; __u64 atime; __u64 mtime; __u64 unused2; @@ -319,22 +255,14 @@ struct fuse_read_in { __u64 fh; __u64 offset; __u32 size; - __u32 read_flags; - __u64 lock_owner; - __u32 flags; __u32 padding; }; -#define FUSE_COMPAT_WRITE_IN_SIZE 24 - struct fuse_write_in { __u64 fh; __u64 offset; __u32 size; __u32 write_flags; - __u64 lock_owner; - __u32 flags; - __u32 padding; }; struct fuse_write_out { @@ -373,8 +301,6 @@ struct fuse_lk_in { __u64 fh; __u64 owner; struct fuse_file_lock lk; - __u32 lk_flags; - __u32 padding; }; struct fuse_lk_out { @@ -438,12 +364,10 @@ struct fuse_dirent { __u64 off; __u32 namelen; __u32 type; - char name[]; + char name[0]; }; #define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name) #define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1)) #define FUSE_DIRENT_SIZE(d) \ FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) - -#endif /* !_FS_FUSE_FUSE_KERNEL_H_ */ From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 20:34:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BA11FF70; Wed, 24 Jul 2013 20:34:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A7CF62ACF; Wed, 24 Jul 2013 20:34:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6OKYPlU011569; Wed, 24 Jul 2013 20:34:25 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6OKYP8C011568; Wed, 24 Jul 2013 20:34:25 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201307242034.r6OKYP8C011568@svn.freebsd.org> From: John Baldwin Date: Wed, 24 Jul 2013 20:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253620 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 20:34:25 -0000 Author: jhb Date: Wed Jul 24 20:34:25 2013 New Revision: 253620 URL: http://svnweb.freebsd.org/changeset/base/253620 Log: Use VMFS_OPTIMAL_SPACE instead of VMFS_ALIGNED_SPACE in shm_map(). Modified: head/sys/kern/uipc_shm.c Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Wed Jul 24 20:21:29 2013 (r253619) +++ head/sys/kern/uipc_shm.c Wed Jul 24 20:34:25 2013 (r253620) @@ -779,7 +779,7 @@ shm_map(struct file *fp, size_t size, of offset = trunc_page(offset); size = round_page(size + ofs); rv = vm_map_find(kernel_map, obj, offset, &kva, size, - VMFS_ALIGNED_SPACE, VM_PROT_READ | VM_PROT_WRITE, + VMFS_OPTIMAL_SPACE, VM_PROT_READ | VM_PROT_WRITE, VM_PROT_READ | VM_PROT_WRITE, 0); if (rv == KERN_SUCCESS) { rv = vm_map_wire(kernel_map, kva, kva + size, From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 03:31:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 558A2D4D; Thu, 25 Jul 2013 03:31:28 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 42BD629EC; Thu, 25 Jul 2013 03:31:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6P3VSPF045822; Thu, 25 Jul 2013 03:31:28 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6P3VRPn045820; Thu, 25 Jul 2013 03:31:27 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307250331.r6P3VRPn045820@svn.freebsd.org> From: Rui Paulo Date: Thu, 25 Jul 2013 03:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253634 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 03:31:28 -0000 Author: rpaulo Date: Thu Jul 25 03:31:27 2013 New Revision: 253634 URL: http://svnweb.freebsd.org/changeset/base/253634 Log: Enable modules for the BeagleBone and for the Raspberry Pi. Modified: head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/RPI-B Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Thu Jul 25 02:48:01 2013 (r253633) +++ head/sys/arm/conf/BEAGLEBONE Thu Jul 25 03:31:27 2013 (r253634) @@ -24,7 +24,6 @@ ident BEAGLEBONE include "../ti/am335x/std.beaglebone" -makeoptions MODULES_OVERRIDE="" makeoptions WITHOUT_MODULES="ahc" options HZ=100 @@ -82,7 +81,7 @@ device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards # Boot device is 2nd slice on MMC/SD card -options ROOTDEVNAME=\"ufs:mmcsd0s2\" +options ROOTDEVNAME=\"ufs:mmcsd1s2\" # Console and misc device uart Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Thu Jul 25 02:48:01 2013 (r253633) +++ head/sys/arm/conf/RPI-B Thu Jul 25 03:31:27 2013 (r253634) @@ -20,7 +20,6 @@ ident RPI-B include "../broadcom/bcm2835/std.rpi" -makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols options HZ=100 From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 03:44:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 12D8B182; Thu, 25 Jul 2013 03:44:13 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 00F5C2A6D; Thu, 25 Jul 2013 03:44:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6P3iCTn049057; Thu, 25 Jul 2013 03:44:12 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6P3iC6K049056; Thu, 25 Jul 2013 03:44:12 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307250344.r6P3iC6K049056@svn.freebsd.org> From: Rui Paulo Date: Thu, 25 Jul 2013 03:44:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253635 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 03:44:13 -0000 Author: rpaulo Date: Thu Jul 25 03:44:12 2013 New Revision: 253635 URL: http://svnweb.freebsd.org/changeset/base/253635 Log: Revert ROOTDEVNAME change from previous commit. Modified: head/sys/arm/conf/BEAGLEBONE Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Thu Jul 25 03:31:27 2013 (r253634) +++ head/sys/arm/conf/BEAGLEBONE Thu Jul 25 03:44:12 2013 (r253635) @@ -81,7 +81,7 @@ device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards # Boot device is 2nd slice on MMC/SD card -options ROOTDEVNAME=\"ufs:mmcsd1s2\" +options ROOTDEVNAME=\"ufs:mmcsd0s2\" # Console and misc device uart From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 03:48:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 09F9836F; Thu, 25 Jul 2013 03:48:38 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EBD452A8C; Thu, 25 Jul 2013 03:48:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6P3mbAV049596; Thu, 25 Jul 2013 03:48:37 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6P3mbsG049595; Thu, 25 Jul 2013 03:48:37 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201307250348.r6P3mbsG049595@svn.freebsd.org> From: Tim Kientzle Date: Thu, 25 Jul 2013 03:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253636 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 03:48:38 -0000 Author: kientzle Date: Thu Jul 25 03:48:37 2013 New Revision: 253636 URL: http://svnweb.freebsd.org/changeset/base/253636 Log: Clear entire map structure including locks so that the locks don't accidentally appear to have been already initialized. In particular, this fixes a consistent kernel crash on armv6 with: panic: lock "vm map (user)" 0xc09cc050 already initialized that appeared with r251709. PR: arm/180820 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Thu Jul 25 03:44:12 2013 (r253635) +++ head/sys/vm/vm_map.c Thu Jul 25 03:48:37 2013 (r253636) @@ -239,8 +239,7 @@ vm_map_zinit(void *mem, int size, int fl vm_map_t map; map = (vm_map_t)mem; - map->nentries = 0; - map->size = 0; + memset(map, 0, sizeof(*map)); mtx_init(&map->system_mtx, "vm map (system)", NULL, MTX_DEF | MTX_DUPOK); sx_init(&map->lock, "vm map (user)"); return (0); From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 03:54:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 825EC6CA; Thu, 25 Jul 2013 03:54:10 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5FB162ACB; Thu, 25 Jul 2013 03:54:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6P3s90Y051964; Thu, 25 Jul 2013 03:54:09 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6P3s83c051956; Thu, 25 Jul 2013 03:54:08 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307250354.r6P3s83c051956@svn.freebsd.org> From: Rui Paulo Date: Thu, 25 Jul 2013 03:54:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253637 - in head: etc/mtree lib/libusb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 03:54:10 -0000 Author: rpaulo Date: Thu Jul 25 03:54:08 2013 New Revision: 253637 URL: http://svnweb.freebsd.org/changeset/base/253637 Log: Add pkgconf files for libusb. Reviewed by: hselasky Added: head/lib/libusb/libusb-0.1.pc (contents, props changed) head/lib/libusb/libusb-1.0.pc (contents, props changed) head/lib/libusb/libusb-2.0.pc (contents, props changed) Modified: head/etc/mtree/BSD.usr.dist head/lib/libusb/Makefile Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Thu Jul 25 03:48:37 2013 (r253636) +++ head/etc/mtree/BSD.usr.dist Thu Jul 25 03:54:08 2013 (r253637) @@ -38,6 +38,8 @@ .. lint .. + pkgconfig + .. .. libexec bsdinstall Modified: head/lib/libusb/Makefile ============================================================================== --- head/lib/libusb/Makefile Thu Jul 25 03:48:37 2013 (r253636) +++ head/lib/libusb/Makefile Thu Jul 25 03:54:08 2013 (r253637) @@ -38,6 +38,14 @@ SRCS+= libusb10_io.c CFLAGS+= -DCOMPAT_32BIT .endif +beforeinstall: + ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${.CURDIR}/libusb-0.1.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${.CURDIR}/libusb-1.0.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${.CURDIR}/libusb-2.0.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + # # Cross platform support # Added: head/lib/libusb/libusb-0.1.pc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libusb/libusb-0.1.pc Thu Jul 25 03:54:08 2013 (r253637) @@ -0,0 +1,11 @@ +# $FreeBSD$ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: libusb-0.1 +Description: Library that abstracts ways to access USB devices (v0.1) +Version: 0.1.0 +Libs: -L${libdir} -lusb +Cflags: -I${includedir} Added: head/lib/libusb/libusb-1.0.pc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libusb/libusb-1.0.pc Thu Jul 25 03:54:08 2013 (r253637) @@ -0,0 +1,11 @@ +# $FreeBSD$ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: libusb-1.0 +Description: Library that abstracts ways to access USB devices (v1.0) +Version: 1.0.9 +Libs: -L${libdir} -lusb +Cflags: -I${includedir} Added: head/lib/libusb/libusb-2.0.pc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libusb/libusb-2.0.pc Thu Jul 25 03:54:08 2013 (r253637) @@ -0,0 +1,11 @@ +# $FreeBSD$ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: libusb-2.0 +Description: Library that abstracts ways to access USB devices (v2.0) +Version: 2.0.0 +Libs: -L${libdir} -lusb +Cflags: -I${includedir} From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 03:55:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 942C7859; Thu, 25 Jul 2013 03:55:50 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 816BA2AE6; Thu, 25 Jul 2013 03:55:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6P3toLu052235; Thu, 25 Jul 2013 03:55:50 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6P3toUl052234; Thu, 25 Jul 2013 03:55:50 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307250355.r6P3toUl052234@svn.freebsd.org> From: Rui Paulo Date: Thu, 25 Jul 2013 03:55:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253638 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 03:55:50 -0000 Author: rpaulo Date: Thu Jul 25 03:55:50 2013 New Revision: 253638 URL: http://svnweb.freebsd.org/changeset/base/253638 Log: Bump __FreeBSD_version for the addition of libusb's pkgconf files. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Jul 25 03:54:08 2013 (r253637) +++ head/sys/sys/param.h Thu Jul 25 03:55:50 2013 (r253638) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000039 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000040 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 04:10:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CBEAFBEF; Thu, 25 Jul 2013 04:10:29 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from felyko.com (felyko.com [174.136.100.2]) by mx1.freebsd.org (Postfix) with ESMTP id A83E92B5B; Thu, 25 Jul 2013 04:10:29 +0000 (UTC) Received: from [IPv6:2601:9:4d00:119:15a2:4ee8:1063:6b03] (unknown [IPv6:2601:9:4d00:119:15a2:4ee8:1063:6b03]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 2E93C39869; Wed, 24 Jul 2013 21:10:29 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r253637 - in head: etc/mtree lib/libusb From: Rui Paulo In-Reply-To: <201307250354.r6P3s83c051956@svn.freebsd.org> Date: Wed, 24 Jul 2013 21:10:28 -0700 Content-Transfer-Encoding: 7bit Message-Id: <265840E8-D814-49B6-88E9-7698EE566F8A@FreeBSD.org> References: <201307250354.r6P3s83c051956@svn.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "" X-Mailer: Apple Mail (2.1508) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 04:10:29 -0000 On 24 Jul 2013, at 20:54, Rui Paulo wrote: > Author: rpaulo > Date: Thu Jul 25 03:54:08 2013 > New Revision: 253637 > URL: http://svnweb.freebsd.org/changeset/base/253637 > > Log: > Add pkgconf files for libusb. > > Reviewed by: hselasky This breaks libgphoto2, but I filed a PR with a proposed fix: http://www.freebsd.org/cgi/query-pr.cgi?pr=180825 -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 06:23:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C6EAAFB3; Thu, 25 Jul 2013 06:23:27 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9A2982F51; Thu, 25 Jul 2013 06:23:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6P6NRFo099458; Thu, 25 Jul 2013 06:23:27 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6P6NQZJ099455; Thu, 25 Jul 2013 06:23:26 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307250623.r6P6NQZJ099455@svn.freebsd.org> From: Rui Paulo Date: Thu, 25 Jul 2013 06:23:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253639 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 06:23:27 -0000 Author: rpaulo Date: Thu Jul 25 06:23:26 2013 New Revision: 253639 URL: http://svnweb.freebsd.org/changeset/base/253639 Log: Add ieee80211_add_{qos,wpa,rsn}() functions since they are needed by an OpenBSD driver that is being ported to FreeBSD. Reviewed by: adrian Modified: head/sys/net80211/ieee80211.h head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_proto.h Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Thu Jul 25 03:55:50 2013 (r253638) +++ head/sys/net80211/ieee80211.h Thu Jul 25 06:23:26 2013 (r253639) @@ -711,6 +711,7 @@ enum { IEEE80211_ELEMID_IBSSDFS = 41, IEEE80211_ELEMID_ERP = 42, IEEE80211_ELEMID_HTCAP = 45, + IEEE80211_ELEMID_QOS = 46, IEEE80211_ELEMID_RSN = 48, IEEE80211_ELEMID_XRATES = 50, IEEE80211_ELEMID_HTINFO = 61, Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Thu Jul 25 03:55:50 2013 (r253638) +++ head/sys/net80211/ieee80211_output.c Thu Jul 25 06:23:26 2013 (r253639) @@ -1883,6 +1883,40 @@ ieee80211_add_countryie(uint8_t *frm, st return add_appie(frm, ic->ic_countryie); } +uint8_t * +ieee80211_add_wpa(uint8_t *frm, const struct ieee80211vap *vap) +{ + if (vap->iv_flags & IEEE80211_F_WPA1 && vap->iv_wpa_ie != NULL) + return (add_ie(frm, vap->iv_wpa_ie)); + else { + /* XXX else complain? */ + return (frm); + } +} + +uint8_t * +ieee80211_add_rsn(uint8_t *frm, const struct ieee80211vap *vap) +{ + if (vap->iv_flags & IEEE80211_F_WPA2 && vap->iv_rsn_ie != NULL) + return (add_ie(frm, vap->iv_rsn_ie)); + else { + /* XXX else complain? */ + return (frm); + } +} + +uint8_t * +ieee80211_add_qos(uint8_t *frm, const struct ieee80211_node *ni) +{ + if (ni->ni_flags & IEEE80211_NODE_QOS) { + *frm++ = IEEE80211_ELEMID_QOS; + *frm++ = 1; + *frm++ = 0; + } + + return (frm); +} + /* * Send a probe request frame with the specified ssid * and any optional information element data. @@ -1951,17 +1985,9 @@ ieee80211_send_probereq(struct ieee80211 frm = ieee80211_add_ssid(frm, ssid, ssidlen); rs = ieee80211_get_suprates(ic, ic->ic_curchan); frm = ieee80211_add_rates(frm, rs); - if (vap->iv_flags & IEEE80211_F_WPA2) { - if (vap->iv_rsn_ie != NULL) - frm = add_ie(frm, vap->iv_rsn_ie); - /* XXX else complain? */ - } + frm = ieee80211_add_rsn(frm, vap); frm = ieee80211_add_xrates(frm, rs); - if (vap->iv_flags & IEEE80211_F_WPA1) { - if (vap->iv_wpa_ie != NULL) - frm = add_ie(frm, vap->iv_wpa_ie); - /* XXX else complain? */ - } + frm = ieee80211_add_wpa(frm, vap); if (vap->iv_appie_probereq != NULL) frm = add_appie(frm, vap->iv_appie_probereq); m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); @@ -2227,11 +2253,7 @@ ieee80211_send_mgmt(struct ieee80211_nod frm = ieee80211_add_ssid(frm, ni->ni_essid, ni->ni_esslen); frm = ieee80211_add_rates(frm, &ni->ni_rates); - if (vap->iv_flags & IEEE80211_F_WPA2) { - if (vap->iv_rsn_ie != NULL) - frm = add_ie(frm, vap->iv_rsn_ie); - /* XXX else complain? */ - } + frm = ieee80211_add_rsn(frm, vap); frm = ieee80211_add_xrates(frm, &ni->ni_rates); if (capinfo & IEEE80211_CAPINFO_SPECTRUM_MGMT) { frm = ieee80211_add_powercapability(frm, @@ -2242,11 +2264,7 @@ ieee80211_send_mgmt(struct ieee80211_nod ni->ni_ies.htcap_ie != NULL && ni->ni_ies.htcap_ie[0] == IEEE80211_ELEMID_HTCAP) frm = ieee80211_add_htcap(frm, ni); - if (vap->iv_flags & IEEE80211_F_WPA1) { - if (vap->iv_wpa_ie != NULL) - frm = add_ie(frm, vap->iv_wpa_ie); - /* XXX else complain */ - } + frm = ieee80211_add_wpa(frm, vap); if ((ic->ic_flags & IEEE80211_F_WME) && ni->ni_ies.wme_ie != NULL) frm = ieee80211_add_wme_info(frm, &ic->ic_wme); @@ -2513,11 +2531,7 @@ ieee80211_alloc_proberesp(struct ieee802 if (IEEE80211_IS_CHAN_ANYG(bss->ni_chan)) frm = ieee80211_add_erp(frm, ic); frm = ieee80211_add_xrates(frm, rs); - if (vap->iv_flags & IEEE80211_F_WPA2) { - if (vap->iv_rsn_ie != NULL) - frm = add_ie(frm, vap->iv_rsn_ie); - /* XXX else complain? */ - } + frm = ieee80211_add_rsn(frm, vap); /* * NB: legacy 11b clients do not get certain ie's. * The caller identifies such clients by passing @@ -2529,11 +2543,7 @@ ieee80211_alloc_proberesp(struct ieee802 frm = ieee80211_add_htcap(frm, bss); frm = ieee80211_add_htinfo(frm, bss); } - if (vap->iv_flags & IEEE80211_F_WPA1) { - if (vap->iv_wpa_ie != NULL) - frm = add_ie(frm, vap->iv_wpa_ie); - /* XXX else complain? */ - } + frm = ieee80211_add_wpa(frm, vap); if (vap->iv_flags & IEEE80211_F_WME) frm = ieee80211_add_wme_param(frm, &ic->ic_wme); if (IEEE80211_IS_CHAN_HT(bss->ni_chan) && @@ -2831,21 +2841,13 @@ ieee80211_beacon_construct(struct mbuf * frm = ieee80211_add_erp(frm, ic); } frm = ieee80211_add_xrates(frm, rs); - if (vap->iv_flags & IEEE80211_F_WPA2) { - if (vap->iv_rsn_ie != NULL) - frm = add_ie(frm, vap->iv_rsn_ie); - /* XXX else complain */ - } + frm = ieee80211_add_rsn(frm, vap); if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) { frm = ieee80211_add_htcap(frm, ni); bo->bo_htinfo = frm; frm = ieee80211_add_htinfo(frm, ni); } - if (vap->iv_flags & IEEE80211_F_WPA1) { - if (vap->iv_wpa_ie != NULL) - frm = add_ie(frm, vap->iv_wpa_ie); - /* XXX else complain */ - } + frm = ieee80211_add_wpa(frm, vap); if (vap->iv_flags & IEEE80211_F_WME) { bo->bo_wme = frm; frm = ieee80211_add_wme_param(frm, &ic->ic_wme); Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Thu Jul 25 03:55:50 2013 (r253638) +++ head/sys/net80211/ieee80211_proto.h Thu Jul 25 06:23:26 2013 (r253639) @@ -136,6 +136,9 @@ struct mbuf *ieee80211_alloc_cts(struct uint8_t *ieee80211_add_rates(uint8_t *, const struct ieee80211_rateset *); uint8_t *ieee80211_add_xrates(uint8_t *, const struct ieee80211_rateset *); +uint8_t *ieee80211_add_wpa(uint8_t *, const struct ieee80211vap *); +uint8_t *ieee80211_add_rsn(uint8_t *, const struct ieee80211vap *); +uint8_t *ieee80211_add_qos(uint8_t *, const struct ieee80211_node *); uint16_t ieee80211_getcapinfo(struct ieee80211vap *, struct ieee80211_channel *); From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 07:54:16 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 18AB711A; Thu, 25 Jul 2013 07:54:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id CFE1C234E; Thu, 25 Jul 2013 07:54:15 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 2CB72421F23; Thu, 25 Jul 2013 17:26:18 +1000 (EST) Date: Thu, 25 Jul 2013 17:26:16 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Tim Kientzle Subject: Re: svn commit: r253636 - head/sys/vm In-Reply-To: <201307250348.r6P3mbsG049595@svn.freebsd.org> Message-ID: <20130725171038.O841@besplex.bde.org> References: <201307250348.r6P3mbsG049595@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=YYGEuWhf c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=B9HLQOAVcRIA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=AptvzqaXglMA:10 a=FdjqN1yl-l20e4seHRMA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 07:54:16 -0000 On Thu, 25 Jul 2013, Tim Kientzle wrote: > Log: > Clear entire map structure including locks so that the > locks don't accidentally appear to have been already > initialized. > > In particular, this fixes a consistent kernel crash on > armv6 with: > panic: lock "vm map (user)" 0xc09cc050 already initialized > that appeared with r251709. > > PR: arm/180820 > > Modified: > head/sys/vm/vm_map.c > > Modified: head/sys/vm/vm_map.c > ============================================================================== > --- head/sys/vm/vm_map.c Thu Jul 25 03:44:12 2013 (r253635) > +++ head/sys/vm/vm_map.c Thu Jul 25 03:48:37 2013 (r253636) > @@ -239,8 +239,7 @@ vm_map_zinit(void *mem, int size, int fl > vm_map_t map; > > map = (vm_map_t)mem; > - map->nentries = 0; > - map->size = 0; > + memset(map, 0, sizeof(*map)); > mtx_init(&map->system_mtx, "vm map (system)", NULL, MTX_DEF | MTX_DUPOK); > sx_init(&map->lock, "vm map (user)"); > return (0); memset() to value 0 is spelled bzero() in the kernel. Before this commit, vm used normal style in 21 of 28 instances. The style regression is even smaller in kern -- 18 of 169 instances (3 in comments, and 1 of these in a loop doing a memset to a nonzero value, which was required before about FreeBSD-4 since memset() didn't exist in the kernel. memset() is still a slightly pessimized wrapper round bzero() when the value is nonzero, and a more pessimized loop otherwise). In FreeBSD-4, this style bug was not present in vm (0 of 16 instances) and was smaller in kern (6 of 121 instances (3 in comments, and 1 to #define a buggy memset() in terms of bzero() for the other 2)). Bruce From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 08:08:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AFA269CB; Thu, 25 Jul 2013 08:08:07 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2D3522426; Thu, 25 Jul 2013 08:08:06 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.7/8.14.7/ALCHEMY.FRANKEN.DE) with ESMTP id r6P87wva093360; Thu, 25 Jul 2013 10:07:58 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.7/8.14.7/Submit) id r6P87whZ093359; Thu, 25 Jul 2013 10:07:58 +0200 (CEST) (envelope-from marius) Date: Thu, 25 Jul 2013 10:07:58 +0200 From: Marius Strobl To: Craig Rodrigues Subject: Re: svn commit: r253346 - in head/sys: kern net netgraph netgraph/bluetooth/socket Message-ID: <20130725080758.GE948@alchemy.franken.de> References: <201307150132.r6F1WttU081255@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201307150132.r6F1WttU081255@svn.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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 08:08:07 -0000 On Mon, Jul 15, 2013 at 01:32:55AM +0000, Craig Rodrigues wrote: > Author: rodrigc > Date: Mon Jul 15 01:32:55 2013 > New Revision: 253346 > URL: http://svnweb.freebsd.org/changeset/base/253346 > > Log: > PR: 168520 170096 > Submitted by: adrian, zec > > Fix multiple kernel panics when VIMAGE is enabled in the kernel. > These fixes are based on patches submitted by Adrian Chadd and Marko Zec. > > (1) Set curthread->td_vnet to vnet0 in device_probe_and_attach() just before calling > device_attach(). This fixes multiple VIMAGE related kernel panics > when trying to attach Bluetooth or USB Ethernet devices because > curthread->td_vnet is NULL. > > (2) Set curthread->td_vnet in if_detach(). This fixes kernel panics when detaching networking > interfaces, especially USB Ethernet devices. > > (3) Use VNET_DOMAIN_SET() in ng_btsocket.c > > (4) In ng_unref_node() set curthread->td_vnet. This fixes kernel panics > when detaching Netgraph nodes. > > Modified: > head/sys/kern/subr_bus.c > head/sys/net/if.c > head/sys/netgraph/bluetooth/socket/ng_btsocket.c > head/sys/netgraph/ng_base.c > > Modified: head/sys/kern/subr_bus.c > ============================================================================== > --- head/sys/kern/subr_bus.c Mon Jul 15 00:49:10 2013 (r253345) > +++ head/sys/kern/subr_bus.c Mon Jul 15 01:32:55 2013 (r253346) > @@ -53,6 +53,8 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#include > + > #include > > #include > @@ -2735,7 +2737,11 @@ device_probe_and_attach(device_t dev) > return (0); > else if (error != 0) > return (error); > - return (device_attach(dev)); > + > + CURVNET_SET_QUIET(vnet0); > + error = device_attach(dev); > + CURVNET_RESTORE(); > + return error; > } Uhm - do we really need to have that layering violation in subr_bus.c? Wouldn't it be sufficient to set curthread->td_vnet to vnet0 in if_alloc(9) or if_attach(9) at least instead? Marius From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 08:10:00 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 381A8C76; Thu, 25 Jul 2013 08:10:00 +0000 (UTC) (envelope-from hps@bitfrost.no) Received: from mta.bitpro.no (mta.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id BB50C2457; Thu, 25 Jul 2013 08:09:59 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta.bitpro.no (Postfix) with ESMTP id CBAD17A153; Thu, 25 Jul 2013 10:09:57 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id 2122C8EFEDC; Thu, 25 Jul 2013 10:10:02 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ywf2WLcw1MbJ; Thu, 25 Jul 2013 10:10:01 +0200 (CEST) Received: from laptop015.hselasky.homeunix.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) by mail.lockless.no (Postfix) with ESMTPSA id E43D78EFEBC; Thu, 25 Jul 2013 10:10:00 +0200 (CEST) Message-ID: <51F0DDB0.7080102@bitfrost.no> Date: Thu, 25 Jul 2013 10:11:28 +0200 From: Hans Petter Selasky Organization: Bitfrost A/S User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130522 Thunderbird/17.0.6 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r253636 - head/sys/vm References: <201307250348.r6P3mbsG049595@svn.freebsd.org> <20130725171038.O841@besplex.bde.org> In-Reply-To: <20130725171038.O841@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Tim Kientzle , src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 08:10:00 -0000 On 07/25/13 09:26, Bruce Evans wrote: > On Thu, 25 Jul 2013, Tim Kientzle wrote: > >> Log: >> Clear entire map structure including locks so that the >> locks don't accidentally appear to have been already >> initialized. >> >> In particular, this fixes a consistent kernel crash on >> armv6 with: >> panic: lock "vm map (user)" 0xc09cc050 already initialized >> that appeared with r251709. >> >> PR: arm/180820 >> >> Modified: >> head/sys/vm/vm_map.c >> >> Modified: head/sys/vm/vm_map.c >> ============================================================================== >> >> --- head/sys/vm/vm_map.c Thu Jul 25 03:44:12 2013 (r253635) >> +++ head/sys/vm/vm_map.c Thu Jul 25 03:48:37 2013 (r253636) >> @@ -239,8 +239,7 @@ vm_map_zinit(void *mem, int size, int fl >> vm_map_t map; >> >> map = (vm_map_t)mem; >> - map->nentries = 0; >> - map->size = 0; >> + memset(map, 0, sizeof(*map)); >> mtx_init(&map->system_mtx, "vm map (system)", NULL, MTX_DEF | >> MTX_DUPOK); >> sx_init(&map->lock, "vm map (user)"); >> return (0); > > memset() to value 0 is spelled bzero() in the kernel. > Hi, Is this the "memset vs bzero" or "batman vs superman" discussion again ;-) The structure looks like some size, so bzero() might run faster than memset() depending on the compiler settings. Should be profiled before changed! --HPS From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 08:41:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C7A86D10; Thu, 25 Jul 2013 08:41:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B525126A9; Thu, 25 Jul 2013 08:41:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6P8fM19043444; Thu, 25 Jul 2013 08:41:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6P8fMco043443; Thu, 25 Jul 2013 08:41:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201307250841.r6P8fMco043443@svn.freebsd.org> From: Alexander Motin Date: Thu, 25 Jul 2013 08:41:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253643 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 08:41:22 -0000 Author: mav Date: Thu Jul 25 08:41:22 2013 New Revision: 253643 URL: http://svnweb.freebsd.org/changeset/base/253643 Log: Following r222950, revert unintentional change cls -> class in argument name in r245264. Aside from non-uniformity, that again confused C++ compilers. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Thu Jul 25 08:05:25 2013 (r253642) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Thu Jul 25 08:41:22 2013 (r253643) @@ -172,7 +172,7 @@ extern void ddt_object_name(ddt_t *ddt, extern int ddt_object_walk(ddt_t *ddt, enum ddt_type type, enum ddt_class cls, uint64_t *walk, ddt_entry_t *dde); extern int ddt_object_count(ddt_t *ddt, enum ddt_type type, - enum ddt_class class, uint64_t *count); + enum ddt_class cls, uint64_t *count); extern int ddt_object_info(ddt_t *ddt, enum ddt_type type, enum ddt_class cls, dmu_object_info_t *); extern boolean_t ddt_object_exists(ddt_t *ddt, enum ddt_type type, From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 08:48:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F25A7414; Thu, 25 Jul 2013 08:48:39 +0000 (UTC) (envelope-from zec@fer.hr) Received: from mail.fer.hr (mail.fer.hr [161.53.72.233]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 83A362731; Thu, 25 Jul 2013 08:48:39 +0000 (UTC) Received: from x23.lan (89.164.242.107) by MAIL.fer.hr (161.53.72.233) with Microsoft SMTP Server (TLS) id 14.2.342.3; Thu, 25 Jul 2013 10:48:30 +0200 From: Marko Zec To: Marius Strobl Subject: Re: svn commit: r253346 - in head/sys: kern net netgraph netgraph/bluetooth/socket Date: Thu, 25 Jul 2013 10:48:33 +0200 User-Agent: KMail/1.9.10 References: <201307150132.r6F1WttU081255@svn.freebsd.org> <20130725080758.GE948@alchemy.franken.de> In-Reply-To: <20130725080758.GE948@alchemy.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <201307251048.33475.zec@fer.hr> X-Originating-IP: [89.164.242.107] Cc: Craig Rodrigues , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 08:48:40 -0000 On Thursday 25 July 2013 10:07:58 Marius Strobl wrote: > On Mon, Jul 15, 2013 at 01:32:55AM +0000, Craig Rodrigues wrote: > > Author: rodrigc > > Date: Mon Jul 15 01:32:55 2013 > > New Revision: 253346 > > URL: http://svnweb.freebsd.org/changeset/base/253346 > > > > Log: > > PR: 168520 170096 > > Submitted by: adrian, zec > > > > Fix multiple kernel panics when VIMAGE is enabled in the kernel. > > These fixes are based on patches submitted by Adrian Chadd and Marko > > Zec. > > > > (1) Set curthread->td_vnet to vnet0 in device_probe_and_attach() > > just before calling device_attach(). This fixes multiple VIMAGE > > related kernel panics when trying to attach Bluetooth or USB Ethernet > > devices because curthread->td_vnet is NULL. > > > > (2) Set curthread->td_vnet in if_detach(). This fixes kernel panics > > when detaching networking interfaces, especially USB Ethernet devices. > > > > (3) Use VNET_DOMAIN_SET() in ng_btsocket.c > > > > (4) In ng_unref_node() set curthread->td_vnet. This fixes kernel > > panics when detaching Netgraph nodes. > > > > Modified: > > head/sys/kern/subr_bus.c > > head/sys/net/if.c > > head/sys/netgraph/bluetooth/socket/ng_btsocket.c > > head/sys/netgraph/ng_base.c > > > > Modified: head/sys/kern/subr_bus.c > > ======================================================================= > >======= --- head/sys/kern/subr_bus.c Mon Jul 15 00:49:10 2013 (r253345) > > +++ head/sys/kern/subr_bus.c Mon Jul 15 01:32:55 2013 (r253346) @@ > > -53,6 +53,8 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > > > +#include > > + > > #include > > > > #include > > @@ -2735,7 +2737,11 @@ device_probe_and_attach(device_t dev) > > return (0); > > else if (error != 0) > > return (error); > > - return (device_attach(dev)); > > + > > + CURVNET_SET_QUIET(vnet0); > > + error = device_attach(dev); > > + CURVNET_RESTORE(); > > + return error; > > } > > Uhm - do we really need to have that layering violation in subr_bus.c? > Wouldn't it be sufficient to set curthread->td_vnet to vnet0 in > if_alloc(9) or if_attach(9) at least instead? That wouldn't solve the issues with attaching netgraph node(s) to the arriving device, nor potentially other issues unrelated to if_alloc or if_attach. Marko From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 09:12:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C0C14687; Thu, 25 Jul 2013 09:12:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AE2B62994; Thu, 25 Jul 2013 09:12:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6P9CkwL054016; Thu, 25 Jul 2013 09:12:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6P9CkVE054015; Thu, 25 Jul 2013 09:12:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201307250912.r6P9CkVE054015@svn.freebsd.org> From: Alexander Motin Date: Thu, 25 Jul 2013 09:12:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253644 - head/sys/dev/ata/chipsets X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 09:12:46 -0000 Author: mav Date: Thu Jul 25 09:12:46 2013 New Revision: 253644 URL: http://svnweb.freebsd.org/changeset/base/253644 Log: Add missing NULL check after malloc(M_NOWAIT). Submitted by: Dmitry Luhtionov Modified: head/sys/dev/ata/chipsets/ata-promise.c Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Thu Jul 25 08:41:22 2013 (r253643) +++ head/sys/dev/ata/chipsets/ata-promise.c Thu Jul 25 09:12:46 2013 (r253644) @@ -287,6 +287,10 @@ ata_promise_chipinit(device_t dev) /* setup host packet controls */ hpkt = malloc(sizeof(struct ata_promise_sx4), M_ATAPCI, M_NOWAIT | M_ZERO); + if (hpkt == NULL) { + device_printf(dev, "Cannot allocate HPKT\n"); + goto failnfree; + } mtx_init(&hpkt->mtx, "ATA promise HPKT lock", NULL, MTX_DEF); TAILQ_INIT(&hpkt->queue); hpkt->busy = 0; From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 09:29:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D60B1140; Thu, 25 Jul 2013 09:29:48 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C2D0A2AE4; Thu, 25 Jul 2013 09:29:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6P9TmI5058349; Thu, 25 Jul 2013 09:29:48 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6P9TmYi058348; Thu, 25 Jul 2013 09:29:48 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201307250929.r6P9TmYi058348@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 25 Jul 2013 09:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253645 - head/sys/dev/sound/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 09:29:48 -0000 Author: uqs Date: Thu Jul 25 09:29:48 2013 New Revision: 253645 URL: http://svnweb.freebsd.org/changeset/base/253645 Log: snd_ds1(4): Fix order of arguments for stereo/16bit mode This function is called 4 times in this file, with swapped parameter ordering. Fix the function definition instead of all the call sites. 16bit/stereo or 8bit/mono playback is unaffected and was probably working fine before, this should fix 16bit/mono and 8bit/stereo playback. Found by: Coverity Scan, CID 1006688 Modified: head/sys/dev/sound/pci/ds1.c Modified: head/sys/dev/sound/pci/ds1.c ============================================================================== --- head/sys/dev/sound/pci/ds1.c Thu Jul 25 09:12:46 2013 (r253644) +++ head/sys/dev/sound/pci/ds1.c Thu Jul 25 09:29:48 2013 (r253645) @@ -365,7 +365,7 @@ ds_allocpslot(struct sc_info *sc) } static int -ds_initpbank(volatile struct pbank *pb, int ch, int b16, int stereo, u_int32_t rate, bus_addr_t base, u_int32_t len) +ds_initpbank(volatile struct pbank *pb, int ch, int stereo, int b16, u_int32_t rate, bus_addr_t base, u_int32_t len) { u_int32_t lv[] = {1, 1, 0, 0, 0}; u_int32_t rv[] = {1, 0, 1, 0, 0}; From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 09:30:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id ACFA0233; Thu, 25 Jul 2013 09:30:00 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9B0AF2AEB; Thu, 25 Jul 2013 09:30:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6P9U0BK058452; Thu, 25 Jul 2013 09:30:00 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6P9U00t058451; Thu, 25 Jul 2013 09:30:00 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201307250930.r6P9U00t058451@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 25 Jul 2013 09:30:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253646 - head/sys/dev/aic7xxx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 09:30:00 -0000 Author: uqs Date: Thu Jul 25 09:30:00 2013 New Revision: 253646 URL: http://svnweb.freebsd.org/changeset/base/253646 Log: Match function definition to declaration and call-site. SVN r95378 refactored ahc_9005_subdevinfo_valid out into a separate function but swapped the vendor/subvendor and device/subdevice pairs of the parameters. Found by: Coverity Prevent, CID 744931 Reviewed by: gibbs Modified: head/sys/dev/aic7xxx/aic7xxx_pci.c Modified: head/sys/dev/aic7xxx/aic7xxx_pci.c ============================================================================== --- head/sys/dev/aic7xxx/aic7xxx_pci.c Thu Jul 25 09:29:48 2013 (r253645) +++ head/sys/dev/aic7xxx/aic7xxx_pci.c Thu Jul 25 09:30:00 2013 (r253646) @@ -673,8 +673,8 @@ const u_int ahc_num_pci_devs = NUM_ELEME #define STA 0x08 #define DPR 0x01 -static int ahc_9005_subdevinfo_valid(uint16_t vendor, uint16_t device, - uint16_t subvendor, uint16_t subdevice); +static int ahc_9005_subdevinfo_valid(uint16_t device, uint16_t vendor, + uint16_t subdevice, uint16_t subvendor); static int ahc_ext_scbram_present(struct ahc_softc *ahc); static void ahc_scbram_config(struct ahc_softc *ahc, int enable, int pcheck, int fast, int large); @@ -766,7 +766,7 @@ ahc_find_pci_device(aic_dev_softc_t pci) * ID as valid. */ if (aic_get_pci_function(pci) > 0 - && ahc_9005_subdevinfo_valid(vendor, device, subvendor, subdevice) + && ahc_9005_subdevinfo_valid(device, vendor, subdevice, subvendor) && SUBID_9005_MFUNCENB(subdevice) == 0) return (NULL); From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 09:36:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A6FF55F0; Thu, 25 Jul 2013 09:36:49 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-la0-x22f.google.com (mail-la0-x22f.google.com [IPv6:2a00:1450:4010:c03::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C162D2B58; Thu, 25 Jul 2013 09:36:48 +0000 (UTC) Received: by mail-la0-f47.google.com with SMTP id fe20so1160046lab.6 for ; Thu, 25 Jul 2013 02:36:46 -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 :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=xeqo7JWFg630vQVxmen26eMe7/+n5tYfj2ttBX/HS1o=; b=Vz+StGlsdSLb1sdgQE+YlliInMEsVoP/6GZX0Pa/3rPS2rcY00K/5csybscYVL4/Ou LvtANweJ1EBpudP8GRmJF/PDaQRzMsx3MezA7Q8pfElRw87HA5xedpqtMQa54O7ojaV0 hD5TM8nmJ5DTuZPdytglvsdMwGTLDX/vf0rv3xtYapT8OI9rCQIPuIFXVtkZIcLkb5Es uyQ76I0jqUU/D016L1n6Z7HDij30+6HunOxKzWzO9bfK9eqcc5uZyZIeawOm51jTHa6z DD6nfPFEkD7RAJUhRM6r8laPexvP9Jzx+xiqn1T6NCPGMe4AQ38pGgsuiWBf7GC4IOK3 8vEQ== MIME-Version: 1.0 X-Received: by 10.152.87.194 with SMTP id ba2mr19089614lab.6.1374745006185; Thu, 25 Jul 2013 02:36:46 -0700 (PDT) Sender: crodr001@gmail.com Received: by 10.112.149.38 with HTTP; Thu, 25 Jul 2013 02:36:46 -0700 (PDT) In-Reply-To: <20130725080758.GE948@alchemy.franken.de> References: <201307150132.r6F1WttU081255@svn.freebsd.org> <20130725080758.GE948@alchemy.franken.de> Date: Thu, 25 Jul 2013 02:36:46 -0700 X-Google-Sender-Auth: f2UuBsbDDZ_kAdf09eUtFKaSDLc Message-ID: Subject: Re: svn commit: r253346 - in head/sys: kern net netgraph netgraph/bluetooth/socket From: Craig Rodrigues To: Marius Strobl Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 09:36:49 -0000 On Thu, Jul 25, 2013 at 1:07 AM, Marius Strobl wrote: > > Uhm - do we really need to have that layering violation in subr_bus.c? > Wouldn't it be sufficient to set curthread->td_vnet to vnet0 in if_alloc(9) > or if_attach(9) at least instead? > There was some discussion about this involving Marko Zec, Adrian Chadd, and myself starting in this thread: http://lists.freebsd.org/pipermail/svn-src-all/2013-July/071798.html Adrian and Marko converged on similar patches: http://lists.freebsd.org/pipermail/freebsd-hackers/2012-November/041120.html http://people.freebsd.org/~adrian/ath/20130712-vimage-default-attach-detach.diff As Marko mentioned in another e-mail on this thread, the patch as it is necessary in order to fix VIMAGE related kernel panics in many different scenarios, including ones involving Netgraph nodes. -- Craig From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 10:24:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 223C92C4; Thu, 25 Jul 2013 10:24:57 +0000 (UTC) (envelope-from zec@fer.hr) Received: from mail.fer.hr (mail.fer.hr [161.53.72.233]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A24732E37; Thu, 25 Jul 2013 10:24:56 +0000 (UTC) Received: from vipnet1585.mobile.carnet.hr (31.147.6.49) by MAIL.fer.hr (161.53.72.233) with Microsoft SMTP Server (TLS) id 14.2.342.3; Thu, 25 Jul 2013 12:24:52 +0200 From: Marko Zec To: Craig Rodrigues Subject: Re: svn commit: r253346 - in head/sys: kern net netgraph netgraph/bluetooth/socket Date: Thu, 25 Jul 2013 12:24:53 +0200 User-Agent: KMail/1.9.10 References: <201307150132.r6F1WttU081255@svn.freebsd.org> <20130725080758.GE948@alchemy.franken.de> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <201307251224.53211.zec@fer.hr> X-Originating-IP: [31.147.6.49] Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Marius Strobl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 10:24:57 -0000 On Thursday 25 July 2013 11:36:46 Craig Rodrigues wrote: > On Thu, Jul 25, 2013 at 1:07 AM, Marius Strobl wrote: > > Uhm - do we really need to have that layering violation in subr_bus.c? > > Wouldn't it be sufficient to set curthread->td_vnet to vnet0 in > > if_alloc(9) or if_attach(9) at least instead? > > There was some discussion about this involving Marko Zec, Adrian Chadd, > and myself > starting in this thread: > > http://lists.freebsd.org/pipermail/svn-src-all/2013-July/071798.html > > Adrian and Marko converged on similar patches: > > http://lists.freebsd.org/pipermail/freebsd-hackers/2012-November/041120.h >tml > http://people.freebsd.org/~adrian/ath/20130712-vimage-default-attach-deta >ch.diff > > > As Marko mentioned in another e-mail on this thread, the patch as it is > necessary in > order to fix VIMAGE related kernel panics in many different scenarios, > including > ones involving Netgraph nodes. Moreover, unconditionally setting curvnet to vnet0 in if_alloc(), if_attach() or similar places as suggested my Marius simply couldn't work, because that would break creation of pseudo-interfaces inside non-vnet0 contexts (such as vlan, ng_ether, ng_eiface etc.). Marko From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 10:27:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 6260E516; Thu, 25 Jul 2013 10:27:18 +0000 (UTC) Date: Thu, 25 Jul 2013 10:27:18 +0000 From: Alexey Dokuchaev To: Pedro Giffuni Subject: Re: svn commit: r253614 - head/usr.bin/patch Message-ID: <20130725102718.GA49714@FreeBSD.org> References: <201307241546.r6OFkok8016984@svn.freebsd.org> <20130724165243.GB3049@FreeBSD.org> <51F01981.3060603@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <51F01981.3060603@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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 10:27:18 -0000 On Wed, Jul 24, 2013 at 01:14:25PM -0500, Pedro Giffuni wrote: > El 24/07/2013 11:52 a. m., Alexey Dokuchaev escribió: > >On Wed, Jul 24, 2013 at 03:46:50PM +0000, Pedro F. Giffuni wrote: > >>New Revision: 253614 > >>URL: http://svnweb.freebsd.org/changeset/base/253614 > >> > >>Log: > >> patch: style fix > > > >It's still broken: bad use of capital letters (lack thereof), missing full > >stop (terminating dot). > > > > All the comments in that file have that same problem. At least now > we are consistently inconsistent. ;-) > >> Submitted by: gogolok > > > >$ finger gogolok@freebsd.org > >[...] > >finger: gogolok: no such user > > > >?? > > > @google ... > > I actually don't have more information about the submitter: My point was that "short" should only be used for our fellow committers. ./danfe From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 10:29:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B8FED6E8; Thu, 25 Jul 2013 10:29:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8CACB2EAF; Thu, 25 Jul 2013 10:29:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6PATf6F077985; Thu, 25 Jul 2013 10:29:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6PATfXB077980; Thu, 25 Jul 2013 10:29:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201307251029.r6PATfXB077980@svn.freebsd.org> From: Alexander Motin Date: Thu, 25 Jul 2013 10:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253647 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 10:29:41 -0000 Author: mav Date: Thu Jul 25 10:29:40 2013 New Revision: 253647 URL: http://svnweb.freebsd.org/changeset/base/253647 Log: Decode some bits defined in AHCI 1.3.1 Device Sleep Technical Proposal. For now this is only conmetics to report HBA capabilities (Haswell?). Submitted by: Dmitry Luhtionov Modified: head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci.h Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Thu Jul 25 09:30:00 2013 (r253646) +++ head/sys/dev/ahci/ahci.c Thu Jul 25 10:29:40 2013 (r253647) @@ -538,7 +538,10 @@ ahci_attach(device_t dev) (ctlr->caps & AHCI_CAP_NPMASK) + 1); } if (bootverbose && version >= 0x00010200) { - device_printf(dev, "Caps2:%s%s%s\n", + device_printf(dev, "Caps2:%s%s%s%s%s%s\n", + (ctlr->caps2 & AHCI_CAP2_DESO) ? " DESO":"", + (ctlr->caps2 & AHCI_CAP2_SADM) ? " SADM":"", + (ctlr->caps2 & AHCI_CAP2_SDS) ? " SDS":"", (ctlr->caps2 & AHCI_CAP2_APST) ? " APST":"", (ctlr->caps2 & AHCI_CAP2_NVMP) ? " NVMP":"", (ctlr->caps2 & AHCI_CAP2_BOH) ? " BOH":""); Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Thu Jul 25 09:30:00 2013 (r253646) +++ head/sys/dev/ahci/ahci.h Thu Jul 25 10:29:40 2013 (r253647) @@ -100,6 +100,7 @@ #define ATA_SS_IPM_ACTIVE 0x00000100 #define ATA_SS_IPM_PARTIAL 0x00000200 #define ATA_SS_IPM_SLUMBER 0x00000600 +#define ATA_SS_IPM_DEVSLEEP 0x00000800 #define ATA_SERROR 14 #define ATA_SE_DATA_CORRECTED 0x00000001 @@ -205,6 +206,9 @@ #define AHCI_CAP2_BOH 0x00000001 #define AHCI_CAP2_NVMP 0x00000002 #define AHCI_CAP2_APST 0x00000004 +#define AHCI_CAP2_SDS 0x00000008 +#define AHCI_CAP2_SADM 0x00000010 +#define AHCI_CAP2_DESO 0x00000020 #define AHCI_OFFSET 0x100 #define AHCI_STEP 0x80 @@ -262,6 +266,7 @@ #define AHCI_P_CMD_ACTIVE 0x10000000 #define AHCI_P_CMD_PARTIAL 0x20000000 #define AHCI_P_CMD_SLUMBER 0x60000000 +#define AHCI_P_CMD_DEVSLEEP 0x80000000 #define AHCI_P_TFD 0x20 #define AHCI_P_SIG 0x24 From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 11:44:07 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 22024CA3; Thu, 25 Jul 2013 11:44:07 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C5C69237C; Thu, 25 Jul 2013 11:44:06 +0000 (UTC) Received: from [192.168.0.2] (cpc27-cmbg15-2-0-cust235.5-4.cable.virginmedia.com [86.27.188.236]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id r6PBhsnL039111 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 25 Jul 2013 11:43:56 GMT (envelope-from theraven@FreeBSD.org) Content-Type: multipart/signed; boundary="Apple-Mail=_9FD02FE0-1BE7-4720-B810-D2F9C8BF31BE"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: svn commit: r253636 - head/sys/vm From: David Chisnall In-Reply-To: <51F0DDB0.7080102@bitfrost.no> Date: Thu, 25 Jul 2013 12:43:49 +0100 Message-Id: <73FCA347-5EB9-445F-A25C-D06CA137CBEE@FreeBSD.org> References: <201307250348.r6P3mbsG049595@svn.freebsd.org> <20130725171038.O841@besplex.bde.org> <51F0DDB0.7080102@bitfrost.no> To: Hans Petter Selasky X-Mailer: Apple Mail (2.1503) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Tim Kientzle , src-committers@FreeBSD.org, Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 11:44:07 -0000 --Apple-Mail=_9FD02FE0-1BE7-4720-B810-D2F9C8BF31BE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 On 25 Jul 2013, at 09:11, Hans Petter Selasky wrote: > The structure looks like some size, so bzero() might run faster than = memset() depending on the compiler settings. Should be profiled before = changed! They will generate identical code for small structures with known sizes. = Both clang and gcc have a simplify libcalls pass that recognises both = functions and will elide the call in preference to a small set of inline = stores. However(), memset is to be preferred in this idiom because the compiler = provides better diagnostics in the case of error: bzero.c:9:22: warning: 'memset' call operates on objects of type 'struct = foo' while the size is based on a different type 'struct foo *' [-Wsizeof-pointer-memaccess] memset(f, 0, sizeof(f)); ~ ^ bzero.c:9:22: note: did you mean to dereference the argument to 'sizeof' = (and multiply it by the number of elements)? memset(f, 0, sizeof(f)); ^ The same line with bzero(f, sizeof(f)) generates no error. David --Apple-Mail=_9FD02FE0-1BE7-4720-B810-D2F9C8BF31BE 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----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQIcBAEBAgAGBQJR8Q92AAoJEKx65DEEsqId+bEP/Rm3oxEzblD4n+MTtd3dwjvt RV5eSDHKFV5GyRMtvggrQy10NPulZDjiRLCzIivbpM9ybDOg+sxTUrRJn+2FOp9i GBuvX543BO4TTtxkpBdk69HCwe5iiAfNdO7Ls/FfDFYDJodVyPQf8GG8/pvyTNJ+ 9s3mjdoUc3Wv+nTkWY5QJQvV0Mibn5+NeO1oLDEznbhihcIVDOovTMN2iY0NfcLb aAKdTQt41PwIE3Jml67HIEgbSRIo79Eind8kDUfkK/nqx8+Yw2tbECZsDZPDkUIX dMcyoSen+GKjpq45NHfIYU3TP4vUdbIxCbopbK9gBddHYWdHOKCGqW7DTmZZXoHU odnSoCldpMy7q2nmeqIea22KX0DVNbUGPpy95WNCLf0BAE2afHiJYaKD0AEkEkx8 bpy27cBgYWidUifzbrwOxD3t9GJTFY0wkRXdg+j7JHP8mrlEGOalEflrlmj27NJ3 P+xflWSOk2nFWyg91Kw6XlsLD+pLmZeMEX2ILZbdv9f1T/EfhTgpjzQ8ug2WsFsq TCVWCLnMN8itFphngLmLwUyHaY+8k66XLfr4LLSzH+yh4CmWtOJtLz/07eJEhiV7 DBZmmeyoqf2quYdNXWrXrzBk1smpI0Lvm8/yFAeICZPkOzxGI7u9+XxpJPJ9XI2h bmB9v3wloqdzhSUKNm79 =9SVh -----END PGP SIGNATURE----- --Apple-Mail=_9FD02FE0-1BE7-4720-B810-D2F9C8BF31BE-- From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 13:09:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9E5B935E; Thu, 25 Jul 2013 13:09:18 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8BEA12835; Thu, 25 Jul 2013 13:09:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6PD9Ijw029175; Thu, 25 Jul 2013 13:09:18 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6PD9I4Z029174; Thu, 25 Jul 2013 13:09:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307251309.r6PD9I4Z029174@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 25 Jul 2013 13:09:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253649 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 13:09:18 -0000 Author: jilles Date: Thu Jul 25 13:09:17 2013 New Revision: 253649 URL: http://svnweb.freebsd.org/changeset/base/253649 Log: sh: Remove output.c's reset() handler. These cleanup operations are not needed because they are already performed after an optimized command substitution (whether there was an error or not). Modified: head/bin/sh/output.c Modified: head/bin/sh/output.c ============================================================================== --- head/bin/sh/output.c Thu Jul 25 12:43:22 2013 (r253648) +++ head/bin/sh/output.c Thu Jul 25 13:09:17 2013 (r253649) @@ -75,25 +75,6 @@ struct output memout = {NULL, 0, NULL, 0 struct output *out1 = &output; struct output *out2 = &errout; - - -#ifdef mkinit - -INCLUDE "output.h" -INCLUDE "memalloc.h" - -RESET { - out1 = &output; - out2 = &errout; - if (memout.buf != NULL) { - ckfree(memout.buf); - memout.buf = NULL; - } -} - -#endif - - void outcslow(int c, struct output *file) { From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 14:27:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 676584A0; Thu, 25 Jul 2013 14:27:47 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D4DB32BA9; Thu, 25 Jul 2013 14:27:46 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.7/8.14.7/ALCHEMY.FRANKEN.DE) with ESMTP id r6PERh5I094973; Thu, 25 Jul 2013 16:27:43 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.7/8.14.7/Submit) id r6PERhg5094972; Thu, 25 Jul 2013 16:27:43 +0200 (CEST) (envelope-from marius) Date: Thu, 25 Jul 2013 16:27:43 +0200 From: Marius Strobl To: Marko Zec Subject: Re: svn commit: r253346 - in head/sys: kern net netgraph netgraph/bluetooth/socket Message-ID: <20130725142743.GS56034@alchemy.franken.de> References: <201307150132.r6F1WttU081255@svn.freebsd.org> <20130725080758.GE948@alchemy.franken.de> <201307251224.53211.zec@fer.hr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201307251224.53211.zec@fer.hr> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Craig Rodrigues , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 14:27:47 -0000 On Thu, Jul 25, 2013 at 12:24:53PM +0200, Marko Zec wrote: > On Thursday 25 July 2013 11:36:46 Craig Rodrigues wrote: > > On Thu, Jul 25, 2013 at 1:07 AM, Marius Strobl > wrote: > > > Uhm - do we really need to have that layering violation in subr_bus.c? > > > Wouldn't it be sufficient to set curthread->td_vnet to vnet0 in > > > if_alloc(9) or if_attach(9) at least instead? > > > > There was some discussion about this involving Marko Zec, Adrian Chadd, > > and myself > > starting in this thread: > > > > http://lists.freebsd.org/pipermail/svn-src-all/2013-July/071798.html > > > > Adrian and Marko converged on similar patches: > > > > http://lists.freebsd.org/pipermail/freebsd-hackers/2012-November/041120.h > >tml > > http://people.freebsd.org/~adrian/ath/20130712-vimage-default-attach-deta > >ch.diff > > > > > > As Marko mentioned in another e-mail on this thread, the patch as it is > > necessary in > > order to fix VIMAGE related kernel panics in many different scenarios, > > including > > ones involving Netgraph nodes. > > Moreover, unconditionally setting curvnet to vnet0 in if_alloc(), > if_attach() or similar places as suggested my Marius simply couldn't work, > because that would break creation of pseudo-interfaces inside non-vnet0 > contexts (such as vlan, ng_ether, ng_eiface etc.). > Well, I didn't say that it shall be unconditional; in a previous version of the patch Adrian also set it conditionally only in case vnet isn't vnet0 in device_probe_and_attach() so it seems viable to check whether that's needed in a particular context. As for Netgraph nodes I don't know how these are attached to devices but a quick look at the code suggests that f. e. ng_make_node_common() would be a good candidate for setting vnet to vnet0 if necessary. Moving this network specific stuff out of the generic device layer would also make things consistent and symmetric given that r253346 added setting vnet to if_detach(), if_free() and ng_unref_node(). Marius From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 15:08:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 14C9CEF5; Thu, 25 Jul 2013 15:08:44 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F3E802DC5; Thu, 25 Jul 2013 15:08:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6PF8hmk068826; Thu, 25 Jul 2013 15:08:43 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6PF8fiw068808; Thu, 25 Jul 2013 15:08:41 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307251508.r6PF8fiw068808@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 25 Jul 2013 15:08:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253650 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 15:08:44 -0000 Author: jilles Date: Thu Jul 25 15:08:41 2013 New Revision: 253650 URL: http://svnweb.freebsd.org/changeset/base/253650 Log: sh: Remove mkinit. Replace the RESET blocks with regular functions and a reset() function that calls them all. This code generation tool is unusual and does not appear to provide much benefit. I do not think isolating the knowledge about which modules need to be reset is worth an almost 500-line build tool and wider scope for variables used by the reset functions. Also, relying on reset functions is often wrong: the cleanup should be done in exception handlers so that no stale state remains after 'command eval' and the like. Deleted: head/bin/sh/init.h head/bin/sh/mkinit.c Modified: head/bin/sh/Makefile head/bin/sh/TOUR head/bin/sh/eval.c head/bin/sh/eval.h head/bin/sh/exec.c head/bin/sh/input.c head/bin/sh/input.h head/bin/sh/main.c head/bin/sh/parser.c head/bin/sh/parser.h head/bin/sh/redir.c head/bin/sh/redir.h Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Thu Jul 25 13:09:17 2013 (r253649) +++ head/bin/sh/Makefile Thu Jul 25 15:08:41 2013 (r253650) @@ -8,7 +8,7 @@ SHSRCS= alias.c arith_yacc.c arith_yylex histedit.c input.c jobs.c kill.c mail.c main.c memalloc.c miscbltin.c \ mystring.c options.c output.c parser.c printf.c redir.c show.c \ test.c trap.c var.c -GENSRCS= builtins.c init.c nodes.c syntax.c +GENSRCS= builtins.c nodes.c syntax.c GENHDRS= builtins.h nodes.h syntax.h token.h SRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS} @@ -30,26 +30,21 @@ WFORMAT=0 ${.CURDIR}/../test \ ${.CURDIR}/../../usr.bin/printf -CLEANFILES+= mkinit mkinit.o mknodes mknodes.o \ +CLEANFILES+= mknodes mknodes.o \ mksyntax mksyntax.o CLEANFILES+= ${GENSRCS} ${GENHDRS} -build-tools: mkinit mknodes mksyntax +build-tools: mknodes mksyntax .ORDER: builtins.c builtins.h builtins.c builtins.h: mkbuiltins builtins.def sh ${.CURDIR}/mkbuiltins ${.CURDIR} -init.c: mkinit alias.c eval.c exec.c input.c jobs.c options.c parser.c \ - redir.c trap.c var.c - ./mkinit ${.ALLSRC:S/^mkinit$//} - # XXX this is just to stop the default .c rule being used, so that the # intermediate object has a fixed name. # XXX we have a default .c rule, but no default .o rule. .o: ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} -mkinit: mkinit.o mknodes: mknodes.o mksyntax: mksyntax.o Modified: head/bin/sh/TOUR ============================================================================== --- head/bin/sh/TOUR Thu Jul 25 13:09:17 2013 (r253649) +++ head/bin/sh/TOUR Thu Jul 25 15:08:41 2013 (r253650) @@ -25,38 +25,11 @@ programs is: program input files generates ------- ----------- --------- mkbuiltins builtins builtins.h builtins.c - mkinit *.c init.c mknodes nodetypes nodes.h nodes.c mksyntax - syntax.h syntax.c mktokens - token.h -There are undoubtedly too many of these. Mkinit searches all the -C source files for entries looking like: - - RESET { - x = 2; /* executed when the shell does a longjmp - back to the main command loop */ - } - -It pulls this code out into routines which are when particular -events occur. The intent is to improve modularity by isolating -the information about which modules need to be explicitly -initialized/reset within the modules themselves. - -Mkinit recognizes several constructs for placing declarations in -the init.c file. - INCLUDE "file.h" -includes a file. The storage class MKINIT makes a declaration -available in the init.c file, for example: - MKINIT int funcnest; /* depth of function calls */ -MKINIT alone on a line introduces a structure or union declara- -tion: - MKINIT - struct redirtab { - short renamed[10]; - }; -Preprocessor #define statements are copied to init.c without any -special action to request this. +There are undoubtedly too many of these. EXCEPTIONS: Code for dealing with exceptions appears in exceptions.c. The C language doesn't include exception handling, Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Thu Jul 25 13:09:17 2013 (r253649) +++ head/bin/sh/eval.c Thu Jul 25 15:08:41 2013 (r253650) @@ -104,16 +104,13 @@ static void prehash(union node *); * Called to reset things after an exception. */ -#ifdef mkinit -INCLUDE "eval.h" - -RESET { +void +reseteval(void) +{ evalskip = 0; loopnest = 0; funcnest = 0; } -#endif - /* Modified: head/bin/sh/eval.h ============================================================================== --- head/bin/sh/eval.h Thu Jul 25 13:09:17 2013 (r253649) +++ head/bin/sh/eval.h Thu Jul 25 15:08:41 2013 (r253650) @@ -46,6 +46,8 @@ struct backcmd { /* result of evalbackc struct job *jp; /* job structure for command */ }; +void reseteval(void); + /* flags in argument to evaltree/evalstring */ #define EV_EXIT 01 /* exit after evaluating tree */ #define EV_TESTED 02 /* exit status is checked; ignore -e flag */ Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Thu Jul 25 13:09:17 2013 (r253649) +++ head/bin/sh/exec.c Thu Jul 25 15:08:41 2013 (r253650) @@ -70,7 +70,6 @@ __FBSDID("$FreeBSD$"); #include "syntax.h" #include "memalloc.h" #include "error.h" -#include "init.h" #include "mystring.h" #include "show.h" #include "jobs.h" Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Thu Jul 25 13:09:17 2013 (r253649) +++ head/bin/sh/input.c Thu Jul 25 15:08:41 2013 (r253650) @@ -108,15 +108,12 @@ static void pushfile(void); static int preadfd(void); static void popstring(void); -#ifdef mkinit -INCLUDE "input.h" -INCLUDE "error.h" - -RESET { +void +resetinput(void) +{ popallfiles(); parselleft = parsenleft = 0; /* clear input buffer */ } -#endif /* Modified: head/bin/sh/input.h ============================================================================== --- head/bin/sh/input.h Thu Jul 25 13:09:17 2013 (r253649) +++ head/bin/sh/input.h Thu Jul 25 15:08:41 2013 (r253650) @@ -47,6 +47,7 @@ extern const char *parsenextc; /* next c struct alias; struct parsefile; +void resetinput(void); char *pfgets(char *, int); int pgetc(void); int preadbuffer(void); Modified: head/bin/sh/main.c ============================================================================== --- head/bin/sh/main.c Thu Jul 25 13:09:17 2013 (r253649) +++ head/bin/sh/main.c Thu Jul 25 15:08:41 2013 (r253650) @@ -68,10 +68,10 @@ __FBSDID("$FreeBSD$"); #include "show.h" #include "memalloc.h" #include "error.h" -#include "init.h" #include "mystring.h" #include "exec.h" #include "cd.h" +#include "redir.h" #include "builtins.h" int rootpid; @@ -79,6 +79,7 @@ int rootshell; struct jmploc main_handler; int localeisutf8, initial_localeisutf8; +static void reset(void); static void cmdloop(int); static void read_profile(const char *); static char *find_dot_file(char *); @@ -179,6 +180,14 @@ state4: return 0; } +static void +reset(void) +{ + reseteval(); + resetinput(); + resetparser(); + resetredir(); +} /* * Read and execute commands. "Top" is nonzero for the top level command Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Thu Jul 25 13:09:17 2013 (r253649) +++ head/bin/sh/parser.c Thu Jul 25 15:08:41 2013 (r253650) @@ -1819,13 +1819,13 @@ parsearith: { } /* end of readtoken */ - -#ifdef mkinit -RESET { +void +resetparser(void) +{ tokpushback = 0; checkkwd = 0; } -#endif + /* * Returns true if the text contains nothing to expand (no dollar signs Modified: head/bin/sh/parser.h ============================================================================== --- head/bin/sh/parser.h Thu Jul 25 13:09:17 2013 (r253649) +++ head/bin/sh/parser.h Thu Jul 25 15:08:41 2013 (r253650) @@ -79,6 +79,7 @@ extern const char *const parsekwd[]; union node *parsecmd(int); void fixredir(union node *, const char *, int); +void resetparser(void); int goodname(const char *); int isassignment(const char *); char *getprompt(void *); Modified: head/bin/sh/redir.c ============================================================================== --- head/bin/sh/redir.c Thu Jul 25 13:09:17 2013 (r253649) +++ head/bin/sh/redir.c Thu Jul 25 15:08:41 2013 (r253650) @@ -324,16 +324,13 @@ popredir(void) * Undo all redirections. Called on error or interrupt. */ -#ifdef mkinit - -INCLUDE "redir.h" - -RESET { +void +resetredir(void) +{ while (redirlist) popredir(); } -#endif /* Return true if fd 0 has already been redirected at least once. */ int Modified: head/bin/sh/redir.h ============================================================================== --- head/bin/sh/redir.h Thu Jul 25 13:09:17 2013 (r253649) +++ head/bin/sh/redir.h Thu Jul 25 15:08:41 2013 (r253650) @@ -40,6 +40,7 @@ union node; void redirect(union node *, int); void popredir(void); +void resetredir(void); int fd0_redirected_p(void); void clearredir(void); From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 15:10:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 25610143; Thu, 25 Jul 2013 15:10:45 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-ob0-x236.google.com (mail-ob0-x236.google.com [IPv6:2607:f8b0:4003:c01::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AD4022DED; Thu, 25 Jul 2013 15:10:44 +0000 (UTC) Received: by mail-ob0-f182.google.com with SMTP id wo10so1779442obc.13 for ; Thu, 25 Jul 2013 08:10:44 -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 :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=+dbKJ7QqQNHVav7fADAFkOBwF5R6sLxGL5wKT5PkFrI=; b=u05iKsACftIpkOny1vtQvM4xQMvmyR7K/stvQoIkSVEETX3lzl+J3S4ICizpPxDwIs cuZiJXxdnt5nmnAV+BA3eY5UINuJOWgGsM3isImp5+LeDVlhatCF+DlYF9HtVwC0hRbq ZXcbF02kL36SQds2RA33+4oWF60EV5swPcxYyFnaYC2BZ4YOT8Sw33U0zW4rHVeGKG16 yXpm0qiiLUuKE83F4SEjbdiNUv2z2GrX64WHMvJsp4s81cuLgS4DCFsvMo/itaRPgzvI kR0VHTS6Y5qdTkFsVOTeH16Cwts7lc7b7D1jzCXIAMv9Ptgkb05g2eVIT+NgRXRZ3zNe jw5w== MIME-Version: 1.0 X-Received: by 10.182.61.105 with SMTP id o9mr37024526obr.54.1374765044049; Thu, 25 Jul 2013 08:10:44 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.182.162.65 with HTTP; Thu, 25 Jul 2013 08:10:43 -0700 (PDT) In-Reply-To: <73FCA347-5EB9-445F-A25C-D06CA137CBEE@FreeBSD.org> References: <201307250348.r6P3mbsG049595@svn.freebsd.org> <20130725171038.O841@besplex.bde.org> <51F0DDB0.7080102@bitfrost.no> <73FCA347-5EB9-445F-A25C-D06CA137CBEE@FreeBSD.org> Date: Thu, 25 Jul 2013 08:10:43 -0700 X-Google-Sender-Auth: VNQyFicQOCV41CUg5qQpxd75crA Message-ID: Subject: Re: svn commit: r253636 - head/sys/vm From: mdf@FreeBSD.org To: David Chisnall Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Tim Kientzle , Bruce Evans , Hans Petter Selasky X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 15:10:45 -0000 On Thu, Jul 25, 2013 at 4:43 AM, David Chisnall wrote: > However(), memset is to be preferred in this idiom because the compiler > provides better diagnostics in the case of error: > > bzero.c:9:22: warning: 'memset' call operates on objects of type 'struct > foo' > while the size is based on a different type 'struct foo *' > [-Wsizeof-pointer-memaccess] > memset(f, 0, sizeof(f)); > ~ ^ > bzero.c:9:22: note: did you mean to dereference the argument to 'sizeof' > (and > multiply it by the number of elements)? > memset(f, 0, sizeof(f)); > ^ > > The same line with bzero(f, sizeof(f)) generates no error. > Isn't that a compiler bug? memset(p, 0, n) is the same as bzero(p, n). Why would the compiler warn on one and not the other? Does clang have a similar bias for memcpy versus bcopy? Thanks, matthew From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 15:23:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 39D25536 for ; Thu, 25 Jul 2013 15:23:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm24-vm0.bullet.mail.bf1.yahoo.com (nm24-vm0.bullet.mail.bf1.yahoo.com [98.139.213.161]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DC9182EBD for ; Thu, 25 Jul 2013 15:23:18 +0000 (UTC) Received: from [66.196.81.173] by nm24.bullet.mail.bf1.yahoo.com with NNFMP; 25 Jul 2013 15:23:10 -0000 Received: from [98.139.211.193] by tm19.bullet.mail.bf1.yahoo.com with NNFMP; 25 Jul 2013 15:23:10 -0000 Received: from [127.0.0.1] by smtp202.mail.bf1.yahoo.com with NNFMP; 25 Jul 2013 15:23:10 -0000 X-Yahoo-Newman-Id: 911770.49577.bm@smtp202.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: L3N74cQVM1meySuQIy8h_MFO5CXZDEvGliTC7NpdV9DYzXS b7dmDSrxhwBXHDMnSwH_n.Fa7LeN.fdE0piw16rkzMaY_QhflKTAhJYsHICU TKj9.7GEZWH7I93k6JY_lGftXtpZ7YpoIBZR7x38KdK0uNboFhPTasgyRKNv dKgPJZAXGh3bA0fQv7R.wx.QxbjXKJSY19ysKsrEFK2eieTHsRdb8ojH3Sms RypVdV_VRV0oeuLyjLTsbt2dwUzHZ_NVU0hfOnI8ekKAj95CNfDIkt_.FG27 jlaKg3phKhsYnsjsegMx40rbU5bQGWlWCjibkP06sYeLBtC9PcW3CPdEH3VM qbitrICvCSvItz0kK9bHLniJyTcTwN1p2_IIpCB9bSAGCNlC02vjYio8l4ax cRcNsxyqnGQpEQg7sawTymMonNygsBxeq3Ij4bEkCWiLwTZqxYjJD0qZqIi7 B_NzlorxBYbTSZbGN4TPUUdym8jczjOSBjy.IgcoxTtjDdGwLftOXVHyFWaN gejeAIJX0vjjUh_YyMHAO8oOYXQ-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with ) by smtp202.mail.bf1.yahoo.com with SMTP; 25 Jul 2013 08:23:10 -0700 PDT Message-ID: <51F142DC.1090802@FreeBSD.org> Date: Thu, 25 Jul 2013 10:23:08 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130630 Thunderbird/17.0.7 MIME-Version: 1.0 To: Alexey Dokuchaev Subject: Re: svn commit: r253614 - head/usr.bin/patch References: <201307241546.r6OFkok8016984@svn.freebsd.org> <20130724165243.GB3049@FreeBSD.org> <51F01981.3060603@FreeBSD.org> <20130725102718.GA49714@FreeBSD.org> In-Reply-To: <20130725102718.GA49714@FreeBSD.org> Content-Type: text/plain; charset=KOI8-R; 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 15:23:19 -0000 On 25.07.2013 05:27, Alexey Dokuchaev wrote: >> All the comments in that file have that same problem. At least now >> we are consistently inconsistent. > ;-) Yes, I defininitely missed a wink there :). This is not a change I feel I should spend more time on though. >>>> Submitted by: gogolok >>> $ finger gogolok@freebsd.org >>> [...] >>> finger: gogolok: no such user >>> >>> ?? >>> >> @google ... >> >> I actually don't have more information about the submitter: > My point was that "short" should only be used for our fellow committers. Ugh ... point taken. The problem with unwritten rules is that someone can always abuse them in the name of lazyness. I will be more careful next time. Pedro. From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 15:34:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 445EFCDA; Thu, 25 Jul 2013 15:34:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 220772F85; Thu, 25 Jul 2013 15:34:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6PFYLXA078106; Thu, 25 Jul 2013 15:34:21 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6PFYKK3078105; Thu, 25 Jul 2013 15:34:20 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307251534.r6PFYKK3078105@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 25 Jul 2013 15:34:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253651 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 15:34:21 -0000 Author: pfg Date: Thu Jul 25 15:34:20 2013 New Revision: 253651 URL: http://svnweb.freebsd.org/changeset/base/253651 Log: ext2fs: Don't assume that on-disk format of a directory is the same as in ext2_readdir() has always been very fs specific and different with respect to its ufs_ counterpart. Recent changes from UFS have made it possible to share more closely the implementation. MFUFS r252438: Always start parsing at DIRBLKSIZ aligned offset, skip first entries if uio_offset is not DIRBLKSIZ aligned. Return EINVAL if buffer is too small for single entry. Preallocate buffer for cookies. Skip entries with zero inode number. Reviewed by: gleb, Zheng Liu MFC after: 1 month Modified: head/sys/fs/ext2fs/ext2_lookup.c Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Thu Jul 25 15:08:41 2013 (r253650) +++ head/sys/fs/ext2fs/ext2_lookup.c Thu Jul 25 15:34:20 2013 (r253651) @@ -128,33 +128,40 @@ ext2_is_dot_entry(struct componentname * /* * Vnode op for reading directories. - * - * This function has to convert directory entries from the on-disk - * format to the format defined by . Unfortunately, the - * conversion will blow up some entries by four bytes, so it can't be - * done in place. Instead, the conversion is done entry by entry and - * the converted entry is sent via uiomove. - * - * XXX allocate a buffer, convert as many entries as possible, then send - * the whole buffer to uiomove */ int ext2_readdir(struct vop_readdir_args *ap) { + struct vnode *vp = ap->a_vp; struct uio *uio = ap->a_uio; - int count, error; - - struct ext2fs_direct_2 *edp, *dp; - int ncookies; + struct buf *bp; + struct inode *ip; + struct ext2fs_direct_2 *dp, *edp; + u_long *cookies; struct dirent dstdp; - struct uio auio; - struct iovec aiov; - caddr_t dirbuf; + off_t offset, startoffset; + size_t readcnt, skipcnt; + ssize_t startresid; + int ncookies; int DIRBLKSIZ = VTOI(ap->a_vp)->i_e2fs->e2fs_bsize; - int readcnt; - off_t startoffset = uio->uio_offset; + int error; - count = uio->uio_resid; + ip = VTOI(vp); + if (ap->a_ncookies != NULL) { + ncookies = uio->uio_resid; + if (uio->uio_offset >= ip->i_size) + ncookies = 0; + else if (ip->i_size - uio->uio_offset < ncookies) + ncookies = ip->i_size - uio->uio_offset; + ncookies = ncookies / (offsetof(struct ext2fs_direct_2, + e2d_namlen) + 4) + 1; + cookies = malloc(ncookies * sizeof(*cookies), M_TEMP, M_WAITOK); + *ap->a_ncookies = ncookies; + *ap->a_cookies = cookies; + } else { + ncookies = 0; + cookies = NULL; + } /* * Avoid complications for partial directory entries by adjusting * the i/o to end at a block boundary. Don't give up (like ufs @@ -163,25 +170,33 @@ ext2_readdir(struct vop_readdir_args *ap * size is a little larger than DIRBLKSIZ to allow for expansion * of directory entries, but some callers just use 512. */ - count -= (uio->uio_offset + count) & (DIRBLKSIZ -1); - if (count <= 0) - count += DIRBLKSIZ; - auio = *uio; - auio.uio_iov = &aiov; - auio.uio_iovcnt = 1; - auio.uio_resid = count; - auio.uio_segflg = UIO_SYSSPACE; - aiov.iov_len = count; - dirbuf = malloc(count, M_TEMP, M_WAITOK); - aiov.iov_base = dirbuf; - error = VOP_READ(ap->a_vp, &auio, 0, ap->a_cred); - if (error == 0) { - readcnt = count - auio.uio_resid; - edp = (struct ext2fs_direct_2 *)&dirbuf[readcnt]; - ncookies = 0; - bzero(&dstdp, offsetof(struct dirent, d_name)); - for (dp = (struct ext2fs_direct_2 *)dirbuf; - !error && uio->uio_resid > 0 && dp < edp; ) { + if (uio->uio_offset < 0) + offset = startoffset = uio->uio_offset + DIRBLKSIZ; + else + offset = startoffset = uio->uio_offset; + startresid = uio->uio_resid; + error = 0; + while (error == 0 && uio->uio_resid > 0 && + uio->uio_offset < ip->i_size) { + error = ext2_blkatoff(vp, uio->uio_offset, NULL, &bp); + if (error) + break; + if (bp->b_offset + bp->b_bcount > ip->i_size) + readcnt = ip->i_size - bp->b_offset; + else + readcnt = bp->b_bcount; + skipcnt = (size_t)(uio->uio_offset - bp->b_offset) & + ~(size_t)(DIRBLKSIZ - 1); + offset = bp->b_offset + skipcnt; + dp = (struct ext2fs_direct_2 *)&bp->b_data[skipcnt]; + edp = (struct ext2fs_direct_2 *)&bp->b_data[readcnt]; + while (error == 0 && uio->uio_resid > 0 && dp < edp) { + if (dp->e2d_reclen <= offsetof(struct ext2fs_direct_2, + e2d_namlen) || (caddr_t)dp + dp->e2d_reclen > + (caddr_t)edp) { + error = EIO; + break; + } /*- * "New" ext2fs directory entries differ in 3 ways * from ufs on-disk ones: @@ -198,57 +213,60 @@ ext2_readdir(struct vop_readdir_args *ap * because ext2fs uses a machine-independent disk * layout. */ - dstdp.d_fileno = dp->e2d_ino; - dstdp.d_type = FTTODT(dp->e2d_type); dstdp.d_namlen = dp->e2d_namlen; + dstdp.d_type = FTTODT(dp->e2d_type); + if (offsetof(struct ext2fs_direct_2, e2d_namlen) + + dstdp.d_namlen > dp->e2d_reclen) { + error = EIO; + break; + } + if (offset < startoffset || dp->e2d_ino == 0) + goto nextentry; + dstdp.d_fileno = dp->e2d_ino; dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp); bcopy(dp->e2d_name, dstdp.d_name, dstdp.d_namlen); - bzero(dstdp.d_name + dstdp.d_namlen, - dstdp.d_reclen - offsetof(struct dirent, d_name) - - dstdp.d_namlen); - - if (dp->e2d_reclen > 0) { - if(dstdp.d_reclen <= uio->uio_resid) { - /* advance dp */ - dp = (struct ext2fs_direct_2 *) - ((char *)dp + dp->e2d_reclen); - error = - uiomove(&dstdp, dstdp.d_reclen, uio); - if (!error) - ncookies++; - } else - break; - } else { - error = EIO; + dstdp.d_name[dstdp.d_namlen] = '\0'; + if (dstdp.d_reclen > uio->uio_resid) { + if (uio->uio_resid == startresid) + error = EINVAL; + else + error = EJUSTRETURN; break; } - } - /* we need to correct uio_offset */ - uio->uio_offset = startoffset + (caddr_t)dp - dirbuf; - - if (!error && ap->a_ncookies != NULL) { - u_long *cookiep, *cookies, *ecookies; - off_t off; - - if (uio->uio_segflg != UIO_SYSSPACE || uio->uio_iovcnt != 1) - panic("ext2_readdir: unexpected uio from NFS server"); - cookies = malloc(ncookies * sizeof(u_long), M_TEMP, - M_WAITOK); - off = startoffset; - for (dp = (struct ext2fs_direct_2 *)dirbuf, - cookiep = cookies, ecookies = cookies + ncookies; - cookiep < ecookies; - dp = (struct ext2fs_direct_2 *)((caddr_t) dp + dp->e2d_reclen)) { - off += dp->e2d_reclen; - *cookiep++ = (u_long) off; + /* Advance dp. */ + error = uiomove((caddr_t)&dstdp, dstdp.d_reclen, uio); + if (error) + break; + if (cookies != NULL) { + KASSERT(ncookies > 0, + ("ext2_readdir: cookies buffer too small")); + *cookies = offset + dp->e2d_reclen; + cookies++; + ncookies--; } - *ap->a_ncookies = ncookies; - *ap->a_cookies = cookies; +nextentry: + offset += dp->e2d_reclen; + dp = (struct ext2fs_direct_2 *)((caddr_t)dp + + dp->e2d_reclen); + } + bqrelse(bp); + uio->uio_offset = offset; + } + /* We need to correct uio_offset. */ + uio->uio_offset = offset; + if (error == EJUSTRETURN) + error = 0; + if (ap->a_ncookies != NULL) { + if (error == 0) { + ap->a_ncookies -= ncookies; + } else { + free(*ap->a_cookies, M_TEMP); + *ap->a_ncookies = 0; + *ap->a_cookies = NULL; } } - free(dirbuf, M_TEMP); - if (ap->a_eofflag) - *ap->a_eofflag = VTOI(ap->a_vp)->i_size <= uio->uio_offset; + if (error == 0 && ap->a_eofflag) + *ap->a_eofflag = ip->i_size <= uio->uio_offset; return (error); } From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 15:54:46 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8DBC453B; Thu, 25 Jul 2013 15:54:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 4ECF820A9; Thu, 25 Jul 2013 15:54:46 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id EB033104208F; Fri, 26 Jul 2013 01:54:34 +1000 (EST) Date: Fri, 26 Jul 2013 01:54:33 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marko Zec Subject: Re: svn commit: r253346 - in head/sys: kern net netgraph netgraph/bluetooth/socket In-Reply-To: <201307251048.33475.zec@fer.hr> Message-ID: <20130726015202.O2570@besplex.bde.org> References: <201307150132.r6F1WttU081255@svn.freebsd.org> <20130725080758.GE948@alchemy.franken.de> <201307251048.33475.zec@fer.hr> 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=YYGEuWhf c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=O1joYcyITo4A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=tFGGZ4DTOH8A:10 a=6I5d2MoRAAAA:8 a=3jECLxWCSvKPP1vQ-c4A:9 a=CjuIK1q_8ugA:10 Cc: Craig Rodrigues , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Marius Strobl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 15:54:46 -0000 On Thu, 25 Jul 2013, Marko Zec wrote: > On Thursday 25 July 2013 10:07:58 Marius Strobl wrote: >> On Mon, Jul 15, 2013 at 01:32:55AM +0000, Craig Rodrigues wrote: >>> Author: rodrigc >>> Date: Mon Jul 15 01:32:55 2013 >>> New Revision: 253346 >>> URL: http://svnweb.freebsd.org/changeset/base/253346 >>> >>> Log: >>> PR: 168520 170096 >>> Submitted by: adrian, zec >>> >>> Fix multiple kernel panics when VIMAGE is enabled in the kernel. >>> These fixes are based on patches submitted by Adrian Chadd and Marko >>> Zec. >>> >>> (1) Set curthread->td_vnet to vnet0 in device_probe_and_attach() >>> just before calling device_attach(). This fixes multiple VIMAGE >>> related kernel panics when trying to attach Bluetooth or USB Ethernet >>> devices because curthread->td_vnet is NULL. >>> >>> (2) Set curthread->td_vnet in if_detach(). This fixes kernel panics >>> when detaching networking interfaces, especially USB Ethernet devices. >>> >>> (3) Use VNET_DOMAIN_SET() in ng_btsocket.c >>> >>> (4) In ng_unref_node() set curthread->td_vnet. This fixes kernel >>> panics when detaching Netgraph nodes. >>> >>> Modified: >>> head/sys/kern/subr_bus.c >>> head/sys/net/if.c >>> head/sys/netgraph/bluetooth/socket/ng_btsocket.c >>> head/sys/netgraph/ng_base.c >>> >>> Modified: head/sys/kern/subr_bus.c >>> ======================================================================= >>> ======= --- head/sys/kern/subr_bus.c Mon Jul 15 00:49:10 2013 (r253345) >>> +++ head/sys/kern/subr_bus.c Mon Jul 15 01:32:55 2013 (r253346) @@ >>> -53,6 +53,8 @@ __FBSDID("$FreeBSD$"); >>> #include >>> #include >>> >>> +#include >>> + >>> #include >>> >>> #include >>> @@ -2735,7 +2737,11 @@ device_probe_and_attach(device_t dev) >>> return (0); >>> else if (error != 0) >>> return (error); >>> - return (device_attach(dev)); >>> + >>> + CURVNET_SET_QUIET(vnet0); >>> + error = device_attach(dev); >>> + CURVNET_RESTORE(); >>> + return error; >>> } >> >> Uhm - do we really need to have that layering violation in subr_bus.c? >> Wouldn't it be sufficient to set curthread->td_vnet to vnet0 in >> if_alloc(9) or if_attach(9) at least instead? > > That wouldn't solve the issues with attaching netgraph node(s) to the > arriving device, nor potentially other issues unrelated to if_alloc or > if_attach. This patch also has some style bugs (change from silly parentheses around the return value to none. 2 returns in unchanged code visible in the patch still use normal style). Bruce From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 16:04:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9FBF6775; Thu, 25 Jul 2013 16:04:00 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com [IPv6:2a00:1450:400c:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B3C4A210F; Thu, 25 Jul 2013 16:03:59 +0000 (UTC) Received: by mail-wg0-f44.google.com with SMTP id l18so1829885wgh.23 for ; Thu, 25 Jul 2013 09:03: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 :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=xl5MevXcfR2y19Npd71mwra4nuS0GZjdeN5LTLjWhJ8=; b=P3c44EZe1hreXjfmh4o0axLsQhP08Eej6dd6VDd8mqBnYe2t3ILZM0TjK5mBTXGuBl e5vNkhor6kvrawcCk+PngXAtmZ8mFml2eR3ZnRWAAYBaZ+vRM7bgOnQX7r/1DSJE4HF3 ypGCJ7X5go5rw2+0VT48berytqDBfLRd70U0aHXETZhjlvpbQZjcxD4JZmQ+ofiYclAm 0dkBg0nhod4oMVisYcEPOfs5Vp7ZqmzimqhNeopLngSglW/2hXU95EE8Cw972IGnDkx0 6Dz68UrDefTPC6E8VUH4IVIaO1fz3AjsgfanTNcA/J29QmJHmlA7YQB6CE0lZfX5S/hZ h/lg== MIME-Version: 1.0 X-Received: by 10.180.20.116 with SMTP id m20mr2597032wie.46.1374768237997; Thu, 25 Jul 2013 09:03:57 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Thu, 25 Jul 2013 09:03:57 -0700 (PDT) In-Reply-To: <20130725080758.GE948@alchemy.franken.de> References: <201307150132.r6F1WttU081255@svn.freebsd.org> <20130725080758.GE948@alchemy.franken.de> Date: Thu, 25 Jul 2013 09:03:57 -0700 X-Google-Sender-Auth: u_Rikah0RN2eyHssl9pegYCiftY Message-ID: Subject: Re: svn commit: r253346 - in head/sys: kern net netgraph netgraph/bluetooth/socket From: Adrian Chadd To: Marius Strobl Content-Type: text/plain; charset=ISO-8859-1 Cc: Craig Rodrigues , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 16:04:00 -0000 There's already a layering violation. It's called "giving a default vnet context during initial system bring up rather than properly figuring out where to sneak it in." That's the root cause that hid all of this crap. -adrian From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 16:04:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6507F8B4; Thu, 25 Jul 2013 16:04:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3CB7C2116; Thu, 25 Jul 2013 16:04:38 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 55B77B953; Thu, 25 Jul 2013 12:04:36 -0400 (EDT) From: John Baldwin To: "David E. O'Brien" Subject: Re: svn commit: r253618 - head/sys/dev/usb/gadget Date: Wed, 24 Jul 2013 15:29:34 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201307241832.r6OIWFGc074918@svn.freebsd.org> In-Reply-To: <201307241832.r6OIWFGc074918@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201307241529.35175.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 25 Jul 2013 12:04:37 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 16:04:38 -0000 On Wednesday, July 24, 2013 2:32:15 pm David E. O'Brien wrote: > Author: obrien > Date: Wed Jul 24 18:32:15 2013 > New Revision: 253618 > URL: http://svnweb.freebsd.org/changeset/base/253618 > > Log: > per style(9): > Kernel include files (i.e. sys/*.h) come first; normally, include > OR , but not both. includes > , and it is okay to depend on that. This is not fully correct. The consistent style throughout the tree when using _FBSDID() is: #include __FBSDID() #include ... Please fix these to match that. It might not be a bad idea to document the __FBSDID() practice in style.9 while you are at it. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 16:04:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 77A93A9C; Thu, 25 Jul 2013 16:04:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 658A02120; Thu, 25 Jul 2013 16:04:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6PG4upF087727; Thu, 25 Jul 2013 16:04:56 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6PG4uFJ087726; Thu, 25 Jul 2013 16:04:56 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307251604.r6PG4uFJ087726@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 25 Jul 2013 16:04:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253652 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 16:04:56 -0000 Author: pfg Date: Thu Jul 25 16:04:55 2013 New Revision: 253652 URL: http://svnweb.freebsd.org/changeset/base/253652 Log: ext2fs: Drop a check that wan't supposed to be in r253651. MFC after: 1 month Modified: head/sys/fs/ext2fs/ext2_lookup.c Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Thu Jul 25 15:34:20 2013 (r253651) +++ head/sys/fs/ext2fs/ext2_lookup.c Thu Jul 25 16:04:55 2013 (r253652) @@ -170,10 +170,7 @@ ext2_readdir(struct vop_readdir_args *ap * size is a little larger than DIRBLKSIZ to allow for expansion * of directory entries, but some callers just use 512. */ - if (uio->uio_offset < 0) - offset = startoffset = uio->uio_offset + DIRBLKSIZ; - else - offset = startoffset = uio->uio_offset; + offset = startoffset = uio->uio_offset; startresid = uio->uio_resid; error = 0; while (error == 0 && uio->uio_resid > 0 && From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 16:34:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E03DC2B7; Thu, 25 Jul 2013 16:34:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CD7FF22C3; Thu, 25 Jul 2013 16:34:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6PGYYW9097084; Thu, 25 Jul 2013 16:34:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6PGYYJE097083; Thu, 25 Jul 2013 16:34:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201307251634.r6PGYYJE097083@svn.freebsd.org> From: John Baldwin Date: Thu, 25 Jul 2013 16:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253653 - head/sys/ofed/drivers/net/mlx4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 16:34:35 -0000 Author: jhb Date: Thu Jul 25 16:34:34 2013 New Revision: 253653 URL: http://svnweb.freebsd.org/changeset/base/253653 Log: Avoid trashing IP fragments: - Only enable UDP/TCP hardware checksums if CSUM_UDP or CSUM_TCP is set. - Only enable IP hardware checksums if CSUM_IP is set. PR: kern/180430 Submitted by: Meny Yossefi MFC after: 1 week Modified: head/sys/ofed/drivers/net/mlx4/en_tx.c Modified: head/sys/ofed/drivers/net/mlx4/en_tx.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_tx.c Thu Jul 25 16:04:55 2013 (r253652) +++ head/sys/ofed/drivers/net/mlx4/en_tx.c Thu Jul 25 16:34:34 2013 (r253653) @@ -780,8 +780,12 @@ retry: tx_desc->ctrl.srcrb_flags = cpu_to_be32(MLX4_WQE_CTRL_CQ_UPDATE | MLX4_WQE_CTRL_SOLICITED); if (mb->m_pkthdr.csum_flags & (CSUM_IP|CSUM_TCP|CSUM_UDP)) { - tx_desc->ctrl.srcrb_flags |= cpu_to_be32(MLX4_WQE_CTRL_IP_CSUM | - MLX4_WQE_CTRL_TCP_UDP_CSUM); + if (mb->m_pkthdr.csum_flags & CSUM_IP) + tx_desc->ctrl.srcrb_flags |= + cpu_to_be32(MLX4_WQE_CTRL_IP_CSUM); + if (mb->m_pkthdr.csum_flags & (CSUM_TCP|CSUM_UDP)) + tx_desc->ctrl.srcrb_flags |= + cpu_to_be32(MLX4_WQE_CTRL_TCP_UDP_CSUM); priv->port_stats.tx_chksum_offload++; } From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 16:35:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A38DA495; Thu, 25 Jul 2013 16:35:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7100722DB; Thu, 25 Jul 2013 16:35:22 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3EF3EB926; Thu, 25 Jul 2013 12:35:21 -0400 (EDT) From: John Baldwin To: Alexander Motin Subject: Re: svn commit: r253644 - head/sys/dev/ata/chipsets Date: Thu, 25 Jul 2013 12:14:28 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201307250912.r6P9CkVE054015@svn.freebsd.org> In-Reply-To: <201307250912.r6P9CkVE054015@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201307251214.29191.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 25 Jul 2013 12:35:21 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 16:35:22 -0000 On Thursday, July 25, 2013 5:12:46 am Alexander Motin wrote: > Author: mav > Date: Thu Jul 25 09:12:46 2013 > New Revision: 253644 > URL: http://svnweb.freebsd.org/changeset/base/253644 > > Log: > Add missing NULL check after malloc(M_NOWAIT). > > Submitted by: Dmitry Luhtionov > > Modified: > head/sys/dev/ata/chipsets/ata-promise.c > > Modified: head/sys/dev/ata/chipsets/ata-promise.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-promise.c Thu Jul 25 08:41:22 2013 (r253643) > +++ head/sys/dev/ata/chipsets/ata-promise.c Thu Jul 25 09:12:46 2013 (r253644) > @@ -287,6 +287,10 @@ ata_promise_chipinit(device_t dev) > /* setup host packet controls */ > hpkt = malloc(sizeof(struct ata_promise_sx4), > M_ATAPCI, M_NOWAIT | M_ZERO); > + if (hpkt == NULL) { > + device_printf(dev, "Cannot allocate HPKT\n"); > + goto failnfree; > + } > mtx_init(&hpkt->mtx, "ATA promise HPKT lock", NULL, MTX_DEF); > TAILQ_INIT(&hpkt->queue); > hpkt->busy = 0; Why not use M_WAITOK here? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 16:37:29 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 99D0F63B; Thu, 25 Jul 2013 16:37:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 28B972305; Thu, 25 Jul 2013 16:37:27 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id EB777D41E74; Fri, 26 Jul 2013 02:37:15 +1000 (EST) Date: Fri, 26 Jul 2013 02:37:14 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: David Chisnall Subject: Re: svn commit: r253636 - head/sys/vm In-Reply-To: <73FCA347-5EB9-445F-A25C-D06CA137CBEE@FreeBSD.org> Message-ID: <20130726021053.O2628@besplex.bde.org> References: <201307250348.r6P3mbsG049595@svn.freebsd.org> <20130725171038.O841@besplex.bde.org> <51F0DDB0.7080102@bitfrost.no> <73FCA347-5EB9-445F-A25C-D06CA137CBEE@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=YYGEuWhf c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=B9HLQOAVcRIA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=AptvzqaXglMA:10 a=RLjKCVHinBivolnNwb0A:9 a=CjuIK1q_8ugA:10 Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, Tim Kientzle , Bruce Evans , Hans Petter Selasky X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 16:37:29 -0000 On Thu, 25 Jul 2013, David Chisnall wrote: > On 25 Jul 2013, at 09:11, Hans Petter Selasky wrote: > >> The structure looks like some size, so bzero() might run faster than memset() depending on the compiler settings. Should be profiled before changed! > > They will generate identical code for small structures with known sizes. Both clang and gcc have a simplify libcalls pass that recognises both functions and will elide the call in preference to a small set of inline stores. In the kernel, compilers are prevented from inlining memset() and many other things by -ffreestanding in CFLAGS. This rarely matters, and no one except me cares. In my version, memset() doesn't exist, but bzero() has the micro-optimization of turning itself into __builtin_memset() if the size is small (<= 32). My memcpy() has the micro-optimization of turning itself into __builtin_memcpy() unconditionally. __builtin_memcpy() then turns itself back into extern memcpy() according to the inverse of a similar size check. I think extern memcmp() still doesn't exist in the FreeBSD kernel, so simply using __builtin_memset() would give linkage errors when __builtin_memcmp() turns itself back into memcmp(). Determining whether the size is "small" is difficult. It is very CPU-dependent, and also depends on how efficient the extern function is. Compilers once used a very large limits for inlining, but changed to fairly small limits when they realized that they didn't understand memory. Extern functions are hard to optimize, since the correct optimization depends on the CPU including its cache organization. FreeBSD's x86 bcopy() and bzero() are still optimized for generic CPUs. Generic means approximately the original i386, but since these are important operations, all CPUs run the old i386 code for them not to badly (perhaps only twice as slow as possible), with newer Intel systems doing it better than most. Use of memcpy() in the kernel is the result of previous micro-optimizations. It was supposed to be used only for small fixed-size copies. This could have been done better by making bcopy() inline and calling __builtin_memcpy() in this case. The extern memcpy() should never have been used, but was needed for cases where __builtin_memcpy() turns itself into memcpy(), which happened mainly when compiling with -O0. Other uses of memcpy() were style bugs. No one cared when this optimization was turned into a style bug in all cases by -ffreestanding. > However(), memset is to be preferred in this idiom because the compiler provides better diagnostics in the case of error: > > bzero.c:9:22: warning: 'memset' call operates on objects of type 'struct foo' > while the size is based on a different type 'struct foo *' > [-Wsizeof-pointer-memaccess] > memset(f, 0, sizeof(f)); > ~ ^ > bzero.c:9:22: note: did you mean to dereference the argument to 'sizeof' (and > multiply it by the number of elements)? > memset(f, 0, sizeof(f)); > ^ > > The same line with bzero(f, sizeof(f)) generates no error. This is compiler bug with -ffreestanding. Then memset() is not special. clang allows me to declare my own memset but still prints this warning if the API is not too different: no warning for "void memset(int *, int)", but warning for "int memset(int *, int, int)". The warning seems to be based on the function name, since it is not claimed that the function is standard (even without -ffreestanding). While testing this, I mistyped an &f as &foo, where &foo is a function name. clang doesn't warn about this. clang warned when memset was my home made "int memset(int *, int, int)", because the function pointer isn't compatible with int *. But it also isn't compatible with void *. I think casting NULL to a function pointer must work even if NULL is spelled with a void *, but that is the only case where a void * object pointer can safely be converted to a function pointer. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 16:41:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9E2C18C7; Thu, 25 Jul 2013 16:41:29 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-ea0-x22a.google.com (mail-ea0-x22a.google.com [IPv6:2a00:1450:4013:c01::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AD0232341; Thu, 25 Jul 2013 16:41:28 +0000 (UTC) Received: by mail-ea0-f170.google.com with SMTP id h10so1049552eaj.15 for ; Thu, 25 Jul 2013 09:41:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=fOIy7EnaKbrpvS8VZdKkmZ/KR4UTQSQeJz49iNh9cTM=; b=eObikhMMrCVsl6XicdMdOYDHASK3AjbKk9EmUzcDj+CSf99qTVK41CTh5jSeS4orX+ Ipkn10zuBqM4XGHuryBLyhnHR9xW4aVf8Qhv/OLmVENCglpCmeT8w1QCyqtw/PLzvmkH gPK6r6kzI/qbPBdKvLPxoLPfWUX7TeLcO+7ybPjC5d42vW50DHVP71LIwND/CwxcnJlL b7Xywd/3VFmL62G7dg8Qp269US7TS46Pww1CfLxBw2hhSgrhbq5RH/WKvP6nWHjGBU5M lixmdB5/wi+k+1jTVJqzP3h1o7Wgc23z6HhIoNw5xgO+kXo/O4KaJP++e9VpmTJ/fniN o3dg== X-Received: by 10.14.218.8 with SMTP id j8mr43440948eep.129.1374770486861; Thu, 25 Jul 2013 09:41:26 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (mavhome.mavhome.dp.ua. [213.227.240.37]) by mx.google.com with ESMTPSA id i2sm74841893eeu.4.2013.07.25.09.41.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 09:41:25 -0700 (PDT) Sender: Alexander Motin Message-ID: <51F15532.2060100@FreeBSD.org> Date: Thu, 25 Jul 2013 19:41:22 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130616 Thunderbird/17.0.6 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r253644 - head/sys/dev/ata/chipsets References: <201307250912.r6P9CkVE054015@svn.freebsd.org> <201307251214.29191.jhb@freebsd.org> In-Reply-To: <201307251214.29191.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 16:41:29 -0000 On 25.07.2013 19:14, John Baldwin wrote: > On Thursday, July 25, 2013 5:12:46 am Alexander Motin wrote: >> Author: mav >> Date: Thu Jul 25 09:12:46 2013 >> New Revision: 253644 >> URL: http://svnweb.freebsd.org/changeset/base/253644 >> >> Log: >> Add missing NULL check after malloc(M_NOWAIT). >> >> Submitted by: Dmitry Luhtionov >> >> Modified: >> head/sys/dev/ata/chipsets/ata-promise.c >> >> Modified: head/sys/dev/ata/chipsets/ata-promise.c >> ============================================================================== >> --- head/sys/dev/ata/chipsets/ata-promise.c Thu Jul 25 08:41:22 2013 (r253643) >> +++ head/sys/dev/ata/chipsets/ata-promise.c Thu Jul 25 09:12:46 2013 (r253644) >> @@ -287,6 +287,10 @@ ata_promise_chipinit(device_t dev) >> /* setup host packet controls */ >> hpkt = malloc(sizeof(struct ata_promise_sx4), >> M_ATAPCI, M_NOWAIT | M_ZERO); >> + if (hpkt == NULL) { >> + device_printf(dev, "Cannot allocate HPKT\n"); >> + goto failnfree; >> + } >> mtx_init(&hpkt->mtx, "ATA promise HPKT lock", NULL, MTX_DEF); >> TAILQ_INIT(&hpkt->queue); >> hpkt->busy = 0; > > Why not use M_WAITOK here? I have no strong opinion. I was going to do it first because only Giant is held at that point. But looking on different device_XXX() internals and other code I've found that they prefer to use M_NOWAIT in alike places. While Giant allows sleeping, it is dropped during sleep, that I guess is not really safe. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 16:42:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 57FC9A2B; Thu, 25 Jul 2013 16:42:54 +0000 (UTC) (envelope-from zec@fer.hr) Received: from mail.fer.hr (mail.fer.hr [161.53.72.233]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AEB6D235F; Thu, 25 Jul 2013 16:42:53 +0000 (UTC) Received: from x23.lan (89.164.242.107) by MAIL.fer.hr (161.53.72.233) with Microsoft SMTP Server (TLS) id 14.2.342.3; Thu, 25 Jul 2013 18:42:50 +0200 From: Marko Zec To: Marius Strobl Subject: Re: svn commit: r253346 - in head/sys: kern net netgraph netgraph/bluetooth/socket Date: Thu, 25 Jul 2013 18:42:53 +0200 User-Agent: KMail/1.9.10 References: <201307150132.r6F1WttU081255@svn.freebsd.org> <201307251224.53211.zec@fer.hr> <20130725142743.GS56034@alchemy.franken.de> In-Reply-To: <20130725142743.GS56034@alchemy.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <201307251842.53577.zec@fer.hr> X-Originating-IP: [89.164.242.107] Cc: Craig Rodrigues , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 16:42:54 -0000 On Thursday 25 July 2013 16:27:43 Marius Strobl wrote: > On Thu, Jul 25, 2013 at 12:24:53PM +0200, Marko Zec wrote: > > On Thursday 25 July 2013 11:36:46 Craig Rodrigues wrote: > > > On Thu, Jul 25, 2013 at 1:07 AM, Marius Strobl > > > > wrote: > > > > Uhm - do we really need to have that layering violation in > > > > subr_bus.c? Wouldn't it be sufficient to set curthread->td_vnet to > > > > vnet0 in if_alloc(9) or if_attach(9) at least instead? > > > > > > There was some discussion about this involving Marko Zec, Adrian > > > Chadd, and myself > > > starting in this thread: > > > > > > http://lists.freebsd.org/pipermail/svn-src-all/2013-July/071798.html > > > > > > Adrian and Marko converged on similar patches: > > > > > > http://lists.freebsd.org/pipermail/freebsd-hackers/2012-November/0411 > > >20.h tml > > > http://people.freebsd.org/~adrian/ath/20130712-vimage-default-attach- > > >deta ch.diff > > > > > > > > > As Marko mentioned in another e-mail on this thread, the patch as it > > > is necessary in > > > order to fix VIMAGE related kernel panics in many different > > > scenarios, including > > > ones involving Netgraph nodes. > > > > Moreover, unconditionally setting curvnet to vnet0 in if_alloc(), > > if_attach() or similar places as suggested my Marius simply couldn't > > work, because that would break creation of pseudo-interfaces inside > > non-vnet0 contexts (such as vlan, ng_ether, ng_eiface etc.). > > Well, I didn't say that it shall be unconditional; in a previous > version of the patch Adrian also set it conditionally only in case > vnet isn't vnet0 in device_probe_and_attach() so it seems viable to > check whether that's needed in a particular context. When a function which is expected to be called with curvnet properly set is called with curvnet being NULL, it should panic (or crash), not guess which vnet the caller should have set, but failed to do. Otherwise, we would have tons of subtle inter-vnet leaks (towards vnet0) which could be very difficult to track and nail down. Hell, why not set curvnet to vnet0 at boot time and NEVER revert it back to NULL, while only occasionally switching to non-default vnets - how would we swim in that kind of mud? > As for Netgraph nodes I don't know how these are attached to devices > but a quick look at the code suggests that f. e. ng_make_node_common() > would be a good candidate for setting vnet to vnet0 if necessary. > Moving this network specific stuff out of the generic device layer > would also make things consistent and symmetric given that r253346 > added setting vnet to if_detach(), if_free() and ng_unref_node(). In all the functions you're refering to here, vnet context is unambiguously defined by the object passed as function's argument, so it is perfectly safe to do CURVNET_SET(ifp->if_vnet) or CURVNET_SET(ng_node->nd_vnet), which is very different from the proposal for pure guessing in if_attach() etc. which I am strongly opposed to. Marko From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 16:57:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3FB84DB9; Thu, 25 Jul 2013 16:57:28 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2C77A2417; Thu, 25 Jul 2013 16:57:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6PGvSe9003654; Thu, 25 Jul 2013 16:57:28 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6PGvSWq003653; Thu, 25 Jul 2013 16:57:28 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201307251657.r6PGvSWq003653@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 25 Jul 2013 16:57:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253654 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 16:57:28 -0000 Author: marcel Date: Thu Jul 25 16:57:27 2013 New Revision: 253654 URL: http://svnweb.freebsd.org/changeset/base/253654 Log: Set the device description after we call uart_probe(). In uart_probe() we call device-specific probe functions, which can (and typically will) set the device description based on low-level device probe information. In the end we never actually used the device description that we so carefully maintained in the PCI match table. By setting the device description after we call uart_probe(), we'll print the more user- friendly description by default. Modified: head/sys/dev/uart/uart_bus_pci.c Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Thu Jul 25 16:34:34 2013 (r253653) +++ head/sys/dev/uart/uart_bus_pci.c Thu Jul 25 16:57:27 2013 (r253654) @@ -162,6 +162,7 @@ uart_pci_probe(device_t dev) { struct uart_softc *sc; const struct pci_id *id; + int result; sc = device_get_softc(dev); @@ -174,9 +175,14 @@ uart_pci_probe(device_t dev) return (ENXIO); match: + result = uart_bus_probe(dev, 0, id->rclk, id->rid, 0); + /* Bail out on error. */ + if (result > 0) + return (result); + /* Set/override the device description. */ if (id->desc) device_set_desc(dev, id->desc); - return (uart_bus_probe(dev, 0, id->rclk, id->rid, 0)); + return (result); } DRIVER_MODULE(uart, pci, uart_pci_driver, uart_devclass, NULL, NULL); From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 16:59:20 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AEC02F11; Thu, 25 Jul 2013 16:59:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 706D8242B; Thu, 25 Jul 2013 16:59:20 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id ABC33D42AC5; Fri, 26 Jul 2013 02:59:15 +1000 (EST) Date: Fri, 26 Jul 2013 02:59:12 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin Subject: Re: svn commit: r253618 - head/sys/dev/usb/gadget In-Reply-To: <201307241529.35175.jhb@freebsd.org> Message-ID: <20130726025137.E2782@besplex.bde.org> References: <201307241832.r6OIWFGc074918@svn.freebsd.org> <201307241529.35175.jhb@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=Yos2GeoX c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=JYkn-E3srG0A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=4v6nFQ3yUQ4A:10 a=6I5d2MoRAAAA:8 a=ZHBUoalBIWQ8lvIXvfIA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "David E. O'Brien" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 16:59:20 -0000 On Wed, 24 Jul 2013, John Baldwin wrote: > On Wednesday, July 24, 2013 2:32:15 pm David E. O'Brien wrote: >> Author: obrien >> Date: Wed Jul 24 18:32:15 2013 >> New Revision: 253618 >> URL: http://svnweb.freebsd.org/changeset/base/253618 >> >> Log: >> per style(9): >> Kernel include files (i.e. sys/*.h) come first; normally, include >> OR , but not both. includes >> , and it is okay to depend on that. > > This is not fully correct. The consistent style throughout the tree when > using _FBSDID() is: > > #include > __FBSDID() > > #include > ... > > Please fix these to match that. It might not be a bad idea to document the > __FBSDID() practice in style.9 while you are at it. This ugliness (sys/cdefs.h before __FBSDID()) is to avoid changing all the includes of sys/param.h and sys/types.h or even anyother.h that followed the old style rule. As is common, style(9) documents the rule for sys/cdefs.h before __FBSDID() only by example. Its main text wasn't changed and still emphasizes depending on getting sys/cdefs.h from sys/param.h or sys/types.h and not from anywhere else. But almost everywhere else now includes it too, and with it included before __FBSDID(), almost all direct includes of it not before __FBSDID() are style bugs. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 18:20:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5E4B02F0; Thu, 25 Jul 2013 18:20:19 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay009.isp.belgacom.be (mailrelay009.isp.belgacom.be [195.238.6.176]) by mx1.freebsd.org (Postfix) with ESMTP id 7999F282E; Thu, 25 Jul 2013 18:20:18 +0000 (UTC) X-Belgacom-Dynamic: yes X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=YNYxFN+OaEw7Bvgx8BtAje2BdF1dMiUvAYP8MJfhIY0= c=1 sm=2 a=xnulW3ATU38A:10 a=ZxPGInapWdQA:10 a=6I5d2MoRAAAA:8 a=25FBXyFstQaOdyPHdHYA:9 a=CjuIK1q_8ugA:10 a=Ygar-FfzCk9i-NbEwFsA:9 a=0CaTwavtbm8A:10 a=_G8qimlXLBUA:10 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmcGAONr8VFR8b7D/2dsb2JhbABbgwY1vjGBFhd0giQBAQVWIxALDgYECSUPKh4GiCcIuXmPbBEHhAADjECDUodMgSqFbIMNhyuDFjo Received: from 195.190-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.190.195]) by relay.skynet.be with ESMTP; 25 Jul 2013 20:19:55 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id r6PIJr2I005035; Thu, 25 Jul 2013 20:19:54 +0200 (CEST) (envelope-from tijl@coosemans.org) Date: Thu, 25 Jul 2013 20:19:48 +0200 From: Tijl Coosemans To: David Chisnall Subject: Re: svn commit: r253563 - head/contrib/libstdc++/include/c_std Message-ID: <20130725201948.2f5ae808@kalimero.tijl.coosemans.org> In-Reply-To: <201307231023.r6NANhGf065713@svn.freebsd.org> References: <201307231023.r6NANhGf065713@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA256; boundary="Sig_/9brOvKNWdGkshkv=nffU6_R"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 18:20:19 -0000 --Sig_/9brOvKNWdGkshkv=nffU6_R Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 23 Jul 2013 10:23:43 +0000 (UTC) David Chisnall wrote: > Author: theraven > Date: Tue Jul 23 10:23:43 2013 > New Revision: 253563 > URL: http://svnweb.freebsd.org/changeset/base/253563 >=20 > Log: > Add isnan() and isinf() to the global namespace in libstdc++'s . > =20 > The standard (n3242, section 17.6.1.1, paragraph 4) says that, because = these are > declared as macros in the C specification (even though they are > implemented as functions in the C++ library) they should be in the glob= al > namespace. > =20 > A surprising number of configure checks rely on this. It was broken by= recent > cleanups to math.h. >=20 > Modified: > head/contrib/libstdc++/include/c_std/std_cmath.h >=20 > Modified: head/contrib/libstdc++/include/c_std/std_cmath.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/contrib/libstdc++/include/c_std/std_cmath.h Tue Jul 23 05:11:22 = 2013 (r253562) > +++ head/contrib/libstdc++/include/c_std/std_cmath.h Tue Jul 23 10:23:43 = 2013 (r253563) > @@ -589,6 +589,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) > { return ::__gnu_cxx::__capture_isunordered(__f1, __f2); } > =20 > _GLIBCXX_END_NAMESPACE > +using std::isnan; > +using std::isinf; > =20 > #endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */ > #endif Doesn't this violate C++98/C++03? The quote above is for C++11. I think the real issue here is that isnan/isinf functions were completely removed from math.h instead of just hidden for C++11 (with some #if). This also broke compilation of C code with -D_XOPEN_SOURCE=3D500. --Sig_/9brOvKNWdGkshkv=nffU6_R Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iF4EAREIAAYFAlHxbEgACgkQfoCS2CCgtisfDgD/aw+jKaLh4dMzFZp5ytu1Wh0A 1Vq0Rex2lSH3uc6hAagA/RxtmddWxxg2v4gbXybZRd/w7uTS1C0hRlQ679+NF1V4 =OwSC -----END PGP SIGNATURE----- --Sig_/9brOvKNWdGkshkv=nffU6_R-- From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 19:10:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B2734F3; Thu, 25 Jul 2013 19:10:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9F81C2A9C; Thu, 25 Jul 2013 19:10:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6PJANEu056104; Thu, 25 Jul 2013 19:10:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6PJANqe056103; Thu, 25 Jul 2013 19:10:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307251910.r6PJANqe056103@svn.freebsd.org> From: Adrian Chadd Date: Thu, 25 Jul 2013 19:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253655 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 19:10:23 -0000 Author: adrian Date: Thu Jul 25 19:10:23 2013 New Revision: 253655 URL: http://svnweb.freebsd.org/changeset/base/253655 Log: Fix typo. Sponsored by: Netflix Modified: head/sys/net/ieee8023ad_lacp.c Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Thu Jul 25 16:57:27 2013 (r253654) +++ head/sys/net/ieee8023ad_lacp.c Thu Jul 25 19:10:23 2013 (r253655) @@ -1343,7 +1343,7 @@ re_eval: case LACP_MUX_DISTRIBUTING: if (selected != LACP_SELECTED || !p_sync || !p_collecting) { new_state = LACP_MUX_COLLECTING; - lacp_dprintf(lp, "Interface stopped DISTRIBUTING, possible flaping\n"); + lacp_dprintf(lp, "Interface stopped DISTRIBUTING, possible flapping\n"); sc->sc_flapping++; } break; From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 19:34:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9FE92548; Thu, 25 Jul 2013 19:34:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8CB5F2B87; Thu, 25 Jul 2013 19:34:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6PJYO00066738; Thu, 25 Jul 2013 19:34:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6PJYOYG066737; Thu, 25 Jul 2013 19:34:24 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201307251934.r6PJYOYG066737@svn.freebsd.org> From: John Baldwin Date: Thu, 25 Jul 2013 19:34:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253656 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 19:34:24 -0000 Author: jhb Date: Thu Jul 25 19:34:24 2013 New Revision: 253656 URL: http://svnweb.freebsd.org/changeset/base/253656 Log: Enhance the description of NOTE_TRACK: - NOTE_TRACK has never triggered a NOTE_TRACK event from the parent pid. If NOTE_FORK is set, the listener will get a NOTE_FORK event from the parent pid, but not a separate NOTE_TRACK event. - Explicitly note that the event added to monitor the child process preserves the fflags from the original event. - Move the description of NOTE_TRACKERR under NOTE_TRACK as it is not a bit for the user to set (which is what this list pupports to be). Also, explicitly note that if an error occurs, the NOTE_CHILD event will not be generated. MFC after: 1 week Modified: head/lib/libc/sys/kqueue.2 Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Thu Jul 25 19:10:23 2013 (r253655) +++ head/lib/libc/sys/kqueue.2 Thu Jul 25 19:34:24 2013 (r253656) @@ -388,20 +388,25 @@ The process has called .It NOTE_EXEC The process has executed a new process via .Xr execve 2 -or similar call. +or a similar call. .It NOTE_TRACK Follow a process across .Fn fork calls. -The parent process will return with NOTE_TRACK set in the +The parent process registers a new kevent to monitor the child process +using the same .Va fflags -field, while the child process will return with NOTE_CHILD set in +as the original event. +The child process will signal an event with NOTE_CHILD set in .Va fflags and the parent PID in .Va data . -.It NOTE_TRACKERR -This flag is returned if the system was unable to attach an event to -the child process, usually due to resource limitations. +.Pp +If the parent process fails to register a new kevent +.Pq usually due to resource limitations , +it will signal an event with NOTE_TRACKERR set in +.Va fflags , +and the child process will not signal a NOTE_CHILD event. .El .Pp On return, From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 19:37:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6D4A47AF; Thu, 25 Jul 2013 19:37:50 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 596172BC6; Thu, 25 Jul 2013 19:37:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6PJboul067514; Thu, 25 Jul 2013 19:37:50 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6PJbosT067513; Thu, 25 Jul 2013 19:37:50 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307251937.r6PJbosT067513@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 25 Jul 2013 19:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253657 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 19:37:50 -0000 Author: pfg Date: Thu Jul 25 19:37:49 2013 New Revision: 253657 URL: http://svnweb.freebsd.org/changeset/base/253657 Log: ext2fs: Return EINVAL for negative uio_offset as in UFS. While here drop old comment that doesn't really apply. MFC after: 1 month Discussed with: gleb Modified: head/sys/fs/ext2fs/ext2_lookup.c Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Thu Jul 25 19:34:24 2013 (r253656) +++ head/sys/fs/ext2fs/ext2_lookup.c Thu Jul 25 19:37:49 2013 (r253657) @@ -146,6 +146,8 @@ ext2_readdir(struct vop_readdir_args *ap int DIRBLKSIZ = VTOI(ap->a_vp)->i_e2fs->e2fs_bsize; int error; + if (uio->uio_offset < 0) + return (EINVAL); ip = VTOI(vp); if (ap->a_ncookies != NULL) { ncookies = uio->uio_resid; @@ -162,14 +164,6 @@ ext2_readdir(struct vop_readdir_args *ap ncookies = 0; cookies = NULL; } - /* - * Avoid complications for partial directory entries by adjusting - * the i/o to end at a block boundary. Don't give up (like ufs - * does) if the initial adjustment gives a negative count, since - * many callers don't supply a large enough buffer. The correct - * size is a little larger than DIRBLKSIZ to allow for expansion - * of directory entries, but some callers just use 512. - */ offset = startoffset = uio->uio_offset; startresid = uio->uio_resid; error = 0; From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 19:48:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4D303CBA; Thu, 25 Jul 2013 19:48:17 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 290112C78; Thu, 25 Jul 2013 19:48:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6PJmH1l071428; Thu, 25 Jul 2013 19:48:17 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6PJmF9I071419; Thu, 25 Jul 2013 19:48:15 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307251948.r6PJmF9I071419@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 25 Jul 2013 19:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253658 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 19:48:17 -0000 Author: jilles Date: Thu Jul 25 19:48:15 2013 New Revision: 253658 URL: http://svnweb.freebsd.org/changeset/base/253658 Log: sh: Remove #define MKINIT. MKINIT only served for the removed mkinit. Many variables can be static now. Modified: head/bin/sh/eval.c head/bin/sh/input.c head/bin/sh/jobs.c head/bin/sh/parser.c head/bin/sh/redir.c head/bin/sh/shell.h head/bin/sh/trap.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Thu Jul 25 19:37:49 2013 (r253657) +++ head/bin/sh/eval.c Thu Jul 25 19:48:15 2013 (r253658) @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); int evalskip; /* set if we are skipping commands */ int skipcount; /* number of levels to skip */ -MKINIT int loopnest; /* current loop nesting level */ +static int loopnest; /* current loop nesting level */ int funcnest; /* depth of function calls */ static int builtin_flags; /* evalcommand flags for builtins */ Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Thu Jul 25 19:37:49 2013 (r253657) +++ head/bin/sh/input.c Thu Jul 25 19:48:15 2013 (r253658) @@ -92,7 +92,7 @@ struct parsefile { int plinno = 1; /* input line number */ int parsenleft; /* copy of parsefile->nleft */ -MKINIT int parselleft; /* copy of parsefile->lleft */ +static int parselleft; /* copy of parsefile->lleft */ const char *parsenextc; /* copy of parsefile->nextc */ static char basebuf[BUFSIZ + 1];/* buffer for top level input file */ static struct parsefile basepf = { /* top level input file */ Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Thu Jul 25 19:37:49 2013 (r253657) +++ head/bin/sh/jobs.c Thu Jul 25 19:48:15 2013 (r253658) @@ -77,8 +77,8 @@ __FBSDID("$FreeBSD$"); static struct job *jobtab; /* array of jobs */ static int njobs; /* size of array */ -MKINIT pid_t backgndpid = -1; /* pid of last background process */ -MKINIT struct job *bgjob = NULL; /* last background process */ +static pid_t backgndpid = -1; /* pid of last background process */ +static struct job *bgjob = NULL; /* last background process */ #if JOBS static struct job *jobmru; /* most recently used job list */ static pid_t initialpgrp; /* pgrp of shell on invocation */ @@ -116,7 +116,7 @@ static void showjob(struct job *, int); * Turn job control on and off. */ -MKINIT int jobctl; +static int jobctl; #if JOBS void Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Thu Jul 25 19:37:49 2013 (r253657) +++ head/bin/sh/parser.c Thu Jul 25 19:48:15 2013 (r253658) @@ -96,9 +96,9 @@ static struct heredoc *heredoclist; /* l static int doprompt; /* if set, prompt the user */ static int needprompt; /* true if interactive and at start of line */ static int lasttoken; /* last token read */ -MKINIT int tokpushback; /* last token pushed back */ +int tokpushback; /* last token pushed back */ static char *wordtext; /* text of last word returned by readtoken */ -MKINIT int checkkwd; /* 1 == check for kwds, 2 == also eat newlines */ +static int checkkwd; /* 1 == check for kwds, 2 == also eat newlines */ static struct nodelist *backquotelist; static union node *redirnode; static struct heredoc *heredoc; Modified: head/bin/sh/redir.c ============================================================================== --- head/bin/sh/redir.c Thu Jul 25 19:37:49 2013 (r253657) +++ head/bin/sh/redir.c Thu Jul 25 19:48:15 2013 (r253658) @@ -66,14 +66,13 @@ __FBSDID("$FreeBSD$"); #define CLOSED -1 /* fd was not open before redir */ -MKINIT struct redirtab { struct redirtab *next; int renamed[10]; }; -MKINIT struct redirtab *redirlist; +static struct redirtab *redirlist; /* * We keep track of whether or not fd0 has been redirected. This is for Modified: head/bin/sh/shell.h ============================================================================== --- head/bin/sh/shell.h Thu Jul 25 19:37:49 2013 (r253657) +++ head/bin/sh/shell.h Thu Jul 25 19:48:15 2013 (r253658) @@ -63,7 +63,6 @@ typedef intmax_t arith_t; #define ARITH_MAX INTMAX_MAX typedef void *pointer; -#define MKINIT /* empty */ #include Modified: head/bin/sh/trap.c ============================================================================== --- head/bin/sh/trap.c Thu Jul 25 19:37:49 2013 (r253657) +++ head/bin/sh/trap.c Thu Jul 25 19:48:15 2013 (r253658) @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #define S_RESET 5 /* temporary - to reset a hard ignored sig */ -MKINIT char sigmode[NSIG]; /* current value of signal */ +static char sigmode[NSIG]; /* current value of signal */ volatile sig_atomic_t pendingsig; /* indicates some signal received */ int in_dotrap; /* do we execute in a trap handler? */ static char *volatile trap[NSIG]; /* trap handler commands */ From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 20:50:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AEE9CDDA; Thu, 25 Jul 2013 20:50:35 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9A8212F97; Thu, 25 Jul 2013 20:50:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6PKoZw6097398; Thu, 25 Jul 2013 20:50:35 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6PKoZ7W097397; Thu, 25 Jul 2013 20:50:35 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307252050.r6PKoZ7W097397@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 25 Jul 2013 20:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253659 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 20:50:35 -0000 Author: jilles Date: Thu Jul 25 20:50:35 2013 New Revision: 253659 URL: http://svnweb.freebsd.org/changeset/base/253659 Log: sh: Remove an incorrect comment. Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Thu Jul 25 19:48:15 2013 (r253658) +++ head/bin/sh/parser.c Thu Jul 25 20:50:35 2013 (r253659) @@ -98,7 +98,7 @@ static int needprompt; /* true if inter static int lasttoken; /* last token read */ int tokpushback; /* last token pushed back */ static char *wordtext; /* text of last word returned by readtoken */ -static int checkkwd; /* 1 == check for kwds, 2 == also eat newlines */ +static int checkkwd; static struct nodelist *backquotelist; static union node *redirnode; static struct heredoc *heredoc; From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 20:53:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5D7C6F4E; Thu, 25 Jul 2013 20:53:16 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2FDB72FB8; Thu, 25 Jul 2013 20:53:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6PKrGF7098030; Thu, 25 Jul 2013 20:53:16 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6PKrFv8098027; Thu, 25 Jul 2013 20:53:15 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201307252053.r6PKrFv8098027@svn.freebsd.org> From: Brooks Davis Date: Thu, 25 Jul 2013 20:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253660 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 20:53:16 -0000 Author: brooks Date: Thu Jul 25 20:53:15 2013 New Revision: 253660 URL: http://svnweb.freebsd.org/changeset/base/253660 Log: Document the sbinuptime() and getsbinuptime() functions introduced in r247452. Sponsored by: DARPA, AFRL Modified: head/share/man/man9/Makefile head/share/man/man9/microuptime.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Jul 25 20:50:35 2013 (r253659) +++ head/share/man/man9/Makefile Thu Jul 25 20:53:15 2013 (r253660) @@ -954,7 +954,9 @@ MLINKS+=microuptime.9 binuptime.9 \ microuptime.9 getbinuptime.9 \ microuptime.9 getmicrouptime.9 \ microuptime.9 getnanouptime.9 \ - microuptime.9 nanouptime.9 + microuptime.9 getsbinuptime.9 \ + microuptime.9 nanouptime.9 \ + microuptime.9 sbinuptime.9 MLINKS+=mi_switch.9 cpu_switch.9 \ mi_switch.9 cpu_throw.9 MLINKS+=mtx_pool.9 mtx_pool_alloc.9 \ Modified: head/share/man/man9/microuptime.9 ============================================================================== --- head/share/man/man9/microuptime.9 Thu Jul 25 20:50:35 2013 (r253659) +++ head/share/man/man9/microuptime.9 Thu Jul 25 20:53:15 2013 (r253660) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 16, 2004 +.Dd July 25, 2013 .Dt MICROUPTIME 9 .Os .Sh NAME @@ -33,7 +33,9 @@ .Nm microuptime , .Nm getmicrouptime , .Nm nanouptime , -.Nm getnanouptime +.Nm getnanouptime , +.Nm sbinuptime , +.Nm getsbinuptime .Nd get the time elapsed since boot .Sh SYNOPSIS .In sys/time.h @@ -49,6 +51,10 @@ .Fn nanouptime "struct timespec *ts" .Ft void .Fn getnanouptime "struct timespec *tsp" +.Ft sbintime_t +.Fn sbinuptime "void" +.Ft sbintime_t +.Fn getsbinuptime "void" .Sh DESCRIPTION The .Fn binuptime @@ -71,28 +77,37 @@ and .Fn getnanouptime functions store the elapsed time as a .Vt "struct timespec" . +The +.Fn sbinuptime +and +.Fn getsbinuptime +functions return the time elapsed since boot as a +.Vt "sbintime_t" . .Pp The .Fn binuptime , .Fn microuptime , +.Fn nanouptime , and -.Fn nanouptime +.Fn sbinuptime functions always query the timecounter to return the current time as precisely as possible. Whereas .Fn getbinuptime , .Fn getmicrouptime , +.Fn getnanouptime , and -.Fn getnanouptime +.Fn getsbinuptime functions are abstractions which return a less precise, but faster to obtain, time. .Pp The intent of the .Fn getbinuptime , .Fn getmicrouptime , +.Fn getnanouptime , and -.Fn getnanouptime +.Fn getsbinuptime functions is to enforce the user's preference for timer accuracy versus execution time. .Sh SEE ALSO From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 22:41:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B4D54912 for ; Thu, 25 Jul 2013 22:41:12 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-pb0-f42.google.com (mail-pb0-f42.google.com [209.85.160.42]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 88BB32501 for ; Thu, 25 Jul 2013 22:41:12 +0000 (UTC) Received: by mail-pb0-f42.google.com with SMTP id un1so1307521pbc.15 for ; Thu, 25 Jul 2013 15:41:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :x-gm-message-state; bh=mZPZN2zJ5GUWAHuEvZOOWPzK1Io4PxEAly+/viXPqRQ=; b=npSk6Aw78oHwnUutb/i12tAIf3gEojP29qkzO2JG5KvrB03aCTTCSCC+8PsWj04Zm1 W5celTRva6ENmfSuEy4stHmPNMRUkw+vj1X9T9SZpMzpdz3OiRTHKvrWVEhXNn7duT8f r65oklHdtcK536inas8r1hpBf0WXcfOlgROGsCV5ivEsKWlI15uLX62UiRNRZRVdbIlS nhmxk0Z5u3Z+H3+5K50Oj3Q63qhSWyEYfAM+LpEkJ6NpHLlI7uUaEsSHpsMoV7+Xr9nS G8+5d0cd68UDN65d7DV9tMxTNWc9raiadoUH1pWFLuAjvU5BffZuGCVuTJ7ujdNQzYli sHFg== X-Received: by 10.66.159.132 with SMTP id xc4mr17551459pab.27.1374792066659; Thu, 25 Jul 2013 15:41:06 -0700 (PDT) Received: from zont-osx.swifttest.com (h-74-3-97-61.snva.ca.megapath.net. [74.3.97.61]) by mx.google.com with ESMTPSA id cx3sm56194633pbb.30.2013.07.25.15.41.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 15:41:05 -0700 (PDT) Sender: Andrey Zonov Message-ID: <51F1A97A.8050405@FreeBSD.org> Date: Thu, 25 Jul 2013 15:40:58 -0700 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Jeff Roberson Subject: Re: svn commit: r253587 - head/sys/vm References: <201307240125.r6O1PuQG043670@svn.freebsd.org> In-Reply-To: <201307240125.r6O1PuQG043670@svn.freebsd.org> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2UWIDDNFJSPHXWBCBQASW" X-Gm-Message-State: ALoCoQnpk3cIowtwOaUKnREMC/bLGMXkscv0oMKJKjdrwHVFlyj0xzPS5j2lQylq803PrnMgl80r Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 22:41:12 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2UWIDDNFJSPHXWBCBQASW Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 7/23/13 6:25 PM, Jeff Roberson wrote: > Author: jeff > Date: Wed Jul 24 01:25:56 2013 > New Revision: 253587 > URL: http://svnweb.freebsd.org/changeset/base/253587 >=20 > Log: > - Remove the long obsolete 'vm_pageout_algorithm' experiment. > =20 There is more of it. diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3 index d689b7c..7d7b90a 100644 --- a/lib/libc/gen/sysctl.3 +++ b/lib/libc/gen/sysctl.3 @@ -735,7 +735,6 @@ privilege may change the value. .It Sy "Second level name Type Changeable" .It "VM_LOADAVG struct loadavg no" .It "VM_TOTAL struct vmtotal no" -.It "VM_PAGEOUT_ALGORITHM integer yes" .It "VM_SWAPPING_ENABLED integer maybe" .It "VM_V_CACHE_MAX integer yes" .It "VM_V_CACHE_MIN integer yes" @@ -754,9 +753,6 @@ The returned data consists of a Return the system wide virtual memory statistics. The returned data consists of a .Va struct vmtotal . -.It Li VM_PAGEOUT_ALGORITHM -0 if the statistics-based page management algorithm is in use -or 1 if the near-LRU algorithm is in use. .It Li VM_SWAPPING_ENABLED 1 if process swapping is enabled or 0 if disabled. This variable is diff --git a/sys/vm/vm_param.h b/sys/vm/vm_param.h index c404989..44306be 100644 --- a/sys/vm/vm_param.h +++ b/sys/vm/vm_param.h @@ -82,9 +82,8 @@ #define VM_V_CACHE_MIN 7 /* cnt.v_cache_min */ #define VM_V_CACHE_MAX 8 /* cnt.v_cache_max */ #define VM_V_PAGEOUT_FREE_MIN 9 /* cnt.v_pageout_free_min */ -#define VM_PAGEOUT_ALGORITHM 10 /* pageout algorithm */ -#define VM_SWAPPING_ENABLED 11 /* swapping enabled */ -#define VM_MAXID 12 /* number of valid vm ids= */ +#define VM_SWAPPING_ENABLED 10 /* swapping enabled */ +#define VM_MAXID 11 /* number of valid vm ids= */ #define CTL_VM_NAMES { \ { 0, 0 }, \ @@ -97,7 +96,6 @@ { "v_cache_min", CTLTYPE_UINT }, \ { "v_cache_max", CTLTYPE_UINT }, \ { "v_pageout_free_min", CTLTYPE_UINT}, \ - { "pageout_algorithm", CTLTYPE_INT}, \ { "swap_enabled", CTLTYPE_INT},\ } diff --git a/tools/tools/sysdoc/tunables.mdoc b/tools/tools/sysdoc/tunables.mdoc index 35ef9c0..8b426e6 100644 --- a/tools/tools/sysdoc/tunables.mdoc +++ b/tools/tools/sysdoc/tunables.mdoc @@ -2259,9 +2259,6 @@ Displays the number of swap devices available to the system. This is a read-only variable. --- -vm.pageout_algorithm - ---- vm.pageout_full_stats_interval --- --=20 Andrey Zonov ------enig2UWIDDNFJSPHXWBCBQASW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJR8al/AAoJEBWLemxX/CvTpp0H/RI0Es8tsLzMQyOwt5Kv1tH5 9hGqg7h/J8EazF95Pm9rx3J1rEd7PHT7zHYQw3Xy0sT4Ixs7vv0MIYkfjc2v2gfR FuLHQ7l9b2vCIDamitp4VyT8/Ya9PFN+6n6Z/BY9IXxLbWHrt/YxukG+6hm8jduh 8vJf0nLLqRXGB7aedKa55pe2J8uQ8qLsdvs3Tmbtm8b0kW6zplYPybhoHeMTXW/Y zWRfHIsjIcP4aHUz6wK0V5XGljcpqUsAyvXSqDPoGsJuqYIPkUBLrsTGVKmfbrr3 hhkTU4v7CH694w3kMdY1vP8SY4z7Upum+PiF3K3BzS18HO+M1Tp/aI0sE6WJksk= =E8I3 -----END PGP SIGNATURE----- ------enig2UWIDDNFJSPHXWBCBQASW-- From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 23:01:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 69573E91; Thu, 25 Jul 2013 23:01:24 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pp1.rice.edu (proofpoint1.mail.rice.edu [128.42.201.100]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 965662621; Thu, 25 Jul 2013 23:01:23 +0000 (UTC) Received: from pps.filterd (pp1.rice.edu [127.0.0.1]) by pp1.rice.edu (8.14.5/8.14.5) with SMTP id r6PHfZF0027463; Thu, 25 Jul 2013 18:01:22 -0500 Received: from mh2.mail.rice.edu (mh2.mail.rice.edu [128.42.201.21]) by pp1.rice.edu with ESMTP id 1dsymjh8jp-1; Thu, 25 Jul 2013 18:01:22 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh2.mail.rice.edu, auth channel Received: from [10.104.199.202] (unknown [131.107.165.81]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh2.mail.rice.edu (Postfix) with ESMTPSA id 54DA250013E; Thu, 25 Jul 2013 18:01:21 -0500 (CDT) Subject: Re: svn commit: r253587 - head/sys/vm Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Alan Cox In-Reply-To: <51F1A97A.8050405@FreeBSD.org> Date: Thu, 25 Jul 2013 16:01:16 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201307240125.r6O1PuQG043670@svn.freebsd.org> <51F1A97A.8050405@FreeBSD.org> To: Andrey Zonov X-Mailer: Apple Mail (2.1085) Cc: svn-src-head@freebsd.org, Jeff Roberson , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 23:01:24 -0000 On Jul 25, 2013, at 3:40 PM, Andrey Zonov wrote: > On 7/23/13 6:25 PM, Jeff Roberson wrote: >> Author: jeff >> Date: Wed Jul 24 01:25:56 2013 >> New Revision: 253587 >> URL: http://svnweb.freebsd.org/changeset/base/253587 >>=20 >> Log: >> - Remove the long obsolete 'vm_pageout_algorithm' experiment. >>=20 >=20 > There is more of it. >=20 Thank you. Please commit this. =20 Alan > diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3 > index d689b7c..7d7b90a 100644 > --- a/lib/libc/gen/sysctl.3 > +++ b/lib/libc/gen/sysctl.3 > @@ -735,7 +735,6 @@ privilege may change the value. > .It Sy "Second level name Type Changeable" > .It "VM_LOADAVG struct loadavg no" > .It "VM_TOTAL struct vmtotal no" > -.It "VM_PAGEOUT_ALGORITHM integer yes" > .It "VM_SWAPPING_ENABLED integer maybe" > .It "VM_V_CACHE_MAX integer yes" > .It "VM_V_CACHE_MIN integer yes" > @@ -754,9 +753,6 @@ The returned data consists of a > Return the system wide virtual memory statistics. > The returned data consists of a > .Va struct vmtotal . > -.It Li VM_PAGEOUT_ALGORITHM > -0 if the statistics-based page management algorithm is in use > -or 1 if the near-LRU algorithm is in use. > .It Li VM_SWAPPING_ENABLED > 1 if process swapping is enabled or 0 if disabled. > This variable is > diff --git a/sys/vm/vm_param.h b/sys/vm/vm_param.h > index c404989..44306be 100644 > --- a/sys/vm/vm_param.h > +++ b/sys/vm/vm_param.h > @@ -82,9 +82,8 @@ > #define VM_V_CACHE_MIN 7 /* cnt.v_cache_min */ > #define VM_V_CACHE_MAX 8 /* cnt.v_cache_max */ > #define VM_V_PAGEOUT_FREE_MIN 9 /* cnt.v_pageout_free_min */ > -#define VM_PAGEOUT_ALGORITHM 10 /* pageout algorithm = */ > -#define VM_SWAPPING_ENABLED 11 /* swapping enabled */ > -#define VM_MAXID 12 /* number of valid vm = ids */ > +#define VM_SWAPPING_ENABLED 10 /* swapping enabled */ > +#define VM_MAXID 11 /* number of valid vm = ids */ >=20 > #define CTL_VM_NAMES { \ > { 0, 0 }, \ > @@ -97,7 +96,6 @@ > { "v_cache_min", CTLTYPE_UINT }, \ > { "v_cache_max", CTLTYPE_UINT }, \ > { "v_pageout_free_min", CTLTYPE_UINT}, \ > - { "pageout_algorithm", CTLTYPE_INT}, \ > { "swap_enabled", CTLTYPE_INT},\ > } >=20 > diff --git a/tools/tools/sysdoc/tunables.mdoc > b/tools/tools/sysdoc/tunables.mdoc > index 35ef9c0..8b426e6 100644 > --- a/tools/tools/sysdoc/tunables.mdoc > +++ b/tools/tools/sysdoc/tunables.mdoc > @@ -2259,9 +2259,6 @@ Displays the number of swap devices available > to the system. This is a read-only variable. >=20 > --- > -vm.pageout_algorithm > - > ---- > vm.pageout_full_stats_interval >=20 > --- >=20 >=20 > --=20 > Andrey Zonov >=20 From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 00:28:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 03E63A18; Fri, 26 Jul 2013 00:28:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E4D5F293B; Fri, 26 Jul 2013 00:28:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6Q0SKHp080906; Fri, 26 Jul 2013 00:28:20 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6Q0SKjE080899; Fri, 26 Jul 2013 00:28:20 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307260028.r6Q0SKjE080899@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 26 Jul 2013 00:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253661 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 00:28:21 -0000 Author: pfg Date: Fri Jul 26 00:28:19 2013 New Revision: 253661 URL: http://svnweb.freebsd.org/changeset/base/253661 Log: Fix a segfault in ctfmerge due to a bug in gcc. GCC can generate bogus dwarf attributes with DW_AT_byte_size set to 0xFFFFFFFF. The issue was originaly detected in NetBSD but it has been adapted for portability and to avoid compiler warnings. Reference: https://www.illumos.org/issues/3776 Obtained from: NetBSD MFC after: 1 month Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c Thu Jul 25 20:53:15 2013 (r253660) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c Fri Jul 26 00:28:19 2013 (r253661) @@ -52,6 +52,8 @@ static char *curfile; #define CTF_BUF_CHUNK_SIZE (64 * 1024) #define RES_BUF_CHUNK_SIZE (64 * 1024) +static int ntypes=0; /* The number of types. */ + struct ctf_buf { strtab_t ctb_strtab; /* string table */ caddr_t ctb_base; /* pointer to base of buffer */ @@ -1143,6 +1145,10 @@ resurrect_types(ctf_header_t *h, tdata_t (*mpp)->ml_type = tdarr[ctm->ctm_type]; (*mpp)->ml_offset = ctm->ctm_offset; (*mpp)->ml_size = 0; + if (ctm->ctm_type > ntypes) { + parseterminate("Invalid member type ctm_type=%d", + ctm->ctm_type); + } } } else { for (i = 0, mpp = &tdp->t_members; i < vlen; @@ -1159,6 +1165,10 @@ resurrect_types(ctf_header_t *h, tdata_t (*mpp)->ml_offset = (int)CTF_LMEM_OFFSET(ctlm); (*mpp)->ml_size = 0; + if (ctlm->ctlm_type > ntypes) { + parseterminate("Invalid lmember type ctlm_type=%d", + ctlm->ctlm_type); + } } } @@ -1272,9 +1282,10 @@ ctf_parse(ctf_header_t *h, caddr_t buf, { tdata_t *td = tdata_new(); tdesc_t **tdarr; - int ntypes = count_types(h, buf); int idx, i; + ntypes = count_types(h, buf); + /* shudder */ tdarr = xcalloc(sizeof (tdesc_t *) * (ntypes + 1)); tdarr[0] = NULL; Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h Thu Jul 25 20:53:15 2013 (r253660) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h Fri Jul 26 00:28:19 2013 (r253661) @@ -159,7 +159,7 @@ typedef struct ardef { /* Auxiliary structure for structure/union tdesc_t */ typedef struct mlist { int ml_offset; /* Offset from start of structure (in bits) */ - int ml_size; /* Member size (in bits) */ + uint_t ml_size; /* Member size (in bits) */ char *ml_name; /* Member name */ struct tdesc *ml_type; /* Member type */ struct mlist *ml_next; /* Next member */ Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Thu Jul 25 20:53:15 2013 (r253660) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Fri Jul 26 00:28:19 2013 (r253661) @@ -674,6 +674,13 @@ die_array_create(dwarf_t *dw, Dwarf_Die tdesc_t *dimtdp; int flags; + /* Check for bogus gcc DW_AT_byte_size attribute */ + if (uval == (unsigned)-1) { + printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n", + __func__); + uval = 0; + } + tdp->t_size = uval; /* @@ -760,6 +767,12 @@ die_enum_create(dwarf_t *dw, Dwarf_Die d tdp->t_type = ENUM; (void) die_unsigned(dw, die, DW_AT_byte_size, &uval, DW_ATTR_REQ); + /* Check for bogus gcc DW_AT_byte_size attribute */ + if (uval == (unsigned)-1) { + printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n", + __func__); + uval = 0; + } tdp->t_size = uval; if ((mem = die_child(dw, die)) != NULL) { @@ -873,7 +886,7 @@ static void die_sou_create(dwarf_t *dw, Dwarf_Die str, Dwarf_Off off, tdesc_t *tdp, int type, const char *typename) { - Dwarf_Unsigned sz, bitsz, bitoff; + Dwarf_Unsigned sz, bitsz, bitoff, maxsz=0; Dwarf_Die mem; mlist_t *ml, **mlastp; iidesc_t *ii; @@ -929,6 +942,8 @@ die_sou_create(dwarf_t *dw, Dwarf_Die st ml->ml_name = NULL; ml->ml_type = die_lookup_pass1(dw, mem, DW_AT_type); + debug(3, "die_sou_create(): ml_type = %p t_id = %d\n", + ml->ml_type, ml->ml_type->t_id); if (die_mem_offset(dw, mem, DW_AT_data_member_location, &mloff, 0)) { @@ -956,8 +971,24 @@ die_sou_create(dwarf_t *dw, Dwarf_Die st *mlastp = ml; mlastp = &ml->ml_next; + + /* Find the size of the largest member to work around a gcc + * bug. See GCC Bugzilla 35998. + */ + if (maxsz < ml->ml_size) + maxsz = ml->ml_size; + } while ((mem = die_sibling(dw, mem)) != NULL); + /* See if we got a bogus DW_AT_byte_size. GCC will sometimes + * emit this. + */ + if (sz == (unsigned)-1) { + printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n", + __func__); + tdp->t_size = maxsz / 8; /* maxsz is in bits, t_size is bytes */ + } + /* * GCC will attempt to eliminate unused types, thus decreasing the * size of the emitted dwarf. That is, if you declare a foo_t in your @@ -1054,7 +1085,7 @@ die_sou_resolve(tdesc_t *tdp, tdesc_t ** } if (ml->ml_size != 0 && mt->t_type == INTRINSIC && - mt->t_intr->intr_nbits != ml->ml_size) { + mt->t_intr->intr_nbits != (int)ml->ml_size) { /* * This member is a bitfield, and needs to reference * an intrinsic type with the same width. If the @@ -1370,6 +1401,13 @@ die_base_create(dwarf_t *dw, Dwarf_Die b */ (void) die_unsigned(dw, base, DW_AT_byte_size, &sz, DW_ATTR_REQ); + /* Check for bogus gcc DW_AT_byte_size attribute */ + if (sz == (unsigned)-1) { + printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n", + __func__); + sz = 0; + } + if (tdp->t_name == NULL) terminate("die %llu: base type without name\n", off); Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c Thu Jul 25 20:53:15 2013 (r253660) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c Fri Jul 26 00:28:19 2013 (r253661) @@ -952,7 +952,7 @@ soudef(char *cp, stabtype_t type, tdesc_ itdp = find_intrinsic(tdp); if (itdp->t_type == INTRINSIC) { - if (mlp->ml_size != itdp->t_intr->intr_nbits) { + if ((int)mlp->ml_size != itdp->t_intr->intr_nbits) { parse_debug(4, cp, "making %d bit intrinsic " "from %s", mlp->ml_size, tdesc_name(itdp)); mlp->ml_type = bitintrinsic(itdp, mlp->ml_size); @@ -1173,7 +1173,7 @@ resolve_typed_bitfields_cb(void *arg, vo while (tdp) { switch (tdp->t_type) { case INTRINSIC: - if (ml->ml_size != tdp->t_intr->intr_nbits) { + if ((int)ml->ml_size != tdp->t_intr->intr_nbits) { debug(3, "making %d bit intrinsic from %s", ml->ml_size, tdesc_name(tdp)); ml->ml_type = bitintrinsic(tdp, ml->ml_size); From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 02:00:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 351FE201; Fri, 26 Jul 2013 02:00:08 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 096992BC5; Fri, 26 Jul 2013 02:00:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6Q207eP015228; Fri, 26 Jul 2013 02:00:07 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6Q207cB015223; Fri, 26 Jul 2013 02:00:07 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201307260200.r6Q207cB015223@svn.freebsd.org> From: Andrey Zonov Date: Fri, 26 Jul 2013 02:00:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253662 - in head: lib/libc/gen sys/vm tools/tools/sysdoc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 02:00:08 -0000 Author: zont Date: Fri Jul 26 02:00:06 2013 New Revision: 253662 URL: http://svnweb.freebsd.org/changeset/base/253662 Log: Remove define and documentation for vm_pageout_algorithm missed in r253587 Modified: head/lib/libc/gen/sysctl.3 head/sys/vm/vm_param.h head/tools/tools/sysdoc/tunables.mdoc Modified: head/lib/libc/gen/sysctl.3 ============================================================================== --- head/lib/libc/gen/sysctl.3 Fri Jul 26 00:28:19 2013 (r253661) +++ head/lib/libc/gen/sysctl.3 Fri Jul 26 02:00:06 2013 (r253662) @@ -735,7 +735,6 @@ privilege may change the value. .It Sy "Second level name Type Changeable" .It "VM_LOADAVG struct loadavg no" .It "VM_TOTAL struct vmtotal no" -.It "VM_PAGEOUT_ALGORITHM integer yes" .It "VM_SWAPPING_ENABLED integer maybe" .It "VM_V_CACHE_MAX integer yes" .It "VM_V_CACHE_MIN integer yes" @@ -754,9 +753,6 @@ The returned data consists of a Return the system wide virtual memory statistics. The returned data consists of a .Va struct vmtotal . -.It Li VM_PAGEOUT_ALGORITHM -0 if the statistics-based page management algorithm is in use -or 1 if the near-LRU algorithm is in use. .It Li VM_SWAPPING_ENABLED 1 if process swapping is enabled or 0 if disabled. This variable is Modified: head/sys/vm/vm_param.h ============================================================================== --- head/sys/vm/vm_param.h Fri Jul 26 00:28:19 2013 (r253661) +++ head/sys/vm/vm_param.h Fri Jul 26 02:00:06 2013 (r253662) @@ -82,9 +82,8 @@ #define VM_V_CACHE_MIN 7 /* cnt.v_cache_min */ #define VM_V_CACHE_MAX 8 /* cnt.v_cache_max */ #define VM_V_PAGEOUT_FREE_MIN 9 /* cnt.v_pageout_free_min */ -#define VM_PAGEOUT_ALGORITHM 10 /* pageout algorithm */ -#define VM_SWAPPING_ENABLED 11 /* swapping enabled */ -#define VM_MAXID 12 /* number of valid vm ids */ +#define VM_SWAPPING_ENABLED 10 /* swapping enabled */ +#define VM_MAXID 11 /* number of valid vm ids */ #define CTL_VM_NAMES { \ { 0, 0 }, \ @@ -97,7 +96,6 @@ { "v_cache_min", CTLTYPE_UINT }, \ { "v_cache_max", CTLTYPE_UINT }, \ { "v_pageout_free_min", CTLTYPE_UINT}, \ - { "pageout_algorithm", CTLTYPE_INT}, \ { "swap_enabled", CTLTYPE_INT},\ } Modified: head/tools/tools/sysdoc/tunables.mdoc ============================================================================== --- head/tools/tools/sysdoc/tunables.mdoc Fri Jul 26 00:28:19 2013 (r253661) +++ head/tools/tools/sysdoc/tunables.mdoc Fri Jul 26 02:00:06 2013 (r253662) @@ -2259,9 +2259,6 @@ Displays the number of swap devices avai to the system. This is a read-only variable. --- -vm.pageout_algorithm - ---- vm.pageout_full_stats_interval --- From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 07:57:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BAA491F7; Fri, 26 Jul 2013 07:57:10 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 7C70E2AE4; Fri, 26 Jul 2013 07:57:10 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 883A210415EB; Fri, 26 Jul 2013 17:57:04 +1000 (EST) Date: Fri, 26 Jul 2013 17:57:03 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alan Cox Subject: Re: svn commit: r253587 - head/sys/vm In-Reply-To: Message-ID: <20130726171745.S903@besplex.bde.org> References: <201307240125.r6O1PuQG043670@svn.freebsd.org> <51F1A97A.8050405@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=Yos2GeoX c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=k2_y77qti6sA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=AptvzqaXglMA:10 a=6I5d2MoRAAAA:8 a=ICkzG_RQmSd3FELimVYA:9 a=zc2sE1R14Q2WUreY:21 a=rZYTZnQeQprp-bAz:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Andrey Zonov , src-committers@freebsd.org, Jeff Roberson X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 07:57:10 -0000 On Thu, 25 Jul 2013, Alan Cox wrote: > On Jul 25, 2013, at 3:40 PM, Andrey Zonov wrote: > >> On 7/23/13 6:25 PM, Jeff Roberson wrote: >>> Author: jeff >>> Date: Wed Jul 24 01:25:56 2013 >>> New Revision: 253587 >>> URL: http://svnweb.freebsd.org/changeset/base/253587 >>> >>> Log: >>> - Remove the long obsolete 'vm_pageout_algorithm' experiment. >> >> There is more of it. What a nuisance for something to be documented :-). > Thank you. Please commit this. Erm, this breaks the ABI, not only for the removed sysctl but for the one that was moved up into its slot number. >> diff --git a/sys/vm/vm_param.h b/sys/vm/vm_param.h >> index c404989..44306be 100644 >> --- a/sys/vm/vm_param.h >> +++ b/sys/vm/vm_param.h >> @@ -82,9 +82,8 @@ >> #define VM_V_CACHE_MIN 7 /* cnt.v_cache_min */ >> #define VM_V_CACHE_MAX 8 /* cnt.v_cache_max */ >> #define VM_V_PAGEOUT_FREE_MIN 9 /* cnt.v_pageout_free_min */ >> -#define VM_PAGEOUT_ALGORITHM 10 /* pageout algorithm */ >> -#define VM_SWAPPING_ENABLED 11 /* swapping enabled */ >> -#define VM_MAXID 12 /* number of valid vm ids */ >> +#define VM_SWAPPING_ENABLED 10 /* swapping enabled */ >> +#define VM_MAXID 11 /* number of valid vm ids */ The ABI requires slot numbers for a discontinued sysctl to reserved for the same discontinued sysctl forever, so that the much later use of the slot doesn't conflict. This is easy to do for sysctls (unlike for syscalls), since numbered sysctls were a design error so new ones and any later reuse of slot numbers are bugs. The ABI prevents fixing the design error. Closing up the gap gives conflicts immediately for all numbered sysctls after the discontinued one. >> >> #define CTL_VM_NAMES { \ >> { 0, 0 }, \ >> @@ -97,7 +96,6 @@ >> { "v_cache_min", CTLTYPE_UINT }, \ >> { "v_cache_max", CTLTYPE_UINT }, \ >> { "v_pageout_free_min", CTLTYPE_UINT}, \ >> - { "pageout_algorithm", CTLTYPE_INT}, \ >> { "swap_enabled", CTLTYPE_INT},\ >> } CTL_*NAMES is garbage, but if it were used, then its slot numbers would need to be preserved forever too, and its strings for discontinued sysctls should never be removed, so that things like kdump can decode discontinued sysctls. The string list for syscalls supports most discontinued syscalls starting with #11 = obsolete execv = "obs_execv". CTL_*NAMES was actually only used be sysctl(8). It became garbage on 21 Dec 1995. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 09:43:20 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 11F9F78A; Fri, 26 Jul 2013 09:43:20 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D14AB2EE6; Fri, 26 Jul 2013 09:43:19 +0000 (UTC) Received: from [192.168.0.2] (cpc27-cmbg15-2-0-cust235.5-4.cable.virginmedia.com [86.27.188.236]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id r6Q9hEkE046946 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 26 Jul 2013 09:43:15 GMT (envelope-from theraven@FreeBSD.org) Content-Type: multipart/signed; boundary="Apple-Mail=_6230B7AF-8C4C-41E6-88D0-5056E637E1C8"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r253563 - head/contrib/libstdc++/include/c_std From: David Chisnall In-Reply-To: <20130725201948.2f5ae808@kalimero.tijl.coosemans.org> Date: Fri, 26 Jul 2013 10:43:07 +0100 Message-Id: <7D9DA326-0F32-44D2-92F9-EED0751F9AE0@FreeBSD.org> References: <201307231023.r6NANhGf065713@svn.freebsd.org> <20130725201948.2f5ae808@kalimero.tijl.coosemans.org> To: Tijl Coosemans X-Mailer: Apple Mail (2.1508) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 09:43:20 -0000 --Apple-Mail=_6230B7AF-8C4C-41E6-88D0-5056E637E1C8 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 25 Jul 2013, at 19:19, Tijl Coosemans wrote: > This also > broke compilation of C code with -D_XOPEN_SOURCE=500. Do you have a test case for this? David --Apple-Mail=_6230B7AF-8C4C-41E6-88D0-5056E637E1C8 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----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQIcBAEBAgAGBQJR8kSsAAoJEKx65DEEsqId4QsQAL0sE7AoKjOFgxQefJjUMyWp Omd9Fr4xcg6wyKVVYmiS9pIm+LUDqowNjai9w/KXmL/CAqskEIOc55wc/PVMmuLs stFc+uxE2z3wi7yUxyKcgUBYMNvLv/u0o6n2QenVFKgTEtDaoaK2jshFvMpF6xV0 DEnGEvjm51EH3oJIOCeiTCKyRvNWrThrHMY7CQqYlvKg+wib0H7OPc4A2Ys3cXzJ RZtND1mDVs28qQTnImOFi+shlz9vb3A8Kalpa847v3wzuQiWlHy/KfLUvpvHlUFQ xL8R+d29dwNAHNOxNvFoJugXR1ma/4i48qwpiLyJwZT3q+XxmjcW5DNqMzBL0f0v QXh1W556ZIrskY7DophquNLd3z2Z+wfNGp5JT7bfRBWbt9Yxh9F1ofhMD3GLFRGD XdgQvYyc6Q/WVOhRNbu+18iwF8cUkWlvl7IOuDJ2D8WDKzkrbh1QfMtF/JR5fOud yuFT0Zuk3Cl0593zU3x41xa72ldsdIg1u2AiyWrhmhbpdzmqqmBdEe7h5m4MN6xk +jZUEs68sylF/ebIebQJ/rWCI03LB6d4j71kwpWMJ5IsfkYy+cqjVGzxiD7WMyaV dP1kXnk7i3JJhaW9+TaisQQHJ/Fg59URBLhqsDDsaMXb7sG5qxExKYzOr2PLXnV1 L8Sefx8UVX3BCXkg+Zpa =rO75 -----END PGP SIGNATURE----- --Apple-Mail=_6230B7AF-8C4C-41E6-88D0-5056E637E1C8-- From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 09:50:01 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 011EAA48; Fri, 26 Jul 2013 09:50:01 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A51D52F35; Fri, 26 Jul 2013 09:50:00 +0000 (UTC) Received: from [192.168.0.2] (cpc27-cmbg15-2-0-cust235.5-4.cable.virginmedia.com [86.27.188.236]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id r6Q9nrvp046989 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 26 Jul 2013 09:49:54 GMT (envelope-from theraven@FreeBSD.org) Content-Type: multipart/signed; boundary="Apple-Mail=_5D1E1B92-B9CC-42C0-A907-8147FA9433B1"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r253636 - head/sys/vm From: David Chisnall In-Reply-To: Date: Fri, 26 Jul 2013 10:49:47 +0100 Message-Id: <7B55F378-E6E8-4CFA-95DC-4E37A45C48FC@FreeBSD.org> References: <201307250348.r6P3mbsG049595@svn.freebsd.org> <20130725171038.O841@besplex.bde.org> <51F0DDB0.7080102@bitfrost.no> <73FCA347-5EB9-445F-A25C-D06CA137CBEE@FreeBSD.org> To: mdf@FreeBSD.org X-Mailer: Apple Mail (2.1508) Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Tim Kientzle , Bruce Evans , Hans Petter Selasky X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 09:50:01 -0000 --Apple-Mail=_5D1E1B92-B9CC-42C0-A907-8147FA9433B1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 On 25 Jul 2013, at 16:10, mdf@FreeBSD.org wrote: > Isn't that a compiler bug? memset(p, 0, n) is the same as bzero(p, = n). Why would the compiler warn on one and not the other? They are different. memcpy is defined by the C standard. bzero is = defined by POSIX. When you are compiling C code, the compiler is free = to assume behaviour of any C standard functions but not of POSIX = functions because it does not know that you are compiling for a POSIX = target (possibly it should do this if the relevant POSIX macros are = set). =20 As Bruce says, however, the C standard excludes memset() and memcpy() in = freestanding environments (which is a shame, because a lot of = optimisations depend on their existence, and something I had thought was = fixed in C11), so this is not relevant in the kernel. > Does clang have a similar bias for memcpy versus bcopy? Almost certainly. David --Apple-Mail=_5D1E1B92-B9CC-42C0-A907-8147FA9433B1 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----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQIcBAEBAgAGBQJR8kY7AAoJEKx65DEEsqIdtOAP/1UVc5r0JbJ30v+lPvd3Ji8f 7OKZMbmYvMjvDnfSQ8ECcsQ15dPyp2BI+xIMjN+P8nqj63C0xMiA4HnoujjBQ9WB 2uL+xC4KXp3ka4l7cOvpe0W4dndSJtfOF9q9mCHudM4Hdk6g1F2LPpCzaQ/GmEBm aSVl+royEKpRlhGtpAc7SHz95VtgXijFr+u3dh+PTHqCa0YEZz5gDvprmJeDiTYI 2sGQdTxziRM0fpj2FI4iJQMbMEctYdwjYpgGjud0WGyDllQjdjpqkK/PReOvcpb1 jfvr6oLVi8bW3yQYqAXYXLz5l9GKZuZwuKQwjne8uONZ1HNZL68bddaWcAjsEeVV 2kyJjRpUe5y4it58rfENy6rVIedWP8n+tX1lRMyVr8aOAnlCIsHLdD+g2/9KnHNL mAbfrJ78lpPH4XHNW913so4XaGZYjlOMfBq3OFb7mvr/Z4eZ7/6wqcpGHTy+geAD o1RX++20D7NCN4w/0cb0qVL0EAAdCd+KZJlrLkeefTgG4N9KR+w4ZA4HcpYtwFMi 8/j6LHXCC28+CcmD9re8Xbw7plkegXC3ZY+W+00BUUuYeGEvVLp+1U8B4/L6Ax8r i1jkgVBY2VNaaWzHzdgiVNEDqkFZ6TaOepU3ArBb4k35mztj+Yvkt+lFfHz7x0ee IARJymg4fyJ39oxUHEl1 =cTWO -----END PGP SIGNATURE----- --Apple-Mail=_5D1E1B92-B9CC-42C0-A907-8147FA9433B1-- From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 09:58:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B1B58DB4; Fri, 26 Jul 2013 09:58:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9EC3B2F83; Fri, 26 Jul 2013 09:58:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6Q9wuX9074509; Fri, 26 Jul 2013 09:58:56 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6Q9wuk1074508; Fri, 26 Jul 2013 09:58:56 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201307260958.r6Q9wuk1074508@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 26 Jul 2013 09:58:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253670 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 09:58:56 -0000 Author: hselasky Date: Fri Jul 26 09:58:56 2013 New Revision: 253670 URL: http://svnweb.freebsd.org/changeset/base/253670 Log: Assume that all Apple products using interface class 255, subclass 253 and protocol 1 are USB ethernet adapters. This avoids keeping and updating the product list every now and then. This patch will add support for the USB ethernet interface found in the IPAD. MFC after: 1 week Modified: head/sys/dev/usb/net/if_ipheth.c Modified: head/sys/dev/usb/net/if_ipheth.c ============================================================================== --- head/sys/dev/usb/net/if_ipheth.c Fri Jul 26 09:11:38 2013 (r253669) +++ head/sys/dev/usb/net/if_ipheth.c Fri Jul 26 09:58:56 2013 (r253670) @@ -149,6 +149,7 @@ static const struct usb_ether_methods ip USB_IFACE_PROTOCOL(pt) static const STRUCT_USB_HOST_ID ipheth_devs[] = { +#if 0 {IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE, IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, IPHETH_USBINTF_PROTO)}, @@ -167,6 +168,13 @@ static const STRUCT_USB_HOST_ID ipheth_d {IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE_5, IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, IPHETH_USBINTF_PROTO)}, +#else + /* product agnostic interface match */ + {USB_VENDOR(USB_VENDOR_APPLE), + USB_IFACE_CLASS(IPHETH_USBINTF_CLASS), + USB_IFACE_SUBCLASS(IPHETH_USBINTF_SUBCLASS), + USB_IFACE_PROTOCOL(IPHETH_USBINTF_PROTO)}, +#endif }; static int From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 10:25:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F146F40C; Fri, 26 Jul 2013 10:25:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CF6282099; Fri, 26 Jul 2013 10:25:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6QAPIuh083580; Fri, 26 Jul 2013 10:25:18 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6QAPIbl083579; Fri, 26 Jul 2013 10:25:18 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201307261025.r6QAPIbl083579@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 26 Jul 2013 10:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253672 - head/etc/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 10:25:19 -0000 Author: hselasky Date: Fri Jul 26 10:25:18 2013 New Revision: 253672 URL: http://svnweb.freebsd.org/changeset/base/253672 Log: Regenerate usb.conf MFC after: 1 week Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Fri Jul 26 10:22:04 2013 (r253671) +++ head/etc/devd/usb.conf Fri Jul 26 10:25:18 2013 (r253672) @@ -8,72 +8,6 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x05ac"; - match "product" "0x1290"; - match "intclass" "0xff"; - match "intsubclass" "0xfd"; - match "intprotocol" "0x01"; - action "kldload -n if_ipheth"; -}; - -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "host"; - match "vendor" "0x05ac"; - match "product" "0x1292"; - match "intclass" "0xff"; - match "intsubclass" "0xfd"; - match "intprotocol" "0x01"; - action "kldload -n if_ipheth"; -}; - -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "host"; - match "vendor" "0x05ac"; - match "product" "0x1294"; - match "intclass" "0xff"; - match "intsubclass" "0xfd"; - match "intprotocol" "0x01"; - action "kldload -n if_ipheth"; -}; - -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "host"; - match "vendor" "0x05ac"; - match "product" "0x1297"; - match "intclass" "0xff"; - match "intsubclass" "0xfd"; - match "intprotocol" "0x01"; - action "kldload -n if_ipheth"; -}; - -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "host"; - match "vendor" "0x05ac"; - match "product" "0x12a0"; - match "intclass" "0xff"; - match "intsubclass" "0xfd"; - match "intprotocol" "0x01"; - action "kldload -n if_ipheth"; -}; - -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "host"; - match "vendor" "0x05ac"; - match "product" "0x12a8"; - match "intclass" "0xff"; - match "intsubclass" "0xfd"; - match "intprotocol" "0x01"; - action "kldload -n if_ipheth"; -}; - -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "host"; match "vendor" "0x0104"; match "product" "0x00be"; action "kldload -n uipaq"; @@ -2938,6 +2872,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x1004"; + match "product" "0x618f"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x100d"; match "product" "(0x9031|0x9032)"; action "kldload -n if_run"; @@ -4042,6 +3984,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x17ef"; + match "product" "0x7203"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x17f4"; match "product" "0xaaaa"; action "kldload -n uslcom"; @@ -4826,6 +4776,16 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x05ac"; + match "intclass" "0xff"; + match "intsubclass" "0xfd"; + match "intprotocol" "0x01"; + action "kldload -n if_ipheth"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0a5c"; match "intclass" "0xff"; match "intsubclass" "0x01"; @@ -4976,5 +4936,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2480 USB entries processed +# 2477 USB entries processed From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 10:27:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BD49163A; Fri, 26 Jul 2013 10:27:04 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay005.isp.belgacom.be (mailrelay005.isp.belgacom.be [195.238.6.171]) by mx1.freebsd.org (Postfix) with ESMTP id DAC6520AE; Fri, 26 Jul 2013 10:27:03 +0000 (UTC) X-Belgacom-Dynamic: yes X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=XcRPbE/61RViQ18Cyf2UWKT165DesunXni6Typ7x5jA= c=1 sm=2 a=xnulW3ATU38A:10 a=ZxPGInapWdQA:10 a=YqRfAJJkAAAA:8 a=uZvujYp8AAAA:8 a=_PAU7rG3nKefrySOl48A:9 a=CjuIK1q_8ugA:10 a=PvG2Zffer3IA:10 a=UIDpq6-GphUA:10 a=PkNVBHQ7kYMaElKaVUgA:9 a=52ONB197B48A:10 a=79zaizEPLzsA:10 a=AsDod6THfi1vPLdkaJ4A:9 a=0CaTwavtbm8A:10 a=_G8qimlXLBUA:10 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApkGAHdO8lFR8YfH/2dsb2JhbABagwY1gxiqGpBigRUXdIIkAQEFViMQCw4KCSUPKh4GE4gUCLkAjS6CTweEBQOQEodMgSqIeIcrgxY6 Received: from 199.135-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.135.199]) by relay.skynet.be with ESMTP; 26 Jul 2013 12:27:01 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id r6QAR0DZ038395; Fri, 26 Jul 2013 12:27:00 +0200 (CEST) (envelope-from tijl@coosemans.org) Date: Fri, 26 Jul 2013 12:26:54 +0200 From: Tijl Coosemans To: David Chisnall Subject: Re: svn commit: r253563 - head/contrib/libstdc++/include/c_std Message-ID: <20130726122654.19448832@kalimero.tijl.coosemans.org> In-Reply-To: <7D9DA326-0F32-44D2-92F9-EED0751F9AE0@FreeBSD.org> References: <201307231023.r6NANhGf065713@svn.freebsd.org> <20130725201948.2f5ae808@kalimero.tijl.coosemans.org> <7D9DA326-0F32-44D2-92F9-EED0751F9AE0@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA256; boundary="Sig_/r7E=hNkrA_0GDL+DKgKSgXH"; protocol="application/pgp-signature" X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 10:27:04 -0000 --Sig_/r7E=hNkrA_0GDL+DKgKSgXH Content-Type: multipart/mixed; boundary="MP_/0sT8hdRwNYiLTNcS=tosJed" --MP_/0sT8hdRwNYiLTNcS=tosJed Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Fri, 26 Jul 2013 10:43:07 +0100 David Chisnall wrote: > On 25 Jul 2013, at 19:19, Tijl Coosemans wrote: >> This also >> broke compilation of C code with -D_XOPEN_SOURCE=3D500. >=20 > Do you have a test case for this? % cc -c test.c -D_XOPEN_SOURCE=3D500 -Wall -std=3Dgnu89 test.c:5:10: warning: implicit declaration of function 'isnan' [-Wimplicit-function-declaration] return( isnan( d )); ^ 1 warning generated. The isnan function is part of SUSv2: http://pubs.opengroup.org/onlinepubs/7990989775/xsh/isnan.html _XOPEN_SOURCE is handled in sys/cdefs.h. It sets the following macros: #define __XSI_VISIBLE 500 #define __POSIX_VISIBLE 199506 #define __ISO_C_VISIBLE 1990 --MP_/0sT8hdRwNYiLTNcS=tosJed-- --Sig_/r7E=hNkrA_0GDL+DKgKSgXH Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iF4EAREIAAYFAlHyTvMACgkQfoCS2CCgtiu2rQD+PemdXObmxkZLmC6xSzDrEW0T IfHslMljqA2p9QqA97YA/09d2xUzkJrPxyqfc7xavYZPjOs7GCHBBgqtNI7oDdVx =kEnp -----END PGP SIGNATURE----- --Sig_/r7E=hNkrA_0GDL+DKgKSgXH-- From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 10:52:45 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7E80CAD0; Fri, 26 Jul 2013 10:52:45 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3040D2203; Fri, 26 Jul 2013 10:52:44 +0000 (UTC) Received: from [192.168.0.2] (cpc27-cmbg15-2-0-cust235.5-4.cable.virginmedia.com [86.27.188.236]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id r6QAppjh047298 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 26 Jul 2013 10:51:54 GMT (envelope-from theraven@FreeBSD.org) Content-Type: multipart/signed; boundary="Apple-Mail=_307F7165-6576-4650-A30E-01E9F347DD08"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r253563 - head/contrib/libstdc++/include/c_std From: David Chisnall In-Reply-To: <20130726122654.19448832@kalimero.tijl.coosemans.org> Date: Fri, 26 Jul 2013 11:51:43 +0100 Message-Id: References: <201307231023.r6NANhGf065713@svn.freebsd.org> <20130725201948.2f5ae808@kalimero.tijl.coosemans.org> <7D9DA326-0F32-44D2-92F9-EED0751F9AE0@FreeBSD.org> <20130726122654.19448832@kalimero.tijl.coosemans.org> To: Tijl Coosemans X-Mailer: Apple Mail (2.1508) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 10:52:45 -0000 --Apple-Mail=_307F7165-6576-4650-A30E-01E9F347DD08 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 26 Jul 2013, at 11:26, Tijl Coosemans wrote: > On Fri, 26 Jul 2013 10:43:07 +0100 David Chisnall wrote: >> On 25 Jul 2013, at 19:19, Tijl Coosemans wrote: >>> This also >>> broke compilation of C code with -D_XOPEN_SOURCE=3D500. >>=20 >> Do you have a test case for this? >=20 > % cc -c test.c -D_XOPEN_SOURCE=3D500 -Wall -std=3Dgnu89 > test.c:5:10: warning: implicit declaration of function 'isnan' > [-Wimplicit-function-declaration] > return( isnan( d )); > ^ > 1 warning generated. >=20 > The isnan function is part of SUSv2: > http://pubs.opengroup.org/onlinepubs/7990989775/xsh/isnan.html >=20 > _XOPEN_SOURCE is handled in sys/cdefs.h. It sets the following macros: > #define __XSI_VISIBLE 500 > #define __POSIX_VISIBLE 199506 > #define __ISO_C_VISIBLE 1990 So, isnan and isinf should be visible in functions when in = __ISO_C_VISIBLE < 1999 and __XSI_VISIBLE < 600,=20 and __XSI_VISIBLE >=3D 500? David --Apple-Mail=_307F7165-6576-4650-A30E-01E9F347DD08 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----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQIcBAEBAgAGBQJR8lTAAAoJEKx65DEEsqIdFyMQAJhOBfXumc2WG7MhHwFZZhAz 1Ue2dFCvFMQWhG+tI++XrL2B8GyN/Tk2HEbLbohxfMlOEzJmsxWFF92xnOQyZ5kF We2ACKUKRVtsB5SvmudZJWuqhahJSi++95D8D+Tballi08LSugpTSfgCsEV7TfqN AtKYLYd4Ao9F1xZBQ1Mcr0EcayKh40/2QkOSaKgXzWl6obaT40i4tie/EVgvGCJv VGGR1gNkZN1aXAsVJMNh1gIqKgL954Nq2z8pqAGmP+kvy1sdp6KgUIUnxN3hEC8B WjMJKgZijDgM7MXj+iVOhXS0XTtenHB51MxBr/l6GHpkd3Pnc+RwERDXdZHVQW3m 5KfYoYBnYPvnoT5uGTrYKMmboqBVeme4QZek5svEosOtiRnc6pks5KS6e4seXtCw 70oclQj92xxMqYNkiohyctpcpSIMaByn+/+91B8PLPsBzfVsjftopuuFnFNJXmyt 0SWnTnQqHWJN/XShTqSzGxKYiLlFosKKyhJBZESX0CwsfEgCCTHPBvClvv9I6HIB z8CEtJGT+CmR48X95GwgdkHnr7bRzp6uaKK6qhT2ggHviAk9JXGBNFQk5a6VI52w OFbotnMYj3UnqNvrZo9u3ERSQ+8+Ukiwrnmngjp72GEFYYsj02ZWT6AOfpZnmUO5 Hhj26Ipe1e8zX1ZwBWGx =Sh4z -----END PGP SIGNATURE----- --Apple-Mail=_307F7165-6576-4650-A30E-01E9F347DD08-- From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 14:04:45 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 857B3FD2; Fri, 26 Jul 2013 14:04:45 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 45D1E2D12; Fri, 26 Jul 2013 14:04:45 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id A92CB1203C3; Fri, 26 Jul 2013 16:04:28 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 9140A28494; Fri, 26 Jul 2013 16:04:28 +0200 (CEST) Date: Fri, 26 Jul 2013 16:04:28 +0200 From: Jilles Tjoelker To: David Chisnall Subject: Re: svn commit: r253563 - head/contrib/libstdc++/include/c_std Message-ID: <20130726140428.GB14175@stack.nl> References: <201307231023.r6NANhGf065713@svn.freebsd.org> <20130725201948.2f5ae808@kalimero.tijl.coosemans.org> <7D9DA326-0F32-44D2-92F9-EED0751F9AE0@FreeBSD.org> <20130726122654.19448832@kalimero.tijl.coosemans.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, Tijl Coosemans , src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 14:04:45 -0000 On Fri, Jul 26, 2013 at 11:51:43AM +0100, David Chisnall wrote: > On 26 Jul 2013, at 11:26, Tijl Coosemans wrote: > > On Fri, 26 Jul 2013 10:43:07 +0100 David Chisnall wrote: > >> On 25 Jul 2013, at 19:19, Tijl Coosemans wrote: > >>> This also broke compilation of C code with -D_XOPEN_SOURCE=500. > >> Do you have a test case for this? > > % cc -c test.c -D_XOPEN_SOURCE=500 -Wall -std=gnu89 > > test.c:5:10: warning: implicit declaration of function 'isnan' > > [-Wimplicit-function-declaration] > > return( isnan( d )); > > ^ > > 1 warning generated. > > The isnan function is part of SUSv2: > > http://pubs.opengroup.org/onlinepubs/7990989775/xsh/isnan.html > > _XOPEN_SOURCE is handled in sys/cdefs.h. It sets the following macros: > > #define __XSI_VISIBLE 500 > > #define __POSIX_VISIBLE 199506 > > #define __ISO_C_VISIBLE 1990 > So, isnan and isinf should be visible in functions when in > __ISO_C_VISIBLE < 1999 and __XSI_VISIBLE < 600, and __XSI_VISIBLE >= > 500? This is cosmetic, but http://pubs.opengroup.org/onlinepubs/000095399/functions/isnan.html says that isnan() appeared in Issue 3. This is before _XOPEN_SOURCE == 500. A simple solution is to expose it when __XSI_VISIBLE > 0 && __XSI_VISIBLE < 600 && __ISO_C_VISIBLE < 1999. However, has no support for _XOPEN_SOURCE < 500 and there is no point in adding such support now. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 14:22:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B27AE342; Fri, 26 Jul 2013 14:22:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9FF6C2DCB; Fri, 26 Jul 2013 14:22:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6QEM3Vs056755; Fri, 26 Jul 2013 14:22:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6QEM3dp056754; Fri, 26 Jul 2013 14:22:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201307261422.r6QEM3dp056754@svn.freebsd.org> From: Marius Strobl Date: Fri, 26 Jul 2013 14:22:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253675 - head/usr.sbin/makefs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 14:22:03 -0000 Author: marius Date: Fri Jul 26 14:22:03 2013 New Revision: 253675 URL: http://svnweb.freebsd.org/changeset/base/253675 Log: Ensure that makefs.h is included when using ufs_bswap.h so the FFS_EI macro is picked up when defined. Previously, ffs_subr.c was always built without support for opposite endianess as it doesn't include makefs.h on its own. MFC after: 3 days Modified: head/usr.sbin/makefs/ffs/ufs_bswap.h Modified: head/usr.sbin/makefs/ffs/ufs_bswap.h ============================================================================== --- head/usr.sbin/makefs/ffs/ufs_bswap.h Fri Jul 26 11:39:29 2013 (r253674) +++ head/usr.sbin/makefs/ffs/ufs_bswap.h Fri Jul 26 14:22:03 2013 (r253675) @@ -40,6 +40,8 @@ #include +#include "makefs.h" + /* Macros to access UFS flags */ #ifdef FFS_EI #define UFS_MPNEEDSWAP(mp) (VFSTOUFS(mp)->um_flags & UFS_NEEDSWAP) From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 14:23:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 40D435AC; Fri, 26 Jul 2013 14:23:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 150E42DE0; Fri, 26 Jul 2013 14:23:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6QENPIV057045; Fri, 26 Jul 2013 14:23:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6QENPVj057044; Fri, 26 Jul 2013 14:23:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201307261423.r6QENPVj057044@svn.freebsd.org> From: Marius Strobl Date: Fri, 26 Jul 2013 14:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253676 - head/release/sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 14:23:26 -0000 Author: marius Date: Fri Jul 26 14:23:25 2013 New Revision: 253676 URL: http://svnweb.freebsd.org/changeset/base/253676 Log: - Once we have shifted arguments thrice, base-bits-dir is $1 rather than $4. Introduce $BASEBITSDIR for clarity and in order to avoid repeating this mistake in the future. Fixing this ensures that we pick up the newly built boot code and loader native to the target, which is especially relevant when cross-building release images. - It is pointless to specify an endianess for ISO 9660 images so strip that. MFC after: 3 days Modified: head/release/sparc64/mkisoimages.sh Modified: head/release/sparc64/mkisoimages.sh ============================================================================== --- head/release/sparc64/mkisoimages.sh Fri Jul 26 14:22:03 2013 (r253675) +++ head/release/sparc64/mkisoimages.sh Fri Jul 26 14:23:25 2013 (r253676) @@ -32,26 +32,28 @@ case $1 in esac LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift NAME=$1; shift +BASEBITSDIR=$1 # Create an ISO image publisher="The FreeBSD Project. http://www.FreeBSD.org/" -echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab -makefs -t cd9660 -B be -o rockridge -o label="$LABEL" -o publisher="$publisher" ${NAME}.tmp $* -rm $1/etc/fstab +echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "${BASEBITSDIR}/etc/fstab" +makefs -t cd9660 -o rockridge -o label="$LABEL" -o publisher="$publisher" ${NAME}.tmp $* +rm "${BASEBITSDIR}/etc/fstab" if [ "x$BOPT" != "x-b" ]; then mv ${NAME}.tmp ${NAME} exit 0 fi + TMPIMGDIR=`mktemp -d /tmp/bootfs.XXXXXXXX` || exit 1 BOOTFSDIR="${TMPIMGDIR}/bootfs" BOOTFSIMG="${TMPIMGDIR}/bootfs.img" # Create a boot filesystem mkdir -p "${BOOTFSDIR}/boot" -cp $4/boot/loader "${BOOTFSDIR}/boot" +cp -p "${BASEBITSDIR}/boot/loader" "${BOOTFSDIR}/boot" makefs -t ffs -B be -M 512k "${BOOTFSIMG}" "${BOOTFSDIR}" -dd if=$4/boot/boot1 of="${BOOTFSIMG}" bs=512 conv=notrunc,sync +dd if="${BASEBITSDIR}/boot/boot1" of="${BOOTFSIMG}" bs=512 conv=notrunc,sync # Create a boot ISO image : ${CYLSIZE:=640} From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 14:25:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 34FE481B; Fri, 26 Jul 2013 14:25:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 134C22E0E; Fri, 26 Jul 2013 14:25:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6QEPwfp057438; Fri, 26 Jul 2013 14:25:58 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6QEPwft057436; Fri, 26 Jul 2013 14:25:58 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307261425.r6QEPwft057436@svn.freebsd.org> From: Andriy Gapon Date: Fri, 26 Jul 2013 14:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253677 - in head: . sys/fs/devfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 14:25:59 -0000 Author: avg Date: Fri Jul 26 14:25:58 2013 New Revision: 253677 URL: http://svnweb.freebsd.org/changeset/base/253677 Log: make path matching in devfs rules consistent and sane (and safer) Before this change path matching had the following features: - for device nodes the patterns were matched against full path - in the above case '/' in a path could be matched by a wildcard - for directories and links only the last component was matched So, for example, a pattern like 're*' could match the following entries: - re0 device - responder/u0 device - zvol/recpool directory Although it was possible to work around this behavior (once it was spotted and understood), it was very confusing and contrary to documentation. Now we always match a full path for all types of devfs entries (devices, directories, links) and a '/' has to be matched explicitly. This behavior follows the shell globbing rules. This change is originally developed by Jaakko Heinonen. Many thanks! PR: kern/122838 Submitted by: jh MFC after: 4 weeks Modified: head/UPDATING head/sys/fs/devfs/devfs_rule.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Jul 26 14:23:25 2013 (r253676) +++ head/UPDATING Fri Jul 26 14:25:58 2013 (r253677) @@ -64,6 +64,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 even if neither the traced process nor the tracing process had write access to that file. +201306XX: + Behavior of devfs rules path matching has been changed. + Pattern is now always matched against fully qualified devfs + path and slash characters must be explicitly matched by + slashes in pattern (FNM_PATHNAME). Rulesets involving devfs + subdirectories must be reviewed. + 20130615: CVS has been removed from the base system. An exact copy of the code is available from the devel/cvs port. Modified: head/sys/fs/devfs/devfs_rule.c ============================================================================== --- head/sys/fs/devfs/devfs_rule.c Fri Jul 26 14:23:25 2013 (r253676) +++ head/sys/fs/devfs/devfs_rule.c Fri Jul 26 14:25:58 2013 (r253677) @@ -101,7 +101,7 @@ struct devfs_ruleset { static devfs_rid devfs_rid_input(devfs_rid rid, struct devfs_mount *dm); static void devfs_rule_applyde_recursive(struct devfs_krule *dk, - struct devfs_dirent *de); + struct devfs_mount *dm, struct devfs_dirent *de); static void devfs_rule_applydm(struct devfs_krule *dk, struct devfs_mount *dm); static int devfs_rule_autonumber(struct devfs_ruleset *ds, devfs_rnum *rnp); static struct devfs_krule *devfs_rule_byid(devfs_rid rid); @@ -109,13 +109,16 @@ static int devfs_rule_delete(struct dev static struct cdev *devfs_rule_getdev(struct devfs_dirent *de); static int devfs_rule_input(struct devfs_rule *dr, struct devfs_mount *dm); static int devfs_rule_insert(struct devfs_rule *dr); -static int devfs_rule_match(struct devfs_krule *dk, struct devfs_dirent *de); -static int devfs_rule_matchpath(struct devfs_krule *dk, +static int devfs_rule_match(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de); +static int devfs_rule_matchpath(struct devfs_krule *dk, struct devfs_mount *dm, struct devfs_dirent *de); -static void devfs_rule_run(struct devfs_krule *dk, struct devfs_dirent *de, unsigned depth); +static void devfs_rule_run(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de, unsigned depth); static void devfs_ruleset_applyde(struct devfs_ruleset *ds, - struct devfs_dirent *de, unsigned depth); + struct devfs_mount *dm, struct devfs_dirent *de, + unsigned depth); static void devfs_ruleset_applydm(struct devfs_ruleset *ds, struct devfs_mount *dm); static struct devfs_ruleset *devfs_ruleset_bynum(devfs_rsnum rsnum); @@ -146,7 +149,7 @@ devfs_rules_apply(struct devfs_mount *dm sx_slock(&sx_rules); ds = devfs_ruleset_bynum(dm->dm_ruleset); KASSERT(ds != NULL, ("mount-point has NULL ruleset")); - devfs_ruleset_applyde(ds, de, devfs_rule_depth); + devfs_ruleset_applyde(ds, dm, de, devfs_rule_depth); sx_sunlock(&sx_rules); } @@ -337,13 +340,14 @@ devfs_rid_input(devfs_rid rid, struct de * XXX: a linear search could be done through the cdev list instead. */ static void -devfs_rule_applyde_recursive(struct devfs_krule *dk, struct devfs_dirent *de) +devfs_rule_applyde_recursive(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de) { struct devfs_dirent *de2; TAILQ_FOREACH(de2, &de->de_dlist, de_list) - devfs_rule_applyde_recursive(dk, de2); - devfs_rule_run(dk, de, devfs_rule_depth); + devfs_rule_applyde_recursive(dk, dm, de2); + devfs_rule_run(dk, dm, de, devfs_rule_depth); } /* @@ -353,7 +357,7 @@ static void devfs_rule_applydm(struct devfs_krule *dk, struct devfs_mount *dm) { - devfs_rule_applyde_recursive(dk, dm->dm_rootdir); + devfs_rule_applyde_recursive(dk, dm, dm->dm_rootdir); } /* @@ -525,7 +529,8 @@ devfs_rule_insert(struct devfs_rule *dr) * de; 0, otherwise. */ static int -devfs_rule_match(struct devfs_krule *dk, struct devfs_dirent *de) +devfs_rule_match(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de) { struct devfs_rule *dr = &dk->dk_rule; struct cdev *dev; @@ -558,7 +563,7 @@ devfs_rule_match(struct devfs_krule *dk, dev_relthread(dev, ref); } if (dr->dr_icond & DRC_PATHPTRN) - if (!devfs_rule_matchpath(dk, de)) + if (!devfs_rule_matchpath(dk, dm, de)) return (0); return (1); @@ -568,35 +573,43 @@ devfs_rule_match(struct devfs_krule *dk, * Determine whether dk matches de on account of dr_pathptrn. */ static int -devfs_rule_matchpath(struct devfs_krule *dk, struct devfs_dirent *de) +devfs_rule_matchpath(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de) { struct devfs_rule *dr = &dk->dk_rule; - char *pname; struct cdev *dev; + int match; + char *pname, *specname; + specname = NULL; dev = devfs_rule_getdev(de); if (dev != NULL) pname = dev->si_name; else if (de->de_dirent->d_type == DT_LNK || - de->de_dirent->d_type == DT_DIR) - pname = de->de_dirent->d_name; - else + (de->de_dirent->d_type == DT_DIR && de != dm->dm_rootdir && + (de->de_flags & (DE_DOT | DE_DOTDOT)) == 0)) { + specname = malloc(SPECNAMELEN + 1, M_TEMP, M_WAITOK); + pname = devfs_fqpn(specname, dm, de, NULL); + } else return (0); - KASSERT(pname != NULL, ("devfs_rule_matchpath: NULL pname")); - return (fnmatch(dr->dr_pathptrn, pname, 0) == 0); + KASSERT(pname != NULL, ("devfs_rule_matchpath: NULL pname")); + match = fnmatch(dr->dr_pathptrn, pname, FNM_PATHNAME) == 0; + free(specname, M_TEMP); + return (match); } /* * Run dk on de. */ static void -devfs_rule_run(struct devfs_krule *dk, struct devfs_dirent *de, unsigned depth) +devfs_rule_run(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de, unsigned depth) { struct devfs_rule *dr = &dk->dk_rule; struct devfs_ruleset *ds; - if (!devfs_rule_match(dk, de)) + if (!devfs_rule_match(dk, dm, de)) return; if (dr->dr_iacts & DRA_BACTS) { if (dr->dr_bacts & DRB_HIDE) @@ -623,7 +636,7 @@ devfs_rule_run(struct devfs_krule *dk, s if (depth > 0) { ds = devfs_ruleset_bynum(dk->dk_rule.dr_incset); KASSERT(ds != NULL, ("DRA_INCSET but bad dr_incset")); - devfs_ruleset_applyde(ds, de, depth - 1); + devfs_ruleset_applyde(ds, dm, de, depth - 1); } } } @@ -632,12 +645,13 @@ devfs_rule_run(struct devfs_krule *dk, s * Apply all the rules in ds to de. */ static void -devfs_ruleset_applyde(struct devfs_ruleset *ds, struct devfs_dirent *de, unsigned depth) +devfs_ruleset_applyde(struct devfs_ruleset *ds, struct devfs_mount *dm, + struct devfs_dirent *de, unsigned depth) { struct devfs_krule *dk; TAILQ_FOREACH(dk, &ds->ds_rules, dk_list) - devfs_rule_run(dk, de, depth); + devfs_rule_run(dk, dm, de, depth); } /* From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 14:37:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A6C1FE73; Fri, 26 Jul 2013 14:37:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 93A2E2EA1; Fri, 26 Jul 2013 14:37:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6QEbN7I060857; Fri, 26 Jul 2013 14:37:23 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6QEbNAw060856; Fri, 26 Jul 2013 14:37:23 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307261437.r6QEbNAw060856@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 26 Jul 2013 14:37:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253678 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 14:37:23 -0000 Author: pfg Date: Fri Jul 26 14:37:23 2013 New Revision: 253678 URL: http://svnweb.freebsd.org/changeset/base/253678 Log: Style issue in r253661. Pointed out by: avg MFC after: 1 month Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c Fri Jul 26 14:25:58 2013 (r253677) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c Fri Jul 26 14:37:23 2013 (r253678) @@ -52,7 +52,7 @@ static char *curfile; #define CTF_BUF_CHUNK_SIZE (64 * 1024) #define RES_BUF_CHUNK_SIZE (64 * 1024) -static int ntypes=0; /* The number of types. */ +static int ntypes = 0; /* The number of types. */ struct ctf_buf { strtab_t ctb_strtab; /* string table */ From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 14:43:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8F6763B7; Fri, 26 Jul 2013 14:43:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7CF7B2F18; Fri, 26 Jul 2013 14:43:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6QEhcVS063386; Fri, 26 Jul 2013 14:43:38 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6QEhc94063385; Fri, 26 Jul 2013 14:43:38 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307261443.r6QEhc94063385@svn.freebsd.org> From: Andriy Gapon Date: Fri, 26 Jul 2013 14:43:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253679 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 14:43:38 -0000 Author: avg Date: Fri Jul 26 14:43:38 2013 New Revision: 253679 URL: http://svnweb.freebsd.org/changeset/base/253679 Log: fix UPDATING entry in r253677 MFC after: 3 weeks X-MFC with: r253677 Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Jul 26 14:37:23 2013 (r253678) +++ head/UPDATING Fri Jul 26 14:43:38 2013 (r253679) @@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130726: + Behavior of devfs rules path matching has been changed. + Pattern is now always matched against fully qualified devfs + path and slash characters must be explicitly matched by + slashes in pattern (FNM_PATHNAME). Rulesets involving devfs + subdirectories must be reviewed. + 20130716: The default ARM ABI has changed to the ARM EABI. The old ABI is incompatible with the ARM EABI and all programs and modules will @@ -64,13 +71,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 even if neither the traced process nor the tracing process had write access to that file. -201306XX: - Behavior of devfs rules path matching has been changed. - Pattern is now always matched against fully qualified devfs - path and slash characters must be explicitly matched by - slashes in pattern (FNM_PATHNAME). Rulesets involving devfs - subdirectories must be reviewed. - 20130615: CVS has been removed from the base system. An exact copy of the code is available from the devel/cvs port. From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 15:10:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CA0AC27A; Fri, 26 Jul 2013 15:10:05 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8F9BA20D5; Fri, 26 Jul 2013 15:10:05 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 89EC01203CB; Fri, 26 Jul 2013 17:09:49 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 7269E28494; Fri, 26 Jul 2013 17:09:49 +0200 (CEST) Date: Fri, 26 Jul 2013 17:09:49 +0200 From: Jilles Tjoelker To: Andrey Zonov Subject: Re: svn commit: r253662 - in head: lib/libc/gen sys/vm tools/tools/sysdoc Message-ID: <20130726150949.GC14175@stack.nl> References: <201307260200.r6Q207cB015223@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201307260200.r6Q207cB015223@svn.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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 15:10:05 -0000 On Fri, Jul 26, 2013 at 02:00:07AM +0000, Andrey Zonov wrote: > Author: zont > Date: Fri Jul 26 02:00:06 2013 > New Revision: 253662 > URL: http://svnweb.freebsd.org/changeset/base/253662 > Log: > Remove define and documentation for vm_pageout_algorithm missed in r253587 > Modified: > head/lib/libc/gen/sysctl.3 > head/sys/vm/vm_param.h > head/tools/tools/sysdoc/tunables.mdoc > Modified: head/sys/vm/vm_param.h > ============================================================================== > --- head/sys/vm/vm_param.h Fri Jul 26 00:28:19 2013 (r253661) > +++ head/sys/vm/vm_param.h Fri Jul 26 02:00:06 2013 (r253662) > @@ -82,9 +82,8 @@ > #define VM_V_CACHE_MIN 7 /* cnt.v_cache_min */ > #define VM_V_CACHE_MAX 8 /* cnt.v_cache_max */ > #define VM_V_PAGEOUT_FREE_MIN 9 /* cnt.v_pageout_free_min */ > -#define VM_PAGEOUT_ALGORITHM 10 /* pageout algorithm */ > -#define VM_SWAPPING_ENABLED 11 /* swapping enabled */ > -#define VM_MAXID 12 /* number of valid vm ids */ > +#define VM_SWAPPING_ENABLED 10 /* swapping enabled */ > +#define VM_MAXID 11 /* number of valid vm ids */ As noted in mail from Bruce Evans, please preserve the ABI of VM_SWAPPING_ENABLED here. > #define CTL_VM_NAMES { \ > { 0, 0 }, \ > @@ -97,7 +96,6 @@ > { "v_cache_min", CTLTYPE_UINT }, \ > { "v_cache_max", CTLTYPE_UINT }, \ > { "v_pageout_free_min", CTLTYPE_UINT}, \ > - { "pageout_algorithm", CTLTYPE_INT}, \ > { "swap_enabled", CTLTYPE_INT},\ > } This should be replaced with some sort of dummy rather than replaced entirely (does not matter very much because it should not be used). -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 15:53:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DE93C88F; Fri, 26 Jul 2013 15:53:44 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CA1AF2387; Fri, 26 Jul 2013 15:53:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6QFriv5084675; Fri, 26 Jul 2013 15:53:44 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6QFrhwu084667; Fri, 26 Jul 2013 15:53:43 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201307261553.r6QFrhwu084667@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Fri, 26 Jul 2013 15:53:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253680 - in head: lib/libfetch usr.bin/fetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 15:53:44 -0000 Author: des Date: Fri Jul 26 15:53:43 2013 New Revision: 253680 URL: http://svnweb.freebsd.org/changeset/base/253680 Log: Implement certificate verification, and many other SSL-related imrovements; complete details in the PR. PR: kern/175514 Submitted by: Michael Gmelin MFC after: 1 week Modified: head/lib/libfetch/common.c head/lib/libfetch/common.h head/lib/libfetch/fetch.3 head/lib/libfetch/http.c head/usr.bin/fetch/fetch.1 head/usr.bin/fetch/fetch.c Modified: head/lib/libfetch/common.c ============================================================================== --- head/lib/libfetch/common.c Fri Jul 26 14:43:38 2013 (r253679) +++ head/lib/libfetch/common.c Fri Jul 26 15:53:43 2013 (r253680) @@ -1,5 +1,6 @@ /*- * Copyright (c) 1998-2011 Dag-Erling Smørgrav + * Copyright (c) 2013 Michael Gmelin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -47,6 +48,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef WITH_SSL +#include +#endif + #include "fetch.h" #include "common.h" @@ -317,15 +322,488 @@ fetch_connect(const char *host, int port return (conn); } +#ifdef WITH_SSL +/* + * Convert characters A-Z to lowercase (intentionally avoid any locale + * specific conversions). + */ +static char +fetch_ssl_tolower(char in) +{ + if (in >= 'A' && in <= 'Z') + return (in + 32); + else + return (in); +} + +/* + * isalpha implementation that intentionally avoids any locale specific + * conversions. + */ +static int +fetch_ssl_isalpha(char in) +{ + return ((in >= 'A' && in <= 'Z') || (in >= 'a' && in <= 'z')); +} + +/* + * Check if passed hostnames a and b are equal. + */ +static int +fetch_ssl_hname_equal(const char *a, size_t alen, const char *b, + size_t blen) +{ + size_t i; + + if (alen != blen) + return (0); + for (i = 0; i < alen; ++i) { + if (fetch_ssl_tolower(a[i]) != fetch_ssl_tolower(b[i])) + return (0); + } + return (1); +} + +/* + * Check if domain label is traditional, meaning that only A-Z, a-z, 0-9 + * and '-' (hyphen) are allowed. Hyphens have to be surrounded by alpha- + * numeric characters. Double hyphens (like they're found in IDN a-labels + * 'xn--') are not allowed. Empty labels are invalid. + */ +static int +fetch_ssl_is_trad_domain_label(const char *l, size_t len, int wcok) +{ + size_t i; + + if (!len || l[0] == '-' || l[len-1] == '-') + return (0); + for (i = 0; i < len; ++i) { + if (!isdigit(l[i]) && + !fetch_ssl_isalpha(l[i]) && + !(l[i] == '*' && wcok) && + !(l[i] == '-' && l[i - 1] != '-')) + return (0); + } + return (1); +} + +/* + * Check if host name consists only of numbers. This might indicate an IP + * address, which is not a good idea for CN wildcard comparison. + */ +static int +fetch_ssl_hname_is_only_numbers(const char *hostname, size_t len) +{ + size_t i; + + for (i = 0; i < len; ++i) { + if (!((hostname[i] >= '0' && hostname[i] <= '9') || + hostname[i] == '.')) + return (0); + } + return (1); +} + +/* + * Check if the host name h passed matches the pattern passed in m which + * is usually part of subjectAltName or CN of a certificate presented to + * the client. This includes wildcard matching. The algorithm is based on + * RFC6125, sections 6.4.3 and 7.2, which clarifies RFC2818 and RFC3280. + */ +static int +fetch_ssl_hname_match(const char *h, size_t hlen, const char *m, + size_t mlen) +{ + int delta, hdotidx, mdot1idx, wcidx; + const char *hdot, *mdot1, *mdot2; + const char *wc; /* wildcard */ + + if (!(h && *h && m && *m)) + return (0); + if ((wc = strnstr(m, "*", mlen)) == NULL) + return (fetch_ssl_hname_equal(h, hlen, m, mlen)); + wcidx = wc - m; + /* hostname should not be just dots and numbers */ + if (fetch_ssl_hname_is_only_numbers(h, hlen)) + return (0); + /* only one wildcard allowed in pattern */ + if (strnstr(wc + 1, "*", mlen - wcidx - 1) != NULL) + return (0); + /* + * there must be at least two more domain labels and + * wildcard has to be in the leftmost label (RFC6125) + */ + mdot1 = strnstr(m, ".", mlen); + if (mdot1 == NULL || mdot1 < wc || (mlen - (mdot1 - m)) < 4) + return (0); + mdot1idx = mdot1 - m; + mdot2 = strnstr(mdot1 + 1, ".", mlen - mdot1idx - 1); + if (mdot2 == NULL || (mlen - (mdot2 - m)) < 2) + return (0); + /* hostname must contain a dot and not be the 1st char */ + hdot = strnstr(h, ".", hlen); + if (hdot == NULL || hdot == h) + return (0); + hdotidx = hdot - h; + /* + * host part of hostname must be at least as long as + * pattern it's supposed to match + */ + if (hdotidx < mdot1idx) + return (0); + /* + * don't allow wildcards in non-traditional domain names + * (IDN, A-label, U-label...) + */ + if (!fetch_ssl_is_trad_domain_label(h, hdotidx, 0) || + !fetch_ssl_is_trad_domain_label(m, mdot1idx, 1)) + return (0); + /* match domain part (part after first dot) */ + if (!fetch_ssl_hname_equal(hdot, hlen - hdotidx, mdot1, + mlen - mdot1idx)) + return (0); + /* match part left of wildcard */ + if (!fetch_ssl_hname_equal(h, wcidx, m, wcidx)) + return (0); + /* match part right of wildcard */ + delta = mdot1idx - wcidx - 1; + if (!fetch_ssl_hname_equal(hdot - delta, delta, + mdot1 - delta, delta)) + return (0); + /* all tests succeded, it's a match */ + return (1); +} + +/* + * Get numeric host address info - returns NULL if host was not an IP + * address. The caller is responsible for deallocation using + * freeaddrinfo(3). + */ +static struct addrinfo * +fetch_ssl_get_numeric_addrinfo(const char *hostname, size_t len) +{ + struct addrinfo hints, *res; + char *host; + + host = (char *)malloc(len + 1); + memcpy(host, hostname, len); + host[len] = '\0'; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = 0; + hints.ai_flags = AI_NUMERICHOST; + /* port is not relevant for this purpose */ + getaddrinfo(host, "443", &hints, &res); + free(host); + return res; +} + +/* + * Compare ip address in addrinfo with address passes. + */ +static int +fetch_ssl_ipaddr_match_bin(const struct addrinfo *lhost, const char *rhost, + size_t rhostlen) +{ + const void *left; + + if (lhost->ai_family == AF_INET && rhostlen == 4) { + left = (void *)&((struct sockaddr_in*)(void *) + lhost->ai_addr)->sin_addr.s_addr; +#ifdef INET6 + } else if (lhost->ai_family == AF_INET6 && rhostlen == 16) { + left = (void *)&((struct sockaddr_in6 *)(void *) + lhost->ai_addr)->sin6_addr; +#endif + } else + return (0); + return (!memcmp(left, (const void *)rhost, rhostlen) ? 1 : 0); +} + +/* + * Compare ip address in addrinfo with host passed. If host is not an IP + * address, comparison will fail. + */ +static int +fetch_ssl_ipaddr_match(const struct addrinfo *laddr, const char *r, + size_t rlen) +{ + struct addrinfo *raddr; + int ret; + char *rip; + + ret = 0; + if ((raddr = fetch_ssl_get_numeric_addrinfo(r, rlen)) == NULL) + return 0; /* not a numeric host */ + + if (laddr->ai_family == raddr->ai_family) { + if (laddr->ai_family == AF_INET) { + rip = (char *)&((struct sockaddr_in *)(void *) + raddr->ai_addr)->sin_addr.s_addr; + ret = fetch_ssl_ipaddr_match_bin(laddr, rip, 4); +#ifdef INET6 + } else if (laddr->ai_family == AF_INET6) { + rip = (char *)&((struct sockaddr_in6 *)(void *) + raddr->ai_addr)->sin6_addr; + ret = fetch_ssl_ipaddr_match_bin(laddr, rip, 16); +#endif + } + + } + freeaddrinfo(raddr); + return (ret); +} + +/* + * Verify server certificate by subjectAltName. + */ +static int +fetch_ssl_verify_altname(STACK_OF(GENERAL_NAME) *altnames, + const char *host, struct addrinfo *ip) +{ + const GENERAL_NAME *name; + size_t nslen; + int i; + const char *ns; + + for (i = 0; i < sk_GENERAL_NAME_num(altnames); ++i) { +#if OPENSSL_VERSION_NUMBER < 0x10000000L + /* + * This is a workaround, since the following line causes + * alignment issues in clang: + * name = sk_GENERAL_NAME_value(altnames, i); + * OpenSSL explicitly warns not to use those macros + * directly, but there isn't much choice (and there + * shouldn't be any ill side effects) + */ + name = (GENERAL_NAME *)SKM_sk_value(void, altnames, i); +#else + name = sk_GENERAL_NAME_value(altnames, i); +#endif + ns = (const char *)ASN1_STRING_data(name->d.ia5); + nslen = (size_t)ASN1_STRING_length(name->d.ia5); + + if (name->type == GEN_DNS && ip == NULL && + fetch_ssl_hname_match(host, strlen(host), ns, nslen)) + return (1); + else if (name->type == GEN_IPADD && ip != NULL && + fetch_ssl_ipaddr_match_bin(ip, ns, nslen)) + return (1); + } + return (0); +} + +/* + * Verify server certificate by CN. + */ +static int +fetch_ssl_verify_cn(X509_NAME *subject, const char *host, + struct addrinfo *ip) +{ + ASN1_STRING *namedata; + X509_NAME_ENTRY *nameentry; + int cnlen, lastpos, loc, ret; + unsigned char *cn; + + ret = 0; + lastpos = -1; + loc = -1; + cn = NULL; + /* get most specific CN (last entry in list) and compare */ + while ((lastpos = X509_NAME_get_index_by_NID(subject, + NID_commonName, lastpos)) != -1) + loc = lastpos; + + if (loc > -1) { + nameentry = X509_NAME_get_entry(subject, loc); + namedata = X509_NAME_ENTRY_get_data(nameentry); + cnlen = ASN1_STRING_to_UTF8(&cn, namedata); + if (ip == NULL && + fetch_ssl_hname_match(host, strlen(host), cn, cnlen)) + ret = 1; + else if (ip != NULL && fetch_ssl_ipaddr_match(ip, cn, cnlen)) + ret = 1; + OPENSSL_free(cn); + } + return (ret); +} + +/* + * Verify that server certificate subjectAltName/CN matches + * hostname. First check, if there are alternative subject names. If yes, + * those have to match. Only if those don't exist it falls back to + * checking the subject's CN. + */ +static int +fetch_ssl_verify_hname(X509 *cert, const char *host) +{ + struct addrinfo *ip; + STACK_OF(GENERAL_NAME) *altnames; + X509_NAME *subject; + int ret; + + ret = 0; + ip = fetch_ssl_get_numeric_addrinfo(host, strlen(host)); + altnames = X509_get_ext_d2i(cert, NID_subject_alt_name, + NULL, NULL); + + if (altnames != NULL) { + ret = fetch_ssl_verify_altname(altnames, host, ip); + } else { + subject = X509_get_subject_name(cert); + if (subject != NULL) + ret = fetch_ssl_verify_cn(subject, host, ip); + } + + if (ip != NULL) + freeaddrinfo(ip); + if (altnames != NULL) + GENERAL_NAMES_free(altnames); + return (ret); +} + +/* + * Configure transport security layer based on environment. + */ +static void +fetch_ssl_setup_transport_layer(SSL_CTX *ctx, int verbose) +{ + long ssl_ctx_options; + + ssl_ctx_options = SSL_OP_ALL | SSL_OP_NO_TICKET; + if (getenv("SSL_ALLOW_SSL2") == NULL) + ssl_ctx_options |= SSL_OP_NO_SSLv2; + if (getenv("SSL_NO_SSL3") != NULL) + ssl_ctx_options |= SSL_OP_NO_SSLv3; + if (getenv("SSL_NO_TLS1") != NULL) + ssl_ctx_options |= SSL_OP_NO_TLSv1; + if (verbose) + fetch_info("SSL options: %x", ssl_ctx_options); + SSL_CTX_set_options(ctx, ssl_ctx_options); +} + + +/* + * Configure peer verification based on environment. + */ +static int +fetch_ssl_setup_peer_verification(SSL_CTX *ctx, int verbose) +{ + X509_LOOKUP *crl_lookup; + X509_STORE *crl_store; + const char *ca_cert_file, *ca_cert_path, *crl_file; + + if (getenv("SSL_NO_VERIFY_PEER") == NULL) { + ca_cert_file = getenv("SSL_CA_CERT_FILE") != NULL ? + getenv("SSL_CA_CERT_FILE") : "/etc/ssl/cert.pem"; + ca_cert_path = getenv("SSL_CA_CERT_PATH"); + if (verbose) { + fetch_info("Peer verification enabled"); + if (ca_cert_file != NULL) + fetch_info("Using CA cert file: %s", + ca_cert_file); + if (ca_cert_path != NULL) + fetch_info("Using CA cert path: %s", + ca_cert_path); + } + SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, + fetch_ssl_cb_verify_crt); + SSL_CTX_load_verify_locations(ctx, ca_cert_file, + ca_cert_path); + if ((crl_file = getenv("SSL_CRL_FILE")) != NULL) { + if (verbose) + fetch_info("Using CRL file: %s", crl_file); + crl_store = SSL_CTX_get_cert_store(ctx); + crl_lookup = X509_STORE_add_lookup(crl_store, + X509_LOOKUP_file()); + if (crl_lookup == NULL || + !X509_load_crl_file(crl_lookup, crl_file, + X509_FILETYPE_PEM)) { + fprintf(stderr, + "Could not load CRL file %s\n", + crl_file); + return (0); + } + X509_STORE_set_flags(crl_store, + X509_V_FLAG_CRL_CHECK | + X509_V_FLAG_CRL_CHECK_ALL); + } + } + return (1); +} + +/* + * Configure client certificate based on environment. + */ +static int +fetch_ssl_setup_client_certificate(SSL_CTX *ctx, int verbose) +{ + const char *client_cert_file, *client_key_file; + + if ((client_cert_file = getenv("SSL_CLIENT_CERT_FILE")) != NULL) { + client_key_file = getenv("SSL_CLIENT_KEY_FILE") != NULL ? + getenv("SSL_CLIENT_KEY_FILE") : client_cert_file; + if (verbose) { + fetch_info("Using client cert file: %s", + client_cert_file); + fetch_info("Using client key file: %s", + client_key_file); + } + if (SSL_CTX_use_certificate_chain_file(ctx, + client_cert_file) != 1) { + fprintf(stderr, + "Could not load client certificate %s\n", + client_cert_file); + return (0); + } + if (SSL_CTX_use_PrivateKey_file(ctx, client_key_file, + SSL_FILETYPE_PEM) != 1) { + fprintf(stderr, + "Could not load client key %s\n", + client_key_file); + return (0); + } + } + return (1); +} + +/* + * Callback for SSL certificate verification, this is called on server + * cert verification. It takes no decision, but informs the user in case + * verification failed. + */ +int +fetch_ssl_cb_verify_crt(int verified, X509_STORE_CTX *ctx) +{ + X509 *crt; + X509_NAME *name; + char *str; + + str = NULL; + if (!verified) { + if ((crt = X509_STORE_CTX_get_current_cert(ctx)) != NULL && + (name = X509_get_subject_name(crt)) != NULL) + str = X509_NAME_oneline(name, 0, 0); + fprintf(stderr, "Certificate verification failed for %s\n", + str != NULL ? str : "no relevant certificate"); + OPENSSL_free(str); + } + return (verified); +} + +#endif /* * Enable SSL on a connection. */ int -fetch_ssl(conn_t *conn, int verbose) +fetch_ssl(conn_t *conn, const struct url *URL, int verbose) { #ifdef WITH_SSL int ret, ssl_err; + X509_NAME *name; + char *str; /* Init the SSL library and context */ if (!SSL_library_init()){ @@ -339,8 +817,14 @@ fetch_ssl(conn_t *conn, int verbose) conn->ssl_ctx = SSL_CTX_new(conn->ssl_meth); SSL_CTX_set_mode(conn->ssl_ctx, SSL_MODE_AUTO_RETRY); + fetch_ssl_setup_transport_layer(conn->ssl_ctx, verbose); + if (!fetch_ssl_setup_peer_verification(conn->ssl_ctx, verbose)) + return (-1); + if (!fetch_ssl_setup_client_certificate(conn->ssl_ctx, verbose)) + return (-1); + conn->ssl = SSL_new(conn->ssl_ctx); - if (conn->ssl == NULL){ + if (conn->ssl == NULL) { fprintf(stderr, "SSL context creation failed\n"); return (-1); } @@ -353,22 +837,35 @@ fetch_ssl(conn_t *conn, int verbose) return (-1); } } + conn->ssl_cert = SSL_get_peer_certificate(conn->ssl); - if (verbose) { - X509_NAME *name; - char *str; + if (conn->ssl_cert == NULL) { + fprintf(stderr, "No server SSL certificate\n"); + return (-1); + } - fprintf(stderr, "SSL connection established using %s\n", + if (getenv("SSL_NO_VERIFY_HOSTNAME") == NULL) { + if (verbose) + fetch_info("Verify hostname"); + if (!fetch_ssl_verify_hname(conn->ssl_cert, URL->host)) { + fprintf(stderr, + "SSL certificate subject doesn't match host %s\n", + URL->host); + return (-1); + } + } + + if (verbose) { + fetch_info("SSL connection established using %s", SSL_get_cipher(conn->ssl)); - conn->ssl_cert = SSL_get_peer_certificate(conn->ssl); name = X509_get_subject_name(conn->ssl_cert); str = X509_NAME_oneline(name, 0, 0); - printf("Certificate subject: %s\n", str); - free(str); + fetch_info("Certificate subject: %s", str); + OPENSSL_free(str); name = X509_get_issuer_name(conn->ssl_cert); str = X509_NAME_oneline(name, 0, 0); - printf("Certificate issuer: %s\n", str); - free(str); + fetch_info("Certificate issuer: %s", str); + OPENSSL_free(str); } return (0); @@ -726,6 +1223,22 @@ fetch_close(conn_t *conn) if (--conn->ref > 0) return (0); +#ifdef WITH_SSL + if (conn->ssl) { + SSL_shutdown(conn->ssl); + SSL_set_connect_state(conn->ssl); + SSL_free(conn->ssl); + conn->ssl = NULL; + } + if (conn->ssl_ctx) { + SSL_CTX_free(conn->ssl_ctx); + conn->ssl_ctx = NULL; + } + if (conn->ssl_cert) { + X509_free(conn->ssl_cert); + conn->ssl_cert = NULL; + } +#endif ret = close(conn->sd); free(conn->cache.buf); free(conn->buf); Modified: head/lib/libfetch/common.h ============================================================================== --- head/lib/libfetch/common.h Fri Jul 26 14:43:38 2013 (r253679) +++ head/lib/libfetch/common.h Fri Jul 26 15:53:43 2013 (r253680) @@ -87,7 +87,10 @@ int fetch_bind(int, int, const char *) conn_t *fetch_connect(const char *, int, int, int); conn_t *fetch_reopen(int); conn_t *fetch_ref(conn_t *); -int fetch_ssl(conn_t *, int); +#ifdef WITH_SSL +int fetch_ssl_cb_verify_crt(int, X509_STORE_CTX*); +#endif +int fetch_ssl(conn_t *, const struct url *, int); ssize_t fetch_read(conn_t *, char *, size_t); int fetch_getln(conn_t *); ssize_t fetch_write(conn_t *, const char *, size_t); Modified: head/lib/libfetch/fetch.3 ============================================================================== --- head/lib/libfetch/fetch.3 Fri Jul 26 14:43:38 2013 (r253679) +++ head/lib/libfetch/fetch.3 Fri Jul 26 15:53:43 2013 (r253680) @@ -1,5 +1,6 @@ .\"- .\" Copyright (c) 1998-2011 Dag-Erling Smørgrav +.\" Copyright (c) 2013 Michael Gmelin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 27, 2011 +.Dd January 25, 2013 .Dt FETCH 3 .Os .Sh NAME @@ -392,6 +393,60 @@ method in a manner consistent with the r library, .Fn fetchPutHTTP is currently unimplemented. +.Sh HTTPS SCHEME +Based on HTTP SCHEME. +By default the peer is verified using the CA bundle located in +.Pa /etc/ssl/cert.pem . +The file may contain multiple CA certificates. +A common source of a current CA bundle is +.Pa \%security/ca_root_nss . +.Pp +The CA bundle used for peer verification can be changed by setting the +environment variables +.Ev SSL_CA_CERT_FILE +to point to a concatenated bundle of trusted certificates and +.Ev SSL_CA_CERT_PATH +to point to a directory containing hashes of trusted CAs (see +.Xr verify 1 ) . +.Pp +A certificate revocation list (CRL) can be used by setting the +environment variable +.Ev SSL_CRL_FILE +(see +.Xr crl 1 ) . +.Pp +Peer verification can be disabled by setting the environment variable +.Ev SSL_NO_VERIFY_PEER . +Note that this also disables CRL checking. +.Pp +By default the service identity is verified according to the rules +detailed in RFC6125 (also known as hostname verification). +This feature can be disabled by setting the environment variable +.Ev SSL_NO_VERIFY_HOSTNAME . +.Pp +Client certificate based authentication is supported. +The environment variable +.Ev SSL_CLIENT_CERT_FILE +should be set to point to a file containing key and client certificate +to be used in PEM format. In case the key is stored in a separate +file, the environment variable +.Ev SSL_CLIENT_KEY_FILE +can be set to point to the key in PEM format. +In case the key uses a password, the user will be prompted on standard +input (see +.Xr PEM 3 ) . +.Pp +By default +.Nm libfetch +allows SSLv3 and TLSv1 when negotiating the connecting with the remote +peer. +You can change this behavior by setting the environment variable +.Ev SSL_ALLOW_SSL2 +to allow SSLv2 (not recommended) and +.Ev SSL_NO_SSL3 +or +.Ev SSL_NO_TLS1 +to disable the respective methods. .Sh AUTHENTICATION Apart from setting the appropriate environment variables and specifying the user name and password in the URL or the @@ -579,6 +634,31 @@ which proxies should not be used. Same as .Ev NO_PROXY , for compatibility. +.It Ev SSL_ALLOW_SSL2 +Allow SSL version 2 when negotiating the connection (not recommended). +.It Ev SSL_CA_CERT_FILE +CA certificate bundle containing trusted CA certificates. +Default value: +.Pa /etc/ssl/cert.pem . +.It Ev SSL_CA_CERT_PATH +Path containing trusted CA hashes. +.It Ev SSL_CLIENT_CERT_FILE +PEM encoded client certificate/key which will be used in +client certificate authentication. +.It Ev SSL_CLIENT_KEY_FILE +PEM encoded client key in case key and client certificate +are stored separately. +.It Ev SSL_CRL_FILE +File containing certificate revocation list. +.It Ev SSL_NO_SSL3 +Don't allow SSL version 3 when negotiating the connection. +.It Ev SSL_NO_TLS1 +Don't allow TLV version 1 when negotiating the connection. +.It Ev SSL_NO_VERIFY_HOSTNAME +If set, do not verify that the hostname matches the subject of the +certificate presented by the server. +.It Ev SSL_NO_VERIFY_PEER +If set, do not verify the peer certificate against trusted CAs. .El .Sh EXAMPLES To access a proxy server on @@ -610,6 +690,19 @@ as follows: .Bd -literal -offset indent NO_PROXY=localhost,127.0.0.1 .Ed +.Pp +Access HTTPS website without any certificate verification whatsoever: +.Bd -literal -offset indent +SSL_NO_VERIFY_PEER=1 +SSL_NO_VERIFY_HOSTNAME=1 +.Ed +.Pp +Access HTTPS website using client certificate based authentication +and a private CA: +.Bd -literal -offset indent +SSL_CLIENT_CERT_FILE=/path/to/client.pem +SSL_CA_CERT_FILE=/path/to/myca.pem +.Ed .Sh SEE ALSO .Xr fetch 1 , .Xr ftpio 3 , @@ -678,7 +771,8 @@ with numerous suggestions and contributi .An Hajimu Umemoto Aq ume@FreeBSD.org , .An Henry Whincup Aq henry@techiebod.com , .An Jukka A. Ukkonen Aq jau@iki.fi , -.An Jean-Fran\(,cois Dockes Aq jf@dockes.org +.An Jean-Fran\(,cois Dockes Aq jf@dockes.org , +.An Michael Gmelin Aq freebsd@grem.de and others. It replaces the older .Nm ftpio @@ -688,7 +782,9 @@ and .An Jordan K. Hubbard Aq jkh@FreeBSD.org . .Pp This manual page was written by -.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org . +.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org +and +.An Michael Gmelin Aq freebsd@grem.de . .Sh BUGS Some parts of the library are not yet implemented. The most notable @@ -717,6 +813,10 @@ implemented, superfluous at this site" i .Fn fetchStatFTP does not check that the result of an MDTM command is a valid date. .Pp +In case password protected keys are used for client certificate based +authentication the user is prompted for the password on each and every +fetch operation. +.Pp The man page is incomplete, poorly written and produces badly formatted text. .Pp Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Fri Jul 26 14:43:38 2013 (r253679) +++ head/lib/libfetch/http.c Fri Jul 26 15:53:43 2013 (r253680) @@ -1408,7 +1408,7 @@ http_connect(struct url *URL, struct url http_get_reply(conn); } if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && - fetch_ssl(conn, verbose) == -1) { + fetch_ssl(conn, URL, verbose) == -1) { fetch_close(conn); /* grrr */ errno = EAUTH; Modified: head/usr.bin/fetch/fetch.1 ============================================================================== --- head/usr.bin/fetch/fetch.1 Fri Jul 26 14:43:38 2013 (r253679) +++ head/usr.bin/fetch/fetch.1 Fri Jul 26 15:53:43 2013 (r253680) @@ -38,22 +38,51 @@ .Sh SYNOPSIS .Nm .Op Fl 146AadFlMmnPpqRrsUv +.Op Fl -allow-sslv2 .Op Fl B Ar bytes +.Op Fl -bind-address= Ns Ar host +.Op Fl -ca-cert= Ns Ar file +.Op Fl -ca-path= Ns Ar dir +.Op Fl -cert= Ns Ar file +.Op Fl -crl= Ns Ar file .Op Fl i Ar file +.Op Fl -key= Ns Ar file .Op Fl N Ar file +.Op Fl -no-passive +.Op Fl -no-proxy= Ns Ar list +.Op Fl -no-sslv3 +.Op Fl -no-tlsv1 +.Op Fl -no-verify-hostname +.Op Fl -no-verify-peer .Op Fl o Ar file +.Op Fl -referer= Ns Ar URL .Op Fl S Ar bytes .Op Fl T Ar seconds +.Op Fl -user-agent= Ns Ar agent-string .Op Fl w Ar seconds .Ar URL ... .Nm .Op Fl 146AadFlMmnPpqRrsUv .Op Fl B Ar bytes +.Op Fl -bind-address= Ns Ar host +.Op Fl -ca-cert= Ns Ar file +.Op Fl -ca-path= Ns Ar dir +.Op Fl -cert= Ns Ar file +.Op Fl -crl= Ns Ar file .Op Fl i Ar file +.Op Fl -key= Ns Ar file .Op Fl N Ar file +.Op Fl -no-passive +.Op Fl -no-proxy= Ns Ar list +.Op Fl -no-sslv3 +.Op Fl -no-tlsv1 +.Op Fl -no-verify-hostname +.Op Fl -no-verify-peer .Op Fl o Ar file +.Op Fl -referer= Ns Ar URL .Op Fl S Ar bytes .Op Fl T Ar seconds +.Op Fl -user-agent= Ns Ar agent-string .Op Fl w Ar seconds .Fl h Ar host Fl f Ar file Oo Fl c Ar dir Oc .Sh DESCRIPTION @@ -67,23 +96,26 @@ command line. .Pp The following options are available: .Bl -tag -width Fl -.It Fl 1 +.It Fl 1 , -one-file Stop and return exit code 0 at the first successfully retrieved file. -.It Fl 4 +.It Fl 4 , -ipv4-only Forces .Nm to use IPv4 addresses only. -.It Fl 6 +.It Fl 6 , -ipv6-only Forces .Nm to use IPv6 addresses only. -.It Fl A +.It Fl A , -no-redirect Do not automatically follow ``temporary'' (302) redirects. Some broken Web sites will return a redirect instead of a not-found error when the requested object does not exist. -.It Fl a +.It Fl a , -retry Automatically retry the transfer upon soft failures. -.It Fl B Ar bytes +.It Fl -allow-sslv2 +[SSL] +Allow SSL version 2 when negotiating the connection. +.It Fl B Ar bytes , Fl -buffer-size= Ns Ar bytes Specify the read buffer size in bytes. The default is 4096 bytes. Attempts to set a buffer size lower than this will be silently @@ -92,15 +124,43 @@ The number of reads actually performed i two or higher (see the .Fl v flag). +.It Fl -bind-address= Ns Ar host +Specifies a hostname or IP address to which sockets used for outgoing +connections will be bound. .It Fl c Ar dir The file to retrieve is in directory .Ar dir on the remote host. This option is deprecated and is provided for backward compatibility only. -.It Fl d +.It Fl -ca-cert= Ns Ar file +[SSL] +Path to certificate bundle containing trusted CA certificates. +If not specified, +.Pa /etc/ssl/cert.pem +is used. +The file may contain multiple CA certificates. The port +.Pa security/ca_root_nss +is a common source of a current CA bundle. +.It Fl -ca-path= Ns Ar dir +[SSL] +The directory +.Ar dir +contains trusted CA hashes. +.It Fl -cert= Ns Ar file +[SSL] +.Ar file +is a PEM encoded client certificate/key which will be used in +client certificate authentication. +.It Fl -crl= Ns Ar file +[SSL] +Points to certificate revocation list +.Ar file , +which has to be in PEM format and may contain peer certificates that have +been revoked. +.It Fl d , -direct Use a direct connection even if a proxy is configured. -.It Fl F +.It Fl F , -force-restart In combination with the .Fl r flag, forces a restart even if the local and remote files have @@ -118,17 +178,22 @@ The file to retrieve is located on the h .Ar host . This option is deprecated and is provided for backward compatibility only. -.It Fl i Ar file +.It Fl i Ar file , Fl -if-modified-since= Ns Ar file If-Modified-Since mode: the remote file will only be retrieved if it is newer than .Ar file on the local host. (HTTP only) -.It Fl l +.It Fl -key= Ns Ar file +[SSL] +.Ar file +is a PEM encoded client key that will be used in client certificate +authentication in case key and client certificate are stored separately. +.It Fl l , -symlink If the target is a file-scheme URL, make a symbolic link to the target rather than trying to copy it. .It Fl M -.It Fl m +.It Fl m , -mirror Mirror mode: if the file already exists locally and has the same size and modification time as the remote file, it will not be fetched. Note that the @@ -136,7 +201,7 @@ Note that the and .Fl r flags are mutually exclusive. -.It Fl N Ar file +.It Fl N Ar file , Fl -netrc= Ns Ar file Use .Ar file instead of @@ -146,9 +211,28 @@ See .Xr ftp 1 for a description of the file format. This feature is experimental. -.It Fl n +.It Fl n , -no-mtime Do not preserve the modification time of the transferred file. -.It Fl o Ar file +.It Fl -no-passive +Forces the FTP code to use active mode. +.It Fl -no-proxy= Ns Ar list +Either a single asterisk, which disables the use of proxies +altogether, or a comma- or whitespace-separated list of hosts for +which proxies should not be used. +.It Fl -no-sslv3 +[SSL] +Don't allow SSL version 3 when negotiating the connection. +.It Fl -no-tlsv1 +[SSL] +Don't allow TLS version 1 when negotiating the connection. +.It Fl -no-verify-hostname +[SSL] +Do not verify that the hostname matches the subject of the +certificate presented by the server. +.It Fl -no-verify-peer +[SSL] +Do not verify the peer certificate against trusted CAs. +.It Fl o Ar file , Fl output= Ns Ar file Set the output file name to .Ar file . By default, a ``pathname'' is extracted from the specified URI, and @@ -163,36 +247,45 @@ If the argument is a directory, fetched file(s) will be placed within the directory, with name(s) selected as in the default behaviour. .It Fl P -.It Fl p +.It Fl p , -passive Use passive FTP. These flags have no effect, since passive FTP is the default, but are provided for compatibility with earlier versions where active FTP was the default. -To force active mode, set the +To force active mode, use the +.Fl -no-passive +flag or set the .Ev FTP_PASSIVE_MODE environment variable to .Ql NO . -.It Fl q +.It Fl -referer= Ns Ar URL *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 19:06:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 90622D0; Fri, 26 Jul 2013 19:06:15 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7D5B72C02; Fri, 26 Jul 2013 19:06:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6QJ6Fw1067307; Fri, 26 Jul 2013 19:06:15 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6QJ6FVX067305; Fri, 26 Jul 2013 19:06:15 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201307261906.r6QJ6FVX067305@svn.freebsd.org> From: Jeff Roberson Date: Fri, 26 Jul 2013 19:06:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253685 - in head/sys: amd64/amd64 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 19:06:15 -0000 Author: jeff Date: Fri Jul 26 19:06:14 2013 New Revision: 253685 URL: http://svnweb.freebsd.org/changeset/base/253685 Log: - Use kmem_malloc rather than kmem_alloc() for GDT/LDT/tss allocations etc. This eliminates some unusual uses of that API in favor of more typical uses of kmem_malloc(). Discussed with: kib/alc Tested by: pho Sponsored by: EMC / Isilon Storage Division Modified: head/sys/amd64/amd64/sys_machdep.c head/sys/i386/i386/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Fri Jul 26 19:02:17 2013 (r253684) +++ head/sys/amd64/amd64/sys_machdep.c Fri Jul 26 19:06:14 2013 (r253685) @@ -356,8 +356,8 @@ amd64_set_ioperm(td, uap) */ pcb = td->td_pcb; if (pcb->pcb_tssp == NULL) { - tssp = (struct amd64tss *)kmem_alloc(kernel_map, - ctob(IOPAGES+1)); + tssp = (struct amd64tss *)kmem_malloc(kernel_map, + ctob(IOPAGES+1), M_WAITOK); if (tssp == NULL) return (ENOMEM); iomap = (char *)&tssp[1]; @@ -463,8 +463,9 @@ user_ldt_alloc(struct proc *p, int force return (mdp->md_ldt); mtx_unlock(&dt_lock); new_ldt = malloc(sizeof(struct proc_ldt), M_SUBPROC, M_WAITOK); - new_ldt->ldt_base = (caddr_t)kmem_alloc(kernel_map, - max_ldt_segment * sizeof(struct user_segment_descriptor)); + new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_map, + max_ldt_segment * sizeof(struct user_segment_descriptor), + M_WAITOK); if (new_ldt->ldt_base == NULL) { FREE(new_ldt, M_SUBPROC); mtx_lock(&dt_lock); Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Fri Jul 26 19:02:17 2013 (r253684) +++ head/sys/i386/i386/sys_machdep.c Fri Jul 26 19:06:14 2013 (r253685) @@ -164,8 +164,9 @@ sysarch(td, uap) break; case I386_SET_LDT: if (kargs.largs.descs != NULL) { - lp = (union descriptor *)kmem_alloc(kernel_map, - kargs.largs.num * sizeof(union descriptor)); + lp = (union descriptor *)kmem_malloc(kernel_map, + kargs.largs.num * sizeof(union descriptor), + M_WAITOK); if (lp == NULL) { error = ENOMEM; break; @@ -298,7 +299,8 @@ i386_extend_pcb(struct thread *td) 0 /* granularity */ }; - ext = (struct pcb_ext *)kmem_alloc(kernel_map, ctob(IOPAGES+1)); + ext = (struct pcb_ext *)kmem_malloc(kernel_map, ctob(IOPAGES+1), + M_WAITOK); if (ext == 0) return (ENOMEM); bzero(ext, sizeof(struct pcb_ext)); @@ -471,8 +473,8 @@ user_ldt_alloc(struct mdproc *mdp, int l M_SUBPROC, M_WAITOK); new_ldt->ldt_len = len = NEW_MAX_LD(len); - new_ldt->ldt_base = (caddr_t)kmem_alloc(kernel_map, - round_page(len * sizeof(union descriptor))); + new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_map, + round_page(len * sizeof(union descriptor)), M_WAITOK); if (new_ldt->ldt_base == NULL) { free(new_ldt, M_SUBPROC); mtx_lock_spin(&dt_lock); @@ -511,8 +513,8 @@ user_ldt_alloc(struct mdproc *mdp, int l M_SUBPROC, M_WAITOK); new_ldt->ldt_len = len = NEW_MAX_LD(len); - new_ldt->ldt_base = (caddr_t)kmem_alloc(kernel_map, - len * sizeof(union descriptor)); + new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_map, + len * sizeof(union descriptor), M_WAITOK); if (new_ldt->ldt_base == NULL) { free(new_ldt, M_SUBPROC); mtx_lock_spin(&dt_lock); From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 19:41:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 16BF4AE7; Fri, 26 Jul 2013 19:41:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 03BC52D4A; Fri, 26 Jul 2013 19:41:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6QJfEf5087849; Fri, 26 Jul 2013 19:41:14 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6QJfEMO087844; Fri, 26 Jul 2013 19:41:14 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307261941.r6QJfEMO087844@svn.freebsd.org> From: Adrian Chadd Date: Fri, 26 Jul 2013 19:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253687 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 19:41:15 -0000 Author: adrian Date: Fri Jul 26 19:41:13 2013 New Revision: 253687 URL: http://svnweb.freebsd.org/changeset/base/253687 Log: Break out the static, global LACP debug options into a per-lagg unit sysctl tree. * Create a net.link.lagg.X.lacp node * Add a debug node under that for tx_test and rx_test * Add lacp_strict_mode, defaulting to 1 tx_test and rx_test are still a bitmap of unit numbers for now. At some point it would be nice to create child nodes of the lagg bundle for each sub-interface, and then populate those with various knobs and statistics. Sponsored by: Netflix Modified: head/sys/net/ieee8023ad_lacp.c head/sys/net/ieee8023ad_lacp.h head/sys/net/if_lagg.c head/sys/net/if_lagg.h Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Fri Jul 26 19:11:08 2013 (r253686) +++ head/sys/net/ieee8023ad_lacp.c Fri Jul 26 19:41:13 2013 (r253687) @@ -193,18 +193,6 @@ SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO &lacp_debug, 0, "Enable LACP debug logging (1=debug, 2=trace)"); TUNABLE_INT("net.link.lagg.lacp.debug", &lacp_debug); -/* bitmap of ports */ -static int lacp_rx_test = 0; -static int lacp_tx_test = 0; -SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, rxtest, CTLFLAG_RW, &lacp_rx_test, 0, - "RXTest"); -SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, txtest, CTLFLAG_RW, &lacp_tx_test, 0, - "TXTest"); - -static int lacp_strict = 1; -SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, strict, CTLFLAG_RW, &lacp_strict, - 0, "Strict spec compliance"); - #define LACP_DPRINTF(a) if (lacp_debug & 0x01) { lacp_dprintf a ; } #define LACP_TRACE(a) if (lacp_debug & 0x02) { lacp_dprintf(a,"%s\n",__func__); } #define LACP_TPRINTF(a) if (lacp_debug & 0x04) { lacp_dprintf a ; } @@ -315,7 +303,7 @@ lacp_pdu_input(struct lacp_port *lp, str lacp_dump_lacpdu(du); } - if ((1 << lp->lp_ifp->if_dunit) & lacp_rx_test) { + if ((1 << lp->lp_ifp->if_dunit) & lp->lp_lsc->lsc_debug.lsc_rx_test) { LACP_TPRINTF((lp, "Dropping RX PDU\n")); goto bad; } @@ -750,10 +738,48 @@ lacp_transit_expire(void *vp) lsc->lsc_suppress_distributing = FALSE; } +static void +lacp_attach_sysctl(struct lacp_softc *lsc, struct sysctl_oid *p_oid) +{ + struct lagg_softc *sc = lsc->lsc_softc; + + SYSCTL_ADD_UINT(&sc->ctx, SYSCTL_CHILDREN(p_oid), OID_AUTO, + "lacp_strict_mode", + CTLFLAG_RW, + &lsc->lsc_strict_mode, + lsc->lsc_strict_mode, + "Enable LACP strict mode"); +} + +static void +lacp_attach_sysctl_debug(struct lacp_softc *lsc, struct sysctl_oid *p_oid) +{ + struct lagg_softc *sc = lsc->lsc_softc; + struct sysctl_oid *oid; + + /* Create a child of the parent lagg interface */ + oid = SYSCTL_ADD_NODE(&sc->ctx, SYSCTL_CHILDREN(p_oid), + OID_AUTO, "debug", CTLFLAG_RD, NULL, "DEBUG"); + + SYSCTL_ADD_UINT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_test", + CTLFLAG_RW, + &lsc->lsc_debug.lsc_rx_test, + lsc->lsc_debug.lsc_rx_test, + "Bitmap of if_dunit entries to drop RX frames for"); + SYSCTL_ADD_UINT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_test", + CTLFLAG_RW, + &lsc->lsc_debug.lsc_tx_test, + lsc->lsc_debug.lsc_tx_test, + "Bitmap of if_dunit entries to drop TX frames for"); +} + int lacp_attach(struct lagg_softc *sc) { struct lacp_softc *lsc; + struct sysctl_oid *oid; lsc = malloc(sizeof(struct lacp_softc), M_DEVBUF, M_NOWAIT|M_ZERO); @@ -765,10 +791,19 @@ lacp_attach(struct lagg_softc *sc) lsc->lsc_hashkey = arc4random(); lsc->lsc_active_aggregator = NULL; + lsc->lsc_strict_mode = 1; LACP_LOCK_INIT(lsc); TAILQ_INIT(&lsc->lsc_aggregators); LIST_INIT(&lsc->lsc_ports); + /* Create a child of the parent lagg interface */ + oid = SYSCTL_ADD_NODE(&sc->ctx, SYSCTL_CHILDREN(sc->sc_oid), + OID_AUTO, "lacp", CTLFLAG_RD, NULL, "LACP"); + + /* Attach sysctl nodes */ + lacp_attach_sysctl(lsc, oid); + lacp_attach_sysctl_debug(lsc, oid); + callout_init_mtx(&lsc->lsc_transit_callout, &lsc->lsc_mtx, 0); callout_init_mtx(&lsc->lsc_callout, &lsc->lsc_mtx, 0); @@ -1594,7 +1629,7 @@ lacp_sm_rx_record_pdu(struct lacp_port * } /* XXX Hack, still need to implement 5.4.9 para 2,3,4 */ - if (lacp_strict) + if (lp->lp_lsc->lsc_strict_mode) lp->lp_partner.lip_state |= LACP_STATE_SYNC; lacp_sm_ptx_update_timeout(lp, oldpstate); @@ -1622,7 +1657,7 @@ lacp_sm_rx_record_default(struct lacp_po LACP_TRACE(lp); oldpstate = lp->lp_partner.lip_state; - if (lacp_strict) + if (lp->lp_lsc->lsc_strict_mode) lp->lp_partner = lacp_partner_admin_strict; else lp->lp_partner = lacp_partner_admin_optimistic;; @@ -1660,7 +1695,7 @@ lacp_sm_rx_update_default_selected(struc LACP_TRACE(lp); - if (lacp_strict) + if (lp->lp_lsc->lsc_strict_mode) lacp_sm_rx_update_selected_from_peerinfo(lp, &lacp_partner_admin_strict); else @@ -1695,10 +1730,11 @@ lacp_sm_tx(struct lacp_port *lp) return; } - if (((1 << lp->lp_ifp->if_dunit) & lacp_tx_test) == 0) + if (((1 << lp->lp_ifp->if_dunit) & lp->lp_lsc->lsc_debug.lsc_tx_test) == 0) { error = lacp_xmit_lacpdu(lp); - else + } else { LACP_TPRINTF((lp, "Dropping TX PDU\n")); + } if (error == 0) { lp->lp_flags &= ~LACP_PORT_NTT; Modified: head/sys/net/ieee8023ad_lacp.h ============================================================================== --- head/sys/net/ieee8023ad_lacp.h Fri Jul 26 19:11:08 2013 (r253686) +++ head/sys/net/ieee8023ad_lacp.h Fri Jul 26 19:41:13 2013 (r253687) @@ -245,6 +245,11 @@ struct lacp_softc { struct lacp_portmap lsc_pmap[2]; volatile u_int lsc_activemap; u_int32_t lsc_hashkey; + struct { + u_int32_t lsc_rx_test; + u_int32_t lsc_tx_test; + } lsc_debug; + u_int32_t lsc_strict_mode; }; #define LACP_TYPE_ACTORINFO 1 Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Fri Jul 26 19:11:08 2013 (r253686) +++ head/sys/net/if_lagg.c Fri Jul 26 19:41:13 2013 (r253687) @@ -291,7 +291,8 @@ lagg_clone_create(struct if_clone *ifc, sysctl_ctx_init(&sc->ctx); snprintf(num, sizeof(num), "%u", unit); sc->use_flowid = def_use_flowid; - oid = SYSCTL_ADD_NODE(&sc->ctx, &SYSCTL_NODE_CHILDREN(_net_link, lagg), + sc->sc_oid = oid = SYSCTL_ADD_NODE(&sc->ctx, + &SYSCTL_NODE_CHILDREN(_net_link, lagg), OID_AUTO, num, CTLFLAG_RD, NULL, ""); SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "use_flowid", CTLTYPE_INT|CTLFLAG_RW, &sc->use_flowid, sc->use_flowid, Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Fri Jul 26 19:11:08 2013 (r253686) +++ head/sys/net/if_lagg.h Fri Jul 26 19:41:13 2013 (r253687) @@ -228,6 +228,7 @@ struct lagg_softc { eventhandler_tag vlan_detach; struct callout sc_callout; struct sysctl_ctx_list ctx; /* sysctl variables */ + struct sysctl_oid *sc_oid; /* sysctl tree oid */ int use_flowid; /* use M_FLOWID */ }; From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 20:54:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4F532B86; Fri, 26 Jul 2013 20:54:34 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3D0F92FA7; Fri, 26 Jul 2013 20:54:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6QKsYoF018672; Fri, 26 Jul 2013 20:54:34 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6QKsYD0018671; Fri, 26 Jul 2013 20:54:34 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201307262054.r6QKsYD0018671@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 26 Jul 2013 20:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253688 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 20:54:34 -0000 Author: np Date: Fri Jul 26 20:54:33 2013 New Revision: 253688 URL: http://svnweb.freebsd.org/changeset/base/253688 Log: Reserve room for ioctls that aren't in this copy of the driver yet. Modified: head/sys/dev/cxgbe/t4_ioctl.h Modified: head/sys/dev/cxgbe/t4_ioctl.h ============================================================================== --- head/sys/dev/cxgbe/t4_ioctl.h Fri Jul 26 19:41:13 2013 (r253687) +++ head/sys/dev/cxgbe/t4_ioctl.h Fri Jul 26 20:54:33 2013 (r253688) @@ -51,6 +51,9 @@ enum { T4_GET_MEM, /* read memory */ T4_GET_I2C, /* read from i2c addressible device */ T4_CLEAR_STATS, /* clear a port's MAC statistics */ + T4_SET_OFLD_POLICY, /* Set offload policy */ + T4_SET_SCHED_CLASS, /* set sched class */ + T4_SET_SCHED_QUEUE, /* set queue class */ }; struct t4_reg { From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 21:25:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2AB57547; Fri, 26 Jul 2013 21:25:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 08A6D212A; Fri, 26 Jul 2013 21:25:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6QLPJXg031790; Fri, 26 Jul 2013 21:25:19 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6QLPJjd031784; Fri, 26 Jul 2013 21:25:19 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307262125.r6QLPJjd031784@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 26 Jul 2013 21:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253689 - in head: gnu/usr.bin/patch share/mk tools/build/options usr.bin/patch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 21:25:20 -0000 Author: pfg Date: Fri Jul 26 21:25:18 2013 New Revision: 253689 URL: http://svnweb.freebsd.org/changeset/base/253689 Log: Make the BSD-licensed patch the default. The BSD-licensed patch(1) command has matured and it's behaviour can be considered equivalent to the older version of GNU patch in the tree. The switch has been extensively tested [1] and only two ports presented regressions, which have since been fixed. For convenience a new WITH_GNU_PATCH option is available, but it will likely be removed in the near future. PR: 176313 Approved by: portmgr Added: head/tools/build/options/WITH_GNU_PATCH - copied, changed from r253470, head/tools/build/options/WITH_BSD_PATCH Deleted: head/tools/build/options/WITH_BSD_PATCH Modified: head/gnu/usr.bin/patch/Makefile head/share/mk/bsd.own.mk head/usr.bin/patch/Makefile Modified: head/gnu/usr.bin/patch/Makefile ============================================================================== --- head/gnu/usr.bin/patch/Makefile Fri Jul 26 20:54:33 2013 (r253688) +++ head/gnu/usr.bin/patch/Makefile Fri Jul 26 21:25:18 2013 (r253689) @@ -2,14 +2,14 @@ .include -.if ${MK_BSD_PATCH} == "yes" +.if ${MK_GNU_PATCH} == "yes" +PROG= patch +.else PROG= gnupatch CLEANFILES+= gnupatch.1 gnupatch.1: patch.1 cp ${.ALLSRC} ${.TARGET} -.else -PROG= patch .endif SRCS= backupfile.c inp.c patch.c pch.c util.c version.c Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Fri Jul 26 20:54:33 2013 (r253688) +++ head/share/mk/bsd.own.mk Fri Jul 26 21:25:18 2013 (r253689) @@ -364,7 +364,6 @@ __DEFAULT_YES_OPTIONS = \ ZONEINFO __DEFAULT_NO_OPTIONS = \ - BSD_PATCH \ BIND_IDN \ BIND_LARGE_FILE \ BIND_LIBS \ @@ -375,6 +374,7 @@ __DEFAULT_NO_OPTIONS = \ CLANG_EXTRAS \ CTF \ DEBUG_FILES \ + GNU_PATCH \ GPL_DTC \ HESIOD \ ICONV \ Copied and modified: head/tools/build/options/WITH_GNU_PATCH (from r253470, head/tools/build/options/WITH_BSD_PATCH) ============================================================================== --- head/tools/build/options/WITH_BSD_PATCH Fri Jul 19 12:43:20 2013 (r253470, copy source) +++ head/tools/build/options/WITH_GNU_PATCH Fri Jul 26 21:25:18 2013 (r253689) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Install BSD-licensed patch as 'patch' instead of GNU patch. +Install GNU-licensed patch as 'patch' instead of BSD patch. Modified: head/usr.bin/patch/Makefile ============================================================================== --- head/usr.bin/patch/Makefile Fri Jul 26 20:54:33 2013 (r253688) +++ head/usr.bin/patch/Makefile Fri Jul 26 21:25:18 2013 (r253689) @@ -3,14 +3,14 @@ .include -.if ${MK_BSD_PATCH} == "yes" -PROG= patch -.else +.if ${MK_GNU_PATCH} == "yes" PROG= bsdpatch CLEANFILES+= bsdpatch.1 bsdpatch.1: patch.1 cp ${.ALLSRC} ${.TARGET} +.else +PROG= patch .endif SRCS= backupfile.c inp.c mkpath.c patch.c pch.c util.c From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 21:26:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A537968E for ; Fri, 26 Jul 2013 21:26:19 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 788002136 for ; Fri, 26 Jul 2013 21:26:19 +0000 (UTC) Received: by mail-pa0-f42.google.com with SMTP id lj1so3704541pab.29 for ; Fri, 26 Jul 2013 14:26:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :x-gm-message-state; bh=QJESk5STmuhHQpAsYSlMAvYq6cF5xMxkXPQlb+2peUs=; b=KaW6N0A4EIaD1GcY8yGuMn38Om4i8cMgvVAWXnc4SlsDyz1vDOd4RPmZjQQaMHtoEO 7sLh4c3L0n3aL3nad2omgyOxYuIVbH7kTYvVVPatpsjTVnHw/nGQAnEGiDlM0HGXuLWD hEPX1gxKHsbRIrNIdowP2Ch5mHHskF4+QgaIi/uuJN/wqrPvYfRn4u8nvjHBcDDmdquf GZmafa2pdU9YFeezDwWqKfA5QKLvD2ydQi5Ox2uq8a4vA3qJZ4SM5tUMcV7F7WQ/9RPr 9t3d8bDu6ObeRf9JirvvVt5g7UaUnY73PAx326o5t1dL1zEMjQfAiqvQW2TDfdqZ30JD OBTA== X-Received: by 10.68.237.3 with SMTP id uy3mr17008636pbc.155.1374873973409; Fri, 26 Jul 2013 14:26:13 -0700 (PDT) Received: from zont-osx.swifttest.com (h-74-3-97-61.snva.ca.megapath.net. [74.3.97.61]) by mx.google.com with ESMTPSA id xl3sm62029203pbb.17.2013.07.26.14.26.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Jul 2013 14:26:12 -0700 (PDT) Sender: Andrey Zonov Message-ID: <51F2E970.3070303@FreeBSD.org> Date: Fri, 26 Jul 2013 14:26:08 -0700 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Jilles Tjoelker Subject: Re: svn commit: r253662 - in head: lib/libc/gen sys/vm tools/tools/sysdoc References: <201307260200.r6Q207cB015223@svn.freebsd.org> <20130726150949.GC14175@stack.nl> In-Reply-To: <20130726150949.GC14175@stack.nl> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2WRQWRTFUJEHNMFAEIMTQ" X-Gm-Message-State: ALoCoQlHAVuhSTYTHCE6Hyw6poQtfFrQDTaIki7swCXzUM3WJQvySZFLS7VONlXims/t9eE6x6N7 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 21:26:19 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2WRQWRTFUJEHNMFAEIMTQ Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 7/26/13 8:09 AM, Jilles Tjoelker wrote: > On Fri, Jul 26, 2013 at 02:00:07AM +0000, Andrey Zonov wrote: >> Author: zont >> Date: Fri Jul 26 02:00:06 2013 >> New Revision: 253662 >> URL: http://svnweb.freebsd.org/changeset/base/253662 >=20 >> Log: >> Remove define and documentation for vm_pageout_algorithm missed in r= 253587 >=20 >> Modified: >> head/lib/libc/gen/sysctl.3 >> head/sys/vm/vm_param.h >> head/tools/tools/sysdoc/tunables.mdoc >=20 >> Modified: head/sys/vm/vm_param.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/vm/vm_param.h Fri Jul 26 00:28:19 2013 (r253661) >> +++ head/sys/vm/vm_param.h Fri Jul 26 02:00:06 2013 (r253662) >> @@ -82,9 +82,8 @@ >> #define VM_V_CACHE_MIN 7 /* cnt.v_cache_min */ >> #define VM_V_CACHE_MAX 8 /* cnt.v_cache_max */ >> #define VM_V_PAGEOUT_FREE_MIN 9 /* cnt.v_pageout_free_min */ >> -#define VM_PAGEOUT_ALGORITHM 10 /* pageout algorithm */ >> -#define VM_SWAPPING_ENABLED 11 /* swapping enabled */ >> -#define VM_MAXID 12 /* number of valid vm ids */ >> +#define VM_SWAPPING_ENABLED 10 /* swapping enabled */ >> +#define VM_MAXID 11 /* number of valid vm ids */ >=20 > As noted in mail from Bruce Evans, please preserve the ABI of > VM_SWAPPING_ENABLED here. >=20 I don't think it's a big problem. Internally we don't use it. Good code uses sysctlbyname() instead of sysctl(). It doesn't seem to me this is very popular sysctl. It's also CURRENT without MFC. I prefer clean code where it is possible instead of "dummy" all around. >> #define CTL_VM_NAMES { \ >> { 0, 0 }, \ >> @@ -97,7 +96,6 @@ >> { "v_cache_min", CTLTYPE_UINT }, \ >> { "v_cache_max", CTLTYPE_UINT }, \ >> { "v_pageout_free_min", CTLTYPE_UINT}, \ >> - { "pageout_algorithm", CTLTYPE_INT}, \ >> { "swap_enabled", CTLTYPE_INT},\ >> } >=20 > This should be replaced with some sort of dummy rather than replaced > entirely (does not matter very much because it should not be used). >=20 --=20 Andrey Zonov ------enig2WRQWRTFUJEHNMFAEIMTQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJR8ulzAAoJEBWLemxX/CvTTlMH/AqmYR7Ytm79iDPmZlr4DlDT yQYym8KSY97I6/20E7o4P83j9G8fsbCSnzBF53SfdhsAlB4lENU7sqeMxvvWTlHm 2gQIQ0vXMKUMev+kulVMC/KY53CqCL2Z/akCeny7MwNK2hrUYVFsBjdVQWoDOxrZ fLN2Br1sv+ji4ShcaWYRVnZrYuV8QyfWA4BUssyTM6cPFPHNc/z+ybGNUTPjqt43 dGhudoSyV9IR8ypuutZOlSYHqkGV1+mALS9RLjzMLPnNPUmUqkKC3vtPRFFjc2T5 Ql03zr7VBeos1aRg80Yu1N5sRXV3XwK35imGjTnKmhK9URJPyzc8TNvjoqLzdJY= =fZaL -----END PGP SIGNATURE----- ------enig2WRQWRTFUJEHNMFAEIMTQ-- From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 21:31:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7FC6A84F for ; Fri, 26 Jul 2013 21:31:26 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF6E92171 for ; Fri, 26 Jul 2013 21:31:25 +0000 (UTC) Received: by mail-la0-f43.google.com with SMTP id fs13so2720487lab.16 for ; Fri, 26 Jul 2013 14:31:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=A6yNbZNavRW4QrQixNrGSVA7mUEmp96hrKg7WLbrN54=; b=jlGevIpMm0Nn8PvIb2nBRhnVIL2uF/q4mArkJ5aAqe+uUIXT2D9MkIT18e33y7/Omk L1lhUEPhVE/awhAZa2RFtMoi2RqzTRmpqGy3ORSnVJvwmc9PNsOGmVRS7yndou1p8sgC ebV5lDmfJK52H7JNa8uFHU7Eg6Fvu8sAUO/fukspDm20H0EPuLvufd0sUAQjFmyx4fTn EoGvryFUWdpmL6fZqFcJ0K1xoZWjFvkvmZ0sh2vJLQw84GAwEv8UwwgT/jML7U+IS+NG 6YPLXE07HhDzzyMqP/U3WwOUHrJL7lzrJt9SLLMSQSxGCfYpDwwKnYKH1Kf5anhX4E20 mDoA== X-Received: by 10.152.26.2 with SMTP id h2mr22339561lag.52.1374874277596; Fri, 26 Jul 2013 14:31:17 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.113.231 with HTTP; Fri, 26 Jul 2013 14:30:57 -0700 (PDT) In-Reply-To: <51F2E970.3070303@FreeBSD.org> References: <201307260200.r6Q207cB015223@svn.freebsd.org> <20130726150949.GC14175@stack.nl> <51F2E970.3070303@FreeBSD.org> From: Juli Mallett Date: Fri, 26 Jul 2013 14:30:57 -0700 X-Google-Sender-Auth: 8Ci1py3Dir307MjXbfdaGsMCEmY Message-ID: Subject: Re: svn commit: r253662 - in head: lib/libc/gen sys/vm tools/tools/sysdoc To: Andrey Zonov X-Gm-Message-State: ALoCoQlIvSi1PgytxBG2xk3NQTLkG3Coq7mTrfF61ZY7yL6rl/lobeHqNE3b+ADgZ+dllHMNTHNK Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jilles Tjoelker X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 21:31:26 -0000 On Fri, Jul 26, 2013 at 2:26 PM, Andrey Zonov wrote: > On 7/26/13 8:09 AM, Jilles Tjoelker wrote: > > On Fri, Jul 26, 2013 at 02:00:07AM +0000, Andrey Zonov wrote: > >> Author: zont > >> Date: Fri Jul 26 02:00:06 2013 > >> New Revision: 253662 > >> URL: http://svnweb.freebsd.org/changeset/base/253662 > > > >> Log: > >> Remove define and documentation for vm_pageout_algorithm missed in > r253587 > > > >> Modified: > >> head/lib/libc/gen/sysctl.3 > >> head/sys/vm/vm_param.h > >> head/tools/tools/sysdoc/tunables.mdoc > > > >> Modified: head/sys/vm/vm_param.h > >> > ============================================================================== > >> --- head/sys/vm/vm_param.h Fri Jul 26 00:28:19 2013 (r253661) > >> +++ head/sys/vm/vm_param.h Fri Jul 26 02:00:06 2013 (r253662) > >> @@ -82,9 +82,8 @@ > >> #define VM_V_CACHE_MIN 7 /* cnt.v_cache_min */ > >> #define VM_V_CACHE_MAX 8 /* cnt.v_cache_max */ > >> #define VM_V_PAGEOUT_FREE_MIN 9 /* cnt.v_pageout_free_min > */ > >> -#define VM_PAGEOUT_ALGORITHM 10 /* pageout algorithm */ > >> -#define VM_SWAPPING_ENABLED 11 /* swapping enabled */ > >> -#define VM_MAXID 12 /* number of valid vm ids > */ > >> +#define VM_SWAPPING_ENABLED 10 /* swapping enabled */ > >> +#define VM_MAXID 11 /* number of valid vm ids > */ > > > > As noted in mail from Bruce Evans, please preserve the ABI of > > VM_SWAPPING_ENABLED here. > > > > I don't think it's a big problem. Internally we don't use it. Good > code uses sysctlbyname() instead of sysctl(). It doesn't seem to me > this is very popular sysctl. It's also CURRENT without MFC. That doesn't seem like a great argument. Why should we break the ABI for bad code that used that sysctl and all following? It seems pretty trivial to preserve, and no-cost. Also, the fact that it's in current misses the point completely: it breaks ABI with older binaries, namely older binaries running on -CURRENT. And not just for that field. From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 21:34:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2E7BD8F6; Fri, 26 Jul 2013 21:34:10 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 17B7D218E; Fri, 26 Jul 2013 21:34:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6QLYAk2035708; Fri, 26 Jul 2013 21:34:10 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6QLYAJO035706; Fri, 26 Jul 2013 21:34:10 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201307262134.r6QLYAJO035706@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 26 Jul 2013 21:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253690 - in head/sys/contrib/dev/acpica: . common compiler components/executer components/hardware components/namespace components/tables components/utilities include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 21:34:10 -0000 Author: jkim Date: Fri Jul 26 21:34:09 2013 New Revision: 253690 URL: http://svnweb.freebsd.org/changeset/base/253690 Log: Merge ACPICA 20130725. Modified: head/sys/contrib/dev/acpica/changes.txt (contents, props changed) head/sys/contrib/dev/acpica/common/dmextern.c head/sys/contrib/dev/acpica/common/getopt.c head/sys/contrib/dev/acpica/compiler/asloffset.c head/sys/contrib/dev/acpica/compiler/asloperands.c head/sys/contrib/dev/acpica/compiler/asloptions.c head/sys/contrib/dev/acpica/compiler/dttemplate.c head/sys/contrib/dev/acpica/components/executer/exoparg1.c head/sys/contrib/dev/acpica/components/hardware/hwtimer.c head/sys/contrib/dev/acpica/components/namespace/nspredef.c head/sys/contrib/dev/acpica/components/namespace/nswalk.c head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c head/sys/contrib/dev/acpica/components/tables/tbfadt.c head/sys/contrib/dev/acpica/components/tables/tbxfroot.c head/sys/contrib/dev/acpica/components/utilities/utglobal.c head/sys/contrib/dev/acpica/components/utilities/utosi.c head/sys/contrib/dev/acpica/components/utilities/utxface.c head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acnamesp.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actables.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/acutils.h Directory Properties: head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/dev/acpica/common/ (props changed) head/sys/contrib/dev/acpica/compiler/ (props changed) head/sys/contrib/dev/acpica/components/debugger/ (props changed) head/sys/contrib/dev/acpica/components/disassembler/ (props changed) head/sys/contrib/dev/acpica/components/dispatcher/ (props changed) head/sys/contrib/dev/acpica/components/events/ (props changed) head/sys/contrib/dev/acpica/components/executer/ (props changed) head/sys/contrib/dev/acpica/components/hardware/ (props changed) head/sys/contrib/dev/acpica/components/namespace/ (props changed) head/sys/contrib/dev/acpica/components/parser/ (props changed) head/sys/contrib/dev/acpica/components/resources/ (props changed) head/sys/contrib/dev/acpica/components/tables/ (props changed) head/sys/contrib/dev/acpica/components/utilities/ (props changed) head/sys/contrib/dev/acpica/include/ (props changed) head/sys/contrib/dev/acpica/os_specific/ (props changed) Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Fri Jul 26 21:25:18 2013 (r253689) +++ head/sys/contrib/dev/acpica/changes.txt Fri Jul 26 21:34:09 2013 (r253690) @@ -1,4 +1,76 @@ ---------------------------------------- +25 July 2013. Summary of changes for version 20130725: + +1) ACPICA kernel-resident subsystem: + +Fixed a problem with the DerefOf operator where references to FieldUnits +and BufferFields incorrectly returned the parent object, not the actual +value of the object. After this change, a dereference of a FieldUnit +reference results in a read operation on the field to get the value, and +likewise, the appropriate BufferField value is extracted from the target +buffer. + +Fixed a problem where the _WAK method could cause a fault under these +circumstances: 1) Interpreter slack mode was not enabled, and 2) the _WAK +method returned no value. The problem is rarely seen because most kernels +run ACPICA in slack mode. + +For the DerefOf operator, a fatal error now results if an attempt is made +to dereference a reference (created by the Index operator) to a NULL +package element. Provides compatibility with other ACPI implementations, +and this behavior will be added to a future version of the ACPI +specification. + +The ACPI Power Management Timer (defined in the FADT) is now optional. +This provides compatibility with other ACPI implementations and will +appear in the next version of the ACPI specification. If there is no PM +Timer on the platform, AcpiGetTimer returns AE_SUPPORT. An address of +zero in the FADT indicates no PM timer. + +Implemented a new interface for _OSI support, AcpiUpdateInterfaces. This +allows the host to globally enable/disable all vendor strings, all +feature strings, or both. Intended to be primarily used for debugging +purposes only. Lv Zheng. + +Expose the collected _OSI data to the host via a global variable. This +data tracks the highest level vendor ID that has been invoked by the BIOS +so that the host (and potentially ACPICA itself) can change behaviors +based upon the age of the BIOS. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 96.2K Code, 27.1K Data, 123.3K Total + Debug Version: 184.4K Code, 76.8K Data, 261.2K Total + Previous Release: + Non-Debug Version: 95.9K Code, 26.9K Data, 122.8K Total + Debug Version: 184.1K Code, 76.7K Data, 260.8K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Created the following enhancements for the -so option (create +offset table): +1)Add offsets for the last nameseg in each namepath for every supported +object type +2)Add support for Processor, Device, Thermal Zone, and Scope objects +3)Add the actual AML opcode for the parent object of every supported +object type +4)Add support for the ZERO/ONE/ONES AML opcodes for integer objects + +Disassembler: Emit all unresolved external symbols in a single block. +These are external references to control methods that could not be +resolved, and thus, the disassembler had to make a guess at the number of +arguments to parse. + +iASL: The argument to the -T option (create table template) is now +optional. If not specified, the default table is a DSDT, typically the +most common case. + +---------------------------------------- 26 June 2013. Summary of changes for version 20130626: 1) ACPICA kernel-resident subsystem: @@ -65,12 +137,14 @@ longer executed properly because of a me initialized correctly. ACPICA BZ 1016. Tomasz Nowicki . -Fixed a possible problem with the new extended sleep registers in the ACPI +Fixed a possible problem with the new extended sleep registers in the +ACPI 5.0 FADT. Do not use these registers (even if populated) unless the HW- reduced bit is set in the FADT (as per the ACPI specification). ACPICA BZ 1020. Lv Zheng. -Implemented return value repair code for _CST predefined objects: Sort the +Implemented return value repair code for _CST predefined objects: Sort +the list and detect/remove invalid entries. ACPICA BZ 890. Lv Zheng. Implemented a debug-only option to disable loading of SSDTs from the @@ -87,7 +161,8 @@ BZ 1013. 4) Clear debug buffer global on termination to prevent possible multiple delete. ACPICA BZ 1010. -Standardized all switch() blocks across the entire source base. After many +Standardized all switch() blocks across the entire source base. After +many years, different formatting for switch() had crept in. This change makes the formatting of every switch block identical. ACPICA BZ 997. Chao Guan. @@ -118,7 +193,8 @@ has a much larger code and data size. 2) iASL Compiler/Disassembler and Tools: New utility: Implemented an easily portable version of the acpidump -utility to extract ACPI tables from the system (or a file) in an ASCII hex +utility to extract ACPI tables from the system (or a file) in an ASCII +hex dump format. The top-level code implements the various command line options, file I/O, and table dump routines. To port to a new host, only three functions need to be implemented to get tables -- since this @@ -152,7 +228,8 @@ iASL: Added control method and package s iASL: issue a remark if a non-serialized method creates named objects. If a thread blocks within the method for any reason, and another thread -enters the method, the method will fail because an attempt will be made to +enters the method, the method will fail because an attempt will be made +to create the same (named) object twice. In this case, issue a remark that the method should be marked serialized. NOTE: may become a warning later. ACPICA BZ 909. @@ -165,10 +242,13 @@ ACPICA BZ 909. Fixed a possible buffer overrun during some rare but specific field unit read operations. This overrun can only happen if the DSDT version is 1 -- meaning that all AML integers are 32 bits -- and the field length is -between 33 and 55 bits long. During the read, an internal buffer object is -created for the field unit because the field is larger than an integer (32 +between 33 and 55 bits long. During the read, an internal buffer object +is +created for the field unit because the field is larger than an integer +(32 bits). However, in this case, the buffer will be incorrectly written -beyond the end because the buffer length is less than the internal minimum +beyond the end because the buffer length is less than the internal +minimum of 64 bits (8 bytes) long. The buffer will be either 5, 6, or 7 bytes long, but a full 8 bytes will be written. @@ -220,7 +300,8 @@ has a much larger code and data size. 2) iASL Compiler/Disassembler and Tools: AcpiExec: Added installation of a handler for the SystemCMOS address -space. This prevents control method abort if a method accesses this space. +space. This prevents control method abort if a method accesses this +space. AcpiExec: Added support for multiple EC devices, and now install EC operation region handler(s) at the actual EC device instead of the @@ -235,7 +316,8 @@ AcpiExec installs a handler for every po Debugger: Enhanced the "handlers" command to display non-root handlers. This change enhances the handlers command to display handlers associated with individual devices throughout the namespace, in addition to the -currently supported display of handlers associated with the root namespace +currently supported display of handlers associated with the root +namespace node. ASL Test Suite: Several test suite errors have been identified and @@ -264,7 +346,8 @@ return from this interface. Handles a po ACPI_WAIT_FOREVER is modified by the host to be a value less than "forever". Jung-uk Kim. -Predefined name support: Add allowed/required argument type information to +Predefined name support: Add allowed/required argument type information +to the master predefined info table. This change adds the infrastructure to enable typechecking on incoming arguments for all predefined methods/objects. It does not actually contain the code that will fully @@ -287,10 +370,12 @@ has a much larger code and data size. 2) iASL Compiler/Disassembler and Tools: -iASL: Implemented a new option to simplify the development of ACPI-related +iASL: Implemented a new option to simplify the development of ACPI- +related BIOS code. Adds support for a new "offset table" output file. The -so option will create a C table containing the AML table offsets of various -named objects in the namespace so that BIOS code can modify them easily at +named objects in the namespace so that BIOS code can modify them easily +at boot time. This can simplify BIOS runtime code by eliminating expensive searches for "magic values", enhancing boot times and adding greater reliability. With assistance from Lee Hamel. @@ -324,11 +409,13 @@ names table (above). Fixed a possible regression on some hosts: Reinstated the safe return macros (return_ACPI_STATUS, etc.) that ensure that the argument is evaluated only once. Although these macros are not needed for the ACPICA -code itself, they are often used by ACPI-related host device drivers where +code itself, they are often used by ACPI-related host device drivers +where the safe feature may be necessary. Fixed several issues related to the ACPI 5.0 reduced hardware support -(SOC): Now ensure that if the platform declares itself as hardware-reduced +(SOC): Now ensure that if the platform declares itself as hardware- +reduced via the FADT, the following functions become NOOPs (and always return AE_OK) because ACPI is always enabled by definition on these machines: AcpiEnable @@ -341,13 +428,15 @@ predefined name return values. Both of t the related device drivers that invoke these methods: 1) For the _STR and _MLS names, automatically repair/convert an ASCII string to a Unicode buffer. -2) For the _CRS, _PRS, and _DMA names, return a resource descriptor with a +2) For the _CRS, _PRS, and _DMA names, return a resource descriptor with +a lone end tag descriptor in the following cases: A Return(0) was executed, a null buffer was returned, or no object at all was returned (non-slack mode only). Adds a new file, nsconvert.c ACPICA BZ 998. Bob Moore, Lv Zheng. -Resource Manager: Added additional code to prevent possible infinite loops +Resource Manager: Added additional code to prevent possible infinite +loops while traversing corrupted or ill-formed resource template buffers. Check for zero-length resource descriptors in all code that loops through resource templates (the length field is used to index through the @@ -388,7 +477,8 @@ iASL: Implemented compile-time validatio predefined names. This new feature validates static package objects returned by the various predefined names defined to return packages. Both object types and package lengths are validated, for both parent packages -and sub-packages, if any. The code is similar in structure and behavior to +and sub-packages, if any. The code is similar in structure and behavior +to the runtime repair mechanism within the AML interpreter and uses the existing predefined name information table. Adds a new file, aslprepkg.c. ACPICA BZ 938. @@ -405,7 +495,8 @@ assumes zero method arguments in these c actual number of arguments without resolution/definition of the method). Debugger: Added support to display all resources with a single command. -Invocation of the resources command with no arguments will now display all +Invocation of the resources command with no arguments will now display +all resources within the current namespace. AcpiHelp: Added descriptive text for each ACPICA exception code displayed @@ -418,8 +509,10 @@ via the -e option. Updated the AcpiGetSleepTypeData interface: Allow the \_Sx methods to return either 1 or 2 integers. Although the ACPI spec defines the \_Sx -objects to return a package containing one integer, most BIOS code returns -two integers and the previous code reflects that. However, we also need to +objects to return a package containing one integer, most BIOS code +returns +two integers and the previous code reflects that. However, we also need +to support BIOS code that actually implements to the ACPI spec, and this change reflects this. @@ -463,12 +556,15 @@ attempt to flush data to the output file This can cause an infinite loop as the max error count code essentially keeps calling itself. -iASL/Disassembler: Added an option (-in) to ignore NOOP opcodes/operators. +iASL/Disassembler: Added an option (-in) to ignore NOOP +opcodes/operators. Implemented for both the compiler and the disassembler. Often, the NOOP -opcode is used as padding for packages that are changed dynamically by the +opcode is used as padding for packages that are changed dynamically by +the BIOS. When disassembled and recompiled, these NOOPs will cause syntax errors. This option causes the disassembler to ignore all NOOP opcodes -(0xA3), and it also causes the compiler to ignore all ASL source code NOOP +(0xA3), and it also causes the compiler to ignore all ASL source code +NOOP statements as well. Debugger: Enhanced the Sleep command to execute all sleep states. This @@ -499,7 +595,8 @@ the existing share bit. Reported by Aaro Interpreter: Fix Store() when an implicit conversion is not possible. For example, in the cases such as a store of a string to an existing package object, implement the store as a CopyObject(). This is a small departure -from the ACPI specification which states that the control method should be +from the ACPI specification which states that the control method should +be aborted in this case. However, the ASLTS suite depends on this behavior. Performance improvement for the various FUNCTION_TRACE and DEBUG_PRINT @@ -538,15 +635,18 @@ iASL: Disallow a method call as argument This change tracks an errata to the ACPI 5.0 document. The AML grammar will not allow the interpreter to differentiate between a method and a method invocation when these are used as an argument to the ObjectType -operator. The ACPI specification change is to disallow a method invocation +operator. The ACPI specification change is to disallow a method +invocation (UserTerm) for the ObjectType operator. Finish support for the TPM2 and CSRT tables in the headers, table compiler, and disassembler. Unix user-space OSL: Fix a problem with WaitSemaphore where the timeout -always expires immediately if the semaphore is not available. The original -code was using a relative-time timeout, but sem_timedwait requires the use +always expires immediately if the semaphore is not available. The +original +code was using a relative-time timeout, but sem_timedwait requires the +use of an absolute time. iASL: Added a remark if the Timer() operator is used within a 32-bit @@ -566,14 +666,18 @@ been updated. Implemented a performance enhancement for ACPI/AML Package objects. This change greatly increases the performance of Package objects within the -interpreter. It changes the processing of reference counts for packages by +interpreter. It changes the processing of reference counts for packages +by optimizing for the most common case where the package sub-objects are -either Integers, Strings, or Buffers. Increases the overall performance of -the ASLTS test suite by 1.5X (Increases the Slack Mode performance by 2X.) +either Integers, Strings, or Buffers. Increases the overall performance +of +the ASLTS test suite by 1.5X (Increases the Slack Mode performance by +2X.) Chao Guan. ACPICA BZ 943. Implemented and deployed common macros to extract flag bits from resource -descriptors. Improves readability and maintainability of the code. Fixes a +descriptors. Improves readability and maintainability of the code. Fixes +a problem with the UART serial bus descriptor for the number of data bits flags (was incorrectly 2 bits, should be 3). @@ -607,14 +711,17 @@ carats (^). ACPICA BZ 984. Debugger: Completed a major update for the Disassemble command. This command was out-of-date and did not properly disassemble control -methods that had any reasonable complexity. This fix brings the command up +methods that had any reasonable complexity. This fix brings the command +up to the same level as the rest of the disassembler. Adds one new file, dmdeferred.c, which is existing code that is now common with the main disassembler and the debugger disassemble command. ACPICA MZ 978. iASL: Moved the parser entry prototype to avoid a duplicate declaration. -Newer versions of Bison emit this prototype, so moved the prototype out of -the iASL header to where it is actually used in order to avoid a duplicate +Newer versions of Bison emit this prototype, so moved the prototype out +of +the iASL header to where it is actually used in order to avoid a +duplicate declaration. iASL/Tools: Standardized use of the stream I/O functions: @@ -622,7 +729,8 @@ iASL/Tools: Standardized use of the stre 2) Ensure proper order of size/count arguments for fread/fwrite 3) Use test of (Actual != Requested) after all fwrite, and most fread 4) Standardize I/O error messages -Improves reliability and maintainability of the code. Bob Moore, Lv Zheng. +Improves reliability and maintainability of the code. Bob Moore, Lv +Zheng. ACPICA BZ 981. Disassembler: Prevent duplicate External() statements. During generation @@ -744,7 +852,8 @@ ACPICA BZ 846. Makefiles: Completely removed the obsolete "Linux" makefiles under -acpica/generate/linux. These makefiles are obsolete and have been replaced +acpica/generate/linux. These makefiles are obsolete and have been +replaced by the generic unix makefiles under acpica/generate/unix. @@ -783,7 +892,8 @@ that is a named object. This change fixe iASL: Fixed a regression where the AML file is not deleted on errors. The AML -output file should be deleted if there are any errors during the compiler. +output file should be deleted if there are any errors during the +compiler. The only exception is if the -f (force output) option is used. ACPICA BZ 974. @@ -838,7 +948,8 @@ ACPICA BZ 969. Implemented support for complex bit-packed buffers returned from the _PLD (Physical Location of Device) predefined method. Adds a new external -interface, AcpiDecodePldBuffer that parses the buffer into a more usable C +interface, AcpiDecodePldBuffer that parses the buffer into a more usable +C structure. Note: C Bitfields cannot be used for this type of predefined structure since the memory layout of individual bitfields is not defined by @@ -853,7 +964,8 @@ during execution of module-level ASL code (code that is executed at table load time.) Lin Ming. -Added the Windows8/Server2012 string for the _OSI method. This change adds +Added the Windows8/Server2012 string for the _OSI method. This change +adds a new _OSI string, "Windows 2012" for both Windows 8 and Windows Server 2012. @@ -870,14 +982,16 @@ GPE support: Removed an extraneous param internal GPE functions. Tang Feng. Removed the linux makefiles from the unix packages. The generate/linux -makefiles are obsolete and have been removed from the unix tarball release +makefiles are obsolete and have been removed from the unix tarball +release packages. The replacement makefiles are under generate/unix, and there is a top-level makefile under the main acpica directory. ACPICA BZ 967, 912. Updates for Unix makefiles: 1) Add -D_FORTIFY_SOURCE=2 for gcc generation. Arjan van de Ven. -2) Update linker flags (move to end of command line) for AcpiExec utility. +2) Update linker flags (move to end of command line) for AcpiExec +utility. Guan Chao. Split ACPICA initialization functions to new file, utxfinit.c. Split from @@ -901,13 +1015,15 @@ much larger code and data size. iASL: Fixed a problem with constant folding for fixed-length constant expressions. The constant-folding code was not being invoked for constant -expressions that allow the use of type 3/4/5 opcodes to generate constants +expressions that allow the use of type 3/4/5 opcodes to generate +constants for expressions such as ByteConstExpr, WordConstExpr, etc. This could result in the generation of invalid AML bytecode. ACPICA BZ 970. iASL: Fixed a generation issue on newer versions of Bison. Newer versions -apparently automatically emit some of the necessary externals. This change +apparently automatically emit some of the necessary externals. This +change handles these versions in order to eliminate generation warnings. Disassembler: Added support to decode the DBG2 and CSRT ACPI tables. @@ -925,7 +1041,8 @@ AE_BAD_PARAMETER was always returned. 1) ACPICA Kernel-resident Subsystem: Fixed a possible fault in the return package object repair code. Fixes a -problem that can occur when a lone package object is wrapped with an outer +problem that can occur when a lone package object is wrapped with an +outer package object in order to force conformance to the ACPI specification. Can affect these predefined names: _ALR, _MLS, _PSS, _TRT, _TSS, _PRT, _HPX, @@ -969,14 +1086,16 @@ table and FADT errors. Additional deployment to be completed as appropriate in the future. The associated conditional macros are ACPI_BIOS_ERROR and -ACPI_BIOS_WARNING. See the ACPICA reference for additional details. ACPICA +ACPI_BIOS_WARNING. See the ACPICA reference for additional details. +ACPICA BZ 843. Implicit notify support: ensure that no memory allocation occurs within a critical region. This fix moves a memory allocation outside of the time that a -spinlock is held. Fixes issues on systems that do not allow this behavior. +spinlock is held. Fixes issues on systems that do not allow this +behavior. Jung-uk Kim. Split exception code utilities and tables into a new file, @@ -1029,7 +1148,8 @@ generates a runtime device notification in the absence of a BIOS-provided GPE control method (_Lxx/_Exx) or a host-installed handler for the GPE. Implicit notify is -provided by ACPICA for Windows compatibility, and is a workaround for BIOS +provided by ACPICA for Windows compatibility, and is a workaround for +BIOS AML code errors. See the description of the AcpiSetupGpeForWake interface in the @@ -1068,9 +1188,11 @@ etc.) AcpiSrc: Fixed several long-standing Linux code translation issues. Argument -descriptions in function headers are now translated properly to lower case +descriptions in function headers are now translated properly to lower +case and -underscores. ACPICA BZ 961. Also fixes translation problems such as these: +underscores. ACPICA BZ 961. Also fixes translation problems such as +these: (old -> new) i_aSL -> iASL 00-7_f -> 00-7F @@ -1112,7 +1234,8 @@ additional information. ACPICA BZ 868. ACPI Tables: Added a new error message for a possible overflow failure during -the conversion of FADT 32-bit legacy register addresses to internal common +the conversion of FADT 32-bit legacy register addresses to internal +common 64- bit GAS structure representation. The GAS has a one-byte "bit length" field, @@ -1149,7 +1272,8 @@ correct External statement. Disassembler: Several additional fixes for the External() statement generation related to some ASL operators. Also, order the External() statements -alphabetically in the disassembler output. Fixes the External() generation +alphabetically in the disassembler output. Fixes the External() +generation for the Create* field, Alias, and Scope operators: 1) Create* buffer field operators - fix type mismatch warning on @@ -1173,7 +1297,8 @@ condition. iASL: Implemented some changes to enhance the IDE support (-vi option.) Error -and Warning messages are now correctly recognized for both the source code +and Warning messages are now correctly recognized for both the source +code browser and the global error and warning counts. ---------------------------------------- @@ -1182,13 +1307,15 @@ browser and the global error and warning 1) ACPICA Core Subsystem: -Implemented support for multiple notify handlers. This change adds support +Implemented support for multiple notify handlers. This change adds +support to allow multiple system and device notify handlers on Device, Thermal Zone, and Processor objects. This can simplify the host OS notification implementation. -Also re-worked and restructured the entire notify support code to simplify +Also re-worked and restructured the entire notify support code to +simplify handler installation, handler removal, notify event queuing, and notify dispatch to handler(s). Note: there can still only be two global notify handlers - one for system notifies and one for device notifies. There are @@ -1229,7 +1356,8 @@ resource tags within resource descriptor StartDependent* descriptor. Reported by Petr Vandrovec. ACPICA BZ 949. -iASL and Preprocessor: Implemented full support for the #line directive to +iASL and Preprocessor: Implemented full support for the #line directive +to correctly track original source file line numbers through the .i preprocessor output file - for error and warning messages. @@ -1250,7 +1378,8 @@ ASL Test Suite (ASLTS): Reduce iASL warn Update for resource descriptor offset fix above. Update/cleanup error output routines. Enable and send iASL errors/warnings to an error logfile -(error.txt). Send all other iASL output to a logfile (compiler.txt). Fixed +(error.txt). Send all other iASL output to a logfile (compiler.txt). +Fixed several extraneous "unrecognized operator" messages. ---------------------------------------- @@ -1260,7 +1389,8 @@ several extraneous "unrecognized operato 1) ACPICA Core Subsystem: Enhanced the sleep/wake interfaces to optionally execute the _GTS method -(Going To Sleep) and the _BFS method (Back From Sleep). Windows apparently +(Going To Sleep) and the _BFS method (Back From Sleep). Windows +apparently does not execute these methods, and therefore these methods are often untested. It has been seen on some systems where the execution of these methods causes errors and also prevents the machine from entering S5. It @@ -1281,8 +1411,10 @@ early. The local FADT table length cannot be set to the common length until the original length has been examined. There is code that checks the table length -and sets various fields appropriately. This can affect older machines with -early FADT versions. For example, this can cause inadvertent writes to the +and sets various fields appropriately. This can affect older machines +with +early FADT versions. For example, this can cause inadvertent writes to +the CST_CNT register. Julian Anastasov. Fixed a mapping issue related to a physical table override. Use the @@ -1295,10 +1427,12 @@ Thomas Renninger, Bob Moore. Enhanced the automatic return-object repair code: Repair a common problem with -predefined methods that are defined to return a variable-length Package of +predefined methods that are defined to return a variable-length Package +of sub-objects. If there is only one sub-object, some BIOS ASL code mistakenly -simply returns the single object instead of a Package with one sub-object. +simply returns the single object instead of a Package with one sub- +object. This new support will repair this error by wrapping a Package object around the original object, creating the correct and expected Package with one @@ -1393,7 +1527,8 @@ method. Some machines require that the G method is executed. Thomas Renninger. -c) In AcpiLeaveSleepState, now always clear the WAK_STS (wake status) bit. +c) In AcpiLeaveSleepState, now always clear the WAK_STS (wake status) +bit. Some BIOS code assumes that WAK_STS will be cleared on resume and use it to determine whether the system is rebooting or resuming. Matthew Garrett. @@ -1429,7 +1564,8 @@ build of ACPICA that supports only the A model. See the ACPICA reference for details. ACPICA BZ 942. This option removes about -10% of the code and 5% of the static data, and the following hardware ACPI +10% of the code and 5% of the static data, and the following hardware +ACPI features become unavailable: PM Event and Control registers SCI interrupt (and handler) @@ -1442,7 +1578,8 @@ features become unavailable: Updated the unix tarball directory structure to match the ACPICA git source tree. This ensures that the generic unix makefiles work properly (in -generate/unix). Also updated the Linux makefiles to match. ACPICA BZ 867. +generate/unix). Also updated the Linux makefiles to match. ACPICA BZ +867. Updated the return value of the _REV predefined method to integer value 5 to @@ -1493,7 +1630,8 @@ the ACPICA reference for additional details. Adds one new file, utilities/utaddress.c. Lin Ming, Bob Moore. -Fixed several issues with the ACPI 5.0 FADT support: Add the sleep Control +Fixed several issues with the ACPI 5.0 FADT support: Add the sleep +Control and Status registers, update the ACPI 5.0 flags, and update internal data structures to handle an FADT larger than 256 bytes. The size of the ACPI @@ -1551,7 +1689,8 @@ summarized below. Reduced Hardware Support: ------------------------- -This support allows for ACPI systems without the usual ACPI hardware. This +This support allows for ACPI systems without the usual ACPI hardware. +This support is enabled by a flag in the revision 5 FADT. If it is set, ACPICA will not attempt to initialize or use any of the usual ACPI hardware. Note, @@ -1571,7 +1710,8 @@ ACPI Tables: ------------ All new tables and updates to existing tables are fully supported in the -ACPICA headers (for use by device drivers), the disassembler, and the iASL +ACPICA headers (for use by device drivers), the disassembler, and the +iASL Data Table Compiler. ACPI 5.0 defines these new tables: BGRT /* Boot Graphics Resource Table */ @@ -1597,7 +1737,8 @@ The new operation region Space IDs are: Resource Descriptors: --------------------- -All new ASL resource descriptors are fully supported by the iASL compiler, +All new ASL resource descriptors are fully supported by the iASL +compiler, the ASL/AML disassembler, and the ACPICA runtime Resource Manager code (including @@ -1615,15 +1756,18 @@ ASL/AML Operators, New and Modified: One new operator is added, the Connection operator, which is used to associate -a GeneralPurposeIo or GenericSerialBus resource descriptor with individual +a GeneralPurposeIo or GenericSerialBus resource descriptor with +individual field objects within an operation region. Several new protocols are associated with the AccessAs operator. All are fully supported by the iASL compiler, disassembler, and runtime ACPICA AML interpreter: - Connection // Declare Field Connection attributes + Connection // Declare Field Connection +attributes AccessAs: AttribBytes (n) // Read/Write N-Bytes Protocol - AccessAs: AttribRawBytes (n) // Raw Read/Write N-Bytes Protocol + AccessAs: AttribRawBytes (n) // Raw Read/Write N-Bytes +Protocol AccessAs: AttribRawProcessBytes (n) // Raw Process Call Protocol RawDataBuffer // Data type for Vendor Data fields @@ -1658,7 +1802,8 @@ drivers and other host OS services: AcpiAcquireMutex and AcpiReleaseMutex: These interfaces allow the host OS to acquire and release AML mutexes that are defined in the DSDT/SSDT tables -provided by the BIOS. They are intended to be used in conjunction with the +provided by the BIOS. They are intended to be used in conjunction with +the ACPI 5.0 _DLM (Device Lock Method) in order to provide transaction-level mutual exclusion with the AML code/interpreter. @@ -1705,7 +1850,8 @@ Non-ACPI 5.0 changes for this release: 1) ACPICA Core Subsystem: -Fix a problem with operation region declarations where a failure can occur +Fix a problem with operation region declarations where a failure can +occur if the region name and an argument that evaluates to an object (such as the region address) are in different namespace scopes. Lin Ming, ACPICA BZ @@ -1757,7 +1903,8 @@ now allowed after every grammar e iASL: Fixed some possible aliasing warnings during generation. ACPICA BZ 923. -Disassembler: Fix problem with disassembly of the DataTableRegion operator +Disassembler: Fix problem with disassembly of the DataTableRegion +operator where an inadvertent "Unhandled deferred opcode" message could be generated. @@ -1785,15 +1932,18 @@ Support for ACPI 5.0 in ACPICA has been will be released at the same time that ACPI 5.0 is officially released. -The ACPI 5.0 specification is on track for release in the next few months. +The ACPI 5.0 specification is on track for release in the next few +months. 1) ACPICA Core Subsystem: Fixed a problem where the maximum sleep time for the Sleep() operator was -intended to be limited to two seconds, but was inadvertently limited to 20 +intended to be limited to two seconds, but was inadvertently limited to +20 seconds instead. -Linux and Unix makefiles: Added header file dependencies to ensure correct +Linux and Unix makefiles: Added header file dependencies to ensure +correct generation of ACPICA core code and utilities. Also simplified the makefiles considerably through the use of the vpath variable to specify search @@ -1806,8 +1956,10 @@ iASL: Implemented support to check the a created to access named Resource Descriptor fields. For example, if a resource field is -defined to be two bits, a warning is issued if a CreateXxxxField() is used -with an incorrect bit length. This is implemented for all current resource +defined to be two bits, a warning is issued if a CreateXxxxField() is +used +with an incorrect bit length. This is implemented for all current +resource descriptor names. ACPICA BZ 930. Disassembler: Fixed a byte ordering problem with the output of 24-bit and @@ -1829,13 +1981,15 @@ AML output). Includes listings, hex file iASL: Added -G option to the table compiler to allow the compilation of custom -ACPI tables. The only part of a table that is required is the standard 36- +ACPI tables. The only part of a table that is required is the standard +36- byte ACPI header. AcpiXtract: Ported to the standard ACPICA environment (with ACPICA headers), -which also adds correct 64-bit support. Also, now all output filenames are +which also adds correct 64-bit support. Also, now all output filenames +are completely lower case. AcpiExec: Ignore any non-AML tables (tables other than DSDT or SSDT) when @@ -1844,7 +1998,8 @@ exception is an FADT. This also fixes a load non-AML tables. ACPICA BZ 932. -AcpiHelp: Added the AccessAs and Offset operators. Fixed a problem where a +AcpiHelp: Added the AccessAs and Offset operators. Fixed a problem where +a missing table terminator could cause a fault when using the -p option. AcpiSrc: Fixed a possible divide-by-zero fault when generating file @@ -1875,7 +2030,8 @@ Updated the predefined name repair mecha _TSS return object if a _PSS object is present. We can only sort the _TSS return -package if there is no _PSS within the same scope. This is because if _PSS +package if there is no _PSS within the same scope. This is because if +_PSS is present, the ACPI specification dictates that the _TSS Power Dissipation field @@ -1887,9 +2043,11 @@ is. Reported by, and fixed with assistan Added an option to globally disable the control method return value validation -and repair. This runtime option can be used to disable return value repair +and repair. This runtime option can be used to disable return value +repair if -this is causing a problem on a particular machine. Also added an option to +this is causing a problem on a particular machine. Also added an option +to AcpiExec (-dr) to set this disable flag. All makefiles and project files: Major changes to improve generation of @@ -1935,11 +2093,13 @@ provides the following functionality: of arguments, and the return value data type. Find/display AML opcode name(s) -- with opcode, arguments, and grammar. - Decode/display AML opcode -- with opcode name, arguments, and grammar. + Decode/display AML opcode -- with opcode name, arguments, and +grammar. Service Layers: Make multi-thread support configurable. Conditionally compile -the multi-thread support so that threading libraries will not be linked if +the multi-thread support so that threading libraries will not be linked +if not necessary. The only tool that requires multi-thread support is AcpiExec. @@ -1972,7 +2132,8 @@ signature. Now, only allow SSDT, OEMx, a interpreter errors and kernel faults. So now, we once again allow only SSDT, OEMx, and now, also a null signature. (05/2011). -Added the missing _TDL predefined name to the global name list in order to +Added the missing _TDL predefined name to the global name list in order +to enable validation. Affects both the core ACPICA code and the iASL compiler. @@ -2039,11 +2200,14 @@ device even if there is no corresponding EmbeddedControl. Fixes a problem seen on some machines and apparently is compatible with Windows behavior. ACPICA BZ 875. -Added more predefined methods that are eligible for automatic NULL package -element removal. This change adds another group of predefined names to the +Added more predefined methods that are eligible for automatic NULL +package +element removal. This change adds another group of predefined names to +the list of names that can be repaired by having NULL package elements dynamically -removed. This group are those methods that return a single variable-length +removed. This group are those methods that return a single variable- +length package containing simple data types such as integers, buffers, strings. This includes: _ALx, _BCL, _CID,_ DOD, _EDL, _FIX, _PCL, _PLD, _PMD, _PRx, @@ -2082,7 +2246,8 @@ data size. iASL/DTC: Major update for new grammar features. Allow generic data types in -custom ACPI tables. Field names are now optional. Any line can be split to +custom ACPI tables. Field names are now optional. Any line can be split +to multiple lines using the continuation char (\). Large buffers now use line- continuation character(s) and no colon on the continuation lines. See the @@ -2108,7 +2273,8 @@ region declaration in the same scope. If useful since it probably won't be executed. ACPICA BZ 915. -iASL/DTC: Finish support for expression evaluation. Added a new expression +iASL/DTC: Finish support for expression evaluation. Added a new +expression parser that implements c-style operator precedence and parenthesization. ACPICA bugzilla @@ -2129,10 +2295,12 @@ AcpiXtract: Fix for RSDP and dynamic SSD "unusual" headers in the acpidump file. Update the header validation to support these -tables. Problem introduced in previous AcpiXtract version in the change to +tables. Problem introduced in previous AcpiXtract version in the change +to support "wrong checksum" error messages emitted by acpidump utility. -iASL: Add a * option to generate all template files (as a synonym for ALL) +iASL: Add a * option to generate all template files (as a synonym for +ALL) as in "iasl -T *" or "iasl -T ALL". @@ -2158,7 +2326,8 @@ root object was passed to the AcpiSetupG Implemented support for "spurious" Global Lock interrupts. On some systems, a -global lock interrupt can occur without the pending flag being set. Upon a +global lock interrupt can occur without the pending flag being set. Upon +a GL interrupt, we now ensure that a thread is actually waiting for the lock before @@ -2188,7 +2357,8 @@ header files, disassembler, table compil Moore, Lin Ming. -AcpiXtract: Correctly handle embedded comments and messages from AcpiDump. +AcpiXtract: Correctly handle embedded comments and messages from +AcpiDump. Apparently some or all versions of acpidump will occasionally emit a comment like @@ -2209,8 +2379,10 @@ for a user-defined address space. This i 1) ACPI CA Core Subsystem: -Added a mechanism to defer _REG methods for some early-installed handlers. -Most user handlers should be installed before call to AcpiEnableSubsystem. +Added a mechanism to defer _REG methods for some early-installed +handlers. +Most user handlers should be installed before call to +AcpiEnableSubsystem. However, Event handlers and region handlers should be installed after AcpiInitializeObjects. Override handlers for the "default" regions should be @@ -2222,15 +2394,18 @@ Implemented an optimization for GPE dete simply ignore GPE registers that contain no enabled GPEs -- there is no need to read the register since this information is available internally. This -becomes more important on machines with a large GPE space. ACPICA bugzilla +becomes more important on machines with a large GPE space. ACPICA +bugzilla 884. Lin Ming. Suggestion from Joe Liu. -Removed all use of the highly unreliable FADT revision field. The revision +Removed all use of the highly unreliable FADT revision field. The +revision number in the FADT has been found to be completely unreliable and cannot be trusted. Only the actual table length can be used to infer the version. This -change updates the ACPICA core and the disassembler so that both no longer +change updates the ACPICA core and the disassembler so that both no +longer even look at the FADT version and instead depend solely upon the FADT length. @@ -2278,7 +2453,8 @@ global handlers. installation status -- default or user-installed handler will be used. -iASL: Warn if reserved method incorrectly returns a value. Many predefined +iASL: Warn if reserved method incorrectly returns a value. Many +predefined names are defined such that they do not return a value. If implemented as a method, issue a warning if such a name explicitly returns a value. ACPICA @@ -2311,7 +2487,8 @@ a single screen, instead of help subcomm Fixed a race condition between method execution and namespace walks that can possibly cause a fault. The problem was apparently introduced in version -20100528 as a result of a performance optimization that reduces the number +20100528 as a result of a performance optimization that reduces the +number of namespace walks upon method exit by using the delete_namespace_subtree function instead of the delete_namespace_by_owner function used @@ -2323,7 +2500,8 @@ Fixed several issues and a possible faul method support. History: This support changes a method to "serialized" on the fly if the method generates an AE_ALREADY_EXISTS error, indicating the -possibility that it cannot handle reentrancy. This fix repairs a couple of +possibility that it cannot handle reentrancy. This fix repairs a couple +of issues seen in the field, especially on machines with many cores: 1) Delete method children only upon the exit of the last thread, @@ -2380,7 +2558,8 @@ much larger code and data size. iASL: Added generic data types to the Data Table compiler. Add "generic" data -types such as UINT32, String, Unicode, etc., to simplify the generation of +types such as UINT32, String, Unicode, etc., to simplify the generation +of platform-defined tables such as UEFI. Lin Ming. iASL: Added listing support for the Data Table Compiler. Adds listing @@ -2407,15 +2586,18 @@ a handful of new interfaces: One new file, evxfgpe.c to consolidate all external GPE interfaces. See the ACPICA Programmer Reference for full details and programming -information. See the new section 4.4 "General Purpose Event (GPE) Support" +information. See the new section 4.4 "General Purpose Event (GPE) +Support" for a full overview, and section 8.7 "ACPI General Purpose Event Management" -for programming details. ACPICA BZ 858,870,877. Matthew Garrett, Lin Ming, +for programming details. ACPICA BZ 858,870,877. Matthew Garrett, Lin +Ming, Bob Moore, Rafael Wysocki. Implemented a new GPE feature for Windows compatibility, the "Implicit Wake -GPE Notify". This feature will automatically issue a Notify(2) on a device +GPE Notify". This feature will automatically issue a Notify(2) on a +device when a Wake GPE is received if there is no corresponding GPE method or handler. ACPICA BZ 870. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 22:04:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D376C4A5; Fri, 26 Jul 2013 22:04:13 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BF151231F; Fri, 26 Jul 2013 22:04:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6QM4DKr048117; Fri, 26 Jul 2013 22:04:13 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6QM4BYi048101; Fri, 26 Jul 2013 22:04:11 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201307262204.r6QM4BYi048101@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 26 Jul 2013 22:04:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253691 - in head: sys/conf sys/dev/cxgbe sys/dev/cxgbe/common sys/modules/cxgbe/if_cxgbe tools/tools/cxgbetool X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 22:04:13 -0000 Author: np Date: Fri Jul 26 22:04:11 2013 New Revision: 253691 URL: http://svnweb.freebsd.org/changeset/base/253691 Log: Add support for packet-sniffing tracers to cxgbe(4). This works with all T4 and T5 based cards and is useful for analyzing TSO, LRO, TOE, and for general purpose monitoring without tapping any cxgbe or cxl ifnet directly. Tracers on the T4/T5 chips provide access to Ethernet frames exactly as they were received from or transmitted on the wire. On transmit, a tracer will capture a frame after TSO segmentation, hw VLAN tag insertion, hw L3 & L4 checksum insertion, etc. It will also capture frames generated by the TCP offload engine (TOE traffic is normally invisible to the kernel). On receive, a tracer will capture a frame before hw VLAN extraction, runt filtering, other badness filtering, before the steering/drop/L2-rewrite filters or the TOE have had a go at it, and of course before sw LRO in the driver. There are 4 tracers on a chip. A tracer can trace only in one direction (tx or rx). For now cxgbetool will set up tracers to capture the first 128B of every transmitted or received frame on a given port. This is a small subset of what the hardware can do. A pseudo ifnet with the same name as the nexus driver (t4nex0 or t5nex0) will be created for tracing. The data delivered to this ifnet is an additional copy made inside the chip. Normal delivery to cxgbe or cxl will be made as usual. /* watch cxl0, which is the first port hanging off t5nex0. */ # cxgbetool t5nex0 tracer 0 tx0 (watch what cxl0 is transmitting) # cxgbetool t5nex0 tracer 1 rx0 (watch what cxl0 is receiving) # cxgbetool t5nex0 tracer list # tcpdump -i t5nex0 <== all that cxl0 sees and puts on the wire If you were doing TSO, a tcpdump on cxl0 may have shown you ~64K "frames" with no L3/L4 checksum but this will show you the frames that were actually transmitted. /* all done */ # cxgbetool t5nex0 tracer 0 disable # cxgbetool t5nex0 tracer 1 disable # cxgbetool t5nex0 tracer list # ifconfig t5nex0 destroy Added: head/sys/dev/cxgbe/t4_tracer.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/common/t4_hw.h head/sys/dev/cxgbe/t4_ioctl.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c head/sys/modules/cxgbe/if_cxgbe/Makefile head/tools/tools/cxgbetool/cxgbetool.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Jul 26 21:34:09 2013 (r253690) +++ head/sys/conf/files Fri Jul 26 22:04:11 2013 (r253691) @@ -1155,6 +1155,8 @@ dev/cxgbe/t4_sge.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/t4_l2t.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/t4_tracer.c optional cxgbe pci \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/common/t4_hw.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" t4fw_cfg.c optional cxgbe \ Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Fri Jul 26 21:34:09 2013 (r253690) +++ head/sys/dev/cxgbe/adapter.h Fri Jul 26 22:04:11 2013 (r253691) @@ -172,6 +172,7 @@ enum { DOOMED = (1 << 0), PORT_INIT_DONE = (1 << 1), PORT_SYSCTL_CTX = (1 << 2), + HAS_TRACEQ = (1 << 3), }; #define IS_DOOMED(pi) ((pi)->flags & DOOMED) @@ -577,6 +578,14 @@ struct adapter { #endif int flags; + char ifp_lockname[16]; + struct mtx ifp_lock; + struct ifnet *ifp; /* tracer ifp */ + struct ifmedia media; + int traceq; /* iq used by all tracers, -1 if none */ + int tracer_valid; /* bitmap of valid tracers */ + int tracer_enabled; /* bitmap of enabled tracers */ + char fw_version[32]; char cfg_file[32]; u_int cfcsum; @@ -808,6 +817,16 @@ int t4_eth_tx(struct ifnet *, struct sge void t4_update_fl_bufsize(struct ifnet *); int can_resume_tx(struct sge_eq *); +/* t4_tracer.c */ +struct t4_tracer; +void t4_tracer_modload(void); +void t4_tracer_modunload(void); +void t4_tracer_port_detach(struct adapter *); +int t4_get_tracer(struct adapter *, struct t4_tracer *); +int t4_set_tracer(struct adapter *, struct t4_tracer *); +int t4_trace_pkt(struct sge_iq *, const struct rss_header *, struct mbuf *); +int t5_trace_pkt(struct sge_iq *, const struct rss_header *, struct mbuf *); + static inline struct wrqe * alloc_wrqe(int wr_len, struct sge_wrq *wrq) { Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Fri Jul 26 21:34:09 2013 (r253690) +++ head/sys/dev/cxgbe/common/t4_hw.c Fri Jul 26 22:04:11 2013 (r253691) @@ -3624,22 +3624,24 @@ void t4_get_chan_txrate(struct adapter * * @idx: which filter to configure * @enable: whether to enable or disable the filter * - * Configures one of the tracing filters available in HW. If @enable is - * %0 @tp is not examined and may be %NULL. The user is responsible to - * set the single/multiple trace mode by writing to A_MPS_TRC_CFG register - * by using "cxgbtool iface reg reg_addr=val" command. See t4_sniffer/ - * docs/readme.txt for a complete description of how to setup traceing on - * T4. + * Configures one of the tracing filters available in HW. If @tp is %NULL + * it indicates that the filter is already written in the register and it + * just needs to be enabled or disabled. */ -int t4_set_trace_filter(struct adapter *adap, const struct trace_params *tp, int idx, - int enable) +int t4_set_trace_filter(struct adapter *adap, const struct trace_params *tp, + int idx, int enable) { int i, ofst = idx * 4; u32 data_reg, mask_reg, cfg; u32 multitrc = F_TRCMULTIFILTER; + u32 en = is_t4(adap) ? F_TFEN : F_T5_TFEN; - if (!enable) { - t4_write_reg(adap, A_MPS_TRC_FILTER_MATCH_CTL_A + ofst, 0); + if (idx < 0 || idx >= NTRACE) + return -EINVAL; + + if (tp == NULL || !enable) { + t4_set_reg_field(adap, A_MPS_TRC_FILTER_MATCH_CTL_A + ofst, en, + enable ? en : 0); return 0; } @@ -3660,8 +3662,7 @@ int t4_set_trace_filter(struct adapter * */ if (tp->snap_len > ((10 * 1024 / 4) - (2 * 8))) return -EINVAL; - } - else { + } else { /* * If multiple tracers are disabled, to avoid deadlocks * maximum packet capture size of 9600 bytes is recommended. @@ -3672,12 +3673,13 @@ int t4_set_trace_filter(struct adapter * return -EINVAL; } - if (tp->port > 11 || tp->invert > 1 || tp->skip_len > M_TFLENGTH || - tp->skip_ofst > M_TFOFFSET || tp->min_len > M_TFMINPKTSIZE) + if (tp->port > (is_t4(adap) ? 11 : 19) || tp->invert > 1 || + tp->skip_len > M_TFLENGTH || tp->skip_ofst > M_TFOFFSET || + tp->min_len > M_TFMINPKTSIZE) return -EINVAL; /* stop the tracer we'll be changing */ - t4_write_reg(adap, A_MPS_TRC_FILTER_MATCH_CTL_A + ofst, 0); + t4_set_reg_field(adap, A_MPS_TRC_FILTER_MATCH_CTL_A + ofst, en, 0); idx *= (A_MPS_TRC_FILTER1_MATCH - A_MPS_TRC_FILTER0_MATCH); data_reg = A_MPS_TRC_FILTER0_MATCH + idx; @@ -3691,11 +3693,10 @@ int t4_set_trace_filter(struct adapter * V_TFCAPTUREMAX(tp->snap_len) | V_TFMINPKTSIZE(tp->min_len)); t4_write_reg(adap, A_MPS_TRC_FILTER_MATCH_CTL_A + ofst, - V_TFOFFSET(tp->skip_ofst) | V_TFLENGTH(tp->skip_len) | - is_t4(adap) ? - V_TFPORT(tp->port) | F_TFEN | V_TFINVERTMATCH(tp->invert) : - V_T5_TFPORT(tp->port) | F_T5_TFEN | - V_T5_TFINVERTMATCH(tp->invert)); + V_TFOFFSET(tp->skip_ofst) | V_TFLENGTH(tp->skip_len) | en | + (is_t4(adap) ? + V_TFPORT(tp->port) | V_TFINVERTMATCH(tp->invert) : + V_T5_TFPORT(tp->port) | V_T5_TFINVERTMATCH(tp->invert))); return 0; } @@ -3722,15 +3723,16 @@ void t4_get_trace_filter(struct adapter if (is_t4(adap)) { *enabled = !!(ctla & F_TFEN); tp->port = G_TFPORT(ctla); + tp->invert = !!(ctla & F_TFINVERTMATCH); } else { *enabled = !!(ctla & F_T5_TFEN); tp->port = G_T5_TFPORT(ctla); + tp->invert = !!(ctla & F_T5_TFINVERTMATCH); } tp->snap_len = G_TFCAPTUREMAX(ctlb); tp->min_len = G_TFMINPKTSIZE(ctlb); tp->skip_ofst = G_TFOFFSET(ctla); tp->skip_len = G_TFLENGTH(ctla); - tp->invert = !!(ctla & F_TFINVERTMATCH); ofst = (A_MPS_TRC_FILTER1_MATCH - A_MPS_TRC_FILTER0_MATCH) * idx; data_reg = A_MPS_TRC_FILTER0_MATCH + ofst; Modified: head/sys/dev/cxgbe/common/t4_hw.h ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.h Fri Jul 26 21:34:09 2013 (r253690) +++ head/sys/dev/cxgbe/common/t4_hw.h Fri Jul 26 22:04:11 2013 (r253691) @@ -45,6 +45,7 @@ enum { NTX_SCHED = 8, /* # of HW Tx scheduling queues */ PM_NSTATS = 5, /* # of PM stats */ MBOX_LEN = 64, /* mailbox size in bytes */ + NTRACE = 4, /* # of tracing filters */ TRACE_LEN = 112, /* length of trace data and mask */ FILTER_OPT_LEN = 36, /* filter tuple width of optional components */ NWOL_PAT = 8, /* # of WoL patterns */ Modified: head/sys/dev/cxgbe/t4_ioctl.h ============================================================================== --- head/sys/dev/cxgbe/t4_ioctl.h Fri Jul 26 21:34:09 2013 (r253690) +++ head/sys/dev/cxgbe/t4_ioctl.h Fri Jul 26 22:04:11 2013 (r253691) @@ -54,6 +54,8 @@ enum { T4_SET_OFLD_POLICY, /* Set offload policy */ T4_SET_SCHED_CLASS, /* set sched class */ T4_SET_SCHED_QUEUE, /* set queue class */ + T4_GET_TRACER, /* get information about a tracer */ + T4_SET_TRACER, /* program a tracer */ }; struct t4_reg { @@ -226,6 +228,25 @@ struct t4_mem_range { uint32_t *data; }; +#define T4_TRACE_LEN 112 +struct t4_trace_params { + uint32_t data[T4_TRACE_LEN / 4]; + uint32_t mask[T4_TRACE_LEN / 4]; + uint16_t snap_len; + uint16_t min_len; + uint8_t skip_ofst; + uint8_t skip_len; + uint8_t invert; + uint8_t port; +}; + +struct t4_tracer { + uint8_t idx; + uint8_t enabled; + uint8_t valid; + struct t4_trace_params tp; +}; + #define CHELSIO_T4_GETREG _IOWR('f', T4_GETREG, struct t4_reg) #define CHELSIO_T4_SETREG _IOW('f', T4_SETREG, struct t4_reg) #define CHELSIO_T4_REGDUMP _IOWR('f', T4_REGDUMP, struct t4_regdump) @@ -240,4 +261,6 @@ struct t4_mem_range { #define CHELSIO_T4_GET_MEM _IOW('f', T4_GET_MEM, struct t4_mem_range) #define CHELSIO_T4_GET_I2C _IOWR('f', T4_GET_I2C, struct t4_i2c_data) #define CHELSIO_T4_CLEAR_STATS _IOW('f', T4_CLEAR_STATS, uint32_t) +#define CHELSIO_T4_GET_TRACER _IOWR('f', T4_GET_TRACER, struct t4_tracer) +#define CHELSIO_T4_SET_TRACER _IOW('f', T4_SET_TRACER, struct t4_tracer) #endif Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Jul 26 21:34:09 2013 (r253690) +++ head/sys/dev/cxgbe/t4_main.c Fri Jul 26 22:04:11 2013 (r253691) @@ -557,6 +557,11 @@ t4_attach(device_t dev) pci_write_config(dev, i + PCIER_DEVICE_CTL, v, 2); } + sc->traceq = -1; + mtx_init(&sc->ifp_lock, sc->ifp_lockname, 0, MTX_DEF); + snprintf(sc->ifp_lockname, sizeof(sc->ifp_lockname), "%s tracer", + device_get_nameunit(dev)); + snprintf(sc->lockname, sizeof(sc->lockname), "%s", device_get_nameunit(dev)); mtx_init(&sc->sc_lock, sc->lockname, 0, MTX_DEF); @@ -588,8 +593,11 @@ t4_attach(device_t dev) for (i = 0; i < nitems(sc->fw_msg_handler); i++) sc->fw_msg_handler[i] = fw_msg_not_handled; t4_register_cpl_handler(sc, CPL_SET_TCB_RPL, t4_filter_rpl); + t4_register_cpl_handler(sc, CPL_TRACE_PKT, t4_trace_pkt); + t4_register_cpl_handler(sc, CPL_TRACE_PKT_T5, t5_trace_pkt); t4_init_sge_cpl_handlers(sc); + /* Prepare the adapter for operation */ rc = -t4_prep_adapter(sc); if (rc != 0) { @@ -668,6 +676,7 @@ t4_attach(device_t dev) snprintf(pi->lockname, sizeof(pi->lockname), "%sp%d", device_get_nameunit(dev), i); mtx_init(&pi->pi_lock, pi->lockname, 0, MTX_DEF); + sc->chan_map[pi->tx_chan] = i; if (is_10G_port(pi) || is_40G_port(pi)) { n10g++; @@ -916,6 +925,8 @@ t4_detach(device_t dev) mtx_destroy(&sc->tids.ftid_lock); if (mtx_initialized(&sc->sfl_lock)) mtx_destroy(&sc->sfl_lock); + if (mtx_initialized(&sc->ifp_lock)) + mtx_destroy(&sc->ifp_lock); bzero(sc, sizeof(*sc)); @@ -1018,6 +1029,11 @@ cxgbe_detach(device_t dev) #endif ADAPTER_UNLOCK(sc); + if (pi->flags & HAS_TRACEQ) { + sc->traceq = -1; /* cloner should not create ifnet */ + t4_tracer_port_detach(sc); + } + if (pi->vlan_c) EVENTHANDLER_DEREGISTER(vlan_config, pi->vlan_c); @@ -2887,6 +2903,17 @@ cxgbe_init_synchronized(struct port_info goto done; } + /* + * The first iq of the first port to come up is used for tracing. + */ + if (sc->traceq < 0) { + sc->traceq = sc->sge.rxq[pi->first_rxq].iq.abs_id; + t4_write_reg(sc, is_t4(sc) ? A_MPS_TRC_RSS_CONTROL : + A_MPS_T5_TRC_RSS_CONTROL, V_RSSCONTROL(pi->tx_chan) | + V_QUEUENUMBER(sc->traceq)); + pi->flags |= HAS_TRACEQ; + } + /* all ok */ setbit(&sc->open_device_map, pi->port_id); PORT_LOCK(pi); @@ -7414,6 +7441,12 @@ t4_ioctl(struct cdev *dev, unsigned long } break; } + case CHELSIO_T4_GET_TRACER: + rc = t4_get_tracer(sc, (struct t4_tracer *)data); + break; + case CHELSIO_T4_SET_TRACER: + rc = t4_set_tracer(sc, (struct t4_tracer *)data); + break; default: rc = EINVAL; } @@ -7650,12 +7683,14 @@ mod_event(module_t mod, int cmd, void *a mtx_init(&t4_uld_list_lock, "T4 ULDs", 0, MTX_DEF); SLIST_INIT(&t4_uld_list); #endif + t4_tracer_modload(); tweak_tunables(); break; case MOD_UNLOAD: if (atomic_fetchadd_int(&loaded, -1) > 1) break; + t4_tracer_modunload(); #ifdef TCP_OFFLOAD mtx_lock(&t4_uld_list_lock); if (!SLIST_EMPTY(&t4_uld_list)) { Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Fri Jul 26 21:34:09 2013 (r253690) +++ head/sys/dev/cxgbe/t4_sge.c Fri Jul 26 22:04:11 2013 (r253691) @@ -276,7 +276,6 @@ t4_init_sge_cpl_handlers(struct adapter t4_register_cpl_handler(sc, CPL_FW6_MSG, handle_fw_msg); t4_register_cpl_handler(sc, CPL_SGE_EGR_UPDATE, handle_sge_egr_update); t4_register_cpl_handler(sc, CPL_RX_PKT, t4_eth_rx); - t4_register_fw_msg_handler(sc, FW6_TYPE_CMD_RPL, t4_handle_fw_rpl); } Added: head/sys/dev/cxgbe/t4_tracer.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/t4_tracer.c Fri Jul 26 22:04:11 2013 (r253691) @@ -0,0 +1,519 @@ +/*- + * Copyright (c) 2013 Chelsio Communications, Inc. + * All rights reserved. + * Written by: Navdeep Parhar + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" +#include "opt_inet6.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "common/common.h" +#include "common/t4_msg.h" +#include "common/t4_regs.h" +#include "t4_ioctl.h" + +/* + * Locking notes + * ============= + * + * An interface cloner is registered during mod_load and it can be used to + * create or destroy the tracing ifnet for an adapter at any time. It is + * possible for the cloned interface to outlive the adapter (adapter disappears + * in t4_detach but the tracing ifnet may live till mod_unload when removal of + * the cloner finally destroys any remaining cloned interfaces). When tracing + * filters are active, this ifnet is also receiving data. There are potential + * bad races between ifnet create, ifnet destroy, ifnet rx, ifnet ioctl, + * cxgbe_detach/t4_detach, mod_unload. + * + * a) The driver selects an iq for tracing (sc->traceq) inside a synch op. The + * iq is destroyed inside a synch op too (and sc->traceq updated). + * b) The cloner looks for an adapter that matches the name of the ifnet it's + * been asked to create, starts a synch op on that adapter, and proceeds only + * if the adapter has a tracing iq. + * c) The cloned ifnet and the adapter are coupled to each other via + * ifp->if_softc and sc->ifp. These can be modified only with the global + * t4_trace_lock sx as well as the sc->ifp_lock mutex held. Holding either + * of these will prevent any change. + * + * The order in which all the locks involved should be acquired are: + * t4_list_lock + * adapter lock + * (begin synch op and let go of the above two) + * t4_trace_lock + * sc->ifp_lock + */ + +static struct sx t4_trace_lock; +static const char *t4_cloner_name = "tXnex"; +static struct if_clone *t4_cloner; + +/* tracer ifnet routines. mostly no-ops. */ +static void tracer_init(void *); +static int tracer_ioctl(struct ifnet *, unsigned long, caddr_t); +static int tracer_transmit(struct ifnet *, struct mbuf *); +static void tracer_qflush(struct ifnet *); +static int tracer_media_change(struct ifnet *); +static void tracer_media_status(struct ifnet *, struct ifmediareq *); + +/* match name (request/response) */ +struct match_rr { + const char *name; + int lock; /* set to 1 to returned sc locked. */ + struct adapter *sc; + int rc; +}; + +static void +match_name(struct adapter *sc, void *arg) +{ + struct match_rr *mrr = arg; + + if (strcmp(device_get_nameunit(sc->dev), mrr->name) != 0) + return; + + KASSERT(mrr->sc == NULL, ("%s: multiple matches (%p, %p) for %s", + __func__, mrr->sc, sc, mrr->name)); + + mrr->sc = sc; + if (mrr->lock) + mrr->rc = begin_synchronized_op(mrr->sc, NULL, 0, "t4clon"); + else + mrr->rc = 0; +} + +static int +t4_cloner_match(struct if_clone *ifc, const char *name) +{ + struct match_rr mrr; + + mrr.name = name; + mrr.lock = 0; + mrr.sc = NULL; + t4_iterate(match_name, &mrr); + + return (mrr.sc != NULL); +} + +static int +t4_cloner_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) +{ + struct match_rr mrr; + struct adapter *sc; + struct ifnet *ifp; + int rc, unit; + const uint8_t lla[ETHER_ADDR_LEN] = {0, 0, 0, 0, 0, 0}; + + mrr.name = name; + mrr.lock = 1; + mrr.sc = NULL; + mrr.rc = ENOENT; + t4_iterate(match_name, &mrr); + + if (mrr.rc != 0) + return (mrr.rc); + sc = mrr.sc; + + KASSERT(sc != NULL, ("%s: name (%s) matched but softc is NULL", + __func__, name)); + ASSERT_SYNCHRONIZED_OP(sc); + + sx_xlock(&t4_trace_lock); + + if (sc->ifp != NULL) { + rc = EEXIST; + goto done; + } + if (sc->traceq < 0) { + rc = EAGAIN; + goto done; + } + + + unit = -1; + rc = ifc_alloc_unit(ifc, &unit); + if (rc != 0) + goto done; + + ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { + ifc_free_unit(ifc, unit); + rc = ENOMEM; + goto done; + } + + /* Note that if_xname is not . */ + strlcpy(ifp->if_xname, name, sizeof(ifp->if_xname)); + ifp->if_dname = t4_cloner_name; + ifp->if_dunit = unit; + ifp->if_init = tracer_init; + ifp->if_flags = IFF_SIMPLEX | IFF_DRV_RUNNING; + ifp->if_ioctl = tracer_ioctl; + ifp->if_transmit = tracer_transmit; + ifp->if_qflush = tracer_qflush; + ifp->if_capabilities = IFCAP_JUMBO_MTU | IFCAP_VLAN_MTU; + ifmedia_init(&sc->media, IFM_IMASK, tracer_media_change, + tracer_media_status); + ifmedia_add(&sc->media, IFM_ETHER | IFM_FDX | IFM_NONE, 0, NULL); + ifmedia_set(&sc->media, IFM_ETHER | IFM_FDX | IFM_NONE); + ether_ifattach(ifp, lla); + if_up(ifp); + + mtx_lock(&sc->ifp_lock); + ifp->if_softc = sc; + sc->ifp = ifp; + mtx_unlock(&sc->ifp_lock); +done: + sx_xunlock(&t4_trace_lock); + end_synchronized_op(sc, 0); + return (rc); +} + +static int +t4_cloner_destroy(struct if_clone *ifc, struct ifnet *ifp) +{ + struct adapter *sc; + int unit = ifp->if_dunit; + + sx_xlock(&t4_trace_lock); + sc = ifp->if_softc; + if (sc != NULL) { + mtx_lock(&sc->ifp_lock); + sc->ifp = NULL; + ifp->if_softc = NULL; + mtx_unlock(&sc->ifp_lock); + ifmedia_removeall(&sc->media); + } + ether_ifdetach(ifp); + if_free(ifp); + ifc_free_unit(ifc, unit); + sx_xunlock(&t4_trace_lock); + + return (0); +} + +void +t4_tracer_modload() +{ + + sx_init(&t4_trace_lock, "T4/T5 tracer lock"); + t4_cloner = if_clone_advanced(t4_cloner_name, 0, t4_cloner_match, + t4_cloner_create, t4_cloner_destroy); +} + +void +t4_tracer_modunload() +{ + + if (t4_cloner != NULL) { + /* + * The module is being unloaded so the nexus drivers have + * detached. The tracing interfaces can not outlive the nexus + * (ifp->if_softc is the nexus) and must have been destroyed + * already. XXX: but if_clone is opaque to us and we can't + * assert LIST_EMPTY(&t4_cloner->ifc_iflist) at this time. + */ + if_clone_detach(t4_cloner); + } + sx_destroy(&t4_trace_lock); +} + +void +t4_tracer_port_detach(struct adapter *sc) +{ + + sx_xlock(&t4_trace_lock); + if (sc->ifp != NULL) { + mtx_lock(&sc->ifp_lock); + sc->ifp->if_softc = NULL; + sc->ifp = NULL; + mtx_unlock(&sc->ifp_lock); + } + ifmedia_removeall(&sc->media); + sx_xunlock(&t4_trace_lock); +} + +int +t4_get_tracer(struct adapter *sc, struct t4_tracer *t) +{ + int rc, i, enabled; + struct trace_params tp; + + if (t->idx >= NTRACE) { + t->idx = 0xff; + t->enabled = 0; + t->valid = 0; + return (0); + } + + rc = begin_synchronized_op(sc, NULL, HOLD_LOCK | SLEEP_OK | INTR_OK, + "t4gett"); + if (rc) + return (rc); + + for (i = t->idx; i < NTRACE; i++) { + if (isset(&sc->tracer_valid, t->idx)) { + t4_get_trace_filter(sc, &tp, i, &enabled); + t->idx = i; + t->enabled = enabled; + t->valid = 1; + memcpy(&t->tp.data[0], &tp.data[0], sizeof(t->tp.data)); + memcpy(&t->tp.mask[0], &tp.mask[0], sizeof(t->tp.mask)); + t->tp.snap_len = tp.snap_len; + t->tp.min_len = tp.min_len; + t->tp.skip_ofst = tp.skip_ofst; + t->tp.skip_len = tp.skip_len; + t->tp.invert = tp.invert; + + /* convert channel to port iff 0 <= port < 8. */ + if (tp.port < 4) + t->tp.port = sc->chan_map[tp.port]; + else if (tp.port < 8) + t->tp.port = sc->chan_map[tp.port - 4] + 4; + else + t->tp.port = tp.port; + + goto done; + } + } + + t->idx = 0xff; + t->enabled = 0; + t->valid = 0; +done: + end_synchronized_op(sc, LOCK_HELD); + + return (rc); +} + +int +t4_set_tracer(struct adapter *sc, struct t4_tracer *t) +{ + int rc; + struct trace_params tp, *tpp; + + if (t->idx >= NTRACE) + return (EINVAL); + + rc = begin_synchronized_op(sc, NULL, HOLD_LOCK | SLEEP_OK | INTR_OK, + "t4sett"); + if (rc) + return (rc); + + /* + * If no tracing filter is specified this time then check if the filter + * at the index is valid anyway because it was set previously. If so + * then this is a legitimate enable/disable operation. + */ + if (t->valid == 0) { + if (isset(&sc->tracer_valid, t->idx)) + tpp = NULL; + else + rc = EINVAL; + goto done; + } + + if (t->tp.port > 19 || t->tp.snap_len > 9600 || + t->tp.min_len > M_TFMINPKTSIZE || t->tp.skip_len > M_TFLENGTH || + t->tp.skip_ofst > M_TFOFFSET) { + rc = EINVAL; + goto done; + } + + memcpy(&tp.data[0], &t->tp.data[0], sizeof(tp.data)); + memcpy(&tp.mask[0], &t->tp.mask[0], sizeof(tp.mask)); + tp.snap_len = t->tp.snap_len; + tp.min_len = t->tp.min_len; + tp.skip_ofst = t->tp.skip_ofst; + tp.skip_len = t->tp.skip_len; + tp.invert = !!t->tp.invert; + + /* convert port to channel iff 0 <= port < 8. */ + if (t->tp.port < 4) { + if (sc->port[t->tp.port] == NULL) { + rc = EINVAL; + goto done; + } + tp.port = sc->port[t->tp.port]->tx_chan; + } else if (t->tp.port < 8) { + if (sc->port[t->tp.port - 4] == NULL) { + rc = EINVAL; + goto done; + } + tp.port = sc->port[t->tp.port - 4]->tx_chan + 4; + } + tpp = &tp; +done: + if (rc == 0) { + rc = -t4_set_trace_filter(sc, tpp, t->idx, t->enabled); + if (rc == 0) { + if (t->enabled) { + setbit(&sc->tracer_valid, t->idx); + if (sc->tracer_enabled == 0) { + t4_set_reg_field(sc, A_MPS_TRC_CFG, + F_TRCEN, F_TRCEN); + } + setbit(&sc->tracer_enabled, t->idx); + } else { + clrbit(&sc->tracer_enabled, t->idx); + if (sc->tracer_enabled == 0) { + t4_set_reg_field(sc, A_MPS_TRC_CFG, + F_TRCEN, 0); + } + } + } + } + end_synchronized_op(sc, LOCK_HELD); + + return (rc); +} + +int +t4_trace_pkt(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) +{ + struct adapter *sc = iq->adapter; + struct ifnet *ifp; + + KASSERT(m != NULL, ("%s: no payload with opcode %02x", __func__, + rss->opcode)); + + mtx_lock(&sc->ifp_lock); + ifp = sc->ifp; + if (sc->ifp) { + m_adj(m, sizeof(struct cpl_trace_pkt)); + m->m_pkthdr.rcvif = ifp; + ETHER_BPF_MTAP(ifp, m); + } + mtx_unlock(&sc->ifp_lock); + m_freem(m); + + return (0); +} + +int +t5_trace_pkt(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) +{ + struct adapter *sc = iq->adapter; + struct ifnet *ifp; + + KASSERT(m != NULL, ("%s: no payload with opcode %02x", __func__, + rss->opcode)); + + mtx_lock(&sc->ifp_lock); + ifp = sc->ifp; + if (ifp != NULL) { + m_adj(m, sizeof(struct cpl_t5_trace_pkt)); + m->m_pkthdr.rcvif = ifp; + ETHER_BPF_MTAP(ifp, m); + } + mtx_unlock(&sc->ifp_lock); + m_freem(m); + + return (0); +} + + +static void +tracer_init(void *arg) +{ + + return; +} + +static int +tracer_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data) +{ + int rc = 0; + struct adapter *sc; + struct ifreq *ifr = (struct ifreq *)data; + + switch (cmd) { + case SIOCSIFMTU: + case SIOCSIFFLAGS: + case SIOCADDMULTI: + case SIOCDELMULTI: + case SIOCSIFCAP: + break; + case SIOCSIFMEDIA: + case SIOCGIFMEDIA: + sx_xlock(&t4_trace_lock); + sc = ifp->if_softc; + if (sc == NULL) + rc = EIO; + else + rc = ifmedia_ioctl(ifp, ifr, &sc->media, cmd); + sx_xunlock(&t4_trace_lock); + break; + default: + rc = ether_ioctl(ifp, cmd, data); + } + + return (rc); +} + +static int +tracer_transmit(struct ifnet *ifp, struct mbuf *m) +{ + + m_freem(m); + return (0); +} + +static void +tracer_qflush(struct ifnet *ifp) +{ + + return; +} + +static int +tracer_media_change(struct ifnet *ifp) +{ + + return (EOPNOTSUPP); +} + +static void +tracer_media_status(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + + ifmr->ifm_status = IFM_AVALID | IFM_ACTIVE; + + return; +} Modified: head/sys/modules/cxgbe/if_cxgbe/Makefile ============================================================================== --- head/sys/modules/cxgbe/if_cxgbe/Makefile Fri Jul 26 21:34:09 2013 (r253690) +++ head/sys/modules/cxgbe/if_cxgbe/Makefile Fri Jul 26 22:04:11 2013 (r253691) @@ -8,7 +8,7 @@ CXGBE = ${.CURDIR}/../../../dev/cxgbe .PATH: ${CXGBE} ${CXGBE}/common KMOD = if_cxgbe -SRCS = t4_main.c t4_sge.c t4_l2t.c +SRCS = t4_main.c t4_sge.c t4_l2t.c t4_tracer.c SRCS+= t4_hw.c SRCS+= device_if.h bus_if.h pci_if.h SRCS+= opt_inet.h opt_inet6.h Modified: head/tools/tools/cxgbetool/cxgbetool.c ============================================================================== --- head/tools/tools/cxgbetool/cxgbetool.c Fri Jul 26 21:34:09 2013 (r253690) +++ head/tools/tools/cxgbetool/cxgbetool.c Fri Jul 26 22:04:11 2013 (r253691) @@ -98,6 +98,9 @@ usage(FILE *fp) "\tregdump [] ... dump registers\n" "\tstdio interactive mode\n" "\ttcb read TCB\n" + "\ttracer tx|rx set and enable a tracer)\n" + "\ttracer disable|enable disable or enable a tracer\n" + "\ttracer list list all tracers\n" ); } @@ -1658,6 +1661,203 @@ clearstats(int argc, const char *argv[]) } static int +show_tracers(void) +{ + struct t4_tracer t; + char *s; + int rc, port_idx, i; + long long val; + + /* Magic values: MPS_TRC_CFG = 0x9800. MPS_TRC_CFG[1:1] = TrcEn */ + rc = read_reg(0x9800, 4, &val); + if (rc != 0) + return (rc); + printf("tracing is %s\n", val & 2 ? "ENABLED" : "DISABLED"); + + t.idx = 0; + for (t.idx = 0; ; t.idx++) { + rc = doit(CHELSIO_T4_GET_TRACER, &t); + if (rc != 0 || t.idx == 0xff) + break; + + if (t.tp.port < 4) { + s = "Rx"; + port_idx = t.tp.port; + } else if (t.tp.port < 8) { + s = "Tx"; + port_idx = t.tp.port - 4; + } else if (t.tp.port < 12) { + s = "loopback"; + port_idx = t.tp.port - 8; + } else if (t.tp.port < 16) { + s = "MPS Rx"; + port_idx = t.tp.port - 12; + } else if (t.tp.port < 20) { + s = "MPS Tx"; + port_idx = t.tp.port - 16; + } else { + s = "unknown"; + port_idx = t.tp.port; + } + + printf("\ntracer %u (currently %s) captures ", t.idx, + t.enabled ? "ENABLED" : "DISABLED"); + if (t.tp.port < 8) + printf("port %u %s, ", port_idx, s); + else + printf("%s %u, ", s, port_idx); + printf("snap length: %u, min length: %u\n", t.tp.snap_len, + t.tp.min_len); + printf("packets captured %smatch filter\n", + t.tp.invert ? "do not " : ""); + if (t.tp.skip_ofst) { + printf("filter pattern: "); + for (i = 0; i < t.tp.skip_ofst * 2; i += 2) + printf("%08x%08x", t.tp.data[i], + t.tp.data[i + 1]); + printf("/"); + for (i = 0; i < t.tp.skip_ofst * 2; i += 2) + printf("%08x%08x", t.tp.mask[i], + t.tp.mask[i + 1]); + printf("@0\n"); + } + printf("filter pattern: "); + for (i = t.tp.skip_ofst * 2; i < T4_TRACE_LEN / 4; i += 2) + printf("%08x%08x", t.tp.data[i], t.tp.data[i + 1]); + printf("/"); + for (i = t.tp.skip_ofst * 2; i < T4_TRACE_LEN / 4; i += 2) + printf("%08x%08x", t.tp.mask[i], t.tp.mask[i + 1]); + printf("@%u\n", (t.tp.skip_ofst + t.tp.skip_len) * 8); + } + + return (rc); +} + +static int +tracer_onoff(uint8_t idx, int enabled) +{ + struct t4_tracer t; + + t.idx = idx; + t.enabled = enabled; + t.valid = 0; + + return doit(CHELSIO_T4_SET_TRACER, &t); +} + +static void +create_tracing_ifnet() +{ + char *cmd[] = { + "/sbin/ifconfig", __DECONST(char *, nexus), "create", NULL + }; + char *env[] = {NULL}; + + if (vfork() == 0) { + close(STDERR_FILENO); + execve(cmd[0], cmd, env); + _exit(0); + } +} + +/* + * XXX: Allow user to specify snaplen, minlen, and pattern (including inverted + * matching). Right now this is a quick-n-dirty implementation that traces the + * first 128B of all tx or rx on a port + */ +static int +set_tracer(uint8_t idx, int argc, const char *argv[]) +{ + struct t4_tracer t; + int len, port; + + bzero(&t, sizeof (t)); + t.idx = idx; + t.enabled = 1; + t.valid = 1; + + if (argc != 1) { + warnx("must specify tx or rx."); + return (EINVAL); + } + + len = strlen(argv[0]); + if (len != 3) { + warnx("argument must be 3 characters (tx or rx)"); + return (EINVAL); + } + + if (strncmp(argv[0], "tx", 2) == 0) { + port = argv[0][2] - '0'; + if (port < 0 || port > 3) { + warnx("'%c' in %s is invalid", argv[0][2], argv[0]); + return (EINVAL); + } + port += 4; + } else if (strncmp(argv[0], "rx", 2) == 0) { + port = argv[0][2] - '0'; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 22:40:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E0BCBFC4; Fri, 26 Jul 2013 22:40:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CCEC6245A; Fri, 26 Jul 2013 22:40:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6QMeHMK062247; Fri, 26 Jul 2013 22:40:17 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6QMeHBX062246; Fri, 26 Jul 2013 22:40:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307262240.r6QMeHBX062246@svn.freebsd.org> From: Xin LI Date: Fri, 26 Jul 2013 22:40:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253692 - head/contrib/bind9/lib/dns/rdata/generic releng/8.4 releng/8.4/contrib/bind9/lib/dns/rdata/generic releng/8.4/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 22:40:18 -0000 Author: delphij Date: Fri Jul 26 22:40:17 2013 New Revision: 253692 URL: http://svnweb.freebsd.org/changeset/base/253692 Log: Fix Denial of Service vulnerability in named(8). [13:07] Security: CVE-2013-4854 Security: FreeBSD-SA-13:07.bind Approved by: so Modified: head/contrib/bind9/lib/dns/rdata/generic/keydata_65533.c Changes in other areas also in this revision: Modified: releng/8.4/UPDATING releng/8.4/contrib/bind9/lib/dns/rdata/generic/keydata_65533.c releng/8.4/sys/conf/newvers.sh Modified: head/contrib/bind9/lib/dns/rdata/generic/keydata_65533.c ============================================================================== --- head/contrib/bind9/lib/dns/rdata/generic/keydata_65533.c Fri Jul 26 22:04:11 2013 (r253691) +++ head/contrib/bind9/lib/dns/rdata/generic/keydata_65533.c Fri Jul 26 22:40:17 2013 (r253692) @@ -176,7 +176,7 @@ fromwire_keydata(ARGS_FROMWIRE) { UNUSED(options); isc_buffer_activeregion(source, &sr); - if (sr.length < 4) + if (sr.length < 16) return (ISC_R_UNEXPECTEDEND); isc_buffer_forward(source, sr.length); From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 23:22:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DFE501B2; Fri, 26 Jul 2013 23:22:05 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CD23925ED; Fri, 26 Jul 2013 23:22:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6QNM5su095114; Fri, 26 Jul 2013 23:22:05 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6QNM51H095113; Fri, 26 Jul 2013 23:22:05 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201307262322.r6QNM51H095113@svn.freebsd.org> From: Jeff Roberson Date: Fri, 26 Jul 2013 23:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253697 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jul 2013 23:22:06 -0000 Author: jeff Date: Fri Jul 26 23:22:05 2013 New Revision: 253697 URL: http://svnweb.freebsd.org/changeset/base/253697 Log: Improve page LRU quality and simplify the logic. - Don't short-circuit aging tests for unmapped objects. This biases against unmapped file pages and transient mappings. - Always honor PGA_REFERENCED. We can now use this after soft busying to lazily restart the LRU. - Don't transition directly from active to cached bypassing the inactive queue. This frees recently used data much too early. - Rename actcount to act_delta to be more consistent with use and meaning. Reviewed by: kib, alc Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Fri Jul 26 22:53:17 2013 (r253696) +++ head/sys/vm/vm_pageout.c Fri Jul 26 23:22:05 2013 (r253697) @@ -708,7 +708,7 @@ vm_pageout_object_deactivate_pages(pmap_ { vm_object_t backing_object, object; vm_page_t p; - int actcount, remove_mode; + int act_delta, remove_mode; VM_OBJECT_ASSERT_LOCKED(first_object); if ((first_object->flags & OBJ_FICTITIOUS) != 0) @@ -739,17 +739,17 @@ vm_pageout_object_deactivate_pages(pmap_ vm_page_unlock(p); continue; } - actcount = pmap_ts_referenced(p); + act_delta = pmap_ts_referenced(p); if ((p->aflags & PGA_REFERENCED) != 0) { - if (actcount == 0) - actcount = 1; + if (act_delta == 0) + act_delta = 1; vm_page_aflag_clear(p, PGA_REFERENCED); } - if (p->queue != PQ_ACTIVE && actcount != 0) { + if (p->queue != PQ_ACTIVE && act_delta != 0) { vm_page_activate(p); - p->act_count += actcount; + p->act_count += act_delta; } else if (p->queue == PQ_ACTIVE) { - if (actcount == 0) { + if (act_delta == 0) { p->act_count -= min(p->act_count, ACT_DECLINE); if (!remove_mode && p->act_count == 0) { @@ -869,7 +869,7 @@ vm_pageout_scan(int pass) int page_shortage, maxscan, pcount; int addl_page_shortage; vm_object_t object; - int actcount; + int act_delta; int vnodes_skipped = 0; int maxlaunder; boolean_t queues_locked; @@ -989,44 +989,40 @@ vm_pageout_scan(int pass) queues_locked = FALSE; /* - * If the object is not being used, we ignore previous + * We bump the activation count if the page has been + * referenced while in the inactive queue. This makes + * it less likely that the page will be added back to the + * inactive queue prematurely again. Here we check the + * page tables (or emulated bits, if any), given the upper + * level VM system not knowing anything about existing * references. */ - if (object->ref_count == 0) { + act_delta = 0; + if ((m->aflags & PGA_REFERENCED) != 0) { vm_page_aflag_clear(m, PGA_REFERENCED); + act_delta = 1; + } + if (object->ref_count != 0) { + act_delta += pmap_ts_referenced(m); + } else { KASSERT(!pmap_page_is_mapped(m), ("vm_pageout_scan: page %p is mapped", m)); - - /* - * Otherwise, if the page has been referenced while in the - * inactive queue, we bump the "activation count" upwards, - * making it less likely that the page will be added back to - * the inactive queue prematurely again. Here we check the - * page tables (or emulated bits, if any), given the upper - * level VM system not knowing anything about existing - * references. - */ - } else if ((m->aflags & PGA_REFERENCED) == 0 && - (actcount = pmap_ts_referenced(m)) != 0) { - vm_page_activate(m); - VM_OBJECT_WUNLOCK(object); - m->act_count += actcount + ACT_ADVANCE; - vm_page_unlock(m); - goto relock_queues; } /* * If the upper level VM system knows about any page - * references, we activate the page. We also set the - * "activation count" higher than normal so that we will less - * likely place pages back onto the inactive queue again. + * references, we reactivate the page or requeue it. */ - if ((m->aflags & PGA_REFERENCED) != 0) { - vm_page_aflag_clear(m, PGA_REFERENCED); - actcount = pmap_ts_referenced(m); - vm_page_activate(m); + if (act_delta != 0) { + if (object->ref_count) { + vm_page_activate(m); + m->act_count += act_delta + ACT_ADVANCE; + } else { + vm_pagequeue_lock(pq); + queues_locked = TRUE; + vm_page_requeue_locked(m); + } VM_OBJECT_WUNLOCK(object); - m->act_count += actcount + ACT_ADVANCE + 1; vm_page_unlock(m); goto relock_queues; } @@ -1324,50 +1320,40 @@ relock_queues: /* * Check to see "how much" the page has been used. */ - actcount = 0; - if (object->ref_count != 0) { - if (m->aflags & PGA_REFERENCED) { - actcount += 1; - } - actcount += pmap_ts_referenced(m); - if (actcount) { - m->act_count += ACT_ADVANCE + actcount; - if (m->act_count > ACT_MAX) - m->act_count = ACT_MAX; - } + act_delta = 0; + if (m->aflags & PGA_REFERENCED) { + vm_page_aflag_clear(m, PGA_REFERENCED); + act_delta += 1; } + if (object->ref_count != 0) + act_delta += pmap_ts_referenced(m); /* - * Since we have "tested" this bit, we need to clear it now. + * Advance or decay the act_count based on recent usage. */ - vm_page_aflag_clear(m, PGA_REFERENCED); + if (act_delta) { + m->act_count += ACT_ADVANCE + act_delta; + if (m->act_count > ACT_MAX) + m->act_count = ACT_MAX; + } else { + m->act_count -= min(m->act_count, ACT_DECLINE); + act_delta = m->act_count; + } /* - * Only if an object is currently being used, do we use the - * page activation count stats. + * Move this page to the tail of the active or inactive + * queue depending on usage. */ - if (actcount != 0 && object->ref_count != 0) + if (act_delta == 0) { + KASSERT(object->ref_count != 0 || + !pmap_page_is_mapped(m), + ("vm_pageout_scan: page %p is mapped", m)); + /* Dequeue to avoid later lock recursion. */ + vm_page_dequeue_locked(m); + vm_page_deactivate(m); + page_shortage--; + } else vm_page_requeue_locked(m); - else { - m->act_count -= min(m->act_count, ACT_DECLINE); - if (object->ref_count == 0 || - m->act_count == 0) { - page_shortage--; - /* Dequeue to avoid later lock recursion. */ - vm_page_dequeue_locked(m); - if (object->ref_count == 0) { - KASSERT(!pmap_page_is_mapped(m), - ("vm_pageout_scan: page %p is mapped", m)); - if (m->dirty == 0) - vm_page_cache(m); - else - vm_page_deactivate(m); - } else { - vm_page_deactivate(m); - } - } else - vm_page_requeue_locked(m); - } vm_page_unlock(m); VM_OBJECT_WUNLOCK(object); m = next; From owner-svn-src-head@FreeBSD.ORG Sat Jul 27 00:53:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A4524957; Sat, 27 Jul 2013 00:53:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 918A32977; Sat, 27 Jul 2013 00:53:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6R0r8pO032258; Sat, 27 Jul 2013 00:53:08 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6R0r8Mt032257; Sat, 27 Jul 2013 00:53:08 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201307270053.r6R0r8Mt032257@svn.freebsd.org> From: Navdeep Parhar Date: Sat, 27 Jul 2013 00:53:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253699 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 00:53:08 -0000 Author: np Date: Sat Jul 27 00:53:07 2013 New Revision: 253699 URL: http://svnweb.freebsd.org/changeset/base/253699 Log: Expand the list of devices claimed by cxgbe(4). Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Jul 26 23:41:22 2013 (r253698) +++ head/sys/dev/cxgbe/t4_main.c Sat Jul 27 00:53:07 2013 (r253699) @@ -447,26 +447,27 @@ struct { }, t5_pciids[] = { {0xb000, "Chelsio Terminator 5 FPGA"}, {0x5400, "Chelsio T580-dbg"}, - {0x5401, "Chelsio T520-CR"}, + {0x5401, "Chelsio T520-CR"}, /* 2 x 10G */ + {0x5402, "Chelsio T522-CR"}, /* 2 x 10G, 2 X 1G */ {0x5403, "Chelsio T540-CR"}, /* 4 x 10G */ - {0x5407, "Chelsio T520-SO"}, - {0x5408, "Chelsio T520-CX"}, + {0x5407, "Chelsio T520-SO"}, /* 2 x 10G, nomem */ + {0x5409, "Chelsio T520-BT"}, /* 2 x 10GBaseT */ + {0x540a, "Chelsio T504-BT"}, /* 4 x 1G */ + {0x540d, "Chelsio T580-CR"}, /* 2 x 40G */ + {0x540e, "Chelsio T540-LP-CR"}, /* 4 x 10G */ {0x5410, "Chelsio T580-LP-CR"}, /* 2 x 40G */ - {0x5411, "Chelsio T520-LL-CR"}, + {0x5411, "Chelsio T520-LL-CR"}, /* 2 x 10G */ + {0x5412, "Chelsio T560-CR"}, /* 1 x 40G, 2 x 10G */ + {0x5414, "Chelsio T580-LP-SO-CR"}, /* 2 x 40G, nomem */ #ifdef notyet - {0x5402, "Chelsio T522-CR"}, {0x5404, "Chelsio T520-BCH"}, {0x5405, "Chelsio T540-BCH"}, {0x5406, "Chelsio T540-CH"}, - {0x5409, "Chelsio T520-BT"}, - {0x540a, "Chelsio T504-BT"}, + {0x5408, "Chelsio T520-CX"}, {0x540b, "Chelsio B520-SR"}, {0x540c, "Chelsio B504-BT"}, - {0x540d, "Chelsio T580-CR"}, - {0x540e, "Chelsio T540-LP-CR"}, {0x540f, "Chelsio Amsterdam"}, - {0x5412, "Chelsio T560-CR"}, - {0x5413, "Chelsio T580-CR"}, + {0x5413, "Chelsio T580-CHR"}, #endif }; From owner-svn-src-head@FreeBSD.ORG Sat Jul 27 07:43:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8481FF4E; Sat, 27 Jul 2013 07:43:44 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5823A2B48; Sat, 27 Jul 2013 07:43:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6R7higS085323; Sat, 27 Jul 2013 07:43:44 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6R7higl085322; Sat, 27 Jul 2013 07:43:44 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201307270743.r6R7higl085322@svn.freebsd.org> From: Navdeep Parhar Date: Sat, 27 Jul 2013 07:43:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253701 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 07:43:44 -0000 Author: np Date: Sat Jul 27 07:43:43 2013 New Revision: 253701 URL: http://svnweb.freebsd.org/changeset/base/253701 Log: Display a string instead of a numeric code in the linkdnrc sysctl. Submitted by: gnn@ Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat Jul 27 05:32:26 2013 (r253700) +++ head/sys/dev/cxgbe/t4_main.c Sat Jul 27 07:43:43 2013 (r253701) @@ -392,6 +392,7 @@ static int sysctl_devlog(SYSCTL_HANDLER_ static int sysctl_fcoe_stats(SYSCTL_HANDLER_ARGS); static int sysctl_hw_sched(SYSCTL_HANDLER_ARGS); static int sysctl_lb_stats(SYSCTL_HANDLER_ARGS); +static int sysctl_linkdnrc(SYSCTL_HANDLER_ARGS); static int sysctl_meminfo(SYSCTL_HANDLER_ARGS); static int sysctl_mps_tcam(SYSCTL_HANDLER_ARGS); static int sysctl_path_mtus(SYSCTL_HANDLER_ARGS); @@ -4439,8 +4440,8 @@ cxgbe_sysctls(struct port_info *pi) oid = device_get_sysctl_tree(pi->dev); children = SYSCTL_CHILDREN(oid); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "linkdnrc", CTLFLAG_RD, - &pi->linkdnrc, 0, "reason why link is down"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "linkdnrc", CTLTYPE_STRING | + CTLFLAG_RD, pi, 0, sysctl_linkdnrc, "A", "reason why link is down"); if (pi->port_type == FW_PORT_TYPE_BT_XAUI) { SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD, pi, 0, sysctl_btphy, "I", @@ -5486,6 +5487,37 @@ sysctl_lb_stats(SYSCTL_HANDLER_ARGS) return (rc); } +static int +sysctl_linkdnrc(SYSCTL_HANDLER_ARGS) +{ + int rc = 0; + struct port_info *pi = arg1; + struct sbuf *sb; + static const char *linkdnreasons[] = { + "non-specific", "remote fault", "autoneg failed", "reserved3", + "PHY overheated", "unknown", "rx los", "reserved7" + }; + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return(rc); + sb = sbuf_new_for_sysctl(NULL, NULL, 64, req); + if (sb == NULL) + return (ENOMEM); + + if (pi->linkdnrc < 0) + sbuf_printf(sb, "n/a"); + else if (pi->linkdnrc < nitems(linkdnreasons)) + sbuf_printf(sb, "%s", linkdnreasons[pi->linkdnrc]); + else + sbuf_printf(sb, "%d", pi->linkdnrc); + + rc = sbuf_finish(sb); + sbuf_delete(sb); + + return (rc); +} + struct mem_desc { unsigned int base; unsigned int limit; From owner-svn-src-head@FreeBSD.ORG Sat Jul 27 07:48:05 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4067112B; Sat, 27 Jul 2013 07:48:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id C7A3B2B5C; Sat, 27 Jul 2013 07:48:03 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 66DD91A3524; Sat, 27 Jul 2013 17:47:53 +1000 (EST) Date: Sat, 27 Jul 2013 17:47:52 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Juli Mallett Subject: Re: svn commit: r253662 - in head: lib/libc/gen sys/vm tools/tools/sysdoc In-Reply-To: Message-ID: <20130727170845.E872@besplex.bde.org> References: <201307260200.r6Q207cB015223@svn.freebsd.org> <20130726150949.GC14175@stack.nl> <51F2E970.3070303@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=Yos2GeoX c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=NRP33-gIz6cA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=csUvqbbglXYA:10 a=6I5d2MoRAAAA:8 a=V2Xkxio-15NM_JPYHrYA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 Cc: svn-src-head@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Jilles Tjoelker X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 07:48:05 -0000 On Fri, 26 Jul 2013, Juli Mallett wrote: > On Fri, Jul 26, 2013 at 2:26 PM, Andrey Zonov wrote: > >> On 7/26/13 8:09 AM, Jilles Tjoelker wrote: >>> As noted in mail from Bruce Evans, please preserve the ABI of >>> VM_SWAPPING_ENABLED here. >> >> I don't think it's a big problem. Internally we don't use it. Good >> code uses sysctlbyname() instead of sysctl(). It doesn't seem to me >> this is very popular sysctl. It's also CURRENT without MFC. > > That doesn't seem like a great argument. > > Why should we break the ABI for bad code that used that sysctl and all > following? It seems pretty trivial to preserve, and no-cost. Also, the > fact that it's in current misses the point completely: it breaks ABI with > older binaries, namely older binaries running on -CURRENT. And not just > for that field. Especially since the main reason numbered sysctls exist is to support old binaries (and sources) that use them. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Jul 27 14:58:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 34B4AEF2; Sat, 27 Jul 2013 14:58:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 128CD28D2; Sat, 27 Jul 2013 14:58:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6REwOKA015914; Sat, 27 Jul 2013 14:58:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6REwOWc015913; Sat, 27 Jul 2013 14:58:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307271458.r6REwOWc015913@svn.freebsd.org> From: Adrian Chadd Date: Sat, 27 Jul 2013 14:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253705 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 14:58:24 -0000 Author: adrian Date: Sat Jul 27 14:58:23 2013 New Revision: 253705 URL: http://svnweb.freebsd.org/changeset/base/253705 Log: Implement some function tracing. Submitted by: Cedric GROSS Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sat Jul 27 09:00:32 2013 (r253704) +++ head/sys/dev/iwn/if_iwn.c Sat Jul 27 14:58:23 2013 (r253705) @@ -339,6 +339,7 @@ enum { IWN_DEBUG_CMD = 0x00001000, /* cmd submission */ IWN_DEBUG_TXRATE = 0x00002000, /* TX rate debugging */ IWN_DEBUG_PWRSAVE = 0x00004000, /* Power save operations */ + IWN_DEBUG_TRACE = 0x40000000, /* Print begin and start driver function */ IWN_DEBUG_FATAL = 0x80000000, /* fatal errors */ IWN_DEBUG_ANY = 0xffffffff }; @@ -456,6 +457,8 @@ iwn_attach(device_t dev) sc->sc_debug = 0; #endif + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: begin\n",__func__); + /* * Get the offset of the PCI Express Capability Structure in PCI * Configuration Space. @@ -706,9 +709,11 @@ iwn_attach(device_t dev) if (bootverbose) ieee80211_announce(ic); + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); return 0; fail: iwn_detach(dev); + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end in error\n",__func__); return error; } @@ -717,6 +722,7 @@ iwn4965_attach(struct iwn_softc *sc, uin { struct iwn_ops *ops = &sc->ops; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); ops->load_firmware = iwn4965_load_firmware; ops->read_eeprom = iwn4965_read_eeprom; ops->post_alive = iwn4965_post_alive; @@ -747,6 +753,8 @@ iwn4965_attach(struct iwn_softc *sc, uin sc->txchainmask = IWN_ANT_AB; sc->rxchainmask = IWN_ANT_ABC; + DPRINTF(sc, IWN_DEBUG_TRACE, "%s: end\n",__func__); + return 0; } @@ -755,6 +763,8 @@ iwn5000_attach(struct iwn_softc *sc, uin { struct iwn_ops *ops = &sc->ops; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + ops->load_firmware = iwn5000_load_firmware; ops->read_eeprom = iwn5000_read_eeprom; ops->post_alive = iwn5000_post_alive; @@ -831,6 +841,7 @@ iwn5000_attach(struct iwn_softc *sc, uin default: device_printf(sc->sc_dev, "adapter type %d not supported\n", sc->hw_type); + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end in error\n",__func__); return ENOTSUP; } return 0; @@ -844,12 +855,13 @@ iwn_radiotap_attach(struct iwn_softc *sc { struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; - + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); ieee80211_radiotap_attach(ic, &sc->sc_txtap.wt_ihdr, sizeof(sc->sc_txtap), IWN_TX_RADIOTAP_PRESENT, &sc->sc_rxtap.wr_ihdr, sizeof(sc->sc_rxtap), IWN_RX_RADIOTAP_PRESENT); + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); } static void @@ -949,6 +961,7 @@ iwn_detach(device_t dev) if (ifp != NULL) if_free(ifp); + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s done\n", __func__); IWN_LOCK_DESTROY(sc); return 0; } @@ -1109,6 +1122,7 @@ iwn_eeprom_lock(struct iwn_softc *sc) DELAY(10); } } + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end timeout\n", __func__); return ETIMEDOUT; } @@ -1128,6 +1142,8 @@ iwn_init_otprom(struct iwn_softc *sc) uint16_t prev, base, next; int count, error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Wait for clock stabilization before accessing prph. */ if ((error = iwn_clock_wait(sc)) != 0) return error; @@ -1171,6 +1187,9 @@ iwn_init_otprom(struct iwn_softc *sc) /* Skip "next" word. */ sc->prom_base = prev + 1; } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); + return 0; } @@ -1181,6 +1200,8 @@ iwn_read_prom_data(struct iwn_softc *sc, uint32_t val, tmp; int ntries; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + addr += sc->prom_base; for (; count > 0; count -= 2, addr++) { IWN_WRITE(sc, IWN_EEPROM, addr << 2); @@ -1213,6 +1234,9 @@ iwn_read_prom_data(struct iwn_softc *sc, if (count > 1) *out++ = val >> 24; } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); + return 0; } @@ -1343,6 +1367,8 @@ iwn_alloc_rx_ring(struct iwn_softc *sc, ring->cur = 0; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Allocate RX descriptors (256-byte aligned). */ size = IWN_RX_RING_COUNT * sizeof (uint32_t); error = iwn_dma_contig_alloc(sc, &ring->desc_dma, (void **)&ring->desc, @@ -1417,9 +1443,14 @@ iwn_alloc_rx_ring(struct iwn_softc *sc, bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map, BUS_DMASYNC_PREWRITE); + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return 0; fail: iwn_free_rx_ring(sc, ring); + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end in error\n",__func__); + return error; } @@ -1428,6 +1459,8 @@ iwn_reset_rx_ring(struct iwn_softc *sc, { int ntries; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + if (iwn_nic_lock(sc) == 0) { IWN_WRITE(sc, IWN_FH_RX_CONFIG, 0); for (ntries = 0; ntries < 1000; ntries++) { @@ -1447,6 +1480,8 @@ iwn_free_rx_ring(struct iwn_softc *sc, s { int i; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s \n", __func__); + iwn_dma_contig_free(&ring->desc_dma); iwn_dma_contig_free(&ring->stat_dma); @@ -1480,6 +1515,8 @@ iwn_alloc_tx_ring(struct iwn_softc *sc, ring->queued = 0; ring->cur = 0; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Allocate TX descriptors (256-byte aligned). */ size = IWN_TX_RING_COUNT * sizeof (struct iwn_tx_desc); error = iwn_dma_contig_alloc(sc, &ring->desc_dma, (void **)&ring->desc, @@ -1528,9 +1565,13 @@ iwn_alloc_tx_ring(struct iwn_softc *sc, goto fail; } } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); + return 0; fail: iwn_free_tx_ring(sc, ring); + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end in error\n", __func__); return error; } @@ -1539,6 +1580,8 @@ iwn_reset_tx_ring(struct iwn_softc *sc, { int i; + DPRINTF(sc, IWN_DEBUG_TRACE, "->doing %s \n", __func__); + for (i = 0; i < IWN_TX_RING_COUNT; i++) { struct iwn_tx_data *data = &ring->data[i]; @@ -1564,6 +1607,8 @@ iwn_free_tx_ring(struct iwn_softc *sc, s { int i; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s \n", __func__); + iwn_dma_contig_free(&ring->desc_dma); iwn_dma_contig_free(&ring->cmd_dma); @@ -1617,6 +1662,8 @@ iwn_read_eeprom(struct iwn_softc *sc, ui uint16_t val; int error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Check whether adapter has an EEPROM or an OTPROM. */ if (sc->hw_type >= IWN_HW_REV_TYPE_1000 && (IWN_READ(sc, IWN_OTP_GP) & IWN_OTP_GP_DEV_SEL_OTP)) @@ -1674,6 +1721,9 @@ iwn_read_eeprom(struct iwn_softc *sc, ui iwn_apm_stop(sc); /* Power OFF adapter. */ iwn_eeprom_unlock(sc); + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); + return 0; } @@ -1684,6 +1734,8 @@ iwn4965_read_eeprom(struct iwn_softc *sc uint16_t val; int i; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Read regulatory domain (4 ASCII characters). */ iwn_read_prom_data(sc, IWN4965_EEPROM_DOMAIN, sc->eeprom_domain, 4); @@ -1722,6 +1774,8 @@ iwn4965_read_eeprom(struct iwn_softc *sc iwn4965_print_power_group(sc, i); } #endif + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); } #ifdef IWN_DEBUG @@ -1768,6 +1822,8 @@ iwn5000_read_eeprom(struct iwn_softc *sc uint16_t val; int i; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Read regulatory domain (4 ASCII characters). */ iwn_read_prom_data(sc, IWN5000_EEPROM_REG, &val, 2); base = le16toh(val); @@ -1811,6 +1867,9 @@ iwn5000_read_eeprom(struct iwn_softc *sc DPRINTF(sc, IWN_DEBUG_CALIBRATE, "crystal calibration 0x%08x\n", le32toh(sc->eeprom_crystal)); } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); + } /* @@ -1846,6 +1905,8 @@ iwn_read_eeprom_band(struct iwn_softc *s uint8_t chan; int i, nflags; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + for (i = 0; i < band->nchan; i++) { if (!(channels[i].flags & IWN_EEPROM_CHAN_VALID)) { DPRINTF(sc, IWN_DEBUG_RESET, @@ -1888,6 +1949,9 @@ iwn_read_eeprom_band(struct iwn_softc *s c->ic_flags |= IEEE80211_CHAN_HT20; } } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); + } static void @@ -1901,8 +1965,12 @@ iwn_read_eeprom_ht40(struct iwn_softc *s uint8_t chan; int i, nflags; - if (!(sc->sc_flags & IWN_FLAG_HAS_11N)) + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s start\n", __func__); + + if (!(sc->sc_flags & IWN_FLAG_HAS_11N)) { + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end no 11n\n", __func__); return; + } for (i = 0; i < band->nchan; i++) { if (!(channels[i].flags & IWN_EEPROM_CHAN_VALID)) { @@ -1950,6 +2018,9 @@ iwn_read_eeprom_ht40(struct iwn_softc *s c->ic_flags &= ~IEEE80211_CHAN_HT; c->ic_flags |= IEEE80211_CHAN_HT40D | nflags; } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); + } static void @@ -2033,6 +2104,8 @@ iwn_read_eeprom_enhinfo(struct iwn_softc uint8_t flags; int i, j; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + iwn_read_prom_data(sc, IWN5000_EEPROM_REG, &val, 2); base = le16toh(val); iwn_read_prom_data(sc, base + IWN6000_EEPROM_ENHINFO, @@ -2083,6 +2156,9 @@ iwn_read_eeprom_enhinfo(struct iwn_softc c->ic_maxpower = maxpwr; } } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); + } static struct ieee80211_node * @@ -2229,6 +2305,8 @@ iwn_newstate(struct ieee80211vap *vap, e struct iwn_softc *sc = ic->ic_ifp->if_softc; int error = 0; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + DPRINTF(sc, IWN_DEBUG_STATE, "%s: %s -> %s\n", __func__, ieee80211_state_name[vap->iv_state], ieee80211_state_name[nstate]); @@ -2288,8 +2366,13 @@ iwn_newstate(struct ieee80211vap *vap, e } IWN_UNLOCK(sc); IEEE80211_LOCK(ic); - if (error != 0) + if (error != 0){ + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end in error\n", __func__); return error; + } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return ivp->iv_newstate(vap, nstate, arg); } @@ -2353,6 +2436,8 @@ iwn_rx_done(struct iwn_softc *sc, struct uint32_t flags; int error, len, rssi, nf; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + if (desc->type == IWN_MPDU_RX_DONE) { /* Check for prior RX_PHY notification. */ if (!sc->last_rx_valid) { @@ -2491,6 +2576,9 @@ iwn_rx_done(struct iwn_softc *sc, struct (void)ieee80211_input_all(ic, m, rssi - nf, nf); IWN_LOCK(sc); + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + } /* Process an incoming Compressed BlockAck. */ @@ -2512,6 +2600,8 @@ iwn_rx_compressed_ba(struct iwn_softc *s uint8_t tid; int ackfailcnt = 0, i, lastidx, qid, *res, shift; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); qid = le16toh(ba->qid); @@ -2583,6 +2673,9 @@ iwn_rx_compressed_ba(struct iwn_softc *s } bitmap >>= 1; } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + } /* @@ -2596,10 +2689,14 @@ iwn5000_rx_calib_results(struct iwn_soft struct iwn_phy_calib *calib = (struct iwn_phy_calib *)(desc + 1); int len, idx = -1; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Runtime firmware should not send such a notification. */ - if (sc->sc_flags & IWN_FLAG_CALIB_DONE) + if (sc->sc_flags & IWN_FLAG_CALIB_DONE){ + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s received after clib done\n", + __func__); return; - + } len = (le32toh(desc->len) & 0x3fff) - 4; bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); @@ -2661,10 +2758,15 @@ iwn_rx_statistics(struct iwn_softc *sc, struct iwn_stats *stats = (struct iwn_stats *)(desc + 1); int temp; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Ignore statistics received during a scan. */ if (vap->iv_state != IEEE80211_S_RUN || - (ic->ic_flags & IEEE80211_F_SCAN)) + (ic->ic_flags & IEEE80211_F_SCAN)){ + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s received during calib\n", + __func__); return; + } bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); @@ -2702,6 +2804,8 @@ iwn_rx_statistics(struct iwn_softc *sc, iwn_collect_noise(sc, &stats->rx.general); else if (calib->state == IWN_CALIB_STATE_RUN) iwn_tune_sensitivity(sc, &stats->rx); + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); } /* @@ -2783,6 +2887,8 @@ iwn_tx_done(struct iwn_softc *sc, struct KASSERT(data->ni != NULL, ("no node")); + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Unmap and free mbuf. */ bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(ring->data_dmat, data->map); @@ -2837,6 +2943,9 @@ iwn_tx_done(struct iwn_softc *sc, struct iwn_start_locked(ifp); } } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + } /* @@ -2884,6 +2993,8 @@ iwn_ampdu_tx_done(struct iwn_softc *sc, uint8_t tid; int bit, i, lastidx, *res, seqno, shift, start; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + #ifdef NOT_YET if (nframes == 1) { if ((*status & 0xff) != 1 && (*status & 0xff) != 2) @@ -2970,6 +3081,9 @@ iwn_ampdu_tx_done(struct iwn_softc *sc, iwn_start_locked(ifp); } } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + } /* @@ -3280,7 +3394,8 @@ iwn_intr(void *arg) r2 = IWN_READ(sc, IWN_FH_INT); } - DPRINTF(sc, IWN_DEBUG_INTR, "interrupt reg1=%x reg2=%x\n", r1, r2); + DPRINTF(sc, IWN_DEBUG_INTR, "interrupt reg1=0x%08x reg2=0x%08x\n" + , r1, r2); if (r1 == 0 && r2 == 0) goto done; /* Interrupt not for us. */ @@ -3353,6 +3468,8 @@ iwn4965_update_sched(struct iwn_softc *s { uint16_t *w = &sc->sched[qid * IWN4965_SCHED_COUNT + idx]; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + *w = htole16(len + 8); bus_dmamap_sync(sc->sched_dma.tag, sc->sched_dma.map, BUS_DMASYNC_PREWRITE); @@ -3369,6 +3486,8 @@ iwn5000_update_sched(struct iwn_softc *s { uint16_t *w = &sc->sched[qid * IWN5000_SCHED_COUNT + idx]; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + *w = htole16(id << 12 | (len + 8)); bus_dmamap_sync(sc->sched_dma.tag, sc->sched_dma.map, BUS_DMASYNC_PREWRITE); @@ -3385,6 +3504,8 @@ iwn5000_reset_sched(struct iwn_softc *sc { uint16_t *w = &sc->sched[qid * IWN5000_SCHED_COUNT + idx]; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + *w = (*w & htole16(0xf000)) | htole16(1); bus_dmamap_sync(sc->sched_dma.tag, sc->sched_dma.map, BUS_DMASYNC_PREWRITE); @@ -3419,6 +3540,8 @@ iwn_tx_data(struct iwn_softc *sc, struct uint8_t tid, ridx, txant, type; int ac, i, totlen, error, pad, nsegs = 0, rate; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + IWN_LOCK_ASSERT(sc); wh = mtod(m, struct ieee80211_frame *); @@ -3664,6 +3787,8 @@ iwn_tx_data(struct iwn_softc *sc, struct if (++ring->queued > IWN_TX_RING_HIMARK) sc->qfullmsk |= 1 << ring->qid; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return 0; } @@ -3688,6 +3813,8 @@ iwn_tx_data_raw(struct iwn_softc *sc, st int ac, totlen, error, pad, nsegs = 0, i, rate; uint8_t ridx, type, txant; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + IWN_LOCK_ASSERT(sc); wh = mtod(m, struct ieee80211_frame *); @@ -3873,6 +4000,8 @@ iwn_tx_data_raw(struct iwn_softc *sc, st if (++ring->queued > IWN_TX_RING_HIMARK) sc->qfullmsk |= 1 << ring->qid; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return 0; } @@ -3885,6 +4014,8 @@ iwn_raw_xmit(struct ieee80211_node *ni, struct iwn_softc *sc = ifp->if_softc; int error = 0; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { ieee80211_free_node(ni); m_freem(m); @@ -3913,6 +4044,9 @@ iwn_raw_xmit(struct ieee80211_node *ni, sc->sc_tx_timer = 5; IWN_UNLOCK(sc); + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return error; } @@ -3968,6 +4102,8 @@ iwn_watchdog(void *arg) KASSERT(ifp->if_drv_flags & IFF_DRV_RUNNING, ("not running")); + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + if (sc->sc_tx_timer > 0) { if (--sc->sc_tx_timer == 0) { if_printf(ifp, "device timeout\n"); @@ -4035,6 +4171,8 @@ iwn_cmd(struct iwn_softc *sc, int code, bus_addr_t paddr; int totlen, error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + if (async == 0) IWN_LOCK_ASSERT(sc); @@ -4090,6 +4228,8 @@ iwn_cmd(struct iwn_softc *sc, int code, ring->cur = (ring->cur + 1) % IWN_TX_RING_COUNT; IWN_WRITE(sc, IWN_HBUS_TARG_WRPTR, ring->qid << 8 | ring->cur); + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return async ? 0 : msleep(desc, &sc->sc_mtx, PCATCH, "iwncmd", hz); } @@ -4099,6 +4239,8 @@ iwn4965_add_node(struct iwn_softc *sc, s struct iwn4965_node_info hnode; caddr_t src, dst; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* * We use the node structure for 5000 Series internally (it is * a superset of the one for 4965AGN). We thus copy the common @@ -4115,6 +4257,9 @@ iwn4965_add_node(struct iwn_softc *sc, s static int iwn5000_add_node(struct iwn_softc *sc, struct iwn_node_info *node, int async) { + + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Direct mapping. */ return iwn_cmd(sc, IWN_CMD_ADD_NODE, node, sizeof (*node), async); } @@ -4129,6 +4274,8 @@ iwn_set_link_quality(struct iwn_softc *s uint8_t txant; int i, rate, txrate; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Use the first valid TX antenna. */ txant = IWN_LSB(sc->txchainmask); @@ -4166,6 +4313,9 @@ iwn_set_link_quality(struct iwn_softc *s if (txrate > 0) txrate--; } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return iwn_cmd(sc, IWN_CMD_LINK_QUALITY, &linkq, sizeof linkq, 1); #undef RV } @@ -4184,6 +4334,8 @@ iwn_add_broadcast_node(struct iwn_softc uint8_t txant; int i, error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + memset(&node, 0, sizeof node); IEEE80211_ADDR_COPY(node.macaddr, ifp->if_broadcastaddr); node.id = sc->broadcast_id; @@ -4212,6 +4364,9 @@ iwn_add_broadcast_node(struct iwn_softc for (i = 1; i < IWN_MAX_TX_RETRIES; i++) { linkq.retry[i] = linkq.retry[0]; } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return iwn_cmd(sc, IWN_CMD_LINK_QUALITY, &linkq, sizeof linkq, async); } @@ -4223,6 +4378,8 @@ iwn_updateedca(struct ieee80211com *ic) struct iwn_edca_params cmd; int aci; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + memset(&cmd, 0, sizeof cmd); cmd.flags = htole32(IWN_EDCA_UPDATE); for (aci = 0; aci < WME_NUM_AC; aci++) { @@ -4239,6 +4396,9 @@ iwn_updateedca(struct ieee80211com *ic) (void)iwn_cmd(sc, IWN_CMD_EDCA_PARAMS, &cmd, sizeof cmd, 1); IWN_UNLOCK(sc); IEEE80211_LOCK(ic); + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return 0; #undef IWN_EXP2 } @@ -4254,6 +4414,8 @@ iwn_set_led(struct iwn_softc *sc, uint8_ { struct iwn_cmd_led led; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Clear microcode LED ownership. */ IWN_CLRBITS(sc, IWN_LED, IWN_LED_BSM_CTRL); @@ -4274,6 +4436,8 @@ iwn_set_critical_temp(struct iwn_softc * struct iwn_critical_temp crit; int32_t temp; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + IWN_WRITE(sc, IWN_UCODE_GP1_CLR, IWN_UCODE_GP1_CTEMP_STOP_RF); if (sc->hw_type == IWN_HW_REV_TYPE_5150) @@ -4294,6 +4458,8 @@ iwn_set_timing(struct iwn_softc *sc, str struct iwn_cmd_timing cmd; uint64_t val, mod; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + memset(&cmd, 0, sizeof cmd); memcpy(&cmd.tstamp, ni->ni_tstamp.data, sizeof (uint64_t)); cmd.bintval = htole16(ni->ni_intval); @@ -4316,6 +4482,8 @@ iwn4965_power_calibration(struct iwn_sof struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Adjust TX power if need be (delta >= 3 degC). */ DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s: temperature %d->%d\n", __func__, sc->temp, temp); @@ -4487,6 +4655,8 @@ iwn5000_set_txpower(struct iwn_softc *sc { struct iwn5000_cmd_txpower cmd; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* * TX power calibration is handled automatically by the firmware * for 5000 Series. @@ -4509,6 +4679,8 @@ iwn4965_get_rssi(struct iwn_softc *sc, s uint8_t mask, agc; int rssi; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + mask = (le16toh(phy->antenna) >> 4) & IWN_ANT_ABC; agc = (le16toh(phy->agc) >> 7) & 0x7f; @@ -4534,6 +4706,8 @@ iwn5000_get_rssi(struct iwn_softc *sc, s uint8_t agc; int rssi; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + agc = (le32toh(phy->agc) >> 9) & 0x7f; rssi = MAX(le16toh(phy->rssi[0]) & 0xff, @@ -4575,6 +4749,8 @@ iwn4965_get_temperature(struct iwn_softc struct iwn_ucode_info *uc = &sc->ucode_info; int32_t r1, r2, r3, r4, temp; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + r1 = le32toh(uc->temp[0].chan20MHz); r2 = le32toh(uc->temp[1].chan20MHz); r3 = le32toh(uc->temp[2].chan20MHz); @@ -4599,6 +4775,8 @@ iwn5000_get_temperature(struct iwn_softc { int32_t temp; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* * Temperature is not used by the driver for 5000 Series because * TX power calibration is handled by firmware. @@ -4622,6 +4800,8 @@ iwn_init_sensitivity(struct iwn_softc *s uint32_t flags; int error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Reset calibration state machine. */ memset(calib, 0, sizeof (*calib)); calib->state = IWN_CALIB_STATE_INIT; @@ -4666,6 +4846,8 @@ iwn_collect_noise(struct iwn_softc *sc, uint32_t val; int i; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Accumulate RSSI and noise for all 3 antennas. */ for (i = 0; i < 3; i++) { calib->rssi[i] += le32toh(stats->rssi[i]) & 0xff; @@ -4704,6 +4886,9 @@ iwn_collect_noise(struct iwn_softc *sc, /* Enable power-saving mode if requested by user. */ if (ic->ic_flags & IEEE80211_F_PMGTON) (void)iwn_set_pslevel(sc, 0, 3, 1); + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + } static int @@ -4711,6 +4896,8 @@ iwn4965_init_gains(struct iwn_softc *sc) { struct iwn_phy_calib_gain cmd; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + memset(&cmd, 0, sizeof cmd); cmd.code = IWN4965_PHY_CALIB_DIFF_GAIN; /* Differential gains initially set to 0 for all 3 antennas. */ @@ -4724,6 +4911,8 @@ iwn5000_init_gains(struct iwn_softc *sc) { struct iwn_phy_calib cmd; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + memset(&cmd, 0, sizeof cmd); cmd.code = sc->reset_noise_gain; cmd.ngroups = 1; @@ -4740,6 +4929,8 @@ iwn4965_set_gains(struct iwn_softc *sc) struct iwn_phy_calib_gain cmd; int i, delta, noise; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Get minimal noise among connected antennas. */ noise = INT_MAX; /* NB: There's at least one antenna. */ for (i = 0; i < 3; i++) @@ -4773,6 +4964,8 @@ iwn5000_set_gains(struct iwn_softc *sc) struct iwn_phy_calib_gain cmd; int i, ant, div, delta; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* We collected 20 beacons and !=6050 need a 1.5 factor. */ div = (sc->hw_type == IWN_HW_REV_TYPE_6050) ? 20 : 30; @@ -4831,9 +5024,13 @@ iwn_tune_sensitivity(struct iwn_softc *s uint8_t noise[3], noise_ref; int i, needs_update = 0; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Check that we've been enabled long enough. */ - if ((rxena = le32toh(stats->general.load)) == 0) + if ((rxena = le32toh(stats->general.load)) == 0){ + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end not so long\n", __func__); return; + } /* Compute number of false alarms since last call for OFDM. */ fa = le32toh(stats->ofdm.bad_plcp) - calib->bad_plcp_ofdm; @@ -4951,6 +5148,9 @@ iwn_tune_sensitivity(struct iwn_softc *s if (needs_update) (void)iwn_send_sensitivity(sc); + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + #undef dec #undef inc } @@ -5158,6 +5358,8 @@ iwn_config(struct iwn_softc *sc) uint16_t rxchain; int error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + if (sc->hw_type == IWN_HW_REV_TYPE_6005) { /* Set radio temperature sensor offset. */ error = iwn5000_temp_offset_calib(sc); @@ -5271,6 +5473,9 @@ iwn_config(struct iwn_softc *sc) "%s: could not set power saving level\n", __func__); return error; } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return 0; } @@ -5305,6 +5510,8 @@ iwn_scan(struct iwn_softc *sc) uint8_t txant; int buflen, error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + buf = malloc(IWN_SCAN_MAXSZ, M_DEVBUF, M_NOWAIT | M_ZERO); if (buf == NULL) { device_printf(sc->sc_dev, @@ -5440,6 +5647,9 @@ iwn_scan(struct iwn_softc *sc) hdr->nchan); error = iwn_cmd(sc, IWN_CMD_SCAN, buf, buflen, 1); free(buf, M_DEVBUF); + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return error; } @@ -5452,6 +5662,8 @@ iwn_auth(struct iwn_softc *sc, struct ie struct ieee80211_node *ni = vap->iv_bss; int error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Update adapter configuration. */ IEEE80211_ADDR_COPY(sc->rxon.bssid, ni->ni_bssid); sc->rxon.chan = ieee80211_chan2ieee(ic, ni->ni_chan); @@ -5499,6 +5711,9 @@ iwn_auth(struct iwn_softc *sc, struct ie error); return error; } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return 0; } @@ -5513,6 +5728,8 @@ iwn_run(struct iwn_softc *sc, struct iee uint32_t htflags = 0; int error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + if (ic->ic_opmode == IEEE80211_M_MONITOR) { /* Link LED blinks while monitoring. */ iwn_set_led(sc, IWN_LED_LINK, 5, 5); @@ -5632,6 +5849,9 @@ iwn_run(struct iwn_softc *sc, struct iee /* Link LED always on while associated. */ iwn_set_led(sc, IWN_LED_LINK, 0, 1); + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return 0; } @@ -5652,6 +5872,8 @@ iwn_ampdu_rx_start(struct ieee80211_node uint8_t tid; int error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + tid = MS(le16toh(baparamset), IEEE80211_BAPS_TID); ssn = MS(le16toh(baseqctl), IEEE80211_BASEQ_START); @@ -5684,6 +5906,8 @@ iwn_ampdu_rx_stop(struct ieee80211_node struct iwn_node_info node; uint8_t tid; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* XXX: tid as an argument */ for (tid = 0; tid < WME_NUM_TID; tid++) { if (&ni->ni_rx_ampdu[tid] == rap) @@ -5707,6 +5931,8 @@ iwn_addba_request(struct ieee80211_node struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; int qid; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + for (qid = sc->firstaggqueue; qid < sc->ntxqs; qid++) { if (sc->qid2tap[qid] == NULL) break; @@ -5737,6 +5963,8 @@ iwn_addba_response(struct ieee80211_node uint8_t tid = tap->txa_tid; int ret; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + if (code == IEEE80211_STATUS_SUCCESS) { ni->ni_txseqs[tid] = tap->txa_start & 0xfff; ret = iwn_ampdu_tx_start(ni->ni_ic, ni, tid); @@ -5765,6 +5993,8 @@ iwn_ampdu_tx_start(struct ieee80211com * struct iwn_node_info node; int error, qid; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Enable TX for the specified RA/TID. */ wn->disable_tid &= ~(1 << tid); memset(&node, 0, sizeof node); @@ -5796,6 +6026,8 @@ iwn_ampdu_tx_stop(struct ieee80211_node uint8_t tid = tap->txa_tid; int qid; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + sc->sc_addba_stop(ni, tap); if (tap->txa_private == NULL) @@ -5819,6 +6051,8 @@ iwn4965_ampdu_tx_start(struct iwn_softc { struct iwn_node *wn = (void *)ni; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Stop TX scheduler while we're changing its configuration. */ iwn_prph_write(sc, IWN4965_SCHED_QUEUE_STATUS(qid), IWN4965_TXQ_STATUS_CHGACT); @@ -5854,6 +6088,8 @@ iwn4965_ampdu_tx_start(struct iwn_softc static void iwn4965_ampdu_tx_stop(struct iwn_softc *sc, int qid, uint8_t tid, uint16_t ssn) { + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Stop TX scheduler while we're changing its configuration. */ iwn_prph_write(sc, IWN4965_SCHED_QUEUE_STATUS(qid), IWN4965_TXQ_STATUS_CHGACT); @@ -5874,6 +6110,8 @@ static void iwn5000_ampdu_tx_start(struct iwn_softc *sc, struct ieee80211_node *ni, int qid, uint8_t tid, uint16_t ssn) { + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + struct iwn_node *wn = (void *)ni; /* Stop TX scheduler while we're changing its configuration. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Jul 27 15:02:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8CEB8EB; Sat, 27 Jul 2013 15:02:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6B73728F4; Sat, 27 Jul 2013 15:02:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6RF2KK7018349; Sat, 27 Jul 2013 15:02:20 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6RF2KoV018347; Sat, 27 Jul 2013 15:02:20 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201307271502.r6RF2KoV018347@svn.freebsd.org> From: Alexander Motin Date: Sat, 27 Jul 2013 15:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253706 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 15:02:20 -0000 Author: mav Date: Sat Jul 27 15:02:19 2013 New Revision: 253706 URL: http://svnweb.freebsd.org/changeset/base/253706 Log: Introduce 3 seconds timeout on `graid stop` command (mostly with -f flag). Since completion waiting goes in g_event thread, it may cause GEOM deadlock if consumer on top (for example, ZFS) uses g_event thread for closing. Modified: head/sys/geom/raid/g_raid.c head/sys/geom/raid/g_raid_ctl.c Modified: head/sys/geom/raid/g_raid.c ============================================================================== --- head/sys/geom/raid/g_raid.c Sat Jul 27 14:58:23 2013 (r253705) +++ head/sys/geom/raid/g_raid.c Sat Jul 27 15:02:19 2013 (r253706) @@ -2171,7 +2171,7 @@ g_raid_destroy_disk(struct g_raid_disk * int g_raid_destroy(struct g_raid_softc *sc, int how) { - int opens; + int error, opens; g_topology_assert_not(); if (sc == NULL) @@ -2188,11 +2188,13 @@ g_raid_destroy(struct g_raid_softc *sc, G_RAID_DEBUG1(1, sc, "%d volumes are still open.", opens); + sx_xunlock(&sc->sc_lock); return (EBUSY); case G_RAID_DESTROY_DELAYED: G_RAID_DEBUG1(1, sc, "Array will be destroyed on last close."); sc->sc_stopping = G_RAID_DESTROY_DELAYED; + sx_xunlock(&sc->sc_lock); return (EBUSY); case G_RAID_DESTROY_HARD: G_RAID_DEBUG1(1, sc, @@ -2206,9 +2208,9 @@ g_raid_destroy(struct g_raid_softc *sc, /* Wake up worker to let it selfdestruct. */ g_raid_event_send(sc, G_RAID_NODE_E_WAKE, 0); /* Sleep until node destroyed. */ - sx_sleep(&sc->sc_stopping, &sc->sc_lock, - PRIBIO | PDROP, "r:destroy", 0); - return (0); + error = sx_sleep(&sc->sc_stopping, &sc->sc_lock, + PRIBIO | PDROP, "r:destroy", hz * 3); + return (error == EWOULDBLOCK ? EBUSY : 0); } static void @@ -2303,8 +2305,6 @@ g_raid_destroy_geom(struct gctl_req *req sx_xlock(&sc->sc_lock); g_cancel_event(sc); error = g_raid_destroy(gp->softc, G_RAID_DESTROY_SOFT); - if (error != 0) - sx_xunlock(&sc->sc_lock); g_topology_lock(); return (error); } @@ -2469,7 +2469,6 @@ g_raid_shutdown_post_sync(void *arg, int struct g_geom *gp, *gp2; struct g_raid_softc *sc; struct g_raid_volume *vol; - int error; mp = arg; DROP_GIANT(); @@ -2483,9 +2482,7 @@ g_raid_shutdown_post_sync(void *arg, int TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) g_raid_clean(vol, -1); g_cancel_event(sc); - error = g_raid_destroy(sc, G_RAID_DESTROY_DELAYED); - if (error != 0) - sx_xunlock(&sc->sc_lock); + g_raid_destroy(sc, G_RAID_DESTROY_DELAYED); g_topology_lock(); } g_topology_unlock(); Modified: head/sys/geom/raid/g_raid_ctl.c ============================================================================== --- head/sys/geom/raid/g_raid_ctl.c Sat Jul 27 14:58:23 2013 (r253705) +++ head/sys/geom/raid/g_raid_ctl.c Sat Jul 27 15:02:19 2013 (r253706) @@ -181,7 +181,7 @@ g_raid_ctl_stop(struct gctl_req *req, st sx_xlock(&sc->sc_lock); error = g_raid_destroy(sc, how); if (error != 0) - sx_xunlock(&sc->sc_lock); + gctl_error(req, "Array is busy."); g_topology_lock(); } From owner-svn-src-head@FreeBSD.ORG Sat Jul 27 15:28:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7921E5FF; Sat, 27 Jul 2013 15:28:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5784229CB; Sat, 27 Jul 2013 15:28:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6RFSWIe025267; Sat, 27 Jul 2013 15:28:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6RFSVIB025265; Sat, 27 Jul 2013 15:28:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201307271528.r6RFSVIB025265@svn.freebsd.org> From: Marius Strobl Date: Sat, 27 Jul 2013 15:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253707 - in head/usr.sbin/makefs: . cd9660 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 15:28:32 -0000 Author: marius Date: Sat Jul 27 15:28:31 2013 New Revision: 253707 URL: http://svnweb.freebsd.org/changeset/base/253707 Log: - Set the System Identifier in the Primary Volume Descriptor to FreeBSD rather than NetBSD. - Correctly set the Expiration Time in the Primary Volume Descriptor; according to ISO 9660 8.4.26.1 unspecified date and time are denoted by the digit 0 in RBP 1 to 16 but the number 0 in RBP 17. [1] - Merge iso9660_rrip.c rev. 1.11 from NetBSD: name_len should be read as unsigned byte. [2] Note: This is according to ISO 9660 9.1.10. - Rock Ridge TF entries should use a length of 5, because after the 4 bytes of generic SUSP header there is one byte of flags. See typedef of ISO_RRIP_TF in iso9660_rrip.h. [1] Submitted by: Thomas Schmitt [1] Obtained from: NetBSD [2] MFC after: 3 days Modified: head/usr.sbin/makefs/cd9660.c head/usr.sbin/makefs/cd9660/iso9660_rrip.c Modified: head/usr.sbin/makefs/cd9660.c ============================================================================== --- head/usr.sbin/makefs/cd9660.c Sat Jul 27 15:02:19 2013 (r253706) +++ head/usr.sbin/makefs/cd9660.c Sat Jul 27 15:28:31 2013 (r253707) @@ -230,7 +230,7 @@ cd9660_set_defaults(void) memset(diskStructure.primaryDescriptor.abstract_file_id, 0x20,37); memset(diskStructure.primaryDescriptor.bibliographic_file_id, 0x20,37); - strcpy(diskStructure.primaryDescriptor.system_id,"NetBSD"); + strcpy(diskStructure.primaryDescriptor.system_id, "FreeBSD"); cd9660_defaults_set = 1; @@ -681,7 +681,8 @@ cd9660_finalize_PVD(void) cd9660_set_date(diskStructure.primaryDescriptor.expiration_date, now); */ - memset(diskStructure.primaryDescriptor.expiration_date, '0' ,17); + memset(diskStructure.primaryDescriptor.expiration_date, '0', 16); + diskStructure.primaryDescriptor.expiration_date[16] = 0; cd9660_time_8426( (unsigned char *)diskStructure.primaryDescriptor.effective_date, tim); Modified: head/usr.sbin/makefs/cd9660/iso9660_rrip.c ============================================================================== --- head/usr.sbin/makefs/cd9660/iso9660_rrip.c Sat Jul 27 15:02:19 2013 (r253706) +++ head/usr.sbin/makefs/cd9660/iso9660_rrip.c Sat Jul 27 15:28:31 2013 (r253707) @@ -1,4 +1,4 @@ -/* $NetBSD: iso9660_rrip.c,v 1.10 2011/05/29 17:07:58 tsutsui Exp $ */ +/* $NetBSD: iso9660_rrip.c,v 1.11 2012/04/29 13:32:21 joerg Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -419,9 +419,9 @@ cd9660_rrip_initialize_node(cd9660node * } else if ((node->node != NULL) && ((strlen(node->node->name) != - (int)node->isoDirRecord->name_len[0]) || + (uint8_t)node->isoDirRecord->name_len[0]) || (memcmp(node->node->name,node->isoDirRecord->name, - (int) node->isoDirRecord->name_len[0]) != 0))) { + (uint8_t)node->isoDirRecord->name_len[0]) != 0))) { cd9660_rrip_NM(node); } @@ -685,7 +685,7 @@ int cd9660node_rrip_tf(struct ISO_SUSP_ATTRIBUTES *p, fsnode *_node) { p->attr.rr_entry.TF.flags[0] = TF_MODIFY | TF_ACCESS | TF_ATTRIBUTES; - p->attr.rr_entry.TF.h.length[0] = 4; + p->attr.rr_entry.TF.h.length[0] = 5; p->attr.rr_entry.TF.h.version[0] = 1; /* From owner-svn-src-head@FreeBSD.ORG Sat Jul 27 16:32:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 51D77378; Sat, 27 Jul 2013 16:32:35 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2537C2BAC; Sat, 27 Jul 2013 16:32:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6RGWZvZ046751; Sat, 27 Jul 2013 16:32:35 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6RGWYF8046749; Sat, 27 Jul 2013 16:32:34 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201307271632.r6RGWYF8046749@svn.freebsd.org> From: Sean Bruno Date: Sat, 27 Jul 2013 16:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253708 - head/sys/dev/ipmi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 16:32:35 -0000 Author: sbruno Date: Sat Jul 27 16:32:34 2013 New Revision: 253708 URL: http://svnweb.freebsd.org/changeset/base/253708 Log: At some point after stable/7 the ACPI and ISA interfaces to the IPMI controller no longer have the parent in the device tree. This causes the identify function in ipmi_isa.c to attempt to probe and poke at the ISA IPMI interface Move the check for ipmi_attached out of the ipmi_isa_attach function and into the ipmi_isa_identify function. Remove the check of the device tree for ipmi devices attached. This probing appears to make Broadcom management firmware on Dell machines crash and emit NMI EISA warnings at various times requiring power cycles of the machines to restore. Bump MAX_TIMEOUT to 6 seconds as a hack for super slow IPMI interfaces that need longer to respond to our intial probes on startup. Tested on Dell R410, R510, R815, HP DL160G6 This is MFC candidate for 9.2R Reviewed by: peter MFC after: 2 weeks Sponsored by: Yahoo! Inc. Modified: head/sys/dev/ipmi/ipmi_isa.c head/sys/dev/ipmi/ipmivars.h Modified: head/sys/dev/ipmi/ipmi_isa.c ============================================================================== --- head/sys/dev/ipmi/ipmi_isa.c Sat Jul 27 15:28:31 2013 (r253707) +++ head/sys/dev/ipmi/ipmi_isa.c Sat Jul 27 16:32:34 2013 (r253708) @@ -56,8 +56,15 @@ ipmi_isa_identify(driver_t *driver, devi struct ipmi_get_info info; uint32_t devid; - if (ipmi_smbios_identify(&info) && info.iface_type != SSIF_MODE && - device_find_child(parent, "ipmi", -1) == NULL) { + /* + * Give other drivers precedence. Unfortunately, this doesn't + * work if we have an SMBIOS table that duplicates a PCI device + * that's later on the bus than the PCI-ISA bridge. + */ + if (ipmi_attached) + return; + + if (ipmi_smbios_identify(&info) && info.iface_type != SSIF_MODE) { /* * XXX: Hack alert. On some broken systems, the IPMI * interface is described via SMBIOS, but the actual @@ -175,14 +182,6 @@ ipmi_isa_attach(device_t dev) !ipmi_hint_identify(dev, &info)) return (ENXIO); - /* - * Give other drivers precedence. Unfortunately, this doesn't - * work if we have an SMBIOS table that duplicates a PCI device - * that's later on the bus than the PCI-ISA bridge. - */ - if (ipmi_attached) - return (EBUSY); - switch (info.iface_type) { case KCS_MODE: count = 2; Modified: head/sys/dev/ipmi/ipmivars.h ============================================================================== --- head/sys/dev/ipmi/ipmivars.h Sat Jul 27 15:28:31 2013 (r253707) +++ head/sys/dev/ipmi/ipmivars.h Sat Jul 27 16:32:34 2013 (r253708) @@ -219,7 +219,7 @@ struct ipmi_ipmb { ((sc)->ipmi_io_res[1] != NULL ? OUTB_MULTIPLE(sc, x, value) : \ OUTB_SINGLE(sc, x, value)) -#define MAX_TIMEOUT 3 * hz +#define MAX_TIMEOUT 6 * hz int ipmi_attach(device_t); int ipmi_detach(device_t); From owner-svn-src-head@FreeBSD.ORG Sat Jul 27 16:42:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id ABD6A6EE; Sat, 27 Jul 2013 16:42:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 800802C2E; Sat, 27 Jul 2013 16:42:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6RGgTC0049637; Sat, 27 Jul 2013 16:42:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6RGgTlR049636; Sat, 27 Jul 2013 16:42:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307271642.r6RGgTlR049636@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 27 Jul 2013 16:42:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253709 - head/sys/dev/drm2/i915 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 16:42:29 -0000 Author: kib Date: Sat Jul 27 16:42:29 2013 New Revision: 253709 URL: http://svnweb.freebsd.org/changeset/base/253709 Log: The pmap_qenter() and pmap_qremove() perform TLB invalidation on its own, no need to call pmap_invalidate_range() one more time. Noted by: alc MFC after: 1 week Modified: head/sys/dev/drm2/i915/intel_ringbuffer.c Modified: head/sys/dev/drm2/i915/intel_ringbuffer.c ============================================================================== --- head/sys/dev/drm2/i915/intel_ringbuffer.c Sat Jul 27 16:32:34 2013 (r253708) +++ head/sys/dev/drm2/i915/intel_ringbuffer.c Sat Jul 27 16:42:29 2013 (r253709) @@ -365,8 +365,6 @@ init_pipe_control(struct intel_ring_buff if (pc->cpu_page == NULL) goto err_unpin; pmap_qenter((uintptr_t)pc->cpu_page, &obj->pages[0], 1); - pmap_invalidate_range(kernel_pmap, (vm_offset_t)pc->cpu_page, - (vm_offset_t)pc->cpu_page + PAGE_SIZE); pmap_invalidate_cache_range((vm_offset_t)pc->cpu_page, (vm_offset_t)pc->cpu_page + PAGE_SIZE); @@ -394,8 +392,6 @@ cleanup_pipe_control(struct intel_ring_b obj = pc->obj; pmap_qremove((vm_offset_t)pc->cpu_page, 1); - pmap_invalidate_range(kernel_pmap, (vm_offset_t)pc->cpu_page, - (vm_offset_t)pc->cpu_page + PAGE_SIZE); kmem_free(kernel_map, (uintptr_t)pc->cpu_page, PAGE_SIZE); i915_gem_object_unpin(obj); drm_gem_object_unreference(&obj->base); @@ -972,9 +968,6 @@ static void cleanup_status_page(struct i return; pmap_qremove((vm_offset_t)ring->status_page.page_addr, 1); - pmap_invalidate_range(kernel_pmap, - (vm_offset_t)ring->status_page.page_addr, - (vm_offset_t)ring->status_page.page_addr + PAGE_SIZE); kmem_free(kernel_map, (vm_offset_t)ring->status_page.page_addr, PAGE_SIZE); i915_gem_object_unpin(obj); @@ -1014,9 +1007,6 @@ static int init_status_page(struct intel } pmap_qenter((vm_offset_t)ring->status_page.page_addr, &obj->pages[0], 1); - pmap_invalidate_range(kernel_pmap, - (vm_offset_t)ring->status_page.page_addr, - (vm_offset_t)ring->status_page.page_addr + PAGE_SIZE); pmap_invalidate_cache_range((vm_offset_t)ring->status_page.page_addr, (vm_offset_t)ring->status_page.page_addr + PAGE_SIZE); ring->status_page.obj = obj; From owner-svn-src-head@FreeBSD.ORG Sat Jul 27 16:44:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5C04A845; Sat, 27 Jul 2013 16:44:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 498E52C45; Sat, 27 Jul 2013 16:44:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6RGicBf049945; Sat, 27 Jul 2013 16:44:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6RGic5v049944; Sat, 27 Jul 2013 16:44:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307271644.r6RGic5v049944@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 27 Jul 2013 16:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253710 - head/sys/dev/drm2/ttm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 16:44:38 -0000 Author: kib Date: Sat Jul 27 16:44:37 2013 New Revision: 253710 URL: http://svnweb.freebsd.org/changeset/base/253710 Log: MFgem r251960: re-check the mgt device object for the requested page after the object was relocked. Tested by: dumbbell Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_bo_vm.c Sat Jul 27 16:42:29 2013 (r253709) +++ head/sys/dev/drm2/ttm/ttm_bo_vm.c Sat Jul 27 16:44:37 2013 (r253710) @@ -102,7 +102,7 @@ ttm_bo_vm_fault(vm_object_t vm_obj, vm_o struct ttm_buffer_object *bo = vm_obj->handle; struct ttm_bo_device *bdev = bo->bdev; struct ttm_tt *ttm = NULL; - vm_page_t m, oldm; + vm_page_t m, m1, oldm; int ret; int retval = VM_PAGER_OK; struct ttm_mem_type_manager *man = @@ -220,7 +220,14 @@ reserve: } m->valid = VM_PAGE_BITS_ALL; *mres = m; - vm_page_insert(m, vm_obj, OFF_TO_IDX(offset)); + m1 = vm_page_lookup(vm_obj, OFF_TO_IDX(offset)); + if (m1 == NULL) { + vm_page_insert(m, vm_obj, OFF_TO_IDX(offset)); + } else { + KASSERT(m == m1, + ("inconsistent insert bo %p m %p m1 %p offset %jx", + bo, m, m1, (uintmax_t)offset)); + } vm_page_busy(m); if (oldm != NULL) { From owner-svn-src-head@FreeBSD.ORG Sat Jul 27 17:20:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 96AF33E0; Sat, 27 Jul 2013 17:20:44 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F7192D6C; Sat, 27 Jul 2013 17:20:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6RHKicB062084; Sat, 27 Jul 2013 17:20:44 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6RHKix6062083; Sat, 27 Jul 2013 17:20:44 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201307271720.r6RHKix6062083@svn.freebsd.org> From: Sean Bruno Date: Sat, 27 Jul 2013 17:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253712 - head/sys/dev/ciss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 17:20:44 -0000 Author: sbruno Date: Sat Jul 27 17:20:43 2013 New Revision: 253712 URL: http://svnweb.freebsd.org/changeset/base/253712 Log: update ciss debugger command to iterate over multiple raid controllers up to max controllers supported PR: kern/179932 Reviewed by: Markus Gebert MFC after: 2 weeks Sponsored by: Yahoo! Inc. Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Sat Jul 27 17:16:59 2013 (r253711) +++ head/sys/dev/ciss/ciss.c Sat Jul 27 17:20:43 2013 (r253712) @@ -4378,11 +4378,17 @@ ciss_print_adapter(struct ciss_softc *sc DB_COMMAND(ciss_prt, db_ciss_prt) { struct ciss_softc *sc; + devclass_t dc; + int maxciss, i; - sc = devclass_get_softc(devclass_find("ciss"), 0); - if (sc == NULL) { - printf("no ciss controllers\n"); - } else { + dc = devclass_find("ciss"); + if ( dc == NULL ) { + printf("%s: can't find devclass!\n", __func__); + return; + } + maxciss = devclass_get_maxunit(dc); + for (i = 0; i < maxciss; i++) { + sc = devclass_get_softc(dc, i); ciss_print_adapter(sc); } } From owner-svn-src-head@FreeBSD.ORG Sat Jul 27 18:18:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C2591480; Sat, 27 Jul 2013 18:18:47 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AF4A92F87; Sat, 27 Jul 2013 18:18:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6RIIlZo078231; Sat, 27 Jul 2013 18:18:47 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6RIIlJj078230; Sat, 27 Jul 2013 18:18:47 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201307271818.r6RIIlJj078230@svn.freebsd.org> From: Tim Kientzle Date: Sat, 27 Jul 2013 18:18:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253714 - head/sys/boot/arm/uboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 18:18:47 -0000 Author: kientzle Date: Sat Jul 27 18:18:46 2013 New Revision: 253714 URL: http://svnweb.freebsd.org/changeset/base/253714 Log: Install Forth infrastructure along with ubldr. Note: loader.rc is installed as loader.rc.sample so that by default, none of this is actually used. Modified: head/sys/boot/arm/uboot/Makefile Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Sat Jul 27 17:25:43 2013 (r253713) +++ head/sys/boot/arm/uboot/Makefile Sat Jul 27 18:18:46 2013 (r253714) @@ -134,7 +134,20 @@ ldscript.generated:: mv ldscript.generated.tmp ldscript.generated; \ fi +.if !defined(LOADER_ONLY) .PATH: ${.CURDIR}/../../forth -FILES= loader.help +FILES+= loader.help loader.4th support.4th loader.conf +FILES+= screen.4th frames.4th beastie.4th +FILES+= brand.4th check-password.4th color.4th delay.4th +FILES+= menu.4th menu-commands.4th menusets.4th shortcuts.4th version.4th +FILESDIR_loader.conf= /boot/defaults + +# Put sample loader.rc and menu.rc on disk but don't enable them +# by default. +FILES+= loader.rc +FILESNAME_loader.rc= loader.rc.sample +FILES+= menu.rc +FILESNAME_menu.rc= menu.rc.sample +.endif .include From owner-svn-src-head@FreeBSD.ORG Sat Jul 27 18:19:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 158D75B9; Sat, 27 Jul 2013 18:19:29 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 011AD2F8C; Sat, 27 Jul 2013 18:19:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6RIJSxQ078354; Sat, 27 Jul 2013 18:19:28 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6RIJSqs078353; Sat, 27 Jul 2013 18:19:28 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201307271819.r6RIJSqs078353@svn.freebsd.org> From: Tim Kientzle Date: Sat, 27 Jul 2013 18:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253715 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 18:19:29 -0000 Author: kientzle Date: Sat Jul 27 18:19:28 2013 New Revision: 253715 URL: http://svnweb.freebsd.org/changeset/base/253715 Log: Put in commented-out version of beastie menu commands so that non-i386 users can easily experiment with this. Modified: head/sys/boot/forth/loader.rc Modified: head/sys/boot/forth/loader.rc ============================================================================== --- head/sys/boot/forth/loader.rc Sat Jul 27 18:18:46 2013 (r253714) +++ head/sys/boot/forth/loader.rc Sat Jul 27 18:19:28 2013 (r253715) @@ -10,5 +10,9 @@ start \ Tests for password -- executes autoboot first if a password was defined check-password +\ Uncomment to enable boot menu +\ include /boot/beastie.4th +\ beastie-start + \ Unless set otherwise, autoboot is automatic at this point From owner-svn-src-head@FreeBSD.ORG Sat Jul 27 20:47:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3FB451C0; Sat, 27 Jul 2013 20:47:03 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 10FA52457; Sat, 27 Jul 2013 20:47:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6RKl2cb023268; Sat, 27 Jul 2013 20:47:02 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6RKl2vI023259; Sat, 27 Jul 2013 20:47:02 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201307272047.r6RKl2vI023259@svn.freebsd.org> From: Alfred Perlstein Date: Sat, 27 Jul 2013 20:47:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253719 - in head: sys/conf sys/dev/watchdog sys/libkern sys/sys usr.sbin/watchdogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 20:47:03 -0000 Author: alfred Date: Sat Jul 27 20:47:01 2013 New Revision: 253719 URL: http://svnweb.freebsd.org/changeset/base/253719 Log: Fix watchdog pretimeout. The original API calls for pow2ns, however the new APIs from Linux call for seconds. We need to be able to convert to/from 2^Nns to seconds in both userland and kernel to fix this and properly compare units. Added: head/sys/libkern/flsll.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/watchdog/watchdog.c head/sys/sys/libkern.h head/usr.sbin/watchdogd/watchdogd.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Jul 27 20:15:18 2013 (r253718) +++ head/sys/conf/files Sat Jul 27 20:47:01 2013 (r253719) @@ -2976,6 +2976,7 @@ libkern/arc4random.c standard libkern/bcd.c standard libkern/bsearch.c standard libkern/crc32.c standard +libkern/flsll.c standard libkern/fnmatch.c standard libkern/iconv.c optional libiconv libkern/iconv_converter_if.m optional libiconv Modified: head/sys/dev/watchdog/watchdog.c ============================================================================== --- head/sys/dev/watchdog/watchdog.c Sat Jul 27 20:15:18 2013 (r253718) +++ head/sys/dev/watchdog/watchdog.c Sat Jul 27 20:47:01 2013 (r253719) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -60,10 +61,56 @@ static int wd_softtimeout_act = WD_SOFT_ static struct cdev *wd_dev; static volatile u_int wd_last_u; /* last timeout value set by kern_do_pat */ +static u_int wd_last_u_sysctl; /* last timeout value set by kern_do_pat */ +static u_int wd_last_u_sysctl_secs; /* wd_last_u in seconds */ + +SYSCTL_NODE(_hw, OID_AUTO, watchdog, CTLFLAG_RD, 0, "Main watchdog device"); +SYSCTL_UINT(_hw_watchdog, OID_AUTO, wd_last_u, CTLFLAG_RD, + &wd_last_u_sysctl, 0, "Watchdog last update time"); +SYSCTL_UINT(_hw_watchdog, OID_AUTO, wd_last_u_secs, CTLFLAG_RD, + &wd_last_u_sysctl_secs, 0, "Watchdog last update time"); static int wd_lastpat_valid = 0; static time_t wd_lastpat = 0; /* when the watchdog was last patted */ +static void +pow2ns_to_ts(int pow2ns, struct timespec *ts) +{ + uint64_t ns; + + ns = 1ULL << pow2ns; + ts->tv_sec = ns / 1000000000ULL; + ts->tv_nsec = ns % 1000000000ULL; +} + +static int +pow2ns_to_ticks(int pow2ns) +{ + struct timeval tv; + struct timespec ts; + + pow2ns_to_ts(pow2ns, &ts); + TIMESPEC_TO_TIMEVAL(&tv, &ts); + return (tvtohz(&tv)); +} + +static int +seconds_to_pow2ns(int seconds) +{ + uint64_t power; + uint64_t ns; + uint64_t shifted; + + ns = ((uint64_t)seconds) * 1000000000ULL; + power = flsll(ns); + shifted = 1ULL << power; + if (shifted <= ns) { + power++; + } + return (power); +} + + int wdog_kern_pat(u_int utim) { @@ -86,6 +133,8 @@ wdog_kern_pat(u_int utim) * This can be zero (to disable the watchdog) */ wd_last_u = (utim & WD_INTERVAL); + wd_last_u_sysctl = wd_last_u; + wd_last_u_sysctl_secs = pow2ns_to_ticks(wd_last_u) / hz; } if ((utim & WD_INTERVAL) == WD_TO_NEVER) { utim = 0; @@ -101,7 +150,7 @@ wdog_kern_pat(u_int utim) callout_stop(&wd_softtimeo_handle); } else { (void) callout_reset(&wd_softtimeo_handle, - hz*utim, wd_timeout_cb, "soft"); + pow2ns_to_ticks(utim), wd_timeout_cb, "soft"); } error = 0; } else { @@ -201,10 +250,13 @@ static int wd_set_pretimeout(int newtimeout, int disableiftoolong) { u_int utime; + struct timespec utime_ts; + int timeout_ticks; utime = wdog_kern_last_timeout(); + pow2ns_to_ts(utime, &utime_ts); /* do not permit a pre-timeout >= than the timeout. */ - if (newtimeout >= utime) { + if (newtimeout >= utime_ts.tv_sec) { /* * If 'disableiftoolong' then just fall through * so as to disable the pre-watchdog @@ -222,8 +274,22 @@ wd_set_pretimeout(int newtimeout, int di return 0; } + timeout_ticks = pow2ns_to_ticks(utime) - (hz*newtimeout); +#if 0 + printf("wd_set_pretimeout: " + "newtimeout: %d, " + "utime: %d -> utime_ticks: %d, " + "hz*newtimeout: %d, " + "timeout_ticks: %d -> sec: %d\n", + newtimeout, + utime, pow2ns_to_ticks(utime), + hz*newtimeout, + timeout_ticks, timeout_ticks / hz); +#endif + /* We determined the value is sane, so reset the callout */ - (void) callout_reset(&wd_pretimeo_handle, hz*(utime - newtimeout), + (void) callout_reset(&wd_pretimeo_handle, + timeout_ticks, wd_timeout_cb, "pre-timeout"); wd_pretimeout = newtimeout; return 0; @@ -282,7 +348,7 @@ wd_ioctl(struct cdev *dev __unused, u_lo break; case WDIOC_SETTIMEOUT: u = *(u_int *)data; - error = wdog_kern_pat(u); + error = wdog_kern_pat(seconds_to_pow2ns(u)); break; case WDIOC_GETTIMEOUT: u = wdog_kern_last_timeout(); Added: head/sys/libkern/flsll.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/libkern/flsll.c Sat Jul 27 20:47:01 2013 (r253719) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +__FBSDID("$FreeBSD$"); + +/* + * Find Last Set bit + */ +int +flsll(long long mask) +{ + int bit; + + if (mask == 0) + return (0); + for (bit = 1; mask != 1; bit++) + mask = (unsigned long long)mask >> 1; + return (bit); +} Modified: head/sys/sys/libkern.h ============================================================================== --- head/sys/sys/libkern.h Sat Jul 27 20:15:18 2013 (r253718) +++ head/sys/sys/libkern.h Sat Jul 27 20:47:01 2013 (r253719) @@ -94,6 +94,10 @@ int fls(int); #ifndef HAVE_INLINE_FLSL int flsl(long); #endif +#ifndef HAVE_INLINE_FLSLL +int flsll(long long); +#endif + int fnmatch(const char *, const char *, int); int locc(int, char *, u_int); void *memchr(const void *s, int c, size_t n); Modified: head/usr.sbin/watchdogd/watchdogd.c ============================================================================== --- head/usr.sbin/watchdogd/watchdogd.c Sat Jul 27 20:15:18 2013 (r253718) +++ head/usr.sbin/watchdogd/watchdogd.c Sat Jul 27 20:47:01 2013 (r253719) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -58,19 +59,24 @@ __FBSDID("$FreeBSD$"); #include +static long fetchtimeout(int opt, const char *longopt, const char *myoptarg); static void parseargs(int, char *[]); +static int seconds_to_pow2ns(int); static void sighandler(int); static void watchdog_loop(void); static int watchdog_init(void); static int watchdog_onoff(int onoff); static int watchdog_patpat(u_int timeout); static void usage(void); +static int tstotv(struct timeval *tv, struct timespec *ts); +static int tvtohz(struct timeval *tv); static int debugging = 0; static int end_program = 0; static const char *pidfile = _PATH_VARRUN "watchdogd.pid"; static u_int timeout = WD_TO_128SEC; static u_int pretimeout = 0; +static u_int timeout_sec; static u_int passive = 0; static int is_daemon = 0; static int is_dry_run = 0; /* do not arm the watchdog, only @@ -183,6 +189,59 @@ main(int argc, char *argv[]) } } +static void +pow2ns_to_ts(int pow2ns, struct timespec *ts) +{ + uint64_t ns; + + ns = 1ULL << pow2ns; + ts->tv_sec = ns / 1000000000ULL; + ts->tv_nsec = ns % 1000000000ULL; +} + +/* + * Convert a timeout in seconds to N where 2^N nanoseconds is close to + * "seconds". + * + * The kernel expects the timeouts for watchdogs in "2^N nanosecond format". + */ +static u_int +parse_timeout_to_pow2ns(char opt, const char *longopt, const char *myoptarg) +{ + double a; + u_int rv; + struct timespec ts; + struct timeval tv; + int ticks; + char shortopt[] = "- "; + + if (!longopt) + shortopt[1] = opt; + + a = fetchtimeout(opt, longopt, myoptarg); + + if (a == 0) + rv = WD_TO_NEVER; + else + rv = seconds_to_pow2ns(a); + pow2ns_to_ts(rv, &ts); + tstotv(&tv, &ts); + ticks = tvtohz(&tv); + if (debugging) { + printf("Timeout for %s%s " + "is 2^%d nanoseconds " + "(in: %s sec -> out: %ld sec %ld ns -> %d ticks)\n", + longopt ? "-" : "", longopt ? longopt : shortopt, + rv, + myoptarg, ts.tv_sec, ts.tv_nsec, ticks); + } + if (ticks <= 0) { + errx(1, "Timeout for %s%s is too small, please choose a higher timeout.", longopt ? "-" : "", longopt ? longopt : shortopt); + } + + return (rv); +} + /* * Catch signals and begin shutdown process. */ @@ -513,6 +572,110 @@ timeout_act_str2int(const char *lopt, co return rv; } +int +tstotv(struct timeval *tv, struct timespec *ts) +{ + + tv->tv_sec = ts->tv_sec; + tv->tv_usec = ts->tv_nsec / 1000; + return 0; +} + +/* + * Convert a timeval to a number of ticks. + * Mostly copied from the kernel. + */ +int +tvtohz(struct timeval *tv) +{ + register unsigned long ticks; + register long sec, usec; + int hz; + size_t hzsize; + int error; + int tick; + + hzsize = sizeof(hz); + + error = sysctlbyname("kern.hz", &hz, &hzsize, NULL, 0); + if (error) + err(1, "sysctlbyname kern.hz"); + + tick = 1000000 / hz; + + /* + * If the number of usecs in the whole seconds part of the time + * difference fits in a long, then the total number of usecs will + * fit in an unsigned long. Compute the total and convert it to + * ticks, rounding up and adding 1 to allow for the current tick + * to expire. Rounding also depends on unsigned long arithmetic + * to avoid overflow. + * + * Otherwise, if the number of ticks in the whole seconds part of + * the time difference fits in a long, then convert the parts to + * ticks separately and add, using similar rounding methods and + * overflow avoidance. This method would work in the previous + * case but it is slightly slower and assumes that hz is integral. + * + * Otherwise, round the time difference down to the maximum + * representable value. + * + * If ints have 32 bits, then the maximum value for any timeout in + * 10ms ticks is 248 days. + */ + sec = tv->tv_sec; + usec = tv->tv_usec; + if (usec < 0) { + sec--; + usec += 1000000; + } + if (sec < 0) { +#ifdef DIAGNOSTIC + if (usec > 0) { + sec++; + usec -= 1000000; + } + printf("tvotohz: negative time difference %ld sec %ld usec\n", + sec, usec); +#endif + ticks = 1; + } else if (sec <= LONG_MAX / 1000000) + ticks = (sec * 1000000 + (unsigned long)usec + (tick - 1)) + / tick + 1; + else if (sec <= LONG_MAX / hz) + ticks = sec * hz + + ((unsigned long)usec + (tick - 1)) / tick + 1; + else + ticks = LONG_MAX; + if (ticks > INT_MAX) + ticks = INT_MAX; + return ((int)ticks); +} + +static int +seconds_to_pow2ns(int seconds) +{ + uint64_t power; + uint64_t ns; + uint64_t shifted; + + if (seconds <= 0) + errx(1, "seconds %d < 0", seconds); + ns = ((uint64_t)seconds) * 1000000000ULL; + power = flsll(ns); + shifted = 1ULL << power; + if (shifted <= ns) { + power++; + } + if (debugging) { + printf("shifted %lld\n", (long long)shifted); + printf("seconds_to_pow2ns: seconds: %d, ns %lld, power %d\n", + seconds, (long long)ns, (int)power); + } + return (power); +} + + /* * Handle the few command line arguments supported. */ @@ -521,9 +684,7 @@ parseargs(int argc, char *argv[]) { int longindex; int c; - char *p; const char *lopt; - double a; /* * if we end with a 'd' aka 'watchdogd' then we are the daemon program, @@ -565,21 +726,11 @@ parseargs(int argc, char *argv[]) do_syslog = 0; break; case 't': - p = NULL; - errno = 0; - a = strtod(optarg, &p); - if ((p != NULL && *p != '\0') || errno != 0) - errx(EX_USAGE, "-t argument is not a number"); - if (a < 0) - errx(EX_USAGE, "-t argument must be positive"); - - if (a == 0) - timeout = WD_TO_NEVER; - else - timeout = flsll(a * 1e9); - if (debugging) - printf("Timeout is 2^%d nanoseconds\n", - timeout); + timeout_sec = atoi(optarg); + timeout = parse_timeout_to_pow2ns(c, NULL, optarg); + if (debugging) + printf("Timeout is 2^%d nanoseconds\n", + timeout); break; case 'T': carp_thresh_seconds = fetchtimeout(c, "NULL", optarg); @@ -618,4 +769,15 @@ parseargs(int argc, char *argv[]) errx(EX_USAGE, "extra arguments."); if (is_daemon && timeout < WD_TO_1SEC) errx(EX_USAGE, "-t argument is less than one second."); + if (pretimeout_set) { + struct timespec ts; + + pow2ns_to_ts(timeout, &ts); + if (pretimeout >= ts.tv_sec) { + errx(EX_USAGE, + "pretimeout (%d) >= timeout (%d -> %ld)\n" + "see manual section TIMEOUT RESOLUTION", + pretimeout, timeout_sec, (long)ts.tv_sec); + } + } } From owner-svn-src-head@FreeBSD.ORG Sat Jul 27 20:48:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A584E308 for ; Sat, 27 Jul 2013 20:48:04 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 762C12462 for ; Sat, 27 Jul 2013 20:48:04 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id ro12so38949pbb.27 for ; Sat, 27 Jul 2013 13:47:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :x-gm-message-state; bh=XPUQG9xsVlmb7bcoASZZJGKZESKuJdnuv2+4Gvu1S1E=; b=eoqRDMAdlG5rMxEt4uSVB+0dAeogNRy2xHXh+SbNPZI1jEteUXjddy9bLQ9FE5rUQ3 4oSsfcCtsI3x9DDH4ztm/qTBpep8CLBi1CBfRdJQGaPDqzppFP5AXS6TRLq+KjjPWHAc EdXh8Pqd/K98oxk5/ZJ8JBbIVv+kftfw4RaI1OSE+qd0T8Fbb8MF9JYs9EbF8aFA+qn3 cXPmbJWHuVRK9RUQO6z34QwM2O3EiXKhB9iCGw2Ha6bStkN8pUVwiYARW11UISd6De7b 4CeZvyAVeD6l0x87/4DMhH6JsK5iNs62v8Maf8X9AHhlSN1SmqQ/kvx6+ZfKKw7QWgJ0 5C6Q== X-Received: by 10.68.218.199 with SMTP id pi7mr60324737pbc.19.1374958078693; Sat, 27 Jul 2013 13:47:58 -0700 (PDT) Received: from zont-osx.local (c-50-136-243-235.hsd1.ca.comcast.net. [50.136.243.235]) by mx.google.com with ESMTPSA id t9sm9748276pba.46.2013.07.27.13.47.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 27 Jul 2013 13:47:57 -0700 (PDT) Sender: Andrey Zonov Message-ID: <51F431F8.1040803@FreeBSD.org> Date: Sat, 27 Jul 2013 13:47:52 -0700 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r253662 - in head: lib/libc/gen sys/vm tools/tools/sysdoc References: <201307260200.r6Q207cB015223@svn.freebsd.org> <20130726150949.GC14175@stack.nl> <51F2E970.3070303@FreeBSD.org> <20130727170845.E872@besplex.bde.org> In-Reply-To: <20130727170845.E872@besplex.bde.org> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2BWDOWUBELCWUQNFBHHBD" X-Gm-Message-State: ALoCoQkWZhcEx+cqK6Rl2jH0Fdi4j++kKukxJueuS0riaeGsteEn8AZeswQw9AxzNKLMESi1uZ0p Cc: Juli Mallett , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Jilles Tjoelker X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 20:48:04 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2BWDOWUBELCWUQNFBHHBD Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 7/27/13 12:47 AM, Bruce Evans wrote: > On Fri, 26 Jul 2013, Juli Mallett wrote: >=20 >> On Fri, Jul 26, 2013 at 2:26 PM, Andrey Zonov wrote= : >> >>> On 7/26/13 8:09 AM, Jilles Tjoelker wrote: >>>> As noted in mail from Bruce Evans, please preserve the ABI of >>>> VM_SWAPPING_ENABLED here. >>> >>> I don't think it's a big problem. Internally we don't use it. Good >>> code uses sysctlbyname() instead of sysctl(). It doesn't seem to me >>> this is very popular sysctl. It's also CURRENT without MFC. >> >> That doesn't seem like a great argument. >> >> Why should we break the ABI for bad code that used that sysctl and all= >> following? It seems pretty trivial to preserve, and no-cost. Also, t= he >> fact that it's in current misses the point completely: it breaks ABI w= ith >> older binaries, namely older binaries running on -CURRENT. And not ju= st >> for that field. >=20 > Especially since the main reason numbered sysctls exist is to support o= ld > binaries (and sources) that use them. >=20 Does it look OK? diff --git a/sys/vm/vm_param.h b/sys/vm/vm_param.h index 44306be..0323473 100644 --- a/sys/vm/vm_param.h +++ b/sys/vm/vm_param.h @@ -82,8 +82,9 @@ #define VM_V_CACHE_MIN 7 /* cnt.v_cache_min */ #define VM_V_CACHE_MAX 8 /* cnt.v_cache_max */ #define VM_V_PAGEOUT_FREE_MIN 9 /* cnt.v_pageout_free_min */ -#define VM_SWAPPING_ENABLED 10 /* swapping enabled */ -#define VM_MAXID 11 /* number of valid vm ids= */ +/*#define VM_PAGEOUT_ALGORITHM 10 pageout algorithm */ +#define VM_SWAPPING_ENABLED 11 /* swapping enabled */ +#define VM_MAXID 12 /* number of valid vm ids= */ #define CTL_VM_NAMES { \ { 0, 0 }, \ @@ -96,6 +97,7 @@ { "v_cache_min", CTLTYPE_UINT }, \ { "v_cache_max", CTLTYPE_UINT }, \ { "v_pageout_free_min", CTLTYPE_UINT}, \ + { "obsolete_pageout_algorithm", CTLTYPE_INT}, \ { "swap_enabled", CTLTYPE_INT},\ } --=20 Andrey Zonov ------enig2BWDOWUBELCWUQNFBHHBD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJR9DH7AAoJEBWLemxX/CvTTl4H/Rbjk4vlXRxR2t/+z1Kcx4vS 5DpoM6DRfC3jZi3qfo2TxT600+5Ekyabhgpe6Gp3VM4TZVo0trC7lphPZ+I/0cv4 FWy9ElytnJIJYIlZcTOYXTLbD92itdkFKF2AqZL8Rttrt048CFy0XKYuHA9EIKSz Tj1B+5EfG+6ymdmC4JcPqfTAZxuO20jOIUcTx/WCgne7l21bbloC+/AJ+kyAPfQF HJAYktT134bpnP6lxigk67vTBALTskv08ucPXpKdVnxUpFy79riauweKKmNxibA2 TqczSDSULkSqC1ytTKCAWwhl5ZP9UsCO++RqSDag/rw8WpZPiOEm+h5Ykt9QNYE= =Cdzu -----END PGP SIGNATURE----- ------enig2BWDOWUBELCWUQNFBHHBD-- From owner-svn-src-head@FreeBSD.ORG Sat Jul 27 21:23:13 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 504D5F9B; Sat, 27 Jul 2013 21:23:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id BC5D425BC; Sat, 27 Jul 2013 21:23:12 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id D99963C3137; Sun, 28 Jul 2013 07:22:57 +1000 (EST) Date: Sun, 28 Jul 2013 07:22:56 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Zonov Subject: Re: svn commit: r253662 - in head: lib/libc/gen sys/vm tools/tools/sysdoc In-Reply-To: <51F431F8.1040803@FreeBSD.org> Message-ID: <20130728071405.R3136@besplex.bde.org> References: <201307260200.r6Q207cB015223@svn.freebsd.org> <20130726150949.GC14175@stack.nl> <51F2E970.3070303@FreeBSD.org> <20130727170845.E872@besplex.bde.org> <51F431F8.1040803@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=Yos2GeoX c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=NRP33-gIz6cA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=csUvqbbglXYA:10 a=0fzaMso3ov0qgOl2MZsA:9 a=0CfFHigASY0qdis4:21 a=4W80fvmnR7tQkGyv:21 a=CjuIK1q_8ugA:10 Cc: src-committers@FreeBSD.org, Jilles Tjoelker , Juli Mallett , svn-src-all@FreeBSD.org, Bruce Evans , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 21:23:13 -0000 On Sat, 27 Jul 2013, Andrey Zonov wrote: > On 7/27/13 12:47 AM, Bruce Evans wrote: >> ... >> Especially since the main reason numbered sysctls exist is to support old >> binaries (and sources) that use them. > > Does it look OK? It looks functionally OK, but ugly. > diff --git a/sys/vm/vm_param.h b/sys/vm/vm_param.h > index 44306be..0323473 100644 > --- a/sys/vm/vm_param.h > +++ b/sys/vm/vm_param.h > @@ -82,8 +82,9 @@ > #define VM_V_CACHE_MIN 7 /* cnt.v_cache_min */ > #define VM_V_CACHE_MAX 8 /* cnt.v_cache_max */ > #define VM_V_PAGEOUT_FREE_MIN 9 /* cnt.v_pageout_free_min */ > -#define VM_SWAPPING_ENABLED 10 /* swapping enabled */ > -#define VM_MAXID 11 /* number of valid vm ids */ > +/*#define VM_PAGEOUT_ALGORITHM 10 pageout algorithm */ Commenting out things like this is ugly. Code should be commented out using #if 0, but here I think I prefere changing the #defined name to something like VM_OBS_10. VM_OBS_PAGEOUT_ALGORITGHM would be too long. > +#define VM_SWAPPING_ENABLED 11 /* swapping enabled */ > +#define VM_MAXID 12 /* number of valid vm ids */ > > #define CTL_VM_NAMES { \ > { 0, 0 }, \ > @@ -96,6 +97,7 @@ > { "v_cache_min", CTLTYPE_UINT }, \ > { "v_cache_max", CTLTYPE_UINT }, \ > { "v_pageout_free_min", CTLTYPE_UINT}, \ > + { "obsolete_pageout_algorithm", CTLTYPE_INT}, \ > { "swap_enabled", CTLTYPE_INT},\ > } Bruce From owner-svn-src-head@FreeBSD.ORG Sat Jul 27 21:31:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7C49423A; Sat, 27 Jul 2013 21:31:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 59E882603; Sat, 27 Jul 2013 21:31:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6RLVota037816; Sat, 27 Jul 2013 21:31:50 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6RLVm1N037809; Sat, 27 Jul 2013 21:31:48 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201307272131.r6RLVm1N037809@svn.freebsd.org> From: Mark Johnston Date: Sat, 27 Jul 2013 21:31:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253720 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 21:31:50 -0000 Author: markj Date: Sat Jul 27 21:31:48 2013 New Revision: 253720 URL: http://svnweb.freebsd.org/changeset/base/253720 Log: Use kern_ioctl() rather than ioctl() for testing the FBT provider, since the latter doesn't exist in FreeBSD. All the tests under fbtprovider pass now. Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d Sat Jul 27 20:47:01 2013 (r253719) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d Sat Jul 27 21:31:48 2013 (r253720) @@ -36,12 +36,12 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the ioctl function\n"); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("Returning from ioctl function\n"); exit(0); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d Sat Jul 27 20:47:01 2013 (r253719) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d Sat Jul 27 21:31:48 2013 (r253720) @@ -36,7 +36,7 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:return +fbt::kern_ioctl:return { printf("The function return value is stored in %u\n", arg1); exit(0); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d Sat Jul 27 20:47:01 2013 (r253719) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d Sat Jul 27 21:31:48 2013 (r253720) @@ -36,13 +36,13 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("Returning from ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d Sat Jul 27 20:47:01 2013 (r253719) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d Sat Jul 27 21:31:48 2013 (r253720) @@ -41,12 +41,12 @@ BEGIN self->traceme = 1; } -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the function\n"); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("The offset = %u\n", arg0); exit(0); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d Sat Jul 27 20:47:01 2013 (r253719) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d Sat Jul 27 21:31:48 2013 (r253720) @@ -36,14 +36,14 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); exit(0); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("Returning from ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d Sat Jul 27 20:47:01 2013 (r253719) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d Sat Jul 27 21:31:48 2013 (r253720) @@ -36,7 +36,7 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:return +fbt::kern_ioctl:return /arg1 == 0/ { printf("%s %x returned 0", probefunc, arg0); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d Sat Jul 27 20:47:01 2013 (r253719) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d Sat Jul 27 21:31:48 2013 (r253720) @@ -36,7 +36,7 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { self->traceme = 1; } @@ -47,7 +47,7 @@ fbt:::entry printf("called %s\n", probefunc); } -fbt::ioctl:return +fbt::kern_ioctl:return /self->traceme/ { self->traceme = 0; From owner-svn-src-head@FreeBSD.ORG Sat Jul 27 22:19:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C1A5BB1F; Sat, 27 Jul 2013 22:19:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ADAC22796; Sat, 27 Jul 2013 22:19:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6RMJYh9050821; Sat, 27 Jul 2013 22:19:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6RMJYv2050820; Sat, 27 Jul 2013 22:19:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201307272219.r6RMJYv2050820@svn.freebsd.org> From: Alexander Motin Date: Sat, 27 Jul 2013 22:19:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253721 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 22:19:34 -0000 Author: mav Date: Sat Jul 27 22:19:34 2013 New Revision: 253721 URL: http://svnweb.freebsd.org/changeset/base/253721 Log: Detect unsupported PREVENT ALLOW MEDIUM REMOVAL and SYNCHRONIZE CACHE(10) to not spam devices with useless commands and logs with errors. Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Sat Jul 27 21:31:48 2013 (r253720) +++ head/sys/cam/scsi/scsi_da.c Sat Jul 27 22:19:34 2013 (r253721) @@ -535,6 +535,7 @@ static struct da_quirk_entry da_quirk_ta {T_DIRECT, SIP_MEDIA_REMOVABLE, "TOSHIBA", "TransMemory", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE }, +#if 0 { /* * PNY USB Flash keys @@ -543,6 +544,7 @@ static struct da_quirk_entry da_quirk_ta {T_DIRECT, SIP_MEDIA_REMOVABLE, "*" , "USB DISK*", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE }, +#endif { /* * Genesys 6-in-1 Card Reader @@ -2786,6 +2788,28 @@ cmd6workaround(union ccb *ccb) return (0); } + /* Detect unsupported PREVENT ALLOW MEDIUM REMOVAL. */ + if ((ccb->ccb_h.flags & CAM_CDB_POINTER) == 0 && + (*cdb == PREVENT_ALLOW) && + (softc->quirks & DA_Q_NO_PREVENT) == 0) { + if (bootverbose) + xpt_print(ccb->ccb_h.path, + "PREVENT ALLOW MEDIUM REMOVAL not supported.\n"); + softc->quirks |= DA_Q_NO_PREVENT; + return (0); + } + + /* Detect unsupported SYNCHRONIZE CACHE(10). */ + if ((ccb->ccb_h.flags & CAM_CDB_POINTER) == 0 && + (*cdb == SYNCHRONIZE_CACHE) && + (softc->quirks & DA_Q_NO_SYNC_CACHE) == 0) { + if (bootverbose) + xpt_print(ccb->ccb_h.path, + "SYNCHRONIZE CACHE(10) not supported.\n"); + softc->quirks |= DA_Q_NO_SYNC_CACHE; + return (0); + } + /* Translation only possible if CDB is an array and cmd is R/W6 */ if ((ccb->ccb_h.flags & CAM_CDB_POINTER) != 0 || (*cdb != READ_6 && *cdb != WRITE_6)) From owner-svn-src-head@FreeBSD.ORG Sat Jul 27 22:21:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B5D65CB9; Sat, 27 Jul 2013 22:21:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A3FAD27B1; Sat, 27 Jul 2013 22:21:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6RMLAZX052780; Sat, 27 Jul 2013 22:21:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6RMLAxp052779; Sat, 27 Jul 2013 22:21:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201307272221.r6RMLAxp052779@svn.freebsd.org> From: Alexander Motin Date: Sat, 27 Jul 2013 22:21:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253722 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 22:21:10 -0000 Author: mav Date: Sat Jul 27 22:21:10 2013 New Revision: 253722 URL: http://svnweb.freebsd.org/changeset/base/253722 Log: Oops, revert unwanted part of r253721. Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Sat Jul 27 22:19:34 2013 (r253721) +++ head/sys/cam/scsi/scsi_da.c Sat Jul 27 22:21:10 2013 (r253722) @@ -535,7 +535,6 @@ static struct da_quirk_entry da_quirk_ta {T_DIRECT, SIP_MEDIA_REMOVABLE, "TOSHIBA", "TransMemory", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE }, -#if 0 { /* * PNY USB Flash keys @@ -544,7 +543,6 @@ static struct da_quirk_entry da_quirk_ta {T_DIRECT, SIP_MEDIA_REMOVABLE, "*" , "USB DISK*", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE }, -#endif { /* * Genesys 6-in-1 Card Reader From owner-svn-src-head@FreeBSD.ORG Sat Jul 27 22:23:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6E683E02; Sat, 27 Jul 2013 22:23:33 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3FBF827BB; Sat, 27 Jul 2013 22:23:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6RMNXi4053106; Sat, 27 Jul 2013 22:23:33 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6RMNXBL053105; Sat, 27 Jul 2013 22:23:33 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201307272223.r6RMNXBL053105@svn.freebsd.org> From: Alfred Perlstein Date: Sat, 27 Jul 2013 22:23:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253723 - head/usr.sbin/watchdogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 22:23:33 -0000 Author: alfred Date: Sat Jul 27 22:23:32 2013 New Revision: 253723 URL: http://svnweb.freebsd.org/changeset/base/253723 Log: Provide some examples for watchdogd usage. Modified: head/usr.sbin/watchdogd/watchdogd.8 Modified: head/usr.sbin/watchdogd/watchdogd.8 ============================================================================== --- head/usr.sbin/watchdogd/watchdogd.8 Sat Jul 27 22:21:10 2013 (r253722) +++ head/usr.sbin/watchdogd/watchdogd.8 Sat Jul 27 22:23:32 2013 (r253723) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 5, 2013 +.Dd July 27, 2013 .Dt WATCHDOGD 8 .Os .Sh NAME @@ -204,6 +204,81 @@ and the kernel .Xr log 4 device for .Xr syslog 8 . +.Sh EXAMPLES +.Ss Debugging watchdogd and/or your watchdog script. +.Pp +This is a useful recipe for debugging watchdogd and your watchdog +script. +.Pp +(Note that ^C works oddly because watchdogd calls system(3) so the +first ^C will terminate the "sleep" command.) +.Pp +.Pp +Explanation of options used: +.Bl -enum -offset indent -compact +.It +Set Debug on (--debug) +.It +Set the watchdog to trip at 30 seconds. (-t 30) +.It +Use of a softtimeout: +.Bl -enum -offset indent -compact -nested +.It +Use a softtimeout (don't arm the hardware watchdog) (--softtimeout) +.It +Set the softtimeout action to do both kernel printf(9) and log(9) when it trips. (--softtimeout-action log,printf) +.El +.It +Use of a pre-timeout: +.Bl -enum -offset indent -compact -nested +.It +Set a pre-timeout of 15 seconds (this will later trigger a panic/dump) (--pretimeout 15) +.It +Set the action to also kernel printf(9) and log(9) when it trips. (--pretimeout-action log,printf) +.El +.It +Use of a script: +.Bl -enum -offset indent -compact -nested +.It +Run "sleep 60" as a shell command that acts as the watchdog (-e 'sleep 60') +.It +Warn us when the script takes longer than 1 second to run (-w) +.El +.El +.Bd -literal +watchdogd --debug -t 30 \\ + --softtimeout --softtimeout-action log,printf \\ + --pretimeout 15 --pretimeout-action log,printf \\ + -e 'sleep 60' -w +.Ed +.Ss Production use of example +.Bl -enum -offset indent -compact +.It +Set hard timeout to 120 seconds (-t 120) +.It +Set a panic to happen at 60 seconds (to trigger a +.Xr crash 8 +for dump analysis): +.Bl -enum -offset indent -compact -nested +.It +Use of pre-timeout (--pretimeout 60) +.It +Specify pre-timeout action (--pretimeout-action log,printf,panic ) +.El +.It +Use of a script: +.Bl -enum -offset indent -compact -nested +.It +Run your script (-e '/path/to/your/script 60') +.It +Log if your script takes a longer than 15 seconds to run time. (-w -T 15) +.El +.El +.Bd -literal +watchdogd -t 120 \\ + --pretimeout 60 --pretimeout-action log,printf,panic \\ + -e '/path/to/your/script 60' -w -T 15 +.Ed .Sh FILES .Bl -tag -width ".Pa /var/run/watchdogd.pid" -compact .It Pa /var/run/watchdogd.pid From owner-svn-src-head@FreeBSD.ORG Sat Jul 27 22:44:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B10D8CC; Sat, 27 Jul 2013 22:44:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E7792819; Sat, 27 Jul 2013 22:44:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6RMiuOd059016; Sat, 27 Jul 2013 22:44:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6RMiuGV059014; Sat, 27 Jul 2013 22:44:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201307272244.r6RMiuGV059014@svn.freebsd.org> From: Alexander Motin Date: Sat, 27 Jul 2013 22:44:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253724 - in head/sys/cam: ata scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 22:44:56 -0000 Author: mav Date: Sat Jul 27 22:44:55 2013 New Revision: 253724 URL: http://svnweb.freebsd.org/changeset/base/253724 Log: Synchronize device cache on close only if there were some write operations. While these operations are not really needed otherwise, at least for SCSI they may cause extra errors if some other initiator holds write exclusive reservation on the LUN (SYNCHRONIZE CACHE handled as "write" operation). Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sat Jul 27 22:23:32 2013 (r253723) +++ head/sys/cam/ata/ata_da.c Sat Jul 27 22:44:55 2013 (r253724) @@ -86,7 +86,8 @@ typedef enum { ADA_FLAG_SCTX_INIT = 0x0200, ADA_FLAG_CAN_CFA = 0x0400, ADA_FLAG_CAN_POWERMGT = 0x0800, - ADA_FLAG_CAN_DMA48 = 0x1000 + ADA_FLAG_CAN_DMA48 = 0x1000, + ADA_FLAG_DIRTY = 0x2000 } ada_flags; typedef enum { @@ -602,6 +603,7 @@ adaclose(struct disk *dp) struct cam_periph *periph; struct ada_softc *softc; union ccb *ccb; + int error; periph = (struct cam_periph *)dp->d_drv1; cam_periph_lock(periph); @@ -617,7 +619,8 @@ adaclose(struct disk *dp) ("adaclose\n")); /* We only sync the cache if the drive is capable of it. */ - if ((softc->flags & ADA_FLAG_CAN_FLUSHCACHE) != 0 && + if ((softc->flags & ADA_FLAG_DIRTY) != 0 && + (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) != 0 && (periph->flags & CAM_PERIPH_INVALID) == 0) { ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); @@ -634,11 +637,13 @@ adaclose(struct disk *dp) ata_48bit_cmd(&ccb->ataio, ATA_FLUSHCACHE48, 0, 0, 0); else ata_28bit_cmd(&ccb->ataio, ATA_FLUSHCACHE, 0, 0, 0); - cam_periph_runccb(ccb, adaerror, /*cam_flags*/0, + error = cam_periph_runccb(ccb, adaerror, /*cam_flags*/0, /*sense_flags*/0, softc->disk->d_devstat); - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) + if (error != 0) xpt_print(periph->path, "Synchronize cache failed\n"); + else + softc->flags &= ~ADA_FLAG_DIRTY; xpt_release_ccb(ccb); } @@ -1479,8 +1484,10 @@ adastart(struct cam_periph *periph, unio tag_code = 1; } switch (bp->bio_cmd) { - case BIO_READ: case BIO_WRITE: + softc->flags |= ADA_FLAG_DIRTY; + /* FALLTHROUGH */ + case BIO_READ: { uint64_t lba = bp->bio_pblkno; uint16_t count = bp->bio_bcount / softc->params.secsize; Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Sat Jul 27 22:23:32 2013 (r253723) +++ head/sys/cam/scsi/scsi_da.c Sat Jul 27 22:44:55 2013 (r253724) @@ -89,7 +89,8 @@ typedef enum { DA_FLAG_OPEN = 0x100, DA_FLAG_SCTX_INIT = 0x200, DA_FLAG_CAN_RC16 = 0x400, - DA_FLAG_PROBED = 0x800 + DA_FLAG_PROBED = 0x800, + DA_FLAG_DIRTY = 0x1000 } da_flags; typedef enum { @@ -1237,6 +1238,7 @@ daclose(struct disk *dp) { struct cam_periph *periph; struct da_softc *softc; + int error; periph = (struct cam_periph *)dp->d_drv1; cam_periph_lock(periph); @@ -1251,8 +1253,9 @@ daclose(struct disk *dp) CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, ("daclose\n")); - if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0 - && (softc->flags & DA_FLAG_PACK_INVALID) == 0) { + if ((softc->flags & DA_FLAG_DIRTY) != 0 && + (softc->quirks & DA_Q_NO_SYNC_CACHE) == 0 && + (softc->flags & DA_FLAG_PACK_INVALID) == 0) { union ccb *ccb; ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); @@ -1266,9 +1269,11 @@ daclose(struct disk *dp) SSD_FULL_SIZE, 5 * 60 * 1000); - cam_periph_runccb(ccb, daerror, /*cam_flags*/0, + error = cam_periph_runccb(ccb, daerror, /*cam_flags*/0, /*sense_flags*/SF_RETRY_UA | SF_QUIET_IR, softc->disk->d_devstat); + if (error == 0) + softc->flags &= ~DA_FLAG_DIRTY; xpt_release_ccb(ccb); } @@ -2240,8 +2245,10 @@ skipstate: } switch (bp->bio_cmd) { - case BIO_READ: case BIO_WRITE: + softc->flags |= DA_FLAG_DIRTY; + /* FALLTHROUGH */ + case BIO_READ: scsi_read_write(&start_ccb->csio, /*retries*/da_retry_count, /*cbfcnp*/dadone,