From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 00:54:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4813F1065673; Sun, 3 Jun 2012 00:54:11 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30D308FC0C; Sun, 3 Jun 2012 00:54:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q530sBG2024155; Sun, 3 Jun 2012 00:54:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q530sBDP024152; Sun, 3 Jun 2012 00:54:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206030054.q530sBDP024152@svn.freebsd.org> From: Marius Strobl Date: Sun, 3 Jun 2012 00:54:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236495 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 00:54:11 -0000 Author: marius Date: Sun Jun 3 00:54:10 2012 New Revision: 236495 URL: http://svn.freebsd.org/changeset/base/236495 Log: - Prepend the device description with "AT91" to reflect its nature. [1] - Move DMA tag and map creature to at91_spi_activate() where the other resource allocation also lives. [1] - Flesh out at91_spi_deactivate(). [1] - Work around the "Software Reset must be Written Twice" erratum. - For now, run the bus at the slowest speed possible in order to work around data corruption on transit even seen with 9 MHz on ETHERNUT5 (15 MHz maximum) and AT45DB321D (20 MHz maximum). This also serves as a poor man's work-around for the "NPCSx rises if no data data is to be transmitted" erratum of RM9200. Being able to use the appropriate bus speed would require: 1) Adding a proper work-around for the RM9200 bug consisting of taking the chip select control away from the SPI peripheral and managing it directly as a GPIO line. 2) Taking the maximum frequencies supported by the actual board and the slave devices into account and basing the whole thing on the master clock instead of hardcoding a divisor as previously done. 3) Fixing the above mentioned data corruption. - KASSERT that TX/RX command and data sizes match on transfers. - Introduce a mutex ensuring that only one child device is running a SPI transfer at a time. [1] - Add preliminary, #ifdef'ed out support for setting the chip select. [1] - Use the RX instead of the TX commando size when setting up the RX side of a transfer. - For controllers having SPI_SR_TXEMPTY, i.e. !RM9200, also wait for the completion of the TX part of transfers before stopping the whole thing again. - Use DEVMETHOD_END. [1] - Use NULL instead of 0 for pointers. [1, partially] Additional testing by: Ian Lepore Submitted by: Ian Lepore [1] MFC after: 1 week Modified: head/sys/arm/at91/at91_spi.c head/sys/arm/at91/at91_spireg.h Modified: head/sys/arm/at91/at91_spi.c ============================================================================== --- head/sys/arm/at91/at91_spi.c Sat Jun 2 22:14:10 2012 (r236494) +++ head/sys/arm/at91/at91_spi.c Sun Jun 3 00:54:10 2012 (r236495) @@ -1,5 +1,7 @@ /*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. + * Copyright (c) 2006 M. Warner Losh. + * Copyright (c) 2011-2012 Ian Lepore. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,17 +33,21 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include -#include #include +#include + #include #include #include +#include #include + #include "spibus_if.h" struct at91_spi_softc @@ -50,29 +56,39 @@ struct at91_spi_softc void *intrhand; /* Interrupt handle */ struct resource *irq_res; /* IRQ resource */ struct resource *mem_res; /* Memory resource */ - bus_dma_tag_t dmatag; /* bus dma tag for mbufs */ + bus_dma_tag_t dmatag; /* bus dma tag for transfers */ bus_dmamap_t map[4]; /* Maps for the transaction */ - int rxdone; + struct sx xfer_mtx; /* Enforce one transfer at a time */ + uint32_t xfer_mask; /* Bits to wait on for completion */ + uint32_t xfer_done; /* interrupt<->mainthread signaling */ }; +#define CS_TO_MR(cs) ((~(1 << (cs)) & 0x0f) << 16) + static inline uint32_t RD4(struct at91_spi_softc *sc, bus_size_t off) { - return bus_read_4(sc->mem_res, off); + + return (bus_read_4(sc->mem_res, off)); } static inline void WR4(struct at91_spi_softc *sc, bus_size_t off, uint32_t val) { + bus_write_4(sc->mem_res, off, val); } /* bus entry points */ -static int at91_spi_probe(device_t dev); static int at91_spi_attach(device_t dev); static int at91_spi_detach(device_t dev); +static int at91_spi_probe(device_t dev); +static int at91_spi_transfer(device_t dev, device_t child, + struct spi_command *cmd); /* helper routines */ +static void at91_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, + int error); static int at91_spi_activate(device_t dev); static void at91_spi_deactivate(device_t dev); static void at91_spi_intr(void *arg); @@ -80,43 +96,64 @@ static void at91_spi_intr(void *arg); static int at91_spi_probe(device_t dev) { - device_set_desc(dev, "SPI"); + + device_set_desc(dev, "AT91 SPI"); return (0); } static int at91_spi_attach(device_t dev) { - struct at91_spi_softc *sc = device_get_softc(dev); - int err, i; + struct at91_spi_softc *sc; + int err; + uint32_t csr; + + sc = device_get_softc(dev); sc->dev = dev; + sx_init(&sc->xfer_mtx, device_get_nameunit(dev)); + + /* + * Allocate resources. + */ err = at91_spi_activate(dev); if (err) goto out; /* - * Allocate DMA tags and maps + * Set up the hardware. */ - err = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, 2058, 1, - 2048, BUS_DMA_ALLOCNOW, NULL, NULL, &sc->dmatag); - if (err != 0) - goto out; - for (i = 0; i < 4; i++) { - err = bus_dmamap_create(sc->dmatag, 0, &sc->map[i]); - if (err != 0) - goto out; - } - // reset the SPI + sc->xfer_mask = SPI_SR_RXBUFF | (at91_is_rm92() ? 0 : SPI_SR_TXEMPTY); + WR4(sc, SPI_CR, SPI_CR_SWRST); + /* "Software Reset must be Written Twice" erratum */ WR4(sc, SPI_CR, SPI_CR_SWRST); WR4(sc, SPI_IDR, 0xffffffff); WR4(sc, SPI_MR, (0xf << 24) | SPI_MR_MSTR | SPI_MR_MODFDIS | - (0xE << 16)); + CS_TO_MR(0)); + + /* + * For now, run the bus at the slowest speed possible as otherwise we + * may encounter data corruption on transmit as seen with ETHERNUT5 + * and AT45DB321D even though both board and slave device can take + * more. + * This also serves as a work-around for the "NPCSx rises if no data + * data is to be transmitted" erratum. The ideal workaround for the + * latter is to take the chip select control away from the peripheral + * and manage it directly as a GPIO line. The easy solution is to + * slow down the bus so dramatically that it just never gets starved + * as may be seen when the OCHI controller is running and consuming + * memory and APB bandwidth. + * Also, currently we lack a way for lettting both the board and the + * slave devices take their maximum supported SPI clocks into account. + */ + csr = SPI_CSR_CPOL | (4 << 16) | (0xff << 8); + WR4(sc, SPI_CSR0, csr); + WR4(sc, SPI_CSR1, csr); + WR4(sc, SPI_CSR2, csr); + WR4(sc, SPI_CSR3, csr); - WR4(sc, SPI_CSR0, SPI_CSR_CPOL | (4 << 16) | (2 << 8)); WR4(sc, SPI_CR, SPI_CR_SPIEN); WR4(sc, PDC_PTCR, PDC_PTCR_TXTDIS); @@ -143,6 +180,7 @@ out: static int at91_spi_detach(device_t dev) { + return (EBUSY); /* XXX */ } @@ -150,26 +188,41 @@ static int at91_spi_activate(device_t dev) { struct at91_spi_softc *sc; - int rid, err = ENOMEM; + int err, i, rid; sc = device_get_softc(dev); + err = ENOMEM; + rid = 0; sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->mem_res == NULL) - goto errout; + goto out; + rid = 0; sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->irq_res == NULL) - goto errout; + goto out; err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, at91_spi_intr, sc, &sc->intrhand); if (err != 0) - goto errout; - return (0); -errout: - at91_spi_deactivate(dev); + goto out; + + err = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, 2048, 1, + 2048, BUS_DMA_ALLOCNOW, NULL, NULL, &sc->dmatag); + if (err != 0) + goto out; + + for (i = 0; i < 4; i++) { + err = bus_dmamap_create(sc->dmatag, 0, &sc->map[i]); + if (err != 0) + goto out; + } +out: + if (err != 0) + at91_spi_deactivate(dev); return (err); } @@ -177,26 +230,37 @@ static void at91_spi_deactivate(device_t dev) { struct at91_spi_softc *sc; + int i; sc = device_get_softc(dev); + bus_generic_detach(dev); + + for (i = 0; i < 4; i++) + if (sc->map[i]) + bus_dmamap_destroy(sc->dmatag, sc->map[i]); + + if (sc->dmatag) + bus_dma_tag_destroy(sc->dmatag); + if (sc->intrhand) bus_teardown_intr(dev, sc->irq_res, sc->intrhand); - sc->intrhand = 0; - bus_generic_detach(sc->dev); - if (sc->mem_res) - bus_release_resource(dev, SYS_RES_IOPORT, - rman_get_rid(sc->mem_res), sc->mem_res); - sc->mem_res = 0; + sc->intrhand = NULL; if (sc->irq_res) bus_release_resource(dev, SYS_RES_IRQ, rman_get_rid(sc->irq_res), sc->irq_res); - sc->irq_res = 0; - return; + sc->irq_res = NULL; + + if (sc->mem_res) + bus_release_resource(dev, SYS_RES_MEMORY, + rman_get_rid(sc->mem_res), sc->mem_res); + sc->mem_res = NULL; } static void -at91_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +at91_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs __unused, + int error) { + if (error != 0) return; *(bus_addr_t *)arg = segs[0].ds_addr; @@ -206,80 +270,133 @@ static int at91_spi_transfer(device_t dev, device_t child, struct spi_command *cmd) { struct at91_spi_softc *sc; - int i, j, rxdone, err, mode[4]; bus_addr_t addr; + int err, i, j, mode[4]; + uint32_t mask; + + KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz, + ("%s: TX/RX command sizes should be equal", __func__)); + KASSERT(cmd->tx_data_sz == cmd->rx_data_sz, + ("%s: TX/RX data sizes should be equal", __func__)); sc = device_get_softc(dev); - WR4(sc, PDC_PTCR, PDC_PTCR_TXTDIS | PDC_PTCR_RXTDIS); i = 0; - if (bus_dmamap_load(sc->dmatag, sc->map[i], cmd->tx_cmd, - cmd->tx_cmd_sz, at91_getaddr, &addr, 0) != 0) + + sx_xlock(&sc->xfer_mtx); + + /* + * Disable transfers while we set things up. + */ + WR4(sc, PDC_PTCR, PDC_PTCR_TXTDIS | PDC_PTCR_RXTDIS); + +#ifdef SPI_CHIPSEL_SUPPORT + if (cmd->cs < 0 || cmd->cs > 3) { + device_printf(dev, + "Invalid chip select %d requested by %s\n", cmd->cs, + device_get_nameunit(child)); + err = EINVAL; + goto out; + } +#ifdef SPI_CHIP_SELECT_HIGH_SUPPORT + if (at91_is_rm92() && cmd->cs == 0 && + (cmd->flags & SPI_CHIP_SELECT_HIGH) != 0) { + device_printf(dev, + "Invalid chip select high requested by %s\n", + device_get_nameunit(child)); + err = EINVAL; + goto out; + } +#endif + WR4(sc, SPI_MR, (RD4(sc, SPI_MR) & ~0x000f0000) | CS_TO_MR(cmd->cs)); +#endif + + /* + * Set up the TX side of the transfer. + */ + if ((err = bus_dmamap_load(sc->dmatag, sc->map[i], cmd->tx_cmd, + cmd->tx_cmd_sz, at91_getaddr, &addr, 0)) != 0) goto out; WR4(sc, PDC_TPR, addr); WR4(sc, PDC_TCR, cmd->tx_cmd_sz); bus_dmamap_sync(sc->dmatag, sc->map[i], BUS_DMASYNC_PREWRITE); mode[i++] = BUS_DMASYNC_POSTWRITE; if (cmd->tx_data_sz > 0) { - if (bus_dmamap_load(sc->dmatag, sc->map[i], cmd->tx_data, - cmd->tx_data_sz, at91_getaddr, &addr, 0) != 0) + if ((err = bus_dmamap_load(sc->dmatag, sc->map[i], + cmd->tx_data, cmd->tx_data_sz, at91_getaddr, &addr, 0)) != + 0) goto out; WR4(sc, PDC_TNPR, addr); WR4(sc, PDC_TNCR, cmd->tx_data_sz); bus_dmamap_sync(sc->dmatag, sc->map[i], BUS_DMASYNC_PREWRITE); mode[i++] = BUS_DMASYNC_POSTWRITE; } - if (bus_dmamap_load(sc->dmatag, sc->map[i], cmd->rx_cmd, - cmd->tx_cmd_sz, at91_getaddr, &addr, 0) != 0) + + /* + * Set up the RX side of the transfer. + */ + if ((err = bus_dmamap_load(sc->dmatag, sc->map[i], cmd->rx_cmd, + cmd->rx_cmd_sz, at91_getaddr, &addr, 0)) != 0) goto out; WR4(sc, PDC_RPR, addr); - WR4(sc, PDC_RCR, cmd->tx_cmd_sz); + WR4(sc, PDC_RCR, cmd->rx_cmd_sz); bus_dmamap_sync(sc->dmatag, sc->map[i], BUS_DMASYNC_PREREAD); mode[i++] = BUS_DMASYNC_POSTREAD; if (cmd->rx_data_sz > 0) { - if (bus_dmamap_load(sc->dmatag, sc->map[i], cmd->rx_data, - cmd->tx_data_sz, at91_getaddr, &addr, 0) != 0) + if ((err = bus_dmamap_load(sc->dmatag, sc->map[i], + cmd->rx_data, cmd->rx_data_sz, at91_getaddr, &addr, 0)) != + 0) goto out; WR4(sc, PDC_RNPR, addr); WR4(sc, PDC_RNCR, cmd->rx_data_sz); bus_dmamap_sync(sc->dmatag, sc->map[i], BUS_DMASYNC_PREREAD); mode[i++] = BUS_DMASYNC_POSTREAD; } - WR4(sc, SPI_IER, SPI_SR_ENDRX); + + /* + * Start the transfer, wait for it to complete. + */ + sc->xfer_done = 0; + mask = sc->xfer_mask; + WR4(sc, SPI_IER, mask); WR4(sc, PDC_PTCR, PDC_PTCR_TXTEN | PDC_PTCR_RXTEN); + do + err = tsleep(&sc->xfer_done, PCATCH | PZERO, "at91_spi", hz); + while (sc->xfer_done != mask && err != EINTR); - rxdone = sc->rxdone; - do { - err = tsleep(&sc->rxdone, PCATCH | PZERO, "spi", hz); - } while (rxdone == sc->rxdone && err != EINTR); + /* + * Stop the transfer and clean things up. + */ WR4(sc, PDC_PTCR, PDC_PTCR_TXTDIS | PDC_PTCR_RXTDIS); - if (err == 0) { - for (j = 0; j < i; j++) + if (err == 0) + for (j = 0; j < i; j++) bus_dmamap_sync(sc->dmatag, sc->map[j], mode[j]); - } - for (j = 0; j < i; j++) - bus_dmamap_unload(sc->dmatag, sc->map[j]); - return (err); out: for (j = 0; j < i; j++) bus_dmamap_unload(sc->dmatag, sc->map[j]); - return (EIO); + + sx_xunlock(&sc->xfer_mtx); + + return (err); } static void at91_spi_intr(void *arg) { - struct at91_spi_softc *sc = (struct at91_spi_softc*)arg; - uint32_t sr; + struct at91_spi_softc *sc; + uint32_t mask, sr; + sc = (struct at91_spi_softc*)arg; + + mask = sc->xfer_mask; sr = RD4(sc, SPI_SR) & RD4(sc, SPI_IMR); - if (sr & SPI_SR_ENDRX) { - sc->rxdone++; - WR4(sc, SPI_IDR, SPI_SR_ENDRX); - wakeup(&sc->rxdone); + if ((sr & mask) != 0) { + sc->xfer_done |= sr & mask; + WR4(sc, SPI_IDR, mask); + wakeup(&sc->xfer_done); } - if (sr & ~SPI_SR_ENDRX) { + if ((sr & ~mask) != 0) { device_printf(sc->dev, "Unexpected ISR %#x\n", sr); - WR4(sc, SPI_IDR, sr & ~SPI_SR_ENDRX); + WR4(sc, SPI_IDR, sr & ~mask); } } @@ -293,7 +410,8 @@ static device_method_t at91_spi_methods[ /* spibus interface */ DEVMETHOD(spibus_transfer, at91_spi_transfer), - { 0, 0 } + + DEVMETHOD_END }; static driver_t at91_spi_driver = { @@ -302,4 +420,5 @@ static driver_t at91_spi_driver = { sizeof(struct at91_spi_softc), }; -DRIVER_MODULE(at91_spi, atmelarm, at91_spi_driver, at91_spi_devclass, 0, 0); +DRIVER_MODULE(at91_spi, atmelarm, at91_spi_driver, at91_spi_devclass, NULL, + NULL); Modified: head/sys/arm/at91/at91_spireg.h ============================================================================== --- head/sys/arm/at91/at91_spireg.h Sat Jun 2 22:14:10 2012 (r236494) +++ head/sys/arm/at91/at91_spireg.h Sun Jun 3 00:54:10 2012 (r236495) @@ -54,6 +54,8 @@ #define SPI_SR_ENDTX 0x00020 #define SPI_SR_RXBUFF 0x00040 #define SPI_SR_TXBUFE 0x00080 +#define SPI_SR_NSSR 0x00100 +#define SPI_SR_TXEMPTY 0x00200 #define SPI_SR_SPIENS 0x10000 #define SPI_IER 0x14 /* IER: Interrupt Enable Regsiter */ #define SPI_IDR 0x18 /* IDR: Interrupt Disable Regsiter */ From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 01:00:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8F85A106564A; Sun, 3 Jun 2012 01:00:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 790C78FC15; Sun, 3 Jun 2012 01:00:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5310tRL024495; Sun, 3 Jun 2012 01:00:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5310tNX024492; Sun, 3 Jun 2012 01:00:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206030100.q5310tNX024492@svn.freebsd.org> From: Marius Strobl Date: Sun, 3 Jun 2012 01:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236496 - head/sys/dev/flash X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 01:00:55 -0000 Author: marius Date: Sun Jun 3 01:00:55 2012 New Revision: 236496 URL: http://svn.freebsd.org/changeset/base/236496 Log: - Loop up to 3 seconds when waiting for a device to get ready. [1] - Make the device description match the driver name. - Identify the chip variant based on the JEDEC and use that information to use the proper values for page count, offset and size instead of hardcoding a AT45DB642x with 2^N byte page support disabled. - Take advantage of bioq_takefirst(). - Given that CONTINUOUS_ARRAY_READ_HF (0x0b) command isn't even mentioned in Atmel's DataFlash Application Note, as suggested by the previous comment may not work on all all devices and actually doesn't properly on at least AT45DB321D (JEDEC 0x1f2701), rewrite at45d_task() to use CONTINUOUS_ARRAY_READ (0xe8) for reading instead. This rewrite is laid out in a way allowing to easily add support for BIO_DELETE later on. - Add support for reads and writes not starting on a page boundary. - Verify the flash content after writing. - Let at45d_task() gracefully handle errors on SPI transfers and the device not becoming ready afterwards again. [1] - Use DEVMETHOD_END. [1] - Use NULL instead of 0 for pointers. [1] Additional testing by: Ian Lepore Submitted by: Ian Lepore [1] MFC after: 1 week Modified: head/sys/dev/flash/at45d.c Modified: head/sys/dev/flash/at45d.c ============================================================================== --- head/sys/dev/flash/at45d.c Sun Jun 3 00:54:10 2012 (r236495) +++ head/sys/dev/flash/at45d.c Sun Jun 3 01:00:55 2012 (r236496) @@ -1,5 +1,8 @@ /*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. + * Copyright (c) 2006 M. Warner Losh + * Copyright (c) 2011-2012 Ian Lepore + * Copyright (c) 2012 Marius Strobl + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -42,44 +45,82 @@ __FBSDID("$FreeBSD$"); #include #include "spibus_if.h" -struct at45d_softc +struct at45d_flash_ident { - struct intr_config_hook config_intrhook; - device_t dev; - struct mtx sc_mtx; - struct disk *disk; - struct proc *p; - struct bio_queue_head bio_queue; + const char *name; + uint32_t jedec; + uint16_t pagecount; + uint16_t pageoffset; + uint16_t pagesize; + uint16_t pagesize2n; }; -#define AT45D_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +struct at45d_softc +{ + struct bio_queue_head bio_queue; + struct mtx sc_mtx; + struct disk *disk; + struct proc *p; + struct intr_config_hook config_intrhook; + device_t dev; + uint16_t pagecount; + uint16_t pageoffset; + uint16_t pagesize; +}; + +#define AT45D_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define AT45D_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define AT45D_LOCK_INIT(_sc) \ +#define AT45D_LOCK_INIT(_sc) \ mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->dev), \ "at45d", MTX_DEF) -#define AT45D_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); -#define AT45D_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); -#define AT45D_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); - -static void at45d_delayed_attach(void *xsc); +#define AT45D_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); +#define AT45D_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); +#define AT45D_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); + +/* bus entry points */ +static device_attach_t at45d_attach; +static device_detach_t at45d_detach; +static device_probe_t at45d_probe; /* disk routines */ -static int at45d_open(struct disk *dp); static int at45d_close(struct disk *dp); +static int at45d_open(struct disk *dp); static void at45d_strategy(struct bio *bp); static void at45d_task(void *arg); -#define CONTINUOUS_ARRAY_READ 0xE8 -#define CONTINUOUS_ARRAY_READ_HF 0x0B -#define CONTINUOUS_ARRAY_READ_LF 0x03 -#define STATUS_REGISTER_READ 0xD7 -#define PROGRAM_THROUGH_BUFFER 0x82 -#define MANUFACTURER_ID 0x9F +/* helper routines */ +static void at45d_delayed_attach(void *xsc); +static int at45d_get_mfg_info(device_t dev, uint8_t *resp); +static int at45d_get_status(device_t dev, uint8_t *status); +static int at45d_wait_ready(device_t dev, uint8_t *status); + +#define BUFFER_TRANSFER 0x53 +#define BUFFER_COMPARE 0x60 +#define PROGRAM_THROUGH_BUFFER 0x82 +#define MANUFACTURER_ID 0x9f +#define STATUS_REGISTER_READ 0xd7 +#define CONTINUOUS_ARRAY_READ 0xe8 + +/* + * A sectorsize2n != 0 is used to indicate that a device optionally supports + * 2^N byte pages. If support for the latter is enabled, the sector offset + * has to be reduced by one. + */ +static const struct at45d_flash_ident const at45d_flash_devices[] = { + { "AT45DB011B", 0x1f2200, 512, 9, 264, 256 }, + { "AT45DB021B", 0x1f2300, 1024, 9, 264, 256 }, + { "AT45DB041x", 0x1f2400, 2028, 9, 264, 256 }, + { "AT45DB081B", 0x1f2500, 4096, 9, 264, 256 }, + { "AT45DB161x", 0x1f2600, 4096, 10, 528, 512 }, + { "AT45DB321x", 0x1f2700, 8192, 10, 528, 0 }, + { "AT45DB321x", 0x1f2701, 8192, 10, 528, 512 }, + { "AT45DB642x", 0x1f2800, 8192, 11, 1056, 1024 } +}; -static uint8_t -at45d_get_status(device_t dev) +static int +at45d_get_status(device_t dev, uint8_t *status) { - uint8_t txBuf[8], rxBuf[8]; + uint8_t rxBuf[8], txBuf[8]; struct spi_command cmd; int err; @@ -90,23 +131,16 @@ at45d_get_status(device_t dev) txBuf[0] = STATUS_REGISTER_READ; cmd.tx_cmd = txBuf; cmd.rx_cmd = rxBuf; - cmd.rx_cmd_sz = 2; - cmd.tx_cmd_sz = 2; + cmd.rx_cmd_sz = cmd.tx_cmd_sz = 2; err = SPIBUS_TRANSFER(device_get_parent(dev), dev, &cmd); - return (rxBuf[1]); -} - -static void -at45d_wait_for_device_ready(device_t dev) -{ - while (!(at45d_get_status(dev) & 0x80)) - continue; + *status = rxBuf[1]; + return (err); } static int at45d_get_mfg_info(device_t dev, uint8_t *resp) { - uint8_t txBuf[8], rxBuf[8]; + uint8_t rxBuf[8], txBuf[8]; struct spi_command cmd; int err; @@ -117,22 +151,37 @@ at45d_get_mfg_info(device_t dev, uint8_t txBuf[0] = MANUFACTURER_ID; cmd.tx_cmd = &txBuf; cmd.rx_cmd = &rxBuf; - cmd.tx_cmd_sz = 5; - cmd.rx_cmd_sz = 5; + cmd.tx_cmd_sz = cmd.rx_cmd_sz = 5; err = SPIBUS_TRANSFER(device_get_parent(dev), dev, &cmd); if (err) return (err); memcpy(resp, rxBuf + 1, 4); - // XXX We really should 'decode' the reply into some kind of - // XXX structure. To be generic (and not just for atmel parts) - // XXX we'd have to loop until we got a full reply. return (0); } static int +at45d_wait_ready(device_t dev, uint8_t *status) +{ + struct timeval now, tout; + int err; + + getmicrouptime(&tout); + tout.tv_sec += 3; + do { + getmicrouptime(&now); + if (now.tv_sec > tout.tv_sec) + err = ETIMEDOUT; + else + err = at45d_get_status(dev, status); + } while (err == 0 && (*status & 0x80) == 0); + return (err); +} + +static int at45d_probe(device_t dev) { - device_set_desc(dev, "AT45 Flash Family"); + + device_set_desc(dev, "AT45D Flash Family"); return (0); } @@ -156,31 +205,66 @@ at45d_attach(device_t dev) static int at45d_detach(device_t dev) { - return EIO; + + return (EBUSY) /* XXX */; } static void at45d_delayed_attach(void *xsc) { - struct at45d_softc *sc = xsc; - uint8_t buf[4]; - - at45d_get_mfg_info(sc->dev, buf); - at45d_wait_for_device_ready(sc->dev); - - sc->disk = disk_alloc(); - sc->disk->d_open = at45d_open; - sc->disk->d_close = at45d_close; - sc->disk->d_strategy = at45d_strategy; - sc->disk->d_name = "flash/spi"; - sc->disk->d_drv1 = sc; - sc->disk->d_maxsize = DFLTPHYS; - sc->disk->d_sectorsize = 1056; /* XXX */ - sc->disk->d_mediasize = 8192 * 1056; /* XXX */ - sc->disk->d_unit = device_get_unit(sc->dev); - disk_create(sc->disk, DISK_VERSION); - bioq_init(&sc->bio_queue); - kproc_create(&at45d_task, sc, &sc->p, 0, 0, "task: at45d flash"); + struct at45d_softc *sc; + const struct at45d_flash_ident *ident; + u_int i; + uint32_t jedec; + uint16_t pagesize; + uint8_t buf[4], status; + + sc = xsc; + ident = NULL; + jedec = 0; + + if (at45d_wait_ready(sc->dev, &status) != 0) + device_printf(sc->dev, "Error waiting for device-ready.\n"); + else if (at45d_get_mfg_info(sc->dev, buf) != 0) + device_printf(sc->dev, "Failed to get ID.\n"); + else { + jedec = buf[0] << 16 | buf[1] << 8 | buf[2]; + for (i = 0; i < nitems(at45d_flash_devices); i++) { + if (at45d_flash_devices[i].jedec == jedec) { + ident = &at45d_flash_devices[i]; + break; + } + } + } + if (ident == NULL) + device_printf(sc->dev, "JEDEC 0x%x not in list.\n", jedec); + else { + sc->pagecount = ident->pagecount; + sc->pageoffset = ident->pageoffset; + if (ident->pagesize2n != 0 && (status & 0x01) != 0) { + sc->pageoffset -= 1; + pagesize = ident->pagesize2n; + } else + pagesize = ident->pagesize; + sc->pagesize = pagesize; + + sc->disk = disk_alloc(); + sc->disk->d_open = at45d_open; + sc->disk->d_close = at45d_close; + sc->disk->d_strategy = at45d_strategy; + sc->disk->d_name = "flash/spi"; + sc->disk->d_drv1 = sc; + sc->disk->d_maxsize = DFLTPHYS; + sc->disk->d_sectorsize = pagesize; + sc->disk->d_mediasize = pagesize * ident->pagecount; + sc->disk->d_unit = device_get_unit(sc->dev); + disk_create(sc->disk, DISK_VERSION); + bioq_init(&sc->bio_queue); + kproc_create(&at45d_task, sc, &sc->p, 0, 0, + "task: at45d flash"); + device_printf(sc->dev, "%s, %d bytes per page, %d pages\n", + ident->name, pagesize, ident->pagecount); + } config_intrhook_disestablish(&sc->config_intrhook); } @@ -188,13 +272,15 @@ at45d_delayed_attach(void *xsc) static int at45d_open(struct disk *dp) { - return 0; + + return (0); } static int at45d_close(struct disk *dp) { - return 0; + + return (0); } static void @@ -212,53 +298,132 @@ at45d_strategy(struct bio *bp) static void at45d_task(void *arg) { - struct at45d_softc *sc = (struct at45d_softc*)arg; + uint8_t rxBuf[8], txBuf[8]; + struct at45d_softc *sc; struct bio *bp; - uint8_t txBuf[8], rxBuf[8]; struct spi_command cmd; - int sz; - daddr_t block, end; device_t dev, pdev; - int err; + caddr_t buf; + u_long len, resid; + u_int addr, berr, err, offset, page; + uint8_t status; + + sc = (struct at45d_softc*)arg; + dev = sc->dev; + pdev = device_get_parent(dev); + memset(&cmd, 0, sizeof(cmd)); + memset(txBuf, 0, sizeof(txBuf)); + memset(rxBuf, 0, sizeof(rxBuf)); + cmd.tx_cmd = txBuf; + cmd.rx_cmd = rxBuf; for (;;) { - dev = sc->dev; - pdev = device_get_parent(dev); AT45D_LOCK(sc); do { - bp = bioq_first(&sc->bio_queue); + bp = bioq_takefirst(&sc->bio_queue); if (bp == NULL) msleep(sc, &sc->sc_mtx, PRIBIO, "jobqueue", 0); } while (bp == NULL); - bioq_remove(&sc->bio_queue, bp); AT45D_UNLOCK(sc); - sz = sc->disk->d_sectorsize; - end = bp->bio_pblkno + (bp->bio_bcount / sz); - for (block = bp->bio_pblkno; block < end; block++) { - char *vaddr = bp->bio_data + (block - bp->bio_pblkno) * sz; - if (bp->bio_cmd == BIO_READ) { - txBuf[0] = CONTINUOUS_ARRAY_READ_HF; - cmd.tx_cmd_sz = 5; - cmd.rx_cmd_sz = 5; - } else { + + berr = 0; + buf = bp->bio_data; + len = resid = bp->bio_bcount; + page = bp->bio_offset / sc->pagesize; + offset = bp->bio_offset % sc->pagesize; + + switch (bp->bio_cmd) { + case BIO_READ: + txBuf[0] = CONTINUOUS_ARRAY_READ; + cmd.tx_cmd_sz = cmd.rx_cmd_sz = 8; + cmd.tx_data = cmd.rx_data = buf; + break; + case BIO_WRITE: + cmd.tx_cmd_sz = cmd.rx_cmd_sz = 4; + cmd.tx_data = cmd.rx_data = buf; + if (resid + offset > sc->pagesize) + len = sc->pagesize - offset; + break; + default: + berr = EINVAL; + goto out; + } + + /* + * NB: for BIO_READ, this loop is only traversed once. + */ + while (resid > 0) { + if (page > sc->pagecount) { + berr = EINVAL; + goto out; + } + addr = page << sc->pageoffset; + if (bp->bio_cmd == BIO_WRITE) { + if (len != sc->pagesize) { + txBuf[0] = BUFFER_TRANSFER; + txBuf[1] = ((addr >> 16) & 0xff); + txBuf[2] = ((addr >> 8) & 0xff); + txBuf[3] = 0; + cmd.tx_data_sz = cmd.rx_data_sz = 0; + err = SPIBUS_TRANSFER(pdev, dev, + &cmd); + if (err == 0) + err = at45d_wait_ready(dev, + &status); + if (err != 0) { + berr = EIO; + goto out; + } + } txBuf[0] = PROGRAM_THROUGH_BUFFER; - cmd.tx_cmd_sz = 4; - cmd.rx_cmd_sz = 4; } - // XXX only works on certain devices... Fixme - txBuf[1] = ((block >> 5) & 0xFF); - txBuf[2] = ((block << 3) & 0xF8); - txBuf[3] = 0; - txBuf[4] = 0; - cmd.tx_cmd = txBuf; - cmd.rx_cmd = rxBuf; - cmd.tx_data = vaddr; - cmd.tx_data_sz = sz; - cmd.rx_data = vaddr; - cmd.rx_data_sz = sz; + + addr += offset; + txBuf[1] = ((addr >> 16) & 0xff); + txBuf[2] = ((addr >> 8) & 0xff); + txBuf[3] = (addr & 0xff); + cmd.tx_data_sz = cmd.rx_data_sz = len; err = SPIBUS_TRANSFER(pdev, dev, &cmd); - // XXX err check? + if (err == 0 && bp->bio_cmd != BIO_READ) + err = at45d_wait_ready(dev, &status); + if (err != 0) { + berr = EIO; + goto out; + } + if (bp->bio_cmd == BIO_WRITE) { + addr = page << sc->pageoffset; + txBuf[0] = BUFFER_COMPARE; + txBuf[1] = ((addr >> 16) & 0xff); + txBuf[2] = ((addr >> 8) & 0xff); + txBuf[3] = 0; + cmd.tx_data_sz = cmd.rx_data_sz = 0; + err = SPIBUS_TRANSFER(pdev, dev, &cmd); + if (err == 0) + err = at45d_wait_ready(dev, &status); + if (err != 0 || (status & 0x40) != 0) { + device_printf(dev, "comparing page " + "%d failed (status=0x%x)\n", addr, + status); + berr = EIO; + goto out; + } + } + page++; + buf += len; + offset = 0; + resid -= len; + if (resid > sc->pagesize) + len = sc->pagesize; + else + len = resid; + cmd.tx_data = cmd.rx_data = buf; + } + out: + if (berr != 0) { + bp->bio_flags |= BIO_ERROR; + bp->bio_error = berr; } + bp->bio_resid = resid; biodone(bp); } } @@ -271,7 +436,7 @@ static device_method_t at45d_methods[] = DEVMETHOD(device_attach, at45d_attach), DEVMETHOD(device_detach, at45d_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t at45d_driver = { @@ -280,4 +445,4 @@ static driver_t at45d_driver = { sizeof(struct at45d_softc), }; -DRIVER_MODULE(at45d, spibus, at45d_driver, at45d_devclass, 0, 0); +DRIVER_MODULE(at45d, spibus, at45d_driver, at45d_devclass, NULL, NULL); From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 01:07:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4DF6106566B; Sun, 3 Jun 2012 01:07:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFEF68FC16; Sun, 3 Jun 2012 01:07:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5317tFr024840; Sun, 3 Jun 2012 01:07:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5317tCI024838; Sun, 3 Jun 2012 01:07:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206030107.q5317tCI024838@svn.freebsd.org> From: Marius Strobl Date: Sun, 3 Jun 2012 01:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236497 - head/sys/arm/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 01:07:55 -0000 Author: marius Date: Sun Jun 3 01:07:55 2012 New Revision: 236497 URL: http://svn.freebsd.org/changeset/base/236497 Log: - Now that the DataFlash related drivers work properly (at91_spi(4) since r236495 and at45d(4) since r236496), enable them by default. - Sort BOOTP options. Modified: head/sys/arm/conf/ETHERNUT5 Modified: head/sys/arm/conf/ETHERNUT5 ============================================================================== --- head/sys/arm/conf/ETHERNUT5 Sun Jun 3 01:00:55 2012 (r236496) +++ head/sys/arm/conf/ETHERNUT5 Sun Jun 3 01:07:55 2012 (r236497) @@ -66,11 +66,11 @@ options PRINTF_BUFR_SIZE=128 # Prevent #options INCLUDE_CONFIG_FILE # Include this file in kernel # required for netbooting -options BOOTP_NFSROOT options BOOTP +options BOOTP_COMPAT +options BOOTP_NFSROOT options BOOTP_NFSV3 options BOOTP_WIRED_TO=ate0 -options BOOTP_COMPAT # alternatively, boot from a MMC/SD memory card #options ROOTDEVNAME=\"ufs:/dev/mmcsd0a\" @@ -117,11 +117,11 @@ options AT91_MCI_HAS_4WIRE device mmc # MMC/SD bus device mmcsd # MMC/SD memory card -# DataFlash - totally b0rken drivers -#device at91_spi # Atmel AT91 Serial Peripheral Interface -#device spibus # SPI bus -#device at45d # Atmel AT45D -#device geom_map # GEOM partition mapping +# DataFlash +device at91_spi # Atmel AT91 Serial Peripheral Interface +device spibus # SPI bus +device at45d # Atmel AT45D +device geom_map # GEOM partition mapping # Pseudo devices. device loop # Network loopback From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 05:36:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07BDC106566B; Sun, 3 Jun 2012 05:36:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA7008FC14; Sun, 3 Jun 2012 05:36:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q535aP7L036975; Sun, 3 Jun 2012 05:36:25 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q535aPJF036973; Sun, 3 Jun 2012 05:36:25 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201206030536.q535aPJF036973@svn.freebsd.org> From: Warner Losh Date: Sun, 3 Jun 2012 05:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236498 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 05:36:26 -0000 Author: imp Date: Sun Jun 3 05:36:25 2012 New Revision: 236498 URL: http://svn.freebsd.org/changeset/base/236498 Log: Remove stray repeated line... Modified: head/sys/arm/at91/at91_reset.S Modified: head/sys/arm/at91/at91_reset.S ============================================================================== --- head/sys/arm/at91/at91_reset.S Sun Jun 3 01:07:55 2012 (r236497) +++ head/sys/arm/at91/at91_reset.S Sun Jun 3 05:36:25 2012 (r236498) @@ -18,7 +18,6 @@ __FBSDID("$FreeBSD$"); * the data until the clock restarts. * * If the User reset is programed to assert a general reset, the data - * If the User reset is programed to assert a general reset, the data * maintained by the SDRAM leads to a data bus conflict and adversly affects * the boot memories connected to the EBI: * + NAND Flash boot functionality, if the system boots out of internal ROM. From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 06:57:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 824511065673; Sun, 3 Jun 2012 06:57:48 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A8638FC08; Sun, 3 Jun 2012 06:57:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q536vmoW040876; Sun, 3 Jun 2012 06:57:48 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q536vmu4040865; Sun, 3 Jun 2012 06:57:48 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201206030657.q536vmu4040865@svn.freebsd.org> From: Joel Dahl Date: Sun, 3 Jun 2012 06:57:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236500 - in head/usr.sbin: adduser arp bluetooth/bthidcontrol bluetooth/btpand bluetooth/hccontrol bluetooth/l2control bluetooth/sdpcontrol digictl fwcontrol gssd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 06:57:48 -0000 Author: joel (doc committer) Date: Sun Jun 3 06:57:47 2012 New Revision: 236500 URL: http://svn.freebsd.org/changeset/base/236500 Log: mdoc: add missing width argument to Bl -tag. Modified: head/usr.sbin/adduser/rmuser.8 head/usr.sbin/arp/arp.4 head/usr.sbin/bluetooth/bthidcontrol/bthidcontrol.8 head/usr.sbin/bluetooth/btpand/btpand.8 head/usr.sbin/bluetooth/hccontrol/hccontrol.8 head/usr.sbin/bluetooth/l2control/l2control.8 head/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.8 head/usr.sbin/digictl/digictl.8 head/usr.sbin/fwcontrol/fwcontrol.8 head/usr.sbin/gssd/gssd.8 Modified: head/usr.sbin/adduser/rmuser.8 ============================================================================== --- head/usr.sbin/adduser/rmuser.8 Sun Jun 3 05:47:42 2012 (r236499) +++ head/usr.sbin/adduser/rmuser.8 Sun Jun 3 06:57:47 2012 (r236500) @@ -157,7 +157,7 @@ Identifies one or more users to be remov interactively asks for one or more users to be removed. .El .Sh FILES -.Bl -tag -compact +.Bl -tag -width "Pa /etc/master.passwd" -compact .It Pa /etc/master.passwd .It Pa /etc/passwd .It Pa /etc/group Modified: head/usr.sbin/arp/arp.4 ============================================================================== --- head/usr.sbin/arp/arp.4 Sun Jun 3 05:47:42 2012 (r236499) +++ head/usr.sbin/arp/arp.4 Sun Jun 3 06:57:47 2012 (r236500) @@ -119,7 +119,7 @@ branch of the .Xr sysctl 3 MIB. -.Bl -tag +.Bl -tag -width "useloopback" .It Va max_age How long an ARP entry is held in the cache until it needs to be refreshed. .It Va maxtries Modified: head/usr.sbin/bluetooth/bthidcontrol/bthidcontrol.8 ============================================================================== --- head/usr.sbin/bluetooth/bthidcontrol/bthidcontrol.8 Sun Jun 3 05:47:42 2012 (r236499) +++ head/usr.sbin/bluetooth/bthidcontrol/bthidcontrol.8 Sun Jun 3 06:57:47 2012 (r236500) @@ -83,7 +83,7 @@ The currently supported node commands in .Nm are: .Pp -.Bl -tag -offset indent -compact +.Bl -tag -width "Forget" -offset indent -compact .It Cm Query .It Cm Dump .It Cm Known Modified: head/usr.sbin/bluetooth/btpand/btpand.8 ============================================================================== --- head/usr.sbin/bluetooth/btpand/btpand.8 Sun Jun 3 05:47:42 2012 (r236499) +++ head/usr.sbin/bluetooth/btpand/btpand.8 Sun Jun 3 06:57:47 2012 (r236500) @@ -128,7 +128,7 @@ and 1 for a PANU server. Set L2CAP connection link mode. Supported modes are: .Pp -.Bl -tag -compact +.Bl -tag -width 8n -compact .It auth require devices to be paired. .It encrypt @@ -151,7 +151,7 @@ Name of .Ar service to provide or connect to, the following services are recognised: .Pp -.Bl -tag -compact +.Bl -tag -width 8n -compact .It GN Group ad-hoc Network. .It NAP @@ -182,7 +182,7 @@ has set up the client or server connecti .Xr tap 4 interface, it will create a pid file and detach. .Sh FILES -.Bl -tag -compact +.Bl -tag -width "Pa /etc/bluetooth/hosts" -compact .It Pa /dev/tap .It Pa /etc/bluetooth/hosts .It Pa /var/run/sdp Modified: head/usr.sbin/bluetooth/hccontrol/hccontrol.8 ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/hccontrol.8 Sun Jun 3 05:47:42 2012 (r236499) +++ head/usr.sbin/bluetooth/hccontrol/hccontrol.8 Sun Jun 3 06:57:47 2012 (r236500) @@ -81,7 +81,7 @@ The currently supported HCI commands in .Nm are: .Pp -.Bl -tag -offset indent -compact +.Bl -tag -width 40n -offset indent -compact .It Cm Inquiry .It Cm Create_Connection .It Cm Disconnect @@ -148,7 +148,7 @@ The currently supported node commands in .Nm are: .Pp -.Bl -tag -offset indent -compact +.Bl -tag -width 40n -offset indent -compact .It Cm Read_Node_State .It Cm Initialize .It Cm Read_Debug_Level Modified: head/usr.sbin/bluetooth/l2control/l2control.8 ============================================================================== --- head/usr.sbin/bluetooth/l2control/l2control.8 Sun Jun 3 05:47:42 2012 (r236499) +++ head/usr.sbin/bluetooth/l2control/l2control.8 Sun Jun 3 06:57:47 2012 (r236500) @@ -77,7 +77,7 @@ The currently supported node commands in .Nm are: .Pp -.Bl -tag -offset indent -compact +.Bl -tag -width "Write_Auto_Disconnect_Timeout" -offset indent -compact .It Cm Read_Node_Flags .It Cm Read_Debug_Level .It Cm Write_Debug_Level Modified: head/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.8 ============================================================================== --- head/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.8 Sun Jun 3 05:47:42 2012 (r236499) +++ head/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.8 Sun Jun 3 06:57:47 2012 (r236500) @@ -86,7 +86,7 @@ The currently supported node commands in .Nm are: .Pp -.Bl -tag -offset indent -compact +.Bl -tag -width "Browse" -offset indent -compact .It Cm Browse .It Cm Search .El Modified: head/usr.sbin/digictl/digictl.8 ============================================================================== --- head/usr.sbin/digictl/digictl.8 Sun Jun 3 05:47:42 2012 (r236499) +++ head/usr.sbin/digictl/digictl.8 Sun Jun 3 06:57:47 2012 (r236500) @@ -53,7 +53,7 @@ is the card number and is the port number. .Pp The following flags are recognized: -.Bl -tag +.Bl -tag -width 10n .It Fl a Cm disable | enable | query Disable, enable or query the .Em ALTPIN Modified: head/usr.sbin/fwcontrol/fwcontrol.8 ============================================================================== --- head/usr.sbin/fwcontrol/fwcontrol.8 Sun Jun 3 05:47:42 2012 (r236499) +++ head/usr.sbin/fwcontrol/fwcontrol.8 Sun Jun 3 06:57:47 2012 (r236500) @@ -144,7 +144,7 @@ Hostname will be converted to EUI64 usin .Xr eui64 5 . .El .Sh FILES -.Bl -tag +.Bl -tag -width "Pa /dev/fw0.0" .It Pa /dev/fw0.0 .El .Sh EXAMPLES Modified: head/usr.sbin/gssd/gssd.8 ============================================================================== --- head/usr.sbin/gssd/gssd.8 Sun Jun 3 05:47:42 2012 (r236499) +++ head/usr.sbin/gssd/gssd.8 Sun Jun 3 06:57:47 2012 (r236500) @@ -40,7 +40,7 @@ The program provides support for the kernel GSS-API implementation. .Pp The options are as follows: -.Bl -tag +.Bl -tag -width indent .It Fl d Run in debug mode. In this mode, From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 07:36:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA2F81065672; Sun, 3 Jun 2012 07:36:59 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C58F88FC1D; Sun, 3 Jun 2012 07:36:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q537axBg042647; Sun, 3 Jun 2012 07:36:59 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q537axiD042645; Sun, 3 Jun 2012 07:36:59 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201206030736.q537axiD042645@svn.freebsd.org> From: Maksim Yevmenkin Date: Sun, 3 Jun 2012 07:36:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236501 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 07:36:59 -0000 Author: emax Date: Sun Jun 3 07:36:59 2012 New Revision: 236501 URL: http://svn.freebsd.org/changeset/base/236501 Log: Plug reference leak. Interface routes are refcounted as packets move through the stack, and there's garbage collection tied to it so that route changes can safely propagate while traffic is flowing. In our setup, we weren't changing or deleting any routes, but the refcounting logic in ip6_input() was wrong and caused a reference leak on every inbound V6 packet. This eventually caused a 32bit overflow, and the resulting 0 value caused the garbage collection to run on the active route. That then snowballed into the panic. Reviewed by: scottl MFC after: 3 days Modified: head/sys/netinet6/ip6_input.c Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Sun Jun 3 06:57:47 2012 (r236500) +++ head/sys/netinet6/ip6_input.c Sun Jun 3 07:36:59 2012 (r236501) @@ -879,19 +879,23 @@ passin: * as our interface address (e.g. multicast addresses, addresses * within FAITH prefixes and such). */ - if (deliverifp && !ip6_getdstifaddr(m)) { + if (deliverifp) { struct in6_ifaddr *ia6; - ia6 = in6_ifawithifp(deliverifp, &ip6->ip6_dst); - if (ia6) { - if (!ip6_setdstifaddr(m, ia6)) { - /* - * XXX maybe we should drop the packet here, - * as we could not provide enough information - * to the upper layers. - */ - } + if ((ia6 = ip6_getdstifaddr(m)) != NULL) { ifa_free(&ia6->ia_ifa); + } else { + ia6 = in6_ifawithifp(deliverifp, &ip6->ip6_dst); + if (ia6) { + if (!ip6_setdstifaddr(m, ia6)) { + /* + * XXX maybe we should drop the packet here, + * as we could not provide enough information + * to the upper layers. + */ + } + ifa_free(&ia6->ia_ifa); + } } } From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 07:45:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C50F1065799; Sun, 3 Jun 2012 07:45:43 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37DB18FC12; Sun, 3 Jun 2012 07:45:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q537jh97043062; Sun, 3 Jun 2012 07:45:43 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q537jhAf043060; Sun, 3 Jun 2012 07:45:43 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201206030745.q537jhAf043060@svn.freebsd.org> From: Joel Dahl Date: Sun, 3 Jun 2012 07:45:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236502 - head/sbin/setkey X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 07:45:43 -0000 Author: joel (doc committer) Date: Sun Jun 3 07:45:42 2012 New Revision: 236502 URL: http://svn.freebsd.org/changeset/base/236502 Log: Minor mdoc improvements. Modified: head/sbin/setkey/setkey.8 Modified: head/sbin/setkey/setkey.8 ============================================================================== --- head/sbin/setkey/setkey.8 Sun Jun 3 07:36:59 2012 (r236501) +++ head/sbin/setkey/setkey.8 Sun Jun 3 07:45:42 2012 (r236502) @@ -442,7 +442,7 @@ protocols other than TCP, UDP and ICMP m .Ar policy is expressed in one of the following three formats: .Pp -.Bl -tag -compact +.Bl -tag -width 2n -compact .It Fl P Ar direction Li discard .It Fl P Ar direction Li none .It Xo Fl P Ar direction Li ipsec @@ -553,7 +553,9 @@ For example, if an IP header was followed by an AH header followed by an ESP header followed by an upper layer protocol header, the rule would be: +.Pp .Dl esp/transport//require ah/transport//require ; +.Pp The rule order is very important. .Pp Note that From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 08:01:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DE641065672; Sun, 3 Jun 2012 08:01:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 484228FC0C; Sun, 3 Jun 2012 08:01:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5381DaP043829; Sun, 3 Jun 2012 08:01:13 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5381D7Y043823; Sun, 3 Jun 2012 08:01:13 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206030801.q5381D7Y043823@svn.freebsd.org> From: Andriy Gapon Date: Sun, 3 Jun 2012 08:01:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236503 - in head/sys: amd64/amd64 i386/i386 kern x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 08:01:13 -0000 Author: avg Date: Sun Jun 3 08:01:12 2012 New Revision: 236503 URL: http://svn.freebsd.org/changeset/base/236503 Log: free wdog_kern_pat calls in post-panic paths from under SW_WATCHDOG Those calls are useful with hardware watchdog drivers too. MFC after: 3 weeks Modified: head/sys/amd64/amd64/minidump_machdep.c head/sys/i386/i386/minidump_machdep.c head/sys/kern/kern_shutdown.c head/sys/kern/vfs_subr.c head/sys/x86/x86/dump_machdep.c Modified: head/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- head/sys/amd64/amd64/minidump_machdep.c Sun Jun 3 07:45:42 2012 (r236502) +++ head/sys/amd64/amd64/minidump_machdep.c Sun Jun 3 08:01:12 2012 (r236503) @@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SW_WATCHDOG #include -#endif #include #include #include @@ -177,9 +175,9 @@ blk_write(struct dumperinfo *di, char *p report_progress(progress, dumpsize); counter &= (1<<24) - 1; } -#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); -#endif + if (ptr) { error = dump_write(di, ptr, 0, dumplo, len); if (error) Modified: head/sys/i386/i386/minidump_machdep.c ============================================================================== --- head/sys/i386/i386/minidump_machdep.c Sun Jun 3 07:45:42 2012 (r236502) +++ head/sys/i386/i386/minidump_machdep.c Sun Jun 3 08:01:12 2012 (r236503) @@ -36,9 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SW_WATCHDOG #include -#endif #include #include #include @@ -143,9 +141,9 @@ blk_write(struct dumperinfo *di, char *p printf(" %lld", PG2MB(progress >> PAGE_SHIFT)); counter &= (1<<24) - 1; } -#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); -#endif + if (ptr) { error = dump_write(di, ptr, 0, dumplo, len); if (error) Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Sun Jun 3 07:45:42 2012 (r236502) +++ head/sys/kern/kern_shutdown.c Sun Jun 3 08:01:12 2012 (r236503) @@ -66,9 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SW_WATCHDOG #include -#endif #include @@ -334,9 +332,7 @@ kern_reboot(int howto) waittime = 0; -#ifdef SW_WATCHDOG wdog_kern_pat(WD_LASTVAL); -#endif sys_sync(curthread, NULL); /* @@ -362,9 +358,8 @@ kern_reboot(int howto) if (nbusy < pbusy) iter = 0; pbusy = nbusy; -#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); -#endif sys_sync(curthread, NULL); #ifdef PREEMPTION Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Jun 3 07:45:42 2012 (r236502) +++ head/sys/kern/vfs_subr.c Sun Jun 3 08:01:12 2012 (r236503) @@ -73,9 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SW_WATCHDOG #include -#endif #include @@ -1869,10 +1867,10 @@ sched_sync(void) LIST_INSERT_HEAD(next, bo, bo_synclist); continue; } -#ifdef SW_WATCHDOG + if (first_printf == 0) wdog_kern_pat(WD_LASTVAL); -#endif + } if (!LIST_EMPTY(gslp)) { mtx_unlock(&sync_mtx); Modified: head/sys/x86/x86/dump_machdep.c ============================================================================== --- head/sys/x86/x86/dump_machdep.c Sun Jun 3 07:45:42 2012 (r236502) +++ head/sys/x86/x86/dump_machdep.c Sun Jun 3 08:01:12 2012 (r236503) @@ -36,9 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SW_WATCHDOG #include -#endif #include #include #include @@ -198,9 +196,9 @@ cb_dumpdata(struct md_pa *mdp, int seqnr a = pa + i * PAGE_SIZE; va = pmap_kenter_temporary(trunc_page(a), i); } -#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); -#endif + error = dump_write(di, va, 0, dumplo, sz); if (error) break; From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 08:30:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D32B7106566B; Sun, 3 Jun 2012 08:30:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B99DB8FC14; Sun, 3 Jun 2012 08:30:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q538U0Dc045099; Sun, 3 Jun 2012 08:30:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q538U0ZY045098; Sun, 3 Jun 2012 08:30:00 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206030830.q538U0ZY045098@svn.freebsd.org> From: Andriy Gapon Date: Sun, 3 Jun 2012 08:30:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236504 - head/usr.sbin/cpucontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 08:30:01 -0000 Author: avg Date: Sun Jun 3 08:30:00 2012 New Revision: 236504 URL: http://svn.freebsd.org/changeset/base/236504 Log: cpucontrol: use CPUCTL_UPDATE ioctl on correct file descriptor I guess that means that microcode update has never worked for AMD CPUs. Please also note that only older AMD CPUs and micrcode file format are supported anyway (pre 10h family). MFC after: 1 week Modified: head/usr.sbin/cpucontrol/amd.c Modified: head/usr.sbin/cpucontrol/amd.c ============================================================================== --- head/usr.sbin/cpucontrol/amd.c Sun Jun 3 08:01:12 2012 (r236503) +++ head/usr.sbin/cpucontrol/amd.c Sun Jun 3 08:30:00 2012 (r236504) @@ -160,7 +160,7 @@ amd_update(const char *dev, const char * args.data = fw_image; args.size = st.st_size; - error = ioctl(fd, CPUCTL_UPDATE, &args); + error = ioctl(devfd, CPUCTL_UPDATE, &args); if (error < 0) { fprintf(stderr, "failed.\n"); warn("ioctl()"); From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 09:37:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8007106564A; Sun, 3 Jun 2012 09:37:27 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A14F98FC0A; Sun, 3 Jun 2012 09:37:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q539bRGq048239; Sun, 3 Jun 2012 09:37:27 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q539bR1J048236; Sun, 3 Jun 2012 09:37:27 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201206030937.q539bR1J048236@svn.freebsd.org> From: Martin Matuska Date: Sun, 3 Jun 2012 09:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236505 - in stable/9: cddl/contrib/opensolaris/cmd/zpool sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 09:37:27 -0000 Author: mm Date: Sun Jun 3 09:37:27 2012 New Revision: 236505 URL: http://svn.freebsd.org/changeset/base/236505 Log: MFC r236145, r236146: MFC r236145 [1]: Import illumos changeset 13564:cf89c0c60496 1946 incorrect formatting when listing output of multiple pools with zpool iostat -v MFC r236146 [2]: Import illumos changeset 13605:b5c2b5db80d6 (partial) 763 FMD msg URLs should refer to something visible Replace sun.com URL's with illumos.org References: https://www.illumos.org/issues/1946 [1] https://www.illumos.org/issues/763 [2] Obtained from: illumos (issue #1946 [1], #763 [2]) Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sun Jun 3 08:30:00 2012 (r236504) +++ stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sun Jun 3 09:37:27 2012 (r236505) @@ -23,6 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Frederik Wessels. All rights reserved. * Copyright (c) 2011 Martin Matuska . All rights reserved. */ @@ -1616,7 +1617,7 @@ show_import(nvlist_t *config) } if (msgid != NULL) - (void) printf(gettext(" see: http://www.sun.com/msg/%s\n"), + (void) printf(gettext(" see: http://illumos.org/msg/%s\n"), msgid); (void) printf(gettext(" config:\n\n")); @@ -2351,7 +2352,8 @@ get_namewidth(zpool_handle_t *zhp, void if (!cb->cb_verbose) cb->cb_namewidth = strlen(zpool_get_name(zhp)); else - cb->cb_namewidth = max_width(zhp, nvroot, 0, 0); + cb->cb_namewidth = max_width(zhp, nvroot, 0, + cb->cb_namewidth); } /* @@ -3683,7 +3685,7 @@ print_dedup_stats(nvlist_t *config) * pool: tank * status: DEGRADED * reason: One or more devices ... - * see: http://www.sun.com/msg/ZFS-xxxx-01 + * see: http://illumos.org/msg/ZFS-xxxx-01 * config: * mirror DEGRADED * c1t0d0 OK @@ -3891,7 +3893,7 @@ status_callback(zpool_handle_t *zhp, voi } if (msgid != NULL) - (void) printf(gettext(" see: http://www.sun.com/msg/%s\n"), + (void) printf(gettext(" see: http://illumos.org/msg/%s\n"), msgid); if (config != NULL) { Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Jun 3 08:30:00 2012 (r236504) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Jun 3 09:37:27 2012 (r236505) @@ -2050,7 +2050,7 @@ spa_load_impl(spa_t *spa, uint64_t pool_ cmn_err(CE_WARN, "pool '%s' could not be " "loaded as it was last accessed by " "another system (host: %s hostid: 0x%lx). " - "See: http://www.sun.com/msg/ZFS-8000-EY", + "See: http://illumos.org/msg/ZFS-8000-EY", spa_name(spa), hostname, (unsigned long)hostid); return (EBADF); From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 09:37:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1F7711065886; Sun, 3 Jun 2012 09:37:48 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 085608FC12; Sun, 3 Jun 2012 09:37:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q539blVo048288; Sun, 3 Jun 2012 09:37:47 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q539bl9k048285; Sun, 3 Jun 2012 09:37:47 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201206030937.q539bl9k048285@svn.freebsd.org> From: Martin Matuska Date: Sun, 3 Jun 2012 09:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236506 - in stable/8: cddl/contrib/opensolaris/cmd/zpool sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 09:37:48 -0000 Author: mm Date: Sun Jun 3 09:37:47 2012 New Revision: 236506 URL: http://svn.freebsd.org/changeset/base/236506 Log: MFC r236145, r236146: MFC r236145 [1]: Import illumos changeset 13564:cf89c0c60496 1946 incorrect formatting when listing output of multiple pools with zpool iostat -v MFC r236146 [2]: Import illumos changeset 13605:b5c2b5db80d6 (partial) 763 FMD msg URLs should refer to something visible Replace sun.com URL's with illumos.org References: https://www.illumos.org/issues/1946 [1] https://www.illumos.org/issues/763 [2] Obtained from: illumos (issue #1946 [1], #763 [2]) Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sun Jun 3 09:37:27 2012 (r236505) +++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sun Jun 3 09:37:47 2012 (r236506) @@ -23,6 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Frederik Wessels. All rights reserved. * Copyright (c) 2011 Martin Matuska . All rights reserved. */ @@ -1616,7 +1617,7 @@ show_import(nvlist_t *config) } if (msgid != NULL) - (void) printf(gettext(" see: http://www.sun.com/msg/%s\n"), + (void) printf(gettext(" see: http://illumos.org/msg/%s\n"), msgid); (void) printf(gettext(" config:\n\n")); @@ -2351,7 +2352,8 @@ get_namewidth(zpool_handle_t *zhp, void if (!cb->cb_verbose) cb->cb_namewidth = strlen(zpool_get_name(zhp)); else - cb->cb_namewidth = max_width(zhp, nvroot, 0, 0); + cb->cb_namewidth = max_width(zhp, nvroot, 0, + cb->cb_namewidth); } /* @@ -3683,7 +3685,7 @@ print_dedup_stats(nvlist_t *config) * pool: tank * status: DEGRADED * reason: One or more devices ... - * see: http://www.sun.com/msg/ZFS-xxxx-01 + * see: http://illumos.org/msg/ZFS-xxxx-01 * config: * mirror DEGRADED * c1t0d0 OK @@ -3891,7 +3893,7 @@ status_callback(zpool_handle_t *zhp, voi } if (msgid != NULL) - (void) printf(gettext(" see: http://www.sun.com/msg/%s\n"), + (void) printf(gettext(" see: http://illumos.org/msg/%s\n"), msgid); if (config != NULL) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Jun 3 09:37:27 2012 (r236505) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Jun 3 09:37:47 2012 (r236506) @@ -2050,7 +2050,7 @@ spa_load_impl(spa_t *spa, uint64_t pool_ cmn_err(CE_WARN, "pool '%s' could not be " "loaded as it was last accessed by " "another system (host: %s hostid: 0x%lx). " - "See: http://www.sun.com/msg/ZFS-8000-EY", + "See: http://illumos.org/msg/ZFS-8000-EY", spa_name(spa), hostname, (unsigned long)hostid); return (EBADF); From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 10:50:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A96BD1065673; Sun, 3 Jun 2012 10:50:47 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22F4C8FC15; Sun, 3 Jun 2012 10:50:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q53Aokto056354; Sun, 3 Jun 2012 10:50:46 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q53AokSA056352; Sun, 3 Jun 2012 10:50:46 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201206031050.q53AokSA056352@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 3 Jun 2012 10:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236507 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 10:50:47 -0000 Author: pjd Date: Sun Jun 3 10:50:46 2012 New Revision: 236507 URL: http://svn.freebsd.org/changeset/base/236507 Log: Simplify the code by using snprlcat(). MFC after: 3 days Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Sun Jun 3 09:37:47 2012 (r236506) +++ head/sbin/hastd/primary.c Sun Jun 3 10:50:46 2012 (r236507) @@ -990,36 +990,33 @@ reqlog(int loglevel, int debuglevel, str { char msg[1024]; va_list ap; - int len; va_start(ap, fmt); - len = vsnprintf(msg, sizeof(msg), fmt, ap); + (void)vsnprintf(msg, sizeof(msg), fmt, ap); va_end(ap); - if ((size_t)len < sizeof(msg)) { - switch (ggio->gctl_cmd) { - case BIO_READ: - (void)snprintf(msg + len, sizeof(msg) - len, - "READ(%ju, %ju).", (uintmax_t)ggio->gctl_offset, - (uintmax_t)ggio->gctl_length); - break; - case BIO_DELETE: - (void)snprintf(msg + len, sizeof(msg) - len, - "DELETE(%ju, %ju).", (uintmax_t)ggio->gctl_offset, - (uintmax_t)ggio->gctl_length); - break; - case BIO_FLUSH: - (void)snprintf(msg + len, sizeof(msg) - len, "FLUSH."); - break; - case BIO_WRITE: - (void)snprintf(msg + len, sizeof(msg) - len, - "WRITE(%ju, %ju).", (uintmax_t)ggio->gctl_offset, - (uintmax_t)ggio->gctl_length); - break; - default: - (void)snprintf(msg + len, sizeof(msg) - len, - "UNKNOWN(%u).", (unsigned int)ggio->gctl_cmd); - break; - } + switch (ggio->gctl_cmd) { + case BIO_READ: + (void)snprlcat(msg, sizeof(msg), "READ(%ju, %ju).", + (uintmax_t)ggio->gctl_offset, + (uintmax_t)ggio->gctl_length); + break; + case BIO_DELETE: + (void)snprlcat(msg, sizeof(msg), "DELETE(%ju, %ju).", + (uintmax_t)ggio->gctl_offset, + (uintmax_t)ggio->gctl_length); + break; + case BIO_FLUSH: + (void)snprlcat(msg, sizeof(msg), "FLUSH."); + break; + case BIO_WRITE: + (void)snprlcat(msg, sizeof(msg), "WRITE(%ju, %ju).", + (uintmax_t)ggio->gctl_offset, + (uintmax_t)ggio->gctl_length); + break; + default: + (void)snprlcat(msg, sizeof(msg), "UNKNOWN(%u).", + (unsigned int)ggio->gctl_cmd); + break; } pjdlog_common(loglevel, debuglevel, -1, "%s", msg); } From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 11:09:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F856106564A; Sun, 3 Jun 2012 11:09:52 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A9918FC08; Sun, 3 Jun 2012 11:09:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q53B9qLc057334; Sun, 3 Jun 2012 11:09:52 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q53B9qFv057332; Sun, 3 Jun 2012 11:09:52 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201206031109.q53B9qFv057332@svn.freebsd.org> From: Joel Dahl Date: Sun, 3 Jun 2012 11:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236508 - head/usr.bin/man X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 11:09:52 -0000 Author: joel (doc committer) Date: Sun Jun 3 11:09:51 2012 New Revision: 236508 URL: http://svn.freebsd.org/changeset/base/236508 Log: Minor mdoc improvements. Modified: head/usr.bin/man/man.conf.5 Modified: head/usr.bin/man/man.conf.5 ============================================================================== --- head/usr.bin/man/man.conf.5 Sun Jun 3 10:50:46 2012 (r236507) +++ head/usr.bin/man/man.conf.5 Sun Jun 3 11:09:51 2012 (r236508) @@ -57,7 +57,7 @@ system for extending the manual set to s is intended to be used by the local administrator to set additional policy. .Pp Currently supported configuration variables include: -.Bl -tag -offset indent +.Bl -tag -width 12n -offset indent .It MANCONFIG Overrides the default location to import additional manual configuration files. Defaults to @@ -70,7 +70,8 @@ Indicates support is available for the g .Pp For pages in a given language, overriding the default toolset for display is supported via the following definitions: -.Bl -tag -offset indent -compact +.Pp +.Bl -tag -width 12n -offset indent -compact .It EQN Ns _ Ns Va LANG .It NROFF Ns _ Ns Va LANG .It PIC Ns _ Ns Va LANG @@ -87,7 +88,7 @@ section for how to use these variables. The parser used for this utility is very basic and only supports comment characters (#) at the beginning of a line. .Sh FILES -.Bl -tag -compact +.Bl -tag -width "Pa /usr/local/etc/man.d/*.conf" -compact .It Pa /etc/man.conf System configuration file. .It Pa /usr/local/etc/man.d/*.conf From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 11:29:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A57C6106564A; Sun, 3 Jun 2012 11:29:49 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8640B8FC0A; Sun, 3 Jun 2012 11:29:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q53BTngl058280; Sun, 3 Jun 2012 11:29:49 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q53BTn3C058269; Sun, 3 Jun 2012 11:29:49 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201206031129.q53BTn3C058269@svn.freebsd.org> From: Joel Dahl Date: Sun, 3 Jun 2012 11:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236509 - in head/usr.sbin: arp ctladm jail ndiscvt newsyslog pmcstat setfib syslogd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 11:29:49 -0000 Author: joel (doc committer) Date: Sun Jun 3 11:29:48 2012 New Revision: 236509 URL: http://svn.freebsd.org/changeset/base/236509 Log: Minor spelling fixes. Modified: head/usr.sbin/arp/arp.4 head/usr.sbin/ctladm/ctladm.8 head/usr.sbin/jail/jail.8 head/usr.sbin/jail/jail.conf.5 head/usr.sbin/ndiscvt/ndiscvt.8 head/usr.sbin/newsyslog/newsyslog.8 head/usr.sbin/pmcstat/pmcstat.8 head/usr.sbin/setfib/setfib.1 head/usr.sbin/syslogd/syslogd.8 Modified: head/usr.sbin/arp/arp.4 ============================================================================== --- head/usr.sbin/arp/arp.4 Sun Jun 3 11:09:51 2012 (r236508) +++ head/usr.sbin/arp/arp.4 Sun Jun 3 11:29:48 2012 (r236509) @@ -113,7 +113,7 @@ MIB variable .Va net.link.ether.inet.proxyall to 1. .Sh MIB Variables -The ARP protocol implements a number of configrable variables in +The ARP protocol implements a number of configurable variables in .Va net.link.ether.inet branch of the Modified: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Sun Jun 3 11:09:51 2012 (r236508) +++ head/usr.sbin/ctladm/ctladm.8 Sun Jun 3 11:29:48 2012 (r236509) @@ -401,7 +401,7 @@ This option and the .Fl m option are mutually exclusive. One of the two must be specified, though. .It Fl P Ar pc -Specify the mode page page control value. Possible values are: +Specify the mode page control value. Possible values are: .Bl -tag -width 2n -compact .It 0 Current values. Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Sun Jun 3 11:09:51 2012 (r236508) +++ head/usr.sbin/jail/jail.8 Sun Jun 3 11:29:48 2012 (r236509) @@ -429,7 +429,7 @@ See the .Sx "Hierarchical Jails" section for more information. .It Va children.cur -The number of descendents of this jail, including its own child jails +The number of descendants of this jail, including its own child jails and any jails created under them. .It Va enforce_statfs This determines which information processes in a jail are able to get Modified: head/usr.sbin/jail/jail.conf.5 ============================================================================== --- head/usr.sbin/jail/jail.conf.5 Sun Jun 3 11:09:51 2012 (r236508) +++ head/usr.sbin/jail/jail.conf.5 Sun Jun 3 11:29:48 2012 (r236509) @@ -125,7 +125,7 @@ Variable substitution occurs in unquoted strings, but not in single-quote strings. .Pp A variable is defined in the same way a parameter is, except that the -variable name is preceeded with a dollar sign: +variable name is preceded with a dollar sign: .Bd -literal -offset indent $parentdir = "/var/jail"; path = "$parentdir/$name"; Modified: head/usr.sbin/ndiscvt/ndiscvt.8 ============================================================================== --- head/usr.sbin/ndiscvt/ndiscvt.8 Sun Jun 3 11:09:51 2012 (r236508) +++ head/usr.sbin/ndiscvt/ndiscvt.8 Sun Jun 3 11:29:48 2012 (r236509) @@ -187,7 +187,7 @@ been mounted), the extra files can simply be copied to the .Pa /compat/ndis directory, and they will be loaded into the kernel on demand when the -the driver needs them. +driver needs them. .Pp If however the driver is required to bootstrap the system (i.e., if Modified: head/usr.sbin/newsyslog/newsyslog.8 ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.8 Sun Jun 3 11:09:51 2012 (r236508) +++ head/usr.sbin/newsyslog/newsyslog.8 Sun Jun 3 11:29:48 2012 (r236509) @@ -166,7 +166,7 @@ is used. If the .Ar timefmt string is changed the old files created using the previous time format -will not be be automatically removed (unless the new format is very +will not be automatically removed (unless the new format is very similar to the old format). This is also the case when changing from sequential filenames to time based file names, and the other way around. Modified: head/usr.sbin/pmcstat/pmcstat.8 ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.8 Sun Jun 3 11:09:51 2012 (r236508) +++ head/usr.sbin/pmcstat/pmcstat.8 Sun Jun 3 11:29:48 2012 (r236509) @@ -263,7 +263,7 @@ Print the sampled PCs with the name, the of the function within they live. The .Ar pathname -argument is mandatory and indicates where informations will be stored. +argument is mandatory and indicates where the information will be stored. If argument .Ar pathname is a Modified: head/usr.sbin/setfib/setfib.1 ============================================================================== --- head/usr.sbin/setfib/setfib.1 Sun Jun 3 11:09:51 2012 (r236508) +++ head/usr.sbin/setfib/setfib.1 Sun Jun 3 11:29:48 2012 (r236509) @@ -45,7 +45,7 @@ with an different routing table. The table number .Dq Ar fib will be used by default for all sockets started by this -process or descendents. +process or descendants. .Sh ENVIRONMENT The .Ev PATH Modified: head/usr.sbin/syslogd/syslogd.8 ============================================================================== --- head/usr.sbin/syslogd/syslogd.8 Sun Jun 3 11:09:51 2012 (r236508) +++ head/usr.sbin/syslogd/syslogd.8 Sun Jun 3 11:29:48 2012 (r236509) @@ -344,7 +344,7 @@ therefore, they must be created manually The date and time are taken from the received message. If the format of the timestamp field is incorrect, time obtained from the local host is used instead. -This can be overriden by the +This can be overridden by the .Fl T flag. .Sh FILES From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 11:31:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ABA7D106566B; Sun, 3 Jun 2012 11:31:45 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 969C78FC1B; Sun, 3 Jun 2012 11:31:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q53BVjki058409; Sun, 3 Jun 2012 11:31:45 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q53BVjw9058407; Sun, 3 Jun 2012 11:31:45 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201206031131.q53BVjw9058407@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 3 Jun 2012 11:31:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236510 - stable/8/lib/libfetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 11:31:45 -0000 Author: jilles Date: Sun Jun 3 11:31:45 2012 New Revision: 236510 URL: http://svn.freebsd.org/changeset/base/236510 Log: MFC r236193: libfetch: Avoid SIGPIPE on network connections. To avoid unexpected process termination from SIGPIPE when writing to a closed network connection, enable SO_NOSIGPIPE on all network connections. The POSIX standard MSG_NOSIGNAL is not used since it requires modifying all send calls to add this flag. This is particularly nasty for SSL connections. Modified: stable/8/lib/libfetch/common.c Directory Properties: stable/8/lib/libfetch/ (props changed) Modified: stable/8/lib/libfetch/common.c ============================================================================== --- stable/8/lib/libfetch/common.c Sun Jun 3 11:29:48 2012 (r236509) +++ stable/8/lib/libfetch/common.c Sun Jun 3 11:31:45 2012 (r236510) @@ -209,11 +209,13 @@ conn_t * fetch_reopen(int sd) { conn_t *conn; + int opt = 1; /* allocate and fill connection structure */ if ((conn = calloc(1, sizeof(*conn))) == NULL) return (NULL); fcntl(sd, F_SETFD, FD_CLOEXEC); + setsockopt(sd, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof opt); conn->sd = sd; ++conn->ref; return (conn); From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 11:52:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAF0E106566B; Sun, 3 Jun 2012 11:52:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) by mx1.freebsd.org (Postfix) with ESMTP id 2714E8FC15; Sun, 3 Jun 2012 11:52:17 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id C449F25D3A9B; Sun, 3 Jun 2012 11:52:15 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id DE2FFBE7517; Sun, 3 Jun 2012 11:52:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 4OQOWj-RNF8s; Sun, 3 Jun 2012 11:52:13 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 7B804BE7518; Sun, 3 Jun 2012 11:52:13 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201206030736.q537axiD042645@svn.freebsd.org> Date: Sun, 3 Jun 2012 11:52:11 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <930B5C42-C9B7-49BD-A610-AAD7FEAC1BD9@FreeBSD.org> References: <201206030736.q537axiD042645@svn.freebsd.org> To: Maksim Yevmenkin , Scott Long X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r236501 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 11:52:17 -0000 On 3. Jun 2012, at 07:36 , Maksim Yevmenkin wrote: > Author: emax > Date: Sun Jun 3 07:36:59 2012 > New Revision: 236501 > URL: http://svn.freebsd.org/changeset/base/236501 >=20 > Log: > Plug reference leak. >=20 > Interface routes are refcounted as packets move through the stack, > and there's garbage collection tied to it so that route changes can > safely propagate while traffic is flowing. In our setup, we weren't > changing or deleting any routes, but the refcounting logic in > ip6_input() was wrong and caused a reference leak on every inbound > V6 packet. This eventually caused a 32bit overflow, and the resulting > 0 value caused the garbage collection to run on the active route. > That then snowballed into the panic. Global s/route/address/ above. Awesome you found this. I have = certainly read the code several times lately incl. having done the initial review and always missed it. I'll try to get around reviewing the other two you put in my inbox. Great job and finally someone doing 1<<32 packet IPv6 one uptime. Been waiting for that to happen for a long time:-) /bz >=20 > Reviewed by: scottl > MFC after: 3 days >=20 > Modified: > head/sys/netinet6/ip6_input.c >=20 > Modified: head/sys/netinet6/ip6_input.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/netinet6/ip6_input.c Sun Jun 3 06:57:47 2012 = (r236500) > +++ head/sys/netinet6/ip6_input.c Sun Jun 3 07:36:59 2012 = (r236501) > @@ -879,19 +879,23 @@ passin: > * as our interface address (e.g. multicast addresses, addresses > * within FAITH prefixes and such). > */ > - if (deliverifp && !ip6_getdstifaddr(m)) { > + if (deliverifp) { > struct in6_ifaddr *ia6; >=20 > - ia6 =3D in6_ifawithifp(deliverifp, &ip6->ip6_dst); > - if (ia6) { > - if (!ip6_setdstifaddr(m, ia6)) { > - /* > - * XXX maybe we should drop the packet = here, > - * as we could not provide enough = information > - * to the upper layers. > - */ > - } > + if ((ia6 =3D ip6_getdstifaddr(m)) !=3D NULL) { > ifa_free(&ia6->ia_ifa); > + } else { > + ia6 =3D in6_ifawithifp(deliverifp, = &ip6->ip6_dst); > + if (ia6) { > + if (!ip6_setdstifaddr(m, ia6)) { > + /* > + * XXX maybe we should drop the = packet here, > + * as we could not provide = enough information > + * to the upper layers. > + */ > + } > + ifa_free(&ia6->ia_ifa); > + } > } > } >=20 --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 11:54:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B8307106566B; Sun, 3 Jun 2012 11:54:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88B278FC15; Sun, 3 Jun 2012 11:54:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q53BsQUL059477; Sun, 3 Jun 2012 11:54:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q53BsQCR059473; Sun, 3 Jun 2012 11:54:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206031154.q53BsQCR059473@svn.freebsd.org> From: Marius Strobl Date: Sun, 3 Jun 2012 11:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236511 - stable/9/sys/powerpc/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 11:54:26 -0000 Author: marius Date: Sun Jun 3 11:54:26 2012 New Revision: 236511 URL: http://svn.freebsd.org/changeset/base/236511 Log: MFC: r233635 Allow multiple inclusion of trap.h. This has always been broken, but until recently never caused problems. Modified: stable/9/sys/powerpc/include/trap.h stable/9/sys/powerpc/include/trap_aim.h stable/9/sys/powerpc/include/trap_booke.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/powerpc/include/trap.h ============================================================================== --- stable/9/sys/powerpc/include/trap.h Sun Jun 3 11:31:45 2012 (r236510) +++ stable/9/sys/powerpc/include/trap.h Sun Jun 3 11:54:26 2012 (r236511) @@ -6,7 +6,3 @@ #include #endif -#ifndef LOCORE -struct trapframe; -void trap(struct trapframe *); -#endif Modified: stable/9/sys/powerpc/include/trap_aim.h ============================================================================== --- stable/9/sys/powerpc/include/trap_aim.h Sun Jun 3 11:31:45 2012 (r236510) +++ stable/9/sys/powerpc/include/trap_aim.h Sun Jun 3 11:54:26 2012 (r236511) @@ -119,4 +119,9 @@ #define EXC_PGM_PRIV (1UL << 18) #define EXC_PGM_TRAP (1UL << 17) +#ifndef LOCORE +struct trapframe; +void trap(struct trapframe *); +#endif + #endif /* _POWERPC_TRAP_H_ */ Modified: stable/9/sys/powerpc/include/trap_booke.h ============================================================================== --- stable/9/sys/powerpc/include/trap_booke.h Sun Jun 3 11:31:45 2012 (r236510) +++ stable/9/sys/powerpc/include/trap_booke.h Sun Jun 3 11:54:26 2012 (r236511) @@ -52,4 +52,9 @@ #define EXC_LAST 255 +#ifndef LOCORE +struct trapframe; +void trap(struct trapframe *); +#endif + #endif /* _POWERPC_TRAP_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 12:19:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A04871065672; Sun, 3 Jun 2012 12:19:16 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B9F88FC0A; Sun, 3 Jun 2012 12:19:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q53CJGFT060736; Sun, 3 Jun 2012 12:19:16 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q53CJGjU060734; Sun, 3 Jun 2012 12:19:16 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201206031219.q53CJGjU060734@svn.freebsd.org> From: Ulrich Spoerlein Date: Sun, 3 Jun 2012 12:19:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236514 - head/sys/modules/wpi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 12:19:16 -0000 Author: uqs Date: Sun Jun 3 12:19:16 2012 New Revision: 236514 URL: http://svn.freebsd.org/changeset/base/236514 Log: Fix make depend Modified: head/sys/modules/wpi/Makefile Modified: head/sys/modules/wpi/Makefile ============================================================================== --- head/sys/modules/wpi/Makefile Sun Jun 3 12:11:03 2012 (r236513) +++ head/sys/modules/wpi/Makefile Sun Jun 3 12:19:16 2012 (r236514) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../dev/wpi KMOD = if_wpi -SRCS = if_wpi.c device_if.h bus_if.h pci_if.h +SRCS = if_wpi.c device_if.h bus_if.h pci_if.h opt_wlan.h .include From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 14:54:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44383106564A; Sun, 3 Jun 2012 14:54:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 151DD8FC14; Sun, 3 Jun 2012 14:54:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q53Esol2067505; Sun, 3 Jun 2012 14:54:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q53EsoqW067503; Sun, 3 Jun 2012 14:54:50 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201206031454.q53EsoqW067503@svn.freebsd.org> From: Michael Tuexen Date: Sun, 3 Jun 2012 14:54:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236515 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 14:54:51 -0000 Author: tuexen Date: Sun Jun 3 14:54:50 2012 New Revision: 236515 URL: http://svn.freebsd.org/changeset/base/236515 Log: Use an existing function to get the source address. MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Sun Jun 3 12:19:16 2012 (r236514) +++ head/sys/netinet/sctp_asconf.c Sun Jun 3 14:54:50 2012 (r236515) @@ -856,70 +856,20 @@ send_reply: * this could happen if the source address was just newly * added */ - struct ip *iph; - struct sctphdr *sh; - struct sockaddr_storage from_store; - struct sockaddr *from = (struct sockaddr *)&from_store; + struct sockaddr_storage addr; + struct sockaddr *src = (struct sockaddr *)&addr; SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: looking up net for IP source address\n"); - /* pullup already done, IP options already stripped */ - iph = mtod(m, struct ip *); - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - { - struct sockaddr_in *from4; - - sh = (struct sctphdr *)((caddr_t)iph + sizeof(*iph)); - from4 = (struct sockaddr_in *)&from_store; - bzero(from4, sizeof(*from4)); - from4->sin_family = AF_INET; - from4->sin_len = sizeof(struct sockaddr_in); - from4->sin_addr.s_addr = iph->ip_src.s_addr; - from4->sin_port = sh->src_port; - break; - } -#endif -#ifdef INET6 - case IPV6_VERSION >> 4: - { - struct ip6_hdr *ip6; - struct sockaddr_in6 *from6; - - ip6 = mtod(m, struct ip6_hdr *); - sh = (struct sctphdr *)((caddr_t)ip6 + sizeof(*ip6)); - from6 = (struct sockaddr_in6 *)&from_store; - bzero(from6, sizeof(*from6)); - from6->sin6_family = AF_INET6; - from6->sin6_len = sizeof(struct sockaddr_in6); - from6->sin6_addr = ip6->ip6_src; - from6->sin6_port = sh->src_port; - /* - * Get the scopes in properly to the sin6 - * addr's - */ - /* we probably don't need these operations */ - (void)sa6_recoverscope(from6); - sa6_embedscope(from6, - MODULE_GLOBAL(ip6_use_defzone)); - - break; - } -#endif - default: - /* unknown address type */ - from = NULL; - } - if (from != NULL) { - SCTPDBG(SCTP_DEBUG_ASCONF1, "Looking for IP source: "); - SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, from); - /* look up the from address */ - stcb->asoc.last_control_chunk_from = sctp_findnet(stcb, from); + sctp_asconf_get_source_ip(m, src); + SCTPDBG(SCTP_DEBUG_ASCONF1, "Looking for IP source: "); + SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, src); + /* look up the from address */ + stcb->asoc.last_control_chunk_from = sctp_findnet(stcb, src); #ifdef SCTP_DEBUG - if (stcb->asoc.last_control_chunk_from == NULL) - SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: IP source address not found?!\n"); -#endif + if (stcb->asoc.last_control_chunk_from == NULL) { + SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: IP source address not found?!\n"); } +#endif } } From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 16:06:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF2301065678; Sun, 3 Jun 2012 16:06:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CF218FC1C; Sun, 3 Jun 2012 16:06:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q53G6u4v070706; Sun, 3 Jun 2012 16:06:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q53G6ug2070704; Sun, 3 Jun 2012 16:06:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206031606.q53G6ug2070704@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 3 Jun 2012 16:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236516 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 16:06:57 -0000 Author: kib Date: Sun Jun 3 16:06:56 2012 New Revision: 236516 URL: http://svn.freebsd.org/changeset/base/236516 Log: Count and export the number of prefaulting happen. MFC after: 1 month Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sun Jun 3 14:54:50 2012 (r236515) +++ head/sys/kern/vfs_vnops.c Sun Jun 3 16:06:56 2012 (r236516) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -696,6 +697,9 @@ unlock: } static const int io_hold_cnt = 16; +static unsigned long vn_io_faults_cnt; +SYSCTL_LONG(_debug, OID_AUTO, vn_io_faults, CTLFLAG_RD, + &vn_io_faults_cnt, 0, "Count of vn_io_fault lock avoidance triggers"); /* * The vn_io_fault() is a wrapper around vn_read() and vn_write() to @@ -793,6 +797,7 @@ vn_io_fault(struct file *fp, struct uio if (error != EFAULT) goto out; + atomic_add_long(&vn_io_faults_cnt, 1); uio_clone->uio_segflg = UIO_NOCOPY; uiomove(NULL, resid - uio->uio_resid, uio_clone); uio_clone->uio_segflg = uio->uio_segflg; From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 16:19:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6C84106566C; Sun, 3 Jun 2012 16:19:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A26AA8FC17; Sun, 3 Jun 2012 16:19:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q53GJbck071286; Sun, 3 Jun 2012 16:19:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q53GJb2m071284; Sun, 3 Jun 2012 16:19:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206031619.q53GJb2m071284@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 3 Jun 2012 16:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236517 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 16:19:37 -0000 Author: kib Date: Sun Jun 3 16:19:37 2012 New Revision: 236517 URL: http://svn.freebsd.org/changeset/base/236517 Log: Add a knob to disable vn_io_fault. MFC after: 1 month Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sun Jun 3 16:06:56 2012 (r236516) +++ head/sys/kern/vfs_vnops.c Sun Jun 3 16:19:37 2012 (r236517) @@ -697,6 +697,9 @@ unlock: } static const int io_hold_cnt = 16; +static int vn_io_fault_enable = 1; +SYSCTL_INT(_debug, OID_AUTO, vn_io_fault_enable, CTLFLAG_RW, + &vn_io_fault_enable, 0, "Enable vn_io_fault lock avoidance"); static unsigned long vn_io_faults_cnt; SYSCTL_LONG(_debug, OID_AUTO, vn_io_faults, CTLFLAG_RD, &vn_io_faults_cnt, 0, "Count of vn_io_fault lock avoidance triggers"); @@ -759,7 +762,8 @@ vn_io_fault(struct file *fp, struct uio vp = fp->f_vnode; if (uio->uio_segflg != UIO_USERSPACE || vp->v_type != VREG || ((mp = vp->v_mount) != NULL && - (mp->mnt_kern_flag & MNTK_NO_IOPF) == 0)) + (mp->mnt_kern_flag & MNTK_NO_IOPF) == 0) || + !vn_io_fault_enable) return (doio(fp, uio, active_cred, flags, td)); /* From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 17:48:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C360106566B; Sun, 3 Jun 2012 17:48:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 677408FC08; Sun, 3 Jun 2012 17:48:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q53Hm5qu075326; Sun, 3 Jun 2012 17:48:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q53Hm5X4075324; Sun, 3 Jun 2012 17:48:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206031748.q53Hm5X4075324@svn.freebsd.org> From: Marius Strobl Date: Sun, 3 Jun 2012 17:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236518 - stable/9/sys/boot/powerpc/ps3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 17:48:05 -0000 Author: marius Date: Sun Jun 3 17:48:04 2012 New Revision: 236518 URL: http://svn.freebsd.org/changeset/base/236518 Log: MFC: r233666 Fix build after changes to trap headers. Modified: stable/9/sys/boot/powerpc/ps3/start.S Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/boot/powerpc/ps3/start.S ============================================================================== --- stable/9/sys/boot/powerpc/ps3/start.S Sun Jun 3 16:19:37 2012 (r236517) +++ stable/9/sys/boot/powerpc/ps3/start.S Sun Jun 3 17:48:04 2012 (r236518) @@ -25,6 +25,8 @@ * $FreeBSD$ */ +#define LOCORE + #include /* From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 17:51:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 096B21065672; Sun, 3 Jun 2012 17:51:54 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8FA58FC15; Sun, 3 Jun 2012 17:51:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q53HprFb075521; Sun, 3 Jun 2012 17:51:53 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q53HprHg075520; Sun, 3 Jun 2012 17:51:53 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201206031751.q53HprHg075520@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 3 Jun 2012 17:51:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236519 - stable/9/sys/modules/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 17:51:54 -0000 Author: luigi Date: Sun Jun 3 17:51:53 2012 New Revision: 236519 URL: http://svn.freebsd.org/changeset/base/236519 Log: MFC: let netmap build as a module (but do not connect to the main build yet) Added: stable/9/sys/modules/netmap/ stable/9/sys/modules/netmap/Makefile (contents, props changed) Added: stable/9/sys/modules/netmap/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/modules/netmap/Makefile Sun Jun 3 17:51:53 2012 (r236519) @@ -0,0 +1,14 @@ +# $FreeBSD$ +# +# Compile netmap as a module, useful if you want a netmap bridge +# or loadable drivers. + +.PATH: ${.CURDIR}/../../dev/netmap +.PATH.h: ${.CURDIR}/../../net +KMOD = netmap +SRCS = device_if.h bus_if.h opt_netmap.h +SRCS += netmap.c netmap.h netmap_kern.h + +netmap.o: netmap_mem2.c + +.include From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 18:00:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A1805106564A; Sun, 3 Jun 2012 18:00:39 +0000 (UTC) (envelope-from rea@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BA0E8FC0C; Sun, 3 Jun 2012 18:00:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q53I0dsm075988; Sun, 3 Jun 2012 18:00:39 GMT (envelope-from rea@svn.freebsd.org) Received: (from rea@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q53I0dUD075982; Sun, 3 Jun 2012 18:00:39 GMT (envelope-from rea@svn.freebsd.org) Message-Id: <201206031800.q53I0dUD075982@svn.freebsd.org> From: Eygene Ryabinkin Date: Sun, 3 Jun 2012 18:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236520 - stable/9/crypto/openssh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 18:00:39 -0000 Author: rea (ports committer) Date: Sun Jun 3 18:00:38 2012 New Revision: 236520 URL: http://svn.freebsd.org/changeset/base/236520 Log: OpenSSH: allow VersionAddendum to be used again Prior to this, setting VersionAddendum will be a no-op: one will always have BASE_VERSION + " " + VERSION_HPN for VersionAddendum set in the config and a bare BASE_VERSION + VERSION_HPN when there is no VersionAddendum is set. HPN patch requires both parties to have the "hpn" inside their advertized versions, so we add VERSION_HPN to the VERSION_BASE if HPN is enabled and omitting it if HPN is disabled. VersionAddendum now uses the following logics: * unset (default value): append " " and VERSION_ADDENDUM; * VersionAddendum is set and isn't empty: append " " and VersionAddendum; * VersionAddendum is set and empty: don't append anything. Approved by: des Reviewed by: bz Modified: stable/9/crypto/openssh/ssh.c stable/9/crypto/openssh/sshconnect.c stable/9/crypto/openssh/sshd.c stable/9/crypto/openssh/version.c stable/9/crypto/openssh/version.h Directory Properties: stable/9/crypto/openssh/ (props changed) Modified: stable/9/crypto/openssh/ssh.c ============================================================================== --- stable/9/crypto/openssh/ssh.c Sun Jun 3 17:51:53 2012 (r236519) +++ stable/9/crypto/openssh/ssh.c Sun Jun 3 18:00:38 2012 (r236520) @@ -405,7 +405,8 @@ main(int ac, char **av) /* FALLTHROUGH */ case 'V': fprintf(stderr, "%s, %s\n", - SSH_RELEASE, SSLeay_version(SSLEAY_VERSION)); + ssh_version_get(options.hpn_disabled), + SSLeay_version(SSLEAY_VERSION)); if (opt == 'V') exit(0); break; Modified: stable/9/crypto/openssh/sshconnect.c ============================================================================== --- stable/9/crypto/openssh/sshconnect.c Sun Jun 3 17:51:53 2012 (r236519) +++ stable/9/crypto/openssh/sshconnect.c Sun Jun 3 18:00:38 2012 (r236520) @@ -585,7 +585,7 @@ ssh_exchange_identification(int timeout_ snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s%s", compat20 ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1, compat20 ? PROTOCOL_MINOR_2 : minor1, - SSH_RELEASE, compat20 ? "\r\n" : "\n"); + ssh_version_get(options.hpn_disabled), compat20 ? "\r\n" : "\n"); if (roaming_atomicio(vwrite, connection_out, buf, strlen(buf)) != strlen(buf)) fatal("write: %.100s", strerror(errno)); Modified: stable/9/crypto/openssh/sshd.c ============================================================================== --- stable/9/crypto/openssh/sshd.c Sun Jun 3 17:51:53 2012 (r236519) +++ stable/9/crypto/openssh/sshd.c Sun Jun 3 18:00:38 2012 (r236520) @@ -430,7 +430,7 @@ sshd_exchange_identification(int sock_in minor = PROTOCOL_MINOR_1; } snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s%s", major, minor, - SSH_RELEASE, newline); + ssh_version_get(options.hpn_disabled), newline); server_version_string = xstrdup(buf); /* Send our protocol version identification. */ @@ -871,7 +871,7 @@ static void usage(void) { fprintf(stderr, "%s, %s\n", - SSH_RELEASE, SSLeay_version(SSLEAY_VERSION)); + ssh_version_get(0), SSLeay_version(SSLEAY_VERSION)); fprintf(stderr, "usage: sshd [-46DdeiqTt] [-b bits] [-C connection_spec] [-c host_cert_file]\n" " [-f config_file] [-g login_grace_time] [-h host_key_file]\n" @@ -1561,7 +1561,7 @@ main(int ac, char **av) exit(1); } - debug("sshd version %.100s", SSH_RELEASE); + debug("sshd version %.100s", ssh_version_get(options.hpn_disabled)); /* Store privilege separation user for later use if required. */ if ((privsep_pw = getpwnam(SSH_PRIVSEP_USER)) == NULL) { Modified: stable/9/crypto/openssh/version.c ============================================================================== --- stable/9/crypto/openssh/version.c Sun Jun 3 17:51:53 2012 (r236519) +++ stable/9/crypto/openssh/version.c Sun Jun 3 18:00:38 2012 (r236520) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2001 Brian Fundakowski Feldman + * Copyright (c) 2012 Eygene Ryabinkin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,30 +36,60 @@ __RCSID("$FreeBSD$"); static char *version = NULL; +/* NULL means "use default value", empty string means "unset" */ +static const char *addendum = NULL; +static unsigned char update_version = 1; +/* + * Constructs the version string if it is empty or needs updating. + * + * HPN patch we're running requires both parties + * to have the "hpn" string inside the advertized version + * (see compat.c::compat_datafellows), so we should + * include it to the generated string if HPN is enabled. + */ const char * -ssh_version_get(void) { +ssh_version_get(int hpn_disabled) +{ + const char *hpn = NULL, *add = NULL; + char *newvers = NULL; + size_t size = 0; + + if (version != NULL && !update_version) + return (version); + + hpn = (hpn_disabled ? NULL : SSH_VERSION_HPN); + add = (addendum == NULL ? SSH_VERSION_ADDENDUM : + (addendum[0] == '\0' ? NULL : addendum)); + + size = strlen(SSH_VERSION_BASE) + (hpn ? strlen(hpn) : 0) + + (add ? strlen(add) + 1 : 0) + 1; + newvers = xmalloc(size); + strcpy(newvers, SSH_VERSION_BASE); + if (hpn) + strcat(newvers, hpn); + if (add) { + strcat(newvers, " "); + strcat(newvers, add); + } + + if (version) + xfree(version); + version = newvers; + update_version = 0; - if (version == NULL) - version = xstrdup(SSH_VERSION); return (version); } void -ssh_version_set_addendum(const char *add) { - char *newvers; - size_t size; - - if (add != NULL) { - size = strlen(SSH_VERSION_BASE) + strlen(SSH_VERSION_HPN) + 1 + - strlen(add) + 1; - newvers = xmalloc(size); - snprintf(newvers, size, "%s %s", SSH_VERSION_BASE, - SSH_VERSION_HPN, add); - } else { - newvers = xstrdup(SSH_VERSION_BASE SSH_VERSION_HPN); - } - if (version != NULL) - xfree(version); - version = newvers; +ssh_version_set_addendum(const char *add) +{ + if (add && addendum && !strcmp(add, addendum)) + return; + + if (addendum) + xfree((void *)addendum); + addendum = (add ? xstrdup(add) : xstrdup("")); + + update_version = 1; } Modified: stable/9/crypto/openssh/version.h ============================================================================== --- stable/9/crypto/openssh/version.h Sun Jun 3 17:51:53 2012 (r236519) +++ stable/9/crypto/openssh/version.h Sun Jun 3 18:00:38 2012 (r236520) @@ -1,14 +1,14 @@ /* $OpenBSD: version.h,v 1.61 2011/02/04 00:44:43 djm Exp $ */ /* $FreeBSD$ */ -#ifndef SSH_VERSION +#ifndef _VERSION_H_ +#define _VERSION_H_ + #define SSH_VERSION_BASE "OpenSSH_5.8p2" #define SSH_VERSION_ADDENDUM "FreeBSD-20110503" #define SSH_VERSION_HPN "_hpn13v11" -#define SSH_VERSION SSH_VERSION_BASE SSH_VERSION_HPN " " SSH_VERSION_ADDENDUM -#define SSH_RELEASE (ssh_version_get()) -const char *ssh_version_get(void); +const char *ssh_version_get(int hpn_disabled); void ssh_version_set_addendum(const char *); -#endif /* SSH_VERSION */ +#endif /* _VERSION_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 18:05:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 556F4106566B; Sun, 3 Jun 2012 18:05:20 +0000 (UTC) (envelope-from rea@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EF598FC0C; Sun, 3 Jun 2012 18:05:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q53I5JKH076241; Sun, 3 Jun 2012 18:05:19 GMT (envelope-from rea@svn.freebsd.org) Received: (from rea@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q53I5Jaq076235; Sun, 3 Jun 2012 18:05:19 GMT (envelope-from rea@svn.freebsd.org) Message-Id: <201206031805.q53I5Jaq076235@svn.freebsd.org> From: Eygene Ryabinkin Date: Sun, 3 Jun 2012 18:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236521 - stable/8/crypto/openssh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 18:05:20 -0000 Author: rea (ports committer) Date: Sun Jun 3 18:05:19 2012 New Revision: 236521 URL: http://svn.freebsd.org/changeset/base/236521 Log: OpenSSH: allow VersionAddendum to be used again Prior to this, setting VersionAddendum will be a no-op: one will always have BASE_VERSION + " " + VERSION_HPN for VersionAddendum set in the config and a bare BASE_VERSION + VERSION_HPN when there is no VersionAddendum is set. HPN patch requires both parties to have the "hpn" inside their advertized versions, so we add VERSION_HPN to the VERSION_BASE if HPN is enabled and omitting it if HPN is disabled. VersionAddendum now uses the following logics: * unset (default value): append " " and VERSION_ADDENDUM; * VersionAddendum is set and isn't empty: append " " and VersionAddendum; * VersionAddendum is set and empty: don't append anything. Approved by: des Reviewed by: bz Modified: stable/8/crypto/openssh/ssh.c stable/8/crypto/openssh/sshconnect.c stable/8/crypto/openssh/sshd.c stable/8/crypto/openssh/version.c stable/8/crypto/openssh/version.h Directory Properties: stable/8/crypto/openssh/ (props changed) Modified: stable/8/crypto/openssh/ssh.c ============================================================================== --- stable/8/crypto/openssh/ssh.c Sun Jun 3 18:00:38 2012 (r236520) +++ stable/8/crypto/openssh/ssh.c Sun Jun 3 18:05:19 2012 (r236521) @@ -388,7 +388,8 @@ main(int ac, char **av) /* FALLTHROUGH */ case 'V': fprintf(stderr, "%s, %s\n", - SSH_RELEASE, SSLeay_version(SSLEAY_VERSION)); + ssh_version_get(options.hpn_disabled), + SSLeay_version(SSLEAY_VERSION)); if (opt == 'V') exit(0); break; Modified: stable/8/crypto/openssh/sshconnect.c ============================================================================== --- stable/8/crypto/openssh/sshconnect.c Sun Jun 3 18:00:38 2012 (r236520) +++ stable/8/crypto/openssh/sshconnect.c Sun Jun 3 18:05:19 2012 (r236521) @@ -571,7 +571,7 @@ ssh_exchange_identification(int timeout_ snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s%s", compat20 ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1, compat20 ? PROTOCOL_MINOR_2 : minor1, - SSH_RELEASE, compat20 ? "\r\n" : "\n"); + ssh_version_get(options.hpn_disabled), compat20 ? "\r\n" : "\n"); if (roaming_atomicio(vwrite, connection_out, buf, strlen(buf)) != strlen(buf)) fatal("write: %.100s", strerror(errno)); Modified: stable/8/crypto/openssh/sshd.c ============================================================================== --- stable/8/crypto/openssh/sshd.c Sun Jun 3 18:00:38 2012 (r236520) +++ stable/8/crypto/openssh/sshd.c Sun Jun 3 18:05:19 2012 (r236521) @@ -431,7 +431,7 @@ sshd_exchange_identification(int sock_in minor = PROTOCOL_MINOR_1; } snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s%s", major, minor, - SSH_RELEASE, newline); + ssh_version_get(options.hpn_disabled), newline); server_version_string = xstrdup(buf); /* Send our protocol version identification. */ @@ -860,7 +860,7 @@ static void usage(void) { fprintf(stderr, "%s, %s\n", - SSH_RELEASE, SSLeay_version(SSLEAY_VERSION)); + ssh_version_get(0), SSLeay_version(SSLEAY_VERSION)); fprintf(stderr, "usage: sshd [-46DdeiqTt] [-b bits] [-C connection_spec] [-c host_cert_file]\n" " [-f config_file] [-g login_grace_time] [-h host_key_file]\n" @@ -1550,7 +1550,7 @@ main(int ac, char **av) exit(1); } - debug("sshd version %.100s", SSH_RELEASE); + debug("sshd version %.100s", ssh_version_get(options.hpn_disabled)); /* Store privilege separation user for later use if required. */ if ((privsep_pw = getpwnam(SSH_PRIVSEP_USER)) == NULL) { Modified: stable/8/crypto/openssh/version.c ============================================================================== --- stable/8/crypto/openssh/version.c Sun Jun 3 18:00:38 2012 (r236520) +++ stable/8/crypto/openssh/version.c Sun Jun 3 18:05:19 2012 (r236521) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2001 Brian Fundakowski Feldman + * Copyright (c) 2012 Eygene Ryabinkin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,30 +36,60 @@ __RCSID("$FreeBSD$"); static char *version = NULL; +/* NULL means "use default value", empty string means "unset" */ +static const char *addendum = NULL; +static unsigned char update_version = 1; +/* + * Constructs the version string if it is empty or needs updating. + * + * HPN patch we're running requires both parties + * to have the "hpn" string inside the advertized version + * (see compat.c::compat_datafellows), so we should + * include it to the generated string if HPN is enabled. + */ const char * -ssh_version_get(void) { +ssh_version_get(int hpn_disabled) +{ + const char *hpn = NULL, *add = NULL; + char *newvers = NULL; + size_t size = 0; + + if (version != NULL && !update_version) + return (version); + + hpn = (hpn_disabled ? NULL : SSH_VERSION_HPN); + add = (addendum == NULL ? SSH_VERSION_ADDENDUM : + (addendum[0] == '\0' ? NULL : addendum)); + + size = strlen(SSH_VERSION_BASE) + (hpn ? strlen(hpn) : 0) + + (add ? strlen(add) + 1 : 0) + 1; + newvers = xmalloc(size); + strcpy(newvers, SSH_VERSION_BASE); + if (hpn) + strcat(newvers, hpn); + if (add) { + strcat(newvers, " "); + strcat(newvers, add); + } + + if (version) + xfree(version); + version = newvers; + update_version = 0; - if (version == NULL) - version = xstrdup(SSH_VERSION); return (version); } void -ssh_version_set_addendum(const char *add) { - char *newvers; - size_t size; - - if (add != NULL) { - size = strlen(SSH_VERSION_BASE) + strlen(SSH_VERSION_HPN) + 1 + - strlen(add) + 1; - newvers = xmalloc(size); - snprintf(newvers, size, "%s %s", SSH_VERSION_BASE, - SSH_VERSION_HPN, add); - } else { - newvers = xstrdup(SSH_VERSION_BASE SSH_VERSION_HPN); - } - if (version != NULL) - xfree(version); - version = newvers; +ssh_version_set_addendum(const char *add) +{ + if (add && addendum && !strcmp(add, addendum)) + return; + + if (addendum) + xfree((void *)addendum); + addendum = (add ? xstrdup(add) : xstrdup("")); + + update_version = 1; } Modified: stable/8/crypto/openssh/version.h ============================================================================== --- stable/8/crypto/openssh/version.h Sun Jun 3 18:00:38 2012 (r236520) +++ stable/8/crypto/openssh/version.h Sun Jun 3 18:05:19 2012 (r236521) @@ -1,14 +1,13 @@ /* $OpenBSD: version.h,v 1.57 2010/03/07 22:01:32 djm Exp $ */ /* $FreeBSD$ */ -#ifndef SSH_VERSION +#ifndef _VERSION_H_ +#define _VERSION_H_ #define SSH_VERSION_BASE "OpenSSH_5.4p1" #define SSH_VERSION_ADDENDUM "FreeBSD-20100308" #define SSH_VERSION_HPN "_hpn13v11" -#define SSH_VERSION SSH_VERSION_BASE SSH_VERSION_HPN " " SSH_VERSION_ADDENDUM -#define SSH_RELEASE (ssh_version_get()) -const char *ssh_version_get(void); +const char *ssh_version_get(int hpn_disabled); void ssh_version_set_addendum(const char *); -#endif /* SSH_VERSION */ +#endif /* _VERSION_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 18:14:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9615D1065670; Sun, 3 Jun 2012 18:14:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80E648FC14; Sun, 3 Jun 2012 18:14:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q53IEwVV076696; Sun, 3 Jun 2012 18:14:58 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q53IEwGK076694; Sun, 3 Jun 2012 18:14:58 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201206031814.q53IEwGK076694@svn.freebsd.org> From: Michael Tuexen Date: Sun, 3 Jun 2012 18:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236522 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 18:14:58 -0000 Author: tuexen Date: Sun Jun 3 18:14:57 2012 New Revision: 236522 URL: http://svn.freebsd.org/changeset/base/236522 Log: Remove code which is not needed. MFC after: 3 days Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun Jun 3 18:05:19 2012 (r236521) +++ head/sys/netinet/sctp_pcb.c Sun Jun 3 18:14:57 2012 (r236522) @@ -2187,8 +2187,6 @@ sctp_findassociation_addr(struct mbuf *m from6->sin6_addr = ip6->ip6_src; from6->sin6_port = sh->src_port; /* Get the scopes in properly to the sin6 addr's */ - /* we probably don't need these operations */ - (void)sa6_recoverscope(from6); sa6_embedscope(from6, MODULE_GLOBAL(ip6_use_defzone)); break; } @@ -2230,8 +2228,6 @@ sctp_findassociation_addr(struct mbuf *m to6->sin6_addr = ip6->ip6_dst; to6->sin6_port = sh->dest_port; /* Get the scopes in properly to the sin6 addr's */ - /* we probably don't need these operations */ - (void)sa6_recoverscope(to6); sa6_embedscope(to6, MODULE_GLOBAL(ip6_use_defzone)); break; } From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 18:16:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF896106566B; Sun, 3 Jun 2012 18:16:17 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C81F88FC1B; Sun, 3 Jun 2012 18:16:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q53IGHWB076808; Sun, 3 Jun 2012 18:16:17 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q53IGH7O076805; Sun, 3 Jun 2012 18:16:17 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201206031816.q53IGH7O076805@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 3 Jun 2012 18:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236523 - in stable/9: libexec/rtld-elf share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 18:16:18 -0000 Author: bapt Date: Sun Jun 3 18:16:17 2012 New Revision: 236523 URL: http://svn.freebsd.org/changeset/base/236523 Log: MFC: 234851, 235059 Add two special directives to libmap.conf: include : Parse the contents of file before continuing with the current file. includedir : Parse the contents of every file in dir that ends in .conf before continuing with the current file. Any file or directory encountered while processing include or includedir directives will be parsed exactly once, even if it is encountered multiple times. Approved by: des (mentor) Modified: stable/9/libexec/rtld-elf/libmap.c stable/9/share/man/man5/libmap.conf.5 Directory Properties: stable/9/libexec/rtld-elf/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man5/ (props changed) Modified: stable/9/libexec/rtld-elf/libmap.c ============================================================================== --- stable/9/libexec/rtld-elf/libmap.c Sun Jun 3 18:14:57 2012 (r236522) +++ stable/9/libexec/rtld-elf/libmap.c Sun Jun 3 18:16:17 2012 (r236523) @@ -2,11 +2,13 @@ * $FreeBSD$ */ +#include #include #include #include #include #include +#include #include #include #include @@ -39,9 +41,17 @@ struct lmp { TAILQ_ENTRY(lmp) lmp_link; }; +static TAILQ_HEAD(lmc_list, lmc) lmc_head = TAILQ_HEAD_INITIALIZER(lmc_head); +struct lmc { + char *path; + TAILQ_ENTRY(lmc) next; +}; + static int lm_count; static void lmc_parse(char *, size_t); +static void lmc_parse_file(char *); +static void lmc_parse_dir(char *); static void lm_add(const char *, const char *, const char *); static void lm_free(struct lm_list *); static char *lml_find(struct lm_list *, const char *); @@ -61,37 +71,13 @@ static const char *quickbasename(const c int lm_init(char *libmap_override) { - struct stat st; - char *lm_map, *p; - int fd; + char *p; dbg("lm_init(\"%s\")", libmap_override); TAILQ_INIT(&lmp_head); - fd = open(_PATH_LIBMAP_CONF, O_RDONLY); - if (fd == -1) { - dbg("lm_init: open(\"%s\") failed, %s", _PATH_LIBMAP_CONF, - rtld_strerror(errno)); - goto override; - } - if (fstat(fd, &st) == -1) { - close(fd); - dbg("lm_init: fstat(\"%s\") failed, %s", _PATH_LIBMAP_CONF, - rtld_strerror(errno)); - goto override; - } - lm_map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); - if (lm_map == (const char *)MAP_FAILED) { - close(fd); - dbg("lm_init: mmap(\"%s\") failed, %s", _PATH_LIBMAP_CONF, - rtld_strerror(errno)); - goto override; - } - close(fd); - lmc_parse(lm_map, st.st_size); - munmap(lm_map, st.st_size); + lmc_parse_file(_PATH_LIBMAP_CONF); -override: if (libmap_override) { /* * Do some character replacement to make $LIBMAP look @@ -116,14 +102,116 @@ override: } static void +lmc_parse_file(char *path) +{ + struct lmc *p; + struct stat st; + int fd; + char *rpath; + char *lm_map; + + rpath = realpath(path, NULL); + if (rpath == NULL) + return; + + TAILQ_FOREACH(p, &lmc_head, next) { + if (strcmp(p->path, rpath) == 0) { + free(rpath); + return; + } + } + + fd = open(rpath, O_RDONLY); + if (fd == -1) { + dbg("lm_parse_file: open(\"%s\") failed, %s", rpath, + rtld_strerror(errno)); + free(rpath); + return; + } + if (fstat(fd, &st) == -1) { + close(fd); + dbg("lm_parse_file: fstat(\"%s\") failed, %s", rpath, + rtld_strerror(errno)); + free(rpath); + return; + } + lm_map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); + if (lm_map == (const char *)MAP_FAILED) { + close(fd); + dbg("lm_parse_file: mmap(\"%s\") failed, %s", rpath, + rtld_strerror(errno)); + free(rpath); + return; + } + close(fd); + p = xmalloc(sizeof(struct lmc)); + p->path = rpath; + TAILQ_INSERT_HEAD(&lmc_head, p, next); + lmc_parse(lm_map, st.st_size); + munmap(lm_map, st.st_size); +} + +static void +lmc_parse_dir(char *idir) +{ + DIR *d; + struct dirent *dp; + struct lmc *p; + char conffile[MAXPATHLEN]; + char *ext; + char *rpath; + + rpath = realpath(idir, NULL); + if (rpath == NULL) + return; + + TAILQ_FOREACH(p, &lmc_head, next) { + if (strcmp(p->path, rpath) == 0) { + free(rpath); + return; + } + } + d = opendir(idir); + if (d == NULL) { + free(rpath); + return; + } + + p = xmalloc(sizeof(struct lmc)); + p->path = rpath; + TAILQ_INSERT_HEAD(&lmc_head, p, next); + + while ((dp = readdir(d)) != NULL) { + if (dp->d_ino == 0) + continue; + if (dp->d_type != DT_REG) + continue; + ext = strrchr(dp->d_name, '.'); + if (ext == NULL) + continue; + if (strcmp(ext, ".conf") != 0) + continue; + if (strlcpy(conffile, idir, MAXPATHLEN) >= MAXPATHLEN) + continue; /* too long */ + if (strlcat(conffile, "/", MAXPATHLEN) >= MAXPATHLEN) + continue; /* too long */ + if (strlcat(conffile, dp->d_name, MAXPATHLEN) >= MAXPATHLEN) + continue; /* too long */ + lmc_parse_file(conffile); + } + closedir(d); +} + +static void lmc_parse(char *lm_p, size_t lm_len) { char *cp, *f, *t, *c, *p; char prog[MAXPATHLEN]; - char line[MAXPATHLEN + 2]; + /* allow includedir + full length path */ + char line[MAXPATHLEN + 13]; size_t cnt; int i; - + cnt = 0; p = NULL; while (cnt < lm_len) { @@ -181,7 +269,8 @@ lmc_parse(char *lm_p, size_t lm_len) while(rtld_isspace(*cp)) cp++; if (!iseol(*cp)) continue; - strcpy(prog, c); + if (strlcpy(prog, c, sizeof prog) >= sizeof prog) + continue; p = prog; continue; } @@ -207,7 +296,12 @@ lmc_parse(char *lm_p, size_t lm_len) if (!iseol(*cp)) continue; *cp = '\0'; - lm_add(p, f, t); + if (strcmp(f, "includedir") == 0) + lmc_parse_dir(t); + else if (strcmp(f, "include") == 0) + lmc_parse_file(t); + else + lm_add(p, f, t); } } @@ -232,9 +326,17 @@ void lm_fini (void) { struct lmp *lmp; + struct lmc *p; dbg("%s()", __func__); + while (!TAILQ_EMPTY(&lmc_head)) { + p = TAILQ_FIRST(&lmc_head); + TAILQ_REMOVE(&lmc_head, p, next); + free(p->path); + free(p); + } + while (!TAILQ_EMPTY(&lmp_head)) { lmp = TAILQ_FIRST(&lmp_head); TAILQ_REMOVE(&lmp_head, lmp, lmp_link); Modified: stable/9/share/man/man5/libmap.conf.5 ============================================================================== --- stable/9/share/man/man5/libmap.conf.5 Sun Jun 3 18:14:57 2012 (r236522) +++ stable/9/share/man/man5/libmap.conf.5 Sun Jun 3 18:16:17 2012 (r236523) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 31, 2004 +.Dd April 28, 2012 .Dt LIBMAP.CONF 5 .Os .Sh NAME @@ -43,6 +43,27 @@ left hand side containing the mapping ca side containing the mapping. Dependencies are matched against candidates and replaced with the mappings. .Pp +Two special directives are available: +.Bl -tag -width indent +.It Cm include Ar file +Parse the contents of +.Ar file +before continuing with the current file. +.It Cm includedir Ar dir +Parse the contents of every file in +.Ar dir +that ends in +.Pa .conf +before continuing with the current file. +.El +.Pp +Any file or directory encountered while processing +.Cm include +or +.Cm includedir +directives will be parsed exactly once, even if it is encountered +multiple times. +.Pp Constrained mappings may be specified by enclosing the name of the executable or library in brackets. All mappings following a constraint will only be evaluated for that constraint. From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 18:34:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6661C106566B; Sun, 3 Jun 2012 18:34:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F5618FC12; Sun, 3 Jun 2012 18:34:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q53IYXpZ077646; Sun, 3 Jun 2012 18:34:33 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q53IYWGB077633; Sun, 3 Jun 2012 18:34:32 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201206031834.q53IYWGB077633@svn.freebsd.org> From: Warner Losh Date: Sun, 3 Jun 2012 18:34:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236524 - in head/sys/arm: arm at91 econa include mv s3c2xx0 sa11x0 xscale/i80321 xscale/i8134x xscale/ixp425 xscale/pxa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 18:34:33 -0000 Author: imp Date: Sun Jun 3 18:34:32 2012 New Revision: 236524 URL: http://svn.freebsd.org/changeset/base/236524 Log: Minor rearrangement of the locore <-> initarm interface. Pass in a structure with the first 4 registers to allow a wider range of boot loaders to work. Future commits will make use of this to centralize support for the different loaders. Modified: head/sys/arm/arm/locore.S head/sys/arm/at91/at91_machdep.c head/sys/arm/econa/econa_machdep.c head/sys/arm/include/cpu.h head/sys/arm/mv/mv_machdep.c head/sys/arm/s3c2xx0/s3c24x0_machdep.c head/sys/arm/sa11x0/assabet_machdep.c head/sys/arm/xscale/i80321/ep80219_machdep.c head/sys/arm/xscale/i80321/iq31244_machdep.c head/sys/arm/xscale/i8134x/crb_machdep.c head/sys/arm/xscale/ixp425/avila_machdep.c head/sys/arm/xscale/pxa/pxa_machdep.c Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Sun Jun 3 18:16:17 2012 (r236523) +++ head/sys/arm/arm/locore.S Sun Jun 3 18:34:32 2012 (r236524) @@ -37,6 +37,7 @@ #include #include #include + __FBSDID("$FreeBSD$"); /* What size should this really be ? It is only used by initarm() */ @@ -61,22 +62,25 @@ __FBSDID("$FreeBSD$"); .globl physaddr .set physaddr,PHYSADDR -ENTRY_NP(btext) - /* - * On entry: - * r0 - metadata pointer or 0 + * On entry for FreeBSD boot ABI: + * r0 - metadata pointer or 0 (boothowto on AT91's boot2) * r1 - if (r0 == 0) then metadata pointer + * On entry for Linux boot ABI: + * r0 - 0 + * r1 - machine type (passed as arg2 to initarm) + * r2 - Pointer to a tagged list or dtb image (phys addr) (passed as arg1 initarm) + * + * For both types of boot we gather up the args, put them in a struct arm_boot_params + * structure and pass that to initarm. */ +ENTRY_NP(btext) ASENTRY_NP(_start) + mov r9, r0 /* 0 or boot mode from boot2 */ + mov r8, r1 /* Save Machine type */ + mov ip, r2 /* Save meta data */ + mov fp, r3 /* Future expantion */ - /* Move metadata ptr to r12 (ip) */ - mov ip, r0 - ldr r0, =0 - cmp ip, r0 - bne 1f - mov ip, r1 -1: /* Make sure interrupts are disabled. */ mrs r7, cpsr orr r7, r7, #(I32_bit|F32_bit) @@ -91,25 +95,25 @@ ASENTRY_NP(_start) */ mrc p15, 0, r2, c1, c0, 0 ands r2, r2, #CPU_CONTROL_MMU_ENABLE - ldreq r8, =PHYSADDR - ldrne r8, =LOADERRAMADDR - cmp r7, r8 + ldreq r6, =PHYSADDR + ldrne r6, =LOADERRAMADDR + cmp r7, r6 bls flash_lower cmp r7, pc bhi from_ram b do_copy flash_lower: - cmp r8, pc + cmp r6, pc bls from_ram do_copy: - ldr r9, =KERNBASE + ldr r7, =KERNBASE adr r1, _start ldr r0, Lreal_start ldr r2, Lend sub r2, r2, r0 - sub r0, r0, r9 - add r0, r0, r8 + sub r0, r0, r7 + add r0, r0, r6 mov r4, r0 bl memcpy ldr r0, Lram_offset @@ -186,8 +190,14 @@ mmu_done: ldr pc, .Lvirt_done virt_done: - mov r0, ip /* Load argument: metadata ptr */ - + mov r1, #20 /* loader info size is 20 bytes also second arg */ + subs sp, sp, r1 /* allocate arm_boot_params struct on stack */ + mov r0, sp /* loader info pointer is first arg */ + str r1, [r0] /* Store length of loader info */ + str r9, [r0, #4] /* Store r0 from boot loader */ + str r8, [r0, #8] /* Store r1 from boot loader */ + str ip, [r0, #12] /* store r2 from boot loader */ + str fp, [r0, #16] /* store r3 from boot loader */ mov fp, #0 /* trace back starts here */ bl _C_LABEL(initarm) /* Off we go */ Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Sun Jun 3 18:16:17 2012 (r236523) +++ head/sys/arm/at91/at91_machdep.c Sun Jun 3 18:34:32 2012 (r236524) @@ -132,9 +132,6 @@ struct pv_addr undstack; struct pv_addr abtstack; struct pv_addr kernelstack; -static void *boot_arg1; -static void *boot_arg2; - static struct trapframe proc0_tf; /* Static device mappings. */ @@ -236,7 +233,7 @@ at91_ramsize(void) } void * -initarm(void *arg, void *arg2) +initarm(struct arm_boot_params *abp) { struct pv_addr kernel_l1pt; struct pv_addr dpcpu; @@ -247,8 +244,6 @@ initarm(void *arg, void *arg2) uint32_t memsize; vm_offset_t lastaddr; - boot_arg1 = arg; - boot_arg2 = arg2; set_cpufuncs(); lastaddr = fake_preload_metadata(); pcpu_init(pcpup, 0, sizeof(struct pcpu)); Modified: head/sys/arm/econa/econa_machdep.c ============================================================================== --- head/sys/arm/econa/econa_machdep.c Sun Jun 3 18:16:17 2012 (r236523) +++ head/sys/arm/econa/econa_machdep.c Sun Jun 3 18:34:32 2012 (r236524) @@ -123,9 +123,6 @@ struct pv_addr undstack; struct pv_addr abtstack; struct pv_addr kernelstack; -static void *boot_arg1; -static void *boot_arg2; - static struct trapframe proc0_tf; /* Static device mappings. */ @@ -186,7 +183,7 @@ static const struct pmap_devmap econa_de void * -initarm(void *arg, void *arg2) +initarm(struct arm_boot_params *abp) { struct pv_addr kernel_l1pt; volatile uint32_t * ddr = (uint32_t *)0x4000000C; @@ -198,9 +195,6 @@ initarm(void *arg, void *arg2) uint32_t memsize; int mem_info; - - boot_arg1 = arg; - boot_arg2 = arg2; boothowto = RB_VERBOSE; set_cpufuncs(); Modified: head/sys/arm/include/cpu.h ============================================================================== --- head/sys/arm/include/cpu.h Sun Jun 3 18:16:17 2012 (r236523) +++ head/sys/arm/include/cpu.h Sun Jun 3 18:34:32 2012 (r236524) @@ -6,8 +6,8 @@ #include -void cpu_halt(void); -void swi_vm(void *); +void cpu_halt(void); +void swi_vm(void *); #ifdef _KERNEL static __inline uint64_t @@ -25,8 +25,8 @@ get_cyclecount(void) #define TRAPF_PC(tfp) ((tfp)->tf_pc) -#define cpu_getstack(td) ((td)->td_frame->tf_usr_sp) -#define cpu_setstack(td, sp) ((td)->td_frame->tf_usr_sp = (sp)) +#define cpu_getstack(td) ((td)->td_frame->tf_usr_sp) +#define cpu_setstack(td, sp) ((td)->td_frame->tf_usr_sp = (sp)) #define cpu_spinwait() /* nothing */ #define ARM_NVEC 8 @@ -34,12 +34,20 @@ get_cyclecount(void) extern vm_offset_t vector_page; +struct arm_boot_params { + register_t abp_size; /* Size of this structure */ + register_t abp_r0; /* r0 from the boot loader */ + register_t abp_r1; /* r1 from the boot loader */ + register_t abp_r2; /* r2 from the boot loader */ + register_t abp_r3; /* r3 from the boot loader */ +}; + void arm_vector_init(vm_offset_t, int); void fork_trampoline(void); void identify_arm_cpu(void); -void *initarm(void *, void *); +void *initarm(struct arm_boot_params *); extern char btext[]; extern char etext[]; -int badaddr_read (void *, size_t, void *); +int badaddr_read(void *, size_t, void *); #endif /* !MACHINE_CPU_H */ Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Sun Jun 3 18:16:17 2012 (r236523) +++ head/sys/arm/mv/mv_machdep.c Sun Jun 3 18:34:32 2012 (r236524) @@ -306,16 +306,18 @@ physmap_init(void) } void * -initarm(void *mdp, void *unused __unused) +initarm(struct arm_boot_params *abp) { struct pv_addr kernel_l1pt; struct pv_addr dpcpu; vm_offset_t dtbp, freemempos, l2_start, lastaddr; uint32_t memsize, l2size; void *kmdp; + void *mdp; u_int l1pagetable; int i = 0, j = 0, err_devmap = 0; + mdp = (void *)abp->abp_r0; kmdp = NULL; lastaddr = 0; memsize = 0; Modified: head/sys/arm/s3c2xx0/s3c24x0_machdep.c ============================================================================== --- head/sys/arm/s3c2xx0/s3c24x0_machdep.c Sun Jun 3 18:16:17 2012 (r236523) +++ head/sys/arm/s3c2xx0/s3c24x0_machdep.c Sun Jun 3 18:34:32 2012 (r236524) @@ -234,7 +234,7 @@ bus_dma_get_range_nb(void) } void * -initarm(void *arg, void *arg2) +initarm(struct arm_boot_params *abp) { struct pv_addr kernel_l1pt; int loop; Modified: head/sys/arm/sa11x0/assabet_machdep.c ============================================================================== --- head/sys/arm/sa11x0/assabet_machdep.c Sun Jun 3 18:16:17 2012 (r236523) +++ head/sys/arm/sa11x0/assabet_machdep.c Sun Jun 3 18:34:32 2012 (r236524) @@ -201,7 +201,7 @@ cpu_reset() #define CPU_SA110_CACHE_CLEAN_SIZE (0x4000 * 2) void * -initarm(void *arg, void *arg2) +initarm(struct arm_boot_params *abp) { struct pcpu *pc; struct pv_addr kernel_l1pt; Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/ep80219_machdep.c Sun Jun 3 18:16:17 2012 (r236523) +++ head/sys/arm/xscale/i80321/ep80219_machdep.c Sun Jun 3 18:34:32 2012 (r236524) @@ -181,7 +181,7 @@ static const struct pmap_devmap ep80219_ extern vm_offset_t xscale_cache_clean_addr; void * -initarm(void *arg, void *arg2) +initarm(struct arm_boot_params *abp) { struct pv_addr kernel_l1pt; struct pv_addr dpcpu; Modified: head/sys/arm/xscale/i80321/iq31244_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/iq31244_machdep.c Sun Jun 3 18:16:17 2012 (r236523) +++ head/sys/arm/xscale/i80321/iq31244_machdep.c Sun Jun 3 18:34:32 2012 (r236524) @@ -182,7 +182,7 @@ static const struct pmap_devmap iq80321_ extern vm_offset_t xscale_cache_clean_addr; void * -initarm(void *arg, void *arg2) +initarm(struct arm_boot_params *abp) { struct pv_addr kernel_l1pt; struct pv_addr dpcpu; Modified: head/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- head/sys/arm/xscale/i8134x/crb_machdep.c Sun Jun 3 18:16:17 2012 (r236523) +++ head/sys/arm/xscale/i8134x/crb_machdep.c Sun Jun 3 18:34:32 2012 (r236524) @@ -178,7 +178,7 @@ static const struct pmap_devmap iq81342_ extern vm_offset_t xscale_cache_clean_addr; void * -initarm(void *arg, void *arg2) +initarm(struct arm_boot_params *abp) { struct pv_addr kernel_l1pt; struct pv_addr dpcpu; Modified: head/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_machdep.c Sun Jun 3 18:16:17 2012 (r236523) +++ head/sys/arm/xscale/ixp425/avila_machdep.c Sun Jun 3 18:34:32 2012 (r236524) @@ -225,7 +225,7 @@ static const struct pmap_devmap ixp435_d extern vm_offset_t xscale_cache_clean_addr; void * -initarm(void *arg, void *arg2) +initarm(struct arm_boot_params *abp) { #define next_chunk2(a,b) (((a) + (b)) &~ ((b)-1)) #define next_page(a) next_chunk2(a,PAGE_SIZE) Modified: head/sys/arm/xscale/pxa/pxa_machdep.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_machdep.c Sun Jun 3 18:16:17 2012 (r236523) +++ head/sys/arm/xscale/pxa/pxa_machdep.c Sun Jun 3 18:34:32 2012 (r236524) @@ -162,7 +162,7 @@ static const struct pmap_devmap pxa_devm extern vm_offset_t xscale_cache_clean_addr; void * -initarm(void *arg, void *arg2) +initarm(struct arm_boot_params *abp) { struct pv_addr kernel_l1pt; struct pv_addr dpcpu; From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 20:35:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0DD42106566C; Sun, 3 Jun 2012 20:35:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC40A8FC15; Sun, 3 Jun 2012 20:35:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q53KZf4O083121; Sun, 3 Jun 2012 20:35:41 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q53KZfLE083118; Sun, 3 Jun 2012 20:35:41 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201206032035.q53KZfLE083118@svn.freebsd.org> From: Dimitry Andric Date: Sun, 3 Jun 2012 20:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236528 - in head: . share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 20:35:42 -0000 Author: dim Date: Sun Jun 3 20:35:41 2012 New Revision: 236528 URL: http://svn.freebsd.org/changeset/base/236528 Log: During buildworld and buildkernel, define EARLY_BUILD in the earlier stages (build-tools, cross-tools, etc) of the build, so we can detect in bsd.*.mk whether to pass compiler-specific flags to ${CC}. In particular, this commit will allow using WITH_CLANG_IS_CC when the base compiler is still gcc, and when ${CC}, ${CXX} and ${CPP} are left at their defaults. The early stages will then be built using gcc, and no clang-specific flags will be passed to it. The later stages will be built as usual. The EARLY_BUILD define can also serve other uses, such as building the world stage C++ executables with libc++ instead of libstdc++: during the early build stages, we cannot assume libc++ is already available, so we must still build with libstdc++ at that time. MFC after: 1 week Modified: head/Makefile.inc1 head/share/mk/bsd.sys.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Jun 3 20:29:28 2012 (r236527) +++ head/Makefile.inc1 Sun Jun 3 20:35:41 2012 (r236528) @@ -242,7 +242,7 @@ BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ SSP_CFLAGS= \ -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \ -DNO_PIC -DNO_PROFILE -DNO_SHARED \ - -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF + -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD # build-tools stage TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ @@ -252,7 +252,7 @@ TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ BOOTSTRAPPING=${OSRELDATE} \ SSP_CFLAGS= \ -DNO_LINT \ - -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF + -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD # cross-tools stage XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \ @@ -487,7 +487,8 @@ build32: .for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic cd ${.CURDIR}/${_dir}; \ MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \ - DIRPRFX=${_dir}/ build-tools + DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF \ + -DEARLY_BUILD build-tools .endfor cd ${.CURDIR}; \ ${LIB32WMAKE} -f Makefile.inc1 libraries @@ -829,7 +830,7 @@ buildkernel: cd ${KRNLOBJDIR}/${_kernel}; \ PATH=${BPATH}:${PATH} \ MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \ - ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF \ + ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF -DEARLY_BUILD \ -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile # XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case. .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) @@ -837,7 +838,7 @@ buildkernel: cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \ PATH=${BPATH}:${PATH} \ MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \ - ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF ${target} + ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF -DEARLY_BUILD ${target} .endfor .endif .if !defined(NO_KERNELDEPEND) Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Sun Jun 3 20:29:28 2012 (r236527) +++ head/share/mk/bsd.sys.mk Sun Jun 3 20:35:41 2012 (r236528) @@ -61,7 +61,8 @@ CWARNFLAGS+= -Wno-uninitialized CWARNFLAGS+= -Wno-pointer-sign # Clang has more warnings enabled by default, and when using -Wall, so if WARNS # is set to low values, these have to be disabled explicitly. -.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang" +.if (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") && \ + !defined(EARLY_BUILD) .if ${WARNS} <= 6 CWARNFLAGS+= -Wno-empty-body -Wno-string-plus-int .endif # WARNS <= 6 @@ -88,7 +89,8 @@ WFORMAT= 1 .if ${WFORMAT} > 0 #CWARNFLAGS+= -Wformat-nonliteral -Wformat-security -Wno-format-extra-args CWARNFLAGS+= -Wformat=2 -Wno-format-extra-args -.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang" +.if (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") && \ + !defined(EARLY_BUILD) .if ${WARNS} <= 3 CWARNFLAGS+= -Wno-format-nonliteral .endif # WARNS <= 3 @@ -109,7 +111,8 @@ CWARNFLAGS+= -Wno-format CWARNFLAGS+= -Wno-unknown-pragmas .endif # IGNORE_PRAGMA -.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang" +.if (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") && \ + !defined(EARLY_BUILD) CLANG_NO_IAS= -no-integrated-as CLANG_OPT_SMALL= -mstack-alignment=8 -mllvm -inline-threshold=3\ -mllvm -enable-load-pre=false -mllvm -simplifycfg-dup-ret From owner-svn-src-all@FreeBSD.ORG Sun Jun 3 21:03:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44FB0106566C; Sun, 3 Jun 2012 21:03:17 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 305BC8FC19; Sun, 3 Jun 2012 21:03:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q53L3HZv084311; Sun, 3 Jun 2012 21:03:17 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q53L3GwB084309; Sun, 3 Jun 2012 21:03:16 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206032103.q53L3GwB084309@svn.freebsd.org> From: Marius Strobl Date: Sun, 3 Jun 2012 21:03:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236529 - head/sys/dev/flash X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 21:03:17 -0000 Author: marius Date: Sun Jun 3 21:03:16 2012 New Revision: 236529 URL: http://svn.freebsd.org/changeset/base/236529 Log: Disable verification of the flashed content for now; for reasons unknown it sometimes causes physwr to hang. Modified: head/sys/dev/flash/at45d.c Modified: head/sys/dev/flash/at45d.c ============================================================================== --- head/sys/dev/flash/at45d.c Sun Jun 3 20:35:41 2012 (r236528) +++ head/sys/dev/flash/at45d.c Sun Jun 3 21:03:16 2012 (r236529) @@ -390,6 +390,7 @@ at45d_task(void *arg) berr = EIO; goto out; } +#ifdef notyet /* May cause physwr to hang for reasons unknown. */ if (bp->bio_cmd == BIO_WRITE) { addr = page << sc->pageoffset; txBuf[0] = BUFFER_COMPARE; @@ -408,6 +409,7 @@ at45d_task(void *arg) goto out; } } +#endif page++; buf += len; offset = 0; From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 03:51:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 95F64106566C; Mon, 4 Jun 2012 03:51:09 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 805D98FC0C; Mon, 4 Jun 2012 03:51:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q543p9jJ002916; Mon, 4 Jun 2012 03:51:09 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q543p9YX002912; Mon, 4 Jun 2012 03:51:09 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201206040351.q543p9YX002912@svn.freebsd.org> From: Alan Cox Date: Mon, 4 Jun 2012 03:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236534 - in head/sys: amd64/amd64 i386/i386 i386/xen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 03:51:09 -0000 Author: alc Date: Mon Jun 4 03:51:08 2012 New Revision: 236534 URL: http://svn.freebsd.org/changeset/base/236534 Log: Various small changes to PV entry management: Constify pc_freemask[]. pmap_pv_reclaim() Eliminate "freemask" because it was a pessimization. Add a comment about the resident count adjustment. free_pv_entry() [i386 only] Merge an optimization from amd64 (r233954). get_pv_entry() Eliminate the move to tail of the pv_chunk on the global pv_chunks list. (The right strategy needs more thought. Moreover, there were unintended differences between the amd64 and i386 implementation.) pmap_remove_pages() Eliminate unnecessary ()'s. Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Jun 4 02:25:11 2012 (r236533) +++ head/sys/amd64/amd64/pmap.c Mon Jun 4 03:51:08 2012 (r236534) @@ -2021,7 +2021,7 @@ pv_to_chunk(pv_entry_t pv) #define PC_FREE1 0xfffffffffffffffful #define PC_FREE2 0x000000fffffffffful -static uint64_t pc_freemask[_NPCM] = { PC_FREE0, PC_FREE1, PC_FREE2 }; +static const uint64_t pc_freemask[_NPCM] = { PC_FREE0, PC_FREE1, PC_FREE2 }; SYSCTL_LONG(_vm_pmap, OID_AUTO, pv_entry_count, CTLFLAG_RD, &pv_entry_count, 0, "Current number of pv entries"); @@ -2070,7 +2070,7 @@ pmap_pv_reclaim(pmap_t locked_pmap) pv_entry_t pv; vm_offset_t va; vm_page_t free, m, m_pc; - uint64_t inuse, freemask; + uint64_t inuse; int bit, field, freed; rw_assert(&pvh_global_lock, RA_WLOCKED); @@ -2102,7 +2102,6 @@ pmap_pv_reclaim(pmap_t locked_pmap) */ freed = 0; for (field = 0; field < _NPCM; field++) { - freemask = 0; for (inuse = ~pc->pc_map[field] & pc_freemask[field]; inuse != 0; inuse &= ~(1UL << bit)) { bit = bsfq(inuse); @@ -2131,16 +2130,16 @@ pmap_pv_reclaim(pmap_t locked_pmap) PGA_WRITEABLE); } } + pc->pc_map[field] |= 1UL << bit; pmap_unuse_pt(pmap, va, *pde, &free); - freemask |= 1UL << bit; freed++; } - pc->pc_map[field] |= freemask; } if (freed == 0) { TAILQ_INSERT_TAIL(&newtail, pc, pc_lru); continue; } + /* Every freed mapping is for a 4 KB page. */ pmap_resident_count_dec(pmap, freed); PV_STAT(pv_entry_frees += freed); PV_STAT(pv_entry_spare += freed); @@ -2261,10 +2260,6 @@ retry: TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list); } - if (pc != TAILQ_LAST(&pv_chunks, pch)) { - TAILQ_REMOVE(&pv_chunks, pc, pc_lru); - TAILQ_INSERT_TAIL(&pv_chunks, pc, pc_lru); - } pv_entry_count++; PV_STAT(pv_entry_spare--); return (pv); @@ -4137,7 +4132,7 @@ pmap_remove_pages(pmap_t pmap) TAILQ_FOREACH_SAFE(pc, &pmap->pm_pvchunk, pc_list, npc) { allfree = 1; for (field = 0; field < _NPCM; field++) { - inuse = (~(pc->pc_map[field])) & pc_freemask[field]; + inuse = ~pc->pc_map[field] & pc_freemask[field]; while (inuse != 0) { bit = bsfq(inuse); bitmask = 1UL << bit; Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Mon Jun 4 02:25:11 2012 (r236533) +++ head/sys/i386/i386/pmap.c Mon Jun 4 03:51:08 2012 (r236534) @@ -2177,7 +2177,7 @@ pv_to_chunk(pv_entry_t pv) #define PC_FREE0_9 0xfffffffful /* Free values for index 0 through 9 */ #define PC_FREE10 0x0000fffful /* Free values for index 10 */ -static uint32_t pc_freemask[_NPCM] = { +static const uint32_t pc_freemask[_NPCM] = { PC_FREE0_9, PC_FREE0_9, PC_FREE0_9, PC_FREE0_9, PC_FREE0_9, PC_FREE0_9, PC_FREE0_9, PC_FREE0_9, PC_FREE0_9, @@ -2227,7 +2227,7 @@ pmap_pv_reclaim(pmap_t locked_pmap) pv_entry_t pv; vm_offset_t va; vm_page_t free, m, m_pc; - uint32_t inuse, freemask; + uint32_t inuse; int bit, field, freed; PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED); @@ -2260,7 +2260,6 @@ pmap_pv_reclaim(pmap_t locked_pmap) */ freed = 0; for (field = 0; field < _NPCM; field++) { - freemask = 0; for (inuse = ~pc->pc_map[field] & pc_freemask[field]; inuse != 0; inuse &= ~(1UL << bit)) { bit = bsfl(inuse); @@ -2289,16 +2288,16 @@ pmap_pv_reclaim(pmap_t locked_pmap) PGA_WRITEABLE); } } + pc->pc_map[field] |= 1UL << bit; pmap_unuse_pt(pmap, va, &free); - freemask |= 1UL << bit; freed++; } - pc->pc_map[field] |= freemask; } if (freed == 0) { TAILQ_INSERT_TAIL(&newtail, pc, pc_lru); continue; } + /* Every freed mapping is for a 4 KB page. */ pmap->pm_stats.resident_count -= freed; PV_STAT(pv_entry_frees += freed); PV_STAT(pv_entry_spare += freed); @@ -2367,13 +2366,21 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv field = idx / 32; bit = idx % 32; pc->pc_map[field] |= 1ul << bit; - /* move to head of list */ - TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); for (idx = 0; idx < _NPCM; idx++) if (pc->pc_map[idx] != pc_freemask[idx]) { - TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); + /* + * 98% of the time, pc is already at the head of the + * list. If it isn't already, move it to the head. + */ + if (__predict_false(TAILQ_FIRST(&pmap->pm_pvchunk) != + pc)) { + TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); + TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, + pc_list); + } return; } + TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); free_pv_chunk(pc); } @@ -2437,10 +2444,6 @@ retry: } TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list); - if (pc != TAILQ_LAST(&pv_chunks, pch)) { - TAILQ_REMOVE(&pv_chunks, pc, pc_lru); - TAILQ_INSERT_TAIL(&pv_chunks, pc, pc_lru); - } PV_STAT(pv_entry_spare--); return (pv); } @@ -4371,7 +4374,7 @@ pmap_remove_pages(pmap_t pmap) TAILQ_FOREACH_SAFE(pc, &pmap->pm_pvchunk, pc_list, npc) { allfree = 1; for (field = 0; field < _NPCM; field++) { - inuse = (~(pc->pc_map[field])) & pc_freemask[field]; + inuse = ~pc->pc_map[field] & pc_freemask[field]; while (inuse != 0) { bit = bsfl(inuse); bitmask = 1UL << bit; Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Mon Jun 4 02:25:11 2012 (r236533) +++ head/sys/i386/xen/pmap.c Mon Jun 4 03:51:08 2012 (r236534) @@ -1929,7 +1929,7 @@ pv_to_chunk(pv_entry_t pv) #define PC_FREE0_9 0xfffffffful /* Free values for index 0 through 9 */ #define PC_FREE10 0x0000fffful /* Free values for index 10 */ -static uint32_t pc_freemask[_NPCM] = { +static const uint32_t pc_freemask[_NPCM] = { PC_FREE0_9, PC_FREE0_9, PC_FREE0_9, PC_FREE0_9, PC_FREE0_9, PC_FREE0_9, PC_FREE0_9, PC_FREE0_9, PC_FREE0_9, @@ -1977,7 +1977,7 @@ pmap_pv_reclaim(pmap_t locked_pmap) pv_entry_t pv; vm_offset_t va; vm_page_t free, m, m_pc; - uint32_t inuse, freemask; + uint32_t inuse; int bit, field, freed; PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED); @@ -2010,7 +2010,6 @@ pmap_pv_reclaim(pmap_t locked_pmap) */ freed = 0; for (field = 0; field < _NPCM; field++) { - freemask = 0; for (inuse = ~pc->pc_map[field] & pc_freemask[field]; inuse != 0; inuse &= ~(1UL << bit)) { bit = bsfl(inuse); @@ -2030,16 +2029,16 @@ pmap_pv_reclaim(pmap_t locked_pmap) TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); if (TAILQ_EMPTY(&m->md.pv_list)) vm_page_aflag_clear(m, PGA_WRITEABLE); + pc->pc_map[field] |= 1UL << bit; pmap_unuse_pt(pmap, va, &free); - freemask |= 1UL << bit; freed++; } - pc->pc_map[field] |= freemask; } if (freed == 0) { TAILQ_INSERT_TAIL(&newtail, pc, pc_lru); continue; } + /* Every freed mapping is for a 4 KB page. */ pmap->pm_stats.resident_count -= freed; PV_STAT(pv_entry_frees += freed); PV_STAT(pv_entry_spare += freed); @@ -2108,13 +2107,21 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv field = idx / 32; bit = idx % 32; pc->pc_map[field] |= 1ul << bit; - /* move to head of list */ - TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); for (idx = 0; idx < _NPCM; idx++) if (pc->pc_map[idx] != pc_freemask[idx]) { - TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); + /* + * 98% of the time, pc is already at the head of the + * list. If it isn't already, move it to the head. + */ + if (__predict_false(TAILQ_FIRST(&pmap->pm_pvchunk) != + pc)) { + TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); + TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, + pc_list); + } return; } + TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); free_pv_chunk(pc); } @@ -2178,10 +2185,6 @@ retry: } TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list); - if (pc != TAILQ_LAST(&pv_chunks, pch)) { - TAILQ_REMOVE(&pv_chunks, pc, pc_lru); - TAILQ_INSERT_TAIL(&pv_chunks, pc, pc_lru); - } PV_STAT(pv_entry_spare--); return (pv); } @@ -3538,7 +3541,7 @@ pmap_remove_pages(pmap_t pmap) TAILQ_FOREACH_SAFE(pc, &pmap->pm_pvchunk, pc_list, npc) { allfree = 1; for (field = 0; field < _NPCM; field++) { - inuse = (~(pc->pc_map[field])) & pc_freemask[field]; + inuse = ~pc->pc_map[field] & pc_freemask[field]; while (inuse != 0) { bit = bsfl(inuse); bitmask = 1UL << bit; From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 04:25:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2D6B106566B; Mon, 4 Jun 2012 04:25:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D5EA8FC17; Mon, 4 Jun 2012 04:25:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q544P0xF004387; Mon, 4 Jun 2012 04:25:00 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q544P0f2004384; Mon, 4 Jun 2012 04:25:00 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201206040425.q544P0f2004384@svn.freebsd.org> From: Warner Losh Date: Mon, 4 Jun 2012 04:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236535 - in head/sys: arm/at91 conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 04:25:01 -0000 Author: imp Date: Mon Jun 4 04:24:59 2012 New Revision: 236535 URL: http://svn.freebsd.org/changeset/base/236535 Log: Eliminate the now-unused AT91C_MASTER_CLOCK option and change the one place in the source it was used to the more correct AT91C_MAIN_CLOCK. Sort AT91C_MAIN_CLOCK into a better location in the options.arm file. Modified: head/sys/arm/at91/at91_pmc.c head/sys/conf/options.arm Modified: head/sys/arm/at91/at91_pmc.c ============================================================================== --- head/sys/arm/at91/at91_pmc.c Mon Jun 4 03:51:08 2012 (r236534) +++ head/sys/arm/at91/at91_pmc.c Mon Jun 4 04:24:59 2012 (r236535) @@ -429,7 +429,7 @@ at91_pmc_sense_main_clock(void) * measure it correctly, and that any error can be adequately * compensated for by roudning to the nearest 500Hz. Users * with fast, or odd-ball clocks will need to set - * AT91C_MASTER_CLOCK in the kernel config file. + * AT91C_MAIN_CLOCK in the kernel config file. */ if (ckgr_val >= 21000000) return ((ckgr_val + 250) / 500 * 500); Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Mon Jun 4 03:51:08 2012 (r236534) +++ head/sys/conf/options.arm Mon Jun 4 04:24:59 2012 (r236535) @@ -4,8 +4,6 @@ ARM_CACHE_LOCK_ENABLE opt_global.h ARMFPE opt_global.h ARM_KERN_DIRECTMAP opt_vm.h ARM_USE_SMALL_ALLOC opt_global.h -AT91C_MASTER_CLOCK opt_global.h -AT91C_MAIN_CLOCK opt_at91.h COUNTS_PER_SEC opt_timer.h CPU_SA1100 opt_global.h CPU_SA1110 opt_global.h @@ -38,5 +36,6 @@ AT91_TSC opt_at91.h AT91_KWIKBYTE opt_at91.h AT91_MCI_HAS_4WIRE opt_at91.h AT91_MCI_SLOT_B opt_at91.h +AT91C_MAIN_CLOCK opt_at91.h CPU_FA526 opt_global.h CPU_FA626TE opt_global.h From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 06:39:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3165D1065673; Mon, 4 Jun 2012 06:39:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B43D8FC14; Mon, 4 Jun 2012 06:39:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q546dA0a009835; Mon, 4 Jun 2012 06:39:10 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q546dA0Y009833; Mon, 4 Jun 2012 06:39:10 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201206040639.q546dA0Y009833@svn.freebsd.org> From: Dimitry Andric Date: Mon, 4 Jun 2012 06:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236538 - stable/9/contrib/llvm/tools/bugpoint X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 06:39:11 -0000 Author: dim Date: Mon Jun 4 06:39:10 2012 New Revision: 236538 URL: http://svn.freebsd.org/changeset/base/236538 Log: MFC r236386: Pull in r155978 from upstream llvm trunk: Fix unintentional use of operator bool. This enables llvm's bugpoint tool to build with libc++. Modified: stable/9/contrib/llvm/tools/bugpoint/ToolRunner.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) Modified: stable/9/contrib/llvm/tools/bugpoint/ToolRunner.cpp ============================================================================== --- stable/9/contrib/llvm/tools/bugpoint/ToolRunner.cpp Mon Jun 4 06:06:10 2012 (r236537) +++ stable/9/contrib/llvm/tools/bugpoint/ToolRunner.cpp Mon Jun 4 06:39:10 2012 (r236538) @@ -128,7 +128,7 @@ static int RunProgramRemotelyWithTimeout ErrorFile.close(); } - errs() << OS; + errs() << OS.str(); } return ReturnCode; From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 06:43:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B491D10656D1; Mon, 4 Jun 2012 06:43:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F35B8FC16; Mon, 4 Jun 2012 06:43:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q546h1B1010031; Mon, 4 Jun 2012 06:43:01 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q546h1H4010029; Mon, 4 Jun 2012 06:43:01 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201206040643.q546h1H4010029@svn.freebsd.org> From: Dimitry Andric Date: Mon, 4 Jun 2012 06:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236539 - stable/9/contrib/libc++/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 06:43:01 -0000 Author: dim Date: Mon Jun 4 06:43:01 2012 New Revision: 236539 URL: http://svn.freebsd.org/changeset/base/236539 Log: MFC r236387: Fix dangling else in libc++'s __bit_reference header. This has also been sent upstream. Modified: stable/9/contrib/libc++/include/__bit_reference Directory Properties: stable/9/contrib/libc++/ (props changed) Modified: stable/9/contrib/libc++/include/__bit_reference ============================================================================== --- stable/9/contrib/libc++/include/__bit_reference Mon Jun 4 06:39:10 2012 (r236538) +++ stable/9/contrib/libc++/include/__bit_reference Mon Jun 4 06:43:01 2012 (r236539) @@ -950,11 +950,15 @@ __equal_unaligned(__bit_iterator<_Cp, tr __storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r); __m = (~__storage_type(0) << __first2.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn)); if (__first2.__ctz_ > __first1.__ctz_) + { if ((*__first2.__seg_ & __m) != (__b << (__first2.__ctz_ - __first1.__ctz_))) return false; + } else + { if ((*__first2.__seg_ & __m) != (__b >> (__first1.__ctz_ - __first2.__ctz_))) return false; + } __first2.__seg_ += (__ddn + __first2.__ctz_) / __bits_per_word; __first2.__ctz_ = static_cast((__ddn + __first2.__ctz_) % __bits_per_word); __dn -= __ddn; From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 06:45:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B429A1065672; Mon, 4 Jun 2012 06:45:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F9828FC12; Mon, 4 Jun 2012 06:45:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q546jnBX010210; Mon, 4 Jun 2012 06:45:49 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q546jnix010208; Mon, 4 Jun 2012 06:45:49 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201206040645.q546jnix010208@svn.freebsd.org> From: Dimitry Andric Date: Mon, 4 Jun 2012 06:45:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236540 - stable/9/sbin/devd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 06:45:49 -0000 Author: dim Date: Mon Jun 4 06:45:49 2012 New Revision: 236540 URL: http://svn.freebsd.org/changeset/base/236540 Log: MFC r236388: Make devd build with libc++. Modified: stable/9/sbin/devd/devd.cc Directory Properties: stable/9/sbin/devd/ (props changed) Modified: stable/9/sbin/devd/devd.cc ============================================================================== --- stable/9/sbin/devd/devd.cc Mon Jun 4 06:43:01 2012 (r236539) +++ stable/9/sbin/devd/devd.cc Mon Jun 4 06:45:49 2012 (r236540) @@ -798,7 +798,7 @@ create_socket(const char *name) unlink(name); if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) err(1, "fcntl"); - if (bind(fd, (struct sockaddr *) & sun, slen) < 0) + if (::bind(fd, (struct sockaddr *) & sun, slen) < 0) err(1, "bind"); listen(fd, 4); chown(name, 0, 0); /* XXX - root.wheel */ From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 07:03:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 02587106564A; Mon, 4 Jun 2012 07:03:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E05348FC0A; Mon, 4 Jun 2012 07:03:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5473u5Y011152; Mon, 4 Jun 2012 07:03:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5473usD011144; Mon, 4 Jun 2012 07:03:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206040703.q5473usD011144@svn.freebsd.org> From: Alexander Motin Date: Mon, 4 Jun 2012 07:03:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236541 - in stable/9/sys: cam dev/ahci dev/ata dev/mvs dev/siis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 07:03:57 -0000 Author: mav Date: Mon Jun 4 07:03:56 2012 New Revision: 236541 URL: http://svn.freebsd.org/changeset/base/236541 Log: MFC r235333: Add two functions xpt_batch_start() and xpt_batch_done() to the CAM SIM KPI to allow drivers to handle request completion directly without passing them to the CAM SWI thread removing extra context switch. Modify all ATA/SATA drivers to use them. Modified: stable/9/sys/cam/cam_sim.h stable/9/sys/cam/cam_xpt.c stable/9/sys/cam/cam_xpt_sim.h stable/9/sys/dev/ahci/ahci.c stable/9/sys/dev/ata/ata-all.c stable/9/sys/dev/mvs/mvs.c stable/9/sys/dev/siis/siis.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/cam/cam_sim.h ============================================================================== --- stable/9/sys/cam/cam_sim.h Mon Jun 4 06:45:49 2012 (r236540) +++ stable/9/sys/cam/cam_sim.h Mon Jun 4 07:03:56 2012 (r236541) @@ -106,6 +106,7 @@ struct cam_sim { #define CAM_SIM_MPSAFE 0x02 #define CAM_SIM_ON_DONEQ 0x04 #define CAM_SIM_POLLED 0x08 +#define CAM_SIM_BATCH 0x10 struct callout callout; struct cam_devq *devq; /* Device Queue to use for this SIM */ int refcount; /* References to the SIM. */ Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Mon Jun 4 06:45:49 2012 (r236540) +++ stable/9/sys/cam/cam_xpt.c Mon Jun 4 07:03:56 2012 (r236541) @@ -4332,7 +4332,8 @@ xpt_done(union ccb *done_ccb) TAILQ_INSERT_TAIL(&sim->sim_doneq, &done_ccb->ccb_h, sim_links.tqe); done_ccb->ccb_h.pinfo.index = CAM_DONEQ_INDEX; - if ((sim->flags & (CAM_SIM_ON_DONEQ | CAM_SIM_POLLED)) == 0) { + if ((sim->flags & (CAM_SIM_ON_DONEQ | CAM_SIM_POLLED | + CAM_SIM_BATCH)) == 0) { mtx_lock(&cam_simq_lock); first = TAILQ_EMPTY(&cam_simq); TAILQ_INSERT_TAIL(&cam_simq, sim, links); @@ -4344,6 +4345,25 @@ xpt_done(union ccb *done_ccb) } } +void +xpt_batch_start(struct cam_sim *sim) +{ + + KASSERT((sim->flags & CAM_SIM_BATCH) == 0, ("Batch flag already set")); + sim->flags |= CAM_SIM_BATCH; +} + +void +xpt_batch_done(struct cam_sim *sim) +{ + + KASSERT((sim->flags & CAM_SIM_BATCH) != 0, ("Batch flag was not set")); + sim->flags &= ~CAM_SIM_BATCH; + if (!TAILQ_EMPTY(&sim->sim_doneq) && + (sim->flags & CAM_SIM_ON_DONEQ) == 0) + camisr_runqueue(&sim->sim_doneq); +} + union ccb * xpt_alloc_ccb() { Modified: stable/9/sys/cam/cam_xpt_sim.h ============================================================================== --- stable/9/sys/cam/cam_xpt_sim.h Mon Jun 4 06:45:49 2012 (r236540) +++ stable/9/sys/cam/cam_xpt_sim.h Mon Jun 4 07:03:56 2012 (r236541) @@ -51,6 +51,8 @@ void xpt_release_devq_rl(struct cam_pat u_int count, int run_queue); int xpt_sim_opened(struct cam_sim *sim); void xpt_done(union ccb *done_ccb); +void xpt_batch_start(struct cam_sim *sim); +void xpt_batch_done(struct cam_sim *sim); #endif #endif /* _CAM_CAM_XPT_SIM_H */ Modified: stable/9/sys/dev/ahci/ahci.c ============================================================================== --- stable/9/sys/dev/ahci/ahci.c Mon Jun 4 06:45:49 2012 (r236540) +++ stable/9/sys/dev/ahci/ahci.c Mon Jun 4 07:03:56 2012 (r236541) @@ -1458,7 +1458,9 @@ ahci_ch_intr_locked(void *data) struct ahci_channel *ch = device_get_softc(dev); mtx_lock(&ch->mtx); + xpt_batch_start(ch->sim); ahci_ch_intr(data); + xpt_batch_done(ch->sim); mtx_unlock(&ch->mtx); } Modified: stable/9/sys/dev/ata/ata-all.c ============================================================================== --- stable/9/sys/dev/ata/ata-all.c Mon Jun 4 06:45:49 2012 (r236540) +++ stable/9/sys/dev/ata/ata-all.c Mon Jun 4 07:03:56 2012 (r236541) @@ -544,9 +544,11 @@ ata_interrupt(void *data) struct ata_channel *ch = (struct ata_channel *)data; mtx_lock(&ch->state_mtx); + xpt_batch_start(ch->sim); #endif ata_interrupt_locked(data); #ifdef ATA_CAM + xpt_batch_done(ch->sim); mtx_unlock(&ch->state_mtx); #endif } Modified: stable/9/sys/dev/mvs/mvs.c ============================================================================== --- stable/9/sys/dev/mvs/mvs.c Mon Jun 4 06:45:49 2012 (r236540) +++ stable/9/sys/dev/mvs/mvs.c Mon Jun 4 07:03:56 2012 (r236541) @@ -654,7 +654,9 @@ mvs_ch_intr_locked(void *data) struct mvs_channel *ch = device_get_softc(dev); mtx_lock(&ch->mtx); + xpt_batch_start(ch->sim); mvs_ch_intr(data); + xpt_batch_done(ch->sim); mtx_unlock(&ch->mtx); } Modified: stable/9/sys/dev/siis/siis.c ============================================================================== --- stable/9/sys/dev/siis/siis.c Mon Jun 4 06:45:49 2012 (r236540) +++ stable/9/sys/dev/siis/siis.c Mon Jun 4 07:03:56 2012 (r236541) @@ -830,7 +830,9 @@ siis_ch_intr_locked(void *data) struct siis_channel *ch = device_get_softc(dev); mtx_lock(&ch->mtx); + xpt_batch_start(ch->sim); siis_ch_intr(data); + xpt_batch_done(ch->sim); mtx_unlock(&ch->mtx); } From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 07:05:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CBA61106564A; Mon, 4 Jun 2012 07:05:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB5EB8FC1C; Mon, 4 Jun 2012 07:05:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5475Enl011265; Mon, 4 Jun 2012 07:05:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5475E4s011257; Mon, 4 Jun 2012 07:05:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206040705.q5475E4s011257@svn.freebsd.org> From: Alexander Motin Date: Mon, 4 Jun 2012 07:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236542 - in stable/8/sys: cam dev/ahci dev/ata dev/mvs dev/siis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 07:05:14 -0000 Author: mav Date: Mon Jun 4 07:05:13 2012 New Revision: 236542 URL: http://svn.freebsd.org/changeset/base/236542 Log: MFC r235333: Add two functions xpt_batch_start() and xpt_batch_done() to the CAM SIM KPI to allow drivers to handle request completion directly without passing them to the CAM SWI thread removing extra context switch. Modify all ATA/SATA drivers to use them. Modified: stable/8/sys/cam/cam_sim.h stable/8/sys/cam/cam_xpt.c stable/8/sys/cam/cam_xpt_sim.h stable/8/sys/dev/ahci/ahci.c stable/8/sys/dev/ata/ata-all.c stable/8/sys/dev/mvs/mvs.c stable/8/sys/dev/siis/siis.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/cam_sim.h ============================================================================== --- stable/8/sys/cam/cam_sim.h Mon Jun 4 07:03:56 2012 (r236541) +++ stable/8/sys/cam/cam_sim.h Mon Jun 4 07:05:13 2012 (r236542) @@ -106,6 +106,7 @@ struct cam_sim { #define CAM_SIM_MPSAFE 0x02 #define CAM_SIM_ON_DONEQ 0x04 #define CAM_SIM_POLLED 0x08 +#define CAM_SIM_BATCH 0x10 struct callout callout; struct cam_devq *devq; /* Device Queue to use for this SIM */ int refcount; /* References to the SIM. */ Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Mon Jun 4 07:03:56 2012 (r236541) +++ stable/8/sys/cam/cam_xpt.c Mon Jun 4 07:05:13 2012 (r236542) @@ -4250,7 +4250,8 @@ xpt_done(union ccb *done_ccb) TAILQ_INSERT_TAIL(&sim->sim_doneq, &done_ccb->ccb_h, sim_links.tqe); done_ccb->ccb_h.pinfo.index = CAM_DONEQ_INDEX; - if ((sim->flags & (CAM_SIM_ON_DONEQ | CAM_SIM_POLLED)) == 0) { + if ((sim->flags & (CAM_SIM_ON_DONEQ | CAM_SIM_POLLED | + CAM_SIM_BATCH)) == 0) { mtx_lock(&cam_simq_lock); first = TAILQ_EMPTY(&cam_simq); TAILQ_INSERT_TAIL(&cam_simq, sim, links); @@ -4262,6 +4263,25 @@ xpt_done(union ccb *done_ccb) } } +void +xpt_batch_start(struct cam_sim *sim) +{ + + KASSERT((sim->flags & CAM_SIM_BATCH) == 0, ("Batch flag already set")); + sim->flags |= CAM_SIM_BATCH; +} + +void +xpt_batch_done(struct cam_sim *sim) +{ + + KASSERT((sim->flags & CAM_SIM_BATCH) != 0, ("Batch flag was not set")); + sim->flags &= ~CAM_SIM_BATCH; + if (!TAILQ_EMPTY(&sim->sim_doneq) && + (sim->flags & CAM_SIM_ON_DONEQ) == 0) + camisr_runqueue(&sim->sim_doneq); +} + union ccb * xpt_alloc_ccb() { Modified: stable/8/sys/cam/cam_xpt_sim.h ============================================================================== --- stable/8/sys/cam/cam_xpt_sim.h Mon Jun 4 07:03:56 2012 (r236541) +++ stable/8/sys/cam/cam_xpt_sim.h Mon Jun 4 07:05:13 2012 (r236542) @@ -51,6 +51,8 @@ void xpt_release_devq_rl(struct cam_pat u_int count, int run_queue); int xpt_sim_opened(struct cam_sim *sim); void xpt_done(union ccb *done_ccb); +void xpt_batch_start(struct cam_sim *sim); +void xpt_batch_done(struct cam_sim *sim); #endif #endif /* _CAM_CAM_XPT_SIM_H */ Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Mon Jun 4 07:03:56 2012 (r236541) +++ stable/8/sys/dev/ahci/ahci.c Mon Jun 4 07:05:13 2012 (r236542) @@ -1455,7 +1455,9 @@ ahci_ch_intr_locked(void *data) struct ahci_channel *ch = device_get_softc(dev); mtx_lock(&ch->mtx); + xpt_batch_start(ch->sim); ahci_ch_intr(data); + xpt_batch_done(ch->sim); mtx_unlock(&ch->mtx); } Modified: stable/8/sys/dev/ata/ata-all.c ============================================================================== --- stable/8/sys/dev/ata/ata-all.c Mon Jun 4 07:03:56 2012 (r236541) +++ stable/8/sys/dev/ata/ata-all.c Mon Jun 4 07:05:13 2012 (r236542) @@ -543,9 +543,11 @@ ata_interrupt(void *data) struct ata_channel *ch = (struct ata_channel *)data; mtx_lock(&ch->state_mtx); + xpt_batch_start(ch->sim); #endif ata_interrupt_locked(data); #ifdef ATA_CAM + xpt_batch_done(ch->sim); mtx_unlock(&ch->state_mtx); #endif } Modified: stable/8/sys/dev/mvs/mvs.c ============================================================================== --- stable/8/sys/dev/mvs/mvs.c Mon Jun 4 07:03:56 2012 (r236541) +++ stable/8/sys/dev/mvs/mvs.c Mon Jun 4 07:05:13 2012 (r236542) @@ -653,7 +653,9 @@ mvs_ch_intr_locked(void *data) struct mvs_channel *ch = device_get_softc(dev); mtx_lock(&ch->mtx); + xpt_batch_start(ch->sim); mvs_ch_intr(data); + xpt_batch_done(ch->sim); mtx_unlock(&ch->mtx); } Modified: stable/8/sys/dev/siis/siis.c ============================================================================== --- stable/8/sys/dev/siis/siis.c Mon Jun 4 07:03:56 2012 (r236541) +++ stable/8/sys/dev/siis/siis.c Mon Jun 4 07:05:13 2012 (r236542) @@ -835,7 +835,9 @@ siis_ch_intr_locked(void *data) struct siis_channel *ch = device_get_softc(dev); mtx_lock(&ch->mtx); + xpt_batch_start(ch->sim); siis_ch_intr(data); + xpt_batch_done(ch->sim); mtx_unlock(&ch->mtx); } From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 07:07:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 38251106566B; Mon, 4 Jun 2012 07:07:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 235618FC12; Mon, 4 Jun 2012 07:07:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5477k4T011422; Mon, 4 Jun 2012 07:07:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5477k5P011420; Mon, 4 Jun 2012 07:07:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206040707.q5477k5P011420@svn.freebsd.org> From: Alexander Motin Date: Mon, 4 Jun 2012 07:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236543 - stable/9/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 07:07:47 -0000 Author: mav Date: Mon Jun 4 07:07:46 2012 New Revision: 236543 URL: http://svn.freebsd.org/changeset/base/236543 Log: MFC r236184: Make legacy ATA to not call device_add_child() with unit number but without driver name. Modified: stable/9/sys/dev/ata/ata-all.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ata/ata-all.c ============================================================================== --- stable/9/sys/dev/ata/ata-all.c Mon Jun 4 07:05:13 2012 (r236542) +++ stable/9/sys/dev/ata/ata-all.c Mon Jun 4 07:07:46 2012 (r236543) @@ -887,7 +887,7 @@ ata_add_child(device_t parent, struct at { device_t child; - if ((child = device_add_child(parent, NULL, unit))) { + if ((child = device_add_child(parent, (unit < 0) ? NULL : "ad", unit))) { device_set_softc(child, atadev); device_quiet(child); atadev->dev = child; From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 07:08:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD51E106564A; Mon, 4 Jun 2012 07:08:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97EC68FC14; Mon, 4 Jun 2012 07:08:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5478w73011522; Mon, 4 Jun 2012 07:08:58 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5478wal011520; Mon, 4 Jun 2012 07:08:58 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206040708.q5478wal011520@svn.freebsd.org> From: Alexander Motin Date: Mon, 4 Jun 2012 07:08:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236544 - stable/8/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 07:08:58 -0000 Author: mav Date: Mon Jun 4 07:08:58 2012 New Revision: 236544 URL: http://svn.freebsd.org/changeset/base/236544 Log: MFC r236184: Make legacy ATA to not call device_add_child() with unit number but without driver name. Modified: stable/8/sys/dev/ata/ata-all.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/ata/ata-all.c ============================================================================== --- stable/8/sys/dev/ata/ata-all.c Mon Jun 4 07:07:46 2012 (r236543) +++ stable/8/sys/dev/ata/ata-all.c Mon Jun 4 07:08:58 2012 (r236544) @@ -886,7 +886,7 @@ ata_add_child(device_t parent, struct at { device_t child; - if ((child = device_add_child(parent, NULL, unit))) { + if ((child = device_add_child(parent, (unit < 0) ? NULL : "ad", unit))) { device_set_softc(child, atadev); device_quiet(child); atadev->dev = child; From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 07:12:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 017B41065674; Mon, 4 Jun 2012 07:12:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0BE68FC1C; Mon, 4 Jun 2012 07:12:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q547CaAd011830; Mon, 4 Jun 2012 07:12:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q547CaOt011828; Mon, 4 Jun 2012 07:12:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206040712.q547CaOt011828@svn.freebsd.org> From: Alexander Motin Date: Mon, 4 Jun 2012 07:12:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236546 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 07:12:37 -0000 Author: mav Date: Mon Jun 4 07:12:36 2012 New Revision: 236546 URL: http://svn.freebsd.org/changeset/base/236546 Log: MFC r232740: Make kern.sched.idlespinthresh default value adaptive depending of HZ. Otherwise with HZ above 8000 CPU may never skip timer ticks on idle. Modified: stable/9/sys/kern/sched_ule.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/sched_ule.c ============================================================================== --- stable/9/sys/kern/sched_ule.c Mon Jun 4 07:12:11 2012 (r236545) +++ stable/9/sys/kern/sched_ule.c Mon Jun 4 07:12:36 2012 (r236546) @@ -212,7 +212,7 @@ static int preempt_thresh = 0; #endif static int static_boost = PRI_MIN_BATCH; static int sched_idlespins = 10000; -static int sched_idlespinthresh = 16; +static int sched_idlespinthresh = -1; /* * tdq - per processor runqs and statistics. All fields are protected by the @@ -1410,6 +1410,8 @@ sched_initticks(void *dummy) steal_thresh = min(fls(mp_ncpus) - 1, 3); affinity = SCHED_AFFINITY_DEFAULT; #endif + if (sched_idlespinthresh < 0) + sched_idlespinthresh = max(16, 2 * hz / realstathz); } From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 07:16:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D02F106566B; Mon, 4 Jun 2012 07:16:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 671DB8FC08; Mon, 4 Jun 2012 07:16:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q547GDcY012057; Mon, 4 Jun 2012 07:16:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q547GDLq012055; Mon, 4 Jun 2012 07:16:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206040716.q547GDLq012055@svn.freebsd.org> From: Alexander Motin Date: Mon, 4 Jun 2012 07:16:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236547 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 07:16:13 -0000 Author: mav Date: Mon Jun 4 07:16:12 2012 New Revision: 236547 URL: http://svn.freebsd.org/changeset/base/236547 Log: MFC r234066: Microoptimize cpu_search(). According to profiling, it makes one take 6% of CPU time on hackbench with its million of context switches per second, instead of 8% before. Modified: stable/9/sys/kern/sched_ule.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/sched_ule.c ============================================================================== --- stable/9/sys/kern/sched_ule.c Mon Jun 4 07:12:36 2012 (r236546) +++ stable/9/sys/kern/sched_ule.c Mon Jun 4 07:16:12 2012 (r236547) @@ -615,32 +615,34 @@ cpu_search(const struct cpu_group *cg, s cpuset_t cpumask; struct cpu_group *child; struct tdq *tdq; - int cpu, i, hload, lload, load, total, rnd; + int cpu, i, hload, lload, load, total, rnd, *rndptr; total = 0; cpumask = cg->cg_mask; if (match & CPU_SEARCH_LOWEST) { lload = INT_MAX; - low->cs_load = INT_MAX; lgroup = *low; } if (match & CPU_SEARCH_HIGHEST) { - hload = -1; - high->cs_load = -1; + hload = INT_MIN; hgroup = *high; } /* Iterate through the child CPU groups and then remaining CPUs. */ - for (i = 0, cpu = 0; i <= cg->cg_children; ) { - if (i >= cg->cg_children) { - while (cpu <= mp_maxid && !CPU_ISSET(cpu, &cpumask)) - cpu++; - if (cpu > mp_maxid) + for (i = cg->cg_children, cpu = mp_maxid; i >= 0; ) { + if (i == 0) { + while (cpu >= 0 && !CPU_ISSET(cpu, &cpumask)) + cpu--; + if (cpu < 0) break; child = NULL; } else - child = &cg->cg_child[i]; + child = &cg->cg_child[i - 1]; + if (match & CPU_SEARCH_LOWEST) + lgroup.cs_cpu = -1; + if (match & CPU_SEARCH_HIGHEST) + hgroup.cs_cpu = -1; if (child) { /* Handle child CPU group. */ CPU_NAND(&cpumask, &child->cg_mask); switch (match) { @@ -657,23 +659,23 @@ cpu_search(const struct cpu_group *cg, s } else { /* Handle child CPU. */ tdq = TDQ_CPU(cpu); load = tdq->tdq_load * 256; - rnd = DPCPU_SET(randomval, - DPCPU_GET(randomval) * 69069 + 5) >> 26; + rndptr = DPCPU_PTR(randomval); + rnd = (*rndptr = *rndptr * 69069 + 5) >> 26; if (match & CPU_SEARCH_LOWEST) { if (cpu == low->cs_prefer) load -= 64; /* If that CPU is allowed and get data. */ - if (CPU_ISSET(cpu, &lgroup.cs_mask) && - tdq->tdq_lowpri > lgroup.cs_pri && - tdq->tdq_load <= lgroup.cs_limit) { + if (tdq->tdq_lowpri > lgroup.cs_pri && + tdq->tdq_load <= lgroup.cs_limit && + CPU_ISSET(cpu, &lgroup.cs_mask)) { lgroup.cs_cpu = cpu; lgroup.cs_load = load - rnd; } } if (match & CPU_SEARCH_HIGHEST) - if (CPU_ISSET(cpu, &hgroup.cs_mask) && - tdq->tdq_load >= hgroup.cs_limit && - tdq->tdq_transferable) { + if (tdq->tdq_load >= hgroup.cs_limit && + tdq->tdq_transferable && + CPU_ISSET(cpu, &hgroup.cs_mask)) { hgroup.cs_cpu = cpu; hgroup.cs_load = load - rnd; } @@ -682,7 +684,7 @@ cpu_search(const struct cpu_group *cg, s /* We have info about child item. Compare it. */ if (match & CPU_SEARCH_LOWEST) { - if (lgroup.cs_load != INT_MAX && + if (lgroup.cs_cpu >= 0 && (load < lload || (load == lload && lgroup.cs_load < low->cs_load))) { lload = load; @@ -691,17 +693,19 @@ cpu_search(const struct cpu_group *cg, s } } if (match & CPU_SEARCH_HIGHEST) - if (hgroup.cs_load >= 0 && + if (hgroup.cs_cpu >= 0 && (load > hload || (load == hload && hgroup.cs_load > high->cs_load))) { hload = load; high->cs_cpu = hgroup.cs_cpu; high->cs_load = hgroup.cs_load; } - if (child) - i++; - else - cpu++; + if (child) { + i--; + if (i == 0 && CPU_EMPTY(&cpumask)) + break; + } else + cpu--; } return (total); } From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 08:40:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3800E106566B; Mon, 4 Jun 2012 08:40:15 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 238E28FC14; Mon, 4 Jun 2012 08:40:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q548eEm6015627; Mon, 4 Jun 2012 08:40:14 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q548eEpe015625; Mon, 4 Jun 2012 08:40:14 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201206040840.q548eEpe015625@svn.freebsd.org> From: Grzegorz Bernacki Date: Mon, 4 Jun 2012 08:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236549 - head/sys/modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 08:40:15 -0000 Author: gber Date: Mon Jun 4 08:40:14 2012 New Revision: 236549 URL: http://svn.freebsd.org/changeset/base/236549 Log: Restore changes accidentally removed in r235537. Noticed by: avg Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Jun 4 07:54:53 2012 (r236548) +++ head/sys/modules/Makefile Mon Jun 4 08:40:14 2012 (r236549) @@ -338,6 +338,7 @@ SUBDIR= ${_3dfx} \ vx \ ${_vxge} \ wb \ + ${_wbwd} \ ${_wi} \ wlan \ wlan_acl \ @@ -521,6 +522,7 @@ _stg= stg _streams= streams _svr4= svr4 _vxge= vxge +_wbwd= wbwd _wi= wi _xe= xe .if ${MK_ZFS} != "no" || defined(ALL_MODULES) @@ -716,6 +718,7 @@ _viawd= viawd _virtio= virtio _vxge= vxge _x86bios= x86bios +_wbwd= wbwd _wi= wi _wpi= wpi .if ${MK_SOURCELESS_UCODE} != "no" From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 08:42:19 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 772E81065674; Mon, 4 Jun 2012 08:42:18 +0000 (UTC) (envelope-from gber@freebsd.org) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id EF7A58FC17; Mon, 4 Jun 2012 08:42:17 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id 5C380C3CBC; Mon, 4 Jun 2012 10:42:06 +0200 (CEST) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id j-lI64SxTz7h; Mon, 4 Jun 2012 10:42:05 +0200 (CEST) Received: from [10.0.0.93] (cardhu.semihalf.com [213.17.239.108]) by smtp.semihalf.com (Postfix) with ESMTPSA id CA69BC384F; Mon, 4 Jun 2012 10:42:05 +0200 (CEST) Message-ID: <4FCC90AD.6010904@freebsd.org> Date: Mon, 04 Jun 2012 12:40:45 +0200 From: Grzegorz Bernacki User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.24) Gecko/20120127 Thunderbird/3.1.16 MIME-Version: 1.0 To: Andriy Gapon References: <201205171011.q4HABIJY090234@svn.freebsd.org> <4FCA5EBE.50109@FreeBSD.org> In-Reply-To: <4FCA5EBE.50109@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 Subject: Re: svn commit: r235537 - in head: etc/mtree include lib lib/libnandfs lib/libstand sbin sbin/nandfs sbin/newfs_nandfs share/man/man4 share/man/man5 share/mk sys/boot/arm/uboot sys/boot/i386/loader sys... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 08:42:19 -0000 On 06/02/12 20:43, Andriy Gapon wrote: > on 17/05/2012 13:11 Grzegorz Bernacki said the following: >> Author: gber >> Date: Thu May 17 10:11:18 2012 >> New Revision: 235537 >> URL: http://svn.freebsd.org/changeset/base/235537 >> >> Log: >> Import work done under project/nand (@235533) into head. >> >> The NAND Flash environment consists of several distinct components: >> - NAND framework (drivers harness for NAND controllers and NAND chips) >> - NAND simulator (NANDsim) >> - NAND file system (NAND FS) >> - Companion tools and utilities >> - Documentation (manual pages) >> >> This work is still experimental. Please use with caution. >> >> Obtained from: Semihalf >> Supported by: FreeBSD Foundation, Juniper Networks > [snip] >> head/sys/modules/Makefile > > Looks like this commit has unintentionally [?] removed wbwd-related lines from > sys/modules/Makefile. Please fix. Hi Andriy, Sorry about that. Fixed in r236549. regards, grzesiek From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 09:22:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E24E7106564A; Mon, 4 Jun 2012 09:22:22 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDC868FC15; Mon, 4 Jun 2012 09:22:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q549MMnB017353; Mon, 4 Jun 2012 09:22:22 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q549MMeF017351; Mon, 4 Jun 2012 09:22:22 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201206040922.q549MMeF017351@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 4 Jun 2012 09:22:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236550 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 09:22:23 -0000 Author: trociny Date: Mon Jun 4 09:22:22 2012 New Revision: 236550 URL: http://svn.freebsd.org/changeset/base/236550 Log: On a child exit, call waitpid(2) to clean up the process table. Submitted by: Andrey Zonov MFC after: 1 week Modified: head/usr.sbin/daemon/daemon.c Modified: head/usr.sbin/daemon/daemon.c ============================================================================== --- head/usr.sbin/daemon/daemon.c Mon Jun 4 08:40:14 2012 (r236549) +++ head/usr.sbin/daemon/daemon.c Mon Jun 4 09:22:22 2012 (r236550) @@ -217,6 +217,10 @@ wait_child(pid_t pid, sigset_t *mask) } switch (signo) { case SIGCHLD: + if (waitpid(pid, NULL, WNOHANG) == -1) { + warn("waitpid"); + return (-1); + } return (terminate); case SIGTERM: terminate = 1; From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 09:25:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6BE54106564A; Mon, 4 Jun 2012 09:25:02 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FFFD8FC0A; Mon, 4 Jun 2012 09:25:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q549P2hS017507; Mon, 4 Jun 2012 09:25:02 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q549P2QJ017505; Mon, 4 Jun 2012 09:25:02 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201206040925.q549P2QJ017505@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 4 Jun 2012 09:25:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236551 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 09:25:02 -0000 Author: trociny Date: Mon Jun 4 09:25:01 2012 New Revision: 236551 URL: http://svn.freebsd.org/changeset/base/236551 Log: Document -r option in SYNOPSIS and usage statement. Submitted by: Andrey Zonov MFC after: 3 days Modified: head/usr.sbin/daemon/daemon.8 head/usr.sbin/daemon/daemon.c Modified: head/usr.sbin/daemon/daemon.8 ============================================================================== --- head/usr.sbin/daemon/daemon.8 Mon Jun 4 09:22:22 2012 (r236550) +++ head/usr.sbin/daemon/daemon.8 Mon Jun 4 09:25:01 2012 (r236551) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2012 +.Dd June 4, 2012 .Dt DAEMON 8 .Os .Sh NAME @@ -34,7 +34,7 @@ .Nd run detached from the controlling terminal .Sh SYNOPSIS .Nm -.Op Fl cf +.Op Fl cfr .Op Fl p Ar pidfile .Op Fl u Ar user .Ar command arguments ... Modified: head/usr.sbin/daemon/daemon.c ============================================================================== --- head/usr.sbin/daemon/daemon.c Mon Jun 4 09:22:22 2012 (r236550) +++ head/usr.sbin/daemon/daemon.c Mon Jun 4 09:25:01 2012 (r236551) @@ -240,7 +240,7 @@ static void usage(void) { (void)fprintf(stderr, - "usage: daemon [-cf] [-p pidfile] [-u user] command " + "usage: daemon [-cfr] [-p pidfile] [-u user] command " "arguments ...\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 09:47:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 155E21065686; Mon, 4 Jun 2012 09:47:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0077B8FC08; Mon, 4 Jun 2012 09:47:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q549lJG6018430; Mon, 4 Jun 2012 09:47:19 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q549lJli018428; Mon, 4 Jun 2012 09:47:19 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206040947.q549lJli018428@svn.freebsd.org> From: Alexander Motin Date: Mon, 4 Jun 2012 09:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236552 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 09:47:20 -0000 Author: mav Date: Mon Jun 4 09:47:19 2012 New Revision: 236552 URL: http://svn.freebsd.org/changeset/base/236552 Log: Remove some dead code that I doubt will ever be implemented. Modified: head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Mon Jun 4 09:25:01 2012 (r236551) +++ head/sys/cam/ata/ata_xpt.c Mon Jun 4 09:47:19 2012 (r236552) @@ -166,8 +166,6 @@ static cam_status proberegister(struct c static void probeschedule(struct cam_periph *probe_periph); static void probestart(struct cam_periph *periph, union ccb *start_ccb); static void proberequestdefaultnegotiation(struct cam_periph *periph); -//static int proberequestbackoff(struct cam_periph *periph, -// struct cam_ed *device); static void probedone(struct cam_periph *periph, union ccb *done_ccb); static void probecleanup(struct cam_periph *periph); static void ata_find_quirk(struct cam_ed *device); @@ -681,112 +679,6 @@ proberequestdefaultnegotiation(struct ca xpt_action((union ccb *)&cts); } -#if 0 -/* - * Backoff Negotiation Code- only pertinent for SPI devices. - */ -static int -proberequestbackoff(struct cam_periph *periph, struct cam_ed *device) -{ - struct ccb_trans_settings cts; - struct ccb_trans_settings_spi *spi; - - memset(&cts, 0, sizeof (cts)); - xpt_setup_ccb(&cts.ccb_h, periph->path, CAM_PRIORITY_NONE); - cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; - cts.type = CTS_TYPE_CURRENT_SETTINGS; - xpt_action((union ccb *)&cts); - if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - if (bootverbose) { - xpt_print(periph->path, - "failed to get current device settings\n"); - } - return (0); - } - if (cts.transport != XPORT_SPI) { - if (bootverbose) { - xpt_print(periph->path, "not SPI transport\n"); - } - return (0); - } - spi = &cts.xport_specific.spi; - - /* - * We cannot renegotiate sync rate if we don't have one. - */ - if ((spi->valid & CTS_SPI_VALID_SYNC_RATE) == 0) { - if (bootverbose) { - xpt_print(periph->path, "no sync rate known\n"); - } - return (0); - } - - /* - * We'll assert that we don't have to touch PPR options- the - * SIM will see what we do with period and offset and adjust - * the PPR options as appropriate. - */ - - /* - * A sync rate with unknown or zero offset is nonsensical. - * A sync period of zero means Async. - */ - if ((spi->valid & CTS_SPI_VALID_SYNC_OFFSET) == 0 - || spi->sync_offset == 0 || spi->sync_period == 0) { - if (bootverbose) { - xpt_print(periph->path, "no sync rate available\n"); - } - return (0); - } - - if (device->flags & CAM_DEV_DV_HIT_BOTTOM) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, - ("hit async: giving up on DV\n")); - return (0); - } - - - /* - * Jump sync_period up by one, but stop at 5MHz and fall back to Async. - * We don't try to remember 'last' settings to see if the SIM actually - * gets into the speed we want to set. We check on the SIM telling - * us that a requested speed is bad, but otherwise don't try and - * check the speed due to the asynchronous and handshake nature - * of speed setting. - */ - spi->valid = CTS_SPI_VALID_SYNC_RATE | CTS_SPI_VALID_SYNC_OFFSET; - for (;;) { - spi->sync_period++; - if (spi->sync_period >= 0xf) { - spi->sync_period = 0; - spi->sync_offset = 0; - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, - ("setting to async for DV\n")); - /* - * Once we hit async, we don't want to try - * any more settings. - */ - device->flags |= CAM_DEV_DV_HIT_BOTTOM; - } else if (bootverbose) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, - ("DV: period 0x%x\n", spi->sync_period)); - printf("setting period to 0x%x\n", spi->sync_period); - } - cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; - cts.type = CTS_TYPE_CURRENT_SETTINGS; - xpt_action((union ccb *)&cts); - if ((cts.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { - break; - } - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, - ("DV: failed to set period 0x%x\n", spi->sync_period)); - if (spi->sync_period == 0) { - return (0); - } - } - return (1); -} -#endif static void probedone(struct cam_periph *periph, union ccb *done_ccb) { From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 10:01:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFC061065740; Mon, 4 Jun 2012 10:01:39 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay008.isp.belgacom.be (mailrelay008.isp.belgacom.be [195.238.6.174]) by mx1.freebsd.org (Postfix) with ESMTP id B29538FC0C; Mon, 4 Jun 2012 10:01:38 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABGGzE9bsUeP/2dsb2JhbAA9CIVOrleBCIIYAQEFIzMjEAsOBgQCAgUhAgIPAigeBg0BBwEBiAsHpBqSA4EjiW4WhGiBEgOlEYJi Received: from 143.71-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.71.143]) by relay.skynet.be with ESMTP; 04 Jun 2012 12:00:28 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.5/8.14.5) with ESMTP id q54A0RXX008342; Mon, 4 Jun 2012 12:00:27 +0200 (CEST) (envelope-from tijl@freebsd.org) Message-ID: <4FCC873B.90104@freebsd.org> Date: Mon, 04 Jun 2012 12:00:27 +0200 From: Tijl Coosemans User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:12.0) Gecko/20120502 Thunderbird/12.0 MIME-Version: 1.0 To: Konstantin Belousov References: <201206021810.q52IAGZA004238@svn.freebsd.org> In-Reply-To: <201206021810.q52IAGZA004238@svn.freebsd.org> X-Enigmail-Version: 1.5pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r236456 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 10:01:39 -0000 On 02-06-2012 20:10, Konstantin Belousov wrote: > Author: kib > Date: Sat Jun 2 18:10:16 2012 > New Revision: 236456 > URL: http://svn.freebsd.org/changeset/base/236456 > > Log: > Use plain store for atomic_store_rel on x86, instead of implicitly > locked xchg instruction. IA32 memory model guarantees that store has > release semantic, since stores cannot pass loads or stores. They can pass non-temporal stores can't they? From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 10:42:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2389106564A; Mon, 4 Jun 2012 10:42:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82F418FC15; Mon, 4 Jun 2012 10:42:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54AgA1Z036601; Mon, 4 Jun 2012 10:42:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54AgAYi036598; Mon, 4 Jun 2012 10:42:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206041042.q54AgAYi036598@svn.freebsd.org> From: Alexander Motin Date: Mon, 4 Jun 2012 10:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236555 - head/sbin/camcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 10:42:10 -0000 Author: mav Date: Mon Jun 4 10:42:09 2012 New Revision: 236555 URL: http://svn.freebsd.org/changeset/base/236555 Log: Add -p argument for `camcontrol debug` to allow enabling CAM_DEBUG_PROBE added at r208911. Modified: head/sbin/camcontrol/camcontrol.8 head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Mon Jun 4 10:09:57 2012 (r236554) +++ head/sbin/camcontrol/camcontrol.8 Mon Jun 4 10:42:09 2012 (r236555) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 24, 2011 +.Dd June 4, 2012 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -175,6 +175,7 @@ .Op Fl S .Op Fl X .Op Fl c +.Op Fl p .Aq all|off|bus Ns Op :target Ns Op :lun .Nm .Ic tags @@ -796,6 +797,8 @@ Enable CAM_DEBUG_XPT printfs. Enable CAM_DEBUG_CDB printfs. This will cause the kernel to print out the SCSI CDBs sent to the specified device(s). +.It Fl p +Enable CAM_DEBUG_PROBE printfs. .It all Enable debugging for all devices. .It off Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Mon Jun 4 10:09:57 2012 (r236554) +++ head/sbin/camcontrol/camcontrol.c Mon Jun 4 10:42:09 2012 (r236555) @@ -123,6 +123,7 @@ typedef enum { CAM_ARG_DEBUG_CDB = 0x08000000, CAM_ARG_DEBUG_XPT = 0x10000000, CAM_ARG_DEBUG_PERIPH = 0x20000000, + CAM_ARG_DEBUG_PROBE = 0x40000000, } cam_argmask; struct camcontrol_opts { @@ -176,7 +177,7 @@ static struct camcontrol_opts option_tab {"tags", CAM_CMD_TAG, CAM_ARG_NONE, "N:q"}, {"negotiate", CAM_CMD_RATE, CAM_ARG_NONE, negotiate_opts}, {"rate", CAM_CMD_RATE, CAM_ARG_NONE, negotiate_opts}, - {"debug", CAM_CMD_DEBUG, CAM_ARG_NONE, "IPTSXc"}, + {"debug", CAM_CMD_DEBUG, CAM_ARG_NONE, "IPTSXcp"}, {"format", CAM_CMD_FORMAT, CAM_ARG_NONE, "qrwy"}, {"idle", CAM_CMD_IDLE, CAM_ARG_NONE, "t:"}, {"standby", CAM_CMD_STANDBY, CAM_ARG_NONE, "t:"}, @@ -2640,6 +2641,10 @@ camdebug(int argc, char **argv, char *co arglist |= CAM_ARG_DEBUG_CDB; ccb.cdbg.flags |= CAM_DEBUG_CDB; break; + case 'p': + arglist |= CAM_ARG_DEBUG_PROBE; + ccb.cdbg.flags |= CAM_DEBUG_PROBE; + break; default: break; } @@ -2669,7 +2674,7 @@ camdebug(int argc, char **argv, char *co ccb.cdbg.flags = CAM_DEBUG_NONE; arglist &= ~(CAM_ARG_DEBUG_INFO|CAM_ARG_DEBUG_PERIPH| CAM_ARG_DEBUG_TRACE|CAM_ARG_DEBUG_SUBTRACE| - CAM_ARG_DEBUG_XPT); + CAM_ARG_DEBUG_XPT|CAM_ARG_DEBUG_PROBE); } else if (strncmp(tstr, "all", 3) != 0) { tmpstr = (char *)strtok(tstr, ":"); if ((tmpstr != NULL) && (*tmpstr != '\0')){ From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 10:50:29 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EEA31065674; Mon, 4 Jun 2012 10:50:29 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) by mx1.freebsd.org (Postfix) with ESMTP id 58EA78FC0C; Mon, 4 Jun 2012 10:50:29 +0000 (UTC) Received: from [192.168.0.2] (cpc11-cwma8-2-0-cust430.7-3.cable.virginmedia.com [82.11.219.175]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id q54Ao7F2037168 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Mon, 4 Jun 2012 10:50:22 GMT (envelope-from theraven@FreeBSD.org) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: David Chisnall In-Reply-To: <4FCC873B.90104@freebsd.org> Date: Mon, 4 Jun 2012 11:44:31 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201206021810.q52IAGZA004238@svn.freebsd.org> <4FCC873B.90104@freebsd.org> To: Tijl Coosemans X-Mailer: Apple Mail (2.1257) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Konstantin Belousov Subject: Re: svn commit: r236456 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 10:50:29 -0000 On 4 Jun 2012, at 11:00, Tijl Coosemans wrote: > On 02-06-2012 20:10, Konstantin Belousov wrote: >> Author: kib >> Date: Sat Jun 2 18:10:16 2012 >> New Revision: 236456 >> URL: http://svn.freebsd.org/changeset/base/236456 >>=20 >> Log: >> Use plain store for atomic_store_rel on x86, instead of implicitly >> locked xchg instruction. IA32 memory model guarantees that store = has >> release semantic, since stores cannot pass loads or stores. >=20 > They can pass non-temporal stores can't they? Now that we have support for C11 atomics via stdatomic.h (in current and = stable), it would be nice to compare their performance with the assembly = versions. There is the potential for greater optimisation, because the = compiler treats any asm block as a full barrier, so only the CPU, not = the compiler, can reorder loads and stores across it. With the C11 = stuff, on a new compiler (clang or gcc 4.7), the compiler can perform = any reordering of loads and stores that does not violate the semantics = specified by the atomic operation. David= From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 12:36:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A0201065670; Mon, 4 Jun 2012 12:36:59 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 846C78FC14; Mon, 4 Jun 2012 12:36:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54CaxB6041511; Mon, 4 Jun 2012 12:36:59 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54CaxO1041508; Mon, 4 Jun 2012 12:36:59 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201206041236.q54CaxO1041508@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Mon, 4 Jun 2012 12:36:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236559 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 12:36:59 -0000 Author: melifaro Date: Mon Jun 4 12:36:58 2012 New Revision: 236559 URL: http://svn.freebsd.org/changeset/base/236559 Log: Fix panic introduced by r235745. Panic occurs after first packet traverse renamed interface. Add several comments on locking Found by: avg Approved by: ae(mentor) Tested by: avg MFC after: 1 week Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Mon Jun 4 12:28:56 2012 (r236558) +++ head/sys/net/bpf.c Mon Jun 4 12:36:58 2012 (r236559) @@ -1704,6 +1704,14 @@ bpfioctl(struct cdev *dev, u_long cmd, c /* * Set d's packet filter program to fp. If this file already has a filter, * free it and replace it. Returns EINVAL for bogus requests. + * + * Note we need global lock here to serialize bpf_setf() and bpf_setif() calls + * since reading d->bd_bif can't be protected by d or interface lock due to + * lock order. + * + * Additionally, we have to acquire interface write lock due to bpf_mtap() uses + * interface read lock to read all filers. + * */ static int bpf_setf(struct bpf_d *d, struct bpf_program *fp, u_long cmd) @@ -2535,20 +2543,32 @@ bpfdetach(struct ifnet *ifp) } /* - * Interface departure handler + * Interface departure handler. + * Note departure event does not guagantee interface is going down. */ static void bpf_ifdetach(void *arg __unused, struct ifnet *ifp) { struct bpf_if *bp; - if ((bp = ifp->if_bpf) == NULL) + BPF_LOCK(); + if ((bp = ifp->if_bpf) == NULL) { + BPF_UNLOCK(); + return; + } + + /* Check if bpfdetach() was called previously */ + if ((bp->flags & BPFIF_FLAG_DYING) == 0) { + BPF_UNLOCK(); return; + } CTR3(KTR_NET, "%s: freing BPF instance %p for interface %p", __func__, bp, ifp); ifp->if_bpf = NULL; + BPF_UNLOCK(); + rw_destroy(&bp->bif_lock); free(bp, M_BPF); } From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 12:49:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 70BBC106566C; Mon, 4 Jun 2012 12:49:22 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BB358FC15; Mon, 4 Jun 2012 12:49:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54CnMqf042024; Mon, 4 Jun 2012 12:49:22 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54CnM32042022; Mon, 4 Jun 2012 12:49:22 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201206041249.q54CnM32042022@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 4 Jun 2012 12:49:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236560 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 12:49:22 -0000 Author: glebius Date: Mon Jun 4 12:49:21 2012 New Revision: 236560 URL: http://svn.freebsd.org/changeset/base/236560 Log: Optimise kern_sendfile(): skip cycling through the entire mbuf chain in m_cat(), storing pointer to last mbuf in chain in local variable and attaching new mbuf to the end of chain. Submitter reports that CPU load dropped for > 10% on a web server serving large files with this optimisation. Submitted by: Sergey Budnevitch Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Mon Jun 4 12:36:58 2012 (r236559) +++ head/sys/kern/uipc_syscalls.c Mon Jun 4 12:49:21 2012 (r236560) @@ -1962,6 +1962,7 @@ kern_sendfile(struct thread *td, struct * and takes care of the overall progress. */ for (off = uap->offset, rem = uap->nbytes; ; ) { + struct mbuf *mtail = NULL; int loopbytes = 0; int space = 0; int done = 0; @@ -2181,10 +2182,15 @@ retry_space: m0->m_len = xfsize; /* Append to mbuf chain. */ - if (m != NULL) - m_cat(m, m0); - else - m = m0; + if (mtail != NULL) { + mtail->m_next = m0; + } else { + if (m != NULL) + m_cat(m, m0); + else + m = m0; + } + mtail = m0; /* Keep track of bits processed. */ loopbytes += xfsize; From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 12:51:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B6F0E106564A; Mon, 4 Jun 2012 12:51:04 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 1547D8FC26; Mon, 4 Jun 2012 12:51:03 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q54CooJ8097542; Mon, 4 Jun 2012 15:50:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q54CooLc091323; Mon, 4 Jun 2012 15:50:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q54Coo08091322; Mon, 4 Jun 2012 15:50:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 4 Jun 2012 15:50:50 +0300 From: Konstantin Belousov To: Tijl Coosemans Message-ID: <20120604125050.GA85127@deviant.kiev.zoral.com.ua> References: <201206021810.q52IAGZA004238@svn.freebsd.org> <4FCC873B.90104@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5vNYLRcllDrimb99" Content-Disposition: inline In-Reply-To: <4FCC873B.90104@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r236456 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 12:51:04 -0000 --5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 04, 2012 at 12:00:27PM +0200, Tijl Coosemans wrote: > On 02-06-2012 20:10, Konstantin Belousov wrote: > > Author: kib > > Date: Sat Jun 2 18:10:16 2012 > > New Revision: 236456 > > URL: http://svn.freebsd.org/changeset/base/236456 > >=20 > > Log: > > Use plain store for atomic_store_rel on x86, instead of implicitly > > locked xchg instruction. IA32 memory model guarantees that store has > > release semantic, since stores cannot pass loads or stores. >=20 > They can pass non-temporal stores can't they? Sure. But (our) barriers only work for WB memory accesses, in respect to ot= her WB memory accesses. The atomic(9) contains not quite explicit mention of the requirement, for ia32 and more direct notion for ia64. It could probably be reworded to mention memory access type explicitely for ia32 too. At least the code which I saw and maintain which uses the mixed accesses to the same physical page, sometime including non-CPU caches coherency protocols, use explicit {s,m}fence barriers as needed. --5vNYLRcllDrimb99 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/MrykACgkQC3+MBN1Mb4gfcwCfZegTw+qe1tj4qPpT8osb1267 SpgAnivKjpW3WAIf7FOx7DrJtkAcloaL =QyCF -----END PGP SIGNATURE----- --5vNYLRcllDrimb99-- From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 14:05:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E644106564A; Mon, 4 Jun 2012 14:05:26 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 425C68FC14; Mon, 4 Jun 2012 14:05:25 +0000 (UTC) Received: by laai10 with SMTP id i10so3816877laa.13 for ; Mon, 04 Jun 2012 07:05:24 -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 :content-transfer-encoding; bh=+A5L7pd1wMBvAxqm7YAh0KmSMcw8+4BidHzM8puCTFg=; b=woBJXglRH5zXmjIhVQO8XZKU2BHrsURcB2aUon7HCm2A4uwqLjiEpQvC/4WssSWTaj IIbR3bBcxau2/A3lQD15bkdmrWi51y854uAtVnMcf9VmQ1JmVKBP85mJX/ureWoPkhND 7aXXNtr3ktRWfSHxR2muQA9j803ZaA/Tyck8VI53hpEAos/VdQtDg+6sazNhie8hp9SJ N1pfpGusRl8Z6adcDgla9cjkuJK7rIQBk1dhldLwF963czmclbzcvyGG0x0Z2SNSo9Ey bduAXy7NeS/GEdLCVtJnVLfnYUPMHUkJdxt7Q7UHsRSZiv6eZRaMDOk3RJPdRsFgQRgK yWLQ== MIME-Version: 1.0 Received: by 10.112.103.194 with SMTP id fy2mr6215541lbb.64.1338818337361; Mon, 04 Jun 2012 06:58:57 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.27.65 with HTTP; Mon, 4 Jun 2012 06:58:57 -0700 (PDT) In-Reply-To: <20120604125050.GA85127@deviant.kiev.zoral.com.ua> References: <201206021810.q52IAGZA004238@svn.freebsd.org> <4FCC873B.90104@freebsd.org> <20120604125050.GA85127@deviant.kiev.zoral.com.ua> Date: Mon, 4 Jun 2012 14:58:57 +0100 X-Google-Sender-Auth: y1ZYnXydrcaQp7JLU5eKqVew7dY Message-ID: From: Attilio Rao To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Tijl Coosemans , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r236456 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 14:05:26 -0000 2012/6/4 Konstantin Belousov : > On Mon, Jun 04, 2012 at 12:00:27PM +0200, Tijl Coosemans wrote: >> On 02-06-2012 20:10, Konstantin Belousov wrote: >> > Author: kib >> > Date: Sat Jun =C2=A02 18:10:16 2012 >> > New Revision: 236456 >> > URL: http://svn.freebsd.org/changeset/base/236456 >> > >> > Log: >> > =C2=A0 Use plain store for atomic_store_rel on x86, instead of implici= tly >> > =C2=A0 locked xchg instruction. =C2=A0IA32 memory model guarantees tha= t store has >> > =C2=A0 release semantic, since stores cannot pass loads or stores. >> >> They can pass non-temporal stores can't they? > Sure. But (our) barriers only work for WB memory accesses, in respect to = other > WB memory accesses. > > The atomic(9) contains not quite explicit mention of the requirement, > for ia32 and more direct notion for ia64. It could probably be reworded t= o > mention memory access type explicitely for ia32 too. I don't think this is right. What if I want to use NTI in a block of code locked? What if I want to use CLFLUSH? I simply cannot do that now because of the reordering requirement. Also, there is the more worrisome case of the string operations. If gcc/clang optimize the code in order to do string operations between locked path, this is not valid anymore as they can be reordered against the _rel() barrier. However, we should consider atomic(9) as a script for MI requirement of our locking primitives among the architectures. Right now too many things live on assumptions of people doing patches (like this case) rather than actually working on a common policy of what we can easilly support and what we can't. I also wondered often if we should use *fence on architectures supporting them, by default, because of the possibility to use FPU now (which wasn't present back in the day) and thus we cannot really guarantee memory ordering over stores of memory areas bigger than a quad-word. If we don't want to add the burden, we should explicitely mention that in atomic(9) or any other place. Definitively: I think this patch violates some edge cases. Please back it o= ut. Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 14:11:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A9C5106566C; Mon, 4 Jun 2012 14:11:50 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 634DF8FC1A; Mon, 4 Jun 2012 14:11:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54EBouW045733; Mon, 4 Jun 2012 14:11:50 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54EBo4p045729; Mon, 4 Jun 2012 14:11:50 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201206041411.q54EBo4p045729@svn.freebsd.org> From: Isabell Long Date: Mon, 4 Jun 2012 14:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236562 - stable/9/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 14:11:50 -0000 Author: issyl0 (doc committer) Date: Mon Jun 4 14:11:49 2012 New Revision: 236562 URL: http://svn.freebsd.org/changeset/base/236562 Log: Merge r235848 from head to stable/9: Add two new locale-specific man pages: - libc/stdio/scanf_l.3 - libc/stdio/printf_l.3 Approved by: gabor (mentor) Added: stable/9/lib/libc/stdio/printf_l.3 - copied unchanged from r235848, head/lib/libc/stdio/printf_l.3 stable/9/lib/libc/stdio/scanf_l.3 - copied unchanged from r235848, head/lib/libc/stdio/scanf_l.3 Modified: stable/9/lib/libc/stdio/Makefile.inc Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdio/Makefile.inc ============================================================================== --- stable/9/lib/libc/stdio/Makefile.inc Mon Jun 4 13:41:22 2012 (r236561) +++ stable/9/lib/libc/stdio/Makefile.inc Mon Jun 4 14:11:49 2012 (r236562) @@ -36,7 +36,8 @@ MAN+= fclose.3 ferror.3 fflush.3 fgetln. fopen.3 fputs.3 \ fputws.3 fread.3 fseek.3 funopen.3 fwide.3 getc.3 \ getline.3 getwc.3 mktemp.3 \ - printf.3 putc.3 putwc.3 remove.3 scanf.3 setbuf.3 stdio.3 tmpnam.3 \ + printf.3 printf_l.3 putc.3 putwc.3 remove.3 scanf.3 scanf_l.3 setbuf.3 \ + stdio.3 tmpnam.3 \ ungetc.3 ungetwc.3 wprintf.3 wscanf.3 MLINKS+=fclose.3 fcloseall.3 @@ -63,11 +64,16 @@ MLINKS+=printf.3 asprintf.3 printf.3 dpr printf.3 vasprintf.3 printf.3 vdprintf.3 \ printf.3 vfprintf.3 printf.3 vprintf.3 printf.3 vsnprintf.3 \ printf.3 vsprintf.3 +MLINKS+=printf_l.3 asprintf_l.3 printf_l.3 fprintf_l.3 printf_l.3 snprintf_l.3 \ + printf_l.3 sprintf_l.3 printf_l.3 vasprintf_l.3 printf_l.3 vfprintf_l.3 \ + printf_l.3 vprintf_l.3 printf_l.3 vsnprintf_l.3 printf_l.3 vsprintf_l.3 MLINKS+=putc.3 fputc.3 putc.3 putc_unlocked.3 putc.3 putchar.3 \ putc.3 putchar_unlocked.3 putc.3 putw.3 MLINKS+=putwc.3 fputwc.3 putwc.3 putwchar.3 MLINKS+=scanf.3 fscanf.3 scanf.3 sscanf.3 scanf.3 vfscanf.3 scanf.3 vscanf.3 \ scanf.3 vsscanf.3 +MLINKS+=scanf_l.3 fscanf_l.3 scanf_l.3 sscanf_l.3 scanf_l.3 vfscanf_l.3 \ + scanf_l.3 vscanf_l.3 scanf_l.3 vsscanf_l.3 MLINKS+=setbuf.3 setbuffer.3 setbuf.3 setlinebuf.3 setbuf.3 setvbuf.3 MLINKS+=tmpnam.3 tempnam.3 tmpnam.3 tmpfile.3 MLINKS+=wprintf.3 fwprintf.3 wprintf.3 swprintf.3 \ Copied: stable/9/lib/libc/stdio/printf_l.3 (from r235848, head/lib/libc/stdio/printf_l.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libc/stdio/printf_l.3 Mon Jun 4 14:11:49 2012 (r236562, copy of r235848, head/lib/libc/stdio/printf_l.3) @@ -0,0 +1,80 @@ +.\" Copyright (c) 2012 Isabell Long +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 7, 2012 +.Dt PRINTF_L 3 +.Os +.Sh NAME +.Nm printf_l , +.Nm asprintf_l , +.Nm fprintf_l , +.Nm snprintf_l , +.Nm sprintf_l , +.Nm vasprintf_l , +.Nm vfprintf_l , +.Nm vprintf_l , +.Nm vsnprintf_l , +.Nm vsprintf_l +.Nd formatted output conversion +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft int +.Fn printf_l "locale_t loc" "const char * restrict format" "..." +.Ft int +.Fn asprintf_l "char **ret" "locale_t loc" "const char * format" "..." +.Ft int +.Fn fprintf_l "FILE * restrict stream" "locale_t loc" "const char * restrict format" "..." +.Ft int +.Fn snprintf_l "char * restrict str" "size_t size" "locale_t loc" "const char * restrict format" "..." +.Ft int +.Fn sprintf_l "char * restrict str" "locale_t loc" "const char * restrict format" "..." +.Ft int +.Fn vasprintf_l "char **ret" "locale_t loc" "const char *format" "va_list ap" +.Ft int +.Fn vfprintf_l "FILE * restrict stream" "locale_t loc" "const char * restrict format" "va_list ap" +.Ft int +.Fn vprintf_l "locale_t loc" "const char * restrict format" "va_list ap" +.Ft int +.Fn vsnprintf_l "char * restrict str" "size_t size" "locale_t loc" "const char * restrict format" "va_list ap" +.Ft int +.Fn vsprintf_l "char * restrict str" "locale_t loc" "const char * restrict format" "va_list ap" +.Sh DESCRIPTION +The above functions are used to convert formatted output in the locale +.Fa loc . +They behave in the same way as the versions without the _l suffix, but use +the specified locale rather than the global or per-thread locale. +See the specific manual pages for more information. +.Sh SEE ALSO +.Xr printf 3 , +.Xr xlocale 3 +.Sh STANDARDS +These functions do not conform to any specific standard so they should be +considered as non-portable local extensions. +.Sh HISTORY +These functions first appeared in Darwin and were first implemented in +.Fx 9.1 . Copied: stable/9/lib/libc/stdio/scanf_l.3 (from r235848, head/lib/libc/stdio/scanf_l.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libc/stdio/scanf_l.3 Mon Jun 4 14:11:49 2012 (r236562, copy of r235848, head/lib/libc/stdio/scanf_l.3) @@ -0,0 +1,70 @@ +.\" Copyright (c) 2012 Isabell Long +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 8, 2012 +.Dt SCANF_L 3 +.Os +.Sh NAME +.Nm scanf_l , +.Nm fscanf_l , +.Nm sscanf_l , +.Nm vfscanf_l , +.Nm vscanf_l , +.Nm vsscanf_l +.Nd input format conversion +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft int +.Fn scanf_l "locale_t loc" "const char * restrict format" "..." +.Ft int +.Fn fscanf_l "FILE * restrict stream" "locale_t loc" "const char * restrict format" "..." +.Ft int +.Fn sscanf_l "const char * restrict str" "locale_t loc" "const char * restrict format" "..." +.Ft int +.Fn vfscanf_l "FILE * restrict stream" "locale_t loc" "const char * restrict format" "va_list ap" +.Ft int +.Fn vscanf_l "locale_t loc" "const char * restrict format" "va_list ap" +.Ft int +.Fn vsscanf_l "const char * restrict str" "locale_t loc" "const char * restrict format" "va_list ap" +.Sh DESCRIPTION +The above functions scan input according to a specified +.Fa format +in the locale +.Fa loc . +They behave in the same way as the versions without the _l suffix, but use +the specific locale rather than the the global or per-thread locale. +See the specific manual pages for more information. +.Sh SEE ALSO +.Xr scanf 3 , +.Xr xlocale 3 +.Sh STANDARDS +These functions do not conform to any specific standard so they should be +considered as non-portable local extensions. +.Sh HISTORY +These functions first appeared in Darwin and were first implemented in +.Fx 9.1 . From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 14:18:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA88A106564A; Mon, 4 Jun 2012 14:18:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95E298FC0C; Mon, 4 Jun 2012 14:18:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54EIDnU046080; Mon, 4 Jun 2012 14:18:13 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54EIDU3046078; Mon, 4 Jun 2012 14:18:13 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201206041418.q54EIDU3046078@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 4 Jun 2012 14:18:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236563 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 14:18:13 -0000 Author: glebius Date: Mon Jun 4 14:18:13 2012 New Revision: 236563 URL: http://svn.freebsd.org/changeset/base/236563 Log: Microoptimisation of code from r236560, also coming from Nginx Inc. Submitted by: ru Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Mon Jun 4 14:11:49 2012 (r236562) +++ head/sys/kern/uipc_syscalls.c Mon Jun 4 14:18:13 2012 (r236563) @@ -2184,12 +2184,10 @@ retry_space: /* Append to mbuf chain. */ if (mtail != NULL) { mtail->m_next = m0; - } else { - if (m != NULL) - m_cat(m, m0); - else - m = m0; - } + } else if (m != NULL) + m_last(m)->m_next = m0; + else + m = m0; mtail = m0; /* Keep track of bits processed. */ From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 14:26:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75BA8106567B; Mon, 4 Jun 2012 14:26:06 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60FA48FC0C; Mon, 4 Jun 2012 14:26:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54EQ6f4046492; Mon, 4 Jun 2012 14:26:06 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54EQ6o7046489; Mon, 4 Jun 2012 14:26:06 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201206041426.q54EQ6o7046489@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 4 Jun 2012 14:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236564 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 14:26:06 -0000 Author: trasz Date: Mon Jun 4 14:26:05 2012 New Revision: 236564 URL: http://svn.freebsd.org/changeset/base/236564 Log: Please welcome Mateusz Guzik (mjg) as a new src committer. I'll be mentoring him. Mateusz will work on general bugfixing in various areas of the kernel. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Mon Jun 4 14:18:13 2012 (r236563) +++ svnadmin/conf/access Mon Jun 4 14:26:05 2012 (r236564) @@ -168,6 +168,7 @@ mdodd melifaro miwi mjacob +mjg mlaier mm mohans Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Mon Jun 4 14:18:13 2012 (r236563) +++ svnadmin/conf/mentors Mon Jun 4 14:26:05 2012 (r236564) @@ -27,6 +27,7 @@ jwd rmacklem kargl das melifaro ae Co-mentor: kib miwi rwatson +mjg trasz monthadar adrian nork imp pfg jhb From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 14:27:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D635106564A; Mon, 4 Jun 2012 14:27:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 330D08FC18; Mon, 4 Jun 2012 14:27:54 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q54ERoGK011115; Mon, 4 Jun 2012 17:27:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q54ERnu1091772; Mon, 4 Jun 2012 17:27:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q54ERnho091771; Mon, 4 Jun 2012 17:27:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 4 Jun 2012 17:27:49 +0300 From: Konstantin Belousov To: Attilio Rao Message-ID: <20120604142749.GB85127@deviant.kiev.zoral.com.ua> References: <201206021810.q52IAGZA004238@svn.freebsd.org> <4FCC873B.90104@freebsd.org> <20120604125050.GA85127@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OwLcNYc0lM97+oe1" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, Tijl Coosemans , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r236456 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 14:27:54 -0000 --OwLcNYc0lM97+oe1 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 04, 2012 at 02:58:57PM +0100, Attilio Rao wrote: > 2012/6/4 Konstantin Belousov : > > On Mon, Jun 04, 2012 at 12:00:27PM +0200, Tijl Coosemans wrote: > >> On 02-06-2012 20:10, Konstantin Belousov wrote: > >> > Author: kib > >> > Date: Sat Jun =9A2 18:10:16 2012 > >> > New Revision: 236456 > >> > URL: http://svn.freebsd.org/changeset/base/236456 > >> > > >> > Log: > >> > =9A Use plain store for atomic_store_rel on x86, instead of implicit= ly > >> > =9A locked xchg instruction. =9AIA32 memory model guarantees that st= ore has > >> > =9A release semantic, since stores cannot pass loads or stores. > >> > >> They can pass non-temporal stores can't they? > > Sure. But (our) barriers only work for WB memory accesses, in respect t= o other > > WB memory accesses. > > > > The atomic(9) contains not quite explicit mention of the requirement, > > for ia32 and more direct notion for ia64. It could probably be reworded= to > > mention memory access type explicitely for ia32 too. >=20 > I don't think this is right. > What if I want to use NTI in a block of code locked? What if I want to > use CLFLUSH? I simply cannot do that now because of the reordering > requirement. Assuming that NTI means "Non Temporal Instruction", Intel explicit requirement is to use fence barrier if order shall be ensured. This, as well as CLFLUSH use, is somewhat commonly documented. More, CLFLUSH is documented by Intel to _not_ serialize with any other fencing or serialization instruction, except MFENCE. So xchg-based _store_rel is not different from mov-based _store_rel for CLFLUSH and non-temporal ops. I do not see how you note is relevant. > Also, there is the more worrisome case of the string operations. If > gcc/clang optimize the code in order to do string operations between > locked path, this is not valid anymore as they can be reordered > against the _rel() barrier. They cannot. Fast string operation volatile store order only among string operation itself, the operation cannot pass sequential store. The store used in _store_rel thus cannot be passed by fast string optimizations. I do not see how you note is relevant there, again. >=20 > However, we should consider atomic(9) as a script for MI requirement > of our locking primitives among the architectures. Right now too many > things live on assumptions of people doing patches (like this case) > rather than actually working on a common policy of what we can easilly > support and what we can't. >=20 > I also wondered often if we should use *fence on architectures > supporting them, by default, because of the possibility to use FPU now > (which wasn't present back in the day) and thus we cannot really > guarantee memory ordering over stores of memory areas bigger than a > quad-word. If we don't want to add the burden, we should explicitely > mention that in atomic(9) or any other place. The proposal to use fence explicitely contradicts recommendations from the AMD Optimization Guide, which, JFYI, I cited in the updated comment in the patch. How is FPU relevant to the memory model discussion, I left out of the answer. >=20 > Definitively: I think this patch violates some edge cases. Please back it= out. No. I explicitely inform you that I consider the backout request as frivolous, technically unfounded, and that I will not back it out. --OwLcNYc0lM97+oe1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/MxeUACgkQC3+MBN1Mb4hpagCfSnSKT0ZdhVH3/wUvvdBe5TCH CeQAmwY/wASzpG9nu7uOB9GbxPywH9pb =GTZq -----END PGP SIGNATURE----- --OwLcNYc0lM97+oe1-- From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 15:21:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35C7E106566B; Mon, 4 Jun 2012 15:21:14 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21A7A8FC08; Mon, 4 Jun 2012 15:21:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54FLD0A049272; Mon, 4 Jun 2012 15:21:13 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54FLDHK049270; Mon, 4 Jun 2012 15:21:13 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201206041521.q54FLDHK049270@svn.freebsd.org> From: Mateusz Guzik Date: Mon, 4 Jun 2012 15:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236565 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 15:21:14 -0000 Author: mjg Date: Mon Jun 4 15:21:13 2012 New Revision: 236565 URL: http://svn.freebsd.org/changeset/base/236565 Log: Add myself as a new committer. Approved by: trasz (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Mon Jun 4 14:26:05 2012 (r236564) +++ head/share/misc/committers-src.dot Mon Jun 4 15:21:13 2012 (r236565) @@ -200,6 +200,7 @@ mdf [label="Matthew Fleming\nmdf@FreeBSD mdodd [label="Matthew N. Dodd\nmdodd@FreeBSD.org\n1999/07/27"] melifaro [label="Alexander V. Chernikov\nmelifaro@FreeBSD.org\n2011/10/04"] mjacob [label="Matt Jacob\nmjacob@FreeBSD.org\n1997/08/13"] +mjg [label="Mateusz Guzik\nmjg@FreeBSD.org\n2012/06/04"] mlaier [label="Max Laier\nmlaier@FreeBSD.org\n2004/02/10"] monthadar [label="Monthadar Al Jaberi\nmonthadar@FreeBSD.org\n2012/04/02"] mr [label="Michael Reifenberger\nmr@FreeBSD.org\n2001/09/30"] @@ -602,6 +603,7 @@ thompsa -> weongyo thompsa -> eri trasz -> jh +trasz -> mjg ume -> jinmei ume -> suz From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 15:59:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AFBE2106564A; Mon, 4 Jun 2012 15:59:23 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1B7548FC17; Mon, 4 Jun 2012 15:59:23 +0000 (UTC) Received: by vcbfy7 with SMTP id fy7so3117925vcb.13 for ; Mon, 04 Jun 2012 08:59:22 -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 :content-transfer-encoding; bh=I7j3+u3OZP4BsX7gYWzrDonkwq6C+gDc6oE/uggpBfs=; b=GaURxQ77HMntzwkDi9tbp5yxgag9WgMZnGFqOmXZPkHcDSx37Tj7S/LIbcXp9oRpgt lbFfJLEB/NUFn4Ow0kLdOBcX6CtIapyQf4G+GRZMGGz15fi5rv5DFTklH72F36bGdjP2 q/wBw4jS3uQkrzr/wSq5pRRI6Du0DrtFw0/4oLFdic28XaB7c38Zg0MBV9QRnDVi0dRG VRgDK8p2PJ8Pq4uBM8ygD9/eSYmcb8DTW5K7BqQfBKrwfKLycY7SFeI8Os5n+qbWnwiS ZXZm1Pg/aIFYCNZqNwQrNw+tQv00j+C4+3bS9n59uN+Ag2pF2NbsTGGeWFHtWbIrTrYD LJZQ== MIME-Version: 1.0 Received: by 10.220.240.147 with SMTP id la19mr12749181vcb.47.1338825562557; Mon, 04 Jun 2012 08:59:22 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.220.99.11 with HTTP; Mon, 4 Jun 2012 08:59:22 -0700 (PDT) In-Reply-To: <20120604142749.GB85127@deviant.kiev.zoral.com.ua> References: <201206021810.q52IAGZA004238@svn.freebsd.org> <4FCC873B.90104@freebsd.org> <20120604125050.GA85127@deviant.kiev.zoral.com.ua> <20120604142749.GB85127@deviant.kiev.zoral.com.ua> Date: Mon, 4 Jun 2012 16:59:22 +0100 X-Google-Sender-Auth: Bfkhj8qksNTxAFBMYR4VWYzr9r0 Message-ID: From: Attilio Rao To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Tijl Coosemans , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r236456 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 15:59:23 -0000 2012/6/4 Konstantin Belousov : > On Mon, Jun 04, 2012 at 02:58:57PM +0100, Attilio Rao wrote: >> 2012/6/4 Konstantin Belousov : >> > On Mon, Jun 04, 2012 at 12:00:27PM +0200, Tijl Coosemans wrote: >> >> On 02-06-2012 20:10, Konstantin Belousov wrote: >> >> > Author: kib >> >> > Date: Sat Jun =C2=A02 18:10:16 2012 >> >> > New Revision: 236456 >> >> > URL: http://svn.freebsd.org/changeset/base/236456 >> >> > >> >> > Log: >> >> > =C2=A0 Use plain store for atomic_store_rel on x86, instead of impl= icitly >> >> > =C2=A0 locked xchg instruction. =C2=A0IA32 memory model guarantees = that store has >> >> > =C2=A0 release semantic, since stores cannot pass loads or stores. >> >> >> >> They can pass non-temporal stores can't they? >> > Sure. But (our) barriers only work for WB memory accesses, in respect = to other >> > WB memory accesses. >> > >> > The atomic(9) contains not quite explicit mention of the requirement, >> > for ia32 and more direct notion for ia64. It could probably be reworde= d to >> > mention memory access type explicitely for ia32 too. >> >> I don't think this is right. >> What if I want to use NTI in a block of code locked? What if I want to >> use CLFLUSH? I simply cannot do that now because of the reordering >> requirement. > Assuming that NTI means "Non Temporal Instruction", Intel explicit > requirement is to use fence barrier if order shall be ensured. This, > as well as CLFLUSH use, is somewhat commonly documented. More, CLFLUSH > is documented by Intel to _not_ serialize with any other fencing or > serialization instruction, except MFENCE. So xchg-based _store_rel is > not different from mov-based _store_rel for CLFLUSH and non-temporal > ops. > > I do not see how you note is relevant. > >> Also, there is the more worrisome case of the string operations. If >> gcc/clang optimize the code in order to do string operations between >> locked path, this is not valid anymore as they can be reordered >> against the _rel() barrier. > They cannot. Fast string operation volatile store order only among > string operation itself, the operation cannot pass sequential store. > The store used in _store_rel thus cannot be passed by fast string > optimizations. > > I do not see how you note is relevant there, again. I'm not sure why but I thought that the string writes could be re-ordered against "external" writes too, but I re-read the manual and this is not the case. > >> >> However, we should consider atomic(9) as a script for MI requirement >> of our locking primitives among the architectures. Right now too many >> things live on assumptions of people doing patches (like this case) >> rather than actually working on a common policy of what we can easilly >> support and what we can't. >> >> I also wondered often if we should use *fence on architectures >> supporting them, by default, because of the possibility to use FPU now >> (which wasn't present back in the day) and thus we cannot really >> guarantee memory ordering over stores of memory areas bigger than a >> quad-word. If we don't want to add the burden, we should explicitely >> mention that in atomic(9) or any other place. > The proposal to use fence explicitely contradicts recommendations from > the AMD Optimization Guide, which, JFYI, I cited in the updated comment > in the patch. > > How is FPU relevant to the memory model discussion, I left out of the > answer. I'm not saying to use *fence, I'm saying that we should document MD cases where this is required (we can use agnostic terms like "simple barrier") in atomic(9). Also, about FPU, I'm saying that before we had no need to consider FPU/XMM into consideration from a model perspective but now we should do that because we can use FPU within the kernel. >> Definitively: I think this patch violates some edge cases. Please back i= t out. > No. I explicitely inform you that I consider the backout request > as frivolous, technically unfounded, and that I will not back it out. My main motivation for asking the backout was for the ordering issue with the string operations, but it doesn't seem to be the case, than I withdraw my request, sorry. I'm fine with using explicit memory barriers in MD code that use NTI (I just assume gcc/clang won't over-optimize things on their own as thinking they want to reduce cache traffic by using NTI). Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 16:04:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3EAC81065670; Mon, 4 Jun 2012 16:04:02 +0000 (UTC) (envelope-from zml@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A23D8FC25; Mon, 4 Jun 2012 16:04:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54G427K051189; Mon, 4 Jun 2012 16:04:02 GMT (envelope-from zml@svn.freebsd.org) Received: (from zml@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54G41He051186; Mon, 4 Jun 2012 16:04:01 GMT (envelope-from zml@svn.freebsd.org) Message-Id: <201206041604.q54G41He051186@svn.freebsd.org> From: Zachary Loafman Date: Mon, 4 Jun 2012 16:04:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236566 - in head/sys/cddl/dev/dtrace: amd64 i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 16:04:02 -0000 Author: zml Date: Mon Jun 4 16:04:01 2012 New Revision: 236566 URL: http://svn.freebsd.org/changeset/base/236566 Log: Fix DTrace TSC skew calculation: The skew calculation here is exactly backwards. We were able to repro it on a multi-package ESX server running a FreeBSD VM, where the TSCs can be pretty evil. MFC after: 1 week Submitted by: Jeff Ford Reviewed by: avg, gnn Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Jun 4 15:21:13 2012 (r236565) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Jun 4 16:04:01 2012 (r236566) @@ -446,7 +446,7 @@ dtrace_gethrtime() * (see nsec_scale calculations) taking into account 32-bit shift of * the higher half and finally add. */ - tsc = rdtsc() + tsc_skew[curcpu]; + tsc = rdtsc() - tsc_skew[curcpu]; lo = tsc; hi = tsc >> 32; return (((lo * nsec_scale) >> SCALE_SHIFT) + Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Jun 4 15:21:13 2012 (r236565) +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Jun 4 16:04:01 2012 (r236566) @@ -447,7 +447,7 @@ dtrace_gethrtime() * (see nsec_scale calculations) taking into account 32-bit shift of * the higher half and finally add. */ - tsc = rdtsc() + tsc_skew[curcpu]; + tsc = rdtsc() - tsc_skew[curcpu]; lo = tsc; hi = tsc >> 32; return (((lo * nsec_scale) >> SCALE_SHIFT) + From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 16:15:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 49F90106567B; Mon, 4 Jun 2012 16:15:41 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 347808FC19; Mon, 4 Jun 2012 16:15:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54GFfGU051786; Mon, 4 Jun 2012 16:15:41 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54GFeI6051783; Mon, 4 Jun 2012 16:15:40 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201206041615.q54GFeI6051783@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 4 Jun 2012 16:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236567 - in head/sys/cddl/dev/dtrace: amd64 i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 16:15:41 -0000 Author: gnn Date: Mon Jun 4 16:15:40 2012 New Revision: 236567 URL: http://svn.freebsd.org/changeset/base/236567 Log: Integrate a fix for a very odd signal delivery problem found by Bryan Cantril and others in the Solaris/Illumos version of DTrace. Obtained from: https://www.illumos.org/issues/789 MFC after: 2 weeks Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Jun 4 16:04:01 2012 (r236566) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Jun 4 16:15:40 2012 (r236567) @@ -27,6 +27,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + #include #include #include @@ -297,14 +301,15 @@ dtrace_safe_defer_signal(void) } /* - * If we've executed the original instruction, but haven't performed - * the jmp back to t->t_dtrace_npc or the clean up of any registers - * used to emulate %rip-relative instructions in 64-bit mode, do that - * here and take the signal right away. We detect this condition by - * seeing if the program counter is the range [scrpc + isz, astpc). + * If we have executed the original instruction, but we have performed + * neither the jmp back to t->t_dtrace_npc nor the clean up of any + * registers used to emulate %rip-relative instructions in 64-bit mode, + * we'll save ourselves some effort by doing that here and taking the + * signal right away. We detect this condition by seeing if the program + * counter is the range [scrpc + isz, astpc). */ - if (t->t_dtrace_astpc - rp->r_pc < - t->t_dtrace_astpc - t->t_dtrace_scrpc - isz) { + if (rp->r_pc >= t->t_dtrace_scrpc + isz && + rp->r_pc < t->t_dtrace_astpc) { #ifdef __amd64 /* * If there is a scratch register and we're on the Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Jun 4 16:04:01 2012 (r236566) +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Jun 4 16:15:40 2012 (r236567) @@ -27,6 +27,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + #include #include #include @@ -298,14 +302,15 @@ dtrace_safe_defer_signal(void) } /* - * If we've executed the original instruction, but haven't performed - * the jmp back to t->t_dtrace_npc or the clean up of any registers - * used to emulate %rip-relative instructions in 64-bit mode, do that - * here and take the signal right away. We detect this condition by - * seeing if the program counter is the range [scrpc + isz, astpc). + * If we have executed the original instruction, but we have performed + * neither the jmp back to t->t_dtrace_npc nor the clean up of any + * registers used to emulate %rip-relative instructions in 64-bit mode, + * we'll save ourselves some effort by doing that here and taking the + * signal right away. We detect this condition by seeing if the program + * counter is the range [scrpc + isz, astpc). */ - if (t->t_dtrace_astpc - rp->r_pc < - t->t_dtrace_astpc - t->t_dtrace_scrpc - isz) { + if (rp->r_pc >= t->t_dtrace_scrpc + isz && + rp->r_pc < t->t_dtrace_astpc) { #ifdef __amd64 /* * If there is a scratch register and we're on the From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 16:25:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8BC2F1065677 for ; Mon, 4 Jun 2012 16:25:48 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm25.bullet.mail.sp2.yahoo.com (nm25.bullet.mail.sp2.yahoo.com [98.139.91.95]) by mx1.freebsd.org (Postfix) with SMTP id 2862E8FC15 for ; Mon, 4 Jun 2012 16:25:48 +0000 (UTC) Received: from [98.139.91.69] by nm25.bullet.mail.sp2.yahoo.com with NNFMP; 04 Jun 2012 16:25:42 -0000 Received: from [208.71.42.201] by tm9.bullet.mail.sp2.yahoo.com with NNFMP; 04 Jun 2012 16:25:42 -0000 Received: from [127.0.0.1] by smtp212.mail.gq1.yahoo.com with NNFMP; 04 Jun 2012 16:25:41 -0000 X-Yahoo-Newman-Id: 957978.77072.bm@smtp212.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: .FI5k8EVM1mXDSYyLEF.6GebxAj2PsydTfuwAaL5vJZbe1M BCIlKakYl3RCh1gqW6ywap5dUh6v9RfqugdQnp2LCmHjCDk1NJyu73cSLL9j kGnQCdJ5TjPFHm9Q5iMSiYdvscqojhH0KLj1B2B0NCrtJ9zryLfyMcr1eXe3 bQFPobmN0Zhsrsr6IOoa7SgZQfOn1Gr00whkztlDr1wFAGu5GGS3bMjlstGV GGQ5Zu6ySF8owWC3OH.yY2iFdg0pEVZC8_JN2QRDJehUoZaOADS_lam1SVhe 3yfexEC3ICeCMuARlyNQ33fFwkhMD1oZ1NgD99o3ctPzwMmLhqxiU4OnCQpp Wmcb1m_ro4yEv4NeKk.VvqOFG0.5Mrd0VelvkKBKZwBF.hZ8GVdeW0gZUspb zwAQ4rpLpJREqDiREz30De5CySgMmj08yxphVDWZVuL3_HzXO2G41ExSeaom kz0fBvDPgLJcpuP6YOVv1yDjwFcF47XcfyWpqzoZc860qlaoP3Mzm5ck.rhD .cH4YDjsvy6uSavfFuQfe3VGxGdijC03a.O296Eg14XQ43JEMPThJ4yMdhVK uyt1w8fX_S3oHu6Qtmg-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Received: from [192.168.10.102] (pfg@200.118.157.7 with plain) by smtp212.mail.gq1.yahoo.com with SMTP; 04 Jun 2012 09:25:41 -0700 PDT Message-ID: <4FCCE183.4060002@FreeBSD.org> Date: Mon, 04 Jun 2012 11:25:39 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120506 Thunderbird/12.0.1 MIME-Version: 1.0 To: "George V. Neville-Neil" References: <201206041615.q54GFeI6051783@svn.freebsd.org> In-Reply-To: <201206041615.q54GFeI6051783@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 Subject: Re: svn commit: r236567 - in head/sys/cddl/dev/dtrace: amd64 i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 16:25:48 -0000 On 06/04/12 11:15, George V. Neville-Neil wrote: > Author: gnn > Date: Mon Jun 4 16:15:40 2012 > New Revision: 236567 > URL: http://svn.freebsd.org/changeset/base/236567 > > Log: > Integrate a fix for a very odd signal delivery problem found > by Bryan Cantril and others in the Solaris/Illumos version of DTrace. > > Obtained from: https://www.illumos.org/issues/789 > MFC after: 2 weeks And it looks like kern/164724 :) cheers, Pedro. > Modified: > head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c > head/sys/cddl/dev/dtrace/i386/dtrace_subr.c > > Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c > ============================================================================== > --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Jun 4 16:04:01 2012 (r236566) > +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Jun 4 16:15:40 2012 (r236567) > @@ -27,6 +27,10 @@ > * Use is subject to license terms. > */ > > +/* > + * Copyright (c) 2011, Joyent, Inc. All rights reserved. > + */ > + > #include > #include > #include > @@ -297,14 +301,15 @@ dtrace_safe_defer_signal(void) > } > > /* > - * If we've executed the original instruction, but haven't performed > - * the jmp back to t->t_dtrace_npc or the clean up of any registers > - * used to emulate %rip-relative instructions in 64-bit mode, do that > - * here and take the signal right away. We detect this condition by > - * seeing if the program counter is the range [scrpc + isz, astpc). > + * If we have executed the original instruction, but we have performed > + * neither the jmp back to t->t_dtrace_npc nor the clean up of any > + * registers used to emulate %rip-relative instructions in 64-bit mode, > + * we'll save ourselves some effort by doing that here and taking the > + * signal right away. We detect this condition by seeing if the program > + * counter is the range [scrpc + isz, astpc). > */ > - if (t->t_dtrace_astpc - rp->r_pc< > - t->t_dtrace_astpc - t->t_dtrace_scrpc - isz) { > + if (rp->r_pc>= t->t_dtrace_scrpc + isz&& > + rp->r_pc< t->t_dtrace_astpc) { > #ifdef __amd64 > /* > * If there is a scratch register and we're on the > > Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c > ============================================================================== > --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Jun 4 16:04:01 2012 (r236566) > +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Jun 4 16:15:40 2012 (r236567) > @@ -27,6 +27,10 @@ > * Use is subject to license terms. > */ > > +/* > + * Copyright (c) 2011, Joyent, Inc. All rights reserved. > + */ > + > #include > #include > #include > @@ -298,14 +302,15 @@ dtrace_safe_defer_signal(void) > } > > /* > - * If we've executed the original instruction, but haven't performed > - * the jmp back to t->t_dtrace_npc or the clean up of any registers > - * used to emulate %rip-relative instructions in 64-bit mode, do that > - * here and take the signal right away. We detect this condition by > - * seeing if the program counter is the range [scrpc + isz, astpc). > + * If we have executed the original instruction, but we have performed > + * neither the jmp back to t->t_dtrace_npc nor the clean up of any > + * registers used to emulate %rip-relative instructions in 64-bit mode, > + * we'll save ourselves some effort by doing that here and taking the > + * signal right away. We detect this condition by seeing if the program > + * counter is the range [scrpc + isz, astpc). > */ > - if (t->t_dtrace_astpc - rp->r_pc< > - t->t_dtrace_astpc - t->t_dtrace_scrpc - isz) { > + if (rp->r_pc>= t->t_dtrace_scrpc + isz&& > + rp->r_pc< t->t_dtrace_astpc) { > #ifdef __amd64 > /* > * If there is a scratch register and we're on the From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 17:22:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0964106566B; Mon, 4 Jun 2012 17:22:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC84A8FC1A; Mon, 4 Jun 2012 17:22:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54HMhmU055034; Mon, 4 Jun 2012 17:22:43 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54HMh9n055032; Mon, 4 Jun 2012 17:22:43 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201206041722.q54HMh9n055032@svn.freebsd.org> From: Dimitry Andric Date: Mon, 4 Jun 2012 17:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236571 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 17:22:44 -0000 Author: dim Date: Mon Jun 4 17:22:43 2012 New Revision: 236571 URL: http://svn.freebsd.org/changeset/base/236571 Log: Make aicasm compile without warnings if -Wpointer-sign is enabled. MFC after: 3 days Modified: head/sys/dev/aic7xxx/aicasm/aicasm.c Modified: head/sys/dev/aic7xxx/aicasm/aicasm.c ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm.c Mon Jun 4 17:13:32 2012 (r236570) +++ head/sys/dev/aic7xxx/aicasm/aicasm.c Mon Jun 4 17:22:43 2012 (r236571) @@ -530,7 +530,7 @@ output_listing(char *ifilename) int instrptr; unsigned int line; int func_count; - int skip_addr; + unsigned int skip_addr; instrcount = 0; instrptr = 0; From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 17:50:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 44AE4106567A; Mon, 4 Jun 2012 17:50:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 13E308FC1E; Mon, 4 Jun 2012 17:50:12 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 71154B99F; Mon, 4 Jun 2012 13:50:11 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Date: Mon, 4 Jun 2012 12:09:41 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p13; KDE/4.5.5; amd64; ; ) References: <201206021810.q52IAGZA004238@svn.freebsd.org> <20120604142749.GB85127@deviant.kiev.zoral.com.ua> In-Reply-To: <20120604142749.GB85127@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201206041209.42075.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 04 Jun 2012 13:50:11 -0400 (EDT) Cc: Attilio Rao , svn-src-head@freebsd.org, Tijl Coosemans , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r236456 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 17:50:12 -0000 On Monday, June 04, 2012 10:27:49 am Konstantin Belousov wrote: > On Mon, Jun 04, 2012 at 02:58:57PM +0100, Attilio Rao wrote: > > 2012/6/4 Konstantin Belousov : > > > On Mon, Jun 04, 2012 at 12:00:27PM +0200, Tijl Coosemans wrote: > > >> On 02-06-2012 20:10, Konstantin Belousov wrote: > > >> > Author: kib > > >> > Date: Sat Jun 2 18:10:16 2012 > > >> > New Revision: 236456 > > >> > URL: http://svn.freebsd.org/changeset/base/236456 > > >> > > > >> > Log: > > >> > Use plain store for atomic_store_rel on x86, instead of implicitly > > >> > locked xchg instruction. IA32 memory model guarantees that store has > > >> > release semantic, since stores cannot pass loads or stores. > > >> > > >> They can pass non-temporal stores can't they? > > > Sure. But (our) barriers only work for WB memory accesses, in respect to other > > > WB memory accesses. > > > > > > The atomic(9) contains not quite explicit mention of the requirement, > > > for ia32 and more direct notion for ia64. It could probably be reworded to > > > mention memory access type explicitely for ia32 too. > > > > I don't think this is right. > > What if I want to use NTI in a block of code locked? What if I want to > > use CLFLUSH? I simply cannot do that now because of the reordering > > requirement. > Assuming that NTI means "Non Temporal Instruction", Intel explicit > requirement is to use fence barrier if order shall be ensured. This, > as well as CLFLUSH use, is somewhat commonly documented. More, CLFLUSH > is documented by Intel to _not_ serialize with any other fencing or > serialization instruction, except MFENCE. So xchg-based _store_rel is > not different from mov-based _store_rel for CLFLUSH and non-temporal > ops. I agree, having recently worked with movnt at work, if you are going to use these instructions, you will need to use your own explicit fences. No code should depend on implict barriers in locking primitives for working with movnt. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 18:02:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17E0F106566B; Mon, 4 Jun 2012 18:02:10 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0286C8FC1D; Mon, 4 Jun 2012 18:02:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54I29Ls056892; Mon, 4 Jun 2012 18:02:09 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54I29nZ056889; Mon, 4 Jun 2012 18:02:09 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201206041802.q54I29nZ056889@svn.freebsd.org> From: Xin LI Date: Mon, 4 Jun 2012 18:02:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236572 - head/usr.sbin/inetd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 18:02:10 -0000 Author: delphij Date: Mon Jun 4 18:02:09 2012 New Revision: 236572 URL: http://svn.freebsd.org/changeset/base/236572 Log: Replace the use of wall clock time with monotonically increasing clock. In general, gettimeofday() is not appropriate interface when accounting for elasped time because it can go backward, in which case the policy code could errornously consider the limit as exceeded. MFC after: 1 week Reported by: Mahesh Arumugam Submitted by: Dorr H. Clark via gnn Sponsored by: Citrix / NetScaler Modified: head/usr.sbin/inetd/inetd.c head/usr.sbin/inetd/inetd.h Modified: head/usr.sbin/inetd/inetd.c ============================================================================== --- head/usr.sbin/inetd/inetd.c Mon Jun 4 17:22:43 2012 (r236571) +++ head/usr.sbin/inetd/inetd.c Mon Jun 4 18:02:09 2012 (r236572) @@ -688,11 +688,11 @@ main(int argc, char **argv) */ if (dofork) { if (sep->se_count++ == 0) - (void)gettimeofday(&sep->se_time, (struct timezone *)NULL); + (void)clock_gettime(CLOCK_MONOTONIC_FAST, &sep->se_time); else if (toomany > 0 && sep->se_count >= toomany) { - struct timeval now; + struct timespec now; - (void)gettimeofday(&now, (struct timezone *)NULL); + (void)clock_gettime(CLOCK_MONOTONIC_FAST, &now); if (now.tv_sec - sep->se_time.tv_sec > CNT_INTVL) { sep->se_time = now; Modified: head/usr.sbin/inetd/inetd.h ============================================================================== --- head/usr.sbin/inetd/inetd.h Mon Jun 4 17:22:43 2012 (r236571) +++ head/usr.sbin/inetd/inetd.h Mon Jun 4 18:02:09 2012 (r236572) @@ -109,7 +109,7 @@ struct servtab { u_int se_rpc_lowvers; /* RPC low version */ u_int se_rpc_highvers; /* RPC high version */ int se_count; /* number started since se_time */ - struct timeval se_time; /* start of se_count */ + struct timespec se_time; /* start of se_count */ struct servtab *se_next; struct se_flags { u_int se_nomapped : 1; From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 18:43:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 41FFD106564A; Mon, 4 Jun 2012 18:43:52 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CAB28FC14; Mon, 4 Jun 2012 18:43:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54IhqGF058867; Mon, 4 Jun 2012 18:43:52 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54Ihp07058865; Mon, 4 Jun 2012 18:43:51 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201206041843.q54Ihp07058865@svn.freebsd.org> From: Maksim Yevmenkin Date: Mon, 4 Jun 2012 18:43:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236575 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 18:43:52 -0000 Author: emax Date: Mon Jun 4 18:43:51 2012 New Revision: 236575 URL: http://svn.freebsd.org/changeset/base/236575 Log: Plug more refcount leaks and possible NULL deref for interface address list. Submitted by: scottl@ MFC after: 3 days Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Mon Jun 4 18:17:09 2012 (r236574) +++ head/sys/netinet/tcp_input.c Mon Jun 4 18:43:51 2012 (r236575) @@ -512,6 +512,8 @@ tcp6_input(struct mbuf **mp, int *offp, (caddr_t)&ip6->ip6_dst - (caddr_t)ip6); return IPPROTO_DONE; } + if (ia6) + ifa_free(&ia6->ia_ifa); tcp_input(m, *offp); return IPPROTO_DONE; @@ -1240,7 +1242,8 @@ relocked: rstreason = BANDLIM_RST_OPENPORT; goto dropwithreset; } - ifa_free(&ia6->ia_ifa); + if (ia6) + ifa_free(&ia6->ia_ifa); } #endif /* INET6 */ /* From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 18:58:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A98401065672; Mon, 4 Jun 2012 18:58:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id EB01B8FC14; Mon, 4 Jun 2012 18:58:00 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q54IvlvR053156; Mon, 4 Jun 2012 21:57:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q54IvkvG092903; Mon, 4 Jun 2012 21:57:46 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q54IvkJ3092902; Mon, 4 Jun 2012 21:57:46 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 4 Jun 2012 21:57:46 +0300 From: Konstantin Belousov To: Attilio Rao Message-ID: <20120604185746.GE85127@deviant.kiev.zoral.com.ua> References: <201206021810.q52IAGZA004238@svn.freebsd.org> <4FCC873B.90104@freebsd.org> <20120604125050.GA85127@deviant.kiev.zoral.com.ua> <20120604142749.GB85127@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VdOwlNaOFKGAtAAV" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, Tijl Coosemans , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r236456 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 18:58:01 -0000 --VdOwlNaOFKGAtAAV Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 04, 2012 at 04:59:22PM +0100, Attilio Rao wrote: > 2012/6/4 Konstantin Belousov : > > On Mon, Jun 04, 2012 at 02:58:57PM +0100, Attilio Rao wrote: > >> 2012/6/4 Konstantin Belousov : > >> > On Mon, Jun 04, 2012 at 12:00:27PM +0200, Tijl Coosemans wrote: > >> >> On 02-06-2012 20:10, Konstantin Belousov wrote: > >> >> > Author: kib > >> >> > Date: Sat Jun =9A2 18:10:16 2012 > >> >> > New Revision: 236456 > >> >> > URL: http://svn.freebsd.org/changeset/base/236456 > >> >> > > >> >> > Log: > >> >> > =9A Use plain store for atomic_store_rel on x86, instead of impli= citly > >> >> > =9A locked xchg instruction. =9AIA32 memory model guarantees that= store has > >> >> > =9A release semantic, since stores cannot pass loads or stores. > >> >> > >> >> They can pass non-temporal stores can't they? > >> > Sure. But (our) barriers only work for WB memory accesses, in respec= t to other > >> > WB memory accesses. > >> > > >> > The atomic(9) contains not quite explicit mention of the requirement, > >> > for ia32 and more direct notion for ia64. It could probably be rewor= ded to > >> > mention memory access type explicitely for ia32 too. > >> > >> I don't think this is right. > >> What if I want to use NTI in a block of code locked? What if I want to > >> use CLFLUSH? I simply cannot do that now because of the reordering > >> requirement. > > Assuming that NTI means "Non Temporal Instruction", Intel explicit > > requirement is to use fence barrier if order shall be ensured. This, > > as well as CLFLUSH use, is somewhat commonly documented. More, CLFLUSH > > is documented by Intel to _not_ serialize with any other fencing or > > serialization instruction, except MFENCE. So xchg-based _store_rel is > > not different from mov-based _store_rel for CLFLUSH and non-temporal > > ops. > > > > I do not see how you note is relevant. > > > >> Also, there is the more worrisome case of the string operations. If > >> gcc/clang optimize the code in order to do string operations between > >> locked path, this is not valid anymore as they can be reordered > >> against the _rel() barrier. > > They cannot. Fast string operation volatile store order only among > > string operation itself, the operation cannot pass sequential store. > > The store used in _store_rel thus cannot be passed by fast string > > optimizations. > > > > I do not see how you note is relevant there, again. >=20 > I'm not sure why but I thought that the string writes could be > re-ordered against "external" writes too, but I re-read the manual > and this is not the case. >=20 > > > >> > >> However, we should consider atomic(9) as a script for MI requirement > >> of our locking primitives among the architectures. Right now too many > >> things live on assumptions of people doing patches (like this case) > >> rather than actually working on a common policy of what we can easilly > >> support and what we can't. > >> > >> I also wondered often if we should use *fence on architectures > >> supporting them, by default, because of the possibility to use FPU now > >> (which wasn't present back in the day) and thus we cannot really > >> guarantee memory ordering over stores of memory areas bigger than a > >> quad-word. If we don't want to add the burden, we should explicitely > >> mention that in atomic(9) or any other place. > > The proposal to use fence explicitely contradicts recommendations from > > the AMD Optimization Guide, which, JFYI, I cited in the updated comment > > in the patch. > > > > How is FPU relevant to the memory model discussion, I left out of the > > answer. >=20 > I'm not saying to use *fence, I'm saying that we should document MD > cases where this is required (we can use agnostic terms like "simple > barrier") in atomic(9). > Also, about FPU, I'm saying that before we had no need to consider > FPU/XMM into consideration from a model perspective but now we should > do that because we can use FPU within the kernel. FPU and XMM, unless explicitely doing something weird, as in movnti case, are following normal mem model rules. The fact that we can use FPU in kernel does not makes it reasonable to use FPU in kernel, except taking advantage of some non-regular CPU features like AESNI. And in fact you still cannot (easily) use floating-point due to exceptions. >=20 > >> Definitively: I think this patch violates some edge cases. Please back= it out. > > No. I explicitely inform you that I consider the backout request > > as frivolous, technically unfounded, and that I will not back it out. >=20 > My main motivation for asking the backout was for the ordering issue > with the string operations, but it doesn't seem to be the case, than I > withdraw my request, sorry. > I'm fine with using explicit memory barriers in MD code that use NTI > (I just assume gcc/clang won't over-optimize things on their own as > thinking they want to reduce cache traffic by using NTI). Intel simply cannot go that far while their own recommendation is to use normal stores for unlock. For me, the real unexpected architectural behaviour was of CLFLUSH. I was quite surprised when Alan pointed that to me during the work on pmap_invalidate_cache_range(). --VdOwlNaOFKGAtAAV Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/NBSoACgkQC3+MBN1Mb4jDhwCg4ixpZoE8TBwg9g4CHa6jUblY tvMAn2ulp2iphhm+SBIXGCFIzLtLFf4c =AZtw -----END PGP SIGNATURE----- --VdOwlNaOFKGAtAAV-- From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 19:09:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8F7F41065670; Mon, 4 Jun 2012 19:09:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60ED48FC0A; Mon, 4 Jun 2012 19:09:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54J9F2N060191; Mon, 4 Jun 2012 19:09:15 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54J9FFT060188; Mon, 4 Jun 2012 19:09:15 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206041909.q54J9FFT060188@svn.freebsd.org> From: John Baldwin Date: Mon, 4 Jun 2012 19:09:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236577 - head/usr.bin/kdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 19:09:15 -0000 Author: jhb Date: Mon Jun 4 19:09:14 2012 New Revision: 236577 URL: http://svn.freebsd.org/changeset/base/236577 Log: Allow the -p argument to kdump to accept either a PID or a thread ID. Submitted by: Dmitry Banschikov d.banschikov hostcomm ru MFC after: 1 week Modified: head/usr.bin/kdump/kdump.1 head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.1 ============================================================================== --- head/usr.bin/kdump/kdump.1 Mon Jun 4 18:45:18 2012 (r236576) +++ head/usr.bin/kdump/kdump.1 Mon Jun 4 19:09:14 2012 (r236577) @@ -28,7 +28,7 @@ .\" @(#)kdump.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd April 20, 2012 +.Dd June 4, 2012 .Dt KDUMP 1 .Os .Sh NAME @@ -86,9 +86,9 @@ string. Suppressing this feature yields a more consistent output format and is easily amenable to further processing. .It Fl p Ar pid -Display only trace events that correspond to the process +Display only trace events that correspond to the process or thread .Ar pid . -This may be useful when there are multiple processes recorded in the +This may be useful when there are multiple processes or threads recorded in the same trace file. .It Fl R Display relative timestamps (time since previous entry). Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Mon Jun 4 18:45:18 2012 (r236576) +++ head/usr.bin/kdump/kdump.c Mon Jun 4 19:09:14 2012 (r236577) @@ -251,7 +251,8 @@ main(int argc, char *argv[]) } } if (trpoints & (1< Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00BEE106566C; Mon, 4 Jun 2012 19:36:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 8AA7A8FC17; Mon, 4 Jun 2012 19:36:04 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA11315; Mon, 04 Jun 2012 22:36:03 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Sbd4M-0000tX-QT; Mon, 04 Jun 2012 22:36:02 +0300 Message-ID: <4FCD0E22.6090507@FreeBSD.org> Date: Mon, 04 Jun 2012 22:36:02 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120503 Thunderbird/12.0.1 MIME-Version: 1.0 To: Grzegorz Bernacki References: <201205171011.q4HABIJY090234@svn.freebsd.org> <4FCA5EBE.50109@FreeBSD.org> <4FCC90AD.6010904@freebsd.org> In-Reply-To: <4FCC90AD.6010904@freebsd.org> X-Enigmail-Version: 1.5pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235537 - in head: etc/mtree include lib lib/libnandfs lib/libstand sbin sbin/nandfs sbin/newfs_nandfs share/man/man4 share/man/man5 share/mk sys/boot/arm/uboot sys/boot/i386/loader sys... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 19:36:06 -0000 on 04/06/2012 13:40 Grzegorz Bernacki said the following: > Hi Andriy, > > Sorry about that. Fixed in r236549. Thank you! -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 19:40:52 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CC9F10656A6; Mon, 4 Jun 2012 19:40:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 5DAEF8FC20; Mon, 4 Jun 2012 19:40:51 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA11348; Mon, 04 Jun 2012 22:40:50 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Sbd8z-0000u0-MT; Mon, 04 Jun 2012 22:40:49 +0300 Message-ID: <4FCD0F41.4030709@FreeBSD.org> Date: Mon, 04 Jun 2012 22:40:49 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120503 Thunderbird/12.0.1 MIME-Version: 1.0 To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201206030801.q5381D7Y043823@svn.freebsd.org> In-Reply-To: <201206030801.q5381D7Y043823@svn.freebsd.org> X-Enigmail-Version: 1.5pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r236503 - in head/sys: amd64/amd64 i386/i386 kern x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 19:40:52 -0000 on 03/06/2012 11:01 Andriy Gapon said the following: > Author: avg > Date: Sun Jun 3 08:01:12 2012 > New Revision: 236503 > URL: http://svn.freebsd.org/changeset/base/236503 > > Log: > free wdog_kern_pat calls in post-panic paths from under SW_WATCHDOG > > Those calls are useful with hardware watchdog drivers too. Failed to mention: Reviewed by: attilio > MFC after: 3 weeks > > Modified: > head/sys/amd64/amd64/minidump_machdep.c > head/sys/i386/i386/minidump_machdep.c > head/sys/kern/kern_shutdown.c > head/sys/kern/vfs_subr.c > head/sys/x86/x86/dump_machdep.c > > Modified: head/sys/amd64/amd64/minidump_machdep.c > ============================================================================== > --- head/sys/amd64/amd64/minidump_machdep.c Sun Jun 3 07:45:42 2012 (r236502) > +++ head/sys/amd64/amd64/minidump_machdep.c Sun Jun 3 08:01:12 2012 (r236503) > @@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#ifdef SW_WATCHDOG > #include > -#endif > #include > #include > #include > @@ -177,9 +175,9 @@ blk_write(struct dumperinfo *di, char *p > report_progress(progress, dumpsize); > counter &= (1<<24) - 1; > } > -#ifdef SW_WATCHDOG > + > wdog_kern_pat(WD_LASTVAL); > -#endif > + > if (ptr) { > error = dump_write(di, ptr, 0, dumplo, len); > if (error) > > Modified: head/sys/i386/i386/minidump_machdep.c > ============================================================================== > --- head/sys/i386/i386/minidump_machdep.c Sun Jun 3 07:45:42 2012 (r236502) > +++ head/sys/i386/i386/minidump_machdep.c Sun Jun 3 08:01:12 2012 (r236503) > @@ -36,9 +36,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#ifdef SW_WATCHDOG > #include > -#endif > #include > #include > #include > @@ -143,9 +141,9 @@ blk_write(struct dumperinfo *di, char *p > printf(" %lld", PG2MB(progress >> PAGE_SHIFT)); > counter &= (1<<24) - 1; > } > -#ifdef SW_WATCHDOG > + > wdog_kern_pat(WD_LASTVAL); > -#endif > + > if (ptr) { > error = dump_write(di, ptr, 0, dumplo, len); > if (error) > > Modified: head/sys/kern/kern_shutdown.c > ============================================================================== > --- head/sys/kern/kern_shutdown.c Sun Jun 3 07:45:42 2012 (r236502) > +++ head/sys/kern/kern_shutdown.c Sun Jun 3 08:01:12 2012 (r236503) > @@ -66,9 +66,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#ifdef SW_WATCHDOG > #include > -#endif > > #include > > @@ -334,9 +332,7 @@ kern_reboot(int howto) > > waittime = 0; > > -#ifdef SW_WATCHDOG > wdog_kern_pat(WD_LASTVAL); > -#endif > sys_sync(curthread, NULL); > > /* > @@ -362,9 +358,8 @@ kern_reboot(int howto) > if (nbusy < pbusy) > iter = 0; > pbusy = nbusy; > -#ifdef SW_WATCHDOG > + > wdog_kern_pat(WD_LASTVAL); > -#endif > sys_sync(curthread, NULL); > > #ifdef PREEMPTION > > Modified: head/sys/kern/vfs_subr.c > ============================================================================== > --- head/sys/kern/vfs_subr.c Sun Jun 3 07:45:42 2012 (r236502) > +++ head/sys/kern/vfs_subr.c Sun Jun 3 08:01:12 2012 (r236503) > @@ -73,9 +73,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#ifdef SW_WATCHDOG > #include > -#endif > > #include > > @@ -1869,10 +1867,10 @@ sched_sync(void) > LIST_INSERT_HEAD(next, bo, bo_synclist); > continue; > } > -#ifdef SW_WATCHDOG > + > if (first_printf == 0) > wdog_kern_pat(WD_LASTVAL); > -#endif > + > } > if (!LIST_EMPTY(gslp)) { > mtx_unlock(&sync_mtx); > > Modified: head/sys/x86/x86/dump_machdep.c > ============================================================================== > --- head/sys/x86/x86/dump_machdep.c Sun Jun 3 07:45:42 2012 (r236502) > +++ head/sys/x86/x86/dump_machdep.c Sun Jun 3 08:01:12 2012 (r236503) > @@ -36,9 +36,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#ifdef SW_WATCHDOG > #include > -#endif > #include > #include > #include > @@ -198,9 +196,9 @@ cb_dumpdata(struct md_pa *mdp, int seqnr > a = pa + i * PAGE_SIZE; > va = pmap_kenter_temporary(trunc_page(a), i); > } > -#ifdef SW_WATCHDOG > + > wdog_kern_pat(WD_LASTVAL); > -#endif > + > error = dump_write(di, va, 0, dumplo, sz); > if (error) > break; -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 20:36:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 566711065758; Mon, 4 Jun 2012 20:36:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 409758FC16; Mon, 4 Jun 2012 20:36:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54KaCRL064309; Mon, 4 Jun 2012 20:36:12 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54KaCQc064307; Mon, 4 Jun 2012 20:36:12 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201206042036.q54KaCQc064307@svn.freebsd.org> From: Dimitry Andric Date: Mon, 4 Jun 2012 20:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236578 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 20:36:12 -0000 Author: dim Date: Mon Jun 4 20:36:11 2012 New Revision: 236578 URL: http://svn.freebsd.org/changeset/base/236578 Log: Fix build of aicasm when CC=clang. This was due to a side-effect of the EARLY_BUILD macro: the -Qunused-arguments flag isn't passed anymore when building this particular program. However, with clang 3.1 and -Werror, such unused argument warnings are flagged as errors, causing buildkernel to fail at this stage, due to the -nostdinc flag passed during linking. Since the -nostdinc flag isn't actually needed, just remove it. X-MFC-With: r236528 Modified: head/sys/dev/aic7xxx/aicasm/Makefile Modified: head/sys/dev/aic7xxx/aicasm/Makefile ============================================================================== --- head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 4 19:09:14 2012 (r236577) +++ head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 4 20:36:11 2012 (r236578) @@ -24,8 +24,7 @@ WARNS?= 5 DEPENDFILE= .depend_aicasm .endif -NOSTDINC= -nostdinc -CFLAGS+= ${NOSTDINC} -I/usr/include -I. +CFLAGS+= -I. .ifdef MAKESRCPATH CFLAGS+= -I${MAKESRCPATH} .endif From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 20:45:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53322106564A; Mon, 4 Jun 2012 20:45:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33B5F8FC08; Mon, 4 Jun 2012 20:45:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54KjYnj064755; Mon, 4 Jun 2012 20:45:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54KjYK7064753; Mon, 4 Jun 2012 20:45:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206042045.q54KjYK7064753@svn.freebsd.org> From: Marius Strobl Date: Mon, 4 Jun 2012 20:45:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236579 - head/sys/boot/ofw/libofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 20:45:34 -0000 Author: marius Date: Mon Jun 4 20:45:33 2012 New Revision: 236579 URL: http://svn.freebsd.org/changeset/base/236579 Log: The workaround added in r151650 for handling firmwares that don't allow a single device to be opened multiple times concurrently unfortunately isn't sufficient with ZFS. This is due to the fact, that ZFS may open different partitions of a single device simultaneously. So the best we can do in this case is to cache the lastly used device path and close and open devices in ofwd_strategy() as needed. PR: 165025 Submitted by: Gavin Mu MFC after: 1 week Modified: head/sys/boot/ofw/libofw/ofw_disk.c Modified: head/sys/boot/ofw/libofw/ofw_disk.c ============================================================================== --- head/sys/boot/ofw/libofw/ofw_disk.c Mon Jun 4 20:36:11 2012 (r236578) +++ head/sys/boot/ofw/libofw/ofw_disk.c Mon Jun 4 20:45:33 2012 (r236579) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); */ #include -#include #include @@ -43,8 +42,8 @@ __FBSDID("$FreeBSD$"); #include "libofw.h" static int ofwd_init(void); -static int ofwd_strategy(void *devdata, int flag, daddr_t dblk, - size_t size, char *buf, size_t *rsize); +static int ofwd_strategy(void *devdata, int flag, daddr_t dblk, + size_t size, char *buf, size_t *rsize); static int ofwd_open(struct open_file *f, ...); static int ofwd_close(struct open_file *f); static int ofwd_ioctl(struct open_file *f, u_long cmd, void *data); @@ -61,120 +60,109 @@ struct devsw ofwdisk = { ofwd_print }; -struct opened_dev { - ihandle_t handle; - u_int count; - SLIST_ENTRY(opened_dev) link; -}; - -SLIST_HEAD(, opened_dev) opened_devs = SLIST_HEAD_INITIALIZER(opened_devs); +/* + * We're not guaranteed to be able to open a device more than once and there + * is no OFW standard method to determine whether a device is already opened. + * Opening a device multiple times simultaneously happens to work with most + * OFW block device drivers but triggers a trap with at least the driver for + * the on-board controllers of Sun Fire V100 and Ultra 1. Upper layers and MI + * code expect to be able to open a device more than once however. Given that + * different partitions of the same device might be opened at the same time as + * done by ZFS, we can't generally just keep track of the opened devices and + * reuse the instance handle when asked to open an already opened device. So + * the best we can do is to cache the lastly used device path and close and + * open devices in ofwd_strategy() as needed. + */ +static struct ofw_devdesc *kdp; static int ofwd_init(void) { - return 0; + return (0); } static int -ofwd_strategy(void *devdata, int flag, daddr_t dblk, size_t size, char *buf, - size_t *rsize) +ofwd_strategy(void *devdata, int flag __unused, daddr_t dblk, size_t size, + char *buf, size_t *rsize) { struct ofw_devdesc *dp = (struct ofw_devdesc *)devdata; daddr_t pos; int n; + if (dp != kdp) { + if (kdp != NULL) { +#if !defined(__powerpc__) + OF_close(kdp->d_handle); +#endif + kdp = NULL; + } + if ((dp->d_handle = OF_open(dp->d_path)) == -1) + return (ENOENT); + kdp = dp; + } + pos = dblk * 512; do { if (OF_seek(dp->d_handle, pos) < 0) - return EIO; + return (EIO); n = OF_read(dp->d_handle, buf, size); if (n < 0 && n != -2) - return EIO; + return (EIO); } while (n == -2); *rsize = size; - return 0; + return (0); } static int ofwd_open(struct open_file *f, ...) { - char path[256]; struct ofw_devdesc *dp; - struct opened_dev *odp; va_list vl; va_start(vl, f); dp = va_arg(vl, struct ofw_devdesc *); va_end(vl); - /* - * We're not guaranteed to be able to open a device more than once - * simultaneously and there is no OFW standard method to determine - * whether a device is already opened. Opening a device more than - * once happens to work with most OFW block device drivers but - * triggers a trap with at least the driver for the on-board SCSI - * controller in Sun Ultra 1. Upper layers and MI code expect to - * be able to open a device more than once however. As a workaround - * keep track of the opened devices and reuse the instance handle - * when asked to open an already opened device. - */ - SLIST_FOREACH(odp, &opened_devs, link) { - if (OF_instance_to_path(odp->handle, path, sizeof(path)) == -1) - continue; - if (strcmp(path, dp->d_path) == 0) { - odp->count++; - dp->d_handle = odp->handle; - return 0; + + if (dp != kdp) { + if (kdp != NULL) { + OF_close(kdp->d_handle); + kdp = NULL; } + if ((dp->d_handle = OF_open(dp->d_path)) == -1) { + printf("%s: Could not open %s\n", __func__, + dp->d_path); + return (ENOENT); + } + kdp = dp; } - odp = malloc(sizeof(struct opened_dev)); - if (odp == NULL) { - printf("ofwd_open: malloc failed\n"); - return ENOMEM; - } - if ((odp->handle = OF_open(dp->d_path)) == -1) { - printf("ofwd_open: Could not open %s\n", dp->d_path); - free(odp); - return ENOENT; - } - odp->count = 1; - SLIST_INSERT_HEAD(&opened_devs, odp, link); - dp->d_handle = odp->handle; - return 0; + return (0); } static int ofwd_close(struct open_file *f) { struct ofw_devdesc *dev = f->f_devdata; - struct opened_dev *odp; - SLIST_FOREACH(odp, &opened_devs, link) { - if (odp->handle == dev->d_handle) { - odp->count--; - if (odp->count == 0) { - SLIST_REMOVE(&opened_devs, odp, opened_dev, - link); - #if !defined(__powerpc__) - OF_close(odp->handle); - #endif - free(odp); - } - break; - } + if (dev == kdp) { +#if !defined(__powerpc__) + OF_close(dev->d_handle); +#endif + kdp = NULL; } - return 0; + return (0); } static int -ofwd_ioctl(struct open_file *f, u_long cmd, void *data) +ofwd_ioctl(struct open_file *f __unused, u_long cmd __unused, + void *data __unused) { return (EINVAL); } static void -ofwd_print(int verbose) +ofwd_print(int verbose __unused) { } From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 20:56:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1A729106566B; Mon, 4 Jun 2012 20:56:41 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EDE738FC15; Mon, 4 Jun 2012 20:56:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54Kue9j065353; Mon, 4 Jun 2012 20:56:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54KueU7065351; Mon, 4 Jun 2012 20:56:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206042056.q54KueU7065351@svn.freebsd.org> From: Marius Strobl Date: Mon, 4 Jun 2012 20:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236581 - head/sys/boot/sparc64/loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 20:56:41 -0000 Author: marius Date: Mon Jun 4 20:56:40 2012 New Revision: 236581 URL: http://svn.freebsd.org/changeset/base/236581 Log: The loaddev environment variable is not modifiable once set, so it is not update for ZFS. It seems that this does not really affect anything except the help command. Nevertheless, rearrange things so loaddev is set only once in all cases in order to get it right. Pointed out by: avg MFC after: r235364 Modified: head/sys/boot/sparc64/loader/main.c Modified: head/sys/boot/sparc64/loader/main.c ============================================================================== --- head/sys/boot/sparc64/loader/main.c Mon Jun 4 20:50:41 2012 (r236580) +++ head/sys/boot/sparc64/loader/main.c Mon Jun 4 20:56:40 2012 (r236581) @@ -141,6 +141,7 @@ static u_int tlb_locked; static vm_offset_t curkva = 0; static vm_offset_t heapva; +static char bootpath[64]; static phandle_t root; /* @@ -740,7 +741,7 @@ sparc64_zfs_probe(void) /* Get the GUID of the ZFS pool on the boot device. */ guid = 0; - zfs_probe_dev(getenv("currdev"), &guid); + zfs_probe_dev(bootpath, &guid); for (unit = 0; unit < MAXDEV; unit++) { /* Find freebsd-zfs slices in the VTOC. */ @@ -757,7 +758,7 @@ sparc64_zfs_probe(void) for (part = 0; part < 8; part++) { if (part == 2 || vtoc.part[part].tag != - VTOC_TAG_FREEBSD_ZFS) + VTOC_TAG_FREEBSD_ZFS) continue; sprintf(devname, "disk%d:%c", unit, part + 'a'); if (zfs_probe_dev(devname, NULL) == ENXIO) @@ -770,11 +771,9 @@ sparc64_zfs_probe(void) zfs_currdev.root_guid = 0; zfs_currdev.d_dev = &zfs_dev; zfs_currdev.d_type = zfs_currdev.d_dev->dv_type; - /* Update the environment for ZFS. */ - env_setenv("currdev", EV_VOLATILE, zfs_fmtdev(&zfs_currdev), - ofw_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, zfs_fmtdev(&zfs_currdev), - env_noset, env_nounset); + (void)strncpy(bootpath, zfs_fmtdev(&zfs_currdev), + sizeof(bootpath) - 1); + bootpath[sizeof(bootpath) - 1] = '\0'; } } #endif /* LOADER_ZFS_SUPPORT */ @@ -782,7 +781,6 @@ sparc64_zfs_probe(void) int main(int (*openfirm)(void *)) { - char bootpath[64]; char compatible[32]; struct devsw **dp; @@ -834,16 +832,11 @@ main(int (*openfirm)(void *)) */ if (bootpath[strlen(bootpath) - 2] == ':' && bootpath[strlen(bootpath) - 1] == 'f' && - strstr(bootpath, "cdrom")) { + strstr(bootpath, "cdrom") != NULL) { bootpath[strlen(bootpath) - 1] = 'a'; printf("Boot path set to %s\n", bootpath); } - env_setenv("currdev", EV_VOLATILE, bootpath, - ofw_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, bootpath, - env_noset, env_nounset); - /* * Initialize devices. */ @@ -851,6 +844,15 @@ main(int (*openfirm)(void *)) if ((*dp)->dv_init != 0) (*dp)->dv_init(); + /* + * Now that sparc64_zfs_probe() might have altered bootpath, + * export it. + */ + env_setenv("currdev", EV_VOLATILE, bootpath, + ofw_setcurrdev, env_nounset); + env_setenv("loaddev", EV_VOLATILE, bootpath, + env_noset, env_nounset); + printf("\n"); printf("%s, Revision %s\n", bootprog_name, bootprog_rev); printf("(%s, %s)\n", bootprog_maker, bootprog_date); From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 21:34:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6340F106566C; Mon, 4 Jun 2012 21:34:50 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33E018FC12; Mon, 4 Jun 2012 21:34:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54LYodD067687; Mon, 4 Jun 2012 21:34:50 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54LYoVJ067685; Mon, 4 Jun 2012 21:34:50 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201206042134.q54LYoVJ067685@svn.freebsd.org> From: "Andrey A. Chernov" Date: Mon, 4 Jun 2012 21:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 21:34:50 -0000 Author: ache Date: Mon Jun 4 21:34:49 2012 New Revision: 236582 URL: http://svn.freebsd.org/changeset/base/236582 Log: 1) IEEE Std 1003.1-2008, "errno" section, is explicit that "The setting of errno after a successful call to a function is unspecified unless the description of that function specifies that errno shall not be modified." However, free() in IEEE Std 1003.1-2008 does not mention its interaction with errno, so MAY modify it after successful call (it depends on particular free() implementation, OS-specific, etc.). So, save errno across free() calls to make code portable and POSIX-conformant. 2) Remove unused serrno assignment. MFC after: 1 week Modified: head/lib/libc/stdlib/realpath.c Modified: head/lib/libc/stdlib/realpath.c ============================================================================== --- head/lib/libc/stdlib/realpath.c Mon Jun 4 20:56:40 2012 (r236581) +++ head/lib/libc/stdlib/realpath.c Mon Jun 4 21:34:49 2012 (r236582) @@ -65,7 +65,6 @@ realpath(const char * __restrict path, c errno = ENOENT; return (NULL); } - serrno = errno; if (resolved == NULL) { resolved = malloc(PATH_MAX); if (resolved == NULL) @@ -83,9 +82,11 @@ realpath(const char * __restrict path, c left_len = strlcpy(left, path + 1, sizeof(left)); } else { if (getcwd(resolved, PATH_MAX) == NULL) { - if (m) + if (m) { + serrno = errno; free(resolved); - else { + errno = serrno; + } else { resolved[0] = '.'; resolved[1] = '\0'; } @@ -143,8 +144,11 @@ realpath(const char * __restrict path, c * occurence to not implement lookahead. */ if (lstat(resolved, &sb) != 0) { - if (m) + if (m) { + serrno = errno; free(resolved); + errno = serrno; + } return (NULL); } if (!S_ISDIR(sb.st_mode)) { @@ -184,8 +188,11 @@ realpath(const char * __restrict path, c if (lstat(resolved, &sb) != 0) { if (errno != ENOENT || p != NULL) errno = ENOTDIR; - if (m) + if (m) { + serrno = errno; free(resolved); + errno = serrno; + } return (NULL); } if (S_ISLNK(sb.st_mode)) { @@ -197,8 +204,11 @@ realpath(const char * __restrict path, c } slen = readlink(resolved, symlink, sizeof(symlink) - 1); if (slen < 0) { - if (m) + if (m) { + serrno = errno; free(resolved); + errno = serrno; + } return (NULL); } symlink[slen] = '\0'; From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 22:01:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14E7A1065678; Mon, 4 Jun 2012 22:01:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E963E8FC16; Mon, 4 Jun 2012 22:01:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54M1CpP069050; Mon, 4 Jun 2012 22:01:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54M1Csx069045; Mon, 4 Jun 2012 22:01:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201206042201.q54M1Csx069045@svn.freebsd.org> From: Adrian Chadd Date: Mon, 4 Jun 2012 22:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236583 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 22:01:13 -0000 Author: adrian Date: Mon Jun 4 22:01:12 2012 New Revision: 236583 URL: http://svn.freebsd.org/changeset/base/236583 Log: Migrate the TX path to a taskqueue for now, until a better way of implementing parallel TX and TX/RX completion can be done without simply abusing long-held locks. Right now, multiple concurrent ath_start() entries can result in frames being dequeued out of order. Well, they're dequeued in order fine, but if there's any preemption or race between CPUs between: * removing the frame from the ifnet, and * calling and runningath_tx_start(), until the frame is placed on a software or hardware TXQ Then although dequeueing the frame is in-order, queueing it to the hardware may be out of order. This is solved in a lot of other drivers by just holding a TX lock over a rather long period of time. This lets them continue to direct dispatch without races between dequeue and hardware queue. Note to observers: if_transmit() doesn't necessarily solve this. It removes the ifnet from the main path, but the same issue exists if there's some intermediary queue (eg a bufring, which as an aside also may pull in ifnet when you're using ALTQ.) So, until I can sit down and code up a much better way of doing parallel TX, I'm going to leave the TX path using a deferred taskqueue task. What I will likely head towards is doing a direct dispatch to hardware or software via if_transmit(), but it'll require some driver changes to allow queues to be made without using the really large ath_buf / ath_desc entries. TODO: * Look at how feasible it'll be to just do direct dispatch to ath_tx_start() from if_transmit(), avoiding doing _any_ intermediary serialisation into a global queue. This may break ALTQ for example, so I have to be delicate. * It's quite likely that I should break up ath_tx_start() so it deposits frames onto the software queues first, and then only fill in the 802.11 fields when it's being queued to the hardware. That will make the if_transmit() -> software queue path very quick and lightweight. * This has some very bad behaviour when using ACPI and Cx states. I'll do some subsequent analysis using KTR and schedgraph and file a follow-up PR or two. PR: kern/168649 Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Jun 4 21:34:49 2012 (r236582) +++ head/sys/dev/ath/if_ath.c Mon Jun 4 22:01:12 2012 (r236583) @@ -373,6 +373,7 @@ ath_attach(u_int16_t devid, struct ath_s "%s taskq", ifp->if_xname); TASK_INIT(&sc->sc_rxtask, 0, ath_rx_tasklet, sc); + TASK_INIT(&sc->sc_txstarttask, 0, ath_tx_tasklet, sc); TASK_INIT(&sc->sc_bmisstask, 0, ath_bmiss_proc, sc); TASK_INIT(&sc->sc_bstucktask,0, ath_bstuck_proc, sc); TASK_INIT(&sc->sc_resettask,0, ath_reset_proc, sc); @@ -2325,6 +2326,15 @@ void ath_start(struct ifnet *ifp) { struct ath_softc *sc = ifp->if_softc; + + taskqueue_enqueue(sc->sc_tq, &sc->sc_txstarttask); +} + +void +ath_tx_tasklet(void *arg, int npending) +{ + struct ath_softc *sc = (struct ath_softc *) arg; + struct ifnet *ifp = sc->sc_ifp; struct ieee80211_node *ni; struct ath_buf *bf; struct mbuf *m, *next; @@ -3499,7 +3509,8 @@ ath_tx_proc_q0(void *arg, int npending) sc->sc_txproc_cnt--; ATH_PCU_UNLOCK(sc); - ath_start(ifp); + // ath_start(ifp); + ath_tx_tasklet(sc, 1); } /* @@ -3549,7 +3560,8 @@ ath_tx_proc_q0123(void *arg, int npendin sc->sc_txproc_cnt--; ATH_PCU_UNLOCK(sc); - ath_start(ifp); + //ath_start(ifp); + ath_tx_tasklet(sc, 1); } /* @@ -3592,7 +3604,8 @@ ath_tx_proc(void *arg, int npending) sc->sc_txproc_cnt--; ATH_PCU_UNLOCK(sc); - ath_start(ifp); + //ath_start(ifp); + ath_tx_tasklet(sc, 1); } #undef TXQACTIVE Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Mon Jun 4 21:34:49 2012 (r236582) +++ head/sys/dev/ath/if_ath_misc.h Mon Jun 4 22:01:12 2012 (r236583) @@ -83,6 +83,7 @@ extern void ath_setslottime(struct ath_s * we can kill this. */ extern void ath_start(struct ifnet *ifp); +extern void ath_tx_tasklet(void *arg, int npending); #endif Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Mon Jun 4 21:34:49 2012 (r236582) +++ head/sys/dev/ath/if_ath_rx.c Mon Jun 4 22:01:12 2012 (r236583) @@ -899,7 +899,8 @@ rx_proc_next: ieee80211_ff_age_all(ic, 100); #endif if (!IFQ_IS_EMPTY(&ifp->if_snd)) - ath_start(ifp); + ath_tx_tasklet(sc, 1); + //ath_start(ifp); } #undef PA2DESC Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Jun 4 21:34:49 2012 (r236582) +++ head/sys/dev/ath/if_athvar.h Mon Jun 4 22:01:12 2012 (r236583) @@ -476,6 +476,7 @@ struct ath_softc { struct mbuf *sc_rxpending; /* pending receive data */ u_int32_t *sc_rxlink; /* link ptr in last RX desc */ struct task sc_rxtask; /* rx int processing */ + struct task sc_txstarttask; /* ath_start() processing */ u_int8_t sc_defant; /* current default antenna */ u_int8_t sc_rxotherant; /* rx's on non-default antenna*/ u_int64_t sc_lastrx; /* tsf at last rx'd frame */ From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 22:06:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBD3B1065672; Mon, 4 Jun 2012 22:06:29 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D65238FC14; Mon, 4 Jun 2012 22:06:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54M6Tca069311; Mon, 4 Jun 2012 22:06:29 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54M6Tnl069306; Mon, 4 Jun 2012 22:06:29 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201206042206.q54M6Tnl069306@svn.freebsd.org> From: Doug Barton Date: Mon, 4 Jun 2012 22:06:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236584 - in vendor/bind9/dist: . lib/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 22:06:30 -0000 Author: dougb Date: Mon Jun 4 22:06:29 2012 New Revision: 236584 URL: http://svn.freebsd.org/changeset/base/236584 Log: Vendor import of BIND 9.8.3-P1 Modified: vendor/bind9/dist/CHANGES vendor/bind9/dist/lib/dns/rdata.c vendor/bind9/dist/lib/dns/rdataslab.c vendor/bind9/dist/version Modified: vendor/bind9/dist/CHANGES ============================================================================== --- vendor/bind9/dist/CHANGES Mon Jun 4 22:01:12 2012 (r236583) +++ vendor/bind9/dist/CHANGES Mon Jun 4 22:06:29 2012 (r236584) @@ -1,3 +1,8 @@ + --- 9.8.3-P1 released --- + +3331. [security] dns_rdataslab_fromrdataset could produce bad + rdataslabs. [RT #29644] + --- 9.8.3 released --- 3318. [tuning] Reduce the amount of work performed while holding a Modified: vendor/bind9/dist/lib/dns/rdata.c ============================================================================== --- vendor/bind9/dist/lib/dns/rdata.c Mon Jun 4 22:01:12 2012 (r236583) +++ vendor/bind9/dist/lib/dns/rdata.c Mon Jun 4 22:06:29 2012 (r236584) @@ -329,8 +329,8 @@ dns_rdata_compare(const dns_rdata_t *rda REQUIRE(rdata1 != NULL); REQUIRE(rdata2 != NULL); - REQUIRE(rdata1->data != NULL); - REQUIRE(rdata2->data != NULL); + REQUIRE(rdata1->length == 0 || rdata1->data != NULL); + REQUIRE(rdata2->length == 0 || rdata2->data != NULL); REQUIRE(DNS_RDATA_VALIDFLAGS(rdata1)); REQUIRE(DNS_RDATA_VALIDFLAGS(rdata2)); @@ -360,8 +360,8 @@ dns_rdata_casecompare(const dns_rdata_t REQUIRE(rdata1 != NULL); REQUIRE(rdata2 != NULL); - REQUIRE(rdata1->data != NULL); - REQUIRE(rdata2->data != NULL); + REQUIRE(rdata1->length == 0 || rdata1->data != NULL); + REQUIRE(rdata2->length == 0 || rdata2->data != NULL); REQUIRE(DNS_RDATA_VALIDFLAGS(rdata1)); REQUIRE(DNS_RDATA_VALIDFLAGS(rdata2)); Modified: vendor/bind9/dist/lib/dns/rdataslab.c ============================================================================== --- vendor/bind9/dist/lib/dns/rdataslab.c Mon Jun 4 22:01:12 2012 (r236583) +++ vendor/bind9/dist/lib/dns/rdataslab.c Mon Jun 4 22:06:29 2012 (r236584) @@ -126,6 +126,11 @@ isc_result_t dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx, isc_region_t *region, unsigned int reservelen) { + /* + * Use &removed as a sentinal pointer for duplicate + * rdata as rdata.data == NULL is valid. + */ + static unsigned char removed; struct xrdata *x; unsigned char *rawbuf; #if DNS_RDATASET_FIXED @@ -169,6 +174,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ INSIST(result == ISC_R_SUCCESS); dns_rdata_init(&x[i].rdata); dns_rdataset_current(rdataset, &x[i].rdata); + INSIST(x[i].rdata.data != &removed); #if DNS_RDATASET_FIXED x[i].order = i; #endif @@ -201,8 +207,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ */ for (i = 1; i < nalloc; i++) { if (compare_rdata(&x[i-1].rdata, &x[i].rdata) == 0) { - x[i-1].rdata.data = NULL; - x[i-1].rdata.length = 0; + x[i-1].rdata.data = &removed; #if DNS_RDATASET_FIXED /* * Preserve the least order so A, B, A -> A, B @@ -292,7 +297,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ #endif for (i = 0; i < nalloc; i++) { - if (x[i].rdata.data == NULL) + if (x[i].rdata.data == &removed) continue; #if DNS_RDATASET_FIXED offsettable[x[i].order] = rawbuf - offsetbase; Modified: vendor/bind9/dist/version ============================================================================== --- vendor/bind9/dist/version Mon Jun 4 22:01:12 2012 (r236583) +++ vendor/bind9/dist/version Mon Jun 4 22:06:29 2012 (r236584) @@ -6,5 +6,5 @@ MAJORVER=9 MINORVER=8 PATCHVER=3 -RELEASETYPE= -RELEASEVER= +RELEASETYPE=-P +RELEASEVER=1 From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 22:07:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A4CF1065680; Mon, 4 Jun 2012 22:07:06 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B89A8FC14; Mon, 4 Jun 2012 22:07:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54M76UU069382; Mon, 4 Jun 2012 22:07:06 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54M768m069381; Mon, 4 Jun 2012 22:07:06 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201206042207.q54M768m069381@svn.freebsd.org> From: Doug Barton Date: Mon, 4 Jun 2012 22:07:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236585 - vendor/bind9/9.8.3-P1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 22:07:06 -0000 Author: dougb Date: Mon Jun 4 22:07:05 2012 New Revision: 236585 URL: http://svn.freebsd.org/changeset/base/236585 Log: Tag the 9.8.3-P1 release Added: vendor/bind9/9.8.3-P1/ - copied from r236584, vendor/bind9/dist/ From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 22:11:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEA28106566B; Mon, 4 Jun 2012 22:11:20 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D93328FC14; Mon, 4 Jun 2012 22:11:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54MBKJX069822; Mon, 4 Jun 2012 22:11:20 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54MBKP3069817; Mon, 4 Jun 2012 22:11:20 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201206042211.q54MBKP3069817@svn.freebsd.org> From: Doug Barton Date: Mon, 4 Jun 2012 22:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236586 - in head/contrib/bind9: . lib/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 22:11:21 -0000 Author: dougb Date: Mon Jun 4 22:11:20 2012 New Revision: 236586 URL: http://svn.freebsd.org/changeset/base/236586 Log: Upgrade to 9.8.3-P1, the latest from ISC. This version contains a critical bugfix: Processing of DNS resource records where the rdata field is zero length may cause various issues for the servers handling them. Processing of these records may lead to unexpected outcomes. Recursive servers may crash or disclose some portion of memory to the client. Secondary servers may crash on restart after transferring a zone containing these records. Master servers may corrupt zone data if the zone option "auto-dnssec" is set to "maintain". Other unexpected problems that are not listed here may also be encountered. All BIND users are strongly encouraged to upgrade. Modified: head/contrib/bind9/CHANGES head/contrib/bind9/lib/dns/rdata.c head/contrib/bind9/lib/dns/rdataslab.c head/contrib/bind9/version Directory Properties: head/contrib/bind9/ (props changed) Modified: head/contrib/bind9/CHANGES ============================================================================== --- head/contrib/bind9/CHANGES Mon Jun 4 22:07:05 2012 (r236585) +++ head/contrib/bind9/CHANGES Mon Jun 4 22:11:20 2012 (r236586) @@ -1,3 +1,8 @@ + --- 9.8.3-P1 released --- + +3331. [security] dns_rdataslab_fromrdataset could produce bad + rdataslabs. [RT #29644] + --- 9.8.3 released --- 3318. [tuning] Reduce the amount of work performed while holding a Modified: head/contrib/bind9/lib/dns/rdata.c ============================================================================== --- head/contrib/bind9/lib/dns/rdata.c Mon Jun 4 22:07:05 2012 (r236585) +++ head/contrib/bind9/lib/dns/rdata.c Mon Jun 4 22:11:20 2012 (r236586) @@ -329,8 +329,8 @@ dns_rdata_compare(const dns_rdata_t *rda REQUIRE(rdata1 != NULL); REQUIRE(rdata2 != NULL); - REQUIRE(rdata1->data != NULL); - REQUIRE(rdata2->data != NULL); + REQUIRE(rdata1->length == 0 || rdata1->data != NULL); + REQUIRE(rdata2->length == 0 || rdata2->data != NULL); REQUIRE(DNS_RDATA_VALIDFLAGS(rdata1)); REQUIRE(DNS_RDATA_VALIDFLAGS(rdata2)); @@ -360,8 +360,8 @@ dns_rdata_casecompare(const dns_rdata_t REQUIRE(rdata1 != NULL); REQUIRE(rdata2 != NULL); - REQUIRE(rdata1->data != NULL); - REQUIRE(rdata2->data != NULL); + REQUIRE(rdata1->length == 0 || rdata1->data != NULL); + REQUIRE(rdata2->length == 0 || rdata2->data != NULL); REQUIRE(DNS_RDATA_VALIDFLAGS(rdata1)); REQUIRE(DNS_RDATA_VALIDFLAGS(rdata2)); Modified: head/contrib/bind9/lib/dns/rdataslab.c ============================================================================== --- head/contrib/bind9/lib/dns/rdataslab.c Mon Jun 4 22:07:05 2012 (r236585) +++ head/contrib/bind9/lib/dns/rdataslab.c Mon Jun 4 22:11:20 2012 (r236586) @@ -126,6 +126,11 @@ isc_result_t dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx, isc_region_t *region, unsigned int reservelen) { + /* + * Use &removed as a sentinal pointer for duplicate + * rdata as rdata.data == NULL is valid. + */ + static unsigned char removed; struct xrdata *x; unsigned char *rawbuf; #if DNS_RDATASET_FIXED @@ -169,6 +174,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ INSIST(result == ISC_R_SUCCESS); dns_rdata_init(&x[i].rdata); dns_rdataset_current(rdataset, &x[i].rdata); + INSIST(x[i].rdata.data != &removed); #if DNS_RDATASET_FIXED x[i].order = i; #endif @@ -201,8 +207,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ */ for (i = 1; i < nalloc; i++) { if (compare_rdata(&x[i-1].rdata, &x[i].rdata) == 0) { - x[i-1].rdata.data = NULL; - x[i-1].rdata.length = 0; + x[i-1].rdata.data = &removed; #if DNS_RDATASET_FIXED /* * Preserve the least order so A, B, A -> A, B @@ -292,7 +297,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ #endif for (i = 0; i < nalloc; i++) { - if (x[i].rdata.data == NULL) + if (x[i].rdata.data == &removed) continue; #if DNS_RDATASET_FIXED offsettable[x[i].order] = rawbuf - offsetbase; Modified: head/contrib/bind9/version ============================================================================== --- head/contrib/bind9/version Mon Jun 4 22:07:05 2012 (r236585) +++ head/contrib/bind9/version Mon Jun 4 22:11:20 2012 (r236586) @@ -6,5 +6,5 @@ MAJORVER=9 MINORVER=8 PATCHVER=3 -RELEASETYPE= -RELEASEVER= +RELEASETYPE=-P +RELEASEVER=1 From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 22:14:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10EA0106564A; Mon, 4 Jun 2012 22:14:34 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EFB138FC12; Mon, 4 Jun 2012 22:14:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54MEXmx070239; Mon, 4 Jun 2012 22:14:33 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54MEXHe070234; Mon, 4 Jun 2012 22:14:33 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201206042214.q54MEXHe070234@svn.freebsd.org> From: Doug Barton Date: Mon, 4 Jun 2012 22:14:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236587 - in stable/9/contrib/bind9: . lib/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 22:14:34 -0000 Author: dougb Date: Mon Jun 4 22:14:33 2012 New Revision: 236587 URL: http://svn.freebsd.org/changeset/base/236587 Log: Upgrade to 9.8.3-P1, the latest from ISC. This version contains a critical bugfix: Processing of DNS resource records where the rdata field is zero length may cause various issues for the servers handling them. Processing of these records may lead to unexpected outcomes. Recursive servers may crash or disclose some portion of memory to the client. Secondary servers may crash on restart after transferring a zone containing these records. Master servers may corrupt zone data if the zone option "auto-dnssec" is set to "maintain". Other unexpected problems that are not listed here may also be encountered. All BIND users are strongly encouraged to upgrade. Modified: stable/9/contrib/bind9/CHANGES stable/9/contrib/bind9/lib/dns/rdata.c stable/9/contrib/bind9/lib/dns/rdataslab.c stable/9/contrib/bind9/version Directory Properties: stable/9/contrib/bind9/ (props changed) Modified: stable/9/contrib/bind9/CHANGES ============================================================================== --- stable/9/contrib/bind9/CHANGES Mon Jun 4 22:11:20 2012 (r236586) +++ stable/9/contrib/bind9/CHANGES Mon Jun 4 22:14:33 2012 (r236587) @@ -1,3 +1,8 @@ + --- 9.8.3-P1 released --- + +3331. [security] dns_rdataslab_fromrdataset could produce bad + rdataslabs. [RT #29644] + --- 9.8.3 released --- 3318. [tuning] Reduce the amount of work performed while holding a Modified: stable/9/contrib/bind9/lib/dns/rdata.c ============================================================================== --- stable/9/contrib/bind9/lib/dns/rdata.c Mon Jun 4 22:11:20 2012 (r236586) +++ stable/9/contrib/bind9/lib/dns/rdata.c Mon Jun 4 22:14:33 2012 (r236587) @@ -329,8 +329,8 @@ dns_rdata_compare(const dns_rdata_t *rda REQUIRE(rdata1 != NULL); REQUIRE(rdata2 != NULL); - REQUIRE(rdata1->data != NULL); - REQUIRE(rdata2->data != NULL); + REQUIRE(rdata1->length == 0 || rdata1->data != NULL); + REQUIRE(rdata2->length == 0 || rdata2->data != NULL); REQUIRE(DNS_RDATA_VALIDFLAGS(rdata1)); REQUIRE(DNS_RDATA_VALIDFLAGS(rdata2)); @@ -360,8 +360,8 @@ dns_rdata_casecompare(const dns_rdata_t REQUIRE(rdata1 != NULL); REQUIRE(rdata2 != NULL); - REQUIRE(rdata1->data != NULL); - REQUIRE(rdata2->data != NULL); + REQUIRE(rdata1->length == 0 || rdata1->data != NULL); + REQUIRE(rdata2->length == 0 || rdata2->data != NULL); REQUIRE(DNS_RDATA_VALIDFLAGS(rdata1)); REQUIRE(DNS_RDATA_VALIDFLAGS(rdata2)); Modified: stable/9/contrib/bind9/lib/dns/rdataslab.c ============================================================================== --- stable/9/contrib/bind9/lib/dns/rdataslab.c Mon Jun 4 22:11:20 2012 (r236586) +++ stable/9/contrib/bind9/lib/dns/rdataslab.c Mon Jun 4 22:14:33 2012 (r236587) @@ -126,6 +126,11 @@ isc_result_t dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx, isc_region_t *region, unsigned int reservelen) { + /* + * Use &removed as a sentinal pointer for duplicate + * rdata as rdata.data == NULL is valid. + */ + static unsigned char removed; struct xrdata *x; unsigned char *rawbuf; #if DNS_RDATASET_FIXED @@ -169,6 +174,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ INSIST(result == ISC_R_SUCCESS); dns_rdata_init(&x[i].rdata); dns_rdataset_current(rdataset, &x[i].rdata); + INSIST(x[i].rdata.data != &removed); #if DNS_RDATASET_FIXED x[i].order = i; #endif @@ -201,8 +207,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ */ for (i = 1; i < nalloc; i++) { if (compare_rdata(&x[i-1].rdata, &x[i].rdata) == 0) { - x[i-1].rdata.data = NULL; - x[i-1].rdata.length = 0; + x[i-1].rdata.data = &removed; #if DNS_RDATASET_FIXED /* * Preserve the least order so A, B, A -> A, B @@ -292,7 +297,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ #endif for (i = 0; i < nalloc; i++) { - if (x[i].rdata.data == NULL) + if (x[i].rdata.data == &removed) continue; #if DNS_RDATASET_FIXED offsettable[x[i].order] = rawbuf - offsetbase; Modified: stable/9/contrib/bind9/version ============================================================================== --- stable/9/contrib/bind9/version Mon Jun 4 22:11:20 2012 (r236586) +++ stable/9/contrib/bind9/version Mon Jun 4 22:14:33 2012 (r236587) @@ -6,5 +6,5 @@ MAJORVER=9 MINORVER=8 PATCHVER=3 -RELEASETYPE= -RELEASEVER= +RELEASETYPE=-P +RELEASEVER=1 From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 22:19:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35EE8106566B; Mon, 4 Jun 2012 22:19:10 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16BB48FC0A; Mon, 4 Jun 2012 22:19:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54MJ9XL070907; Mon, 4 Jun 2012 22:19:09 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54MJ9XX070902; Mon, 4 Jun 2012 22:19:09 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201206042219.q54MJ9XX070902@svn.freebsd.org> From: Doug Barton Date: Mon, 4 Jun 2012 22:19:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236588 - in vendor/bind9/dist-9.6: . lib/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 22:19:10 -0000 Author: dougb Date: Mon Jun 4 22:19:09 2012 New Revision: 236588 URL: http://svn.freebsd.org/changeset/base/236588 Log: Vendor import of BIND 9.6-ESV-R7-P1 Modified: vendor/bind9/dist-9.6/CHANGES vendor/bind9/dist-9.6/lib/dns/rdata.c vendor/bind9/dist-9.6/lib/dns/rdataslab.c vendor/bind9/dist-9.6/version Modified: vendor/bind9/dist-9.6/CHANGES ============================================================================== --- vendor/bind9/dist-9.6/CHANGES Mon Jun 4 22:14:33 2012 (r236587) +++ vendor/bind9/dist-9.6/CHANGES Mon Jun 4 22:19:09 2012 (r236588) @@ -1,3 +1,8 @@ + --- 9.6-ESV-R7-P1 released --- + +3331. [security] dns_rdataslab_fromrdataset could produce bad + rdataslabs. [RT #29644] + --- 9.6-ESV-R7 released --- 3318. [tuning] Reduce the amount of work performed while holding a Modified: vendor/bind9/dist-9.6/lib/dns/rdata.c ============================================================================== --- vendor/bind9/dist-9.6/lib/dns/rdata.c Mon Jun 4 22:14:33 2012 (r236587) +++ vendor/bind9/dist-9.6/lib/dns/rdata.c Mon Jun 4 22:19:09 2012 (r236588) @@ -345,8 +345,8 @@ dns_rdata_compare(const dns_rdata_t *rda REQUIRE(rdata1 != NULL); REQUIRE(rdata2 != NULL); - REQUIRE(rdata1->data != NULL); - REQUIRE(rdata2->data != NULL); + REQUIRE(rdata1->length == 0 || rdata1->data != NULL); + REQUIRE(rdata2->length == 0 || rdata2->data != NULL); REQUIRE(DNS_RDATA_VALIDFLAGS(rdata1)); REQUIRE(DNS_RDATA_VALIDFLAGS(rdata2)); Modified: vendor/bind9/dist-9.6/lib/dns/rdataslab.c ============================================================================== --- vendor/bind9/dist-9.6/lib/dns/rdataslab.c Mon Jun 4 22:14:33 2012 (r236587) +++ vendor/bind9/dist-9.6/lib/dns/rdataslab.c Mon Jun 4 22:19:09 2012 (r236588) @@ -126,6 +126,11 @@ isc_result_t dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx, isc_region_t *region, unsigned int reservelen) { + /* + * Use &removed as a sentinal pointer for duplicate + * rdata as rdata.data == NULL is valid. + */ + static unsigned char removed; struct xrdata *x; unsigned char *rawbuf; #if DNS_RDATASET_FIXED @@ -165,6 +170,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ INSIST(result == ISC_R_SUCCESS); dns_rdata_init(&x[i].rdata); dns_rdataset_current(rdataset, &x[i].rdata); + INSIST(x[i].rdata.data != &removed); #if DNS_RDATASET_FIXED x[i].order = i; #endif @@ -197,8 +203,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ */ for (i = 1; i < nalloc; i++) { if (compare_rdata(&x[i-1].rdata, &x[i].rdata) == 0) { - x[i-1].rdata.data = NULL; - x[i-1].rdata.length = 0; + x[i-1].rdata.data = &removed; #if DNS_RDATASET_FIXED /* * Preserve the least order so A, B, A -> A, B @@ -285,7 +290,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ #endif for (i = 0; i < nalloc; i++) { - if (x[i].rdata.data == NULL) + if (x[i].rdata.data == &removed) continue; #if DNS_RDATASET_FIXED offsettable[x[i].order] = rawbuf - offsetbase; Modified: vendor/bind9/dist-9.6/version ============================================================================== --- vendor/bind9/dist-9.6/version Mon Jun 4 22:14:33 2012 (r236587) +++ vendor/bind9/dist-9.6/version Mon Jun 4 22:19:09 2012 (r236588) @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=6 PATCHVER= RELEASETYPE=-ESV -RELEASEVER=-R7 +RELEASEVER=-R7-P1 From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 22:19:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 199CC106568B; Mon, 4 Jun 2012 22:19:33 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF7D48FC12; Mon, 4 Jun 2012 22:19:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54MJWrF070985; Mon, 4 Jun 2012 22:19:32 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54MJWHY070984; Mon, 4 Jun 2012 22:19:32 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201206042219.q54MJWHY070984@svn.freebsd.org> From: Doug Barton Date: Mon, 4 Jun 2012 22:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236589 - vendor/bind9/9.6-ESV-R7-P1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 22:19:33 -0000 Author: dougb Date: Mon Jun 4 22:19:32 2012 New Revision: 236589 URL: http://svn.freebsd.org/changeset/base/236589 Log: Tag the 9.6-ESV-R7-P1 release Added: vendor/bind9/9.6-ESV-R7-P1/ - copied from r236588, vendor/bind9/dist-9.6/ From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 22:21:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1DC69106564A; Mon, 4 Jun 2012 22:21:56 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0667A8FC08; Mon, 4 Jun 2012 22:21:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54MLtn9071221; Mon, 4 Jun 2012 22:21:55 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54MLtbS071216; Mon, 4 Jun 2012 22:21:55 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201206042221.q54MLtbS071216@svn.freebsd.org> From: Doug Barton Date: Mon, 4 Jun 2012 22:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236590 - in stable/8/contrib/bind9: . lib/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 22:21:56 -0000 Author: dougb Date: Mon Jun 4 22:21:55 2012 New Revision: 236590 URL: http://svn.freebsd.org/changeset/base/236590 Log: Upgrade to 9.6-ESV-R7-P1, the latest from ISC. This version contains a critical bugfix: Processing of DNS resource records where the rdata field is zero length may cause various issues for the servers handling them. Processing of these records may lead to unexpected outcomes. Recursive servers may crash or disclose some portion of memory to the client. Secondary servers may crash on restart after transferring a zone containing these records. Master servers may corrupt zone data if the zone option "auto-dnssec" is set to "maintain". Other unexpected problems that are not listed here may also be encountered. All BIND users are strongly encouraged to upgrade. Modified: stable/8/contrib/bind9/CHANGES stable/8/contrib/bind9/lib/dns/rdata.c stable/8/contrib/bind9/lib/dns/rdataslab.c stable/8/contrib/bind9/version Directory Properties: stable/8/contrib/bind9/ (props changed) Modified: stable/8/contrib/bind9/CHANGES ============================================================================== --- stable/8/contrib/bind9/CHANGES Mon Jun 4 22:19:32 2012 (r236589) +++ stable/8/contrib/bind9/CHANGES Mon Jun 4 22:21:55 2012 (r236590) @@ -1,3 +1,8 @@ + --- 9.6-ESV-R7-P1 released --- + +3331. [security] dns_rdataslab_fromrdataset could produce bad + rdataslabs. [RT #29644] + --- 9.6-ESV-R7 released --- 3318. [tuning] Reduce the amount of work performed while holding a Modified: stable/8/contrib/bind9/lib/dns/rdata.c ============================================================================== --- stable/8/contrib/bind9/lib/dns/rdata.c Mon Jun 4 22:19:32 2012 (r236589) +++ stable/8/contrib/bind9/lib/dns/rdata.c Mon Jun 4 22:21:55 2012 (r236590) @@ -345,8 +345,8 @@ dns_rdata_compare(const dns_rdata_t *rda REQUIRE(rdata1 != NULL); REQUIRE(rdata2 != NULL); - REQUIRE(rdata1->data != NULL); - REQUIRE(rdata2->data != NULL); + REQUIRE(rdata1->length == 0 || rdata1->data != NULL); + REQUIRE(rdata2->length == 0 || rdata2->data != NULL); REQUIRE(DNS_RDATA_VALIDFLAGS(rdata1)); REQUIRE(DNS_RDATA_VALIDFLAGS(rdata2)); Modified: stable/8/contrib/bind9/lib/dns/rdataslab.c ============================================================================== --- stable/8/contrib/bind9/lib/dns/rdataslab.c Mon Jun 4 22:19:32 2012 (r236589) +++ stable/8/contrib/bind9/lib/dns/rdataslab.c Mon Jun 4 22:21:55 2012 (r236590) @@ -126,6 +126,11 @@ isc_result_t dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx, isc_region_t *region, unsigned int reservelen) { + /* + * Use &removed as a sentinal pointer for duplicate + * rdata as rdata.data == NULL is valid. + */ + static unsigned char removed; struct xrdata *x; unsigned char *rawbuf; #if DNS_RDATASET_FIXED @@ -165,6 +170,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ INSIST(result == ISC_R_SUCCESS); dns_rdata_init(&x[i].rdata); dns_rdataset_current(rdataset, &x[i].rdata); + INSIST(x[i].rdata.data != &removed); #if DNS_RDATASET_FIXED x[i].order = i; #endif @@ -197,8 +203,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ */ for (i = 1; i < nalloc; i++) { if (compare_rdata(&x[i-1].rdata, &x[i].rdata) == 0) { - x[i-1].rdata.data = NULL; - x[i-1].rdata.length = 0; + x[i-1].rdata.data = &removed; #if DNS_RDATASET_FIXED /* * Preserve the least order so A, B, A -> A, B @@ -285,7 +290,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ #endif for (i = 0; i < nalloc; i++) { - if (x[i].rdata.data == NULL) + if (x[i].rdata.data == &removed) continue; #if DNS_RDATASET_FIXED offsettable[x[i].order] = rawbuf - offsetbase; Modified: stable/8/contrib/bind9/version ============================================================================== --- stable/8/contrib/bind9/version Mon Jun 4 22:19:32 2012 (r236589) +++ stable/8/contrib/bind9/version Mon Jun 4 22:21:55 2012 (r236590) @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=6 PATCHVER= RELEASETYPE=-ESV -RELEASEVER=-R7 +RELEASEVER=-R7-P1 From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 22:46:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54832106566C; Mon, 4 Jun 2012 22:46:05 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E9B68FC08; Mon, 4 Jun 2012 22:46:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54Mk5QY072417; Mon, 4 Jun 2012 22:46:05 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54Mk5jN072415; Mon, 4 Jun 2012 22:46:05 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201206042246.q54Mk5jN072415@svn.freebsd.org> From: Sean Bruno Date: Mon, 4 Jun 2012 22:46:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236591 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 22:46:05 -0000 Author: sbruno Date: Mon Jun 4 22:46:04 2012 New Revision: 236591 URL: http://svn.freebsd.org/changeset/base/236591 Log: Lines were a bit too long. Wrap some of them to 60 columns. Suggested by: bjk@ MFC after: 3 days Modified: head/share/man/man4/bce.4 Modified: head/share/man/man4/bce.4 ============================================================================== --- head/share/man/man4/bce.4 Mon Jun 4 22:21:55 2012 (r236590) +++ head/share/man/man4/bce.4 Mon Jun 4 22:46:04 2012 (r236591) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 1, 2012 +.Dd June 4, 2012 .Dt BCE 4 .Os .Sh NAME @@ -213,45 +213,58 @@ Enable/Disable strict RX frame size chec Enable/Disable frame header/payload splitting (default 1). .It Va hw.bce.rx_pages Set the number of memory pages assigned to recieve packets by the driver. -Due to alignment issues, this value can only be of the set 1, 2, 4 or 8 (default 2). +Due to alignment issues, this value can only be of the set +1, 2, 4 or 8 (default 2). .It Va hw.bce.tx_pages -Set the number of memory pages assigned to transmit packets by the driver. -Due to alignment issues, this value can only be of the set 1, 2, 4 or 8 (default 2). +Set the number of memory pages assigned to transmit packets +by the driver. +Due to alignment issues, this value can only be of the set +1, 2, 4 or 8 (default 2). .It Va hw.bce.rx_ticks -Time in microsecond ticks to wait before generating a status block updates due to RX processing activity. +Time in microsecond ticks to wait before generating a status +block updates due to RX processing activity. Values from 0-100 are valid. A value of 0 disables this status block update. -Cannot be set to 0 if hw.bce.rx_quick_cons_trip is also 0 (default 18). +Cannot be set to 0 if hw.bce.rx_quick_cons_trip is also 0 +(default 18). .It Va hw.bce.rx_ticks_int -Time in microsecond ticks to wait during RX interrupt processing before generating a status block update. +Time in microsecond ticks to wait during RX interrupt +processing before generating a status block update. Values from 0-100 are valid. Valid values are in the range from 0-100. A value of 0 disables this status block update (default 18). .It Va hw.bce.rx_quick_cons_trip -Number of RX Quick BD Chain entries that must be completed before a status block is generated. +Number of RX Quick BD Chain entries that must be completed +before a status block is generated. Values from 0-256 are valid. A value of 0 disables this status block update. Cannot be set to 0 if hw.bce.rx_ticks is also 0 (default 6). .It Va hw.bce.rx_quick_cons_trip_int -Number of RX quick BD entries that must be completed before a status block is generated duing interrupt processing. +Number of RX quick BD entries that must be completed before +a status block is generated duing interrupt processing. Values from 0-256 are valid. A value of 0 disables this status block update (default 6). .It Va hw.bce.tx_ticks -Time in microsecond ticks to wait before a status block update is generated due to TX activitiy. +Time in microsecond ticks to wait before a status block +update is generated due to TX activitiy. Values from 0-100 are valid. A value of 0 disables this status block update. -Cannot be set to 0 if hw.bce.tx_quick_cons_trip is also 0 (default 80). +Cannot be set to 0 if hw.bce.tx_quick_cons_trip is also 0 +(default 80). .It Va hw.bce.tx_ticks_int -Time in microsecond ticks to wait in interrupt processing before a status block update is generated due to TX activity +Time in microsecond ticks to wait in interrupt processing +before a status block update is generated due to TX activity Values from 0-100 are valid. A value of 0 disables this status block update (default 80). .It Va hw.bce.tx_cons_trip -How many TX Quick BD Chain entries that must be completed before a status block is generated. +How many TX Quick BD Chain entries that must be completed +before a status block is generated. Values from 0-100 are valid. A value of 0 disables this status block update. Cannot be set to 0 if hw.bce.tx_ticks is also 0 (default 20). .It Va hw.bce.tx_cons_trip_int -How many TX Quick BD Chain entries that must be completed before a status block is generated during an interrupt. +How many TX Quick BD Chain entries that must be completed +before a status block is generated during an interrupt. Values from 0-100 are valid. A value of 0 disables this status block update (default 20). .El From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 22:54:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28BB21065672; Mon, 4 Jun 2012 22:54:20 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 113518FC08; Mon, 4 Jun 2012 22:54:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54MsKY0072826; Mon, 4 Jun 2012 22:54:20 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54MsJjn072820; Mon, 4 Jun 2012 22:54:19 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201206042254.q54MsJjn072820@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 4 Jun 2012 22:54:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236592 - in head/sys: dev/filemon modules modules/filemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 22:54:20 -0000 Author: obrien Date: Mon Jun 4 22:54:19 2012 New Revision: 236592 URL: http://svn.freebsd.org/changeset/base/236592 Log: Add the 'filemon' device. 'filemon' is a kernel module that provides a device interface for processes to record system calls of its children. Submitted by: Juniper Networks. Added: head/sys/dev/filemon/ head/sys/dev/filemon/filemon.c (contents, props changed) head/sys/dev/filemon/filemon.h (contents, props changed) head/sys/dev/filemon/filemon_lock.c (contents, props changed) head/sys/dev/filemon/filemon_wrapper.c (contents, props changed) head/sys/modules/filemon/ head/sys/modules/filemon/Makefile (contents, props changed) Modified: head/sys/modules/Makefile Added: head/sys/dev/filemon/filemon.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/filemon/filemon.c Mon Jun 4 22:54:19 2012 (r236592) @@ -0,0 +1,377 @@ +/*- + * Copyright (c) 2011, David E. O'Brien. + * Copyright (c) 2009-2011, Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JUNIPER NETWORKS 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 JUNIPER NETWORKS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if __FreeBSD_version >= 900041 +#include +#endif + +#include "filemon.h" + +#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32) +#include +#include + +extern struct sysentvec ia32_freebsd_sysvec; +#endif + +extern struct sysentvec elf32_freebsd_sysvec; +extern struct sysentvec elf64_freebsd_sysvec; + +static d_close_t filemon_close; +static d_ioctl_t filemon_ioctl; +static d_open_t filemon_open; +static int filemon_unload(void); +static void filemon_load(void *); + +static struct cdevsw filemon_cdevsw = { + .d_version = D_VERSION, + .d_close = filemon_close, + .d_ioctl = filemon_ioctl, + .d_open = filemon_open, + .d_name = "filemon", +}; + +MALLOC_DECLARE(M_FILEMON); +MALLOC_DEFINE(M_FILEMON, "filemon", "File access monitor"); + +struct filemon { + TAILQ_ENTRY(filemon) link; /* Link into the in-use list. */ + struct mtx mtx; /* Lock mutex for this filemon. */ + struct cv cv; /* Lock condition variable for this + filemon. */ + struct file *fp; /* Output file pointer. */ + struct thread *locker; /* Ptr to the thread locking this + filemon. */ + pid_t pid; /* The process ID being monitored. */ + char fname1[MAXPATHLEN]; /* Temporary filename buffer. */ + char fname2[MAXPATHLEN]; /* Temporary filename buffer. */ + char msgbufr[1024]; /* Output message buffer. */ +}; + +static TAILQ_HEAD(, filemon) filemons_inuse = TAILQ_HEAD_INITIALIZER(filemons_inuse); +static TAILQ_HEAD(, filemon) filemons_free = TAILQ_HEAD_INITIALIZER(filemons_free); +static int n_readers = 0; +static struct mtx access_mtx; +static struct cv access_cv; +static struct thread *access_owner = NULL; +static struct thread *access_requester = NULL; + +#if __FreeBSD_version < 701000 +static struct clonedevs *filemon_clones; +static eventhandler_tag eh_tag; +#else +static struct cdev *filemon_dev; +#endif + +#include "filemon_lock.c" +#include "filemon_wrapper.c" + +#if __FreeBSD_version < 701000 +static void +filemon_clone(void *arg, struct ucred *cred, char *name, int namelen, + struct cdev **dev) +{ + int u = -1; + size_t len; + + if (*dev != NULL) + return; + + len = strlen(name); + + if (len != 7) + return; + + if (bcmp(name,"filemon", 7) != 0) + return; + + /* Clone the device to the new minor number. */ + if (clone_create(&filemon_clones, &filemon_cdevsw, &u, dev, 0) != 0) + /* Create the /dev/filemonNN entry. */ + *dev = make_dev_cred(&filemon_cdevsw, u, cred, UID_ROOT, + GID_WHEEL, 0666, "filemon%d", u); + if (*dev != NULL) { + dev_ref(*dev); + (*dev)->si_flags |= SI_CHEAPCLONE; + } +} +#endif + +static void +filemon_dtr(void *data) +{ + struct filemon *filemon = data; + + if (filemon != NULL) { + struct file *fp = filemon->fp; + + /* Get exclusive write access. */ + filemon_lock_write(); + + /* Remove from the in-use list. */ + TAILQ_REMOVE(&filemons_inuse, filemon, link); + + filemon->fp = NULL; + filemon->pid = -1; + + /* Add to the free list. */ + TAILQ_INSERT_TAIL(&filemons_free, filemon, link); + + /* Give up write access. */ + filemon_unlock_write(); + + if (fp != NULL) + fdrop(fp, curthread); + } +} + +static int +filemon_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag __unused, + struct thread *td) +{ + int error = 0; + struct filemon *filemon; + +#if __FreeBSD_version < 701000 + filemon = dev->si_drv1; +#else + devfs_get_cdevpriv((void **) &filemon); +#endif + + switch (cmd) { + /* Set the output file descriptor. */ + case FILEMON_SET_FD: +#if __FreeBSD_version < 900041 +#define FGET_WRITE(a1, a2, a3) fget_write((a1), (a2), (a3)) +#else +#define FGET_WRITE(a1, a2, a3) fget_write((a1), (a2), CAP_WRITE | CAP_SEEK, (a3)) +#endif + if ((error = FGET_WRITE(td, *(int *)data, &filemon->fp)) == 0) + /* Write the file header. */ + filemon_comment(filemon); + break; + + /* Set the monitored process ID. */ + case FILEMON_SET_PID: + filemon->pid = *((pid_t *) data); + break; + + default: + error = EINVAL; + break; + } + + return (error); +} + +static int +filemon_open(struct cdev *dev, int oflags __unused, int devtype __unused, + struct thread *td __unused) +{ + struct filemon *filemon; + + /* Get exclusive write access. */ + filemon_lock_write(); + + if ((filemon = TAILQ_FIRST(&filemons_free)) != NULL) + TAILQ_REMOVE(&filemons_free, filemon, link); + + /* Give up write access. */ + filemon_unlock_write(); + + if (filemon == NULL) { + filemon = malloc(sizeof(struct filemon), M_FILEMON, + M_WAITOK | M_ZERO); + + filemon->fp = NULL; + + mtx_init(&filemon->mtx, "filemon", "filemon", MTX_DEF); + cv_init(&filemon->cv, "filemon"); + } + + filemon->pid = curproc->p_pid; + +#if __FreeBSD_version < 701000 + dev->si_drv1 = filemon; +#else + devfs_set_cdevpriv(filemon, filemon_dtr); +#endif + + /* Get exclusive write access. */ + filemon_lock_write(); + + /* Add to the in-use list. */ + TAILQ_INSERT_TAIL(&filemons_inuse, filemon, link); + + /* Give up write access. */ + filemon_unlock_write(); + + return (0); +} + +static int +filemon_close(struct cdev *dev __unused, int flag __unused, int fmt __unused, + struct thread *td __unused) +{ +#if __FreeBSD_version < 701000 + filemon_dtr(dev->si_drv1); + + dev->si_drv1 = NULL; + + /* Schedule this cloned device to be destroyed. */ + destroy_dev_sched(dev); +#endif + + return (0); +} + +static void +filemon_load(void *dummy __unused) +{ + mtx_init(&access_mtx, "filemon", "filemon", MTX_DEF); + cv_init(&access_cv, "filemon"); + + /* Install the syscall wrappers. */ + filemon_wrapper_install(); + +#if __FreeBSD_version < 701000 + /* Enable device cloning. */ + clone_setup(&filemon_clones); + + /* Setup device cloning events. */ + eh_tag = EVENTHANDLER_REGISTER(dev_clone, filemon_clone, 0, 1000); +#else + filemon_dev = make_dev(&filemon_cdevsw, 0, UID_ROOT, GID_WHEEL, 0666, + "filemon"); +#endif +} + +static int +filemon_unload(void) +{ + struct filemon *filemon; + int error = 0; + + /* Get exclusive write access. */ + filemon_lock_write(); + + if (TAILQ_FIRST(&filemons_inuse) != NULL) + error = EBUSY; + else { +#if __FreeBSD_version >= 701000 + destroy_dev(filemon_dev); +#endif + + /* Deinstall the syscall wrappers. */ + filemon_wrapper_deinstall(); + } + + /* Give up write access. */ + filemon_unlock_write(); + + if (error == 0) { +#if __FreeBSD_version < 701000 + /* + * Check if there is still an event handler callback registered. + */ + if (eh_tag != 0) { + /* De-register the device cloning event handler. */ + EVENTHANDLER_DEREGISTER(dev_clone, eh_tag); + eh_tag = 0; + + /* Stop device cloning. */ + clone_cleanup(&filemon_clones); + } +#endif + /* free() filemon structs free list. */ + filemon_lock_write(); + while ((filemon = TAILQ_FIRST(&filemons_free)) != NULL) { + TAILQ_REMOVE(&filemons_free, filemon, link); + mtx_destroy(&filemon->mtx); + cv_destroy(&filemon->cv); + free(filemon, M_FILEMON); + } + filemon_unlock_write(); + + mtx_destroy(&access_mtx); + cv_destroy(&access_cv); + } + + return (error); +} + +static int +filemon_modevent(module_t mod __unused, int type, void *data) +{ + int error = 0; + + switch (type) { + case MOD_LOAD: + filemon_load(data); + break; + + case MOD_UNLOAD: + error = filemon_unload(); + break; + + case MOD_SHUTDOWN: + break; + + default: + error = EOPNOTSUPP; + break; + + } + + return (error); +} + +DEV_MODULE(filemon, filemon_modevent, NULL); +MODULE_VERSION(filemon, 1); Added: head/sys/dev/filemon/filemon.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/filemon/filemon.h Mon Jun 4 22:54:19 2012 (r236592) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2011, David E. O'Brien. + * Copyright (c) 2009-2011, Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JUNIPER NETWORKS 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 JUNIPER NETWORKS 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$ + */ + +#define FILEMON_SET_FD _IOWR('S', 1, int) +#define FILEMON_SET_PID _IOWR('S', 2, pid_t) + +#define FILEMON_VERSION 4 /* output format + (bump when adding record types) */ Added: head/sys/dev/filemon/filemon_lock.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/filemon/filemon_lock.c Mon Jun 4 22:54:19 2012 (r236592) @@ -0,0 +1,122 @@ +/*- + * Copyright (c) 2009-2011, Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JUNIPER NETWORKS 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 JUNIPER NETWORKS 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$"); + +static void +filemon_filemon_lock(struct filemon *filemon) +{ + mtx_lock(&filemon->mtx); + + while (filemon->locker != NULL && filemon->locker != curthread) + cv_wait(&filemon->cv, &filemon->mtx); + + filemon->locker = curthread; + + mtx_unlock(&filemon->mtx); +} + +static void +filemon_filemon_unlock(struct filemon *filemon) +{ + mtx_lock(&filemon->mtx); + + if (filemon->locker == curthread) + filemon->locker = NULL; + + /* Wake up threads waiting. */ + cv_broadcast(&filemon->cv); + + mtx_unlock(&filemon->mtx); +} + +static void +filemon_lock_read(void) +{ + mtx_lock(&access_mtx); + + while (access_owner != NULL || access_requester != NULL) + cv_wait(&access_cv, &access_mtx); + + n_readers++; + + /* Wake up threads waiting. */ + cv_broadcast(&access_cv); + + mtx_unlock(&access_mtx); +} + +static void +filemon_unlock_read(void) +{ + mtx_lock(&access_mtx); + + if (n_readers > 0) + n_readers--; + + /* Wake up a thread waiting. */ + cv_broadcast(&access_cv); + + mtx_unlock(&access_mtx); +} + +static void +filemon_lock_write(void) +{ + mtx_lock(&access_mtx); + + while (access_owner != curthread) { + if (access_owner == NULL && + (access_requester == NULL || + access_requester == curthread)) { + access_owner = curthread; + access_requester = NULL; + } else { + if (access_requester == NULL) + access_requester = curthread; + + cv_wait(&access_cv, &access_mtx); + } + } + + mtx_unlock(&access_mtx); +} + +static void +filemon_unlock_write(void) +{ + mtx_lock(&access_mtx); + + /* Sanity check that the current thread actually has the write lock. */ + if (access_owner == curthread) + access_owner = NULL; + + /* Wake up a thread waiting. */ + cv_broadcast(&access_cv); + + mtx_unlock(&access_mtx); +} Added: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/filemon/filemon_wrapper.c Mon Jun 4 22:54:19 2012 (r236592) @@ -0,0 +1,746 @@ +/*- + * Copyright (c) 2011, David E. O'Brien. + * Copyright (c) 2009-2011, Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JUNIPER NETWORKS 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 JUNIPER NETWORKS 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$"); + +#if __FreeBSD_version > 800032 +#define FILEMON_HAS_LINKAT +#endif + +#if __FreeBSD_version < 900044 /* r225617 (2011-09-16) failed to bump + __FreeBSD_version. This really should + be based on "900045". "900044" is r225469 + (2011-09-10) so this code is broken for + 9-CURRENT September 10th-16th. */ +#define sys_chdir chdir +#define sys_execve execve +#define sys_fork fork +#define sys_link link +#define sys_open open +#define sys_rename rename +#define sys_stat stat +#define sys_symlink symlink +#define sys_unlink unlink +#define sys_vfork vfork +#define sys_sys_exit sys_exit +#ifdef FILEMON_HAS_LINKAT +#define sys_linkat linkat +#endif +#endif /* __FreeBSD_version */ + +static void +filemon_output(struct filemon *filemon, char *msg, size_t len) +{ + struct uio auio; + struct iovec aiov; + + if (filemon->fp == NULL) + return; + + aiov.iov_base = msg; + aiov.iov_len = len; + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_resid = len; + auio.uio_segflg = UIO_SYSSPACE; + auio.uio_rw = UIO_WRITE; + auio.uio_td = curthread; + auio.uio_offset = (off_t) -1; + + bwillwrite(); + + fo_write(filemon->fp, &auio, curthread->td_ucred, 0, curthread); +} + +static struct filemon * +filemon_pid_check(struct proc *p) +{ + struct filemon *filemon; + + TAILQ_FOREACH(filemon, &filemons_inuse, link) { + if (p->p_pid == filemon->pid) + return (filemon); + } + + if (p->p_pptr == NULL) + return (NULL); + + return (filemon_pid_check(p->p_pptr)); +} + +static void +filemon_comment(struct filemon *filemon) +{ + int len; + struct timeval now; + + /* Load timestamp before locking. Less accurate but less contention. */ + getmicrotime(&now); + + /* Grab a read lock on the filemon inuse list. */ + filemon_lock_read(); + + /* Lock the found filemon structure. */ + filemon_filemon_lock(filemon); + + len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), + "# filemon version %d\n# Target pid %d\n# Start %ju.%06ju\nV %d\n", + FILEMON_VERSION, curproc->p_pid, (uintmax_t)now.tv_sec, + (uintmax_t)now.tv_usec, FILEMON_VERSION); + + filemon_output(filemon, filemon->msgbufr, len); + + /* Unlock the found filemon structure. */ + filemon_filemon_unlock(filemon); + + /* Release the read lock. */ + filemon_unlock_read(); +} + +static int +filemon_wrapper_chdir(struct thread *td, struct chdir_args *uap) +{ + int ret; + size_t done; + size_t len; + struct filemon *filemon; + + if ((ret = sys_chdir(td, uap)) == 0) { + /* Grab a read lock on the filemon inuse list. */ + filemon_lock_read(); + + if ((filemon = filemon_pid_check(curproc)) != NULL) { + /* Lock the found filemon structure. */ + filemon_filemon_lock(filemon); + + copyinstr(uap->path, filemon->fname1, + sizeof(filemon->fname1), &done); + + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "C %d %s\n", + curproc->p_pid, filemon->fname1); + + filemon_output(filemon, filemon->msgbufr, len); + + /* Unlock the found filemon structure. */ + filemon_filemon_unlock(filemon); + } + + /* Release the read lock. */ + filemon_unlock_read(); + } + + return (ret); +} + +static int +filemon_wrapper_execve(struct thread *td, struct execve_args *uap) +{ + char fname[MAXPATHLEN]; + int ret; + size_t done; + size_t len; + struct filemon *filemon; + + copyinstr(uap->fname, fname, sizeof(fname), &done); + + if ((ret = sys_execve(td, uap)) == 0) { + /* Grab a read lock on the filemon inuse list. */ + filemon_lock_read(); + + if ((filemon = filemon_pid_check(curproc)) != NULL) { + /* Lock the found filemon structure. */ + filemon_filemon_lock(filemon); + + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "E %d %s\n", + curproc->p_pid, fname); + + filemon_output(filemon, filemon->msgbufr, len); + + /* Unlock the found filemon structure. */ + filemon_filemon_unlock(filemon); + } + + /* Release the read lock. */ + filemon_unlock_read(); + } + + return (ret); +} + +#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32) +static int +filemon_wrapper_freebsd32_execve(struct thread *td, + struct freebsd32_execve_args *uap) +{ + char fname[MAXPATHLEN]; + int ret; + size_t done; + size_t len; + struct filemon *filemon; + + copyinstr(uap->fname, fname, sizeof(fname), &done); + + if ((ret = freebsd32_execve(td, uap)) == 0) { + /* Grab a read lock on the filemon inuse list. */ + filemon_lock_read(); + + if ((filemon = filemon_pid_check(curproc)) != NULL) { + /* Lock the found filemon structure. */ + filemon_filemon_lock(filemon); + + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "E %d %s\n", + curproc->p_pid, fname); + + filemon_output(filemon, filemon->msgbufr, len); + + /* Unlock the found filemon structure. */ + filemon_filemon_unlock(filemon); + } + + /* Release the read lock. */ + filemon_unlock_read(); + } + + return (ret); +} +#endif + +static int +filemon_wrapper_fork(struct thread *td, struct fork_args *uap) +{ + int ret; + size_t len; + struct filemon *filemon; + + if ((ret = sys_fork(td, uap)) == 0) { + /* Grab a read lock on the filemon inuse list. */ + filemon_lock_read(); + + if ((filemon = filemon_pid_check(curproc)) != NULL) { + /* Lock the found filemon structure. */ + filemon_filemon_lock(filemon); + + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "F %d %ld\n", + curproc->p_pid, (long)curthread->td_retval[0]); + + filemon_output(filemon, filemon->msgbufr, len); + + /* Unlock the found filemon structure. */ + filemon_filemon_unlock(filemon); + } + + /* Release the read lock. */ + filemon_unlock_read(); + } + + return (ret); +} + +static int +filemon_wrapper_open(struct thread *td, struct open_args *uap) +{ + int ret; + size_t done; + size_t len; + struct filemon *filemon; + + if ((ret = sys_open(td, uap)) == 0) { + /* Grab a read lock on the filemon inuse list. */ + filemon_lock_read(); + + if ((filemon = filemon_pid_check(curproc)) != NULL) { + /* Lock the found filemon structure. */ + filemon_filemon_lock(filemon); + + copyinstr(uap->path, filemon->fname1, + sizeof(filemon->fname1), &done); + + if (uap->flags & O_RDWR) { + /* + * We'll get the W record below, but need + * to also output an R to distingish from + * O_WRONLY. + */ + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "R %d %s\n", + curproc->p_pid, filemon->fname1); + filemon_output(filemon, filemon->msgbufr, len); + } + + + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "%c %d %s\n", + (uap->flags & O_ACCMODE) ? 'W':'R', + curproc->p_pid, filemon->fname1); + filemon_output(filemon, filemon->msgbufr, len); + + /* Unlock the found filemon structure. */ + filemon_filemon_unlock(filemon); + } + + /* Release the read lock. */ + filemon_unlock_read(); + } + + return (ret); +} + +static int +filemon_wrapper_rename(struct thread *td, struct rename_args *uap) +{ + int ret; + size_t done; + size_t len; + struct filemon *filemon; + + if ((ret = sys_rename(td, uap)) == 0) { + /* Grab a read lock on the filemon inuse list. */ + filemon_lock_read(); + + if ((filemon = filemon_pid_check(curproc)) != NULL) { + /* Lock the found filemon structure. */ + filemon_filemon_lock(filemon); + + copyinstr(uap->from, filemon->fname1, + sizeof(filemon->fname1), &done); + copyinstr(uap->to, filemon->fname2, + sizeof(filemon->fname2), &done); + + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "M %d '%s' '%s'\n", + curproc->p_pid, filemon->fname1, filemon->fname2); + + filemon_output(filemon, filemon->msgbufr, len); + + /* Unlock the found filemon structure. */ + filemon_filemon_unlock(filemon); + } + + /* Release the read lock. */ + filemon_unlock_read(); + } + + return (ret); +} + +static int +filemon_wrapper_link(struct thread *td, struct link_args *uap) +{ + int ret; + size_t done; + size_t len; + struct filemon *filemon; + + if ((ret = sys_link(td, uap)) == 0) { + /* Grab a read lock on the filemon inuse list. */ + filemon_lock_read(); + + if ((filemon = filemon_pid_check(curproc)) != NULL) { + /* Lock the found filemon structure. */ + filemon_filemon_lock(filemon); + + copyinstr(uap->path, filemon->fname1, + sizeof(filemon->fname1), &done); + copyinstr(uap->link, filemon->fname2, + sizeof(filemon->fname2), &done); + + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "L %d '%s' '%s'\n", + curproc->p_pid, filemon->fname1, filemon->fname2); + + filemon_output(filemon, filemon->msgbufr, len); + + /* Unlock the found filemon structure. */ + filemon_filemon_unlock(filemon); + } + + /* Release the read lock. */ + filemon_unlock_read(); + } + + return (ret); +} + +static int +filemon_wrapper_symlink(struct thread *td, struct symlink_args *uap) +{ + int ret; + size_t done; + size_t len; + struct filemon *filemon; + + if ((ret = sys_symlink(td, uap)) == 0) { + /* Grab a read lock on the filemon inuse list. */ + filemon_lock_read(); + + if ((filemon = filemon_pid_check(curproc)) != NULL) { + /* Lock the found filemon structure. */ + filemon_filemon_lock(filemon); + + copyinstr(uap->path, filemon->fname1, + sizeof(filemon->fname1), &done); + copyinstr(uap->link, filemon->fname2, + sizeof(filemon->fname2), &done); + + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "L %d '%s' '%s'\n", + curproc->p_pid, filemon->fname1, filemon->fname2); + + filemon_output(filemon, filemon->msgbufr, len); + + /* Unlock the found filemon structure. */ + filemon_filemon_unlock(filemon); + } + + /* Release the read lock. */ + filemon_unlock_read(); + } + + return (ret); +} + +#ifdef FILEMON_HAS_LINKAT +static int +filemon_wrapper_linkat(struct thread *td, struct linkat_args *uap) +{ + int ret; + size_t done; + size_t len; + struct filemon *filemon; + + if ((ret = sys_linkat(td, uap)) == 0) { + /* Grab a read lock on the filemon inuse list. */ + filemon_lock_read(); + + if ((filemon = filemon_pid_check(curproc)) != NULL) { + /* Lock the found filemon structure. */ + filemon_filemon_lock(filemon); + + copyinstr(uap->path1, filemon->fname1, + sizeof(filemon->fname1), &done); + copyinstr(uap->path2, filemon->fname2, + sizeof(filemon->fname2), &done); + + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "L %d '%s' '%s'\n", + curproc->p_pid, filemon->fname1, filemon->fname2); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 22:59:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FCD7106566B; Mon, 4 Jun 2012 22:59:07 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FC388FC1B; Mon, 4 Jun 2012 22:59:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54Mx75d073087; Mon, 4 Jun 2012 22:59:07 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54Mx7Ok073084; Mon, 4 Jun 2012 22:59:07 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201206042259.q54Mx7Ok073084@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 4 Jun 2012 22:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236593 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 22:59:07 -0000 Author: obrien Date: Mon Jun 4 22:59:06 2012 New Revision: 236593 URL: http://svn.freebsd.org/changeset/base/236593 Log: Add a man page for filemon(4) [r236592]. Added: head/share/man/man4/filemon.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Jun 4 22:54:19 2012 (r236592) +++ head/share/man/man4/Makefile Mon Jun 4 22:59:06 2012 (r236593) @@ -126,6 +126,7 @@ MAN= aac.4 \ fdt.4 \ fdtbus.4 \ ffclock.4 \ + filemon.4 \ firewire.4 \ fpa.4 \ fwe.4 \ Added: head/share/man/man4/filemon.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/filemon.4 Mon Jun 4 22:59:06 2012 (r236593) @@ -0,0 +1,166 @@ +.\" Copyright (c) 2012 +.\" David E. O'Brien . All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by David E. O'Brien and +.\" contributors. +.\" 4. Neither the name of the author 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 AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 30, 2012 +.Dt FILEMON 4 +.Os +.Sh NAME +.Nm filemon +.Nd the filemon device +.Sh SYNOPSIS +.In dev/filemon/filemon.h +.Sh DESCRIPTION +The +.Nm +device allows a process to collect file operations data of its children. +The device +.Pa /dev/filemon +responds to two +.Xr ioctl 2 +calls. +.Pp +System calls are denoted using the following single letters: +.Bl -tag -width indent -compact +.It Dq Li C +.Xr chdir 2 +.It Dq Li D +.Xr unlink 2 +.It Dq Li E +.Xr exec 2 +.It Dq Li F +.Xr fork 2 , +.Xr vfork 2 +.It Dq Li L +.Xr link 2 , +.Xr linkat 2 , +.Xr symlink 2 , +.Xr symlinkat 2 +.It Dq Li M +.Xr rename 2 +.It Dq Li R +.Xr open 2 +for read +.It Dq Li S +.Xr stat 2 +.It Dq Li W +.Xr open 2 +for write +.It Dq Li X +.Xr _exit 2 +.El +.Pp +Note that +.Dq R +following +.Dq W +records can represent a single +.Xr open 2 +for R/W, +or two seperate +.Xr open 2 +calls, one for +R +and one for +W. +.Sh IOCTLS +User mode programs communicate with the filemon driver through a +number of ioctls which are described below. +Each takes a single argument. +.Bl -tag -width FILEMON_SET_PID +.It Dv FILEMON_SET_FD +Write the internal tracing buffer to the supplied open file descriptor. +.It Dv FILEMON_SET_PID . +Child process ID to trace. +.El +.Pp +.Sh RETURN VALUES +The ioctl returns zero on success and non-zero on failure. +.Sh EXAMPLES +.Bd -literal -offset indent +#include +#include +#include +#include +#include +#include +#include + +static void +open_filemon(void) +{ + pid_t child; + int fm_fd, fm_log; + + if ((fm_fd = open("/dev/filemon", O_RDWR)) == -1) + err(1, "open(\"/dev/filemon\", O_RDWR)"); + if ((fm_log = open("filemon.out", + O_CREAT | O_WRONLY | O_TRUNC, DEFFILEMODE)) == -1) + err(1, "open(filemon.out)"); + + if (ioctl(fm_fd, FILEMON_SET_FD, &fm_log) < 0) + err(1, "Cannot set filemon log file descriptor"); + /* Set up these two fd's to close on exec. */ + (void)fcntl(fm_fd, F_SETFD, FD_CLOEXEC); + (void)fcntl(fm_log, F_SETFD, FD_CLOEXEC); + + if ((child = fork()) == 0) { + /* Do something here. */ + return 0; + } else { + if (ioctl(fm_fd, FILEMON_SET_PID, &child) < 0) + err(1, "Cannot set filemon PID"); + wait(&child); + close(fm_fd); + } + return 0; +} +.Ed +.Pp +Creates a file named +.Pa filemon.out +and configures the +.Nm +device to write the filemon buffer contents to it. +.Sh FILES +.Bl -tag -width /dev/zero +.It Pa /dev/filemon +.El +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr ktrace 1 , +.Xr truss 1 +.Sh HISTORY +A +.Nm +device appeared in +.Fx 9.1 . From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 22:59:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2C2181065688; Mon, 4 Jun 2012 22:59:34 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15DE68FC22; Mon, 4 Jun 2012 22:59:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q54MxXGH073145; Mon, 4 Jun 2012 22:59:33 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q54MxXuv073142; Mon, 4 Jun 2012 22:59:33 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201206042259.q54MxXuv073142@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 4 Jun 2012 22:59:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236594 - head/tools/regression/filemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 22:59:34 -0000 Author: obrien Date: Mon Jun 4 22:59:33 2012 New Revision: 236594 URL: http://svn.freebsd.org/changeset/base/236594 Log: Add a regression test for filemon(4) [r236592]. Added: head/tools/regression/filemon/ head/tools/regression/filemon/Makefile (contents, props changed) head/tools/regression/filemon/filemontest.c (contents, props changed) head/tools/regression/filemon/test_script.sh (contents, props changed) Added: head/tools/regression/filemon/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/filemon/Makefile Mon Jun 4 22:59:33 2012 (r236594) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +PROG= filemontest + +NO_MAN= + +WARNS?= 6 +CFLAGS+= -I${.CURDIR}/../../../sys + +# Cannot use .OBJDIR -- 'filemontest' expects 'test_script.sh' in . +test: ${PROG} clean-test + cd ${.CURDIR} ; \ + for A in 1 2 3 4 5 6 7 8 9 0; do \ + for B in 1 2 3 4 5 6 7 8 9 0; do \ + for C in 1 2 3 4 5 6 7 8 9 0; do \ + ${.OBJDIR}/${PROG} ;\ + done ;\ + done ;\ + done + @cd ${.CURDIR} ; set +e ; egrep '(Start|Stop) .*\.' filemon_log.* | \ + grep -q -v '\.[0-9][0-9][0-9][0-9][0-9][0-9]$$' || echo "Time stamp format OK" + +clean-test: + cd ${.CURDIR} ; rm -f filemon_log.* + +.include Added: head/tools/regression/filemon/filemontest.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/filemon/filemontest.c Mon Jun 4 22:59:33 2012 (r236594) @@ -0,0 +1,75 @@ +/*- + * Copyright (c) 2009-2011, Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JUNIPER NETWORKS 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 JUNIPER NETWORKS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include + +#include +#include +#include +#include +#include + +/* + * This simple test of filemon expects a test script called + * "test_script.sh" in the cwd. + */ + +int +main(void) { + char log_name[] = "filemon_log.XXXXXX"; + pid_t child; + int fm_fd, fm_log; + + if ((fm_fd = open("/dev/filemon", O_RDWR)) == -1) + err(1, "open(\"/dev/filemon\", O_RDWR)"); + if ((fm_log = mkstemp(log_name)) == -1) + err(1, "mkstemp(%s)", log_name); + + if (ioctl(fm_fd, FILEMON_SET_FD, &fm_log) < 0) + err(1, "Cannot set filemon log file descriptor"); + + /* Set up these two fd's to close on exec. */ + (void)fcntl(fm_fd, F_SETFD, FD_CLOEXEC); + (void)fcntl(fm_log, F_SETFD, FD_CLOEXEC); + + if ((child = fork()) == 0) { + system("./test_script.sh"); + return 0; + } else { + if (ioctl(fm_fd, FILEMON_SET_PID, &child) < 0) + err(1, "Cannot set filemon PID"); + wait(&child); + close(fm_fd); +// printf("Results in %s\n", log_name); + } + return 0; +} Added: head/tools/regression/filemon/test_script.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/filemon/test_script.sh Mon Jun 4 22:59:33 2012 (r236594) @@ -0,0 +1,43 @@ +#! /bin/sh +# +# Copyright (c) 2011, Juniper Networks, Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY JUNIPER NETWORKS 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 JUNIPER NETWORKS 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$ + +trap 'rm -f $f1 $f2; exit 1' 1 2 3 13 15 +echo shazbot > /dev/null +f1=`mktemp /tmp/filemon_test.XXXXXX` +f2=`mktemp /tmp/ed-script.XXXXXX` +> $f1 +echo "One line to rule them all" >> $f1 +wc -l $f1 > /dev/null +# ed(1)'s /tmp/ed.* buffer file will be opened RW +echo ',s/$/./g' > $f2 +echo 'wq' >>$f2 +ed -s $f1 < $f2 +#echo ",s/$/./\ +#w" | ed -s $f1 +#rm $f1 $f2 +uptime > /dev/null From owner-svn-src-all@FreeBSD.ORG Mon Jun 4 23:07:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7F511065674 for ; Mon, 4 Jun 2012 23:07:49 +0000 (UTC) (envelope-from andy@fud.org.nz) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id A6C708FC0C for ; Mon, 4 Jun 2012 23:07:49 +0000 (UTC) Received: by dadv36 with SMTP id v36so6832529dad.13 for ; Mon, 04 Jun 2012 16:07:48 -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:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=81xmapn/XKJPtuwcx3gAfP5Q3AWV9MHYRaitCBTlr4c=; b=UCvOiuIzNtg8j7pk8VlqKbo1ox+2ZMmM0uatfauewxW7MLB/ll5mB71vMZd05qRDv9 1ttsiooWUVcG+vBpwn8DI4cXSqTZ6VE9Ft1Oo0uv0mS9B3znXNFVTjhEmWgEW7WxpKw2 Kx2VCsfFT3yBSjt78oexpjaA08ltetw4Yf/Sd7SDBaK+OFM6W06aY8agI6Q0yCeJAokl ekY1e2I4u3ZRQdq7p0diSxVICfaS1ZZ/h4IfTBxJb1jsa6d4hgPX7I3DfEw2BxN66ac2 YhSqLKzlLlhwC6ZnnZ+mWadD/fLeqM923FmodtBzSPvv+LsW/rsRTTQiexKDNUVeB4bH 5F8A== MIME-Version: 1.0 Received: by 10.68.201.73 with SMTP id jy9mr43445060pbc.19.1338851268537; Mon, 04 Jun 2012 16:07:48 -0700 (PDT) Sender: andy@fud.org.nz Received: by 10.68.73.161 with HTTP; Mon, 4 Jun 2012 16:07:48 -0700 (PDT) In-Reply-To: <201206042259.q54Mx7Ok073084@svn.freebsd.org> References: <201206042259.q54Mx7Ok073084@svn.freebsd.org> Date: Tue, 5 Jun 2012 11:07:48 +1200 X-Google-Sender-Auth: phKuPW4R9GZNU73Vaw-JgkAo5tg Message-ID: From: Andrew Thompson To: "David E. O'Brien" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQmbqfD+K+t6l37EbuiId2lXXdzEAh2aKsn404L18k+e5PGMTMCzaQD0kG6sdtNHyyLNfq4Q Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r236593 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 23:07:49 -0000 On 5 June 2012 10:59, David E. O'Brien wrote: > Author: obrien > Date: Mon Jun =A04 22:59:06 2012 > New Revision: 236593 > URL: http://svn.freebsd.org/changeset/base/236593 > > Log: > =A0Add a man page for filemon(4) [r236592]. > +static void > +open_filemon(void) > +{ > + > + =A0 =A0 =A0 if ((child =3D fork()) =3D=3D 0) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Do something here. */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return 0; > + =A0 =A0 =A0 } else { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (ioctl(fm_fd, FILEMON_SET_PID, &child) <= 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 err(1, "Cannot set filemon = PID"); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 wait(&child); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 close(fm_fd); > + =A0 =A0 =A0 } > + =A0 =A0 =A0 return 0; Does the race have to be managed between the parent SET_PID ioctl and the child doing something? Andrew From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 02:18:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 63733106566B; Tue, 5 Jun 2012 02:18:55 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F3758FC14; Tue, 5 Jun 2012 02:18:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q552ItdC081924; Tue, 5 Jun 2012 02:18:55 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q552Itik081922; Tue, 5 Jun 2012 02:18:55 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201206050218.q552Itik081922@svn.freebsd.org> From: Warren Block Date: Tue, 5 Jun 2012 02:18:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236595 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 02:18:55 -0000 Author: wblock (doc committer) Date: Tue Jun 5 02:18:54 2012 New Revision: 236595 URL: http://svn.freebsd.org/changeset/base/236595 Log: More wording corrections and simplifications. Approved by: gjb (mentor) Modified: head/share/man/man4/vlan.4 Modified: head/share/man/man4/vlan.4 ============================================================================== --- head/share/man/man4/vlan.4 Mon Jun 4 22:59:33 2012 (r236594) +++ head/share/man/man4/vlan.4 Tue Jun 5 02:18:54 2012 (r236595) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 25, 2011 +.Dd June 4, 2012 .Dt VLAN 4 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd "IEEE 802.1Q VLAN network interface" .Sh SYNOPSIS To compile this driver into the kernel, -place the following lines in your +place the following line in your kernel configuration file: .Bd -ragged -offset indent .Cd "device vlan" @@ -119,8 +119,8 @@ It may have either capability enabled pe a way to turn it off. The whole issue is very specific to a particular device and its driver. .Pp -At present, physical interfaces capable of full VLAN processing -in the hardware is limited to these devices: +At present, these devices are capable of full VLAN processing +in hardware: .Xr ae 4 , .Xr age 4 , .Xr alc 4 , @@ -196,7 +196,7 @@ for use and calculates the appropriate frame MTU based on the capabilities of the parent interface. Some other interfaces not listed above may handle long frames, -but they do not advertise this ability of theirs. +but they do not advertise this ability. The MTU setting on .Nm can be corrected manually if used in conjunction with such a parent interface. From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 02:48:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A1A010657B8; Tue, 5 Jun 2012 02:48:59 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3B38C8FC0C; Tue, 5 Jun 2012 02:48:59 +0000 (UTC) Received: by dadv36 with SMTP id v36so7038678dad.13 for ; Mon, 04 Jun 2012 19:48: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=o1IVUyFrAwnBLisIWuzUeSsF+UU4Mo6M/bS/GVXIFmQ=; b=SrY/88lSNlDup57sjsx/B7f9+M4KyU3fQW9CZ9DmlFabxzuhKcq7r+W1IeVl1OqkSo wcyDg9tIBTyQheWGBkxCo4TnN7hb4hHD4t/xJJYw77K7cxK051V0Q+UdefHYFga6yYjH RfyQmNjhTAloFih3+b+59Ap0Aj2/vQUZWwXihAeto3F6SjqAnFG527MmI51U8I80rAfF br5mWl+zca1rwhJM/p8qfkzI0EeXRMHZ6uHmetn6RYTm2PHSBTkl96NBkrLcyQ3vHT4w G7kcRsm07R8jtsQeHvjkoAGcp5UqkDHX0otcazTv/33LCNvGq1Pg4PgLrByEWuYo7gnu tUtQ== MIME-Version: 1.0 Received: by 10.68.116.203 with SMTP id jy11mr35402052pbb.129.1338864538878; Mon, 04 Jun 2012 19:48:58 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.143.91.18 with HTTP; Mon, 4 Jun 2012 19:48:58 -0700 (PDT) In-Reply-To: <201206041418.q54EIDU3046078@svn.freebsd.org> References: <201206041418.q54EIDU3046078@svn.freebsd.org> Date: Mon, 4 Jun 2012 19:48:58 -0700 X-Google-Sender-Auth: izhogV0mdiB91dE2aP46I7BH-x0 Message-ID: From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r236563 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 02:48:59 -0000 Hi, This commit undid part of what you committed in a previous commit? Adrian From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 03:14:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7E8B106564A; Tue, 5 Jun 2012 03:14:39 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D10208FC12; Tue, 5 Jun 2012 03:14:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q553EdJR084736; Tue, 5 Jun 2012 03:14:39 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q553EdPb084726; Tue, 5 Jun 2012 03:14:39 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206050314.q553EdPb084726@svn.freebsd.org> From: Eitan Adler Date: Tue, 5 Jun 2012 03:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236596 - in head: share/man/man4 share/man/man5 share/man/man7 sys/netinet/libalias usr.bin/find usr.bin/gzip usr.bin/usbhidctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 03:14:40 -0000 Author: eadler Date: Tue Jun 5 03:14:39 2012 New Revision: 236596 URL: http://svn.freebsd.org/changeset/base/236596 Log: Fix style nit: don't use leading zero for dates in .Dd Prompted by: brueffer Approved by: brueffer MFC after: 3 days Modified: head/share/man/man4/io.4 head/share/man/man4/ng_ksocket.4 head/share/man/man5/make.conf.5 head/share/man/man5/rc.conf.5 head/share/man/man7/development.7 head/sys/netinet/libalias/libalias.3 head/usr.bin/find/find.1 head/usr.bin/gzip/zmore.1 head/usr.bin/usbhidctl/usbhidctl.1 Modified: head/share/man/man4/io.4 ============================================================================== --- head/share/man/man4/io.4 Tue Jun 5 02:18:54 2012 (r236595) +++ head/share/man/man4/io.4 Tue Jun 5 03:14:39 2012 (r236596) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 01, 2010 +.Dd June 1, 2010 .Dt IO 4 .Os .Sh NAME Modified: head/share/man/man4/ng_ksocket.4 ============================================================================== --- head/share/man/man4/ng_ksocket.4 Tue Jun 5 02:18:54 2012 (r236595) +++ head/share/man/man4/ng_ksocket.4 Tue Jun 5 03:14:39 2012 (r236596) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 09, 2012 +.Dd January 9, 2012 .Dt NG_KSOCKET 4 .Os .Sh NAME Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Tue Jun 5 02:18:54 2012 (r236595) +++ head/share/man/man5/make.conf.5 Tue Jun 5 03:14:39 2012 (r236596) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 02, 2012 +.Dd May 2, 2012 .Dt MAKE.CONF 5 .Os .Sh NAME Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Tue Jun 5 02:18:54 2012 (r236595) +++ head/share/man/man5/rc.conf.5 Tue Jun 5 03:14:39 2012 (r236596) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 06, 2012 +.Dd May 6, 2012 .Dt RC.CONF 5 .Os .Sh NAME Modified: head/share/man/man7/development.7 ============================================================================== --- head/share/man/man7/development.7 Tue Jun 5 02:18:54 2012 (r236595) +++ head/share/man/man7/development.7 Tue Jun 5 03:14:39 2012 (r236596) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 02, 2012 +.Dd May 2, 2012 .Dt DEVELOPMENT 7 .Os .Sh NAME Modified: head/sys/netinet/libalias/libalias.3 ============================================================================== --- head/sys/netinet/libalias/libalias.3 Tue Jun 5 02:18:54 2012 (r236595) +++ head/sys/netinet/libalias/libalias.3 Tue Jun 5 03:14:39 2012 (r236596) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 04, 2011 +.Dd July 4, 2011 .Dt LIBALIAS 3 .Os .Sh NAME Modified: head/usr.bin/find/find.1 ============================================================================== --- head/usr.bin/find/find.1 Tue Jun 5 02:18:54 2012 (r236595) +++ head/usr.bin/find/find.1 Tue Jun 5 03:14:39 2012 (r236596) @@ -31,7 +31,7 @@ .\" @(#)find.1 8.7 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd May 06, 2012 +.Dd May 6, 2012 .Dt FIND 1 .Os .Sh NAME Modified: head/usr.bin/gzip/zmore.1 ============================================================================== --- head/usr.bin/gzip/zmore.1 Tue Jun 5 02:18:54 2012 (r236595) +++ head/usr.bin/gzip/zmore.1 Tue Jun 5 03:14:39 2012 (r236596) @@ -20,7 +20,7 @@ .\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" .\" $FreeBSD$ -.Dd February 06, 2011 +.Dd February 6, 2011 .Dt ZMORE 1 .Os .Sh NAME Modified: head/usr.bin/usbhidctl/usbhidctl.1 ============================================================================== --- head/usr.bin/usbhidctl/usbhidctl.1 Tue Jun 5 02:18:54 2012 (r236595) +++ head/usr.bin/usbhidctl/usbhidctl.1 Tue Jun 5 03:14:39 2012 (r236596) @@ -28,7 +28,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 01, 2011 +.Dd August 1, 2011 .Dt USBHIDCTL 1 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 03:14:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A3D3A10657AF; Tue, 5 Jun 2012 03:14:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F6F28FC08; Tue, 5 Jun 2012 03:14:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q553Eoj2084782; Tue, 5 Jun 2012 03:14:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q553EoPP084778; Tue, 5 Jun 2012 03:14:50 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201206050314.q553EoPP084778@svn.freebsd.org> From: Adrian Chadd Date: Tue, 5 Jun 2012 03:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236597 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 03:14:50 -0000 Author: adrian Date: Tue Jun 5 03:14:49 2012 New Revision: 236597 URL: http://svn.freebsd.org/changeset/base/236597 Log: Create a function - ath_tx_kick() - which is called where ath_start() is called to "kick" along TX. For now, schedule a taskqueue call. Later on I may go back to the direct call of ath_rx_tasklet() - but for now, this will do. I've tested UDP and TCP TX. UDP TX still achieves 240MBit, but TCP TX gets stuck at around 100MBit or so, instead of the 150MBit it should be at. I'll re-test with no ACPI/power/sleep states enabled at startup and see what effect it has. This is in preparation for supporting an if_transmit() path, which will turn ath_tx_kick() into a NUL operation (as there won't be an ifnet queue to service.) Tested: * AR9280 STA TODO: * test on AR5416, AR9160, AR928x STA/AP modes PR: kern/168649 Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Jun 5 03:14:39 2012 (r236596) +++ head/sys/dev/ath/if_ath.c Tue Jun 5 03:14:49 2012 (r236597) @@ -142,6 +142,7 @@ static void ath_vap_delete(struct ieee80 static void ath_init(void *); static void ath_stop_locked(struct ifnet *); static void ath_stop(struct ifnet *); +static void ath_tx_tasklet(void *arg, int npending); static int ath_reset_vap(struct ieee80211vap *, u_long); static int ath_media_change(struct ifnet *); static void ath_watchdog(void *); @@ -2330,7 +2331,7 @@ ath_start(struct ifnet *ifp) taskqueue_enqueue(sc->sc_tq, &sc->sc_txstarttask); } -void +static void ath_tx_tasklet(void *arg, int npending) { struct ath_softc *sc = (struct ath_softc *) arg; @@ -3509,8 +3510,7 @@ ath_tx_proc_q0(void *arg, int npending) sc->sc_txproc_cnt--; ATH_PCU_UNLOCK(sc); - // ath_start(ifp); - ath_tx_tasklet(sc, 1); + ath_tx_kick(sc); } /* @@ -3560,8 +3560,7 @@ ath_tx_proc_q0123(void *arg, int npendin sc->sc_txproc_cnt--; ATH_PCU_UNLOCK(sc); - //ath_start(ifp); - ath_tx_tasklet(sc, 1); + ath_tx_kick(sc); } /* @@ -3604,8 +3603,7 @@ ath_tx_proc(void *arg, int npending) sc->sc_txproc_cnt--; ATH_PCU_UNLOCK(sc); - //ath_start(ifp); - ath_tx_tasklet(sc, 1); + ath_tx_kick(sc); } #undef TXQACTIVE Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Tue Jun 5 03:14:39 2012 (r236596) +++ head/sys/dev/ath/if_ath_misc.h Tue Jun 5 03:14:49 2012 (r236597) @@ -83,7 +83,17 @@ extern void ath_setslottime(struct ath_s * we can kill this. */ extern void ath_start(struct ifnet *ifp); -extern void ath_tx_tasklet(void *arg, int npending); +static inline void +ath_tx_kick(struct ath_softc *sc) +{ + + /* + * Use a taskqueue to schedule a TX completion task, + * even if we're in taskqueue context. That way this can + * be called from any context. + */ + taskqueue_enqueue(sc->sc_tq, &sc->sc_txstarttask); +} #endif Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Tue Jun 5 03:14:39 2012 (r236596) +++ head/sys/dev/ath/if_ath_rx.c Tue Jun 5 03:14:49 2012 (r236597) @@ -899,8 +899,7 @@ rx_proc_next: ieee80211_ff_age_all(ic, 100); #endif if (!IFQ_IS_EMPTY(&ifp->if_snd)) - ath_tx_tasklet(sc, 1); - //ath_start(ifp); + ath_tx_kick(sc); } #undef PA2DESC From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 05:14:12 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 15B2E1065676; Tue, 5 Jun 2012 05:14:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 8D1FF8FC12; Tue, 5 Jun 2012 05:14:11 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q555EASU093611; Tue, 5 Jun 2012 09:14:10 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q555EAJX093610; Tue, 5 Jun 2012 09:14:10 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 5 Jun 2012 09:14:10 +0400 From: Gleb Smirnoff To: Adrian Chadd Message-ID: <20120605051410.GR44607@FreeBSD.org> References: <201206041418.q54EIDU3046078@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r236563 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 05:14:12 -0000 On Mon, Jun 04, 2012 at 07:48:58PM -0700, Adrian Chadd wrote: A> This commit undid part of what you committed in a previous commit? It didn't. Since we are sure that second arugment of m_cat() isn't a chain, but a single M_EXT mbuf, we can skip using m_cat and reduce code to m_last. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 05:16:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F2241065675; Tue, 5 Jun 2012 05:16:05 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A9308FC0A; Tue, 5 Jun 2012 05:16:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q555G5GJ090179; Tue, 5 Jun 2012 05:16:05 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q555G5cD090176; Tue, 5 Jun 2012 05:16:05 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201206050516.q555G5cD090176@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 5 Jun 2012 05:16:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236598 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 05:16:05 -0000 Author: glebius Date: Tue Jun 5 05:16:04 2012 New Revision: 236598 URL: http://svn.freebsd.org/changeset/base/236598 Log: style(9) for r236563. Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Tue Jun 5 03:14:49 2012 (r236597) +++ head/sys/kern/uipc_syscalls.c Tue Jun 5 05:16:04 2012 (r236598) @@ -2182,9 +2182,9 @@ retry_space: m0->m_len = xfsize; /* Append to mbuf chain. */ - if (mtail != NULL) { + if (mtail != NULL) mtail->m_next = m0; - } else if (m != NULL) + else if (m != NULL) m_last(m)->m_next = m0; else m = m0; From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 06:03:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C0C4D106564A; Tue, 5 Jun 2012 06:03:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A18AC8FC12; Tue, 5 Jun 2012 06:03:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5563tPK092338; Tue, 5 Jun 2012 06:03:55 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5563tN1092334; Tue, 5 Jun 2012 06:03:55 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201206050603.q5563tN1092334@svn.freebsd.org> From: Adrian Chadd Date: Tue, 5 Jun 2012 06:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236599 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 06:03:55 -0000 Author: adrian Date: Tue Jun 5 06:03:55 2012 New Revision: 236599 URL: http://svn.freebsd.org/changeset/base/236599 Log: Mostly revert previous commit(s). After doing a bunch of local testing, it turns out that it negatively affects performance. I'm stil investigating exactly why deferring the IO causes such negative TCP performance but doesn't affect UDP preformance. Leave the ath_tx_kick() change in there however; it's going to be useful to have that there for if_transmit() work. PR: kern/168649 Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Jun 5 05:16:04 2012 (r236598) +++ head/sys/dev/ath/if_ath.c Tue Jun 5 06:03:55 2012 (r236599) @@ -142,7 +142,6 @@ static void ath_vap_delete(struct ieee80 static void ath_init(void *); static void ath_stop_locked(struct ifnet *); static void ath_stop(struct ifnet *); -static void ath_tx_tasklet(void *arg, int npending); static int ath_reset_vap(struct ieee80211vap *, u_long); static int ath_media_change(struct ifnet *); static void ath_watchdog(void *); @@ -374,7 +373,6 @@ ath_attach(u_int16_t devid, struct ath_s "%s taskq", ifp->if_xname); TASK_INIT(&sc->sc_rxtask, 0, ath_rx_tasklet, sc); - TASK_INIT(&sc->sc_txstarttask, 0, ath_tx_tasklet, sc); TASK_INIT(&sc->sc_bmisstask, 0, ath_bmiss_proc, sc); TASK_INIT(&sc->sc_bstucktask,0, ath_bstuck_proc, sc); TASK_INIT(&sc->sc_resettask,0, ath_reset_proc, sc); @@ -2327,15 +2325,6 @@ void ath_start(struct ifnet *ifp) { struct ath_softc *sc = ifp->if_softc; - - taskqueue_enqueue(sc->sc_tq, &sc->sc_txstarttask); -} - -static void -ath_tx_tasklet(void *arg, int npending) -{ - struct ath_softc *sc = (struct ath_softc *) arg; - struct ifnet *ifp = sc->sc_ifp; struct ieee80211_node *ni; struct ath_buf *bf; struct mbuf *m, *next; Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Tue Jun 5 05:16:04 2012 (r236598) +++ head/sys/dev/ath/if_ath_misc.h Tue Jun 5 06:03:55 2012 (r236599) @@ -88,12 +88,7 @@ static inline void ath_tx_kick(struct ath_softc *sc) { - /* - * Use a taskqueue to schedule a TX completion task, - * even if we're in taskqueue context. That way this can - * be called from any context. - */ - taskqueue_enqueue(sc->sc_tq, &sc->sc_txstarttask); + ath_start(sc->sc_ifp); } #endif Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue Jun 5 05:16:04 2012 (r236598) +++ head/sys/dev/ath/if_athvar.h Tue Jun 5 06:03:55 2012 (r236599) @@ -476,7 +476,6 @@ struct ath_softc { struct mbuf *sc_rxpending; /* pending receive data */ u_int32_t *sc_rxlink; /* link ptr in last RX desc */ struct task sc_rxtask; /* rx int processing */ - struct task sc_txstarttask; /* ath_start() processing */ u_int8_t sc_defant; /* current default antenna */ u_int8_t sc_rxotherant; /* rx's on non-default antenna*/ u_int64_t sc_lastrx; /* tsf at last rx'd frame */ From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 06:41:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 61E63106566B; Tue, 5 Jun 2012 06:41:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B3A68FC08; Tue, 5 Jun 2012 06:41:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q556fmqn094001; Tue, 5 Jun 2012 06:41:48 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q556fmW9093998; Tue, 5 Jun 2012 06:41:48 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201206050641.q556fmW9093998@svn.freebsd.org> From: Dimitry Andric Date: Tue, 5 Jun 2012 06:41:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236600 - in stable/9/lib: libc++ libcxxrt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 06:41:48 -0000 Author: dim Date: Tue Jun 5 06:41:47 2012 New Revision: 236600 URL: http://svn.freebsd.org/changeset/base/236600 Log: MFC r236442: Tabify libcxxrt and libc++'s Makefiles. Modified: stable/9/lib/libc++/Makefile stable/9/lib/libcxxrt/Makefile Directory Properties: stable/9/lib/libc++/ (props changed) stable/9/lib/libcxxrt/ (props changed) Modified: stable/9/lib/libc++/Makefile ============================================================================== --- stable/9/lib/libc++/Makefile Tue Jun 5 06:03:55 2012 (r236599) +++ stable/9/lib/libc++/Makefile Tue Jun 5 06:41:47 2012 (r236600) @@ -1,156 +1,156 @@ # $FreeBSD$ -LIBCXXRTDIR= ${.CURDIR}/../../contrib/libcxxrt -HDRDIR= ${.CURDIR}/../../contrib/libc++/include -SRCDIR= ${.CURDIR}/../../contrib/libc++/src -CXXINCLUDEDIR= ${INCLUDEDIR}/c++/v${SHLIB_MAJOR} +LIBCXXRTDIR= ${.CURDIR}/../../contrib/libcxxrt +HDRDIR= ${.CURDIR}/../../contrib/libc++/include +SRCDIR= ${.CURDIR}/../../contrib/libc++/src +CXXINCLUDEDIR= ${INCLUDEDIR}/c++/v${SHLIB_MAJOR} .PATH: ${SRCDIR} -LIB= c++ -SHLIB_MAJOR= 1 +LIB= c++ +SHLIB_MAJOR= 1 -SRCS+= algorithm.cpp\ - bind.cpp\ - chrono.cpp\ - condition_variable.cpp\ - debug.cpp\ - exception.cpp\ - future.cpp\ - hash.cpp\ - ios.cpp\ - iostream.cpp\ - locale.cpp\ - memory.cpp\ - mutex.cpp\ - new.cpp\ - random.cpp\ - regex.cpp\ - stdexcept.cpp\ - string.cpp\ - strstream.cpp\ - system_error.cpp\ - thread.cpp\ - typeinfo.cpp\ - utility.cpp\ - valarray.cpp - -WARNS= 0 -CXXFLAGS+= -I${HDRDIR} -I${LIBCXXRTDIR} -std=c++0x -nostdlib -DLIBCXXRT - -DPADD= ${LIBCXXRT} -LDADD= -lcxxrt -LDFLAGS+= --verbose -INCSGROUPS= STD EXT - -STD_HEADERS= __bit_reference\ - __config\ - __debug\ - __functional_03\ - __functional_base\ - __functional_base_03\ - __hash_table\ - __locale\ - __mutex_base\ - __split_buffer\ - __sso_allocator\ - __std_stream\ - __tree\ - __tuple\ - __tuple_03\ - __undef_min_max\ - algorithm\ - array\ - atomic\ - bitset\ - cassert\ - ccomplex\ - cctype\ - cerrno\ - cfenv\ - cfloat\ - chrono\ - cinttypes\ - ciso646\ - climits\ - clocale\ - cmath\ - codecvt\ - complex\ - complex.h\ - condition_variable\ - csetjmp\ - csignal\ - cstdarg\ - cstdbool\ - cstddef\ - cstdint\ - cstdio\ - cstdlib\ - cstring\ - ctgmath\ - ctime\ - cwchar\ - cwctype\ - deque\ - exception\ - forward_list\ - fstream\ - functional\ - future\ - initializer_list\ - iomanip\ - ios\ - iosfwd\ - iostream\ - istream\ - iterator\ - limits\ - list\ - locale\ - map\ - memory\ - mutex\ - new\ - numeric\ - ostream\ - queue\ - random\ - ratio\ - regex\ - scoped_allocator\ - set\ - sstream\ - stack\ - stdexcept\ - streambuf\ - string\ - strstream\ - system_error\ - tgmath.h\ - thread\ - tuple\ - type_traits\ - typeindex\ - typeinfo\ - unordered_map\ - unordered_set\ - utility\ - valarray\ - vector +SRCS+= algorithm.cpp\ + bind.cpp\ + chrono.cpp\ + condition_variable.cpp\ + debug.cpp\ + exception.cpp\ + future.cpp\ + hash.cpp\ + ios.cpp\ + iostream.cpp\ + locale.cpp\ + memory.cpp\ + mutex.cpp\ + new.cpp\ + random.cpp\ + regex.cpp\ + stdexcept.cpp\ + string.cpp\ + strstream.cpp\ + system_error.cpp\ + thread.cpp\ + typeinfo.cpp\ + utility.cpp\ + valarray.cpp + +WARNS= 0 +CXXFLAGS+= -I${HDRDIR} -I${LIBCXXRTDIR} -std=c++0x -nostdlib -DLIBCXXRT + +DPADD= ${LIBCXXRT} +LDADD= -lcxxrt +LDFLAGS+= --verbose +INCSGROUPS= STD EXT + +STD_HEADERS= __bit_reference\ + __config\ + __debug\ + __functional_03\ + __functional_base\ + __functional_base_03\ + __hash_table\ + __locale\ + __mutex_base\ + __split_buffer\ + __sso_allocator\ + __std_stream\ + __tree\ + __tuple\ + __tuple_03\ + __undef_min_max\ + algorithm\ + array\ + atomic\ + bitset\ + cassert\ + ccomplex\ + cctype\ + cerrno\ + cfenv\ + cfloat\ + chrono\ + cinttypes\ + ciso646\ + climits\ + clocale\ + cmath\ + codecvt\ + complex\ + complex.h\ + condition_variable\ + csetjmp\ + csignal\ + cstdarg\ + cstdbool\ + cstddef\ + cstdint\ + cstdio\ + cstdlib\ + cstring\ + ctgmath\ + ctime\ + cwchar\ + cwctype\ + deque\ + exception\ + forward_list\ + fstream\ + functional\ + future\ + initializer_list\ + iomanip\ + ios\ + iosfwd\ + iostream\ + istream\ + iterator\ + limits\ + list\ + locale\ + map\ + memory\ + mutex\ + new\ + numeric\ + ostream\ + queue\ + random\ + ratio\ + regex\ + scoped_allocator\ + set\ + sstream\ + stack\ + stdexcept\ + streambuf\ + string\ + strstream\ + system_error\ + tgmath.h\ + thread\ + tuple\ + type_traits\ + typeindex\ + typeinfo\ + unordered_map\ + unordered_set\ + utility\ + valarray\ + vector .for hdr in ${STD_HEADERS} -STD+= ${HDRDIR}/${hdr} +STD+= ${HDRDIR}/${hdr} .endfor -STDDIR= ${CXXINCLUDEDIR} +STDDIR= ${CXXINCLUDEDIR} -EXT_HEADERS= __hash\ - hash_map\ - hash_set +EXT_HEADERS= __hash\ + hash_map\ + hash_set .for hdr in ${EXT_HEADERS} -EXT+= ${HDRDIR}/ext/${hdr} +EXT+= ${HDRDIR}/ext/${hdr} .endfor -EXTDIR= ${CXXINCLUDEDIR}/ext +EXTDIR= ${CXXINCLUDEDIR}/ext .include Modified: stable/9/lib/libcxxrt/Makefile ============================================================================== --- stable/9/lib/libcxxrt/Makefile Tue Jun 5 06:03:55 2012 (r236599) +++ stable/9/lib/libcxxrt/Makefile Tue Jun 5 06:41:47 2012 (r236600) @@ -1,26 +1,26 @@ # $FreeBSD$ -SRCDIR= ${.CURDIR}/../../contrib/libcxxrt +SRCDIR= ${.CURDIR}/../../contrib/libcxxrt -SHLIB_MAJOR= 1 -SHLIBDIR?= /lib +SHLIB_MAJOR= 1 +SHLIBDIR?= /lib .PATH: ${SRCDIR} -LIB= cxxrt +LIB= cxxrt -SRCS+= libelftc_dem_gnu3.c\ - terminate.cc\ - dynamic_cast.cc\ - memory.cc\ - auxhelper.cc\ - exception.cc\ - stdexcept.cc\ - typeinfo.cc\ - guard.cc - -WARNS= 0 -CFLAGS+= -I${SRCDIR} -VERSION_MAP= ${.CURDIR}/Version.map +SRCS+= libelftc_dem_gnu3.c\ + terminate.cc\ + dynamic_cast.cc\ + memory.cc\ + auxhelper.cc\ + exception.cc\ + stdexcept.cc\ + typeinfo.cc\ + guard.cc + +WARNS= 0 +CFLAGS+= -I${SRCDIR} +VERSION_MAP= ${.CURDIR}/Version.map .include From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 06:43:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B2FCC106566C; Tue, 5 Jun 2012 06:43:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CF2C8FC15; Tue, 5 Jun 2012 06:43:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q556hjGc094146; Tue, 5 Jun 2012 06:43:45 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q556hj2l094144; Tue, 5 Jun 2012 06:43:45 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201206050643.q556hj2l094144@svn.freebsd.org> From: Dimitry Andric Date: Tue, 5 Jun 2012 06:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236601 - stable/9/lib/libc++ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 06:43:45 -0000 Author: dim Date: Tue Jun 5 06:43:45 2012 New Revision: 236601 URL: http://svn.freebsd.org/changeset/base/236601 Log: MFC r236444: Install libcxxrt's C++ ABI and unwind headers. This is done in libc++'s Makefile, so these headers go into the same destination directory as libc++'s own headers, currently /usr/include/c++/v1. Modified: stable/9/lib/libc++/Makefile Directory Properties: stable/9/lib/libc++/ (props changed) Modified: stable/9/lib/libc++/Makefile ============================================================================== --- stable/9/lib/libc++/Makefile Tue Jun 5 06:41:47 2012 (r236600) +++ stable/9/lib/libc++/Makefile Tue Jun 5 06:43:45 2012 (r236601) @@ -138,10 +138,17 @@ STD_HEADERS= __bit_reference\ utility\ valarray\ vector +RT_HEADERS= cxxabi.h\ + unwind.h\ + unwind-arm.h\ + unwind-itanium.h .for hdr in ${STD_HEADERS} STD+= ${HDRDIR}/${hdr} .endfor +.for hdr in ${RT_HEADERS} +STD+= ${LIBCXXRTDIR}/${hdr} +.endfor STDDIR= ${CXXINCLUDEDIR} EXT_HEADERS= __hash\ From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 07:49:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2371D1065675; Tue, 5 Jun 2012 07:49:34 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id C2FCB8FC12; Tue, 5 Jun 2012 07:49:33 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 27352FE1; Tue, 5 Jun 2012 09:49:32 +0200 (CEST) Date: Tue, 5 Jun 2012 09:47:42 +0200 From: Pawel Jakub Dawidek To: "Andrey A. Chernov" Message-ID: <20120605074741.GA1391@garage.freebsd.pl> References: <201206042134.q54LYoVJ067685@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5mCyUwZo2JvN/JJP" Content-Disposition: inline In-Reply-To: <201206042134.q54LYoVJ067685@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, freebsd-arch@FreeBSD.org Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 07:49:34 -0000 --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 04, 2012 at 09:34:49PM +0000, Andrey A. Chernov wrote: > Author: ache > Date: Mon Jun 4 21:34:49 2012 > New Revision: 236582 > URL: http://svn.freebsd.org/changeset/base/236582 >=20 > Log: > 1) IEEE Std 1003.1-2008, "errno" section, is explicit that > =20 > "The setting of errno after a successful call to a function is > unspecified unless the description of that function specifies that > errno shall not be modified." Very interesting. However free(3) is always successful. Maybe we need more context here, but the sentence above might talk about functions that can either succeed or fail and such functions do set errno on failure, but we don't know what they do to errno on success - they sometimes interact with the errno, free(3) never does. I aware that my interpretation might be too wishful, but it is pretty obvious to save errno value when calling a function that can eventually fail - when we save the errno we don't know if it will fail or not, so we have to do that, but requiring to save errno when calling a void function that can't fail is simply silly and complicates the code without a reason. > However, free() in IEEE Std 1003.1-2008 does not mention its interaction > with errno, so MAY modify it after successful call > (it depends on particular free() implementation, OS-specific, etc.). Expecting documentation to describe interaction with some global variable that it doesn't need is pretty silly too (ok, errno is special, but still). It make sense to describe all the cases when the function actually is sometimes using the global variable, but for a function that never fails and should never touch the global it doesn't make sense. Maybe that's why it doesn't mention interaction with errno? I agree that the standards aren't clear, but if saving errno around free(3) is the way to go, then I'm sure we have much more problems in our code, even if it is not suppose to be portable it should be correct - we never know who and when will take the code and port it. I guess what I'm trying to say here is that this is much bigger change than it looks and we should probably agree on some global rule here. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --5mCyUwZo2JvN/JJP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/NuZ0ACgkQForvXbEpPzSfyACeK8eSY42ZOt2Sl1X4SOxGXsdC WvIAoOFeogjkUqP7aMxtyL4lqO4yUNyp =sCiA -----END PGP SIGNATURE----- --5mCyUwZo2JvN/JJP-- From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 08:08:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DAB3C1065678; Tue, 5 Jun 2012 08:08:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 90D828FC12; Tue, 5 Jun 2012 08:08:15 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:6c87:8d41:d769:c2e6] (unknown [IPv6:2001:7b8:3a7:0:6c87:8d41:d769:c2e6]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 4958C5C37; Tue, 5 Jun 2012 10:08:09 +0200 (CEST) Message-ID: <4FCDBE69.6080906@FreeBSD.org> Date: Tue, 05 Jun 2012 10:08:09 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120529 Thunderbird/13.0 MIME-Version: 1.0 To: "Andrey A. Chernov" References: <201206042134.q54LYoVJ067685@svn.freebsd.org> In-Reply-To: <201206042134.q54LYoVJ067685@svn.freebsd.org> X-Enigmail-Version: 1.5a1pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 08:08:16 -0000 On 2012-06-04 23:34, Andrey A. Chernov wrote:> Author: ache > Date: Mon Jun 4 21:34:49 2012 > New Revision: 236582 > URL: http://svn.freebsd.org/changeset/base/236582 > > Log: > 1) IEEE Std 1003.1-2008, "errno" section, is explicit that > > "The setting of errno after a successful call to a function is > unspecified unless the description of that function specifies that > errno shall not be modified." > > However, free() in IEEE Std 1003.1-2008 does not mention its interaction > with errno, so MAY modify it after successful call > (it depends on particular free() implementation, OS-specific, etc.). Actually, it says the following: RETURN VALUE The free() function shall not return a value. ERRORS No errors are defined. How much clearer do you want it? ;) From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 08:35:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01D7D1065670; Tue, 5 Jun 2012 08:35:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 6FA0C8FC19; Tue, 5 Jun 2012 08:35:58 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q558ZsRF013288; Tue, 5 Jun 2012 11:35:54 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q558ZrKU097778; Tue, 5 Jun 2012 11:35:53 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q558ZrHU097777; Tue, 5 Jun 2012 11:35:53 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 5 Jun 2012 11:35:53 +0300 From: Konstantin Belousov To: Dimitry Andric Message-ID: <20120605083553.GH85127@deviant.kiev.zoral.com.ua> References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <4FCDBE69.6080906@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="a8sldprk+5E/pDEv" Content-Disposition: inline In-Reply-To: <4FCDBE69.6080906@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "Andrey A. Chernov" Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 08:35:59 -0000 --a8sldprk+5E/pDEv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 05, 2012 at 10:08:09AM +0200, Dimitry Andric wrote: > On 2012-06-04 23:34, Andrey A. Chernov wrote:> Author: ache > > Date: Mon Jun 4 21:34:49 2012 > > New Revision: 236582 > > URL: http://svn.freebsd.org/changeset/base/236582 > >=20 > > Log: > > 1) IEEE Std 1003.1-2008, "errno" section, is explicit that > > =20 > > "The setting of errno after a successful call to a function is > > unspecified unless the description of that function specifies that > > errno shall not be modified." > > =20 > > However, free() in IEEE Std 1003.1-2008 does not mention its interact= ion > > with errno, so MAY modify it after successful call > > (it depends on particular free() implementation, OS-specific, etc.). >=20 > Actually, it says the following: >=20 > RETURN VALUE >=20 > The free() function shall not return a value. >=20 > ERRORS >=20 > No errors are defined. >=20 > How much clearer do you want it? ;) Not to mention that the patch was committed to _our_ implementation of libc, which uses _our_ free, and not some abstract free(3). Our free changi= ng errno means that process state is so messed that worrying about realpath(3) correctness is beyond any expectations. I already described my POV to ache, but it seems that nobody listens. It ju= st a season, it seems. --a8sldprk+5E/pDEv Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/NxOkACgkQC3+MBN1Mb4jWWQCfVddHYIiiIzDUp3qFjDfGqK77 5YUAn2E/APiLIwdFS3T4xB1Kka6goVaW =IzOm -----END PGP SIGNATURE----- --a8sldprk+5E/pDEv-- From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 09:45:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4698B1065670; Tue, 5 Jun 2012 09:45:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30BAA8FC1C; Tue, 5 Jun 2012 09:45:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q559jhIf002588; Tue, 5 Jun 2012 09:45:43 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q559jgKT002582; Tue, 5 Jun 2012 09:45:42 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206050945.q559jgKT002582@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jun 2012 09:45:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236602 - in head/sys/cam: ata scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 09:45:43 -0000 Author: mav Date: Tue Jun 5 09:45:42 2012 New Revision: 236602 URL: http://svn.freebsd.org/changeset/base/236602 Log: Tune and add some missing CAM_DEBUG() points for better consistency. Modified: head/sys/cam/ata/ata_da.c head/sys/cam/ata/ata_pmp.c head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_pt.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Tue Jun 5 06:43:45 2012 (r236601) +++ head/sys/cam/ata/ata_da.c Tue Jun 5 09:45:42 2012 (r236602) @@ -436,9 +436,8 @@ adaopen(struct disk *dp) softc = (struct ada_softc *)periph->softc; softc->flags |= ADA_FLAG_OPEN; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, - ("adaopen: disk=%s%d (unit %d)\n", dp->d_name, dp->d_unit, - periph->unit_number)); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("adaopen\n")); if ((softc->flags & ADA_FLAG_PACK_INVALID) != 0) { /* Invalidate our pack information. */ @@ -469,6 +468,10 @@ adaclose(struct disk *dp) } softc = (struct ada_softc *)periph->softc; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("adaclose\n")); + /* We only sync the cache if the drive is capable of it. */ if ((softc->flags & ADA_FLAG_CAN_FLUSHCACHE) != 0 && (softc->flags & ADA_FLAG_PACK_INVALID) == 0) { @@ -542,6 +545,8 @@ adastrategy(struct bio *bp) cam_periph_lock(periph); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("adastrategy(%p)\n", bp)); + /* * If the device has been made invalid, error out */ @@ -1167,6 +1172,8 @@ adastart(struct cam_periph *periph, unio struct ada_softc *softc = (struct ada_softc *)periph->softc; struct ccb_ataio *ataio = &start_ccb->ataio; + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("adastart\n")); + switch (softc->state) { case ADA_STATE_NORMAL: { @@ -1175,7 +1182,7 @@ adastart(struct cam_periph *periph, unio /* Execute immediate CCB if waiting. */ if (periph->immediate_priority <= periph->pinfo.priority) { - CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("queuing for immediate ccb\n")); start_ccb->ccb_h.ccb_state = ADA_CCB_WAITING; SLIST_INSERT_HEAD(&periph->ccb_list, &start_ccb->ccb_h, @@ -1467,6 +1474,9 @@ adadone(struct cam_periph *periph, union softc = (struct ada_softc *)periph->softc; ataio = &done_ccb->ataio; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("adadone\n")); + switch (ataio->ccb_h.ccb_state & ADA_CCB_TYPE_MASK) { case ADA_CCB_BUFFER_IO: case ADA_CCB_TRIM: Modified: head/sys/cam/ata/ata_pmp.c ============================================================================== --- head/sys/cam/ata/ata_pmp.c Tue Jun 5 06:43:45 2012 (r236601) +++ head/sys/cam/ata/ata_pmp.c Tue Jun 5 09:45:42 2012 (r236602) @@ -429,7 +429,9 @@ pmpstart(struct cam_periph *periph, unio softc = (struct pmp_softc *)periph->softc; ataio = &start_ccb->ataio; - + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("pmpstart\n")); + if (softc->restart) { softc->restart = 0; softc->state = min(softc->state, PMP_STATE_PRECONFIG); @@ -560,7 +562,7 @@ pmpdone(struct cam_periph *periph, union softc = (struct pmp_softc *)periph->softc; ataio = &done_ccb->ataio; - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("pmpdone\n")); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("pmpdone\n")); priority = done_ccb->ccb_h.pinfo.priority; Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Tue Jun 5 06:43:45 2012 (r236601) +++ head/sys/cam/scsi/scsi_cd.c Tue Jun 5 09:45:42 2012 (r236602) @@ -1014,6 +1014,9 @@ cdopen(struct disk *dp) return (error); } + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("cdopen\n")); + /* * Check for media, and set the appropriate flags. We don't bail * if we don't have media, but then we don't allow anything but the @@ -1051,6 +1054,9 @@ cdclose(struct disk *dp) cam_periph_lock(periph); cam_periph_hold(periph, PRIBIO); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("cdclose\n")); + if ((softc->flags & CD_FLAG_DISC_REMOVABLE) != 0) cdprevent(periph, PR_ALLOW); @@ -1395,7 +1401,8 @@ cdstrategy(struct bio *bp) } cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdstrategy\n")); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, + ("cdstrategy(%p)\n", bp)); softc = (struct cd_softc *)periph->softc; @@ -1861,12 +1868,11 @@ cdioctl(struct disk *dp, u_long cmd, voi return(ENXIO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdioctl\n")); softc = (struct cd_softc *)periph->softc; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, - ("trying to do ioctl %#lx\n", cmd)); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, + ("cdioctl(%#lx)\n", cmd)); if ((error = cam_periph_hold(periph, PRIBIO | PCATCH)) != 0) { cam_periph_unlock(periph); Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Jun 5 06:43:45 2012 (r236601) +++ head/sys/cam/scsi/scsi_da.c Tue Jun 5 09:45:42 2012 (r236602) @@ -942,9 +942,8 @@ daopen(struct disk *dp) softc = (struct da_softc *)periph->softc; softc->flags |= DA_FLAG_OPEN; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, - ("daopen: disk=%s%d (unit %d)\n", dp->d_name, dp->d_unit, - unit)); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("daopen\n")); if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) { /* Invalidate our pack information. */ @@ -999,6 +998,9 @@ daclose(struct disk *dp) softc = (struct da_softc *)periph->softc; + 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) { union ccb *ccb; @@ -1108,7 +1110,9 @@ dastrategy(struct bio *bp) biofinish(bp, NULL, ENXIO); return; } - + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dastrategy(%p)\n", bp)); + /* * Place it in the queue of disk activities for this disk */ @@ -1724,6 +1728,8 @@ dastart(struct cam_periph *periph, union softc = (struct da_softc *)periph->softc; + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dastart\n")); + switch (softc->state) { case DA_STATE_NORMAL: { @@ -1732,7 +1738,7 @@ dastart(struct cam_periph *periph, union /* Execute immediate CCB if waiting. */ if (periph->immediate_priority <= periph->pinfo.priority) { - CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("queuing for immediate ccb\n")); start_ccb->ccb_h.ccb_state = DA_CCB_WAITING; SLIST_INSERT_HEAD(&periph->ccb_list, &start_ccb->ccb_h, @@ -2064,6 +2070,9 @@ dadone(struct cam_periph *periph, union softc = (struct da_softc *)periph->softc; priority = done_ccb->ccb_h.pinfo.priority; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dadone\n")); + csio = &done_ccb->csio; switch (csio->ccb_h.ccb_state & DA_CCB_TYPE_MASK) { case DA_CCB_BUFFER_IO: Modified: head/sys/cam/scsi/scsi_pt.c ============================================================================== --- head/sys/cam/scsi/scsi_pt.c Tue Jun 5 06:43:45 2012 (r236601) +++ head/sys/cam/scsi/scsi_pt.c Tue Jun 5 09:45:42 2012 (r236602) @@ -425,12 +425,14 @@ ptstart(struct cam_periph *periph, union softc = (struct pt_softc *)periph->softc; + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("ptstart\n")); + /* * See if there is a buf with work for us to do.. */ bp = bioq_first(&softc->bio_queue); if (periph->immediate_priority <= periph->pinfo.priority) { - CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("queuing for immediate ccb\n")); start_ccb->ccb_h.ccb_state = PT_CCB_WAITING; SLIST_INSERT_HEAD(&periph->ccb_list, &start_ccb->ccb_h, @@ -483,6 +485,9 @@ ptdone(struct cam_periph *periph, union struct ccb_scsiio *csio; softc = (struct pt_softc *)periph->softc; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("ptdone\n")); + csio = &done_ccb->csio; switch (csio->ccb_h.ccb_state) { case PT_CCB_BUFFER_IO: From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 10:08:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 15A671065675; Tue, 5 Jun 2012 10:08:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01A188FC1A; Tue, 5 Jun 2012 10:08:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55A8MDg003694; Tue, 5 Jun 2012 10:08:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55A8MIR003692; Tue, 5 Jun 2012 10:08:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206051008.q55A8MIR003692@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jun 2012 10:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236604 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 10:08:23 -0000 Author: mav Date: Tue Jun 5 10:08:22 2012 New Revision: 236604 URL: http://svn.freebsd.org/changeset/base/236604 Log: Do not reinvent a wheel and let default error handler do its job. Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Jun 5 09:49:31 2012 (r236603) +++ head/sys/cam/scsi/scsi_da.c Tue Jun 5 10:08:22 2012 (r236604) @@ -1016,30 +1016,9 @@ daclose(struct disk *dp) SSD_FULL_SIZE, 5 * 60 * 1000); - cam_periph_runccb(ccb, /*error_routine*/NULL, /*cam_flags*/0, - /*sense_flags*/SF_RETRY_UA, + cam_periph_runccb(ccb, daerror, /*cam_flags*/0, + /*sense_flags*/SF_RETRY_UA | SF_QUIET_IR, softc->disk->d_devstat); - - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - if ((ccb->ccb_h.status & CAM_STATUS_MASK) == - CAM_SCSI_STATUS_ERROR) { - int asc, ascq; - int sense_key, error_code; - - scsi_extract_sense_len(&ccb->csio.sense_data, - ccb->csio.sense_len - ccb->csio.sense_resid, - &error_code, &sense_key, &asc, &ascq, - /*show_errors*/ 1); - if (sense_key != SSD_KEY_ILLEGAL_REQUEST) - scsi_sense_print(&ccb->csio); - } else { - xpt_print(periph->path, "Synchronize cache " - "failed, status == 0x%x, scsi status == " - "0x%x\n", ccb->csio.ccb_h.status, - ccb->csio.scsi_status); - } - } - xpt_release_ccb(ccb); } @@ -2541,8 +2520,8 @@ daprevent(struct cam_periph *periph, int SSD_FULL_SIZE, 5000); - error = cam_periph_runccb(ccb, /*error_routine*/NULL, CAM_RETRY_SELTO, - SF_RETRY_UA, softc->disk->d_devstat); + error = cam_periph_runccb(ccb, daerror, CAM_RETRY_SELTO, + SF_RETRY_UA | SF_QUIET_IR, softc->disk->d_devstat); if (error == 0) { if (action == PR_ALLOW) From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 10:23:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B3751065675; Tue, 5 Jun 2012 10:23:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1677B8FC0C; Tue, 5 Jun 2012 10:23:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55ANfMH004434; Tue, 5 Jun 2012 10:23:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55ANfud004431; Tue, 5 Jun 2012 10:23:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206051023.q55ANfud004431@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jun 2012 10:23:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236605 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 10:23:42 -0000 Author: mav Date: Tue Jun 5 10:23:41 2012 New Revision: 236605 URL: http://svn.freebsd.org/changeset/base/236605 Log: Replace #ifdef CAMDEBUG + if + panic() with single KASSERT(). Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Tue Jun 5 10:08:22 2012 (r236604) +++ head/sys/cam/cam_xpt.c Tue Jun 5 10:23:41 2012 (r236605) @@ -3226,13 +3226,8 @@ xpt_run_dev_allocq(struct cam_eb *bus) ("running device %p\n", device)); drvq = &device->drvq; - -#ifdef CAMDEBUG - if (drvq->entries <= 0) { - panic("xpt_run_dev_allocq: " - "Device on queue without any work to do"); - } -#endif + KASSERT(drvq->entries > 0, ("xpt_run_dev_allocq: " + "Device on queue without any work to do")); if ((work_ccb = xpt_get_ccb(device)) != NULL) { devq->alloc_openings--; devq->alloc_active++; From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 11:23:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07A11106564A; Tue, 5 Jun 2012 11:23:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5E208FC08; Tue, 5 Jun 2012 11:23:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55BNu55016263; Tue, 5 Jun 2012 11:23:56 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55BNuac016261; Tue, 5 Jun 2012 11:23:56 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201206051123.q55BNuac016261@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 5 Jun 2012 11:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236606 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 11:23:57 -0000 Author: bz Date: Tue Jun 5 11:23:56 2012 New Revision: 236606 URL: http://svn.freebsd.org/changeset/base/236606 Log: MFC r236327 (by emax): When we return deprecated addresses, we need to reference them. Modified: stable/9/sys/netinet6/in6.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/in6.c ============================================================================== --- stable/9/sys/netinet6/in6.c Tue Jun 5 10:23:41 2012 (r236605) +++ stable/9/sys/netinet6/in6.c Tue Jun 5 11:23:56 2012 (r236606) @@ -2236,14 +2236,20 @@ in6_ifawithifp(struct ifnet *ifp, struct IF_ADDR_RUNLOCK(ifp); return (struct in6_ifaddr *)ifa; } - IF_ADDR_RUNLOCK(ifp); /* use the last-resort values, that are, deprecated addresses */ - if (dep[0]) + if (dep[0]) { + ifa_ref((struct ifaddr *)dep[0]); + IF_ADDR_RUNLOCK(ifp); return dep[0]; - if (dep[1]) + } + if (dep[1]) { + ifa_ref((struct ifaddr *)dep[1]); + IF_ADDR_RUNLOCK(ifp); return dep[1]; + } + IF_ADDR_RUNLOCK(ifp); return NULL; } From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 11:24:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 548EB1065670; Tue, 5 Jun 2012 11:24:06 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EFA78FC12; Tue, 5 Jun 2012 11:24:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55BO6W3016311; Tue, 5 Jun 2012 11:24:06 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55BO62d016309; Tue, 5 Jun 2012 11:24:06 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201206051124.q55BO62d016309@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 5 Jun 2012 11:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236607 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 11:24:06 -0000 Author: bz Date: Tue Jun 5 11:24:05 2012 New Revision: 236607 URL: http://svn.freebsd.org/changeset/base/236607 Log: MFC r236327 (by emax): When we return deprecated addresses, we need to reference them. Modified: stable/8/sys/netinet6/in6.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/in6.c ============================================================================== --- stable/8/sys/netinet6/in6.c Tue Jun 5 11:23:56 2012 (r236606) +++ stable/8/sys/netinet6/in6.c Tue Jun 5 11:24:05 2012 (r236607) @@ -2151,14 +2151,20 @@ in6_ifawithifp(struct ifnet *ifp, struct IF_ADDR_RUNLOCK(ifp); return (struct in6_ifaddr *)ifa; } - IF_ADDR_RUNLOCK(ifp); /* use the last-resort values, that are, deprecated addresses */ - if (dep[0]) + if (dep[0]) { + ifa_ref((struct ifaddr *)dep[0]); + IF_ADDR_RUNLOCK(ifp); return dep[0]; - if (dep[1]) + } + if (dep[1]) { + ifa_ref((struct ifaddr *)dep[1]); + IF_ADDR_RUNLOCK(ifp); return dep[1]; + } + IF_ADDR_RUNLOCK(ifp); return NULL; } From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 11:26:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA616106566C; Tue, 5 Jun 2012 11:26:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 946178FC14; Tue, 5 Jun 2012 11:26:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55BQiER016498; Tue, 5 Jun 2012 11:26:44 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55BQiqk016496; Tue, 5 Jun 2012 11:26:44 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201206051126.q55BQiqk016496@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 5 Jun 2012 11:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236608 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 11:26:44 -0000 Author: bz Date: Tue Jun 5 11:26:43 2012 New Revision: 236608 URL: http://svn.freebsd.org/changeset/base/236608 Log: MFC r236501 (by emax): Plug reference leak. Interface addresses are refcounted as packets move through the stack, and there's garbage collection tied to it so that address changes can safely propagate while traffic is flowing. In our setup, we weren't changing or deleting any addresses, but the refcounting logic in ip6_input() was wrong and caused a reference leak on every inbound V6 packet. This eventually caused a 32bit overflow, and the resulting 0 value caused the garbage collection to run on the active address. That then snowballed into the panic. Modified: stable/9/sys/netinet6/ip6_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/ip6_input.c ============================================================================== --- stable/9/sys/netinet6/ip6_input.c Tue Jun 5 11:24:05 2012 (r236607) +++ stable/9/sys/netinet6/ip6_input.c Tue Jun 5 11:26:43 2012 (r236608) @@ -797,19 +797,23 @@ passin: * as our interface address (e.g. multicast addresses, addresses * within FAITH prefixes and such). */ - if (deliverifp && !ip6_getdstifaddr(m)) { + if (deliverifp) { struct in6_ifaddr *ia6; - ia6 = in6_ifawithifp(deliverifp, &ip6->ip6_dst); - if (ia6) { - if (!ip6_setdstifaddr(m, ia6)) { - /* - * XXX maybe we should drop the packet here, - * as we could not provide enough information - * to the upper layers. - */ - } + if ((ia6 = ip6_getdstifaddr(m)) != NULL) { ifa_free(&ia6->ia_ifa); + } else { + ia6 = in6_ifawithifp(deliverifp, &ip6->ip6_dst); + if (ia6) { + if (!ip6_setdstifaddr(m, ia6)) { + /* + * XXX maybe we should drop the packet here, + * as we could not provide enough information + * to the upper layers. + */ + } + ifa_free(&ia6->ia_ifa); + } } } From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 11:27:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BECBF106566B; Tue, 5 Jun 2012 11:27:11 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9CE88FC0C; Tue, 5 Jun 2012 11:27:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55BRBiI016561; Tue, 5 Jun 2012 11:27:11 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55BRBtZ016559; Tue, 5 Jun 2012 11:27:11 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201206051127.q55BRBtZ016559@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 5 Jun 2012 11:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236609 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 11:27:11 -0000 Author: bz Date: Tue Jun 5 11:27:11 2012 New Revision: 236609 URL: http://svn.freebsd.org/changeset/base/236609 Log: MFC r236501 (by emax): Plug reference leak. Interface addresses are refcounted as packets move through the stack, and there's garbage collection tied to it so that address changes can safely propagate while traffic is flowing. In our setup, we weren't changing or deleting any addresses, but the refcounting logic in ip6_input() was wrong and caused a reference leak on every inbound V6 packet. This eventually caused a 32bit overflow, and the resulting 0 value caused the garbage collection to run on the active address. That then snowballed into the panic. Modified: stable/8/sys/netinet6/ip6_input.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/ip6_input.c ============================================================================== --- stable/8/sys/netinet6/ip6_input.c Tue Jun 5 11:26:43 2012 (r236608) +++ stable/8/sys/netinet6/ip6_input.c Tue Jun 5 11:27:11 2012 (r236609) @@ -734,19 +734,23 @@ passin: * as our interface address (e.g. multicast addresses, addresses * within FAITH prefixes and such). */ - if (deliverifp && !ip6_getdstifaddr(m)) { + if (deliverifp) { struct in6_ifaddr *ia6; - ia6 = in6_ifawithifp(deliverifp, &ip6->ip6_dst); - if (ia6) { - if (!ip6_setdstifaddr(m, ia6)) { - /* - * XXX maybe we should drop the packet here, - * as we could not provide enough information - * to the upper layers. - */ - } + if ((ia6 = ip6_getdstifaddr(m)) != NULL) { ifa_free(&ia6->ia_ifa); + } else { + ia6 = in6_ifawithifp(deliverifp, &ip6->ip6_dst); + if (ia6) { + if (!ip6_setdstifaddr(m, ia6)) { + /* + * XXX maybe we should drop the packet here, + * as we could not provide enough information + * to the upper layers. + */ + } + ifa_free(&ia6->ia_ifa); + } } } From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 11:28:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E3EFE1065672; Tue, 5 Jun 2012 11:28:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDDAE8FC15; Tue, 5 Jun 2012 11:28:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55BSv9K016698; Tue, 5 Jun 2012 11:28:57 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55BSvld016696; Tue, 5 Jun 2012 11:28:57 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201206051128.q55BSvld016696@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 5 Jun 2012 11:28:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236610 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 11:28:58 -0000 Author: bz Date: Tue Jun 5 11:28:57 2012 New Revision: 236610 URL: http://svn.freebsd.org/changeset/base/236610 Log: MFC r236575 (by emax): Plug more refcount leaks and possible NULL deref for interface address list. Modified: stable/9/sys/netinet/tcp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Tue Jun 5 11:27:11 2012 (r236609) +++ stable/9/sys/netinet/tcp_input.c Tue Jun 5 11:28:57 2012 (r236610) @@ -543,6 +543,8 @@ tcp6_input(struct mbuf **mp, int *offp, (caddr_t)&ip6->ip6_dst - (caddr_t)ip6); return IPPROTO_DONE; } + if (ia6) + ifa_free(&ia6->ia_ifa); tcp_input(m, *offp); return IPPROTO_DONE; @@ -1253,7 +1255,8 @@ relocked: rstreason = BANDLIM_RST_OPENPORT; goto dropwithreset; } - ifa_free(&ia6->ia_ifa); + if (ia6) + ifa_free(&ia6->ia_ifa); } #endif /* INET6 */ /* From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 11:29:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E45E81065676; Tue, 5 Jun 2012 11:29:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF9368FC18; Tue, 5 Jun 2012 11:29:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55BT0ct016737; Tue, 5 Jun 2012 11:29:00 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55BT0vT016734; Tue, 5 Jun 2012 11:29:00 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201206051129.q55BT0vT016734@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 5 Jun 2012 11:29:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236611 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 11:29:01 -0000 Author: bz Date: Tue Jun 5 11:29:00 2012 New Revision: 236611 URL: http://svn.freebsd.org/changeset/base/236611 Log: MFC r236575 (by emax): Plug more refcount leaks and possible NULL deref for interface address list. Modified: stable/8/sys/netinet/tcp_input.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/tcp_input.c ============================================================================== --- stable/8/sys/netinet/tcp_input.c Tue Jun 5 11:28:57 2012 (r236610) +++ stable/8/sys/netinet/tcp_input.c Tue Jun 5 11:29:00 2012 (r236611) @@ -538,6 +538,8 @@ tcp6_input(struct mbuf **mp, int *offp, (caddr_t)&ip6->ip6_dst - (caddr_t)ip6); return IPPROTO_DONE; } + if (ia6) + ifa_free(&ia6->ia_ifa); tcp_input(m, *offp); return IPPROTO_DONE; @@ -1206,7 +1208,8 @@ relocked: rstreason = BANDLIM_RST_OPENPORT; goto dropwithreset; } - ifa_free(&ia6->ia_ifa); + if (ia6) + ifa_free(&ia6->ia_ifa); } #endif /* From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 11:42:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7B1621065672; Tue, 5 Jun 2012 11:42:35 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 652088FC12; Tue, 5 Jun 2012 11:42:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55BgZEm017409; Tue, 5 Jun 2012 11:42:35 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55BgZWo017407; Tue, 5 Jun 2012 11:42:35 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201206051142.q55BgZWo017407@svn.freebsd.org> From: David Chisnall Date: Tue, 5 Jun 2012 11:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236612 - stable/9/lib/msun/src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 11:42:35 -0000 Author: theraven Date: Tue Jun 5 11:42:34 2012 New Revision: 236612 URL: http://svn.freebsd.org/changeset/base/236612 Log: Merge r236148. This allows C++ code to include after explicitly including math.h. Modified: stable/9/lib/msun/src/math.h Directory Properties: stable/9/lib/msun/ (props changed) Modified: stable/9/lib/msun/src/math.h ============================================================================== --- stable/9/lib/msun/src/math.h Tue Jun 5 11:29:00 2012 (r236611) +++ stable/9/lib/msun/src/math.h Tue Jun 5 11:42:34 2012 (r236612) @@ -398,35 +398,15 @@ float significandf(float); * long double versions of ISO/POSIX math functions */ #if __ISO_C_VISIBLE >= 1999 -#if _DECLARE_C99_LDBL_MATH -long double acoshl(long double); -#endif long double acosl(long double); -#if _DECLARE_C99_LDBL_MATH -long double asinhl(long double); -#endif long double asinl(long double); long double atan2l(long double, long double); -#if _DECLARE_C99_LDBL_MATH -long double atanhl(long double); -#endif long double atanl(long double); long double cbrtl(long double); long double ceill(long double); long double copysignl(long double, long double) __pure2; -#if _DECLARE_C99_LDBL_MATH -long double coshl(long double); -#endif long double cosl(long double); -#if _DECLARE_C99_LDBL_MATH -long double erfcl(long double); -long double erfl(long double); -#endif long double exp2l(long double); -#if _DECLARE_C99_LDBL_MATH -long double expl(long double); -long double expm1l(long double); -#endif long double fabsl(long double) __pure2; long double fdiml(long double, long double); long double floorl(long double); @@ -438,20 +418,9 @@ long double frexpl(long double value, in long double hypotl(long double, long double); int ilogbl(long double) __pure2; long double ldexpl(long double, int); -#if _DECLARE_C99_LDBL_MATH -long double lgammal(long double); -#endif long long llrintl(long double); long long llroundl(long double); -#if _DECLARE_C99_LDBL_MATH -long double log10l(long double); -long double log1pl(long double); -long double log2l(long double); -#endif long double logbl(long double); -#if _DECLARE_C99_LDBL_MATH -long double logl(long double); -#endif long lrintl(long double); long lroundl(long double); long double modfl(long double, long double *); /* fundamentally !__pure2 */ @@ -461,30 +430,54 @@ long double nextafterl(long double, long double nexttoward(double, long double); float nexttowardf(float, long double); long double nexttowardl(long double, long double); -#if _DECLARE_C99_LDBL_MATH -long double powl(long double, long double); -#endif long double remainderl(long double, long double); long double remquol(long double, long double, int *); long double rintl(long double); long double roundl(long double); long double scalblnl(long double, long); long double scalbnl(long double, int); -#if _DECLARE_C99_LDBL_MATH -long double sinhl(long double); -#endif long double sinl(long double); long double sqrtl(long double); -#if _DECLARE_C99_LDBL_MATH -long double tanhl(long double); -#endif long double tanl(long double); -#if _DECLARE_C99_LDBL_MATH -long double tgammal(long double); -#endif long double truncl(long double); #endif /* __ISO_C_VISIBLE >= 1999 */ __END_DECLS #endif /* !_MATH_H_ */ + +/* separate header for cmath */ +#ifndef _MATH_EXTRA_H_ +#if __ISO_C_VISIBLE >= 1999 +#if _DECLARE_C99_LDBL_MATH + +#define _MATH_EXTRA_H_ + +/* + * extra long double versions of math functions for C99 and cmath + */ +__BEGIN_DECLS + +long double acoshl(long double); +long double asinhl(long double); +long double atanhl(long double); +long double coshl(long double); +long double erfcl(long double); +long double erfl(long double); +long double expl(long double); +long double expm1l(long double); +long double lgammal(long double); +long double log10l(long double); +long double log1pl(long double); +long double log2l(long double); +long double logl(long double); +long double powl(long double, long double); +long double sinhl(long double); +long double tanhl(long double); +long double tgammal(long double); + +__END_DECLS + +#endif /* !_DECLARE_C99_LDBL_MATH */ +#endif /* __ISO_C_VISIBLE >= 1999 */ +#endif /* !_MATH_EXTRA_H_ */ From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 11:48:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 74E80106566B; Tue, 5 Jun 2012 11:48:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E2628FC08; Tue, 5 Jun 2012 11:48:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55BmXSr017728; Tue, 5 Jun 2012 11:48:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55BmXGJ017725; Tue, 5 Jun 2012 11:48:33 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206051148.q55BmXGJ017725@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jun 2012 11:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236613 - in head/sys/cam: ata scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 11:48:33 -0000 Author: mav Date: Tue Jun 5 11:48:32 2012 New Revision: 236613 URL: http://svn.freebsd.org/changeset/base/236613 Log: Tune and add some more CAM_DEBUG() points for the probe sequences. Modified: head/sys/cam/ata/ata_xpt.c head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Tue Jun 5 11:42:34 2012 (r236612) +++ head/sys/cam/ata/ata_xpt.c Tue Jun 5 11:48:32 2012 (r236613) @@ -96,6 +96,7 @@ typedef enum { PROBE_PM_PRV, PROBE_IDENTIFY_SES, PROBE_IDENTIFY_SAFTE, + PROBE_DONE, PROBE_INVALID } probe_action; @@ -115,6 +116,7 @@ static char *probe_action_text[] = { "PROBE_PM_PRV", "PROBE_IDENTIFY_SES", "PROBE_IDENTIFY_SAFTE", + "PROBE_DONE", "PROBE_INVALID" }; @@ -122,7 +124,7 @@ static char *probe_action_text[] = { do { \ char **text; \ text = probe_action_text; \ - CAM_DEBUG((softc)->periph->path, CAM_DEBUG_INFO, \ + CAM_DEBUG((softc)->periph->path, CAM_DEBUG_PROBE, \ ("Probe %s to %s\n", text[(softc)->action], \ text[(newaction)])); \ (softc)->action = (newaction); \ @@ -251,6 +253,8 @@ proberegister(struct cam_periph *periph, if (status != CAM_REQ_CMP) { return (status); } + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); + /* * Ensure nobody slip in until probe finish. */ @@ -653,11 +657,8 @@ negotiate: ata_28bit_cmd(ataio, ATA_SEP_ATTN, 0xEC, 0x00, sizeof(softc->ident_data) / 4); break; - case PROBE_INVALID: - CAM_DEBUG(path, CAM_DEBUG_INFO, - ("probestart: invalid action state\n")); default: - break; + panic("probestart: invalid action state 0x%x\n", softc->action); } xpt_action(start_ccb); } @@ -776,6 +777,7 @@ probedone(struct cam_periph *periph, uni */ device_fail: if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0) xpt_async(AC_LOST_DEVICE, path, NULL); + PROBE_SET_ACTION(softc, PROBE_INVALID); found = 0; goto done; } @@ -787,8 +789,8 @@ noerror: { int sign = (done_ccb->ataio.res.lba_high << 8) + done_ccb->ataio.res.lba_mid; - if (bootverbose) - xpt_print(path, "SIGNATURE: %04x\n", sign); + CAM_DEBUG(path, CAM_DEBUG_PROBE, + ("SIGNATURE: %04x\n", sign)); if (sign == 0x0000 && done_ccb->ccb_h.target_id != 15) { path->device->protocol = PROTO_ATA; @@ -1053,6 +1055,7 @@ notsata: xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); break; case PROBE_INQUIRY: case PROBE_FULL_INQUIRY: @@ -1094,6 +1097,7 @@ notsata: xpt_action(done_ccb); xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); break; } case PROBE_PM_PID: @@ -1162,6 +1166,7 @@ notsata: xpt_action(done_ccb); xpt_async(AC_SCSI_AEN, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); break; case PROBE_IDENTIFY_SES: case PROBE_IDENTIFY_SAFTE: @@ -1204,12 +1209,10 @@ notsata: xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); break; - case PROBE_INVALID: - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_INFO, - ("probedone: invalid action state\n")); default: - break; + panic("probedone: invalid action state 0x%x\n", softc->action); } done: if (softc->restart) { @@ -1219,6 +1222,7 @@ done: return; } xpt_release_ccb(done_ccb); + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe completed\n")); while ((done_ccb = (union ccb *)TAILQ_FIRST(&softc->request_ccbs))) { TAILQ_REMOVE(&softc->request_ccbs, &done_ccb->ccb_h, periph_links.tqe); Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Tue Jun 5 11:42:34 2012 (r236612) +++ head/sys/cam/scsi/scsi_xpt.c Tue Jun 5 11:48:32 2012 (r236613) @@ -141,6 +141,7 @@ typedef enum { PROBE_INQUIRY_BASIC_DV1, PROBE_INQUIRY_BASIC_DV2, PROBE_DV_EXIT, + PROBE_DONE, PROBE_INVALID } probe_action; @@ -157,6 +158,7 @@ static char *probe_action_text[] = { "PROBE_INQUIRY_BASIC_DV1", "PROBE_INQUIRY_BASIC_DV2", "PROBE_DV_EXIT", + "PROBE_DONE", "PROBE_INVALID" }; @@ -164,7 +166,7 @@ static char *probe_action_text[] = { do { \ char **text; \ text = probe_action_text; \ - CAM_DEBUG((softc)->periph->path, CAM_DEBUG_INFO, \ + CAM_DEBUG((softc)->periph->path, CAM_DEBUG_PROBE, \ ("Probe %s to %s\n", text[(softc)->action], \ text[(newaction)])); \ (softc)->action = (newaction); \ @@ -642,7 +644,7 @@ proberegister(struct cam_periph *periph, if (status != CAM_REQ_CMP) { return (status); } - + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); /* * Ensure we've waited at least a bus settle @@ -981,11 +983,8 @@ again: probedone(periph, start_ccb); return; } - case PROBE_INVALID: - CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_INFO, - ("probestart: invalid action state\n")); default: - break; + panic("probestart: invalid action state 0x%x\n", softc->action); } xpt_action(start_ccb); } @@ -1065,7 +1064,7 @@ proberequestbackoff(struct cam_periph *p } if (device->flags & CAM_DEV_DV_HIT_BOTTOM) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("hit async: giving up on DV\n")); return (0); } @@ -1085,7 +1084,7 @@ proberequestbackoff(struct cam_periph *p if (spi->sync_period >= 0xf) { spi->sync_period = 0; spi->sync_offset = 0; - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("setting to async for DV\n")); /* * Once we hit async, we don't want to try @@ -1093,7 +1092,7 @@ proberequestbackoff(struct cam_periph *p */ device->flags |= CAM_DEV_DV_HIT_BOTTOM; } else if (bootverbose) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("DV: period 0x%x\n", spi->sync_period)); printf("setting period to 0x%x\n", spi->sync_period); } @@ -1103,7 +1102,7 @@ proberequestbackoff(struct cam_periph *p if ((cts.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { break; } - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("DV: failed to set period 0x%x\n", spi->sync_period)); if (spi->sync_period == 0) { return (0); @@ -1250,6 +1249,7 @@ probedone(struct cam_periph *periph, uni if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0) /* Send the async notification. */ xpt_async(AC_LOST_DEVICE, path, NULL); + PROBE_SET_ACTION(softc, PROBE_INVALID); xpt_release_ccb(done_ccb); break; @@ -1283,8 +1283,9 @@ probedone(struct cam_periph *periph, uni /* * Reallocate and retry to cover all luns */ - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, path, - ("reallocating REPORT_LUNS for %u luns\n", nlun)); + CAM_DEBUG(path, CAM_DEBUG_PROBE, + ("Probe: reallocating REPORT_LUNS for %u luns\n", + nlun)); free(lp, M_CAMXPT); path->target->rpl_size = (nlun << 3) + 8; xpt_release_ccb(done_ccb); @@ -1307,8 +1308,8 @@ probedone(struct cam_periph *periph, uni lun_id_t lun; int idx; - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, path, - ("%u luns reported\n", nlun)); + CAM_DEBUG(path, CAM_DEBUG_PROBE, + ("Probe: %u lun(s) reported\n", nlun)); CAM_GET_SIMPLE_LUN(lp, 0, lun); /* @@ -1330,8 +1331,8 @@ probedone(struct cam_periph *periph, uni lp->luns[idx].lundata, 8); memcpy(lp->luns[idx].lundata, tlun, 8); - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, - path, ("lun 0 in position %u\n", idx)); + CAM_DEBUG(path, CAM_DEBUG_PROBE, + ("lun 0 in position %u\n", idx)); } else { /* * There is no lun 0 in our list. Destroy @@ -1616,7 +1617,7 @@ probe_device_check: && done_ccb->ccb_h.target_lun == 0 && (path->device->inq_data.flags & SID_Sync) != 0 && (path->device->flags & CAM_DEV_IN_DV) == 0) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Begin Domain Validation\n")); path->device->flags |= CAM_DEV_IN_DV; xpt_release_ccb(done_ccb); @@ -1625,7 +1626,7 @@ probe_device_check: return; } if (softc->action == PROBE_DV_EXIT) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Leave Domain Validation\n")); } if (path->device->flags & CAM_DEV_UNCONFIGURED) { @@ -1641,6 +1642,7 @@ probe_device_check: xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); xpt_release_ccb(done_ccb); break; case PROBE_INQUIRY_BASIC_DV1: @@ -1680,7 +1682,7 @@ probe_device_check: return; } if (softc->action == PROBE_INQUIRY_BASIC_DV2) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Leave Domain Validation Successfully\n")); } if (path->device->flags & CAM_DEV_UNCONFIGURED) { @@ -1696,20 +1698,19 @@ probe_device_check: xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); xpt_release_ccb(done_ccb); break; } - case PROBE_INVALID: - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_INFO, - ("probedone: invalid action state\n")); default: - break; + panic("probedone: invalid action state 0x%x\n", softc->action); } done_ccb = (union ccb *)TAILQ_FIRST(&softc->request_ccbs); TAILQ_REMOVE(&softc->request_ccbs, &done_ccb->ccb_h, periph_links.tqe); done_ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(done_ccb); if (TAILQ_FIRST(&softc->request_ccbs) == NULL) { + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe completed\n")); cam_periph_invalidate(periph); cam_release_devq(periph->path, RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_XPT + 1, FALSE); @@ -1922,7 +1923,7 @@ scsi_scan_bus(struct cam_periph *periph, xpt_done(request_ccb); return; } - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, request_ccb->ccb_h.path, + CAM_DEBUG(request_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("SCAN start for %p\n", scan_info)); scan_info->request_ccb = request_ccb; scan_info->cpi = &work_ccb->cpi; @@ -2035,8 +2036,8 @@ scsi_scan_bus(struct cam_periph *periph, CAM_GET_SIMPLE_LUN(target->luns, scan_info->lunindex[target_id], lun_id); next_target = 0; - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, - request_ccb->ccb_h.path, + CAM_DEBUG(request_ccb->ccb_h.path, + CAM_DEBUG_PROBE, ("next lun to try at index %u is %u\n", scan_info->lunindex[target_id], lun_id)); scan_info->lunindex[target_id]++; @@ -2143,8 +2144,8 @@ scsi_scan_bus(struct cam_periph *periph, xpt_free_ccb(request_ccb); xpt_free_ccb((union ccb *)scan_info->cpi); request_ccb = scan_info->request_ccb; - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, - request_ccb->ccb_h.path, + CAM_DEBUG(request_ccb->ccb_h.path, + CAM_DEBUG_TRACE, ("SCAN done for %p\n", scan_info)); free(scan_info, M_CAMXPT); request_ccb->ccb_h.status = CAM_REQ_CMP; From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 12:34:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4824B1065672; Tue, 5 Jun 2012 12:34:09 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 337CC8FC20; Tue, 5 Jun 2012 12:34:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55CY9Rs019820; Tue, 5 Jun 2012 12:34:09 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55CY9Oq019818; Tue, 5 Jun 2012 12:34:09 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201206051234.q55CY9Oq019818@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 5 Jun 2012 12:34:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236614 - head/gnu/lib/libsupc++ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 12:34:09 -0000 Author: des Date: Tue Jun 5 12:34:08 2012 New Revision: 236614 URL: http://svn.freebsd.org/changeset/base/236614 Log: Add mangled symbols for operator new / delete on 64-bit platforms. Reported by: decke@ MFC after: 1 week Modified: head/gnu/lib/libsupc++/Version.map Modified: head/gnu/lib/libsupc++/Version.map ============================================================================== --- head/gnu/lib/libsupc++/Version.map Tue Jun 5 11:48:32 2012 (r236613) +++ head/gnu/lib/libsupc++/Version.map Tue Jun 5 12:34:08 2012 (r236614) @@ -126,11 +126,19 @@ CXXABI_1.3 { # __gnu_cxx::_verbose_terminate_handler() _ZN9__gnu_cxx27__verbose_terminate_handlerEv; - # new / delete operators + # operator new and new[], 32-bit size_t _Znaj; _ZnajRKSt9nothrow_t; _Znwj; _ZnwjRKSt9nothrow_t; + + # operator new and new[], 64-bit size_t + _Znam; + _ZnamRKSt9nothrow_t; + _Znwm; + _ZnwmRKSt9nothrow_t; + + # operator delete and delete[] _ZdaPv; _ZdaPvRKSt9nothrow_t; _ZdlPv; From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 12:40:22 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 902E2106566C; Tue, 5 Jun 2012 12:40:22 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id ECF618FC17; Tue, 5 Jun 2012 12:40:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q55Cd1U8013453; Tue, 5 Jun 2012 16:39:01 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q55Cd18e013452; Tue, 5 Jun 2012 16:39:01 +0400 (MSK) (envelope-from ache) Date: Tue, 5 Jun 2012 16:39:01 +0400 From: Andrey Chernov To: Dimitry Andric Message-ID: <20120605123901.GA13306@vniz.net> Mail-Followup-To: Andrey Chernov , Dimitry Andric , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <4FCDBE69.6080906@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FCDBE69.6080906@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 Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 12:40:22 -0000 On Tue, Jun 05, 2012 at 10:08:09AM +0200, Dimitry Andric wrote: > On 2012-06-04 23:34, Andrey A. Chernov wrote:> Author: ache > > Date: Mon Jun 4 21:34:49 2012 > > New Revision: 236582 > > URL: http://svn.freebsd.org/changeset/base/236582 > > > > Log: > > 1) IEEE Std 1003.1-2008, "errno" section, is explicit that > > > > "The setting of errno after a successful call to a function is > > unspecified unless the description of that function specifies that > > errno shall not be modified." > > > > However, free() in IEEE Std 1003.1-2008 does not mention its interaction > > with errno, so MAY modify it after successful call > > (it depends on particular free() implementation, OS-specific, etc.). > > Actually, it says the following: > > RETURN VALUE > > The free() function shall not return a value. > > ERRORS > > No errors are defined. > > How much clearer do you want it? ;) It is pretty clear. The function is not specified that errno shall not be modified. You mstake errors with direct mention of not modified errno, as POSIX requires. Moreover, standard metion "unsuccessful call" case for free() where errno state is totally undefined. -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 12:48:51 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5160810656A4; Tue, 5 Jun 2012 12:48:51 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 9D5EC8FC1D; Tue, 5 Jun 2012 12:48:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q55CmmN2013623; Tue, 5 Jun 2012 16:48:49 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q55Cmm7G013622; Tue, 5 Jun 2012 16:48:48 +0400 (MSK) (envelope-from ache) Date: Tue, 5 Jun 2012 16:48:47 +0400 From: Andrey Chernov To: Konstantin Belousov Message-ID: <20120605124847.GB13306@vniz.net> Mail-Followup-To: Andrey Chernov , Konstantin Belousov , Dimitry Andric , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <4FCDBE69.6080906@FreeBSD.org> <20120605083553.GH85127@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qDbXVdCdHGoSgWSk" Content-Disposition: inline In-Reply-To: <20120605083553.GH85127@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Dimitry Andric Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 12:48:51 -0000 --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 05, 2012 at 11:35:53AM +0300, Konstantin Belousov wrote: > Not to mention that the patch was committed to _our_ implementation of > libc, which uses _our_ free, and not some abstract free(3). Our free chan= ging > errno means that process state is so messed that worrying about realpath(= 3) > correctness is beyond any expectations. We can't stay with "our free" concept but with "some abstract free"=20 instead. The code must be portable and even "our free" can be replaced in= =20 the future. About errno changing, look at "our free" code pass, potential candidates=20 (as Garrett mentions) are utrace, assert, idalloc - I don't look deep to=20 say for sure. But it does not really matter because the whole "our free"=20 concept is flawed. > I already described my POV to ache, but it seems that nobody listens. It = just > a season, it seems. You deside to not answer to the free() discussion which follows your=20 initial commit, which means either you agree with change or you are not=20 interested. It looks strange that you just consider to answer now and keep= =20 silence at the time of discussion. --=20 http://ache.vniz.net/ --qDbXVdCdHGoSgWSk Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/OAC8ACgkQVg5YK5ZEdN2BOwCgqT9ce0JL6k9QvfXN6DjGP87x xFEAnRZQAuX2VFJsrT9WzRGguCHO9d2E =uKtO -----END PGP SIGNATURE----- --qDbXVdCdHGoSgWSk-- From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 12:53:00 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 280CF1065672; Tue, 5 Jun 2012 12:53:00 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 993568FC24; Tue, 5 Jun 2012 12:52:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q55CqwS3013702; Tue, 5 Jun 2012 16:52:58 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q55Cqwrd013701; Tue, 5 Jun 2012 16:52:58 +0400 (MSK) (envelope-from ache) Date: Tue, 5 Jun 2012 16:52:57 +0400 From: Andrey Chernov To: Dimitry Andric , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Message-ID: <20120605125257.GC13306@vniz.net> Mail-Followup-To: Andrey Chernov , Dimitry Andric , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <4FCDBE69.6080906@FreeBSD.org> <20120605123901.GA13306@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120605123901.GA13306@vniz.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 12:53:00 -0000 On Tue, Jun 05, 2012 at 04:39:01PM +0400, Andrey Chernov wrote: > > Actually, it says the following: > > > > RETURN VALUE > > > > The free() function shall not return a value. > > > > ERRORS > > > > No errors are defined. > > > > How much clearer do you want it? ;) > > It is pretty clear. > The function is not specified that errno shall not be modified. > You mstake errors with direct mention of not modified errno, as POSIX > requires. > > Moreover, standard metion "unsuccessful call" case for free() where errno > state is totally undefined. BTW, this interpretation is not my invention, look at this discussion where Austin Groupd agrees that it is the case: http://austingroupbugs.net/view.php?id=385 -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 12:55:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBDE81065670; Tue, 5 Jun 2012 12:55:26 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo6-p00-ob.rzone.de (mo6-p00-ob.rzone.de [IPv6:2a01:238:20a:202:5300::1]) by mx1.freebsd.org (Postfix) with ESMTP id 23AA08FC14; Tue, 5 Jun 2012 12:55:25 +0000 (UTC) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/avgusCdvwXOZ/NA7x/bslx0Tb3qG7Dr+rtoZmup0T66FYx9W X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de ([2001:6f8:13f0:0:15bb:b233:9679:7231]) by smtp.strato.de (jored mo7) (RZmta 29.10 AUTH) with (AES128-SHA encrypted) ESMTPA id 6067e2o55Ca4HT ; Tue, 5 Jun 2012 14:55:21 +0200 (CEST) Received: by britannica.bec.de (sSMTP sendmail emulation); Tue, 05 Jun 2012 14:55:20 +0200 Date: Tue, 5 Jun 2012 14:55:20 +0200 From: Joerg Sonnenberger To: svn-src-all@freebsd.org Message-ID: <20120605125520.GA12045@britannica.bec.de> References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <4FCDBE69.6080906@FreeBSD.org> <20120605123901.GA13306@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120605123901.GA13306@vniz.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, Dimitry Andric , src-committers@FreeBSD.ORG, Andrey Chernov Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 12:55:26 -0000 On Tue, Jun 05, 2012 at 04:39:01PM +0400, Andrey Chernov wrote: > Moreover, standard metion "unsuccessful call" case for free() where errno > state is totally undefined. ...which would be a programming mistake in first place and is valid as justification. Joerg From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 13:09:24 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7E97C106566B; Tue, 5 Jun 2012 13:09:24 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id E639D8FC1D; Tue, 5 Jun 2012 13:09:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q55D9MpJ014011; Tue, 5 Jun 2012 17:09:22 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q55D9MQe014010; Tue, 5 Jun 2012 17:09:22 +0400 (MSK) (envelope-from ache) Date: Tue, 5 Jun 2012 17:09:22 +0400 From: Andrey Chernov To: Pawel Jakub Dawidek Message-ID: <20120605130922.GE13306@vniz.net> Mail-Followup-To: Andrey Chernov , Pawel Jakub Dawidek , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG, freebsd-arch@FreeBSD.ORG References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <20120605074741.GA1391@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gj572EiMnwbLXET9" Content-Disposition: inline In-Reply-To: <20120605074741.GA1391@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, freebsd-arch@FreeBSD.ORG Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 13:09:24 -0000 --gj572EiMnwbLXET9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 05, 2012 at 09:47:42AM +0200, Pawel Jakub Dawidek wrote: > > "The setting of errno after a successful call to a function is > > unspecified unless the description of that function specifies that > > errno shall not be modified." >=20 > Very interesting. However free(3) is always successful. Maybe we need > more context here, but the sentence above might talk about functions > that can either succeed or fail and such functions do set errno on > failure, but we don't know what they do to errno on success - they > sometimes interact with the errno, free(3) never does. According to Austing Group interpretation, this setence talks about=20 funtions which always succeed too, please see http://austingroupbugs.net/view.php?id=3D385 > I aware that my interpretation might be too wishful, but it is pretty > obvious to save errno value when calling a function that can eventually > fail - when we save the errno we don't know if it will fail or not, so > we have to do that, but requiring to save errno when calling a void > function that can't fail is simply silly and complicates the code > without a reason. It still can fail due to internal errors, it just not returns failure. For internal errors POSIX states that errno state is unspecified. > I agree that the standards aren't clear, but if saving errno around > free(3) is the way to go, then I'm sure we have much more problems in > our code, even if it is not suppose to be portable it should be correct > - we never know who and when will take the code and port it. Currently they are pretty clear in that moment, although I agree that if=20 POSIX says it should not modify errno, the life will be easy. Lets look at= =20 their further movement, since they are already aware of this specific=20 problem. > I guess what I'm trying to say here is that this is much bigger change > than it looks and we should probably agree on some global rule here. =2E..which not violate standards. --=20 http://ache.vniz.net/ --gj572EiMnwbLXET9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/OBQIACgkQVg5YK5ZEdN3tRwCfSZV9vBpAGgmbFiu6NQuciGF1 ussAn3c6HZUcV5JLevuVuJGCnrw/PpBI =sd4B -----END PGP SIGNATURE----- --gj572EiMnwbLXET9-- From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 13:10:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27A0B1065670; Tue, 5 Jun 2012 13:10:08 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id CAEC28FC0A; Tue, 5 Jun 2012 13:10:07 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 2130B6F77; Tue, 5 Jun 2012 13:10:07 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id DB8CD9600; Tue, 5 Jun 2012 15:10:06 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Pawel Jakub Dawidek References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <20120605074741.GA1391@garage.freebsd.pl> Date: Tue, 05 Jun 2012 15:10:06 +0200 In-Reply-To: <20120605074741.GA1391@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Tue, 5 Jun 2012 09:47:42 +0200") Message-ID: <86txypvr9t.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "Andrey A. Chernov" , freebsd-arch@FreeBSD.org Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 13:10:08 -0000 Pawel Jakub Dawidek writes: > Very interesting. However free(3) is always successful. Maybe we need > more context here, but the sentence above might talk about functions > that can either succeed or fail and such functions do set errno on > failure, but we don't know what they do to errno on success - they > sometimes interact with the errno, free(3) never does. Even if free() itself never fails, it might have side effects such as unmapping a slab, logging a KTR event etc. which can modify errno. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 13:13:07 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 89DB6106566B; Tue, 5 Jun 2012 13:13:07 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 0177E8FC0C; Tue, 5 Jun 2012 13:13:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q55DD5wP014120; Tue, 5 Jun 2012 17:13:05 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q55DD5ut014119; Tue, 5 Jun 2012 17:13:05 +0400 (MSK) (envelope-from ache) Date: Tue, 5 Jun 2012 17:13:05 +0400 From: Andrey Chernov To: Joerg Sonnenberger Message-ID: <20120605131305.GF13306@vniz.net> Mail-Followup-To: Andrey Chernov , Joerg Sonnenberger , svn-src-all@FreeBSD.ORG, Dimitry Andric , src-committers@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <4FCDBE69.6080906@FreeBSD.org> <20120605123901.GA13306@vniz.net> <20120605125520.GA12045@britannica.bec.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120605125520.GA12045@britannica.bec.de> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Dimitry Andric Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 13:13:07 -0000 On Tue, Jun 05, 2012 at 02:55:20PM +0200, Joerg Sonnenberger wrote: > On Tue, Jun 05, 2012 at 04:39:01PM +0400, Andrey Chernov wrote: > > Moreover, standard metion "unsuccessful call" case for free() where errno > > state is totally undefined. > > ...which would be a programming mistake in first place and is valid as > justification. Not only that (I mean programming mistake in the realpath). F.e. internal free/malloc state can be damaged by other code even earlier. But all of this is not the case, since POSIX allows it to modify errno on _success_, which is main reason of the change. Please see http://austingroupbugs.net/view.php?id=385 -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 13:27:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1D540106564A; Tue, 5 Jun 2012 13:27:38 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 086038FC17; Tue, 5 Jun 2012 13:27:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55DRbY2022185; Tue, 5 Jun 2012 13:27:37 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55DRbut022183; Tue, 5 Jun 2012 13:27:37 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201206051327.q55DRbut022183@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 5 Jun 2012 13:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236615 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 13:27:38 -0000 Author: bz Date: Tue Jun 5 13:27:37 2012 New Revision: 236615 URL: http://svn.freebsd.org/changeset/base/236615 Log: Plug two interface address refcount leaks in early error return cases in the ioctl path. Reported by: rpaulo Reviewed by: emax MFC after: 3 days Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Tue Jun 5 12:34:08 2012 (r236614) +++ head/sys/netinet6/in6.c Tue Jun 5 13:27:37 2012 (r236615) @@ -1667,14 +1667,19 @@ in6_lifaddr_ioctl(struct socket *so, u_l hostid = IFA_IN6(ifa); /* prefixlen must be <= 64. */ - if (64 < iflr->prefixlen) + if (64 < iflr->prefixlen) { + if (ifa != NULL) + ifa_free(ifa); return EINVAL; + } prefixlen = iflr->prefixlen; /* hostid part must be zero. */ sin6 = (struct sockaddr_in6 *)&iflr->addr; if (sin6->sin6_addr.s6_addr32[2] != 0 || sin6->sin6_addr.s6_addr32[3] != 0) { + if (ifa != NULL) + ifa_free(ifa); return EINVAL; } } else From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 13:35:36 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 31FA91065674; Tue, 5 Jun 2012 13:35:36 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 534128FC0C; Tue, 5 Jun 2012 13:35:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q55DZA9X014565; Tue, 5 Jun 2012 17:35:10 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q55DZ8EY014564; Tue, 5 Jun 2012 17:35:08 +0400 (MSK) (envelope-from ache) Date: Tue, 5 Jun 2012 17:35:08 +0400 From: Andrey Chernov To: Dag-Erling Sm??rgrav Message-ID: <20120605133508.GA14460@vniz.net> Mail-Followup-To: Andrey Chernov , Dag-Erling Sm??rgrav , Pawel Jakub Dawidek , svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, freebsd-arch@FreeBSD.ORG References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <20120605074741.GA1391@garage.freebsd.pl> <86txypvr9t.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86txypvr9t.fsf@ds4.des.no> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Pawel Jakub Dawidek , freebsd-arch@FreeBSD.ORG Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 13:35:36 -0000 On Tue, Jun 05, 2012 at 03:10:06PM +0200, Dag-Erling Sm??rgrav wrote: > Pawel Jakub Dawidek writes: > > Very interesting. However free(3) is always successful. Maybe we need > > more context here, but the sentence above might talk about functions > > that can either succeed or fail and such functions do set errno on > > failure, but we don't know what they do to errno on success - they > > sometimes interact with the errno, free(3) never does. > > Even if free() itself never fails, it might have side effects such as > unmapping a slab, logging a KTR event etc. which can modify errno. I totally agree. Even if our free() will be cleaned in this sense or save errno internally, we need the code which not relays on some particular implementation but works in general scope with any standard-conformant free(). -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 13:57:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62C851065673; Tue, 5 Jun 2012 13:57:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CA3D8FC18; Tue, 5 Jun 2012 13:57:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55Dv3M8023525; Tue, 5 Jun 2012 13:57:03 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55Dv35r023523; Tue, 5 Jun 2012 13:57:03 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201206051357.q55Dv35r023523@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 5 Jun 2012 13:57:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236616 - stable/9/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 13:57:03 -0000 Author: trasz Date: Tue Jun 5 13:57:02 2012 New Revision: 236616 URL: http://svn.freebsd.org/changeset/base/236616 Log: MFC r236237: Fix lock interaction table for rmlocks - by default they cannot sleep, just like rwlocks. Modified: stable/9/share/man/man9/locking.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/locking.9 ============================================================================== --- stable/9/share/man/man9/locking.9 Tue Jun 5 13:27:37 2012 (r236615) +++ stable/9/share/man/man9/locking.9 Tue Jun 5 13:57:02 2012 (r236616) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 3, 2010 +.Dd May 25, 2012 .Dt LOCKING 9 .Os .Sh NAME @@ -301,7 +301,7 @@ one of the synchronization primitives di .It mutex Ta \&ok Ta \&ok-1 Ta \&no Ta \&ok Ta \&ok Ta \&no-3 .It sx Ta \&ok Ta \&ok Ta \&ok-2 Ta \&ok Ta \&ok Ta \&ok-4 .It rwlock Ta \&ok Ta \&ok Ta \&no Ta \&ok-2 Ta \&ok Ta \&no-3 -.It rmlock Ta \&ok Ta \&ok Ta \&ok-5 Ta \&ok Ta \&ok-2 Ta \&ok-5 +.It rmlock Ta \&ok Ta \&ok Ta \&no-5 Ta \&ok Ta \&ok-2 Ta \&no-5 .El .Pp .Em *1 From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 14:03:43 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 742D4106564A; Tue, 5 Jun 2012 14:03:43 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id E36208FC0C; Tue, 5 Jun 2012 14:03:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q55E3fFx015151; Tue, 5 Jun 2012 18:03:41 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q55E3fuP015146; Tue, 5 Jun 2012 18:03:41 +0400 (MSK) (envelope-from ache) Date: Tue, 5 Jun 2012 18:03:40 +0400 From: Andrey Chernov To: src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Message-ID: <20120605140340.GA15035@vniz.net> Mail-Followup-To: Andrey Chernov , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201206042134.q54LYoVJ067685@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201206042134.q54LYoVJ067685@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 14:03:43 -0000 On Mon, Jun 04, 2012 at 09:34:49PM +0000, Andrey A. Chernov wrote: > 1) IEEE Std 1003.1-2008, "errno" section, is explicit that > > "The setting of errno after a successful call to a function is > unspecified unless the description of that function specifies that > errno shall not be modified." > > However, free() in IEEE Std 1003.1-2008 does not mention its interaction > with errno, so MAY modify it after successful call > (it depends on particular free() implementation, OS-specific, etc.). I see this subject brings some attention, so I prefer to exmpain details. Here is the quote from the future standard change: http://austingroupbugs.net/view.php?id=385 "However, earlier versions of this standard did not require this, and the same example had to be written as: // buf was obtained by malloc(buflen) ret = write(fd, buf, buflen); if (ret < 0) { int save = errno; free(buf); errno = save; return ret; } " All we have now is "earlier version of standard". Until they'll publish future version, we need to stay this recommendation. -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 14:20:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5FF27106566C; Tue, 5 Jun 2012 14:20:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49FD38FC08; Tue, 5 Jun 2012 14:20:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55EK0H3024583; Tue, 5 Jun 2012 14:20:00 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55EK0Sl024580; Tue, 5 Jun 2012 14:20:00 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201206051420.q55EK0Sl024580@svn.freebsd.org> From: Warner Losh Date: Tue, 5 Jun 2012 14:20:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236617 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 14:20:00 -0000 Author: imp Date: Tue Jun 5 14:19:59 2012 New Revision: 236617 URL: http://svn.freebsd.org/changeset/base/236617 Log: Remove dead code. Modified: head/sys/arm/at91/at91rm92reg.h Modified: head/sys/arm/at91/at91rm92reg.h ============================================================================== --- head/sys/arm/at91/at91rm92reg.h Tue Jun 5 13:57:02 2012 (r236616) +++ head/sys/arm/at91/at91rm92reg.h Tue Jun 5 14:19:59 2012 (r236617) @@ -91,146 +91,6 @@ #define AT91RM92_SYS_BASE 0xffff000 #define AT91RM92_SYS_SIZE 0x1000 -#if 0 -/* Interrupt Controller */ -#define IC_SMR (0) /* Source mode register */ -#define IC_SVR (128) /* Source vector register */ -#define IC_IVR (256) /* IRQ vector register */ -#define IC_FVR (260) /* FIQ vector register */ -#define IC_ISR (264) /* Interrupt status register */ -#define IC_IPR (268) /* Interrupt pending register */ -#define IC_IMR (272) /* Interrupt status register */ -#define IC_CISR (276) /* Core interrupt status register */ -#define IC_IECR (288) /* Interrupt enable command register */ -#define IC_IDCR (292) /* Interrupt disable command register */ -#define IC_ICCR (296) /* Interrupt clear command register */ -#define IC_ISCR (300) /* Interrupt set command register */ -#define IC_EOICR (304) /* End of interrupt command register */ -#define IC_SPU (308) /* Spurious vector register */ -#define IC_DCR (312) /* Debug control register */ -#define IC_FFER (320) /* Fast forcing enable register */ -#define IC_FFDR (324) /* Fast forcing disable register */ -#define IC_FFSR (328) /* Fast forcing status register */ - - -#define PIOA_PER (0x400) /* PIO Enable Register */ -#define PIOA_PDR (0x400 + 4) /* PIO Disable Register */ -#define PIOA_PSR (0x400 + 8) /* PIO status register */ -#define PIOA_OER (0x400 + 16) /* Output enable register */ -#define PIOA_ODR (0x400 + 20) /* Output disable register */ -#define PIOA_OSR (0x400 + 24) /* Output status register */ -#define PIOA_IFER (0x400 + 32) /* Input filter enable register */ -#define PIOA_IFDR (0x400 + 36) /* Input filter disable register */ -#define PIOA_IFSR (0x400 + 40) /* Input filter status register */ -#define PIOA_SODR (0x400 + 48) /* Set output data register */ -#define PIOA_CODR (0x400 + 52) /* Clear output data register */ -#define PIOA_ODSR (0x400 + 56) /* Output data status register */ -#define PIOA_PDSR (0x400 + 60) /* Pin data status register */ -#define PIOA_IER (0x400 + 64) /* Interrupt enable register */ -#define PIOA_IDR (0x400 + 68) /* Interrupt disable register */ -#define PIOA_IMR (0x400 + 72) /* Interrupt mask register */ -#define PIOA_ISR (0x400 + 76) /* Interrupt status register */ -#define PIOA_MDER (0x400 + 80) /* Multi driver enable register */ -#define PIOA_MDDR (0x400 + 84) /* Multi driver disable register */ -#define PIOA_MDSR (0x400 + 88) /* Multi driver status register */ -#define PIOA_PPUDR (0x400 + 96) /* Pull-up disable register */ -#define PIOA_PPUER (0x400 + 100) /* Pull-up enable register */ -#define PIOA_PPUSR (0x400 + 104) /* Pad pull-up status register */ -#define PIOA_ASR (0x400 + 112) /* Select A register */ -#define PIOA_BSR (0x400 + 116) /* Select B register */ -#define PIOA_ABSR (0x400 + 120) /* AB Select status register */ -#define PIOA_OWER (0x400 + 160) /* Output Write enable register */ -#define PIOA_OWDR (0x400 + 164) /* Output write disable register */ -#define PIOA_OWSR (0x400 + 168) /* Output write status register */ -#define PIOB_PER (0x400) /* PIO Enable Register */ -#define PIOB_PDR (0x600 + 4) /* PIO Disable Register */ -#define PIOB_PSR (0x600 + 8) /* PIO status register */ -#define PIOB_OER (0x600 + 16) /* Output enable register */ -#define PIOB_ODR (0x600 + 20) /* Output disable register */ -#define PIOB_OSR (0x600 + 24) /* Output status register */ -#define PIOB_IFER (0x600 + 32) /* Input filter enable register */ -#define PIOB_IFDR (0x600 + 36) /* Input filter disable register */ -#define PIOB_IFSR (0x600 + 40) /* Input filter status register */ -#define PIOB_SODR (0x600 + 48) /* Set output data register */ -#define PIOB_CODR (0x600 + 52) /* Clear output data register */ -#define PIOB_ODSR (0x600 + 56) /* Output data status register */ -#define PIOB_PDSR (0x600 + 60) /* Pin data status register */ -#define PIOB_IER (0x600 + 64) /* Interrupt enable register */ -#define PIOB_IDR (0x600 + 68) /* Interrupt disable register */ -#define PIOB_IMR (0x600 + 72) /* Interrupt mask register */ -#define PIOB_ISR (0x600 + 76) /* Interrupt status register */ -#define PIOB_MDER (0x600 + 80) /* Multi driver enable register */ -#define PIOB_MDDR (0x600 + 84) /* Multi driver disable register */ -#define PIOB_MDSR (0x600 + 88) /* Multi driver status register */ -#define PIOB_PPUDR (0x600 + 96) /* Pull-up disable register */ -#define PIOB_PPUER (0x600 + 100) /* Pull-up enable register */ -#define PIOB_PPUSR (0x600 + 104) /* Pad pull-up status register */ -#define PIOB_ASR (0x600 + 112) /* Select A register */ -#define PIOB_BSR (0x600 + 116) /* Select B register */ -#define PIOB_ABSR (0x600 + 120) /* AB Select status register */ -#define PIOB_OWER (0x600 + 160) /* Output Write enable register */ -#define PIOB_OWDR (0x600 + 164) /* Output write disable register */ -#define PIOB_OWSR (0x600 + 168) /* Output write status register */ -#define PIOC_PER (0x800) /* PIO Enable Register */ -#define PIOC_PDR (0x800 + 4) /* PIO Disable Register */ -#define PIOC_PSR (0x800 + 8) /* PIO status register */ -#define PIOC_OER (0x800 + 16) /* Output enable register */ -#define PIOC_ODR (0x800 + 20) /* Output disable register */ -#define PIOC_OSR (0x800 + 24) /* Output status register */ -#define PIOC_IFER (0x800 + 32) /* Input filter enable register */ -#define PIOC_IFDR (0x800 + 36) /* Input filter disable register */ -#define PIOC_IFSR (0x800 + 40) /* Input filter status register */ -#define PIOC_SODR (0x800 + 48) /* Set output data register */ -#define PIOC_CODR (0x800 + 52) /* Clear output data register */ -#define PIOC_ODSR (0x800 + 56) /* Output data status register */ -#define PIOC_PDSR (0x800 + 60) /* Pin data status register */ -#define PIOC_IER (0x800 + 64) /* Interrupt enable register */ -#define PIOC_IDR (0x800 + 68) /* Interrupt disable register */ -#define PIOC_IMR (0x800 + 72) /* Interrupt mask register */ -#define PIOC_ISR (0x800 + 76) /* Interrupt status register */ -#define PIOC_MDER (0x800 + 80) /* Multi driver enable register */ -#define PIOC_MDDR (0x800 + 84) /* Multi driver disable register */ -#define PIOC_MDSR (0x800 + 88) /* Multi driver status register */ -#define PIOC_PPUDR (0x800 + 96) /* Pull-up disable register */ -#define PIOC_PPUER (0x800 + 100) /* Pull-up enable register */ -#define PIOC_PPUSR (0x800 + 104) /* Pad pull-up status register */ -#define PIOC_ASR (0x800 + 112) /* Select A register */ -#define PIOC_BSR (0x800 + 116) /* Select B register */ -#define PIOC_ABSR (0x800 + 120) /* AB Select status register */ -#define PIOC_OWER (0x800 + 160) /* Output Write enable register */ -#define PIOC_OWDR (0x800 + 164) /* Output write disable register */ -#define PIOC_OWSR (0x800 + 168) /* Output write status register */ -#define PIOD_PER (0xa00) /* PIO Enable Register */ -#define PIOD_PDR (0xa00 + 4) /* PIO Disable Register */ -#define PIOD_PSR (0xa00 + 8) /* PIO status register */ -#define PIOD_OER (0xa00 + 16) /* Output enable register */ -#define PIOD_ODR (0xa00 + 20) /* Output disable register */ -#define PIOD_OSR (0xa00 + 24) /* Output status register */ -#define PIOD_IFER (0xa00 + 32) /* Input filter enable register */ -#define PIOD_IFDR (0xa00 + 36) /* Input filter disable register */ -#define PIOD_IFSR (0xa00 + 40) /* Input filter status register */ -#define PIOD_SODR (0xa00 + 48) /* Set output data register */ -#define PIOD_CODR (0xa00 + 52) /* Clear output data register */ -#define PIOD_ODSR (0xa00 + 56) /* Output data status register */ -#define PIOD_PDSR (0xa00 + 60) /* Pin data status register */ -#define PIOD_IER (0xa00 + 64) /* Interrupt enable register */ -#define PIOD_IDR (0xa00 + 68) /* Interrupt disable register */ -#define PIOD_IMR (0xa00 + 72) /* Interrupt mask register */ -#define PIOD_ISR (0xa00 + 76) /* Interrupt status register */ -#define PIOD_MDER (0xa00 + 80) /* Multi driver enable register */ -#define PIOD_MDDR (0xa00 + 84) /* Multi driver disable register */ -#define PIOD_MDSR (0xa00 + 88) /* Multi driver status register */ -#define PIOD_PPUDR (0xa00 + 96) /* Pull-up disable register */ -#define PIOD_PPUER (0xa00 + 100) /* Pull-up enable register */ -#define PIOD_PPUSR (0xa00 + 104) /* Pad pull-up status register */ -#define PIOD_ASR (0xa00 + 112) /* Select A register */ -#define PIOD_BSR (0xa00 + 116) /* Select B register */ -#define PIOD_ABSR (0xa00 + 120) /* AB Select status register */ -#define PIOD_OWER (0xa00 + 160) /* Output Write enable register */ -#define PIOD_OWDR (0xa00 + 164) /* Output write disable register */ -#define PIOD_OWSR (0xa00 + 168) /* Output write status register */ - -#endif /* * PIO */ From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 14:25:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87C08106566B; Tue, 5 Jun 2012 14:25:31 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo6-p00-ob.rzone.de (mo6-p00-ob.rzone.de [IPv6:2a01:238:20a:202:5300::1]) by mx1.freebsd.org (Postfix) with ESMTP id DF1608FC16; Tue, 5 Jun 2012 14:25:30 +0000 (UTC) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/avgusCdvwXOZ/NA7x/bvTm77YCcfSPAeCHFXjMjf+Y6twMjxoXA= X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de ([2001:6f8:13f0:31f:94ff:fbf7:8e6a:dc1b]) by smtp.strato.de (josoe mo46) (RZmta 29.10 AUTH) with (AES128-SHA encrypted) ESMTPA id D0258do55DMrk3 ; Tue, 5 Jun 2012 16:25:21 +0200 (CEST) Received: by britannica.bec.de (sSMTP sendmail emulation); Tue, 05 Jun 2012 16:25:10 +0200 Date: Tue, 5 Jun 2012 16:25:10 +0200 From: Joerg Sonnenberger To: svn-src-all@freebsd.org Message-ID: <20120605142510.GB13416@britannica.bec.de> References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <4FCDBE69.6080906@FreeBSD.org> <20120605123901.GA13306@vniz.net> <20120605125520.GA12045@britannica.bec.de> <20120605131305.GF13306@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120605131305.GF13306@vniz.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, Dimitry Andric , src-committers@FreeBSD.ORG, Andrey Chernov Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 14:25:31 -0000 On Tue, Jun 05, 2012 at 05:13:05PM +0400, Andrey Chernov wrote: > On Tue, Jun 05, 2012 at 02:55:20PM +0200, Joerg Sonnenberger wrote: > > On Tue, Jun 05, 2012 at 04:39:01PM +0400, Andrey Chernov wrote: > > > Moreover, standard metion "unsuccessful call" case for free() where errno > > > state is totally undefined. > > > > ...which would be a programming mistake in first place and is valid as > > justification. > > Not only that (I mean programming mistake in the realpath). F.e. internal > free/malloc state can be damaged by other code even earlier. But all of > this is not the case, since POSIX allows it to modify errno on _success_, > which is main reason of the change. > Please see > http://austingroupbugs.net/view.php?id=385 That is about explicitly recognizing how stupid the notion of free(3) not preserving errno is. Seriously, before you start to randomly bloat code all over the place, restricting the behavior of free(3) to be sensible is a much saner option. Joerg From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 14:31:17 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECA0C1065673; Tue, 5 Jun 2012 14:31:17 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 648288FC0C; Tue, 5 Jun 2012 14:31:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q55EVFQj015774; Tue, 5 Jun 2012 18:31:15 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q55EVFN9015773; Tue, 5 Jun 2012 18:31:15 +0400 (MSK) (envelope-from ache) Date: Tue, 5 Jun 2012 18:31:14 +0400 From: Andrey Chernov To: Joerg Sonnenberger Message-ID: <20120605143114.GA15710@vniz.net> Mail-Followup-To: Andrey Chernov , Joerg Sonnenberger , svn-src-all@FreeBSD.ORG, Dimitry Andric , src-committers@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <4FCDBE69.6080906@FreeBSD.org> <20120605123901.GA13306@vniz.net> <20120605125520.GA12045@britannica.bec.de> <20120605131305.GF13306@vniz.net> <20120605142510.GB13416@britannica.bec.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120605142510.GB13416@britannica.bec.de> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Dimitry Andric Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 14:31:18 -0000 On Tue, Jun 05, 2012 at 04:25:10PM +0200, Joerg Sonnenberger wrote: > > Please see > > http://austingroupbugs.net/view.php?id=385 > > That is about explicitly recognizing how stupid the notion of free(3) > not preserving errno is. Seriously, before you start to randomly bloat > code all over the place, restricting the behavior of free(3) to be > sensible is a much saner option. I agree that saving errno inside free() itself will make life easy, but I just follow their recommendation: "However, earlier versions of this standard did not require this, and the same example had to be written as: // buf was obtained by malloc(buflen) ret = write(fd, buf, buflen); if (ret < 0) { int save = errno; free(buf); errno = save; return ret; } " All we have now is "earlier version of this standard". Until they'll publish the future version, we can't ignore the recommendation. BTW, if general consensus will be to track unpublished standard, I will back out my change (in hope our malloc() maintainer will change free() to directly save errno). -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 15:17:58 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDB22106566B; Tue, 5 Jun 2012 15:17:58 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo6-p00-ob.rzone.de (mo6-p00-ob.rzone.de [IPv6:2a01:238:20a:202:5300::1]) by mx1.freebsd.org (Postfix) with ESMTP id 9583F8FC0C; Tue, 5 Jun 2012 15:17:57 +0000 (UTC) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/avgusCdvwXOZ/NA7x/bvTm77YCcfSPAeCHFXjMjf+Y6twMjxoXA= X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de ([2001:6f8:13f0:31f:94ff:fbf7:8e6a:dc1b]) by smtp.strato.de (josoe mo41) (RZmta 29.10 AUTH) with (AES128-SHA encrypted) ESMTPA id i023eao55DZB6M ; Tue, 5 Jun 2012 17:17:46 +0200 (CEST) Received: by britannica.bec.de (sSMTP sendmail emulation); Tue, 05 Jun 2012 17:17:33 +0200 Date: Tue, 5 Jun 2012 17:17:33 +0200 From: Joerg Sonnenberger To: Andrey Chernov , svn-src-all@FreeBSD.ORG, Dimitry Andric , src-committers@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Message-ID: <20120605151733.GA15110@britannica.bec.de> References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <4FCDBE69.6080906@FreeBSD.org> <20120605123901.GA13306@vniz.net> <20120605125520.GA12045@britannica.bec.de> <20120605131305.GF13306@vniz.net> <20120605142510.GB13416@britannica.bec.de> <20120605143114.GA15710@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120605143114.GA15710@vniz.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 15:17:58 -0000 On Tue, Jun 05, 2012 at 06:31:14PM +0400, Andrey Chernov wrote: > BTW, if general consensus will be to track unpublished standard, I will > back out my change (in hope our malloc() maintainer will change free() to > directly save errno). The standard is quite irrelevant here. FreeBSD is free to require a more restricted behavior of free(3). Joerg From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 15:23:34 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46BC4106567A; Tue, 5 Jun 2012 15:23:34 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id CA6068FC16; Tue, 5 Jun 2012 15:23:33 +0000 (UTC) Received: from sa-nc-apg-88.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q55FNOIA030172 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 5 Jun 2012 08:23:30 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <20120605143114.GA15710@vniz.net> Date: Tue, 5 Jun 2012 08:23:20 -0700 Content-Transfer-Encoding: 7bit Message-Id: <9BD2A226-4C65-4879-8C6F-4C3AFF1C9D41@xcllnt.net> References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <4FCDBE69.6080906@FreeBSD.org> <20120605123901.GA13306@vniz.net> <20120605125520.GA12045@britannica.bec.de> <20120605131305.GF13306@vniz.net> <20120605142510.GB13416@britannica.bec.de> <20120605143114.GA15710@vniz.net> To: Andrey Chernov X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@FreeBSD.org, Dimitry Andric , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Joerg Sonnenberger Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 15:23:34 -0000 On Jun 5, 2012, at 7:31 AM, Andrey Chernov wrote: > On Tue, Jun 05, 2012 at 04:25:10PM +0200, Joerg Sonnenberger wrote: >>> Please see >>> http://austingroupbugs.net/view.php?id=385 >> >> That is about explicitly recognizing how stupid the notion of free(3) >> not preserving errno is. Seriously, before you start to randomly bloat >> code all over the place, restricting the behavior of free(3) to be >> sensible is a much saner option. > > I agree that saving errno inside free() itself will make life easy, > but I just follow their recommendation: > > "However, earlier versions of this standard did not require this, and the > same example had to be written as: > > // buf was obtained by malloc(buflen) > ret = write(fd, buf, buflen); > if (ret < 0) { > int save = errno; > free(buf); > errno = save; > return ret; > } > " > > All we have now is "earlier version of this standard". Until they'll > publish the future version, we can't ignore the recommendation. > > BTW, if general consensus will be to track unpublished standard, I will > back out my change (in hope our malloc() maintainer will change free() to > directly save errno). We do know where things are heading towards, so it seems very reasonable to not change our current code, even if it is not in compliance with the currently published version (or the "earlier version of this standard" as you call it in the context of the unpublished version) and wait until we have more clarity. Often times our code has been non-compliant for many years and our non-compliance is shared with many implementations, so I see little reason to push for an immediate compliancy. If we the resolution of the ID 0000385 indicates that a future version will have the suggested text, then one can definitely argue that it's not unreasonable to start changing our functions to match the new text (like free(3)) and change all consumers to depend on it. I do not see a reason to revert the change under discussion just yet as it just adds to the churn without there being anything concrete, but I do suggest we won't "fix" any other code in the mean time. Our time is probably better spent auditing our source base and documenting where we depend on the yet-to-be-published behaviour and where we are strictly in compliance with the current version. This can will help us in the future when we want to clean things up. Just my $0.02, -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 15:56:49 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E36B5106566B; Tue, 5 Jun 2012 15:56:49 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 58BA48FC14; Tue, 5 Jun 2012 15:56:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q55FukgX017214; Tue, 5 Jun 2012 19:56:46 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q55FukQu017213; Tue, 5 Jun 2012 19:56:46 +0400 (MSK) (envelope-from ache) Date: Tue, 5 Jun 2012 19:56:46 +0400 From: Andrey Chernov To: Marcel Moolenaar Message-ID: <20120605155645.GA16936@vniz.net> Mail-Followup-To: Andrey Chernov , Marcel Moolenaar , Joerg Sonnenberger , svn-src-all@FreeBSD.ORG, Dimitry Andric , src-committers@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <4FCDBE69.6080906@FreeBSD.org> <20120605123901.GA13306@vniz.net> <20120605125520.GA12045@britannica.bec.de> <20120605131305.GF13306@vniz.net> <20120605142510.GB13416@britannica.bec.de> <20120605143114.GA15710@vniz.net> <9BD2A226-4C65-4879-8C6F-4C3AFF1C9D41@xcllnt.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9BD2A226-4C65-4879-8C6F-4C3AFF1C9D41@xcllnt.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, Dimitry Andric , svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Joerg Sonnenberger Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 15:56:50 -0000 On Tue, Jun 05, 2012 at 08:23:20AM -0700, Marcel Moolenaar wrote: > If we the resolution of the ID 0000385 indicates that a future version > will have the suggested text, then one can definitely argue that it's > not unreasonable to start changing our functions to match the new text > (like free(3)) and change all consumers to depend on it. It is already reach Resolved status, exact link if of the final changes is http://austingroupbugs.net/view.php?id=385#c713 But considering all feedback I got at this moment (including private ones) I decide to back out my change and fill PR for malloc() maintainer to save errno directly in free() instead. -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 16:16:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15182106566B; Tue, 5 Jun 2012 16:16:34 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D1C58FC15; Tue, 5 Jun 2012 16:16:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55GGXkS029766; Tue, 5 Jun 2012 16:16:33 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55GGXt7029764; Tue, 5 Jun 2012 16:16:33 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201206051616.q55GGXt7029764@svn.freebsd.org> From: "Andrey A. Chernov" Date: Tue, 5 Jun 2012 16:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236618 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 16:16:34 -0000 Author: ache Date: Tue Jun 5 16:16:33 2012 New Revision: 236618 URL: http://svn.freebsd.org/changeset/base/236618 Log: 1) Although unpublished version of standard http://austingroupbugs.net/view.php?id=385#c713 (Resolved state) recommend this way for the current standard (called "earlier" in the text) "However, earlier versions of this standard did not require this, and the same example had to be written as: // buf was obtained by malloc(buflen) ret = write(fd, buf, buflen); if (ret < 0) { int save = errno; free(buf); errno = save; return ret; } " from feedback I have for previous commit it seems that many people prefer to avoid mass code change needed for current standard compliance and prefer to track unpublished standard instead, which requires now that free() itself must save errno, not its usage code. So, I back out "save errno across free()" part of previous commit, and will fill PR for changing free() isntead. 2) Remove now unused serrno. MFC after: 1 week Modified: head/lib/libc/stdlib/realpath.c Modified: head/lib/libc/stdlib/realpath.c ============================================================================== --- head/lib/libc/stdlib/realpath.c Tue Jun 5 14:19:59 2012 (r236617) +++ head/lib/libc/stdlib/realpath.c Tue Jun 5 16:16:33 2012 (r236618) @@ -54,7 +54,7 @@ realpath(const char * __restrict path, c char *p, *q, *s; size_t left_len, resolved_len; unsigned symlinks; - int m, serrno, slen; + int m, slen; char left[PATH_MAX], next_token[PATH_MAX], symlink[PATH_MAX]; if (path == NULL) { @@ -82,11 +82,9 @@ realpath(const char * __restrict path, c left_len = strlcpy(left, path + 1, sizeof(left)); } else { if (getcwd(resolved, PATH_MAX) == NULL) { - if (m) { - serrno = errno; + if (m) free(resolved); - errno = serrno; - } else { + else { resolved[0] = '.'; resolved[1] = '\0'; } @@ -144,11 +142,8 @@ realpath(const char * __restrict path, c * occurence to not implement lookahead. */ if (lstat(resolved, &sb) != 0) { - if (m) { - serrno = errno; + if (m) free(resolved); - errno = serrno; - } return (NULL); } if (!S_ISDIR(sb.st_mode)) { @@ -188,11 +183,8 @@ realpath(const char * __restrict path, c if (lstat(resolved, &sb) != 0) { if (errno != ENOENT || p != NULL) errno = ENOTDIR; - if (m) { - serrno = errno; + if (m) free(resolved); - errno = serrno; - } return (NULL); } if (S_ISLNK(sb.st_mode)) { @@ -204,11 +196,8 @@ realpath(const char * __restrict path, c } slen = readlink(resolved, symlink, sizeof(symlink) - 1); if (slen < 0) { - if (m) { - serrno = errno; + if (m) free(resolved); - errno = serrno; - } return (NULL); } symlink[slen] = '\0'; From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 16:46:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC83D106564A; Tue, 5 Jun 2012 16:46:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7FAE8FC12; Tue, 5 Jun 2012 16:46:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55GkYg0031128; Tue, 5 Jun 2012 16:46:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55GkYv8031126; Tue, 5 Jun 2012 16:46:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206051646.q55GkYv8031126@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jun 2012 16:46:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236619 - head/sys/geom/multipath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 16:46:34 -0000 Author: mav Date: Tue Jun 5 16:46:34 2012 New Revision: 236619 URL: http://svn.freebsd.org/changeset/base/236619 Log: Add missing newlines into XML output. MFC after: 3 days Sponsored by: iXsystems, Inc. Modified: head/sys/geom/multipath/g_multipath.c Modified: head/sys/geom/multipath/g_multipath.c ============================================================================== --- head/sys/geom/multipath/g_multipath.c Tue Jun 5 16:16:33 2012 (r236618) +++ head/sys/geom/multipath/g_multipath.c Tue Jun 5 16:46:34 2012 (r236619) @@ -1314,7 +1314,7 @@ g_multipath_dumpconf(struct sbuf *sb, co if (sc == NULL) return; if (cp != NULL) { - sbuf_printf(sb, "%s%s", indent, + sbuf_printf(sb, "%s%s\n", indent, (cp->index & MP_NEW) ? "NEW" : (cp->index & MP_LOST) ? "LOST" : (cp->index & MP_FAIL) ? "FAIL" : @@ -1323,17 +1323,17 @@ g_multipath_dumpconf(struct sbuf *sb, co sc->sc_active_active == 2 ? "READ" : "PASSIVE"); } else { good = g_multipath_good(gp); - sbuf_printf(sb, "%s%s", indent, + sbuf_printf(sb, "%s%s\n", indent, good == 0 ? "BROKEN" : (good != sc->sc_ndisks || sc->sc_ndisks == 1) ? "DEGRADED" : "OPTIMAL"); } if (cp == NULL && pp == NULL) { - sbuf_printf(sb, "%s%s", indent, sc->sc_uuid); - sbuf_printf(sb, "%sActive/%s", indent, + sbuf_printf(sb, "%s%s\n", indent, sc->sc_uuid); + sbuf_printf(sb, "%sActive/%s\n", indent, sc->sc_active_active == 2 ? "Read" : sc->sc_active_active == 1 ? "Active" : "Passive"); - sbuf_printf(sb, "%s%s", indent, + sbuf_printf(sb, "%s%s\n", indent, sc->sc_uuid[0] == 0 ? "MANUAL" : "AUTOMATIC"); } } From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 17:13:25 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 001BD10656D3; Tue, 5 Jun 2012 17:13:24 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 6B7FB8FC1F; Tue, 5 Jun 2012 17:13:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q55HDMv3018545; Tue, 5 Jun 2012 21:13:22 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q55HDLPj018543; Tue, 5 Jun 2012 21:13:22 +0400 (MSK) (envelope-from ache) Date: Tue, 5 Jun 2012 21:13:21 +0400 From: Andrey Chernov To: Joerg Sonnenberger Message-ID: <20120605171321.GA18396@vniz.net> Mail-Followup-To: Andrey Chernov , Joerg Sonnenberger , svn-src-all@FreeBSD.ORG, Dimitry Andric , src-committers@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <4FCDBE69.6080906@FreeBSD.org> <20120605123901.GA13306@vniz.net> <20120605125520.GA12045@britannica.bec.de> <20120605131305.GF13306@vniz.net> <20120605142510.GB13416@britannica.bec.de> <20120605143114.GA15710@vniz.net> <20120605151733.GA15110@britannica.bec.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120605151733.GA15110@britannica.bec.de> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Dimitry Andric Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 17:13:25 -0000 On Tue, Jun 05, 2012 at 05:17:33PM +0200, Joerg Sonnenberger wrote: > On Tue, Jun 05, 2012 at 06:31:14PM +0400, Andrey Chernov wrote: > > BTW, if general consensus will be to track unpublished standard, I will > > back out my change (in hope our malloc() maintainer will change free() to > > directly save errno). > > The standard is quite irrelevant here. FreeBSD is free to require a more > restricted behavior of free(3). I am not supporter of "our" concept for standard API. Having ours only restricted free() will make harder to write portable code because people tends relay on what works for them and not on standards. But in the light of upcoming new standard version which require the same, it is acceptable at least. BTW, the change backed out, PR for free() filled instead. -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 17:36:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 785A7106564A; Tue, 5 Jun 2012 17:36:29 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48EEF8FC1D; Tue, 5 Jun 2012 17:36:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55HaT8Y033559; Tue, 5 Jun 2012 17:36:29 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55HaTD8033556; Tue, 5 Jun 2012 17:36:29 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201206051736.q55HaTD8033556@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 5 Jun 2012 17:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236620 - in head: share/man/man4 tools/regression/filemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 17:36:29 -0000 Author: obrien Date: Tue Jun 5 17:36:28 2012 New Revision: 236620 URL: http://svn.freebsd.org/changeset/base/236620 Log: Correct examples to the latest version I had. Modified: head/share/man/man4/filemon.4 head/tools/regression/filemon/filemontest.c Modified: head/share/man/man4/filemon.4 ============================================================================== --- head/share/man/man4/filemon.4 Tue Jun 5 16:46:34 2012 (r236619) +++ head/share/man/man4/filemon.4 Tue Jun 5 17:36:28 2012 (r236620) @@ -127,18 +127,19 @@ open_filemon(void) O_CREAT | O_WRONLY | O_TRUNC, DEFFILEMODE)) == -1) err(1, "open(filemon.out)"); - if (ioctl(fm_fd, FILEMON_SET_FD, &fm_log) < 0) + if (ioctl(fm_fd, FILEMON_SET_FD, &fm_log) == -1) err(1, "Cannot set filemon log file descriptor"); /* Set up these two fd's to close on exec. */ (void)fcntl(fm_fd, F_SETFD, FD_CLOEXEC); (void)fcntl(fm_log, F_SETFD, FD_CLOEXEC); if ((child = fork()) == 0) { + child = getpid(); + if (ioctl(fm_fd, FILEMON_SET_PID, &child) == -1) + err(1, "Cannot set filemon PID"); /* Do something here. */ return 0; } else { - if (ioctl(fm_fd, FILEMON_SET_PID, &child) < 0) - err(1, "Cannot set filemon PID"); wait(&child); close(fm_fd); } Modified: head/tools/regression/filemon/filemontest.c ============================================================================== --- head/tools/regression/filemon/filemontest.c Tue Jun 5 16:46:34 2012 (r236619) +++ head/tools/regression/filemon/filemontest.c Tue Jun 5 17:36:28 2012 (r236620) @@ -54,22 +54,27 @@ main(void) { if ((fm_log = mkstemp(log_name)) == -1) err(1, "mkstemp(%s)", log_name); - if (ioctl(fm_fd, FILEMON_SET_FD, &fm_log) < 0) + if (ioctl(fm_fd, FILEMON_SET_FD, &fm_log) == -1) err(1, "Cannot set filemon log file descriptor"); /* Set up these two fd's to close on exec. */ (void)fcntl(fm_fd, F_SETFD, FD_CLOEXEC); (void)fcntl(fm_log, F_SETFD, FD_CLOEXEC); - if ((child = fork()) == 0) { + switch (child = fork()) { + case 0: + child = getpid(); + if (ioctl(fm_fd, FILEMON_SET_PID, &child) == -1) + err(1, "Cannot set filemon PID to %d", child); system("./test_script.sh"); - return 0; - } else { - if (ioctl(fm_fd, FILEMON_SET_PID, &child) < 0) - err(1, "Cannot set filemon PID"); + break; + case -1: + err(1, "Cannot fork"); + default: wait(&child); close(fm_fd); // printf("Results in %s\n", log_name); + break; } return 0; } From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 17:37:30 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10CBD106564A; Tue, 5 Jun 2012 17:37:30 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id E0E058FC1A; Tue, 5 Jun 2012 17:37:29 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.5/8.14.5) with ESMTP id q55HbTA5076558; Tue, 5 Jun 2012 10:37:29 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.5/8.14.5/Submit) id q55HbTeb076557; Tue, 5 Jun 2012 10:37:29 -0700 (PDT) (envelope-from obrien) Date: Tue, 5 Jun 2012 10:37:29 -0700 From: "David O'Brien" To: Andrew Thompson Message-ID: <20120605173729.GA76499@dragon.NUXI.org> References: <201206042259.q54Mx7Ok073084@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 10.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r236593 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 17:37:30 -0000 On Tue, Jun 05, 2012 at 11:07:48AM +1200, Andrew Thompson wrote: > Does the race have to be managed between the parent SET_PID ioctl and > the child doing something? Thank you for catching that. I committed an older version of that. (had copies of this on multiple machines...) -- -- David (obrien@FreeBSD.org) From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 17:44:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E25EC1065672; Tue, 5 Jun 2012 17:44:54 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE2258FC1B; Tue, 5 Jun 2012 17:44:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55His75034019; Tue, 5 Jun 2012 17:44:54 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55HisJV034017; Tue, 5 Jun 2012 17:44:54 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201206051744.q55HisJV034017@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 5 Jun 2012 17:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236621 - head/sys/modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 17:44:55 -0000 Author: obrien Date: Tue Jun 5 17:44:54 2012 New Revision: 236621 URL: http://svn.freebsd.org/changeset/base/236621 Log: Only build filemon(4) on x86. Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Jun 5 17:36:28 2012 (r236620) +++ head/sys/modules/Makefile Tue Jun 5 17:44:54 2012 (r236621) @@ -5,7 +5,8 @@ # Modules that include binary-only blobs of microcode should be selectable by # MK_SOURCELESS_UCODE option (see below). -SUBDIR= ${_3dfx} \ +SUBDIR= \ + ${_3dfx} \ ${_3dfx_linux} \ ${_aac} \ accf_data \ @@ -358,9 +359,12 @@ SUBDIR= ${_3dfx} \ ${_zfs} \ zlib \ +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +_filemon= filemon +.endif + .if ${MACHINE_CPUARCH} != "powerpc" && ${MACHINE_CPUARCH} != "arm" && \ ${MACHINE_CPUARCH} != "mips" -_filemon= filemon _syscons= syscons _vpo= vpo .endif From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 17:46:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 193F7106566B; Tue, 5 Jun 2012 17:46:51 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0537D8FC0A; Tue, 5 Jun 2012 17:46:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55Hko57034152; Tue, 5 Jun 2012 17:46:50 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55HkoRS034150; Tue, 5 Jun 2012 17:46:50 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201206051746.q55HkoRS034150@svn.freebsd.org> From: Joel Dahl Date: Tue, 5 Jun 2012 17:46:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236622 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 17:46:51 -0000 Author: joel (doc committer) Date: Tue Jun 5 17:46:50 2012 New Revision: 236622 URL: http://svn.freebsd.org/changeset/base/236622 Log: Various mdoc fixes. Modified: head/share/man/man4/filemon.4 Modified: head/share/man/man4/filemon.4 ============================================================================== --- head/share/man/man4/filemon.4 Tue Jun 5 17:44:54 2012 (r236621) +++ head/share/man/man4/filemon.4 Tue Jun 5 17:46:50 2012 (r236622) @@ -93,20 +93,25 @@ R and one for W. .Sh IOCTLS -User mode programs communicate with the filemon driver through a +User mode programs communicate with the +.Nm filemon +driver through a number of ioctls which are described below. Each takes a single argument. .Bl -tag -width FILEMON_SET_PID .It Dv FILEMON_SET_FD Write the internal tracing buffer to the supplied open file descriptor. -.It Dv FILEMON_SET_PID . +.It Dv FILEMON_SET_PID Child process ID to trace. .El -.Pp .Sh RETURN VALUES The ioctl returns zero on success and non-zero on failure. +.Sh FILES +.Bl -tag -width /dev/zero +.It Pa /dev/filemon +.El .Sh EXAMPLES -.Bd -literal -offset indent +.Bd -literal #include #include #include @@ -152,10 +157,6 @@ Creates a file named and configures the .Nm device to write the filemon buffer contents to it. -.Sh FILES -.Bl -tag -width /dev/zero -.It Pa /dev/filemon -.El .Sh SEE ALSO .Xr dtrace 1 , .Xr ktrace 1 , From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 17:49:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF14C106567D; Tue, 5 Jun 2012 17:49:11 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAD538FC14; Tue, 5 Jun 2012 17:49:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55HnBB1034311; Tue, 5 Jun 2012 17:49:11 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55HnBx6034309; Tue, 5 Jun 2012 17:49:11 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201206051749.q55HnBx6034309@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 5 Jun 2012 17:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236623 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 17:49:12 -0000 Author: obrien Date: Tue Jun 5 17:49:11 2012 New Revision: 236623 URL: http://svn.freebsd.org/changeset/base/236623 Log: RAID is an acronym. Modified: head/share/man/man4/mpt.4 Modified: head/share/man/man4/mpt.4 ============================================================================== --- head/share/man/man4/mpt.4 Tue Jun 5 17:46:50 2012 (r236622) +++ head/share/man/man4/mpt.4 Tue Jun 5 17:49:11 2012 (r236623) @@ -124,15 +124,15 @@ Dell PowerEdge 1750 thru 2850 IBM eServer xSeries 335 .El .Pp -These systems also contain Integrated Raid Mirroring and Integrated -Raid Mirroring Enhanced which this driver also supports. +These systems also contain Integrated RAID Mirroring and Integrated +RAID Mirroring Enhanced which this driver also supports. .Pp The .Tn SAS controller chips are also present on many new AMD/Opteron based systems, like the Sun 4100. Note that this controller can drive both SAS and SATA -drives or a mix of them at the same time. The Integrated Raid Mirroring +drives or a mix of them at the same time. The Integrated RAID Mirroring available for these controllers is poorly supported at best. .Pp The From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 17:58:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD45E106564A; Tue, 5 Jun 2012 17:58:48 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C8408FC15; Tue, 5 Jun 2012 17:58:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55HwmQW034811; Tue, 5 Jun 2012 17:58:48 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55Hwmmf034809; Tue, 5 Jun 2012 17:58:48 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201206051758.q55Hwmmf034809@svn.freebsd.org> From: Joel Dahl Date: Tue, 5 Jun 2012 17:58:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236624 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 17:58:48 -0000 Author: joel (doc committer) Date: Tue Jun 5 17:58:47 2012 New Revision: 236624 URL: http://svn.freebsd.org/changeset/base/236624 Log: Remove end of line whitespace. Modified: head/share/man/man4/bce.4 Modified: head/share/man/man4/bce.4 ============================================================================== --- head/share/man/man4/bce.4 Tue Jun 5 17:49:11 2012 (r236623) +++ head/share/man/man4/bce.4 Tue Jun 5 17:58:47 2012 (r236624) @@ -213,57 +213,57 @@ Enable/Disable strict RX frame size chec Enable/Disable frame header/payload splitting (default 1). .It Va hw.bce.rx_pages Set the number of memory pages assigned to recieve packets by the driver. -Due to alignment issues, this value can only be of the set +Due to alignment issues, this value can only be of the set 1, 2, 4 or 8 (default 2). .It Va hw.bce.tx_pages -Set the number of memory pages assigned to transmit packets +Set the number of memory pages assigned to transmit packets by the driver. -Due to alignment issues, this value can only be of the set +Due to alignment issues, this value can only be of the set 1, 2, 4 or 8 (default 2). .It Va hw.bce.rx_ticks -Time in microsecond ticks to wait before generating a status +Time in microsecond ticks to wait before generating a status block updates due to RX processing activity. Values from 0-100 are valid. A value of 0 disables this status block update. -Cannot be set to 0 if hw.bce.rx_quick_cons_trip is also 0 +Cannot be set to 0 if hw.bce.rx_quick_cons_trip is also 0 (default 18). .It Va hw.bce.rx_ticks_int -Time in microsecond ticks to wait during RX interrupt +Time in microsecond ticks to wait during RX interrupt processing before generating a status block update. Values from 0-100 are valid. Valid values are in the range from 0-100. A value of 0 disables this status block update (default 18). .It Va hw.bce.rx_quick_cons_trip -Number of RX Quick BD Chain entries that must be completed +Number of RX Quick BD Chain entries that must be completed before a status block is generated. Values from 0-256 are valid. A value of 0 disables this status block update. Cannot be set to 0 if hw.bce.rx_ticks is also 0 (default 6). .It Va hw.bce.rx_quick_cons_trip_int -Number of RX quick BD entries that must be completed before +Number of RX quick BD entries that must be completed before a status block is generated duing interrupt processing. Values from 0-256 are valid. A value of 0 disables this status block update (default 6). .It Va hw.bce.tx_ticks -Time in microsecond ticks to wait before a status block +Time in microsecond ticks to wait before a status block update is generated due to TX activitiy. Values from 0-100 are valid. A value of 0 disables this status block update. -Cannot be set to 0 if hw.bce.tx_quick_cons_trip is also 0 +Cannot be set to 0 if hw.bce.tx_quick_cons_trip is also 0 (default 80). .It Va hw.bce.tx_ticks_int -Time in microsecond ticks to wait in interrupt processing +Time in microsecond ticks to wait in interrupt processing before a status block update is generated due to TX activity Values from 0-100 are valid. A value of 0 disables this status block update (default 80). .It Va hw.bce.tx_cons_trip -How many TX Quick BD Chain entries that must be completed +How many TX Quick BD Chain entries that must be completed before a status block is generated. Values from 0-100 are valid. A value of 0 disables this status block update. Cannot be set to 0 if hw.bce.tx_ticks is also 0 (default 20). .It Va hw.bce.tx_cons_trip_int -How many TX Quick BD Chain entries that must be completed +How many TX Quick BD Chain entries that must be completed before a status block is generated during an interrupt. Values from 0-100 are valid. A value of 0 disables this status block update (default 20). From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 18:07:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B8B2B106567A; Tue, 5 Jun 2012 18:07:20 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A341B8FC1A; Tue, 5 Jun 2012 18:07:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55I7Ka1035312; Tue, 5 Jun 2012 18:07:20 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55I7Kfe035310; Tue, 5 Jun 2012 18:07:20 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201206051807.q55I7Kfe035310@svn.freebsd.org> From: Joel Dahl Date: Tue, 5 Jun 2012 18:07:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236625 - head/sbin/camcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 18:07:20 -0000 Author: joel (doc committer) Date: Tue Jun 5 18:07:20 2012 New Revision: 236625 URL: http://svn.freebsd.org/changeset/base/236625 Log: Minor spelling fixes. Modified: head/sbin/camcontrol/camcontrol.8 Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Tue Jun 5 17:58:47 2012 (r236624) +++ head/sbin/camcontrol/camcontrol.8 Tue Jun 5 18:07:20 2012 (r236625) @@ -738,7 +738,7 @@ Set the partial pathway timeout value, i See the .Tn ANSI .Tn SAS -Protcol Layer (SPL) +Protocol Layer (SPL) specification for more information on this field. .It Fl a Ar enable|disable Enable or disable SATA slumber phy power conditions. @@ -1109,7 +1109,7 @@ Do not ask for confirmation. Run in simulation mode. Packet sizes that will be sent are shown, but no actual packet is sent to the device. -No confimation is asked in simulation mode. +No confirmation is asked in simulation mode. .It Fl v Besides showing sense information in case of a failure, the verbose option causes From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 18:09:23 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FD921065687; Tue, 5 Jun 2012 18:09:23 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id D84C68FC17; Tue, 5 Jun 2012 18:09:22 +0000 (UTC) Received: from sa-nc-apg-88.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q55I9Fnu030706 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 5 Jun 2012 11:09:21 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <201206051744.q55HisJV034017@svn.freebsd.org> Date: Tue, 5 Jun 2012 11:09:10 -0700 Content-Transfer-Encoding: 7bit Message-Id: <75AF37CD-8AC4-48DB-A724-59EB447274DD@xcllnt.net> References: <201206051744.q55HisJV034017@svn.freebsd.org> To: "David E. O'Brien" X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r236621 - head/sys/modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 18:09:23 -0000 On Jun 5, 2012, at 10:44 AM, David E. O'Brien wrote: > Author: obrien > Date: Tue Jun 5 17:44:54 2012 > New Revision: 236621 > URL: http://svn.freebsd.org/changeset/base/236621 > > Log: > Only build filemon(4) on x86. Why? -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 18:19:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D8311065670; Tue, 5 Jun 2012 18:19:53 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3011F8FC0C; Tue, 5 Jun 2012 18:19:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55IJrbj035980; Tue, 5 Jun 2012 18:19:53 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55IJqes035975; Tue, 5 Jun 2012 18:19:52 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201206051819.q55IJqes035975@svn.freebsd.org> From: Joel Dahl Date: Tue, 5 Jun 2012 18:19:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236626 - in head: lib/libelf lib/libgssapi sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 18:19:53 -0000 Author: joel (doc committer) Date: Tue Jun 5 18:19:52 2012 New Revision: 236626 URL: http://svn.freebsd.org/changeset/base/236626 Log: Remove repeated words. Modified: head/lib/libelf/elf_begin.3 head/lib/libgssapi/gss_unwrap.3 head/lib/libgssapi/gss_wrap.3 head/sbin/ifconfig/ifconfig.8 Modified: head/lib/libelf/elf_begin.3 ============================================================================== --- head/lib/libelf/elf_begin.3 Tue Jun 5 18:07:20 2012 (r236625) +++ head/lib/libelf/elf_begin.3 Tue Jun 5 18:19:52 2012 (r236626) @@ -252,7 +252,7 @@ was created. .It Bq Er ELF_E_ARGUMENT An .Xr ar 1 -archive was opened with with +archive was opened with .Ar cmd set to .Dv ELF_C_RDWR . Modified: head/lib/libgssapi/gss_unwrap.3 ============================================================================== --- head/lib/libgssapi/gss_unwrap.3 Tue Jun 5 18:07:20 2012 (r236625) +++ head/lib/libgssapi/gss_unwrap.3 Tue Jun 5 18:19:52 2012 (r236626) @@ -100,7 +100,7 @@ Protected message. .It output_message_buffer Buffer to receive unwrapped message. Storage associated with this buffer must -be freed by the application after use use +be freed by the application after use with a call to .Xr gss_release_buffer 3 . .It conf_state Modified: head/lib/libgssapi/gss_wrap.3 ============================================================================== --- head/lib/libgssapi/gss_wrap.3 Tue Jun 5 18:07:20 2012 (r236625) +++ head/lib/libgssapi/gss_wrap.3 Tue Jun 5 18:19:52 2012 (r236626) @@ -118,7 +118,7 @@ Integrity and data origin services only .It output_message_buffer Buffer to receive protected message. Storage associated with this buffer must -be freed by the application after use use +be freed by the application after use with a call to .Xr gss_release_buffer 3 . .El Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Tue Jun 5 18:07:20 2012 (r236625) +++ head/sbin/ifconfig/ifconfig.8 Tue Jun 5 18:19:52 2012 (r236626) @@ -2051,7 +2051,7 @@ Send broadcast path requests every two s Nodes on the mesh without a path to this root mesh station with try to discover a path to us. .It Cm PROACTIVE -Send broadcast path requests every two seconds and every node must reply with +Send broadcast path requests every two seconds and every node must reply with a path reply even if it already has a path to this root mesh station. .It Cm RANN Send broadcast root announcement (RANN) frames. From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 18:48:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD13B1065673; Tue, 5 Jun 2012 18:48:02 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98BCC8FC19; Tue, 5 Jun 2012 18:48:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55Im2So037253; Tue, 5 Jun 2012 18:48:02 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55Im2xP037250; Tue, 5 Jun 2012 18:48:02 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201206051848.q55Im2xP037250@svn.freebsd.org> From: Maksim Yevmenkin Date: Tue, 5 Jun 2012 18:48:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236627 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 18:48:02 -0000 Author: emax Date: Tue Jun 5 18:48:02 2012 New Revision: 236627 URL: http://svn.freebsd.org/changeset/base/236627 Log: Before it gets lost in the noise. Put a bandaid to prevent ixgbe(4) from completely locking up the system under high load. Our platform has a few CPU cores and a single active ixgbe(4) port with 4 queues. Under high enough traffic load, at about 7.5GBs and 700,000 packets/sec (outbound), the entire system would deadlock. What we found was that each CPU was in an endless loop on a different ix taskqueue thread. The OACTIVE flag had gotten set on each queue, and the ixgbe_handle_queue() function was continuously rescheduling itself via the taskqueue_enqueue. Since all CPUs were busy with their taskqueue threads, the ixgbe_local_timer() function couldn't run to clear the OACTIVE flag. Submitted by: scottl MFC after: 1 week Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Tue Jun 5 18:19:52 2012 (r236626) +++ head/sys/dev/ixgbe/ixgbe.c Tue Jun 5 18:48:02 2012 (r236627) @@ -1368,7 +1368,7 @@ ixgbe_handle_que(void *context, int pend ixgbe_start_locked(txr, ifp); #endif IXGBE_TX_UNLOCK(txr); - if (more || (ifp->if_drv_flags & IFF_DRV_OACTIVE)) { + if (more) { taskqueue_enqueue(que->tq, &que->que_task); return; } From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 18:57:38 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F3351065670; Tue, 5 Jun 2012 18:57:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id D4F048FC1E; Tue, 5 Jun 2012 18:57:37 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q55IvTj9015074 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 6 Jun 2012 04:57:30 +1000 Date: Wed, 6 Jun 2012 04:57:29 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov In-Reply-To: <20120605130922.GE13306@vniz.net> Message-ID: <20120606043731.D1124@besplex.bde.org> References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <20120605074741.GA1391@garage.freebsd.pl> <20120605130922.GE13306@vniz.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Pawel Jakub Dawidek , freebsd-arch@FreeBSD.org Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 18:57:38 -0000 On Tue, 5 Jun 2012, Andrey Chernov wrote: > On Tue, Jun 05, 2012 at 09:47:42AM +0200, Pawel Jakub Dawidek wrote: >>> "The setting of errno after a successful call to a function is >>> unspecified unless the description of that function specifies that >>> errno shall not be modified." >> >> Very interesting. However free(3) is always successful. Maybe we need >> more context here, but the sentence above might talk about functions >> that can either succeed or fail and such functions do set errno on >> failure, but we don't know what they do to errno on success - they >> sometimes interact with the errno, free(3) never does. > > According to Austing Group interpretation, this setence talks about > funtions which always succeed too, please see > http://austingroupbugs.net/view.php?id=385 This has very little to do with POSIX. It is a basic part of Standard C that the C library may, at its option, clobber errno, gratuitously or otherwise. From n869.txt: [#3] The value of errno is zero at program startup, but is never set to zero by any library function.159) The value of errno may be set to nonzero by a library function call whether or not there is an error, provided the use of errno is not documented in the description of the function in this International Standard. Use of errno is not documented for free(); thus free() is permitted to clobber errno. POSIX may require errno to not be clobbered, especially for its functions. It probably shouldn't do this for Standard C library functions like free(), since this would be an extension and any use of the extension would give unnecessarily unportanle code. >> I aware that my interpretation might be too wishful, but it is pretty >> obvious to save errno value when calling a function that can eventually >> fail - when we save the errno we don't know if it will fail or not, so >> we have to do that, but requiring to save errno when calling a void >> function that can't fail is simply silly and complicates the code >> without a reason. This has very little to do with success or failure. It does complicate the code for callers, but actually simplifies the library. Since most libary functions aren't required to preserve errno, they can call each other without having save and restore errno when they call each other. > It still can fail due to internal errors, it just not returns failure. > For internal errors POSIX states that errno state is unspecified. > >> I agree that the standards aren't clear, but if saving errno around >> free(3) is the way to go, then I'm sure we have much more problems in >> our code, even if it is not suppose to be portable it should be correct >> - we never know who and when will take the code and port it. > > Currently they are pretty clear in that moment, although I agree that if > POSIX says it should not modify errno, the life will be easy. Lets look at > their further movement, since they are already aware of this specific > problem. They are perfectly clear. >> I guess what I'm trying to say here is that this is much bigger change >> than it looks and we should probably agree on some global rule here. > > ...which not violate standards. Yes, its completion is a very large and ugly change. realpath() is a POSIX interface, so any code that implements or uses it can safely assume POSIX requirements. But non-POSIX code can only safely assume Standard C requirements. OTOH, the libary can assume anything that it wants and implements for itself, since it is the implementation so it can make free() easy to use for itself, with any extensions that aren't incompatible with Standard C. Since free() is allowed to clobber errno, it is also allowed to do a null clobber as a compatible extension. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 18:58:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BB785106589E; Tue, 5 Jun 2012 18:58:05 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5A198FC1A; Tue, 5 Jun 2012 18:58:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55Iw5To037735; Tue, 5 Jun 2012 18:58:05 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55Iw5ZD037734; Tue, 5 Jun 2012 18:58:05 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201206051858.q55Iw5ZD037734@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 5 Jun 2012 18:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236628 - head/cddl/lib/libdtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 18:58:05 -0000 Author: gnn Date: Tue Jun 5 18:58:05 2012 New Revision: 236628 URL: http://svn.freebsd.org/changeset/base/236628 Log: Add DTrace's io.d, which handles tranlsations for file, buffer and device info structures as well as the fds[] array. This is a raw version of the file, unmodified, to be used as a baseline. Added: head/cddl/lib/libdtrace/io.d (contents, props changed) Added: head/cddl/lib/libdtrace/io.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/lib/libdtrace/io.d Tue Jun 5 18:58:05 2012 (r236628) @@ -0,0 +1,220 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD$ + */ +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D depends_on module unix +#pragma D depends_on provider io + +inline int B_BUSY = B_BUSY; +#pragma D binding "1.0" B_BUSY +inline int B_DONE = 0x00000200; +#pragma D binding "1.0" B_DONE +inline int B_ERROR = B_ERROR; +#pragma D binding "1.0" B_ERROR +inline int B_PAGEIO = B_PAGEIO; +#pragma D binding "1.0" B_PAGEIO +inline int B_PHYS = B_PHYS; +#pragma D binding "1.0" B_PHYS +inline int B_READ = B_READ; +#pragma D binding "1.0" B_READ +inline int B_WRITE = B_WRITE; +#pragma D binding "1.0" B_WRITE +inline int B_ASYNC = 0x00000004; +#pragma D binding "1.0" B_ASYNC + +typedef struct bufinfo { + int b_flags; /* buffer status */ + size_t b_bcount; /* number of bytes */ + caddr_t b_addr; /* buffer address */ + uint64_t b_lblkno; /* block # on device */ + uint64_t b_blkno; /* expanded block # on device */ + size_t b_resid; /* # of bytes not transferred */ + size_t b_bufsize; /* size of allocated buffer */ + caddr_t b_iodone; /* I/O completion routine */ + int b_error; /* expanded error field */ + dev_t b_edev; /* extended device */ +} bufinfo_t; + +#pragma D binding "1.0" translator +translator bufinfo_t < struct buf *B > { + b_flags = B->b_flags; + b_addr = B->b_un.b_addr; + b_bcount = B->b_bcount; + b_lblkno = B->_b_blkno._f; + b_blkno = sizeof (long) == 8 ? B->_b_blkno._f : B->_b_blkno._p._l; + b_resid = B->b_resid; + b_bufsize = B->b_bufsize; + b_iodone = (caddr_t)B->b_iodone; + b_error = B->b_error; + b_edev = B->b_edev; +}; + +typedef struct devinfo { + int dev_major; /* major number */ + int dev_minor; /* minor number */ + int dev_instance; /* instance number */ + string dev_name; /* name of device */ + string dev_statname; /* name of device + instance/minor */ + string dev_pathname; /* pathname of device */ +} devinfo_t; + +#pragma D binding "1.0" translator +translator devinfo_t < struct buf *B > { + dev_major = B->b_dip != NULL ? getmajor(B->b_edev) : + getmajor(B->b_file->v_vfsp->vfs_dev); + dev_minor = B->b_dip != NULL ? getminor(B->b_edev) : + getminor(B->b_file->v_vfsp->vfs_dev); + dev_instance = B->b_dip == NULL ? + getminor(B->b_file->v_vfsp->vfs_dev) : + ((struct dev_info *)B->b_dip)->devi_instance; + dev_name = B->b_dip == NULL ? "nfs" : + stringof(`devnamesp[getmajor(B->b_edev)].dn_name); + dev_statname = strjoin(B->b_dip == NULL ? "nfs" : + stringof(`devnamesp[getmajor(B->b_edev)].dn_name), + lltostr(B->b_dip == NULL ? getminor(B->b_file->v_vfsp->vfs_dev) : + ((struct dev_info *)B->b_dip)->devi_instance == 0 && + ((struct dev_info *)B->b_dip)->devi_parent != NULL && + ((struct dev_info *)B->b_dip)->devi_parent->devi_node_name == + "pseudo" ? getminor(B->b_edev) : + ((struct dev_info *)B->b_dip)->devi_instance)); + dev_pathname = B->b_dip == NULL ? "" : + ddi_pathname(B->b_dip, getminor(B->b_edev)); +}; + +typedef struct fileinfo { + string fi_name; /* name (basename of fi_pathname) */ + string fi_dirname; /* directory (dirname of fi_pathname) */ + string fi_pathname; /* full pathname */ + offset_t fi_offset; /* offset within file */ + string fi_fs; /* filesystem */ + string fi_mount; /* mount point of file system */ + int fi_oflags; /* open(2) flags for file descriptor */ +} fileinfo_t; + +#pragma D binding "1.0" translator +translator fileinfo_t < struct buf *B > { + fi_name = B->b_file == NULL ? "" : + B->b_file->v_path == NULL ? "" : + basename(cleanpath(B->b_file->v_path)); + fi_dirname = B->b_file == NULL ? "" : + B->b_file->v_path == NULL ? "" : + dirname(cleanpath(B->b_file->v_path)); + fi_pathname = B->b_file == NULL ? "" : + B->b_file->v_path == NULL ? "" : + cleanpath(B->b_file->v_path); + fi_offset = B->b_offset; + fi_fs = B->b_file == NULL ? "" : + stringof(B->b_file->v_op->vnop_name); + fi_mount = B->b_file == NULL ? "" : + B->b_file->v_vfsp->vfs_vnodecovered == NULL ? "/" : + B->b_file->v_vfsp->vfs_vnodecovered->v_path == NULL ? "" : + cleanpath(B->b_file->v_vfsp->vfs_vnodecovered->v_path); + fi_oflags = 0; +}; + +/* + * The following inline constants can be used to examine fi_oflags when using + * the fds[] array or a translated fileinfo_t. Note that the various open + * flags behave as a bit-field *except* for O_RDONLY, O_WRONLY, and O_RDWR. + * To test the open mode, you write code similar to that used with the fcntl(2) + * F_GET[X]FL command, such as: if ((fi_oflags & O_ACCMODE) == O_WRONLY). + */ +inline int O_ACCMODE = 0x0003; +#pragma D binding "1.1" O_ACCMODE + +inline int O_RDONLY = 0x0000; +#pragma D binding "1.1" O_RDONLY +inline int O_WRONLY = 0x0001; +#pragma D binding "1.1" O_WRONLY +inline int O_RDWR = 0x0002; +#pragma D binding "1.1" O_RDWR + +inline int O_APPEND = 0x0008; +#pragma D binding "1.1" O_APPEND +inline int O_CREAT = 0x0200; +#pragma D binding "1.1" O_CREAT +inline int O_DSYNC = O_DSYNC; +#pragma D binding "1.1" O_DSYNC +inline int O_EXCL = 0x0800; +#pragma D binding "1.1" O_EXCL +inline int O_LARGEFILE = O_LARGEFILE; +#pragma D binding "1.1" O_LARGEFILE +inline int O_NOCTTY = 0x8000; +#pragma D binding "1.1" O_NOCTTY +inline int O_NONBLOCK = 0x0004; +#pragma D binding "1.1" O_NONBLOCK +inline int O_NDELAY = 0x0004; +#pragma D binding "1.1" O_NDELAY +inline int O_RSYNC = O_RSYNC; +#pragma D binding "1.1" O_RSYNC +inline int O_SYNC = 0x0080; +#pragma D binding "1.1" O_SYNC +inline int O_TRUNC = 0x0400; +#pragma D binding "1.1" O_TRUNC +inline int O_XATTR = O_XATTR; +#pragma D binding "1.1" O_XATTR + +#pragma D binding "1.1" translator +translator fileinfo_t < struct file *F > { + fi_name = F == NULL ? "" : + F->f_vnode->v_path == NULL ? "" : + basename(cleanpath(F->f_vnode->v_path)); + fi_dirname = F == NULL ? "" : + F->f_vnode->v_path == NULL ? "" : + dirname(cleanpath(F->f_vnode->v_path)); + fi_pathname = F == NULL ? "" : + F->f_vnode->v_path == NULL ? "" : + cleanpath(F->f_vnode->v_path); + fi_offset = F == NULL ? 0 : F->f_offset; + fi_fs = F == NULL ? "" : stringof(F->f_vnode->v_op->vnop_name); + fi_mount = F == NULL ? "" : + F->f_vnode->v_vfsp->vfs_vnodecovered == NULL ? "/" : + F->f_vnode->v_vfsp->vfs_vnodecovered->v_path == NULL ? "" : + cleanpath(F->f_vnode->v_vfsp->vfs_vnodecovered->v_path); + fi_oflags = F == NULL ? 0 : F->f_flag + (int)FOPEN; +}; + +inline fileinfo_t fds[int fd] = xlate ( + fd >= 0 && fd < curthread->t_procp->p_user.u_finfo.fi_nfiles ? + curthread->t_procp->p_user.u_finfo.fi_list[fd].uf_file : NULL); + +#pragma D attributes Stable/Stable/Common fds +#pragma D binding "1.1" fds + +#pragma D binding "1.2" translator +translator fileinfo_t < struct vnode *V > { + fi_name = V->v_path == NULL ? "" : + basename(cleanpath(V->v_path)); + fi_dirname = V->v_path == NULL ? "" : + dirname(cleanpath(V->v_path)); + fi_pathname = V->v_path == NULL ? "" : cleanpath(V->v_path); + fi_fs = stringof(V->v_op->vnop_name); + fi_mount = V->v_vfsp->vfs_vnodecovered == NULL ? "/" : + V->v_vfsp->vfs_vnodecovered->v_path == NULL ? "" : + cleanpath(V->v_vfsp->vfs_vnodecovered->v_path); +}; From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 19:41:05 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCEDF1065749; Tue, 5 Jun 2012 19:41:05 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 2C4BE8FC19; Tue, 5 Jun 2012 19:41:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q55Jf2ab021290; Tue, 5 Jun 2012 23:41:03 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q55Jf25B021289; Tue, 5 Jun 2012 23:41:02 +0400 (MSK) (envelope-from ache) Date: Tue, 5 Jun 2012 23:41:02 +0400 From: Andrey Chernov To: Bruce Evans Message-ID: <20120605194102.GA21173@vniz.net> Mail-Followup-To: Andrey Chernov , Bruce Evans , svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Pawel Jakub Dawidek , freebsd-arch@FreeBSD.ORG References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <20120605074741.GA1391@garage.freebsd.pl> <20120605130922.GE13306@vniz.net> <20120606043731.D1124@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120606043731.D1124@besplex.bde.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, Pawel Jakub Dawidek , freebsd-arch@FreeBSD.ORG Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 19:41:05 -0000 On Wed, Jun 06, 2012 at 04:57:29AM +1000, Bruce Evans wrote: > POSIX may require errno to not be clobbered, especially for its functions. > It probably shouldn't do this for Standard C library functions like free(), > since this would be an extension and any use of the extension would give > unnecessarily unportanle code. POSIX feels itself like they own all Standard C functions now. See "Resolved state" text for upcoming standard there: "At line 30583 [XSH free DESCRIPTION], add a paragraph with CX shading: The free() function shall not modify errno if ptr is a null pointer or a pointer previously returned as if by malloc() and not yet deallocated. At line 30591 [APPLICATION USAGE], add a new paragraph: Because the free() function does not modify errno for valid pointers, it is safe to use it in cleanup code without corrupting earlier errors, ..." > OTOH, the libary can assume anything that it wants and > implements for itself, since it is the implementation so it can make > free() easy to use for itself, with any extensions that aren't incompatible > with Standard C. Since free() is allowed to clobber errno, it is also > allowed to do a null clobber as a compatible extension. Yes, it is safe for free() itself to save errno and still stay compliant with both current and upcoming POSIX and with Standard C. But any code which rely on that is compliant with upcoming POSIX only. Since people don't want mass changes in that area, this is some sort of compromise acceptable for me (in case free() itself will save/restore errno, of course). -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 19:42:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7B58B106564A; Tue, 5 Jun 2012 19:42:57 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FC8A8FC20; Tue, 5 Jun 2012 19:42:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55JgvuQ039754; Tue, 5 Jun 2012 19:42:57 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55Jgvbt039752; Tue, 5 Jun 2012 19:42:57 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201206051942.q55Jgvbt039752@svn.freebsd.org> From: Ed Schouten Date: Tue, 5 Jun 2012 19:42:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236629 - head/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 19:42:59 -0000 Author: ed Date: Tue Jun 5 19:42:57 2012 New Revision: 236629 URL: http://svn.freebsd.org/changeset/base/236629 Log: Fix a small typo. Fireware -> firmware. MFC after: 2 weeks Modified: head/include/fmtmsg.h Modified: head/include/fmtmsg.h ============================================================================== --- head/include/fmtmsg.h Tue Jun 5 18:58:05 2012 (r236628) +++ head/include/fmtmsg.h Tue Jun 5 19:42:57 2012 (r236629) @@ -32,7 +32,7 @@ /* Source of condition is... */ #define MM_HARD 0x0001 /* ...hardware. */ #define MM_SOFT 0x0002 /* ...software. */ -#define MM_FIRM 0x0004 /* ...fireware. */ +#define MM_FIRM 0x0004 /* ...firmware. */ /* Condition detected by... */ #define MM_APPL 0x0010 /* ...application. */ From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 19:58:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E76EB1065672; Tue, 5 Jun 2012 19:58:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D97C8FC08; Tue, 5 Jun 2012 19:58:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55JwxTO040698; Tue, 5 Jun 2012 19:58:59 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55JwxTN040695; Tue, 5 Jun 2012 19:58:59 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206051958.q55JwxTN040695@svn.freebsd.org> From: Marius Strobl Date: Tue, 5 Jun 2012 19:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236631 - in stable/9/sys: dev/iwn sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 19:59:00 -0000 Author: marius Date: Tue Jun 5 19:58:58 2012 New Revision: 236631 URL: http://svn.freebsd.org/changeset/base/236631 Log: MFC: r236486 Add nitems(), a macro for determining the number of elements in a statically-allocated array. Obtained from: OpenBSD (in principle) MFC: r236489 Modified: stable/9/sys/dev/iwn/if_iwn.c stable/9/sys/sys/param.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/9/sys/dev/iwn/if_iwn.c Tue Jun 5 19:51:37 2012 (r236630) +++ stable/9/sys/dev/iwn/if_iwn.c Tue Jun 5 19:58:58 2012 (r236631) @@ -2005,8 +2005,6 @@ iwn_setregdomain(struct ieee80211com *ic return 0; } -#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0])) - static void iwn_read_eeprom_enhinfo(struct iwn_softc *sc) { Modified: stable/9/sys/sys/param.h ============================================================================== --- stable/9/sys/sys/param.h Tue Jun 5 19:51:37 2012 (r236630) +++ stable/9/sys/sys/param.h Tue Jun 5 19:58:58 2012 (r236631) @@ -273,6 +273,7 @@ #ifndef howmany #define howmany(x, y) (((x)+((y)-1))/(y)) #endif +#define nitems(x) (sizeof((x)) / sizeof((x)[0])) #define rounddown(x, y) (((x)/(y))*(y)) #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */ #define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 19:59:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CDEFD106566B; Tue, 5 Jun 2012 19:59:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B97098FC08; Tue, 5 Jun 2012 19:59:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55Jx23M040736; Tue, 5 Jun 2012 19:59:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55Jx2jT040733; Tue, 5 Jun 2012 19:59:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206051959.q55Jx2jT040733@svn.freebsd.org> From: Marius Strobl Date: Tue, 5 Jun 2012 19:59:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236632 - in stable/8/sys: dev/iwn sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 19:59:02 -0000 Author: marius Date: Tue Jun 5 19:59:02 2012 New Revision: 236632 URL: http://svn.freebsd.org/changeset/base/236632 Log: MFC: r236486 Add nitems(), a macro for determining the number of elements in a statically-allocated array. Obtained from: OpenBSD (in principle) MFC: r236489 Modified: stable/8/sys/dev/iwn/if_iwn.c stable/8/sys/sys/param.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/8/sys/dev/iwn/if_iwn.c Tue Jun 5 19:58:58 2012 (r236631) +++ stable/8/sys/dev/iwn/if_iwn.c Tue Jun 5 19:59:02 2012 (r236632) @@ -2010,8 +2010,6 @@ iwn_setregdomain(struct ieee80211com *ic return 0; } -#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0])) - static void iwn_read_eeprom_enhinfo(struct iwn_softc *sc) { Modified: stable/8/sys/sys/param.h ============================================================================== --- stable/8/sys/sys/param.h Tue Jun 5 19:58:58 2012 (r236631) +++ stable/8/sys/sys/param.h Tue Jun 5 19:59:02 2012 (r236632) @@ -271,6 +271,7 @@ #ifndef howmany #define howmany(x, y) (((x)+((y)-1))/(y)) #endif +#define nitems(x) (sizeof((x)) / sizeof((x)[0])) #define rounddown(x, y) (((x)/(y))*(y)) #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */ #define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 19:59:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2B6B1065785; Tue, 5 Jun 2012 19:59:09 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DC4E8FC08; Tue, 5 Jun 2012 19:59:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55Jx9k4040782; Tue, 5 Jun 2012 19:59:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55Jx9wZ040780; Tue, 5 Jun 2012 19:59:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206051959.q55Jx9wZ040780@svn.freebsd.org> From: Marius Strobl Date: Tue, 5 Jun 2012 19:59:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236633 - stable/7/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 19:59:09 -0000 Author: marius Date: Tue Jun 5 19:59:09 2012 New Revision: 236633 URL: http://svn.freebsd.org/changeset/base/236633 Log: MFC: r236486 Add nitems(), a macro for determining the number of elements in a statically-allocated array. Obtained from: OpenBSD (in principle) Modified: stable/7/sys/sys/param.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sys/param.h ============================================================================== --- stable/7/sys/sys/param.h Tue Jun 5 19:59:02 2012 (r236632) +++ stable/7/sys/sys/param.h Tue Jun 5 19:59:09 2012 (r236633) @@ -249,6 +249,7 @@ #ifndef howmany #define howmany(x, y) (((x)+((y)-1))/(y)) #endif +#define nitems(x) (sizeof((x)) / sizeof((x)[0])) #define rounddown(x, y) (((x)/(y))*(y)) #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */ #define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 20:09:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A612B106564A; Tue, 5 Jun 2012 20:09:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 333AA8FC20; Tue, 5 Jun 2012 20:09:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55K90Ii041277; Tue, 5 Jun 2012 20:09:00 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55K908g041275; Tue, 5 Jun 2012 20:09:00 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201206052009.q55K908g041275@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 5 Jun 2012 20:08:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236634 - head/usr.sbin/pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 20:09:00 -0000 Author: glebius Date: Tue Jun 5 20:08:59 2012 New Revision: 236634 URL: http://svn.freebsd.org/changeset/base/236634 Log: Don't crash trying to load symbols from striped file. PR: bin/167361 Submitted by: Slawa Olhovchenkov Silence from: jkoshy Modified: head/usr.sbin/pmcstat/pmcstat_log.c Modified: head/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat_log.c Tue Jun 5 19:59:09 2012 (r236633) +++ head/usr.sbin/pmcstat/pmcstat_log.c Tue Jun 5 20:08:59 2012 (r236634) @@ -564,6 +564,8 @@ pmcstat_image_add_symbols(struct pmcstat } image->pi_symcount += newsyms; + if (image->pi_symcount == 0) + return; assert(newsyms <= nfuncsyms); From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 20:11:05 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7D2BF1065673; Tue, 5 Jun 2012 20:11:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 0813E8FC18; Tue, 5 Jun 2012 20:11:04 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q55KB1HC016442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 6 Jun 2012 06:11:02 +1000 Date: Wed, 6 Jun 2012 06:11:01 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov In-Reply-To: <20120605194102.GA21173@vniz.net> Message-ID: <20120606054555.U1456@besplex.bde.org> References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <20120605074741.GA1391@garage.freebsd.pl> <20120605130922.GE13306@vniz.net> <20120606043731.D1124@besplex.bde.org> <20120605194102.GA21173@vniz.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@FreeBSD.ORG, Pawel Jakub Dawidek , svn-src-all@FreeBSD.ORG, Bruce Evans , freebsd-arch@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 20:11:05 -0000 On Tue, 5 Jun 2012, Andrey Chernov wrote: > On Wed, Jun 06, 2012 at 04:57:29AM +1000, Bruce Evans wrote: >> POSIX may require errno to not be clobbered, especially for its functions. >> It probably shouldn't do this for Standard C library functions like free(), >> since this would be an extension and any use of the extension would give >> unnecessarily unportanle code. > > POSIX feels itself like they own all Standard C functions now. See Not really. They can extend anything they want... > "Resolved state" text for upcoming standard there: > > "At line 30583 [XSH free DESCRIPTION], add a paragraph with CX shading: > > The free() function shall not modify errno if ptr is a null pointer > or a pointer previously returned as if by malloc() and not yet > deallocated. ...but the have to mark it as an extension, as they do here. > At line 30591 [APPLICATION USAGE], add a new paragraph: > > Because the free() function does not modify errno for valid pointers, it > is safe to use it in cleanup code without corrupting earlier errors, ..." This is essentially unusable (so a bad idea). Instead of unconditionally saving and restoring errno around calls to free(), portable POSIX code can soon use a messy ifdef to avoid doing this in some cases, but still has to do it in other cases. The results is just bloat and complexity at the source level: #if _POSIX_VERSION < mumble int sverrno; #endif ... if (wantfree) #if _POSIX_VERSION < mumble { /* I made these braces condtional ... */ sverrno = errno; #endif free(p); #if _POSIX_VERSION < mumble errno = sverrno; } /* ... to maximise the ugliness */ #endif >> OTOH, the libary can assume anything that it wants and >> implements for itself, since it is the implementation so it can make >> free() easy to use for itself, with any extensions that aren't incompatible >> with Standard C. Since free() is allowed to clobber errno, it is also >> allowed to do a null clobber as a compatible extension. > > Yes, it is safe for free() itself to save errno and still stay compliant > with both current and upcoming POSIX and with Standard C. But any code > which rely on that is compliant with upcoming POSIX only. Since people > don't want mass changes in that area, this is some sort of compromise > acceptable for me (in case free() itself will save/restore errno, of > course). libc has lots of magic non-conforming code. A little more won't hurt. However, free() is currently not careful about errno. It begins with an optional utrace() call, and this can in theory fail with errno ENOMEM even if there are no bugs in malloc() (all other errors from utrace() indicate bugs in the caller, assuming that the list of errnos in its man page is complete). malloc.c makes a few other sys(lib?)calls and never saves errno. I don't know if the others are reachable from free(). Bruce From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 20:12:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E82BA1065674; Tue, 5 Jun 2012 20:12:55 +0000 (UTC) (envelope-from gavin.atkinson@ury.york.ac.uk) Received: from mail-gw10.york.ac.uk (mail-gw10.york.ac.uk [144.32.129.64]) by mx1.freebsd.org (Postfix) with ESMTP id A42BD8FC12; Tue, 5 Jun 2012 20:12:55 +0000 (UTC) Received: from ury.york.ac.uk ([144.32.108.81]:42710) by mail-gw10.york.ac.uk with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1Sc07Z-0008OK-Jl; Tue, 05 Jun 2012 21:12:53 +0100 Received: from gavin (helo=localhost) by ury.york.ac.uk with local-esmtp (Exim 4.77) (envelope-from ) id 1Sc07Z-0003xx-Dv; Tue, 05 Jun 2012 21:12:53 +0100 Date: Tue, 5 Jun 2012 21:12:53 +0100 (BST) From: Gavin Atkinson X-X-Sender: gavin@ury.york.ac.uk To: "David E. O'Brien" In-Reply-To: <201206042259.q54Mx7Ok073084@svn.freebsd.org> Message-ID: References: <201206042259.q54Mx7Ok073084@svn.freebsd.org> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r236593 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 20:12:56 -0000 On Mon, 4 Jun 2012, David E. O'Brien wrote: > Author: obrien > Date: Mon Jun 4 22:59:06 2012 > New Revision: 236593 > URL: http://svn.freebsd.org/changeset/base/236593 > > Log: > Add a man page for filemon(4) [r236592]. [...] > Added: head/share/man/man4/filemon.4 > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/share/man/man4/filemon.4 Mon Jun 4 22:59:06 2012 (r236593) > @@ -0,0 +1,166 @@ > +.\" Copyright (c) 2012 > +.\" David E. O'Brien . All rights reserved. > +.\" > +.\" Redistribution and use in source and binary forms, with or without > +.\" modification, are permitted provided that the following conditions > +.\" are met: > +.\" 1. Redistributions of source code must retain the above copyright > +.\" notice, this list of conditions and the following disclaimer. > +.\" 2. Redistributions in binary form must reproduce the above copyright > +.\" notice, this list of conditions and the following disclaimer in the > +.\" documentation and/or other materials provided with the distribution. > +.\" 3. All advertising materials mentioning features or use of this software > +.\" must display the following acknowledgement: > +.\" This product includes software developed by David E. O'Brien and > +.\" contributors. > +.\" 4. Neither the name of the author nor the names of its contributors > +.\" may be used to endorse or promote products derived from this software > +.\" without specific prior written permission. The man page has a four-clause license, but the code itself uses the two-clause license. Is there any chance that the man page license could lose the third and fourth clauses to match? Thanks, Gavin From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 20:22:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B054C1065678; Tue, 5 Jun 2012 20:22:38 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9704C8FC28; Tue, 5 Jun 2012 20:22:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55KMc8R041942; Tue, 5 Jun 2012 20:22:38 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55KMc3f041929; Tue, 5 Jun 2012 20:22:38 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201206052022.q55KMc3f041929@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 5 Jun 2012 20:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236635 - in vendor/NetBSD/atf: . dist dist/dist dist/dist/atf-c dist/dist/atf-c++ dist/dist/atf-c++/detail dist/dist/atf-c/detail dist/dist/atf-config dist/dist/atf-report dist/dist/at... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 20:22:38 -0000 Author: obrien Date: Tue Jun 5 20:22:37 2012 New Revision: 236635 URL: http://svn.freebsd.org/changeset/base/236635 Log: Import NetBSD's ATF as of 2011-04-05 16:3:06 UTC Submitted by: sjg@juniper.net Obtained from: Juniper Networks Added: vendor/NetBSD/atf/ vendor/NetBSD/atf/dist/ vendor/NetBSD/atf/dist/Makefile vendor/NetBSD/atf/dist/dist/ vendor/NetBSD/atf/dist/dist/AUTHORS vendor/NetBSD/atf/dist/dist/Atffile vendor/NetBSD/atf/dist/dist/COPYING vendor/NetBSD/atf/dist/dist/Kyuafile vendor/NetBSD/atf/dist/dist/NEWS vendor/NetBSD/atf/dist/dist/README vendor/NetBSD/atf/dist/dist/atf-c/ vendor/NetBSD/atf/dist/dist/atf-c++/ vendor/NetBSD/atf/dist/dist/atf-c++.hpp vendor/NetBSD/atf/dist/dist/atf-c++/Atffile vendor/NetBSD/atf/dist/dist/atf-c++/Kyuafile vendor/NetBSD/atf/dist/dist/atf-c++/atf-c++-api.3 vendor/NetBSD/atf/dist/dist/atf-c++/atf-c++.pc.in vendor/NetBSD/atf/dist/dist/atf-c++/atf_c++_test.cpp vendor/NetBSD/atf/dist/dist/atf-c++/build.cpp vendor/NetBSD/atf/dist/dist/atf-c++/build.hpp vendor/NetBSD/atf/dist/dist/atf-c++/build_test.cpp vendor/NetBSD/atf/dist/dist/atf-c++/check.cpp vendor/NetBSD/atf/dist/dist/atf-c++/check.hpp vendor/NetBSD/atf/dist/dist/atf-c++/check_test.cpp vendor/NetBSD/atf/dist/dist/atf-c++/config.cpp vendor/NetBSD/atf/dist/dist/atf-c++/config.hpp vendor/NetBSD/atf/dist/dist/atf-c++/config_test.cpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/ vendor/NetBSD/atf/dist/dist/atf-c++/detail/Atffile vendor/NetBSD/atf/dist/dist/atf-c++/detail/Kyuafile vendor/NetBSD/atf/dist/dist/atf-c++/detail/application.cpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/application.hpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/application_test.cpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/env.cpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/env.hpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/env_test.cpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/exceptions.cpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/exceptions.hpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/exceptions_test.cpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/expand.cpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/expand.hpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/expand_test.cpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/fs.cpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/fs.hpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/fs_test.cpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/parser.cpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/parser.hpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/parser_test.cpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/process.cpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/process.hpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/process_test.cpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/sanity.hpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/sanity_test.cpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/test_helpers.cpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/test_helpers.hpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/text.cpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/text.hpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/text_test.cpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/ui.cpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/ui.hpp vendor/NetBSD/atf/dist/dist/atf-c++/detail/ui_test.cpp vendor/NetBSD/atf/dist/dist/atf-c++/macros.hpp vendor/NetBSD/atf/dist/dist/atf-c++/macros_hpp_test.cpp vendor/NetBSD/atf/dist/dist/atf-c++/macros_test.cpp vendor/NetBSD/atf/dist/dist/atf-c++/pkg_config_test.sh vendor/NetBSD/atf/dist/dist/atf-c++/tests.cpp vendor/NetBSD/atf/dist/dist/atf-c++/tests.hpp vendor/NetBSD/atf/dist/dist/atf-c++/tests_test.cpp vendor/NetBSD/atf/dist/dist/atf-c++/utils.hpp vendor/NetBSD/atf/dist/dist/atf-c++/utils_test.cpp vendor/NetBSD/atf/dist/dist/atf-c.h vendor/NetBSD/atf/dist/dist/atf-c/Atffile vendor/NetBSD/atf/dist/dist/atf-c/Kyuafile vendor/NetBSD/atf/dist/dist/atf-c/atf-c-api.3 vendor/NetBSD/atf/dist/dist/atf-c/atf-c.pc.in vendor/NetBSD/atf/dist/dist/atf-c/atf_c_test.c vendor/NetBSD/atf/dist/dist/atf-c/build.c vendor/NetBSD/atf/dist/dist/atf-c/build.h vendor/NetBSD/atf/dist/dist/atf-c/build_test.c vendor/NetBSD/atf/dist/dist/atf-c/check.c vendor/NetBSD/atf/dist/dist/atf-c/check.h vendor/NetBSD/atf/dist/dist/atf-c/check_test.c vendor/NetBSD/atf/dist/dist/atf-c/config.c vendor/NetBSD/atf/dist/dist/atf-c/config.h vendor/NetBSD/atf/dist/dist/atf-c/config_test.c vendor/NetBSD/atf/dist/dist/atf-c/defs.h.in vendor/NetBSD/atf/dist/dist/atf-c/detail/ vendor/NetBSD/atf/dist/dist/atf-c/detail/Atffile vendor/NetBSD/atf/dist/dist/atf-c/detail/Kyuafile vendor/NetBSD/atf/dist/dist/atf-c/detail/dynstr.c vendor/NetBSD/atf/dist/dist/atf-c/detail/dynstr.h vendor/NetBSD/atf/dist/dist/atf-c/detail/dynstr_test.c vendor/NetBSD/atf/dist/dist/atf-c/detail/env.c vendor/NetBSD/atf/dist/dist/atf-c/detail/env.h vendor/NetBSD/atf/dist/dist/atf-c/detail/env_test.c vendor/NetBSD/atf/dist/dist/atf-c/detail/fs.c vendor/NetBSD/atf/dist/dist/atf-c/detail/fs.h vendor/NetBSD/atf/dist/dist/atf-c/detail/fs_test.c vendor/NetBSD/atf/dist/dist/atf-c/detail/list.c vendor/NetBSD/atf/dist/dist/atf-c/detail/list.h vendor/NetBSD/atf/dist/dist/atf-c/detail/list_test.c vendor/NetBSD/atf/dist/dist/atf-c/detail/map.c vendor/NetBSD/atf/dist/dist/atf-c/detail/map.h vendor/NetBSD/atf/dist/dist/atf-c/detail/map_test.c vendor/NetBSD/atf/dist/dist/atf-c/detail/process.c vendor/NetBSD/atf/dist/dist/atf-c/detail/process.h vendor/NetBSD/atf/dist/dist/atf-c/detail/process_helpers.c vendor/NetBSD/atf/dist/dist/atf-c/detail/process_test.c vendor/NetBSD/atf/dist/dist/atf-c/detail/sanity.c vendor/NetBSD/atf/dist/dist/atf-c/detail/sanity.h vendor/NetBSD/atf/dist/dist/atf-c/detail/sanity_test.c vendor/NetBSD/atf/dist/dist/atf-c/detail/test_helpers.c vendor/NetBSD/atf/dist/dist/atf-c/detail/test_helpers.h vendor/NetBSD/atf/dist/dist/atf-c/detail/test_helpers_test.c vendor/NetBSD/atf/dist/dist/atf-c/detail/text.c vendor/NetBSD/atf/dist/dist/atf-c/detail/text.h vendor/NetBSD/atf/dist/dist/atf-c/detail/text_test.c vendor/NetBSD/atf/dist/dist/atf-c/detail/tp_main.c vendor/NetBSD/atf/dist/dist/atf-c/detail/user.c vendor/NetBSD/atf/dist/dist/atf-c/detail/user.h vendor/NetBSD/atf/dist/dist/atf-c/detail/user_test.c vendor/NetBSD/atf/dist/dist/atf-c/error.c vendor/NetBSD/atf/dist/dist/atf-c/error.h vendor/NetBSD/atf/dist/dist/atf-c/error_fwd.h vendor/NetBSD/atf/dist/dist/atf-c/error_test.c vendor/NetBSD/atf/dist/dist/atf-c/h_build.h vendor/NetBSD/atf/dist/dist/atf-c/macros.h vendor/NetBSD/atf/dist/dist/atf-c/macros_h_test.c vendor/NetBSD/atf/dist/dist/atf-c/macros_test.c vendor/NetBSD/atf/dist/dist/atf-c/pkg_config_test.sh vendor/NetBSD/atf/dist/dist/atf-c/tc.c vendor/NetBSD/atf/dist/dist/atf-c/tc.h vendor/NetBSD/atf/dist/dist/atf-c/tc_test.c vendor/NetBSD/atf/dist/dist/atf-c/tp.c vendor/NetBSD/atf/dist/dist/atf-c/tp.h vendor/NetBSD/atf/dist/dist/atf-c/tp_test.c vendor/NetBSD/atf/dist/dist/atf-c/utils.c vendor/NetBSD/atf/dist/dist/atf-c/utils.h vendor/NetBSD/atf/dist/dist/atf-c/utils_test.c vendor/NetBSD/atf/dist/dist/atf-config/ vendor/NetBSD/atf/dist/dist/atf-config/Atffile vendor/NetBSD/atf/dist/dist/atf-config/Kyuafile vendor/NetBSD/atf/dist/dist/atf-config/atf-config.1 vendor/NetBSD/atf/dist/dist/atf-config/atf-config.cpp vendor/NetBSD/atf/dist/dist/atf-config/integration_test.sh vendor/NetBSD/atf/dist/dist/atf-report/ vendor/NetBSD/atf/dist/dist/atf-report/Atffile vendor/NetBSD/atf/dist/dist/atf-report/Kyuafile vendor/NetBSD/atf/dist/dist/atf-report/atf-report.1 vendor/NetBSD/atf/dist/dist/atf-report/atf-report.cpp vendor/NetBSD/atf/dist/dist/atf-report/fail_helper.cpp vendor/NetBSD/atf/dist/dist/atf-report/integration_test.sh vendor/NetBSD/atf/dist/dist/atf-report/misc_helpers.cpp vendor/NetBSD/atf/dist/dist/atf-report/pass_helper.cpp vendor/NetBSD/atf/dist/dist/atf-report/reader.cpp vendor/NetBSD/atf/dist/dist/atf-report/reader.hpp vendor/NetBSD/atf/dist/dist/atf-report/reader_test.cpp vendor/NetBSD/atf/dist/dist/atf-report/tests-results.css vendor/NetBSD/atf/dist/dist/atf-report/tests-results.dtd vendor/NetBSD/atf/dist/dist/atf-report/tests-results.xsl vendor/NetBSD/atf/dist/dist/atf-run/ vendor/NetBSD/atf/dist/dist/atf-run/Atffile vendor/NetBSD/atf/dist/dist/atf-run/Kyuafile vendor/NetBSD/atf/dist/dist/atf-run/atf-run.1 vendor/NetBSD/atf/dist/dist/atf-run/atf-run.cpp vendor/NetBSD/atf/dist/dist/atf-run/atffile.cpp vendor/NetBSD/atf/dist/dist/atf-run/atffile.hpp vendor/NetBSD/atf/dist/dist/atf-run/atffile_test.cpp vendor/NetBSD/atf/dist/dist/atf-run/bad_metadata_helper.c vendor/NetBSD/atf/dist/dist/atf-run/config.cpp vendor/NetBSD/atf/dist/dist/atf-run/config.hpp vendor/NetBSD/atf/dist/dist/atf-run/config_test.cpp vendor/NetBSD/atf/dist/dist/atf-run/expect_helpers.c vendor/NetBSD/atf/dist/dist/atf-run/fs.cpp vendor/NetBSD/atf/dist/dist/atf-run/fs.hpp vendor/NetBSD/atf/dist/dist/atf-run/fs_test.cpp vendor/NetBSD/atf/dist/dist/atf-run/integration_test.sh vendor/NetBSD/atf/dist/dist/atf-run/io.cpp vendor/NetBSD/atf/dist/dist/atf-run/io.hpp vendor/NetBSD/atf/dist/dist/atf-run/io_test.cpp vendor/NetBSD/atf/dist/dist/atf-run/misc_helpers.cpp vendor/NetBSD/atf/dist/dist/atf-run/pass_helper.cpp vendor/NetBSD/atf/dist/dist/atf-run/requirements.cpp vendor/NetBSD/atf/dist/dist/atf-run/requirements.hpp vendor/NetBSD/atf/dist/dist/atf-run/requirements_test.cpp vendor/NetBSD/atf/dist/dist/atf-run/sample/ vendor/NetBSD/atf/dist/dist/atf-run/sample/atf-run.hooks vendor/NetBSD/atf/dist/dist/atf-run/sample/common.conf vendor/NetBSD/atf/dist/dist/atf-run/several_tcs_helper.c vendor/NetBSD/atf/dist/dist/atf-run/share/ vendor/NetBSD/atf/dist/dist/atf-run/share/atf-run.hooks vendor/NetBSD/atf/dist/dist/atf-run/signals.cpp vendor/NetBSD/atf/dist/dist/atf-run/signals.hpp vendor/NetBSD/atf/dist/dist/atf-run/signals_test.cpp vendor/NetBSD/atf/dist/dist/atf-run/test-program.cpp vendor/NetBSD/atf/dist/dist/atf-run/test-program.hpp vendor/NetBSD/atf/dist/dist/atf-run/test_program_test.cpp vendor/NetBSD/atf/dist/dist/atf-run/timer.cpp vendor/NetBSD/atf/dist/dist/atf-run/timer.hpp vendor/NetBSD/atf/dist/dist/atf-run/user.cpp vendor/NetBSD/atf/dist/dist/atf-run/user.hpp vendor/NetBSD/atf/dist/dist/atf-run/user_test.cpp vendor/NetBSD/atf/dist/dist/atf-run/zero_tcs_helper.c vendor/NetBSD/atf/dist/dist/atf-sh/ vendor/NetBSD/atf/dist/dist/atf-sh/Atffile vendor/NetBSD/atf/dist/dist/atf-sh/Kyuafile vendor/NetBSD/atf/dist/dist/atf-sh/atf-check.1 vendor/NetBSD/atf/dist/dist/atf-sh/atf-check.cpp vendor/NetBSD/atf/dist/dist/atf-sh/atf-check_test.sh vendor/NetBSD/atf/dist/dist/atf-sh/atf-sh-api.3 vendor/NetBSD/atf/dist/dist/atf-sh/atf-sh.1 vendor/NetBSD/atf/dist/dist/atf-sh/atf-sh.cpp vendor/NetBSD/atf/dist/dist/atf-sh/atf_check_test.sh vendor/NetBSD/atf/dist/dist/atf-sh/config_test.sh vendor/NetBSD/atf/dist/dist/atf-sh/integration_test.sh vendor/NetBSD/atf/dist/dist/atf-sh/libatf-sh.subr vendor/NetBSD/atf/dist/dist/atf-sh/misc_helpers.sh vendor/NetBSD/atf/dist/dist/atf-sh/normalize_test.sh vendor/NetBSD/atf/dist/dist/atf-sh/tc_test.sh vendor/NetBSD/atf/dist/dist/atf-sh/tp_test.sh vendor/NetBSD/atf/dist/dist/atf-version/ vendor/NetBSD/atf/dist/dist/atf-version/atf-version.1 vendor/NetBSD/atf/dist/dist/atf-version/atf-version.cpp vendor/NetBSD/atf/dist/dist/atf-version/generate-revision.sh (contents, props changed) vendor/NetBSD/atf/dist/dist/doc/ vendor/NetBSD/atf/dist/dist/doc/atf-formats.5 vendor/NetBSD/atf/dist/dist/doc/atf-test-case.4 vendor/NetBSD/atf/dist/dist/doc/atf-test-program.1 vendor/NetBSD/atf/dist/dist/doc/atf.7.in vendor/NetBSD/atf/dist/dist/test-programs/ vendor/NetBSD/atf/dist/dist/test-programs/Atffile vendor/NetBSD/atf/dist/dist/test-programs/Kyuafile vendor/NetBSD/atf/dist/dist/test-programs/c_helpers.c vendor/NetBSD/atf/dist/dist/test-programs/common.sh vendor/NetBSD/atf/dist/dist/test-programs/config_test.sh vendor/NetBSD/atf/dist/dist/test-programs/cpp_helpers.cpp vendor/NetBSD/atf/dist/dist/test-programs/expect_test.sh vendor/NetBSD/atf/dist/dist/test-programs/fork_test.sh vendor/NetBSD/atf/dist/dist/test-programs/meta_data_test.sh vendor/NetBSD/atf/dist/dist/test-programs/result_test.sh vendor/NetBSD/atf/dist/dist/test-programs/sh_helpers.sh vendor/NetBSD/atf/dist/dist/test-programs/srcdir_test.sh vendor/NetBSD/atf/dist/etc/ vendor/NetBSD/atf/dist/etc/Makefile vendor/NetBSD/atf/dist/etc/atf/ vendor/NetBSD/atf/dist/etc/atf/Makefile vendor/NetBSD/atf/dist/etc/atf/NetBSD.conf vendor/NetBSD/atf/dist/etc/atf/common.conf vendor/NetBSD/atf/dist/lib/ vendor/NetBSD/atf/dist/lib/Makefile vendor/NetBSD/atf/dist/lib/libatf-c/ vendor/NetBSD/atf/dist/lib/libatf-c++/ vendor/NetBSD/atf/dist/lib/libatf-c++/Makefile vendor/NetBSD/atf/dist/lib/libatf-c/Makefile vendor/NetBSD/atf/dist/lib/libatf-c/bconfig.h vendor/NetBSD/atf/dist/libexec/ vendor/NetBSD/atf/dist/libexec/Makefile vendor/NetBSD/atf/dist/libexec/atf-check/ vendor/NetBSD/atf/dist/libexec/atf-check/Makefile vendor/NetBSD/atf/dist/prepare-import.sh (contents, props changed) vendor/NetBSD/atf/dist/share/ vendor/NetBSD/atf/dist/share/Makefile vendor/NetBSD/atf/dist/share/doc/ vendor/NetBSD/atf/dist/share/doc/Makefile vendor/NetBSD/atf/dist/share/doc/atf/ vendor/NetBSD/atf/dist/share/doc/atf/Makefile vendor/NetBSD/atf/dist/share/examples/ vendor/NetBSD/atf/dist/share/examples/Makefile vendor/NetBSD/atf/dist/share/examples/atf/ vendor/NetBSD/atf/dist/share/examples/atf/Makefile vendor/NetBSD/atf/dist/share/xml/ vendor/NetBSD/atf/dist/share/xml/Makefile vendor/NetBSD/atf/dist/share/xml/atf/ vendor/NetBSD/atf/dist/share/xml/atf/Makefile vendor/NetBSD/atf/dist/share/xsl/ vendor/NetBSD/atf/dist/share/xsl/Makefile vendor/NetBSD/atf/dist/share/xsl/atf/ vendor/NetBSD/atf/dist/share/xsl/atf/Makefile vendor/NetBSD/atf/dist/tests/ vendor/NetBSD/atf/dist/tests/Makefile vendor/NetBSD/atf/dist/tests/atf/ vendor/NetBSD/atf/dist/tests/atf/Makefile vendor/NetBSD/atf/dist/tests/atf/atf-c/ vendor/NetBSD/atf/dist/tests/atf/atf-c++/ vendor/NetBSD/atf/dist/tests/atf/atf-c++/Makefile vendor/NetBSD/atf/dist/tests/atf/atf-c++/detail/ vendor/NetBSD/atf/dist/tests/atf/atf-c++/detail/Makefile vendor/NetBSD/atf/dist/tests/atf/atf-c/Makefile vendor/NetBSD/atf/dist/tests/atf/atf-c/detail/ vendor/NetBSD/atf/dist/tests/atf/atf-c/detail/Makefile vendor/NetBSD/atf/dist/tests/atf/atf-config/ vendor/NetBSD/atf/dist/tests/atf/atf-config/Makefile vendor/NetBSD/atf/dist/tests/atf/atf-report/ vendor/NetBSD/atf/dist/tests/atf/atf-report/Makefile vendor/NetBSD/atf/dist/tests/atf/atf-run/ vendor/NetBSD/atf/dist/tests/atf/atf-run/Makefile vendor/NetBSD/atf/dist/tests/atf/atf-sh/ vendor/NetBSD/atf/dist/tests/atf/atf-sh/Makefile vendor/NetBSD/atf/dist/tests/atf/test-programs/ vendor/NetBSD/atf/dist/tests/atf/test-programs/Makefile vendor/NetBSD/atf/dist/usr.bin/ vendor/NetBSD/atf/dist/usr.bin/Makefile vendor/NetBSD/atf/dist/usr.bin/atf-config/ vendor/NetBSD/atf/dist/usr.bin/atf-config/Makefile vendor/NetBSD/atf/dist/usr.bin/atf-report/ vendor/NetBSD/atf/dist/usr.bin/atf-report/Makefile vendor/NetBSD/atf/dist/usr.bin/atf-run/ vendor/NetBSD/atf/dist/usr.bin/atf-run/Makefile vendor/NetBSD/atf/dist/usr.bin/atf-sh/ vendor/NetBSD/atf/dist/usr.bin/atf-sh/Makefile vendor/NetBSD/atf/dist/usr.bin/atf-version/ vendor/NetBSD/atf/dist/usr.bin/atf-version/Makefile vendor/NetBSD/atf/dist/usr.bin/atf-version/revision.h Added: vendor/NetBSD/atf/dist/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/atf/dist/Makefile Tue Jun 5 20:22:37 2012 (r236635) @@ -0,0 +1,5 @@ +# $NetBSD: Makefile,v 1.3 2010/10/20 09:20:09 jmmv Exp $ + +SUBDIR= etc lib .WAIT libexec share usr.bin tests + +.include Added: vendor/NetBSD/atf/dist/dist/AUTHORS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/atf/dist/dist/AUTHORS Tue Jun 5 20:22:37 2012 (r236635) @@ -0,0 +1,25 @@ +Authors and contributors Automated Testing Framework +=========================================================================== + + +* Julio Merino + + Main developer. He started the work on this project when he took part in + the Google Summer of Code 2007 program as a student. + +* Martin Husemann + + Mentored this project during its development as part of the Google Summer + of Code 2007 program. + +* Lukasz Strzygowski + + Participant of the Google Summer of Code 2008 program. Mentored by The + NetBSD Foundation, he worked on the atfify NetBSD-SoC project and, as a + side-effect, he contributed to the ATF source code. He developed the + initial version of the atf-check utility and started the addition of the + ATF_REQUIRE family of macros in the C interface. + + +=========================================================================== +vim: filetype=text:textwidth=75:expandtab:shiftwidth=2:softtabstop=2 Added: vendor/NetBSD/atf/dist/dist/Atffile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/atf/dist/dist/Atffile Tue Jun 5 20:22:37 2012 (r236635) @@ -0,0 +1,11 @@ +Content-Type: application/X-atf-atffile; version="1" + +prop: test-suite = atf + +tp: atf-c +tp: atf-c++ +tp: atf-sh +tp: test-programs +tp: atf-config +tp: atf-report +tp: atf-run Added: vendor/NetBSD/atf/dist/dist/COPYING ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/atf/dist/dist/COPYING Tue Jun 5 20:22:37 2012 (r236635) @@ -0,0 +1,70 @@ +Redistribution terms Automated Testing Framework +=========================================================================== + + +License +******* + +Copyright (c) 2007, 2008, 2009, 2010, 2011 The NetBSD Foundation, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + + +Relicensed code +*************** + +The following code snippets have been taken from other projects. Even +though they were not originally licensed under the terms above, the +original authors have agreed to relicense their work so that this project +can be distributed under a single license. This section is put here just to +clarify this fact. + +* configure.ac, Makefile.am: The original versions were derived from the + ones in the XML Catalog Manager project, version 2.2. + + Author: Julio Merino + +* atf-c/ui.c: The format_paragraph and format_text functions were + derived form the ones in the Monotone project, revision + 3a0982da308228d796df35f98d787c5cff2bb5b6. + + Author: Julio Merino + +* atf-c++/detail/io.hpp, atf-c++/detail/io.cpp, atf-c++/detail/io_test.cpp: + These files were derived from the file_handle, systembuf, pipe and pistream + classes and tests found in the Boost.Process library. + + Author: Julio Merino + +* admin/check-style.sh, admin/check-style-common.awk, + admin/check-style-cpp.awk, admin/check-style-shell.awk: These files, + except the first one, were first implemented in the Buildtool project. + They were later adapted to be part of Boost.Process and, during that + process, the shell script was created. + + Author: Julio Merino + + +=========================================================================== +vim: filetype=text:textwidth=75:expandtab:shiftwidth=2:softtabstop=2 Added: vendor/NetBSD/atf/dist/dist/Kyuafile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/atf/dist/dist/Kyuafile Tue Jun 5 20:22:37 2012 (r236635) @@ -0,0 +1,11 @@ +syntax("kyuafile", 1) + +test_suite("atf") + +include("atf-c/Kyuafile") +include("atf-c++/Kyuafile") +include("atf-sh/Kyuafile") +include("test-programs/Kyuafile") +include("atf-config/Kyuafile") +include("atf-report/Kyuafile") +include("atf-run/Kyuafile") Added: vendor/NetBSD/atf/dist/dist/NEWS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/atf/dist/dist/NEWS Tue Jun 5 20:22:37 2012 (r236635) @@ -0,0 +1,469 @@ +Major changes between releases Automated Testing Framework +=========================================================================== + + +Changes in version 0.13 +*********************** + +Experimental version released on March 31st, 2011. + +This is the first release after the creation of the Kyua project, a more +modular and reliable replacement for ATF. From now on, ATF will change to +accomodate the transition to this new codebase, but ATF will still continue +to see development in the short/medium term. Check out the project page at +http://code.google.com/p/kyua/ for more details. + +The changes in this release are: + +* Added support to run the tests with the Kyua runtime engine (kyua-cli), a + new package that aims to replace atf-run and atf-report. The ATF tests + can be run with the new system by issuing a 'make installcheck-kyua' from + the top-level directory of the project (assuming the 'kyua' binary is + available during the configuration stage of ATF). + +* atf-run and atf-report are now in maintenance mode (but *not* deprecated + yet!). Kyua already implements a new, much more reliable runtime engine + that provides similar features to these tools. That said, it is not + complete yet so all development efforts should go towards it. + +* If GDB is installed, atf-run dumps the stack trace of crashing test + programs in an attempt to aid debugging. Contributed by Antti Kantee. + +* Reverted default timeout change in previous release and reset its value + to 5 minutes. This was causing several issues, specially when running + the existing NetBSD test suite in qemu. + +* Fixed the 'match' output checker in atf-check to properly validate the + last line of a file even if it does not have a newline. + +* Added the ATF_REQUIRE_IN and ATF_REQUIRE_NOT_IN macros to atf-c++ to + check for the presence (or lack thereof) of an element in a collection. + +* PR bin/44176: Fixed a race condition in atf-run that would crash atf-run + when the cleanup of a test case triggered asynchronous modifications to + its work directory (e.g. killing a daemon process that cleans up a pid + file in the work directory). + +* PR bin/44301: Fixed the sample XSLT file to report bogus test programs + instead of just listing them as having 0 test cases. + + +Changes in version 0.12 +*********************** + +Experimental version released on November 7th, 2010. + +* Added the ATF_REQUIRE_THROW_RE to atf-c++, which is the same as + ATF_REQUIRE_THROW but allows checking for the validity of the exception's + error message by means of a regular expression. + +* Added the ATF_REQUIRE_MATCH to atf-c++, which allows checking for a + regular expression match in a string. + +* Changed the default timeout for test cases from 5 minutes to 30 seconds. + 30 seconds is long enough for virtually all tests to complete, and 5 + minutes is a way too long pause in a test suite where a single test case + stalls. + +* Deprecated the use.fs property. While this seemed like a good idea in + the first place to impose more control on what test cases can do, it + turns out to be bad. First, use.fs=false prevents bogus test cases + from dumping core so after-the-fact debugging is harder. Second, + supporting use.fs adds a lot of unnecessary complexity. atf-run will + now ignore any value provided to use.fs and will allow test cases to + freely access the file system if they wish to. + +* Added the atf_tc_get_config_var_as_{bool,long}{,_wd} functions to the atf-c + library. The 'text' module became private in 0.11 but was being used + externally to simplify the parsing of configuration variables. + +* Made atf-run recognize the 'unprivileged-user' configuration variable + and automatically drop root privileges when a test case sets + require.user=unprivileged. Note that this is, by no means, done for + security purposes; this is just for user convenience; tests should, in + general, not be blindly run as root in the first place. + + +Changes in version 0.11 +*********************** + +Experimental version released on October 20th, 2010. + +* The ATF_CHECK* macros in atf-c++ were renamed to ATF_REQUIRE* to match + their counterparts in atf-c. + +* Clearly separated the modules in atf-c that are supposed to be public + from those that are implementation details. The header files for the + internal modules are not installed any more. + +* Made the atf-check tool private. It is only required by atf-sh and being + public has the danger of causing confusion. Also, making it private + simplifies the public API of atf. + +* Changed atf-sh to enable per-command error checking (set -e) by default. + This catches many cases in which a test case is broken but it is not + reported as such because execution continues. + +* Fixed the XSTL and CSS stylesheets to support expected failures. + + +Changes in version 0.10 +*********************** + +Experimental version released on July 2nd, 2010. + +Miscellaneous features + +* Added expected failures support to test cases and atf-run. These + include, for example, expected clean exits, expected reception of fatal + signals, expected timeouts and expected errors in condition checks. + These statuses can be used to denote test cases that are known to fail + due to a bug in the code they are testing. atf-report reports these + tests separately but they do not count towards the failed test cases + amount. + +* Added the ATF_CHECK_ERRNO and ATF_REQUIRE_ERRNO to the C library to + allow easy checking of call failures that update errno. + +* Added the has.cleanup meta-data property to test caes that specifies + whether the test case has a cleanup routine or not; its value is + automatically set. This property is read by atf-run to know if it has to + run the cleanup routine; skipping this run for every test case + significantly speeds up the run time of test suites. + +* Reversed the order of the ATF_CHECK_THROW macro in the C++ binding to + take the expected exception as the first argument and the statement to + execute as the second argument. + +Changes in atf-check + +* Changed atf-check to support negating the status and output checks by + prefixing them with not- and added support to specify multiple checkers + for stdout and stderr, not only one. + +* Added the match output checker to atf-check to look for regular + expressions in the stdout and stderr of commands. + +* Modified the exit checks in atf-check to support checking for the + reception of signals. + +Code simplifications and cleanups + +* Removed usage messages from test programs to simplify the + implementation of every binding by a significant amount. They just now + refer the user to the appropriate manual page and do not attempt to wrap + lines on terminal boundaries. Test programs are not supposed to be run + by users directly so this minor interface regression is not important. + +* Removed the atf-format internal utility, which is unused after the + change documented above. + +* Removed the atf-cleanup internal utility. It has been unused since the + test case isolation was moved to atf-run in 0.8 + +* Splitted the Makefile.am into smaller files for easier maintenance and + dropped the use of M4. Only affects users building from the repository + sources. + +* Intermixed tests with the source files in the source tree to provide + them more visibility and easier access. The tests directory is gone from + the source tree and tests are now suffixed by _test, not prefixed by t_. + +* Simplifications to the atf-c library: removed the io, tcr and ui + modules as they had become unnecessary after all simplifications + introduced since the 0.8 release. + +* Removed the application/X-atf-tcr format introduced in 0.8 release. + Tests now print a much simplified format that is easy to parse and nicer + to read by end users. As a side effect, the default for test cases is + now to print their results to stdout unless otherwise stated by providing + the -r flag. + +* Removed XML distribution documents and replaced them with plain-text + documents. They provided little value and introduced a lot of complexity + to the build system. + +* Simplified the output of atf-version by not attempting to print a + revision number when building form a distfile. Makes the build system + easier to maintain. + + +Changes in version 0.9 +********************** + +Experimental version released on June 3rd, 2010. + +* Added atf-sh, an interpreter to process test programs written using + the shell API. This is not really a shell interpreter by itself though: + it is just a wrapper around the system shell that eases the loading of + the necessary ATF libraries. + +* Removed atf-compile in favour of atf-sh. + +* Added the use.fs metadata property to test case, which is used to + specify which test cases require file system access. This is to + highlight dependencies on external resources more clearly and to speed up + the execution of test suites by skipping the creation of many unnecessary + work directories. + +* Fixed test programs to get a sane default value for their source + directory. This means that it should not be necessary any more to pass + -s when running test programs that do not live in the current directory. + +* Defining test case headers became optional. This is trivial to achieve + in shell-based tests but a bit ugly in C and C++. In C, use the new + ATF_TC_WITHOUT_HEAD macro to define the test case, and in C++ use + ATF_TEST_CASE_WITHOUT_HEAD. + + +Changes in version 0.8 +********************** + +Experimental version released on May 7th, 2010. + +* Test programs no longer run several test cases in a row. The execution + of a test program now requires a test case name, and that single test + case is executed. To execute several test cases, use the atf-run utility + as usual. + +* Test programs no longer fork a subprocess to isolate the execution of + test cases. They run the test case code in-process, and a crash of the + test case will result in a crash of the test program. This is to ease + debugging of faulty test cases. + +* Test programs no longer isolate their test cases. This means that they + will not create temporary directories nor sanitize the environment any + more. Yes: running a test case that depends on system state by hand will + most likely yield different results depending on where (machine, + directory, user environment, etc.) it is run. Isolation has been moved + to atf-run. + +* Test programs no longer print a cryptic format (application/X-atf-tcs) + on a special file channel. They can now print whatever they want on the + screen. Because test programs can now only run one test case every time, + providing controlled output is not necessary any more. + +* Test programs no longer write their status into a special file + descriptor. Instead, they create a file with the results, which is later + parsed by atf-run. This changes the semantics of the -r flag. + +* atf-run has been adjusted to perform the test case isolation. As a + result, there is now a single canonical place that implements the + isolation of test caes. In previous releases, the three language + bindings (C, C++ and shell) had to be kept in sync with each other (read: + not a nice thing to do at all). As a side effect of this change, writing + bindings for other languages will be much, much easier from now on. + +* atf-run forks test programs on a test case basis, instead of on a test + program basis as it did before. This is to provide the test case + isolation that was before implemented by the test programs themselves. + +* Removed the atf-exec tool. This was used to implement test case + isolation in atf-sh, but it is now unnecessary. + +* It is now optional to define the descr meta-data property. It has been + proven to be mostly useless, because test cases often carry a descriptive + name of their own. + + +Changes in version 0.7 +********************** + +Experimental version released on December 22nd, 2009. + +* Added build-time checks to atf-c and atf-c++. A binding for atf-sh + will come later. + +* Migrated all build-time checks for header files to proper ATF tests. + This demonstrates the use of the new feature described above. + +* Added an internal API for child process management. + +* Converted all plain-text distribution documents to a Docbook canonical + version, and include pre-generated plain text and HTML copies in the + distribution file. + +* Simplified the contents of the Makefile.am by regenerating it from a + canonical Makefile.am.m4 source. As a side-effect, some dependency + specifications were fixed. + +* Migrated all checks from the check target to installcheck, as these + require ATF to be installed. + +* Fixed sign comparison mismatches triggered by the now-enabled + -Wsign-compare. + +* Fixed many memory and object leaks. + + +Changes in version 0.6 +********************** + +Experimental version released on January 18th, 2009. + +* Make atf-exec be able to kill its child process after a certain period + of time; this is controlled through the new -t option. + +* Change atf-sh to use atf-exec's -t option to control the test case's + timeouts, instead of doing it internally. Same behavior as before, but + noticeably faster. + +* atf-exec's -g option and atf-killpg are gone due to the previous + change. + +* Added the atf-check(1) tool, a program that executes a given command + and checks its exit code against a known value and allows the management + of stdout and stderr in multiple ways. This replaces the previous + atf_check function in the atf-sh library and exposes this functionality + to both atf-c and atf-c++. + +* Added the ATF_REQUIRE family of macros to the C interface. These help + in checking for fatal test conditions. The old ATF_CHECK macros now + perform non-fatal checks only. I.e. by using ATF_CHECK, the test case + can now continue its execution and the failures will not be reported + until the end of the whole run. + +* Extended the amount of ATF_CHECK_* C macros with new ones to provide + more features to the developer. These also have their corresponding + counterparts in the ATF_REQUIRE_* family. The new macros (listing the + suffixes only) are: _EQ (replaces _EQUAL), _EQ_MSG, _STREQ and + _STREQ_MSG. + + +Changes in version 0.5 +********************** + +Experimental version released on May 1st, 2008. + +* Clauses 3 and 4 of the BSD license used by the project were dropped. + All the code is now under a 2-clause BSD license compatible with the GNU + General Public License (GPL). + +* Added a C-only binding so that binary test programs do not need to be + tied to C++ at all. This binding is now known as the atf-c library. + +* Renamed the C++ binding to atf-c++ for consistency with the new atf-c. + +* Renamed the POSIX shell binding to atf-sh for consistency with the new + atf-c and atf-c++. + +* Added a -w flag to test programs through which it is possible to + specify the work directory to be used. This was possible in prior + releases by defining the workdir configuration variable (-v workdir=...), + but was a conceptually incorrect mechanism. + +* Test programs now preserve the execution order of test cases when they + are given in the command line. Even those mentioned more than once are + executed multiple times to comply with the user's requests. + + +Changes in version 0.4 +********************** + +Experimental version released on February 4th, 2008. + +* Added two new manual pages, atf-c++-api and atf-sh-api, describing the + C++ and POSIX shell interfaces used to write test programs. + +* Added a pkg-config file, useful to get the flags to build against the + C++ library or to easily detect the presence of ATF. + +* Added a way for test cases to require a specific architecture and/or + machine type through the new 'require.arch' and 'require.machine' + meta-data properties, respectively. + +* Added the 'timeout' property to test cases, useful to set an + upper-bound limit for the test's run time and thus prevent global test + program stalls due to the test case's misbehavior. + +* Added the atf-exec(1) internal utility, used to execute a command + after changing the process group it belongs to. + +* Added the atf-killpg(1) internal utility, used to kill process groups. + +* Multiple portability fixes. Of special interest, full support for + SunOS (Solaris Express Developer Edition 2007/09) using the Sun Studio 12 + C++ compiler. + +* Fixed a serious bug that prevented atf-run(1) from working at all + under Fedora 8 x86_64. Due to the nature of the bug, other platforms + were likely affected too. + + +Changes in version 0.3 +********************** + +Experimental version released on November 11th, 2007. + +* Added XML output support to atf-report. This is accompanied by a DTD + for the format's structure and sample XSLT/CSS files to post-process this + output and convert it to a plain HTML report. + +* Changed atf-run to add system information to the report it generates. + This is currently used by atf-report's XML output only, and is later + printed in the HTML reports in a nice and useful summary table. The user + and system administrator are allowed to tune this feature by means of + hooks. + +* Removed the test cases' 'isolated' property. This was intended to + avoid touching the file system at all when running the related test case, + but this has not been true for a long while: some control files are + unconditionally required for several purposes, and we cannot easily get + rid of them. This way we remove several critical and delicate pieces of + code. + +* Improved atf-report's CSV output format to include information about + test programs too. + +* Fixed the tests that used atf-compile to not require this tool as a + helper. Avoids systems without build-time utilities to skip many tests + that could otherwise be run. (E.g. NetBSD without the comp.tgz set + installed.) + +* Many general cleanups: Fixed many pieces of code marked as ugly and/or + incomplete. + + +Changes in version 0.2 +********************** + +Experimental version released on September 20th, 2007. + +* Test cases now get a known umask on entry. + +* atf-run now detects many unexpected failures caused by test programs and + reports them as bogus tests. atf-report is able to handle these new + errors and nicely reports them to the user. + +* All the data formats read and written by the tools have been + documented and cleaned up. These include those grammars that define how + the different components communicate with each other as well as the + format of files written by the developers and users: the Atffiles and the + configuration files. + +* Added the atf-version tool, a utility that displays information about + the currently installed version of ATF. + +* Test cases can now define an optional cleanup routine to undo their + actions regardless of their exit status. + +* atf-report now summarizes the list of failed (bogus) test programs + when using the ticker output format. + +* Test programs now capture some termination signals and clean up any + temporary files before exiting the program. + +* Multiple bug fixes and improvements all around. + + +Changes in version 0.1 +********************** + +Experimental version released on August 20th, 2007. + +* First public version. This was released coinciding with the end of the + Google Summer of Code 2007 program. + + +=========================================================================== +vim: filetype=text:textwidth=75:expandtab:shiftwidth=2:softtabstop=2 Added: vendor/NetBSD/atf/dist/dist/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/atf/dist/dist/README Tue Jun 5 20:22:37 2012 (r236635) @@ -0,0 +1,40 @@ +Introductory information Automated Testing Framework +=========================================================================== + + +Introduction +************ + +The Automated Testing Framework (ATF) is a collection of libraries and +utilities designed to ease unattended application testing in the hands of +developers and end users of a specific piece of software. + +As regards developers, ATF provides the necessary means to easily create +test suites composed of multiple test programs, which in turn are a +collection of test cases. It also attempts to simplify the debugging of +problems when these test cases detect an error by providing as much +information as possible about the failure. + +As regards users, it simplifies the process of running the test suites and, +in special, encourages end users to run them often: they do not need to +have source trees around nor any other development tools installed to be +able to certify that a given piece of software works on their machine as +advertised. + + +Other documents +*************** + +* AUTHORS: List of authors and contributors for this project. + +* COPYING: License information. + +* INSTALL: Compilation and installation instructions. These is not the + standard document shipped with many packages, so be sure to read it for + things that are specific to ATF's build. + +* NEWS: List of major changes between formal, published releases. + + +=========================================================================== +vim: filetype=text:textwidth=75:expandtab:shiftwidth=2:softtabstop=2 Added: vendor/NetBSD/atf/dist/dist/atf-c++.hpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/atf/dist/dist/atf-c++.hpp Tue Jun 5 20:22:37 2012 (r236635) @@ -0,0 +1,35 @@ +// +// Automated Testing Framework (atf) +// +// Copyright (c) 2007, 2008 The NetBSD Foundation, Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND +// CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +// IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// + +#if !defined(_ATF_CXX_HPP_) +#define _ATF_CXX_HPP_ + +#include + +#endif // !defined(_ATF_CXX_HPP_) Added: vendor/NetBSD/atf/dist/dist/atf-c++/Atffile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/atf/dist/dist/atf-c++/Atffile Tue Jun 5 20:22:37 2012 (r236635) @@ -0,0 +1,14 @@ +Content-Type: application/X-atf-atffile; version="1" + +prop: test-suite = atf + +tp: detail + +tp: atf_c++_test +tp: build_test +tp: check_test +tp: config_test +tp: macros_test +tp: pkg_config_test +tp: tests_test +tp: utils_test Added: vendor/NetBSD/atf/dist/dist/atf-c++/Kyuafile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/atf/dist/dist/atf-c++/Kyuafile Tue Jun 5 20:22:37 2012 (r236635) @@ -0,0 +1,14 @@ +syntax("kyuafile", 1) + +test_suite("atf") + +atf_test_program{name="atf_c++_test"} +atf_test_program{name="build_test"} +atf_test_program{name="check_test"} +atf_test_program{name="config_test"} +atf_test_program{name="macros_test"} +atf_test_program{name="pkg_config_test"} +atf_test_program{name="tests_test"} +atf_test_program{name="utils_test"} + +include("detail/Kyuafile") Added: vendor/NetBSD/atf/dist/dist/atf-c++/atf-c++-api.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/atf/dist/dist/atf-c++/atf-c++-api.3 Tue Jun 5 20:22:37 2012 (r236635) @@ -0,0 +1,404 @@ +.\" +.\" Automated Testing Framework (atf) +.\" +.\" Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND +.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY +.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd December 10, 2010 +.Dt ATF-C++-API 3 +.Os +.Sh NAME +.Nm ATF_ADD_TEST_CASE , +.Nm ATF_CHECK_ERRNO , +.Nm ATF_FAIL , +.Nm ATF_INIT_TEST_CASES , +.Nm ATF_PASS , +.Nm ATF_REQUIRE , +.Nm ATF_REQUIRE_EQ , +.Nm ATF_REQUIRE_ERRNO , +.Nm ATF_REQUIRE_IN , +.Nm ATF_REQUIRE_MATCH , +.Nm ATF_REQUIRE_NOT_IN , +.Nm ATF_REQUIRE_THROW , +.Nm ATF_REQUIRE_THROW_RE , +.Nm ATF_SKIP , +.Nm ATF_TEST_CASE , +.Nm ATF_TEST_CASE_BODY , +.Nm ATF_TEST_CASE_CLEANUP , +.Nm ATF_TEST_CASE_HEAD , +.Nm ATF_TEST_CASE_WITH_CLEANUP , +.Nm ATF_TEST_CASE_WITHOUT_HEAD , +.Nd C++ API to write ATF-based test programs +.Sh SYNOPSIS +.In atf-c++.hpp +.Fn ATF_ADD_TEST_CASE "tcs" "name" +.Fn ATF_CHECK_ERRNO "exp_errno" "bool_expression" +.Fn ATF_FAIL "reason" +.Fn ATF_INIT_TEST_CASES "tcs" +.Fn ATF_PASS +.Fn ATF_REQUIRE "expression" +.Fn ATF_REQUIRE_EQ "expression_1" "expression_2" +.Fn ATF_REQUIRE_ERRNO "exp_errno" "bool_expression" +.Fn ATF_REQUIRE_IN "element" "collection" +.Fn ATF_REQUIRE_MATCH "regexp" "string_expression" +.Fn ATF_REQUIRE_NOT_IN "element" "collection" +.Fn ATF_REQUIRE_THROW "expected_exception" "statement" +.Fn ATF_REQUIRE_THROW_RE "expected_exception" "regexp" "statement" +.Fn ATF_SKIP "reason" +.Fn ATF_TEST_CASE "name" +.Fn ATF_TEST_CASE_BODY "name" +.Fn ATF_TEST_CASE_CLEANUP "name" +.Fn ATF_TEST_CASE_HEAD "name" +.Fn ATF_TEST_CASE_WITH_CLEANUP "name" +.Fn ATF_TEST_CASE_WITHOUT_HEAD "name" +.Sh DESCRIPTION +ATF provides a mostly-macro-based programming interface to implement test +programs in C or C++. +This interface is backed by a C++ implementation, but this fact is +hidden from the developer as much as possible through the use of +macros to simplify programming. +However, the use of C++ is not hidden everywhere and while you can +implement test cases without knowing anything at all about the object model +underneath the provided calls, you might need some minimum notions of the +language in very specific circumstances. +.Pp +C++-based test programs always follow this template: +.Bd -literal -offset indent +extern "C" { +.Ns ... C-specific includes go here ... +} + +.Ns ... C++-specific includes go here ... + +#include + +ATF_TEST_CASE(tc1); +ATF_TEST_CASE_HEAD(tc1) +{ + ... first test case's header ... +} +ATF_TEST_CASE_BODY(tc1) +{ + ... first test case's body ... +} + +ATF_TEST_CASE_WITH_CLEANUP(tc2); +ATF_TEST_CASE_HEAD(tc2) +{ + ... second test case's header ... +} +ATF_TEST_CASE_BODY(tc2) +{ + ... second test case's body ... +} +ATF_TEST_CASE_CLEANUP(tc2) +{ + ... second test case's cleanup ... +} + +ATF_TEST_CASE(tc3); +ATF_TEST_CASE_BODY(tc3) +{ + ... third test case's body ... +} + +.Ns ... additional test cases ... + +ATF_INIT_TEST_CASES(tcs) +{ + ATF_ADD_TEST_CASE(tcs, tc1); + ATF_ADD_TEST_CASE(tcs, tc2); + ATF_ADD_TEST_CASE(tcs, tc3); + ... add additional test cases ... +} +.Ed +.Ss Definition of test cases +Test cases have an identifier and are composed of three different parts: +the header, the body and an optional cleanup routine, all of which are +described in +.Xr atf-test-case 4 . +To define test cases, one can use the +.Fn ATF_TEST_CASE , +.Fn ATF_TEST_CASE_WITH_CLEANUP +or the +.Fn ATF_TEST_CASE_WITHOUT_HEAD +macros, which take a single parameter specifiying the test case's +name. +.Fn ATF_TEST_CASE , +requires to define a head and a body for the test case, +.Fn ATF_TEST_CASE_WITH_CLEANUP +requires to define a head, a body and a cleanup for the test case and +.Fn ATF_TEST_CASE_WITHOUT_HEAD +requires only a body for the test case. +It is important to note that these +.Em do not +set the test case up for execution when the program is run. +In order to do so, a later registration is needed through the +.Fn ATF_ADD_TEST_CASE +macro detailed in +.Sx Program initialization . +.Pp +Later on, one must define the three parts of the body by means of three +functions. +Their headers are given by the +.Fn ATF_TEST_CASE_HEAD , +.Fn ATF_TEST_CASE_BODY +and +.Fn ATF_TEST_CASE_CLEANUP +macros, all of which take the test case's name. +Following each of these, a block of code is expected, surrounded by the +opening and closing brackets. +.Ss Program initialization +The library provides a way to easily define the test program's +.Fn main +function. +You should never define one on your own, but rely on the +library to do it for you. +This is done by using the +.Fn ATF_INIT_TEST_CASES +macro, which is passed the name of the list that will hold the test cases. +This name can be whatever you want as long as it is a valid variable value. +.Pp +After the macro, you are supposed to provide the body of a function, which +should only use the +.Fn ATF_ADD_TEST_CASE +macro to register the test cases the test program will execute. +The first parameter of this macro matches the name you provided in the +former call. +.Ss Header definitions +The test case's header can define the meta-data by using the +.Fn set +method, which takes two parameters: the first one specifies the +meta-data variable to be set and the second one specifies its value. +Both of them are strings. +.Ss Configuration variables +The test case has read-only access to the current configuration variables +by means of the +.Ft bool +.Fn has_config_var +and the +.Ft std::string +.Fn get_config_var +methods, which can be called in any of the three parts of a test case. +.Ss Access to the source directory +It is possible to get the path to the test case's source directory from any +of its three components by querying the +.Sq srcdir +configuration variable. +.Ss Requiring programs +Aside from the +.Va require.progs +meta-data variable available in the header only, one can also check for +additional programs in the test case's body by using the +.Fn require_prog +function, which takes the base name or full path of a single binary. +Relative paths are forbidden. +If it is not found, the test case will be automatically skipped. +.Ss Test case finalization +The test case finalizes either when the body reaches its end, at which +point the test is assumed to have +.Em passed , +or at any explicit call to +.Fn ATF_PASS , +.Fn ATF_FAIL +or +.Fn ATF_SKIP . +These three macros terminate the execution of the test case immediately. +The cleanup routine will be processed afterwards in a completely automated +way, regardless of the test case's termination reason. +.Pp +.Fn ATF_PASS +does not take any parameters. +.Fn ATF_FAIL +and +.Fn ATF_SKIP +take a single string that describes why the test case failed or +was skipped, respectively. +It is very important to provide a clear error message in both cases so that +the user can quickly know why the test did not pass. +.Ss Expectations +Everything explained in the previous section changes when the test case +expectations are redefined by the programmer. +.Pp +Each test case has an internal state called +.Sq expect +that describes what the test case expectations are at any point in time. +The value of this property can change during execution by any of: +.Bl -tag -width indent +.It Fn expect_death "reason" +Expects the test case to exit prematurely regardless of the nature of the +exit. +.It Fn expect_exit "exitcode" "reason" +Expects the test case to exit cleanly. +If +.Va exitcode +is not +.Sq -1 , +.Xr atf-run 1 +will validate that the exit code of the test case matches the one provided +in this call. +Otherwise, the exact value will be ignored. +.It Fn expect_fail "reason" +Any failure (be it fatal or non-fatal) raised in this mode is recorded. +However, such failures do not report the test case as failed; instead, the +test case finalizes cleanly and is reported as +.Sq expected failure ; +this report includes the provided +.Fa reason +as part of it. +If no error is raised while running in this mode, then the test case is +reported as +.Sq failed . *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 20:27:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B27EB10656B6; Tue, 5 Jun 2012 20:27:41 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CD5B8FC14; Tue, 5 Jun 2012 20:27:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55KRf3x042197; Tue, 5 Jun 2012 20:27:41 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55KRfJa042195; Tue, 5 Jun 2012 20:27:41 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201206052027.q55KRfJa042195@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 5 Jun 2012 20:27:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236636 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 20:27:41 -0000 Author: trasz Date: Tue Jun 5 20:27:41 2012 New Revision: 236636 URL: http://svn.freebsd.org/changeset/base/236636 Log: MFC r235781: Fix enforcement of file size limit with O_APPEND on ZFS. vn_rlimit_fsize takes uio->uio_offset and uio->uio_resid into account when determining whether given write would exceed RLIMIT_FSIZE. When APPEND flag is specified, ZFS updates uio->uio_offset to point to the end of file. But this happens after a call to vn_rlimit_fsize, so vn_rlimit_fsize check can be rendered ineffective by thread that opens some file with O_APPEND and lseeks below RLIMIT_FSIZE before calling write. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Jun 5 20:22:37 2012 (r236635) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Jun 5 20:27:41 2012 (r236636) @@ -839,6 +839,12 @@ zfs_write(vnode_t *vp, uio_t *uio, int i rl = zfs_range_lock(zp, woff, n, RL_WRITER); } + if (vn_rlimit_fsize(vp, uio, uio->uio_td)) { + zfs_range_unlock(rl); + ZFS_EXIT(zfsvfs); + return (EFBIG); + } + if (woff >= limit) { zfs_range_unlock(rl); ZFS_EXIT(zfsvfs); @@ -5697,9 +5703,6 @@ zfs_freebsd_write(ap) } */ *ap; { - if (vn_rlimit_fsize(ap->a_vp, ap->a_uio, ap->a_uio->uio_td)) - return (EFBIG); - return (zfs_write(ap->a_vp, ap->a_uio, ioflags(ap->a_ioflag), ap->a_cred, NULL)); } From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 20:32:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F6771065674; Tue, 5 Jun 2012 20:32:39 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31D508FC21; Tue, 5 Jun 2012 20:32:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55KWdJ3042472; Tue, 5 Jun 2012 20:32:39 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55KWcoL042470; Tue, 5 Jun 2012 20:32:38 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201206052032.q55KWcoL042470@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 5 Jun 2012 20:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236637 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 20:32:39 -0000 Author: obrien Date: Tue Jun 5 20:32:38 2012 New Revision: 236637 URL: http://svn.freebsd.org/changeset/base/236637 Log: mdoc police. Submitted by: ru Much thanks to: ru Modified: head/share/man/man4/filemon.4 Modified: head/share/man/man4/filemon.4 ============================================================================== --- head/share/man/man4/filemon.4 Tue Jun 5 20:27:41 2012 (r236636) +++ head/share/man/man4/filemon.4 Tue Jun 5 20:32:38 2012 (r236637) @@ -50,64 +50,70 @@ responds to two calls. .Pp System calls are denoted using the following single letters: +.Pp .Bl -tag -width indent -compact -.It Dq Li C +.It Ql C .Xr chdir 2 -.It Dq Li D +.It Ql D .Xr unlink 2 -.It Dq Li E +.It Ql E .Xr exec 2 -.It Dq Li F +.It Ql F .Xr fork 2 , .Xr vfork 2 -.It Dq Li L +.It Ql L .Xr link 2 , .Xr linkat 2 , .Xr symlink 2 , .Xr symlinkat 2 -.It Dq Li M +.It Ql M .Xr rename 2 -.It Dq Li R +.It Ql R .Xr open 2 for read -.It Dq Li S +.It Ql S .Xr stat 2 -.It Dq Li W +.It Ql W .Xr open 2 for write -.It Dq Li X +.It Ql X .Xr _exit 2 .El .Pp Note that -.Dq R +.Ql R following -.Dq W +.Ql W records can represent a single .Xr open 2 for R/W, or two seperate .Xr open 2 calls, one for -R +.Ql R and one for -W. +.Ql W . .Sh IOCTLS User mode programs communicate with the -.Nm filemon -driver through a -number of ioctls which are described below. +.Nm +driver through a number of ioctls which are described below. Each takes a single argument. -.Bl -tag -width FILEMON_SET_PID +.Bl -tag -width ".Dv FILEMON_SET_PID" .It Dv FILEMON_SET_FD Write the internal tracing buffer to the supplied open file descriptor. .It Dv FILEMON_SET_PID Child process ID to trace. .El .Sh RETURN VALUES -The ioctl returns zero on success and non-zero on failure. +.\" .Rv -std ioctl +The +.Fn ioctl +function returns the value 0 if successful; +otherwise the value \-1 is returned and the global variable +.Va errno +is set to indicate the error. .Sh FILES -.Bl -tag -width /dev/zero +.Bl -tag -width ".Pa /dev/filemon" .It Pa /dev/filemon .El .Sh EXAMPLES @@ -127,7 +133,7 @@ open_filemon(void) int fm_fd, fm_log; if ((fm_fd = open("/dev/filemon", O_RDWR)) == -1) - err(1, "open(\"/dev/filemon\", O_RDWR)"); + err(1, "open(\e"/dev/filemon\e", O_RDWR)"); if ((fm_log = open("filemon.out", O_CREAT | O_WRONLY | O_TRUNC, DEFFILEMODE)) == -1) err(1, "open(filemon.out)"); @@ -156,7 +162,9 @@ Creates a file named .Pa filemon.out and configures the .Nm -device to write the filemon buffer contents to it. +device to write the +.Nm +buffer contents to it. .Sh SEE ALSO .Xr dtrace 1 , .Xr ktrace 1 , From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 20:34:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0EB22106573F; Tue, 5 Jun 2012 20:34:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D50578FC16; Tue, 5 Jun 2012 20:34:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55KYuqj042682; Tue, 5 Jun 2012 20:34:56 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55KYu1G042679; Tue, 5 Jun 2012 20:34:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206052034.q55KYu1G042679@svn.freebsd.org> From: Marius Strobl Date: Tue, 5 Jun 2012 20:34:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236638 - in stable/8/sys/dev: bge sym X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 20:34:57 -0000 Author: marius Date: Tue Jun 5 20:34:56 2012 New Revision: 236638 URL: http://svn.freebsd.org/changeset/base/236638 Log: MFC: r236488 Take advantage of nitems(). Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/sym/sym_hipd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Tue Jun 5 20:32:38 2012 (r236637) +++ stable/8/sys/dev/bge/if_bge.c Tue Jun 5 20:34:56 2012 (r236638) @@ -2791,9 +2791,8 @@ bge_mbox_reorder(struct bge_softc *sc) }; devclass_t pci, pcib; device_t bus, dev; - int count, i; + int i; - count = sizeof(mbox_reorder_lists) / sizeof(mbox_reorder_lists[0]); pci = devclass_find("pci"); pcib = devclass_find("pcib"); dev = sc->bge_dev; @@ -2806,7 +2805,7 @@ bge_mbox_reorder(struct bge_softc *sc) device_get_name(bus), device_get_unit(bus)); if (device_get_devclass(dev) != pcib) break; - for (i = 0; i < count; i++) { + for (i = 0; i < nitems(mbox_reorder_lists); i++) { device_printf(sc->bge_dev, "probing dev : %s%d, vendor : 0x%04x " "device : 0x%04x\n", Modified: stable/8/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/8/sys/dev/sym/sym_hipd.c Tue Jun 5 20:32:38 2012 (r236637) +++ stable/8/sys/dev/sym/sym_hipd.c Tue Jun 5 20:34:56 2012 (r236638) @@ -8411,9 +8411,6 @@ static const struct sym_pci_chip sym_pci FE_RAM|FE_IO256|FE_LEDC} }; -#define sym_pci_num_devs \ - (sizeof(sym_pci_dev_table) / sizeof(sym_pci_dev_table[0])) - /* * Look up the chip table. * @@ -8434,7 +8431,7 @@ sym_find_pci_chip(device_t dev) device_id = pci_get_device(dev); revision = pci_get_revid(dev); - for (i = 0; i < sym_pci_num_devs; i++) { + for (i = 0; i < nitems(sym_pci_dev_table); i++) { chip = &sym_pci_dev_table[i]; if (device_id != chip->device_id) continue; From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 20:39:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A67D106564A; Tue, 5 Jun 2012 20:39:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65A0B8FC15; Tue, 5 Jun 2012 20:39:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55KdDDJ042896; Tue, 5 Jun 2012 20:39:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55KdD8j042894; Tue, 5 Jun 2012 20:39:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206052039.q55KdD8j042894@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jun 2012 20:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236639 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 20:39:13 -0000 Author: mav Date: Tue Jun 5 20:39:12 2012 New Revision: 236639 URL: http://svn.freebsd.org/changeset/base/236639 Log: Use default error handler when flushing disk caches. Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Tue Jun 5 20:34:56 2012 (r236638) +++ head/sys/cam/ata/ata_da.c Tue Jun 5 20:39:12 2012 (r236639) @@ -490,7 +490,7 @@ 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, /*error_routine*/NULL, /*cam_flags*/0, + 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) From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 20:48:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5B2141065782; Tue, 5 Jun 2012 20:48:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 478258FC14; Tue, 5 Jun 2012 20:48:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55KmEvw043333; Tue, 5 Jun 2012 20:48:14 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55KmEHk043331; Tue, 5 Jun 2012 20:48:14 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201206052048.q55KmEHk043331@svn.freebsd.org> From: Michael Tuexen Date: Tue, 5 Jun 2012 20:48:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236640 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 20:48:14 -0000 Author: tuexen Date: Tue Jun 5 20:48:13 2012 New Revision: 236640 URL: http://svn.freebsd.org/changeset/base/236640 Log: The cmsg_len field includes the cmsg header. So use CMSG_LEN(). MFC after: 3 days Modified: head/share/man/man4/ip.4 Modified: head/share/man/man4/ip.4 ============================================================================== --- head/share/man/man4/ip.4 Tue Jun 5 20:39:12 2012 (r236639) +++ head/share/man/man4/ip.4 Tue Jun 5 20:48:13 2012 (r236640) @@ -165,7 +165,7 @@ The .Vt cmsghdr fields have the following values: .Bd -literal -cmsg_len = sizeof(struct in_addr) +cmsg_len = CMSG_LEN(sizeof(struct in_addr)) cmsg_level = IPPROTO_IP cmsg_type = IP_RECVDSTADDR .Ed @@ -184,7 +184,7 @@ structure followed by the address. The cmsghdr fields should have the following values: .Bd -literal -cmsg_len = sizeof(struct in_addr) +cmsg_len = CMSG_LEN(sizeof(struct in_addr)) cmsg_level = IPPROTO_IP cmsg_type = IP_SENDSRCADDR .Ed @@ -279,7 +279,7 @@ that contains a cmsghdr structure follow .Tn TTL . The cmsghdr fields have the following values: .Bd -literal -cmsg_len = sizeof(u_char) +cmsg_len = CMSG_LEN(sizeof(u_char)) cmsg_level = IPPROTO_IP cmsg_type = IP_RECVTTL .Ed @@ -307,7 +307,7 @@ The .Vt cmsghdr fields have the following values: .Bd -literal -cmsg_len = sizeof(struct sockaddr_dl) +cmsg_len = CMSG_LEN(sizeof(struct sockaddr_dl)) cmsg_level = IPPROTO_IP cmsg_type = IP_RECVIF .Ed From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 20:49:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1C6D106566C; Tue, 5 Jun 2012 20:49:19 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 828EE8FC0A; Tue, 5 Jun 2012 20:49:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55KnJrQ043418; Tue, 5 Jun 2012 20:49:19 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55KnJnO043415; Tue, 5 Jun 2012 20:49:19 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206052049.q55KnJnO043415@svn.freebsd.org> From: Marius Strobl Date: Tue, 5 Jun 2012 20:49:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236641 - in stable/9/sys/dev: bge sym X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 20:49:19 -0000 Author: marius Date: Tue Jun 5 20:49:18 2012 New Revision: 236641 URL: http://svn.freebsd.org/changeset/base/236641 Log: MFC: r236488 Take advantage of nitems(). Modified: stable/9/sys/dev/bge/if_bge.c stable/9/sys/dev/sym/sym_hipd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Tue Jun 5 20:48:13 2012 (r236640) +++ stable/9/sys/dev/bge/if_bge.c Tue Jun 5 20:49:18 2012 (r236641) @@ -2791,9 +2791,8 @@ bge_mbox_reorder(struct bge_softc *sc) }; devclass_t pci, pcib; device_t bus, dev; - int count, i; + int i; - count = sizeof(mbox_reorder_lists) / sizeof(mbox_reorder_lists[0]); pci = devclass_find("pci"); pcib = devclass_find("pcib"); dev = sc->bge_dev; @@ -2806,7 +2805,7 @@ bge_mbox_reorder(struct bge_softc *sc) device_get_name(bus), device_get_unit(bus)); if (device_get_devclass(dev) != pcib) break; - for (i = 0; i < count; i++) { + for (i = 0; i < nitems(mbox_reorder_lists); i++) { device_printf(sc->bge_dev, "probing dev : %s%d, vendor : 0x%04x " "device : 0x%04x\n", Modified: stable/9/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/9/sys/dev/sym/sym_hipd.c Tue Jun 5 20:48:13 2012 (r236640) +++ stable/9/sys/dev/sym/sym_hipd.c Tue Jun 5 20:49:18 2012 (r236641) @@ -8411,9 +8411,6 @@ static const struct sym_pci_chip sym_pci FE_RAM|FE_IO256|FE_LEDC} }; -#define sym_pci_num_devs \ - (sizeof(sym_pci_dev_table) / sizeof(sym_pci_dev_table[0])) - /* * Look up the chip table. * @@ -8434,7 +8431,7 @@ sym_find_pci_chip(device_t dev) device_id = pci_get_device(dev); revision = pci_get_revid(dev); - for (i = 0; i < sym_pci_num_devs; i++) { + for (i = 0; i < nitems(sym_pci_dev_table); i++) { chip = &sym_pci_dev_table[i]; if (device_id != chip->device_id) continue; From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 20:53:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 007CA106566B; Tue, 5 Jun 2012 20:53:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF5FD8FC1E; Tue, 5 Jun 2012 20:53:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55KrkS4043664; Tue, 5 Jun 2012 20:53:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55KrkYS043661; Tue, 5 Jun 2012 20:53:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206052053.q55KrkYS043661@svn.freebsd.org> From: Marius Strobl Date: Tue, 5 Jun 2012 20:53:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236642 - stable/9/sys/dev/mmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 20:53:47 -0000 Author: marius Date: Tue Jun 5 20:53:46 2012 New Revision: 236642 URL: http://svn.freebsd.org/changeset/base/236642 Log: MFC: r236491 Add missing prototypes. While at it, sort them alphabetically. Modified: stable/9/sys/dev/mmc/mmc.c stable/9/sys/dev/mmc/mmcsd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/dev/mmc/mmc.c ============================================================================== --- stable/9/sys/dev/mmc/mmc.c Tue Jun 5 20:49:18 2012 (r236641) +++ stable/9/sys/dev/mmc/mmc.c Tue Jun 5 20:53:46 2012 (r236642) @@ -112,11 +112,21 @@ static int mmc_debug; SYSCTL_INT(_hw_mmc, OID_AUTO, debug, CTLFLAG_RW, &mmc_debug, 0, "Debug level"); /* bus entry points */ -static int mmc_probe(device_t dev); +static int mmc_acquire_bus(device_t busdev, device_t dev); static int mmc_attach(device_t dev); +static int mmc_child_location_str(device_t dev, device_t child, char *buf, + size_t buflen); static int mmc_detach(device_t dev); -static int mmc_suspend(device_t dev); +static int mmc_probe(device_t dev); +static int mmc_read_ivar(device_t bus, device_t child, int which, + uintptr_t *result); +static int mmc_release_bus(device_t busdev, device_t dev); static int mmc_resume(device_t dev); +static int mmc_suspend(device_t dev); +static int mmc_wait_for_request(device_t brdev, device_t reqdev, + struct mmc_request *req); +static int mmc_write_ivar(device_t bus, device_t child, int which, + uintptr_t value); #define MMC_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define MMC_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) @@ -127,25 +137,69 @@ static int mmc_resume(device_t dev); #define MMC_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); #define MMC_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); +static int mmc_all_send_cid(struct mmc_softc *sc, uint32_t *rawcid); +static void mmc_app_decode_scr(uint32_t *raw_scr, struct mmc_scr *scr); +static void mmc_app_decode_sd_status(uint32_t *raw_sd_status, + struct mmc_sd_status *sd_status); +static int mmc_app_sd_status(struct mmc_softc *sc, uint16_t rca, + uint32_t *rawsdstatus); +static int mmc_app_send_scr(struct mmc_softc *sc, uint16_t rca, + uint32_t *rawscr); static int mmc_calculate_clock(struct mmc_softc *sc); -static void mmc_delayed_attach(void *); +static void mmc_decode_cid_mmc(uint32_t *raw_cid, struct mmc_cid *cid); +static void mmc_decode_cid_sd(uint32_t *raw_cid, struct mmc_cid *cid); +static void mmc_decode_csd_mmc(uint32_t *raw_csd, struct mmc_csd *csd); +static void mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *csd); +static void mmc_delayed_attach(void *xsc); +static int mmc_delete_cards(struct mmc_softc *sc); +static void mmc_discover_cards(struct mmc_softc *sc); +static void mmc_format_card_id_string(struct mmc_ivars *ivar); +static void mmc_go_discovery(struct mmc_softc *sc); +static uint32_t mmc_get_bits(uint32_t *bits, int bit_len, int start, + int size); +static int mmc_highest_voltage(uint32_t ocr); +static void mmc_idle_cards(struct mmc_softc *sc); +static void mmc_ms_delay(int ms); +static void mmc_log_card(device_t dev, struct mmc_ivars *ivar, int newcard); static void mmc_power_down(struct mmc_softc *sc); +static void mmc_power_up(struct mmc_softc *sc); +static void mmc_rescan_cards(struct mmc_softc *sc); +static void mmc_scan(struct mmc_softc *sc); +static int mmc_sd_switch(struct mmc_softc *sc, uint8_t mode, uint8_t grp, + uint8_t value, uint8_t *res); +static int mmc_select_card(struct mmc_softc *sc, uint16_t rca); +static uint32_t mmc_select_vdd(struct mmc_softc *sc, uint32_t ocr); +static int mmc_send_app_op_cond(struct mmc_softc *sc, uint32_t ocr, + uint32_t *rocr); +static int mmc_send_csd(struct mmc_softc *sc, uint16_t rca, uint32_t *rawcsd); +static int mmc_send_ext_csd(struct mmc_softc *sc, uint8_t *rawextcsd); +static int mmc_send_if_cond(struct mmc_softc *sc, uint8_t vhs); +static int mmc_send_op_cond(struct mmc_softc *sc, uint32_t ocr, + uint32_t *rocr); +static int mmc_send_relative_addr(struct mmc_softc *sc, uint32_t *resp); +static int mmc_send_status(struct mmc_softc *sc, uint16_t rca, + uint32_t *status); +static int mmc_set_blocklen(struct mmc_softc *sc, uint32_t len); +static int mmc_set_card_bus_width(struct mmc_softc *sc, uint16_t rca, + int width); +static int mmc_set_relative_addr(struct mmc_softc *sc, uint16_t resp); +static int mmc_set_timing(struct mmc_softc *sc, int timing); +static int mmc_switch(struct mmc_softc *sc, uint8_t set, uint8_t index, + uint8_t value); +static int mmc_test_bus_width(struct mmc_softc *sc); +static int mmc_wait_for_app_cmd(struct mmc_softc *sc, uint32_t rca, + struct mmc_command *cmd, int retries); static int mmc_wait_for_cmd(struct mmc_softc *sc, struct mmc_command *cmd, int retries); static int mmc_wait_for_command(struct mmc_softc *sc, uint32_t opcode, uint32_t arg, uint32_t flags, uint32_t *resp, int retries); -static int mmc_select_card(struct mmc_softc *sc, uint16_t rca); -static int mmc_set_card_bus_width(struct mmc_softc *sc, uint16_t rca, int width); -static int mmc_app_send_scr(struct mmc_softc *sc, uint16_t rca, uint32_t *rawscr); -static void mmc_app_decode_scr(uint32_t *raw_scr, struct mmc_scr *scr); -static int mmc_send_ext_csd(struct mmc_softc *sc, uint8_t *rawextcsd); -static void mmc_scan(struct mmc_softc *sc); -static int mmc_delete_cards(struct mmc_softc *sc); -static void mmc_format_card_id_string(struct mmc_ivars *ivar); +static int mmc_wait_for_req(struct mmc_softc *sc, struct mmc_request *req); +static void mmc_wakeup(struct mmc_request *req); static void mmc_ms_delay(int ms) { + DELAY(1000 * ms); /* XXX BAD */ } Modified: stable/9/sys/dev/mmc/mmcsd.c ============================================================================== --- stable/9/sys/dev/mmc/mmcsd.c Tue Jun 5 20:49:18 2012 (r236641) +++ stable/9/sys/dev/mmc/mmcsd.c Tue Jun 5 20:53:46 2012 (r236642) @@ -89,19 +89,21 @@ struct mmcsd_softc { }; /* bus entry points */ -static int mmcsd_probe(device_t dev); static int mmcsd_attach(device_t dev); static int mmcsd_detach(device_t dev); +static int mmcsd_probe(device_t dev); /* disk routines */ -static int mmcsd_open(struct disk *dp); static int mmcsd_close(struct disk *dp); -static void mmcsd_strategy(struct bio *bp); static int mmcsd_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t length); +static int mmcsd_open(struct disk *dp); +static void mmcsd_strategy(struct bio *bp); static void mmcsd_task(void *arg); static int mmcsd_bus_bit_width(device_t dev); +static daddr_t mmcsd_delete(struct mmcsd_softc *sc, struct bio *bp); +static daddr_t mmcsd_rw(struct mmcsd_softc *sc, struct bio *bp); #define MMCSD_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define MMCSD_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) @@ -256,12 +258,14 @@ mmcsd_resume(device_t dev) static int mmcsd_open(struct disk *dp) { + return (0); } static int mmcsd_close(struct disk *dp) { + return (0); } @@ -521,6 +525,7 @@ out: static int mmcsd_bus_bit_width(device_t dev) { + if (mmc_get_bus_width(dev) == bus_width_1) return (1); if (mmc_get_bus_width(dev) == bus_width_4) From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 20:53:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86657106567E; Tue, 5 Jun 2012 20:53:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ABB998FC1F; Tue, 5 Jun 2012 20:53:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55KrrPr043707; Tue, 5 Jun 2012 20:53:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55KrrWu043704; Tue, 5 Jun 2012 20:53:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206052053.q55KrrWu043704@svn.freebsd.org> From: Marius Strobl Date: Tue, 5 Jun 2012 20:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236643 - stable/8/sys/dev/mmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 20:53:54 -0000 Author: marius Date: Tue Jun 5 20:53:53 2012 New Revision: 236643 URL: http://svn.freebsd.org/changeset/base/236643 Log: MFC: r236491 Add missing prototypes. While at it, sort them alphabetically. Modified: stable/8/sys/dev/mmc/mmc.c stable/8/sys/dev/mmc/mmcsd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/mmc/mmc.c ============================================================================== --- stable/8/sys/dev/mmc/mmc.c Tue Jun 5 20:53:46 2012 (r236642) +++ stable/8/sys/dev/mmc/mmc.c Tue Jun 5 20:53:53 2012 (r236643) @@ -112,11 +112,21 @@ static int mmc_debug; SYSCTL_INT(_hw_mmc, OID_AUTO, debug, CTLFLAG_RW, &mmc_debug, 0, "Debug level"); /* bus entry points */ -static int mmc_probe(device_t dev); +static int mmc_acquire_bus(device_t busdev, device_t dev); static int mmc_attach(device_t dev); +static int mmc_child_location_str(device_t dev, device_t child, char *buf, + size_t buflen); static int mmc_detach(device_t dev); -static int mmc_suspend(device_t dev); +static int mmc_probe(device_t dev); +static int mmc_read_ivar(device_t bus, device_t child, int which, + uintptr_t *result); +static int mmc_release_bus(device_t busdev, device_t dev); static int mmc_resume(device_t dev); +static int mmc_suspend(device_t dev); +static int mmc_wait_for_request(device_t brdev, device_t reqdev, + struct mmc_request *req); +static int mmc_write_ivar(device_t bus, device_t child, int which, + uintptr_t value); #define MMC_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define MMC_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) @@ -127,25 +137,69 @@ static int mmc_resume(device_t dev); #define MMC_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); #define MMC_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); +static int mmc_all_send_cid(struct mmc_softc *sc, uint32_t *rawcid); +static void mmc_app_decode_scr(uint32_t *raw_scr, struct mmc_scr *scr); +static void mmc_app_decode_sd_status(uint32_t *raw_sd_status, + struct mmc_sd_status *sd_status); +static int mmc_app_sd_status(struct mmc_softc *sc, uint16_t rca, + uint32_t *rawsdstatus); +static int mmc_app_send_scr(struct mmc_softc *sc, uint16_t rca, + uint32_t *rawscr); static int mmc_calculate_clock(struct mmc_softc *sc); -static void mmc_delayed_attach(void *); +static void mmc_decode_cid_mmc(uint32_t *raw_cid, struct mmc_cid *cid); +static void mmc_decode_cid_sd(uint32_t *raw_cid, struct mmc_cid *cid); +static void mmc_decode_csd_mmc(uint32_t *raw_csd, struct mmc_csd *csd); +static void mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *csd); +static void mmc_delayed_attach(void *xsc); +static int mmc_delete_cards(struct mmc_softc *sc); +static void mmc_discover_cards(struct mmc_softc *sc); +static void mmc_format_card_id_string(struct mmc_ivars *ivar); +static void mmc_go_discovery(struct mmc_softc *sc); +static uint32_t mmc_get_bits(uint32_t *bits, int bit_len, int start, + int size); +static int mmc_highest_voltage(uint32_t ocr); +static void mmc_idle_cards(struct mmc_softc *sc); +static void mmc_ms_delay(int ms); +static void mmc_log_card(device_t dev, struct mmc_ivars *ivar, int newcard); static void mmc_power_down(struct mmc_softc *sc); +static void mmc_power_up(struct mmc_softc *sc); +static void mmc_rescan_cards(struct mmc_softc *sc); +static void mmc_scan(struct mmc_softc *sc); +static int mmc_sd_switch(struct mmc_softc *sc, uint8_t mode, uint8_t grp, + uint8_t value, uint8_t *res); +static int mmc_select_card(struct mmc_softc *sc, uint16_t rca); +static uint32_t mmc_select_vdd(struct mmc_softc *sc, uint32_t ocr); +static int mmc_send_app_op_cond(struct mmc_softc *sc, uint32_t ocr, + uint32_t *rocr); +static int mmc_send_csd(struct mmc_softc *sc, uint16_t rca, uint32_t *rawcsd); +static int mmc_send_ext_csd(struct mmc_softc *sc, uint8_t *rawextcsd); +static int mmc_send_if_cond(struct mmc_softc *sc, uint8_t vhs); +static int mmc_send_op_cond(struct mmc_softc *sc, uint32_t ocr, + uint32_t *rocr); +static int mmc_send_relative_addr(struct mmc_softc *sc, uint32_t *resp); +static int mmc_send_status(struct mmc_softc *sc, uint16_t rca, + uint32_t *status); +static int mmc_set_blocklen(struct mmc_softc *sc, uint32_t len); +static int mmc_set_card_bus_width(struct mmc_softc *sc, uint16_t rca, + int width); +static int mmc_set_relative_addr(struct mmc_softc *sc, uint16_t resp); +static int mmc_set_timing(struct mmc_softc *sc, int timing); +static int mmc_switch(struct mmc_softc *sc, uint8_t set, uint8_t index, + uint8_t value); +static int mmc_test_bus_width(struct mmc_softc *sc); +static int mmc_wait_for_app_cmd(struct mmc_softc *sc, uint32_t rca, + struct mmc_command *cmd, int retries); static int mmc_wait_for_cmd(struct mmc_softc *sc, struct mmc_command *cmd, int retries); static int mmc_wait_for_command(struct mmc_softc *sc, uint32_t opcode, uint32_t arg, uint32_t flags, uint32_t *resp, int retries); -static int mmc_select_card(struct mmc_softc *sc, uint16_t rca); -static int mmc_set_card_bus_width(struct mmc_softc *sc, uint16_t rca, int width); -static int mmc_app_send_scr(struct mmc_softc *sc, uint16_t rca, uint32_t *rawscr); -static void mmc_app_decode_scr(uint32_t *raw_scr, struct mmc_scr *scr); -static int mmc_send_ext_csd(struct mmc_softc *sc, uint8_t *rawextcsd); -static void mmc_scan(struct mmc_softc *sc); -static int mmc_delete_cards(struct mmc_softc *sc); -static void mmc_format_card_id_string(struct mmc_ivars *ivar); +static int mmc_wait_for_req(struct mmc_softc *sc, struct mmc_request *req); +static void mmc_wakeup(struct mmc_request *req); static void mmc_ms_delay(int ms) { + DELAY(1000 * ms); /* XXX BAD */ } Modified: stable/8/sys/dev/mmc/mmcsd.c ============================================================================== --- stable/8/sys/dev/mmc/mmcsd.c Tue Jun 5 20:53:46 2012 (r236642) +++ stable/8/sys/dev/mmc/mmcsd.c Tue Jun 5 20:53:53 2012 (r236643) @@ -89,19 +89,21 @@ struct mmcsd_softc { }; /* bus entry points */ -static int mmcsd_probe(device_t dev); static int mmcsd_attach(device_t dev); static int mmcsd_detach(device_t dev); +static int mmcsd_probe(device_t dev); /* disk routines */ -static int mmcsd_open(struct disk *dp); static int mmcsd_close(struct disk *dp); -static void mmcsd_strategy(struct bio *bp); static int mmcsd_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t length); +static int mmcsd_open(struct disk *dp); +static void mmcsd_strategy(struct bio *bp); static void mmcsd_task(void *arg); static int mmcsd_bus_bit_width(device_t dev); +static daddr_t mmcsd_delete(struct mmcsd_softc *sc, struct bio *bp); +static daddr_t mmcsd_rw(struct mmcsd_softc *sc, struct bio *bp); #define MMCSD_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define MMCSD_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) @@ -256,12 +258,14 @@ mmcsd_resume(device_t dev) static int mmcsd_open(struct disk *dp) { + return (0); } static int mmcsd_close(struct disk *dp) { + return (0); } @@ -521,6 +525,7 @@ out: static int mmcsd_bus_bit_width(device_t dev) { + if (mmc_get_bus_width(dev) == bus_width_1) return (1); if (mmc_get_bus_width(dev) == bus_width_4) From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 21:01:57 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8706810656B0; Tue, 5 Jun 2012 21:01:57 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id E88D68FC0C; Tue, 5 Jun 2012 21:01:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q55L1tOI022765; Wed, 6 Jun 2012 01:01:55 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q55L1sFR022764; Wed, 6 Jun 2012 01:01:54 +0400 (MSK) (envelope-from ache) Date: Wed, 6 Jun 2012 01:01:54 +0400 From: Andrey Chernov To: Bruce Evans Message-ID: <20120605210154.GA22370@vniz.net> Mail-Followup-To: Andrey Chernov , Bruce Evans , svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Pawel Jakub Dawidek , freebsd-arch@FreeBSD.ORG References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <20120605074741.GA1391@garage.freebsd.pl> <20120605130922.GE13306@vniz.net> <20120606043731.D1124@besplex.bde.org> <20120605194102.GA21173@vniz.net> <20120606054555.U1456@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120606054555.U1456@besplex.bde.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, Pawel Jakub Dawidek , freebsd-arch@FreeBSD.ORG Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 21:01:57 -0000 On Wed, Jun 06, 2012 at 06:11:01AM +1000, Bruce Evans wrote: > This is essentially unusable (so a bad idea). Instead of unconditionally > saving and restoring errno around calls to free(), portable POSIX code > can soon use a messy ifdef to avoid doing this in some cases, but still > has to do it in other cases. The results is just bloat and complexity > at the source level: It looks like they now consider POSIX as moving target where previous POSIX versions compatibility is not so essential to care about much. I don't have other interpretation of their decision to suddenly accept free() as not modifying errno. Since they clearly indicate code differences for old and new standard, they are well aware of them and of resulting code bloating. > However, free() is currently not careful about errno. It begins with > an optional utrace() call, and this can in theory fail with errno ENOMEM > even if there are no bugs in malloc() (all other errors from utrace() > indicate bugs in the caller, assuming that the list of errnos in its man > page is complete). malloc.c makes a few other sys(lib?)calls and never > saves errno. I don't know if the others are reachable from free(). I fill PR about that: http://www.freebsd.org/cgi/query-pr.cgi?pr=168719 -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 21:30:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DA19106579F; Tue, 5 Jun 2012 21:30:55 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo6-p00-ob.rzone.de (mo6-p00-ob.rzone.de [IPv6:2a01:238:20a:202:5300::1]) by mx1.freebsd.org (Postfix) with ESMTP id 18CD38FC14; Tue, 5 Jun 2012 21:30:50 +0000 (UTC) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/afgnrylsiW+1ZjV+pgsJ X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de (ip-109-45-139-202.web.vodafone.de [109.45.139.202]) by smtp.strato.de (jored mo73) (RZmta 29.10 DYNA|AUTH) with (AES128-SHA encrypted) ESMTPA id A07bfao55ISlKb ; Tue, 5 Jun 2012 23:30:37 +0200 (CEST) Received: by britannica.bec.de (sSMTP sendmail emulation); Tue, 05 Jun 2012 23:30:34 +0200 Date: Tue, 5 Jun 2012 23:30:34 +0200 From: Joerg Sonnenberger To: svn-src-all@freebsd.org Message-ID: <20120605213034.GA25293@britannica.bec.de> References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <20120605074741.GA1391@garage.freebsd.pl> <20120605130922.GE13306@vniz.net> <20120606043731.D1124@besplex.bde.org> <20120605194102.GA21173@vniz.net> <20120606054555.U1456@besplex.bde.org> <20120605210154.GA22370@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120605210154.GA22370@vniz.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@FreeBSD.ORG, Pawel Jakub Dawidek , Bruce Evans , freebsd-arch@FreeBSD.ORG, svn-src-head@FreeBSD.ORG, Andrey Chernov Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 21:30:55 -0000 On Wed, Jun 06, 2012 at 01:01:54AM +0400, Andrey Chernov wrote: > On Wed, Jun 06, 2012 at 06:11:01AM +1000, Bruce Evans wrote: > > This is essentially unusable (so a bad idea). Instead of unconditionally > > saving and restoring errno around calls to free(), portable POSIX code > > can soon use a messy ifdef to avoid doing this in some cases, but still > > has to do it in other cases. The results is just bloat and complexity > > at the source level: > > It looks like they now consider POSIX as moving target where previous > POSIX versions compatibility is not so essential to care about much. I > don't have other interpretation of their decision to suddenly accept > free() as not modifying errno. Since they clearly indicate code > differences for old and new standard, they are well aware of them and of > resulting code bloating. Can you please stop the unjustified rants? The "new" behavior of free(3) doesn't break any existing code, so it is certainly compatible with "old" free(3). The "new" behavior can be obtained easily for code that wants to be portable to "old" implementations using the C preprocessor and a small inline wrapper. As such, there is no code bloating. Joerg From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 21:35:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90B621065675; Tue, 5 Jun 2012 21:35:48 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71A5D8FC1F; Tue, 5 Jun 2012 21:35:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55LZma4045852; Tue, 5 Jun 2012 21:35:48 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55LZmvX045850; Tue, 5 Jun 2012 21:35:48 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201206052135.q55LZmvX045850@svn.freebsd.org> From: Maksim Yevmenkin Date: Tue, 5 Jun 2012 21:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236644 - head/tools/tools/ifpifa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 21:35:48 -0000 Author: emax Date: Tue Jun 5 21:35:47 2012 New Revision: 236644 URL: http://svn.freebsd.org/changeset/base/236644 Log: Add a very simple debug tool that would dump list of interfaces, addresses on each interface, and, associated refcounter. I found it handy to check for address refcounter leaks. Added: head/tools/tools/ifpifa/ head/tools/tools/ifpifa/Makefile (contents, props changed) head/tools/tools/ifpifa/ifpifa.c (contents, props changed) Added: head/tools/tools/ifpifa/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ifpifa/Makefile Tue Jun 5 21:35:47 2012 (r236644) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +PROG= ifpifa +NO_MAN= +WARNS?=6 +BINDIR?=/usr/local/bin +DPADD=${LIBKVM} +LDADD=-lkvm + +.include Added: head/tools/tools/ifpifa/ifpifa.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ifpifa/ifpifa.c Tue Jun 5 21:35:47 2012 (r236644) @@ -0,0 +1,190 @@ +/*- + * Copyright (c) 2012 maksim yevmenkin + * 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 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. + */ + +/* gcc -Wall -ggdb ifpifa.c -lkvm -o ifpifa */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +__FBSDID("$FreeBSD$"); + +static struct nlist nl[] = { +#define N_IFNET 0 + { .n_name = "_ifnet", }, + { .n_name = NULL, }, +}; + +static int +kread(kvm_t *kd, u_long addr, char *buffer, int size) +{ + if (kd == NULL || buffer == NULL) + return (-1); + + if (kvm_read(kd, addr, buffer, size) != size) { + warnx("kvm_read: %s", kvm_geterr(kd)); + return (-1); + } + + return (0); +} + +int +main(void) +{ + kvm_t *kd; + char errbuf[_POSIX2_LINE_MAX]; + u_long ifnetaddr, ifnetaddr_next; + u_long ifaddraddr, ifaddraddr_next; + struct ifnet ifnet; + struct ifnethead ifnethead; + union { + struct ifaddr ifa; + struct in_ifaddr in; + struct in6_ifaddr in6; + } ifaddr; + union { + struct sockaddr *sa; + struct sockaddr_dl *sal; + struct sockaddr_in *sa4; + struct sockaddr_in6 *sa6; + } sa; + char addr[INET6_ADDRSTRLEN]; + + kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf); + if (kd == NULL) { + warnx("kvm_openfiles: %s", errbuf); + exit(0); + } + + if (kvm_nlist(kd, nl) < 0) { + warnx("kvm_nlist: %s", kvm_geterr(kd)); + goto out; + } + + if (nl[N_IFNET].n_type == 0) { + warnx("kvm_nlist: no namelist"); + goto out; + } + + if (kread(kd, nl[N_IFNET].n_value, + (char *) &ifnethead, sizeof(ifnethead)) != 0) + goto out; + + for (ifnetaddr = (u_long) TAILQ_FIRST(&ifnethead); + ifnetaddr != 0; + ifnetaddr = ifnetaddr_next) { + if (kread(kd, ifnetaddr, (char *) &ifnet, sizeof(ifnet)) != 0) + goto out; + ifnetaddr_next = (u_long) TAILQ_NEXT(&ifnet, if_link); + + printf("%s\n", ifnet.if_xname); + + for (ifaddraddr = (u_long) TAILQ_FIRST(&ifnet.if_addrhead); + ifaddraddr != 0; + ifaddraddr = ifaddraddr_next) { + if (kread(kd, ifaddraddr, + (char *) &ifaddr, sizeof(ifaddr)) != 0) + goto out; + + ifaddraddr_next = (u_long) + TAILQ_NEXT(&ifaddr.ifa, ifa_link); + + sa.sa = (struct sockaddr *)( + (unsigned char *) ifaddr.ifa.ifa_addr - + (unsigned char *) ifaddraddr + + (unsigned char *) &ifaddr); + + switch (sa.sa->sa_family) { + case AF_LINK: + switch (sa.sal->sdl_type) { + case IFT_ETHER: + case IFT_FDDI: + ether_ntoa_r((struct ether_addr * ) + LLADDR(sa.sal), addr); + break; + + case IFT_LOOP: + strcpy(addr, "loopback"); + break; + + default: + snprintf(addr, sizeof(addr), + "", + sa.sal->sdl_type); + break; + } + break; + + case AF_INET: + inet_ntop(AF_INET, &sa.sa4->sin_addr, + addr, sizeof(addr)); + break; + + case AF_INET6: + inet_ntop(AF_INET6, &sa.sa6->sin6_addr, + addr, sizeof(addr)); + break; + + default: + snprintf(addr, sizeof(addr), "family=%d", + sa.sa->sa_family); + break; + } + + printf("\t%s ifa_refcnt=%u\n", + addr, ifaddr.ifa.ifa_refcnt); + } + } +out: + kvm_close(kd); + + return (0); +} + From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 21:48:16 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76909106564A; Tue, 5 Jun 2012 21:48:16 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id C88128FC19; Tue, 5 Jun 2012 21:48:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q55LmC3a023628; Wed, 6 Jun 2012 01:48:12 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q55LmBPR023627; Wed, 6 Jun 2012 01:48:11 +0400 (MSK) (envelope-from ache) Date: Wed, 6 Jun 2012 01:48:11 +0400 From: Andrey Chernov To: Joerg Sonnenberger Message-ID: <20120605214811.GA23384@vniz.net> Mail-Followup-To: Andrey Chernov , Joerg Sonnenberger , svn-src-all@FreeBSD.ORG, Bruce Evans , svn-src-head@FreeBSD.ORG, src-committers@FreeBSD.ORG, Pawel Jakub Dawidek , freebsd-arch@FreeBSD.ORG References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <20120605074741.GA1391@garage.freebsd.pl> <20120605130922.GE13306@vniz.net> <20120606043731.D1124@besplex.bde.org> <20120605194102.GA21173@vniz.net> <20120606054555.U1456@besplex.bde.org> <20120605210154.GA22370@vniz.net> <20120605213034.GA25293@britannica.bec.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120605213034.GA25293@britannica.bec.de> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@FreeBSD.ORG, Pawel Jakub Dawidek , svn-src-all@FreeBSD.ORG, Bruce Evans , freebsd-arch@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 21:48:16 -0000 On Tue, Jun 05, 2012 at 11:30:34PM +0200, Joerg Sonnenberger wrote: > On Wed, Jun 06, 2012 at 01:01:54AM +0400, Andrey Chernov wrote: > > On Wed, Jun 06, 2012 at 06:11:01AM +1000, Bruce Evans wrote: > > > This is essentially unusable (so a bad idea). Instead of unconditionally > > > saving and restoring errno around calls to free(), portable POSIX code > > > can soon use a messy ifdef to avoid doing this in some cases, but still > > > has to do it in other cases. The results is just bloat and complexity > > > at the source level: > > > > It looks like they now consider POSIX as moving target where previous > > POSIX versions compatibility is not so essential to care about much. I > > don't have other interpretation of their decision to suddenly accept > > free() as not modifying errno. Since they clearly indicate code > > differences for old and new standard, they are well aware of them and of > > resulting code bloating. > > Can you please stop the unjustified rants? The "new" behavior of free(3) > doesn't break any existing code, so it is certainly compatible with > "old" free(3). The "new" behavior can be obtained easily for code that > wants to be portable to "old" implementations using the C preprocessor > and a small inline wrapper. As such, there is no code bloating. Could you please read more carefully, if you decide to stay in the topic? I already say exactly that few messages behind: > Yes, it is safe for free() itself to save errno and still stay compliant > with both current and upcoming POSIX and with Standard C. > But any code which rely on that is compliant with upcoming POSIX only. It means that when some program wants to conform to current POSIX and future POSIX, it either must save errno across the free() in any case or use code bloating, just reduced by CPP macro you suggest, not eliminated. And I don't think it is good decision from POSIX side, from compatibility point of view. Are you pretend to attack my personal opinion or what? -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Jun 5 22:02:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 42A3C106567C; Tue, 5 Jun 2012 22:02:28 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1447F8FC18; Tue, 5 Jun 2012 22:02:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q55M2RSm047122; Tue, 5 Jun 2012 22:02:27 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q55M2RwX047120; Tue, 5 Jun 2012 22:02:27 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201206052202.q55M2RwX047120@svn.freebsd.org> From: Maksim Yevmenkin Date: Tue, 5 Jun 2012 22:02:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236645 - head/tools/tools/ifpifa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 22:02:28 -0000 Author: emax Date: Tue Jun 5 22:02:27 2012 New Revision: 236645 URL: http://svn.freebsd.org/changeset/base/236645 Log: Fix license Pointed by: brueffer Modified: head/tools/tools/ifpifa/ifpifa.c Modified: head/tools/tools/ifpifa/ifpifa.c ============================================================================== --- head/tools/tools/ifpifa/ifpifa.c Tue Jun 5 21:35:47 2012 (r236644) +++ head/tools/tools/ifpifa/ifpifa.c Tue Jun 5 22:02:27 2012 (r236645) @@ -3,7 +3,7 @@ * All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions + * modification, are permitted providing 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. @@ -11,17 +11,17 @@ * 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 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 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * 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. */ /* gcc -Wall -ggdb ifpifa.c -lkvm -o ifpifa */ From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 01:01:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 03CEC1065670; Wed, 6 Jun 2012 01:01:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2E3A8FC12; Wed, 6 Jun 2012 01:01:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5611CNF058820; Wed, 6 Jun 2012 01:01:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5611Ceb058818; Wed, 6 Jun 2012 01:01:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206060101.q5611Ceb058818@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 6 Jun 2012 01:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236648 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 01:01:13 -0000 Author: kib Date: Wed Jun 6 01:01:12 2012 New Revision: 236648 URL: http://svn.freebsd.org/changeset/base/236648 Log: MFC r236309: Assert that TDP_NOFAULTING and TDP_NOSPEEPING thread flags do not leak when thread returns from a syscall to usermode. Modified: stable/9/sys/kern/subr_syscall.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/subr_syscall.c ============================================================================== --- stable/9/sys/kern/subr_syscall.c Wed Jun 6 00:20:13 2012 (r236647) +++ stable/9/sys/kern/subr_syscall.c Wed Jun 6 01:01:12 2012 (r236648) @@ -182,6 +182,12 @@ syscallret(struct thread *td, int error, KASSERT(td->td_locks == 0, ("System call %s returning with %d locks held", syscallname(p, sa->code), td->td_locks)); + KASSERT((td->td_pflags & TDP_NOFAULTING) == 0, + ("System call %s returning with pagefaults disabled", + syscallname(p, sa->code))); + KASSERT((td->td_pflags & TDP_NOSLEEPING) == 0, + ("System call %s returning with sleep disabled", + syscallname(p, sa->code))); /* * Handle reschedule and other end-of-syscall issues From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 02:42:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9465B1065676; Wed, 6 Jun 2012 02:42:31 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F9688FC16; Wed, 6 Jun 2012 02:42:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q562gVB1063333; Wed, 6 Jun 2012 02:42:31 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q562gVhJ063331; Wed, 6 Jun 2012 02:42:31 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201206060242.q562gVhJ063331@svn.freebsd.org> From: Kevin Lo Date: Wed, 6 Jun 2012 02:42:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236649 - head/sys/dev/ae X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 02:42:31 -0000 Author: kevlo Date: Wed Jun 6 02:42:30 2012 New Revision: 236649 URL: http://svn.freebsd.org/changeset/base/236649 Log: Check the return value of pci_find_cap() Modified: head/sys/dev/ae/if_ae.c Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Wed Jun 6 01:01:12 2012 (r236648) +++ head/sys/dev/ae/if_ae.c Wed Jun 6 02:42:30 2012 (r236649) @@ -1381,12 +1381,13 @@ ae_pm_init(ae_softc_t *sc) /* * Configure PME. */ - pci_find_cap(sc->dev, PCIY_PMG, &pmc); - pmstat = pci_read_config(sc->dev, pmc + PCIR_POWER_STATUS, 2); - pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); - if ((ifp->if_capenable & IFCAP_WOL) != 0) - pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; - pci_write_config(sc->dev, pmc + PCIR_POWER_STATUS, pmstat, 2); + if (pci_find_cap(dev, PCIY_PMG, &pmc) == 0) { + pmstat = pci_read_config(sc->dev, pmc + PCIR_POWER_STATUS, 2); + pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); + if ((ifp->if_capenable & IFCAP_WOL) != 0) + pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->dev, pmc + PCIR_POWER_STATUS, pmstat, 2); + } } static int From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 04:17:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BD3E1106566B; Wed, 6 Jun 2012 04:17:40 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A82F58FC12; Wed, 6 Jun 2012 04:17:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q564HeoF067906; Wed, 6 Jun 2012 04:17:40 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q564HeUi067904; Wed, 6 Jun 2012 04:17:40 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206060417.q564HeUi067904@svn.freebsd.org> From: Eitan Adler Date: Wed, 6 Jun 2012 04:17:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236650 - stable/9/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 04:17:40 -0000 Author: eadler Date: Wed Jun 6 04:17:40 2012 New Revision: 236650 URL: http://svn.freebsd.org/changeset/base/236650 Log: MFC r236282: Add support for Sun 1040 PCI Quad Serial PR: kern/163450 Approved by: cperciva (implicit) Modified: stable/9/sys/dev/puc/pucdata.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/puc/pucdata.c ============================================================================== --- stable/9/sys/dev/puc/pucdata.c Wed Jun 6 02:42:30 2012 (r236649) +++ stable/9/sys/dev/puc/pucdata.c Wed Jun 6 04:17:40 2012 (r236650) @@ -901,6 +901,12 @@ const struct puc_cfg puc_pci_devices[] = .config_function = puc_config_syba }, + { 0x5372, 0x6873, 0xffff, 0, + "Sun 1040 PCI Quad Serial", + DEFAULT_RCLK, + PUC_PORT_4S, 0x10, 4, 0, + }, + { 0x6666, 0x0001, 0xffff, 0, "Decision Computer Inc, PCCOM 4-port serial", DEFAULT_RCLK, From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 04:18:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0DA76106566C; Wed, 6 Jun 2012 04:18:05 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED4ED8FC19; Wed, 6 Jun 2012 04:18:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q564I4iN067959; Wed, 6 Jun 2012 04:18:04 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q564I4IF067957; Wed, 6 Jun 2012 04:18:04 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206060418.q564I4IF067957@svn.freebsd.org> From: Eitan Adler Date: Wed, 6 Jun 2012 04:18:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236651 - stable/8/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 04:18:05 -0000 Author: eadler Date: Wed Jun 6 04:18:04 2012 New Revision: 236651 URL: http://svn.freebsd.org/changeset/base/236651 Log: MFC r236282: Add support for Sun 1040 PCI Quad Serial PR: kern/163450 Approved by: cperciva (implicit) Modified: stable/8/sys/dev/puc/pucdata.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/puc/pucdata.c ============================================================================== --- stable/8/sys/dev/puc/pucdata.c Wed Jun 6 04:17:40 2012 (r236650) +++ stable/8/sys/dev/puc/pucdata.c Wed Jun 6 04:18:04 2012 (r236651) @@ -887,6 +887,12 @@ const struct puc_cfg puc_pci_devices[] = .config_function = puc_config_syba }, + { 0x5372, 0x6873, 0xffff, 0, + "Sun 1040 PCI Quad Serial", + DEFAULT_RCLK, + PUC_PORT_4S, 0x10, 4, 0, + }, + { 0x6666, 0x0001, 0xffff, 0, "Decision Computer Inc, PCCOM 4-port serial", DEFAULT_RCLK, From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 04:18:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8FFE106586C; Wed, 6 Jun 2012 04:18:22 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C36478FC08; Wed, 6 Jun 2012 04:18:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q564IM1B068007; Wed, 6 Jun 2012 04:18:22 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q564IMOS068005; Wed, 6 Jun 2012 04:18:22 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206060418.q564IMOS068005@svn.freebsd.org> From: Eitan Adler Date: Wed, 6 Jun 2012 04:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236652 - stable/7/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 04:18:23 -0000 Author: eadler Date: Wed Jun 6 04:18:22 2012 New Revision: 236652 URL: http://svn.freebsd.org/changeset/base/236652 Log: MFC r236282: Add support for Sun 1040 PCI Quad Serial PR: kern/163450 Approved by: cperciva (implicit) Modified: stable/7/sys/dev/puc/pucdata.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/puc/pucdata.c ============================================================================== --- stable/7/sys/dev/puc/pucdata.c Wed Jun 6 04:18:04 2012 (r236651) +++ stable/7/sys/dev/puc/pucdata.c Wed Jun 6 04:18:22 2012 (r236652) @@ -761,6 +761,12 @@ const struct puc_cfg puc_pci_devices[] = .config_function = puc_config_syba }, + { 0x5372, 0x6873, 0xffff, 0, + "Sun 1040 PCI Quad Serial", + DEFAULT_RCLK, + PUC_PORT_4S, 0x10, 4, 0, + }, + { 0x6666, 0x0001, 0xffff, 0, "Decision Computer Inc, PCCOM 4-port serial", DEFAULT_RCLK, From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 04:26:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 55B56106566C; Wed, 6 Jun 2012 04:26:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40F2E8FC12; Wed, 6 Jun 2012 04:26:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q564Q44w068429; Wed, 6 Jun 2012 04:26:04 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q564Q4NU068427; Wed, 6 Jun 2012 04:26:04 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206060426.q564Q4NU068427@svn.freebsd.org> From: Eitan Adler Date: Wed, 6 Jun 2012 04:26:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236653 - stable/9/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 04:26:04 -0000 Author: eadler Date: Wed Jun 6 04:26:03 2012 New Revision: 236653 URL: http://svn.freebsd.org/changeset/base/236653 Log: MFC r236283: Add support for newer garmin devices PR: kern/163932 Approved by: cperciva (implicit) Modified: stable/9/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_xpt.c Wed Jun 6 04:18:22 2012 (r236652) +++ stable/9/sys/cam/scsi/scsi_xpt.c Wed Jun 6 04:26:03 2012 (r236653) @@ -535,6 +535,10 @@ static struct scsi_quirk_entry scsi_quir CAM_QUIRK_NOLUNS, /*mintags*/0, /*maxtags*/0 }, { + { T_DIRECT, SIP_MEDIA_REMOVABLE, "Garmin", "*", "*" }, + CAM_QUIRK_NORPTLUNS, /*mintags*/2, /*maxtags*/255 + }, + { /* Default tagged queuing parameters for all devices */ { T_ANY, SIP_MEDIA_REMOVABLE|SIP_MEDIA_FIXED, From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 04:26:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A23C4106574D; Wed, 6 Jun 2012 04:26:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DB9E8FC1A; Wed, 6 Jun 2012 04:26:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q564QR05068483; Wed, 6 Jun 2012 04:26:27 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q564QRm7068481; Wed, 6 Jun 2012 04:26:27 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206060426.q564QRm7068481@svn.freebsd.org> From: Eitan Adler Date: Wed, 6 Jun 2012 04:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236654 - stable/8/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 04:26:27 -0000 Author: eadler Date: Wed Jun 6 04:26:27 2012 New Revision: 236654 URL: http://svn.freebsd.org/changeset/base/236654 Log: MFC r236283: Add support for newer garmin devices PR: kern/163932 Approved by: cperciva (implicit) Modified: stable/8/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_xpt.c Wed Jun 6 04:26:03 2012 (r236653) +++ stable/8/sys/cam/scsi/scsi_xpt.c Wed Jun 6 04:26:27 2012 (r236654) @@ -507,6 +507,10 @@ static struct scsi_quirk_entry scsi_quir CAM_QUIRK_NOLUNS, /*mintags*/0, /*maxtags*/0 }, { + { T_DIRECT, SIP_MEDIA_REMOVABLE, "Garmin", "*", "*" }, + CAM_QUIRK_NORPTLUNS, /*mintags*/2, /*maxtags*/255 + }, + { /* Default tagged queuing parameters for all devices */ { T_ANY, SIP_MEDIA_REMOVABLE|SIP_MEDIA_FIXED, From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 04:38:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CB1A8106564A; Wed, 6 Jun 2012 04:38:26 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BC748FC0A; Wed, 6 Jun 2012 04:38:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q564cQvb069205; Wed, 6 Jun 2012 04:38:26 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q564cQBF069200; Wed, 6 Jun 2012 04:38:26 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206060438.q564cQBF069200@svn.freebsd.org> From: Eitan Adler Date: Wed, 6 Jun 2012 04:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236655 - in stable/9/sys/dev: hptiop hptmv isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 04:38:26 -0000 Author: eadler Date: Wed Jun 6 04:38:25 2012 New Revision: 236655 URL: http://svn.freebsd.org/changeset/base/236655 Log: MFC r236379: Adding missing dependancies for loading hptiop(4), hptmv(4) and isp(4) as modules. PR: kern/166239 Approved by: cperciva (implicit) Modified: stable/9/sys/dev/hptiop/hptiop.c stable/9/sys/dev/hptmv/entry.c stable/9/sys/dev/isp/isp_pci.c stable/9/sys/dev/isp/isp_sbus.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/hptiop/hptiop.c ============================================================================== --- stable/9/sys/dev/hptiop/hptiop.c Wed Jun 6 04:26:27 2012 (r236654) +++ stable/9/sys/dev/hptiop/hptiop.c Wed Jun 6 04:38:25 2012 (r236655) @@ -1268,6 +1268,7 @@ static driver_t hptiop_pci_driver = { }; DRIVER_MODULE(hptiop, pci, hptiop_pci_driver, hptiop_devclass, 0, 0); +MODULE_DEPEND(hptiop, cam, 1, 1, 1); static int hptiop_probe(device_t dev) { Modified: stable/9/sys/dev/hptmv/entry.c ============================================================================== --- stable/9/sys/dev/hptmv/entry.c Wed Jun 6 04:26:27 2012 (r236654) +++ stable/9/sys/dev/hptmv/entry.c Wed Jun 6 04:38:25 2012 (r236655) @@ -108,6 +108,7 @@ static devclass_t hpt_devclass; #define __DRIVER_MODULE(p1, p2, p3, p4, p5, p6) DRIVER_MODULE(p1, p2, p3, p4, p5, p6) __DRIVER_MODULE(PROC_DIR_NAME, pci, hpt_pci_driver, hpt_devclass, 0, 0); +MODULE_DEPEND(PROC_DIR_NAME, cam, 1, 1, 1); #define ccb_ccb_ptr spriv_ptr0 #define ccb_adapter ccb_h.spriv_ptr1 Modified: stable/9/sys/dev/isp/isp_pci.c ============================================================================== --- stable/9/sys/dev/isp/isp_pci.c Wed Jun 6 04:26:27 2012 (r236654) +++ stable/9/sys/dev/isp/isp_pci.c Wed Jun 6 04:38:25 2012 (r236655) @@ -372,6 +372,8 @@ static driver_t isp_pci_driver = { }; static devclass_t isp_devclass; DRIVER_MODULE(isp, pci, isp_pci_driver, isp_devclass, 0, 0); +MODULE_DEPEND(isp, cam, 1, 1, 1); +MODULE_DEPEND(isp, firmware, 1, 1, 1); static int isp_pci_probe(device_t dev) Modified: stable/9/sys/dev/isp/isp_sbus.c ============================================================================== --- stable/9/sys/dev/isp/isp_sbus.c Wed Jun 6 04:26:27 2012 (r236654) +++ stable/9/sys/dev/isp/isp_sbus.c Wed Jun 6 04:38:25 2012 (r236655) @@ -106,6 +106,8 @@ static driver_t isp_sbus_driver = { }; static devclass_t isp_devclass; DRIVER_MODULE(isp, sbus, isp_sbus_driver, isp_devclass, 0, 0); +MODULE_DEPEND(isp, cam, 1, 1, 1); +MODULE_DEPEND(isp, firmware, 1, 1, 1); static int isp_sbus_probe(device_t dev) From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 04:38:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD521106579F; Wed, 6 Jun 2012 04:38:46 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7EBF78FC14; Wed, 6 Jun 2012 04:38:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q564ckSi069256; Wed, 6 Jun 2012 04:38:46 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q564ckPM069251; Wed, 6 Jun 2012 04:38:46 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206060438.q564ckPM069251@svn.freebsd.org> From: Eitan Adler Date: Wed, 6 Jun 2012 04:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236656 - in stable/8/sys/dev: hptiop hptmv isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 04:38:46 -0000 Author: eadler Date: Wed Jun 6 04:38:45 2012 New Revision: 236656 URL: http://svn.freebsd.org/changeset/base/236656 Log: MFC r236379: Adding missing dependancies for loading hptiop(4), hptmv(4) and isp(4) as modules. PR: kern/166239 Approved by: cperciva (implicit) Modified: stable/8/sys/dev/hptiop/hptiop.c stable/8/sys/dev/hptmv/entry.c stable/8/sys/dev/isp/isp_pci.c stable/8/sys/dev/isp/isp_sbus.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/hptiop/hptiop.c ============================================================================== --- stable/8/sys/dev/hptiop/hptiop.c Wed Jun 6 04:38:25 2012 (r236655) +++ stable/8/sys/dev/hptiop/hptiop.c Wed Jun 6 04:38:45 2012 (r236656) @@ -1268,6 +1268,7 @@ static driver_t hptiop_pci_driver = { }; DRIVER_MODULE(hptiop, pci, hptiop_pci_driver, hptiop_devclass, 0, 0); +MODULE_DEPEND(hptiop, cam, 1, 1, 1); static int hptiop_probe(device_t dev) { Modified: stable/8/sys/dev/hptmv/entry.c ============================================================================== --- stable/8/sys/dev/hptmv/entry.c Wed Jun 6 04:38:25 2012 (r236655) +++ stable/8/sys/dev/hptmv/entry.c Wed Jun 6 04:38:45 2012 (r236656) @@ -108,6 +108,7 @@ static devclass_t hpt_devclass; #define __DRIVER_MODULE(p1, p2, p3, p4, p5, p6) DRIVER_MODULE(p1, p2, p3, p4, p5, p6) __DRIVER_MODULE(PROC_DIR_NAME, pci, hpt_pci_driver, hpt_devclass, 0, 0); +MODULE_DEPEND(PROC_DIR_NAME, cam, 1, 1, 1); #define ccb_ccb_ptr spriv_ptr0 #define ccb_adapter ccb_h.spriv_ptr1 Modified: stable/8/sys/dev/isp/isp_pci.c ============================================================================== --- stable/8/sys/dev/isp/isp_pci.c Wed Jun 6 04:38:25 2012 (r236655) +++ stable/8/sys/dev/isp/isp_pci.c Wed Jun 6 04:38:45 2012 (r236656) @@ -362,6 +362,8 @@ static driver_t isp_pci_driver = { }; static devclass_t isp_devclass; DRIVER_MODULE(isp, pci, isp_pci_driver, isp_devclass, 0, 0); +MODULE_DEPEND(isp, cam, 1, 1, 1); +MODULE_DEPEND(isp, firmware, 1, 1, 1); static int isp_pci_probe(device_t dev) Modified: stable/8/sys/dev/isp/isp_sbus.c ============================================================================== --- stable/8/sys/dev/isp/isp_sbus.c Wed Jun 6 04:38:25 2012 (r236655) +++ stable/8/sys/dev/isp/isp_sbus.c Wed Jun 6 04:38:45 2012 (r236656) @@ -106,6 +106,8 @@ static driver_t isp_sbus_driver = { }; static devclass_t isp_devclass; DRIVER_MODULE(isp, sbus, isp_sbus_driver, isp_devclass, 0, 0); +MODULE_DEPEND(isp, cam, 1, 1, 1); +MODULE_DEPEND(isp, firmware, 1, 1, 1); static int isp_sbus_probe(device_t dev) From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 04:39:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1CFA10656E1; Wed, 6 Jun 2012 04:39:05 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A33098FC18; Wed, 6 Jun 2012 04:39:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q564d5FM069308; Wed, 6 Jun 2012 04:39:05 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q564d5SQ069303; Wed, 6 Jun 2012 04:39:05 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206060439.q564d5SQ069303@svn.freebsd.org> From: Eitan Adler Date: Wed, 6 Jun 2012 04:39:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236657 - in stable/7/sys/dev: hptiop hptmv isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 04:39:05 -0000 Author: eadler Date: Wed Jun 6 04:39:05 2012 New Revision: 236657 URL: http://svn.freebsd.org/changeset/base/236657 Log: MFC r236379: Adding missing dependancies for loading hptiop(4), hptmv(4) and isp(4) as modules. PR: kern/166239 Approved by: cperciva (implicit) Modified: stable/7/sys/dev/hptiop/hptiop.c stable/7/sys/dev/hptmv/entry.c stable/7/sys/dev/isp/isp_pci.c stable/7/sys/dev/isp/isp_sbus.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/hptiop/hptiop.c ============================================================================== --- stable/7/sys/dev/hptiop/hptiop.c Wed Jun 6 04:38:45 2012 (r236656) +++ stable/7/sys/dev/hptiop/hptiop.c Wed Jun 6 04:39:05 2012 (r236657) @@ -1279,6 +1279,7 @@ static driver_t hptiop_pci_driver = { }; DRIVER_MODULE(hptiop, pci, hptiop_pci_driver, hptiop_devclass, 0, 0); +MODULE_DEPEND(hptiop, cam, 1, 1, 1); static int hptiop_probe(device_t dev) { Modified: stable/7/sys/dev/hptmv/entry.c ============================================================================== --- stable/7/sys/dev/hptmv/entry.c Wed Jun 6 04:38:45 2012 (r236656) +++ stable/7/sys/dev/hptmv/entry.c Wed Jun 6 04:39:05 2012 (r236657) @@ -107,6 +107,7 @@ static devclass_t hpt_devclass; #define __DRIVER_MODULE(p1, p2, p3, p4, p5, p6) DRIVER_MODULE(p1, p2, p3, p4, p5, p6) __DRIVER_MODULE(PROC_DIR_NAME, pci, hpt_pci_driver, hpt_devclass, 0, 0); +MODULE_DEPEND(PROC_DIR_NAME, cam, 1, 1, 1); #define ccb_ccb_ptr spriv_ptr0 #define ccb_adapter ccb_h.spriv_ptr1 Modified: stable/7/sys/dev/isp/isp_pci.c ============================================================================== --- stable/7/sys/dev/isp/isp_pci.c Wed Jun 6 04:38:45 2012 (r236656) +++ stable/7/sys/dev/isp/isp_pci.c Wed Jun 6 04:39:05 2012 (r236657) @@ -362,6 +362,8 @@ static driver_t isp_pci_driver = { }; static devclass_t isp_devclass; DRIVER_MODULE(isp, pci, isp_pci_driver, isp_devclass, 0, 0); +MODULE_DEPEND(isp, cam, 1, 1, 1); +MODULE_DEPEND(isp, firmware, 1, 1, 1); static int isp_pci_probe(device_t dev) Modified: stable/7/sys/dev/isp/isp_sbus.c ============================================================================== --- stable/7/sys/dev/isp/isp_sbus.c Wed Jun 6 04:38:45 2012 (r236656) +++ stable/7/sys/dev/isp/isp_sbus.c Wed Jun 6 04:39:05 2012 (r236657) @@ -106,6 +106,8 @@ static driver_t isp_sbus_driver = { }; static devclass_t isp_devclass; DRIVER_MODULE(isp, sbus, isp_sbus_driver, isp_devclass, 0, 0); +MODULE_DEPEND(isp, cam, 1, 1, 1); +MODULE_DEPEND(isp, firmware, 1, 1, 1); static int isp_sbus_probe(device_t dev) From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 06:19:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E14A1065692; Wed, 6 Jun 2012 06:19:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 078DD8FC16; Wed, 6 Jun 2012 06:19:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q566Jqkp073815; Wed, 6 Jun 2012 06:19:52 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q566JqXF073804; Wed, 6 Jun 2012 06:19:52 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201206060619.q566JqXF073804@svn.freebsd.org> From: Warner Losh Date: Wed, 6 Jun 2012 06:19:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236658 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 06:19:53 -0000 Author: imp Date: Wed Jun 6 06:19:52 2012 New Revision: 236658 URL: http://svn.freebsd.org/changeset/base/236658 Log: Enhance the Atmel SoC chip identification routines to account for more SoC variants. Fold the AT91SAM9XE chips into the AT91SAM9260 handling, where appropriate. The following SoCs/SoC families are recognized: at91cap9, at91rm9200, at91sam9260, at91sam9261, at91sam9263, at91sam9g10, at91sam9g20, at91sam9g45, at91sam9n12, at91sam9rl, at91sam9x5 and the following variations are also recognized: at91rm9200_bga, at91rm9200_pqfp, at91sam9xe, at91sam9g45, at91sam9m10, at91sam9g46, at91sam9m11, at91sam9g15, at91sam9g25, at91sam9g35, at91sam9x25, at91sam9x35 This is only the identification routine: no additional Atmel devices are supported at this time. # With these changes, I'm able to boot to the point of identification # on a few different Atmel SoCs that we don't yet support using the # KB920X config file -- someday tht will be an ATMEL config file... Modified: head/sys/arm/at91/at91.c head/sys/arm/at91/at91_machdep.c head/sys/arm/at91/at91_mci.c head/sys/arm/at91/at91_pmc.c head/sys/arm/at91/at91reg.h head/sys/arm/at91/at91rm9200.c head/sys/arm/at91/at91sam9260.c head/sys/arm/at91/at91sam9g20.c head/sys/arm/at91/at91var.h Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Wed Jun 6 04:39:05 2012 (r236657) +++ head/sys/arm/at91/at91.c Wed Jun 6 06:19:52 2012 (r236658) @@ -54,8 +54,6 @@ static void at91_eoi(void *); extern const struct pmap_devmap at91_devmap[]; -uint32_t at91_chip_id; - uint32_t at91_master_clock; static int Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Wed Jun 6 04:39:05 2012 (r236657) +++ head/sys/arm/at91/at91_machdep.c Wed Jun 6 06:19:52 2012 (r236658) @@ -232,6 +232,156 @@ at91_ramsize(void) return (1 << (cols + rows + banks + bw)); } +const char *soc_type_name[] = { + [AT91_T_CAP9] = "at91cap9", + [AT91_T_RM9200] = "at91rm9200", + [AT91_T_SAM9260] = "at91sam9260", + [AT91_T_SAM9261] = "at91sam9261", + [AT91_T_SAM9263] = "at91sam9263", + [AT91_T_SAM9G10] = "at91sam9g10", + [AT91_T_SAM9G20] = "at91sam9g20", + [AT91_T_SAM9G45] = "at91sam9g45", + [AT91_T_SAM9N12] = "at91sam9n12", + [AT91_T_SAM9RL] = "at91sam9rl", + [AT91_T_SAM9X5] = "at91sam9x5", + [AT91_T_NONE] = "UNKNOWN" +}; + +const char *soc_subtype_name[] = { + [AT91_ST_NONE] = "UNKNOWN", + [AT91_ST_RM9200_BGA] = "at91rm9200_bga", + [AT91_ST_RM9200_PQFP] = "at91rm9200_pqfp", + [AT91_ST_SAM9XE] = "at91sam9xe", + [AT91_ST_SAM9G45] = "at91sam9g45", + [AT91_ST_SAM9M10] = "at91sam9m10", + [AT91_ST_SAM9G46] = "at91sam9g46", + [AT91_ST_SAM9M11] = "at91sam9m11", + [AT91_ST_SAM9G15] = "at91sam9g15", + [AT91_ST_SAM9G25] = "at91sam9g25", + [AT91_ST_SAM9G35] = "at91sam9g35", + [AT91_ST_SAM9X25] = "at91sam9x25", + [AT91_ST_SAM9X35] = "at91sam9x35", +}; + +#define AT91_DBGU0 0x0ffff200 /* Most */ +#define AT91_DBGU1 0x0fffee00 /* SAM9263, CAP9, and SAM9G45 */ + +struct at91_soc_info soc_data; + +/* + * Read the SoC ID from the CIDR register and try to match it against the + * values we know. If we find a good one, we return true. If not, we + * return false. When we find a good one, we also find the subtype + * and CPU family. + */ +static int +at91_try_id(uint32_t dbgu_base) +{ + uint32_t socid; + + soc_data.cidr = *(volatile uint32_t *)(AT91_BASE + dbgu_base + DBGU_C1R); + socid = soc_data.cidr & ~AT91_CPU_VERSION_MASK; + + soc_data.type = AT91_T_NONE; + soc_data.subtype = AT91_ST_NONE; + soc_data.family = (soc_data.cidr & AT91_CPU_FAMILY_MASK) >> 20; + soc_data.exid = *(volatile uint32_t *)(AT91_BASE + dbgu_base + DBGU_C2R); + + switch (socid) { + case AT91_CPU_CAP9: + soc_data.type = AT91_T_CAP9; + break; + case AT91_CPU_RM9200: + soc_data.type = AT91_T_RM9200; + break; + case AT91_CPU_SAM9XE128: + case AT91_CPU_SAM9XE256: + case AT91_CPU_SAM9XE512: + case AT91_CPU_SAM9260: + soc_data.type = AT91_T_SAM9260; + if (soc_data.family == AT91_FAMILY_SAM9XE) + soc_data.subtype = AT91_ST_SAM9XE; + break; + case AT91_CPU_SAM9261: + soc_data.type = AT91_T_SAM9261; + break; + case AT91_CPU_SAM9263: + soc_data.type = AT91_T_SAM9263; + break; + case AT91_CPU_SAM9G10: + soc_data.type = AT91_T_SAM9G10; + break; + case AT91_CPU_SAM9G20: + soc_data.type = AT91_T_SAM9G20; + break; + case AT91_CPU_SAM9G45: + soc_data.type = AT91_T_SAM9G45; + break; + case AT91_CPU_SAM9N12: + soc_data.type = AT91_T_SAM9N12; + break; + case AT91_CPU_SAM9RL64: + soc_data.type = AT91_T_SAM9RL; + break; + case AT91_CPU_SAM9X5: + soc_data.type = AT91_T_SAM9X5; + break; + default: + return 0; + } + + switch (soc_data.type) { + case AT91_T_SAM9G45: + switch (soc_data.exid) { + case AT91_EXID_SAM9G45: + soc_data.subtype = AT91_ST_SAM9G45; + break; + case AT91_EXID_SAM9G46: + soc_data.subtype = AT91_ST_SAM9G46; + break; + case AT91_EXID_SAM9M10: + soc_data.subtype = AT91_ST_SAM9M10; + break; + case AT91_EXID_SAM9M11: + soc_data.subtype = AT91_ST_SAM9M11; + break; + } + break; + case AT91_T_SAM9X5: + switch (soc_data.exid) { + case AT91_EXID_SAM9G15: + soc_data.subtype = AT91_ST_SAM9G15; + break; + case AT91_EXID_SAM9G25: + soc_data.subtype = AT91_ST_SAM9G25; + break; + case AT91_EXID_SAM9G35: + soc_data.subtype = AT91_ST_SAM9G35; + break; + case AT91_EXID_SAM9X25: + soc_data.subtype = AT91_ST_SAM9X25; + break; + case AT91_EXID_SAM9X35: + soc_data.subtype = AT91_ST_SAM9X35; + break; + } + break; + default: + break; + } + snprintf(soc_data.name, sizeof(soc_data.name), "%s%s%s", soc_type_name[soc_data.type], + soc_data.subtype == AT91_ST_NONE ? "" : " subtype ", + soc_data.subtype == AT91_ST_NONE ? "" : soc_subtype_name[soc_data.subtype]); + return 1; +} + +static void +at91_soc_id(void) +{ + if (!at91_try_id(AT91_DBGU0)) + at91_try_id(AT91_DBGU1); +} + void * initarm(struct arm_boot_params *abp) { @@ -355,12 +505,11 @@ initarm(struct arm_boot_params *abp) cpu_tlb_flushID(); cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)); + at91_soc_id(); + /* Initialize all the clocks, so that the console can work */ at91_pmc_init_clock(); - /* Get chip id so device drivers know about differences */ - at91_chip_id = *(uint32_t *)(AT91_BASE + AT91_DBGU_BASE + DBGU_C1R); - cninit(); memsize = board_init(); Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Wed Jun 6 04:39:05 2012 (r236657) +++ head/sys/arm/at91/at91_mci.c Wed Jun 6 06:19:52 2012 (r236658) @@ -313,23 +313,17 @@ static int at91_mci_is_mci1rev2xx(void) { - switch (AT91_CPU(at91_chip_id)) { - case AT91_CPU_SAM9260: - case AT91_CPU_SAM9263: -#ifdef notyet - case AT91_CPU_CAP9: -#endif - case AT91_CPU_SAM9G10: - case AT91_CPU_SAM9G20: -#ifdef notyet - case AT91_CPU_SAM9RL: -#endif - case AT91_CPU_SAM9XE128: - case AT91_CPU_SAM9XE256: - case AT91_CPU_SAM9XE512: + switch (soc_data.type) { + case AT91_T_SAM9260: + case AT91_T_SAM9263: + case AT91_T_CAP9: + case AT91_T_SAM9G10: + case AT91_T_SAM9G20: + case AT91_T_SAM9RL: return(1); + default: + return (0); } - return (0); } static void Modified: head/sys/arm/at91/at91_pmc.c ============================================================================== --- head/sys/arm/at91/at91_pmc.c Wed Jun 6 04:39:05 2012 (r236657) +++ head/sys/arm/at91/at91_pmc.c Wed Jun 6 06:19:52 2012 (r236658) @@ -471,7 +471,7 @@ at91_pmc_init_clock(void) at91_pmc_pll_rate(&plla, RD4(sc, CKGR_PLLAR)); - if (at91_cpu_is(AT91_CPU_SAM9G45) && (mckr & PMC_MCKR_PLLADIV2)) + if (at91_cpu_is(AT91_T_SAM9G45) && (mckr & PMC_MCKR_PLLADIV2)) plla.hz /= 2; /* @@ -512,7 +512,7 @@ at91_pmc_init_clock(void) mck.hz /= (1 + mdiv); /* Only found on SAM9G20 */ - if (at91_cpu_is(AT91_CPU_SAM9G20)) + if (at91_cpu_is(AT91_T_SAM9G20)) cpu.hz /= (mckr & PMC_MCKR_PDIV) ? 2 : 1; at91_master_clock = mck.hz; Modified: head/sys/arm/at91/at91reg.h ============================================================================== --- head/sys/arm/at91/at91reg.h Wed Jun 6 04:39:05 2012 (r236657) +++ head/sys/arm/at91/at91reg.h Wed Jun 6 06:19:52 2012 (r236658) @@ -46,32 +46,40 @@ #define AT91_SYS_BASE 0xffff000 #define AT91_SYS_SIZE 0x1000 -#if defined(AT91SAM9G45) || defined(AT91SAM9263) -#define AT91_DBGU_BASE 0xfffee00 -#else -#define AT91_DBGU_BASE 0xffff200 -#endif #define AT91_DBGU_SIZE 0x200 #define DBGU_C1R (64) /* Chip ID1 Register */ #define DBGU_C2R (68) /* Chip ID2 Register */ #define DBGU_FNTR (72) /* Force NTRST Register */ #define AT91_CPU_VERSION_MASK 0x0000001f -#define AT91_CPU_RM9200 0x09290780 -#define AT91_CPU_SAM9260 0x019803a0 -#define AT91_CPU_SAM9261 0x019703a0 -#define AT91_CPU_SAM9263 0x019607a0 -#define AT91_CPU_SAM9G10 0x819903a0 -#define AT91_CPU_SAM9G20 0x019905a0 -#define AT91_CPU_SAM9G45 0x819b05a0 +#define AT91_CPU_FAMILY_MASK 0x0ff00000 + +#define AT91_CPU_RM9200 0x09290780 +#define AT91_CPU_SAM9260 0x019803a0 +#define AT91_CPU_SAM9261 0x019703a0 +#define AT91_CPU_SAM9263 0x019607a0 +#define AT91_CPU_SAM9G10 0x819903a0 +#define AT91_CPU_SAM9G20 0x019905a0 +#define AT91_CPU_SAM9G45 0x819b05a0 +#define AT91_CPU_SAM9N12 0x819a07a0 +#define AT91_CPU_SAM9RL64 0x019b03a0 +#define AT91_CPU_SAM9X5 0x819a05a0 + #define AT91_CPU_SAM9XE128 0x329973a0 #define AT91_CPU_SAM9XE256 0x329a93a0 #define AT91_CPU_SAM9XE512 0x329aa3a0 -#define AT91_ARCH(chipid) ((chipid >> 20) & 0xff) -#define AT91_CPU(chipid) (chipid & ~AT91_CPU_VERSION_MASK) -#define AT91_ARCH_SAM9 (0x19) -#define AT91_ARCH_SAM9XE (0x29) -#define AT91_ARCH_RM92 (0x92) +#define AT91_CPU_CAP9 0x039a03a0 + +#define AT91_EXID_SAM9M11 0x00000001 +#define AT91_EXID_SAM9M10 0x00000002 +#define AT91_EXID_SAM9G46 0x00000003 +#define AT91_EXID_SAM9G45 0x00000004 + +#define AT91_EXID_SAM9G15 0x00000000 +#define AT91_EXID_SAM9G35 0x00000001 +#define AT91_EXID_SAM9X35 0x00000002 +#define AT91_EXID_SAM9G25 0x00000003 +#define AT91_EXID_SAM9X25 0x00000004 #endif /* _AT91REG_H_ */ Modified: head/sys/arm/at91/at91rm9200.c ============================================================================== --- head/sys/arm/at91/at91rm9200.c Wed Jun 6 04:39:05 2012 (r236657) +++ head/sys/arm/at91/at91rm9200.c Wed Jun 6 06:19:52 2012 (r236658) @@ -197,7 +197,7 @@ static void at91_identify(driver_t *drv, device_t parent) { - if (at91_cpu_is(AT91_CPU_RM9200)) { + if (at91_cpu_is(AT91_T_RM9200)) { at91_add_child(parent, 0, "at91rm920", 0, 0, 0, -1, 0, 0); at91_cpu_add_builtin_children(parent); } @@ -207,11 +207,8 @@ static int at91_probe(device_t dev) { - if (at91_cpu_is(AT91_CPU_RM9200)) { - device_set_desc(dev, "AT91RM9200"); - return (0); - } - return (ENXIO); + device_set_desc(dev, soc_data.name); + return (0); } static int Modified: head/sys/arm/at91/at91sam9260.c ============================================================================== --- head/sys/arm/at91/at91sam9260.c Wed Jun 6 04:39:05 2012 (r236657) +++ head/sys/arm/at91/at91sam9260.c Wed Jun 6 06:19:52 2012 (r236658) @@ -197,11 +197,7 @@ static void at91_identify(driver_t *drv, device_t parent) { - switch (AT91_CPU(at91_chip_id)) { - case AT91_CPU_SAM9260: - case AT91_CPU_SAM9XE128: - case AT91_CPU_SAM9XE256: - case AT91_CPU_SAM9XE512: + if (soc_data.type == AT91_CPU_SAM9260) { at91_add_child(parent, 0, "at91sam9260", 0, 0, 0, -1, 0, 0); at91_cpu_add_builtin_children(parent); break; @@ -211,25 +207,8 @@ at91_identify(driver_t *drv, device_t pa static int at91_probe(device_t dev) { - const char *desc; - switch (AT91_CPU(at91_chip_id)) { - case AT91_CPU_SAM9260: - desc = "AT91SAM9260"; - break; - case AT91_CPU_SAM9XE128: - desc = "AT91SAM9XE128"; - break; - case AT91_CPU_SAM9XE256: - desc = "AT91SAM9XE256"; - break; - case AT91_CPU_SAM9XE512: - desc = "AT91SAM9XE512"; - break; - default: - return (ENXIO); - } - device_set_desc(dev, desc); + device_set_desc(dev, soc_data.name); return (0); } Modified: head/sys/arm/at91/at91sam9g20.c ============================================================================== --- head/sys/arm/at91/at91sam9g20.c Wed Jun 6 04:39:05 2012 (r236657) +++ head/sys/arm/at91/at91sam9g20.c Wed Jun 6 06:19:52 2012 (r236658) @@ -137,8 +137,8 @@ at91_add_child(device_t dev, int prio, c kid = device_add_child_ordered(dev, prio, name, unit); if (kid == NULL) { - printf("Can't add child %s%d ordered\n", name, unit); - return; + printf("Can't add child %s%d ordered\n", name, unit); + return; } ivar = malloc(sizeof(*ivar), M_DEVBUF, M_NOWAIT | M_ZERO); if (ivar == NULL) { @@ -204,7 +204,7 @@ static void at91_identify(driver_t *drv, device_t parent) { - if (at91_cpu_is(AT91_CPU_SAM9G20)) { + if (at91_cpu_is(AT91_T_SAM9G20)) { at91_add_child(parent, 0, "at91sam", 9, 0, 0, -1, 0, 0); at91_cpu_add_builtin_children(parent); } @@ -214,11 +214,8 @@ static int at91_probe(device_t dev) { - if (at91_cpu_is(AT91_CPU_SAM9G20)) { - device_set_desc(dev, "AT91SAM9G20"); - return (0); - } - return (ENXIO); + device_set_desc(dev, soc_data.name); + return (0); } static int Modified: head/sys/arm/at91/at91var.h ============================================================================== --- head/sys/arm/at91/at91var.h Wed Jun 6 04:39:05 2012 (r236657) +++ head/sys/arm/at91/at91var.h Wed Jun 6 06:19:52 2012 (r236658) @@ -59,7 +59,59 @@ struct cpu_devs const char *parent_clk; }; -extern uint32_t at91_chip_id; +enum at91_soc_type { + AT91_T_NONE = 0, + AT91_T_CAP9, + AT91_T_RM9200, + AT91_T_SAM9260, + AT91_T_SAM9261, + AT91_T_SAM9263, + AT91_T_SAM9G10, + AT91_T_SAM9G20, + AT91_T_SAM9G45, + AT91_T_SAM9N12, + AT91_T_SAM9RL, + AT91_T_SAM9X5, +}; + +enum at91_soc_subtype { + AT91_ST_NONE = 0, + /* AT91RM9200 */ + AT91_ST_RM9200_BGA, + AT91_ST_RM9200_PQFP, + /* AT91SAM9260 */ + AT91_ST_SAM9XE, + /* AT91SAM9G45 */ + AT91_ST_SAM9G45, + AT91_ST_SAM9M10, + AT91_ST_SAM9G46, + AT91_ST_SAM9M11, + /* AT91SAM9X5 */ + AT91_ST_SAM9G15, + AT91_ST_SAM9G25, + AT91_ST_SAM9G35, + AT91_ST_SAM9X25, + AT91_ST_SAM9X35, +}; + +enum at91_soc_family { + AT91_FAMILY_SAM9 = 0x19, + AT91_FAMILY_SAM9XE = 0x29, + AT91_FAMILY_RM92 = 0x92, +}; + +#define AT91_SOC_NAME_MAX 50 + +struct at91_soc_info { + enum at91_soc_type type; + enum at91_soc_subtype subtype; + enum at91_soc_family family; + uint32_t cidr; + uint32_t exid; + char name[AT91_SOC_NAME_MAX]; +}; + +extern struct at91_soc_info soc_data; static inline int at91_is_rm92(void); static inline int at91_is_sam9(void); @@ -70,33 +122,32 @@ static inline int at91_is_rm92(void) { - return (AT91_ARCH(at91_chip_id) == AT91_ARCH_RM92); + return (soc_data.type == AT91_T_RM9200); } static inline int at91_is_sam9(void) { - return (AT91_ARCH(at91_chip_id) == AT91_ARCH_SAM9); + return (soc_data.family == AT91_FAMILY_SAM9); } static inline int at91_is_sam9xe(void) { - return (AT91_ARCH(at91_chip_id) == AT91_ARCH_SAM9XE); + return (soc_data.family == AT91_FAMILY_SAM9XE); } static inline int at91_cpu_is(u_int cpu) { - return (AT91_CPU(at91_chip_id) == cpu); + return (soc_data.type == cpu); } extern uint32_t at91_irq_system; extern uint32_t at91_master_clock; - void at91_pmc_init_clock(void); #endif /* _AT91VAR_H_ */ From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 06:32:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18DF81065676; Wed, 6 Jun 2012 06:32:51 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04ADE8FC19; Wed, 6 Jun 2012 06:32:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q566Wo0e074435; Wed, 6 Jun 2012 06:32:50 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q566WoDl074433; Wed, 6 Jun 2012 06:32:50 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206060632.q566WoDl074433@svn.freebsd.org> From: Eitan Adler Date: Wed, 6 Jun 2012 06:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236659 - stable/9/sys/dev/vxge/vxgehal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 06:32:51 -0000 Author: eadler Date: Wed Jun 6 06:32:50 2012 New Revision: 236659 URL: http://svn.freebsd.org/changeset/base/236659 Log: MFC r236377: Fix bug revealed by warning generated by clang: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] Approved by: cperciva (implicit) Modified: stable/9/sys/dev/vxge/vxgehal/vxgehal-channel.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/vxge/vxgehal/vxgehal-channel.h ============================================================================== --- stable/9/sys/dev/vxge/vxgehal/vxgehal-channel.h Wed Jun 6 06:19:52 2012 (r236658) +++ stable/9/sys/dev/vxge/vxgehal/vxgehal-channel.h Wed Jun 6 06:32:50 2012 (r236659) @@ -291,7 +291,7 @@ __hal_channel_dtr_restore(__hal_channel_ else dtr_index = channel->reserve_index - 1; - if ((channel->dtr_arr[dtr_index].dtr == dtrh)) { + if ((channel->dtr_arr[dtr_index].dtr = dtrh) != NULL) { channel->reserve_index = dtr_index; channel->dtr_arr[dtr_index].state = VXGE_HAL_CHANNEL_DTR_FREE; From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 06:35:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9396C1065674; Wed, 6 Jun 2012 06:35:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7ECEE8FC1A; Wed, 6 Jun 2012 06:35:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q566ZAY6074618; Wed, 6 Jun 2012 06:35:10 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q566ZAge074616; Wed, 6 Jun 2012 06:35:10 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206060635.q566ZAge074616@svn.freebsd.org> From: Eitan Adler Date: Wed, 6 Jun 2012 06:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236660 - stable/9/sbin/camcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 06:35:10 -0000 Author: eadler Date: Wed Jun 6 06:35:09 2012 New Revision: 236660 URL: http://svn.freebsd.org/changeset/base/236660 Log: MFC r236285: Add missing flag enable when certain arguments are parsed PR: bin/163053 Approved by: cperciva (implicit) Modified: stable/9/sbin/camcontrol/camcontrol.c Directory Properties: stable/9/sbin/camcontrol/ (props changed) Modified: stable/9/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.c Wed Jun 6 06:32:50 2012 (r236659) +++ stable/9/sbin/camcontrol/camcontrol.c Wed Jun 6 06:35:09 2012 (r236660) @@ -3385,6 +3385,7 @@ ratecontrol(struct cam_device *device, i spi->flags &= ~CTS_SPI_FLAGS_DISC_ENB; else spi->flags |= CTS_SPI_FLAGS_DISC_ENB; + didsettings++; } if (scsi && tag_enable != -1) { if ((cpi.hba_inquiry & PI_TAG_ABLE) == 0) { From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 06:35:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E0CAF10656DF; Wed, 6 Jun 2012 06:35:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC59C8FC1E; Wed, 6 Jun 2012 06:35:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q566ZTtJ074666; Wed, 6 Jun 2012 06:35:29 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q566ZT9L074664; Wed, 6 Jun 2012 06:35:29 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206060635.q566ZT9L074664@svn.freebsd.org> From: Eitan Adler Date: Wed, 6 Jun 2012 06:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236661 - stable/8/sbin/camcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 06:35:30 -0000 Author: eadler Date: Wed Jun 6 06:35:29 2012 New Revision: 236661 URL: http://svn.freebsd.org/changeset/base/236661 Log: MFC r236285: Add missing flag enable when certain arguments are parsed PR: bin/163053 Approved by: cperciva (implicit) Modified: stable/8/sbin/camcontrol/camcontrol.c Directory Properties: stable/8/sbin/camcontrol/ (props changed) Modified: stable/8/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/8/sbin/camcontrol/camcontrol.c Wed Jun 6 06:35:09 2012 (r236660) +++ stable/8/sbin/camcontrol/camcontrol.c Wed Jun 6 06:35:29 2012 (r236661) @@ -3321,6 +3321,7 @@ ratecontrol(struct cam_device *device, i spi->flags &= ~CTS_SPI_FLAGS_DISC_ENB; else spi->flags |= CTS_SPI_FLAGS_DISC_ENB; + didsettings++; } if (scsi && tag_enable != -1) { if ((cpi.hba_inquiry & PI_TAG_ABLE) == 0) { From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 06:35:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8D4C310657B8; Wed, 6 Jun 2012 06:35:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 780D48FC1C; Wed, 6 Jun 2012 06:35:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q566ZmoV074713; Wed, 6 Jun 2012 06:35:48 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q566Zm8T074711; Wed, 6 Jun 2012 06:35:48 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206060635.q566Zm8T074711@svn.freebsd.org> From: Eitan Adler Date: Wed, 6 Jun 2012 06:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236662 - stable/7/sbin/camcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 06:35:48 -0000 Author: eadler Date: Wed Jun 6 06:35:47 2012 New Revision: 236662 URL: http://svn.freebsd.org/changeset/base/236662 Log: MFC r236285: Add missing flag enable when certain arguments are parsed PR: bin/163053 Approved by: cperciva (implicit) Modified: stable/7/sbin/camcontrol/camcontrol.c Directory Properties: stable/7/sbin/camcontrol/ (props changed) Modified: stable/7/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/7/sbin/camcontrol/camcontrol.c Wed Jun 6 06:35:29 2012 (r236661) +++ stable/7/sbin/camcontrol/camcontrol.c Wed Jun 6 06:35:47 2012 (r236662) @@ -2734,6 +2734,7 @@ ratecontrol(struct cam_device *device, i spi->flags &= ~CTS_SPI_FLAGS_DISC_ENB; else spi->flags |= CTS_SPI_FLAGS_DISC_ENB; + didsettings++; } if (scsi && tag_enable != -1) { From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 06:38:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C40AD1065675; Wed, 6 Jun 2012 06:38:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEF428FC16; Wed, 6 Jun 2012 06:38:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q566cud1074933; Wed, 6 Jun 2012 06:38:56 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q566cuY0074931; Wed, 6 Jun 2012 06:38:56 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206060638.q566cuY0074931@svn.freebsd.org> From: Eitan Adler Date: Wed, 6 Jun 2012 06:38:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236663 - stable/9/usr.sbin/lpr/lpr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 06:38:56 -0000 Author: eadler Date: Wed Jun 6 06:38:56 2012 New Revision: 236663 URL: http://svn.freebsd.org/changeset/base/236663 Log: MFC r236289: Relax security permissions on '.seq' file creation - the strict, but odd permissions resulted in a security alert from 110.neggrpperm PR: bin/165533 Approved by: cperciva (implicit) Modified: stable/9/usr.sbin/lpr/lpr/lpr.c Directory Properties: stable/9/usr.sbin/lpr/ (props changed) Modified: stable/9/usr.sbin/lpr/lpr/lpr.c ============================================================================== --- stable/9/usr.sbin/lpr/lpr/lpr.c Wed Jun 6 06:35:47 2012 (r236662) +++ stable/9/usr.sbin/lpr/lpr/lpr.c Wed Jun 6 06:38:56 2012 (r236663) @@ -846,7 +846,7 @@ mktemps(const struct printer *pp) (void) snprintf(buf, sizeof(buf), "%s/.seq", pp->spool_dir); seteuid(euid); - if ((fd = open(buf, O_RDWR|O_CREAT, 0661)) < 0) { + if ((fd = open(buf, O_RDWR|O_CREAT, 0664)) < 0) { printf("%s: cannot create %s\n", progname, buf); exit(1); } From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 06:39:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E65C10656AD; Wed, 6 Jun 2012 06:39:15 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68AF08FC1B; Wed, 6 Jun 2012 06:39:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q566dFXu074980; Wed, 6 Jun 2012 06:39:15 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q566dFgE074978; Wed, 6 Jun 2012 06:39:15 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206060639.q566dFgE074978@svn.freebsd.org> From: Eitan Adler Date: Wed, 6 Jun 2012 06:39:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236664 - stable/8/usr.sbin/lpr/lpr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 06:39:15 -0000 Author: eadler Date: Wed Jun 6 06:39:14 2012 New Revision: 236664 URL: http://svn.freebsd.org/changeset/base/236664 Log: MFC r236289: Relax security permissions on '.seq' file creation - the strict, but odd permissions resulted in a security alert from 110.neggrpperm PR: bin/165533 Approved by: cperciva (implicit) Modified: stable/8/usr.sbin/lpr/lpr/lpr.c Directory Properties: stable/8/usr.sbin/lpr/ (props changed) Modified: stable/8/usr.sbin/lpr/lpr/lpr.c ============================================================================== --- stable/8/usr.sbin/lpr/lpr/lpr.c Wed Jun 6 06:38:56 2012 (r236663) +++ stable/8/usr.sbin/lpr/lpr/lpr.c Wed Jun 6 06:39:14 2012 (r236664) @@ -846,7 +846,7 @@ mktemps(const struct printer *pp) (void) snprintf(buf, sizeof(buf), "%s/.seq", pp->spool_dir); seteuid(euid); - if ((fd = open(buf, O_RDWR|O_CREAT, 0661)) < 0) { + if ((fd = open(buf, O_RDWR|O_CREAT, 0664)) < 0) { printf("%s: cannot create %s\n", progname, buf); exit(1); } From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 06:39:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A4A11065936; Wed, 6 Jun 2012 06:39:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 853A28FC08; Wed, 6 Jun 2012 06:39:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q566dZng075028; Wed, 6 Jun 2012 06:39:35 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q566dZJV075026; Wed, 6 Jun 2012 06:39:35 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206060639.q566dZJV075026@svn.freebsd.org> From: Eitan Adler Date: Wed, 6 Jun 2012 06:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236665 - stable/7/usr.sbin/lpr/lpr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 06:39:35 -0000 Author: eadler Date: Wed Jun 6 06:39:34 2012 New Revision: 236665 URL: http://svn.freebsd.org/changeset/base/236665 Log: MFC r236289: Relax security permissions on '.seq' file creation - the strict, but odd permissions resulted in a security alert from 110.neggrpperm PR: bin/165533 Approved by: cperciva (implicit) Modified: stable/7/usr.sbin/lpr/lpr/lpr.c Directory Properties: stable/7/usr.sbin/lpr/ (props changed) Modified: stable/7/usr.sbin/lpr/lpr/lpr.c ============================================================================== --- stable/7/usr.sbin/lpr/lpr/lpr.c Wed Jun 6 06:39:14 2012 (r236664) +++ stable/7/usr.sbin/lpr/lpr/lpr.c Wed Jun 6 06:39:34 2012 (r236665) @@ -846,7 +846,7 @@ mktemps(const struct printer *pp) (void) snprintf(buf, sizeof(buf), "%s/.seq", pp->spool_dir); seteuid(euid); - if ((fd = open(buf, O_RDWR|O_CREAT, 0661)) < 0) { + if ((fd = open(buf, O_RDWR|O_CREAT, 0664)) < 0) { printf("%s: cannot create %s\n", progname, buf); exit(1); } From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 06:52:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73B7C106566C; Wed, 6 Jun 2012 06:52:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E7118FC16; Wed, 6 Jun 2012 06:52:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q566qqMp075713; Wed, 6 Jun 2012 06:52:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q566qquT075707; Wed, 6 Jun 2012 06:52:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206060652.q566qquT075707@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Jun 2012 06:52:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236666 - in head/sys: cam/ata dev/ahci dev/ata dev/mvs dev/siis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 06:52:52 -0000 Author: mav Date: Wed Jun 6 06:52:51 2012 New Revision: 236666 URL: http://svn.freebsd.org/changeset/base/236666 Log: ATA/SATA controllers have no idea about protocol of the connected device until transport will do some probe actions (at least soft reset). Make ATA/SATA SIMs to not report bogus and confusing PROTO_ATA protocol. Make ATA/SATA transport to fill that gap by reporting protocol to SIM with XPT_SET_TRAN_SETTINGS and patching XPT_GET_TRAN_SETTINGS results if needed. Modified: head/sys/cam/ata/ata_xpt.c head/sys/dev/ahci/ahci.c head/sys/dev/ata/ata-all.c head/sys/dev/mvs/mvs.c head/sys/dev/siis/siis.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Wed Jun 6 06:39:34 2012 (r236665) +++ head/sys/cam/ata/ata_xpt.c Wed Jun 6 06:52:51 2012 (r236666) @@ -942,9 +942,9 @@ noerror: xpt_action((union ccb *)&cts); } } + ata_device_transport(path); if (changed) proberequestdefaultnegotiation(periph); - ata_device_transport(path); PROBE_SET_ACTION(softc, PROBE_SETMODE); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); @@ -1123,6 +1123,9 @@ notsata: snprintf(ident_buf->revision, sizeof(ident_buf->revision), "%04x", softc->pm_prv); path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; + ata_device_transport(path); + if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) + proberequestdefaultnegotiation(periph); /* Set supported bits. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); @@ -1200,6 +1203,9 @@ notsata: path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; } + ata_device_transport(path); + if (changed) + proberequestdefaultnegotiation(periph); if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) { path->device->flags &= ~CAM_DEV_UNCONFIGURED; @@ -1777,6 +1783,12 @@ ata_get_transfer_settings(struct ccb_tra sim = cts->ccb_h.path->bus->sim; (*(sim->sim_action))(sim, (union ccb *)cts); + if (cts->protocol == PROTO_UNKNOWN || + cts->protocol == PROTO_UNSPECIFIED) { + cts->protocol = device->protocol; + cts->protocol_version = device->protocol_version; + } + if (cts->protocol == PROTO_ATA) { ata = &cts->proto_specific.ata; if ((ata->valid & CTS_ATA_VALID_TQ) == 0) { @@ -1797,6 +1809,12 @@ ata_get_transfer_settings(struct ccb_tra scsi->flags |= CTS_SCSI_FLAGS_TAG_ENB; } } + + if (cts->transport == XPORT_UNKNOWN || + cts->transport == XPORT_UNSPECIFIED) { + cts->transport = device->transport; + cts->transport_version = device->transport_version; + } } static void Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Wed Jun 6 06:39:34 2012 (r236665) +++ head/sys/dev/ahci/ahci.c Wed Jun 6 06:52:51 2012 (r236666) @@ -2881,7 +2881,7 @@ ahciaction(struct cam_sim *sim, union cc d = &ch->curr[ccb->ccb_h.target_id]; else d = &ch->user[ccb->ccb_h.target_id]; - cts->protocol = PROTO_ATA; + cts->protocol = PROTO_UNSPECIFIED; cts->protocol_version = PROTO_VERSION_UNSPECIFIED; cts->transport = XPORT_SATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; @@ -2967,7 +2967,7 @@ ahciaction(struct cam_sim *sim, union cc cpi->unit_number = cam_sim_unit(sim); cpi->transport = XPORT_SATA; cpi->transport_version = XPORT_VERSION_UNSPECIFIED; - cpi->protocol = PROTO_ATA; + cpi->protocol = PROTO_UNSPECIFIED; cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; cpi->maxio = MAXPHYS; /* ATI SB600 can't handle 256 sectors with FPDMA (NCQ). */ Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Wed Jun 6 06:39:34 2012 (r236665) +++ head/sys/dev/ata/ata-all.c Wed Jun 6 06:52:51 2012 (r236666) @@ -1787,7 +1787,7 @@ ataaction(struct cam_sim *sim, union ccb d = &ch->curr[ccb->ccb_h.target_id]; else d = &ch->user[ccb->ccb_h.target_id]; - cts->protocol = PROTO_ATA; + cts->protocol = PROTO_UNSPECIFIED; cts->protocol_version = PROTO_VERSION_UNSPECIFIED; if (ch->flags & ATA_SATA) { cts->transport = XPORT_SATA; @@ -1875,7 +1875,7 @@ ataaction(struct cam_sim *sim, union ccb else cpi->transport = XPORT_ATA; cpi->transport_version = XPORT_VERSION_UNSPECIFIED; - cpi->protocol = PROTO_ATA; + cpi->protocol = PROTO_UNSPECIFIED; cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; cpi->maxio = ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS; if (device_get_devclass(device_get_parent(parent)) == Modified: head/sys/dev/mvs/mvs.c ============================================================================== --- head/sys/dev/mvs/mvs.c Wed Jun 6 06:39:34 2012 (r236665) +++ head/sys/dev/mvs/mvs.c Wed Jun 6 06:52:51 2012 (r236666) @@ -2301,7 +2301,7 @@ mvsaction(struct cam_sim *sim, union ccb d = &ch->curr[ccb->ccb_h.target_id]; else d = &ch->user[ccb->ccb_h.target_id]; - cts->protocol = PROTO_ATA; + cts->protocol = PROTO_UNSPECIFIED; cts->protocol_version = PROTO_VERSION_UNSPECIFIED; cts->transport = XPORT_SATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; @@ -2385,7 +2385,7 @@ mvsaction(struct cam_sim *sim, union ccb cpi->unit_number = cam_sim_unit(sim); cpi->transport = XPORT_SATA; cpi->transport_version = XPORT_VERSION_UNSPECIFIED; - cpi->protocol = PROTO_ATA; + cpi->protocol = PROTO_UNSPECIFIED; cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; cpi->maxio = MAXPHYS; if ((ch->quirks & MVS_Q_SOC) == 0) { Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Wed Jun 6 06:39:34 2012 (r236665) +++ head/sys/dev/siis/siis.c Wed Jun 6 06:52:51 2012 (r236666) @@ -1884,7 +1884,7 @@ siisaction(struct cam_sim *sim, union cc d = &ch->curr[ccb->ccb_h.target_id]; else d = &ch->user[ccb->ccb_h.target_id]; - cts->protocol = PROTO_ATA; + cts->protocol = PROTO_UNSPECIFIED; cts->protocol_version = PROTO_VERSION_UNSPECIFIED; cts->transport = XPORT_SATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; @@ -1960,7 +1960,7 @@ siisaction(struct cam_sim *sim, union cc cpi->unit_number = cam_sim_unit(sim); cpi->transport = XPORT_SATA; cpi->transport_version = XPORT_VERSION_UNSPECIFIED; - cpi->protocol = PROTO_ATA; + cpi->protocol = PROTO_UNSPECIFIED; cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; cpi->maxio = MAXPHYS; cpi->hba_vendor = pci_get_vendor(parent); From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 07:46:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B951E106566C; Wed, 6 Jun 2012 07:46:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F4548FC1D; Wed, 6 Jun 2012 07:46:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q567kFDE078154; Wed, 6 Jun 2012 07:46:15 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q567kFJ7078114; Wed, 6 Jun 2012 07:46:15 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206060746.q567kFJ7078114@svn.freebsd.org> From: Marius Strobl Date: Wed, 6 Jun 2012 07:46:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236667 - in stable/8/sys: dev/sound/usb dev/usb dev/usb/controller dev/usb/input dev/usb/misc dev/usb/net dev/usb/serial dev/usb/storage dev/usb/template dev/usb/wlan netgraph/bluetoot... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 07:46:15 -0000 Author: marius Date: Wed Jun 6 07:46:14 2012 New Revision: 236667 URL: http://svn.freebsd.org/changeset/base/236667 Log: MFC: r233774 Fix compiler warnings, mostly signed issues, when USB modules are compiled with WARNS=9. Modified: stable/8/sys/dev/sound/usb/uaudio.c stable/8/sys/dev/sound/usb/uaudioreg.h stable/8/sys/dev/usb/controller/at91dci.c stable/8/sys/dev/usb/controller/atmegadci.c stable/8/sys/dev/usb/controller/avr32dci.c stable/8/sys/dev/usb/controller/ehci.c stable/8/sys/dev/usb/controller/musb_otg.c stable/8/sys/dev/usb/controller/ohci.c stable/8/sys/dev/usb/controller/uhci.c stable/8/sys/dev/usb/controller/uss820dci.c stable/8/sys/dev/usb/controller/xhci.c stable/8/sys/dev/usb/input/atp.c stable/8/sys/dev/usb/input/uep.c stable/8/sys/dev/usb/input/uhid.c stable/8/sys/dev/usb/input/ukbd.c stable/8/sys/dev/usb/input/ums.c stable/8/sys/dev/usb/misc/ufm.c stable/8/sys/dev/usb/net/if_aue.c stable/8/sys/dev/usb/net/if_axe.c stable/8/sys/dev/usb/net/if_cdce.c stable/8/sys/dev/usb/net/if_cue.c stable/8/sys/dev/usb/net/if_ipheth.c stable/8/sys/dev/usb/net/if_kue.c stable/8/sys/dev/usb/net/if_rue.c stable/8/sys/dev/usb/net/if_udav.c stable/8/sys/dev/usb/net/uhso.c stable/8/sys/dev/usb/serial/ubsa.c stable/8/sys/dev/usb/serial/uchcom.c stable/8/sys/dev/usb/serial/ucycom.c stable/8/sys/dev/usb/serial/ufoma.c stable/8/sys/dev/usb/serial/ulpt.c stable/8/sys/dev/usb/serial/umodem.c stable/8/sys/dev/usb/serial/uplcom.c stable/8/sys/dev/usb/serial/usb_serial.c stable/8/sys/dev/usb/serial/usb_serial.h stable/8/sys/dev/usb/storage/umass.c stable/8/sys/dev/usb/storage/urio.c stable/8/sys/dev/usb/storage/ustorage_fs.c stable/8/sys/dev/usb/template/usb_template.c stable/8/sys/dev/usb/usb_busdma.c stable/8/sys/dev/usb/usb_compat_linux.c stable/8/sys/dev/usb/usb_dev.c stable/8/sys/dev/usb/usb_device.c stable/8/sys/dev/usb/usb_handle_request.c stable/8/sys/dev/usb/usb_hid.c stable/8/sys/dev/usb/usb_hub.c stable/8/sys/dev/usb/usb_msctest.c stable/8/sys/dev/usb/usb_request.c stable/8/sys/dev/usb/usb_transfer.c stable/8/sys/dev/usb/usbdi.h stable/8/sys/dev/usb/usbhid.h stable/8/sys/dev/usb/wlan/if_rum.c stable/8/sys/dev/usb/wlan/if_run.c stable/8/sys/dev/usb/wlan/if_uath.c stable/8/sys/dev/usb/wlan/if_upgt.c stable/8/sys/dev/usb/wlan/if_ural.c stable/8/sys/dev/usb/wlan/if_urtw.c stable/8/sys/dev/usb/wlan/if_zyd.c stable/8/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/8/sys/dev/sound/usb/uaudio.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/sound/usb/uaudio.c Wed Jun 6 07:46:14 2012 (r236667) @@ -1272,15 +1272,15 @@ uaudio_chan_record_callback(struct usb_x { struct uaudio_chan *ch = usbd_xfer_softc(xfer); struct usb_page_cache *pc; - uint32_t n; - uint32_t m; - uint32_t blockcount; uint32_t offset0; uint32_t offset1; uint32_t mfl; + int m; + int n; int len; int actlen; int nframes; + int blockcount; usbd_xfer_status(xfer, &actlen, NULL, NULL, &nframes); mfl = usbd_xfer_max_framelen(xfer); @@ -1307,9 +1307,9 @@ uaudio_chan_record_callback(struct usb_x m = (ch->end - ch->cur); - if (m > len) { + if (m > len) m = len; - } + usbd_copy_out(pc, offset1, ch->cur, m); len -= m; @@ -1884,10 +1884,10 @@ uaudio_mixer_add_selector(struct uaudio_ static uint32_t uaudio_mixer_feature_get_bmaControls(const struct usb_audio_feature_unit *d, - uint8_t index) + uint8_t i) { uint32_t temp = 0; - uint32_t offset = (index * d->bControlSize); + uint32_t offset = (i * d->bControlSize); if (d->bControlSize > 0) { temp |= d->bmaControls[offset]; @@ -2636,8 +2636,8 @@ uaudio_mixer_feature_name(const struct u return (uat->feature); } -const static struct uaudio_terminal_node * -uaudio_mixer_get_input(const struct uaudio_terminal_node *iot, uint8_t index) +static const struct uaudio_terminal_node * +uaudio_mixer_get_input(const struct uaudio_terminal_node *iot, uint8_t i) { struct uaudio_terminal_node *root = iot->root; uint8_t n; @@ -2645,17 +2645,16 @@ uaudio_mixer_get_input(const struct uaud n = iot->usr.id_max; do { if (iot->usr.bit_input[n / 8] & (1 << (n % 8))) { - if (!index--) { + if (!i--) return (root + n); - } } } while (n--); return (NULL); } -const static struct uaudio_terminal_node * -uaudio_mixer_get_output(const struct uaudio_terminal_node *iot, uint8_t index) +static const struct uaudio_terminal_node * +uaudio_mixer_get_output(const struct uaudio_terminal_node *iot, uint8_t i) { struct uaudio_terminal_node *root = iot->root; uint8_t n; @@ -2663,9 +2662,8 @@ uaudio_mixer_get_output(const struct uau n = iot->usr.id_max; do { if (iot->usr.bit_output[n / 8] & (1 << (n % 8))) { - if (!index--) { + if (!i--) return (root + n); - } } } while (n--); Modified: stable/8/sys/dev/sound/usb/uaudioreg.h ============================================================================== --- stable/8/sys/dev/sound/usb/uaudioreg.h Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/sound/usb/uaudioreg.h Wed Jun 6 07:46:14 2012 (r236667) @@ -113,9 +113,9 @@ struct usb_audio_streaming_type1_descrip uByte bSamFreqType; #define UA_SAMP_CONTNUOUS 0 uByte tSamFreq[0]; -#define UA_GETSAMP(p, n) (((p)->tSamFreq[((n)*3)+0]) | \ +#define UA_GETSAMP(p, n) ((uint32_t)((((p)->tSamFreq[((n)*3)+0]) | \ ((p)->tSamFreq[((n)*3)+1] << 8) | \ - ((p)->tSamFreq[((n)*3)+2] << 16)) + ((p)->tSamFreq[((n)*3)+2] << 16)))) #define UA_SAMP_LO(p) UA_GETSAMP(p, 0) #define UA_SAMP_HI(p) UA_GETSAMP(p, 1) } __packed; Modified: stable/8/sys/dev/usb/controller/at91dci.c ============================================================================== --- stable/8/sys/dev/usb/controller/at91dci.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/controller/at91dci.c Wed Jun 6 07:46:14 2012 (r236667) @@ -1725,14 +1725,13 @@ static const struct at91dci_config_desc }, }; +#define HSETW(ptr, val) ptr = { (uint8_t)(val), (uint8_t)((val) >> 8) } + static const struct usb_hub_descriptor_min at91dci_hubd = { .bDescLength = sizeof(at91dci_hubd), .bDescriptorType = UDESC_HUB, .bNbrPorts = 1, - .wHubCharacteristics[0] = - (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) & 0xFF, - .wHubCharacteristics[1] = - (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 8, + HSETW(.wHubCharacteristics, (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL)), .bPwrOn2PwrGood = 50, .bHubContrCurrent = 0, .DeviceRemovable = {0}, /* port is removable */ Modified: stable/8/sys/dev/usb/controller/atmegadci.c ============================================================================== --- stable/8/sys/dev/usb/controller/atmegadci.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/controller/atmegadci.c Wed Jun 6 07:46:14 2012 (r236667) @@ -1547,14 +1547,13 @@ static const struct atmegadci_config_des }, }; +#define HSETW(ptr, val) ptr = { (uint8_t)(val), (uint8_t)((val) >> 8) } + static const struct usb_hub_descriptor_min atmegadci_hubd = { .bDescLength = sizeof(atmegadci_hubd), .bDescriptorType = UDESC_HUB, .bNbrPorts = 1, - .wHubCharacteristics[0] = - (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) & 0xFF, - .wHubCharacteristics[1] = - (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 8, + HSETW(.wHubCharacteristics, (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL)), .bPwrOn2PwrGood = 50, .bHubContrCurrent = 0, .DeviceRemovable = {0}, /* port is removable */ Modified: stable/8/sys/dev/usb/controller/avr32dci.c ============================================================================== --- stable/8/sys/dev/usb/controller/avr32dci.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/controller/avr32dci.c Wed Jun 6 07:46:14 2012 (r236667) @@ -1489,14 +1489,13 @@ static const struct avr32dci_config_desc }, }; +#define HSETW(ptr, val) ptr = { (uint8_t)(val), (uint8_t)((val) >> 8) } + static const struct usb_hub_descriptor_min avr32dci_hubd = { .bDescLength = sizeof(avr32dci_hubd), .bDescriptorType = UDESC_HUB, .bNbrPorts = 1, - .wHubCharacteristics[0] = - (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) & 0xFF, - .wHubCharacteristics[1] = - (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 8, + HSETW(.wHubCharacteristics, (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL)), .bPwrOn2PwrGood = 50, .bHubContrCurrent = 0, .DeviceRemovable = {0}, /* port is removable */ Modified: stable/8/sys/dev/usb/controller/ehci.c ============================================================================== --- stable/8/sys/dev/usb/controller/ehci.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/controller/ehci.c Wed Jun 6 07:46:14 2012 (r236667) @@ -3020,13 +3020,8 @@ static const struct ehci_config_desc ehc static const struct usb_hub_descriptor ehci_hubd = { - 0, /* dynamic length */ - UDESC_HUB, - 0, - {0, 0}, - 0, - 0, - {0}, + .bDescLength = 0, /* dynamic length */ + .bDescriptorType = UDESC_HUB, }; static void Modified: stable/8/sys/dev/usb/controller/musb_otg.c ============================================================================== --- stable/8/sys/dev/usb/controller/musb_otg.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/controller/musb_otg.c Wed Jun 6 07:46:14 2012 (r236667) @@ -2192,14 +2192,13 @@ static const struct musbotg_config_desc }, }; +#define HSETW(ptr, val) ptr = { (uint8_t)(val), (uint8_t)((val) >> 8) } + static const struct usb_hub_descriptor_min musbotg_hubd = { .bDescLength = sizeof(musbotg_hubd), .bDescriptorType = UDESC_HUB, .bNbrPorts = 1, - .wHubCharacteristics[0] = - (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) & 0xFF, - .wHubCharacteristics[1] = - (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 16, + HSETW(.wHubCharacteristics, (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL)), .bPwrOn2PwrGood = 50, .bHubContrCurrent = 0, .DeviceRemovable = {0}, /* port is removable */ Modified: stable/8/sys/dev/usb/controller/ohci.c ============================================================================== --- stable/8/sys/dev/usb/controller/ohci.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/controller/ohci.c Wed Jun 6 07:46:14 2012 (r236667) @@ -2080,13 +2080,8 @@ struct ohci_config_desc ohci_confd = static const struct usb_hub_descriptor ohci_hubd = { - 0, /* dynamic length */ - UDESC_HUB, - 0, - {0, 0}, - 0, - 0, - {0}, + .bDescLength = 0, /* dynamic length */ + .bDescriptorType = UDESC_HUB, }; static usb_error_t Modified: stable/8/sys/dev/usb/controller/uhci.c ============================================================================== --- stable/8/sys/dev/usb/controller/uhci.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/controller/uhci.c Wed Jun 6 07:46:14 2012 (r236667) @@ -2351,13 +2351,11 @@ static const struct uhci_config_desc uhc static const struct usb_hub_descriptor_min uhci_hubd_piix = { - sizeof(uhci_hubd_piix), - UDESC_HUB, - 2, - {UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL, 0}, - 50, /* power on to power good */ - 0, - {0x00}, /* both ports are removable */ + .bDescLength = sizeof(uhci_hubd_piix), + .bDescriptorType = UDESC_HUB, + .bNbrPorts = 2, + .wHubCharacteristics = {UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL, 0}, + .bPwrOn2PwrGood = 50, }; /* Modified: stable/8/sys/dev/usb/controller/uss820dci.c ============================================================================== --- stable/8/sys/dev/usb/controller/uss820dci.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/controller/uss820dci.c Wed Jun 6 07:46:14 2012 (r236667) @@ -1788,14 +1788,13 @@ static const struct uss820dci_config_des }, }; +#define HSETW(ptr, val) ptr = { (uint8_t)(val), (uint8_t)((val) >> 8) } + static const struct usb_hub_descriptor_min uss820dci_hubd = { .bDescLength = sizeof(uss820dci_hubd), .bDescriptorType = UDESC_HUB, .bNbrPorts = 1, - .wHubCharacteristics[0] = - (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) & 0xFF, - .wHubCharacteristics[1] = - (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 8, + HSETW(.wHubCharacteristics, (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL)), .bPwrOn2PwrGood = 50, .bHubContrCurrent = 0, .DeviceRemovable = {0}, /* port is removable */ Modified: stable/8/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/8/sys/dev/usb/controller/xhci.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/controller/xhci.c Wed Jun 6 07:46:14 2012 (r236667) @@ -822,7 +822,7 @@ xhci_check_transfer(struct xhci_softc *s offset = td_event - td->td_self; if (offset >= 0 && - offset < sizeof(td->td_trb)) { + offset < (int64_t)sizeof(td->td_trb)) { usb_pc_cpu_invalidate(td->page_cache); @@ -2828,7 +2828,7 @@ struct usb_pipe_methods xhci_device_gene * Simulate a hardware HUB by handling all the necessary requests. *------------------------------------------------------------------------*/ -#define HSETW(ptr, val) ptr[0] = (uint8_t)(val), ptr[1] = (uint8_t)((val) >> 8) +#define HSETW(ptr, val) ptr = { (uint8_t)(val), (uint8_t)((val) >> 8) } static const struct usb_device_descriptor xhci_devd = @@ -2871,8 +2871,7 @@ struct xhci_bos_desc xhci_bosd = { HSETW(.wSpeedsSupported, 0x000C), .bFunctionalitySupport = 8, .bU1DevExitLat = 255, /* dummy - not used */ - .wU2DevExitLat[0] = 0x00, - .wU2DevExitLat[1] = 0x08, + .wU2DevExitLat = { 0x00, 0x08 }, }, .cidd = { .bLength = sizeof(xhci_bosd.cidd), Modified: stable/8/sys/dev/usb/input/atp.c ============================================================================== --- stable/8/sys/dev/usb/input/atp.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/input/atp.c Wed Jun 6 07:46:14 2012 (r236667) @@ -761,7 +761,7 @@ atp_get_pressures(int *p, const int *cur * threshold; this will reduce the contribution from * lower pressure readings. */ - if (p[i] <= atp_sensor_noise_threshold) + if ((u_int)p[i] <= atp_sensor_noise_threshold) p[i] = 0; /* filter away noise */ else p[i] -= atp_sensor_noise_threshold; @@ -887,7 +887,7 @@ atp_match_stroke_component(atp_stroke_co delta_mickeys = pspan->loc - component->loc; - if (abs(delta_mickeys) > atp_max_delta_mickeys) + if ((u_int)abs(delta_mickeys) > atp_max_delta_mickeys) return (FALSE); /* the finger span is too far out; no match */ component->loc = pspan->loc; @@ -1164,9 +1164,10 @@ static void atp_add_new_strokes(struct atp_softc *sc, atp_pspan *pspans_x, u_int n_xpspans, atp_pspan *pspans_y, u_int n_ypspans) { - int i, j; atp_pspan spans[2][ATP_MAX_PSPANS_PER_AXIS]; - u_int nspans[2]; + u_int nspans[2]; + u_int i; + u_int j; /* Copy unmatched pspans into the local arrays. */ for (i = 0, nspans[X] = 0; i < n_xpspans; i++) { @@ -1373,9 +1374,9 @@ atp_terminate_stroke(struct atp_softc *s static __inline boolean_t atp_stroke_has_small_movement(const atp_stroke *stroke) { - return ((abs(stroke->components[X].delta_mickeys) <= + return (((u_int)abs(stroke->components[X].delta_mickeys) <= atp_small_movement_threshold) && - (abs(stroke->components[Y].delta_mickeys) <= + ((u_int)abs(stroke->components[Y].delta_mickeys) <= atp_small_movement_threshold)); } @@ -1388,7 +1389,7 @@ static __inline void atp_update_pending_mickeys(atp_stroke_component *component) { component->pending += component->delta_mickeys; - if (abs(component->pending) <= atp_small_movement_threshold) + if ((u_int)abs(component->pending) <= atp_small_movement_threshold) component->delta_mickeys = 0; else { /* @@ -1690,7 +1691,7 @@ atp_attach(device_t dev) if (usb_fifo_attach(sc->sc_usb_device, sc, &sc->sc_mutex, &atp_fifo_methods, &sc->sc_fifo, - device_get_unit(dev), 0 - 1, uaa->info.bIfaceIndex, + device_get_unit(dev), -1, uaa->info.bIfaceIndex, UID_ROOT, GID_OPERATOR, 0644)) { goto detach; } @@ -1764,13 +1765,13 @@ atp_intr(struct usb_xfer *xfer, usb_erro switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - if (len > sc->sc_params->data_len) { + if (len > (int)sc->sc_params->data_len) { DPRINTFN(ATP_LLEVEL_ERROR, "truncating large packet from %u to %u bytes\n", len, sc->sc_params->data_len); len = sc->sc_params->data_len; } - if (len < sc->sc_params->data_len) + if (len < (int)sc->sc_params->data_len) goto tr_setup; pc = usbd_xfer_get_frame(xfer, 0); @@ -2213,9 +2214,9 @@ static device_method_t atp_methods[] = { }; static driver_t atp_driver = { - ATP_DRIVER_NAME, - atp_methods, - sizeof(struct atp_softc) + .name = ATP_DRIVER_NAME, + .methods = atp_methods, + .size = sizeof(struct atp_softc) }; static devclass_t atp_devclass; Modified: stable/8/sys/dev/usb/input/uep.c ============================================================================== --- stable/8/sys/dev/usb/input/uep.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/input/uep.c Wed Jun 6 07:46:14 2012 (r236667) @@ -202,7 +202,7 @@ uep_intr_callback(struct usb_xfer *xfer, u_char buf[17], *p; int pkt_len; - if (len > sizeof(buf)) { + if (len > (int)sizeof(buf)) { DPRINTF("bad input length %d\n", len); goto tr_setup; } @@ -329,7 +329,7 @@ uep_attach(device_t dev) } error = usb_fifo_attach(uaa->device, sc, &sc->mtx, &uep_fifo_methods, - &sc->fifo, device_get_unit(dev), 0 - 1, uaa->info.bIfaceIndex, + &sc->fifo, device_get_unit(dev), -1, uaa->info.bIfaceIndex, UID_ROOT, GID_OPERATOR, 0644); if (error) { Modified: stable/8/sys/dev/usb/input/uhid.c ============================================================================== --- stable/8/sys/dev/usb/input/uhid.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/input/uhid.c Wed Jun 6 07:46:14 2012 (r236667) @@ -201,10 +201,10 @@ uhid_intr_read_callback(struct usb_xfer * If the ID byte is non zero we allow descriptors * having multiple sizes: */ - if ((actlen >= sc->sc_isize) || + if ((actlen >= (int)sc->sc_isize) || ((actlen > 0) && (sc->sc_iid != 0))) { /* limit report length to the maximum */ - if (actlen > sc->sc_isize) + if (actlen > (int)sc->sc_isize) actlen = sc->sc_isize; usb_fifo_put_data(sc->sc_fifo.fp[USB_FIFO_RX], pc, 0, actlen, 1); @@ -814,7 +814,7 @@ uhid_attach(device_t dev) error = usb_fifo_attach(uaa->device, sc, &sc->sc_mtx, &uhid_fifo_methods, &sc->sc_fifo, - unit, 0 - 1, uaa->info.bIfaceIndex, + unit, -1, uaa->info.bIfaceIndex, UID_ROOT, GID_OPERATOR, 0644); if (error) { goto detach; Modified: stable/8/sys/dev/usb/input/ukbd.c ============================================================================== --- stable/8/sys/dev/usb/input/ukbd.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/input/ukbd.c Wed Jun 6 07:46:14 2012 (r236667) @@ -2119,7 +2119,7 @@ ukbd_key2scan(struct ukbd_softc *sc, int 0x5c, /* Keyboard Intl' 6 (Keypad ,) (For PC-9821 layout) */ }; - if ((code >= 89) && (code < (89 + (sizeof(scan) / sizeof(scan[0]))))) { + if ((code >= 89) && (code < (int)(89 + (sizeof(scan) / sizeof(scan[0]))))) { code = scan[code - 89]; } /* Pause/Break */ Modified: stable/8/sys/dev/usb/input/ums.c ============================================================================== --- stable/8/sys/dev/usb/input/ums.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/input/ums.c Wed Jun 6 07:46:14 2012 (r236667) @@ -201,7 +201,7 @@ ums_intr_callback(struct usb_xfer *xfer, case USB_ST_TRANSFERRED: DPRINTFN(6, "sc=%p actlen=%d\n", sc, len); - if (len > sizeof(sc->sc_temp)) { + if (len > (int)sizeof(sc->sc_temp)) { DPRINTFN(6, "truncating large packet to %zu bytes\n", sizeof(sc->sc_temp)); len = sizeof(sc->sc_temp); @@ -612,7 +612,7 @@ ums_attach(device_t dev) /* Some wheels need the Z axis reversed. */ info->sc_flags |= UMS_FLAG_REVZ; } - if (isize > usbd_xfer_max_framelen(sc->sc_xfer[UMS_INTR_DT])) { + if (isize > (int)usbd_xfer_max_framelen(sc->sc_xfer[UMS_INTR_DT])) { DPRINTF("WARNING: report size, %d bytes, is larger " "than interrupt size, %d bytes!\n", isize, usbd_xfer_max_framelen(sc->sc_xfer[UMS_INTR_DT])); @@ -666,7 +666,7 @@ ums_attach(device_t dev) err = usb_fifo_attach(uaa->device, sc, &sc->sc_mtx, &ums_fifo_methods, &sc->sc_fifo, - device_get_unit(dev), 0 - 1, uaa->info.bIfaceIndex, + device_get_unit(dev), -1, uaa->info.bIfaceIndex, UID_ROOT, GID_OPERATOR, 0644); if (err) { goto detach; Modified: stable/8/sys/dev/usb/misc/ufm.c ============================================================================== --- stable/8/sys/dev/usb/misc/ufm.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/misc/ufm.c Wed Jun 6 07:46:14 2012 (r236667) @@ -156,7 +156,7 @@ ufm_attach(device_t dev) error = usb_fifo_attach(uaa->device, sc, &sc->sc_mtx, &ufm_fifo_methods, &sc->sc_fifo, - device_get_unit(dev), 0 - 1, uaa->info.bIfaceIndex, + device_get_unit(dev), -1, uaa->info.bIfaceIndex, UID_ROOT, GID_OPERATOR, 0644); if (error) { goto detach; Modified: stable/8/sys/dev/usb/net/if_aue.c ============================================================================== --- stable/8/sys/dev/usb/net/if_aue.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/net/if_aue.c Wed Jun 6 07:46:14 2012 (r236667) @@ -740,7 +740,7 @@ aue_intr_callback(struct usb_xfer *xfer, case USB_ST_TRANSFERRED: if ((ifp->if_drv_flags & IFF_DRV_RUNNING) && - actlen >= sizeof(pkt)) { + actlen >= (int)sizeof(pkt)) { pc = usbd_xfer_get_frame(xfer, 0); usbd_copy_out(pc, 0, &pkt, sizeof(pkt)); @@ -793,7 +793,7 @@ aue_bulk_read_callback(struct usb_xfer * } } else { - if (actlen <= sizeof(stat) + ETHER_CRC_LEN) { + if (actlen <= (int)(sizeof(stat) + ETHER_CRC_LEN)) { ifp->if_ierrors++; goto tr_setup; } Modified: stable/8/sys/dev/usb/net/if_axe.c ============================================================================== --- stable/8/sys/dev/usb/net/if_axe.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/net/if_axe.c Wed Jun 6 07:46:14 2012 (r236667) @@ -1036,7 +1036,7 @@ axe_rx_frame(struct usb_ether *ue, struc error = 0; if ((sc->sc_flags & AXE_FLAG_STD_FRAME) != 0) { while (pos < actlen) { - if ((pos + sizeof(hdr)) > actlen) { + if ((int)(pos + sizeof(hdr)) > actlen) { /* too little data */ error = EINVAL; break; @@ -1060,7 +1060,7 @@ axe_rx_frame(struct usb_ether *ue, struc } } else if ((sc->sc_flags & AXE_FLAG_CSUM_FRAME) != 0) { while (pos < actlen) { - if ((pos + sizeof(csum_hdr)) > actlen) { + if ((int)(pos + sizeof(csum_hdr)) > actlen) { /* too little data */ error = EINVAL; break; Modified: stable/8/sys/dev/usb/net/if_cdce.c ============================================================================== --- stable/8/sys/dev/usb/net/if_cdce.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/net/if_cdce.c Wed Jun 6 07:46:14 2012 (r236667) @@ -303,8 +303,8 @@ cdce_ncm_init(struct cdce_softc *sc) int err; ufd = usbd_find_descriptor(sc->sc_ue.ue_udev, NULL, - sc->sc_ifaces_index[1], UDESC_CS_INTERFACE, 0 - 1, - UCDC_NCM_FUNC_DESC_SUBTYPE, 0 - 1); + sc->sc_ifaces_index[1], UDESC_CS_INTERFACE, 0xFF, + UCDC_NCM_FUNC_DESC_SUBTYPE, 0xFF); /* verify length of NCM functional descriptor */ if (ufd != NULL) { @@ -514,7 +514,7 @@ cdce_attach(device_t dev) ud = usbd_find_descriptor (uaa->device, NULL, uaa->info.bIfaceIndex, - UDESC_CS_INTERFACE, 0 - 1, UDESCSUB_CDC_UNION, 0 - 1); + UDESC_CS_INTERFACE, 0xFF, UDESCSUB_CDC_UNION, 0xFF); if ((ud == NULL) || (ud->bLength < sizeof(*ud)) || (sc->sc_flags & CDCE_FLAG_NO_UNION)) { @@ -598,7 +598,7 @@ alloc_transfers: ued = usbd_find_descriptor (uaa->device, NULL, uaa->info.bIfaceIndex, - UDESC_CS_INTERFACE, 0 - 1, UDESCSUB_CDC_ENF, 0 - 1); + UDESC_CS_INTERFACE, 0xFF, UDESCSUB_CDC_ENF, 0xFF); if ((ued == NULL) || (ued->bLength < sizeof(*ued))) { error = USB_ERR_INVAL; @@ -892,7 +892,9 @@ cdce_bulk_read_callback(struct usb_xfer struct cdce_softc *sc = usbd_xfer_softc(xfer); struct mbuf *m; uint8_t x; - int actlen, aframes, len; + int actlen; + int aframes; + int len; usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL); @@ -911,7 +913,7 @@ cdce_bulk_read_callback(struct usb_xfer if ((sc->sc_flags & CDCE_FLAG_ZAURUS) && len >= 14) len -= 4; - if (len < sizeof(struct ether_header)) { + if (len < (int)sizeof(struct ether_header)) { m_freem(m); continue; } @@ -1096,7 +1098,7 @@ cdce_ncm_fill_tx_frames(struct usb_xfer break; } - if (m->m_pkthdr.len > rem) { + if (m->m_pkthdr.len > (int)rem) { if (n == 0) { /* The frame won't fit in our buffer */ DPRINTFN(1, "Frame too big to be transmitted!\n"); @@ -1278,7 +1280,7 @@ cdce_ncm_bulk_read_callback(struct usb_x DPRINTFN(1, "received %u bytes in %u frames\n", actlen, aframes); - if (actlen < (sizeof(sc->sc_ncm.hdr) + + if (actlen < (int)(sizeof(sc->sc_ncm.hdr) + sizeof(sc->sc_ncm.dpt))) { DPRINTFN(1, "frame too short\n"); goto tr_setup; @@ -1305,7 +1307,7 @@ cdce_ncm_bulk_read_callback(struct usb_x goto tr_stall; } temp = UGETW(sc->sc_ncm.hdr.wDptIndex); - if ((temp + sizeof(sc->sc_ncm.dpt)) > actlen) { + if ((int)(temp + sizeof(sc->sc_ncm.dpt)) > actlen) { DPRINTFN(1, "invalid DPT index: 0x%04x\n", temp); goto tr_stall; } @@ -1354,7 +1356,7 @@ cdce_ncm_bulk_read_callback(struct usb_x temp = UGETW(sc->sc_ncm.dp[x].wFrameLength); if ((offset == 0) || - (temp < sizeof(struct ether_header)) || + (temp < (int)sizeof(struct ether_header)) || (temp > (MCLBYTES - ETHER_ALIGN))) { DPRINTFN(1, "NULL frame detected at %d\n", x); m = NULL; @@ -1366,7 +1368,7 @@ cdce_ncm_bulk_read_callback(struct usb_x m = NULL; /* silently ignore this frame */ continue; - } else if (temp > (MHLEN - ETHER_ALIGN)) { + } else if (temp > (int)(MHLEN - ETHER_ALIGN)) { m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); } else { m = m_gethdr(M_DONTWAIT, MT_DATA); Modified: stable/8/sys/dev/usb/net/if_cue.c ============================================================================== --- stable/8/sys/dev/usb/net/if_cue.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/net/if_cue.c Wed Jun 6 07:46:14 2012 (r236667) @@ -457,7 +457,7 @@ cue_bulk_read_callback(struct usb_xfer * switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - if (actlen <= (2 + sizeof(struct ether_header))) { + if (actlen <= (int)(2 + sizeof(struct ether_header))) { ifp->if_ierrors++; goto tr_setup; } Modified: stable/8/sys/dev/usb/net/if_ipheth.c ============================================================================== --- stable/8/sys/dev/usb/net/if_ipheth.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/net/if_ipheth.c Wed Jun 6 07:46:14 2012 (r236667) @@ -471,7 +471,7 @@ ipheth_bulk_read_callback(struct usb_xfe sc->sc_rx_buf[x] = NULL; len = usbd_xfer_frame_len(xfer, x); - if (len < (sizeof(struct ether_header) + + if (len < (int)(sizeof(struct ether_header) + IPHETH_RX_ADJ)) { m_freem(m); continue; Modified: stable/8/sys/dev/usb/net/if_kue.c ============================================================================== --- stable/8/sys/dev/usb/net/if_kue.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/net/if_kue.c Wed Jun 6 07:46:14 2012 (r236667) @@ -545,7 +545,7 @@ kue_bulk_read_callback(struct usb_xfer * switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - if (actlen <= (2 + sizeof(struct ether_header))) { + if (actlen <= (int)(2 + sizeof(struct ether_header))) { ifp->if_ierrors++; goto tr_setup; } Modified: stable/8/sys/dev/usb/net/if_rue.c ============================================================================== --- stable/8/sys/dev/usb/net/if_rue.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/net/if_rue.c Wed Jun 6 07:46:14 2012 (r236667) @@ -638,7 +638,7 @@ rue_intr_callback(struct usb_xfer *xfer, case USB_ST_TRANSFERRED: if (ifp && (ifp->if_drv_flags & IFF_DRV_RUNNING) && - actlen >= sizeof(pkt)) { + actlen >= (int)sizeof(pkt)) { pc = usbd_xfer_get_frame(xfer, 0); usbd_copy_out(pc, 0, &pkt, sizeof(pkt)); Modified: stable/8/sys/dev/usb/net/if_udav.c ============================================================================== --- stable/8/sys/dev/usb/net/if_udav.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/net/if_udav.c Wed Jun 6 07:46:14 2012 (r236667) @@ -642,7 +642,7 @@ udav_bulk_read_callback(struct usb_xfer switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - if (actlen < sizeof(stat) + ETHER_CRC_LEN) { + if (actlen < (int)(sizeof(stat) + ETHER_CRC_LEN)) { ifp->if_ierrors++; goto tr_setup; } Modified: stable/8/sys/dev/usb/net/uhso.c ============================================================================== --- stable/8/sys/dev/usb/net/uhso.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/net/uhso.c Wed Jun 6 07:46:14 2012 (r236667) @@ -482,9 +482,9 @@ static device_method_t uhso_methods[] = }; static driver_t uhso_driver = { - "uhso", - uhso_methods, - sizeof(struct uhso_softc) + .name = "uhso", + .methods = uhso_methods, + .size = sizeof(struct uhso_softc) }; static devclass_t uhso_devclass; @@ -1366,7 +1366,7 @@ uhso_bs_intr_callback(struct usb_xfer *x UHSO_DPRINTF(0, "UCDC notification too short: %d\n", actlen); goto tr_setup; } - else if (actlen > sizeof(struct usb_cdc_notification)) { + else if (actlen > (int)sizeof(struct usb_cdc_notification)) { UHSO_DPRINTF(0, "UCDC notification too large: %d\n", actlen); actlen = sizeof(struct usb_cdc_notification); } Modified: stable/8/sys/dev/usb/serial/ubsa.c ============================================================================== --- stable/8/sys/dev/usb/serial/ubsa.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/serial/ubsa.c Wed Jun 6 07:46:14 2012 (r236667) @@ -627,7 +627,7 @@ ubsa_intr_callback(struct usb_xfer *xfer switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - if (actlen >= sizeof(buf)) { + if (actlen >= (int)sizeof(buf)) { pc = usbd_xfer_get_frame(xfer, 0); usbd_copy_out(pc, 0, buf, sizeof(buf)); Modified: stable/8/sys/dev/usb/serial/uchcom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uchcom.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/serial/uchcom.c Wed Jun 6 07:46:14 2012 (r236667) @@ -846,9 +846,9 @@ static device_method_t uchcom_methods[] }; static driver_t uchcom_driver = { - "ucom", - uchcom_methods, - sizeof(struct uchcom_softc) + .name = "ucom", + .methods = uchcom_methods, + .size = sizeof(struct uchcom_softc) }; static devclass_t uchcom_devclass; Modified: stable/8/sys/dev/usb/serial/ucycom.c ============================================================================== --- stable/8/sys/dev/usb/serial/ucycom.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/serial/ucycom.c Wed Jun 6 07:46:14 2012 (r236667) @@ -519,7 +519,7 @@ ucycom_intr_read_callback(struct usb_xfe struct usb_page_cache *pc; uint8_t buf[2]; uint32_t offset; - uint32_t len; + int len; int actlen; usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); Modified: stable/8/sys/dev/usb/serial/ufoma.c ============================================================================== --- stable/8/sys/dev/usb/serial/ufoma.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/serial/ufoma.c Wed Jun 6 07:46:14 2012 (r236667) @@ -684,7 +684,7 @@ ufoma_intr_callback(struct usb_xfer *xfe DPRINTF("too short message\n"); goto tr_setup; } - if (actlen > sizeof(pkt)) { + if (actlen > (int)sizeof(pkt)) { DPRINTF("truncating message\n"); actlen = sizeof(pkt); } Modified: stable/8/sys/dev/usb/serial/ulpt.c ============================================================================== --- stable/8/sys/dev/usb/serial/ulpt.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/serial/ulpt.c Wed Jun 6 07:46:14 2012 (r236667) @@ -543,7 +543,7 @@ ulpt_attach(device_t dev) /* search through all the descriptors looking for bidir mode */ id = usbd_get_interface_descriptor(uaa->iface); - alt_index = 0 - 1; + alt_index = 0xFF; while (1) { if (id == NULL) { break; @@ -631,14 +631,14 @@ found: error = usb_fifo_attach(uaa->device, sc, &sc->sc_mtx, &ulpt_fifo_methods, &sc->sc_fifo, - unit, 0 - 1, uaa->info.bIfaceIndex, + unit, -1, uaa->info.bIfaceIndex, UID_ROOT, GID_OPERATOR, 0644); if (error) { goto detach; } error = usb_fifo_attach(uaa->device, sc, &sc->sc_mtx, &unlpt_fifo_methods, &sc->sc_fifo_noreset, - unit, 0 - 1, uaa->info.bIfaceIndex, + unit, -1, uaa->info.bIfaceIndex, UID_ROOT, GID_OPERATOR, 0644); if (error) { goto detach; Modified: stable/8/sys/dev/usb/serial/umodem.c ============================================================================== --- stable/8/sys/dev/usb/serial/umodem.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/serial/umodem.c Wed Jun 6 07:46:14 2012 (r236667) @@ -317,7 +317,7 @@ umodem_attach(device_t dev) cud = usbd_find_descriptor(uaa->device, NULL, uaa->info.bIfaceIndex, UDESC_CS_INTERFACE, - 0 - 1, UDESCSUB_CDC_UNION, 0 - 1); + 0xFF, UDESCSUB_CDC_UNION, 0xFF); if ((cud == NULL) || (cud->bLength < sizeof(*cud))) { DPRINTF("Missing descriptor. " @@ -702,7 +702,7 @@ umodem_intr_callback(struct usb_xfer *xf "%d bytes\n", actlen); goto tr_setup; } - if (actlen > sizeof(pkt)) { + if (actlen > (int)sizeof(pkt)) { DPRINTF("truncating message\n"); actlen = sizeof(pkt); } @@ -842,7 +842,7 @@ static void * umodem_get_desc(struct usb_attach_arg *uaa, uint8_t type, uint8_t subtype) { return (usbd_find_descriptor(uaa->device, NULL, uaa->info.bIfaceIndex, - type, 0 - 1, subtype, 0 - 1)); + type, 0xFF, subtype, 0xFF)); } static usb_error_t Modified: stable/8/sys/dev/usb/serial/uplcom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uplcom.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/serial/uplcom.c Wed Jun 6 07:46:14 2012 (r236667) @@ -606,7 +606,7 @@ uplcom_cfg_set_break(struct ucom_softc * &req, NULL, 0, 1000); } -static const int32_t uplcom_rates[] = { +static const uint32_t uplcom_rates[] = { 75, 150, 300, 600, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 14400, 19200, 28800, 38400, 57600, 115200, /* Modified: stable/8/sys/dev/usb/serial/usb_serial.c ============================================================================== --- stable/8/sys/dev/usb/serial/usb_serial.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/serial/usb_serial.c Wed Jun 6 07:46:14 2012 (r236667) @@ -236,14 +236,14 @@ ucom_unit_free(int unit) */ int ucom_attach(struct ucom_super_softc *ssc, struct ucom_softc *sc, - uint32_t subunits, void *parent, + int subunits, void *parent, const struct ucom_callback *callback, struct mtx *mtx) { - uint32_t subunit; + int subunit; int error = 0; if ((sc == NULL) || - (subunits == 0) || + (subunits <= 0) || (callback == NULL)) { return (EINVAL); } @@ -287,7 +287,7 @@ ucom_attach(struct ucom_super_softc *ssc void ucom_detach(struct ucom_super_softc *ssc, struct ucom_softc *sc) { - uint32_t subunit; + int subunit; if (ssc->sc_subunits == 0) return; /* not initialized */ @@ -1056,11 +1056,6 @@ ucom_param(struct tty *tp, struct termio DPRINTF("sc = %p\n", sc); /* Check requested parameters. */ - if (t->c_ospeed < 0) { - DPRINTF("negative ospeed\n"); - error = EINVAL; - goto done; - } if (t->c_ispeed && (t->c_ispeed != t->c_ospeed)) { DPRINTF("mismatch ispeed and ospeed\n"); error = EINVAL; Modified: stable/8/sys/dev/usb/serial/usb_serial.h ============================================================================== --- stable/8/sys/dev/usb/serial/usb_serial.h Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/serial/usb_serial.h Wed Jun 6 07:46:14 2012 (r236667) @@ -163,7 +163,7 @@ struct ucom_softc { struct tty *sc_tty; struct mtx *sc_mtx; void *sc_parent; - uint32_t sc_subunit; + int sc_subunit; uint16_t sc_portno; uint16_t sc_flag; #define UCOM_FLAG_RTS_IFLOW 0x01 /* use RTS input flow control */ @@ -191,7 +191,7 @@ struct ucom_softc { usbd_do_request_proc(udev,&(com)->sc_super->sc_tq,req,ptr,flags,NULL,timo) int ucom_attach(struct ucom_super_softc *, - struct ucom_softc *, uint32_t, void *, + struct ucom_softc *, int, void *, const struct ucom_callback *callback, struct mtx *); void ucom_detach(struct ucom_super_softc *, struct ucom_softc *); void ucom_set_pnpinfo_usb(struct ucom_super_softc *, device_t); Modified: stable/8/sys/dev/usb/storage/umass.c ============================================================================== --- stable/8/sys/dev/usb/storage/umass.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/storage/umass.c Wed Jun 6 07:46:14 2012 (r236667) @@ -1482,7 +1482,7 @@ umass_t_bbb_status_callback(struct usb_x /* Zero missing parts of the CSW: */ - if (actlen < sizeof(sc->csw)) + if (actlen < (int)sizeof(sc->csw)) memset(&sc->csw, 0, sizeof(sc->csw)); pc = usbd_xfer_get_frame(xfer, 0); @@ -2016,7 +2016,7 @@ umass_t_cbi_status_callback(struct usb_x switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - if (actlen < sizeof(sc->sbl)) { + if (actlen < (int)sizeof(sc->sbl)) { goto tr_setup; } pc = usbd_xfer_get_frame(xfer, 0); Modified: stable/8/sys/dev/usb/storage/urio.c ============================================================================== --- stable/8/sys/dev/usb/storage/urio.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/storage/urio.c Wed Jun 6 07:46:14 2012 (r236667) @@ -246,7 +246,7 @@ urio_attach(device_t dev) error = usb_fifo_attach(uaa->device, sc, &sc->sc_mtx, &urio_fifo_methods, &sc->sc_fifo, - device_get_unit(dev), 0 - 1, uaa->info.bIfaceIndex, + device_get_unit(dev), -1, uaa->info.bIfaceIndex, UID_ROOT, GID_OPERATOR, 0644); if (error) { goto detach; Modified: stable/8/sys/dev/usb/storage/ustorage_fs.c ============================================================================== --- stable/8/sys/dev/usb/storage/ustorage_fs.c Wed Jun 6 06:52:51 2012 (r236666) +++ stable/8/sys/dev/usb/storage/ustorage_fs.c Wed Jun 6 07:46:14 2012 (r236667) @@ -964,7 +964,7 @@ ustorage_fs_verify(struct ustorage_fs_so } /* XXX TODO: verify that data is readable */ done: - return (ustorage_fs_min_len(sc, 0, 0 - 1)); + return (ustorage_fs_min_len(sc, 0, -1U)); } /*------------------------------------------------------------------------* @@ -986,7 +986,7 @@ ustorage_fs_inquiry(struct ustorage_fs_s memset(buf, 0, 36); buf[0] = 0x7f; /* Unsupported, no device - type */ - return (ustorage_fs_min_len(sc, 36, 0 - 1)); + return (ustorage_fs_min_len(sc, 36, -1U)); } memset(buf, 0, 8); /* Non - removable, direct - access device */ @@ -1005,7 +1005,7 @@ ustorage_fs_inquiry(struct ustorage_fs_s #if (USTORAGE_QDATA_MAX < 36) #error "(USTORAGE_QDATA_MAX < 36)" #endif - return (ustorage_fs_min_len(sc, 36, 0 - 1)); + return (ustorage_fs_min_len(sc, 36, -1U)); } /*------------------------------------------------------------------------* @@ -1074,7 +1074,7 @@ ustorage_fs_request_sense(struct ustorag #if (USTORAGE_QDATA_MAX < 18) #error "(USTORAGE_QDATA_MAX < 18)" #endif - return (ustorage_fs_min_len(sc, 18, 0 - 1)); + return (ustorage_fs_min_len(sc, 18, -1U)); } /*------------------------------------------------------------------------* @@ -1105,7 +1105,7 @@ ustorage_fs_read_capacity(struct ustorag #if (USTORAGE_QDATA_MAX < 8) #error "(USTORAGE_QDATA_MAX < 8)" #endif - return (ustorage_fs_min_len(sc, 8, 0 - 1)); + return (ustorage_fs_min_len(sc, 8, -1U)); } /*------------------------------------------------------------------------* @@ -1212,7 +1212,7 @@ ustorage_fs_mode_sense(struct ustorage_f #if (USTORAGE_QDATA_MAX < 24) #error "(USTORAGE_QDATA_MAX < 24)" #endif - return (ustorage_fs_min_len(sc, len, 0 - 1)); + return (ustorage_fs_min_len(sc, len, -1U)); } /*------------------------------------------------------------------------* @@ -1302,7 +1302,7 @@ ustorage_fs_read_format_capacities(struc #if (USTORAGE_QDATA_MAX < 12) #error "(USTORAGE_QDATA_MAX < 12)" #endif - return (ustorage_fs_min_len(sc, 12, 0 - 1)); + return (ustorage_fs_min_len(sc, 12, -1U)); } /*------------------------------------------------------------------------* @@ -1615,7 +1615,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so switch (sc->sc_cmd_data[0]) { case SC_INQUIRY: sc->sc_transfer.cmd_dir = DIR_WRITE; - error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], 0 - 1); + error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], -1U); if (error) { break; } @@ -1630,7 +1630,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_MODE_SELECT_6: sc->sc_transfer.cmd_dir = DIR_READ; - error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], 0 - 1); + error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], -1U); if (error) { break; } @@ -1646,7 +1646,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_MODE_SELECT_10: sc->sc_transfer.cmd_dir = DIR_READ; error = ustorage_fs_min_len(sc, - get_be16(&sc->sc_cmd_data[7]), 0 - 1); + get_be16(&sc->sc_cmd_data[7]), -1U); if (error) { break; } @@ -1661,7 +1661,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_MODE_SENSE_6: sc->sc_transfer.cmd_dir = DIR_WRITE; - error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], 0 - 1); + error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], -1U); if (error) { break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 08:07:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E6F9106564A; Wed, 6 Jun 2012 08:07:48 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE1278FC0C; Wed, 6 Jun 2012 08:07:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5687lHk079168; Wed, 6 Jun 2012 08:07:47 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5687lEK079152; Wed, 6 Jun 2012 08:07:47 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201206060807.q5687lEK079152@svn.freebsd.org> From: Joel Dahl Date: Wed, 6 Jun 2012 08:07:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236668 - head/lib/librpcsec_gss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 08:07:48 -0000 Author: joel (doc committer) Date: Wed Jun 6 08:07:47 2012 New Revision: 236668 URL: http://svn.freebsd.org/changeset/base/236668 Log: mdoc: add missing -width argument to Bl -tag. Modified: head/lib/librpcsec_gss/rpc_gss_get_error.3 head/lib/librpcsec_gss/rpc_gss_get_mech_info.3 head/lib/librpcsec_gss/rpc_gss_get_principal_name.3 head/lib/librpcsec_gss/rpc_gss_get_versions.3 head/lib/librpcsec_gss/rpc_gss_getcred.3 head/lib/librpcsec_gss/rpc_gss_is_installed.3 head/lib/librpcsec_gss/rpc_gss_max_data_length.3 head/lib/librpcsec_gss/rpc_gss_mech_to_oid.3 head/lib/librpcsec_gss/rpc_gss_oid_to_mech.3 head/lib/librpcsec_gss/rpc_gss_qop_to_num.3 head/lib/librpcsec_gss/rpc_gss_seccreate.3 head/lib/librpcsec_gss/rpc_gss_set_callback.3 head/lib/librpcsec_gss/rpc_gss_set_defaults.3 head/lib/librpcsec_gss/rpc_gss_set_svc_name.3 head/lib/librpcsec_gss/rpc_gss_svc_max_data_length.3 Modified: head/lib/librpcsec_gss/rpc_gss_get_error.3 ============================================================================== --- head/lib/librpcsec_gss/rpc_gss_get_error.3 Wed Jun 6 07:46:14 2012 (r236667) +++ head/lib/librpcsec_gss/rpc_gss_get_error.3 Wed Jun 6 08:07:47 2012 (r236668) @@ -39,7 +39,7 @@ .Sh DESCRIPTION Get details of the last RPCSEC_GSS error. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It error" .It error A pointer to a structure where the error details will be returned .El Modified: head/lib/librpcsec_gss/rpc_gss_get_mech_info.3 ============================================================================== --- head/lib/librpcsec_gss/rpc_gss_get_mech_info.3 Wed Jun 6 07:46:14 2012 (r236667) +++ head/lib/librpcsec_gss/rpc_gss_get_mech_info.3 Wed Jun 6 08:07:47 2012 (r236668) @@ -40,7 +40,7 @@ This function looks up a mechanism by name by reading the file /etc/gss/mech and queries it for its capabilities. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It service" .It mech The mechanism to search for .It service Modified: head/lib/librpcsec_gss/rpc_gss_get_principal_name.3 ============================================================================== --- head/lib/librpcsec_gss/rpc_gss_get_principal_name.3 Wed Jun 6 07:46:14 2012 (r236667) +++ head/lib/librpcsec_gss/rpc_gss_get_principal_name.3 Wed Jun 6 08:07:47 2012 (r236668) @@ -46,7 +46,7 @@ This function can be used to generate a client principal name from various strings. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It principal" .It principal If the principal is created successfully, .Fa *principal Modified: head/lib/librpcsec_gss/rpc_gss_get_versions.3 ============================================================================== --- head/lib/librpcsec_gss/rpc_gss_get_versions.3 Wed Jun 6 07:46:14 2012 (r236667) +++ head/lib/librpcsec_gss/rpc_gss_get_versions.3 Wed Jun 6 08:07:47 2012 (r236668) @@ -39,7 +39,7 @@ .Sh DESCRIPTION Return the highest and lowest supported versions of the RPCSEC_GSS protocol. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It vers_lo" .It vers_hi The value of .Fa *vers_hi Modified: head/lib/librpcsec_gss/rpc_gss_getcred.3 ============================================================================== --- head/lib/librpcsec_gss/rpc_gss_getcred.3 Wed Jun 6 07:46:14 2012 (r236667) +++ head/lib/librpcsec_gss/rpc_gss_getcred.3 Wed Jun 6 08:07:47 2012 (r236668) @@ -45,7 +45,7 @@ This function returns the RPCSEC_GSS authenticated credentials associated with an RPC request. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It cookie" .It req The RPC request to query .It rcred Modified: head/lib/librpcsec_gss/rpc_gss_is_installed.3 ============================================================================== --- head/lib/librpcsec_gss/rpc_gss_is_installed.3 Wed Jun 6 07:46:14 2012 (r236667) +++ head/lib/librpcsec_gss/rpc_gss_is_installed.3 Wed Jun 6 08:07:47 2012 (r236668) @@ -40,7 +40,7 @@ This function looks up a mechanism by name by reading the file /etc/gss/mech. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It mech" .It mech The mechanism to search for .El Modified: head/lib/librpcsec_gss/rpc_gss_max_data_length.3 ============================================================================== --- head/lib/librpcsec_gss/rpc_gss_max_data_length.3 Wed Jun 6 07:46:14 2012 (r236667) +++ head/lib/librpcsec_gss/rpc_gss_max_data_length.3 Wed Jun 6 08:07:47 2012 (r236668) @@ -41,7 +41,7 @@ Calculate the maximum message size that .Fa max_tp_unit_len , given the current service and QoP setting. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It max_tp_unit_len" .It auth A handle to a RPCSEC_GSS security context .It max_tp_unit_len Modified: head/lib/librpcsec_gss/rpc_gss_mech_to_oid.3 ============================================================================== --- head/lib/librpcsec_gss/rpc_gss_mech_to_oid.3 Wed Jun 6 07:46:14 2012 (r236667) +++ head/lib/librpcsec_gss/rpc_gss_mech_to_oid.3 Wed Jun 6 08:07:47 2012 (r236668) @@ -40,7 +40,7 @@ This function looks up a mechanism by name by reading the file /etc/gss/mech. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It oid_ret" .It mech The mechanism name to search for .It oid_ret Modified: head/lib/librpcsec_gss/rpc_gss_oid_to_mech.3 ============================================================================== --- head/lib/librpcsec_gss/rpc_gss_oid_to_mech.3 Wed Jun 6 07:46:14 2012 (r236667) +++ head/lib/librpcsec_gss/rpc_gss_oid_to_mech.3 Wed Jun 6 08:07:47 2012 (r236668) @@ -40,7 +40,7 @@ This function looks up a mechanism by oid by reading the file /etc/gss/mech. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It mech_ret" .It oid The mechanism oid to search for .It mech_ret Modified: head/lib/librpcsec_gss/rpc_gss_qop_to_num.3 ============================================================================== --- head/lib/librpcsec_gss/rpc_gss_qop_to_num.3 Wed Jun 6 07:46:14 2012 (r236667) +++ head/lib/librpcsec_gss/rpc_gss_qop_to_num.3 Wed Jun 6 08:07:47 2012 (r236668) @@ -40,7 +40,7 @@ This function looks up a quality of protection by name by reading the file /etc/gss/qop. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It number_ret" .It qop The quality of protection to search for .It mech Modified: head/lib/librpcsec_gss/rpc_gss_seccreate.3 ============================================================================== --- head/lib/librpcsec_gss/rpc_gss_seccreate.3 Wed Jun 6 07:46:14 2012 (r236667) +++ head/lib/librpcsec_gss/rpc_gss_seccreate.3 Wed Jun 6 08:07:47 2012 (r236668) @@ -48,7 +48,7 @@ This function is used to establish a security context between an application and a remote peer using the RPSEC_GSS protocol. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width "options_req" .It clnt An RPC handle which is connected to the remote peer .It principal @@ -62,7 +62,7 @@ The value of mechanism should be the nam mechanisms listed in /etc/gss/mech. .It service Type of service requested. -.Bl -tag +.Bl -tag -width "rpc_gss_svc_integrity" .It rpc_gss_svc_default The default - typically the same as .Dv rpc_gss_svc_none . Modified: head/lib/librpcsec_gss/rpc_gss_set_callback.3 ============================================================================== --- head/lib/librpcsec_gss/rpc_gss_set_callback.3 Wed Jun 6 07:46:14 2012 (r236667) +++ head/lib/librpcsec_gss/rpc_gss_set_callback.3 Wed Jun 6 08:07:47 2012 (r236668) @@ -62,7 +62,7 @@ protection used by the context. If a context is locked, any subsequent requests which use different values for service and quality of protection will be rejected. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It gss_context" .It cb A structure containing the RPC program and version for this callback and a function which will be called when new contexts are created for Modified: head/lib/librpcsec_gss/rpc_gss_set_defaults.3 ============================================================================== --- head/lib/librpcsec_gss/rpc_gss_set_defaults.3 Wed Jun 6 07:46:14 2012 (r236667) +++ head/lib/librpcsec_gss/rpc_gss_set_defaults.3 Wed Jun 6 08:07:47 2012 (r236668) @@ -45,7 +45,7 @@ Set the service and quality of protectio The new values apply for the rest of the lifetime of the context (unless changed again with this function). .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It service" .It service The service type to use for subsequent RPC requests .It qop Modified: head/lib/librpcsec_gss/rpc_gss_set_svc_name.3 ============================================================================== --- head/lib/librpcsec_gss/rpc_gss_set_svc_name.3 Wed Jun 6 07:46:14 2012 (r236667) +++ head/lib/librpcsec_gss/rpc_gss_set_svc_name.3 Wed Jun 6 08:07:47 2012 (r236668) @@ -47,7 +47,7 @@ This function registers a service princi authenticate RPCSEC_GSS security contexts for a given RPC program and version. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It mechanism" .It principal A string representing the service principal in the form .Qq service@hostname Modified: head/lib/librpcsec_gss/rpc_gss_svc_max_data_length.3 ============================================================================== --- head/lib/librpcsec_gss/rpc_gss_svc_max_data_length.3 Wed Jun 6 07:46:14 2012 (r236667) +++ head/lib/librpcsec_gss/rpc_gss_svc_max_data_length.3 Wed Jun 6 08:07:47 2012 (r236668) @@ -41,7 +41,7 @@ Calculate the maximum message size that .Fa max_tp_unit_len , given the current service and QoP setting. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It max_tp_unit_len" .It req An RPC request .It max_tp_unit_len From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 08:58:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 02367106566C; Wed, 6 Jun 2012 08:58:32 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E15F18FC17; Wed, 6 Jun 2012 08:58:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q568wVmi081521; Wed, 6 Jun 2012 08:58:31 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q568wVdu081519; Wed, 6 Jun 2012 08:58:31 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201206060858.q568wVdu081519@svn.freebsd.org> From: Fabien Thomas Date: Wed, 6 Jun 2012 08:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236669 - head/usr.sbin/pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 08:58:32 -0000 Author: fabient Date: Wed Jun 6 08:58:31 2012 New Revision: 236669 URL: http://svn.freebsd.org/changeset/base/236669 Log: Remove spurious ARM symbols from lookup table. MFC after: 3 days Modified: head/usr.sbin/pmcstat/pmcstat_log.c Modified: head/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat_log.c Wed Jun 6 08:07:47 2012 (r236668) +++ head/usr.sbin/pmcstat/pmcstat_log.c Wed Jun 6 08:58:31 2012 (r236669) @@ -554,6 +554,14 @@ pmcstat_image_add_symbols(struct pmcstat if ((fnname = elf_strptr(e, sh->sh_link, sym.st_name)) == NULL) continue; +#ifdef __arm__ + /* Remove spurious ARM function name. */ + if (fnname[0] == '$' && + (fnname[1] == 'a' || fnname[1] == 't' || + fnname[1] == 'd') && + fnname[2] == '\0') + continue; +#endif symptr->ps_name = pmcstat_string_intern(fnname); symptr->ps_start = sym.st_value - image->pi_vaddr; From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 09:07:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3F4ED1065676; Wed, 6 Jun 2012 09:07:51 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2862F8FC18; Wed, 6 Jun 2012 09:07:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5697pQY082003; Wed, 6 Jun 2012 09:07:51 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5697o7q082000; Wed, 6 Jun 2012 09:07:50 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201206060907.q5697o7q082000@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 6 Jun 2012 09:07:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236670 - head/sys/dev/ae X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 09:07:51 -0000 Author: pluknet Date: Wed Jun 6 09:07:50 2012 New Revision: 236670 URL: http://svn.freebsd.org/changeset/base/236670 Log: Fix the build. Modified: head/sys/dev/ae/if_ae.c Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Wed Jun 6 08:58:31 2012 (r236669) +++ head/sys/dev/ae/if_ae.c Wed Jun 6 09:07:50 2012 (r236670) @@ -1381,7 +1381,7 @@ ae_pm_init(ae_softc_t *sc) /* * Configure PME. */ - if (pci_find_cap(dev, PCIY_PMG, &pmc) == 0) { + if (pci_find_cap(sc->dev, PCIY_PMG, &pmc) == 0) { pmstat = pci_read_config(sc->dev, pmc + PCIR_POWER_STATUS, 2); pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); if ((ifp->if_capenable & IFCAP_WOL) != 0) From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 09:36:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D2D6106566B; Wed, 6 Jun 2012 09:36:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57C408FC16; Wed, 6 Jun 2012 09:36:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q569arro083480; Wed, 6 Jun 2012 09:36:53 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q569arg2083478; Wed, 6 Jun 2012 09:36:53 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201206060936.q569arg2083478@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 6 Jun 2012 09:36:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236671 - head/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 09:36:53 -0000 Author: glebius Date: Wed Jun 6 09:36:52 2012 New Revision: 236671 URL: http://svn.freebsd.org/changeset/base/236671 Log: Merge revision 1.715 from OpenBSD: date: 2010/12/24 20:12:56; author: henning; state: Exp; lines: +3 -3 in pf_src_connlimit, the indices to sk->addr were swapped. tracked down and diff sent by Robert B Mills thanks, very good work! ok claudio Impact is that the "flush" keyword didn't work. Obtained from: OpenBSD MFC after: 1 week Modified: head/sys/contrib/pf/net/pf.c Modified: head/sys/contrib/pf/net/pf.c ============================================================================== --- head/sys/contrib/pf/net/pf.c Wed Jun 6 09:07:50 2012 (r236670) +++ head/sys/contrib/pf/net/pf.c Wed Jun 6 09:36:52 2012 (r236671) @@ -643,10 +643,10 @@ pf_src_connlimit(struct pf_state **state (*state)->key[PF_SK_WIRE]->af && (((*state)->direction == PF_OUT && PF_AEQ(&(*state)->src_node->addr, - &sk->addr[0], sk->af)) || + &sk->addr[1], sk->af)) || ((*state)->direction == PF_IN && PF_AEQ(&(*state)->src_node->addr, - &sk->addr[1], sk->af))) && + &sk->addr[0], sk->af))) && ((*state)->rule.ptr->flush & PF_FLUSH_GLOBAL || (*state)->rule.ptr == st->rule.ptr)) { From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 11:40:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4ED0D10656EA; Wed, 6 Jun 2012 11:40:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F6858FC20; Wed, 6 Jun 2012 11:40:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q56BeGWO011199; Wed, 6 Jun 2012 11:40:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q56BeGXV011197; Wed, 6 Jun 2012 11:40:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206061140.q56BeGXV011197@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Jun 2012 11:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236674 - stable/8/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 11:40:17 -0000 Author: mav Date: Wed Jun 6 11:40:16 2012 New Revision: 236674 URL: http://svn.freebsd.org/changeset/base/236674 Log: MFC r208896, r208900 (by mjacob): Do a minor amount of stylifying. Also, get a Fibre Channel WWPN if one exists for a da unit and create a sysctl OID for it. Modified: stable/8/sys/cam/scsi/scsi_da.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Wed Jun 6 10:56:59 2012 (r236673) +++ stable/8/sys/cam/scsi/scsi_da.c Wed Jun 6 11:40:16 2012 (r236674) @@ -136,6 +136,7 @@ struct da_softc { struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; struct callout sendordered_c; + uint64_t wwpn; }; struct da_quirk_entry { @@ -1312,6 +1313,7 @@ dasysctlinit(void *context, int pending) struct cam_periph *periph; struct da_softc *softc; char tmpstr[80], tmpstr2[80]; + struct ccb_trans_settings cts; periph = (struct cam_periph *)context; /* @@ -1338,14 +1340,38 @@ dasysctlinit(void *context, int pending) } /* - * Now register the sysctl handler, so the user can the value on + * Now register the sysctl handler, so the user can change the value on * the fly. */ - SYSCTL_ADD_PROC(&softc->sysctl_ctx,SYSCTL_CHILDREN(softc->sysctl_tree), + SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "minimum_cmd_size", CTLTYPE_INT | CTLFLAG_RW, &softc->minimum_cmd_size, 0, dacmdsizesysctl, "I", "Minimum CDB size"); + /* + * Add some addressing info. + */ + memset(&cts, 0, sizeof (cts)); + xpt_setup_ccb(&cts.ccb_h, periph->path, /*priority*/1); + cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; + cts.type = CTS_TYPE_CURRENT_SETTINGS; + cam_periph_lock(periph); + xpt_action((union ccb *)&cts); + cam_periph_unlock(periph); + if (cts.ccb_h.status != CAM_REQ_CMP) { + cam_periph_release(periph); + return; + } + if (cts.protocol == PROTO_SCSI && cts.transport == XPORT_FC) { + struct ccb_trans_settings_fc *fc = &cts.xport_specific.fc; + if (fc->valid & CTS_FC_VALID_WWPN) { + softc->wwpn = fc->wwpn; + SYSCTL_ADD_XLONG(&softc->sysctl_ctx, + SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "wwpn", CTLTYPE_QUAD | CTLFLAG_RD, + &softc->wwpn, "World Wide Port Name"); + } + } cam_periph_release(periph); } From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 11:46:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 562211065678; Wed, 6 Jun 2012 11:46:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 357E88FC25; Wed, 6 Jun 2012 11:46:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q56Bkces011575; Wed, 6 Jun 2012 11:46:38 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q56BkcD3011570; Wed, 6 Jun 2012 11:46:38 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206061146.q56BkcD3011570@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Jun 2012 11:46:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236675 - in stable/8/sys/cam: . scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 11:46:38 -0000 Author: mav Date: Wed Jun 6 11:46:37 2012 New Revision: 236675 URL: http://svn.freebsd.org/changeset/base/236675 Log: MFC r208911 (by mjacob): Implement the usage of Report Luns as part of SCSI probing for SCP3 or better devices. This can be disabled on a per-device basis using quirks as well. This also handles the case where there is actually no connected LUN 0 (which can definitely be the case for storage arrays). Modified: stable/8/sys/cam/cam_debug.h stable/8/sys/cam/cam_xpt.c stable/8/sys/cam/cam_xpt_internal.h stable/8/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/cam_debug.h ============================================================================== --- stable/8/sys/cam/cam_debug.h Wed Jun 6 11:40:16 2012 (r236674) +++ stable/8/sys/cam/cam_debug.h Wed Jun 6 11:46:37 2012 (r236675) @@ -40,7 +40,8 @@ typedef enum { CAM_DEBUG_SUBTRACE = 0x04, /* internal to routine flows */ CAM_DEBUG_CDB = 0x08, /* print out SCSI CDBs only */ CAM_DEBUG_XPT = 0x10, /* print out xpt scheduling */ - CAM_DEBUG_PERIPH = 0x20 /* print out peripheral calls */ + CAM_DEBUG_PERIPH = 0x20, /* print out peripheral calls */ + CAM_DEBUG_PROBE = 0x40 /* print out probe actions */ } cam_debug_flags; #if defined(CAMDEBUG) && defined(_KERNEL) @@ -58,6 +59,7 @@ extern u_int32_t cam_debug_delay; && (cam_dpath != NULL) \ && (xpt_path_comp(cam_dpath, path) >= 0) \ && (xpt_path_comp(cam_dpath, path) < 2)) + #define CAM_DEBUG(path, flag, printfargs) \ if ((cam_dflags & (flag)) \ && (cam_dpath != NULL) \ @@ -68,6 +70,7 @@ extern u_int32_t cam_debug_delay; if (cam_debug_delay != 0) \ DELAY(cam_debug_delay); \ } + #define CAM_DEBUG_PRINT(flag, printfargs) \ if (cam_dflags & (flag)) { \ printf("cam_debug: "); \ @@ -76,11 +79,20 @@ extern u_int32_t cam_debug_delay; DELAY(cam_debug_delay); \ } +#define CAM_DEBUG_PATH_PRINT(flag, path, printfargs) \ + if (cam_dflags & (flag)) { \ + xpt_print(path, "cam_debug: "); \ + printf printfargs; \ + if (cam_debug_delay != 0) \ + DELAY(cam_debug_delay); \ + } + #else /* !CAMDEBUG || !_KERNEL */ #define CAM_DEBUGGED(A, B) 0 #define CAM_DEBUG(A, B, C) #define CAM_DEBUG_PRINT(A, B) +#define CAM_DEBUG_PATH_PRINT(A, B, C) #endif /* CAMDEBUG && _KERNEL */ Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Wed Jun 6 11:40:16 2012 (r236674) +++ stable/8/sys/cam/cam_xpt.c Wed Jun 6 11:46:37 2012 (r236675) @@ -191,8 +191,18 @@ static struct cdevsw xpt_cdevsw = { /* Storage for debugging datastructures */ #ifdef CAMDEBUG struct cam_path *cam_dpath; -u_int32_t cam_dflags; +#ifdef CAM_DEBUG_FLAGS +u_int32_t cam_dflags = CAM_DEBUG_FLAGS; +#else +u_int32_t cam_dflags = CAM_DEBUG_NONE; +#endif +TUNABLE_INT("kern.cam.dflags", &cam_dflags); +SYSCTL_INT(_kern_cam, OID_AUTO, dflags, CTLFLAG_RW, + &cam_dflags, 0, "Cam Debug Flags"); u_int32_t cam_debug_delay; +TUNABLE_INT("kern.cam.debug_delay", &cam_debug_delay); +SYSCTL_INT(_kern_cam, OID_AUTO, debug_delay, CTLFLAG_RW, + &cam_debug_delay, 0, "Cam Debug Flags"); #endif /* Our boot-time initialization hook */ @@ -4369,6 +4379,7 @@ xpt_alloc_target(struct cam_eb *bus, tar target->target_id = target_id; target->refcount = 1; target->generation = 0; + target->luns = NULL; timevalclear(&target->last_reset); /* * Hold a reference to our parent bus so it @@ -4400,6 +4411,8 @@ xpt_release_target(struct cam_et *target TAILQ_REMOVE(&target->bus->et_entries, target, links); target->bus->generation++; xpt_release_bus(target->bus); + if (target->luns) + free(target->luns, M_CAMXPT); free(target, M_CAMXPT); } } @@ -4662,11 +4675,6 @@ xpt_config(void *arg) #ifdef CAMDEBUG /* Setup debugging flags and path */ -#ifdef CAM_DEBUG_FLAGS - cam_dflags = CAM_DEBUG_FLAGS; -#else /* !CAM_DEBUG_FLAGS */ - cam_dflags = CAM_DEBUG_NONE; -#endif /* CAM_DEBUG_FLAGS */ #ifdef CAM_DEBUG_BUS if (cam_dflags != CAM_DEBUG_NONE) { /* Modified: stable/8/sys/cam/cam_xpt_internal.h ============================================================================== --- stable/8/sys/cam/cam_xpt_internal.h Wed Jun 6 11:40:16 2012 (r236674) +++ stable/8/sys/cam/cam_xpt_internal.h Wed Jun 6 11:46:37 2012 (r236675) @@ -135,6 +135,8 @@ struct cam_et { u_int32_t refcount; u_int generation; struct timeval last_reset; + u_int rpl_size; + struct scsi_report_luns_data *luns; }; /* Modified: stable/8/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_xpt.c Wed Jun 6 11:40:16 2012 (r236674) +++ stable/8/sys/cam/scsi/scsi_xpt.c Wed Jun 6 11:46:37 2012 (r236675) @@ -71,6 +71,7 @@ struct scsi_quirk_entry { #define CAM_QUIRK_NOSERIAL 0x02 #define CAM_QUIRK_HILUNS 0x04 #define CAM_QUIRK_NOHILUNS 0x08 +#define CAM_QUIRK_NORPTLUNS 0x10 u_int mintags; u_int maxtags; }; @@ -84,6 +85,21 @@ SYSCTL_PROC(_kern_cam, OID_AUTO, cam_src "allow search above LUN 7 for SCSI3 and greater devices"); #define CAM_SCSI2_MAXLUN 8 +#define CAM_CAN_GET_SIMPLE_LUN(x, i) \ + ((((x)->luns[i].lundata[0] & RPL_LUNDATA_ATYP_MASK) == \ + RPL_LUNDATA_ATYP_PERIPH) || \ + (((x)->luns[i].lundata[0] & RPL_LUNDATA_ATYP_MASK) == \ + RPL_LUNDATA_ATYP_FLAT)) +#define CAM_GET_SIMPLE_LUN(lp, i, lval) \ + if (((lp)->luns[(i)].lundata[0] & RPL_LUNDATA_ATYP_MASK) == \ + RPL_LUNDATA_ATYP_PERIPH) { \ + (lval) = (lp)->luns[(i)].lundata[1]; \ + } else { \ + (lval) = (lp)->luns[(i)].lundata[0]; \ + (lval) &= RPL_LUNDATA_FLAT_LUN_MASK; \ + (lval) <<= 8; \ + (lval) |= (lp)->luns[(i)].lundata[1]; \ + } /* * If we're not quirked to search <= the first 8 luns * and we are either quirked to search above lun 8, @@ -116,6 +132,7 @@ typedef enum { PROBE_TUR, PROBE_INQUIRY, /* this counts as DV0 for Basic Domain Validation */ PROBE_FULL_INQUIRY, + PROBE_REPORT_LUNS, PROBE_MODE_SENSE, PROBE_SERIAL_NUM_0, PROBE_SERIAL_NUM_1, @@ -130,6 +147,7 @@ static char *probe_action_text[] = { "PROBE_TUR", "PROBE_INQUIRY", "PROBE_FULL_INQUIRY", + "PROBE_REPORT_LUNS", "PROBE_MODE_SENSE", "PROBE_SERIAL_NUM_0", "PROBE_SERIAL_NUM_1", @@ -531,6 +549,10 @@ static void proberequestdefaultnegotiat static int proberequestbackoff(struct cam_periph *periph, struct cam_ed *device); static void probedone(struct cam_periph *periph, union ccb *done_ccb); +static int probe_strange_rpl_data(struct scsi_report_luns_data *rp, + uint32_t maxlun); +static void probe_purge_old(struct cam_path *path, + struct scsi_report_luns_data *new); static void probecleanup(struct cam_periph *periph); static void scsi_find_quirk(struct cam_ed *device); static void scsi_scan_bus(struct cam_periph *periph, union ccb *ccb); @@ -689,6 +711,7 @@ probestart(struct cam_periph *periph, un softc = (probe_softc *)periph->softc; csio = &start_ccb->csio; +again: switch (softc->action) { case PROBE_TUR: @@ -777,6 +800,28 @@ probestart(struct cam_periph *periph, un /*timeout*/60 * 1000); break; } + case PROBE_REPORT_LUNS: + { + void *rp; + + rp = malloc(periph->path->target->rpl_size, + M_CAMXPT, M_NOWAIT | M_ZERO); + if (rp == NULL) { + struct scsi_inquiry_data *inq_buf; + inq_buf = &periph->path->device->inq_data; + xpt_print(periph->path, + "Unable to alloc report luns storage\n"); + if (INQ_DATA_TQ_ENABLED(inq_buf)) + PROBE_SET_ACTION(softc, PROBE_MODE_SENSE); + else + PROBE_SET_ACTION(softc, PROBE_SERIAL_NUM_0); + goto again; + } + scsi_report_luns(csio, 5, probedone, MSG_SIMPLE_Q_TAG, + RPL_REPORT_DEFAULT, rp, periph->path->target->rpl_size, + SSD_FULL_SIZE, 60000); break; + break; + } case PROBE_MODE_SENSE: { void *mode_buf; @@ -1049,9 +1094,7 @@ probedone(struct cam_periph *periph, uni periph_qual = SID_QUAL(inq_buf); - switch(periph_qual) { - case SID_QUAL_LU_CONNECTED: - { + if (periph_qual == SID_QUAL_LU_CONNECTED) { u_int8_t len; /* @@ -1078,10 +1121,23 @@ probedone(struct cam_periph *periph, uni scsi_find_quirk(path->device); scsi_devise_transport(path); - if (INQ_DATA_TQ_ENABLED(inq_buf)) - PROBE_SET_ACTION(softc, PROBE_MODE_SENSE); + + if (path->device->lun_id == 0 && + SID_ANSI_REV(inq_buf) > SCSI_REV_SPC2 && + (SCSI_QUIRK(path->device)->quirks & + CAM_QUIRK_NORPTLUNS) == 0) { + PROBE_SET_ACTION(softc, + PROBE_REPORT_LUNS); + /* + * Start with room for *one* lun. + */ + periph->path->target->rpl_size = 16; + } else if (INQ_DATA_TQ_ENABLED(inq_buf)) + PROBE_SET_ACTION(softc, + PROBE_MODE_SENSE); else - PROBE_SET_ACTION(softc, PROBE_SERIAL_NUM_0); + PROBE_SET_ACTION(softc, + PROBE_SERIAL_NUM_0); if (path->device->flags & CAM_DEV_UNCONFIGURED) { path->device->flags &= ~CAM_DEV_UNCONFIGURED; @@ -1090,9 +1146,21 @@ probedone(struct cam_periph *periph, uni xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); return; - } - default: - break; + } else if (path->device->lun_id == 0 && + SID_ANSI_REV(inq_buf) > SCSI_REV_SPC2 && + (SCSI_QUIRK(path->device)->quirks & + CAM_QUIRK_NORPTLUNS) == 0) { + if (path->device->flags & + CAM_DEV_UNCONFIGURED) { + path->device->flags &= + ~CAM_DEV_UNCONFIGURED; + xpt_acquire_device(path->device); + } + PROBE_SET_ACTION(softc, PROBE_REPORT_LUNS); + periph->path->target->rpl_size = 16; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; } } else if (cam_periph_error(done_ccb, 0, done_ccb->ccb_h.target_lun > 0 @@ -1122,6 +1190,120 @@ probedone(struct cam_periph *periph, uni xpt_release_ccb(done_ccb); break; } + case PROBE_REPORT_LUNS: + { + struct ccb_scsiio *csio; + struct scsi_report_luns_data *lp; + u_int nlun, maxlun; + + csio = &done_ccb->csio; + + lp = (struct scsi_report_luns_data *)csio->data_ptr; + nlun = scsi_4btoul(lp->length) / 8; + maxlun = (csio->dxfer_len / 8) - 1; + + if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + if (cam_periph_error(done_ccb, 0, + done_ccb->ccb_h.target_lun > 0 ? + SF_RETRY_UA|SF_QUIET_IR : SF_RETRY_UA, + &softc->saved_ccb) == ERESTART) { + return; + } + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { + xpt_release_devq(done_ccb->ccb_h.path, 1, + TRUE); + } + free(lp, M_CAMXPT); + lp = NULL; + } else if (nlun > maxlun) { + /* + * Reallocate and retry to cover all luns + */ + CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, path, + ("reallocating REPORT_LUNS for %u luns\n", nlun)); + free(lp, M_CAMXPT); + path->target->rpl_size = (nlun << 3) + 8; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + } else if (nlun == 0) { + /* + * If there don't appear to be any luns, bail. + */ + free(lp, M_CAMXPT); + lp = NULL; + } else if (probe_strange_rpl_data(lp, maxlun)) { + /* + * If we can't understand the lun format + * of any entry, bail. + */ + free(lp, M_CAMXPT); + lp = NULL; + } else { + lun_id_t lun; + int idx; + + CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, path, + ("%u luns reported\n", nlun)); + + CAM_GET_SIMPLE_LUN(lp, 0, lun); + /* + * If the first lun is not lun 0, then either there + * is no lun 0 in the list, or the list is unsorted. + */ + if (lun != 0) { + for (idx = 0; idx < nlun; idx++) { + CAM_GET_SIMPLE_LUN(lp, idx, lun); + if (lun == 0) { + break; + } + } + if (idx != nlun) { + uint8_t tlun[8]; + memcpy(tlun, + lp->luns[0].lundata, 8); + memcpy(lp->luns[0].lundata, + lp->luns[idx].lundata, 8); + memcpy(lp->luns[idx].lundata, + tlun, 8); + CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, + path, ("lun 0 in position %u\n", idx)); + } else { + /* + * There is no lun 0 in our list. Destroy + * the validity of the inquiry data so we + * bail here and now. + */ + path->device->flags &= + ~CAM_DEV_INQUIRY_DATA_VALID; + } + } + /* + * If we have an old lun list, We can either + * retest luns that appear to have been dropped, + * or just nuke them. We'll opt for the latter. + * This function will also install the new list + * in the target structure. + */ + probe_purge_old(path, lp); + lp = NULL; + } + if (path->device->flags & CAM_DEV_INQUIRY_DATA_VALID) { + struct scsi_inquiry_data *inq_buf; + inq_buf = &path->device->inq_data; + if (INQ_DATA_TQ_ENABLED(inq_buf)) + PROBE_SET_ACTION(softc, PROBE_MODE_SENSE); + else + PROBE_SET_ACTION(softc, PROBE_SERIAL_NUM_0); + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + } + if (lp) { + free(lp, M_CAMXPT); + } + break; + } case PROBE_MODE_SENSE: { struct ccb_scsiio *csio; @@ -1436,6 +1618,80 @@ probedone(struct cam_periph *periph, uni } } +static int +probe_strange_rpl_data(struct scsi_report_luns_data *rp, uint32_t maxlun) +{ + uint32_t idx; + uint32_t nlun = MIN(maxlun, (scsi_4btoul(rp->length) / 8)); + + for (idx = 0; idx < nlun; idx++) { + if (!CAM_CAN_GET_SIMPLE_LUN(rp, idx)) { + return (-1); + } + } + return (0); +} + +static void +probe_purge_old(struct cam_path *path, struct scsi_report_luns_data *new) +{ + struct cam_path *tp; + struct scsi_report_luns_data *old; + u_int idx1, idx2, nlun_old, nlun_new, this_lun; + u_int8_t *ol, *nl; + + if (path->target == NULL) { + return; + } + if (path->target->luns == NULL) { + path->target->luns = new; + return; + } + old = path->target->luns; + nlun_old = scsi_4btoul(old->length) / 8; + nlun_new = scsi_4btoul(new->length) / 8; + + /* + * We are not going to assume sorted lists. Deal. + */ + for (idx1 = 0; idx1 < nlun_old; idx1++) { + ol = old->luns[idx1].lundata; + for (idx2 = 0; idx2 < nlun_new; idx2++) { + nl = new->luns[idx2].lundata; + if (memcmp(nl, ol, 8) == 0) { + break; + } + } + if (idx2 < nlun_new) { + continue; + } + /* + * An 'old' item not in the 'new' list. + * Nuke it. Except that if it is lun 0, + * that would be what the probe state + * machine is currently working on, + * so we won't do that. + * + * We also cannot nuke it if it is + * not in a lun format we understand. + */ + if (!CAM_CAN_GET_SIMPLE_LUN(old, idx1)) { + continue; + } + CAM_GET_SIMPLE_LUN(old, idx1, this_lun); + if (this_lun == 0) { + continue; + } + if (xpt_create_path(&tp, NULL, xpt_path_path_id(path), + xpt_path_target_id(path), this_lun) == CAM_REQ_CMP) { + xpt_async(AC_LOST_DEVICE, tp, NULL); + xpt_free_path(tp); + } + } + free(old, M_CAMXPT); + path->target->luns = new; +} + static void probecleanup(struct cam_periph *periph) { @@ -1484,6 +1740,7 @@ typedef struct { union ccb *request_ccb; struct ccb_pathinq *cpi; int counter; + int lunindex[0]; } scsi_scan_bus_info; /* @@ -1557,13 +1814,15 @@ scsi_scan_bus(struct cam_periph *periph, } /* Save some state for use while we probe for devices */ - scan_info = (scsi_scan_bus_info *) - malloc(sizeof(scsi_scan_bus_info), M_CAMXPT, M_NOWAIT); + scan_info = (scsi_scan_bus_info *) malloc(sizeof(scsi_scan_bus_info) + + (work_ccb->cpi.max_target * sizeof (u_int)), M_CAMXPT, M_ZERO|M_NOWAIT); if (scan_info == NULL) { request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; xpt_done(request_ccb); return; } + CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, request_ccb->ccb_h.path, + ("SCAN start for %p\n", scan_info)); scan_info->request_ccb = request_ccb; scan_info->cpi = &work_ccb->cpi; @@ -1630,26 +1889,76 @@ scsi_scan_bus(struct cam_periph *periph, case XPT_SCAN_LUN: { cam_status status; - struct cam_path *path; + struct cam_path *path, *oldpath; scsi_scan_bus_info *scan_info; + struct cam_et *target; + struct cam_ed *device; + int next_target; path_id_t path_id; target_id_t target_id; lun_id_t lun_id; + oldpath = request_ccb->ccb_h.path; + + status = request_ccb->ccb_h.status & CAM_STATUS_MASK; /* Reuse the same CCB to query if a device was really found */ scan_info = (scsi_scan_bus_info *)request_ccb->ccb_h.ppriv_ptr0; xpt_setup_ccb(&request_ccb->ccb_h, request_ccb->ccb_h.path, request_ccb->ccb_h.pinfo.priority); request_ccb->ccb_h.func_code = XPT_GDEV_TYPE; + path_id = request_ccb->ccb_h.path_id; target_id = request_ccb->ccb_h.target_id; lun_id = request_ccb->ccb_h.target_lun; xpt_action(request_ccb); - if (request_ccb->ccb_h.status != CAM_REQ_CMP) { - struct cam_ed *device; - struct cam_et *target; + target = request_ccb->ccb_h.path->target; + next_target = 1; + + if (target->luns) { + uint32_t first; + u_int nluns = scsi_4btoul(target->luns->length) / 8; + + /* + * Make sure we skip over lun 0 if it's the first member + * of the list as we've actually just finished probing + * it. + */ + CAM_GET_SIMPLE_LUN(target->luns, 0, first); + if (first == 0 && scan_info->lunindex[target_id] == 0) { + scan_info->lunindex[target_id]++; + } + + if (scan_info->lunindex[target_id] < nluns) { + CAM_GET_SIMPLE_LUN(target->luns, + scan_info->lunindex[target_id], lun_id); + next_target = 0; + CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, + request_ccb->ccb_h.path, + ("next lun to try at index %u is %u\n", + scan_info->lunindex[target_id], lun_id)); + scan_info->lunindex[target_id]++; + } else { + /* + * We're done with scanning all luns. + * + * Nuke the bogus device for lun 0 if lun 0 + * wasn't on the list. + */ + if (first != 0) { + TAILQ_FOREACH(device, + &target->ed_entries, links) { + if (device->lun_id == 0) { + break; + } + } + if (device) { + xpt_release_device(device); + } + } + } + } else if (request_ccb->ccb_h.status != CAM_REQ_CMP) { int phl; /* @@ -1658,7 +1967,6 @@ scsi_scan_bus(struct cam_periph *periph, * target that might have "gone away", go onto * the next lun. */ - target = request_ccb->ccb_h.path->target; /* * We may touch devices that we don't * hold references too, so ensure they @@ -1674,11 +1982,15 @@ scsi_scan_bus(struct cam_periph *periph, device = TAILQ_NEXT(device, links); } if ((lun_id != 0) || (device != NULL)) { - if (lun_id < (CAM_SCSI2_MAXLUN-1) || phl) + if (lun_id < (CAM_SCSI2_MAXLUN-1) || phl) { lun_id++; + next_target = 0; + } } + if (lun_id == request_ccb->ccb_h.target_lun + || lun_id > scan_info->cpi->max_lun) + next_target = 1; } else { - struct cam_ed *device; device = request_ccb->ccb_h.path->device; @@ -1686,23 +1998,26 @@ scsi_scan_bus(struct cam_periph *periph, CAM_QUIRK_NOLUNS) == 0) { /* Try the next lun */ if (lun_id < (CAM_SCSI2_MAXLUN-1) - || CAN_SRCH_HI_DENSE(device)) + || CAN_SRCH_HI_DENSE(device)) { lun_id++; + next_target = 0; + } } + if (lun_id == request_ccb->ccb_h.target_lun + || lun_id > scan_info->cpi->max_lun) + next_target = 1; } /* - * Free the current request path- we're done with it. - */ - xpt_free_path(request_ccb->ccb_h.path); - - /* * Check to see if we scan any further luns. */ - if (lun_id == request_ccb->ccb_h.target_lun - || lun_id > scan_info->cpi->max_lun) { + if (next_target) { int done; + /* + * Free the current request path- we're done with it. + */ + xpt_free_path(oldpath); hop_again: done = 0; if (scan_info->request_ccb->ccb_h.func_code == XPT_SCAN_TGT) { @@ -1727,6 +2042,9 @@ scsi_scan_bus(struct cam_periph *periph, xpt_free_ccb(request_ccb); xpt_free_ccb((union ccb *)scan_info->cpi); request_ccb = scan_info->request_ccb; + CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, + request_ccb->ccb_h.path, + ("SCAN done for %p\n", scan_info)); free(scan_info, M_CAMXPT); request_ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(request_ccb); @@ -1762,6 +2080,13 @@ scsi_scan_bus(struct cam_periph *periph, } else { status = xpt_create_path(&path, xpt_periph, path_id, target_id, lun_id); + /* + * Free the old request path- we're done with it. We + * do this *after* creating the new path so that + * we don't remove a target that has our lun list + * in the case that lun 0 is not present. + */ + xpt_free_path(oldpath); if (status != CAM_REQ_CMP) { printf("scsi_scan_bus: xpt_create_path failed " "with status %#x, halting LUN scan\n", From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 12:16:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A33A31065677; Wed, 6 Jun 2012 12:16:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C1068FC0C; Wed, 6 Jun 2012 12:16:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q56CGs3w013385; Wed, 6 Jun 2012 12:16:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q56CGsZ5013381; Wed, 6 Jun 2012 12:16:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206061216.q56CGsZ5013381@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Jun 2012 12:16:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236677 - stable/9/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 12:16:54 -0000 Author: mav Date: Wed Jun 6 12:16:54 2012 New Revision: 236677 URL: http://svn.freebsd.org/changeset/base/236677 Log: MFC r230053: Add BIO_DELETE support for SCSI Direct Access devices (da). Depending on device capabilities use different methods to implement it. Currently used method can be read/set via kern.cam.da.X.delete_method sysctls. Possible values are: NONE - no provisioning support reported by the device; DISABLE - provisioning support was disabled because of errors; ZERO - use WRITE SAME (10) command to write zeroes; WS10 - use WRITE SAME (10) command with UNMAP bit set; WS16 - use WRITE SAME (16) command with UNMAP bit set; UNMAP - use UNMAP command (equivalent of the ATA DSM TRIM command). The last two methods (UNMAP and WS16) are defined by SBC specification and the UNMAP method is the most advanced one. The rest of methods I've found supported in Linux, and as soon as they were trivial to implement, then why not? Hope they will be useful in some cases. Unluckily I have no devices properly reporting parameters of the logical block provisioning support via respective VPD pages (0xB0 and 0xB2). So all info I have/use now is the flag telling whether logical block provisioning is supported or not. As result, specific methods chosen now by trying different ones in order (UNMAP, WS16, DISABLE) and checking completion status to fallback if needed. I don't expect problems from this, as if something go wrong, it should just disable itself. It may disable even too aggressively if only some command parameter misfit. Unlike Linux, which executes each delete with separate request, I've implemented here the same request aggregation as implemented in ada driver. Tests on SSDs I have show much better results doing it this way: above 8GB/s of the linear delete on Intel SATA SSD on LSI SAS HBA (mps). Sponsored by: iXsystems, Inc. Modified: stable/9/sys/cam/scsi/scsi_all.c stable/9/sys/cam/scsi/scsi_all.h stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_all.c Wed Jun 6 12:13:20 2012 (r236676) +++ stable/9/sys/cam/scsi/scsi_all.c Wed Jun 6 12:16:54 2012 (r236677) @@ -364,6 +364,8 @@ static struct op_table_entry scsi_op_cod { 0x40, D | T | L | P | W | R | O | M | S | C, "CHANGE DEFINITION" }, /* 41 O WRITE SAME(10) */ { 0x41, D, "WRITE SAME(10)" }, + /* 42 O UNMAP */ + { 0x42, D, "UNMAP" }, /* 42 O READ SUB-CHANNEL */ { 0x42, R, "READ SUB-CHANNEL" }, /* 43 O READ TOC/PMA/ATIP */ @@ -5570,6 +5572,104 @@ scsi_read_write(struct ccb_scsiio *csio, } void +scsi_write_same(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t byte2, + int minimum_cmd_size, u_int64_t lba, u_int32_t block_count, + u_int8_t *data_ptr, u_int32_t dxfer_len, u_int8_t sense_len, + u_int32_t timeout) +{ + u_int8_t cdb_len; + if ((minimum_cmd_size < 16) && + ((block_count & 0xffff) == block_count) && + ((lba & 0xffffffff) == lba)) { + /* + * Need a 10 byte cdb. + */ + struct scsi_write_same_10 *scsi_cmd; + + scsi_cmd = (struct scsi_write_same_10 *)&csio->cdb_io.cdb_bytes; + scsi_cmd->opcode = WRITE_SAME_10; + scsi_cmd->byte2 = byte2; + scsi_ulto4b(lba, scsi_cmd->addr); + scsi_cmd->group = 0; + scsi_ulto2b(block_count, scsi_cmd->length); + scsi_cmd->control = 0; + cdb_len = sizeof(*scsi_cmd); + + CAM_DEBUG(csio->ccb_h.path, CAM_DEBUG_SUBTRACE, + ("10byte: %x%x%x%x:%x%x: %d\n", scsi_cmd->addr[0], + scsi_cmd->addr[1], scsi_cmd->addr[2], + scsi_cmd->addr[3], scsi_cmd->length[0], + scsi_cmd->length[1], dxfer_len)); + } else { + /* + * 16 byte CDB. We'll only get here if the LBA is larger + * than 2^32, or if the user asks for a 16 byte command. + */ + struct scsi_write_same_16 *scsi_cmd; + + scsi_cmd = (struct scsi_write_same_16 *)&csio->cdb_io.cdb_bytes; + scsi_cmd->opcode = WRITE_SAME_16; + scsi_cmd->byte2 = byte2; + scsi_u64to8b(lba, scsi_cmd->addr); + scsi_ulto4b(block_count, scsi_cmd->length); + scsi_cmd->group = 0; + scsi_cmd->control = 0; + cdb_len = sizeof(*scsi_cmd); + + CAM_DEBUG(csio->ccb_h.path, CAM_DEBUG_SUBTRACE, + ("16byte: %x%x%x%x%x%x%x%x:%x%x%x%x: %d\n", + scsi_cmd->addr[0], scsi_cmd->addr[1], + scsi_cmd->addr[2], scsi_cmd->addr[3], + scsi_cmd->addr[4], scsi_cmd->addr[5], + scsi_cmd->addr[6], scsi_cmd->addr[7], + scsi_cmd->length[0], scsi_cmd->length[1], + scsi_cmd->length[2], scsi_cmd->length[3], + dxfer_len)); + } + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_OUT, + tag_action, + data_ptr, + dxfer_len, + sense_len, + cdb_len, + timeout); +} + +void +scsi_unmap(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t byte2, + u_int8_t *data_ptr, u_int16_t dxfer_len, u_int8_t sense_len, + u_int32_t timeout) +{ + struct scsi_unmap *scsi_cmd; + + scsi_cmd = (struct scsi_unmap *)&csio->cdb_io.cdb_bytes; + scsi_cmd->opcode = UNMAP; + scsi_cmd->byte2 = byte2; + scsi_ulto4b(0, scsi_cmd->reserved); + scsi_cmd->group = 0; + scsi_ulto2b(dxfer_len, scsi_cmd->length); + scsi_cmd->control = 0; + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_OUT, + tag_action, + data_ptr, + dxfer_len, + sense_len, + sizeof(*scsi_cmd), + timeout); +} + +void scsi_receive_diagnostic_results(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb*), uint8_t tag_action, int pcv, uint8_t page_code, Modified: stable/9/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/9/sys/cam/scsi/scsi_all.h Wed Jun 6 12:13:20 2012 (r236676) +++ stable/9/sys/cam/scsi/scsi_all.h Wed Jun 6 12:16:54 2012 (r236677) @@ -819,6 +819,41 @@ struct scsi_rw_16 u_int8_t control; }; +struct scsi_write_same_10 +{ + uint8_t opcode; + uint8_t byte2; +#define SWS_LBDATA 0x02 +#define SWS_PBDATA 0x04 +#define SWS_UNMAP 0x08 +#define SWS_ANCHOR 0x10 + uint8_t addr[4]; + uint8_t group; + uint8_t length[2]; + uint8_t control; +}; + +struct scsi_write_same_16 +{ + uint8_t opcode; + uint8_t byte2; + uint8_t addr[8]; + uint8_t length[4]; + uint8_t group; + uint8_t control; +}; + +struct scsi_unmap +{ + uint8_t opcode; + uint8_t byte2; +#define SU_ANCHOR 0x01 + uint8_t reserved[4]; + uint8_t group; + uint8_t length[2]; + uint8_t control; +}; + struct scsi_write_verify_10 { uint8_t opcode; @@ -957,6 +992,8 @@ struct ata_pass_16 { #define WRITE_BUFFER 0x3B #define READ_BUFFER 0x3C #define CHANGE_DEFINITION 0x40 +#define WRITE_SAME_10 0x41 +#define UNMAP 0x42 #define LOG_SELECT 0x4C #define LOG_SENSE 0x4D #define MODE_SELECT_10 0x55 @@ -970,6 +1007,7 @@ struct ata_pass_16 { #define WRITE_16 0x8A #define WRITE_VERIFY_16 0x8E #define SYNCHRONIZE_CACHE_16 0x91 +#define WRITE_SAME_16 0x93 #define SERVICE_ACTION_IN 0x9E #define REPORT_LUNS 0xA0 #define ATA_PASS_12 0xA1 @@ -2312,6 +2350,20 @@ void scsi_read_write(struct ccb_scsiio * u_int32_t dxfer_len, u_int8_t sense_len, u_int32_t timeout); +void scsi_write_same(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t byte2, + int minimum_cmd_size, u_int64_t lba, + u_int32_t block_count, u_int8_t *data_ptr, + u_int32_t dxfer_len, u_int8_t sense_len, + u_int32_t timeout); + +void scsi_unmap(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t byte2, + u_int8_t *data_ptr, u_int16_t dxfer_len, + u_int8_t sense_len, u_int32_t timeout); + void scsi_start_stop(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, int start, int load_eject, Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Wed Jun 6 12:13:20 2012 (r236676) +++ stable/9/sys/cam/scsi/scsi_da.c Wed Jun 6 12:16:54 2012 (r236677) @@ -83,8 +83,7 @@ typedef enum { DA_FLAG_RETRY_UA = 0x080, DA_FLAG_OPEN = 0x100, DA_FLAG_SCTX_INIT = 0x200, - DA_FLAG_CAN_RC16 = 0x400, - DA_FLAG_CAN_LBPME = 0x800 + DA_FLAG_CAN_RC16 = 0x400 } da_flags; typedef enum { @@ -101,10 +100,24 @@ typedef enum { DA_CCB_BUFFER_IO = 0x03, DA_CCB_WAITING = 0x04, DA_CCB_DUMP = 0x05, + DA_CCB_DELETE = 0x06, DA_CCB_TYPE_MASK = 0x0F, DA_CCB_RETRY_UA = 0x10 } da_ccb_state; +typedef enum { + DA_DELETE_NONE, + DA_DELETE_DISABLE, + DA_DELETE_ZERO, + DA_DELETE_WS10, + DA_DELETE_WS16, + DA_DELETE_UNMAP, + DA_DELETE_MAX = DA_DELETE_UNMAP +} da_delete_methods; + +static const char *da_delete_method_names[] = + { "NONE", "DISABLE", "ZERO", "WS10", "WS16", "UNMAP" }; + /* Offsets into our private area for storing information */ #define ccb_state ppriv_field0 #define ccb_bp ppriv_ptr1 @@ -119,8 +132,12 @@ struct disk_params { u_int stripeoffset; }; +#define UNMAP_MAX_RANGES 512 + struct da_softc { struct bio_queue_head bio_queue; + struct bio_queue_head delete_queue; + struct bio_queue_head delete_run_queue; SLIST_ENTRY(da_softc) links; LIST_HEAD(, ccb_hdr) pending_ccbs; da_state state; @@ -130,6 +147,10 @@ struct da_softc { int error_inject; int ordered_tag_count; int outstanding_cmds; + int unmap_max_ranges; + int unmap_max_lba; + int delete_running; + da_delete_methods delete_method; struct disk_params params; struct disk *disk; union ccb saved_ccb; @@ -138,6 +159,7 @@ struct da_softc { struct sysctl_oid *sysctl_tree; struct callout sendordered_c; uint64_t wwpn; + uint8_t unmap_buf[UNMAP_MAX_RANGES * 16 + 8]; }; struct da_quirk_entry { @@ -817,6 +839,7 @@ static void daasync(void *callback_arg, struct cam_path *path, void *arg); static void dasysctlinit(void *context, int pending); static int dacmdsizesysctl(SYSCTL_HANDLER_ARGS); +static int dadeletemethodsysctl(SYSCTL_HANDLER_ARGS); static periph_ctor_t daregister; static periph_dtor_t dacleanup; static periph_start_t dastart; @@ -937,6 +960,10 @@ daopen(struct disk *dp) softc->disk->d_fwheads = softc->params.heads; softc->disk->d_devstat->block_size = softc->params.secsize; softc->disk->d_devstat->flags &= ~DEVSTAT_BS_UNAVAILABLE; + if (softc->delete_method > DA_DELETE_DISABLE) + softc->disk->d_flags |= DISKFLAG_CANDELETE; + else + softc->disk->d_flags &= ~DISKFLAG_CANDELETE; if ((softc->flags & DA_FLAG_PACK_REMOVABLE) != 0 && (softc->quirks & DA_Q_NO_PREVENT) == 0) @@ -1034,6 +1061,26 @@ daclose(struct disk *dp) return (0); } +static void +daschedule(struct cam_periph *periph) +{ + struct da_softc *softc = (struct da_softc *)periph->softc; + uint32_t prio; + + /* Check if cam_periph_getccb() was called. */ + prio = periph->immediate_priority; + + /* Check if we have more work to do. */ + if (bioq_first(&softc->bio_queue) || + (!softc->delete_running && bioq_first(&softc->delete_queue))) { + prio = CAM_PRIORITY_NORMAL; + } + + /* Schedule CCB if any of above is true. */ + if (prio != CAM_PRIORITY_NONE) + xpt_schedule(periph, prio); +} + /* * Actually translate the requested transfer into one the physical driver * can understand. The transfer is described by a buf and will include @@ -1066,12 +1113,18 @@ dastrategy(struct bio *bp) /* * Place it in the queue of disk activities for this disk */ - bioq_disksort(&softc->bio_queue, bp); + if (bp->bio_cmd == BIO_DELETE) { + if (bp->bio_bcount == 0) + biodone(bp); + else + bioq_disksort(&softc->delete_queue, bp); + } else + bioq_disksort(&softc->bio_queue, bp); /* * Schedule ourselves for performing the work. */ - xpt_schedule(periph, CAM_PRIORITY_NORMAL); + daschedule(periph); cam_periph_unlock(periph); return; @@ -1234,6 +1287,7 @@ daoninvalidate(struct cam_periph *periph * with XPT_ABORT_CCB. */ bioq_flush(&softc->bio_queue, NULL, ENXIO); + bioq_flush(&softc->delete_queue, NULL, ENXIO); disk_gone(softc->disk); xpt_print(periph->path, "lost device - %d outstanding, %d refs\n", @@ -1379,6 +1433,10 @@ dasysctlinit(void *context, int pending) * the fly. */ SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "delete_method", CTLTYPE_STRING | CTLFLAG_RW, + &softc->delete_method, 0, dadeletemethodsysctl, "A", + "BIO_DELETE execution method"); + SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "minimum_cmd_size", CTLTYPE_INT | CTLFLAG_RW, &softc->minimum_cmd_size, 0, dacmdsizesysctl, "I", "Minimum CDB size"); @@ -1452,6 +1510,32 @@ dacmdsizesysctl(SYSCTL_HANDLER_ARGS) return (0); } +static int +dadeletemethodsysctl(SYSCTL_HANDLER_ARGS) +{ + char buf[16]; + int error; + const char *p; + int i, value; + + value = *(int *)arg1; + if (value < 0 || value > DA_DELETE_MAX) + p = "UNKNOWN"; + else + p = da_delete_method_names[value]; + strncpy(buf, p, sizeof(buf)); + error = sysctl_handle_string(oidp, buf, sizeof(buf), req); + if (error != 0 || req->newptr == NULL) + return (error); + for (i = 0; i <= DA_DELETE_MAX; i++) { + if (strcmp(buf, da_delete_method_names[i]) != 0) + continue; + *(int *)arg1 = i; + return (0); + } + return (EINVAL); +} + static cam_status daregister(struct cam_periph *periph, void *arg) { @@ -1484,10 +1568,14 @@ daregister(struct cam_periph *periph, vo LIST_INIT(&softc->pending_ccbs); softc->state = DA_STATE_PROBE; bioq_init(&softc->bio_queue); + bioq_init(&softc->delete_queue); + bioq_init(&softc->delete_run_queue); if (SID_IS_REMOVABLE(&cgd->inq_data)) softc->flags |= DA_FLAG_PACK_REMOVABLE; if ((cgd->inq_data.flags & SID_CmdQue) != 0) softc->flags |= DA_FLAG_TAGGED_QUEUING; + softc->unmap_max_ranges = UNMAP_MAX_RANGES; + softc->unmap_max_lba = 1024*1024*2; periph->softc = softc; @@ -1640,13 +1728,10 @@ dastart(struct cam_periph *periph, union switch (softc->state) { case DA_STATE_NORMAL: { - /* Pull a buffer from the queue and get going on it */ - struct bio *bp; + struct bio *bp, *bp1; + uint8_t tag_code; - /* - * See if there is a buf with work for us to do.. - */ - bp = bioq_first(&softc->bio_queue); + /* Execute immediate CCB if waiting. */ if (periph->immediate_priority <= periph->pinfo.priority) { CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE, ("queuing for immediate ccb\n")); @@ -1655,84 +1740,186 @@ dastart(struct cam_periph *periph, union periph_links.sle); periph->immediate_priority = CAM_PRIORITY_NONE; wakeup(&periph->ccb_list); - } else if (bp == NULL) { - xpt_release_ccb(start_ccb); - } else { - u_int8_t tag_code; + /* May have more work to do, so ensure we stay scheduled */ + daschedule(periph); + break; + } - bioq_remove(&softc->bio_queue, bp); + /* Run BIO_DELETE if not running yet. */ + if (!softc->delete_running && + (bp = bioq_first(&softc->delete_queue)) != NULL) { + uint64_t lba; + u_int count; + + if (softc->delete_method == DA_DELETE_UNMAP) { + uint8_t *buf = softc->unmap_buf; + uint64_t lastlba = (uint64_t)-1; + uint32_t lastcount = 0; + int blocks = 0, off, ranges = 0; + + softc->delete_running = 1; + bzero(softc->unmap_buf, sizeof(softc->unmap_buf)); + bp1 = bp; + do { + bioq_remove(&softc->delete_queue, bp1); + if (bp1 != bp) + bioq_insert_tail(&softc->delete_run_queue, bp1); + lba = bp1->bio_pblkno; + count = bp1->bio_bcount / softc->params.secsize; + + /* Try to extend the previous range. */ + if (lba == lastlba) { + lastcount += count; + off = (ranges - 1) * 16 + 8; + scsi_ulto4b(lastcount, &buf[off + 8]); + } else if (count > 0) { + off = ranges * 16 + 8; + scsi_u64to8b(lba, &buf[off + 0]); + scsi_ulto4b(count, &buf[off + 8]); + lastcount = count; + ranges++; + } + blocks += count; + lastlba = lba + count; + bp1 = bioq_first(&softc->delete_queue); + if (bp1 == NULL || + ranges >= softc->unmap_max_ranges || + blocks + bp1->bio_bcount / + softc->params.secsize > softc->unmap_max_lba) + break; + } while (1); + scsi_ulto2b(count * 16 + 6, &buf[0]); + scsi_ulto2b(count * 16, &buf[2]); + + scsi_unmap(&start_ccb->csio, + /*retries*/da_retry_count, + /*cbfcnp*/dadone, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*byte2*/0, + /*data_ptr*/ buf, + /*dxfer_len*/ count * 16 + 8, + /*sense_len*/SSD_FULL_SIZE, + da_default_timeout * 1000); + start_ccb->ccb_h.ccb_state = DA_CCB_DELETE; + goto out; + } else if (softc->delete_method == DA_DELETE_ZERO || + softc->delete_method == DA_DELETE_WS10 || + softc->delete_method == DA_DELETE_WS16) { + softc->delete_running = 1; + lba = bp->bio_pblkno; + count = 0; + bp1 = bp; + do { + bioq_remove(&softc->delete_queue, bp1); + if (bp1 != bp) + bioq_insert_tail(&softc->delete_run_queue, bp1); + count += bp1->bio_bcount / softc->params.secsize; + bp1 = bioq_first(&softc->delete_queue); + if (bp1 == NULL || + lba + count != bp1->bio_pblkno || + count + bp1->bio_bcount / + softc->params.secsize > 0xffff) + break; + } while (1); + + scsi_write_same(&start_ccb->csio, + /*retries*/da_retry_count, + /*cbfcnp*/dadone, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*byte2*/softc->delete_method == + DA_DELETE_ZERO ? 0 : SWS_UNMAP, + softc->delete_method == + DA_DELETE_WS16 ? 16 : 10, + /*lba*/lba, + /*block_count*/count, + /*data_ptr*/ __DECONST(void *, + zero_region), + /*dxfer_len*/ softc->params.secsize, + /*sense_len*/SSD_FULL_SIZE, + da_default_timeout * 1000); + start_ccb->ccb_h.ccb_state = DA_CCB_DELETE; + goto out; + } else { + bioq_flush(&softc->delete_queue, NULL, 0); + /* FALLTHROUGH */ + } + } - if ((bp->bio_flags & BIO_ORDERED) != 0 - || (softc->flags & DA_FLAG_NEED_OTAG) != 0) { - softc->flags &= ~DA_FLAG_NEED_OTAG; - softc->ordered_tag_count++; - tag_code = MSG_ORDERED_Q_TAG; - } else { - tag_code = MSG_SIMPLE_Q_TAG; - } - switch (bp->bio_cmd) { - case BIO_READ: - case BIO_WRITE: - scsi_read_write(&start_ccb->csio, - /*retries*/da_retry_count, - /*cbfcnp*/dadone, - /*tag_action*/tag_code, - /*read_op*/bp->bio_cmd - == BIO_READ, - /*byte2*/0, - softc->minimum_cmd_size, - /*lba*/bp->bio_pblkno, - /*block_count*/bp->bio_bcount / - softc->params.secsize, - /*data_ptr*/ bp->bio_data, - /*dxfer_len*/ bp->bio_bcount, - /*sense_len*/SSD_FULL_SIZE, - da_default_timeout * 1000); - break; - case BIO_FLUSH: - /* - * BIO_FLUSH doesn't currently communicate - * range data, so we synchronize the cache - * over the whole disk. We also force - * ordered tag semantics the flush applies - * to all previously queued I/O. - */ - scsi_synchronize_cache(&start_ccb->csio, - /*retries*/1, - /*cbfcnp*/dadone, - MSG_ORDERED_Q_TAG, - /*begin_lba*/0, - /*lb_count*/0, - SSD_FULL_SIZE, - da_default_timeout*1000); - break; - } - start_ccb->ccb_h.ccb_state = DA_CCB_BUFFER_IO; + /* Run regular command. */ + bp = bioq_takefirst(&softc->bio_queue); + if (bp == NULL) { + xpt_release_ccb(start_ccb); + break; + } + + if ((bp->bio_flags & BIO_ORDERED) != 0 || + (softc->flags & DA_FLAG_NEED_OTAG) != 0) { + softc->flags &= ~DA_FLAG_NEED_OTAG; + softc->ordered_tag_count++; + tag_code = MSG_ORDERED_Q_TAG; + } else { + tag_code = MSG_SIMPLE_Q_TAG; + } + switch (bp->bio_cmd) { + case BIO_READ: + case BIO_WRITE: + scsi_read_write(&start_ccb->csio, + /*retries*/da_retry_count, + /*cbfcnp*/dadone, + /*tag_action*/tag_code, + /*read_op*/bp->bio_cmd + == BIO_READ, + /*byte2*/0, + softc->minimum_cmd_size, + /*lba*/bp->bio_pblkno, + /*block_count*/bp->bio_bcount / + softc->params.secsize, + /*data_ptr*/ bp->bio_data, + /*dxfer_len*/ bp->bio_bcount, + /*sense_len*/SSD_FULL_SIZE, + da_default_timeout * 1000); + break; + case BIO_FLUSH: /* - * Block out any asyncronous callbacks - * while we touch the pending ccb list. + * BIO_FLUSH doesn't currently communicate + * range data, so we synchronize the cache + * over the whole disk. We also force + * ordered tag semantics the flush applies + * to all previously queued I/O. */ - LIST_INSERT_HEAD(&softc->pending_ccbs, - &start_ccb->ccb_h, periph_links.le); - softc->outstanding_cmds++; - - /* We expect a unit attention from this device */ - if ((softc->flags & DA_FLAG_RETRY_UA) != 0) { - start_ccb->ccb_h.ccb_state |= DA_CCB_RETRY_UA; - softc->flags &= ~DA_FLAG_RETRY_UA; - } - - start_ccb->ccb_h.ccb_bp = bp; - bp = bioq_first(&softc->bio_queue); - - xpt_action(start_ccb); + scsi_synchronize_cache(&start_ccb->csio, + /*retries*/1, + /*cbfcnp*/dadone, + MSG_ORDERED_Q_TAG, + /*begin_lba*/0, + /*lb_count*/0, + SSD_FULL_SIZE, + da_default_timeout*1000); + break; } - - if (bp != NULL) { - /* Have more work to do, so ensure we stay scheduled */ - xpt_schedule(periph, CAM_PRIORITY_NORMAL); + start_ccb->ccb_h.ccb_state = DA_CCB_BUFFER_IO; + +out: + /* + * Block out any asyncronous callbacks + * while we touch the pending ccb list. + */ + LIST_INSERT_HEAD(&softc->pending_ccbs, + &start_ccb->ccb_h, periph_links.le); + softc->outstanding_cmds++; + + /* We expect a unit attention from this device */ + if ((softc->flags & DA_FLAG_RETRY_UA) != 0) { + start_ccb->ccb_h.ccb_state |= DA_CCB_RETRY_UA; + softc->flags &= ~DA_FLAG_RETRY_UA; } + + start_ccb->ccb_h.ccb_bp = bp; + xpt_action(start_ccb); + + /* May have more work to do, so ensure we stay scheduled */ + daschedule(periph); break; } case DA_STATE_PROBE: @@ -1798,9 +1985,42 @@ cmd6workaround(union ccb *ccb) struct scsi_rw_10 *cmd10; struct da_softc *softc; u_int8_t *cdb; + struct bio *bp; int frozen; cdb = ccb->csio.cdb_io.cdb_bytes; + softc = (struct da_softc *)xpt_path_periph(ccb->ccb_h.path)->softc; + + if (ccb->ccb_h.ccb_state == DA_CCB_DELETE) { + if (softc->delete_method == DA_DELETE_UNMAP) { + xpt_print(ccb->ccb_h.path, "UNMAP is not supported, " + "switching to WRITE SAME(16) with UNMAP.\n"); + softc->delete_method = DA_DELETE_WS16; + } else if (softc->delete_method == DA_DELETE_WS16) { + xpt_print(ccb->ccb_h.path, + "WRITE SAME(16) with UNMAP is not supported, " + "disabling BIO_DELETE.\n"); + softc->delete_method = DA_DELETE_DISABLE; + } else if (softc->delete_method == DA_DELETE_WS10) { + xpt_print(ccb->ccb_h.path, + "WRITE SAME(10) with UNMAP is not supported, " + "disabling BIO_DELETE.\n"); + softc->delete_method = DA_DELETE_DISABLE; + } else if (softc->delete_method == DA_DELETE_ZERO) { + xpt_print(ccb->ccb_h.path, + "WRITE SAME(10) is not supported, " + "disabling BIO_DELETE.\n"); + softc->delete_method = DA_DELETE_DISABLE; + } else + softc->delete_method = DA_DELETE_DISABLE; + while ((bp = bioq_takefirst(&softc->delete_run_queue)) + != NULL) + bioq_disksort(&softc->delete_queue, bp); + bioq_insert_tail(&softc->delete_queue, + (struct bio *)ccb->ccb_h.ccb_bp); + ccb->ccb_h.ccb_bp = NULL; + return (0); + } /* Translation only possible if CDB is an array and cmd is R/W6 */ if ((ccb->ccb_h.flags & CAM_CDB_POINTER) != 0 || @@ -1809,8 +2029,7 @@ cmd6workaround(union ccb *ccb) xpt_print(ccb->ccb_h.path, "READ(6)/WRITE(6) not supported, " "increasing minimum_cmd_size to 10.\n"); - softc = (struct da_softc *)xpt_path_periph(ccb->ccb_h.path)->softc; - softc->minimum_cmd_size = 10; + softc->minimum_cmd_size = 10; bcopy(cdb, &cmd6, sizeof(struct scsi_rw_6)); cmd10 = (struct scsi_rw_10 *)cdb; @@ -1848,8 +2067,9 @@ dadone(struct cam_periph *periph, union csio = &done_ccb->csio; switch (csio->ccb_h.ccb_state & DA_CCB_TYPE_MASK) { case DA_CCB_BUFFER_IO: + case DA_CCB_DELETE: { - struct bio *bp; + struct bio *bp, *bp1; bp = (struct bio *)done_ccb->ccb_h.ccb_bp; if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { @@ -1869,6 +2089,7 @@ dadone(struct cam_periph *periph, union */ return; } + bp = (struct bio *)done_ccb->ccb_h.ccb_bp; if (error != 0) { int queued_error; @@ -1896,10 +2117,12 @@ dadone(struct cam_periph *periph, union } bioq_flush(&softc->bio_queue, NULL, queued_error); - bp->bio_error = error; - bp->bio_resid = bp->bio_bcount; - bp->bio_flags |= BIO_ERROR; - } else { + if (bp != NULL) { + bp->bio_error = error; + bp->bio_resid = bp->bio_bcount; + bp->bio_flags |= BIO_ERROR; + } + } else if (bp != NULL) { bp->bio_resid = csio->resid; bp->bio_error = 0; if (bp->bio_resid != 0) @@ -1911,7 +2134,7 @@ dadone(struct cam_periph *periph, union /*reduction*/0, /*timeout*/0, /*getcount_only*/0); - } else { + } else if (bp != NULL) { if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) panic("REQ_CMP with QFRZN"); bp->bio_resid = csio->resid; @@ -1940,7 +2163,22 @@ dadone(struct cam_periph *periph, union softc->outstanding_cmds); } - biodone(bp); + if ((csio->ccb_h.ccb_state & DA_CCB_TYPE_MASK) == + DA_CCB_DELETE) { + while ((bp1 = bioq_takefirst(&softc->delete_run_queue)) + != NULL) { + bp1->bio_resid = bp->bio_resid; + bp1->bio_error = bp->bio_error; + if (bp->bio_flags & BIO_ERROR) + bp1->bio_flags |= BIO_ERROR; + biodone(bp1); + } + softc->delete_running = 0; + if (bp != NULL) + biodone(bp); + daschedule(periph); + } else if (bp != NULL) + biodone(bp); break; } case DA_CCB_PROBE: @@ -2010,10 +2248,9 @@ dadone(struct cam_periph *periph, union } else { dasetgeom(periph, block_size, maxsector, lbppbe, lalba & SRC16_LALBA); - if (lalba & SRC16_LBPME) - softc->flags |= DA_FLAG_CAN_LBPME; - else - softc->flags &= ~DA_FLAG_CAN_LBPME; + if ((lalba & SRC16_LBPME) && + softc->delete_method == DA_DELETE_NONE) + softc->delete_method = DA_DELETE_UNMAP; dp = &softc->params; snprintf(announce_buf, sizeof(announce_buf), "%juMB (%ju %u byte sectors: %dH %dS/T " @@ -2400,10 +2637,9 @@ done: } else { dasetgeom(periph, block_len, maxsector, lbppbe, lalba & SRC16_LALBA); - if (lalba & SRC16_LBPME) - softc->flags |= DA_FLAG_CAN_LBPME; - else - softc->flags &= ~DA_FLAG_CAN_LBPME; + if ((lalba & SRC16_LBPME) && + softc->delete_method == DA_DELETE_NONE) + softc->delete_method = DA_DELETE_UNMAP; } } From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 12:36:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 743FE106564A; Wed, 6 Jun 2012 12:36:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 544D18FC15; Wed, 6 Jun 2012 12:36:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q56CafV9014480; Wed, 6 Jun 2012 12:36:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q56CafnO014478; Wed, 6 Jun 2012 12:36:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206061236.q56CafnO014478@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Jun 2012 12:36:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236678 - stable/8/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 12:36:41 -0000 Author: mav Date: Wed Jun 6 12:36:40 2012 New Revision: 236678 URL: http://svn.freebsd.org/changeset/base/236678 Log: MFC r223084 (by gibbs): sys/cam/scsi/scsi_da.c: - Only attempt the closing synchronize cache on a disk if it is still there. - When a device is lost, report the number of outstanding I/Os as they are drained. - When a device is lost, return any unprocessed bios with ENXIO instead of EIO. - Filter asynchronous events, but always allow cam_periph_async() to see them too. Modified: stable/8/sys/cam/scsi/scsi_da.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Wed Jun 6 12:16:54 2012 (r236677) +++ stable/8/sys/cam/scsi/scsi_da.c Wed Jun 6 12:36:40 2012 (r236678) @@ -972,7 +972,8 @@ daclose(struct disk *dp) softc = (struct da_softc *)periph->softc; - if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0) { + if ((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); @@ -1299,12 +1300,12 @@ daasync(void *callback_arg, u_int32_t co softc->flags |= DA_FLAG_RETRY_UA; LIST_FOREACH(ccbh, &softc->pending_ccbs, periph_links.le) ccbh->ccb_state |= DA_CCB_RETRY_UA; - /* FALLTHROUGH*/ + break; } default: - cam_periph_async(periph, code, path, arg); break; } + cam_periph_async(periph, code, path, arg); } static void @@ -1795,7 +1796,7 @@ dadone(struct cam_periph *periph, union if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { int error; int sf; - + if ((csio->ccb_h.ccb_state & DA_CCB_RETRY_UA) != 0) sf = SF_RETRY_UA; else @@ -1810,8 +1811,17 @@ dadone(struct cam_periph *periph, union return; } if (error != 0) { + int queued_error; + + /* + * return all queued I/O with EIO, so that + * the client can retry these I/Os in the + * proper order should it attempt to recover. + */ + queued_error = EIO; - if (error == ENXIO) { + if (error == ENXIO + && (softc->flags & DA_FLAG_PACK_INVALID)== 0) { /* * Catastrophic error. Mark our pack as * invalid. @@ -1823,14 +1833,10 @@ dadone(struct cam_periph *periph, union xpt_print(periph->path, "Invalidating pack\n"); softc->flags |= DA_FLAG_PACK_INVALID; + queued_error = ENXIO; } - - /* - * return all queued I/O with EIO, so that - * the client can retry these I/Os in the - * proper order should it attempt to recover. - */ - bioq_flush(&softc->bio_queue, NULL, EIO); + bioq_flush(&softc->bio_queue, NULL, + queued_error); bp->bio_error = error; bp->bio_resid = bp->bio_bcount; bp->bio_flags |= BIO_ERROR; @@ -1870,6 +1876,11 @@ dadone(struct cam_periph *periph, union if (softc->outstanding_cmds == 0) softc->flags |= DA_FLAG_WENT_IDLE; + if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) { + xpt_print(periph->path, "oustanding %d\n", + softc->outstanding_cmds); + } + biodone(bp); break; } From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 13:35:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 550F01065679; Wed, 6 Jun 2012 13:35:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40AA58FC18; Wed, 6 Jun 2012 13:35:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q56DZVmc017269; Wed, 6 Jun 2012 13:35:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q56DZVj9017267; Wed, 6 Jun 2012 13:35:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206061335.q56DZVj9017267@svn.freebsd.org> From: John Baldwin Date: Wed, 6 Jun 2012 13:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236680 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 13:35:31 -0000 Author: jhb Date: Wed Jun 6 13:35:30 2012 New Revision: 236680 URL: http://svn.freebsd.org/changeset/base/236680 Log: Use the defined terms "readers" and "writers" to simplify some text. Modified: head/share/man/man9/rwlock.9 Modified: head/share/man/man9/rwlock.9 ============================================================================== --- head/share/man/man9/rwlock.9 Wed Jun 6 12:45:48 2012 (r236679) +++ head/share/man/man9/rwlock.9 Wed Jun 6 13:35:30 2012 (r236680) @@ -114,12 +114,10 @@ cannot be held while sleeping. The .Nm locks have priority propagation like mutexes, but priority -can be propagated only to an exclusive holder. -This limitation comes from the fact that shared owners +can be propagated only to writers. +This limitation comes from the fact that readers are anonymous. -Another important property is that shared holders of -.Nm -can recurse, +Another important property is that readers can always recurse, and exclusive locks can be made recursive selectively. .Ss Macros and Functions .Bl -tag -width indent From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 14:31:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 566A91065678; Wed, 6 Jun 2012 14:31:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 410178FC21; Wed, 6 Jun 2012 14:31:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q56EVFoi019891; Wed, 6 Jun 2012 14:31:15 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q56EVF3Z019889; Wed, 6 Jun 2012 14:31:15 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201206061431.q56EVF3Z019889@svn.freebsd.org> From: Warner Losh Date: Wed, 6 Jun 2012 14:31:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236681 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 14:31:15 -0000 Author: imp Date: Wed Jun 6 14:31:14 2012 New Revision: 236681 URL: http://svn.freebsd.org/changeset/base/236681 Log: Remove stray break; that resulted from a last-minute, untested change. Modified: head/sys/arm/at91/at91sam9260.c Modified: head/sys/arm/at91/at91sam9260.c ============================================================================== --- head/sys/arm/at91/at91sam9260.c Wed Jun 6 13:35:30 2012 (r236680) +++ head/sys/arm/at91/at91sam9260.c Wed Jun 6 14:31:14 2012 (r236681) @@ -200,7 +200,6 @@ at91_identify(driver_t *drv, device_t pa if (soc_data.type == AT91_CPU_SAM9260) { at91_add_child(parent, 0, "at91sam9260", 0, 0, 0, -1, 0, 0); at91_cpu_add_builtin_children(parent); - break; } } From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 16:00:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C57BE1065673; Wed, 6 Jun 2012 16:00:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF3098FC12; Wed, 6 Jun 2012 16:00:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q56G0VbG023864; Wed, 6 Jun 2012 16:00:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q56G0Vc0023859; Wed, 6 Jun 2012 16:00:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206061600.q56G0Vc0023859@svn.freebsd.org> From: John Baldwin Date: Wed, 6 Jun 2012 16:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236683 - in stable/9: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 16:00:32 -0000 Author: jhb Date: Wed Jun 6 16:00:31 2012 New Revision: 236683 URL: http://svn.freebsd.org/changeset/base/236683 Log: MFC 228509,228620,228533: Add a helper API to allow in-kernel code to map portions of shared memory objects created by shm_open(2) into the kernel's address space. This provides a convenient way for creating shared memory buffers between userland and the kernel without requiring custom character devices. Added: stable/9/share/man/man9/shm_map.9 - copied, changed from r228509, head/share/man/man9/shm_map.9 Modified: stable/9/share/man/man9/Makefile stable/9/sys/kern/uipc_shm.c stable/9/sys/sys/mman.h Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Wed Jun 6 15:29:27 2012 (r236682) +++ stable/9/share/man/man9/Makefile Wed Jun 6 16:00:31 2012 (r236683) @@ -237,6 +237,7 @@ MAN= accept_filter.9 \ sema.9 \ sf_buf.9 \ sglist.9 \ + shm_map.9 \ signal.9 \ sleep.9 \ sleepqueue.9 \ @@ -1156,6 +1157,7 @@ MLINKS+=sglist.9 sglist_alloc.9 \ sglist.9 sglist_reset.9 \ sglist.9 sglist_slice.9 \ sglist.9 sglist_split.9 +MLINKS+=shm_map.9 shm_unmap.9 MLINKS+=signal.9 cursig.9 \ signal.9 execsigs.9 \ signal.9 issignal.9 \ Copied and modified: stable/9/share/man/man9/shm_map.9 (from r228509, head/share/man/man9/shm_map.9) ============================================================================== --- head/share/man/man9/shm_map.9 Wed Dec 14 22:22:19 2011 (r228509, copy source) +++ stable/9/share/man/man9/shm_map.9 Wed Jun 6 16:00:31 2012 (r236683) @@ -30,9 +30,8 @@ .Dt SHM_MAP 9 .Os .Sh NAME -.Nm shm_map , -.Nm shm_unmap -.Nd map shared memory objects into the kernel's address space +.Nm shm_map , shm_unmap +.Nd "map shared memory objects into the kernel's address space" .Sh SYNOPSIS .In sys/types.h .In sys/mman.h @@ -42,9 +41,9 @@ .Fn shm_unmap "struct file *fp" "void *mem" "size_t size" .Sh DESCRIPTION The -.Nm shm_map +.Fn shm_map and -.Nm shm_unmap +.Fn shm_unmap functions provide an API for mapping shared memory objects into the kernel. Shared memory objects are created by .Xr shm_open 2 . @@ -57,13 +56,13 @@ Shared memory objects can still be grown .Pp To simplify the accounting needed to enforce the above requirement, callers of this API are required to unmap the entire region mapped by -.Nm shm_map +.Fn shm_map when calling -.Nm shm_unmap . +.Fn shm_unmap . Unmapping only a portion of the region is not permitted. .Pp The -.Nm shm_map +.Fn shm_map function locates the shared memory object associated with the open file .Fa fp . It maps the region of that object described by @@ -77,9 +76,9 @@ will be set to the start of the mapping. All pages for the range will be wired into memory upon successful return. .Pp The -.Nm shm_unmap +.Fn shm_unmap function unmaps a region previously mapped by -.Nm shm_map . +.Fn shm_map . The .Fa mem argument should match the value previously returned in @@ -87,22 +86,22 @@ argument should match the value previous and the .Fa size argument should match the value passed to -.Nm shm_map . +.Fn shm_map . .Pp Note that -.Nm shm_map +.Fn shm_map will not hold an extra reference on the open file .Fa fp for the lifetime of the mapping. Instead, the calling code is required to do this if it wishes to use -.Nm shm_unmap +.Fn shm_unmap on the region in the future. .Sh RETURN VALUES The -.Nm shm_map +.Fn shm_map and -.Nm shm_unmap +.Fn shm_unmap functions return zero on success or an error on failure. .Sh EXAMPLES The following function accepts a file descriptor for a shared memory @@ -110,7 +109,7 @@ object. It maps the first sixteen kilobytes of the object into the kernel, performs some work on that address, and then unmaps the address before returning. -.Bd -literal +.Bd -literal -offset indent int shm_example(int fd) { @@ -118,7 +117,7 @@ shm_example(int fd) void *mem; int error; - error = fget(curthread, fd, CAP_MMAP, &fp) + error = fget(curthread, fd, CAP_MMAP, &fp); if (error) return (error); error = shm_map(fp, 16384, 0, &mem); @@ -136,7 +135,7 @@ shm_example(int fd) .Ed .Sh ERRORS The -.Nm shm_map +.Fn shm_map function returns the following errors on failure: .Bl -tag -width Er .It Bq Er EINVAL @@ -158,7 +157,7 @@ The shared memory object could not be ma .El .Pp The -.Nm shm_unmap +.Fn shm_unmap function returns the following errors on failure: .Bl -tag -width Er .It Bq Er EINVAL Modified: stable/9/sys/kern/uipc_shm.c ============================================================================== --- stable/9/sys/kern/uipc_shm.c Wed Jun 6 15:29:27 2012 (r236682) +++ stable/9/sys/kern/uipc_shm.c Wed Jun 6 16:00:31 2012 (r236683) @@ -74,7 +74,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include @@ -260,6 +262,14 @@ shm_dotruncate(struct shmfd *shmfd, off_ /* Are we shrinking? If so, trim the end. */ if (length < shmfd->shm_size) { + /* + * Disallow any requests to shrink the size if this + * object is mapped into the kernel. + */ + if (shmfd->shm_kmappings > 0) { + VM_OBJECT_UNLOCK(object); + return (EBUSY); + } /* * Zero the truncated part of the last page. @@ -732,3 +742,105 @@ out: mtx_unlock(&shm_timestamp_lock); return (error); } + +/* + * Helper routines to allow the backing object of a shared memory file + * descriptor to be mapped in the kernel. + */ +int +shm_map(struct file *fp, size_t size, off_t offset, void **memp) +{ + struct shmfd *shmfd; + vm_offset_t kva, ofs; + vm_object_t obj; + int rv; + + if (fp->f_type != DTYPE_SHM) + return (EINVAL); + shmfd = fp->f_data; + obj = shmfd->shm_object; + VM_OBJECT_LOCK(obj); + /* + * XXXRW: This validation is probably insufficient, and subject to + * sign errors. It should be fixed. + */ + if (offset >= shmfd->shm_size || + offset + size > round_page(shmfd->shm_size)) { + VM_OBJECT_UNLOCK(obj); + return (EINVAL); + } + + shmfd->shm_kmappings++; + vm_object_reference_locked(obj); + VM_OBJECT_UNLOCK(obj); + + /* Map the object into the kernel_map and wire it. */ + kva = vm_map_min(kernel_map); + ofs = offset & PAGE_MASK; + 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, + VM_PROT_READ | VM_PROT_WRITE, 0); + if (rv == KERN_SUCCESS) { + rv = vm_map_wire(kernel_map, kva, kva + size, + VM_MAP_WIRE_SYSTEM | VM_MAP_WIRE_NOHOLES); + if (rv == KERN_SUCCESS) { + *memp = (void *)(kva + ofs); + return (0); + } + vm_map_remove(kernel_map, kva, kva + size); + } else + vm_object_deallocate(obj); + + /* On failure, drop our mapping reference. */ + VM_OBJECT_LOCK(obj); + shmfd->shm_kmappings--; + VM_OBJECT_UNLOCK(obj); + + return (vm_mmap_to_errno(rv)); +} + +/* + * We require the caller to unmap the entire entry. This allows us to + * safely decrement shm_kmappings when a mapping is removed. + */ +int +shm_unmap(struct file *fp, void *mem, size_t size) +{ + struct shmfd *shmfd; + vm_map_entry_t entry; + vm_offset_t kva, ofs; + vm_object_t obj; + vm_pindex_t pindex; + vm_prot_t prot; + boolean_t wired; + vm_map_t map; + int rv; + + if (fp->f_type != DTYPE_SHM) + return (EINVAL); + shmfd = fp->f_data; + kva = (vm_offset_t)mem; + ofs = kva & PAGE_MASK; + kva = trunc_page(kva); + size = round_page(size + ofs); + map = kernel_map; + rv = vm_map_lookup(&map, kva, VM_PROT_READ | VM_PROT_WRITE, &entry, + &obj, &pindex, &prot, &wired); + if (rv != KERN_SUCCESS) + return (EINVAL); + if (entry->start != kva || entry->end != kva + size) { + vm_map_lookup_done(map, entry); + return (EINVAL); + } + vm_map_lookup_done(map, entry); + if (obj != shmfd->shm_object) + return (EINVAL); + vm_map_remove(map, kva, kva + size); + VM_OBJECT_LOCK(obj); + KASSERT(shmfd->shm_kmappings > 0, ("shm_unmap: object not mapped")); + shmfd->shm_kmappings--; + VM_OBJECT_UNLOCK(obj); + return (0); +} Modified: stable/9/sys/sys/mman.h ============================================================================== --- stable/9/sys/sys/mman.h Wed Jun 6 15:29:27 2012 (r236682) +++ stable/9/sys/sys/mman.h Wed Jun 6 16:00:31 2012 (r236683) @@ -181,6 +181,8 @@ typedef __size_t size_t; #ifdef _KERNEL #include +struct file; + struct shmfd { size_t shm_size; vm_object_t shm_object; @@ -188,6 +190,7 @@ struct shmfd { uid_t shm_uid; gid_t shm_gid; mode_t shm_mode; + int shm_kmappings; /* * Values maintained solely to make this a better-behaved file @@ -203,6 +206,8 @@ struct shmfd { int shm_mmap(struct shmfd *shmfd, vm_size_t objsize, vm_ooffset_t foff, vm_object_t *obj); +int shm_map(struct file *fp, size_t size, off_t offset, void **memp); +int shm_unmap(struct file *fp, void *mem, size_t size); #else /* !_KERNEL */ From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 16:01:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D557106566C; Wed, 6 Jun 2012 16:01:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1BAF8FC18; Wed, 6 Jun 2012 16:01:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q56G1j9F023956; Wed, 6 Jun 2012 16:01:45 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q56G1jeN023951; Wed, 6 Jun 2012 16:01:45 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206061601.q56G1jeN023951@svn.freebsd.org> From: John Baldwin Date: Wed, 6 Jun 2012 16:01:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236684 - in stable/8: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 16:01:46 -0000 Author: jhb Date: Wed Jun 6 16:01:45 2012 New Revision: 236684 URL: http://svn.freebsd.org/changeset/base/236684 Log: MFC 228509,228620,228533: Add a helper API to allow in-kernel code to map portions of shared memory objects created by shm_open(2) into the kernel's address space. This provides a convenient way for creating shared memory buffers between userland and the kernel without requiring custom character devices. Added: stable/8/share/man/man9/shm_map.9 - copied, changed from r228509, head/share/man/man9/shm_map.9 Modified: stable/8/share/man/man9/Makefile stable/8/sys/kern/uipc_shm.c stable/8/sys/sys/mman.h Directory Properties: stable/8/share/man/man9/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Wed Jun 6 16:00:31 2012 (r236683) +++ stable/8/share/man/man9/Makefile Wed Jun 6 16:01:45 2012 (r236684) @@ -237,6 +237,7 @@ MAN= accept_filter.9 \ sema.9 \ sf_buf.9 \ sglist.9 \ + shm_map.9 \ signal.9 \ sleep.9 \ sleepqueue.9 \ @@ -1117,6 +1118,7 @@ MLINKS+=sglist.9 sglist_alloc.9 \ sglist.9 sglist_reset.9 \ sglist.9 sglist_slice.9 \ sglist.9 sglist_split.9 +MLINKS+=shm_map.9 shm_unmap.9 MLINKS+=signal.9 cursig.9 \ signal.9 execsigs.9 \ signal.9 issignal.9 \ Copied and modified: stable/8/share/man/man9/shm_map.9 (from r228509, head/share/man/man9/shm_map.9) ============================================================================== --- head/share/man/man9/shm_map.9 Wed Dec 14 22:22:19 2011 (r228509, copy source) +++ stable/8/share/man/man9/shm_map.9 Wed Jun 6 16:01:45 2012 (r236684) @@ -30,9 +30,8 @@ .Dt SHM_MAP 9 .Os .Sh NAME -.Nm shm_map , -.Nm shm_unmap -.Nd map shared memory objects into the kernel's address space +.Nm shm_map , shm_unmap +.Nd "map shared memory objects into the kernel's address space" .Sh SYNOPSIS .In sys/types.h .In sys/mman.h @@ -42,9 +41,9 @@ .Fn shm_unmap "struct file *fp" "void *mem" "size_t size" .Sh DESCRIPTION The -.Nm shm_map +.Fn shm_map and -.Nm shm_unmap +.Fn shm_unmap functions provide an API for mapping shared memory objects into the kernel. Shared memory objects are created by .Xr shm_open 2 . @@ -57,13 +56,13 @@ Shared memory objects can still be grown .Pp To simplify the accounting needed to enforce the above requirement, callers of this API are required to unmap the entire region mapped by -.Nm shm_map +.Fn shm_map when calling -.Nm shm_unmap . +.Fn shm_unmap . Unmapping only a portion of the region is not permitted. .Pp The -.Nm shm_map +.Fn shm_map function locates the shared memory object associated with the open file .Fa fp . It maps the region of that object described by @@ -77,9 +76,9 @@ will be set to the start of the mapping. All pages for the range will be wired into memory upon successful return. .Pp The -.Nm shm_unmap +.Fn shm_unmap function unmaps a region previously mapped by -.Nm shm_map . +.Fn shm_map . The .Fa mem argument should match the value previously returned in @@ -87,22 +86,22 @@ argument should match the value previous and the .Fa size argument should match the value passed to -.Nm shm_map . +.Fn shm_map . .Pp Note that -.Nm shm_map +.Fn shm_map will not hold an extra reference on the open file .Fa fp for the lifetime of the mapping. Instead, the calling code is required to do this if it wishes to use -.Nm shm_unmap +.Fn shm_unmap on the region in the future. .Sh RETURN VALUES The -.Nm shm_map +.Fn shm_map and -.Nm shm_unmap +.Fn shm_unmap functions return zero on success or an error on failure. .Sh EXAMPLES The following function accepts a file descriptor for a shared memory @@ -110,7 +109,7 @@ object. It maps the first sixteen kilobytes of the object into the kernel, performs some work on that address, and then unmaps the address before returning. -.Bd -literal +.Bd -literal -offset indent int shm_example(int fd) { @@ -118,7 +117,7 @@ shm_example(int fd) void *mem; int error; - error = fget(curthread, fd, CAP_MMAP, &fp) + error = fget(curthread, fd, CAP_MMAP, &fp); if (error) return (error); error = shm_map(fp, 16384, 0, &mem); @@ -136,7 +135,7 @@ shm_example(int fd) .Ed .Sh ERRORS The -.Nm shm_map +.Fn shm_map function returns the following errors on failure: .Bl -tag -width Er .It Bq Er EINVAL @@ -158,7 +157,7 @@ The shared memory object could not be ma .El .Pp The -.Nm shm_unmap +.Fn shm_unmap function returns the following errors on failure: .Bl -tag -width Er .It Bq Er EINVAL Modified: stable/8/sys/kern/uipc_shm.c ============================================================================== --- stable/8/sys/kern/uipc_shm.c Wed Jun 6 16:00:31 2012 (r236683) +++ stable/8/sys/kern/uipc_shm.c Wed Jun 6 16:01:45 2012 (r236684) @@ -81,7 +81,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include @@ -259,6 +261,14 @@ shm_dotruncate(struct shmfd *shmfd, off_ /* Are we shrinking? If so, trim the end. */ if (length < shmfd->shm_size) { + /* + * Disallow any requests to shrink the size if this + * object is mapped into the kernel. + */ + if (shmfd->shm_kmappings > 0) { + VM_OBJECT_UNLOCK(object); + return (EBUSY); + } delta = ptoa(object->size - nobjsize); /* Toss in memory pages. */ @@ -642,3 +652,105 @@ shm_mmap(struct shmfd *shmfd, vm_size_t *obj = shmfd->shm_object; return (0); } + +/* + * Helper routines to allow the backing object of a shared memory file + * descriptor to be mapped in the kernel. + */ +int +shm_map(struct file *fp, size_t size, off_t offset, void **memp) +{ + struct shmfd *shmfd; + vm_offset_t kva, ofs; + vm_object_t obj; + int rv; + + if (fp->f_type != DTYPE_SHM) + return (EINVAL); + shmfd = fp->f_data; + obj = shmfd->shm_object; + VM_OBJECT_LOCK(obj); + /* + * XXXRW: This validation is probably insufficient, and subject to + * sign errors. It should be fixed. + */ + if (offset >= shmfd->shm_size || + offset + size > round_page(shmfd->shm_size)) { + VM_OBJECT_UNLOCK(obj); + return (EINVAL); + } + + shmfd->shm_kmappings++; + vm_object_reference_locked(obj); + VM_OBJECT_UNLOCK(obj); + + /* Map the object into the kernel_map and wire it. */ + kva = vm_map_min(kernel_map); + ofs = offset & PAGE_MASK; + 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, + VM_PROT_READ | VM_PROT_WRITE, 0); + if (rv == KERN_SUCCESS) { + rv = vm_map_wire(kernel_map, kva, kva + size, + VM_MAP_WIRE_SYSTEM | VM_MAP_WIRE_NOHOLES); + if (rv == KERN_SUCCESS) { + *memp = (void *)(kva + ofs); + return (0); + } + vm_map_remove(kernel_map, kva, kva + size); + } else + vm_object_deallocate(obj); + + /* On failure, drop our mapping reference. */ + VM_OBJECT_LOCK(obj); + shmfd->shm_kmappings--; + VM_OBJECT_UNLOCK(obj); + + return (vm_mmap_to_errno(rv)); +} + +/* + * We require the caller to unmap the entire entry. This allows us to + * safely decrement shm_kmappings when a mapping is removed. + */ +int +shm_unmap(struct file *fp, void *mem, size_t size) +{ + struct shmfd *shmfd; + vm_map_entry_t entry; + vm_offset_t kva, ofs; + vm_object_t obj; + vm_pindex_t pindex; + vm_prot_t prot; + boolean_t wired; + vm_map_t map; + int rv; + + if (fp->f_type != DTYPE_SHM) + return (EINVAL); + shmfd = fp->f_data; + kva = (vm_offset_t)mem; + ofs = kva & PAGE_MASK; + kva = trunc_page(kva); + size = round_page(size + ofs); + map = kernel_map; + rv = vm_map_lookup(&map, kva, VM_PROT_READ | VM_PROT_WRITE, &entry, + &obj, &pindex, &prot, &wired); + if (rv != KERN_SUCCESS) + return (EINVAL); + if (entry->start != kva || entry->end != kva + size) { + vm_map_lookup_done(map, entry); + return (EINVAL); + } + vm_map_lookup_done(map, entry); + if (obj != shmfd->shm_object) + return (EINVAL); + vm_map_remove(map, kva, kva + size); + VM_OBJECT_LOCK(obj); + KASSERT(shmfd->shm_kmappings > 0, ("shm_unmap: object not mapped")); + shmfd->shm_kmappings--; + VM_OBJECT_UNLOCK(obj); + return (0); +} Modified: stable/8/sys/sys/mman.h ============================================================================== --- stable/8/sys/sys/mman.h Wed Jun 6 16:00:31 2012 (r236683) +++ stable/8/sys/sys/mman.h Wed Jun 6 16:01:45 2012 (r236684) @@ -181,6 +181,8 @@ typedef __size_t size_t; #ifdef _KERNEL #include +struct file; + struct shmfd { size_t shm_size; vm_object_t shm_object; @@ -188,6 +190,7 @@ struct shmfd { uid_t shm_uid; gid_t shm_gid; mode_t shm_mode; + int shm_kmappings; /* * Values maintained solely to make this a better-behaved file @@ -203,6 +206,8 @@ struct shmfd { int shm_mmap(struct shmfd *shmfd, vm_size_t objsize, vm_ooffset_t foff, vm_object_t *obj); +int shm_map(struct file *fp, size_t size, off_t offset, void **memp); +int shm_unmap(struct file *fp, void *mem, size_t size); #else /* !_KERNEL */ From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 16:20:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B71D7106567C; Wed, 6 Jun 2012 16:20:59 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A18208FC0C; Wed, 6 Jun 2012 16:20:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q56GKxGf024867; Wed, 6 Jun 2012 16:20:59 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q56GKxr7024865; Wed, 6 Jun 2012 16:20:59 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201206061620.q56GKxr7024865@svn.freebsd.org> From: Maksim Yevmenkin Date: Wed, 6 Jun 2012 16:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236685 - stable/8/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 16:20:59 -0000 Author: emax Date: Wed Jun 6 16:20:59 2012 New Revision: 236685 URL: http://svn.freebsd.org/changeset/base/236685 Log: MFC r235854 Seems applicable here as well. Tweak condition for disabling allocation from per-CPU buckets in low memory situation. I've observed a situation where per-CPU allocations were disabled while there were enough free cached pages. Basically, cnt.v_free_count was sitting stable at a value lower than cnt.v_free_min and that caused massive performance drop. Reviewed by: alc Requested by: Andrew Boyer aboyer at averesystems dot com Modified: stable/8/sys/vm/uma_core.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/vm/uma_core.c ============================================================================== --- stable/8/sys/vm/uma_core.c Wed Jun 6 16:01:45 2012 (r236684) +++ stable/8/sys/vm/uma_core.c Wed Jun 6 16:20:59 2012 (r236685) @@ -267,10 +267,7 @@ SYSCTL_PROC(_vm, OID_AUTO, zone_stats, C static void bucket_enable(void) { - if (cnt.v_free_count < cnt.v_free_min) - bucketdisable = 1; - else - bucketdisable = 0; + bucketdisable = vm_page_count_min(); } /* From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 16:26:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E053106564A; Wed, 6 Jun 2012 16:26:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08D648FC0A; Wed, 6 Jun 2012 16:26:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q56GQtRm025156; Wed, 6 Jun 2012 16:26:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q56GQteq025154; Wed, 6 Jun 2012 16:26:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206061626.q56GQteq025154@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 6 Jun 2012 16:26:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236686 - head/tools/tools/syscall_timing X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 16:26:56 -0000 Author: kib Date: Wed Jun 6 16:26:55 2012 New Revision: 236686 URL: http://svn.freebsd.org/changeset/base/236686 Log: Add gettimeofday() test. MFC after: 3 days Modified: head/tools/tools/syscall_timing/syscall_timing.c Modified: head/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- head/tools/tools/syscall_timing/syscall_timing.c Wed Jun 6 16:20:59 2012 (r236685) +++ head/tools/tools/syscall_timing/syscall_timing.c Wed Jun 6 16:26:55 2012 (r236686) @@ -142,6 +142,22 @@ test_clock_gettime(uintmax_t num, uintma } uintmax_t +test_gettimeofday(uintmax_t num, uintmax_t int_arg, const char *path) +{ + struct timeval tv; + uintmax_t i; + + benchmark_start(); + for (i = 0; i < num; i++) { + if (alarm_fired) + break; + (void)gettimeofday(&tv, NULL); + } + benchmark_stop(); + return (i); +} + +uintmax_t test_pipe(uintmax_t num, uintmax_t int_arg, const char *path) { int fd[2], i; @@ -608,6 +624,7 @@ static const struct test tests[] = { { "getuid", test_getuid }, { "getppid", test_getppid }, { "clock_gettime", test_clock_gettime }, + { "gettimeofday", test_gettimeofday }, { "pipe", test_pipe }, { "socket_local_stream", test_socket_stream, .t_int = PF_LOCAL }, { "socket_local_dgram", test_socket_dgram, .t_int = PF_LOCAL }, From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 16:30:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EFED106566C; Wed, 6 Jun 2012 16:30:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29CF78FC15; Wed, 6 Jun 2012 16:30:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q56GUHmG025326; Wed, 6 Jun 2012 16:30:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q56GUGH4025324; Wed, 6 Jun 2012 16:30:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206061630.q56GUGH4025324@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 6 Jun 2012 16:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236687 - head/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 16:30:17 -0000 Author: kib Date: Wed Jun 6 16:30:16 2012 New Revision: 236687 URL: http://svn.freebsd.org/changeset/base/236687 Log: Improve handling of uiomove(9) errors for the NFS client. Do not brelse() the buffer unconditionally with BIO_ERROR set if uiomove() failed. The brelse() treats most buffers with BIO_ERROR as B_INVAL, dropping their content. Instead, if the write request covered the whole buffer, remember the cached state and brelse() with BIO_ERROR set only if the buffer was not cached previously. Update the buffer dirtyoff/dirtyend based on the progress recorded by uiomove() in passed struct uio, even in the presence of error. Otherwise, usermode could see changed data in the backed pages, but later the buffer is destroyed without write-back. If uiomove() failed for IO_UNIT request, try to truncate the vnode back to the pre-write state, and rewind the progress in passed uio accordingly, following the FFS behaviour. Reviewed by: rmacklem (some time ago) Tested by: pho MFC after: 1 month Modified: head/sys/fs/nfsclient/nfs_clbio.c Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Wed Jun 6 16:26:55 2012 (r236686) +++ head/sys/fs/nfsclient/nfs_clbio.c Wed Jun 6 16:30:16 2012 (r236687) @@ -897,8 +897,9 @@ ncl_write(struct vop_write_args *ap) struct nfsmount *nmp = VFSTONFS(vp->v_mount); daddr_t lbn; int bcount; - int n, on, error = 0; - off_t tmp_off; + int bp_cached, n, on, error = 0; + size_t orig_resid, local_resid; + off_t orig_size, tmp_off; KASSERT(uio->uio_rw == UIO_WRITE, ("ncl_write mode")); KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, @@ -950,6 +951,11 @@ flush_and_restart: mtx_unlock(&np->n_mtx); } + orig_resid = uio->uio_resid; + mtx_lock(&np->n_mtx); + orig_size = np->n_size; + mtx_unlock(&np->n_mtx); + /* * If IO_APPEND then load uio_offset. We restart here if we cannot * get the append lock. @@ -1127,7 +1133,10 @@ again: * normally. */ + bp_cached = 1; if (on == 0 && n == bcount) { + if ((bp->b_flags & B_CACHE) == 0) + bp_cached = 0; bp->b_flags |= B_CACHE; bp->b_flags &= ~B_INVAL; bp->b_ioflags &= ~BIO_ERROR; @@ -1193,8 +1202,24 @@ again: goto again; } + local_resid = uio->uio_resid; error = uiomove((char *)bp->b_data + on, n, uio); + if (error != 0 && !bp_cached) { + /* + * This block has no other content then what + * possibly was written by the faulty uiomove. + * Release it, forgetting the data pages, to + * prevent the leak of uninitialized data to + * usermode. + */ + bp->b_ioflags |= BIO_ERROR; + brelse(bp); + uio->uio_offset -= local_resid - uio->uio_resid; + uio->uio_resid = local_resid; + break; + } + /* * Since this block is being modified, it must be written * again and not just committed. Since write clustering does @@ -1203,17 +1228,18 @@ again: */ bp->b_flags &= ~(B_NEEDCOMMIT | B_CLUSTEROK); - if (error) { - bp->b_ioflags |= BIO_ERROR; - brelse(bp); - break; - } + /* + * Get the partial update on the progress made from + * uiomove, if an error occured. + */ + if (error != 0) + n = local_resid - uio->uio_resid; /* * Only update dirtyoff/dirtyend if not a degenerate * condition. */ - if (n) { + if (n > 0) { if (bp->b_dirtyend > 0) { bp->b_dirtyoff = min(on, bp->b_dirtyoff); bp->b_dirtyend = max((on + n), bp->b_dirtyend); @@ -1242,8 +1268,22 @@ again: } else { bdwrite(bp); } + + if (error != 0) + break; } while (uio->uio_resid > 0 && n > 0); + if (error != 0) { + if (ioflag & IO_UNIT) { + VATTR_NULL(&vattr); + vattr.va_size = orig_size; + /* IO_SYNC is handled implicitely */ + (void)VOP_SETATTR(vp, &vattr, cred); + uio->uio_offset -= orig_resid - uio->uio_resid; + uio->uio_resid = orig_resid; + } + } + return (error); } From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 16:51:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E2C60106564A; Wed, 6 Jun 2012 16:51:33 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDDC28FC0C; Wed, 6 Jun 2012 16:51:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q56GpXHU026296; Wed, 6 Jun 2012 16:51:33 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q56GpXTk026294; Wed, 6 Jun 2012 16:51:33 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201206061651.q56GpXTk026294@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 6 Jun 2012 16:51:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236688 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 16:51:34 -0000 Author: obrien Date: Wed Jun 6 16:51:33 2012 New Revision: 236688 URL: http://svn.freebsd.org/changeset/base/236688 Log: Add to the description and spell check. Modified: head/share/man/man4/filemon.4 Modified: head/share/man/man4/filemon.4 ============================================================================== --- head/share/man/man4/filemon.4 Wed Jun 6 16:30:16 2012 (r236687) +++ head/share/man/man4/filemon.4 Wed Jun 6 16:51:33 2012 (r236688) @@ -10,7 +10,7 @@ .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: +.\" must display the following acknowledgment: .\" This product includes software developed by David E. O'Brien and .\" contributors. .\" 4. Neither the name of the author nor the names of its contributors @@ -19,7 +19,7 @@ .\" .\" 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 +.\" IMPLIED WARRANTIES OF MERCHANT ABILITY 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 @@ -87,12 +87,13 @@ following records can represent a single .Xr open 2 for R/W, -or two seperate +or two separate .Xr open 2 calls, one for .Ql R and one for .Ql W . +Note that only successful system calls are captured. .Sh IOCTLS User mode programs communicate with the .Nm @@ -168,7 +169,8 @@ buffer contents to it. .Sh SEE ALSO .Xr dtrace 1 , .Xr ktrace 1 , -.Xr truss 1 +.Xr truss 1 , +.Xr ioctl 2 .Sh HISTORY A .Nm From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 17:04:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0FC2E106566C; Wed, 6 Jun 2012 17:04:57 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF2198FC15; Wed, 6 Jun 2012 17:04:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q56H4uB7026932; Wed, 6 Jun 2012 17:04:56 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q56H4uGj026930; Wed, 6 Jun 2012 17:04:56 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201206061704.q56H4uGj026930@svn.freebsd.org> From: "Kenneth D. Merry" Date: Wed, 6 Jun 2012 17:04:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236689 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 17:04:57 -0000 Author: ken Date: Wed Jun 6 17:04:56 2012 New Revision: 236689 URL: http://svn.freebsd.org/changeset/base/236689 Log: Fix a memory leak in the kernel case in scsi_command_string(). Submitted by: Kashyap Desai MFC after: 3 days Modified: head/sys/cam/scsi/scsi_all.c Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Wed Jun 6 16:51:33 2012 (r236688) +++ head/sys/cam/scsi/scsi_all.c Wed Jun 6 17:04:56 2012 (r236689) @@ -3059,6 +3059,10 @@ scsi_command_string(struct cam_device *d sizeof(cdb_str))); } +#ifdef _KERNEL + xpt_free_ccb((union ccb *)cgd); +#endif + return(0); } From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 17:08:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A7CA1065673; Wed, 6 Jun 2012 17:08:24 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id EE88F8FC16; Wed, 6 Jun 2012 17:08:22 +0000 (UTC) Received: by bkvi18 with SMTP id i18so7550210bkv.13 for ; Wed, 06 Jun 2012 10:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=OjFOjI+9GXKzBU4JTuUKw85FaMQ4h2oHDQ498sG7IOw=; b=pe0D6s3qrZeGQ+IlJ3bNKnla4iLD91kM2cn+UHga4XDPFKjn6US787WXmFKEUS6SHW hpOc5+HZ8XoR7eZx2I7sV5RHsjUUaYW1f+fyimSdsNR3lc9fjHolddWszBERZdkATPPf njuD9ypWxQD2bDJGvGPUZagRpTzdCjDkYwRJ66S45a4RTJD4sZpSnvcK3Hpinbl6Gh8Z DgPIDQS6m1JSNp3npcE3ZJnoIikCwn9yrPk3F1sS8LLWbqlt997rs9Z6RWVEEzmgL3jD CNt3I7ZNxYZZv6b0ueApn+BDi4Q0xCdwI0mca7Ljh2r2+ejYOkf8Mg7KRG/o5s43RqDL TtQA== Received: by 10.204.153.15 with SMTP id i15mr13246039bkw.74.1339002501666; Wed, 06 Jun 2012 10:08:21 -0700 (PDT) MIME-Version: 1.0 Sender: utisoft@gmail.com Received: by 10.204.171.138 with HTTP; Wed, 6 Jun 2012 10:07:51 -0700 (PDT) In-Reply-To: <201206061651.q56GpXTk026294@svn.freebsd.org> References: <201206061651.q56GpXTk026294@svn.freebsd.org> From: Chris Rees Date: Wed, 6 Jun 2012 18:07:51 +0100 X-Google-Sender-Auth: CUuDWDlYWN_fDb19wSRJreByFG0 Message-ID: To: "David E. O'Brien" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r236688 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 17:08:24 -0000 On 6 June 2012 17:51, David E. O'Brien wrote: > Author: obrien > Date: Wed Jun =A06 16:51:33 2012 > New Revision: 236688 > URL: http://svn.freebsd.org/changeset/base/236688 > > Log: > =A0Add to the description and spell check. > > Modified: > =A0head/share/man/man4/filemon.4 > > Modified: head/share/man/man4/filemon.4 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/man/man4/filemon.4 =A0 =A0 =A0 Wed Jun =A06 16:30:16 2012 = =A0 =A0 =A0 =A0(r236687) > +++ head/share/man/man4/filemon.4 =A0 =A0 =A0 Wed Jun =A06 16:51:33 2012 = =A0 =A0 =A0 =A0(r236688) > @@ -10,7 +10,7 @@ > =A0.\" =A0 =A0notice, this list of conditions and the following disclaime= r in the > =A0.\" =A0 =A0documentation and/or other materials provided with the dist= ribution. > =A0.\" 3. All advertising materials mentioning features or use of this so= ftware > -.\" =A0 =A0must display the following acknowledgement: > +.\" =A0 =A0must display the following acknowledgment: > =A0.\" =A0 =A0This product includes software developed by David E. O'Brie= n and > =A0.\" =A0 =A0contributors. Aren't we phasing that clause out? Chris From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 17:26:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CEC51065670; Wed, 6 Jun 2012 17:26:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 675D88FC21; Wed, 6 Jun 2012 17:26:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q56HQrL9027972; Wed, 6 Jun 2012 17:26:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q56HQqhG027970; Wed, 6 Jun 2012 17:26:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206061726.q56HQqhG027970@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 6 Jun 2012 17:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236690 - head/tools/tools/syscall_timing X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 17:26:53 -0000 Author: kib Date: Wed Jun 6 17:26:52 2012 New Revision: 236690 URL: http://svn.freebsd.org/changeset/base/236690 Log: Do not execute a needed statement with side-effect in assert(). MFC after: 3 days Modified: head/tools/tools/syscall_timing/syscall_timing.c Modified: head/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- head/tools/tools/syscall_timing/syscall_timing.c Wed Jun 6 17:04:56 2012 (r236689) +++ head/tools/tools/syscall_timing/syscall_timing.c Wed Jun 6 17:26:52 2012 (r236690) @@ -71,20 +71,24 @@ alarm_handler(int signum) static void benchmark_start(void) { + int error; alarm_fired = 0; if (alarm_timeout) { signal(SIGALRM, alarm_handler); alarm(alarm_timeout); } - assert(clock_gettime(CLOCK_REALTIME, &ts_start) == 0); + error = clock_gettime(CLOCK_REALTIME, &ts_start); + assert(error == 0); } static void benchmark_stop(void) { + int error; - assert(clock_gettime(CLOCK_REALTIME, &ts_end) == 0); + error = clock_gettime(CLOCK_REALTIME, &ts_end); + assert(error == 0); } uintmax_t @@ -687,7 +691,7 @@ main(int argc, char *argv[]) const char *path; long long ll; char *endp; - int ch, i, j, k; + int ch, error, i, j, k; uintmax_t iterations, loops; alarm_timeout = 1; @@ -756,7 +760,8 @@ main(int argc, char *argv[]) } } - assert(clock_getres(CLOCK_REALTIME, &ts_res) == 0); + error = clock_getres(CLOCK_REALTIME, &ts_res); + assert(error == 0); printf("Clock resolution: %ju.%09ju\n", (uintmax_t)ts_res.tv_sec, (uintmax_t)ts_res.tv_nsec); printf("test\tloop\ttime\titerations\tperiteration\n"); From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 17:28:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1EF71065783; Wed, 6 Jun 2012 17:28:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB6A18FC0A; Wed, 6 Jun 2012 17:28:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q56HSkji028101; Wed, 6 Jun 2012 17:28:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q56HSkPZ028099; Wed, 6 Jun 2012 17:28:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206061728.q56HSkPZ028099@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Jun 2012 17:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236691 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 17:28:46 -0000 Author: mav Date: Wed Jun 6 17:28:46 2012 New Revision: 236691 URL: http://svn.freebsd.org/changeset/base/236691 Log: Remove declaration of scsi_interpret_sense(), removed 11 years ago. Modified: head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Wed Jun 6 17:26:52 2012 (r236690) +++ head/sys/cam/scsi/scsi_all.h Wed Jun 6 17:28:46 2012 (r236691) @@ -2183,12 +2183,6 @@ int scsi_sense_sbuf(struct ccb_scsiio * char * scsi_sense_string(struct ccb_scsiio *csio, char *str, int str_len); void scsi_sense_print(struct ccb_scsiio *csio); -int scsi_interpret_sense(union ccb *ccb, - u_int32_t sense_flags, - u_int32_t *relsim_flags, - u_int32_t *reduction, - u_int32_t *timeout, - scsi_sense_action error_action); #else /* _KERNEL */ int scsi_command_string(struct cam_device *device, struct ccb_scsiio *csio, struct sbuf *sb); @@ -2200,13 +2194,6 @@ char * scsi_sense_string(struct cam_dev char *str, int str_len); void scsi_sense_print(struct cam_device *device, struct ccb_scsiio *csio, FILE *ofile); -int scsi_interpret_sense(struct cam_device *device, - union ccb *ccb, - u_int32_t sense_flags, - u_int32_t *relsim_flags, - u_int32_t *reduction, - u_int32_t *timeout, - scsi_sense_action error_action); #endif /* _KERNEL */ #define SF_RETRY_UA 0x01 From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 18:00:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ECA951065670; Wed, 6 Jun 2012 18:00:25 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44F678FC19; Wed, 6 Jun 2012 18:00:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q56I0KGI029820; Wed, 6 Jun 2012 18:00:20 GMT (envelope-from oleg@svn.freebsd.org) Received: (from oleg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q56I0Kem029818; Wed, 6 Jun 2012 18:00:20 GMT (envelope-from oleg@svn.freebsd.org) Message-Id: <201206061800.q56I0Kem029818@svn.freebsd.org> From: Oleg Bulyzhin Date: Wed, 6 Jun 2012 18:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236692 - stable/9/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 18:00:26 -0000 Author: oleg Date: Wed Jun 6 18:00:19 2012 New Revision: 236692 URL: http://svn.freebsd.org/changeset/base/236692 Log: MFC: r232272, r232273 - lookup_dyn_rule_locked(): style(9) cleanup - Refresh dynamic tcp rule only if both sides answered keepalive packets. - Remove some useless assignments. Modified: stable/9/sys/netinet/ipfw/ip_fw_dynamic.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/ipfw/ip_fw_dynamic.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_fw_dynamic.c Wed Jun 6 17:28:46 2012 (r236691) +++ stable/9/sys/netinet/ipfw/ip_fw_dynamic.c Wed Jun 6 18:00:19 2012 (r236692) @@ -390,72 +390,68 @@ ipfw_remove_dyn_children(struct ip_fw *r IPFW_DYN_UNLOCK(); } -/** - * lookup a dynamic rule, locked version +/* + * Lookup a dynamic rule, locked version. */ static ipfw_dyn_rule * lookup_dyn_rule_locked(struct ipfw_flow_id *pkt, int *match_direction, struct tcphdr *tcp) { /* - * stateful ipfw extensions. - * Lookup into dynamic session queue + * Stateful ipfw extensions. + * Lookup into dynamic session queue. */ #define MATCH_REVERSE 0 #define MATCH_FORWARD 1 #define MATCH_NONE 2 #define MATCH_UNKNOWN 3 int i, dir = MATCH_NONE; - ipfw_dyn_rule *prev, *q=NULL; + ipfw_dyn_rule *prev, *q = NULL; IPFW_DYN_LOCK_ASSERT(); if (V_ipfw_dyn_v == NULL) - goto done; /* not found */ - i = hash_packet( pkt ); - for (prev=NULL, q = V_ipfw_dyn_v[i] ; q != NULL ; ) { + goto done; /* not found */ + i = hash_packet(pkt); + for (prev = NULL, q = V_ipfw_dyn_v[i]; q != NULL;) { if (q->dyn_type == O_LIMIT_PARENT && q->count) goto next; - if (TIME_LEQ( q->expire, time_uptime)) { /* expire entry */ + if (TIME_LEQ(q->expire, time_uptime)) { /* expire entry */ UNLINK_DYN_RULE(prev, V_ipfw_dyn_v[i], q); continue; } - if (pkt->proto == q->id.proto && - q->dyn_type != O_LIMIT_PARENT) { - if (IS_IP6_FLOW_ID(pkt)) { - if (IN6_ARE_ADDR_EQUAL(&(pkt->src_ip6), - &(q->id.src_ip6)) && - IN6_ARE_ADDR_EQUAL(&(pkt->dst_ip6), - &(q->id.dst_ip6)) && + if (pkt->proto != q->id.proto || q->dyn_type == O_LIMIT_PARENT) + goto next; + + if (IS_IP6_FLOW_ID(pkt)) { + if (IN6_ARE_ADDR_EQUAL(&pkt->src_ip6, &q->id.src_ip6) && + IN6_ARE_ADDR_EQUAL(&pkt->dst_ip6, &q->id.dst_ip6) && pkt->src_port == q->id.src_port && - pkt->dst_port == q->id.dst_port ) { + pkt->dst_port == q->id.dst_port) { + dir = MATCH_FORWARD; + break; + } + if (IN6_ARE_ADDR_EQUAL(&pkt->src_ip6, &q->id.dst_ip6) && + IN6_ARE_ADDR_EQUAL(&pkt->dst_ip6, &q->id.src_ip6) && + pkt->src_port == q->id.dst_port && + pkt->dst_port == q->id.src_port) { + dir = MATCH_REVERSE; + break; + } + } else { + if (pkt->src_ip == q->id.src_ip && + pkt->dst_ip == q->id.dst_ip && + pkt->src_port == q->id.src_port && + pkt->dst_port == q->id.dst_port) { dir = MATCH_FORWARD; break; - } - if (IN6_ARE_ADDR_EQUAL(&(pkt->src_ip6), - &(q->id.dst_ip6)) && - IN6_ARE_ADDR_EQUAL(&(pkt->dst_ip6), - &(q->id.src_ip6)) && - pkt->src_port == q->id.dst_port && - pkt->dst_port == q->id.src_port ) { - dir = MATCH_REVERSE; - break; - } - } else { - if (pkt->src_ip == q->id.src_ip && - pkt->dst_ip == q->id.dst_ip && - pkt->src_port == q->id.src_port && - pkt->dst_port == q->id.dst_port ) { - dir = MATCH_FORWARD; - break; - } - if (pkt->src_ip == q->id.dst_ip && - pkt->dst_ip == q->id.src_ip && - pkt->src_port == q->id.dst_port && - pkt->dst_port == q->id.src_port ) { - dir = MATCH_REVERSE; - break; - } + } + if (pkt->src_ip == q->id.dst_ip && + pkt->dst_ip == q->id.src_ip && + pkt->src_port == q->id.dst_port && + pkt->dst_port == q->id.src_port) { + dir = MATCH_REVERSE; + break; } } next: @@ -463,45 +459,55 @@ next: q = q->next; } if (q == NULL) - goto done; /* q = NULL, not found */ + goto done; /* q = NULL, not found */ - if ( prev != NULL) { /* found and not in front */ + if (prev != NULL) { /* found and not in front */ prev->next = q->next; q->next = V_ipfw_dyn_v[i]; V_ipfw_dyn_v[i] = q; } if (pkt->proto == IPPROTO_TCP) { /* update state according to flags */ - u_char flags = pkt->_flags & (TH_FIN|TH_SYN|TH_RST); + uint32_t ack; + u_char flags = pkt->_flags & (TH_FIN | TH_SYN | TH_RST); #define BOTH_SYN (TH_SYN | (TH_SYN << 8)) #define BOTH_FIN (TH_FIN | (TH_FIN << 8)) - q->state |= (dir == MATCH_FORWARD ) ? flags : (flags << 8); - switch (q->state) { - case TH_SYN: /* opening */ +#define TCP_FLAGS (TH_FLAGS | (TH_FLAGS << 8)) +#define ACK_FWD 0x10000 /* fwd ack seen */ +#define ACK_REV 0x20000 /* rev ack seen */ + + q->state |= (dir == MATCH_FORWARD) ? flags : (flags << 8); + switch (q->state & TCP_FLAGS) { + case TH_SYN: /* opening */ q->expire = time_uptime + V_dyn_syn_lifetime; break; case BOTH_SYN: /* move to established */ - case BOTH_SYN | TH_FIN : /* one side tries to close */ - case BOTH_SYN | (TH_FIN << 8) : - if (tcp) { + case BOTH_SYN | TH_FIN: /* one side tries to close */ + case BOTH_SYN | (TH_FIN << 8): #define _SEQ_GE(a,b) ((int)(a) - (int)(b) >= 0) - u_int32_t ack = ntohl(tcp->th_ack); - if (dir == MATCH_FORWARD) { - if (q->ack_fwd == 0 || _SEQ_GE(ack, q->ack_fwd)) - q->ack_fwd = ack; - else { /* ignore out-of-sequence */ - break; + if (tcp == NULL) + break; + + ack = ntohl(tcp->th_ack); + if (dir == MATCH_FORWARD) { + if (q->ack_fwd == 0 || + _SEQ_GE(ack, q->ack_fwd)) { + q->ack_fwd = ack; + q->state |= ACK_FWD; } - } else { - if (q->ack_rev == 0 || _SEQ_GE(ack, q->ack_rev)) - q->ack_rev = ack; - else { /* ignore out-of-sequence */ - break; + } else { + if (q->ack_rev == 0 || + _SEQ_GE(ack, q->ack_rev)) { + q->ack_rev = ack; + q->state |= ACK_REV; } - } } - q->expire = time_uptime + V_dyn_ack_lifetime; + if ((q->state & (ACK_FWD | ACK_REV)) == + (ACK_FWD | ACK_REV)) { + q->expire = time_uptime + V_dyn_ack_lifetime; + q->state &= ~(ACK_FWD | ACK_REV); + } break; case BOTH_SYN | BOTH_FIN: /* both sides closed */ @@ -531,9 +537,9 @@ next: q->expire = time_uptime + V_dyn_short_lifetime; } done: - if (match_direction) + if (match_direction != NULL) *match_direction = dir; - return q; + return (q); } ipfw_dyn_rule * @@ -1076,10 +1082,12 @@ ipfw_tick(void * vnetx) if (TIME_LEQ(q->expire, time_uptime)) continue; /* too late, rule expired */ - m = ipfw_send_pkt(NULL, &(q->id), q->ack_rev - 1, - q->ack_fwd, TH_SYN); - mnext = ipfw_send_pkt(NULL, &(q->id), q->ack_fwd - 1, - q->ack_rev, 0); + m = (q->state & ACK_REV) ? NULL : + ipfw_send_pkt(NULL, &(q->id), q->ack_rev - 1, + q->ack_fwd, TH_SYN); + mnext = (q->state & ACK_FWD) ? NULL : + ipfw_send_pkt(NULL, &(q->id), q->ack_fwd - 1, + q->ack_rev, 0); switch (q->id.addr_type) { case 4: @@ -1105,18 +1113,16 @@ ipfw_tick(void * vnetx) break; #endif } - - m = mnext = NULL; } } IPFW_DYN_UNLOCK(); - for (m = mnext = m0; m != NULL; m = mnext) { + for (m = m0; m != NULL; m = mnext) { mnext = m->m_nextpkt; m->m_nextpkt = NULL; ip_output(m, NULL, NULL, 0, NULL, NULL); } #ifdef INET6 - for (m = mnext = m6; m != NULL; m = mnext) { + for (m = m6; m != NULL; m = mnext) { mnext = m->m_nextpkt; m->m_nextpkt = NULL; ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL); From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 18:00:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B01E810657F3; Wed, 6 Jun 2012 18:00:38 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BDE58FC12; Wed, 6 Jun 2012 18:00:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q56I0c0p029866; Wed, 6 Jun 2012 18:00:38 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q56I0cZ0029864; Wed, 6 Jun 2012 18:00:38 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201206061800.q56I0cZ0029864@svn.freebsd.org> From: Maksim Yevmenkin Date: Wed, 6 Jun 2012 18:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236693 - head/contrib/bsnmp/snmp_mibII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 18:00:38 -0000 Author: emax Date: Wed Jun 6 18:00:38 2012 New Revision: 236693 URL: http://svn.freebsd.org/changeset/base/236693 Log: Count both IPv4 and IPv6 TCP connections in tcpCurrEstab Timeout from: current, syrinx MFC after: 1 week Modified: head/contrib/bsnmp/snmp_mibII/mibII_tcp.c Modified: head/contrib/bsnmp/snmp_mibII/mibII_tcp.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_tcp.c Wed Jun 6 18:00:19 2012 (r236692) +++ head/contrib/bsnmp/snmp_mibII/mibII_tcp.c Wed Jun 6 18:00:38 2012 (r236693) @@ -109,10 +109,12 @@ fetch_tcp(void) ptr = (struct xinpgen *)(void *)((char *)ptr + ptr->xig_len)) { tp = (struct xtcpcb *)ptr; if (tp->xt_inp.inp_gencnt > xinpgen->xig_gen || - (tp->xt_inp.inp_vflag & INP_IPV4) == 0) + (tp->xt_inp.inp_vflag & (INP_IPV4|INP_IPV6)) == 0) continue; - tcp_total++; + if (tp->xt_inp.inp_vflag & INP_IPV4) + tcp_total++; + if (tp->xt_tp.t_state == TCPS_ESTABLISHED || tp->xt_tp.t_state == TCPS_CLOSE_WAIT) tcp_count++; From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 18:04:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EA762106566B; Wed, 6 Jun 2012 18:04:49 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D46E78FC21; Wed, 6 Jun 2012 18:04:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q56I4nZ1030110; Wed, 6 Jun 2012 18:04:49 GMT (envelope-from oleg@svn.freebsd.org) Received: (from oleg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q56I4nif030108; Wed, 6 Jun 2012 18:04:49 GMT (envelope-from oleg@svn.freebsd.org) Message-Id: <201206061804.q56I4nif030108@svn.freebsd.org> From: Oleg Bulyzhin Date: Wed, 6 Jun 2012 18:04:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236694 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 18:04:50 -0000 Author: oleg Date: Wed Jun 6 18:04:49 2012 New Revision: 236694 URL: http://svn.freebsd.org/changeset/base/236694 Log: MFC: r232272, r232273 - lookup_dyn_rule_locked(): style(9) cleanup - Refresh dynamic tcp rule only if both sides answered keepalive packets. - Remove some useless assignments. Modified: stable/8/sys/netinet/ipfw/ip_fw_dynamic.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/ipfw/ip_fw_dynamic.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw_dynamic.c Wed Jun 6 18:00:38 2012 (r236693) +++ stable/8/sys/netinet/ipfw/ip_fw_dynamic.c Wed Jun 6 18:04:49 2012 (r236694) @@ -390,72 +390,68 @@ ipfw_remove_dyn_children(struct ip_fw *r IPFW_DYN_UNLOCK(); } -/** - * lookup a dynamic rule, locked version +/* + * Lookup a dynamic rule, locked version. */ static ipfw_dyn_rule * lookup_dyn_rule_locked(struct ipfw_flow_id *pkt, int *match_direction, struct tcphdr *tcp) { /* - * stateful ipfw extensions. - * Lookup into dynamic session queue + * Stateful ipfw extensions. + * Lookup into dynamic session queue. */ #define MATCH_REVERSE 0 #define MATCH_FORWARD 1 #define MATCH_NONE 2 #define MATCH_UNKNOWN 3 int i, dir = MATCH_NONE; - ipfw_dyn_rule *prev, *q=NULL; + ipfw_dyn_rule *prev, *q = NULL; IPFW_DYN_LOCK_ASSERT(); if (V_ipfw_dyn_v == NULL) - goto done; /* not found */ - i = hash_packet( pkt ); - for (prev=NULL, q = V_ipfw_dyn_v[i] ; q != NULL ; ) { + goto done; /* not found */ + i = hash_packet(pkt); + for (prev = NULL, q = V_ipfw_dyn_v[i]; q != NULL;) { if (q->dyn_type == O_LIMIT_PARENT && q->count) goto next; - if (TIME_LEQ( q->expire, time_uptime)) { /* expire entry */ + if (TIME_LEQ(q->expire, time_uptime)) { /* expire entry */ UNLINK_DYN_RULE(prev, V_ipfw_dyn_v[i], q); continue; } - if (pkt->proto == q->id.proto && - q->dyn_type != O_LIMIT_PARENT) { - if (IS_IP6_FLOW_ID(pkt)) { - if (IN6_ARE_ADDR_EQUAL(&(pkt->src_ip6), - &(q->id.src_ip6)) && - IN6_ARE_ADDR_EQUAL(&(pkt->dst_ip6), - &(q->id.dst_ip6)) && + if (pkt->proto != q->id.proto || q->dyn_type == O_LIMIT_PARENT) + goto next; + + if (IS_IP6_FLOW_ID(pkt)) { + if (IN6_ARE_ADDR_EQUAL(&pkt->src_ip6, &q->id.src_ip6) && + IN6_ARE_ADDR_EQUAL(&pkt->dst_ip6, &q->id.dst_ip6) && pkt->src_port == q->id.src_port && - pkt->dst_port == q->id.dst_port ) { + pkt->dst_port == q->id.dst_port) { + dir = MATCH_FORWARD; + break; + } + if (IN6_ARE_ADDR_EQUAL(&pkt->src_ip6, &q->id.dst_ip6) && + IN6_ARE_ADDR_EQUAL(&pkt->dst_ip6, &q->id.src_ip6) && + pkt->src_port == q->id.dst_port && + pkt->dst_port == q->id.src_port) { + dir = MATCH_REVERSE; + break; + } + } else { + if (pkt->src_ip == q->id.src_ip && + pkt->dst_ip == q->id.dst_ip && + pkt->src_port == q->id.src_port && + pkt->dst_port == q->id.dst_port) { dir = MATCH_FORWARD; break; - } - if (IN6_ARE_ADDR_EQUAL(&(pkt->src_ip6), - &(q->id.dst_ip6)) && - IN6_ARE_ADDR_EQUAL(&(pkt->dst_ip6), - &(q->id.src_ip6)) && - pkt->src_port == q->id.dst_port && - pkt->dst_port == q->id.src_port ) { - dir = MATCH_REVERSE; - break; - } - } else { - if (pkt->src_ip == q->id.src_ip && - pkt->dst_ip == q->id.dst_ip && - pkt->src_port == q->id.src_port && - pkt->dst_port == q->id.dst_port ) { - dir = MATCH_FORWARD; - break; - } - if (pkt->src_ip == q->id.dst_ip && - pkt->dst_ip == q->id.src_ip && - pkt->src_port == q->id.dst_port && - pkt->dst_port == q->id.src_port ) { - dir = MATCH_REVERSE; - break; - } + } + if (pkt->src_ip == q->id.dst_ip && + pkt->dst_ip == q->id.src_ip && + pkt->src_port == q->id.dst_port && + pkt->dst_port == q->id.src_port) { + dir = MATCH_REVERSE; + break; } } next: @@ -463,45 +459,55 @@ next: q = q->next; } if (q == NULL) - goto done; /* q = NULL, not found */ + goto done; /* q = NULL, not found */ - if ( prev != NULL) { /* found and not in front */ + if (prev != NULL) { /* found and not in front */ prev->next = q->next; q->next = V_ipfw_dyn_v[i]; V_ipfw_dyn_v[i] = q; } if (pkt->proto == IPPROTO_TCP) { /* update state according to flags */ - u_char flags = pkt->_flags & (TH_FIN|TH_SYN|TH_RST); + uint32_t ack; + u_char flags = pkt->_flags & (TH_FIN | TH_SYN | TH_RST); #define BOTH_SYN (TH_SYN | (TH_SYN << 8)) #define BOTH_FIN (TH_FIN | (TH_FIN << 8)) - q->state |= (dir == MATCH_FORWARD ) ? flags : (flags << 8); - switch (q->state) { - case TH_SYN: /* opening */ +#define TCP_FLAGS (TH_FLAGS | (TH_FLAGS << 8)) +#define ACK_FWD 0x10000 /* fwd ack seen */ +#define ACK_REV 0x20000 /* rev ack seen */ + + q->state |= (dir == MATCH_FORWARD) ? flags : (flags << 8); + switch (q->state & TCP_FLAGS) { + case TH_SYN: /* opening */ q->expire = time_uptime + V_dyn_syn_lifetime; break; case BOTH_SYN: /* move to established */ - case BOTH_SYN | TH_FIN : /* one side tries to close */ - case BOTH_SYN | (TH_FIN << 8) : - if (tcp) { + case BOTH_SYN | TH_FIN: /* one side tries to close */ + case BOTH_SYN | (TH_FIN << 8): #define _SEQ_GE(a,b) ((int)(a) - (int)(b) >= 0) - u_int32_t ack = ntohl(tcp->th_ack); - if (dir == MATCH_FORWARD) { - if (q->ack_fwd == 0 || _SEQ_GE(ack, q->ack_fwd)) - q->ack_fwd = ack; - else { /* ignore out-of-sequence */ - break; + if (tcp == NULL) + break; + + ack = ntohl(tcp->th_ack); + if (dir == MATCH_FORWARD) { + if (q->ack_fwd == 0 || + _SEQ_GE(ack, q->ack_fwd)) { + q->ack_fwd = ack; + q->state |= ACK_FWD; } - } else { - if (q->ack_rev == 0 || _SEQ_GE(ack, q->ack_rev)) - q->ack_rev = ack; - else { /* ignore out-of-sequence */ - break; + } else { + if (q->ack_rev == 0 || + _SEQ_GE(ack, q->ack_rev)) { + q->ack_rev = ack; + q->state |= ACK_REV; } - } } - q->expire = time_uptime + V_dyn_ack_lifetime; + if ((q->state & (ACK_FWD | ACK_REV)) == + (ACK_FWD | ACK_REV)) { + q->expire = time_uptime + V_dyn_ack_lifetime; + q->state &= ~(ACK_FWD | ACK_REV); + } break; case BOTH_SYN | BOTH_FIN: /* both sides closed */ @@ -531,9 +537,9 @@ next: q->expire = time_uptime + V_dyn_short_lifetime; } done: - if (match_direction) + if (match_direction != NULL) *match_direction = dir; - return q; + return (q); } ipfw_dyn_rule * @@ -1080,10 +1086,12 @@ ipfw_tick(void * vnetx) if (TIME_LEQ(q->expire, time_uptime)) continue; /* too late, rule expired */ - m = ipfw_send_pkt(NULL, &(q->id), q->ack_rev - 1, - q->ack_fwd, TH_SYN); - mnext = ipfw_send_pkt(NULL, &(q->id), q->ack_fwd - 1, - q->ack_rev, 0); + m = (q->state & ACK_REV) ? NULL : + ipfw_send_pkt(NULL, &(q->id), q->ack_rev - 1, + q->ack_fwd, TH_SYN); + mnext = (q->state & ACK_FWD) ? NULL : + ipfw_send_pkt(NULL, &(q->id), q->ack_fwd - 1, + q->ack_rev, 0); switch (q->id.addr_type) { case 4: @@ -1109,18 +1117,16 @@ ipfw_tick(void * vnetx) break; #endif } - - m = mnext = NULL; } } IPFW_DYN_UNLOCK(); - for (m = mnext = m0; m != NULL; m = mnext) { + for (m = m0; m != NULL; m = mnext) { mnext = m->m_nextpkt; m->m_nextpkt = NULL; ip_output(m, NULL, NULL, 0, NULL, NULL); } #ifdef INET6 - for (m = mnext = m6; m != NULL; m = mnext) { + for (m = m6; m != NULL; m = mnext) { mnext = m->m_nextpkt; m->m_nextpkt = NULL; ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL); From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 21:16:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 80B761065672; Wed, 6 Jun 2012 21:16:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C10A8FC25; Wed, 6 Jun 2012 21:16:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q56LGR0H038774; Wed, 6 Jun 2012 21:16:27 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q56LGRco038771; Wed, 6 Jun 2012 21:16:27 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201206062116.q56LGRco038771@svn.freebsd.org> From: Dimitry Andric Date: Wed, 6 Jun 2012 21:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236695 - in head/lib/libc: include net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 21:16:27 -0000 Author: dim Date: Wed Jun 6 21:16:26 2012 New Revision: 236695 URL: http://svn.freebsd.org/changeset/base/236695 Log: Fix two warnings about self-assignment in libc. These normally only trigger with clang, when you either use -save-temps, or ccache. Reported by: Sevan / Venture37 MFC after: 3 days Modified: head/lib/libc/include/port_before.h head/lib/libc/net/getaddrinfo.c Modified: head/lib/libc/include/port_before.h ============================================================================== --- head/lib/libc/include/port_before.h Wed Jun 6 18:04:49 2012 (r236694) +++ head/lib/libc/include/port_before.h Wed Jun 6 21:16:26 2012 (r236695) @@ -17,6 +17,6 @@ var = _u.v; \ } while (0) -#define UNUSED(x) (x) = (x) +#define UNUSED(x) (void)(x) #endif /* _PORT_BEFORE_H_ */ Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Wed Jun 6 18:04:49 2012 (r236694) +++ head/lib/libc/net/getaddrinfo.c Wed Jun 6 21:16:26 2012 (r236695) @@ -464,7 +464,7 @@ getaddrinfo(const char *hostname, const } error = get_portmatch(pai, servname); if (error) - ERR(error); + goto bad; *pai = ai0; } From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 21:49:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7587E1065677; Wed, 6 Jun 2012 21:49:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D9268FC12; Wed, 6 Jun 2012 21:49:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q56LnWWf040385; Wed, 6 Jun 2012 21:49:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q56LnWO0040374; Wed, 6 Jun 2012 21:49:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206062149.q56LnWO0040374@svn.freebsd.org> From: John Baldwin Date: Wed, 6 Jun 2012 21:49:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236698 - in stable/9: lib/libprocstat sys/kern sys/sys usr.bin/fstat usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 21:49:32 -0000 Author: jhb Date: Wed Jun 6 21:49:31 2012 New Revision: 236698 URL: http://svn.freebsd.org/changeset/base/236698 Log: MFC 233760: Export some more useful info about shared memory objects to userland via procstat(1) and fstat(1): - Change shm file descriptors to track the pathname they are associated with and add a shm_path() method to copy the path out to a caller-supplied buffer. - Use the fo_stat() method of shared memory objects and shm_path() to export the path, mode, and size of a shared memory object via struct kinfo_file. - Add a struct shmstat to the libprocstat(3) interface along with a procstat_get_shm_info() to export the mode and size of a shared memory object. - Change procstat to always print out the path for a given object if it is valid. - Teach fstat about shared memory objects and to display their path, mode, and size. Modified: stable/9/lib/libprocstat/Symbol.map stable/9/lib/libprocstat/Versions.def stable/9/lib/libprocstat/libprocstat.3 stable/9/lib/libprocstat/libprocstat.c stable/9/lib/libprocstat/libprocstat.h stable/9/sys/kern/kern_descrip.c stable/9/sys/kern/uipc_shm.c stable/9/sys/sys/mman.h stable/9/usr.bin/fstat/fstat.c stable/9/usr.bin/procstat/procstat_files.c Directory Properties: stable/9/lib/libprocstat/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) stable/9/usr.bin/fstat/ (props changed) stable/9/usr.bin/procstat/ (props changed) Modified: stable/9/lib/libprocstat/Symbol.map ============================================================================== --- stable/9/lib/libprocstat/Symbol.map Wed Jun 6 21:42:22 2012 (r236697) +++ stable/9/lib/libprocstat/Symbol.map Wed Jun 6 21:49:31 2012 (r236698) @@ -14,3 +14,7 @@ FBSD_1.2 { procstat_open_kvm; procstat_open_sysctl; }; + +FBSD_1.3 { + procstat_get_shm_info; +}; Modified: stable/9/lib/libprocstat/Versions.def ============================================================================== --- stable/9/lib/libprocstat/Versions.def Wed Jun 6 21:42:22 2012 (r236697) +++ stable/9/lib/libprocstat/Versions.def Wed Jun 6 21:49:31 2012 (r236698) @@ -3,3 +3,8 @@ # This version was first added to 9.0-current. FBSD_1.2 { }; + +# This version was first added to 10.0-current. +FBSD_1.3 { +} FBSD_1.2; + Modified: stable/9/lib/libprocstat/libprocstat.3 ============================================================================== --- stable/9/lib/libprocstat/libprocstat.3 Wed Jun 6 21:42:22 2012 (r236697) +++ stable/9/lib/libprocstat/libprocstat.3 Wed Jun 6 21:49:31 2012 (r236698) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 12, 2011 +.Dd April 1, 2012 .Dt LIBPROCSTAT 3 .Os .Sh NAME @@ -37,6 +37,7 @@ .Nm procstat_freeprocs , .Nm procstat_get_pipe_info , .Nm procstat_get_pts_info , +.Nm procstat_get_shm_info , .Nm procstat_get_socket_info , .Nm procstat_get_vnode_info .Nd library interface for file and process information retrieval @@ -70,6 +71,13 @@ .Fa "char *errbuf" .Fc .Ft int +.Fo procstat_get_shm_info +.Fa "struct procstat *procstat" +.Fa "struct filestat *fst" +.Fa "struct shmstat *shm" +.Fa "char *errbuf" +.Fc +.Ft int .Fo procstat_get_socket_info .Fa "struct procstat *procstat" .Fa "struct filestat *fst" @@ -191,10 +199,12 @@ function call. The .Fn procstat_get_pipe_info , .Fn procstat_get_pts_info , +.Fn procstat_get_shm_info , .Fn procstat_get_socket_info and .Fn procstat_get_vnode_info functions are used to retrieve information about pipes, pseudo-terminals, +shared memory objects, sockets, and vnodes, respectively. Each of them have a similar interface API. The @@ -231,11 +241,14 @@ argument indicates an actual error messa .Nm procstat_get_pipe_info .It Li PS_FST_TYPE_PTS .Nm procstat_get_pts_info +.It Li PS_FST_TYPE_SHM +.Nm procstat_get_shm_info .El .Sh SEE ALSO .Xr fstat 1 , .Xr fuser 1 , .Xr pipe 2 , +.Xr shm_open 2 , .Xr socket 2 , .Xr kvm 3 , .Xr queue 3 , Modified: stable/9/lib/libprocstat/libprocstat.c ============================================================================== --- stable/9/lib/libprocstat/libprocstat.c Wed Jun 6 21:42:22 2012 (r236697) +++ stable/9/lib/libprocstat/libprocstat.c Wed Jun 6 21:49:31 2012 (r236698) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #define _WANT_FILE #include #include +#include #define _KERNEL #include #include @@ -114,6 +115,10 @@ static int procstat_get_pts_info_sysctl( struct ptsstat *pts, char *errbuf); static int procstat_get_pts_info_kvm(kvm_t *kd, struct filestat *fst, struct ptsstat *pts, char *errbuf); +static int procstat_get_shm_info_sysctl(struct filestat *fst, + struct shmstat *shm, char *errbuf); +static int procstat_get_shm_info_kvm(kvm_t *kd, struct filestat *fst, + struct shmstat *shm, char *errbuf); static int procstat_get_socket_info_sysctl(struct filestat *fst, struct sockstat *sock, char *errbuf); static int procstat_get_socket_info_kvm(kvm_t *kd, struct filestat *fst, @@ -469,6 +474,10 @@ procstat_getfiles_kvm(struct procstat *p data = file.f_data; break; #endif + case DTYPE_SHM: + type = PS_FST_TYPE_SHM; + data = file.f_data; + break; default: continue; } @@ -849,6 +858,69 @@ procstat_get_pts_info_sysctl(struct file } int +procstat_get_shm_info(struct procstat *procstat, struct filestat *fst, + struct shmstat *shm, char *errbuf) +{ + + assert(shm); + if (procstat->type == PROCSTAT_KVM) { + return (procstat_get_shm_info_kvm(procstat->kd, fst, shm, + errbuf)); + } else if (procstat->type == PROCSTAT_SYSCTL) { + return (procstat_get_shm_info_sysctl(fst, shm, errbuf)); + } else { + warnx("unknown access method: %d", procstat->type); + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + return (1); + } +} + +static int +procstat_get_shm_info_kvm(kvm_t *kd, struct filestat *fst, + struct shmstat *shm, char *errbuf) +{ + struct shmfd shmfd; + void *shmfdp; + + assert(kd); + assert(shm); + assert(fst); + bzero(shm, sizeof(*shm)); + shmfdp = fst->fs_typedep; + if (shmfdp == NULL) + goto fail; + if (!kvm_read_all(kd, (unsigned long)shmfdp, &shmfd, + sizeof(struct shmfd))) { + warnx("can't read shmfd at %p", (void *)shmfdp); + goto fail; + } + shm->mode = S_IFREG | shmfd.shm_mode; + shm->size = shmfd.shm_size; + return (0); + +fail: + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + return (1); +} + +static int +procstat_get_shm_info_sysctl(struct filestat *fst, struct shmstat *shm, + char *errbuf __unused) +{ + struct kinfo_file *kif; + + assert(shm); + assert(fst); + bzero(shm, sizeof(*shm)); + kif = fst->fs_typedep; + if (kif == NULL) + return (0); + shm->size = kif->kf_un.kf_file.kf_file_size; + shm->mode = kif->kf_un.kf_file.kf_file_mode; + return (0); +} + +int procstat_get_vnode_info(struct procstat *procstat, struct filestat *fst, struct vnstat *vn, char *errbuf) { Modified: stable/9/lib/libprocstat/libprocstat.h ============================================================================== --- stable/9/lib/libprocstat/libprocstat.h Wed Jun 6 21:42:22 2012 (r236697) +++ stable/9/lib/libprocstat/libprocstat.h Wed Jun 6 21:49:31 2012 (r236698) @@ -123,6 +123,10 @@ struct pipestat { uint64_t addr; uint64_t peer; }; +struct shmstat { + uint64_t size; + uint16_t mode; +}; struct sockstat { uint64_t inp_ppcb; uint64_t so_addr; @@ -152,6 +156,8 @@ int procstat_get_pipe_info(struct procst struct pipestat *pipe, char *errbuf); int procstat_get_pts_info(struct procstat *procstat, struct filestat *fst, struct ptsstat *pts, char *errbuf); +int procstat_get_shm_info(struct procstat *procstat, struct filestat *fst, + struct shmstat *shm, char *errbuf); int procstat_get_socket_info(struct procstat *procstat, struct filestat *fst, struct sockstat *sock, char *errbuf); int procstat_get_vnode_info(struct procstat *procstat, struct filestat *fst, Modified: stable/9/sys/kern/kern_descrip.c ============================================================================== --- stable/9/sys/kern/kern_descrip.c Wed Jun 6 21:42:22 2012 (r236697) +++ stable/9/sys/kern/kern_descrip.c Wed Jun 6 21:49:31 2012 (r236698) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -126,6 +127,7 @@ static int fill_pts_info(struct tty *tp, static int fill_pipe_info(struct pipe *pi, struct kinfo_file *kif); static int fill_procdesc_info(struct procdesc *pdp, struct kinfo_file *kif); +static int fill_shm_info(struct file *fp, struct kinfo_file *kif); /* * A process is initially started out with NDFILE descriptors stored within @@ -2958,6 +2960,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE struct kinfo_ofile *kif; struct filedesc *fdp; int error, i, *name; + struct shmfd *shmfd; struct socket *so; struct vnode *vp; struct file *fp; @@ -2995,6 +2998,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE vp = NULL; so = NULL; tp = NULL; + shmfd = NULL; kif->kf_fd = i; #ifdef CAPABILITIES @@ -3046,6 +3050,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE case DTYPE_SHM: kif->kf_type = KF_TYPE_SHM; + shmfd = fp->f_data; break; case DTYPE_SEM: @@ -3159,6 +3164,8 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE strlcpy(kif->kf_path, tty_devname(tp), sizeof(kif->kf_path)); } + if (shmfd != NULL) + shm_path(shmfd, kif->kf_path, sizeof(kif->kf_path)); error = SYSCTL_OUT(req, kif, sizeof(*kif)); if (error) break; @@ -3229,6 +3236,9 @@ export_fd_for_sysctl(void *data, int typ case KF_TYPE_PROCDESC: error = fill_procdesc_info((struct procdesc *)data, kif); break; + case KF_TYPE_SHM: + error = fill_shm_info((struct file *)data, kif); + break; default: error = 0; } @@ -3398,6 +3408,7 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER case DTYPE_SHM: type = KF_TYPE_SHM; + data = fp; break; case DTYPE_SEM: @@ -3621,6 +3632,23 @@ fill_procdesc_info(struct procdesc *pdp, return (0); } +static int +fill_shm_info(struct file *fp, struct kinfo_file *kif) +{ + struct thread *td; + struct stat sb; + + td = curthread; + if (fp->f_data == NULL) + return (1); + if (fo_stat(fp, &sb, td->td_ucred, td) != 0) + return (1); + shm_path(fp->f_data, kif->kf_path, sizeof(kif->kf_path)); + kif->kf_un.kf_file.kf_file_mode = sb.st_mode; + kif->kf_un.kf_file.kf_file_size = sb.st_size; + return (0); +} + static SYSCTL_NODE(_kern_proc, KERN_PROC_FILEDESC, filedesc, CTLFLAG_RD, sysctl_kern_proc_filedesc, "Process filedesc entries"); Modified: stable/9/sys/kern/uipc_shm.c ============================================================================== --- stable/9/sys/kern/uipc_shm.c Wed Jun 6 21:42:22 2012 (r236697) +++ stable/9/sys/kern/uipc_shm.c Wed Jun 6 21:49:31 2012 (r236698) @@ -468,6 +468,7 @@ shm_insert(char *path, Fnv32_t fnv, stru map->sm_path = path; map->sm_fnv = fnv; map->sm_shmfd = shm_hold(shmfd); + shmfd->shm_path = path; LIST_INSERT_HEAD(SHM_HASH(fnv), map, sm_link); } @@ -490,6 +491,7 @@ shm_remove(char *path, Fnv32_t fnv, stru FREAD | FWRITE); if (error) return (error); + map->sm_shmfd->shm_path = NULL; LIST_REMOVE(map, sm_link); shm_drop(map->sm_shmfd); free(map->sm_path, M_SHMFD); @@ -844,3 +846,15 @@ shm_unmap(struct file *fp, void *mem, si VM_OBJECT_UNLOCK(obj); return (0); } + +void +shm_path(struct shmfd *shmfd, char *path, size_t size) +{ + + if (shmfd->shm_path == NULL) + return; + sx_slock(&shm_dict_lock); + if (shmfd->shm_path != NULL) + strlcpy(path, shmfd->shm_path, size); + sx_sunlock(&shm_dict_lock); +} Modified: stable/9/sys/sys/mman.h ============================================================================== --- stable/9/sys/sys/mman.h Wed Jun 6 21:42:22 2012 (r236697) +++ stable/9/sys/sys/mman.h Wed Jun 6 21:49:31 2012 (r236698) @@ -178,7 +178,7 @@ typedef __size_t size_t; #define _SIZE_T_DECLARED #endif -#ifdef _KERNEL +#if defined(_KERNEL) || defined(_WANT_FILE) #include struct file; @@ -202,12 +202,16 @@ struct shmfd { struct timespec shm_birthtime; struct label *shm_label; /* MAC label */ + const char *shm_path; }; +#endif +#ifdef _KERNEL int shm_mmap(struct shmfd *shmfd, vm_size_t objsize, vm_ooffset_t foff, vm_object_t *obj); int shm_map(struct file *fp, size_t size, off_t offset, void **memp); int shm_unmap(struct file *fp, void *mem, size_t size); +void shm_path(struct shmfd *shmfd, char *path, size_t size); #else /* !_KERNEL */ Modified: stable/9/usr.bin/fstat/fstat.c ============================================================================== --- stable/9/usr.bin/fstat/fstat.c Wed Jun 6 21:42:22 2012 (r236697) +++ stable/9/usr.bin/fstat/fstat.c Wed Jun 6 21:49:31 2012 (r236698) @@ -84,6 +84,8 @@ static void print_pipe_info(struct procs struct filestat *fst); static void print_pts_info(struct procstat *procstat, struct filestat *fst); +static void print_shm_info(struct procstat *procstat, + struct filestat *fst); static void print_socket_info(struct procstat *procstat, struct filestat *fst); static void print_vnode_info(struct procstat *procstat, @@ -289,6 +291,9 @@ print_file_info(struct procstat *procsta case PS_FST_TYPE_PTS: print_pts_info(procstat, fst); break; + case PS_FST_TYPE_SHM: + print_shm_info(procstat, fst); + break; default: if (vflg) fprintf(stderr, @@ -419,6 +424,30 @@ print_pts_info(struct procstat *procstat } static void +print_shm_info(struct procstat *procstat, struct filestat *fst) +{ + struct shmstat shm; + char errbuf[_POSIX2_LINE_MAX]; + char mode[15]; + int error; + + error = procstat_get_shm_info(procstat, fst, &shm, errbuf); + if (error != 0) { + printf("* error"); + return; + } + if (nflg) { + printf(" "); + (void)snprintf(mode, sizeof(mode), "%o", shm.mode); + } else { + printf(" %-15s", fst->fs_path != NULL ? fst->fs_path : "-"); + strmode(shm.mode, mode); + } + printf(" %10s %6ju", mode, shm.size); + print_access_flags(fst->fs_fflags); +} + +static void print_vnode_info(struct procstat *procstat, struct filestat *fst) { struct vnstat vn; Modified: stable/9/usr.bin/procstat/procstat_files.c ============================================================================== --- stable/9/usr.bin/procstat/procstat_files.c Wed Jun 6 21:42:22 2012 (r236697) +++ stable/9/usr.bin/procstat/procstat_files.c Wed Jun 6 21:49:31 2012 (r236698) @@ -440,13 +440,6 @@ procstat_files(struct procstat *procstat printf(" "); } switch (fst->fs_type) { - case PS_FST_TYPE_VNODE: - case PS_FST_TYPE_FIFO: - case PS_FST_TYPE_PTS: - printf("%-3s ", "-"); - printf("%-18s", fst->fs_path != NULL ? fst->fs_path : "-"); - break; - case PS_FST_TYPE_SOCKET: error = procstat_get_socket_info(procstat, fst, &sock, NULL); if (error != 0) @@ -477,7 +470,8 @@ procstat_files(struct procstat *procstat break; default: - printf("%-18s", "-"); + printf("%-3s ", "-"); + printf("%-18s", fst->fs_path != NULL ? fst->fs_path : "-"); } printf("\n"); From owner-svn-src-all@FreeBSD.ORG Wed Jun 6 21:57:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D05F81065674; Wed, 6 Jun 2012 21:57:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB0348FC14; Wed, 6 Jun 2012 21:57:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q56Lv3P3040786; Wed, 6 Jun 2012 21:57:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q56Lv3a5040780; Wed, 6 Jun 2012 21:57:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206062157.q56Lv3a5040780@svn.freebsd.org> From: John Baldwin Date: Wed, 6 Jun 2012 21:57:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236699 - in stable/8: sys/kern sys/sys usr.bin/fstat usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2012 21:57:03 -0000 Author: jhb Date: Wed Jun 6 21:57:03 2012 New Revision: 236699 URL: http://svn.freebsd.org/changeset/base/236699 Log: MFC 233760: Export some more useful info about shared memory objects to userland via procstat(1) and fstat(1): - Change shm file descriptors to track the pathname they are associated with and add a shm_path() method to copy the path out to a caller-supplied buffer. - Use shm_path() to export the path of a shared memory object via struct kinfo_file. - Change procstat to always print out the path for a given object if it is valid. - Teach fstat about shared memory objects and to display their path, mode, and size. Modified: stable/8/sys/kern/kern_descrip.c stable/8/sys/kern/uipc_shm.c stable/8/sys/sys/mman.h stable/8/usr.bin/fstat/fstat.c stable/8/usr.bin/procstat/procstat_files.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/procstat/ (props changed) Modified: stable/8/sys/kern/kern_descrip.c ============================================================================== --- stable/8/sys/kern/kern_descrip.c Wed Jun 6 21:49:31 2012 (r236698) +++ stable/8/sys/kern/kern_descrip.c Wed Jun 6 21:57:03 2012 (r236699) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2742,6 +2743,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE struct kinfo_ofile *kif; struct filedesc *fdp; int error, i, *name; + struct shmfd *shmfd; struct socket *so; struct vnode *vp; struct file *fp; @@ -2779,6 +2781,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE vp = NULL; so = NULL; tp = NULL; + shmfd = NULL; kif->kf_fd = i; switch (fp->f_type) { case DTYPE_VNODE: @@ -2814,6 +2817,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE case DTYPE_SHM: kif->kf_type = KF_TYPE_SHM; + shmfd = fp->f_data; break; case DTYPE_SEM: @@ -2921,6 +2925,8 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE strlcpy(kif->kf_path, tty_devname(tp), sizeof(kif->kf_path)); } + if (shmfd != NULL) + shm_path(shmfd, kif->kf_path, sizeof(kif->kf_path)); error = SYSCTL_OUT(req, kif, sizeof(*kif)); if (error) break; @@ -2995,6 +3001,7 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER struct kinfo_file *kif; struct filedesc *fdp; int error, i, *name; + struct shmfd *shmfd; struct socket *so; struct vnode *vp; struct file *fp; @@ -3032,6 +3039,7 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER vp = NULL; so = NULL; tp = NULL; + shmfd = NULL; kif->kf_fd = i; switch (fp->f_type) { case DTYPE_VNODE: @@ -3067,6 +3075,7 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER case DTYPE_SHM: kif->kf_type = KF_TYPE_SHM; + shmfd = fp->f_data; break; case DTYPE_SEM: @@ -3174,6 +3183,8 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER strlcpy(kif->kf_path, tty_devname(tp), sizeof(kif->kf_path)); } + if (shmfd != NULL) + shm_path(shmfd, kif->kf_path, sizeof(kif->kf_path)); /* Pack record size down */ kif->kf_structsize = offsetof(struct kinfo_file, kf_path) + strlen(kif->kf_path) + 1; Modified: stable/8/sys/kern/uipc_shm.c ============================================================================== --- stable/8/sys/kern/uipc_shm.c Wed Jun 6 21:49:31 2012 (r236698) +++ stable/8/sys/kern/uipc_shm.c Wed Jun 6 21:57:03 2012 (r236699) @@ -453,6 +453,7 @@ shm_insert(char *path, Fnv32_t fnv, stru map->sm_path = path; map->sm_fnv = fnv; map->sm_shmfd = shm_hold(shmfd); + shmfd->shm_path = path; LIST_INSERT_HEAD(SHM_HASH(fnv), map, sm_link); } @@ -475,6 +476,7 @@ shm_remove(char *path, Fnv32_t fnv, stru FREAD | FWRITE); if (error) return (error); + map->sm_shmfd->shm_path = NULL; LIST_REMOVE(map, sm_link); shm_drop(map->sm_shmfd); free(map->sm_path, M_SHMFD); @@ -754,3 +756,15 @@ shm_unmap(struct file *fp, void *mem, si VM_OBJECT_UNLOCK(obj); return (0); } + +void +shm_path(struct shmfd *shmfd, char *path, size_t size) +{ + + if (shmfd->shm_path == NULL) + return; + sx_slock(&shm_dict_lock); + if (shmfd->shm_path != NULL) + strlcpy(path, shmfd->shm_path, size); + sx_sunlock(&shm_dict_lock); +} Modified: stable/8/sys/sys/mman.h ============================================================================== --- stable/8/sys/sys/mman.h Wed Jun 6 21:49:31 2012 (r236698) +++ stable/8/sys/sys/mman.h Wed Jun 6 21:57:03 2012 (r236699) @@ -178,7 +178,7 @@ typedef __size_t size_t; #define _SIZE_T_DECLARED #endif -#ifdef _KERNEL +#if defined(_KERNEL) || defined(_WANT_FILE) #include struct file; @@ -202,12 +202,16 @@ struct shmfd { struct timespec shm_birthtime; struct label *shm_label; /* MAC label */ + const char *shm_path; }; +#endif +#ifdef _KERNEL int shm_mmap(struct shmfd *shmfd, vm_size_t objsize, vm_ooffset_t foff, vm_object_t *obj); int shm_map(struct file *fp, size_t size, off_t offset, void **memp); int shm_unmap(struct file *fp, void *mem, size_t size); +void shm_path(struct shmfd *shmfd, char *path, size_t size); #else /* !_KERNEL */ Modified: stable/8/usr.bin/fstat/fstat.c ============================================================================== --- stable/8/usr.bin/fstat/fstat.c Wed Jun 6 21:49:31 2012 (r236698) +++ stable/8/usr.bin/fstat/fstat.c Wed Jun 6 21:57:03 2012 (r236699) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #define _WANT_FILE #include #include +#include #define _KERNEL #include #include @@ -155,6 +156,7 @@ char *getmnton(struct mount *m); void pipetrans(struct pipe *pi, int i, int flag); void socktrans(struct socket *sock, int i); void ptstrans(struct tty *tp, int i, int flag); +void shmtrans(struct shmfd *shmp, int i, int flag); void getinetproto(int number); int getfname(const char *filename); void usage(void); @@ -418,6 +420,12 @@ dofiles(struct kinfo_proc *kp) ptstrans(file.f_data, i, file.f_flag); } #endif +#ifdef DTYPE_SHM + else if (file.f_type == DTYPE_SHM) { + if (checkfile == 0) + shmtrans(file.f_data, i, file.f_flag); + } +#endif else { dprintf(stderr, "unknown file type %d for file %d of pid %d\n", @@ -939,6 +947,55 @@ bad: printf("* error\n"); } +void +shmtrans(struct shmfd *shmp, int i, int flag) +{ + struct shmfd shm; + char name[MAXPATHLEN]; + char mode[15]; + char rw[3]; + unsigned j; + + PREFIX(i); + + if (!KVM_READ(shmp, &shm, sizeof(struct shmfd))) { + dprintf(stderr, "can't read shm at %p\n", shmp); + goto bad; + } + + if (shm.shm_path != NULL) { + for (j = 0; j < sizeof(name) - 1; j++) { + if (!KVM_READ(shm.shm_path + j, name + j, 1)) + break; + if (name[j] == '\0') + break; + } + name[j] = '\0'; + } else + name[0] = '\0'; + + rw[0] = '\0'; + if (flag & FREAD) + strcat(rw, "r"); + if (flag & FWRITE) + strcat(rw, "w"); + + shm.shm_mode |= S_IFREG; + if (nflg) { + printf(" "); + (void)snprintf(mode, sizeof(mode), "%o", shm.shm_mode); + } else { + printf(" %-15s", name[0] != '\0' ? name : "-"); + strmode(shm.shm_mode, mode); + } + printf(" %10s %6ju", mode, shm.shm_size); + printf(" %2s\n", rw); + + return; +bad: + printf("* error\n"); +} + /* * Read the cdev structure in the kernel in order to work out the * associated dev_t Modified: stable/8/usr.bin/procstat/procstat_files.c ============================================================================== --- stable/8/usr.bin/procstat/procstat_files.c Wed Jun 6 21:49:31 2012 (r236698) +++ stable/8/usr.bin/procstat/procstat_files.c Wed Jun 6 21:57:03 2012 (r236699) @@ -277,13 +277,6 @@ procstat_files(pid_t pid, struct kinfo_p printf("%7c ", '-'); switch (kif->kf_type) { - case KF_TYPE_VNODE: - case KF_TYPE_FIFO: - case KF_TYPE_PTS: - printf("%-3s ", "-"); - printf("%-18s", kif->kf_path); - break; - case KF_TYPE_SOCKET: printf("%-3s ", protocol_to_string(kif->kf_sock_domain, @@ -312,7 +305,8 @@ procstat_files(pid_t pid, struct kinfo_p default: printf("%-3s ", "-"); - printf("%-18s", "-"); + printf("%-18s", kif->kf_path[0] != '\0' ? + kif->kf_path : "-"); } printf("\n"); From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 02:24:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CDAC1106564A; Thu, 7 Jun 2012 02:24:27 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B83F38FC08; Thu, 7 Jun 2012 02:24:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q572ORSR052843; Thu, 7 Jun 2012 02:24:27 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q572OR72052840; Thu, 7 Jun 2012 02:24:27 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201206070224.q572OR72052840@svn.freebsd.org> From: Kevin Lo Date: Thu, 7 Jun 2012 02:24:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236700 - head/sys/dev/jme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 02:24:27 -0000 Author: kevlo Date: Thu Jun 7 02:24:27 2012 New Revision: 236700 URL: http://svn.freebsd.org/changeset/base/236700 Log: Fix a logic error when use PCIY_PMG capability Reviewed by: yongari Modified: head/sys/dev/jme/if_jme.c Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Wed Jun 6 21:57:03 2012 (r236699) +++ head/sys/dev/jme/if_jme.c Thu Jun 7 02:24:27 2012 (r236700) @@ -1661,7 +1661,7 @@ jme_resume(device_t dev) sc = device_get_softc(dev); JME_LOCK(sc); - if (pci_find_cap(sc->jme_dev, PCIY_PMG, &pmc) != 0) { + if (pci_find_cap(sc->jme_dev, PCIY_PMG, &pmc) == 0) { pmstat = pci_read_config(sc->jme_dev, pmc + PCIR_POWER_STATUS, 2); /* Disable PME clear PME status. */ From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 02:51:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FC0A1065673 for ; Thu, 7 Jun 2012 02:51:49 +0000 (UTC) (envelope-from andy@fud.org.nz) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 36E458FC14 for ; Thu, 7 Jun 2012 02:51:48 +0000 (UTC) Received: by pbbro2 with SMTP id ro2so396459pbb.13 for ; Wed, 06 Jun 2012 19:51:48 -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:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=DuiPtZWVvjxdNcmNfo+vr1fwWrnEBbz8d4PMZcEzGhs=; b=QRpqlwV/GPlAjJzCjkiAyCY+YjbuoOzotkVvgEV6uZ4K9zMtHxpjOxSkPtvtPEuD3z IfeHygyWr48xnAk7m0Nu9pK6dxfqVfYfmDs0b1SvQg7kRpeXqBBeYT+849s/q88dY2Zr 2IQ4wtUtEJgh36EE2tHu3SIvfZo+r1UOwRpI5klhqQgHsDVcqmioZ3or+rCkqysW1zQa WmImDPNrfvV8kRIHj11XthLPTtedNrU3WHHElLRChKz3IaQhAdcx0MtkokHtou4YEWnS eehlR9VhyxlCUPAJDPWkc9F4psLo0b6qZ/jVGzO0cCpzDiARSJ0fwXCH37WvjSXufehc JgBg== MIME-Version: 1.0 Received: by 10.68.190.40 with SMTP id gn8mr3262008pbc.118.1339037508617; Wed, 06 Jun 2012 19:51:48 -0700 (PDT) Sender: andy@fud.org.nz Received: by 10.68.73.161 with HTTP; Wed, 6 Jun 2012 19:51:48 -0700 (PDT) In-Reply-To: <201204261736.q3QHa5qq060172@svn.freebsd.org> References: <201204261736.q3QHa5qq060172@svn.freebsd.org> Date: Thu, 7 Jun 2012 14:51:48 +1200 X-Google-Sender-Auth: vRUw40fRPO-4G7OCk6D2DyjLmWE Message-ID: From: Andrew Thompson To: Jamie Gritton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQkZobVqI6IXSKqXoLN/aE2/TJusPVxz/pE0gG76A9SD6XRhh3DFIvo+EJwaDNy2nrqDtUmv Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234712 - in head: lib/libc/sys usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 02:51:49 -0000 On 27 April 2012 05:36, Jamie Gritton wrote: > Author: jamie > Date: Thu Apr 26 17:36:05 2012 > New Revision: 234712 > URL: http://svn.freebsd.org/changeset/base/234712 > > Log: > =A0A new jail(8) with a configuration file, ultimately to replace the wor= k > =A0currently done by /etc/rc.d/jail. > Is there any further information about this? Is this going to be hooked in to rc.conf? regards, Andrew From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 03:22:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 281E2106564A; Thu, 7 Jun 2012 03:22:21 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 131508FC0C; Thu, 7 Jun 2012 03:22:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q573MKxa055655; Thu, 7 Jun 2012 03:22:20 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q573MKTw055653; Thu, 7 Jun 2012 03:22:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201206070322.q573MKTw055653@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 7 Jun 2012 03:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236701 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 03:22:21 -0000 Author: yongari Date: Thu Jun 7 03:22:20 2012 New Revision: 236701 URL: http://svn.freebsd.org/changeset/base/236701 Log: Fix typo. Submitted by: Alexander Milanov < a <> amilanov dot com > Modified: head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Thu Jun 7 02:24:27 2012 (r236700) +++ head/sys/dev/bge/if_bgereg.h Thu Jun 7 03:22:20 2012 (r236701) @@ -779,11 +779,11 @@ #define BGE_LEDCTL_10MBPS_LED 0x00000008 #define BGE_LEDCTL_TRAFLED_OVERRIDE 0x00000010 #define BGE_LEDCTL_TRAFLED_BLINK 0x00000020 -#define BGE_LEDCTL_TREFLED_BLINK_2 0x00000040 +#define BGE_LEDCTL_TRAFLED_BLINK_2 0x00000040 #define BGE_LEDCTL_1000MBPS_STS 0x00000080 #define BGE_LEDCTL_100MBPS_STS 0x00000100 #define BGE_LEDCTL_10MBPS_STS 0x00000200 -#define BGE_LEDCTL_TRADLED_STS 0x00000400 +#define BGE_LEDCTL_TRAFLED_STS 0x00000400 #define BGE_LEDCTL_BLINKPERIOD 0x7FF80000 #define BGE_LEDCTL_BLINKPERIOD_OVERRIDE 0x80000000 From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 05:35:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FCB11065781; Thu, 7 Jun 2012 05:35:44 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D59FA8FC0A; Thu, 7 Jun 2012 05:35:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q575ZhK3062679; Thu, 7 Jun 2012 05:35:43 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q575ZhbP062677; Thu, 7 Jun 2012 05:35:43 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201206070535.q575ZhbP062677@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 7 Jun 2012 05:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236702 - stable/9/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 05:35:44 -0000 Author: yongari Date: Thu Jun 7 05:35:43 2012 New Revision: 236702 URL: http://svn.freebsd.org/changeset/base/236702 Log: MFC r236371: Remove unnecessary device_printfs. Modified: stable/9/sys/dev/bge/if_bge.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Thu Jun 7 03:22:20 2012 (r236701) +++ stable/9/sys/dev/bge/if_bge.c Thu Jun 7 05:35:43 2012 (r236702) @@ -2800,17 +2800,9 @@ bge_mbox_reorder(struct bge_softc *sc) for (;;) { dev = device_get_parent(bus); bus = device_get_parent(dev); - device_printf(sc->bge_dev, "dev : %s%d, bus : %s%d\n", - device_get_name(dev), device_get_unit(dev), - device_get_name(bus), device_get_unit(bus)); if (device_get_devclass(dev) != pcib) break; for (i = 0; i < nitems(mbox_reorder_lists); i++) { - device_printf(sc->bge_dev, - "probing dev : %s%d, vendor : 0x%04x " - "device : 0x%04x\n", - device_get_name(dev), device_get_unit(dev), - pci_get_vendor(dev), pci_get_device(dev)); if (pci_get_vendor(dev) == mbox_reorder_lists[i].vendor && pci_get_device(dev) == From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 05:37:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 55BA3106564A; Thu, 7 Jun 2012 05:37:47 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 413E28FC14; Thu, 7 Jun 2012 05:37:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q575blLa062809; Thu, 7 Jun 2012 05:37:47 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q575blKn062807; Thu, 7 Jun 2012 05:37:47 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201206070537.q575blKn062807@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 7 Jun 2012 05:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236703 - stable/8/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 05:37:47 -0000 Author: yongari Date: Thu Jun 7 05:37:46 2012 New Revision: 236703 URL: http://svn.freebsd.org/changeset/base/236703 Log: MFC r236371: Remove unnecessary device_printfs. Modified: stable/8/sys/dev/bge/if_bge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Thu Jun 7 05:35:43 2012 (r236702) +++ stable/8/sys/dev/bge/if_bge.c Thu Jun 7 05:37:46 2012 (r236703) @@ -2800,17 +2800,9 @@ bge_mbox_reorder(struct bge_softc *sc) for (;;) { dev = device_get_parent(bus); bus = device_get_parent(dev); - device_printf(sc->bge_dev, "dev : %s%d, bus : %s%d\n", - device_get_name(dev), device_get_unit(dev), - device_get_name(bus), device_get_unit(bus)); if (device_get_devclass(dev) != pcib) break; for (i = 0; i < nitems(mbox_reorder_lists); i++) { - device_printf(sc->bge_dev, - "probing dev : %s%d, vendor : 0x%04x " - "device : 0x%04x\n", - device_get_name(dev), device_get_unit(dev), - pci_get_vendor(dev), pci_get_device(dev)); if (pci_get_vendor(dev) == mbox_reorder_lists[i].vendor && pci_get_device(dev) == From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 06:41:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E92A106566B; Thu, 7 Jun 2012 06:41:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 296FF8FC14; Thu, 7 Jun 2012 06:41:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q576fAsX065719; Thu, 7 Jun 2012 06:41:10 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q576f9P4065717; Thu, 7 Jun 2012 06:41:09 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201206070641.q576f9P4065717@svn.freebsd.org> From: Dimitry Andric Date: Thu, 7 Jun 2012 06:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236704 - stable/9/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 06:41:10 -0000 Author: dim Date: Thu Jun 7 06:41:09 2012 New Revision: 236704 URL: http://svn.freebsd.org/changeset/base/236704 Log: MFC r236571: Make aicasm compile without warnings if -Wpointer-sign is enabled. Modified: stable/9/sys/dev/aic7xxx/aicasm/aicasm.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/aic7xxx/aicasm/aicasm.c ============================================================================== --- stable/9/sys/dev/aic7xxx/aicasm/aicasm.c Thu Jun 7 05:37:46 2012 (r236703) +++ stable/9/sys/dev/aic7xxx/aicasm/aicasm.c Thu Jun 7 06:41:09 2012 (r236704) @@ -530,7 +530,7 @@ output_listing(char *ifilename) int instrptr; unsigned int line; int func_count; - int skip_addr; + unsigned int skip_addr; instrcount = 0; instrptr = 0; From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 08:32:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 613481065670; Thu, 7 Jun 2012 08:32:54 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B9DA8FC20; Thu, 7 Jun 2012 08:32:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q578WsXH070715; Thu, 7 Jun 2012 08:32:54 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q578WsiY070713; Thu, 7 Jun 2012 08:32:54 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201206070832.q578WsiY070713@svn.freebsd.org> From: Martin Matuska Date: Thu, 7 Jun 2012 08:32:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236705 - head/cddl/contrib/opensolaris/lib/libzfs/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 08:32:54 -0000 Author: mm Date: Thu Jun 7 08:32:53 2012 New Revision: 236705 URL: http://svn.freebsd.org/changeset/base/236705 Log: Import Illumos revision 13715:351036203e4b 2803 zfs get guid pretty-prints the output References: https://www.illumos.org/issues/2803 Obtained from: illumos (issue #2803) MFC after: 3 days Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Jun 7 06:41:09 2012 (r236704) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Jun 7 08:32:53 2012 (r236705) @@ -23,6 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2010 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. @@ -2321,6 +2322,17 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop } break; + case ZFS_PROP_GUID: + /* + * GUIDs are stored as numbers, but they are identifiers. + * We don't want them to be pretty printed, because pretty + * printing mangles the ID into a truncated and useless value. + */ + if (get_numeric_property(zhp, prop, src, &source, &val) != 0) + return (-1); + (void) snprintf(propbuf, proplen, "%llu", (u_longlong_t)val); + break; + default: switch (zfs_prop_get_type(prop)) { case PROP_TYPE_NUMBER: From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 09:14:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AC5AC1065670; Thu, 7 Jun 2012 09:14:28 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 979ED8FC1A; Thu, 7 Jun 2012 09:14:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q579ESgW073068; Thu, 7 Jun 2012 09:14:28 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q579ES5u073066; Thu, 7 Jun 2012 09:14:28 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201206070914.q579ES5u073066@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 7 Jun 2012 09:14:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236707 - head/tools/tools/tinybsd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 09:14:28 -0000 Author: bz Date: Thu Jun 7 09:14:28 2012 New Revision: 236707 URL: http://svn.freebsd.org/changeset/base/236707 Log: TinyBSD now seems to be hosted elsewhere. Modified: head/tools/tools/tinybsd/README Modified: head/tools/tools/tinybsd/README ============================================================================== --- head/tools/tools/tinybsd/README Thu Jun 7 08:38:40 2012 (r236706) +++ head/tools/tools/tinybsd/README Thu Jun 7 09:14:28 2012 (r236707) @@ -256,4 +256,4 @@ TinyBSD is still a project under heavy d its documentation. In case you'd like to try or use the BETA version of the script, feel free to -download it from the project's official site at http://www.tinybsd.org. +download it from the project's official site at http://code.google.com/p/tinybsd/. From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 10:05:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B47ED106567C; Thu, 7 Jun 2012 10:05:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CAA18FC22; Thu, 7 Jun 2012 10:05:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q57A5pDd075812; Thu, 7 Jun 2012 10:05:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q57A5pSX075803; Thu, 7 Jun 2012 10:05:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206071005.q57A5pSX075803@svn.freebsd.org> From: Alexander Motin Date: Thu, 7 Jun 2012 10:05:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236712 - in head: share/man/man4 sys/cam sys/cam/scsi sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 10:05:51 -0000 Author: mav Date: Thu Jun 7 10:05:51 2012 New Revision: 236712 URL: http://svn.freebsd.org/changeset/base/236712 Log: To make CAM debugging easier, compile in some debug flags (CAM_DEBUG_INFO, CAM_DEBUG_CDB, CAM_DEBUG_PERIPH and CAM_DEBUG_PROBE) by default. List of these flags can be modified with CAM_DEBUG_COMPILE kernel option. CAMDEBUG kernel option still enables all possible debug, if not overriden. Additional 50KB of kernel size is a good price for the ability to debug problems without rebuilding the kernel. In case where size is important, debugging can be compiled out by setting CAM_DEBUG_COMPILE option to 0. Modified: head/share/man/man4/scsi.4 head/sys/cam/cam_debug.h head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt.h head/sys/cam/scsi/scsi_sa.c head/sys/cam/scsi/scsi_target.c head/sys/conf/NOTES head/sys/conf/options Modified: head/share/man/man4/scsi.4 ============================================================================== --- head/share/man/man4/scsi.4 Thu Jun 7 09:52:48 2012 (r236711) +++ head/share/man/man4/scsi.4 Thu Jun 7 10:05:51 2012 (r236712) @@ -24,7 +24,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd March 4, 2010 +.Dd June 7, 2012 .Dt CAM 4 .Os .Sh NAME @@ -43,6 +43,7 @@ .Cd "options CAM_DEBUG_BUS=-1" .Cd "options CAM_DEBUG_TARGET=-1" .Cd "options CAM_DEBUG_LUN=-1" +.Cd "options CAM_DEBUG_COMPILE=CAM_DEBUG_INFO|CAM_DEBUG_CDB|CAM_DEBUG_PROBE" .Cd "options CAM_DEBUG_FLAGS=CAM_DEBUG_INFO|CAM_DEBUG_CDB" .Cd "options CAM_MAX_HIGHPOWER=4" .Cd "options SCSI_NO_SENSE_STRINGS" @@ -72,12 +73,11 @@ There are a number of generic kernel con subsystem: .Bl -tag -width SCSI_NO_SENSE_STRINGS .It Dv CAMDEBUG -This option enables the +This option compiles in all the .Nm debugging printf code. This will not actually cause any debugging information to be printed out when included by itself. -Enabling printouts requires additional configuration. See below for details. .It Dv "CAM_MAX_HIGHPOWER=4" This sets the maximum allowable number of concurrent "high power" commands. @@ -248,54 +248,53 @@ see other .Nm device entries. .Sh DIAGNOSTICS -When the kernel is compiled with options CAMDEBUG, an XPT_DEBUG CCB can be -used to enable various amounts of tracing information on any -specific device. -Devices not being traced will not produce trace information. -There are currently four debugging flags that may be turned on: +An XPT_DEBUG CCB can be used to enable various amounts of tracing information +on any specific bus/device from the list of options compiled into the kernel. +There are currently seven debugging flags that may be compiled in and used: .Bl -tag -width CAM_DEBUG_SUBTRACE .It Dv CAM_DEBUG_INFO -This debugging flag enables general informational printfs for the device +This flag enables general informational printfs for the device or devices in question. .It Dv CAM_DEBUG_TRACE -This debugging flag enables function-level command flow tracing. +This flag enables function-level command flow tracing. i.e.\& kernel printfs will happen at the entrance and exit of various functions. .It Dv CAM_DEBUG_SUBTRACE -This debugging flag enables debugging output internal to various functions. +This flag enables debugging output internal to various functions. .It Dv CAM_DEBUG_CDB -This debugging flag will cause the kernel to print out all +This flag will cause the kernel to print out all +.Tn ATA +and .Tn SCSI commands sent to a particular device or devices. +.It Dv CAM_DEBUG_XPT +This flag will enable command scheduler tracing. +.It Dv CAM_DEBUG_PERIPH +This flag will enable peripheral drivers messages. +.It Dv CAM_DEBUG_PROBE +This flag will enable devices probe process tracing. .El .Pp Some of these flags, most notably .Dv CAM_DEBUG_TRACE and -.Dv CAM_DEBUG_SUBTRACE -will produce kernel printfs in EXTREME numbers, -and because of that, they are not especially useful. -There are not many things logged at the -.Dv CAM_DEBUG_INFO -level, so it is not especially useful. -The most useful debugging flag is the -.Dv CAM_DEBUG_CDB -flag. +.Dv CAM_DEBUG_SUBTRACE , +will produce kernel printfs in EXTREME numbers. +.Pp Users can enable debugging from their kernel config file, by using the following kernel config options: -.Bl -tag -width CAM_DEBUG_TARGET +.Bl -tag -width CAM_DEBUG_COMPILE .It Dv CAMDEBUG -This enables +This builds into the kernel all possible .Nm debugging. -Without this option, users will not even be able -to turn on debugging from userland via -.Xr camcontrol 8 . -.It Dv CAM_DEBUG_FLAGS -This allows the user to set the various debugging flags described above -in a kernel config file. +.It Dv CAM_DEBUG_COMPILE +This allows to specify support for which debugging flags described above +should be built into the kernel. Flags may be ORed together if the user wishes to see printfs for multiple debugging levels. +.It Dv CAM_DEBUG_FLAGS +This allows to set the various debugging flags from a kernel config file. .It Dv CAM_DEBUG_BUS Specify a bus to debug. To debug all busses, set this to -1. @@ -307,17 +306,9 @@ Specify a lun to debug. To debug all luns, set this to -1. .El .Pp -When specifying a bus, target or lun to debug, you -.Em MUST -specify all three bus/target/lun options above. -Using wildcards, you -should be able to enable debugging on most anything. -.Pp -Users may also enable debugging printfs on the fly, if the -.Dv CAMDEBUG -option is their config file, by using the +Users may also enable debugging on the fly by using the .Xr camcontrol 8 -utility. +utility, if wanted options built into the kernel. See .Xr camcontrol 8 for details. Modified: head/sys/cam/cam_debug.h ============================================================================== --- head/sys/cam/cam_debug.h Thu Jun 7 09:52:48 2012 (r236711) +++ head/sys/cam/cam_debug.h Thu Jun 7 10:05:51 2012 (r236712) @@ -44,7 +44,35 @@ typedef enum { CAM_DEBUG_PROBE = 0x40 /* print out probe actions */ } cam_debug_flags; -#if defined(CAMDEBUG) && defined(_KERNEL) +#if defined(_KERNEL) + +#ifndef CAM_DEBUG_FLAGS +#define CAM_DEBUG_FLAGS CAM_DEBUG_NONE +#endif + +#ifndef CAM_DEBUG_COMPILE +#ifdef CAMDEBUG +#define CAM_DEBUG_COMPILE (-1) +#else +#define CAM_DEBUG_COMPILE (CAM_DEBUG_INFO | CAM_DEBUG_CDB | \ + CAM_DEBUG_PERIPH | CAM_DEBUG_PROBE | \ + CAM_DEBUG_FLAGS) +#endif +#endif + +#ifndef CAM_DEBUG_BUS +#define CAM_DEBUG_BUS (-1) +#endif +#ifndef CAM_DEBUG_TARGET +#define CAM_DEBUG_TARGET (-1) +#endif +#ifndef CAM_DEBUG_LUN +#define CAM_DEBUG_LUN (-1) +#endif + +#ifndef CAM_DEBUG_DELAY +#define CAM_DEBUG_DELAY 0 +#endif /* Path we want to debug */ extern struct cam_path *cam_dpath; @@ -52,48 +80,48 @@ extern struct cam_path *cam_dpath; extern u_int32_t cam_dflags; /* Printf delay value (to prevent scrolling) */ extern u_int32_t cam_debug_delay; - + /* Debugging macros. */ #define CAM_DEBUGGED(path, flag) \ - ((cam_dflags & (flag)) \ + (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags) \ && (cam_dpath != NULL) \ && (xpt_path_comp(cam_dpath, path) >= 0) \ && (xpt_path_comp(cam_dpath, path) < 2)) #define CAM_DEBUG(path, flag, printfargs) \ - if ((cam_dflags & (flag)) \ + if (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags) \ && (cam_dpath != NULL) \ && (xpt_path_comp(cam_dpath, path) >= 0) \ && (xpt_path_comp(cam_dpath, path) < 2)) { \ xpt_print_path(path); \ - printf printfargs; \ + printf printfargs; \ if (cam_debug_delay != 0) \ DELAY(cam_debug_delay); \ } #define CAM_DEBUG_PRINT(flag, printfargs) \ - if (cam_dflags & (flag)) { \ + if (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags)) { \ printf("cam_debug: "); \ - printf printfargs; \ + printf printfargs; \ if (cam_debug_delay != 0) \ DELAY(cam_debug_delay); \ } #define CAM_DEBUG_PATH_PRINT(flag, path, printfargs) \ - if (cam_dflags & (flag)) { \ + if (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags)) { \ xpt_print(path, "cam_debug: "); \ - printf printfargs; \ + printf printfargs; \ if (cam_debug_delay != 0) \ DELAY(cam_debug_delay); \ } -#else /* !CAMDEBUG || !_KERNEL */ +#else /* !_KERNEL */ #define CAM_DEBUGGED(A, B) 0 #define CAM_DEBUG(A, B, C) #define CAM_DEBUG_PRINT(A, B) #define CAM_DEBUG_PATH_PRINT(A, B, C) -#endif /* CAMDEBUG && _KERNEL */ +#endif /* _KERNEL */ #endif /* _CAM_CAM_DEBUG_H */ Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Thu Jun 7 09:52:48 2012 (r236711) +++ head/sys/cam/cam_xpt.c Thu Jun 7 10:05:51 2012 (r236712) @@ -188,21 +188,15 @@ static struct cdevsw xpt_cdevsw = { }; /* Storage for debugging datastructures */ -#ifdef CAMDEBUG struct cam_path *cam_dpath; -#ifdef CAM_DEBUG_FLAGS u_int32_t cam_dflags = CAM_DEBUG_FLAGS; -#else -u_int32_t cam_dflags = CAM_DEBUG_NONE; -#endif TUNABLE_INT("kern.cam.dflags", &cam_dflags); SYSCTL_UINT(_kern_cam, OID_AUTO, dflags, CTLFLAG_RW, - &cam_dflags, 0, "Cam Debug Flags"); -u_int32_t cam_debug_delay; + &cam_dflags, 0, "Enabled debug flags"); +u_int32_t cam_debug_delay = CAM_DEBUG_DELAY; TUNABLE_INT("kern.cam.debug_delay", &cam_debug_delay); SYSCTL_UINT(_kern_cam, OID_AUTO, debug_delay, CTLFLAG_RW, - &cam_debug_delay, 0, "Cam Debug Flags"); -#endif + &cam_debug_delay, 0, "Delay in us after each debug message"); /* Our boot-time initialization hook */ static int cam_module_event_handler(module_t, int /*modeventtype_t*/, void *); @@ -2472,9 +2466,7 @@ xpt_action(union ccb *start_ccb) void xpt_action_default(union ccb *start_ccb) { -#ifdef CAMDEBUG char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1]; -#endif struct cam_path *path; path = start_ccb->ccb_h.path; @@ -2980,16 +2972,17 @@ xpt_action_default(union ccb *start_ccb) break; } case XPT_DEBUG: { -#ifdef CAMDEBUG -#ifdef CAM_DEBUG_DELAY - cam_debug_delay = CAM_DEBUG_DELAY; -#endif + /* Check that all request bits are supported. */ + if (start_ccb->cdbg.flags & ~CAM_DEBUG_COMPILE) { + start_ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; + break; + } + cam_dflags = start_ccb->cdbg.flags; if (cam_dpath != NULL) { xpt_free_path(cam_dpath); cam_dpath = NULL; } - if (cam_dflags != CAM_DEBUG_NONE) { if (xpt_create_path(&cam_dpath, xpt_periph, start_ccb->ccb_h.path_id, @@ -3007,9 +3000,6 @@ xpt_action_default(union ccb *start_ccb) cam_dpath = NULL; start_ccb->ccb_h.status = CAM_REQ_CMP; } -#else /* !CAMDEBUG */ - start_ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; -#endif /* CAMDEBUG */ break; } case XPT_FREEZE_QUEUE: @@ -4760,9 +4750,7 @@ xpt_config(void *arg) * Now that interrupts are enabled, go find our devices */ -#ifdef CAMDEBUG - /* Setup debugging flags and path */ -#ifdef CAM_DEBUG_BUS + /* Setup debugging path */ if (cam_dflags != CAM_DEBUG_NONE) { /* * Locking is specifically omitted here. No SIMs have @@ -4779,10 +4767,6 @@ xpt_config(void *arg) } } else cam_dpath = NULL; -#else /* !CAM_DEBUG_BUS */ - cam_dpath = NULL; -#endif /* CAM_DEBUG_BUS */ -#endif /* CAMDEBUG */ periphdriver_init(1); xpt_hold_boot(); Modified: head/sys/cam/cam_xpt.h ============================================================================== --- head/sys/cam/cam_xpt.h Thu Jun 7 09:52:48 2012 (r236711) +++ head/sys/cam/cam_xpt.h Thu Jun 7 10:05:51 2012 (r236712) @@ -63,28 +63,6 @@ struct async_node { SLIST_HEAD(async_list, async_node); SLIST_HEAD(periph_list, cam_periph); -#if defined(CAM_DEBUG_FLAGS) && !defined(CAMDEBUG) -#error "You must have options CAMDEBUG to use options CAM_DEBUG_FLAGS" -#endif - -/* - * In order to enable the CAM_DEBUG_* options, the user must have CAMDEBUG - * enabled. Also, the user must have either none, or all of CAM_DEBUG_BUS, - * CAM_DEBUG_TARGET, and CAM_DEBUG_LUN specified. - */ -#if defined(CAM_DEBUG_BUS) || defined(CAM_DEBUG_TARGET) \ - || defined(CAM_DEBUG_LUN) -#ifdef CAMDEBUG -#if !defined(CAM_DEBUG_BUS) || !defined(CAM_DEBUG_TARGET) \ - || !defined(CAM_DEBUG_LUN) -#error "You must define all or none of CAM_DEBUG_BUS, CAM_DEBUG_TARGET \ - and CAM_DEBUG_LUN" -#endif /* !CAM_DEBUG_BUS || !CAM_DEBUG_TARGET || !CAM_DEBUG_LUN */ -#else /* !CAMDEBUG */ -#error "You must use options CAMDEBUG if you use the CAM_DEBUG_* options" -#endif /* CAMDEBUG */ -#endif /* CAM_DEBUG_BUS || CAM_DEBUG_TARGET || CAM_DEBUG_LUN */ - void xpt_action(union ccb *new_ccb); void xpt_action_default(union ccb *new_ccb); union ccb *xpt_alloc_ccb(void); Modified: head/sys/cam/scsi/scsi_sa.c ============================================================================== --- head/sys/cam/scsi/scsi_sa.c Thu Jun 7 09:52:48 2012 (r236711) +++ head/sys/cam/scsi/scsi_sa.c Thu Jun 7 10:05:51 2012 (r236712) @@ -1482,10 +1482,6 @@ saregister(struct cam_periph *periph, vo softc->quirks = ((struct sa_quirk_entry *)match)->quirks; softc->last_media_blksize = ((struct sa_quirk_entry *)match)->prefblk; -#ifdef CAMDEBUG - xpt_print(periph->path, "found quirk entry %d\n", - (int) (((struct sa_quirk_entry *) match) - sa_quirk_table)); -#endif } else softc->quirks = SA_QUIRK_NONE; @@ -1798,13 +1794,11 @@ sadone(struct cam_periph *periph, union */ if (error || (softc->flags & SA_FLAG_ERR_PENDING)) cam_release_devq(done_ccb->ccb_h.path, 0, 0, 0, 0); -#ifdef CAMDEBUG if (error || bp->bio_resid) { CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("error %d resid %ld count %ld\n", error, bp->bio_resid, bp->bio_bcount)); } -#endif biofinish(bp, softc->device_stats, 0); break; } Modified: head/sys/cam/scsi/scsi_target.c ============================================================================== --- head/sys/cam/scsi/scsi_target.c Thu Jun 7 09:52:48 2012 (r236711) +++ head/sys/cam/scsi/scsi_target.c Thu Jun 7 10:05:51 2012 (r236712) @@ -266,7 +266,6 @@ targioctl(struct cdev *dev, u_long cmd, break; case TARGIOCDEBUG: { -#ifdef CAMDEBUG struct ccb_debug cdbg; /* If no periph available, disallow debugging changes */ @@ -287,9 +286,6 @@ targioctl(struct cdev *dev, u_long cmd, xpt_action((union ccb *)&cdbg); cam_periph_unlock(softc->periph); status = cdbg.ccb_h.status & CAM_STATUS_MASK; -#else - status = CAM_FUNC_NOTAVAIL; -#endif break; } default: Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Jun 7 09:52:48 2012 (r236711) +++ head/sys/conf/NOTES Thu Jun 7 10:05:51 2012 (r236712) @@ -1305,14 +1305,13 @@ device ctl #CAM Target Layer # CAM OPTIONS: # debugging options: -# -- NOTE -- If you specify one of the bus/target/lun options, you must -# specify them all! -# CAMDEBUG: When defined enables debugging macros -# CAM_DEBUG_BUS: Debug the given bus. Use -1 to debug all busses. -# CAM_DEBUG_TARGET: Debug the given target. Use -1 to debug all targets. -# CAM_DEBUG_LUN: Debug the given lun. Use -1 to debug all luns. -# CAM_DEBUG_FLAGS: OR together CAM_DEBUG_INFO, CAM_DEBUG_TRACE, -# CAM_DEBUG_SUBTRACE, and CAM_DEBUG_CDB +# CAMDEBUG Compile in all possible debugging. +# CAM_DEBUG_COMPILE Debug levels to compile in. +# CAM_DEBUG_FLAGS Debug levels to enable on boot. +# CAM_DEBUG_BUS Limit debugging to the given bus. +# CAM_DEBUG_TARGET Limit debugging to the given target. +# CAM_DEBUG_LUN Limit debugging to the given lun. +# CAM_DEBUG_DELAY Delay in us after printing each debug line. # # CAM_MAX_HIGHPOWER: Maximum number of concurrent high power (start unit) cmds # SCSI_NO_SENSE_STRINGS: When defined disables sense descriptions @@ -1323,10 +1322,12 @@ device ctl #CAM Target Layer # can be changed at boot and runtime with the # kern.cam.scsi_delay tunable/sysctl. options CAMDEBUG +options CAM_DEBUG_COMPILE=-1 +options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_DEBUG_PERIPH) options CAM_DEBUG_BUS=-1 options CAM_DEBUG_TARGET=-1 options CAM_DEBUG_LUN=-1 -options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_TRACE|CAM_DEBUG_CDB) +options CAM_DEBUG_DELAY=1 options CAM_MAX_HIGHPOWER=4 options SCSI_NO_SENSE_STRINGS options SCSI_NO_OP_STRINGS Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Jun 7 09:52:48 2012 (r236711) +++ head/sys/conf/options Thu Jun 7 10:05:51 2012 (r236712) @@ -306,6 +306,7 @@ MAXSSIZ opt_param.h # Generic SCSI options. CAM_MAX_HIGHPOWER opt_cam.h CAMDEBUG opt_cam.h +CAM_DEBUG_COMPILE opt_cam.h CAM_DEBUG_DELAY opt_cam.h CAM_DEBUG_BUS opt_cam.h CAM_DEBUG_TARGET opt_cam.h From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 10:53:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 907BF1065689; Thu, 7 Jun 2012 10:53:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70B218FC1B; Thu, 7 Jun 2012 10:53:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q57ArhDe083603; Thu, 7 Jun 2012 10:53:43 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q57Arhb9083600; Thu, 7 Jun 2012 10:53:43 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206071053.q57Arhb9083600@svn.freebsd.org> From: Alexander Motin Date: Thu, 7 Jun 2012 10:53:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236713 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 10:53:43 -0000 Author: mav Date: Thu Jun 7 10:53:42 2012 New Revision: 236713 URL: http://svn.freebsd.org/changeset/base/236713 Log: Add CAM_DEBUG_INFO debug messages for periph created/invalidated/destroyed and for asyncs sent. Modified: head/sys/cam/cam_periph.c head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Thu Jun 7 10:05:51 2012 (r236712) +++ head/sys/cam/cam_periph.c Thu Jun 7 10:53:42 2012 (r236713) @@ -240,6 +240,7 @@ cam_periph_alloc(periph_ctor_t *periph_c goto failure; init_level++; + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph created\n")); status = periph_ctor(periph, arg); @@ -252,6 +253,7 @@ failure: /* Initialized successfully */ break; case 3: + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n")); xpt_remove_periph(periph); /* FALLTHROUGH */ case 2: @@ -572,6 +574,7 @@ void cam_periph_invalidate(struct cam_periph *periph) { + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph invalidated\n")); /* * We only call this routine the first time a peripheral is * invalidated. @@ -610,6 +613,7 @@ camperiphfree(struct cam_periph *periph) if (periph->periph_dtor != NULL) periph->periph_dtor(periph); xpt_remove_periph(periph); + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n")); if (periph->flags & CAM_PERIPH_NEW_DEV_FOUND) { union ccb ccb; Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Thu Jun 7 10:05:51 2012 (r236712) +++ head/sys/cam/cam_xpt.c Thu Jun 7 10:53:42 2012 (r236713) @@ -2973,7 +2973,7 @@ xpt_action_default(union ccb *start_ccb) } case XPT_DEBUG: { /* Check that all request bits are supported. */ - if (start_ccb->cdbg.flags & ~CAM_DEBUG_COMPILE) { + if (start_ccb->cdbg.flags & ~(CAM_DEBUG_COMPILE)) { start_ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; break; } @@ -4033,6 +4033,28 @@ xptpathid(const char *sim_name, int sim_ return (pathid); } +static const char * +xpt_async_string(u_int32_t async_code) +{ + + switch (async_code) { + case AC_BUS_RESET: return ("AC_BUS_RESET"); + case AC_UNSOL_RESEL: return ("AC_UNSOL_RESEL"); + case AC_SCSI_AEN: return ("AC_SCSI_AEN"); + case AC_SENT_BDR: return ("AC_SENT_BDR"); + case AC_PATH_REGISTERED: return ("AC_PATH_REGISTERED"); + case AC_PATH_DEREGISTERED: return ("AC_PATH_DEREGISTERED"); + case AC_FOUND_DEVICE: return ("AC_FOUND_DEVICE"); + case AC_LOST_DEVICE: return ("AC_LOST_DEVICE"); + case AC_TRANSFER_NEG: return ("AC_TRANSFER_NEG"); + case AC_INQ_CHANGED: return ("AC_INQ_CHANGED"); + case AC_GETDEV_CHANGED: return ("AC_GETDEV_CHANGED"); + case AC_CONTRACT: return ("AC_CONTRACT"); + case AC_ADVINFO_CHANGED: return ("AC_ADVINFO_CHANGED"); + } + return ("AC_UNKNOWN"); +} + void xpt_async(u_int32_t async_code, struct cam_path *path, void *async_arg) { @@ -4041,8 +4063,8 @@ xpt_async(u_int32_t async_code, struct c struct cam_ed *device, *next_device; mtx_assert(path->bus->sim->mtx, MA_OWNED); - - CAM_DEBUG(path, CAM_DEBUG_TRACE, ("xpt_async\n")); + CAM_DEBUG(path, CAM_DEBUG_TRACE | CAM_DEBUG_INFO, + ("xpt_async(%s)\n", xpt_async_string(async_code))); /* * Most async events come from a CAM interrupt context. In From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 13:26:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6CED8106566C; Thu, 7 Jun 2012 13:26:55 +0000 (UTC) (envelope-from bjk@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 524388FC0C; Thu, 7 Jun 2012 13:26:55 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q57DQtdm053814; Thu, 7 Jun 2012 13:26:55 GMT (envelope-from bjk@freebsd.org) Received: from localhost (bjk@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) with ESMTP id q57DQtc0053810; Thu, 7 Jun 2012 13:26:55 GMT (envelope-from bjk@freebsd.org) X-Authentication-Warning: freefall.freebsd.org: bjk owned process doing -bs Date: Thu, 7 Jun 2012 13:26:55 +0000 (UTC) From: Benjamin Kaduk To: Alexander Motin In-Reply-To: <201206071005.q57A5pSX075803@svn.freebsd.org> Message-ID: References: <201206071005.q57A5pSX075803@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r236712 - in head: share/man/man4 sys/cam sys/cam/scsi sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 13:26:55 -0000 On Thu, 7 Jun 2012, Alexander Motin wrote: > Author: mav > Date: Thu Jun 7 10:05:51 2012 > New Revision: 236712 > URL: http://svn.freebsd.org/changeset/base/236712 > > Log: > To make CAM debugging easier, compile in some debug flags (CAM_DEBUG_INFO, > CAM_DEBUG_CDB, CAM_DEBUG_PERIPH and CAM_DEBUG_PROBE) by default. > List of these flags can be modified with CAM_DEBUG_COMPILE kernel option. > CAMDEBUG kernel option still enables all possible debug, if not overriden. > > Additional 50KB of kernel size is a good price for the ability to debug > problems without rebuilding the kernel. In case where size is important, > debugging can be compiled out by setting CAM_DEBUG_COMPILE option to 0. Hmm, it looks like re@ will want to add this to the list of things to remove from GENERIC for building release kernels. Is that true? -Ben From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 13:40:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DD7B9106566B; Thu, 7 Jun 2012 13:40:32 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id C65BF8FC08; Thu, 7 Jun 2012 13:40:31 +0000 (UTC) Received: by bkvi18 with SMTP id i18so688095bkv.13 for ; Thu, 07 Jun 2012 06:40:30 -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=WSxyizr3j74vwBopdDqDmW+KS+kEUVQ+ve2ZLM+MzYM=; b=xmxva64kkn/xUafrobg0slZEoTrSKWsjwLhqEqh0H+MqfA8wTMq59E8np2j4//MXXL ulIgJreboLRZFf7K1b9wISFqvAF+Uu/xjcVOfdEo/f3fPq/CefpwD2JDyFmMnboKuhNT efpTM9Hzi7G0hMhO8bPIs0CCyhxl5sEwwtr7DIobbX2EVbZsAZlTetgtHX129y6cPZ0/ oVRHk5q3lfDXXG47KSBnxLRKvJme+4UCwUuni/EuF8XL/ZTzic0L34ElSfdbkqZ0UkAS mhA/7F4m8WTNDaE2vku0bMX23GcLNtqw74q024FTG8vyUTTF+o3X2yvmtw8MZa4AyHbM 7ZcA== Received: by 10.204.151.200 with SMTP id d8mr1620277bkw.82.1339076430647; Thu, 07 Jun 2012 06:40:30 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226]) by mx.google.com with ESMTPS id iq16sm3872839bkc.6.2012.06.07.06.40.28 (version=SSLv3 cipher=OTHER); Thu, 07 Jun 2012 06:40:29 -0700 (PDT) Sender: Alexander Motin Message-ID: <4FD0AF4A.3070703@FreeBSD.org> Date: Thu, 07 Jun 2012 16:40:26 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120506 Thunderbird/12.0.1 MIME-Version: 1.0 To: Benjamin Kaduk References: <201206071005.q57A5pSX075803@svn.freebsd.org> In-Reply-To: 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, src-committers@freebsd.org Subject: Re: svn commit: r236712 - in head: share/man/man4 sys/cam sys/cam/scsi sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 13:40:33 -0000 On 06/07/12 16:26, Benjamin Kaduk wrote: > On Thu, 7 Jun 2012, Alexander Motin wrote: > >> Author: mav >> Date: Thu Jun 7 10:05:51 2012 >> New Revision: 236712 >> URL: http://svn.freebsd.org/changeset/base/236712 >> >> Log: >> To make CAM debugging easier, compile in some debug flags >> (CAM_DEBUG_INFO, >> CAM_DEBUG_CDB, CAM_DEBUG_PERIPH and CAM_DEBUG_PROBE) by default. >> List of these flags can be modified with CAM_DEBUG_COMPILE kernel option. >> CAMDEBUG kernel option still enables all possible debug, if not >> overriden. >> >> Additional 50KB of kernel size is a good price for the ability to debug >> problems without rebuilding the kernel. In case where size is important, >> debugging can be compiled out by setting CAM_DEBUG_COMPILE option to 0. > > Hmm, it looks like re@ will want to add this to the list of things to > remove from GENERIC for building release kernels. Is that true? I don't think so. That only enables compilation of some debugging printf. It changes nothing in CAM behavior until user explicitly enable some of that through the loader tunables, sysctl or `camcontrol debug` command. It it like bootverbose, not like INVARIANTS. We are not blocking bootverbose on releases. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 14:02:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79A841065670; Thu, 7 Jun 2012 14:02:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 648DB8FC15; Thu, 7 Jun 2012 14:02:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q57E2810092040; Thu, 7 Jun 2012 14:02:08 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q57E283A092038; Thu, 7 Jun 2012 14:02:08 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206071402.q57E283A092038@svn.freebsd.org> From: John Baldwin Date: Thu, 7 Jun 2012 14:02:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236714 - stable/8/usr.bin/fstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 14:02:08 -0000 Author: jhb Date: Thu Jun 7 14:02:07 2012 New Revision: 236714 URL: http://svn.freebsd.org/changeset/base/236714 Log: Correct the format specifier for shm_size. shm_size is a size_t unlike the uint64_t size field in libprocstat's shmstat structure in 9.x and later. Pointy hat to: jhb Modified: stable/8/usr.bin/fstat/fstat.c Modified: stable/8/usr.bin/fstat/fstat.c ============================================================================== --- stable/8/usr.bin/fstat/fstat.c Thu Jun 7 10:53:42 2012 (r236713) +++ stable/8/usr.bin/fstat/fstat.c Thu Jun 7 14:02:07 2012 (r236714) @@ -988,7 +988,7 @@ shmtrans(struct shmfd *shmp, int i, int printf(" %-15s", name[0] != '\0' ? name : "-"); strmode(shm.shm_mode, mode); } - printf(" %10s %6ju", mode, shm.shm_size); + printf(" %10s %6zu", mode, shm.shm_size); printf(" %2s\n", rw); return; From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 14:03:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50A551065672; Thu, 7 Jun 2012 14:03:21 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 397568FC1B; Thu, 7 Jun 2012 14:03:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q57E3L0N092124; Thu, 7 Jun 2012 14:03:21 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q57E3LtK092121; Thu, 7 Jun 2012 14:03:21 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201206071403.q57E3LtK092121@svn.freebsd.org> From: Andrew Gallatin Date: Thu, 7 Jun 2012 14:03:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236715 - stable/7/sys/dev/mxge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 14:03:21 -0000 Author: gallatin Date: Thu Jun 7 14:03:20 2012 New Revision: 236715 URL: http://svn.freebsd.org/changeset/base/236715 Log: MFC 236212: Update mxge(4) firmware to the latest version available from Myricom (1.4.55). Sponored by: Myricom, Inc. Modified: stable/7/sys/dev/mxge/eth_z8e.h stable/7/sys/dev/mxge/ethp_z8e.h stable/7/sys/dev/mxge/rss_eth_z8e.h stable/7/sys/dev/mxge/rss_ethp_z8e.h Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/mxge/eth_z8e.h ============================================================================== --- stable/7/sys/dev/mxge/eth_z8e.h Thu Jun 7 14:02:07 2012 (r236714) +++ stable/7/sys/dev/mxge/eth_z8e.h Thu Jun 7 14:03:20 2012 (r236715) @@ -1,6 +1,6 @@ /******************************************************************************* -Copyright (c) 2006-2011, Myricom Inc. +Copyright (c) 2006-2012, Myricom Inc. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -28,7495 +28,7547 @@ POSSIBILITY OF SUCH DAMAGE. $FreeBSD$ ***************************************************************************/ -static unsigned int eth_z8e_uncompressed_length = 375636 ; -static unsigned int eth_z8e_length = 119802 ; -static unsigned char eth_z8e[119802 + 1] = - "\x78\x9c\xec\xbd\x7f\x78\x54\xd5\xb5\x3f\xbc\x32\x99\xc8\x24\x06" - "\x26\x62\xc4\x29\xc5\x76\xb0\x41\xa3\x05\x89\x16\xdb\xd4\x42\x0d" - "\x02\x1a\x2c\xbf\x14\x6c\xa3\xa2\x09\x1a\xe8\xa0\x11\x22\x44\x18" - "\x20\x64\xc2\x80\x36\x41\x20\xa9\xa0\x46\x09\x09\xbd\xf2\x23\x56" - "\xac\xd8\x02\x62\x45\x19\x24\xf6\x4b\x7b\x93\x0c\xed\x8b\xf7\x9b" - "\xdb\x17\x6f\x47\x6e\x84\x94\x1b\x60\x4a\x06\x32\x26\x33\x67\xbf" - "\x9f\xb5\xf7\x39\xc9\xcc\x30\x41\xb9\xf7\x3e\xcf\xfb\x4f\xf3\x3c" - "\x93\x73\xce\x3e\x7b\xaf\xbd\xf6\xda\x6b\xad\xbd\xf6\xde\x6b\xaf" - "\x43\x74\xe5\x7f\x3e\xb2\xf0\x25\x81\x4c\x07\x8a\x0f\xfd\x37\xca" - "\xff\xf3\xef\x9f\x7f\xff\xfc\xfb\xe7\xdf\x3f\xff\xfe\xf9\xf7\xcf" - "\xbf\xff\x7f\xff\xfc\x09\x34\xe6\xbc\xc9\x4c\x1f\x57\x13\x75\xb9" - "\x2d\xc3\x7c\xa4\x15\xbd\xba\x51\x84\xf0\x2a\x01\xe3\xfc\x30\xbe" - "\xf2\xef\x25\xa4\x99\xaa\xc9\x72\x63\x1a\xa5\x89\x57\x6d\xa6\x09" - "\x5b\x88\x36\x0d\x11\x1d\x1b\x5f\x11\xfe\xc6\x52\xa2\xc3\xdb\xf0" - "\xfc\x8a\x68\xdf\x38\x44\x04\x00\xa7\xc0\x47\xf9\x9b\x18\xce\x6a" - "\x3c\xaf\x46\x3a\xd2\x4a\x7c\x54\xb0\x86\xd3\xaa\x50\xce\x48\xf7" - "\xae\xb9\x48\x8d\xf6\x10\x55\x31\x1c\x7b\x98\x26\x0e\x97\x78\x6c" - "\x45\xde\x54\xce\xbb\x6a\x08\xea\x4d\x27\x72\xbf\x22\x82\x11\x38" - "\x58\xb8\x1e\xae\x5b\xcf\x7f\x34\xa6\x3e\x3f\xd2\xda\x8c\xfa\xfa" - "\x81\x91\xc6\xe5\xb9\x0d\xf6\x6f\x51\xe2\x49\xba\xfa\x3a\x86\xc9" - "\xb8\x09\x37\x59\xbc\xdd\x21\x3a\x49\xc9\x99\x9d\x6e\x4a\x3c\x0c" - "\x6a\x6c\x78\x45\xa6\x27\x7a\x03\x21\xb2\x97\x51\x02\xde\x4d\xc5" - "\xd5\x84\x72\x03\x99\x3e\x33\x6b\x29\x83\xeb\x06\x5c\xb3\x30\x79" - "\x12\xea\x07\x13\x31\x8d\x02\x26\xba\x39\xe0\xa6\x84\x2e\x77\x32" - "\xda\x6f\xc9\x94\xed\x47\xbd\x28\x6b\x3e\x49\x29\xff\x30\x21\x3f" - "\xea\xf4\xdb\x97\x33\x0e\x29\x9f\x08\xb7\xc7\x64\xc0\xd1\xdc\x9e" - "\xab\xeb\x5e\x22\xea\x74\x9b\x26\x07\x4c\x56\xa1\xc3\x39\x60\xc0" - "\xe1\x7c\xa8\x2b\x95\xeb\xea\x74\x9b\x5f\x8a\xc8\xe3\x33\xf2\x00" - "\x6f\xff\xe8\x00\x25\x32\xce\x27\x28\x25\x9b\xeb\xd3\xdb\x62\xe6" - "\x3a\xbc\x4b\x42\xe4\x45\xdf\xa3\xee\x74\xb4\xd5\x7e\x38\x48\x04" - "\x98\xd7\xd4\x97\x11\x31\x7c\xe0\x6f\x57\x30\x53\xc6\x18\x30\x19" - "\x46\x6f\x5b\xdd\x9e\xc1\xf5\x12\x47\x6e\xab\x85\xf4\xbc\x05\x91" - "\x38\x32\x5c\xb4\xe5\x7a\x6e\x4b\x23\x38\x4a\xcf\xb3\xa6\x97\x1e" - "\xbd\xed\xbf\x3a\x27\x06\xb6\x4d\xc1\x4e\x00\xec\x04\x8f\x5e\xae" - "\xb7\xfd\xbe\x98\xfc\x2a\x6f\x5a\x72\xc0\x24\x74\x3a\xa4\xb4\xf7" - "\xe5\x4d\xde\x14\x99\x17\xf8\x98\x14\x6d\xc9\xe4\xa3\x94\x56\xb4" - "\x33\x11\x79\xa6\xa0\x1f\xed\xfa\xfb\xeb\xf4\xf7\x36\xbc\xbb\x5b" - "\xc1\xbb\x3a\x3b\x02\x5e\x1a\xc3\x8b\xe4\x2d\x25\x51\x66\xfc\x92" - "\x60\x20\x5f\x85\xdf\x00\x8b\xc1\x6f\x8b\x6d\x42\x73\x7d\x03\x6d" - "\x5a\xbb\x1d\xb4\x10\xe4\x75\x06\xc9\x3e\x94\x5c\x27\xe8\xea\xdd" - "\x80\x4f\x1b\x96\x93\xc5\x55\x2c\x82\x5e\x67\x07\xb5\xf8\x3b\xc8" - "\xe5\x87\x6c\x84\x2e\x50\xd9\x05\xf0\x62\xe8\x0c\x95\x3d\x4b\xb6" - "\xc6\xd2\x2f\x28\x1e\x2f\x6b\x26\x41\xae\x61\x5c\xb6\x8d\x5a\x6a" - "\xdb\xc8\x55\x1b\x5d\xd6\x75\x03\xd9\x9a\xf1\x8c\x3e\xb7\x32\x1e" - "\x2c\x6f\xa1\x94\xed\xf6\xd2\xd7\xc8\xec\x1a\x4e\xa6\xe6\x42\x8f" - "\x8e\x4b\xaa\x93\x71\x59\x73\x9a\x2c\x6f\xcc\x03\x1f\x9e\x66\x7c" - "\xdf\xb6\xbf\xb3\x3c\x68\x3a\x6c\x9b\x42\x87\x6d\xc7\xa9\xd1\x36" - "\x8e\x1a\x9d\x13\x69\xc3\x69\x4a\x3d\x1c\x1c\x4b\x8d\xe6\x7b\xa9" - "\x31\x63\x22\x79\x3b\x70\x0f\xf9\x3d\x6c\x0b\x90\x7d\x09\xf3\x53" - "\xaa\x63\xd3\x53\x64\xf1\x29\x98\xa0\x5d\x6a\xc9\xa1\x12\x22\xa6" - "\x1d\x3f\xc7\x6b\xc7\xe2\x6f\x90\x0d\xf8\xb5\x03\x97\x1f\x02\x97" - "\xb7\x33\x6c\x94\x05\x9c\x07\x78\x6b\x42\x64\x2e\xa5\xe4\x7e\xe4" - "\x38\x5d\x03\xef\x41\x76\x3b\xea\xa0\x4f\x58\x7e\x3b\x57\xe4\x41" - "\x27\xa4\x42\xfe\x53\xd7\xe8\x32\xd0\xe1\xfa\x15\x99\x3b\x97\xe6" - "\x25\xd4\xbf\x22\xda\xba\xdc\x03\xc9\x78\x07\x59\x6c\xc3\xfb\xf6" - "\xd1\xe9\x94\xe6\x0d\xe5\xd0\xc1\xee\x76\x96\xc7\x8e\x41\x01\x4a" - "\x60\x78\x56\x27\x64\x67\x09\x25\x01\x9f\x3f\xd7\x23\xfd\x3b\xc8" - "\x87\xf2\x39\x3e\x7a\xb9\x83\xcb\x8b\xeb\x1f\x0d\x68\xd7\x3f\x7a" - "\x41\x7b\xf5\xd1\x4e\xf1\xea\xa3\xe7\xc3\xaf\x3e\xfa\x0f\xd7\x32" - "\xb2\x84\xaf\x7f\xd4\xdf\x52\x2c\xfb\x20\xad\xa5\x18\x7d\x10\x26" - "\xcb\xca\x33\x94\xf6\xf8\xb3\xe8\xfb\xd0\x67\xb4\x72\x3e\xd9\xb4" - "\xe4\xb7\x5a\xbd\xa1\x4f\xe9\xf1\x52\x12\xb8\x6f\x8f\xd7\xbe\xce" - "\x94\xb7\x0b\x0c\xd9\x42\xbd\xfb\x7d\xa6\x6d\x36\xae\xd7\x9f\xbc" - "\xb7\x00\xbf\x42\xfc\x1c\xf8\x15\x89\x94\xb7\x8b\x40\x2b\xd7\xa0" - "\x55\x09\x54\xd7\x4d\x34\x5a\xa3\x84\xd3\x34\xf0\x18\xf0\x4f\xeb" - "\x87\x6e\xc3\xb4\xb5\x9e\xea\x9b\xcb\xa9\xac\xab\xcb\x41\xac\x0b" - "\x59\xff\xb1\x3e\xec\x72\x0f\xb2\xa3\x9e\x3c\x29\xbf\xaf\x40\xc7" - "\xa4\x78\xaa\x91\xde\x1e\x58\xe1\x48\xf0\xaf\x70\x98\x3a\x53\x3c" - "\x1b\x91\x67\x22\xf2\x54\xeb\x34\x6c\x67\x58\x90\x2d\xff\xc0\x10" - "\x25\x02\x66\xf1\x7b\x17\x5b\xcd\x5b\x5e\x11\xc7\x91\xaf\xa8\x17" - "\x16\x60\x03\x0e\xe8\x3f\xa8\xdc\x48\x03\xad\xdb\xd6\x23\x1f\x97" - "\xf7\x06\x73\x78\x4c\xf1\x79\x8b\xda\xc9\x1a\xa2\x14\xd1\xa3\xea" - "\x43\x9e\x76\xd6\xe9\x03\x83\x74\x55\x97\x9b\x66\x30\x6c\x2e\xe7" - "\xed\x68\x27\x94\xdb\x28\x5c\x0e\x13\xd2\xa7\x75\x09\x47\xc2\x1a" - "\xa4\x1f\x46\x79\xbd\xee\x76\x03\x47\xae\x83\xfb\x5a\xe2\x09\x7e" - "\x38\x5c\x14\xa4\x81\x35\x94\x88\x72\x33\x19\x1e\xc3\x02\x1f\xf8" - "\xd0\xd6\x8d\x87\x8b\xfc\xa4\x89\x28\x98\x3e\x05\xcf\x9a\x1d\x05" - "\x0f\xe9\x02\xf0\x98\xff\x1a\x51\x66\xe0\x56\x09\xef\xc1\xf7\x34" - "\x86\x17\x24\xb3\x5d\xe2\xfb\x53\x86\xd1\xc5\xfa\x03\x30\x3d\x4b" - "\xee\xa1\x0e\xb2\x6e\xf5\xbb\x1c\x89\x2d\x18\x37\xb9\xfc\x3b\x65" - "\xed\x49\xa2\x33\x2f\x91\x79\x8e\xdf\x7b\x43\xe7\x39\xcf\x2a\xd1" - "\xe9\x48\x1c\xd8\x01\x5d\x84\x3c\x28\xef\x64\x3c\x23\xfb\xf2\xc1" - "\x49\x3f\x1d\x47\x3f\x9d\x38\x79\xe2\x38\x9a\x3a\x7e\xc2\x38\xca" - "\xfa\xe1\xa8\xac\x31\xdf\xfb\xc1\xf7\xe4\xcd\xf7\x7e\x90\xfd\x3d" - "\x9a\xf1\xb3\x07\xc7\xd1\x8c\x69\xe3\x68\x26\x7e\x33\x66\x4e\x7a" - "\x70\xe2\xa4\x99\xe3\x28\xef\xde\xc9\x78\x9a\x30\xee\xf6\xac\xfb" - "\x46\xcd\x98\x30\x79\x12\x3d\x30\xeb\x8e\xac\x3b\xee\xa0\xf1\x93" - "\xa6\xdc\x9e\x95\xa5\x5f\x6f\xcf\xe2\x2c\x8f\x64\x4f\x9a\x39\x6a" - "\xc6\xa2\x85\x25\x0b\x47\x4d\x9b\x3c\x81\x53\xa0\xdd\x22\x78\x28" - "\x33\x7c\x51\x63\x5a\x07\xc4\xb9\x5c\xd2\xa0\x3b\xea\xc0\x03\xf8" - "\x75\x78\xca\x4e\x40\x07\x5c\xf3\x5c\x1d\xf7\x9d\x1c\x03\xac\x07" - "\x20\xf7\xe6\x2e\x77\x5a\x29\x68\x78\x94\x69\x68\xbf\x91\xf5\xc4" - "\xf5\xef\xe3\xdd\x21\x7d\xac\x49\xc2\xfb\xda\xe8\xf7\xd7\x42\x07" - "\x5b\xff\x4f\x8b\x9d\xc8\x8b\x1f\xe8\x1e\x80\x2e\x04\x7d\xfd\xd4" - "\xe9\xca\x4b\x02\x7f\x27\xa0\x8e\x36\xc8\xe6\x51\x94\x6d\x8d\x90" - "\xf9\x36\xf4\xcf\x51\x1e\x57\xce\x52\xda\xbb\x2d\x25\x39\xc4\xfd" - "\xe4\x2d\xd1\x61\x5c\xe8\x85\x91\x22\x61\xa0\xef\x01\xe7\x98\x82" - "\x73\x8d\x3d\x42\x3f\xf8\x18\xce\x06\xbc\xd3\x61\x5d\x68\x81\x9e" - "\x80\x1e\xbf\x55\x73\x65\x92\x48\xd9\x9e\xa9\xf5\x64\xca\xb1\x12" - "\xe5\xf2\x22\xf8\x3a\xd0\xe8\x44\xbe\x37\x72\x13\xc0\x07\x09\x18" - "\x7f\xd1\x96\xb4\x42\xf0\x77\x20\xbc\x76\xef\xb3\xe2\x5c\x1e\xdb" - "\x11\x57\x9d\xa4\xc1\x7f\x46\xfb\x9a\xb4\xb5\x7b\x8b\x45\x97\x4c" - "\x63\xba\xed\x17\xfc\x9c\x82\x7c\x3d\xbd\x69\xef\x73\x1a\xf8\x20" - "\x91\xe5\x55\x08\x99\x8e\x31\x73\xf0\x32\xe8\xb4\x56\xe4\x2d\xe6" - "\xbc\xa3\x43\x34\x00\xba\xc6\x66\x77\x25\xd0\x09\x1a\x4c\x5a\xca" - "\xde\x45\x11\xf5\x01\xce\x60\x1e\xa4\x98\x1f\xcd\x5d\xe7\x00\xa7" - "\x53\xa6\xc3\x8e\x19\xfc\x18\xe0\x2f\x66\x5d\xa9\xf4\xf7\xf5\xff" - "\xce\xf9\xf4\xb1\xb9\xef\x19\xb2\xae\xe0\x5c\xff\xef\x87\x41\x4b" - "\xb6\x17\xd8\xfe\xeb\x72\x0f\x9e\xe5\xa3\x81\x7e\x35\x36\x5e\xdf" - "\xca\x79\x35\xe0\x28\x52\x93\xb8\x2d\x25\x9e\xe5\x1d\x74\xb2\x98" - "\xc7\xda\xc1\x69\x9a\xcb\x41\xd1\x38\x5d\xd3\xc4\xf8\xb3\xfe\x00" - "\x2d\x3e\x05\x1f\x24\x03\xde\xb6\x68\x3e\x18\xec\x01\x9c\x67\x81" - "\x5f\x2b\xda\xf4\xac\x8f\xae\x39\xa2\x75\x3a\x50\x2f\x99\x20\x57" - "\xd0\xe7\x7d\x30\xf4\xf2\x6d\xd1\xe5\xaf\xa9\xe0\x72\xc8\x9f\xd4" - "\xd5\x29\xf3\xaf\x63\x9a\xeb\x7c\x07\xbe\xbc\x36\x3d\x86\x2f\xb7" - "\x00\x97\xff\x88\x78\x3f\x26\xe6\xfd\x2a\xbc\xff\x4f\xfd\x3d\xe4" - "\xfe\xda\x59\x31\x7c\x5b\x8c\xf7\xa7\x80\x6f\x00\x72\x0d\xdb\xe2" - "\x9a\x5c\xf0\x98\x3f\x22\xff\x9a\x98\xfc\x5b\x91\xff\xbf\x98\x6f" - "\x78\xcc\xe1\xfc\xf5\xba\xec\x20\xbf\x05\xf9\xf7\xc4\xd4\x3f\x07" - "\xf9\x03\x11\xf8\x1d\x8b\x7e\x9f\x5e\x8b\xf7\x5f\x32\xaf\xc3\x26" - "\x4a\x42\x9e\x01\xac\x4b\x58\x8f\x1d\x2e\xe2\xfe\x4a\x37\xc7\xe4" - "\xcf\x40\xbe\x54\x9d\x46\x26\x9d\x46\xb9\xdc\x8f\xa8\xe3\xb8\xc2" - "\x21\x3d\x3b\xa6\x4c\x1e\xca\xa4\x83\x8e\xcf\x1a\x7c\x19\xa7\x4c" - "\x51\x4c\x99\x75\xdc\x8f\x42\xd5\x63\xee\xea\xe9\x2b\xa3\xeb\xc8" - "\x48\x18\xdc\xb6\xab\x01\x63\x77\x34\x8c\x21\xed\xa8\x77\xd8\x7a" - "\xa5\x77\xae\x06\x0f\xdd\x81\xb4\x7f\x07\xcc\xe7\x58\x06\x20\xab" - "\x01\xaf\x3f\x48\xc2\x95\x9b\xaa\x78\xf7\xba\x6b\x06\x85\x88\xef" - "\x47\xf1\x3d\xc3\x16\x5d\x53\x74\x99\xbc\xee\x1a\x5c\x91\x9e\xce" - "\xf6\x5b\x02\xeb\x60\xd1\xf5\x13\x4d\xc1\xbc\xee\x4e\x61\x22\x13" - "\x9e\xc3\x7a\x1d\x7f\xc6\x73\x02\xf0\x5f\x84\x31\x87\xc4\x52\xe4" - "\x5b\x4e\x13\x90\x7e\x48\xca\xaa\xca\x27\x9f\x55\x1d\xb9\xcc\xdf" - "\x63\xf0\xfc\xbe\x5e\xfe\x5d\x86\x87\xfb\xdb\xf5\xfb\x84\x30\xc3" - "\x3a\x67\xc8\xe0\x90\x37\x65\x39\xc8\xa1\x84\x8f\xf2\x62\xa9\x7c" - "\xc7\x30\x5f\xc6\x75\x32\xae\xab\x70\x7d\x00\xd7\xc7\x5c\x5f\x92" - "\xcd\x15\x96\xf2\xc8\xcf\x93\x71\x7d\x10\xd7\x3b\x71\x9d\x89\xeb" - "\x70\x5c\xef\x41\x1b\xc2\x2c\x17\x18\x47\x79\x8e\x15\xc0\xb8\xaa" - "\x78\x8b\xe7\x00\x5d\xb9\x4c\x83\x49\xc8\xd3\x2e\xe5\x55\xe9\x17" - "\x8b\xea\xc7\xeb\x3a\x64\x5a\x8a\x4c\x1b\xa0\xf8\x41\xa5\x85\x0d" - "\x3d\x74\xae\x2f\x4d\xd7\x4d\xba\x2c\xea\x69\x0a\xfe\x0c\xc0\xf7" - "\x30\xae\x42\xc1\x4a\x52\x7d\xae\xc3\x57\xe5\xcc\x71\xea\x4c\x88" - "\xac\x13\xd7\x4d\x2e\xa7\x10\xb8\x96\x73\x1f\xf9\x68\xc8\x6e\x21" - "\xf9\x1e\x63\xac\x82\x37\x5b\xcf\x37\x86\x69\x2c\xcb\xcb\xf4\xf4" - "\xa3\x11\xbc\x34\xb8\xcb\x3d\x24\x14\x23\x47\x59\xe0\xa5\xdb\x98" - "\x67\x98\xee\xdc\xb6\x41\xc5\x72\x1c\x97\x6d\x91\xf0\xcf\x29\x9e" - "\xac\xd3\xe7\xad\x4a\x7e\xaf\x9f\x18\xa3\x5f\x24\xcf\xc6\xc8\x7b" - "\x07\xd3\x3c\xb1\x94\xe5\xe0\x7a\xcc\xff\xde\x19\x26\x6d\xc6\xb5" - "\x7b\x97\xf0\xfb\x00\xfa\x98\xeb\x4d\x2c\xe6\x76\x5c\xbf\xc9\x78" - "\x2f\xdf\x25\x1f\x4a\x63\xfe\x4e\x2c\x92\xef\x76\x63\x3c\xda\x6f" - "\xbc\x33\xea\x49\x2c\x91\xef\x9a\xfa\xe0\x6e\xcf\xd5\xe1\x26\xc6" - "\xb3\xf9\x44\xc5\xf6\xec\x51\x44\xa6\x5b\xcb\x29\xc9\x1b\x3a\x46" - "\xd3\x43\x22\x3c\xaa\x9c\x92\xbd\xa1\x5d\x74\x0b\xd1\x35\xde\xd0" - "\x71\xba\x95\x68\xb8\x37\xb4\x09\x36\xc8\x36\x7e\x7f\xf0\x66\x4a" - "\x48\xc0\xd5\x75\x53\xb9\x29\xc1\x1b\x2a\xa1\x8c\x72\x33\xae\x45" - "\x74\x6f\x92\xe8\xf2\x86\xa6\x20\x5f\x21\x4d\x0f\x8b\x73\x13\x93" - "\xc4\xdf\xf2\xc3\x94\x36\xe5\x79\xe1\xf2\x86\x30\x1f\x08\x35\x21" - "\x5d\x13\xd3\xc3\x5f\xe2\xd7\x25\xb4\x8a\xed\xb9\xd3\xc3\xe7\xc4" - "\x84\xe7\x0f\xe2\xf9\x6f\x02\x7d\x24\xbc\xa1\xb1\xd4\x12\x08\x20" - "\x9f\x4b\x88\xca\xed\xd9\x8f\x5f\x30\x51\x0f\x6c\x08\xad\x72\x7b" - "\x2e\xda\x92\xd7\x83\x76\x60\x7c\xfd\x59\xcf\x0a\x5c\xd7\x6e\xff" - "\xa9\x7c\xae\xd8\xee\x10\x96\xed\x79\xb7\x61\x72\xc5\x6d\xf0\x86" - "\xda\x28\x1f\xd3\x83\xe9\xcb\xfc\x82\xf1\x1f\xb4\x8a\xe7\x56\x63" - "\x09\x7d\x60\x9d\xbe\xcc\x25\xf0\xce\x22\x92\xb7\xe7\x79\x43\x1d" - "\x84\x3a\x1c\x80\x37\x57\xc2\xab\xd8\x5e\x81\xbc\x7e\xce\x17\x09" - "\x87\x61\x70\xde\xe9\x61\xb2\x22\x7f\x45\x4f\xf2\x76\x27\x7e\x35" - "\xf8\x1d\x41\xd9\xbf\x0a\x77\xfa\x21\x81\xf1\x1e\xe5\xdb\xf1\x1c" - "\x0c\x42\x86\x25\x2d\xc3\x34\x00\xf9\xdb\xc1\x2f\x13\xc1\x77\xc0" - "\x77\x87\x4d\xe2\xbb\x76\xc7\xf5\x41\xd9\x8e\x1d\x43\x54\x3b\x76" - "\x5c\xc7\xe9\x9d\xb0\x75\x70\x9f\xdd\xa9\xde\xfd\x00\xe5\x66\xc9" - "\x72\x15\x3b\xb2\x85\x65\x47\x6e\x10\xf2\x05\xba\x96\x33\x1d\x41" - "\xd7\x72\xa6\xa5\xa8\xdc\x91\xed\x75\xae\x23\x91\xbc\x23\xb7\x27" - "\x79\x47\x1e\xca\x3f\xd5\x23\x6d\x90\x1d\xce\xa0\x82\xbd\x14\x70" - "\x66\x83\x6f\x13\x01\xc3\x09\x58\x15\x3d\x6e\x3b\x4d\x5f\x26\x82" - "\xd3\x43\xab\x42\xf9\xcb\x28\x71\x24\x95\x03\xdf\x0f\x41\xa3\x42" - "\xb4\xb3\x11\xd7\x89\x78\x4f\xd7\xa2\xae\x83\x80\xeb\xe4\xfa\x50" - "\x4f\x05\x60\x3e\x0f\x58\x85\x8c\xd3\x97\x6e\x4a\xc3\x73\xcd\x97" - "\x0a\xbf\xfd\x5a\xc5\x8e\x56\xcd\xb2\xe3\x88\xc1\x43\xcc\x3f\x8a" - "\x6e\x9b\x68\x5a\x40\x84\xbc\xa1\x2d\x04\x1e\x4b\x6b\x09\x1c\xe7" - "\xf7\x98\xff\xec\x42\x3f\x33\x4f\x95\xe0\xba\x8d\x98\x7f\x5a\x8a" - "\x9f\xe7\xbc\x07\x99\x87\xa6\x15\x07\x56\x8d\xa2\xe2\x04\x3c\xbb" - "\xf2\x43\x16\x7a\xbc\xd8\x5c\x1e\xae\xd8\xd1\xd0\x52\xcc\xfd\x72" - "\x0c\x65\xb8\x5c\x11\x59\x13\x30\x07\x48\x10\x21\xab\xd3\x6f\x1e" - "\xe8\x70\x89\x96\xc0\x14\xe4\x2d\x26\x6e\x0f\xf3\x11\xe7\x9f\xda" - "\x21\x7c\x61\xcb\xce\x3c\x6e\x9b\x18\x54\x4e\xcd\x1d\x77\x12\xcf" - "\xc3\x9a\x3b\xb6\x31\x9f\x6a\xc2\xb2\x33\x13\x3c\xda\x33\xb5\xa3" - "\x3c\xe9\xf1\x0b\x94\x80\xb4\x70\xb3\x63\x17\xde\x37\x22\x5f\x93" - "\xe4\xdb\x69\x17\x42\xd6\x90\x65\x47\x4d\xa8\x62\x67\xf6\xb4\x0b" - "\x3d\xa2\xd9\xb1\x89\x1e\xeb\x28\x07\xad\x76\xd1\xd4\x33\xa1\xc4" - "\x96\xe2\x42\xe4\xe9\x42\xfa\x36\xc9\xff\x53\xcf\x74\x8a\x69\xb0" - "\x66\xa6\x5d\xf8\x9b\x98\xea\x10\x07\xf3\x9d\x34\xe8\xea\x55\x42" - "\x63\xb9\x68\x6a\xdb\x45\x57\x1f\xf7\x11\xcb\xc4\x94\x39\x9a\x98" - "\x7a\xe6\x9c\x78\xfc\x59\xa6\xcd\x58\x6a\x76\x40\x7e\x9c\x9b\x98" - "\xde\xfb\x9b\x1d\x07\x50\xff\x44\xc0\x75\x09\xaf\x73\x0b\xf2\x7a" - "\xac\x8f\x9d\x49\xa3\xa6\xb6\x4d\x14\x4a\xde\x51\x13\xae\xdc\xd1" - "\xa0\x25\xef\x38\xa2\x55\xee\x68\x15\xc9\x3b\x33\x43\x95\x3b\xb3" - "\xc3\xc9\x3b\xc1\x03\x3b\x1b\xd0\x4f\xc9\xdc\xe7\xdd\x6e\xb2\xe3" - "\x79\x47\x37\xf7\x7f\xc5\xce\xfd\x68\x6b\x2b\x6c\x5e\xa1\x78\x7f" - "\xe7\x7e\x5e\x5b\x40\xd9\xd6\x9e\xe4\x9d\x47\x90\xaf\x55\xc9\xd7" - "\xce\x76\xe6\x4b\xe4\x33\x21\xed\x14\xe6\x3d\x89\x78\x1f\xec\x49" - "\x6e\xb0\xe0\x67\x13\x6b\x1b\x1c\x80\x7f\x8d\xe4\xa9\x8a\x06\x87" - "\xf8\x71\x35\x6c\xe8\x0b\x80\xd3\x50\x31\x3d\x7c\xb7\x00\x0d\x21" - "\x27\x0d\x0e\xad\xb2\xc1\x29\x52\x1a\x1a\x82\x92\xf7\x1b\x76\x32" - "\xec\x9e\x15\x99\xbc\xe6\x60\xc6\x7b\xd8\x80\x6f\xde\x1a\x64\x5e" - "\xb5\xbc\x99\xa9\x59\xde\xac\x10\x15\x6f\x66\xff\xe4\x79\xe1\x0f" - "\x57\xbc\x99\xa7\x55\xbc\x99\x1b\xba\x0a\xb6\xb9\xf3\x00\xb1\x7e" - "\x0a\x7d\x24\x40\x83\x4f\x40\x8f\x6d\xb2\xff\xbd\x4e\xc8\xc0\xb2" - "\xa1\xe5\xcd\x1d\xe0\x85\xe2\xb7\xa5\x6e\x6a\x09\x1c\x93\x34\x15" - "\xc9\x6f\x66\x32\x4f\x71\xff\x3e\x5e\x4c\xe5\xa2\xf2\xcd\x6c\xad" - "\xf2\xcd\xdc\x70\x25\xe0\x26\xa3\x9e\x94\xb7\xfe\x14\x94\xf2\xfa" - "\x16\xf8\xf5\x00\xca\x7c\x42\x8a\xc7\xdf\x3a\xd2\x9f\x8e\x64\x5d" - "\xc5\xfa\x69\x7a\x28\xc8\x3c\x73\x8a\xf5\x9a\xd2\x53\x94\x6f\xe8" - "\x29\xd6\x51\x3c\xdf\x61\x3d\xa5\xe9\x7a\x4a\xd3\xf5\x94\x7c\xb6" - "\x40\xd7\x54\x6c\xcf\x63\x7d\x34\xdd\xa9\xf4\xcc\xf4\x70\x96\x00" - "\x6f\xa4\x02\x46\x9e\xea\x0b\xe4\x59\xbb\x7d\xae\xcc\x2f\xe9\xb4" - "\xbd\x42\x83\xbe\xc1\xaf\x46\x53\xfa\xa6\x55\xd7\x37\x26\x43\xdf" - "\x84\x31\xae\x41\xa6\xb4\x78\xfa\x46\xd3\xf5\x4d\x58\x28\x7d\xa3" - "\xe9\xfa\x86\xd3\xc3\xba\xbe\x09\xc7\xd1\x37\x90\x67\x6e\x6f\xa2" - "\xae\x67\xca\x59\xcf\x70\x7b\xc1\x6b\xb9\x9a\xd2\x33\x0e\xcc\x75" - "\x4c\xac\x67\xc2\x28\xa3\x19\x7a\xa6\x4b\x96\xaf\x60\x5d\xd3\xf3" - "\x02\x41\x7f\xda\x89\x75\x8c\xd4\x27\xa1\xe1\x21\xd6\x27\xa0\xdf" - "\xdd\xb1\xfa\x04\xf0\x6a\x70\x9f\xa6\xeb\xa9\x23\x98\xe9\x86\xa0" - "\x4f\x1a\xa6\x3b\x03\xe8\xeb\xcf\x30\xf7\x87\xde\x76\x96\x94\x7b" - "\x9d\x21\x82\x1e\x68\x15\x2d\xe5\x04\x1c\xc1\xbf\x61\xe8\x0a\x22" - "\xc8\x65\x66\x08\x32\x0e\x1e\xcf\x6e\x29\xfe\x94\xc2\x90\xd5\xa9" - "\x1d\x9d\xde\xc7\x03\x99\x69\x53\xcf\x08\x3f\xe8\xe3\x7b\xbc\xb8" - "\x1c\xfa\x25\xd3\xdf\xdc\xf1\x21\x4d\x69\x13\xda\x94\x02\x9f\x1d" - "\x32\x90\x3d\x75\xbe\xc7\xfa\xf8\xb3\x69\x90\x33\xe1\x81\x5e\xfc" - "\x7f\xa6\x9e\x49\xb3\xce\x6e\xa3\x6f\x4d\x99\x23\xb4\x30\xe4\x0c" - "\xed\x6d\x40\xbb\xf7\x03\xf7\x23\x90\xb9\x56\xc8\x59\x66\x28\x46" - "\xce\x20\x33\x3b\x70\x6f\x57\xf4\xdb\xd9\x0a\x39\xdb\xaf\xc9\xf1" - "\xac\x4d\xce\x31\x51\x4f\x2b\xaf\xc5\x41\xd6\xf6\x6b\x95\x4a\xd6" - "\x34\x55\xae\x5d\x63\xfa\x99\x74\x59\x43\x5f\xe0\x7d\x10\xb2\x63" - "\xc1\x2f\xbe\xac\x15\x47\xc8\xda\xb3\xba\xac\x25\x2b\x59\x43\x9f" - "\x26\x86\x57\x28\x79\x63\xf8\x3c\x0f\xed\x95\xb7\x94\x37\x33\x71" - "\x9f\xa0\x78\x47\xca\x1c\xc6\x95\x37\xf3\x20\x6f\xb9\x90\x37\xc0" - "\x13\x7e\xd6\x9b\xe0\xcd\xff\xe0\xb1\x6e\x5a\xb1\xf8\x8f\xfc\xf0" - "\xd0\x72\xc8\x53\x1e\x74\xd9\xdf\xa0\x47\xff\xe3\xf1\x00\x6d\x85" - "\x3c\x65\x42\x8e\xb2\x21\x4f\xb9\x90\x2b\x96\xa7\x23\xe1\x15\x0c" - "\xf3\xad\x23\xbd\x30\xe4\x58\x19\x2d\x4f\xfd\xad\x83\x76\xb9\xed" - "\xa5\x3e\xfa\xa0\x98\xed\x15\xdc\x57\xf8\xe8\xc0\x44\xfd\x1e\xf6" - "\xcf\x56\xb9\xb6\xc5\x32\x58\x5c\x46\xd7\x9d\xa6\xe1\xb9\xe0\x77" - "\xc2\x7d\x2a\xee\xa7\x4c\xbf\xe5\x20\xec\x88\x8e\x76\xd4\xdb\xc5" - "\x72\x28\xdc\x63\xd8\x3e\xcb\x01\x1f\x5a\x44\x57\x66\x2a\xec\x4b" - "\x4d\xf4\xd8\x78\xad\xcd\x8a\xe7\x41\x68\x7f\x06\xae\x83\xb7\x5c" - "\xa4\x74\xfc\x6c\x5b\xdc\x5a\x39\xdb\x4e\xb8\xcf\x12\x4b\x6d\x29" - "\x1b\x96\xd0\x48\x6b\x80\x2c\xf5\x6e\x2d\xcf\xba\x2a\x8d\xd7\x9c" - "\xd2\xf9\x5e\xb8\xb7\x8d\xad\xbf\x48\x66\x5e\x17\xd0\x92\x51\x9f" - "\xd3\x2a\xc4\xe2\x4c\xaa\x5f\x04\xfd\xe0\x26\x5b\xbd\x5b\xec\x0e" - "\x77\x49\x99\xcc\x36\x70\x61\xdc\x80\xe7\x0d\xc0\x73\xf6\x43\xcb" - "\x72\xe8\x13\x27\xc5\x5d\xab\xed\x72\x0f\xef\x6d\x7f\x3f\xef\x6b" - "\x0d\x9a\xf4\xf3\xfe\x80\x41\xa7\x7e\xd6\xf5\xcc\x3c\x46\x87\x97" - "\x08\x7f\xd5\x53\xc4\xb4\xb0\xb9\x42\xe2\x3f\x41\xc7\xf2\xb2\x30" - "\xdd\x30\x7d\xd9\xb7\x85\xb7\x43\x78\xbc\xce\x33\x54\x8f\xf7\x65" - "\xa5\x42\xd3\x92\xf7\xfa\x44\xe5\xde\xe3\x9d\x4b\x44\x88\xd7\x72" - "\xba\xdc\x37\xda\x7d\xf4\x23\x8f\xea\x8b\x1d\xfb\xe5\x1c\xd2\xb2" - "\xf7\x38\x60\x5d\xc3\xb0\x9a\x51\x3e\x5c\xb9\xb7\x0d\xf9\x60\x6f" - "\xfe\x51\xae\x77\x40\x8e\xf7\x17\x2f\xa7\x6f\x9e\xa6\x1b\x25\x8d" - "\x45\xc5\xde\x00\xeb\x03\xa4\xa5\x21\x6d\x1d\xe0\x07\x91\xdf\xe9" - "\xa3\xbd\x9b\x94\x1d\x7b\xe3\x3a\x23\x1f\xee\x0b\xf8\x3e\x8a\x7f" - "\x12\xe4\x62\x3a\x60\xd9\xfb\x36\xab\x12\xf4\xe5\x75\xe3\x2f\x0d" - "\xbf\x9c\xf8\xaf\xfb\xf4\xf9\xce\x6c\xd8\x5a\xe4\x5a\x49\xc3\xd0" - "\x3f\xc0\xef\x3b\x09\x98\x47\x9c\x14\xee\x1b\x6b\xde\x58\x1e\xc4" - "\x3c\xe1\x3b\xa9\x3e\x7a\xb1\xb1\x3f\x7a\x0a\xb6\x75\x2e\x8a\xf6" - "\xaa\x25\xbd\xb4\xfc\x7c\xfa\x32\x4d\xf0\x3d\xeb\xa3\x7a\xa4\x33" - "\xdd\x00\x67\x96\x41\xb3\xfe\xfb\x65\xaf\x5f\xcd\x39\xbf\xb3\x47" - "\xb8\x05\x79\xbe\xc5\x7b\x4c\xdf\xd9\xab\xe8\xb0\xf3\x48\x27\xf4" - "\x08\xaf\x13\x63\x6e\x16\x58\x6c\x13\xa0\xd7\x77\x1a\x7c\x34\x32" - "\x4b\x5f\x87\x0a\x78\x43\x93\x58\xb7\xc4\x1d\xb7\x78\x4f\xac\x0f" - "\x7e\xc6\xb1\x96\x61\xd0\x43\x52\x37\x1d\x9a\x55\xa6\xf0\x0e\x32" - "\x5c\x4f\xd9\x79\x6a\xc3\xfb\xc5\x01\xd1\x2e\x2a\x0e\xe5\xf2\x3c" - "\xc2\xb3\xa4\x9b\xd3\x3e\x05\x6f\x0b\xcf\x22\xc6\x29\xe3\x53\xcf" - "\xb7\xba\xe9\xa4\x93\x12\xeb\x7b\xd7\x7f\x32\x3c\xbc\xde\xa3\xd6" - "\xb9\x32\x72\x7c\x34\x2a\x68\xe0\xc5\x36\x06\xe8\xcb\xb4\xde\xcf" - "\xb6\x06\xef\x3d\x2c\x2e\x15\x41\xb6\x39\x90\xb7\xc8\x68\x03\xb7" - "\x4f\xb5\x2b\xa3\x3c\xb2\x5d\xbc\x47\x65\x2d\x55\x34\x58\xbc\x8c" - "\x2c\x76\x45\x6b\x0b\xb7\x97\xdb\xc2\x6d\x96\x6d\x91\x3a\x16\x63" - "\x44\xe8\x4e\xcc\xc7\x64\x7a\x2b\x60\x61\xfe\x33\x52\xe7\xa9\x8c" - "\x9c\x58\x3e\xea\xed\x47\xcb\x8e\x0a\xcc\x41\xbf\xe5\xd2\xc4\x89" - "\x93\x34\xe2\x61\xb5\x76\x36\xe2\x61\x8d\xed\xec\x20\xf3\xef\x07" - "\xad\x3c\x26\x7b\x4b\x59\xdf\xca\xbc\xd7\x22\x6f\x1b\xf2\x4c\xd6" - "\xf3\x4e\x56\x7b\x76\xf2\x3a\x80\xaf\x18\xc7\x9e\xf7\xd1\x88\x02" - "\xbf\x1c\xef\x0f\xa5\x19\xcf\x98\xbb\x63\xfe\x37\xc2\x26\x2a\x3f" - "\x68\x8d\x8f\xcb\x9b\x15\x3c\x9e\x85\x2f\x8a\x0e\xd4\x73\x3d\xf3" - "\x94\x6b\x19\x7d\x03\x7c\xf9\x79\xd9\x4a\xba\x96\xf9\x49\x24\xef" - "\x0d\x29\xba\x8f\xd8\x25\xdc\xb0\x3d\xa1\x51\x8b\x97\xd0\x37\x21" - "\x47\x81\xd3\x34\xe2\x50\x7e\xa9\x1d\xb8\x12\x55\x9d\x25\x92\x3a" - "\x28\x79\x6f\xd0\x1b\xfa\x82\xea\xcf\xf2\xda\xce\x08\x9f\xc1\x8b" - "\xb8\xef\xb8\x9c\xbe\xc0\x38\x63\x51\x6b\x0f\x37\x3d\xcc\xfb\x0c" - "\x27\xe8\xa6\x89\xdc\x5e\xb5\xc7\x79\xd3\x9d\xe2\xa2\x98\x2d\xd4" - "\x98\x16\xf4\xd1\x4d\xc5\x18\x5b\x2c\xf2\xe7\xa6\x02\xf5\xbc\x33" - "\x88\x7c\x19\xe2\xa2\x46\x9c\x8e\xb4\xb1\xc2\x9d\xc0\x32\x71\xa0" - "\xcb\x7d\x93\xc3\x47\x3f\x6e\x55\x7d\x73\xd3\x18\x86\x15\x1f\x87" - "\x9d\x41\xf4\x2d\x31\x6f\x02\xd6\x9f\xed\x65\xbc\x76\x79\xd3\x76" - "\x29\x17\x80\x55\x6f\x52\x7a\x5b\x03\xae\x75\x6e\xcd\x01\x1d\xed" - "\xd0\xd6\x7e\x94\x23\xef\xf5\x77\x42\x1f\x47\xe3\xc3\x3f\x34\xcb" - "\x33\x94\x79\xfc\xe6\x91\x0a\xce\xa1\x5c\xcf\xd0\xd3\xfc\x3c\x8a" - "\x9f\x03\x96\x83\x39\xde\x9a\x1c\xd4\x7f\x1a\xf5\xde\x3c\x52\xcd" - "\xe7\x6f\x1e\xd5\x89\x3a\xba\xdc\x37\x8f\xf4\xd1\x68\xb3\xda\x73" - "\x39\x98\xd3\xdf\x5e\x32\xcb\x0e\xcb\x9c\x92\xe9\xcc\x33\xcd\x5b" - "\xa5\xfc\xb5\x77\x5a\x1a\x2c\xba\xde\xe0\x75\x9a\xd4\x13\x94\xd9" - "\xd1\x6c\x93\xfc\x6d\x12\xa6\x9b\xd7\xfd\x46\xf3\x9b\x78\x5f\x4c" - "\xa9\xaf\xcc\x8e\x4b\x7f\x37\x7b\xf0\x3b\x8a\xdf\x71\xfd\xb9\x1d" - "\xbf\x10\xee\xa7\xe0\x77\x5c\xd2\x6e\x73\x61\x82\x0f\xef\x3a\x61" - "\xb3\xf3\xb3\x8f\x6e\x3e\x22\x36\x67\x98\x60\x97\xc8\xfb\xfa\x6f" - "\xf0\x3a\xc1\xcd\xd0\xb3\x37\x95\xaa\xbe\xc8\x94\x6b\x2a\x90\x47" - "\xa6\xbb\x70\xd5\x88\x60\x63\x59\x80\xf1\xce\x68\xac\x09\x90\xfd" - "\x26\x6e\x7f\x26\xdb\x0f\x22\x00\xfa\xf3\x75\x71\x8d\xf0\x1f\xae" - "\x0d\x11\xef\xcf\x75\xb9\x33\x21\xff\xf3\xa7\xa8\x35\x87\x43\xc5" - "\x0c\x4f\xe7\x09\x61\xb4\x5f\xe9\xb4\x83\x39\xdc\x97\x78\x7e\x0e" - "\x6d\xb7\x9e\xa5\xcc\xbd\x22\xe5\xa3\x9c\xc3\x0e\xa2\x2d\xd0\x23" - "\x18\x6b\xe4\x5e\x41\xbd\xf4\x0f\xc8\xc4\xf8\x7f\xd3\x71\x63\x3f" - "\x69\x3d\xde\x6f\xc0\x3b\x8c\x3d\xfe\x66\x47\x90\x18\x56\x98\xdb" - "\x87\xf2\x1f\x6a\x7e\x33\xc6\x6a\xf4\xf9\xc1\x9c\xb2\x62\xe8\x99" - "\x5e\xbd\x95\x39\x7b\xe5\x19\x11\x34\xda\x77\x78\x2b\xcb\x42\x26" - "\xf8\xff\x69\x47\xbf\xfc\xdf\x8b\xf3\xad\xc9\x87\x33\x54\x9f\x69" - "\xa0\x4b\x74\x9f\xdd\x6a\x51\xfd\x75\xcb\xd8\xe8\xfe\xba\x15\xb6" - "\xcd\x2d\x6b\xf0\xab\xc5\x6f\x97\x7a\x8e\xfc\xdd\x52\x1c\x71\x7f" - "\x00\x3f\xe8\xce\x5b\x30\xfe\x8f\x08\xaa\x7e\xe0\x74\xb4\x83\x79" - "\xe4\x1f\x64\xd1\x7a\xf2\x88\xf7\x6b\x39\x9d\xf9\x99\xd3\x35\xd8" - "\x33\x3e\xba\xa5\x1a\xef\xd3\x58\x56\xab\x34\x8a\x7a\xef\x45\xed" - "\x9e\xe5\xd0\xd5\x74\xcb\xe7\x0c\xcb\xba\xaa\xa2\x82\xf9\x14\x65" - "\x36\x59\x43\x15\x15\xa8\xaf\xc3\xa0\x2b\xd2\x8e\xf1\x7b\xe6\xc9" - "\x2e\xf7\xad\x66\xd0\xa5\x41\xee\xc7\x62\xbe\x17\xdf\xd6\xb8\x35" - "\xb3\xd7\x26\xb3\x34\x38\x58\x1f\x75\xd0\x77\xc7\x40\x67\xa1\x6f" - "\x3f\xca\x56\x63\xcd\x77\xef\xe4\x67\xe8\xca\xcf\x71\x9f\xd5\x0c" - "\x9d\xd4\xbd\x76\x6f\x41\x8f\x89\x06\x74\x9b\x28\x27\xb4\xf6\x4c" - "\x6a\x28\xe5\xed\x22\x6f\xfb\x1e\x6a\x09\xfd\x96\xec\x4f\x49\x18" - "\xb7\x78\xc1\x03\xae\x65\x22\xfc\x4e\x77\x83\xd9\x1b\x3a\xe7\xc1" - "\xd8\xfc\xed\xd3\xf4\x5d\x49\x8f\x17\x4f\x60\xd4\x7f\x5c\xc2\xd6" - "\xe9\xd3\xd1\xbe\x61\x9e\x08\x6d\x38\x29\x02\xb0\xef\x52\xd6\x77" - "\xd3\xc8\xd7\x97\x53\x56\x6d\x37\x65\xd4\x75\x53\xa6\x38\x95\x69" - "\xaa\x85\xdd\xf6\xf8\x85\x34\x82\x4e\xc8\x1b\x54\x4c\x96\xba\xe5" - "\x24\x79\x24\x5c\x09\xfb\x2d\x04\xfb\xed\x5c\x26\xeb\xc6\x5e\xfb" - "\xad\x47\xda\xc5\xfb\x0a\x15\x1f\xed\x2b\x1c\xe8\xa0\x84\xd4\x02" - "\x4a\x03\x7e\xae\xb3\x74\xeb\xfc\x54\x0c\x88\xdc\x66\x9f\xde\x5e" - "\xd0\xbc\xd4\xea\xa0\x01\xb2\xad\xd0\xd7\xa2\xf2\xa3\xec\x7e\xc7" - "\x61\x13\xf3\x54\x80\xe5\x86\xdb\xb0\x8a\xf7\x8c\xf7\x0c\x0d\x9a" - "\x17\xd7\x8a\x20\xa7\x97\x0c\x17\xd0\x99\xdf\x75\x70\xdd\xbb\x91" - "\xde\xe5\xfe\x6e\xb5\xcf\xf4\xab\x91\xfd\xf1\x28\xe6\x47\xba\x5e" - "\x19\x79\x8d\x30\x95\x83\x47\x1b\x1a\x56\x86\x60\x7b\x9f\x65\x99" - "\x1d\x99\x36\xbd\x48\x84\xec\x0b\x78\xff\x7e\x24\xb1\x6f\x01\xef" - "\x29\xfe\x06\xb6\xcd\x57\xf9\x13\xf0\x78\xc1\x73\x05\x6b\x11\x60" - "\xae\x6d\x68\x10\x98\x9f\x7f\x5d\x7f\x06\xb4\x33\x75\xe3\x10\xf6" - "\xb3\x19\x39\xc5\x47\x53\xb6\x31\xee\xd2\x97\x06\xba\x13\xf6\xd6" - "\xb5\xc0\xab\x22\x00\x3a\xe0\x3d\xc6\xff\xc9\x4e\x7d\xff\xd7\xcf" - "\x7b\xaf\x48\xc3\xf8\x7f\xff\x01\x4e\x2b\x19\x4e\xb6\x12\xbb\x88" - "\xbb\xf7\xcd\x36\x13\xef\x49\x03\xde\xf5\x28\xb3\xc7\x80\x83\x71" - "\xea\xd7\x9d\xa6\x87\x1e\x42\xda\x11\x03\x0e\xf2\x5c\x87\xe7\xd6" - "\xde\x3c\xaa\x4c\x7b\x44\x99\x87\x3a\x4d\xb7\xfe\x1a\x69\xa1\xe8" - "\x32\xa3\x52\xa3\xcb\x8c\x1a\x16\x51\xa6\x5c\xd5\x33\x2a\x2b\xa6" - "\x4c\x4e\x4c\x99\x19\x97\xe2\x36\xaa\x30\xa6\x4c\x49\x4c\x99\x35" - "\x97\xe2\x36\xaa\x26\xa6\x4c\x43\x4c\x99\xfd\x11\xb4\x64\xbf\x9a" - "\x2c\xa4\x35\xc5\x94\x39\x1e\x53\xa6\xc3\x78\xee\x87\xc6\xa9\x8b" - "\xb7\x90\x0d\xbc\xc9\xbe\x5b\xfe\x8d\xe8\x9f\xce\x57\x9f\xee\x52" - "\x65\x6f\xcb\xbc\xb4\x5d\xb7\x8d\x8d\xae\xef\xb6\x29\xd1\xf5\xdd" - "\x36\xfb\xd2\x76\xdd\x56\x1c\x53\xa6\x3c\xa6\x4c\x75\x44\x99\xad" - "\x7a\x3d\xdb\x62\xca\xec\x89\x29\xd3\x78\x29\x5f\xdd\xd6\x1a\x53" - "\xa6\x3d\xa6\x4c\xf0\x2b\x68\xc1\xe3\xb8\xf2\x6b\x1b\xc2\xb6\xf2" - "\x3d\xb0\x11\x46\xcf\x61\xdf\x08\xde\x07\x7d\xa3\x3b\x98\xc4\xfb" - "\x73\x3c\x5e\x1d\x76\x06\x31\xb6\x8c\xc6\xfc\x67\x8c\xc7\x18\xb3" - "\xd8\x6f\x84\x65\x5a\xd9\xd8\xa3\x33\xfb\xb3\x45\xa5\xef\x99\xee" - "\xbf\xc6\x75\x1d\x1e\xc6\xe3\xd4\xe8\x4d\xbd\x36\xb1\xf2\x41\x23" - "\x1d\xce\xdf\x8d\x7d\xd8\x7a\xe5\x8f\x92\xc0\x36\xf9\x61\xa7\x2c" - "\x73\x24\xc2\x8e\xe6\xfa\x03\x7b\x96\x07\xcd\x31\x78\x34\x5c\x06" - "\x8f\x54\xd8\x46\xd9\x2d\x18\xbd\x78\x7f\xbd\xb9\x16\x36\x10\xec" - "\x7e\xc6\xed\x04\x65\x65\x49\x9b\x6c\x41\x37\xf1\xbd\xb7\xf4\x2e" - "\xb9\xff\xae\x6c\xd2\x2c\x47\x23\xea\x67\xdb\xbd\xb1\xf8\x3c\xfb" - "\x48\x61\xfc\x65\xdb\x2d\xeb\xe5\xc3\xa5\x7e\xe0\x95\x55\x60\xf8" - "\xa9\xf8\x28\x6b\x93\xb4\x35\x2a\x0e\x65\xb1\x6f\x00\xfb\xd0\x1c" - "\x0e\x64\x73\x1e\xf0\xff\xe8\x22\xa3\xbd\x18\xeb\xfd\xc8\x3b\xf6" - "\x72\x34\x53\x7d\x98\x75\x20\x9a\x27\x93\xc0\x2b\x59\x47\xa3\xfb" - "\x3d\xcb\x17\xdd\xef\x59\xfe\x68\x9e\x34\x81\x27\x6f\x37\x47\x97" - "\xb9\x3d\x3d\xba\xcc\xed\x19\x11\x65\xaa\x55\x3d\xb7\x67\xc7\x94" - "\xc9\x8d\x29\x93\x17\xf1\x8c\x36\xde\xee\xe8\x9d\xfb\x48\x1f\xa8" - "\xdb\x9d\x11\xcf\xa6\x4d\x52\x7f\xde\xbe\xce\x48\xe3\xb5\xa3\xba" - "\x57\x94\x0f\x8e\x0e\xaf\x21\x46\xde\x39\xff\x81\x18\x1c\x9a\x62" - "\x70\xe8\x95\x7f\x7d\xef\xfe\xe3\x93\x74\xc7\x1e\x7d\xef\xbe\x03" - "\x63\xf6\x74\x7e\x06\xac\x1a\xe4\x07\x1d\xee\x48\x8d\x86\x77\xc7" - "\xb0\x68\x78\x77\x8c\x8c\x78\x4e\xc3\xf3\xd8\x88\x36\xa4\x25\xda" - "\x28\x01\xfc\x02\xfb\xed\x8e\x59\x46\x3a\xcf\x29\x81\x6f\xbb\x4b" - "\x8e\x35\x39\xec\x5b\x36\xf8\x04\xdd\x31\x9e\xe7\x9f\x3a\xcc\x48" - "\xf9\x27\xd5\xae\x3b\x36\xc5\xe0\xb1\x2d\x06\x8f\x3d\x11\xed\x0a" - "\x58\x57\xd1\x03\xd6\xd0\x83\x0f\xb3\xed\xc3\xfe\x94\xd2\xc7\x6b" - "\x25\x6c\xb6\x0b\x94\xc6\xbe\x75\x27\x4b\x28\xd1\xeb\x6c\xc7\x5c" - "\x6e\x5f\x41\xbf\xfc\x94\x72\x28\x47\xf9\x56\x91\xbd\xcb\xfd\xbd" - "\x74\x83\x1f\xb5\xb5\x87\x72\xb4\xca\x0f\x33\x90\x06\xfd\x97\xb5" - "\x55\xd9\xb9\x07\x8a\x85\x2b\xaf\x06\xf4\xc4\xbc\x68\xcc\x75\xfa" - "\x3c\x62\x16\xfb\x88\xb1\x1f\x2b\xc6\xf8\x54\xb5\x0f\xff\xbd\xd9" - "\x11\x7c\x1d\xb0\x2f\xbf\x5b\x9c\xa0\x31\xc3\xd9\x06\x60\x19\x65" - "\x5f\xb3\xc3\x21\x3f\xf1\xdc\xdb\x1b\x3a\x2d\x6d\x37\xbc\xb7\xeb" - "\x65\x6b\x22\xca\xfa\xf5\xb9\x71\x3b\xbf\x1b\x1d\x22\xf3\xe1\x80" - "\x9f\x00\x27\x5d\xd9\x7b\x63\x86\x1f\x86\xbc\xa2\x4c\x93\x51\x86" - "\xe7\xd1\x72\x8f\xb7\x84\xcc\xb7\x95\x92\xd9\xb3\xfc\x84\x84\x6d" - "\xf8\x6d\xc0\x96\xee\xf0\x96\xb6\x93\x37\xd0\xca\x6b\x5d\x66\xe5" - "\xa3\x33\xc6\x9e\x18\x24\x4b\x67\xe5\x21\x8c\x71\x63\xec\xe1\xca" - "\x43\xd9\xc0\x0d\xe3\xd9\xf7\x26\xb2\xbe\x89\xa4\xdd\xa4\x49\x33" - "\x1e\x9c\x3e\x75\xd4\xcf\x1e\x9c\x3c\x6b\xd2\x5d\xf6\x59\xf3\x9f" - "\x99\x5b\x38\x6a\xe1\x73\x25\xf6\xa5\x8b\xe6\x97\xcc\x5f\xf0\x73" - "\x7b\x96\x73\x84\xd3\x3e\xa7\x44\x5d\x33\x8b\xe6\x2c\x2e\x19\xc7" - "\xb7\x23\xed\xc5\x8b\xe6\x2e\x91\xb7\xb7\xa4\x50\x34\x90\xf9\x25" - "\x73\x17\xd9\x47\x14\x8e\xb4\xdf\x3b\x67\x7e\xd1\x73\x8b\xe6\xc6" - "\x85\x75\x97\x7d\xd1\xdc\x45\x73\xe7\x14\xda\xc7\xd9\xb3\x18\x72" - "\x24\xb8\x88\xfe\xcc\x32\xc6\x31\x1e\xbf\xaa\xdc\xe2\xa8\x3e\x9e" - "\xf9\x14\xff\x8c\x09\x5c\x3a\x96\xdd\x69\x89\xe6\xb9\x3b\x6d\xd1" - "\x3c\x77\x67\xe6\xa5\x63\xd9\x9d\x31\xe3\xdf\x9d\x31\xe3\xdf\x9d" - "\xb3\x2f\x1d\xcb\xee\x8c\x19\xff\xee\x8c\x19\xff\xee\xec\x1d\xff" - "\xc0\x4b\xbe\xd5\x52\x2f\xdc\x19\x33\xfe\xdd\x19\x33\xfe\xdd\xd9" - "\x18\xf3\x7c\x2c\xe2\xf9\x5a\x3c\xb7\x45\x8e\x8f\x78\x0e\x18\xf2" - "\xd9\xa7\x5f\xbe\x6f\x31\xf2\xb0\xae\x87\x6e\x6e\x53\x79\xbf\x6f" - "\x8f\xc8\xdb\xae\xe7\x1d\xd3\x2b\x7f\xbc\xaf\x8d\x74\x35\x5f\xff" - "\xfe\x6b\xac\xd3\xd9\x1f\x8f\xc7\x26\xc8\xc7\xb7\xcf\xd2\xf7\xaf" - "\x61\x58\xcc\xc3\xec\x9f\x29\x5e\x7d\xb4\xab\x7e\x30\x59\xb8\x4c" - "\xfd\x4b\xec\xd7\x3b\x66\x24\xfb\xea\x22\x8d\x7d\x97\xa1\x53\xbe" - "\xcf\xf6\x6f\x48\x8d\x17\xdf\xf7\x49\x9b\x1f\x65\x74\xf8\x72\x5e" - "\x03\x38\xec\x0b\x6c\xa9\x52\x63\x71\x1b\xee\x53\x99\xa7\x51\xde" - "\x2c\x4c\x63\x9e\x65\x1f\x68\xa4\xa5\xe1\x97\x0e\x78\x3e\x03\xde" - "\x9a\x21\xf1\x6d\xcb\x58\x3b\xb7\x77\x3e\x68\x22\x6b\x95\x5b\x6b" - "\xf5\x6a\x6c\x5b\xff\x20\x5d\xad\x2d\xec\x2d\x17\xee\x83\x79\xf5" - "\x48\x8f\x3f\x4f\xfa\x01\xe4\xe5\x07\x16\xb5\xde\xf2\x03\xf4\xff" - "\xd4\x31\x6a\xed\x74\x6f\x39\xf4\x6d\x37\xe0\x5c\xc0\xb5\x07\xd7" - "\x7f\x37\xe0\x7b\xe4\x7c\xfb\x07\x25\xc2\x9d\x30\x93\xe1\xc6\xa4" - "\xaf\x83\x7e\xeb\xb6\x86\xca\xf3\xe2\xbc\x6b\x10\xee\xc4\x07\xe3" - "\xa4\x7b\x60\x33\x74\x03\x8f\x00\xe3\x1b\x91\xde\x2a\xdc\x83\x66" - "\x71\x7e\x1f\xd7\x87\x32\xfd\xd9\xda\x86\xff\xad\xf2\xe1\xcf\xce" - "\x88\x69\xc7\x97\x27\x29\xfb\x57\xaa\x1d\xd9\xe1\xe8\xba\xb3\xc7" - "\xc6\x6f\x47\xf6\x2c\xb4\xe3\xcb\xf8\xed\xc8\x2e\x96\xb4\x35\xa1" - "\x2d\xa6\x4b\xde\xad\x43\x5b\xbe\x94\x74\x8f\x4e\xdf\xa6\xdb\x42" - "\x01\xcc\xc3\xd2\xf0\x4e\x96\x9d\x59\xda\xd7\x6f\x7a\xbe\x26\x6b" - "\x0d\xcd\x88\x53\x67\x9b\x70\x0f\x98\xe9\xa3\x1f\xca\x73\x0d\x11" - "\xe9\x21\x85\x0b\xe8\x64\x62\x3a\xa1\x3d\x28\xd7\x5f\x7f\x1b\xf3" - "\x12\xb5\x16\xf2\x43\xc8\x7f\x36\x19\x6b\x99\x8b\x4b\x85\xdf\xa0" - "\x23\xde\x39\x62\xde\x05\x23\xde\xad\x89\x7a\xb7\xb2\x37\xbd\xd6" - "\x48\xff\x7a\xfd\xf4\xc3\xa6\x98\x7e\x42\xff\xdc\xf5\x58\x74\xbb" - "\x7f\x78\x5c\xb5\x0f\x7d\x74\x09\xad\x7f\x18\x44\x1f\xf5\xc4\xef" - "\xa3\xbb\xd2\xe3\xf3\xda\x5d\x72\x1d\x4d\x0c\xa6\x38\xf0\xee\xca" - "\x45\xdf\xf5\x48\x1e\xd4\xfb\xe9\xd2\xfe\xb9\xab\xc8\xe8\x9f\xaf" - "\xd7\xc6\xbb\x76\xc7\xb4\x31\x7c\x92\x7e\x34\x4a\xb5\xf5\x47\x2b" - "\x63\x60\x1f\x89\xcf\x8b\x77\xf9\xd0\xce\x70\x3f\xed\x0c\xf5\xcf" - "\x8b\x3f\xb2\xa1\x3d\xe1\x4b\x79\xf1\x47\x59\xaa\x0c\xc5\x2b\x33" - "\x45\xb8\xe3\xd5\xf3\xa3\x42\x57\x88\xed\xdc\x1f\xd5\xf2\xfa\x52" - "\x44\x7a\x69\x34\xff\xa1\x0d\x5c\x8e\xe9\x17\x52\x7a\x96\xfb\xe1" - "\xa4\x9d\x4c\x5f\xc5\x93\x5d\xee\x1f\x1d\x8f\xa1\xd5\xb9\x93\x34" - "\xf6\xb1\x4e\x53\xc2\x36\x45\xaf\x71\xc3\x63\x70\x0a\xc6\xa7\xd7" - "\xd8\x34\xd0\xeb\x5c\x7c\x7a\x8d\x1d\xd9\x3f\xbd\xc6\x72\xff\x9f" - "\xbb\x94\x5e\x63\x0b\x22\xe9\x05\x5b\x57\xb6\xef\x3b\x36\xf0\x46" - "\x4f\xbe\xa8\xe7\xb6\x86\x29\xcd\x0a\x5e\x51\x65\x3a\xb8\xcc\x26" - "\x6b\x50\xf1\x09\x6c\x48\xcb\x59\x1a\x5b\x6a\xc8\xff\xa0\x1a\x1a" - "\x20\x7a\x1e\x65\x3f\xa2\x04\x2e\xe7\x75\x9e\xf3\x78\x43\x59\xc4" - "\xf3\x8f\x98\x7a\x5b\xe3\xeb\x82\xb1\x7e\xd0\xf4\xa5\x4b\xd3\xc7" - "\x59\x94\x1f\xd9\xb8\x9c\x68\x1d\x31\xce\x1e\xdd\x47\x3f\xe2\xb5" - "\x53\xab\xbe\xed\xf4\x95\xbf\xcb\xf7\xd9\xb8\xea\x4b\xfb\xec\xc7" - "\xb7\xab\xfe\xfa\xf1\x35\x31\xf8\x35\xc4\xef\xaf\x71\x9e\xfe\xfb" - "\x6b\xdc\xf1\xfe\xfb\x6b\x1c\xaf\x9f\x9e\xf3\xd1\x8f\xb3\xa2\xc7" - "\x8d\x1f\xa7\x45\xb7\x17\xf5\xa2\x9c\x30\x5d\x75\x2d\x3f\x7f\xdd" - "\x76\x1b\x3f\xd6\x71\xdc\x57\x7c\xae\x08\xf8\x0f\x67\x1c\xaf\x14" - "\x46\xbf\xb0\x41\xc3\xea\xe5\xf1\xf7\x5b\x79\x8e\xdb\x52\x43\xc4" - "\xfb\xc8\xf6\x6f\xb1\xed\x7e\x77\x92\x66\xa2\x56\xdc\x9b\x4e\x52" - "\xce\x9f\x35\x93\xa9\x94\xf7\x3c\xa5\xdf\xba\x5c\x43\xb8\x7b\x58" - "\x64\x5f\xf0\xde\x27\xcf\x4d\x37\xa8\xb9\xd3\xdf\x50\x7e\xbb\xea" - "\x97\x9c\x77\xa3\xe9\x78\x77\x4e\xfc\x7e\xb9\x3b\x0f\xfd\xf2\xb7" - "\xf8\xfd\x72\x77\x49\xff\xfd\x72\x77\x35\xfa\xe5\x6f\x97\xca\xd1" - "\xdd\x0d\xba\x1c\xad\xe6\x32\xf6\x05\x3c\x1f\xcf\xf9\x06\xe7\xc1" - "\x3d\x64\x24\x47\xd2\x64\x54\x87\x21\x47\xb2\xcc\x71\xc0\x92\xf5" - "\xab\x3c\x77\xb7\xea\x30\x22\xe0\xe6\x90\xb5\x23\x9e\x9c\xe4\xd8" - "\x38\xef\x6d\xc5\x64\x01\x0d\xf3\xb6\x30\x8c\x45\x44\xa8\xe7\x19" - "\xce\xc7\xe9\xb7\x05\x22\xe5\x24\x27\xd7\xc8\xc7\xba\x4e\xcf\x9b" - "\x23\xba\x1c\xc4\xf9\x62\x60\xeb\xed\x1f\x20\xc7\x11\xce\xcf\xf9" - "\x62\xf2\xd4\x28\x79\xcc\x39\x1e\x2d\x8f\x39\xbb\xa3\xf9\x13\xf4" - "\x47\x39\x0d\x7a\x0e\xf7\x66\xe0\xf0\xb5\xf9\xeb\xf2\xb2\x39\x7e" - "\x64\x8c\x6c\x82\x07\xc6\x37\x2b\x1e\x18\xff\x76\x34\xae\xe3\x27" - "\xc6\xe7\x81\xf1\xb3\xfb\xe7\x81\xf1\xce\xfe\x79\x60\xfc\x26\xe6" - "\x01\x1f\x8d\x6f\x8a\x96\xcd\xf1\xbb\xa2\xdb\x8e\x7a\xa5\x6c\xd2" - "\x35\x57\x22\x9b\xb0\x85\xae\xed\x4f\x0e\x59\xa6\xd8\x7f\xa4\xbe" - "\xdb\xd8\xeb\xf8\x5a\x34\xb3\x40\xae\x80\xdf\x3d\x05\xbc\xa6\x04" - "\x1d\x9f\xcd\x34\xac\x93\xe7\x31\xef\x29\x89\xa4\xe3\x06\x75\x06" - "\xd2\x85\xbc\x5f\xf2\xbe\xb2\xa2\xe7\x84\x43\xd1\xed\xbf\x67\x53" - "\x7c\x7a\xde\xb3\x0b\xf4\x74\xc5\xa7\xe7\x3d\x47\xfa\xa7\xe7\x3d" - "\x6d\x7c\x46\xea\x52\x99\xba\x27\x64\x5f\x22\x6d\x14\x59\xe6\x2c" - "\x4d\x78\xe8\xeb\x8d\x4f\x13\xc6\x44\x8f\x4f\x13\x86\x5d\xf9\xf8" - "\x34\xc1\x19\x7f\x7c\x9a\x50\x1d\x7f\x7c\x9a\xd0\xa0\xe4\x61\x82" - "\x2f\x5a\x1e\x26\x78\xa2\x79\x02\xb4\xfb\x5f\x1b\x9f\x26\x66\xc5" - "\xc8\x40\xd5\x49\x9a\xf8\x2e\x6c\x0a\xdd\xde\x9c\xf4\x5c\x34\x8e" - "\x13\xa7\xc4\xef\xb7\x89\x85\xe8\xb7\xaa\xf8\xfd\x36\xb1\xbc\xff" - "\x7e\x9b\x58\x8b\x7e\xab\xba\xb4\xdf\x26\xee\xb9\x72\x9b\x62\x62" - "\x7b\x74\x9f\x4d\x3c\x7a\xe5\x7d\x36\x69\x64\xfc\x3e\x9b\x34\x31" - "\x7e\x9f\x4d\xd2\x7d\xd3\x27\x6d\x8a\xee\xb3\x49\x25\xd1\x7d\x06" - "\xba\xfd\x0f\xfb\x0c\xfd\xb3\x46\xf9\x27\x4c\xba\x80\x79\xfb\x80" - "\x2e\xf7\xa4\x0e\x1f\xdd\xbb\x47\xcd\xad\xef\x55\x63\x87\xea\xc3" - "\x77\x90\xc7\x77\xe9\x38\x70\xaf\x45\x4f\xfb\xd9\xa5\xfd\x70\x6f" - "\x06\x74\x74\x47\x63\xa9\xdc\xdb\x52\x7d\xc8\x34\x47\x3e\xcf\x72" - "\xde\x9f\xba\x77\x22\x97\x45\x1f\x0b\x6f\x30\x44\xac\xd7\x91\x3f" - "\xc0\x70\xf8\x6c\x68\x0c\xac\xe2\x2b\x19\xe3\x2f\xe3\x53\xb3\xc6" - "\x53\x76\x07\xe0\xdd\xf7\xbc\xe2\xd5\x7b\x63\xed\xdf\x7a\xbc\x7b" - "\x58\xf1\xe9\xe4\x11\x31\x38\x04\xe2\xf3\xe9\x7d\xa9\x68\x43\x7d" - "\x7c\x3e\xbd\x2f\xb3\x7f\x3e\xbd\x0f\xfd\x4f\xf5\x11\x73\x9f\xc1" - "\x8f\x87\x7c\x31\x73\x9f\xfb\x1c\xd6\x80\xe2\x1d\x69\x13\x55\xee" - "\x5d\xd3\xe5\xbe\x2f\xd6\xfe\x43\xdf\xe4\x0e\xd4\x71\x4e\x8a\x29" - "\xdf\x8f\xfd\x77\x1f\xdb\x7f\xef\xf4\x83\xf3\x65\xec\xbf\xfb\xd8" - "\xfe\x7b\xe7\x52\xd9\xca\xd5\xed\xbf\x78\x73\xbc\xdc\x91\xf1\xfb" - "\x3f\x37\xa6\xff\x29\xaf\x04\xf3\x61\x59\x3e\x3a\x5f\x51\x64\x3e" - "\xf6\x4d\xe2\xbc\xcc\x23\x71\xf2\xd6\xc4\xc2\xec\x27\x9f\xe7\x12" - "\xde\x63\x5f\xaa\xb8\xbc\x97\xab\x9f\x29\x99\x3c\x31\x5a\x1e\x27" - "\x9b\xa3\xe5\xf1\xbe\x86\xe8\x72\x93\x33\xa2\xdf\xdf\x1b\xf8\xdf" - "\xd3\xb1\x93\x37\xc5\xf0\xc0\xc1\x93\x74\xff\x35\x8a\x07\xee\x9f" - "\x1f\x83\xc7\xae\xf8\x3c\x30\xb9\x11\xed\x3f\x18\x9f\x07\x26\xfb" - "\xfa\xe7\x81\xc9\x21\xd0\xf2\x60\x24\xdf\xce\x2c\xcd\x19\x10\x9d" - "\xe7\x7e\x7b\x7c\x9d\x77\x7f\x76\xfc\x35\x82\xfb\x67\x28\x1a\xdf" - "\x5f\x11\x4d\xe3\xfb\x1d\xd1\x34\x44\x5b\xfe\xe7\x34\xec\x8d\x07" - "\xd1\xe5\xbe\x3f\x56\xfe\xbd\x27\xe9\x27\xba\xfc\x4f\x79\x20\x06" - "\xc7\x80\xc2\x25\xde\xba\xc8\x4f\x78\xfe\xeb\x8d\x4f\xcb\x9f\x8c" - "\x8c\xdf\xe6\x9f\x4c\xc4\x18\xe4\xd5\x2e\x91\xa5\x9f\xcc\x46\xfa" - "\x4c\x5e\x0f\xe5\xf5\x90\x3a\xa4\xcf\x0c\x91\x45\x8e\x57\xbd\xe3" - "\xd2\x4f\xca\xd9\x17\x85\xe9\xcf\xfc\x6b\x1d\x46\x33\x78\x0c\x62" - "\xbc\xf2\x4b\xa5\xdf\x82\x75\x0d\xf3\xfa\x8d\xcc\xeb\x3f\x91\xf6" - "\x1f\xef\xb3\xb0\x1f\xa1\xd5\x49\x33\x38\x2e\x85\xc1\xef\x9c\x3f" - "\x06\xf6\x71\x96\x0b\xce\x6f\xe4\x55\xeb\x66\xe5\x31\xba\x69\x8a" - "\x39\x7e\x1f\x4f\x19\xd6\x3f\xef\x4c\xc9\x56\xfd\x3c\xa5\x28\xba" - "\x9f\xa7\xcc\xd0\xdc\x83\x66\x71\x5b\xc1\x03\x57\x24\x27\x25\x76" - "\xe1\xef\x57\xdf\xaf\x7e\xb4\xb5\xb8\x8c\xbe\x75\x9a\xa6\x1c\x93" - "\xf5\x99\x44\xd0\xba\x2a\x81\x1a\xa5\x0e\x98\x7a\x8b\xc4\x13\x79" - "\xf2\x43\x64\x12\xab\x9f\x6e\xe5\x77\xf5\x6e\x11\x44\xbe\xa3\xbc" - "\x27\xc0\x67\xab\xc1\x0b\xd7\x9e\xa0\x29\x67\xa2\xca\x43\xf2\xbd" - "\x0a\x46\x66\xbd\x94\xc7\xa9\x19\xc6\x9a\xee\x1a\x3c\xc7\x5f\xf7" - "\x9d\x9a\x6b\xf8\x3e\x28\x9f\xb1\xa9\xfd\xee\x5f\x32\x4e\x7c\x56" - "\x86\x71\xba\xbc\x1e\x98\x5a\x6b\xf0\xaf\xf2\xb5\x9c\xba\xab\xcf" - "\x97\x6f\xea\x7e\xbc\x2b\xb8\xcc\xda\x60\x84\x1c\x4c\x6d\x8b\x84" - "\xa3\x62\xa2\x4c\x0d\x1a\xfe\x78\x5d\xee\x69\xe6\xaf\x80\xa5\xe3" - "\x33\x6d\x64\x34\x3e\xd3\xc6\xc2\x4e\x49\xd7\x61\xe4\x5e\x0e\x06" - "\xf7\xb9\xe2\x59\xe6\x87\x69\x05\x97\x5b\xf3\x4b\xb4\xd1\x8c\x8d" - "\x97\xf0\xd6\x34\x69\x2f\x31\x8c\xaf\xc0\xf1\x68\xd4\xdc\x42\xee" - "\xdd\xf3\xde\xd6\xf4\x2d\x4a\xee\xa7\xc7\xac\x11\x4e\xeb\x90\xfe" - "\x54\xba\xdc\x3f\x1e\x8a\x95\x83\xe9\xa9\xc6\x18\x1d\x93\x9e\x61" - "\xc8\x3d\xe6\xb5\x0c\x37\x66\x9d\x75\xfa\x44\x25\x0b\xd3\x6b\xb5" - "\xe4\xc8\xf9\xda\x74\x69\xff\x19\xeb\xa5\x78\x3f\x31\xa6\x5c\xcc" - "\xfa\xdf\xb4\x0e\xd1\xff\x3a\x7d\x2a\xfa\x37\xc0\x7b\x5b\x2a\x56" - "\xc3\xf4\xa6\x98\xf5\x0a\xff\x06\x79\xfe\xfe\xaf\x80\x3b\x43\xd7" - "\x7b\x0f\x8c\x8f\xa9\xaf\xc3\x75\xe6\x72\xed\x9f\xd1\x4f\xfb\x67" - "\xf4\xb5\x7f\x81\x84\x1b\xb3\x96\x38\x43\xb6\x3f\x7c\x89\xfe\x9b" - "\xc1\x3e\xa4\x06\xdd\x60\x73\xcf\xd8\x6b\xd8\xea\xbc\x7e\xd0\xbf" - "\xad\x3e\xa3\x6f\xfd\x4f\x95\xeb\x5b\xff\xf3\xc7\xb3\xd5\x7d\x24" - "\xf7\x56\xa3\xeb\x6e\xb5\xd6\xc6\x6d\x4b\x3f\xeb\x7f\x0f\xe8\xeb" - "\x7f\x0f\x14\x44\xeb\xb3\x07\xec\xd1\x7d\x38\x23\xa6\x0f\x1f\xc8" - "\x89\xee\xc3\xe9\x1d\xff\xdd\x71\x0d\xcf\x94\x98\x98\x68\x4a\x4c" - "\x30\x25\x24\xe2\x35\x9a\x48\x03\x12\xcd\x89\x49\xf8\x5d\xa5\x5f" - "\x07\x98\x12\x4d\x66\xfc\x92\xf4\xeb\x55\x31\xcf\x03\xb8\x2c\x7e" - "\x66\xfd\x9a\x14\xf3\x7c\xd5\x57\xbc\x1f\xa0\xd7\x6b\xd4\x6f\x8e" - "\x79\x4e\xfa\x8a\xf7\x57\xfd\x0f\xcb\xd3\x25\xcf\xd1\x7e\x68\x93" - "\x17\x2c\x99\x53\x34\xbf\x50\xee\x17\xcf\xb5\xcf\x79\xf2\xc9\xb9" - "\x8b\x17\xdb\x4b\x16\xda\xef\x19\xff\xe0\x1d\x77\xd9\xd5\xb6\x73" - "\xd1\xb8\x11\x85\x29\x34\x75\xe9\x22\x7e\x31\x75\xe6\xe4\x3c\xfb" - "\x8c\x7b\xc6\x47\xbf\x34\xc0\xc8\xed\xe5\xcb\x41\x89\x90\xbf\x9c" - "\xca\x21\x44\xeb\x5e\x91\xba\xa7\x8d\xfd\x7c\xd5\x9a\xc7\xcf\x0e" - "\x35\xb1\xff\x68\xb7\x4b\x78\x6e\xe4\x3d\xfd\x99\x73\xb9\x11\xa3" - "\xb6\x96\x53\xf1\x13\x7c\x7e\x65\xe6\x2a\xf1\x91\x9f\xec\xf7\x93" - "\xe9\x04\xcd\xfe\x73\x63\x2e\xf2\xe2\xd9\xeb\x0b\x91\xdd\x45\x16" - "\x94\x7f\x16\xef\x12\xc4\x8f\x35\xa4\x05\x74\x5f\xe8\x9f\xae\x92" - "\x69\x1f\x95\x1b\xf9\xac\x27\x69\xd6\x08\xf1\x91\x90\xcf\x7c\x3e" - "\x48\xe5\x9b\xf9\xa5\x30\x3d\xb8\x9f\x75\x43\xed\x60\x32\xf3\x5e" - "\xe8\x6b\x83\xc9\xf2\xda\x10\x8e\x59\x32\xb3\xc3\xd8\x0b\xad\xc4" - "\xb3\x8f\x66\x1f\xe5\xba\x39\xaf\x66\x7a\xf0\x04\xe7\xaf\x8b\xca" - "\x3f\x6b\x58\xdf\x5e\xec\xcc\x0e\x13\xf2\x4d\xff\x9c\xac\xd6\xb0" - "\xf8\x47\x30\xe5\xed\x82\xdb\x72\x29\xc1\x8b\xae\x68\x0a\x95\x93" - "\xf2\xf9\x99\x35\x77\x59\x58\x84\xd8\x3f\x7d\x6a\x87\x4b\x54\x3d" - "\x43\x66\xc8\x74\x82\x67\x11\xfb\x28\xcc\x9a\x52\x3f\x97\xcc\x68" - "\xff\xb0\xd3\xf4\x50\xa9\x7d\x1a\x91\x6b\x2a\x99\xff\xe4\x64\x7f" - "\xc3\xbd\xda\x86\xbf\x90\xf9\xad\xee\x72\x53\xb7\xb0\x51\x69\x89" - "\x68\x17\x1c\xc7\x28\x20\x82\xec\xe3\xdf\x54\x10\xe6\x3c\x67\xbb" - "\x5c\x36\x6a\x29\x09\xd0\xca\xe3\x22\x58\xf1\x17\x75\x36\xa0\xb9" - "\x23\xc0\xfe\x8b\x96\x95\x53\x29\xf1\x64\x1e\x99\x9a\x1d\x35\xe4" - "\x9d\x1d\xa0\xd2\xe3\xa2\xbd\xa9\xe0\x0b\x6a\x71\xec\xa6\xfc\x56" - "\x32\x35\xb5\x7d\x46\x32\x16\xcf\xda\x33\xec\xf7\x68\x5b\x39\x9f" - "\xd3\x2e\xd0\xf2\x95\x34\x70\xf9\xa7\x64\xf5\xb6\xb7\xa2\x9e\x33" - "\xf4\xc8\x31\x4a\x00\x3c\xd3\x8a\xcf\xc8\xb6\xe2\x61\xf6\xf3\xcd" - "\xa1\xda\x32\xb2\x09\x57\x66\x6a\xb7\x2b\x33\xad\x5b\x64\x0e\xee" - "\x72\x65\xa6\xb7\x14\x23\x7f\xdb\x87\x34\xa8\x95\xd2\x3f\x3a\xdd" - "\x6a\xaa\x39\x4f\xc3\xb8\x4d\x27\xd1\xb6\xda\xf3\xc8\xbf\xf6\xe3" - "\x72\x0d\x65\x23\xcb\x84\x92\x3f\xae\xf1\xe6\x05\x49\x03\xac\x9a" - "\x6e\x1a\x56\xdb\x4d\x36\xad\xf2\xe3\x72\x2e\xd7\x41\x3f\x5d\xe6" - "\x6d\x22\x2a\x5d\x29\xc2\x3d\x6b\xf7\x16\x40\x27\x0e\x78\xe7\x89" - "\xfd\x66\x6f\x53\x07\x35\x07\xba\xa9\x85\xfe\x4a\x5e\xe7\x29\xcf" - "\x5b\x4f\xec\xe7\x35\xeb\x04\xcf\xf2\x36\xd4\xa5\x78\xc7\xd5\xcc" - "\x67\x95\xcb\xa9\xaa\x8c\x52\x8b\x97\xd3\x80\xd3\x48\x57\x73\xfb" - "\x06\x87\x37\x74\xca\xb3\x5c\xfa\xe3\xce\x3e\x5a\xd6\x4c\x89\x2d" - "\x81\x1a\x6e\xbf\x29\x9c\x72\x86\xbc\x81\xa3\xe4\x2d\xfe\x9b\x47" - "\xb3\x74\xb4\xaf\xd3\xc8\xf2\xf6\xc5\xa3\x26\xaf\xf9\x22\x79\xf3" - "\x02\x74\x10\x75\x8b\xb5\x67\x52\xa1\xb7\x72\x5a\x02\x41\x3e\xef" - "\x94\x25\x3a\x6d\x29\x55\x8b\x68\x64\xdd\x79\xca\xd8\x72\x9e\x32" - "\x45\x57\xa6\x89\x7d\x6c\xf9\x6c\xea\x16\x5c\x53\xdb\xc8\x82\xb6" - "\x2b\x7f\xec\x64\xdd\xd7\xb6\x27\x93\xea\xbb\xfb\x7c\x6d\xbb\x3b" - "\xfb\x7c\x6d\xc1\x53\x7e\xf6\xb7\xf5\xd1\x43\x6b\xac\x4d\x34\x00" - "\x72\xd2\xc0\xfc\x5d\x75\x96\xcc\xab\xcf\x12\xdd\x56\x6e\x22\xfb" - "\x3c\x3e\x67\xf1\xb3\xb9\x5e\xf4\x0d\xdf\x9f\xa0\x9f\x0d\xc3\x35" - "\x15\xbf\x04\xa4\xcb\xf8\x0d\x6d\x3a\x1f\x23\xcd\x84\xb4\x24\x5c" - "\x13\x21\x2f\x61\x57\xad\xf0\xa3\xae\xfd\x9d\x26\x4a\x61\x7e\xd6" - "\xfd\x7b\xf7\x77\xb9\x7f\x1a\xf0\xd1\x33\x1d\x06\x5f\x2b\x1d\x3f" - "\xd3\x7f\xf0\xc4\x19\x8e\x97\xe5\x97\x78\xf5\x38\x12\x38\x76\x96" - "\x9e\xce\x38\x3c\xc6\xf5\xa2\xfe\x1c\x5c\xad\xf8\x41\x4e\x7f\x7a" - "\xcc\x28\xdb\xd9\xe3\x40\x9d\x3f\x7b\x08\xe9\xc2\x48\x47\xbb\xcd" - "\xfc\xee\x77\x27\xce\x98\x54\x9e\x4c\x13\x60\x06\x75\xf8\x90\xfd" - "\x99\x9b\x58\xc6\x3b\x4d\x56\x71\xb8\x60\x0c\xd5\xbe\x22\x9a\xb6" - "\xbc\x22\x1a\x95\xec\xfd\xac\xc6\x47\x0b\x8d\xf8\x42\x8d\xeb\xf0" - "\xee\x30\x46\x1d\xa6\x4b\x63\x21\xfb\x93\xfd\x0c\xf6\xdf\xd5\x07" - "\x22\xdb\x20\xdc\x0f\xd4\xf0\x58\xfa\x9b\xb2\x23\x49\xd0\x01\x35" - "\x2d\x6d\x1d\xf4\x56\x77\x7b\x92\xeb\x8f\x64\xf2\x86\x4e\xd0\xe8" - "\x74\xb2\xb1\x3d\x58\xff\x8a\xf0\x6d\xe4\xf8\x7c\xaf\x88\x0e\xf0" - "\xcb\x0d\xa7\x29\x2f\xe9\xbb\xe9\x94\xfe\xaf\x4e\xd2\xf5\x53\xde" - "\x0d\x11\xfa\x69\x7b\xb3\x6f\x7f\x84\x6e\x9a\xfd\xd0\xa5\xba\xe9" - "\xd1\x07\x94\x6e\x82\xec\x4b\x5d\x14\xf6\xe9\xe9\xe3\x62\xd2\x75" - "\x3f\x91\x47\x87\xc7\xa4\x07\xf5\xf4\x81\x31\xe9\x7e\x95\xfe\xc8" - "\x54\x43\xf7\xb5\x30\x1e\x4b\x59\xf7\x3d\x72\x3b\xeb\xbe\x96\x02" - "\x5d\xf7\x49\xfd\xf3\xc8\x75\xe2\x5f\xa0\x8b\x96\xb0\xbe\x79\xf8" - "\x0c\xe3\x2f\x3e\x22\x03\xf7\x64\xa4\xbd\xcd\x69\xd5\x7f\x25\x33" - "\x7e\x86\xde\x13\xac\xf7\x58\xe7\xb1\xee\xdb\x3c\x44\xb4\x6e\x7e" - "\x45\x1c\xab\x95\xb1\x7f\x1e\xee\xd5\x7f\x2f\x22\x6d\x1d\xd2\x5e" - "\xc4\x7b\xd6\x83\x4c\x93\xe6\xbc\xfd\xc4\xfe\x27\xb0\xb5\x42\x9a" - "\x29\x8b\x36\xa0\xbf\xf9\xbc\xe1\x1a\xd0\xd7\x9a\x40\xc5\xde\x12" - "\x3e\xc3\x1a\x66\x9f\xb4\xb6\x96\x92\x36\x96\xbb\x21\xab\x21\x67" - "\x5e\xe7\x17\x54\x16\x10\xa7\xf9\xdc\x1d\xe3\x90\xbf\xec\x7e\x8e" - "\x97\x94\xd0\x88\xd9\x30\xfb\x85\xb3\xce\x06\x2e\xe6\x6a\xe0\xa4" - "\xe2\xb3\x3c\xbc\xcd\x47\xdb\xca\x55\x5f\xcf\x3e\xca\x71\xd9\x4e" - "\x50\x5e\x3b\xe6\x7b\x41\x6e\x9b\x35\x5c\x4e\x7c\x0e\x86\x63\x15" - "\xf2\x75\xb3\x49\x73\x54\x1b\x67\x61\xdc\xd0\x0d\xc8\xe3\x6d\x0d" - "\x12\xe3\xec\xa3\x87\xc7\x34\x97\xee\xe7\xf2\xad\x4c\x1b\xe1\x76" - "\x19\x30\x12\x24\x0c\x93\x9c\x37\x3a\x90\x4f\xad\x9d\xa7\xec\x2d" - "\x68\x9e\xed\x27\xd6\xfb\xde\x76\xc0\x28\x3d\xa1\x60\x00\x96\xc0" - "\x18\x10\xf5\x4e\x87\x3f\x70\xa5\xf8\x07\xe0\x6f\xe3\xfe\xe2\x73" - "\x91\xbc\xdf\x06\xba\xa4\xb2\xaf\xbc\xb2\x45\x1f\x1e\x55\xff\x57" - "\x22\xfd\x6c\x27\xf8\xed\xe1\x91\x7c\x6e\x89\xcf\x73\x5e\xee\x2c" - "\x27\x68\x94\x61\x9c\xe7\xd4\x96\xfe\xef\x9e\xe5\x04\x6c\x5b\x9d" - "\x49\xec\x06\xfe\x23\xf9\x3c\x27\xf0\x5f\xc7\x7c\xa8\xb7\x29\xeb" - "\xe5\x47\x24\xcd\x4b\x38\x0d\x73\xc7\x23\x46\xff\x73\x7b\xb9\x2d" - "\x78\x97\xa7\x6c\x44\x81\xf9\xc7\xa3\x59\xfc\x1e\x69\x13\x39\xff" - "\x68\xe8\x31\x2f\xc6\xb0\x77\x4e\x84\x4d\x55\xcb\xc9\xac\x74\xda" - "\xec\xc9\x5c\x5e\xe9\xb4\xd9\xd4\xa7\xd3\x1e\xbd\xa0\x74\x9a\xa2" - "\xb1\xd2\x69\x8f\xfe\x5d\xe9\xb4\x47\x3f\x97\xfb\x62\xd0\x69\xfc" - "\x8e\xf5\x9a\xa1\xd3\xb6\x0c\x11\x47\x58\x77\x74\xb9\x1f\x3d\x6a" - "\xe8\xb6\xf5\x48\x63\xdd\xc1\x38\x2a\x3d\xf5\x48\xa6\xf8\x7f\x33" - "\x49\xf9\x1d\xf0\xbd\x83\xcf\x2f\xb4\xeb\xf7\x3c\x9e\x8c\x57\x3a" - "\x6e\x76\x46\x9f\x8e\x7b\xb4\xa1\xaf\x2c\xeb\xb8\xd9\x3f\x54\x3a" - "\x4e\xa5\xd7\x3f\xc2\x3a\xee\x91\x4c\xa6\x81\x0e\xdf\xc4\x6b\x78" - "\x7a\x7e\xa6\x63\x56\xa4\x8e\x8b\x96\xaf\xd9\xa5\x86\x8e\x63\xdd" - "\x86\xe7\x75\xd0\x69\x72\x0e\xc9\x72\xb6\x09\x34\x37\xe4\x8e\xfb" - "\x80\xdb\xcc\xf1\xd7\x98\x6e\x13\xce\xd0\x00\xfd\xec\x90\xde\xee" - "\xd9\x47\x0c\xdf\x47\xd0\xff\x68\x3c\x3b\xba\x2f\x46\x22\x7d\x9b" - "\xcf\xce\x7b\xcb\x4f\x90\xb7\x46\x94\xb7\x84\x8e\x53\x7e\x09\x74" - "\x45\xe2\xd3\x9f\x73\xdf\x62\xde\xf1\x23\xbe\xb2\xee\x39\x4d\x8f" - "\x0d\xcc\x0f\xd0\x55\x98\xab\x7f\x5e\x65\xc2\x3b\x67\xd4\x3b\xb9" - "\xc6\x70\xdb\x22\x8e\xaf\x07\x41\xe8\x67\xbe\x7f\x85\xf5\xad\xbc" - "\x4c\x7d\xaf\xc9\xfa\x60\x53\x61\x0e\x74\xcd\x59\x7a\x4c\xce\x4b" - "\x64\x7c\x9b\xd5\x71\x61\xfd\x51\x7f\x9f\xd4\xcf\xfb\xbf\x5f\xbe" - "\xfc\xe3\xc9\x97\x2f\xff\xf8\x2d\xac\x8b\xd0\x3e\x6b\xd8\x1d\x0d" - "\x67\x50\xc8\xc8\x77\x9a\xf3\x3d\xa0\xaf\xc5\x7c\xee\x1a\x2e\xe7" - "\x68\x36\x03\x26\xf3\xdf\x06\xe4\x93\x31\x43\xa0\x2b\x27\x2e\x23" - "\x8e\xd7\x12\x59\x76\x7d\x1f\x8d\x1f\xcf\xb9\xcc\xba\x5f\xaa\xb7" - "\x86\x64\xcc\xd8\xc3\xb0\x49\x39\xa6\xd1\xa6\xde\xf5\x8f\xc7\xdb" - "\xa0\x37\x7d\x11\x7e\xb1\x3c\x1f\xfb\x36\xc7\x35\x60\xfb\xb2\x4a" - "\xcd\x37\xaf\x87\x7e\x1e\xcc\xe7\x61\xf8\x6c\x4c\x7e\x78\x86\xe9" - "\xb0\x8c\x65\x96\x6f\x37\xca\xf6\xb7\xce\xc2\xf5\xea\x75\xb2\x8f" - "\x69\x00\x65\x66\x19\x65\x18\x36\xfb\x29\x62\x5c\xfe\xb6\x3c\x53" - "\x1a\xea\x60\x5d\x78\x3d\x6c\xd1\xc1\xaa\x9e\x02\xd2\xeb\xa9\xf0" - "\xd1\x63\x33\x2e\x77\x36\xa3\xff\xf6\xe5\x37\x5e\x79\xfb\x48\x6f" - "\x5f\x01\x7d\x45\xfb\x2e\x53\x6f\xc1\xd8\x2b\xaf\x37\xcd\xa8\xd7" - "\x79\xe5\x74\x2d\xd8\xf5\xf5\xe9\x9a\xa5\xd3\xb5\xc0\xf7\x15\x74" - "\x8d\x53\xcf\x9c\xf4\xaf\x5f\x8f\x5d\xaf\x67\x4e\x6e\xbc\x7a\x48" - "\xfe\xf5\x7b\x6e\xca\x62\xc4\xda\xec\x84\xec\xa8\x58\x75\x73\xaa" - "\x23\xe3\x17\x77\x4a\xb9\x9a\xb3\xad\x37\x5e\xb2\xda\x2b\x87\xae" - "\x9e\x73\x28\x7f\x2b\x8f\xef\x42\xf3\xd1\x9c\x46\x8e\xe3\x3a\x71" - "\xa5\x3a\x93\xad\x97\x69\xbd\x5c\xdc\x64\x8e\xd1\xc5\x31\xf9\xbc" - "\x36\xb4\xbd\x86\x63\x97\x1c\x2a\x60\xff\x7b\xcc\xa9\xa0\xe3\x9f" - "\xb8\x81\x63\x8e\xe1\x7e\x00\xee\x33\x95\x0e\x78\x22\x13\xf5\xf4" - "\x7f\x76\x72\xed\xa1\xe2\x6d\x65\x59\x49\xfd\xf9\xd7\xa3\x3c\x6c" - "\x8a\x67\xe5\xda\x94\x96\x72\x70\x06\xe6\x12\x7a\xbc\xbf\xc2\x2f" - "\x64\x0c\x38\x57\x1e\x9f\x27\xc1\xb8\x58\x38\x50\x3f\x07\x00\x7a" - "\x94\x83\xae\x4f\x6c\x35\xe8\x61\xa4\x23\x6d\x8f\x41\x0f\xd8\x37" - "\xa9\xde\xad\x21\x3e\xa7\x13\x50\x67\xb2\x9f\xf8\x77\x51\x79\xc8" - "\xa1\x60\x3f\xa9\xf6\x68\xb8\xbe\x9e\x3c\xb3\x9c\x37\x95\xf1\xbc" - "\xe9\xc9\x03\xfe\xe4\x43\x0e\x03\x0f\xb1\xd8\x66\xe2\xb3\xdf\xa3" - "\x31\x96\x6e\x50\x31\xf7\x12\xf8\x9c\x9c\x7c\xbf\x38\xd3\xa4\x68" - "\xf2\xe4\x38\xd1\xc9\xb1\x63\x24\xec\x54\xe0\xd9\xc6\x70\x7d\xb8" - "\xfa\x57\x64\x72\xdc\x0b\xbd\x3d\x4f\x8e\xd0\xd6\x1e\x9c\xa1\x75" - "\xd9\x4c\x06\xbe\x75\xf2\x4c\xeb\x93\x68\x7f\x81\x8a\x13\x2b\xf1" - "\xb1\x99\xd8\x9f\x5f\x4b\x39\x54\x2c\x56\xd8\x68\xcf\xa2\x76\x39" - "\x6f\xe2\x3a\x47\xa3\x7e\xc1\xf3\x24\xd8\x26\x28\xb7\xb5\x97\x6e" - "\x80\x2b\xba\x0c\xba\x3d\x39\x45\x8d\xcb\xaa\x8d\x81\x15\x36\xd3" - "\x61\xbf\x3c\x6f\x47\x19\x76\xd7\x97\x2a\x16\xf6\x93\xc7\x0d\xda" - "\xf5\xe2\x04\x7c\x38\x8f\xf2\x6f\x7a\x32\x64\xe0\x24\x65\x37\x85" - "\xcf\xef\x3e\xe1\xe7\x73\x43\x8a\xfe\x87\x53\xbb\xdc\x85\xf6\x4b" - "\xe9\x5f\x38\x26\x82\xfe\x89\xcc\x7b\x4c\x7f\x5e\xeb\x00\x5d\x1e" - "\x03\x2d\x2d\xea\xbc\x03\xdb\x33\x85\x73\xf1\x9c\xca\x78\x6a\x95" - "\x06\xcd\xf3\xcc\x6a\x9d\xac\xb0\x26\xa2\x1f\xd0\x5e\x1b\xdb\x6a" - "\x09\x46\xfb\xb9\x0c\xd3\x80\xe3\x4a\x72\xdd\xc0\xe7\x6a\xd4\xbd" - "\x3b\xb6\x4d\xab\xd5\x59\x12\x52\xbe\x25\x85\x47\x23\x62\x8b\xfb" - "\x4b\xec\x22\xa8\xce\x25\x17\x3a\xf7\x94\xf9\xcd\xfd\xe9\x00\xe6" - "\x41\x19\xa3\xd2\x24\xd7\x15\x60\x73\xcd\xfb\x44\x00\x37\xd5\xf7" - "\xf3\xb6\xa8\xb4\xb9\x7f\xc7\x15\x3c\x36\x77\xbc\x40\xdd\x7e\x97" - "\x8c\xb1\x82\xb6\xcd\xf3\x31\xcf\x19\x7c\xc6\xeb\x90\xca\x67\x7c" - "\xee\x76\xd6\x29\x06\xcd\x81\x7f\x4a\x97\x7b\x6e\xb1\x81\xbf\x91" - "\x9f\xfb\x8e\xf3\xf0\x9e\x4d\xa3\x3d\x28\x75\xad\x3a\x33\x34\xb7" - "\xd6\x90\x61\xae\x83\xfb\x99\x75\x0d\xd3\x43\xd1\x62\xee\x81\x68" - "\x58\x36\x93\x8a\x9b\xc9\x3c\x0f\x79\x5c\x1e\x4c\x42\x1e\x5f\x1f" - "\x8c\xb9\xb3\xd5\xbb\x5e\x3c\xd9\xcf\x5f\xfa\xe2\xa9\xfe\x98\x37" - "\x99\xdb\xd5\x87\x2f\xcb\xdf\xbc\xde\xfe\xe7\x77\x01\x97\x8d\x63" - "\xf0\x4a\x1d\x53\x32\x9c\xf1\xf5\x73\x6c\x5b\xc9\xeb\x80\x5f\xcd" - "\xb8\x73\x1e\xa3\xcf\xfa\x78\x71\x9e\x23\x12\x8e\x70\x49\x5c\x25" - "\x1c\xa5\x3b\xfc\xbc\xb7\x6d\x57\xfb\x2d\xf3\x36\x45\xb4\x3b\xd5" - "\xc0\xa7\x4f\x27\xcc\xdb\x13\xcb\x93\x5c\x37\xc7\xe2\xd3\x61\xb3" - "\x2e\x49\x3b\x41\xf3\xb6\xea\x78\xd9\xb8\x1f\xfb\x1b\xdf\x38\xce" - "\x25\xc7\x3e\xdd\xa8\x74\x08\xfa\xd9\x31\x7c\xa3\x3a\x47\x14\x50" - "\xf1\x4f\x7f\x3e\x42\x98\x7e\xc5\xb4\xe2\xf5\x74\xbf\x8c\xd7\x21" - "\xcf\x98\xff\x9c\xf7\xf8\xc5\xa0\xe2\x5f\xc9\x58\xb7\xba\x6f\xa0" - "\xbf\xb1\x38\x24\x63\xf9\xb9\x4a\xf8\xcc\x6d\x88\xe7\x7a\xd2\xf7" - "\xed\x70\x49\x88\x66\x06\x59\x26\x7e\x5e\xc2\x67\xe9\x55\x1c\xf1" - "\x9f\x97\x1b\xe7\xe7\x39\x76\x26\xc7\x7d\x85\x1e\x4a\xec\x8b\xdb" - "\xea\xc8\x63\x1b\x4b\xef\x5f\xda\x60\x12\x47\x95\xfc\xff\xfc\x8f" - "\x7c\x5e\x5e\xed\x63\x9d\x80\x4e\x48\x3c\x75\x82\x7e\xfe\xb9\x5a" - "\xf7\x31\x74\x94\xe3\x61\xde\xcb\xf2\xe9\x30\x50\x57\x07\xe4\x7b" - "\xc6\xa5\xba\xe4\xe7\x7f\x34\xe6\x2e\x7c\xfe\x4e\xed\x8b\xf5\xc1" - "\xf3\xd1\xcf\xe5\x5c\xb0\xaf\x0f\x3e\x06\x2c\x47\xf6\xa5\x7a\xc1" - "\x31\xc5\x90\xbd\xe2\x1b\xf9\x0c\xf7\xcf\xd3\xb8\xfe\xfe\xc6\x0b" - "\xe1\x7a\x98\xfb\xc9\x72\xd2\x1e\xbf\x6f\xe2\xef\xb3\x39\x76\x1b" - "\x6d\x30\x68\xa2\xda\x30\x3f\xb9\x33\x65\xef\xba\xbe\xb6\xcf\x97" - "\xb6\x6b\xc4\xfb\xf1\x11\xb4\xe1\xe7\x1c\x35\xae\xcd\x07\x7d\x0a" - "\xf5\x58\xb5\x2a\x0d\xb2\xf3\xb4\x58\x91\x47\x0a\xc7\xf9\x64\xc8" - "\x3a\xf2\x8e\xf4\xd1\x05\x9b\xda\xef\x9a\x8f\xf6\x3b\x2a\x54\x39" - "\xc7\x31\xc6\x25\x6e\x3b\xa3\x71\xdc\xcf\xb6\x86\x8a\xa9\x30\xff" - "\x7d\xc6\xd7\x7e\x13\xf7\xf1\xfc\xe7\xa5\x0e\xe7\xf8\x0a\x3d\x8e" - "\xa4\x40\x4f\x26\x75\xf6\x38\xa0\x17\x32\x4d\xa8\x07\xfa\xbf\x33" - "\xa0\xd7\xb9\xcb\xc0\x95\x71\x93\xf1\x39\xc5\xfc\xf8\xf4\xe5\x7a" - "\x65\xcc\x27\xc7\x00\xfc\x2c\xf8\x5d\xf5\x75\xed\x12\xd8\xe9\xed" - "\xfe\xca\x03\x69\xda\x12\x71\x84\xe3\x8b\x61\x2e\xd2\x5e\x05\xfe" - "\x1d\xb4\xca\x03\xdb\xfc\x31\x53\xfe\x32\xca\xc1\x9c\x99\xc4\x45" - "\x91\x5d\xa7\xe1\xba\x44\x8c\xe1\x38\xe3\x78\xce\xd2\x9f\x47\xf2" - "\x73\xe7\x12\x31\xbb\xcb\xfd\x54\x81\xb1\x47\xa8\x62\xe3\x3c\x55" - "\xdc\x1b\x4f\x28\xf1\x51\x3e\x4f\xc4\x71\xa7\x34\xcc\x85\xda\xb9" - "\xde\x7c\x9e\xcf\xa2\x3e\xe4\xab\x81\xbd\xd1\xc6\xf9\xfc\x89\xb7" - "\x0e\xc6\x2f\xb3\x9f\xbd\xd4\x76\xc6\xab\x33\xf9\x40\x9a\x81\xeb" - "\xa0\x40\x8e\xe9\x6b\xe2\x16\x32\x70\x43\xfa\x91\x2a\x95\x1e\xe2" - "\xf8\x87\xec\xeb\xd8\xe5\x7e\x7a\x98\x81\xab\x81\x03\xd7\xc7\xe7" - "\x37\x45\xca\xde\x1a\x8e\x3d\xc3\xf5\x71\x3c\x55\xe4\xcd\x35\xf0" - "\xfd\xba\xbc\x5c\x56\x2b\x04\x8f\x9f\xac\x7f\xed\x43\x89\x5a\x02" - "\xac\x53\x9e\xae\x3d\x5c\x1b\xe0\xf5\xee\xd7\x51\xc7\x6b\x9d\xc2" - "\x41\x5a\x8f\x23\x6e\x1f\x73\x19\xe4\x6f\x95\xfa\x61\xed\xde\xd7" - "\x34\x91\x0b\x3d\x81\x72\x3d\xb9\xbc\xd6\x04\xb9\x2d\x32\x37\x96" - "\xb6\xf3\x99\x4b\xe8\x9c\x22\x33\xf2\xd4\xb0\x9d\x85\xf9\x56\x50" - "\x7e\xbf\x02\xba\xc9\xb3\x64\x0c\x60\x14\x25\x99\x9d\x64\x6e\x8c" - "\x89\x53\xd5\x1f\x7f\x74\x5a\x0e\x56\x74\xae\x3d\x58\xd0\xe5\x2e" - "\x82\xfd\xff\x4c\xbf\x7b\xbe\xab\x87\x80\x9e\xc8\x57\x3d\x94\xe7" - "\x7b\x45\x8e\xcb\xe5\x35\xf6\xab\x59\x07\x8d\xb6\x51\xaa\x48\x3e" - "\x58\xc1\xfa\xb6\x33\xe5\x60\x01\x8f\x25\x28\xdf\x60\x94\xe7\x71" - "\x9d\xc7\x0e\xf4\x97\xad\xaa\x57\x1f\x16\x1d\x55\xf2\x5c\x74\xd4" - "\x90\xd1\x78\xf5\x94\x6c\x13\x9a\x6b\x04\x99\xbc\x18\xb7\x6e\x0b" - "\x52\x6a\xdd\xeb\x44\xd5\xcb\x45\x70\xe3\x72\xcc\x61\x86\xf2\xf7" - "\x2e\x8a\x72\x59\x46\x99\xbf\x37\x80\x5f\x12\x81\xcb\xc6\x8b\xa8" - "\xb3\x4c\xe5\xd3\xfd\xd6\x6d\xc8\x57\x82\x6b\xba\x30\x99\x68\x53" - "\x19\x59\x36\x69\x64\xae\x2e\xa3\x61\x48\x83\xad\xfb\xcc\x2c\x43" - "\x66\xe3\xe1\x50\x55\x47\xf4\x12\xea\x5d\x55\x26\x42\x1f\x63\x3c" - "\x77\x6b\x22\xf8\x75\xe8\x8e\xf6\xef\x51\x6d\x7c\x66\x8f\x61\x13" - "\xe2\xde\x13\xed\x77\xf0\xcc\x25\x67\xbc\x9f\x58\xb8\xb0\x24\x7f" - "\xd1\x5c\xbe\x64\x8e\x78\xee\x96\x94\xc8\xb5\x10\x1e\xff\x54\x9c" - "\x8a\x67\x5a\x79\xdd\x71\xe3\x60\x63\x1f\x7d\x81\xcd\x58\xfb\xd4" - "\xfd\xf5\xef\xe6\x39\x1d\xcf\x7d\xf0\x6e\xcc\xa1\xd2\x95\x0c\x26" - "\xe1\x73\x0b\x99\x62\xeb\x9b\x37\xa7\x64\x4e\xd1\x5d\xbc\x63\x96" - "\x12\xa7\x9e\x05\xb9\x31\xf5\x94\xf7\xd6\xa3\xc6\x9f\x80\x89\xf3" - "\xad\x4f\xdc\x2a\x92\xdb\x73\xd4\x59\xe9\x05\xdb\x8c\x35\xad\x7e" - "\xfc\x1c\x5b\xc3\x6b\x3f\xf6\xb0\x3c\xb8\x56\x92\xe9\x77\xcb\x5b" - "\x4d\x6c\x47\x96\xe1\x9e\xd7\x16\xe4\x1a\x99\x1e\x2f\xea\xa3\xf3" - "\xad\x18\xdf\x17\x04\x45\xe5\x5e\xcc\x8f\x16\xf4\xbb\x66\x13\xe9" - "\x23\xc2\x3e\x85\x6d\xb4\x30\xed\x72\x3e\x47\x9c\x9f\xdb\xc3\x3c" - "\x1b\x53\xee\x79\xd5\x67\x0b\xc1\xff\x45\xf6\xde\xf3\xbc\x7a\x9e" - "\xaa\x21\x46\x1c\xae\x85\xb3\xfb\xf5\x17\xa9\x38\x58\xad\x78\x7c" - "\xe1\x27\x8d\x98\xaf\xa1\x9d\xbf\x38\x41\x0b\x0f\x99\x6d\xb0\x11" - "\x86\xd2\x4e\xdc\x7f\xc2\x65\xf9\x5d\x14\x1f\xdd\x70\x66\xab\x19" - "\xda\x05\x5a\x26\x41\xa8\x3f\x32\xeb\x37\x89\xf8\x99\x44\x82\xdc" - "\x4d\x4d\x44\x0f\x0e\xb8\xca\x4c\xd6\x41\xa9\x96\x6f\x7f\x6b\x98" - "\xed\xee\x1f\x8f\xcd\x76\x95\x95\x42\x2b\x87\x82\x56\x11\x19\x3f" - "\xed\x54\xfb\x43\xb7\x94\x93\xf4\xa7\xa9\x3c\x15\xf7\x2c\xe5\x7a" - "\xb7\x28\xe6\xb3\xeb\x5a\x8a\x48\x73\x3d\x47\xa6\x77\xba\x7d\x26" - "\x8e\xd1\xcc\xf6\x33\x7f\xeb\xe2\x04\x15\x3f\x70\x10\x69\xa0\x97" - "\x53\x54\x88\x34\x65\x77\x16\xff\x52\x5b\x2b\xd2\xfa\xe0\x9b\x89" - "\xe1\xbb\x5e\x23\xd3\xb6\xb2\x76\x93\xd7\xfc\x63\xf2\xda\x03\x74" - "\x10\xf7\x71\xfb\x0a\x75\xb2\x2d\xcb\x30\xea\xdd\x1a\xc7\xeb\x32" - "\xe9\xe7\x4f\x4d\x67\xa9\xf8\x8f\xbb\xfb\x29\xc7\xe7\xbd\x3b\x53" - "\x3e\xf8\xb7\x2e\xf7\xb3\x66\x1f\xdd\x33\x51\xb7\x65\x30\xe6\x3e" - "\x8b\xf9\xff\x42\x19\xe7\x09\xef\x3f\xe5\xef\xc2\x20\x2d\xd3\xc8" - "\x13\xdf\x9e\xe1\x35\x78\xe1\x61\x3e\x10\x17\xff\xde\xce\x67\x5b" - "\xfa\xf1\x83\x19\xe0\x75\xde\xc1\x7b\x91\x49\x83\xa0\x7f\x5c\x17" - "\x44\x4f\xd8\x4d\xe9\x10\x27\x53\xd8\x44\xdf\x0e\x5d\x14\x79\xcd" - "\x1d\xe7\x65\x4c\x53\xd6\x35\xbf\x99\xf7\xb1\xc9\x1b\x3c\xe7\xf1" - "\xae\xd1\xa8\x05\x76\xa5\xb7\xf6\x9c\x47\xc5\x3e\x0d\x53\x33\xfd" - "\x95\x9a\x9d\xff\xb7\xdc\x5b\xfe\x57\xa4\x0b\x19\x0b\xbb\xe7\xa2" - "\x98\xe5\x35\xff\x1b\xf1\x77\x8a\x78\x8c\x03\xdd\xed\x67\xe9\xd9" - "\x7f\x7c\x04\x38\xef\xfc\x07\x60\xc9\x98\x69\xe3\xe8\x20\xee\xd1" - "\xa6\xde\xf1\x2f\x6e\xac\x99\x04\xcf\x7a\xab\xf3\x31\x93\x86\xb1" - "\x94\x63\xdb\x61\x0c\x1d\xc3\xed\xc2\x73\x16\x3f\xe3\x3a\x92\xaf" - "\xd6\x55\x9e\x2d\xd6\xd0\x63\x3c\xb6\xe6\xf1\xb8\x89\xf4\x59\xf5" - "\x17\xe5\x58\x3b\x43\x7f\x9e\xa2\x3f\xe7\xea\xcf\x13\xf5\xe7\x1c" - "\xfd\x99\xd7\xe5\xf5\x31\x79\x51\x75\xaf\xbd\x60\x1a\x70\x14\xcf" - "\x5b\x8d\xbe\x00\x3e\x03\xad\xce\x95\x72\x6c\xd7\xf1\x18\xa3\xe3" - "\x95\xa5\x3f\x1b\xf8\xdc\x60\x0d\xad\xfc\x5f\xc2\x67\xb1\x3d\x1a" - "\x9f\xc5\x59\x11\xf8\x90\xd5\x99\xf3\x75\xf0\x49\xb3\xf2\x77\x22" - "\xfe\x07\xf8\x30\x2e\x9c\x86\xfa\x77\xc7\xe0\xe3\x31\xf0\x89\xcb" - "\x6f\x4b\x44\x3b\xdb\x35\x8b\xbf\x21\xe3\x3a\x0f\x60\x9b\xa5\xbe" - "\xdb\x88\x53\xb8\x38\x74\xb9\x38\x85\x90\x05\x8c\xdb\x25\x68\xff" - "\xe2\x26\xdd\x7e\x3b\xa0\xec\xfc\x92\x31\x86\xef\x18\xda\xda\x50" - "\xa5\xda\xba\x6b\x0d\xc7\xea\x5b\x46\xdf\x74\x39\x45\x3b\xe6\xdd" - "\xff\xc9\x73\xc3\x48\xb8\x45\x25\x8b\x17\x3f\x73\x97\xbd\x68\xce" - "\x82\xb9\xf6\x11\x85\xf6\xc5\x8e\xf9\xf3\x4a\xe6\x46\xfb\x53\xa4" - "\xe9\xdf\xef\x91\xe7\x44\x78\x2e\x25\xe7\xd2\xe0\x7f\xa9\x27\xa5" - "\x4f\x5e\xc9\x05\xe1\x2e\x29\x60\x9d\x5b\xf7\x92\xfa\xce\x13\xf0" - "\x69\x34\xc6\x10\x63\xfe\xcb\x63\x08\xd2\x8f\x63\x9c\x9c\x1d\x91" - "\xce\x79\xfd\x46\x1a\xc3\xd7\x75\xd3\x80\x13\x54\xf2\x4b\xae\x33" - "\x2e\x0d\x2f\x8a\xad\xb0\x9b\xf8\x1b\x16\x26\xe8\x14\xc1\x71\xb7" - "\xf8\xfc\x25\xca\x89\x93\xf4\x9c\x9c\x57\xcc\xc2\xb3\x9a\xb3\x09" - "\xe0\xf8\xdc\x43\x28\xb3\x0d\x69\x66\xb6\x21\x30\x0f\x6c\xe7\x72" - "\x48\x7f\x86\xe3\x60\x20\xdd\xa2\xc7\x13\xe3\xb4\x55\x1c\xa7\x02" - "\x69\x69\x11\x69\x2f\x23\xcd\x86\x34\xbb\x0e\x6f\x3b\xd3\x19\xcf" - "\x39\xfa\x3a\x19\xe7\x79\x5f\xaf\xb7\x3c\x12\x67\xfe\x86\xcb\x1d" - "\xb7\x65\xd9\x67\xcd\xfc\xfe\xb8\x1f\x3f\xb9\x70\xc1\xbc\x14\x92" - "\x64\xcf\xc4\x70\x9c\x75\x87\xf3\x96\xbb\xec\xc5\x73\xe7\x2e\xb2" - "\x2f\x9d\xbb\xa0\xc4\x3e\x67\xe9\x9c\x65\x29\x34\x6f\xe1\xa2\x27" - "\x39\xca\x02\x77\xcb\xe2\xfc\x27\xe7\xfd\x9c\x9d\x5e\x54\xee\x94" - "\x28\x3b\x61\x16\xeb\x36\x3d\x2e\xc9\x91\x2a\xb6\x21\x93\x3d\x79" - "\xb8\xe7\x78\x5d\x36\x5c\x1b\xf1\x3b\x80\xdf\x7e\xfc\x8e\xe1\x77" - "\xf4\x34\xad\x58\x83\xeb\x9e\x2e\xf7\x92\x42\xc3\x5e\xe9\xe3\xa1" - "\x25\x4e\x83\x87\x60\x5f\xec\x51\xe3\xdb\x92\x86\x96\x90\x94\x9f" - "\x5e\x9e\xaa\xba\xd8\xc7\x53\x1c\x6f\xb4\x85\x7d\xba\x96\xe0\x7d" - "\xb7\x5c\xab\xe4\x35\x93\x64\xa6\xdb\x49\x5a\xb6\xa5\xfe\x15\xd1" - "\xc4\xb1\x72\x70\x6d\x04\xbf\x34\xa9\xf8\x34\x4b\x33\x90\x6f\x38" - "\xea\x38\xa0\xea\xd0\x9f\x87\x88\x23\xfc\x0d\x97\x13\xfa\x33\xc3" - "\x02\x8c\x3b\xf9\x9e\xaf\xfa\xde\xa9\x55\xff\xc6\x9b\xa9\xef\xdd" - "\xd2\x66\xbd\x0e\x0f\x68\x51\x5e\xe7\x96\x73\x29\x39\x77\xe6\x35" - "\x62\x6b\xc2\xdd\x02\xf8\x9c\xd3\x12\x1f\x6d\x95\xf1\x2f\xcb\xbb" - "\xa1\x23\xbe\xf7\x3d\xaf\x53\xe6\x4f\xe0\x35\xe4\x69\xc5\x42\xe3" - "\x38\xe4\x5a\xe2\xd3\xad\x5c\x4e\x58\x3c\x79\xda\x86\x81\x39\xca" - "\x66\xe0\xb8\x83\x4b\x1b\x74\x98\x41\xa6\xed\x69\x5a\xf2\xb0\x9a" - "\x87\xaf\x58\xa3\x6c\x89\xa5\x7b\x0c\x5f\x4b\xc8\x68\x26\x9e\x1b" - "\x0d\x1d\xe0\xa3\xa5\xd5\xba\x5f\x9c\x47\x6f\x7f\x48\x7f\xde\xaf" - "\xe3\x98\xc0\xb1\x50\x80\xff\x51\xee\x3b\xd8\x2b\xfb\x71\x7f\x0c" - "\xf4\x69\x52\xf4\x71\xca\x38\x07\xb0\x9b\xf8\xfd\x31\xfe\xde\x0d" - "\xde\x1d\x53\x71\x46\x96\x8e\xe1\x36\xf7\xf9\xce\xd6\xe6\x00\xd7" - "\x3b\x79\x8f\x19\xb2\xb4\xdf\x7b\x91\xe5\x73\x69\x16\xe0\xed\x36" - "\xf4\x0e\xeb\x99\xfc\x30\xe4\x54\xce\xa7\x9c\x45\x86\xbe\xe9\xe3" - "\x03\x67\x79\x3c\x5d\x12\xaf\xdf\x15\xfd\x9d\x7f\x17\xee\xe7\x1a" - "\x81\xd3\x6e\xd9\x07\x1c\x8f\xf5\x62\xef\xbc\xad\x47\xe9\x48\xe7" - "\xb1\xde\x39\xa6\x8e\x07\xc7\x76\xf7\x31\x6e\xdd\x72\xdf\x5f\xd7" - "\x1b\xce\x90\xa1\x37\x0c\x38\xd6\x04\xa1\x59\x9d\xf8\x57\xb1\xcf" - "\xc9\x7b\x24\x3c\x5e\x4a\x7b\x04\x70\x06\x5d\x50\x67\xe0\xb4\xca" - "\x7d\xe0\x5d\xe7\x1e\xfe\xe6\x9b\xb4\x69\xdd\xcf\xfd\xdf\x3e\x5d" - "\xb4\x6c\x46\x24\x4c\x61\xd9\xe7\x64\xb8\xac\x8f\xd8\x26\xc9\x0f" - "\x9b\x39\x0e\x8d\x53\x1f\x5f\xa0\x83\x97\x95\x1b\xb8\x82\x86\x47" - "\x0c\x7c\xf5\x6f\x8e\x1d\x41\x3d\xbe\xe9\xe1\x1e\xf6\x05\x6f\x54" - "\xfd\xb9\x42\xea\x1b\xbc\xdb\x85\xb2\x07\x7c\xf4\x5c\x9a\x2e\x43" - "\x4d\x28\xbf\xeb\x70\xd9\x44\xe4\x59\xd6\xaa\xfb\x33\x1f\x45\xff" - "\x1e\xeb\xe3\xfd\x25\xcd\x11\xeb\x3c\xc7\x54\x1f\xfe\xb8\xfc\x04" - "\x2d\xb7\x45\xa4\xeb\x7d\x7b\x78\x06\xd2\x9b\xd5\x9a\xc9\x3e\x3d" - "\xbe\xdf\x72\xe5\xbb\xaa\xe3\xc8\xba\x80\xcf\xeb\xb1\x8c\x4b\xda" - "\xcb\x3e\x5e\x3e\xc3\x18\x2f\x00\x6b\x8f\xa4\xf9\x10\x71\x80\xe9" - "\xa4\xe2\x7d\x3c\x77\x51\xd1\x69\xb9\x33\x8a\xf6\x3c\x6e\xa2\x1e" - "\xa6\xd3\xa0\x55\x42\x1b\x14\x48\x10\xf9\xcb\xcc\xc4\xf2\xc2\x32" - "\xce\x7b\x83\xe0\x0f\x69\x57\x29\xba\x2d\xdf\x6f\xd0\xcd\xe8\x3b" - "\xa6\x93\x8f\x96\x67\x32\x6d\xa3\xdb\x38\xe0\xe8\x09\xa3\xed\xa0" - "\x29\xc7\x34\xc5\x73\x93\x2e\x17\x4d\x9e\xa1\xec\x3b\xb2\xe4\xcf" - "\x87\xcd\xdf\xa7\xc3\xce\x31\xa4\x68\xbb\xc2\xe6\xa3\x12\x67\xc4" - "\xbc\xe4\x08\xd3\x97\x65\x05\x78\x96\xe8\xb1\xb7\x8e\x28\x3f\xa6" - "\x25\x4d\xa2\x72\x5f\x89\x94\xe5\x25\x32\x46\x0a\xc7\xed\x3d\xca" - "\x34\x62\xbd\xc8\xb2\xc4\x32\xc0\xf2\xa4\x68\xb4\xa2\x24\x82\x46" - "\x8d\x4c\x1f\x9d\x4e\x7b\x62\x74\xf9\x5c\x7b\xd1\x38\xa5\x8b\xed" - "\x99\x23\x0a\x47\xcb\x40\x37\xf6\x7b\x27\xdc\x65\x9f\x31\x6e\x84" - "\xd3\x31\x72\x9a\xba\x4c\x98\x31\x85\xaf\x29\xd1\xf3\x3a\x3b\xea" - "\x39\x1e\x3d\x37\x5c\xe5\x50\xfa\x63\x45\xc0\x97\x70\xb5\xfc\x86" - "\x08\xc7\x9d\xad\x5a\x40\x14\x06\xde\x1b\x4e\xa3\x4f\x2d\xfb\xd2" - "\x39\xce\xf1\x74\x27\x71\x5c\xf4\x2f\xeb\xf1\xae\x0e\xe9\x83\x8a" - "\xf9\xfb\x08\x7f\x13\x5a\xf2\xbe\x74\x5e\xb3\x11\x95\x3b\x5a\xfd" - "\xc9\xa7\xda\xf1\xdb\xed\x4f\xfe\xa0\x7d\xd2\x2d\x2e\xd1\xe5\x2e" - "\x9d\x62\xb4\x8b\xd7\x76\x40\xa7\xf4\xe9\x4e\x11\x66\x1a\xe5\x3b" - "\x39\x16\x39\x60\x27\xf2\xda\x4e\x29\xda\x5f\xbc\x5b\xcd\x5f\x4b" - "\xc1\xff\x4b\x74\x7b\x86\x66\xe0\x19\xf6\xdf\xf7\xe5\x1a\x97\xe6" - "\xb6\xc9\x18\xe6\xda\xea\x5b\x1f\xc4\x7c\x60\xb7\x01\x13\xb0\xae" - "\xd2\xfd\x1e\x24\xbc\xaf\xeb\x57\xab\xad\x7d\x2f\xc3\x9a\xa0\xe2" - "\x42\x42\xc6\xcb\xeb\x4d\x5a\x5e\xaf\x9f\x0c\xde\x0d\x5a\x95\xc6" - "\x7e\x34\x79\xe0\xbd\x72\xce\x63\xbc\xab\x72\x6b\xbe\x2a\x93\x16" - "\x44\x3f\xa6\x29\xfb\xb9\x83\xf5\x27\xe6\xae\x2b\xc7\x1a\xe3\x9a" - "\x1c\x0f\x4d\x54\xae\xe6\x33\x2b\x1f\xe3\x72\xe7\xdd\x66\x82\xce" - "\x6e\xba\x31\x5d\xce\x51\x82\x9a\x3b\x81\x94\x2f\xf3\xca\xdb\x0d" - "\x1d\xcb\xfb\xa5\xd6\x55\xc2\xcf\x6b\xc4\xd6\x90\xf0\xcb\x58\xfb" - "\x3c\x76\xd0\x69\xf2\x96\x76\x95\x7b\xe5\x37\x38\xf9\xbb\x22\x01" - "\x7d\xdc\x08\xab\x71\x03\xf5\xfb\x13\x6f\x2d\xc0\xf8\x90\x70\x9a" - "\x60\xeb\x02\x7f\xa6\x0d\xef\xb5\x68\xa0\x95\x97\xc7\x49\xa6\x4f" - "\xca\xfe\x6d\xec\x03\xc3\x6d\xb5\x86\xd0\xe6\xc8\x76\x99\x34\xdf" - "\x06\x37\xda\x65\x42\xbb\x9c\x67\x58\x66\x82\xec\x9b\x04\x79\x1b" - "\x22\xe3\x59\xcb\xf9\x79\x99\x3d\xb2\x8d\xac\xff\x55\x1b\xca\xc6" - "\xc7\x6b\xa3\x30\x71\x1b\x99\x06\x65\xd7\xe9\xf2\x26\xf1\x64\xfd" - "\xd1\x41\x2b\x8f\x0d\x5a\xc5\x3e\x41\xfb\xd2\xa1\xdf\x26\x70\x1f" - "\x62\xfc\xac\x66\x3c\xe3\xf5\x17\xc3\xd3\x61\xf9\xac\xab\xca\x0b" - "\x80\xcb\xae\xf8\xf4\x2e\x6b\xbe\x3c\xbd\xcb\x7e\xc5\xe5\x19\x0f" - "\xde\xdf\xb1\x86\x4c\xd0\xc1\xa7\x76\x63\xbe\x56\x11\xaf\xde\x41" - "\xab\xb6\x32\x5e\x71\xdf\x09\x96\x17\x5d\x07\x81\x0f\x05\xe4\x44" - "\xb0\x4e\xea\x72\xbb\x72\x0d\x7d\x64\x4d\xb0\x27\x4a\xfd\x60\x12" - "\xd5\xf1\x60\x58\x57\x55\xf3\x3e\xd7\x04\xd4\x1f\xf7\xbd\xc6\xdf" - "\xee\xa8\xd8\x47\xda\xea\xef\xde\x68\x4d\xa0\xbb\xfd\x89\xdf\x4d" - "\xb1\x3a\x43\x19\x4c\x43\xc0\x74\x42\x8e\x1f\xe2\x79\xaa\x5a\x1b" - "\x71\xc1\xfe\xff\xa5\x8c\xcf\xe4\x4f\xde\xa7\xef\x1b\xb9\x30\xfe" - "\xd5\xd8\x8d\xb5\x79\x3c\xb7\xf9\xe8\xef\x0e\x25\x97\xdf\x7c\x5d" - "\xac\xfd\x60\x8f\xe6\xb6\x0a\xfb\x72\x2b\xec\xc8\xf2\x95\x9a\xe0" - "\xef\x39\x7c\xb0\xa7\x8f\x4f\x94\xbf\x94\xc1\x27\x5d\xee\xf2\x8c" - "\xf8\x3c\x50\x3e\xe9\xf2\x3c\x50\xfe\x0d\x7e\xcf\x74\x57\x73\x95" - "\xf2\x22\xc3\x4e\x11\xab\xbf\xf9\xba\xbd\x4c\xd6\x4f\xaa\x6e\xa6" - "\x49\x0e\xe3\x3f\x05\x74\x29\x47\xde\x1a\x43\x0f\x30\xbf\x58\xc3" - "\xfc\xad\x0b\x92\x3c\x8d\x77\x18\x57\x4a\x2c\x6a\x1d\xfc\x40\xb1" - "\xfc\x7e\xa5\x7b\x45\xb5\xdf\xe5\xd8\xcc\xdf\x69\x0d\x24\xef\x2b" - "\x45\x9e\x56\x1f\x35\xaa\xfd\x56\xcb\xbe\x12\xc0\x70\x6e\x52\xfe" - "\xd0\x16\x19\x2f\x0a\x32\xcd\x31\xa2\x58\xae\x91\x96\x0e\xbc\x39" - "\x5e\x14\xe6\x3b\xab\xd2\x7a\xc7\x25\x77\x0e\x74\x85\x90\xb6\x18" - "\xc6\xa5\x61\x9d\xa0\xdd\xcb\x26\xad\xe1\xe2\x68\x1b\x71\x9b\x2f" - "\xae\x1e\xda\xf0\x8b\xdb\xc8\xfc\x07\xdb\x13\x54\x7c\x07\xa5\xaf" - "\xfa\xbe\x99\xfe\x2b\x9b\x4c\x4c\x07\x1f\xad\xb2\x2b\xda\xad\x2a" - "\x30\xfa\xc7\x47\xae\x23\x52\x77\xae\x7e\xb4\x7d\x7a\x48\x7c\xa9" - "\xd6\xb9\x57\x41\xff\x3d\x53\xa3\xde\xaf\x68\x8f\x5d\x03\x62\x7b" - "\xde\x3e\x7f\xb1\xbd\x70\xe1\xd2\x05\xc3\x87\x47\xcd\x95\xcc\xea" - "\xbb\xb8\xab\x36\xa9\xf1\x74\xd5\x11\x03\x6f\xb6\x4b\xf0\x8c\xf6" - "\xaf\xb8\x24\x96\xfd\x94\x7c\xdd\xcd\x3d\x3f\x8b\xfa\xee\x6f\xa7" - "\x29\xb7\x47\x3c\x7e\x8f\xa6\xdc\xf1\xbd\xfc\x07\xe7\xce\x29\x5c" - "\x16\x91\x7a\x67\xe4\xba\x61\xd5\xeb\xa8\x3b\x71\xe8\x3d\xd0\x15" - "\x09\xd3\x56\xf0\xd8\xe2\xfe\xb0\x2c\x24\x4e\x41\x5f\x67\x43\xc6" - "\xf2\x9b\x4b\x42\xd4\x0c\x5d\x26\xbe\xc9\x3a\x7c\x80\x3a\xdb\x09" - "\x7b\x0a\xbc\x65\x45\xdb\xfd\xb0\xeb\x2e\xf0\xfa\x0c\xca\x7d\xde" - "\x52\xc3\x31\x9d\x3f\xd0\xfd\x1a\xdc\xb5\x48\xbf\x06\xd7\x4f\x70" - "\xbd\x0a\xd7\x3f\xda\x17\x60\xde\xc3\xbe\xf4\x4b\xd8\x97\xde\xfd" - "\xae\xf4\x07\x0a\x94\x13\xfb\x04\xe1\xfd\x2c\xb6\x41\x7c\xb4\xda" - "\xcc\xeb\xe0\x9c\x17\x69\x5b\xec\x4f\x51\x16\x5f\x85\xdc\x1b\x74" - "\xd7\x8a\xca\x0f\xfc\x62\x73\x1e\x7f\x6f\x2d\xe3\x24\xad\x4e\x48" - "\x4c\xf8\x9c\x12\x6d\x96\xd4\x2e\xf7\x6a\x94\x5d\x30\x8b\xe9\xd4" - "\xdf\xb7\x68\xe5\x37\x80\x63\xec\xc3\x3e\xdb\x70\x2d\x49\xfb\x56" - "\xb7\xe7\xea\xe4\xb8\xb0\x7a\x56\x84\x4d\xc7\x7b\xd3\x29\xca\x3e" - "\x11\x61\x65\x9f\xae\x2e\x31\xe4\x00\xf7\xe5\x06\x9f\x46\xc5\xd7" - "\x5b\x50\x32\x77\xd1\xdc\x42\xfb\x88\xc5\x29\x14\x11\x5d\xcf\x31" - "\x77\x81\x7d\xd1\xdc\x67\x9f\x9b\xbb\x58\x46\xc6\xe3\xb7\x51\x63" - "\x3e\xf4\xfd\xef\x33\x8c\x73\x5f\xf6\xa1\x4c\xdf\xd5\x5f\x70\x4c" - "\x36\xb1\xf6\xf7\xdb\xd8\x77\x47\xcd\x37\x44\x66\xf4\x7c\xe3\x79" - "\x15\x77\xa2\xe2\x03\x9f\x9a\xeb\x3c\x2f\xbf\x63\x7d\x82\xd6\x54" - "\xf7\xc5\x7f\x5f\x33\x1e\xb4\x34\xe9\x74\xbb\xd0\xe5\x5e\x93\x6d" - "\xd0\xcd\x47\xcf\x7b\x74\x5b\xaa\x43\xea\x0f\x8c\xb1\xd0\x7f\x51" - "\xe3\xab\xfa\x06\xed\x1a\x8e\xcb\x91\x28\xd7\x93\x93\x3f\x68\xe3" - "\xba\x18\x26\xea\xf3\xa0\x7f\x7c\xd0\x9b\xac\xdf\x2a\x0c\x78\xa8" - "\x33\x93\xeb\xd3\xe7\x41\xd7\x9f\xa6\xe7\xe5\x9a\xb3\x56\xf1\x41" - "\x1b\xeb\x14\x8e\x21\xa2\x55\x02\x8e\xdc\xa3\x7d\xde\x23\xd7\x61" - "\xf9\x1b\x04\x80\xc5\xeb\xc0\xd0\x73\x01\xfe\x5e\x31\xa7\xa9\xd8" - "\x70\xab\xd7\xf1\xda\x33\xea\x3a\x0e\xfc\x83\x7d\x67\x1b\x9e\xf7" - "\xb0\xdd\xc9\x70\x7d\xb4\xe6\x00\xc3\x53\xb1\xef\x9e\x1f\x06\xde" - "\xc9\xe8\xb3\x9f\x9e\x2f\x88\x98\x97\x31\x3e\x12\xcf\x00\x70\x91" - "\x71\x56\x95\xaf\xa9\x6c\x37\xeb\xcf\x4d\x7a\xdb\x8d\xf6\x00\x1e" - "\xf4\xdf\xea\x34\xc3\x6f\xc2\xa7\xb7\x9b\xf1\x63\xdc\x23\x71\xd6" - "\xf1\xad\x61\x7c\x51\x6e\x5b\x84\x6c\xf3\xba\x4c\x12\xd2\xf6\xf7" - "\xf9\xb0\xaf\xa1\x58\xbd\xb1\x70\x81\xbd\x68\xfe\x82\xa7\xf3\x97" - "\xce\x79\x7a\x6e\xfe\x73\xc5\x23\xed\xcf\x2d\x78\xa2\x68\xe1\x93" - "\x4f\x33\xd7\x2c\x2e\x79\xee\xc9\xa7\xed\xac\x59\xf2\x27\x4e\x99" - "\x92\x7f\xcf\x43\x33\x1f\x4e\xa1\x7b\xe6\x20\x0d\x33\xff\x29\x59" - "\x23\xd5\xab\x07\x27\x4d\xf8\x69\xfe\x84\xe9\x0f\x4d\x9b\x25\x0f" - "\xbd\xf4\xbe\x9f\xb8\x20\x7e\x86\x28\x3e\x4c\x03\x2f\x1d\x47\xff" - "\x26\x9d\xa0\xca\xb1\x2a\x5e\xfa\x0b\x45\xd1\xf1\xd2\x5f\x00\xd2" - "\x2f\x6c\xc5\xef\x00\xd1\x2f\xfc\xf8\x41\xbb\x57\x66\x29\xfe\x4a" - "\x7e\xbc\xcb\xfd\x42\x4d\x1f\x7f\x55\xca\xb3\x94\xec\xa7\xa4\xd6" - "\x67\x5f\x80\xfe\x5f\xbd\x3f\xf2\x5d\xdf\x7c\xf2\x85\xa3\xbd\xf3" - "\xc9\x5e\x9d\xf2\x42\xef\xdc\x12\x69\xed\x98\x57\x26\xf3\xbc\x52" - "\xad\x27\x55\x8e\x93\x3c\xd5\xaf\x7c\x5b\xc8\x98\x57\xb2\x6c\xcb" - "\x3d\x29\x39\xff\xf8\x45\x76\xa4\x8c\xcb\x35\x7d\x5d\xc6\xb9\x9c" - "\x5c\xbf\xb3\x88\x74\x5e\xd3\x86\x7d\x7c\x1c\xb6\x02\xc6\xaf\x2e" - "\x21\x92\x45\xba\xc2\xe9\x17\x4e\x5e\xe3\x66\xbb\x59\xe7\xa7\x41" - "\xa7\xe9\x17\x7b\x85\xfb\xf9\x26\x35\xa7\x7c\x3e\xcc\x7a\x5d\xac" - "\x1e\x7a\x0f\xfb\x16\xf1\xdc\x09\x75\xee\xea\xe3\xd9\xca\xb1\xcc" - "\x0b\x7d\x73\xd9\x5f\x44\xe9\xff\x4e\xf9\x5d\xc2\x5f\x1c\x37\xe2" - "\x3d\x94\x0c\x27\x93\x79\x78\x35\x6d\x32\x09\xe8\x9b\x5f\xac\xe3" - "\x3a\x98\x9e\x3e\x7a\xa1\x01\x79\xcd\x7d\xf4\xab\x48\xeb\xa5\x9f" - "\xbe\xce\x62\xac\xb1\x28\xbc\x2b\xc7\xf5\x47\xab\xf8\x74\xaa\x28" - "\xf8\x4a\x3a\xb9\x29\x89\x65\xd2\xa0\xd7\xa5\xb4\xaa\xd8\x76\x29" - "\xad\x2a\x2e\xf4\xd1\xea\x85\x1b\x2e\xa5\x55\x45\x6b\xc4\xbe\x92" - "\xbe\x8e\x52\x39\x8e\x69\xc6\x3c\x86\x76\xaf\x03\x9f\xd5\xf4\xd1" - "\xaf\xd2\x72\x29\xfd\x2a\x87\xc5\xa7\x5f\x05\x9f\xaf\x8a\x84\x53" - "\x17\x6f\xdc\x18\xb4\xca\xa4\x9f\x07\xab\xfc\x25\x7f\xeb\x9e\xf1" - "\xd8\x68\xd2\x1c\x1b\xdd\xf8\xe1\xca\xf3\x88\x3e\x5b\x5c\x04\x75" - "\xfa\x56\x37\x62\xce\xcb\xeb\x4a\x97\x19\x8b\x8e\x1b\x6b\x1e\xb8" - "\x6f\xe5\xb9\x33\x7f\x13\x8a\xd3\x99\x9e\xfc\x8d\x31\xf0\x7b\xab" - "\xb2\x4b\x2b\x7b\xbf\xff\xd1\x79\xd3\x83\x05\x89\xab\xc8\x7e\xb8" - "\xf6\x0e\x4e\x0f\x82\x87\x72\x39\x9d\x7d\xb7\xfa\x83\x99\x1f\xce" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 14:38:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 88BC0106564A; Thu, 7 Jun 2012 14:38:44 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 745B78FC0C; Thu, 7 Jun 2012 14:38:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q57Eci1H093828; Thu, 7 Jun 2012 14:38:44 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q57EciIo093826; Thu, 7 Jun 2012 14:38:44 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201206071438.q57EciIo093826@svn.freebsd.org> From: Warren Block Date: Thu, 7 Jun 2012 14:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236716 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 14:38:44 -0000 Author: wblock (doc committer) Date: Thu Jun 7 14:38:43 2012 New Revision: 236716 URL: http://svn.freebsd.org/changeset/base/236716 Log: Add specific supported revision of ASUS USB-N13 ver. A1. http://lists.freebsd.org/pipermail/freebsd-doc/2012-June/019960.html Submitted by: PseudoCylon (AK) Approved by: bcr (mentor) MFC after: 3 days Modified: head/share/man/man4/run.4 Modified: head/share/man/man4/run.4 ============================================================================== --- head/share/man/man4/run.4 Thu Jun 7 14:03:20 2012 (r236715) +++ head/share/man/man4/run.4 Thu Jun 7 14:38:43 2012 (r236716) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 12, 2011 +.Dd June 7, 2012 .Dt RUN 4 .Os .Sh NAME @@ -112,7 +112,7 @@ driver supports the following wireless a .Bl -tag -width Ds -offset indent -compact .It Airlink101 AWLL6090 .It ASUS USB-N11 -.It ASUS USB-N13 +.It ASUS USB-N13 ver. A1 .It ASUS WL-160N .It Belkin F5D8051 ver 3000 .It Belkin F5D8053 From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 15:54:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 813F51065672; Thu, 7 Jun 2012 15:54:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D8A58FC08; Thu, 7 Jun 2012 15:54:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q57Fsris097276; Thu, 7 Jun 2012 15:54:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q57Fsr9S097274; Thu, 7 Jun 2012 15:54:53 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206071554.q57Fsr9S097274@svn.freebsd.org> From: John Baldwin Date: Thu, 7 Jun 2012 15:54:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236717 - head/lib/libprocstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 15:54:53 -0000 Author: jhb Date: Thu Jun 7 15:54:52 2012 New Revision: 236717 URL: http://svn.freebsd.org/changeset/base/236717 Log: Teach procstat_get_shm_info_kvm() how to fetch the pathname of a SHM file descriptor from a core and set it in fts->fs_path. MFC after: 1 week Modified: head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Thu Jun 7 14:38:43 2012 (r236716) +++ head/lib/libprocstat/libprocstat.c Thu Jun 7 15:54:52 2012 (r236717) @@ -881,6 +881,8 @@ procstat_get_shm_info_kvm(kvm_t *kd, str { struct shmfd shmfd; void *shmfdp; + char *path; + int i; assert(kd); assert(shm); @@ -896,6 +898,21 @@ procstat_get_shm_info_kvm(kvm_t *kd, str } shm->mode = S_IFREG | shmfd.shm_mode; shm->size = shmfd.shm_size; + if (fst->fs_path == NULL && shmfd.shm_path != NULL) { + path = malloc(MAXPATHLEN); + for (i = 0; i < MAXPATHLEN - 1; i++) { + if (!kvm_read_all(kd, (unsigned long)shmfd.shm_path + i, + path + i, 1)) + break; + if (path[i] == '\0') + break; + } + path[i] = '\0'; + if (i == 0) + free(path); + else + fst->fs_path = path; + } return (0); fail: From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 18:44:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 031B7106564A; Thu, 7 Jun 2012 18:44:07 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E18238FC12; Thu, 7 Jun 2012 18:44:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q57Ii6Xw004921; Thu, 7 Jun 2012 18:44:06 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q57Ii6Iq004919; Thu, 7 Jun 2012 18:44:06 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201206071844.q57Ii6Iq004919@svn.freebsd.org> From: Sean Bruno Date: Thu, 7 Jun 2012 18:44:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236719 - stable/9/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 18:44:07 -0000 Author: sbruno Date: Thu Jun 7 18:44:06 2012 New Revision: 236719 URL: http://svn.freebsd.org/changeset/base/236719 Log: MFC r236323 Cosmetic nit. If a configured volume has no label, don't emit an empty string for the name during probe. Simply indicate that it has no label. Modified: stable/9/sys/dev/mfi/mfi_disk.c Modified: stable/9/sys/dev/mfi/mfi_disk.c ============================================================================== --- stable/9/sys/dev/mfi/mfi_disk.c Thu Jun 7 15:57:30 2012 (r236718) +++ stable/9/sys/dev/mfi/mfi_disk.c Thu Jun 7 18:44:06 2012 (r236719) @@ -130,10 +130,17 @@ mfi_disk_attach(device_t dev) state = "unknown"; break; } - device_printf(dev, "%juMB (%ju sectors) RAID volume '%s' is %s\n", - sectors / (1024 * 1024 / secsize), sectors, - ld_info->ld_config.properties.name, - state); + + if ( strlen(ld_info->ld_config.properties.name) == 0 ) { + device_printf(dev, + "%juMB (%ju sectors) RAID volume (no label) is %s\n", + sectors / (1024 * 1024 / secsize), sectors, state); + } else { + device_printf(dev, + "%juMB (%ju sectors) RAID volume '%s' is %s\n", + sectors / (1024 * 1024 / secsize), sectors, + ld_info->ld_config.properties.name, state); + } sc->ld_disk = disk_alloc(); sc->ld_disk->d_drv1 = sc; From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 18:54:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C0F40106564A; Thu, 7 Jun 2012 18:54:42 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAD1C8FC0C; Thu, 7 Jun 2012 18:54:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q57Isgtn005474; Thu, 7 Jun 2012 18:54:42 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q57IsgLg005472; Thu, 7 Jun 2012 18:54:42 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201206071854.q57IsgLg005472@svn.freebsd.org> From: Sean Bruno Date: Thu, 7 Jun 2012 18:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236720 - stable/8/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 18:54:42 -0000 Author: sbruno Date: Thu Jun 7 18:54:42 2012 New Revision: 236720 URL: http://svn.freebsd.org/changeset/base/236720 Log: MFC r236323 Cosmetic nit. If a configured volume has no label, don't emit an empty string for the name during probe. Simply indicate that it has no label. Modified: stable/8/sys/dev/mfi/mfi_disk.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/mfi/mfi_disk.c ============================================================================== --- stable/8/sys/dev/mfi/mfi_disk.c Thu Jun 7 18:44:06 2012 (r236719) +++ stable/8/sys/dev/mfi/mfi_disk.c Thu Jun 7 18:54:42 2012 (r236720) @@ -130,10 +130,17 @@ mfi_disk_attach(device_t dev) state = "unknown"; break; } - device_printf(dev, "%juMB (%ju sectors) RAID volume '%s' is %s\n", - sectors / (1024 * 1024 / secsize), sectors, - ld_info->ld_config.properties.name, - state); + + if ( strlen(ld_info->ld_config.properties.name) == 0 ) { + device_printf(dev, + "%juMB (%ju sectors) RAID volume (no label) is %s\n", + sectors / (1024 * 1024 / secsize), sectors, state); + } else { + device_printf(dev, + "%juMB (%ju sectors) RAID volume '%s' is %s\n", + sectors / (1024 * 1024 / secsize), sectors, + ld_info->ld_config.properties.name, state); + } sc->ld_disk = disk_alloc(); sc->ld_disk->d_drv1 = sc; From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 18:58:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8F22106566B; Thu, 7 Jun 2012 18:58:59 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9EB08FC18; Thu, 7 Jun 2012 18:58:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q57IwxaG005699; Thu, 7 Jun 2012 18:58:59 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q57Iwxom005698; Thu, 7 Jun 2012 18:58:59 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201206071858.q57Iwxom005698@svn.freebsd.org> From: Sean Bruno Date: Thu, 7 Jun 2012 18:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236721 - in stable/9/sys: . dev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 18:59:00 -0000 Author: sbruno Date: Thu Jun 7 18:58:59 2012 New Revision: 236721 URL: http://svn.freebsd.org/changeset/base/236721 Log: Update mergeinfo from r236323 that was missed in the code MFC commit at r236323 doh! Modified: Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 19:12:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5E9D7106564A; Thu, 7 Jun 2012 19:12:50 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 476D58FC14; Thu, 7 Jun 2012 19:12:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q57JCou6006378; Thu, 7 Jun 2012 19:12:50 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q57JColM006377; Thu, 7 Jun 2012 19:12:50 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201206071912.q57JColM006377@svn.freebsd.org> From: Sean Bruno Date: Thu, 7 Jun 2012 19:12:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236722 - stable/9/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 19:12:50 -0000 Author: sbruno Date: Thu Jun 7 19:12:49 2012 New Revision: 236722 URL: http://svn.freebsd.org/changeset/base/236722 Log: MFC r236412,236418,236420,236591,236624 Doc updates for bce(4) tuneables Note that for 7/8/9 the strict_rx_mtu variable is named loose_rx_mtu. Modified: stable/9/share/man/man4/bce.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/bce.4 ============================================================================== --- stable/9/share/man/man4/bce.4 Thu Jun 7 18:58:59 2012 (r236721) +++ stable/9/share/man/man4/bce.4 Thu Jun 7 19:12:49 2012 (r236722) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 7, 2009 +.Dd June 4, 2012 .Dt BCE 4 .Os .Sh NAME @@ -200,9 +200,73 @@ variables and .Xr loader 8 tunables: .Bl -tag -width indent +.It Va hw.bce.verbose +Enable/Disable verbose logging and output to the console. +Useful for debugging (default 0). .It Va hw.bce.msi_enable -Whether or not MSI support is enabled in the driver. -The default value is 1. +Enable/Disable MSI support (default 1). +.It Va hw.bce.tso_enable +Enable/Disable TSO support (default 1). +.It Va hw.bce.strict_rx_mtu +Enable/Disable strict RX frame size checking (default 0). +.It Va hw.bce.hdr_split +Enable/Disable frame header/payload splitting (default 1). +.It Va hw.bce.rx_pages +Set the number of memory pages assigned to recieve packets by the driver. +Due to alignment issues, this value can only be of the set +1, 2, 4 or 8 (default 2). +.It Va hw.bce.tx_pages +Set the number of memory pages assigned to transmit packets +by the driver. +Due to alignment issues, this value can only be of the set +1, 2, 4 or 8 (default 2). +.It Va hw.bce.rx_ticks +Time in microsecond ticks to wait before generating a status +block updates due to RX processing activity. +Values from 0-100 are valid. +A value of 0 disables this status block update. +Cannot be set to 0 if hw.bce.rx_quick_cons_trip is also 0 +(default 18). +.It Va hw.bce.rx_ticks_int +Time in microsecond ticks to wait during RX interrupt +processing before generating a status block update. +Values from 0-100 are valid. +Valid values are in the range from 0-100. +A value of 0 disables this status block update (default 18). +.It Va hw.bce.rx_quick_cons_trip +Number of RX Quick BD Chain entries that must be completed +before a status block is generated. +Values from 0-256 are valid. +A value of 0 disables this status block update. +Cannot be set to 0 if hw.bce.rx_ticks is also 0 (default 6). +.It Va hw.bce.rx_quick_cons_trip_int +Number of RX quick BD entries that must be completed before +a status block is generated duing interrupt processing. +Values from 0-256 are valid. +A value of 0 disables this status block update (default 6). +.It Va hw.bce.tx_ticks +Time in microsecond ticks to wait before a status block +update is generated due to TX activitiy. +Values from 0-100 are valid. +A value of 0 disables this status block update. +Cannot be set to 0 if hw.bce.tx_quick_cons_trip is also 0 +(default 80). +.It Va hw.bce.tx_ticks_int +Time in microsecond ticks to wait in interrupt processing +before a status block update is generated due to TX activity +Values from 0-100 are valid. +A value of 0 disables this status block update (default 80). +.It Va hw.bce.tx_cons_trip +How many TX Quick BD Chain entries that must be completed +before a status block is generated. +Values from 0-100 are valid. +A value of 0 disables this status block update. +Cannot be set to 0 if hw.bce.tx_ticks is also 0 (default 20). +.It Va hw.bce.tx_cons_trip_int +How many TX Quick BD Chain entries that must be completed +before a status block is generated during an interrupt. +Values from 0-100 are valid. +A value of 0 disables this status block update (default 20). .El .Sh DIAGNOSTICS .Bl -diag @@ -266,7 +330,7 @@ address space. .It "bce%d: Could not allocate TX descriptor chain DMA tag!" The driver could not allocate a DMA tag for the controller's TX chain. -.It "bce%d: Could not allocate TX descriptor chain DMA memory! +.It "bce%d: Could not allocate TX descriptor chain DMA memory!" The driver could not allocate DMA addressable memory for the controller's TX chain. .It "bce%d: Could not map TX descriptor chain DMA memory!" @@ -346,6 +410,10 @@ with the cable connection, or a driver l A controller hardware failure has occurred. If the problem continues replace the controller. .El +.Sh SUPPORT +For general information and support, +go to the Broadcom NIC Open Source Developer Resource Site: +.Pa http://www.broadcom.com/support/ethernet_nic/open_source.php . .Sh SEE ALSO .Xr altq 4 , .Xr arp 4 , From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 19:19:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53FAB1065672; Thu, 7 Jun 2012 19:19:13 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D5718FC14; Thu, 7 Jun 2012 19:19:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q57JJDOo006723; Thu, 7 Jun 2012 19:19:13 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q57JJDUP006721; Thu, 7 Jun 2012 19:19:13 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201206071919.q57JJDUP006721@svn.freebsd.org> From: Sean Bruno Date: Thu, 7 Jun 2012 19:19:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236723 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 19:19:13 -0000 Author: sbruno Date: Thu Jun 7 19:19:12 2012 New Revision: 236723 URL: http://svn.freebsd.org/changeset/base/236723 Log: MFC r236412,236418,236420,236591,236624 Doc updates for bce(4) tuneables Note that for 7/8/9 the strict_rx_mtu variable is named loose_rx_mtu. Modified: stable/8/share/man/man4/bce.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/bce.4 ============================================================================== --- stable/8/share/man/man4/bce.4 Thu Jun 7 19:12:49 2012 (r236722) +++ stable/8/share/man/man4/bce.4 Thu Jun 7 19:19:12 2012 (r236723) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 7, 2009 +.Dd June 4, 2012 .Dt BCE 4 .Os .Sh NAME @@ -200,9 +200,73 @@ variables and .Xr loader 8 tunables: .Bl -tag -width indent +.It Va hw.bce.verbose +Enable/Disable verbose logging and output to the console. +Useful for debugging (default 0). .It Va hw.bce.msi_enable -Whether or not MSI support is enabled in the driver. -The default value is 1. +Enable/Disable MSI support (default 1). +.It Va hw.bce.tso_enable +Enable/Disable TSO support (default 1). +.It Va hw.bce.loose_rx_mtu +Enable/Disable strict RX frame size checking (default 0). +.It Va hw.bce.hdr_split +Enable/Disable frame header/payload splitting (default 1). +.It Va hw.bce.rx_pages +Set the number of memory pages assigned to recieve packets by the driver. +Due to alignment issues, this value can only be of the set +1, 2, 4 or 8 (default 2). +.It Va hw.bce.tx_pages +Set the number of memory pages assigned to transmit packets +by the driver. +Due to alignment issues, this value can only be of the set +1, 2, 4 or 8 (default 2). +.It Va hw.bce.rx_ticks +Time in microsecond ticks to wait before generating a status +block updates due to RX processing activity. +Values from 0-100 are valid. +A value of 0 disables this status block update. +Cannot be set to 0 if hw.bce.rx_quick_cons_trip is also 0 +(default 18). +.It Va hw.bce.rx_ticks_int +Time in microsecond ticks to wait during RX interrupt +processing before generating a status block update. +Values from 0-100 are valid. +Valid values are in the range from 0-100. +A value of 0 disables this status block update (default 18). +.It Va hw.bce.rx_quick_cons_trip +Number of RX Quick BD Chain entries that must be completed +before a status block is generated. +Values from 0-256 are valid. +A value of 0 disables this status block update. +Cannot be set to 0 if hw.bce.rx_ticks is also 0 (default 6). +.It Va hw.bce.rx_quick_cons_trip_int +Number of RX quick BD entries that must be completed before +a status block is generated duing interrupt processing. +Values from 0-256 are valid. +A value of 0 disables this status block update (default 6). +.It Va hw.bce.tx_ticks +Time in microsecond ticks to wait before a status block +update is generated due to TX activitiy. +Values from 0-100 are valid. +A value of 0 disables this status block update. +Cannot be set to 0 if hw.bce.tx_quick_cons_trip is also 0 +(default 80). +.It Va hw.bce.tx_ticks_int +Time in microsecond ticks to wait in interrupt processing +before a status block update is generated due to TX activity +Values from 0-100 are valid. +A value of 0 disables this status block update (default 80). +.It Va hw.bce.tx_cons_trip +How many TX Quick BD Chain entries that must be completed +before a status block is generated. +Values from 0-100 are valid. +A value of 0 disables this status block update. +Cannot be set to 0 if hw.bce.tx_ticks is also 0 (default 20). +.It Va hw.bce.tx_cons_trip_int +How many TX Quick BD Chain entries that must be completed +before a status block is generated during an interrupt. +Values from 0-100 are valid. +A value of 0 disables this status block update (default 20). .El .Sh DIAGNOSTICS .Bl -diag @@ -266,7 +330,7 @@ address space. .It "bce%d: Could not allocate TX descriptor chain DMA tag!" The driver could not allocate a DMA tag for the controller's TX chain. -.It "bce%d: Could not allocate TX descriptor chain DMA memory! +.It "bce%d: Could not allocate TX descriptor chain DMA memory!" The driver could not allocate DMA addressable memory for the controller's TX chain. .It "bce%d: Could not map TX descriptor chain DMA memory!" @@ -346,6 +410,10 @@ with the cable connection, or a driver l A controller hardware failure has occurred. If the problem continues replace the controller. .El +.Sh SUPPORT +For general information and support, +go to the Broadcom NIC Open Source Developer Resource Site: +.Pa http://www.broadcom.com/support/ethernet_nic/open_source.php . .Sh SEE ALSO .Xr altq 4 , .Xr arp 4 , From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 19:46:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C252106566B; Thu, 7 Jun 2012 19:46:47 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CF248FC08; Thu, 7 Jun 2012 19:46:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q57JkkZr008012; Thu, 7 Jun 2012 19:46:46 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q57Jkkwi008010; Thu, 7 Jun 2012 19:46:46 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201206071946.q57Jkkwi008010@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 7 Jun 2012 19:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236724 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 19:46:47 -0000 Author: trociny Date: Thu Jun 7 19:46:46 2012 New Revision: 236724 URL: http://svn.freebsd.org/changeset/base/236724 Log: Add VIMAGE support to if_tap. PR: kern/152047, kern/158686 Submitted by: Daan Vreeken MFC after: 1 week Modified: head/sys/net/if_tap.c Modified: head/sys/net/if_tap.c ============================================================================== --- head/sys/net/if_tap.c Thu Jun 7 19:19:12 2012 (r236723) +++ head/sys/net/if_tap.c Thu Jun 7 19:46:46 2012 (r236724) @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -66,6 +67,7 @@ #include #include #include +#include #include @@ -214,6 +216,7 @@ tap_destroy(struct tap_softc *tp) KASSERT(!(tp->tap_flags & TAP_OPEN), ("%s flags is out of sync", ifp->if_xname)); + CURVNET_SET(ifp->if_vnet); seldrain(&tp->tap_rsel); knlist_destroy(&tp->tap_rsel.si_note); destroy_dev(tp->tap_dev); @@ -222,6 +225,7 @@ tap_destroy(struct tap_softc *tp) mtx_destroy(&tp->tap_mtx); free(tp, M_TAP); + CURVNET_RESTORE(); } static void @@ -363,6 +367,7 @@ tapclone(void *arg, struct ucred *cred, if (unit == -1) append_unit = 1; + CURVNET_SET(CRED_TO_VNET(cred)); /* find any existing device, or allocate new unit number */ i = clone_create(&tapclones, &tap_cdevsw, &unit, dev, extra); if (i) { @@ -381,6 +386,7 @@ tapclone(void *arg, struct ucred *cred, } if_clone_create(name, namelen, NULL); + CURVNET_RESTORE(); } /* tapclone */ @@ -521,6 +527,7 @@ tapclose(struct cdev *dev, int foo, int /* junk all pending output */ mtx_lock(&tp->tap_mtx); + CURVNET_SET(ifp->if_vnet); IF_DRAIN(&ifp->if_snd); /* @@ -544,6 +551,8 @@ tapclose(struct cdev *dev, int foo, int } if_link_state_change(ifp, LINK_STATE_DOWN); + CURVNET_RESTORE(); + funsetown(&tp->tap_sigio); selwakeuppri(&tp->tap_rsel, PZERO+1); KNOTE_LOCKED(&tp->tap_rsel.si_note, 0); @@ -945,7 +954,9 @@ tapwrite(struct cdev *dev, struct uio *u } /* Pass packet up to parent. */ + CURVNET_SET(ifp->if_vnet); (*ifp->if_input)(ifp, m); + CURVNET_RESTORE(); ifp->if_ipackets ++; /* ibytes are counted in parent */ return (0); From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 19:48:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42F77106564A; Thu, 7 Jun 2012 19:48:46 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E19E8FC08; Thu, 7 Jun 2012 19:48:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q57JmkKJ008142; Thu, 7 Jun 2012 19:48:46 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q57JmjGH008139; Thu, 7 Jun 2012 19:48:45 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201206071948.q57JmjGH008139@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 7 Jun 2012 19:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236725 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 19:48:46 -0000 Author: trociny Date: Thu Jun 7 19:48:45 2012 New Revision: 236725 URL: http://svn.freebsd.org/changeset/base/236725 Log: Sort includes. Submitted by: Daan Vreeken MFC after: 3 days Modified: head/sys/net/if_tap.c Modified: head/sys/net/if_tap.c ============================================================================== --- head/sys/net/if_tap.c Thu Jun 7 19:46:46 2012 (r236724) +++ head/sys/net/if_tap.c Thu Jun 7 19:48:45 2012 (r236725) @@ -65,8 +65,8 @@ #include #include #include -#include #include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 22:49:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A926D106566C; Thu, 7 Jun 2012 22:49:09 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94EB08FC15; Thu, 7 Jun 2012 22:49:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q57Mn9hL016251; Thu, 7 Jun 2012 22:49:09 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q57Mn9cO016249; Thu, 7 Jun 2012 22:49:09 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201206072249.q57Mn9cO016249@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 7 Jun 2012 22:49:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236727 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 22:49:09 -0000 Author: pjd Date: Thu Jun 7 22:49:09 2012 New Revision: 236727 URL: http://svn.freebsd.org/changeset/base/236727 Log: Plug file reference leak in capability failure case. Sponsored by: FreeBSD Foundation MFC after: 3 days Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Thu Jun 7 22:47:53 2012 (r236726) +++ head/sys/kern/tty.c Thu Jun 7 22:49:09 2012 (r236727) @@ -1841,7 +1841,7 @@ ttyhook_register(struct tty **rtp, struc fp_cap = fp; error = cap_funwrap(fp_cap, CAP_TTYHOOK, &fp); if (error) - return (error); + goto done1; #endif /* From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 22:57:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC36D1065700; Thu, 7 Jun 2012 22:57:26 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C844C8FC1B; Thu, 7 Jun 2012 22:57:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q57MvQPJ016698; Thu, 7 Jun 2012 22:57:26 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q57MvQXI016696; Thu, 7 Jun 2012 22:57:26 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201206072257.q57MvQXI016696@svn.freebsd.org> From: Maksim Yevmenkin Date: Thu, 7 Jun 2012 22:57:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236729 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 22:57:27 -0000 Author: emax Date: Thu Jun 7 22:57:26 2012 New Revision: 236729 URL: http://svn.freebsd.org/changeset/base/236729 Log: Correct typo(?) and actually set PTHRESH to 32 and not 16 as per Intel Linux driver 3.8.21. MFC after: 1 week Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Thu Jun 7 22:49:50 2012 (r236728) +++ head/sys/dev/ixgbe/ixgbe.c Thu Jun 7 22:57:26 2012 (r236729) @@ -1152,7 +1152,7 @@ ixgbe_init_locked(struct adapter *adapte * from the Intel linux driver 3.8.21. * Prefetching enables tx line rate even with 1 queue. */ - txdctl |= (16 << 0) | (1 << 8); + txdctl |= (32 << 0) | (1 << 8); IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(i), txdctl); } From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 23:08:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75471106566C; Thu, 7 Jun 2012 23:08:19 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60DDE8FC15; Thu, 7 Jun 2012 23:08:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q57N8JRP017220; Thu, 7 Jun 2012 23:08:19 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q57N8JYG017217; Thu, 7 Jun 2012 23:08:19 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201206072308.q57N8JYG017217@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 7 Jun 2012 23:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236730 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 23:08:19 -0000 Author: pjd Date: Thu Jun 7 23:08:18 2012 New Revision: 236730 URL: http://svn.freebsd.org/changeset/base/236730 Log: Eliminate redundant variable. Sponsored by: FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Thu Jun 7 22:57:26 2012 (r236729) +++ head/sys/kern/tty.c Thu Jun 7 23:08:18 2012 (r236730) @@ -1817,9 +1817,6 @@ ttyhook_register(struct tty **rtp, struc { struct tty *tp; struct file *fp; -#ifdef CAPABILITIES - struct file *fp_cap; -#endif struct cdev *dev; struct cdevsw *cdp; struct filedesc *fdp; @@ -1838,8 +1835,7 @@ ttyhook_register(struct tty **rtp, struc } #ifdef CAPABILITIES - fp_cap = fp; - error = cap_funwrap(fp_cap, CAP_TTYHOOK, &fp); + error = cap_funwrap(fp, CAP_TTYHOOK, &fp); if (error) goto done1; #endif From owner-svn-src-all@FreeBSD.ORG Thu Jun 7 23:33:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E7951106567C; Thu, 7 Jun 2012 23:33:10 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D319F8FC1E; Thu, 7 Jun 2012 23:33:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q57NXANS018355; Thu, 7 Jun 2012 23:33:10 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q57NXADe018353; Thu, 7 Jun 2012 23:33:10 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201206072333.q57NXADe018353@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 7 Jun 2012 23:33:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236731 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 23:33:11 -0000 Author: pjd Date: Thu Jun 7 23:33:10 2012 New Revision: 236731 URL: http://svn.freebsd.org/changeset/base/236731 Log: In fdalloc() f_ofileflags for the newly allocated descriptor has to be 0. Assert that instead of setting it to 0. Sponsored by: FreeBSD Foundation MFC after: 1 month Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Jun 7 23:08:18 2012 (r236730) +++ head/sys/kern/kern_descrip.c Thu Jun 7 23:33:10 2012 (r236731) @@ -1554,9 +1554,8 @@ fdalloc(struct thread *td, int minfd, in */ KASSERT(!fdisused(fdp, fd), ("fd_first_free() returned non-free descriptor")); - KASSERT(fdp->fd_ofiles[fd] == NULL, - ("free descriptor isn't")); - fdp->fd_ofileflags[fd] = 0; /* XXX needed? */ + KASSERT(fdp->fd_ofiles[fd] == NULL, ("free descriptor isn't")); + KASSERT(fdp->fd_ofileflags[fd] == 0, ("file flags are set")); fdused(fdp, fd); *result = fd; return (0); From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 00:36:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A1391065670; Fri, 8 Jun 2012 00:36:02 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 77E068FC14; Fri, 8 Jun 2012 00:36:01 +0000 (UTC) Received: by vcbfy7 with SMTP id fy7so788197vcb.13 for ; Thu, 07 Jun 2012 17:36:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=F4uX558+Nj+OyP5jQqz9X0mnBrH0hCbM5tak4w8rqc0=; b=kP2LF9RTSn5Xi8vyKC7VGz5clSEiNzkpkJD/5bH5FPSn9HB2u7FWWknV/2xBULpcDa VgbEqG8/GeuD5Y8cUosevUL+LFcvO7Nw+p2+tCqgg3EMW+zLtmjPIiSdC2Hv2awy/iX6 a/eyrd3/Dy0q4Oo9JXkELJL2aFsjJVf+CfFNCvlfHHwLjTe0Xr3msT/KSXUuHvD7mnCm 5eWHxwllbI7RTXeqHbI7I6YsGdTVP5rQxP9xf7lYHtaD/Ickq8IPfuYLnYwZ3CI0/MVs 0gXWEftha89H/eYPQZxmySmq7ViAVWLExGLJZeuBddqE87ogazVmnz6nsdsemN/LZt+V Sn1w== MIME-Version: 1.0 Received: by 10.221.1.82 with SMTP id np18mr4227389vcb.22.1339115760797; Thu, 07 Jun 2012 17:36:00 -0700 (PDT) Received: by 10.220.236.201 with HTTP; Thu, 7 Jun 2012 17:36:00 -0700 (PDT) In-Reply-To: <201206072257.q57MvQXI016696@svn.freebsd.org> References: <201206072257.q57MvQXI016696@svn.freebsd.org> Date: Thu, 7 Jun 2012 17:36:00 -0700 Message-ID: From: Jack Vogel To: Maksim Yevmenkin Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r236729 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 00:36:02 -0000 Just because the Linux driver does something does not mean that FreeBSD should, this may be OK, but it isn't something automatic, and with a thing like this you should at least have asked me first... please next time? Jack On Thu, Jun 7, 2012 at 3:57 PM, Maksim Yevmenkin wrote: > Author: emax > Date: Thu Jun 7 22:57:26 2012 > New Revision: 236729 > URL: http://svn.freebsd.org/changeset/base/236729 > > Log: > Correct typo(?) and actually set PTHRESH to 32 and not 16 as per Intel > Linux driver 3.8.21. > > MFC after: 1 week > > Modified: > head/sys/dev/ixgbe/ixgbe.c > > Modified: head/sys/dev/ixgbe/ixgbe.c > > ============================================================================== > --- head/sys/dev/ixgbe/ixgbe.c Thu Jun 7 22:49:50 2012 (r236728) > +++ head/sys/dev/ixgbe/ixgbe.c Thu Jun 7 22:57:26 2012 (r236729) > @@ -1152,7 +1152,7 @@ ixgbe_init_locked(struct adapter *adapte > * from the Intel linux driver 3.8.21. > * Prefetching enables tx line rate even with 1 queue. > */ > - txdctl |= (16 << 0) | (1 << 8); > + txdctl |= (32 << 0) | (1 << 8); > IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(i), txdctl); > } > > From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 01:51:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA19C106566C; Fri, 8 Jun 2012 01:51:49 +0000 (UTC) (envelope-from ashish@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D55978FC08; Fri, 8 Jun 2012 01:51:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q581pn2r024665; Fri, 8 Jun 2012 01:51:49 GMT (envelope-from ashish@svn.freebsd.org) Received: (from ashish@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q581pn03024663; Fri, 8 Jun 2012 01:51:49 GMT (envelope-from ashish@svn.freebsd.org) Message-Id: <201206080151.q581pn03024663@svn.freebsd.org> From: Ashish SHUKLA Date: Fri, 8 Jun 2012 01:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236733 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 01:51:50 -0000 Author: ashish (ports committer) Date: Fri Jun 8 01:51:49 2012 New Revision: 236733 URL: http://svn.freebsd.org/changeset/base/236733 Log: Add myself to the calendar. Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Fri Jun 8 00:00:37 2012 (r236732) +++ head/usr.bin/calendar/calendars/calendar.freebsd Fri Jun 8 01:51:49 2012 (r236733) @@ -310,6 +310,7 @@ 10/23 Mario Sergio Fujikawa Ferreira born in Brasilia, Distrito Federal, Brazil, 1976 10/25 Eric Melville born in Los Gatos, California, United States, 1980 10/25 Julien Laffaye born in Toulouse, France, 1988 +10/25 Ashish SHUKLA born in Kanpur, India, 1985 10/26 Philip M. Gollucci born in Silver Spring, Maryland, United States, 1979 10/27 Takanori Watanabe born in Numazu, Shizuoka, Japan, 1972 11/05 M. Warner Losh born in Kansas City, Kansas, United States, 1966 From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 02:22:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 129DF106564A; Fri, 8 Jun 2012 02:22:18 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id CD0828FC17; Fri, 8 Jun 2012 02:22:17 +0000 (UTC) Received: by dadv36 with SMTP id v36so1834982dad.13 for ; Thu, 07 Jun 2012 19:22:17 -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=SUQwDW100yaOizWewvBo2Ykd51RgG4eUW2tk3eZiLMc=; b=yIZMSxr6no0XZVzaO6xI/qK9J9gFYEjCUeozLIvxbIcF5DRyeAL68lME1Zrs7LmHOX SQYpL+RIfMgBat73edfpIrGg/Gyzdv3LNSGCVBzq+6p9ddxbDDfxn4kARRrHPbUjGCDq 3xCuHKg93MhT0QDAsqVzAeuLV7Ob87GZPShnVTAgqQNnYnSjDd875Thp8Kleycw7KRVQ e56d96xoq2nokgrOWo2jXRJoIjjsq6ewUUmEKXLwNxPRCxOovOGT8bYuR6ELxO5K41GQ rB/H5xXCKZwzITCRbOXu7Ni8LpUsQdtif3KYgnRRb+6H9WMUcBbZmIX6wieQQGIDSsWz QKWg== MIME-Version: 1.0 Received: by 10.68.225.6 with SMTP id rg6mr15056515pbc.100.1339122137274; Thu, 07 Jun 2012 19:22:17 -0700 (PDT) Sender: maksim.yevmenkin@gmail.com Received: by 10.68.204.33 with HTTP; Thu, 7 Jun 2012 19:22:17 -0700 (PDT) In-Reply-To: References: <201206072257.q57MvQXI016696@svn.freebsd.org> Date: Thu, 7 Jun 2012 19:22:17 -0700 X-Google-Sender-Auth: NevbRA8n6aHccY3POrn0SRwDb5s Message-ID: From: Maksim Yevmenkin To: Jack Vogel Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r236729 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 02:22:18 -0000 Jack, On Thu, Jun 7, 2012 at 5:36 PM, Jack Vogel wrote: > Just because the Linux driver does something does not mean that FreeBSD > should, > this may be OK, but it isn't something automatic, and with a thing like this > you should > at least have asked me first... please next time? oh... i'm sorry. i just went by the comment in the code that clearly states where values were taken from and what they should be. naturally, i assumed it was a typo. again, sorry about that. i will double check next time. thanks, max From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 05:53:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D55D31065673; Fri, 8 Jun 2012 05:53:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF9AA8FC19; Fri, 8 Jun 2012 05:53:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q585rPbs035648; Fri, 8 Jun 2012 05:53:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q585rPVO035646; Fri, 8 Jun 2012 05:53:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206080553.q585rPVO035646@svn.freebsd.org> From: Alexander Motin Date: Fri, 8 Jun 2012 05:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236734 - stable/9/sys/geom/multipath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 05:53:25 -0000 Author: mav Date: Fri Jun 8 05:53:25 2012 New Revision: 236734 URL: http://svn.freebsd.org/changeset/base/236734 Log: MFC r236619: Add missing newlines into XML output. Modified: stable/9/sys/geom/multipath/g_multipath.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/multipath/g_multipath.c ============================================================================== --- stable/9/sys/geom/multipath/g_multipath.c Fri Jun 8 01:51:49 2012 (r236733) +++ stable/9/sys/geom/multipath/g_multipath.c Fri Jun 8 05:53:25 2012 (r236734) @@ -1314,7 +1314,7 @@ g_multipath_dumpconf(struct sbuf *sb, co if (sc == NULL) return; if (cp != NULL) { - sbuf_printf(sb, "%s%s", indent, + sbuf_printf(sb, "%s%s\n", indent, (cp->index & MP_NEW) ? "NEW" : (cp->index & MP_LOST) ? "LOST" : (cp->index & MP_FAIL) ? "FAIL" : @@ -1323,17 +1323,17 @@ g_multipath_dumpconf(struct sbuf *sb, co sc->sc_active_active == 2 ? "READ" : "PASSIVE"); } else { good = g_multipath_good(gp); - sbuf_printf(sb, "%s%s", indent, + sbuf_printf(sb, "%s%s\n", indent, good == 0 ? "BROKEN" : (good != sc->sc_ndisks || sc->sc_ndisks == 1) ? "DEGRADED" : "OPTIMAL"); } if (cp == NULL && pp == NULL) { - sbuf_printf(sb, "%s%s", indent, sc->sc_uuid); - sbuf_printf(sb, "%sActive/%s", indent, + sbuf_printf(sb, "%s%s\n", indent, sc->sc_uuid); + sbuf_printf(sb, "%sActive/%s\n", indent, sc->sc_active_active == 2 ? "Read" : sc->sc_active_active == 1 ? "Active" : "Passive"); - sbuf_printf(sb, "%s%s", indent, + sbuf_printf(sb, "%s%s\n", indent, sc->sc_uuid[0] == 0 ? "MANUAL" : "AUTOMATIC"); } } From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 05:54:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 399E91065670; Fri, 8 Jun 2012 05:54:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 240058FC1D; Fri, 8 Jun 2012 05:54:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q585sasO035757; Fri, 8 Jun 2012 05:54:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q585sabU035755; Fri, 8 Jun 2012 05:54:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206080554.q585sabU035755@svn.freebsd.org> From: Alexander Motin Date: Fri, 8 Jun 2012 05:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236735 - stable/8/sys/geom/multipath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 05:54:37 -0000 Author: mav Date: Fri Jun 8 05:54:36 2012 New Revision: 236735 URL: http://svn.freebsd.org/changeset/base/236735 Log: MFC r236619: Add missing newlines into XML output. Modified: stable/8/sys/geom/multipath/g_multipath.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/geom/multipath/g_multipath.c ============================================================================== --- stable/8/sys/geom/multipath/g_multipath.c Fri Jun 8 05:53:25 2012 (r236734) +++ stable/8/sys/geom/multipath/g_multipath.c Fri Jun 8 05:54:36 2012 (r236735) @@ -1312,7 +1312,7 @@ g_multipath_dumpconf(struct sbuf *sb, co if (sc == NULL) return; if (cp != NULL) { - sbuf_printf(sb, "%s%s", indent, + sbuf_printf(sb, "%s%s\n", indent, (cp->index & MP_NEW) ? "NEW" : (cp->index & MP_LOST) ? "LOST" : (cp->index & MP_FAIL) ? "FAIL" : @@ -1321,17 +1321,17 @@ g_multipath_dumpconf(struct sbuf *sb, co sc->sc_active_active == 2 ? "READ" : "PASSIVE"); } else { good = g_multipath_good(gp); - sbuf_printf(sb, "%s%s", indent, + sbuf_printf(sb, "%s%s\n", indent, good == 0 ? "BROKEN" : (good != sc->sc_ndisks || sc->sc_ndisks == 1) ? "DEGRADED" : "OPTIMAL"); } if (cp == NULL && pp == NULL) { - sbuf_printf(sb, "%s%s", indent, sc->sc_uuid); - sbuf_printf(sb, "%sActive/%s", indent, + sbuf_printf(sb, "%s%s\n", indent, sc->sc_uuid); + sbuf_printf(sb, "%sActive/%s\n", indent, sc->sc_active_active == 2 ? "Read" : sc->sc_active_active == 1 ? "Active" : "Passive"); - sbuf_printf(sb, "%s%s", indent, + sbuf_printf(sb, "%s%s\n", indent, sc->sc_uuid[0] == 0 ? "MANUAL" : "AUTOMATIC"); } } From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 06:07:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8AD85106566C; Fri, 8 Jun 2012 06:07:24 +0000 (UTC) (envelope-from jhay@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 767688FC1B; Fri, 8 Jun 2012 06:07:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5867OeX036458; Fri, 8 Jun 2012 06:07:24 GMT (envelope-from jhay@svn.freebsd.org) Received: (from jhay@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5867OWG036456; Fri, 8 Jun 2012 06:07:24 GMT (envelope-from jhay@svn.freebsd.org) Message-Id: <201206080607.q5867OWG036456@svn.freebsd.org> From: John Hay Date: Fri, 8 Jun 2012 06:07:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236736 - head/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 06:07:24 -0000 Author: jhay Date: Fri Jun 8 06:07:23 2012 New Revision: 236736 URL: http://svn.freebsd.org/changeset/base/236736 Log: Add support for the Sunix SER5437A dual serial PCI Express card. Modified: head/sys/dev/puc/pucdata.c Modified: head/sys/dev/puc/pucdata.c ============================================================================== --- head/sys/dev/puc/pucdata.c Fri Jun 8 05:54:36 2012 (r236735) +++ head/sys/dev/puc/pucdata.c Fri Jun 8 06:07:23 2012 (r236736) @@ -901,6 +901,12 @@ const struct puc_cfg puc_pci_devices[] = .config_function = puc_config_syba }, + { 0x1fd4, 0x1999, 0xffff, 0, + "Sunix SER5437A", + DEFAULT_RCLK * 8, + PUC_PORT_2S, 0x10, 0, 8, + }, + { 0x5372, 0x6873, 0xffff, 0, "Sun 1040 PCI Quad Serial", DEFAULT_RCLK, From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 07:44:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1BFB71065673; Fri, 8 Jun 2012 07:44:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 074C48FC12; Fri, 8 Jun 2012 07:44:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q587igUP040826; Fri, 8 Jun 2012 07:44:42 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q587igw9040824; Fri, 8 Jun 2012 07:44:42 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206080744.q587igw9040824@svn.freebsd.org> From: Alexander Motin Date: Fri, 8 Jun 2012 07:44:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236737 - head/sys/dev/ahci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 07:44:43 -0000 Author: mav Date: Fri Jun 8 07:44:42 2012 New Revision: 236737 URL: http://svn.freebsd.org/changeset/base/236737 Log: Add IDs for Marvell 88SE9220/9230/9235 PCIe 2.0 x2 6Gbps SATA controllers. Marvell 88SE9230 was confirmed to work, the rest two are just guessed. MFC after: 1 week Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Fri Jun 8 06:07:23 2012 (r236736) +++ head/sys/dev/ahci/ahci.c Fri Jun 8 07:44:42 2012 (r236737) @@ -202,6 +202,9 @@ static struct { {0x91301b4b, 0x00, "Marvell 88SE9130", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, {0x91721b4b, 0x00, "Marvell 88SE9172", AHCI_Q_NOBSYRES}, {0x91821b4b, 0x00, "Marvell 88SE9182", AHCI_Q_NOBSYRES}, + {0x92201b4b, 0x00, "Marvell 88SE9220", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, + {0x92301b4b, 0x00, "Marvell 88SE9230", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, + {0x92351b4b, 0x00, "Marvell 88SE9235", AHCI_Q_NOBSYRES}, {0x06201103, 0x00, "HighPoint RocketRAID 620", AHCI_Q_NOBSYRES}, {0x06201b4b, 0x00, "HighPoint RocketRAID 620", AHCI_Q_NOBSYRES}, {0x06221103, 0x00, "HighPoint RocketRAID 622", AHCI_Q_NOBSYRES}, From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 08:04:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BC137106566C; Fri, 8 Jun 2012 08:04:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7D718FC0A; Fri, 8 Jun 2012 08:04:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5884p83041796; Fri, 8 Jun 2012 08:04:51 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5884pnT041794; Fri, 8 Jun 2012 08:04:51 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201206080804.q5884pnT041794@svn.freebsd.org> From: Mateusz Guzik Date: Fri, 8 Jun 2012 08:04:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236738 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 08:04:51 -0000 Author: mjg Date: Fri Jun 8 08:04:51 2012 New Revision: 236738 URL: http://svn.freebsd.org/changeset/base/236738 Log: Plug socket refcount leak on error in sys_sctp_peeloff. Reviewed by: tuexen Approved by: trasz (mentor) MFC after: 3 days Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Fri Jun 8 07:44:42 2012 (r236737) +++ head/sys/kern/uipc_syscalls.c Fri Jun 8 08:04:51 2012 (r236738) @@ -2327,11 +2327,11 @@ sys_sctp_peeloff(td, uap) goto done2; if (head->so_proto->pr_protocol != IPPROTO_SCTP) { error = EOPNOTSUPP; - goto done2; + goto done; } error = sctp_can_peel_off(head, (sctp_assoc_t)uap->name); if (error) - goto done2; + goto done; /* * At this point we know we do have a assoc to pull * we proceed to get the fd setup. This may block From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 10:03:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3FAB1065670; Fri, 8 Jun 2012 10:03:37 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 958958FC17; Fri, 8 Jun 2012 10:03:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58A3bGC047624; Fri, 8 Jun 2012 10:03:37 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58A3bF2047622; Fri, 8 Jun 2012 10:03:37 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201206081003.q58A3bF2047622@svn.freebsd.org> From: Max Khon Date: Fri, 8 Jun 2012 10:03:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236742 - stable/9/usr.bin/make X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 10:03:37 -0000 Author: fjoe Date: Fri Jun 8 10:03:37 2012 New Revision: 236742 URL: http://svn.freebsd.org/changeset/base/236742 Log: MFC: r231544 Include target names in diagnostic output. Submitted by: Garrett Cooper Modified: stable/9/usr.bin/make/job.c Directory Properties: stable/9/ (props changed) stable/9/usr.bin/ (props changed) stable/9/usr.bin/make/ (props changed) Modified: stable/9/usr.bin/make/job.c ============================================================================== --- stable/9/usr.bin/make/job.c Fri Jun 8 09:51:57 2012 (r236741) +++ stable/9/usr.bin/make/job.c Fri Jun 8 10:03:37 2012 (r236742) @@ -954,17 +954,19 @@ JobFinish(Job *job, int *status) lastNode = job->node; } fprintf(out, - "*** Completed successfully\n"); + "*** [%s] Completed successfully\n", + job->node->name); } } else { if (usePipes && job->node != lastNode) { MESSAGE(out, job->node); lastNode = job->node; } - fprintf(out, "*** Error code %d%s\n", + fprintf(out, "*** [%s] Error code %d%s\n", + job->node->name, WEXITSTATUS(*status), (job->flags & JOB_IGNERR) ? - "(ignored)" : ""); + " (ignored)" : ""); if (job->flags & JOB_IGNERR) { *status = 0; @@ -1005,7 +1007,8 @@ JobFinish(Job *job, int *status) MESSAGE(out, job->node); lastNode = job->node; } - fprintf(out, "*** Continued\n"); + fprintf(out, "*** [%s] Continued\n", + job->node->name); } if (!(job->flags & JOB_CONTINUING)) { DEBUGF(JOB, ("Warning: process %jd was not " @@ -1029,7 +1032,8 @@ JobFinish(Job *job, int *status) lastNode = job->node; } fprintf(out, - "*** Signal %d\n", WTERMSIG(*status)); + "*** [%s] Signal %d\n", job->node->name, + WTERMSIG(*status)); fflush(out); } } @@ -1056,7 +1060,8 @@ JobFinish(Job *job, int *status) MESSAGE(out, job->node); lastNode = job->node; } - fprintf(out, "*** Stopped -- signal %d\n", WSTOPSIG(*status)); + fprintf(out, "*** [%s] Stopped -- signal %d\n", + job->node->name, WSTOPSIG(*status)); job->flags |= JOB_RESUME; TAILQ_INSERT_TAIL(&stoppedJobs, job, link); fflush(out); @@ -3042,13 +3047,15 @@ Compat_RunCommand(char *cmd, GNode *gn) if (status == 0) { return (0); } else { - printf("*** Error code %d", status); + printf("*** [%s] Error code %d", + gn->name, status); } } else if (WIFSTOPPED(reason)) { status = WSTOPSIG(reason); } else { status = WTERMSIG(reason); - printf("*** Signal %d", status); + printf("*** [%s] Signal %d", + gn->name, status); } if (ps.errCheck) { From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 11:40:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93D8010656D0; Fri, 8 Jun 2012 11:40:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D9BC8FC0C; Fri, 8 Jun 2012 11:40:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58BeUxH056145; Fri, 8 Jun 2012 11:40:30 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58BeUZw056143; Fri, 8 Jun 2012 11:40:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206081140.q58BeUZw056143@svn.freebsd.org> From: Alexander Motin Date: Fri, 8 Jun 2012 11:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236743 - stable/8/sys/dev/sound/pcm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 11:40:30 -0000 Author: mav Date: Fri Jun 8 11:40:30 2012 New Revision: 236743 URL: http://svn.freebsd.org/changeset/base/236743 Log: MFC r214332: Make hw.snd.vpc_0db to be also a loader tunable. Modified: stable/8/sys/dev/sound/pcm/channel.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/sound/pcm/channel.c ============================================================================== --- stable/8/sys/dev/sound/pcm/channel.c Fri Jun 8 10:03:37 2012 (r236742) +++ stable/8/sys/dev/sound/pcm/channel.c Fri Jun 8 11:40:30 2012 (r236743) @@ -124,6 +124,7 @@ SYSCTL_INT(_hw_snd, OID_AUTO, vpc_autore &chn_vpc_autoreset, 0, "automatically reset channels volume to 0db"); static int chn_vol_0db_pcm = SND_VOL_0DB_PCM; +TUNABLE_INT("hw.snd.vpc_0db", &chn_vol_0db_pcm); static void chn_vpc_proc(int reset, int db) From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 11:58:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D5370106566B; Fri, 8 Jun 2012 11:58:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF25E8FC0A; Fri, 8 Jun 2012 11:58:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58BwSLP057042; Fri, 8 Jun 2012 11:58:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58BwS6G057040; Fri, 8 Jun 2012 11:58:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206081158.q58BwS6G057040@svn.freebsd.org> From: Alexander Motin Date: Fri, 8 Jun 2012 11:58:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236745 - stable/8/sys/dev/sound/pcm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 11:58:29 -0000 Author: mav Date: Fri Jun 8 11:58:28 2012 New Revision: 236745 URL: http://svn.freebsd.org/changeset/base/236745 Log: MFC r222826: Make automatic hw.snd.default_unit choice a bit more intelligent. Instead of just setting it to the first registered device, reevaluate it for each device registered, trying to choose best candidate, unless one was forced. For now use such preference order: play&rec, play, rec. As side effect, this should workaround the situation when HDMI audio output of the video card, usually not connected to anything, becomes default, that requires manual user intervention to make sound working. If at some point this won't be enough, we can try to fetch some additional priority flags from the device driver. Modified: stable/8/sys/dev/sound/pcm/sound.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/sound/pcm/sound.c ============================================================================== --- stable/8/sys/dev/sound/pcm/sound.c Fri Jun 8 11:53:51 2012 (r236744) +++ stable/8/sys/dev/sound/pcm/sound.c Fri Jun 8 11:58:28 2012 (r236745) @@ -51,7 +51,7 @@ int pcm_veto_load = 1; int snd_unit = -1; TUNABLE_INT("hw.snd.default_unit", &snd_unit); -static int snd_unit_auto = 0; +static int snd_unit_auto = -1; TUNABLE_INT("hw.snd.default_auto", &snd_unit_auto); SYSCTL_INT(_hw_snd, OID_AUTO, default_auto, CTLFLAG_RW, &snd_unit_auto, 0, "assign default unit to a newly attached device"); @@ -443,6 +443,7 @@ sysctl_hw_snd_default_unit(SYSCTL_HANDLE if (!PCM_REGISTERED(d) || CHN_EMPTY(d, channels.pcm)) return EINVAL; snd_unit = unit; + snd_unit_auto = 0; } return (error); } @@ -737,6 +738,32 @@ pcm_killchan(device_t dev) return (pcm_chn_destroy(ch)); } +static int +pcm_best_unit(int old) +{ + struct snddev_info *d; + int i, best, bestprio, prio; + + best = -1; + bestprio = -100; + for (i = 0; pcm_devclass != NULL && + i < devclass_get_maxunit(pcm_devclass); i++) { + d = devclass_get_softc(pcm_devclass, i); + if (!PCM_REGISTERED(d)) + continue; + prio = 0; + if (d->playcount == 0) + prio -= 10; + if (d->reccount == 0) + prio -= 2; + if (prio > bestprio || (prio == bestprio && i == old)) { + best = i; + bestprio = prio; + } + } + return (best); +} + int pcm_setstatus(device_t dev, char *str) { @@ -770,8 +797,12 @@ pcm_setstatus(device_t dev, char *str) PCM_UNLOCK(d); - if (snd_unit < 0 || snd_unit_auto != 0) + if (snd_unit_auto < 0) + snd_unit_auto = (snd_unit < 0) ? 1 : 0; + if (snd_unit < 0 || snd_unit_auto > 1) snd_unit = device_get_unit(dev); + else if (snd_unit_auto == 1) + snd_unit = pcm_best_unit(snd_unit); return (0); } @@ -1113,7 +1144,6 @@ pcm_unregister(device_t dev) struct snddev_info *d; struct pcm_channel *ch; struct thread *td; - int i; td = curthread; d = device_get_softc(dev); @@ -1216,21 +1246,9 @@ pcm_unregister(device_t dev) sndstat_release(td); if (snd_unit == device_get_unit(dev)) { - /* - * Reassign default unit to the next available dev, but - * first, reset snd_unit to something ridiculous. - */ - snd_unit = -1; - for (i = 0; pcm_devclass != NULL && - i < devclass_get_maxunit(pcm_devclass); i++) { - if (device_get_unit(dev) == i) - continue; - d = devclass_get_softc(pcm_devclass, i); - if (PCM_REGISTERED(d)) { - snd_unit = i; - break; - } - } + snd_unit = pcm_best_unit(-1); + if (snd_unit_auto == 0) + snd_unit_auto = 1; } return (0); From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 12:09:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2B8991065677; Fri, 8 Jun 2012 12:09:01 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1530E8FC0C; Fri, 8 Jun 2012 12:09:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58C91J7057594; Fri, 8 Jun 2012 12:09:01 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58C906K057556; Fri, 8 Jun 2012 12:09:00 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201206081209.q58C906K057556@svn.freebsd.org> From: Joel Dahl Date: Fri, 8 Jun 2012 12:09:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236746 - head/lib/libgssapi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 12:09:01 -0000 Author: joel (doc committer) Date: Fri Jun 8 12:09:00 2012 New Revision: 236746 URL: http://svn.freebsd.org/changeset/base/236746 Log: mdoc: add missing -width argument to Bl -tag. Modified: head/lib/libgssapi/gss_accept_sec_context.3 head/lib/libgssapi/gss_acquire_cred.3 head/lib/libgssapi/gss_add_cred.3 head/lib/libgssapi/gss_add_oid_set_member.3 head/lib/libgssapi/gss_canonicalize_name.3 head/lib/libgssapi/gss_compare_name.3 head/lib/libgssapi/gss_context_time.3 head/lib/libgssapi/gss_create_empty_oid_set.3 head/lib/libgssapi/gss_delete_sec_context.3 head/lib/libgssapi/gss_display_name.3 head/lib/libgssapi/gss_display_status.3 head/lib/libgssapi/gss_duplicate_name.3 head/lib/libgssapi/gss_export_name.3 head/lib/libgssapi/gss_export_sec_context.3 head/lib/libgssapi/gss_get_mic.3 head/lib/libgssapi/gss_import_name.3 head/lib/libgssapi/gss_import_sec_context.3 head/lib/libgssapi/gss_indicate_mechs.3 head/lib/libgssapi/gss_init_sec_context.3 head/lib/libgssapi/gss_inquire_context.3 head/lib/libgssapi/gss_inquire_cred.3 head/lib/libgssapi/gss_inquire_cred_by_mech.3 head/lib/libgssapi/gss_inquire_mechs_for_name.3 head/lib/libgssapi/gss_inquire_names_for_mech.3 head/lib/libgssapi/gss_process_context_token.3 head/lib/libgssapi/gss_release_buffer.3 head/lib/libgssapi/gss_release_cred.3 head/lib/libgssapi/gss_release_name.3 head/lib/libgssapi/gss_release_oid_set.3 head/lib/libgssapi/gss_test_oid_set_member.3 head/lib/libgssapi/gss_unwrap.3 head/lib/libgssapi/gss_verify_mic.3 head/lib/libgssapi/gss_wrap.3 head/lib/libgssapi/gss_wrap_size_limit.3 head/lib/libgssapi/gssapi.3 head/lib/libgssapi/mech.5 Modified: head/lib/libgssapi/gss_accept_sec_context.3 ============================================================================== --- head/lib/libgssapi/gss_accept_sec_context.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_accept_sec_context.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -212,7 +212,7 @@ exist in version 1 of the GSS-API specif wish to run over version 1 implementations must special-case these codes. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It input_chan_bindings" .It context_handle Context handle for new context. Supply @@ -400,7 +400,7 @@ Specify Mechanism specific status code. .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_DEFECTIVE_CREDENTIAL" .It GSS_S_CONTINUE_NEEDED Indicates that a token from the peer application is required to complete the context, @@ -442,7 +442,7 @@ the implementation or the provided crede .Xr gss_release_name 3 , .Xr gss_wrap 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_acquire_cred.3 ============================================================================== --- head/lib/libgssapi/gss_acquire_cred.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_acquire_cred.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -126,7 +126,7 @@ immediately following the call of must return valid credential data, and may therefore incur the overhead of a deferred credential acquisition. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It output_cred_handle" .It desired_name Name of principal whose credential should be acquired. .It time_req @@ -174,7 +174,7 @@ Specify NULL if not required. Mechanism specific status code. .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_CREDENTIALS_EXPIRED" .It GSS_S_COMPLETE Successful completion. .It GSS_S_BAD_MECH @@ -196,7 +196,7 @@ No credentials were found for the specif .Xr gss_release_cred 3 , .Xr gss_release_oid_set 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_add_cred.3 ============================================================================== --- head/lib/libgssapi/gss_add_cred.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_add_cred.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -170,7 +170,7 @@ a non- .Fa output_cred_handle must be supplied. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It output_cred_handle" .It minor_status Mechanism specific status code. .It input_cred_handle @@ -270,7 +270,7 @@ Specify if not required. .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_CREDENTIALS_EXPIRED" .It GSS_S_COMPLETE Successful completion. .It GSS_S_BAD_MECH @@ -296,7 +296,7 @@ No credentials were found for the specif .Xr gss_release_cred 3 , .Xr gss_release_oid_set 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_add_oid_set_member.3 ============================================================================== --- head/lib/libgssapi/gss_add_oid_set_member.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_add_oid_set_member.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -71,7 +71,7 @@ the .Fa oid_set should remain unchanged. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It minor_status" .It minor_status Mechanism specific status code. .It member_oid @@ -80,7 +80,7 @@ The object identifier to copied into the The set in which the object identifier should be inserted. .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_COMPLETE" .It GSS_S_COMPLETE Successful completion .El @@ -88,7 +88,7 @@ Successful completion .Xr gss_create_empty_oid_set 3 , .Xr gss_acquire_cred 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_canonicalize_name.3 ============================================================================== --- head/lib/libgssapi/gss_canonicalize_name.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_canonicalize_name.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -62,7 +62,7 @@ specifying .Fa mech_type as the authentication mechanism. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It minor_status" .It minor_status Mechanism specific status code. .It input_name @@ -79,7 +79,7 @@ after use with a call to .Fn gss_release_name . .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_BAD_NAMETYPE" .It GSS_S_COMPLETE Successful completion. .It GSS_S_BAD_MECH @@ -95,7 +95,7 @@ The provided internal name was ill-forme .Xr gss_init_sec_context 3 , .Xr gss_release_name 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_compare_name.3 ============================================================================== --- head/lib/libgssapi/gss_compare_name.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_compare_name.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -54,7 +54,7 @@ denotes an anonymous principal, the routines should indicate that the two names do not refer to the same identity. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width "minor_status" .It minor_status Mechanism specific status code. .It name1 @@ -62,7 +62,7 @@ Internal-form name. .It name2 Internal-form name. .It name_equal -.Bl -tag +.Bl -tag -width "non-zero" .It non-zero Names refer to same entity .It zero @@ -71,7 +71,7 @@ to refer to the same identity). .El .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_BAD_NAMETYPE" .It GSS_S_COMPLETE Successful completion .It GSS_S_BAD_NAMETYPE @@ -80,7 +80,7 @@ The two names were of incomparable types One or both of name1 or name2 was ill-formed. .El .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_context_time.3 ============================================================================== --- head/lib/libgssapi/gss_context_time.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_context_time.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -47,7 +47,7 @@ Determines the number of seconds for which the specified context will remain valid. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It context_handle" .It minor_status Mechanism specific status code. .It context_handle @@ -57,7 +57,7 @@ Number of seconds that the context will If the context has already expired, zero will be returned. .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_CONTEXT_EXPIRED" .It GSS_S_COMPLETE Successful completion .It GSS_S_CONTEXT_EXPIRED @@ -66,7 +66,7 @@ The context has already expired The context_handle parameter did not identify a valid context .El .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_create_empty_oid_set.3 ============================================================================== --- head/lib/libgssapi/gss_create_empty_oid_set.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_create_empty_oid_set.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -51,7 +51,7 @@ These routines are intended to be used t object identifiers for input to .Fn gss_acquire_cred . .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It minor_status" .It minor_status Mechanism specific status code. .It oid_set @@ -61,7 +61,7 @@ which the application must free after us .Fn gss_release_oid_set . .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_COMPLETE" .It GSS_S_COMPLETE Successful completion .El @@ -69,7 +69,7 @@ Successful completion .Xr gss_add_oid_set_member 3 , .Xr gss_acquire_cred 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_delete_sec_context.3 ============================================================================== --- head/lib/libgssapi/gss_delete_sec_context.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_delete_sec_context.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -88,7 +88,7 @@ mechanisms are encouraged to return a ze indicating that no peer action is necessary, and that no token should be transferred by the application. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It context_handle" .It minor_status Mechanism specific status code. .It context_handle @@ -110,7 +110,7 @@ field of this token to zero to indicate token is to be sent to the peer. .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It context_handle" .It GSS_S_COMPLETE Successful completion .It GSS_S_NO_CONTEXT @@ -121,7 +121,7 @@ No valid context was supplied .Xr gss_init_sec_context 3 , .Xr gss_accept_sec_context 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_display_name.3 ============================================================================== --- head/lib/libgssapi/gss_display_name.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_display_name.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -76,7 +76,7 @@ via the .Fa output_name_type parameter. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It output_name_buffer" .It minor_status Mechanism specific status code. .It input_name @@ -98,7 +98,7 @@ Specify if not required. .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_COMPLETE" .It GSS_S_COMPLETE Successful completion .It GSS_S_BAD_NAME @@ -109,7 +109,7 @@ was ill-formed .Xr gss_import_name 3 , .Xr gss_release_buffer 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_display_status.3 ============================================================================== --- head/lib/libgssapi/gss_display_status.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_display_status.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -111,13 +111,13 @@ do { } while (message_context != 0); .Ed .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It minor_status" .It minor_status Mechanism specific status code. .It status_value Status value to be converted .It status_type -.Bl -tag +.Bl -tag -width ".It GSS_C_MECH_CODE" .It GSS_C_GSS_CODE .Fa status_value is a GSS status code @@ -153,7 +153,7 @@ application after use with a call to .Fn gss_release_buffer . .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_BAD_STATUS" .It GSS_S_COMPLETE Successful completion .It GSS_S_BAD_MECH @@ -168,7 +168,7 @@ nor .Sh SEE ALSO .Xr gss_release_buffer 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_duplicate_name.3 ============================================================================== --- head/lib/libgssapi/gss_duplicate_name.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_duplicate_name.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -57,7 +57,7 @@ and must both be released, and the release of one shall not affect the validity of the other). .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It minor_status" .It minor_status Mechanism specific status code. .It src_name @@ -70,7 +70,7 @@ after use with a call to .Fn gss_release_name . .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_COMPLETE" .It GSS_S_COMPLETE Successful completion .It GSS_S_BAD_NAME @@ -81,7 +81,7 @@ parameter was ill-formed .Sh SEE ALSO .Xr gss_release_name 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_export_name.3 ============================================================================== --- head/lib/libgssapi/gss_export_name.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_export_name.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -58,7 +58,7 @@ parameter must specify a valid MN or by .Fn gss_canonicalize_name ). .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It exported_name" .It minor_status Mechanism specific status code. .It input_name @@ -71,7 +71,7 @@ after use with .Fn gss_release_buffer . .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_BAD_NAMETYPE" .It GSS_S_COMPLETE Successful completion .It GSS_S_NAME_NOT_MN @@ -86,7 +86,7 @@ The internal name was of a type not supp .Xr gss_canonicalize_name 3 , .Xr gss_release_buffer 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_export_sec_context.3 ============================================================================== --- head/lib/libgssapi/gss_export_sec_context.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_export_sec_context.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -100,7 +100,7 @@ providing it also sets the parameter to .Dv GSS_C_NO_CONTEXT . .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It interprocess_token" .It minor_status Mechanism specific status code. .It context_handle @@ -112,7 +112,7 @@ after use with a call to .Fn gss_release_buffer . .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_CONTEXT_EXPIRED" .It GSS_S_COMPLETE Successful completion .It GSS_S_CONTEXT_EXPIRED @@ -126,7 +126,7 @@ The operation is not supported .Xr gss_import_sec_context 3 , .Xr gss_release_buffer 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_get_mic.3 ============================================================================== --- head/lib/libgssapi/gss_get_mic.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_get_mic.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -81,7 +81,7 @@ both to allow GSS-API V1 applications to and to retain the slight parameter type differences between the obsolete versions of this routine and its current form. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It message_buffer" .It minor_status Mechanism specific status code. .It context_handle @@ -109,7 +109,7 @@ use with a call to .Fn gss_release_buffer . .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_CONTEXT_EXPIRED" .It GSS_S_COMPLETE Successful completion .It GSS_S_CONTEXT_EXPIRED @@ -123,7 +123,7 @@ The specified QOP is not supported by th .Xr gss_wrap 3 , .Xr gss_release_buffer 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_import_name.3 ============================================================================== --- head/lib/libgssapi/gss_import_name.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_import_name.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -59,7 +59,7 @@ parameter is of type in which case the returned internal name will be an MN for the mechanism that exported the name. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It input_name_buffer" .It minor_status Mechanism specific status code. .It input_name_buffer @@ -78,7 +78,7 @@ after use with a call to .Fn gss_release_name . .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width "It GSS_S_BAD_NAMETYPE" .It GSS_S_COMPLETE Successful completion .It GSS_S_BAD_NAMETYPE @@ -97,7 +97,7 @@ but the mechanism contained within the i .Sh SEE ALSO .Xr gss_release_name 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_import_sec_context.3 ============================================================================== --- head/lib/libgssapi/gss_import_sec_context.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_import_sec_context.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -50,7 +50,7 @@ A given interprocess token may be import See .Fn gss_export_sec_context . .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It interprocess_token" .It minor_status Mechanism specific status code. .It interprocess_token @@ -62,7 +62,7 @@ application after use with a call to .Fn gss_delete_sec_context . .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_DEFECTIVE_TOKEN" .It GSS_S_COMPLETE Successful completion .It GSS_S_NO_CONTEXT @@ -78,7 +78,7 @@ Local policy prevents the import of this .Xr gss_export_sec_context 3 , .Xr gss_delete_sec_context 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_indicate_mechs.3 ============================================================================== --- head/lib/libgssapi/gss_indicate_mechs.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_indicate_mechs.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -46,7 +46,7 @@ Allows an application to determine which underlying security mechanisms are available. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It minor_status" .It minor_status Mechanism specific status code. .It mech_set @@ -58,14 +58,14 @@ that should be released by the caller af .Fn gss_release_oid_set . .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_COMPLETE" .It GSS_S_COMPLETE Successful completion .El .Sh SEE ALSO .Xr gss_release_oid_set 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_init_sec_context.3 ============================================================================== --- head/lib/libgssapi/gss_init_sec_context.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_init_sec_context.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -233,7 +233,7 @@ exist in version 1 of the GSS-API specif wish to run over version 1 implementations must special-case these codes. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It initiator_cred_handle" .It minor_status Mechanism specific status code. .It initiator_cred_handle @@ -475,7 +475,7 @@ not support context expiration, the valu .Dv NULL if not required. .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_CREDENTIALS_EXPIRED" .It GSS_S_COMPLETE Successful completion .It GSS_S_CONTINUE_NEEDED @@ -529,7 +529,7 @@ implementation. .Xr gss_release_buffer 3 , .Xr gss_wrap 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_inquire_context.3 ============================================================================== --- head/lib/libgssapi/gss_inquire_context.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_inquire_context.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -55,7 +55,7 @@ The caller must already have obtained a context, although the context need not be fully established. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It locally_initiated" .It minor_status Mechanism specific status code. .It context_handle @@ -229,7 +229,7 @@ Specify if not required. .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_NO_CONTEXT" .It GSS_S_COMPLETE Successful completion .It GSS_S_NO_CONTEXT @@ -242,7 +242,7 @@ The referenced context could not be acce .Xr gss_get_mic 3 , .Xr gss_export_sec_context 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_inquire_cred.3 ============================================================================== --- head/lib/libgssapi/gss_inquire_cred.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_inquire_cred.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -50,7 +50,7 @@ .Sh DESCRIPTION Obtains information about a credential. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It minor_status" .It minor_status Mechanism specific status code. .It cred_handle @@ -99,7 +99,7 @@ Specify if not required. .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_DEFECTIVE_CREDENTIAL" .It GSS_S_COMPLETE Successful completion .It GSS_S_NO_CRED @@ -116,7 +116,7 @@ it will be set to 0 .Xr gss_release_name 3 , .Xr gss_release_oid_set 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_inquire_cred_by_mech.3 ============================================================================== --- head/lib/libgssapi/gss_inquire_cred_by_mech.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_inquire_cred_by_mech.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -50,7 +50,7 @@ .Sh DESCRIPTION Obtains per-mechanism information about a credential. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It initiator_lifetime" .It minor_status Mechanism specific status code. .It cred_handle @@ -114,7 +114,7 @@ Specify if not required. .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_DEFECTIVE_CREDENTIAL" .It GSS_S_COMPLETE Successful completion .It GSS_S_NO_CRED @@ -130,7 +130,7 @@ it will be set to 0. .Sh SEE ALSO .Xr gss_release_name 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_inquire_mechs_for_name.3 ============================================================================== --- head/lib/libgssapi/gss_inquire_mechs_for_name.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_inquire_mechs_for_name.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -68,7 +68,7 @@ type). Thus this routine should be used only as a pre-filter for a call to a subsequent mechanism-specific routine. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It minor_status" .It minor_status Mechanism specific status code. .It input_name @@ -80,7 +80,7 @@ to .Fn gss_release_oid_set . .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_COMPLETE" .It GSS_S_COMPLETE Successful completion .It GSS_S_BAD_NAME @@ -91,7 +91,7 @@ parameter was ill-formed .Sh SEE ALSO .Xr gss_release_oid_set 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_inquire_names_for_mech.3 ============================================================================== --- head/lib/libgssapi/gss_inquire_names_for_mech.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_inquire_names_for_mech.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -46,7 +46,7 @@ .Sh DESCRIPTION Returns the set of name-types supported by the specified mechanism. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It minor_status" .It minor_status Mechanism specific status code. .It mechanism @@ -58,14 +58,14 @@ call to .Fn gss_release_oid_set . .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width "GSS_S_COMPLETEXX" .It GSS_S_COMPLETE Successful completion .El .Sh SEE ALSO .Xr gss_release_oid_set 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_process_context_token.3 ============================================================================== --- head/lib/libgssapi/gss_process_context_token.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_process_context_token.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -71,7 +71,7 @@ believing that the context is fully esta .Fn gss_process_context_token provides a way to pass such a token to the mechanism at any time. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It context_handle" .It minor_status Mechanism specific status code. .It context_handle @@ -80,7 +80,7 @@ Context handle of context on which token Token to process. .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_DEFECTIVE_TOKEN" .It GSS_S_COMPLETE Successful completion .It GSS_S_DEFECTIVE_TOKEN @@ -94,7 +94,7 @@ did not refer to a valid context .Xr gss_init_sec_context 3 , .Xr gss_accept_sec_context 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_release_buffer.3 ============================================================================== --- head/lib/libgssapi/gss_release_buffer.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_release_buffer.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -55,7 +55,7 @@ Any buffer object returned by a GSS-API .Fn gss_release_buffer (even if there is no storage associated with the buffer). .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It minor_status" .It minor_status Mechanism specific status code. .It buffer @@ -64,12 +64,12 @@ The gss_buffer_desc object will not be f but its length field will be zeroed. .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_COMPLETE" .It GSS_S_COMPLETE Successful completion .El .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_release_cred.3 ============================================================================== --- head/lib/libgssapi/gss_release_cred.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_release_cred.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -50,7 +50,7 @@ Implementations are encouraged to set th .Dv GSS_C_NO_CREDENTIAL on successful completion of this call. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It minor_status" .It minor_status Mechanism specific status code. .It cred_handle @@ -59,14 +59,14 @@ If GSS_C_NO_CREDENTIAL is supplied, the routine will complete successfully, but will do nothing. .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_COMPLETE" .It GSS_S_COMPLETE Successful completion .It GSS_S_NO_CRED Credentials could not be accessed .El .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_release_name.3 ============================================================================== --- head/lib/libgssapi/gss_release_name.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_release_name.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -48,21 +48,21 @@ Implementations are encouraged to set th .Dv GSS_C_NO_NAME on successful completion of this call. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It minor status" .It minor_status Mechanism specific status code. .It name The name to be deleted. .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_COMPLETE" .It GSS_S_COMPLETE Successful completion .It GSS_S_BAD_NAME The name parameter did not contain a valid name .El .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_release_oid_set.3 ============================================================================== --- head/lib/libgssapi/gss_release_oid_set.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_release_oid_set.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -55,19 +55,19 @@ Implementations are encouraged to set th .Dv GSS_C_NO_OID_SET on successful completion of this routine. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It minor_status" .It minor_status Mechanism specific status code. .It set The storage associated with the gss_OID_set will be deleted. .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_COMPLETE" .It GSS_S_COMPLETE Successful completion .El .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_test_oid_set_member.3 ============================================================================== --- head/lib/libgssapi/gss_test_oid_set_member.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_test_oid_set_member.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -54,7 +54,7 @@ and .Fn gss_inquire_cred , but will also work with user-generated sets. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It minor_status" .It minor_status Mechanism specific status code. .It member @@ -65,7 +65,7 @@ The Object Identifier set. Non-zero if the specified OID is a member of the set, zero if not. .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_COMPLETE" .It GSS_S_COMPLETE Successful completion .El @@ -74,7 +74,7 @@ Successful completion .Xr gss_acquire_cred 3 , .Xr gss_inquire_cred 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_unwrap.3 ============================================================================== --- head/lib/libgssapi/gss_unwrap.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_unwrap.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -90,7 +90,7 @@ both to allow GSS-API V1 applications to and to retain the slight parameter type differences between the obsolete versions of this routine and its current form. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It output_message_buffer" .It minor_status Mechanism specific status code. .It context_handle @@ -116,7 +116,7 @@ Specify NULL if not required. Quality of protection provided. Specify NULL if not required. .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_CONTEXT_EXPIRED" .It GSS_S_COMPLETE Successful completion. .It GSS_S_DEFECTIVE_TOKEN @@ -150,7 +150,7 @@ The context_handle parameter did not ide .Xr gss_wrap 3 , .Xr gss_release_buffer 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_verify_mic.3 ============================================================================== --- head/lib/libgssapi/gss_verify_mic.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_verify_mic.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -81,7 +81,7 @@ both to allow GSS-API V1 applications to and to retain the slight parameter type differences between the obsolete versions of this routine and its current form. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It context_handle" .It minor_status Mechanism specific status code. .It context_handle @@ -97,7 +97,7 @@ Specify if not required. .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_CONTEXT_EXPIRED" .It GSS_S_COMPLETE Successful completion .It GSS_S_DEFECTIVE_TOKEN @@ -130,7 +130,7 @@ The context_handle parameter did not ide .Sh SEE ALSO .Xr gss_wrap 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_wrap.3 ============================================================================== --- head/lib/libgssapi/gss_wrap.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_wrap.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -85,13 +85,13 @@ both to allow GSS-API V1 applications to and to retain the slight parameter type differences between the obsolete versions of this routine and its current form. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It output_message_buffer" .It minor_status Mechanism specific status code. .It context_handle Identifies the context on which the message will be sent. .It conf_req_flag -.Bl -tag -width "Non-zero" +.Bl -tag -width "Non-zero" -compact .It Non-zero Both confidentiality and integrity services are requested. .It Zero @@ -108,7 +108,7 @@ will return a major_status of .It input_message_buffer Message to be protected. .It conf_state -.Bl -tag -width "Non-zero" +.Bl -tag -width "Non-zero" -compact .It Non-zero Confidentiality, data origin authentication and integrity services have been applied. @@ -123,7 +123,7 @@ with a call to .Xr gss_release_buffer 3 . .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_CONTEXT_EXPIRED" .It GSS_S_COMPLETE Successful completion. .It GSS_S_CONTEXT_EXPIRED @@ -137,7 +137,7 @@ The specified QOP is not supported by th .Xr gss_unwrap 3 , .Xr gss_release_buffer 3 .Sh STANDARDS -.Bl -tag +.Bl -tag -width ".It RFC 2743" .It RFC 2743 Generic Security Service Application Program Interface Version 2, Update 1 .It RFC 2744 Modified: head/lib/libgssapi/gss_wrap_size_limit.3 ============================================================================== --- head/lib/libgssapi/gss_wrap_size_limit.3 Fri Jun 8 11:58:28 2012 (r236745) +++ head/lib/libgssapi/gss_wrap_size_limit.3 Fri Jun 8 12:09:00 2012 (r236746) @@ -83,7 +83,7 @@ the implementation should not return a v .Dv max_input_bytes that is greater than this length. .Sh PARAMETERS -.Bl -tag +.Bl -tag -width ".It req_output_size" .It minor_status Mechanism specific status code. .It context_handle @@ -109,7 +109,7 @@ be no larger than bytes. .El .Sh RETURN VALUES -.Bl -tag +.Bl -tag -width ".It GSS_S_CONTEXT_EXPIRED" .It GSS_S_COMPLETE Successful completion. .It GSS_S_NO_CONTEXT @@ -122,7 +122,7 @@ The specified QOP is not supported by th .Sh SEE ALSO .Xr gss_wrap 3 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 12:23:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DA94106566C; Fri, 8 Jun 2012 12:23:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2BCF8FC19; Fri, 8 Jun 2012 12:23:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58CN2ut058271; Fri, 8 Jun 2012 12:23:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58CN2pZ058269; Fri, 8 Jun 2012 12:23:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206081223.q58CN2pZ058269@svn.freebsd.org> From: Alexander Motin Date: Fri, 8 Jun 2012 12:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236747 - stable/8/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 12:23:03 -0000 Author: mav Date: Fri Jun 8 12:23:02 2012 New Revision: 236747 URL: http://svn.freebsd.org/changeset/base/236747 Log: MFC r223058: Add bunch of Conexant codec IDs. For some of them add quirks to disable excessive signal paths to simplify tracer's life. Modified: stable/8/sys/dev/sound/pci/hda/hdac.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac.c Fri Jun 8 12:09:00 2012 (r236746) +++ stable/8/sys/dev/sound/pci/hda/hdac.c Fri Jun 8 12:23:02 2012 (r236747) @@ -754,7 +754,17 @@ static const struct { #define HDA_CODEC_CX20561 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5051) #define HDA_CODEC_CX20582 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5066) #define HDA_CODEC_CX20583 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5067) +#define HDA_CODEC_CX20584 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5068) #define HDA_CODEC_CX20585 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5069) +#define HDA_CODEC_CX20590 HDA_CODEC_CONSTRUCT(CONEXANT, 0x506e) +#define HDA_CODEC_CX20631 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5097) +#define HDA_CODEC_CX20632 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5098) +#define HDA_CODEC_CX20641 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50a1) +#define HDA_CODEC_CX20642 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50a2) +#define HDA_CODEC_CX20651 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50ab) +#define HDA_CODEC_CX20652 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50ac) +#define HDA_CODEC_CX20664 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50b8) +#define HDA_CODEC_CX20665 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50b9) #define HDA_CODEC_CXXXXX HDA_CODEC_CONSTRUCT(CONEXANT, 0xffff) /* VIA */ @@ -939,7 +949,17 @@ static const struct { { HDA_CODEC_CX20561, "Conexant CX20561 (Hermosa)" }, { HDA_CODEC_CX20582, "Conexant CX20582 (Pebble)" }, { HDA_CODEC_CX20583, "Conexant CX20583 (Pebble HSF)" }, + { HDA_CODEC_CX20584, "Conexant CX20584" }, { HDA_CODEC_CX20585, "Conexant CX20585" }, + { HDA_CODEC_CX20590, "Conexant CX20590" }, + { HDA_CODEC_CX20631, "Conexant CX20631" }, + { HDA_CODEC_CX20632, "Conexant CX20632" }, + { HDA_CODEC_CX20641, "Conexant CX20641" }, + { HDA_CODEC_CX20642, "Conexant CX20642" }, + { HDA_CODEC_CX20651, "Conexant CX20651" }, + { HDA_CODEC_CX20652, "Conexant CX20652" }, + { HDA_CODEC_CX20664, "Conexant CX20664" }, + { HDA_CODEC_CX20665, "Conexant CX20665" }, { HDA_CODEC_VT1708_8, "VIA VT1708_8" }, { HDA_CODEC_VT1708_9, "VIA VT1708_9" }, { HDA_CODEC_VT1708_A, "VIA VT1708_A" }, @@ -4921,6 +4941,25 @@ hdac_vendor_patch_parse(struct hdac_devi if (w != NULL) w->connsenable[0] = 0; break; + case HDA_CODEC_CX20582: + case HDA_CODEC_CX20583: + case HDA_CODEC_CX20584: + case HDA_CODEC_CX20585: + case HDA_CODEC_CX20590: + /* + * These codecs have extra connectivity on record side + * too reach for the present parser. + */ + w = hdac_widget_get(devinfo, 20); + if (w != NULL) + w->connsenable[1] = 0; + w = hdac_widget_get(devinfo, 21); + if (w != NULL) + w->connsenable[1] = 0; + w = hdac_widget_get(devinfo, 22); + if (w != NULL) + w->connsenable[0] = 0; + break; case HDA_CODEC_VT1708S_0: case HDA_CODEC_VT1708S_1: case HDA_CODEC_VT1708S_2: From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 12:24:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CE42106564A; Fri, 8 Jun 2012 12:24:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 071C68FC1A; Fri, 8 Jun 2012 12:24:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58COlvf058395; Fri, 8 Jun 2012 12:24:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58COlqT058393; Fri, 8 Jun 2012 12:24:47 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206081224.q58COlqT058393@svn.freebsd.org> From: Alexander Motin Date: Fri, 8 Jun 2012 12:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236748 - stable/8/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 12:24:48 -0000 Author: mav Date: Fri Jun 8 12:24:47 2012 New Revision: 236748 URL: http://svn.freebsd.org/changeset/base/236748 Log: MFC r224967: Fix headphones pin configuration on Lenovo B450 laptop. Modified: stable/8/sys/dev/sound/pci/hda/hdac.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac.c Fri Jun 8 12:23:02 2012 (r236747) +++ stable/8/sys/dev/sound/pci/hda/hdac.c Fri Jun 8 12:24:47 2012 (r236748) @@ -295,6 +295,7 @@ SND_DECLARE_FILE("$FreeBSD$"); #define LENOVO_VENDORID 0x17aa #define LENOVO_3KN100_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x2066) #define LENOVO_3KN200_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x384e) +#define LENOVO_B450_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3a0d) #define LENOVO_TCA55_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x1015) #define LENOVO_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0xffff) @@ -2582,6 +2583,13 @@ hdac_widget_pin_getconfig(struct hdac_wi break; } } + } else if (id == HDA_CODEC_CX20561 && + sc->pci_subvendor == LENOVO_B450_SUBVENDOR) { + switch (nid) { + case 22: + patch = "as=1 seq=15"; + break; + } } if (patch != NULL) From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 12:31:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 695571065670; Fri, 8 Jun 2012 12:31:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53F3E8FC0A; Fri, 8 Jun 2012 12:31:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58CVoFD058910; Fri, 8 Jun 2012 12:31:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58CVoON058908; Fri, 8 Jun 2012 12:31:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206081231.q58CVoON058908@svn.freebsd.org> From: Alexander Motin Date: Fri, 8 Jun 2012 12:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236749 - stable/8/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 12:31:50 -0000 Author: mav Date: Fri Jun 8 12:31:49 2012 New Revision: 236749 URL: http://svn.freebsd.org/changeset/base/236749 Log: MFC r223118: Hide driver revision behind bootverbose. Modified: stable/8/sys/dev/sound/pci/hda/hdac.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac.c Fri Jun 8 12:24:47 2012 (r236748) +++ stable/8/sys/dev/sound/pci/hda/hdac.c Fri Jun 8 12:31:49 2012 (r236749) @@ -4154,7 +4154,10 @@ hdac_attach(device_t dev) uint16_t vendor; uint8_t v; - device_printf(dev, "HDA Driver Revision: %s\n", HDA_DRV_TEST_REV); + HDA_BOOTVERBOSE( + device_printf(dev, "HDA Driver Revision: %s\n", + HDA_DRV_TEST_REV); + ); model = (uint32_t)pci_get_device(dev) << 16; model |= (uint32_t)pci_get_vendor(dev) & 0x0000ffff; From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 12:35:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6EA61106566B; Fri, 8 Jun 2012 12:35:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55BBB8FC15; Fri, 8 Jun 2012 12:35:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58CZi7c059156; Fri, 8 Jun 2012 12:35:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58CZiiK059149; Fri, 8 Jun 2012 12:35:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206081235.q58CZiiK059149@svn.freebsd.org> From: Alexander Motin Date: Fri, 8 Jun 2012 12:35:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236750 - in stable/8: share/man/man4 sys/conf sys/dev/sound/pci/hda sys/modules/sound/driver/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 12:35:44 -0000 Author: mav Date: Fri Jun 8 12:35:43 2012 New Revision: 236750 URL: http://svn.freebsd.org/changeset/base/236750 Log: MFC r230130: Major snd_hda driver rewrite: - Huge old hdac driver was split into three independent pieces: HDA controller driver (hdac), HDA CODEC driver (hdacc) and HDA sudio function driver (hdaa). - Support for multichannel recording was added. Now, as specification defines, driver checks input associations for pins with sequence numbers 14 and 15, and if found (usually) -- works as before, mixing signals together. If it doesn't, it configures input association as multichannel. - Signal tracer was improved to look for cases where several DACs/ADCs in CODEC can work with the same audio signal. If such case found, driver registers additional playback/record stream (channel) for the pcm device. - New controller streams reservation mechanism was implemented. That allows to have more pcm devices then streams supported by the controller (usually 4 in each direction). Now it limits only number of simultaneously transferred audio streams, that is rarely reachable and properly reported if happens. - Codec pins and GPIO signals configuration was exported via set of writable sysctls. Another sysctl dev.hdaa.X.reconfig allows to trigger driver reconfiguration in run-time. - Driver now decodes pins location and connector type names. In some cases it allows to hint user where on the system case connectors, related to the pcm device, are located. Number of channels supported by pcm device, reported now (if it is not 2), should also make search easier. - Added workaround for digital mic on some Asus laptops/netbooks. Sponsored by: iXsystems, Inc. Added: stable/8/sys/dev/sound/pci/hda/hdaa.c - copied unchanged from r230130, head/sys/dev/sound/pci/hda/hdaa.c stable/8/sys/dev/sound/pci/hda/hdaa.h - copied unchanged from r230130, head/sys/dev/sound/pci/hda/hdaa.h stable/8/sys/dev/sound/pci/hda/hdaa_patches.c - copied unchanged from r230130, head/sys/dev/sound/pci/hda/hdaa_patches.c stable/8/sys/dev/sound/pci/hda/hdac_if.m - copied unchanged from r230130, head/sys/dev/sound/pci/hda/hdac_if.m stable/8/sys/dev/sound/pci/hda/hdacc.c - copied unchanged from r230130, head/sys/dev/sound/pci/hda/hdacc.c Modified: stable/8/share/man/man4/snd_hda.4 stable/8/sys/conf/files stable/8/sys/conf/kmod.mk stable/8/sys/dev/sound/pci/hda/hda_reg.h stable/8/sys/dev/sound/pci/hda/hdac.c stable/8/sys/dev/sound/pci/hda/hdac.h stable/8/sys/dev/sound/pci/hda/hdac_private.h stable/8/sys/dev/sound/pci/hda/hdac_reg.h stable/8/sys/modules/sound/driver/hda/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/share/man/man4/snd_hda.4 ============================================================================== --- stable/8/share/man/man4/snd_hda.4 Fri Jun 8 12:31:49 2012 (r236749) +++ stable/8/share/man/man4/snd_hda.4 Fri Jun 8 12:35:43 2012 (r236750) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 22, 2010 +.Dd January 11, 2012 .Dt SND_HDA 4 .Os .Sh NAME @@ -53,8 +53,9 @@ support for several logical audio device .Pp The .Nm -driver is a HDA bus controller driver and HDA codecs audio functions bridge -driver that allows the generic audio driver, +driver includes HDA bus controller driver (hdac), HDA codec driver (hdacc) +and HDA codecs audio functions bridge driver (hdaa) that allows +the generic audio driver, .Xr sound 4 , to be used with this hardware. Only audio functions are supported by @@ -77,7 +78,9 @@ For example, one device for main rear 7. for independent headset connectors at front and one device for SPDIF or HDMI audio input/output. The assignment of audio inputs and outputs may be tuned with -.Xr device.hints 5 . +.Xr device.hints 5 +or +.Xr sysctl 8 . The driver's verbose boot messages provide a lot of information about the operation of the driver and present audio setup. .Pp @@ -92,19 +95,26 @@ The following variables are available at file: .Bl -tag -width ".Va hint.hdac.%d.config"-offset indent .It Va hint.hdac.%d.config -Configures a range of possible options. +Configures a range of possible controller options. Possible values are: +.Dq Li 64bit , .Dq Li dmapos , +.Dq Li msi . +An option prefixed with +.Dq Li no , +such as +.Dq Li nomsi , +will do the opposite and takes precedence. +Options can be separated by whitespace and commas. +.It Va hint.hdac.%d.msi +Controls MSI (Message Signaled Interrupts) support. +.It Va hint.hdac.%d.cad%d.nid%d.config +Same as +.Va hint.hdaa.%d.nid%d.config +.It Va hint.hdaa.%d.config +Configures a range of possible audio function options. +Possible values are: .Dq Li eapdinv , -.Dq Li gpio0 , -.Dq Li gpio1 , -.Dq Li gpio2 , -.Dq Li gpio3 , -.Dq Li gpio4 , -.Dq Li gpio5 , -.Dq Li gpio6 , -.Dq Li gpio7 , -.Dq Li gpioflush , .Dq Li ivref , .Dq Li ivref50 , .Dq Li ivref80 , @@ -126,22 +136,47 @@ such as will do the opposite and takes precedence. Options can be separated by whitespace and commas. .Pp +The +.Dq Li eapdinv +option inverts External Amplifier Power Down signal. +The +.Dq Li fixedrate +denies all sampling rates except 48KHz. +The +.Dq Li forcestereo +denies mono playback/recording. +The +.Dq Li senseinv +option inverts jack sensing logic. +The +.Dq Li ivref Ns Ar X +and +.Dq Li ovref Ns Ar X +options control the voltage used to power external microphones. +.It Va hint.hdaa.%d.gpio_config +Overrides audio function GPIO pins configuration set by BIOS. +May be specified as a set of space-separated +.Dq Ar num Ns = Ns Ar value +pairs, where +.Ar num +is GPIO line number, and +.Ar value +is one of: +.Dq Li keep , +.Dq Li set , +.Dq Li clear , +.Dq Li disable +and +.Dq Li input . +.Pp .Dq Li GPIO Ns s are a codec's General Purpose I/O pins which system integrators sometimes use to control external muters, amplifiers and so on. If you have no sound, or sound volume is not adequate, you may have to experiment a bit with the GPIO setup to find the optimal setup for your system. -.Pp -The -.Dq Li ivref Ns Ar X -and -.Dq Li ovref Ns Ar X -options control the voltage used to power external microphones. -.It Va hint.hdac.%d.msi -Controls MSI (Message Signaled Interrupts) support. -.It Va hint.hdac.%d.cad%d.nid%d.config -Overrides codec pin configuration set by BIOS. +.It Va hint.hdaa.%d.nid%d.config +Overrides audio function pin configuration set by BIOS. May be specified as a 32-bit hexadecimal value with a leading .Dq 0x , or as a set of space-separated @@ -165,7 +200,7 @@ The following options are supported: Association number. Associations are used to group individual pins to form a complex multi-pin device. -For example, to group 4 connectors for 7.1 output, or to treat several +For example, to group 4 connectors for 7.1 input/output, or to treat several input connectors as sources for the same input device. Association numbers can be specified as numeric values from 0 to 15. A value of 0 means disabled pin. @@ -180,16 +215,22 @@ A unique, per-association number used to particular association. Sequence numbers can be specified as numeric values from 0 to 15. .Pp -For output assotiations sequence numbers encode speaker pairs positions: -0 - Front, 1 - Center/LFE, 2 - Back, 3 - Front Wide Center, 4 - Side. -Standard combinations are: (0) - Stereo; (0, 2), (0, 4) - Quadro; -(0, 1, 2), (0, 1, 4) - 5.1; (0, 1, 2, 4) - 7.1. -.Pp The sequence number 15 has a special meaning for output associations. Output pins with this number and device type .Dq Ar Headphones will duplicate (with automatic mute if jack detection is supported) the first pin in that association. +.Pp +The sequence numbers 14 and 15 has a special meaning for input associations. +Their presence in association defines it as multiplexed or mixed respectively. +If none of them present and there are more then one pin in association, +the association will provide multichannel input. +.Pp +For multichannel input/output assotiations sequence numbers encode +channel pairs positions: +0 - Front, 1 - Center/LFE, 2 - Back, 3 - Front Wide Center, 4 - Side. +Standard combinations are: (0) - Stereo; (0, 2), (0, 4) - Quadro; +(0, 1, 2), (0, 1, 4) - 5.1; (0, 1, 2, 4) - 7.1. .It Va device Device type. Can be specified as a number from 0 to 15 or as a name: @@ -278,7 +319,11 @@ The following variables are available in addition to those available to all .Xr sound 4 devices: -.Bl -tag -width ".Va dev.hdac.%d.polling" -offset indent +.Bl -tag -width ".Va dev.hdaa.%d.nid%d_original" -offset indent +.It Va dev.hdac.%d.pindump +Setting this to a non-zero value dumps the current pin configuration, main +capabilities and jack sense status of all audio functions on the controller +to console and syslog. .It Va dev.hdac.%d.polling Enables polling mode. In this mode the driver operates by querying the device state on timer @@ -288,11 +333,30 @@ instead of interrupts. Polling is disabled by default. Do not enable it unless you are facing weird interrupt problems or if the device cannot generate interrupts at all. -.It Va dev.hdac.%d.polling_interval -Controller/Jack Sense polling interval (1-1000 ms) -.It Va dev.hdac.%d.pindump -Setting this to a non-zero value dumps the current pin configuration, main -capabilities and jack sense status to console and syslog. +.It Va dev.hdaa.%d.config +Run-time equivalent of the +.Va hint.hdaa.%d.config +tunable. +.It Va dev.hdaa.%d.gpi_state +Current state of GPI lines. +.It Va dev.hdaa.%d.gpio_state +Current state of GPIO lines. +.It Va dev.hdaa.%d.gpio_config +Run-time equivalent of the +.Va hint.hdaa.%d.gpio.config +tunable. +.It Va dev.hdaa.%d.gpo_state +Current state of GPO lines. +.It Va dev.hdaa.%d.nid%d_config +Run-time equivalent of the +.Va hint.hdaa.%d.nid%d.config +tunable. +.It Va dev.hdaa.%d.nid%d_original +Original pin configuration written by BIOS. +.It Va dev.hdaa.%d.reconfig +Setting this to a non-zero value makes driver to destroy existing pcm devices +and process new pins configuration set via +.Va dev.hdaa.%d.nid%d_config. .El .Sh EXAMPLES Taking HP Compaq DX2300 with Realtek ALC888 HDA codec for example. @@ -307,22 +371,23 @@ So high codec uniformity and flexibility different ways, depending on requested pins usage decribed by pins configuration. The driver reports such default pin configuration when verbose messages enabled: .Bd -literal -hdac0: nid 20 0x01014020 as 2 seq 0 Line-out Jack jack 1 loc 1 color Green misc 0 -hdac0: nid 21 0x99130110 as 1 seq 0 Speaker Fixed jack 3 loc 25 color Unknown misc 1 -hdac0: nid 22 0x411111f0 as 15 seq 0 Speaker None jack 1 loc 1 color Black misc 1 -hdac0: nid 23 0x411111f0 as 15 seq 0 Speaker None jack 1 loc 1 color Black misc 1 -hdac0: nid 24 0x01a19830 as 3 seq 0 Mic Jack jack 1 loc 1 color Pink misc 8 -hdac0: nid 25 0x02a1983f as 3 seq 15 Mic Jack jack 1 loc 2 color Pink misc 8 -hdac0: nid 26 0x01813031 as 3 seq 1 Line-in Jack jack 1 loc 1 color Blue misc 0 -hdac0: nid 27 0x0221401f as 1 seq 15 Headphones Jack jack 1 loc 2 color Green misc 0 -hdac0: nid 28 0x411111f0 as 15 seq 0 Speaker None jack 1 loc 1 color Black misc 1 -hdac0: nid 30 0x411111f0 as 15 seq 0 Speaker None jack 1 loc 1 color Black misc 1 -hdac0: nid 31 0x411111f0 as 15 seq 0 Speaker None jack 1 loc 1 color Black misc 1 +hdaa0: nid 0x as seq device conn jack loc color misc +hdaa0: 20 01014020 2 0 Line-out Jack 1/8 Rear Green 0 +hdaa0: 21 99130110 1 0 Speaker Fixed ATAPI Onboard Unknown 1 +hdaa0: 22 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA +hdaa0: 23 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA +hdaa0: 24 01a19830 3 0 Mic Jack 1/8 Rear Pink 8 +hdaa0: 25 02a1983f 3 15 Mic Jack 1/8 Front Pink 8 +hdaa0: 26 01813031 3 1 Line-in Jack 1/8 Rear Blue 0 +hdaa0: 27 0221401f 1 15 Headphones Jack 1/8 Front Green 0 +hdaa0: 28 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA +hdaa0: 30 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA +hdaa0: 31 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA .Ed .Pp Here we can see, that the nodes with ID (nid) 25 and 27 are front panel -connectors (Jack, loc 2), nids 20, 24 and 26 are rear panel connectors -(Jack, loc 1) and nid 21 is a built-in speaker (Fixed, loc 25). +connectors (Jack, Front), nids 20, 24 and 26 are rear panel connectors +(Jack, Rear) and nid 21 is a built-in speaker (Fixed, Onboard). Pins with nids 22, 23, 28, 30 and 31 will be disabled by driver due to "None" connectivity. So the pin count and description matches to connectors that we have. @@ -330,15 +395,15 @@ we have. Using association (as) and sequence (seq) fields values pins are grouped into 3 associations: .Bd -literal -hdac0: Association 0 (1) out: -hdac0: Pin nid=21 seq=0 -hdac0: Pin nid=27 seq=15 -hdac0: Association 1 (2) out: -hdac0: Pin nid=20 seq=0 -hdac0: Association 2 (3) in: -hdac0: Pin nid=24 seq=0 -hdac0: Pin nid=26 seq=1 -hdac0: Pin nid=25 seq=15 +hdaa0: Association 0 (1) out: +hdaa0: Pin nid=21 seq=0 +hdaa0: Pin nid=27 seq=15 +hdaa0: Association 1 (2) out: +hdaa0: Pin nid=20 seq=0 +hdaa0: Association 2 (3) in: +hdaa0: Pin nid=24 seq=0 +hdaa0: Pin nid=26 seq=1 +hdaa0: Pin nid=25 seq=15 .Ed .Pp Each @@ -498,148 +563,14 @@ Most of controls use logarithmic scale. .Sh HARDWARE The .Nm -driver supports many Intel HDA compatible audio chipsets including the -following: -.Pp -.Bl -bullet -compact -.It -ATI SB450 -.It -ATI SB600 -.It -Intel 631x/632xESB -.It -Intel 82801F (ICH6) -.It -Intel 82801G (ICH7) -.It -Intel 82801H (ICH8) -.It -Intel 82801I (ICH9) -.It -Intel 82801J (ICH10) -.It -Intel US15W (SCH) -.It -nVidia MCP51 -.It -nVidia MCP55 -.It -nVidia MCP61A -.It -nVidia MCP61B -.It -nVidia MCP63 -.It -nVidia MCP65A -.It -nVidia MCP65B -.It -nVidia MCP67A -.It -nVidia MCP67B -.It -nVidia MCP68 -.It -nVidia MCP69 -.It -nVidia MCP73 -.It -nVidia MCP78 -.It -nVidia MCP79 -.It -nVidia MCP89 -.It -SiS 966 -.It -VIA VT8251/8237A -.El -.Pp -The following and many other codecs have been verified to work: +driver supports controllers having PCI class 4 (multimedia) and +subclass 3 (HDA), compatible with Intel HDA specification. .Pp -.Bl -bullet -compact -.It -Analog Devices AD1981HD -.It -Analog Devices AD1983 -.It -Analog Devices AD1984 -.It -Analog Devices AD1986A -.It -Analog Devices AD1988 -.It -Analog Devices AD1988B -.It -CMedia CMI9880 -.It -Conexant CX20549 (Venice) -.It -Conexant CX20551 (Waikiki) -.It -Conexant CX20561 (Hermosa) -.It -Realtek ALC260 -.It -Realtek ALC262 -.It -Realtek ALC268 -.It -Realtek ALC660 -.It -Realtek ALC861 -.It -Realtek ALC861VD -.It -Realtek ALC880 -.It -Realtek ALC882 -.It -Realtek ALC883 -.It -Realtek ALC885 -.It -Realtek ALC888 -.It -Realtek ALC889 -.It -Sigmatel STAC9205 -.It -Sigmatel STAC9220 -.It -Sigmatel STAC9220D / 9223D -.It -Sigmatel STAC9221 -.It -Sigmatel STAC9221D -.It -Sigmatel STAC9227D -.It -Sigmatel STAC9227X -.It -Sigmatel STAC9228D -.It -Sigmatel STAC9228X -.It -Sigmatel STAC9229D -.It -Sigmatel STAC9229X -.It -Sigmatel STAC9230D -.It -Sigmatel STAC9230X -.It -Sigmatel STAC9271D -.It -Sigmatel STAC9872AK -.It -VIA VT1708 -.It -VIA VT1708B -.It -VIA VT1709 -.El +The +.Nm +driver supports more then two hundred different controllers and CODECs. +There is no sense to list all of them here, as in most cases specific CODEC +configuration and wiring are more important then type of the CODEC itself. .Sh SEE ALSO .Xr sound 4 , .Xr snd_ich 4 , @@ -666,19 +597,17 @@ This manual page was written by and .An Giorgos Keramidas Aq keramida@FreeBSD.org . .Sh BUGS -A few Hardware/OEM vendors tend to screw up BIOS settings, thus -rendering the -.Nm -driver useless. -This usually results in a state where the +Some Hardware/OEM vendors tend to screw up BIOS settings or use custom +unusual CODEC wiring that create problems to the driver. +This may result in missing pcm devices, or a state where the .Nm driver seems to attach and work, but no sound is played. Some cases can be solved by tuning .Pa loader.conf variables. -Before trying to fix problem that way, make sure that there really is a problem -and that the PCM audio device in use really corresponds to the expected -audio connector. +But before trying to fix problem that way, make sure that there really is +a problem and that the PCM audio device in use really corresponds to the +expected audio connector. .Pp Some vendors use non-standardized General Purpose I/O (GPIO) pins of the codec to control external amplifiers. Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Fri Jun 8 12:31:49 2012 (r236749) +++ stable/8/sys/conf/files Fri Jun 8 12:35:43 2012 (r236750) @@ -1615,7 +1615,11 @@ dev/sound/pci/t4dwave.c optional snd_t4 dev/sound/pci/via8233.c optional snd_via8233 pci dev/sound/pci/via82c686.c optional snd_via82c686 pci dev/sound/pci/vibes.c optional snd_vibes pci +dev/sound/pci/hda/hdaa.c optional snd_hda pci +dev/sound/pci/hda/hdaa_patches.c optional snd_hda pci dev/sound/pci/hda/hdac.c optional snd_hda pci +dev/sound/pci/hda/hdac_if.m optional snd_hda pci +dev/sound/pci/hda/hdacc.c optional snd_hda pci dev/sound/pcm/ac97.c optional sound dev/sound/pcm/ac97_if.m optional sound dev/sound/pcm/ac97_patch.c optional sound Modified: stable/8/sys/conf/kmod.mk ============================================================================== --- stable/8/sys/conf/kmod.mk Fri Jun 8 12:31:49 2012 (r236749) +++ stable/8/sys/conf/kmod.mk Fri Jun 8 12:35:43 2012 (r236750) @@ -339,6 +339,7 @@ MFILES?= dev/acpica/acpi_if.m dev/acpi_s dev/mii/miibus_if.m dev/mvs/mvs_if.m dev/ofw/ofw_bus_if.m \ dev/pccard/card_if.m dev/pccard/power_if.m dev/pci/pci_if.m \ dev/pci/pcib_if.m dev/ppbus/ppbus_if.m dev/smbus/smbus_if.m \ + dev/sound/pci/hda/hdac_if.m \ dev/sound/pcm/ac97_if.m dev/sound/pcm/channel_if.m \ dev/sound/pcm/feeder_if.m dev/sound/pcm/mixer_if.m \ dev/sound/midi/mpu_if.m dev/sound/midi/mpufoi_if.m \ Modified: stable/8/sys/dev/sound/pci/hda/hda_reg.h ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hda_reg.h Fri Jun 8 12:31:49 2012 (r236749) +++ stable/8/sys/dev/sound/pci/hda/hda_reg.h Fri Jun 8 12:35:43 2012 (r236750) @@ -400,7 +400,7 @@ HDA_CMD_GET_UNSOLICITED_RESPONSE_TAG_SHIFT) #define HDA_CMD_SET_UNSOLICITED_RESPONSE_ENABLE 0x80 -#define HDA_CMD_SET_UNSOLICITED_RESPONSE_TAG_MASK 0x1f +#define HDA_CMD_SET_UNSOLICITED_RESPONSE_TAG_MASK 0x3f #define HDA_CMD_SET_UNSOLICITED_RESPONSE_TAG_SHIFT 0 #define HDA_CMD_SET_UNSOLICITED_RESPONSE_TAG(param) \ @@ -418,14 +418,10 @@ (HDA_CMD_12BIT((cad), (nid), \ HDA_CMD_VERB_SET_PIN_SENSE, (payload))) -#define HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT_MASK 0x80000000 -#define HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT_SHIFT 31 +#define HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT 0x80000000 #define HDA_CMD_GET_PIN_SENSE_IMP_SENSE_MASK 0x7fffffff #define HDA_CMD_GET_PIN_SENSE_IMP_SENSE_SHIFT 0 -#define HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT(rsp) \ - (((rsp) & HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT_MASK) >> \ - HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT_SHIFT) #define HDA_CMD_GET_PIN_SENSE_IMP_SENSE(rsp) \ (((rsp) & HDA_CMD_GET_PIN_SENSE_IMP_SENSE_MASK) >> \ HDA_CMD_GET_PIN_SENSE_IMP_SENSE_SHIFT) Copied: stable/8/sys/dev/sound/pci/hda/hdaa.c (from r230130, head/sys/dev/sound/pci/hda/hdaa.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/dev/sound/pci/hda/hdaa.c Fri Jun 8 12:35:43 2012 (r236750, copy of r230130, head/sys/dev/sound/pci/hda/hdaa.c) @@ -0,0 +1,5901 @@ +/*- + * Copyright (c) 2006 Stephane E. Potvin + * Copyright (c) 2006 Ariff Abdullah + * Copyright (c) 2008-2012 Alexander Motin + * 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. + */ + +/* + * Intel High Definition Audio (Audio function) driver for FreeBSD. + */ + +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_snd.h" +#endif + +#include + +#include +#include + +#include +#include +#include + +#include "mixer_if.h" + +SND_DECLARE_FILE("$FreeBSD$"); + +#define hdaa_lock(devinfo) snd_mtxlock((devinfo)->lock) +#define hdaa_unlock(devinfo) snd_mtxunlock((devinfo)->lock) +#define hdaa_lockassert(devinfo) snd_mtxassert((devinfo)->lock) +#define hdaa_lockowned(devinfo) mtx_owned((devinfo)->lock) + +static const struct { + char *key; + uint32_t value; +} hdaa_quirks_tab[] = { + { "softpcmvol", HDAA_QUIRK_SOFTPCMVOL }, + { "fixedrate", HDAA_QUIRK_FIXEDRATE }, + { "forcestereo", HDAA_QUIRK_FORCESTEREO }, + { "eapdinv", HDAA_QUIRK_EAPDINV }, + { "senseinv", HDAA_QUIRK_SENSEINV }, + { "ivref50", HDAA_QUIRK_IVREF50 }, + { "ivref80", HDAA_QUIRK_IVREF80 }, + { "ivref100", HDAA_QUIRK_IVREF100 }, + { "ovref50", HDAA_QUIRK_OVREF50 }, + { "ovref80", HDAA_QUIRK_OVREF80 }, + { "ovref100", HDAA_QUIRK_OVREF100 }, + { "ivref", HDAA_QUIRK_IVREF }, + { "ovref", HDAA_QUIRK_OVREF }, + { "vref", HDAA_QUIRK_VREF }, +}; +#define HDAA_QUIRKS_TAB_LEN \ + (sizeof(hdaa_quirks_tab) / sizeof(hdaa_quirks_tab[0])) + +#define HDA_BDL_MIN 2 +#define HDA_BDL_MAX 256 +#define HDA_BDL_DEFAULT HDA_BDL_MIN + +#define HDA_BLK_MIN HDA_DMA_ALIGNMENT +#define HDA_BLK_ALIGN (~(HDA_BLK_MIN - 1)) + +#define HDA_BUFSZ_MIN 4096 +#define HDA_BUFSZ_MAX 65536 +#define HDA_BUFSZ_DEFAULT 16384 + +#define HDA_PARSE_MAXDEPTH 10 + +MALLOC_DEFINE(M_HDAA, "hdaa", "HDA Audio"); + +const char *HDA_COLORS[16] = {"Unknown", "Black", "Grey", "Blue", "Green", "Red", + "Orange", "Yellow", "Purple", "Pink", "Res.A", "Res.B", "Res.C", "Res.D", + "White", "Other"}; + +const char *HDA_DEVS[16] = {"Line-out", "Speaker", "Headphones", "CD", + "SPDIF-out", "Digital-out", "Modem-line", "Modem-handset", "Line-in", + "AUX", "Mic", "Telephony", "SPDIF-in", "Digital-in", "Res.E", "Other"}; + +const char *HDA_CONNS[4] = {"Jack", "None", "Fixed", "Both"}; + +const char *HDA_CONNECTORS[16] = { + "Unknown", "1/8", "1/4", "ATAPI", "RCA", "Optical", "Digital", "Analog", + "DIN", "XLR", "RJ-11", "Combo", "0xc", "0xd", "0xe", "Other" }; + +const char *HDA_LOCS[64] = { + "0x00", "Rear", "Front", "Left", "Right", "Top", "Bottom", "Rear-panel", + "Drive-bay", "0x09", "0x0a", "0x0b", "0x0c", "0x0d", "0x0e", "0x0f", + "Internal", "0x11", "0x12", "0x13", "0x14", "0x15", "0x16", "Riser", + "0x18", "Onboard", "0x1a", "0x1b", "0x1c", "0x1d", "0x1e", "0x1f", + "External", "Ext-Rear", "Ext-Front", "Ext-Left", "Ext-Right", "Ext-Top", "Ext-Bottom", "0x07", + "0x28", "0x29", "0x2a", "0x2b", "0x2c", "0x2d", "0x2e", "0x2f", + "Other", "0x31", "0x32", "0x33", "0x34", "0x35", "Other-Bott", "Lid-In", + "Lid-Out", "0x39", "0x3a", "0x3b", "0x3c", "0x3d", "0x3e", "0x3f" }; + +const char *HDA_GPIO_ACTIONS[8] = { + "keep", "set", "clear", "disable", "input", "0x05", "0x06", "0x07"}; + +/* Default */ +static uint32_t hdaa_fmt[] = { + SND_FORMAT(AFMT_S16_LE, 2, 0), + 0 +}; + +static struct pcmchan_caps hdaa_caps = {48000, 48000, hdaa_fmt, 0}; + +static const struct { + uint32_t rate; + int valid; + uint16_t base; + uint16_t mul; + uint16_t div; +} hda_rate_tab[] = { + { 8000, 1, 0x0000, 0x0000, 0x0500 }, /* (48000 * 1) / 6 */ + { 9600, 0, 0x0000, 0x0000, 0x0400 }, /* (48000 * 1) / 5 */ + { 12000, 0, 0x0000, 0x0000, 0x0300 }, /* (48000 * 1) / 4 */ + { 16000, 1, 0x0000, 0x0000, 0x0200 }, /* (48000 * 1) / 3 */ + { 18000, 0, 0x0000, 0x1000, 0x0700 }, /* (48000 * 3) / 8 */ + { 19200, 0, 0x0000, 0x0800, 0x0400 }, /* (48000 * 2) / 5 */ + { 24000, 0, 0x0000, 0x0000, 0x0100 }, /* (48000 * 1) / 2 */ + { 28800, 0, 0x0000, 0x1000, 0x0400 }, /* (48000 * 3) / 5 */ + { 32000, 1, 0x0000, 0x0800, 0x0200 }, /* (48000 * 2) / 3 */ + { 36000, 0, 0x0000, 0x1000, 0x0300 }, /* (48000 * 3) / 4 */ + { 38400, 0, 0x0000, 0x1800, 0x0400 }, /* (48000 * 4) / 5 */ + { 48000, 1, 0x0000, 0x0000, 0x0000 }, /* (48000 * 1) / 1 */ + { 64000, 0, 0x0000, 0x1800, 0x0200 }, /* (48000 * 4) / 3 */ + { 72000, 0, 0x0000, 0x1000, 0x0100 }, /* (48000 * 3) / 2 */ + { 96000, 1, 0x0000, 0x0800, 0x0000 }, /* (48000 * 2) / 1 */ + { 144000, 0, 0x0000, 0x1000, 0x0000 }, /* (48000 * 3) / 1 */ + { 192000, 1, 0x0000, 0x1800, 0x0000 }, /* (48000 * 4) / 1 */ + { 8820, 0, 0x4000, 0x0000, 0x0400 }, /* (44100 * 1) / 5 */ + { 11025, 1, 0x4000, 0x0000, 0x0300 }, /* (44100 * 1) / 4 */ + { 12600, 0, 0x4000, 0x0800, 0x0600 }, /* (44100 * 2) / 7 */ + { 14700, 0, 0x4000, 0x0000, 0x0200 }, /* (44100 * 1) / 3 */ + { 17640, 0, 0x4000, 0x0800, 0x0400 }, /* (44100 * 2) / 5 */ + { 18900, 0, 0x4000, 0x1000, 0x0600 }, /* (44100 * 3) / 7 */ + { 22050, 1, 0x4000, 0x0000, 0x0100 }, /* (44100 * 1) / 2 */ + { 25200, 0, 0x4000, 0x1800, 0x0600 }, /* (44100 * 4) / 7 */ + { 26460, 0, 0x4000, 0x1000, 0x0400 }, /* (44100 * 3) / 5 */ + { 29400, 0, 0x4000, 0x0800, 0x0200 }, /* (44100 * 2) / 3 */ + { 33075, 0, 0x4000, 0x1000, 0x0300 }, /* (44100 * 3) / 4 */ + { 35280, 0, 0x4000, 0x1800, 0x0400 }, /* (44100 * 4) / 5 */ + { 44100, 1, 0x4000, 0x0000, 0x0000 }, /* (44100 * 1) / 1 */ + { 58800, 0, 0x4000, 0x1800, 0x0200 }, /* (44100 * 4) / 3 */ + { 66150, 0, 0x4000, 0x1000, 0x0100 }, /* (44100 * 3) / 2 */ + { 88200, 1, 0x4000, 0x0800, 0x0000 }, /* (44100 * 2) / 1 */ + { 132300, 0, 0x4000, 0x1000, 0x0000 }, /* (44100 * 3) / 1 */ + { 176400, 1, 0x4000, 0x1800, 0x0000 }, /* (44100 * 4) / 1 */ +}; +#define HDA_RATE_TAB_LEN (sizeof(hda_rate_tab) / sizeof(hda_rate_tab[0])) + +/**************************************************************************** + * Function prototypes + ****************************************************************************/ +static int hdaa_pcmchannel_setup(struct hdaa_chan *); + +static void hdaa_widget_connection_select(struct hdaa_widget *, uint8_t); +static void hdaa_audio_ctl_amp_set(struct hdaa_audio_ctl *, + uint32_t, int, int); +static struct hdaa_audio_ctl *hdaa_audio_ctl_amp_get(struct hdaa_devinfo *, + nid_t, int, int, int); +static void hdaa_audio_ctl_amp_set_internal(struct hdaa_devinfo *, + nid_t, int, int, int, int, int, int); + +static void hdaa_dump_pin_config(struct hdaa_widget *w, uint32_t conf); + +static char * +hdaa_audio_ctl_ossmixer_mask2allname(uint32_t mask, char *buf, size_t len) +{ + static char *ossname[] = SOUND_DEVICE_NAMES; + int i, first = 1; + + bzero(buf, len); + for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) { + if (mask & (1 << i)) { + if (first == 0) + strlcat(buf, ", ", len); + strlcat(buf, ossname[i], len); + first = 0; + } + } + return (buf); +} + +static struct hdaa_audio_ctl * +hdaa_audio_ctl_each(struct hdaa_devinfo *devinfo, int *index) +{ + if (devinfo == NULL || + index == NULL || devinfo->ctl == NULL || + devinfo->ctlcnt < 1 || + *index < 0 || *index >= devinfo->ctlcnt) + return (NULL); + return (&devinfo->ctl[(*index)++]); +} + +static struct hdaa_audio_ctl * +hdaa_audio_ctl_amp_get(struct hdaa_devinfo *devinfo, nid_t nid, int dir, + int index, int cnt) +{ + struct hdaa_audio_ctl *ctl; + int i, found = 0; + + if (devinfo == NULL || devinfo->ctl == NULL) + return (NULL); + + i = 0; + while ((ctl = hdaa_audio_ctl_each(devinfo, &i)) != NULL) { + if (ctl->enable == 0) + continue; + if (ctl->widget->nid != nid) + continue; + if (dir && ctl->ndir != dir) + continue; + if (index >= 0 && ctl->ndir == HDAA_CTL_IN && + ctl->dir == ctl->ndir && ctl->index != index) + continue; + found++; + if (found == cnt || cnt <= 0) + return (ctl); + } + + return (NULL); +} + +/* + * Jack detection (Speaker/HP redirection) event handler. + */ +static void +hdaa_hp_switch_handler(struct hdaa_devinfo *devinfo, int asid) +{ + struct hdaa_audio_as *as; + struct hdaa_widget *w; + struct hdaa_audio_ctl *ctl; + uint32_t val, res; + int j; + + as = &devinfo->as[asid]; + if (as->hpredir < 0) + return; + + w = hdaa_widget_get(devinfo, as->pins[15]); + if (w == NULL || w->enable == 0 || w->type != + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) + return; + + res = hda_command(devinfo->dev, + HDA_CMD_GET_PIN_SENSE(0, as->pins[15])); + + HDA_BOOTVERBOSE( + device_printf(devinfo->dev, + "Pin sense: nid=%d sence=0x%08x", + as->pins[15], res); + ); + + res = (res & HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT) != 0; + if (devinfo->quirks & HDAA_QUIRK_SENSEINV) + res ^= 1; + + HDA_BOOTVERBOSE( + printf(" %sconnected\n", res == 0 ? "dis" : ""); + ); + + /* (Un)Mute headphone pin. */ + ctl = hdaa_audio_ctl_amp_get(devinfo, + as->pins[15], HDAA_CTL_IN, -1, 1); + if (ctl != NULL && ctl->mute) { + /* If pin has muter - use it. */ + val = (res != 0) ? 0 : 1; + if (val != ctl->forcemute) { + ctl->forcemute = val; + hdaa_audio_ctl_amp_set(ctl, + HDAA_AMP_MUTE_DEFAULT, + HDAA_AMP_VOL_DEFAULT, HDAA_AMP_VOL_DEFAULT); + } + } else { + /* If there is no muter - disable pin output. */ + w = hdaa_widget_get(devinfo, as->pins[15]); + if (w != NULL && w->type == + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { + if (res != 0) + val = w->wclass.pin.ctrl | + HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; + else + val = w->wclass.pin.ctrl & + ~HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; + if (val != w->wclass.pin.ctrl) { + w->wclass.pin.ctrl = val; + hda_command(devinfo->dev, + HDA_CMD_SET_PIN_WIDGET_CTRL(0, + w->nid, w->wclass.pin.ctrl)); + } + } + } + /* (Un)Mute other pins. */ + for (j = 0; j < 15; j++) { + if (as->pins[j] <= 0) + continue; + ctl = hdaa_audio_ctl_amp_get(devinfo, + as->pins[j], HDAA_CTL_IN, -1, 1); + if (ctl != NULL && ctl->mute) { + /* If pin has muter - use it. */ + val = (res != 0) ? 1 : 0; + if (val == ctl->forcemute) + continue; + ctl->forcemute = val; + hdaa_audio_ctl_amp_set(ctl, + HDAA_AMP_MUTE_DEFAULT, + HDAA_AMP_VOL_DEFAULT, HDAA_AMP_VOL_DEFAULT); + continue; + } + /* If there is no muter - disable pin output. */ + w = hdaa_widget_get(devinfo, as->pins[j]); + if (w != NULL && w->type == + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { + if (res != 0) + val = w->wclass.pin.ctrl & + ~HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; + else + val = w->wclass.pin.ctrl | + HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; + if (val != w->wclass.pin.ctrl) { + w->wclass.pin.ctrl = val; + hda_command(devinfo->dev, + HDA_CMD_SET_PIN_WIDGET_CTRL(0, + w->nid, w->wclass.pin.ctrl)); + } + } + } +} + +/* + * Callback for poll based jack detection. + */ +static void +hdaa_jack_poll_callback(void *arg) +{ + struct hdaa_devinfo *devinfo = arg; + int i; + + hdaa_lock(devinfo); + if (devinfo->poll_ival == 0) { + hdaa_unlock(devinfo); + return; + } + for (i = 0; i < devinfo->ascnt; i++) { + if (devinfo->as[i].hpredir < 0) + continue; + hdaa_hp_switch_handler(devinfo, i); + } + callout_reset(&devinfo->poll_jack, devinfo->poll_ival, + hdaa_jack_poll_callback, devinfo); + hdaa_unlock(devinfo); +} + +/* + * Jack detection initializer. + */ +static void +hdaa_hp_switch_init(struct hdaa_devinfo *devinfo) +{ + struct hdaa_audio_as *as = devinfo->as; + struct hdaa_widget *w; + int i, poll = 0; + + for (i = 0; i < devinfo->ascnt; i++) { + if (as[i].hpredir < 0) + continue; + + w = hdaa_widget_get(devinfo, as[i].pins[15]); + if (w == NULL || w->enable == 0 || w->type != + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) + continue; + if (HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP(w->wclass.pin.cap) == 0 || + (HDA_CONFIG_DEFAULTCONF_MISC(w->wclass.pin.config) & 1) != 0) { + device_printf(devinfo->dev, + "No jack detection support at pin %d\n", + as[i].pins[15]); + continue; + } + if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap)) { + as[i].unsol = HDAC_UNSOL_ALLOC( + device_get_parent(devinfo->dev), devinfo->dev, + w->nid); + hda_command(devinfo->dev, + HDA_CMD_SET_UNSOLICITED_RESPONSE(0, w->nid, + HDA_CMD_SET_UNSOLICITED_RESPONSE_ENABLE | + as[i].unsol)); + } else + poll = 1; + HDA_BOOTVERBOSE( + device_printf(devinfo->dev, + "Headphones redirection " + "for as=%d nid=%d using %s.\n", + i, w->nid, + (poll != 0) ? "polling" : "unsolicited responses"); + ); + hdaa_hp_switch_handler(devinfo, i); + } + if (poll) { + callout_reset(&devinfo->poll_jack, 1, + hdaa_jack_poll_callback, devinfo); + } +} + +static void +hdaa_hp_switch_deinit(struct hdaa_devinfo *devinfo) +{ + struct hdaa_audio_as *as = devinfo->as; + struct hdaa_widget *w; + int i; + + for (i = 0; i < devinfo->ascnt; i++) { + if (as[i].unsol < 0) + continue; + w = hdaa_widget_get(devinfo, as[i].pins[15]); + if (w == NULL || w->enable == 0 || w->type != + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) + continue; + hda_command(devinfo->dev, + HDA_CMD_SET_UNSOLICITED_RESPONSE(0, w->nid, 0)); + HDAC_UNSOL_FREE( + device_get_parent(devinfo->dev), devinfo->dev, + as[i].unsol); + as[i].unsol = -1; + } +} + +uint32_t +hdaa_widget_pin_patch(uint32_t config, const char *str) +{ + char buf[256]; + char *key, *value, *rest, *bad; + int ival, i; + + strlcpy(buf, str, sizeof(buf)); + rest = buf; + while ((key = strsep(&rest, "=")) != NULL) { + value = strsep(&rest, " \t"); + if (value == NULL) + break; + ival = strtol(value, &bad, 10); + if (strcmp(key, "seq") == 0) { + config &= ~HDA_CONFIG_DEFAULTCONF_SEQUENCE_MASK; + config |= ((ival << HDA_CONFIG_DEFAULTCONF_SEQUENCE_SHIFT) & + HDA_CONFIG_DEFAULTCONF_SEQUENCE_MASK); + } else if (strcmp(key, "as") == 0) { + config &= ~HDA_CONFIG_DEFAULTCONF_ASSOCIATION_MASK; + config |= ((ival << HDA_CONFIG_DEFAULTCONF_ASSOCIATION_SHIFT) & + HDA_CONFIG_DEFAULTCONF_ASSOCIATION_MASK); + } else if (strcmp(key, "misc") == 0) { + config &= ~HDA_CONFIG_DEFAULTCONF_MISC_MASK; + config |= ((ival << HDA_CONFIG_DEFAULTCONF_MISC_SHIFT) & + HDA_CONFIG_DEFAULTCONF_MISC_MASK); + } else if (strcmp(key, "color") == 0) { + config &= ~HDA_CONFIG_DEFAULTCONF_COLOR_MASK; + if (bad[0] == 0) { + config |= ((ival << HDA_CONFIG_DEFAULTCONF_COLOR_SHIFT) & + HDA_CONFIG_DEFAULTCONF_COLOR_MASK); + }; + for (i = 0; i < 16; i++) { + if (strcasecmp(HDA_COLORS[i], value) == 0) { + config |= (i << HDA_CONFIG_DEFAULTCONF_COLOR_SHIFT); + break; + } + } + } else if (strcmp(key, "ctype") == 0) { + config &= ~HDA_CONFIG_DEFAULTCONF_CONNECTION_TYPE_MASK; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 12:36:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2B2701065678; Fri, 8 Jun 2012 12:36:09 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16AB58FC12; Fri, 8 Jun 2012 12:36:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58Ca8JQ059215; Fri, 8 Jun 2012 12:36:08 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58Ca84q059213; Fri, 8 Jun 2012 12:36:08 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201206081236.q58Ca84q059213@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Fri, 8 Jun 2012 12:36:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236751 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 12:36:09 -0000 Author: des Date: Fri Jun 8 12:36:08 2012 New Revision: 236751 URL: http://svn.freebsd.org/changeset/base/236751 Log: Document that we also support sha256 and sha512. MFC after: 1 week Modified: head/lib/libutil/login.conf.5 Modified: head/lib/libutil/login.conf.5 ============================================================================== --- head/lib/libutil/login.conf.5 Fri Jun 8 12:35:43 2012 (r236750) +++ head/lib/libutil/login.conf.5 Fri Jun 8 12:36:08 2012 (r236751) @@ -269,7 +269,9 @@ multiplied by 5 seconds. allowed before the login fails. .It "passwd_format string md5 The encryption format that new or" changed passwords will use. -Valid values include "des", "md5" and "blf". +Valid values include "des", "md5", "blf", "sha256" and "sha512"; see +.Xr crypt 3 +for details. NIS clients using a .No non- Ns Fx NIS server should probably use "des". From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 12:56:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34F551065674; Fri, 8 Jun 2012 12:56:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06FAC8FC23; Fri, 8 Jun 2012 12:56:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58CuALO060283; Fri, 8 Jun 2012 12:56:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58CuASe060279; Fri, 8 Jun 2012 12:56:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206081256.q58CuASe060279@svn.freebsd.org> From: Alexander Motin Date: Fri, 8 Jun 2012 12:56:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236752 - in stable/8/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 12:56:11 -0000 Author: mav Date: Fri Jun 8 12:56:10 2012 New Revision: 236752 URL: http://svn.freebsd.org/changeset/base/236752 Log: Partially MFC r227701, r227847 and r227849 (by hselasky): Provide new device_delete_children() KPI without touching all consumers. Modified: stable/8/sys/kern/subr_bus.c stable/8/sys/sys/bus.h Modified: stable/8/sys/kern/subr_bus.c ============================================================================== --- stable/8/sys/kern/subr_bus.c Fri Jun 8 12:36:08 2012 (r236751) +++ stable/8/sys/kern/subr_bus.c Fri Jun 8 12:56:10 2012 (r236752) @@ -1897,7 +1897,7 @@ device_delete_child(device_t dev, device PDEBUG(("%s from %s", DEVICENAME(child), DEVICENAME(dev))); /* remove children first */ - while ( (grandchild = TAILQ_FIRST(&child->children)) ) { + while ((grandchild = TAILQ_FIRST(&child->children)) != NULL) { error = device_delete_child(child, grandchild); if (error) return (error); @@ -1916,6 +1916,39 @@ device_delete_child(device_t dev, device } /** + * @brief Delete all children devices of the given device, if any. + * + * This function deletes all children devices of the given device, if + * any, using the device_delete_child() function for each device it + * finds. If a child device cannot be deleted, this function will + * return an error code. + * + * @param dev the parent device + * + * @retval 0 success + * @retval non-zero a device would not detach + */ +int +device_delete_children(device_t dev) +{ + device_t child; + int error; + + PDEBUG(("Deleting all children of %s", DEVICENAME(dev))); + + error = 0; + + while ((child = TAILQ_FIRST(&dev->children)) != NULL) { + error = device_delete_child(dev, child); + if (error) { + PDEBUG(("Failed deleting %s", DEVICENAME(child))); + break; + } + } + return (error); +} + +/** * @brief Find a device given a unit number * * This is similar to devclass_get_devices() but only searches for Modified: stable/8/sys/sys/bus.h ============================================================================== --- stable/8/sys/sys/bus.h Fri Jun 8 12:36:08 2012 (r236751) +++ stable/8/sys/sys/bus.h Fri Jun 8 12:56:10 2012 (r236752) @@ -407,6 +407,7 @@ device_t device_add_child_ordered(device const char *name, int unit); void device_busy(device_t dev); int device_delete_child(device_t dev, device_t child); +int device_delete_children(device_t dev); int device_attach(device_t dev); int device_detach(device_t dev); void device_disable(device_t dev); From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 12:59:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 233F21065674; Fri, 8 Jun 2012 12:59:25 +0000 (UTC) (envelope-from kozlov@ravenloft.kiev.ua) Received: from ravenloft.kiev.ua (ravenloft.kiev.ua [94.244.131.95]) by mx1.freebsd.org (Postfix) with ESMTP id D51448FC15; Fri, 8 Jun 2012 12:59:24 +0000 (UTC) Date: Fri, 8 Jun 2012 15:59:23 +0300 From: Alex Kozlov To: Dag-Erling Smorgrav , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20120608125923.GA74459@ravenloft.kiev.ua> References: <201206081236.q58Ca84q059213@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201206081236.q58Ca84q059213@svn.freebsd.org> Cc: Subject: Re: svn commit: r236751 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 12:59:25 -0000 On Fri, Jun 08, 2012 at 12:36:08PM +0000, Dag-Erling Smorgrav wrote: > Author: des > Date: Fri Jun 8 12:36:08 2012 > New Revision: 236751 > URL: http://svn.freebsd.org/changeset/base/236751 > > Log: > Document that we also support sha256 and sha512. Perhaps it's time to change default to sha256 or even sha512? -- Alex From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 13:10:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B13081065677; Fri, 8 Jun 2012 13:10:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9992F8FC17; Fri, 8 Jun 2012 13:10:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58DAIcN060999; Fri, 8 Jun 2012 13:10:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58DAIfk060994; Fri, 8 Jun 2012 13:10:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206081310.q58DAIfk060994@svn.freebsd.org> From: Alexander Motin Date: Fri, 8 Jun 2012 13:10:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236753 - in stable/8: share/man/man4 sys/dev/sound/pci/hda sys/dev/sound/pcm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 13:10:18 -0000 Author: mav Date: Fri Jun 8 13:10:18 2012 New Revision: 236753 URL: http://svn.freebsd.org/changeset/base/236753 Log: MFC r230181, r230312, r230326, r230331, r230451, r230465, r230488, r230507, r230511, r230513, r230532, r230537, r230551, r230554, r230571, r230574, r230585, r230641, r230768, r230807, r231024: Sync snd_hda(4) driver with HEAD. This includes major code refactoring, HDMI support, new volume control, automatic recording source selection, runtime reconfigureation, support for more then 4 PCM devices on controller, multichannel recording, additional playback/record streams, higher bandwidths support, more informative device names and many other things. Sponsored by: iXsystems, Inc. Modified: stable/8/share/man/man4/snd_hda.4 stable/8/sys/dev/sound/pci/hda/hda_reg.h stable/8/sys/dev/sound/pci/hda/hdaa.c stable/8/sys/dev/sound/pci/hda/hdaa.h stable/8/sys/dev/sound/pci/hda/hdaa_patches.c stable/8/sys/dev/sound/pci/hda/hdac.c stable/8/sys/dev/sound/pci/hda/hdac.h stable/8/sys/dev/sound/pci/hda/hdac_if.m stable/8/sys/dev/sound/pci/hda/hdac_private.h stable/8/sys/dev/sound/pci/hda/hdacc.c stable/8/sys/dev/sound/pcm/channel.c Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/share/man/man4/snd_hda.4 ============================================================================== --- stable/8/share/man/man4/snd_hda.4 Fri Jun 8 12:56:10 2012 (r236752) +++ stable/8/share/man/man4/snd_hda.4 Fri Jun 8 13:10:18 2012 (r236753) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 11, 2012 +.Dd January 25, 2012 .Dt SND_HDA 4 .Os .Sh NAME @@ -182,6 +182,18 @@ May be specified as a 32-bit hexadecimal or as a set of space-separated .Dq Ar option Ns = Ns Ar value pairs. +.It Va hint.pcm.%d.rec.autosrc +Controls automatic recording source feature: +.Bl -tag -compact +.It 0 +disabled, +.It 1 +once on attach, +.It 2 +enabled. +.El +When enabled, driver will automatically set recording source of the mixer to +connected input using jack presence detection statuses. .El .Pp Pin configuration is the UAA driver's main source of information about codec @@ -357,6 +369,16 @@ Original pin configuration written by BI Setting this to a non-zero value makes driver to destroy existing pcm devices and process new pins configuration set via .Va dev.hdaa.%d.nid%d_config. +.It Va dev.pcm.%d.play.32bit , dev.pcm.%d.rec.32bit +HDA controller uses 32bit representation for all samples of more then 16 bits. +These variables allow to specify how many bits of these 32 should be +used by CODEC. +Depending on codec capabilities, possible values are 20, 24 and 32 bit. +The default value is 24. +.It Va dev.pcm.%d.rec.autosrc +Run-time equivalent of the +.Va hint.pcm.%d.rec.autosrc +tunable. .El .Sh EXAMPLES Taking HP Compaq DX2300 with Realtek ALC888 HDA codec for example. Modified: stable/8/sys/dev/sound/pci/hda/hda_reg.h ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hda_reg.h Fri Jun 8 12:56:10 2012 (r236752) +++ stable/8/sys/dev/sound/pci/hda/hda_reg.h Fri Jun 8 13:10:18 2012 (r236753) @@ -419,6 +419,7 @@ HDA_CMD_VERB_SET_PIN_SENSE, (payload))) #define HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT 0x80000000 +#define HDA_CMD_GET_PIN_SENSE_ELD_VALID 0x40000000 #define HDA_CMD_GET_PIN_SENSE_IMP_SENSE_MASK 0x7fffffff #define HDA_CMD_GET_PIN_SENSE_IMP_SENSE_SHIFT 0 @@ -675,17 +676,47 @@ HDA_CMD_VERB_SET_CONV_CHAN_COUNT, (payload))) #define HDA_CMD_VERB_GET_HDMI_DIP_SIZE 0xf2e + +#define HDA_CMD_GET_HDMI_DIP_SIZE(cad, nid, arg) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_GET_HDMI_DIP_SIZE, (arg))) + #define HDA_CMD_VERB_GET_HDMI_ELDD 0xf2f +#define HDA_CMD_GET_HDMI_ELDD(cad, nid, off) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_GET_HDMI_ELDD, (off))) + #define HDA_CMD_VERB_GET_HDMI_DIP_INDEX 0xf30 #define HDA_CMD_VERB_SET_HDMI_DIP_INDEX 0x730 +#define HDA_CMD_GET_HDMI_DIP_INDEX(cad, nid) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_GET_HDMI_DIP_INDEX, 0x0)) +#define HDA_CMD_SET_HDMI_DIP_INDEX(cad, nid, payload) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_SET_HDMI_DIP_INDEX, (payload))) + #define HDA_CMD_VERB_GET_HDMI_DIP_DATA 0xf31 #define HDA_CMD_VERB_SET_HDMI_DIP_DATA 0x731 +#define HDA_CMD_GET_HDMI_DIP_DATA(cad, nid) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_GET_HDMI_DIP_DATA, 0x0)) +#define HDA_CMD_SET_HDMI_DIP_DATA(cad, nid, payload) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_SET_HDMI_DIP_DATA, (payload))) + #define HDA_CMD_VERB_GET_HDMI_DIP_XMIT 0xf32 #define HDA_CMD_VERB_SET_HDMI_DIP_XMIT 0x732 +#define HDA_CMD_GET_HDMI_DIP_XMIT(cad, nid) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_GET_HDMI_DIP_XMIT, 0x0)) +#define HDA_CMD_SET_HDMI_DIP_XMIT(cad, nid, payload) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_SET_HDMI_DIP_XMIT, (payload))) + #define HDA_CMD_VERB_GET_HDMI_CP_CTRL 0xf33 #define HDA_CMD_VERB_SET_HDMI_CP_CTRL 0x733 @@ -699,6 +730,23 @@ (HDA_CMD_12BIT((cad), (nid), \ HDA_CMD_VERB_SET_HDMI_CHAN_SLOT, (payload))) +#define HDA_HDMI_CODING_TYPE_REF_STREAM_HEADER 0 +#define HDA_HDMI_CODING_TYPE_LPCM 1 +#define HDA_HDMI_CODING_TYPE_AC3 2 +#define HDA_HDMI_CODING_TYPE_MPEG1 3 +#define HDA_HDMI_CODING_TYPE_MP3 4 +#define HDA_HDMI_CODING_TYPE_MPEG2 5 +#define HDA_HDMI_CODING_TYPE_AACLC 6 +#define HDA_HDMI_CODING_TYPE_DTS 7 +#define HDA_HDMI_CODING_TYPE_ATRAC 8 +#define HDA_HDMI_CODING_TYPE_SACD 9 +#define HDA_HDMI_CODING_TYPE_EAC3 10 +#define HDA_HDMI_CODING_TYPE_DTS_HD 11 +#define HDA_HDMI_CODING_TYPE_MLP 12 +#define HDA_HDMI_CODING_TYPE_DST 13 +#define HDA_HDMI_CODING_TYPE_WMAPRO 14 +#define HDA_HDMI_CODING_TYPE_REF_CTX 15 + /* Function Reset */ #define HDA_CMD_VERB_FUNCTION_RESET 0x7ff Modified: stable/8/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdaa.c Fri Jun 8 12:56:10 2012 (r236752) +++ stable/8/sys/dev/sound/pci/hda/hdaa.c Fri Jun 8 13:10:18 2012 (r236753) @@ -74,17 +74,6 @@ static const struct { #define HDAA_QUIRKS_TAB_LEN \ (sizeof(hdaa_quirks_tab) / sizeof(hdaa_quirks_tab[0])) -#define HDA_BDL_MIN 2 -#define HDA_BDL_MAX 256 -#define HDA_BDL_DEFAULT HDA_BDL_MIN - -#define HDA_BLK_MIN HDA_DMA_ALIGNMENT -#define HDA_BLK_ALIGN (~(HDA_BLK_MIN - 1)) - -#define HDA_BUFSZ_MIN 4096 -#define HDA_BUFSZ_MAX 65536 -#define HDA_BUFSZ_DEFAULT 16384 - #define HDA_PARSE_MAXDEPTH 10 MALLOC_DEFINE(M_HDAA, "hdaa", "HDA Audio"); @@ -116,6 +105,12 @@ const char *HDA_LOCS[64] = { const char *HDA_GPIO_ACTIONS[8] = { "keep", "set", "clear", "disable", "input", "0x05", "0x06", "0x07"}; +const char *HDA_HDMI_CODING_TYPES[18] = { + "undefined", "LPCM", "AC-3", "MPEG1", "MP3", "MPEG2", "AAC-LC", "DTS", + "ATRAC", "DSD", "E-AC-3", "DTS-HD", "MLP", "DST", "WMAPro", "HE-AAC", + "HE-AACv2", "MPEG-Surround" +}; + /* Default */ static uint32_t hdaa_fmt[] = { SND_FORMAT(AFMT_S16_LE, 2, 0), @@ -169,6 +164,8 @@ static const struct { }; #define HDA_RATE_TAB_LEN (sizeof(hda_rate_tab) / sizeof(hda_rate_tab[0])) +const static char *ossnames[] = SOUND_DEVICE_NAMES; + /**************************************************************************** * Function prototypes ****************************************************************************/ @@ -187,7 +184,6 @@ static void hdaa_dump_pin_config(struct static char * hdaa_audio_ctl_ossmixer_mask2allname(uint32_t mask, char *buf, size_t len) { - static char *ossname[] = SOUND_DEVICE_NAMES; int i, first = 1; bzero(buf, len); @@ -195,7 +191,7 @@ hdaa_audio_ctl_ossmixer_mask2allname(uin if (mask & (1 << i)) { if (first == 0) strlcat(buf, ", ", len); - strlcat(buf, ossname[i], len); + strlcat(buf, ossnames[i], len); first = 0; } } @@ -243,49 +239,30 @@ hdaa_audio_ctl_amp_get(struct hdaa_devin } /* - * Jack detection (Speaker/HP redirection) event handler. + * Headphones redirection change handler. */ static void -hdaa_hp_switch_handler(struct hdaa_devinfo *devinfo, int asid) +hdaa_hpredir_handler(struct hdaa_widget *w) { - struct hdaa_audio_as *as; - struct hdaa_widget *w; + struct hdaa_devinfo *devinfo = w->devinfo; + struct hdaa_audio_as *as = &devinfo->as[w->bindas]; + struct hdaa_widget *w1; struct hdaa_audio_ctl *ctl; - uint32_t val, res; - int j; - - as = &devinfo->as[asid]; - if (as->hpredir < 0) - return; - - w = hdaa_widget_get(devinfo, as->pins[15]); - if (w == NULL || w->enable == 0 || w->type != - HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) - return; - - res = hda_command(devinfo->dev, - HDA_CMD_GET_PIN_SENSE(0, as->pins[15])); - - HDA_BOOTVERBOSE( - device_printf(devinfo->dev, - "Pin sense: nid=%d sence=0x%08x", - as->pins[15], res); - ); - - res = (res & HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT) != 0; - if (devinfo->quirks & HDAA_QUIRK_SENSEINV) - res ^= 1; + uint32_t val; + int j, connected = w->wclass.pin.connected; HDA_BOOTVERBOSE( - printf(" %sconnected\n", res == 0 ? "dis" : ""); + device_printf((as->pdevinfo && as->pdevinfo->dev) ? + as->pdevinfo->dev : devinfo->dev, + "Redirect output to: %s\n", + connected ? "headphones": "main"); ); - /* (Un)Mute headphone pin. */ ctl = hdaa_audio_ctl_amp_get(devinfo, - as->pins[15], HDAA_CTL_IN, -1, 1); + w->nid, HDAA_CTL_IN, -1, 1); if (ctl != NULL && ctl->mute) { /* If pin has muter - use it. */ - val = (res != 0) ? 0 : 1; + val = connected ? 0 : 1; if (val != ctl->forcemute) { ctl->forcemute = val; hdaa_audio_ctl_amp_set(ctl, @@ -294,21 +271,17 @@ hdaa_hp_switch_handler(struct hdaa_devin } } else { /* If there is no muter - disable pin output. */ - w = hdaa_widget_get(devinfo, as->pins[15]); - if (w != NULL && w->type == - HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { - if (res != 0) - val = w->wclass.pin.ctrl | - HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; - else - val = w->wclass.pin.ctrl & - ~HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; - if (val != w->wclass.pin.ctrl) { - w->wclass.pin.ctrl = val; - hda_command(devinfo->dev, - HDA_CMD_SET_PIN_WIDGET_CTRL(0, - w->nid, w->wclass.pin.ctrl)); - } + if (connected) + val = w->wclass.pin.ctrl | + HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; + else + val = w->wclass.pin.ctrl & + ~HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; + if (val != w->wclass.pin.ctrl) { + w->wclass.pin.ctrl = val; + hda_command(devinfo->dev, + HDA_CMD_SET_PIN_WIDGET_CTRL(0, + w->nid, w->wclass.pin.ctrl)); } } /* (Un)Mute other pins. */ @@ -319,7 +292,7 @@ hdaa_hp_switch_handler(struct hdaa_devin as->pins[j], HDAA_CTL_IN, -1, 1); if (ctl != NULL && ctl->mute) { /* If pin has muter - use it. */ - val = (res != 0) ? 1 : 0; + val = connected ? 1 : 0; if (val == ctl->forcemute) continue; ctl->forcemute = val; @@ -329,32 +302,142 @@ hdaa_hp_switch_handler(struct hdaa_devin continue; } /* If there is no muter - disable pin output. */ - w = hdaa_widget_get(devinfo, as->pins[j]); - if (w != NULL && w->type == - HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { - if (res != 0) - val = w->wclass.pin.ctrl & + w1 = hdaa_widget_get(devinfo, as->pins[j]); + if (w1 != NULL) { + if (connected) + val = w1->wclass.pin.ctrl & ~HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; else - val = w->wclass.pin.ctrl | + val = w1->wclass.pin.ctrl | HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; - if (val != w->wclass.pin.ctrl) { - w->wclass.pin.ctrl = val; + if (val != w1->wclass.pin.ctrl) { + w1->wclass.pin.ctrl = val; hda_command(devinfo->dev, HDA_CMD_SET_PIN_WIDGET_CTRL(0, - w->nid, w->wclass.pin.ctrl)); + w1->nid, w1->wclass.pin.ctrl)); } } } } /* - * Callback for poll based jack detection. + * Recording source change handler. + */ +static void +hdaa_autorecsrc_handler(struct hdaa_audio_as *as, struct hdaa_widget *w) +{ + struct hdaa_pcm_devinfo *pdevinfo = as->pdevinfo; + struct hdaa_devinfo *devinfo; + struct hdaa_widget *w1; + int i, mask, fullmask, prio, bestprio; + char buf[128]; + + if (!as->mixed || pdevinfo == NULL || pdevinfo->mixer == NULL) + return; + /* Don't touch anything if we asked not to. */ + if (pdevinfo->autorecsrc == 0 || + (pdevinfo->autorecsrc == 1 && w != NULL)) + return; + /* Don't touch anything if "mix" or "speaker" selected. */ + if (pdevinfo->recsrc & (SOUND_MASK_IMIX | SOUND_MASK_SPEAKER)) + return; + /* Don't touch anything if several selected. */ + if (ffs(pdevinfo->recsrc) != fls(pdevinfo->recsrc)) + return; + devinfo = pdevinfo->devinfo; + mask = fullmask = 0; + bestprio = 0; + for (i = 0; i < 16; i++) { + if (as->pins[i] <= 0) + continue; + w1 = hdaa_widget_get(devinfo, as->pins[i]); + if (w1 == NULL || w1->enable == 0) + continue; + if (w1->wclass.pin.connected == 0) + continue; + prio = (w1->wclass.pin.connected == 1) ? 2 : 1; + if (prio < bestprio) + continue; + if (prio > bestprio) { + mask = 0; + bestprio = prio; + } + mask |= (1 << w1->ossdev); + fullmask |= (1 << w1->ossdev); + } + if (mask == 0) + return; + /* Prefer newly connected input. */ + if (w != NULL && (mask & (1 << w->ossdev))) + mask = (1 << w->ossdev); + /* Prefer previously selected input */ + if (mask & pdevinfo->recsrc) + mask &= pdevinfo->recsrc; + /* Prefer mic. */ + if (mask & SOUND_MASK_MIC) + mask = SOUND_MASK_MIC; + /* Prefer monitor (2nd mic). */ + if (mask & SOUND_MASK_MONITOR) + mask = SOUND_MASK_MONITOR; + /* Just take first one. */ + mask = (1 << (ffs(mask) - 1)); + HDA_BOOTVERBOSE( + hdaa_audio_ctl_ossmixer_mask2allname(mask, buf, sizeof(buf)); + device_printf(pdevinfo->dev, + "Automatically set rec source to: %s\n", buf); + ); + hdaa_unlock(devinfo); + mix_setrecsrc(pdevinfo->mixer, mask); + hdaa_lock(devinfo); +} + +/* + * Jack presence detection event handler. + */ +static void +hdaa_presence_handler(struct hdaa_widget *w) +{ + struct hdaa_devinfo *devinfo = w->devinfo; + struct hdaa_audio_as *as; + uint32_t res; + int connected; + + if (w->enable == 0 || w->type != + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) + return; + + if (HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP(w->wclass.pin.cap) == 0 || + (HDA_CONFIG_DEFAULTCONF_MISC(w->wclass.pin.config) & 1) != 0) + return; + + res = hda_command(devinfo->dev, HDA_CMD_GET_PIN_SENSE(0, w->nid)); + connected = (res & HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT) != 0; + if (devinfo->quirks & HDAA_QUIRK_SENSEINV) + connected = !connected; + if (connected == w->wclass.pin.connected) + return; + w->wclass.pin.connected = connected; + HDA_BOOTVERBOSE( + device_printf(devinfo->dev, + "Pin sense: nid=%d sence=0x%08x (%sconnected)\n", + w->nid, res, !w->wclass.pin.connected ? "dis" : ""); + ); + + as = &devinfo->as[w->bindas]; + if (as->hpredir >= 0 && as->pins[15] == w->nid) + hdaa_hpredir_handler(w); + if (as->dir == HDAA_CTL_IN) + hdaa_autorecsrc_handler(as, w); +} + +/* + * Callback for poll based presence detection. */ static void hdaa_jack_poll_callback(void *arg) { struct hdaa_devinfo *devinfo = arg; + struct hdaa_widget *w; int i; hdaa_lock(devinfo); @@ -365,56 +448,203 @@ hdaa_jack_poll_callback(void *arg) for (i = 0; i < devinfo->ascnt; i++) { if (devinfo->as[i].hpredir < 0) continue; - hdaa_hp_switch_handler(devinfo, i); + w = hdaa_widget_get(devinfo, devinfo->as[i].pins[15]); + if (w == NULL || w->enable == 0 || w->type != + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) + continue; + hdaa_presence_handler(w); } callout_reset(&devinfo->poll_jack, devinfo->poll_ival, hdaa_jack_poll_callback, devinfo); hdaa_unlock(devinfo); } +static void +hdaa_eld_dump(struct hdaa_widget *w) +{ + struct hdaa_devinfo *devinfo = w->devinfo; + device_t dev = devinfo->dev; + uint8_t *sad; + int len, mnl, i, sadc, fmt; + + if (w->eld == NULL || w->eld_len < 4) + return; + device_printf(dev, + "ELD nid=%d: ELD_Ver=%u Baseline_ELD_Len=%u\n", + w->nid, w->eld[0] >> 3, w->eld[2]); + if ((w->eld[0] >> 3) != 0x02) + return; + len = min(w->eld_len, (u_int)w->eld[2] * 4); + mnl = w->eld[4] & 0x1f; + device_printf(dev, + "ELD nid=%d: CEA_EDID_Ver=%u MNL=%u\n", + w->nid, w->eld[4] >> 5, mnl); + sadc = w->eld[5] >> 4; + device_printf(dev, + "ELD nid=%d: SAD_Count=%u Conn_Type=%u S_AI=%u HDCP=%u\n", + w->nid, sadc, (w->eld[5] >> 2) & 0x3, + (w->eld[5] >> 1) & 0x1, w->eld[5] & 0x1); + device_printf(dev, + "ELD nid=%d: Aud_Synch_Delay=%ums\n", + w->nid, w->eld[6] * 2); + device_printf(dev, + "ELD nid=%d: Channels=0x%b\n", + w->nid, w->eld[7], + "\020\07RLRC\06FLRC\05RC\04RLR\03FC\02LFE\01FLR"); + device_printf(dev, + "ELD nid=%d: Port_ID=0x%02x%02x%02x%02x%02x%02x%02x%02x\n", + w->nid, w->eld[8], w->eld[9], w->eld[10], w->eld[11], + w->eld[12], w->eld[13], w->eld[14], w->eld[15]); + device_printf(dev, + "ELD nid=%d: Manufacturer_Name=0x%02x%02x\n", + w->nid, w->eld[16], w->eld[17]); + device_printf(dev, + "ELD nid=%d: Product_Code=0x%02x%02x\n", + w->nid, w->eld[18], w->eld[19]); + device_printf(dev, + "ELD nid=%d: Monitor_Name_String='%.*s'\n", + w->nid, mnl, &w->eld[20]); + for (i = 0; i < sadc; i++) { + sad = &w->eld[20 + mnl + i * 3]; + fmt = (sad[0] >> 3) & 0x0f; + if (fmt == HDA_HDMI_CODING_TYPE_REF_CTX) { + fmt = (sad[2] >> 3) & 0x1f; + if (fmt < 1 || fmt > 3) + fmt = 0; + else + fmt += 14; + } + device_printf(dev, + "ELD nid=%d: %s %dch freqs=0x%b", + w->nid, HDA_HDMI_CODING_TYPES[fmt], (sad[0] & 0x07) + 1, + sad[1], "\020\007192\006176\00596\00488\00348\00244\00132"); + switch (fmt) { + case HDA_HDMI_CODING_TYPE_LPCM: + printf(" sizes=0x%b", + sad[2] & 0x07, "\020\00324\00220\00116"); + break; + case HDA_HDMI_CODING_TYPE_AC3: + case HDA_HDMI_CODING_TYPE_MPEG1: + case HDA_HDMI_CODING_TYPE_MP3: + case HDA_HDMI_CODING_TYPE_MPEG2: + case HDA_HDMI_CODING_TYPE_AACLC: + case HDA_HDMI_CODING_TYPE_DTS: + case HDA_HDMI_CODING_TYPE_ATRAC: + printf(" max_bitrate=%d", sad[2] * 8000); + break; + case HDA_HDMI_CODING_TYPE_WMAPRO: + printf(" profile=%d", sad[2] & 0x07); + break; + } + printf("\n"); + } +} + +static void +hdaa_eld_handler(struct hdaa_widget *w) +{ + struct hdaa_devinfo *devinfo = w->devinfo; + uint32_t res; + int i; + + if (w->enable == 0 || w->type != + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) + return; + + if (HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP(w->wclass.pin.cap) == 0 || + (HDA_CONFIG_DEFAULTCONF_MISC(w->wclass.pin.config) & 1) != 0) + return; + + res = hda_command(devinfo->dev, HDA_CMD_GET_PIN_SENSE(0, w->nid)); + if ((w->eld != 0) == ((res & HDA_CMD_GET_PIN_SENSE_ELD_VALID) != 0)) + return; + if (w->eld != NULL) { + w->eld_len = 0; + free(w->eld, M_HDAA); + w->eld = NULL; + } + HDA_BOOTVERBOSE( + device_printf(devinfo->dev, + "Pin sense: nid=%d sence=0x%08x " + "(%sconnected, ELD %svalid)\n", + w->nid, res, + (res & HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT) ? "" : "dis", + (res & HDA_CMD_GET_PIN_SENSE_ELD_VALID) ? "" : "in"); + ); + if ((res & HDA_CMD_GET_PIN_SENSE_ELD_VALID) == 0) + return; + + res = hda_command(devinfo->dev, + HDA_CMD_GET_HDMI_DIP_SIZE(0, w->nid, 0x08)); + if (res == HDA_INVALID) + return; + w->eld_len = res & 0xff; + if (w->eld_len != 0) + w->eld = malloc(w->eld_len, M_HDAA, M_ZERO | M_NOWAIT); + if (w->eld == NULL) { + w->eld_len = 0; + return; + } + + for (i = 0; i < w->eld_len; i++) { + res = hda_command(devinfo->dev, + HDA_CMD_GET_HDMI_ELDD(0, w->nid, i)); + if (res & 0x80000000) + w->eld[i] = res & 0xff; + } + HDA_BOOTVERBOSE( + hdaa_eld_dump(w); + ); +} + /* - * Jack detection initializer. + * Pin sense initializer. */ static void -hdaa_hp_switch_init(struct hdaa_devinfo *devinfo) +hdaa_sense_init(struct hdaa_devinfo *devinfo) { - struct hdaa_audio_as *as = devinfo->as; - struct hdaa_widget *w; - int i, poll = 0; - - for (i = 0; i < devinfo->ascnt; i++) { - if (as[i].hpredir < 0) - continue; + struct hdaa_audio_as *as; + struct hdaa_widget *w; + int i, poll = 0; - w = hdaa_widget_get(devinfo, as[i].pins[15]); + for (i = devinfo->startnode; i < devinfo->endnode; i++) { + w = hdaa_widget_get(devinfo, i); if (w == NULL || w->enable == 0 || w->type != HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) continue; - if (HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP(w->wclass.pin.cap) == 0 || - (HDA_CONFIG_DEFAULTCONF_MISC(w->wclass.pin.config) & 1) != 0) { - device_printf(devinfo->dev, - "No jack detection support at pin %d\n", - as[i].pins[15]); - continue; - } - if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap)) { - as[i].unsol = HDAC_UNSOL_ALLOC( - device_get_parent(devinfo->dev), devinfo->dev, - w->nid); + if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap) && + w->unsol < 0) { + w->unsol = HDAC_UNSOL_ALLOC( + device_get_parent(devinfo->dev), devinfo->dev, w->nid); hda_command(devinfo->dev, HDA_CMD_SET_UNSOLICITED_RESPONSE(0, w->nid, - HDA_CMD_SET_UNSOLICITED_RESPONSE_ENABLE | - as[i].unsol)); - } else - poll = 1; - HDA_BOOTVERBOSE( - device_printf(devinfo->dev, - "Headphones redirection " - "for as=%d nid=%d using %s.\n", - i, w->nid, - (poll != 0) ? "polling" : "unsolicited responses"); - ); - hdaa_hp_switch_handler(devinfo, i); + HDA_CMD_SET_UNSOLICITED_RESPONSE_ENABLE | w->unsol)); + } + as = &devinfo->as[w->bindas]; + if (as->hpredir >= 0 && as->pins[15] == w->nid) { + if (HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP(w->wclass.pin.cap) == 0 || + (HDA_CONFIG_DEFAULTCONF_MISC(w->wclass.pin.config) & 1) != 0) { + device_printf(devinfo->dev, + "No presence detection support at nid %d\n", + as[i].pins[15]); + } else { + if (w->unsol < 0) + poll = 1; + HDA_BOOTVERBOSE( + device_printf(devinfo->dev, + "Headphones redirection for " + "association %d nid=%d using %s.\n", + w->bindas, w->nid, + (poll != 0) ? "polling" : + "unsolicited responses"); + ); + }; + } + hdaa_presence_handler(w); + if (!HDA_PARAM_PIN_CAP_DP(w->wclass.pin.cap) && + !HDA_PARAM_PIN_CAP_HDMI(w->wclass.pin.cap)) + continue; + hdaa_eld_handler(w); } if (poll) { callout_reset(&devinfo->poll_jack, 1, @@ -423,25 +653,25 @@ hdaa_hp_switch_init(struct hdaa_devinfo } static void -hdaa_hp_switch_deinit(struct hdaa_devinfo *devinfo) +hdaa_sense_deinit(struct hdaa_devinfo *devinfo) { - struct hdaa_audio_as *as = devinfo->as; - struct hdaa_widget *w; - int i; + struct hdaa_widget *w; + int i; - for (i = 0; i < devinfo->ascnt; i++) { - if (as[i].unsol < 0) - continue; - w = hdaa_widget_get(devinfo, as[i].pins[15]); + callout_stop(&devinfo->poll_jack); + for (i = devinfo->startnode; i < devinfo->endnode; i++) { + w = hdaa_widget_get(devinfo, i); if (w == NULL || w->enable == 0 || w->type != HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) continue; + if (w->unsol < 0) + continue; hda_command(devinfo->dev, HDA_CMD_SET_UNSOLICITED_RESPONSE(0, w->nid, 0)); HDAC_UNSOL_FREE( device_get_parent(devinfo->dev), devinfo->dev, - as[i].unsol); - as[i].unsol = -1; + w->unsol); + w->unsol = -1; } } @@ -902,6 +1132,11 @@ hdaa_widget_parse(struct hdaa_widget *w) w->param.supp_pcm_size_rate = w->devinfo->supp_pcm_size_rate; } + if (HDA_PARAM_AUDIO_WIDGET_CAP_STRIPE(w->param.widget_cap)) { + w->wclass.conv.stripecap = hda_command(dev, + HDA_CMD_GET_STRIPE_CONTROL(0, w->nid)) >> 20; + } else + w->wclass.conv.stripecap = 1; } else { w->param.supp_stream_formats = 0; w->param.supp_pcm_size_rate = 0; @@ -938,6 +1173,7 @@ hdaa_widget_parse(struct hdaa_widget *w) hdaa_sysctl_config, "A", "Original pin configuration"); hdaa_lock(w->devinfo); } + w->unsol = -1; } static void @@ -1001,6 +1237,10 @@ hdaa_widget_postprocess(struct hdaa_widg } strlcat(w->name, HDA_CONNS[conn], sizeof(w->name)); strlcat(w->name, ")", sizeof(w->name)); + + if (HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP(w->wclass.pin.cap) == 0 || + (HDA_CONFIG_DEFAULTCONF_MISC(w->wclass.pin.config) & 1) != 0) + w->wclass.pin.connected = 2; } } @@ -1193,31 +1433,58 @@ hdaa_stream_format(struct hdaa_chan *ch) return (fmt); } +static int +hdaa_allowed_stripes(uint16_t fmt) +{ + static const int bits[8] = { 8, 16, 20, 24, 32, 32, 32, 32 }; + int size; + + size = bits[(fmt >> 4) & 0x03]; + size *= (fmt & 0x0f) + 1; + size *= ((fmt >> 11) & 0x07) + 1; + return (0xffffffffU >> (32 - fls(size / 8))); +} + static void hdaa_audio_setup(struct hdaa_chan *ch) { struct hdaa_audio_as *as = &ch->devinfo->as[ch->as]; - struct hdaa_widget *w; - int i, chn, totalchn, c; + struct hdaa_widget *w, *wp; + int i, j, k, chn, cchn, totalchn, totalextchn, c; uint16_t fmt, dfmt; - uint16_t chmap[2][5] = {{ 0x0010, 0x0001, 0x0201, 0x0231, 0x0231 }, /* 5.1 */ - { 0x0010, 0x0001, 0x2001, 0x2031, 0x2431 }};/* 7.1 */ - int map = -1; + /* Mapping channel pairs to codec pins/converters. */ + const static uint16_t convmap[2][5] = + {{ 0x0010, 0x0001, 0x0201, 0x0231, 0x0231 }, /* 5.1 */ + { 0x0010, 0x0001, 0x2001, 0x2031, 0x2431 }};/* 7.1 */ + /* Mapping formats to HDMI channel allocations. */ + const static uint8_t hdmica[2][8] = + {{ 0x02, 0x00, 0x04, 0x08, 0x0a, 0x0e, 0x12, 0x12 }, /* x.0 */ + { 0x01, 0x03, 0x01, 0x03, 0x09, 0x0b, 0x0f, 0x13 }}; /* x.1 */ + /* Mapping formats to HDMI channels order. */ + const static uint32_t hdmich[2][8] = + {{ 0xFFFF0F00, 0xFFFFFF10, 0xFFF2FF10, 0xFF32FF10, + 0xFF324F10, 0xF5324F10, 0x54326F10, 0x54326F10 }, /* x.0 */ + { 0xFFFFF000, 0xFFFF0100, 0xFFFFF210, 0xFFFF2310, + 0xFF32F410, 0xFF324510, 0xF6324510, 0x76325410 }}; /* x.1 */ + int convmapid = -1; + nid_t nid; + uint8_t csum; totalchn = AFMT_CHANNEL(ch->fmt); + totalextchn = AFMT_EXTCHANNEL(ch->fmt); HDA_BOOTHVERBOSE( device_printf(ch->pdevinfo->dev, - "PCMDIR_%s: Stream setup fmt=%08x speed=%d\n", + "PCMDIR_%s: Stream setup fmt=%08x (%d.%d) speed=%d\n", (ch->dir == PCMDIR_PLAY) ? "PLAY" : "REC", - ch->fmt, ch->spd); + ch->fmt, totalchn - totalextchn, totalextchn, ch->spd); ); fmt = hdaa_stream_format(ch); - /* Set channel mapping for known speaker setups. */ + /* Set channels to I/O converters mapping for known speaker setups. */ if ((as->pinset == 0x0007 || as->pinset == 0x0013)) /* Standard 5.1 */ - map = 0; + convmapid = 0; else if (as->pinset == 0x0017) /* Standard 7.1 */ - map = 1; + convmapid = 1; dfmt = HDA_CMD_SET_DIGITAL_CONV_FMT1_DIGEN; if (ch->fmt & AFMT_AC3) @@ -1234,22 +1501,16 @@ hdaa_audio_setup(struct hdaa_chan *ch) if (as->fakeredir && i == (as->pincnt - 1)) { c = (ch->sid << 4); } else { - if (map >= 0) /* Map known speaker setups. */ - chn = (((chmap[map][totalchn / 2] >> i * 4) & - 0xf) - 1) * 2; + /* Map channels to I/O converters, if set. */ + if (convmapid >= 0) + chn = (((convmap[convmapid][totalchn / 2] + >> i * 4) & 0xf) - 1) * 2; if (chn < 0 || chn >= totalchn) { c = 0; } else { c = (ch->sid << 4) | chn; } } - HDA_BOOTHVERBOSE( - device_printf(ch->pdevinfo->dev, - "PCMDIR_%s: Stream setup nid=%d: " - "fmt=0x%04x, dfmt=0x%04x, chan=0x%04x\n", - (ch->dir == PCMDIR_PLAY) ? "PLAY" : "REC", - ch->io[i], fmt, dfmt, c); - ); hda_command(ch->devinfo->dev, HDA_CMD_SET_CONV_FMT(0, ch->io[i], fmt)); if (HDA_PARAM_AUDIO_WIDGET_CAP_DIGITAL(w->param.widget_cap)) { @@ -1258,15 +1519,112 @@ hdaa_audio_setup(struct hdaa_chan *ch) } hda_command(ch->devinfo->dev, HDA_CMD_SET_CONV_STREAM_CHAN(0, ch->io[i], c)); -#if 0 - hda_command(ch->devinfo->dev, - HDA_CMD_SET_CONV_CHAN_COUNT(0, ch->io[i], 1)); - hda_command(ch->devinfo->dev, - HDA_CMD_SET_HDMI_CHAN_SLOT(0, ch->io[i], 0x00)); - hda_command(ch->devinfo->dev, - HDA_CMD_SET_HDMI_CHAN_SLOT(0, ch->io[i], 0x11)); -#endif - chn += HDA_PARAM_AUDIO_WIDGET_CAP_CC(w->param.widget_cap) + 1; + if (HDA_PARAM_AUDIO_WIDGET_CAP_STRIPE(w->param.widget_cap)) { + hda_command(ch->devinfo->dev, + HDA_CMD_SET_STRIPE_CONTROL(0, w->nid, ch->stripectl)); + } + cchn = HDA_PARAM_AUDIO_WIDGET_CAP_CC(w->param.widget_cap); + if (cchn > 1 && chn < totalchn) { + cchn = min(cchn, totalchn - chn - 1); + hda_command(ch->devinfo->dev, + HDA_CMD_SET_CONV_CHAN_COUNT(0, ch->io[i], cchn)); + } + HDA_BOOTHVERBOSE( + device_printf(ch->pdevinfo->dev, + "PCMDIR_%s: Stream setup nid=%d: " + "fmt=0x%04x, dfmt=0x%04x, chan=0x%04x, " + "chan_count=0x%02x, stripe=%d\n", + (ch->dir == PCMDIR_PLAY) ? "PLAY" : "REC", + ch->io[i], fmt, dfmt, c, cchn, ch->stripectl); + ); + for (j = 0; j < 16; j++) { + if (as->dacs[ch->asindex][j] != ch->io[i]) + continue; + nid = as->pins[j]; + wp = hdaa_widget_get(ch->devinfo, nid); + if (wp == NULL) + continue; + if (!HDA_PARAM_PIN_CAP_DP(wp->wclass.pin.cap) && + !HDA_PARAM_PIN_CAP_HDMI(wp->wclass.pin.cap)) + continue; + + /* Set channel mapping. */ + for (k = 0; k < 8; k++) { + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_CHAN_SLOT(0, nid, + (((hdmich[totalextchn == 0 ? 0 : 1][totalchn - 1] + >> (k * 4)) & 0xf) << 4) | k)); + } + + /* + * Enable High Bit Rate (HBR) Encoded Packet Type + * (EPT), if supported and needed (8ch data). + */ + if (HDA_PARAM_PIN_CAP_HDMI(wp->wclass.pin.cap) && + HDA_PARAM_PIN_CAP_HBR(wp->wclass.pin.cap)) { + wp->wclass.pin.ctrl &= + ~HDA_CMD_SET_PIN_WIDGET_CTRL_VREF_ENABLE_MASK; + if ((ch->fmt & AFMT_AC3) && (cchn == 7)) + wp->wclass.pin.ctrl |= 0x03; + hda_command(ch->devinfo->dev, + HDA_CMD_SET_PIN_WIDGET_CTRL(0, nid, + wp->wclass.pin.ctrl)); + } + + /* Stop audio infoframe transmission. */ + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_INDEX(0, nid, 0x00)); + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_XMIT(0, nid, 0x00)); + + /* Clear audio infoframe buffer. */ + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_INDEX(0, nid, 0x00)); + for (k = 0; k < 32; k++) + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, 0x00)); + + /* Write HDMI/DisplayPort audio infoframe. */ + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_INDEX(0, nid, 0x00)); + if (w->eld != NULL && w->eld_len >= 6 && + ((w->eld[5] >> 2) & 0x3) == 1) { /* DisplayPort */ + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, 0x84)); + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, 0x1b)); + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, 0x44)); + } else { /* HDMI */ + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, 0x84)); + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, 0x01)); + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, 0x0a)); + csum = 0; + csum -= 0x84 + 0x01 + 0x0a + (totalchn - 1) + + hdmica[totalextchn == 0 ? 0 : 1][totalchn - 1]; + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, csum)); + } + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, totalchn - 1)); + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, 0x00)); + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, 0x00)); + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, + hdmica[totalextchn == 0 ? 0 : 1][totalchn - 1])); + + /* Start audio infoframe transmission. */ + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_INDEX(0, nid, 0x00)); + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_XMIT(0, nid, 0xc0)); + } + chn += cchn + 1; } } @@ -1351,6 +1709,8 @@ hdaa_channel_stop(struct hdaa_chan *ch) struct hdaa_widget *w; int i; + if ((ch->flags & HDAA_CHN_RUNNING) == 0) + return; ch->flags &= ~HDAA_CHN_RUNNING; HDAC_STREAM_STOP(device_get_parent(devinfo->dev), devinfo->dev, ch->dir == PCMDIR_PLAY ? 1 : 0, ch->sid); @@ -1374,11 +1734,12 @@ static int hdaa_channel_start(struct hdaa_chan *ch) { struct hdaa_devinfo *devinfo = ch->devinfo; + uint32_t fmt; - ch->ptr = 0; - ch->prevptr = 0; + fmt = hdaa_stream_format(ch); + ch->stripectl = fls(ch->stripecap & hdaa_allowed_stripes(fmt)) - 1; ch->sid = HDAC_STREAM_ALLOC(device_get_parent(devinfo->dev), devinfo->dev, - ch->dir == PCMDIR_PLAY ? 1 : 0, hdaa_stream_format(ch), &ch->dmapos); + ch->dir == PCMDIR_PLAY ? 1 : 0, fmt, ch->stripectl, &ch->dmapos); if (ch->sid <= 0) return (EBUSY); hdaa_audio_setup(ch); @@ -1468,11 +1829,11 @@ hdaa_audio_ctl_ossmixer_init(struct snd_ struct hdaa_pcm_devinfo *pdevinfo = mix_getdevinfo(m); struct hdaa_devinfo *devinfo = pdevinfo->devinfo; struct hdaa_widget *w, *cw; - struct hdaa_audio_ctl *ctl; uint32_t mask, recmask; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 13:22:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43641106566B; Fri, 8 Jun 2012 13:22:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CC8F8FC12; Fri, 8 Jun 2012 13:22:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58DMpmd061705; Fri, 8 Jun 2012 13:22:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58DMolQ061701; Fri, 8 Jun 2012 13:22:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206081322.q58DMolQ061701@svn.freebsd.org> From: Alexander Motin Date: Fri, 8 Jun 2012 13:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236754 - stable/8/sys/dev/sound/pcm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 13:22:51 -0000 Author: mav Date: Fri Jun 8 13:22:50 2012 New Revision: 236754 URL: http://svn.freebsd.org/changeset/base/236754 Log: MFC r230845: Make sound(4) more flexible in setting soft buffer and block sizes when hardware imposes strict limitations on hard buffer and block sizes. Previous code set soft buffer to be no smaller then hard buffer. On some cards with fixed 64K physical buffer that caused up to 800ms play latency. New code allows to set soft buffer size down to just two blocks of the hard buffer and to not write more then that size ahead to the hardware buffer. As result of that change I was able to reduce full practically measured record-playback loop delay in those conditions down to only about 115ms with theoretical playback latency of only about 50ms. New code works fine for both vchans and direct cases. In both cases sound(4) tries to follow hw.snd.latency_profile and hw.snd.latency values and application-requested buffer and block sizes as much as limitation of two hardware blocks allows. Modified: stable/8/sys/dev/sound/pcm/buffer.c stable/8/sys/dev/sound/pcm/buffer.h stable/8/sys/dev/sound/pcm/channel.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/sound/pcm/buffer.c ============================================================================== --- stable/8/sys/dev/sound/pcm/buffer.c Fri Jun 8 13:10:18 2012 (r236753) +++ stable/8/sys/dev/sound/pcm/buffer.c Fri Jun 8 13:22:50 2012 (r236754) @@ -301,6 +301,15 @@ sndbuf_fillsilence(struct snd_dbuf *b) b->rl = b->bufsize; } +void +sndbuf_fillsilence_rl(struct snd_dbuf *b, u_int rl) +{ + if (b->bufsize > 0) + memset(sndbuf_getbuf(b), sndbuf_zerodata(b->fmt), b->bufsize); + b->rp = 0; + b->rl = min(b->bufsize, rl); +} + /** * @brief Reset buffer w/o flushing statistics * Modified: stable/8/sys/dev/sound/pcm/buffer.h ============================================================================== --- stable/8/sys/dev/sound/pcm/buffer.h Fri Jun 8 13:10:18 2012 (r236753) +++ stable/8/sys/dev/sound/pcm/buffer.h Fri Jun 8 13:22:50 2012 (r236754) @@ -74,6 +74,7 @@ int sndbuf_remalloc(struct snd_dbuf *b, void sndbuf_reset(struct snd_dbuf *b); void sndbuf_clear(struct snd_dbuf *b, unsigned int length); void sndbuf_fillsilence(struct snd_dbuf *b); +void sndbuf_fillsilence_rl(struct snd_dbuf *b, u_int rl); void sndbuf_softreset(struct snd_dbuf *b); void sndbuf_clearshadow(struct snd_dbuf *b); Modified: stable/8/sys/dev/sound/pcm/channel.c ============================================================================== --- stable/8/sys/dev/sound/pcm/channel.c Fri Jun 8 13:10:18 2012 (r236753) +++ stable/8/sys/dev/sound/pcm/channel.c Fri Jun 8 13:22:50 2012 (r236754) @@ -395,24 +395,28 @@ chn_wrfeed(struct pcm_channel *c) { struct snd_dbuf *b = c->bufhard; struct snd_dbuf *bs = c->bufsoft; - unsigned int amt; + unsigned int amt, want, wasfree; CHN_LOCKASSERT(c); if ((c->flags & CHN_F_MMAP) && !(c->flags & CHN_F_CLOSING)) sndbuf_acquire(bs, NULL, sndbuf_getfree(bs)); - amt = sndbuf_getfree(b); + wasfree = sndbuf_getfree(b); + want = min(sndbuf_getsize(b), + imax(0, sndbuf_xbytes(sndbuf_getsize(bs), bs, b) - + sndbuf_getready(b))); + amt = min(wasfree, want); if (amt > 0) sndbuf_feed(bs, b, c, c->feeder, amt); /* * Possible xruns. There should be no empty space left in buffer. */ - if (sndbuf_getfree(b) > 0) + if (sndbuf_getready(b) < want) c->xruns++; - if (sndbuf_getfree(b) < amt) + if (sndbuf_getfree(b) < wasfree) chn_wakeup(c); } @@ -721,7 +725,8 @@ chn_start(struct pcm_channel *c, int for } if (c->parentchannel == NULL) { if (c->direction == PCMDIR_PLAY) - sndbuf_fillsilence(b); + sndbuf_fillsilence_rl(b, + sndbuf_xbytes(sndbuf_getsize(bs), bs, b)); if (snd_verbose > 3) device_printf(c->dev, "%s(): %s starting! (%s/%s) " @@ -1728,7 +1733,7 @@ chn_resizebuf(struct pcm_channel *c, int int blkcnt, int blksz) { struct snd_dbuf *b, *bs, *pb; - int sblksz, sblkcnt, hblksz, hblkcnt, limit = 1; + int sblksz, sblkcnt, hblksz, hblkcnt, limit = 0, nsblksz, nsblkcnt; int ret; CHN_LOCKASSERT(c); @@ -1748,7 +1753,6 @@ chn_resizebuf(struct pcm_channel *c, int return EINVAL; else { c->latency = latency; - limit = 0; } bs = c->bufsoft; @@ -1783,19 +1787,22 @@ chn_resizebuf(struct pcm_channel *c, int */ sblksz = round_blksz(blksz, sndbuf_getalign(bs)); sblkcnt = round_pow2(blkcnt); - limit = 0; } if (c->parentchannel != NULL) { - pb = CHN_BUF_PARENT(c, NULL); + pb = c->parentchannel->bufsoft; CHN_UNLOCK(c); CHN_LOCK(c->parentchannel); chn_notify(c->parentchannel, CHN_N_BLOCKSIZE); CHN_UNLOCK(c->parentchannel); CHN_LOCK(c); - limit = (limit != 0 && pb != NULL) ? - sndbuf_xbytes(sndbuf_getsize(pb), pb, bs) : 0; - c->timeout = c->parentchannel->timeout; + if (c->direction == PCMDIR_PLAY) { + limit = (pb != NULL) ? + sndbuf_xbytes(sndbuf_getsize(pb), pb, bs) : 0; + } else { + limit = (pb != NULL) ? + sndbuf_xbytes(sndbuf_getblksz(pb), pb, bs) * 2 : 0; + } } else { hblkcnt = 2; if (c->flags & CHN_F_HAS_SIZE) { @@ -1836,21 +1843,22 @@ chn_resizebuf(struct pcm_channel *c, int CHN_LOCK(c); if (!CHN_EMPTY(c, children)) { - sblksz = round_blksz( - sndbuf_xbytes(sndbuf_getsize(b) >> 1, b, bs), + nsblksz = round_blksz( + sndbuf_xbytes(sndbuf_getblksz(b), b, bs), sndbuf_getalign(bs)); - sblkcnt = 2; + nsblkcnt = sndbuf_getblkcnt(b); + if (c->direction == PCMDIR_PLAY) { + do { + nsblkcnt--; + } while (nsblkcnt >= 2 && + nsblksz * nsblkcnt >= sblksz * sblkcnt); + nsblkcnt++; + } + sblksz = nsblksz; + sblkcnt = nsblkcnt; limit = 0; - } else if (limit != 0) - limit = sndbuf_xbytes(sndbuf_getsize(b), b, bs); - - /* - * Interrupt timeout - */ - c->timeout = ((u_int64_t)hz * sndbuf_getsize(b)) / - ((u_int64_t)sndbuf_getspd(b) * sndbuf_getalign(b)); - if (c->timeout < 1) - c->timeout = 1; + } else + limit = sndbuf_xbytes(sndbuf_getblksz(b), b, bs) * 2; } if (limit > CHN_2NDBUFMAXSIZE) @@ -1887,6 +1895,16 @@ chn_resizebuf(struct pcm_channel *c, int } /* + * Interrupt timeout + */ + c->timeout = ((u_int64_t)hz * sndbuf_getsize(bs)) / + ((u_int64_t)sndbuf_getspd(bs) * sndbuf_getalign(bs)); + if (c->parentchannel != NULL) + c->timeout = min(c->timeout, c->parentchannel->timeout); + if (c->timeout < 1) + c->timeout = 1; + + /* * OSSv4 docs: "By default OSS will set the low water level equal * to the fragment size which is optimal in most cases." */ From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 13:25:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 720A71065673; Fri, 8 Jun 2012 13:25:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C6E18FC16; Fri, 8 Jun 2012 13:25:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58DPlBZ061892; Fri, 8 Jun 2012 13:25:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58DPlmq061890; Fri, 8 Jun 2012 13:25:47 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206081325.q58DPlmq061890@svn.freebsd.org> From: Alexander Motin Date: Fri, 8 Jun 2012 13:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236755 - stable/8/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 13:25:47 -0000 Author: mav Date: Fri Jun 8 13:25:46 2012 New Revision: 236755 URL: http://svn.freebsd.org/changeset/base/236755 Log: MFC r233606: Stop HDA controller polling callout on suspend and reset it on resume. Modified: stable/8/sys/dev/sound/pci/hda/hdac.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac.c Fri Jun 8 13:22:50 2012 (r236754) +++ stable/8/sys/dev/sound/pci/hda/hdac.c Fri Jun 8 13:25:46 2012 (r236755) @@ -1558,8 +1558,10 @@ hdac_suspend(device_t dev) HDA_BOOTHVERBOSE( device_printf(dev, "Reset controller...\n"); ); + callout_stop(&sc->poll_callout); hdac_reset(sc, 0); hdac_unlock(sc); + callout_drain(&sc->poll_callout); taskqueue_drain(taskqueue_thread, &sc->unsolq_task); HDA_BOOTHVERBOSE( device_printf(dev, "Suspend done\n"); @@ -1608,6 +1610,7 @@ hdac_resume(device_t dev) HDAC_GCTL_UNSOL); HDAC_WRITE_4(&sc->mem, HDAC_INTCTL, HDAC_INTCTL_CIE | HDAC_INTCTL_GIE); DELAY(1000); + hdac_poll_reinit(sc); hdac_unlock(sc); error = bus_generic_resume(dev); From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 13:27:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB85D1065673; Fri, 8 Jun 2012 13:27:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B56468FC08; Fri, 8 Jun 2012 13:27:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58DRUnY062019; Fri, 8 Jun 2012 13:27:30 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58DRUFU062017; Fri, 8 Jun 2012 13:27:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206081327.q58DRUFU062017@svn.freebsd.org> From: Alexander Motin Date: Fri, 8 Jun 2012 13:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236756 - stable/8/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 13:27:30 -0000 Author: mav Date: Fri Jun 8 13:27:30 2012 New Revision: 236756 URL: http://svn.freebsd.org/changeset/base/236756 Log: MFC r233692: Reenable unsolicited responses on CODEC if hdaa_sense_init() called again. This fixes jack connection events handling after suspend/resume. Modified: stable/8/sys/dev/sound/pci/hda/hdaa.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdaa.c Fri Jun 8 13:25:46 2012 (r236755) +++ stable/8/sys/dev/sound/pci/hda/hdaa.c Fri Jun 8 13:27:30 2012 (r236756) @@ -612,10 +612,11 @@ hdaa_sense_init(struct hdaa_devinfo *dev if (w == NULL || w->enable == 0 || w->type != HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) continue; - if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap) && - w->unsol < 0) { - w->unsol = HDAC_UNSOL_ALLOC( - device_get_parent(devinfo->dev), devinfo->dev, w->nid); + if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap)) { + if (w->unsol < 0) + w->unsol = HDAC_UNSOL_ALLOC( + device_get_parent(devinfo->dev), + devinfo->dev, w->nid); hda_command(devinfo->dev, HDA_CMD_SET_UNSOLICITED_RESPONSE(0, w->nid, HDA_CMD_SET_UNSOLICITED_RESPONSE_ENABLE | w->unsol)); From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 17:08:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A083510656A7; Fri, 8 Jun 2012 17:08:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BE5A8FC1D; Fri, 8 Jun 2012 17:08:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58H8R4o072194; Fri, 8 Jun 2012 17:08:27 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58H8RRw072192; Fri, 8 Jun 2012 17:08:27 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201206081708.q58H8RRw072192@svn.freebsd.org> From: Dimitry Andric Date: Fri, 8 Jun 2012 17:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236759 - head/usr.bin/sort X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 17:08:27 -0000 Author: dim Date: Fri Jun 8 17:08:27 2012 New Revision: 236759 URL: http://svn.freebsd.org/changeset/base/236759 Log: In usr.bin/sort, use another method of silencing warnings about unused arguments, which does not trigger self-assignment warnings in certain circumstances (for example, using clang with ccache). MFC after: 3 days Modified: head/usr.bin/sort/sort.h Modified: head/usr.bin/sort/sort.h ============================================================================== --- head/usr.bin/sort/sort.h Fri Jun 8 16:16:03 2012 (r236758) +++ head/usr.bin/sort/sort.h Fri Jun 8 17:08:27 2012 (r236759) @@ -41,7 +41,7 @@ #define VERSION "2.3-FreeBSD" -#define UNUSED_ARG(A) do { A=A; } while(0) +#define UNUSED_ARG(A) do { (void)(A); } while(0) #ifdef WITHOUT_NLS #define getstr(n) nlsstr[n] From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 17:30:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35F461065677; Fri, 8 Jun 2012 17:30:17 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id 9B2F38FC20; Fri, 8 Jun 2012 17:30:16 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id CA36314E7912; Fri, 8 Jun 2012 19:30:09 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id CHuSWC1Ob0Xh; Fri, 8 Jun 2012 19:30:08 +0200 (CEST) Received: from [192.168.1.117] (catv-80-98-232-12.catv.broadband.hu [80.98.232.12]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id C68C214E78B1; Fri, 8 Jun 2012 19:30:08 +0200 (CEST) Message-ID: <4FD2369D.6040503@FreeBSD.org> Date: Fri, 08 Jun 2012 19:30:05 +0200 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120410 Thunderbird/13.0a2 MIME-Version: 1.0 To: Dimitry Andric References: <201206081708.q58H8RRw072192@svn.freebsd.org> In-Reply-To: <201206081708.q58H8RRw072192@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 Subject: Re: svn commit: r236759 - head/usr.bin/sort X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 17:30:17 -0000 On 2012.06.08. 19:08, Dimitry Andric wrote: > In usr.bin/sort, use another method of silencing warnings about unused > arguments, which does not trigger self-assignment warnings in certain > circumstances (for example, using clang with ccache). > > MFC after: 3 days > > Modified: > head/usr.bin/sort/sort.h > > Modified: head/usr.bin/sort/sort.h > ============================================================================== > --- head/usr.bin/sort/sort.h Fri Jun 8 16:16:03 2012 (r236758) > +++ head/usr.bin/sort/sort.h Fri Jun 8 17:08:27 2012 (r236759) > @@ -41,7 +41,7 @@ > > #define VERSION "2.3-FreeBSD" > > -#define UNUSED_ARG(A) do { A=A; } while(0) > +#define UNUSED_ARG(A) do { (void)(A); } while(0) My fault, I should have fixed this. But what about this version? I think it is more elegant and this is how it should have been done initially: Index: coll.c =================================================================== --- coll.c (revision 236759) +++ coll.c (working copy) @@ -792,7 +792,8 @@ * Implements numeric sort for -n and -h. */ static int -numcoll_impl(struct key_value *kv1, struct key_value *kv2, size_t offset, bool use_suffix) +numcoll_impl(struct key_value *kv1, struct key_value *kv2, + size_t offset __unused, bool use_suffix) { struct bwstring *s1, *s2; wchar_t sfrac1[MAX_NUM_SIZE + 1], sfrac2[MAX_NUM_SIZE + 1]; @@ -810,8 +811,6 @@ cmp_res = 0; key1_read = key2_read = false; - UNUSED_ARG(offset); - if (debug_sort) { bwsprintf(stdout, s1, "; k1=<", ">"); bwsprintf(stdout, s2, ", k2=<", ">"); @@ -968,14 +967,13 @@ * Implements random sort (-R). */ static int -randomcoll(struct key_value *kv1, struct key_value *kv2, size_t offset) +randomcoll(struct key_value *kv1, struct key_value *kv2, + size_t offset __unused) { struct bwstring *s1, *s2; MD5_CTX ctx1, ctx2; char *b1, *b2; - UNUSED_ARG(offset); - s1 = kv1->k; s2 = kv2->k; @@ -1022,12 +1020,11 @@ * Implements version sort (-V). */ static int -versioncoll(struct key_value *kv1, struct key_value *kv2, size_t offset) +versioncoll(struct key_value *kv1, struct key_value *kv2, + size_t offset __unused) { struct bwstring *s1, *s2; - UNUSED_ARG(offset); - s1 = kv1->k; s2 = kv2->k; @@ -1098,7 +1095,7 @@ * Implements general numeric sort (-g). */ static int -gnumcoll(struct key_value *kv1, struct key_value *kv2, size_t offset) +gnumcoll(struct key_value *kv1, struct key_value *kv2, size_t offset __unused) { double d1, d2; int err1, err2; @@ -1108,8 +1105,6 @@ err1 = err2 = 0; key1_read = key2_read = false; - UNUSED_ARG(offset); - if (debug_sort) { bwsprintf(stdout, kv1->k, "; k1=<", ">"); bwsprintf(stdout, kv2->k, "; k2=<", ">"); @@ -1256,7 +1251,7 @@ * Implements month sort (-M). */ static int -monthcoll(struct key_value *kv1, struct key_value *kv2, size_t offset) +monthcoll(struct key_value *kv1, struct key_value *kv2, size_t offset __unused) { int val1, val2; bool key1_read, key2_read; @@ -1264,8 +1259,6 @@ val1 = val2 = 0; key1_read = key2_read = false; - UNUSED_ARG(offset); - if (debug_sort) { bwsprintf(stdout, kv1->k, "; k1=<", ">"); bwsprintf(stdout, kv2->k, "; k2=<", ">"); Index: sort.h =================================================================== --- sort.h (revision 236759) +++ sort.h (working copy) @@ -41,8 +41,6 @@ #define VERSION "2.3-FreeBSD" -#define UNUSED_ARG(A) do { (void)(A); } while(0) - #ifdef WITHOUT_NLS #define getstr(n) nlsstr[n] #else Gabor From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 18:32:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9557E106566C; Fri, 8 Jun 2012 18:32:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F2D88FC08; Fri, 8 Jun 2012 18:32:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58IWAgi076130; Fri, 8 Jun 2012 18:32:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58IWA1w076126; Fri, 8 Jun 2012 18:32:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206081832.q58IWA1w076126@svn.freebsd.org> From: John Baldwin Date: Fri, 8 Jun 2012 18:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236762 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 18:32:10 -0000 Author: jhb Date: Fri Jun 8 18:32:09 2012 New Revision: 236762 URL: http://svn.freebsd.org/changeset/base/236762 Log: Split the second half of vn_open_cred() (after a vnode has been found via a lookup or created via VOP_CREATE()) into a new vn_open_vnode() function and use this function in fhopen() instead of duplicating code from vn_open_cred() directly. Tested by: pho Reviewed by: kib MFC after: 2 weeks Modified: head/sys/kern/vfs_syscalls.c head/sys/kern/vfs_vnops.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Fri Jun 8 18:11:21 2012 (r236761) +++ head/sys/kern/vfs_syscalls.c Fri Jun 8 18:32:09 2012 (r236762) @@ -4484,17 +4484,12 @@ sys_fhopen(td, uap) int flags; } */ *uap; { - struct proc *p = td->td_proc; struct mount *mp; struct vnode *vp; struct fhandle fhp; - struct vattr vat; - struct vattr *vap = &vat; struct flock lf; struct file *fp; - register struct filedesc *fdp = p->p_fd; int fmode, error, type; - accmode_t accmode; struct file *nfp; int vfslocked; int indx; @@ -4502,6 +4497,7 @@ sys_fhopen(td, uap) error = priv_check(td, PRIV_VFS_FHOPEN); if (error) return (error); + indx = -1; fmode = FFLAGS(uap->flags); /* why not allow a non-read/write open for our lockd? */ if (((fmode & (FREAD | FWRITE)) == 0) || (fmode & O_CREAT)) @@ -4517,109 +4513,40 @@ sys_fhopen(td, uap) /* now give me my vnode, it gets returned to me locked */ error = VFS_FHTOVP(mp, &fhp.fh_fid, LK_EXCLUSIVE, &vp); vfs_unbusy(mp); - if (error) - goto out; - /* - * from now on we have to make sure not - * to forget about the vnode - * any error that causes an abort must vput(vp) - * just set error = err and 'goto bad;'. - */ - - /* - * from vn_open - */ - if (vp->v_type == VLNK) { - error = EMLINK; - goto bad; - } - if (vp->v_type == VSOCK) { - error = EOPNOTSUPP; - goto bad; - } - if (vp->v_type != VDIR && fmode & O_DIRECTORY) { - error = ENOTDIR; - goto bad; - } - accmode = 0; - if (fmode & (FWRITE | O_TRUNC)) { - if (vp->v_type == VDIR) { - error = EISDIR; - goto bad; - } - error = vn_writechk(vp); - if (error) - goto bad; - accmode |= VWRITE; - } - if (fmode & FREAD) - accmode |= VREAD; - if ((fmode & O_APPEND) && (fmode & FWRITE)) - accmode |= VAPPEND; -#ifdef MAC - error = mac_vnode_check_open(td->td_ucred, vp, accmode); - if (error) - goto bad; -#endif - if (accmode) { - error = VOP_ACCESS(vp, accmode, td->td_ucred, td); - if (error) - goto bad; - } - if (fmode & O_TRUNC) { - vfs_ref(mp); - VOP_UNLOCK(vp, 0); /* XXX */ - if ((error = vn_start_write(NULL, &mp, V_WAIT | PCATCH)) != 0) { - vrele(vp); - vfs_rel(mp); - goto out; - } - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); /* XXX */ - vfs_rel(mp); -#ifdef MAC - /* - * We don't yet have fp->f_cred, so use td->td_ucred, which - * should be right. - */ - error = mac_vnode_check_write(td->td_ucred, td->td_ucred, vp); - if (error == 0) { -#endif - VATTR_NULL(vap); - vap->va_size = 0; - error = VOP_SETATTR(vp, vap, td->td_ucred); -#ifdef MAC - } -#endif - vn_finished_write(mp); - if (error) - goto bad; + if (error) { + VFS_UNLOCK_GIANT(vfslocked); + return (error); } - error = VOP_OPEN(vp, fmode, td->td_ucred, td, NULL); - if (error) - goto bad; - if (fmode & FWRITE) { - vp->v_writecount++; - CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d", - __func__, vp, vp->v_writecount); - } + error = falloc_noinstall(td, &nfp); + if (error) { + vput(vp); + VFS_UNLOCK_GIANT(vfslocked); + return (error); + } - /* - * end of vn_open code - */ + /* An extra reference on `nfp' has been held for us by falloc(). */ + fp = nfp; +#ifdef INVARIANTS + td->td_dupfd = -1; +#endif + error = vn_open_vnode(vp, fmode, td->td_ucred, td, fp); + if (error) { + KASSERT(fp->f_ops == &badfileops, + ("VOP_OPEN in fhopen() set f_ops")); + KASSERT(td->td_dupfd < 0, + ("fhopen() encountered fdopen()")); - if ((error = falloc(td, &nfp, &indx, fmode)) != 0) { - if (fmode & FWRITE) { - vp->v_writecount--; - CTR3(KTR_VFS, "%s: vp %p v_writecount decreased to %d", - __func__, vp, vp->v_writecount); - } + vput(vp); goto bad; } - /* An extra reference on `nfp' has been held for us by falloc(). */ - fp = nfp; - nfp->f_vnode = vp; - finit(nfp, fmode & FMASK, DTYPE_VNODE, vp, &vnops); +#ifdef INVARIANTS + td->td_dupfd = 0; +#endif + fp->f_vnode = vp; + fp->f_seqcount = 1; + finit(fp, fmode & FMASK, DTYPE_VNODE, vp, &vnops); + VOP_UNLOCK(vp, 0); if (fmode & (O_EXLOCK | O_SHLOCK)) { lf.l_whence = SEEK_SET; lf.l_start = 0; @@ -4631,36 +4558,22 @@ sys_fhopen(td, uap) type = F_FLOCK; if ((fmode & FNONBLOCK) == 0) type |= F_WAIT; - VOP_UNLOCK(vp, 0); if ((error = VOP_ADVLOCK(vp, (caddr_t)fp, F_SETLK, &lf, - type)) != 0) { - /* - * The lock request failed. Normally close the - * descriptor but handle the case where someone might - * have dup()d or close()d it when we weren't looking. - */ - fdclose(fdp, fp, indx, td); - - /* - * release our private reference - */ - fdrop(fp, td); - goto out; - } - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + type)) != 0) + goto bad; atomic_set_int(&fp->f_flag, FHASLOCK); } + if (fmode & O_TRUNC) { + error = fo_truncate(fp, 0, td->td_ucred, td); + if (error) + goto bad; + } - VOP_UNLOCK(vp, 0); - fdrop(fp, td); - VFS_UNLOCK_GIANT(vfslocked); - td->td_retval[0] = indx; - return (0); - + error = finstall(td, fp, &indx, fmode); bad: - vput(vp); -out: VFS_UNLOCK_GIANT(vfslocked); + fdrop(fp, td); + td->td_retval[0] = indx; return (error); } Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Fri Jun 8 18:11:21 2012 (r236761) +++ head/sys/kern/vfs_vnops.c Fri Jun 8 18:32:09 2012 (r236762) @@ -108,7 +108,8 @@ vn_open(ndp, flagp, cmode, fp) } /* - * Common code for vnode open operations. + * Common code for vnode open operations via a name lookup. + * Lookup the vnode and invoke VOP_CREATE if needed. * Check permissions, and call the VOP_OPEN or VOP_CREATE routine. * * Note that this does NOT free nameidata for the successful case, @@ -124,7 +125,6 @@ vn_open_cred(struct nameidata *ndp, int struct vattr vat; struct vattr *vap = &vat; int fmode, error; - accmode_t accmode; int vfslocked, mpsafe; mpsafe = ndp->ni_cnd.cn_flags & MPSAFE; @@ -205,24 +205,44 @@ restart: vfslocked = NDHASGIANT(ndp); vp = ndp->ni_vp; } - if (vp->v_type == VLNK) { - error = EMLINK; - goto bad; - } - if (vp->v_type == VSOCK) { - error = EOPNOTSUPP; - goto bad; - } - if (vp->v_type != VDIR && fmode & O_DIRECTORY) { - error = ENOTDIR; + error = vn_open_vnode(vp, fmode, cred, td, fp); + if (error) goto bad; - } + *flagp = fmode; + if (!mpsafe) + VFS_UNLOCK_GIANT(vfslocked); + return (0); +bad: + NDFREE(ndp, NDF_ONLY_PNBUF); + vput(vp); + VFS_UNLOCK_GIANT(vfslocked); + *flagp = fmode; + ndp->ni_vp = NULL; + return (error); +} + +/* + * Common code for vnode open operations once a vnode is located. + * Check permissions, and call the VOP_OPEN routine. + */ +int +vn_open_vnode(struct vnode *vp, int fmode, struct ucred *cred, + struct thread *td, struct file *fp) +{ + accmode_t accmode; + int error; + + VFS_ASSERT_GIANT(vp->v_mount); + if (vp->v_type == VLNK) + return (EMLINK); + if (vp->v_type == VSOCK) + return (EOPNOTSUPP); + if (vp->v_type != VDIR && fmode & O_DIRECTORY) + return (ENOTDIR); accmode = 0; if (fmode & (FWRITE | O_TRUNC)) { - if (vp->v_type == VDIR) { - error = EISDIR; - goto bad; - } + if (vp->v_type == VDIR) + return (EISDIR); accmode |= VWRITE; } if (fmode & FREAD) @@ -234,40 +254,30 @@ restart: #ifdef MAC error = mac_vnode_check_open(cred, vp, accmode); if (error) - goto bad; + return (error); #endif if ((fmode & O_CREAT) == 0) { if (accmode & VWRITE) { error = vn_writechk(vp); if (error) - goto bad; + return (error); } if (accmode) { error = VOP_ACCESS(vp, accmode, cred, td); if (error) - goto bad; + return (error); } } if ((error = VOP_OPEN(vp, fmode, cred, td, fp)) != 0) - goto bad; + return (error); if (fmode & FWRITE) { vp->v_writecount++; CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d", __func__, vp, vp->v_writecount); } - *flagp = fmode; - ASSERT_VOP_LOCKED(vp, "vn_open_cred"); - if (!mpsafe) - VFS_UNLOCK_GIANT(vfslocked); + ASSERT_VOP_LOCKED(vp, "vn_open_vnode"); return (0); -bad: - NDFREE(ndp, NDF_ONLY_PNBUF); - vput(vp); - VFS_UNLOCK_GIANT(vfslocked); - *flagp = fmode; - ndp->ni_vp = NULL; - return (error); } /* Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Fri Jun 8 18:11:21 2012 (r236761) +++ head/sys/sys/vnode.h Fri Jun 8 18:32:09 2012 (r236762) @@ -654,6 +654,8 @@ int _vn_lock(struct vnode *vp, int flags int vn_open(struct nameidata *ndp, int *flagp, int cmode, struct file *fp); int vn_open_cred(struct nameidata *ndp, int *flagp, int cmode, u_int vn_open_flags, struct ucred *cred, struct file *fp); +int vn_open_vnode(struct vnode *vp, int fmode, struct ucred *cred, + struct thread *td, struct file *fp); void vn_pages_remove(struct vnode *vp, vm_pindex_t start, vm_pindex_t end); int vn_pollrecord(struct vnode *vp, struct thread *p, int events); int vn_rdwr(enum uio_rw rw, struct vnode *vp, void *base, From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 18:48:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDEBA106566B; Fri, 8 Jun 2012 18:48:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id A1ED38FC1A; Fri, 8 Jun 2012 18:48:43 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:6c85:f675:d0b9:5b63] (unknown [IPv6:2001:7b8:3a7:0:6c85:f675:d0b9:5b63]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 36B565C37; Fri, 8 Jun 2012 20:48:37 +0200 (CEST) Message-ID: <4FD24906.8080209@FreeBSD.org> Date: Fri, 08 Jun 2012 20:48:38 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120529 Thunderbird/13.0 MIME-Version: 1.0 To: Gabor Kovesdan References: <201206081708.q58H8RRw072192@svn.freebsd.org> <4FD2369D.6040503@FreeBSD.org> In-Reply-To: <4FD2369D.6040503@FreeBSD.org> X-Enigmail-Version: 1.5a1pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r236759 - head/usr.bin/sort X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 18:48:44 -0000 On 2012-06-08 19:30, Gabor Kovesdan wrote: > On 2012.06.08. 19:08, Dimitry Andric wrote: ... >> -#define UNUSED_ARG(A) do { A=A; } while(0) >> +#define UNUSED_ARG(A) do { (void)(A); } while(0) > My fault, I should have fixed this. But what about this version? I think > it is more elegant and this is how it should have been done initially: No worries, I just used the least disruptive way of fixing it. Note that it also only occurs specifically when you compile with -save-temps or with ccache, which does preprocessing and compiling separately. Your new diff looks good to me. Though please attach diffs next time, for some reason your mail client (or mine) badly mangled the tabs, and it was tricky to apply. :) From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 19:21:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A157F106564A; Fri, 8 Jun 2012 19:21:49 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D1538FC0A; Fri, 8 Jun 2012 19:21:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58JLn0P078366; Fri, 8 Jun 2012 19:21:49 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58JLn0R078363; Fri, 8 Jun 2012 19:21:49 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201206081921.q58JLn0R078363@svn.freebsd.org> From: Gabor Kovesdan Date: Fri, 8 Jun 2012 19:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236764 - head/usr.bin/sort X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 19:21:49 -0000 Author: gabor Date: Fri Jun 8 19:21:49 2012 New Revision: 236764 URL: http://svn.freebsd.org/changeset/base/236764 Log: - Remove the UNUSED_ARG macro and use __unused in argument lists Reviewed by: dim MFC after: 3 days Modified: head/usr.bin/sort/coll.c head/usr.bin/sort/sort.h Modified: head/usr.bin/sort/coll.c ============================================================================== --- head/usr.bin/sort/coll.c Fri Jun 8 18:44:54 2012 (r236763) +++ head/usr.bin/sort/coll.c Fri Jun 8 19:21:49 2012 (r236764) @@ -792,7 +792,8 @@ cmpsuffix(unsigned char si1, unsigned ch * Implements numeric sort for -n and -h. */ static int -numcoll_impl(struct key_value *kv1, struct key_value *kv2, size_t offset, bool use_suffix) +numcoll_impl(struct key_value *kv1, struct key_value *kv2, + size_t offset __unused, bool use_suffix) { struct bwstring *s1, *s2; wchar_t sfrac1[MAX_NUM_SIZE + 1], sfrac2[MAX_NUM_SIZE + 1]; @@ -810,8 +811,6 @@ numcoll_impl(struct key_value *kv1, stru cmp_res = 0; key1_read = key2_read = false; - UNUSED_ARG(offset); - if (debug_sort) { bwsprintf(stdout, s1, "; k1=<", ">"); bwsprintf(stdout, s2, ", k2=<", ">"); @@ -968,14 +967,13 @@ hnumcoll(struct key_value *kv1, struct k * Implements random sort (-R). */ static int -randomcoll(struct key_value *kv1, struct key_value *kv2, size_t offset) +randomcoll(struct key_value *kv1, struct key_value *kv2, + size_t offset __unused) { struct bwstring *s1, *s2; MD5_CTX ctx1, ctx2; char *b1, *b2; - UNUSED_ARG(offset); - s1 = kv1->k; s2 = kv2->k; @@ -1022,12 +1020,11 @@ randomcoll(struct key_value *kv1, struct * Implements version sort (-V). */ static int -versioncoll(struct key_value *kv1, struct key_value *kv2, size_t offset) +versioncoll(struct key_value *kv1, struct key_value *kv2, + size_t offset __unused) { struct bwstring *s1, *s2; - UNUSED_ARG(offset); - s1 = kv1->k; s2 = kv2->k; @@ -1098,7 +1095,8 @@ cmp_nans(double d1, double d2) * Implements general numeric sort (-g). */ static int -gnumcoll(struct key_value *kv1, struct key_value *kv2, size_t offset) +gnumcoll(struct key_value *kv1, struct key_value *kv2, + size_t offset __unused) { double d1, d2; int err1, err2; @@ -1108,8 +1106,6 @@ gnumcoll(struct key_value *kv1, struct k err1 = err2 = 0; key1_read = key2_read = false; - UNUSED_ARG(offset); - if (debug_sort) { bwsprintf(stdout, kv1->k, "; k1=<", ">"); bwsprintf(stdout, kv2->k, "; k2=<", ">"); @@ -1256,7 +1252,7 @@ gnumcoll(struct key_value *kv1, struct k * Implements month sort (-M). */ static int -monthcoll(struct key_value *kv1, struct key_value *kv2, size_t offset) +monthcoll(struct key_value *kv1, struct key_value *kv2, size_t offset __unused) { int val1, val2; bool key1_read, key2_read; @@ -1264,8 +1260,6 @@ monthcoll(struct key_value *kv1, struct val1 = val2 = 0; key1_read = key2_read = false; - UNUSED_ARG(offset); - if (debug_sort) { bwsprintf(stdout, kv1->k, "; k1=<", ">"); bwsprintf(stdout, kv2->k, "; k2=<", ">"); Modified: head/usr.bin/sort/sort.h ============================================================================== --- head/usr.bin/sort/sort.h Fri Jun 8 18:44:54 2012 (r236763) +++ head/usr.bin/sort/sort.h Fri Jun 8 19:21:49 2012 (r236764) @@ -41,8 +41,6 @@ #define VERSION "2.3-FreeBSD" -#define UNUSED_ARG(A) do { (void)(A); } while(0) - #ifdef WITHOUT_NLS #define getstr(n) nlsstr[n] #else From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 20:30:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0712B106566C; Fri, 8 Jun 2012 20:30:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E68108FC12; Fri, 8 Jun 2012 20:30:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58KUbx1082284; Fri, 8 Jun 2012 20:30:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58KUbpM082282; Fri, 8 Jun 2012 20:30:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206082030.q58KUbpM082282@svn.freebsd.org> From: Alexander Motin Date: Fri, 8 Jun 2012 20:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236765 - stable/9/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 20:30:38 -0000 Author: mav Date: Fri Jun 8 20:30:37 2012 New Revision: 236765 URL: http://svn.freebsd.org/changeset/base/236765 Log: MFC r235982: Add tunable/sysctl kern.cam.pmp.hide_special, controlling whether special PMP ports such as PMP configuration or SEMB should be exposed or hidden. These ports were always hidden before as useless and sometimes promatic. But with updated ses driver supporting SEMB it is no longer so straight. Keep ports hidden by default to avoid probe request ttimeouts if SEP is not connected to PMP's SEMB via I2C, that is very often situation. Modified: stable/9/sys/cam/ata/ata_pmp.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/9/sys/cam/ata/ata_pmp.c Fri Jun 8 19:21:49 2012 (r236764) +++ stable/9/sys/cam/ata/ata_pmp.c Fri Jun 8 20:30:37 2012 (r236765) @@ -126,8 +126,13 @@ static void pmpdone(struct cam_periph * #define PMP_DEFAULT_RETRY 1 #endif +#ifndef PMP_DEFAULT_HIDE_SPECIAL +#define PMP_DEFAULT_HIDE_SPECIAL 1 +#endif + static int pmp_retry_count = PMP_DEFAULT_RETRY; static int pmp_default_timeout = PMP_DEFAULT_TIMEOUT; +static int pmp_hide_special = PMP_DEFAULT_HIDE_SPECIAL; SYSCTL_NODE(_kern_cam, OID_AUTO, pmp, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); @@ -137,6 +142,9 @@ TUNABLE_INT("kern.cam.pmp.retry_count", SYSCTL_INT(_kern_cam_pmp, OID_AUTO, default_timeout, CTLFLAG_RW, &pmp_default_timeout, 0, "Normal I/O timeout (in seconds)"); TUNABLE_INT("kern.cam.pmp.default_timeout", &pmp_default_timeout); +SYSCTL_INT(_kern_cam_pmp, OID_AUTO, hide_special, CTLFLAG_RW, + &pmp_hide_special, 0, "Hide extra ports"); +TUNABLE_INT("kern.cam.pmp.hide_special", &pmp_hide_special); static struct periph_driver pmpdriver = { @@ -583,23 +591,33 @@ pmpdone(struct cam_periph *periph, union (ataio->res.lba_mid << 16) + (ataio->res.lba_low << 8) + ataio->res.sector_count; - /* This PMP declares 6 ports, while only 5 of them are real. - * Port 5 is enclosure management bridge port, which has implementation - * problems, causing probe faults. Hide it for now. */ - if (softc->pm_pid == 0x37261095 && softc->pm_ports == 6) - softc->pm_ports = 5; - /* This PMP declares 7 ports, while only 5 of them are real. - * Port 5 is some fake "Config Disk" with 640 sectors size, - * port 6 is enclosure management bridge port. - * Both fake ports has implementation problems, causing - * probe faults. Hide them for now. */ - if (softc->pm_pid == 0x47261095 && softc->pm_ports == 7) - softc->pm_ports = 5; - /* These PMPs declare one more port then actually have, - * for configuration purposes. Hide it for now. */ - if (softc->pm_pid == 0x57231095 || softc->pm_pid == 0x57331095 || - softc->pm_pid == 0x57341095 || softc->pm_pid == 0x57441095) - softc->pm_ports--; + if (pmp_hide_special) { + /* + * This PMP declares 6 ports, while only 5 of them + * are real. Port 5 is a SEMB port, probing which + * causes timeouts if external SEP is not connected + * to PMP over I2C. + */ + if (softc->pm_pid == 0x37261095 && softc->pm_ports == 6) + softc->pm_ports = 5; + + /* + * This PMP declares 7 ports, while only 5 of them + * are real. Port 5 is a fake "Config Disk" with + * 640 sectors size. Port 6 is a SEMB port. + */ + if (softc->pm_pid == 0x47261095 && softc->pm_ports == 7) + softc->pm_ports = 5; + + /* + * These PMPs have extra configuration port. + */ + if (softc->pm_pid == 0x57231095 || + softc->pm_pid == 0x57331095 || + softc->pm_pid == 0x57341095 || + softc->pm_pid == 0x57441095) + softc->pm_ports--; + } printf("%s%d: %d fan-out ports\n", periph->periph_name, periph->unit_number, softc->pm_ports); From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 20:32:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B41EE106566C; Fri, 8 Jun 2012 20:32:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F2858FC1B; Fri, 8 Jun 2012 20:32:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58KWBFF082429; Fri, 8 Jun 2012 20:32:11 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58KWBKu082427; Fri, 8 Jun 2012 20:32:11 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206082032.q58KWBKu082427@svn.freebsd.org> From: Alexander Motin Date: Fri, 8 Jun 2012 20:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236766 - stable/8/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 20:32:11 -0000 Author: mav Date: Fri Jun 8 20:32:11 2012 New Revision: 236766 URL: http://svn.freebsd.org/changeset/base/236766 Log: MFC r235982: Add tunable/sysctl kern.cam.pmp.hide_special, controlling whether special PMP ports such as PMP configuration or SEMB should be exposed or hidden. These ports were always hidden before as useless and sometimes promatic. But with updated ses driver supporting SEMB it is no longer so straight. Keep ports hidden by default to avoid probe request ttimeouts if SEP is not connected to PMP's SEMB via I2C, that is very often situation. Modified: stable/8/sys/cam/ata/ata_pmp.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/8/sys/cam/ata/ata_pmp.c Fri Jun 8 20:30:37 2012 (r236765) +++ stable/8/sys/cam/ata/ata_pmp.c Fri Jun 8 20:32:11 2012 (r236766) @@ -126,8 +126,13 @@ static void pmpdone(struct cam_periph * #define PMP_DEFAULT_RETRY 1 #endif +#ifndef PMP_DEFAULT_HIDE_SPECIAL +#define PMP_DEFAULT_HIDE_SPECIAL 1 +#endif + static int pmp_retry_count = PMP_DEFAULT_RETRY; static int pmp_default_timeout = PMP_DEFAULT_TIMEOUT; +static int pmp_hide_special = PMP_DEFAULT_HIDE_SPECIAL; SYSCTL_NODE(_kern_cam, OID_AUTO, pmp, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); @@ -137,6 +142,9 @@ TUNABLE_INT("kern.cam.pmp.retry_count", SYSCTL_INT(_kern_cam_pmp, OID_AUTO, default_timeout, CTLFLAG_RW, &pmp_default_timeout, 0, "Normal I/O timeout (in seconds)"); TUNABLE_INT("kern.cam.pmp.default_timeout", &pmp_default_timeout); +SYSCTL_INT(_kern_cam_pmp, OID_AUTO, hide_special, CTLFLAG_RW, + &pmp_hide_special, 0, "Hide extra ports"); +TUNABLE_INT("kern.cam.pmp.hide_special", &pmp_hide_special); static struct periph_driver pmpdriver = { @@ -583,23 +591,33 @@ pmpdone(struct cam_periph *periph, union (ataio->res.lba_mid << 16) + (ataio->res.lba_low << 8) + ataio->res.sector_count; - /* This PMP declares 6 ports, while only 5 of them are real. - * Port 5 is enclosure management bridge port, which has implementation - * problems, causing probe faults. Hide it for now. */ - if (softc->pm_pid == 0x37261095 && softc->pm_ports == 6) - softc->pm_ports = 5; - /* This PMP declares 7 ports, while only 5 of them are real. - * Port 5 is some fake "Config Disk" with 640 sectors size, - * port 6 is enclosure management bridge port. - * Both fake ports has implementation problems, causing - * probe faults. Hide them for now. */ - if (softc->pm_pid == 0x47261095 && softc->pm_ports == 7) - softc->pm_ports = 5; - /* These PMPs declare one more port then actually have, - * for configuration purposes. Hide it for now. */ - if (softc->pm_pid == 0x57231095 || softc->pm_pid == 0x57331095 || - softc->pm_pid == 0x57341095 || softc->pm_pid == 0x57441095) - softc->pm_ports--; + if (pmp_hide_special) { + /* + * This PMP declares 6 ports, while only 5 of them + * are real. Port 5 is a SEMB port, probing which + * causes timeouts if external SEP is not connected + * to PMP over I2C. + */ + if (softc->pm_pid == 0x37261095 && softc->pm_ports == 6) + softc->pm_ports = 5; + + /* + * This PMP declares 7 ports, while only 5 of them + * are real. Port 5 is a fake "Config Disk" with + * 640 sectors size. Port 6 is a SEMB port. + */ + if (softc->pm_pid == 0x47261095 && softc->pm_ports == 7) + softc->pm_ports = 5; + + /* + * These PMPs have extra configuration port. + */ + if (softc->pm_pid == 0x57231095 || + softc->pm_pid == 0x57331095 || + softc->pm_pid == 0x57341095 || + softc->pm_pid == 0x57441095) + softc->pm_ports--; + } printf("%s%d: %d fan-out ports\n", periph->periph_name, periph->unit_number, softc->pm_ports); From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 20:54:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 118AD106566B; Fri, 8 Jun 2012 20:54:06 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB9FE8FC0C; Fri, 8 Jun 2012 20:54:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58Ks5BW083689; Fri, 8 Jun 2012 20:54:05 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58Ks5jR083686; Fri, 8 Jun 2012 20:54:05 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201206082054.q58Ks5jR083686@svn.freebsd.org> From: Gavin Atkinson Date: Fri, 8 Jun 2012 20:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236767 - stable/8/contrib/ipfilter/man X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 20:54:06 -0000 Author: gavin Date: Fri Jun 8 20:54:05 2012 New Revision: 236767 URL: http://svn.freebsd.org/changeset/base/236767 Log: Merge r215463 from head: Fix paths for example files. PR: docs/140725 Modified: stable/8/contrib/ipfilter/man/ipnat.8 stable/8/contrib/ipfilter/man/mkfilters.1 Directory Properties: stable/8/contrib/ipfilter/ (props changed) Modified: stable/8/contrib/ipfilter/man/ipnat.8 ============================================================================== --- stable/8/contrib/ipfilter/man/ipnat.8 Fri Jun 8 20:32:11 2012 (r236766) +++ stable/8/contrib/ipfilter/man/ipnat.8 Fri Jun 8 20:54:05 2012 (r236767) @@ -66,6 +66,6 @@ and active rules/table entries. .SH FILES /dev/ipnat .br -/usr/share/examples/ipf Directory with examples. +/usr/share/examples/ipfilter Directory with examples. .SH SEE ALSO ipnat(5), ipf(8), ipfstat(8) Modified: stable/8/contrib/ipfilter/man/mkfilters.1 ============================================================================== --- stable/8/contrib/ipfilter/man/mkfilters.1 Fri Jun 8 20:32:11 2012 (r236766) +++ stable/8/contrib/ipfilter/man/mkfilters.1 Fri Jun 8 20:54:05 2012 (r236767) @@ -6,7 +6,7 @@ mkfilters \- generate a minimal firewall .SH SYNOPSIS .B mkfilters .SH FILES -/usr/share/examples/ipf/mkfilters +/usr/share/examples/ipfilter/mkfilters .SH DESCRIPTION .PP \fBmkfilters\fP is a perl script that generates a minimal filter rule set for From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 21:30:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 80D2C106566B; Fri, 8 Jun 2012 21:30:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B8398FC16; Fri, 8 Jun 2012 21:30:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58LUaEo085677; Fri, 8 Jun 2012 21:30:36 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58LUaPx085675; Fri, 8 Jun 2012 21:30:36 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206082130.q58LUaPx085675@svn.freebsd.org> From: John Baldwin Date: Fri, 8 Jun 2012 21:30:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236768 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 21:30:36 -0000 Author: jhb Date: Fri Jun 8 21:30:35 2012 New Revision: 236768 URL: http://svn.freebsd.org/changeset/base/236768 Log: Several updates: - Consistently refer to rmlocks as "read-mostly locks". - Relate rmlocks to rwlocks rather than sx locks since they are closer to rwlocks. - Add a separate paragraph on sleepable read-mostly locks contrasting them with "normal" read-mostly locks. - The flag passed to rm_init_flags() to enable recursion for readers is RM_RECURSE, not LO_RECURSABLE. - Fix the description for RM_RECURSE (it allows readers to recurse, not writers). - Explicitly note that rm_try_rlock() honors RM_RECURSE. - Fix some minor grammar nits. Modified: head/share/man/man9/rmlock.9 Modified: head/share/man/man9/rmlock.9 ============================================================================== --- head/share/man/man9/rmlock.9 Fri Jun 8 20:54:05 2012 (r236767) +++ head/share/man/man9/rmlock.9 Fri Jun 8 21:30:35 2012 (r236768) @@ -26,7 +26,7 @@ .\" $FreeBSD$ .\" .\" Based on rwlock.9 man page -.Dd November 16, 2011 +.Dd June 8, 2012 .Dt RMLOCK 9 .Os .Sh NAME @@ -41,7 +41,7 @@ .Nm rm_wunlock , .Nm rm_wowned , .Nm RM_SYSINIT -.Nd kernel reader/writer lock optimized for mostly read access patterns +.Nd kernel reader/writer lock optimized for read-mostly access patterns .Sh SYNOPSIS .In sys/param.h .In sys/lock.h @@ -67,7 +67,7 @@ .In sys/kernel.h .Fn RM_SYSINIT "name" "struct rmlock *rm" "const char *desc" "int opts" .Sh DESCRIPTION -Mostly reader locks allow shared access to protected data by multiple threads, +Read-mostly locks allow shared access to protected data by multiple threads, or exclusive access by a single thread. The threads with shared access are known as .Em readers @@ -76,83 +76,82 @@ A thread with exclusive access is known .Em writer since it can modify protected data. .Pp -Read mostly locks are designed to be efficient for locks almost exclusively +Read-mostly locks are designed to be efficient for locks almost exclusively used as reader locks and as such should be used for protecting data that rarely changes. -Acquiring an exclusive lock after the lock had been locked for shared access +Acquiring an exclusive lock after the lock has been locked for shared access is an expensive operation. .Pp -Although reader/writer locks look very similar to -.Xr sx 9 -locks, their usage pattern is different. -Reader/writer locks can be treated as mutexes (see -.Xr mutex 9 ) -with shared/exclusive semantics unless initialized with -.Dv RM_SLEEPABLE . +Normal read-mostly locks are similar to +.Xr rwlock 9 +locks and follow the same lock ordering rules as +.Xr rwlock 9 +locks. +Read-mostly locks have full priority propagation like mutexes. Unlike -.Xr sx 9 , -an -.Nm -can be locked while holding a non-spin mutex, and an -.Nm -cannot be held while sleeping, again unless initialized with -.Dv RM_SLEEPABLE . -The -.Nm -locks have full priority propagation like mutexes. -The +.Xr rwlock 9 , +read-mostly locks propagate priority to both readers and writers. +This is implemented via the .Va rm_priotracker -structure argument supplied in +structure argument supplied to .Fn rm_rlock and -.Fn rm_runlock -is used to keep track of the read owner(s). -Another important property is that shared holders of -.Nm -can recurse if the lock has been initialized with the -.Dv LO_RECURSABLE -option, however exclusive locks are not allowed to recurse. +.Fn rm_runlock . +Readers can recurse if the lock is initialized with the +.Dv RM_RECURSE +option; +however, writers are never allowed to recurse. +.Pp +Sleepable read-mostly locks are created by passing +.Dv RM_SLEEPABLE +to +.Fn rm_init_flags . +Unlike normal read-mostly locks, +sleepable read-mostly locks follow the same lock ordering rules as +.Xr sx 9 +locks. +Sleepable read-mostly locks do not propagate priority to writers, +but they do propagate priority to readers. +Writers are permitted to sleep while holding a read-mostly lock, +but readers are not. +Unlike other sleepable locks such as +.Xr sx 9 +locks, +readers must use try operations on other sleepable locks to avoid sleeping. .Ss Macros and Functions .Bl -tag -width indent .It Fn rm_init "struct rmlock *rm" "const char *name" -Initialize structure located at -.Fa rm -as mostly reader lock, described by -.Fa name . -The name description is used solely for debugging purposes. +Initialize the read-mostly lock +.Fa rm . +The +.Fa name +description is used solely for debugging purposes. This function must be called before any other operations on the lock. .It Fn rm_init_flags "struct rmlock *rm" "const char *name" "int opts" -Initialize the rm lock just like the -.Fn rm_init -function, but specifying a set of optional flags to alter the -behaviour of -.Fa rm , -through the +Similar to +.Fn rm_init , +initialize the read-mostly lock +.Fa rm +with a set of optional flags. +The .Fa opts -argument. -It contains one or more of the following flags: +arguments contains one or more of the following flags: .Bl -tag -width ".Dv RM_NOWITNESS" .It Dv RM_NOWITNESS Instruct .Xr witness 4 to ignore this lock. .It Dv RM_RECURSE -Allow threads to recursively acquire exclusive locks for +Allow threads to recursively acquire shared locks for .Fa rm . .It Dv RM_SLEEPABLE -Allow writers to sleep while holding the lock. -Readers must not sleep while holding the lock and can avoid to sleep on -taking the lock by using -.Fn rm_try_rlock -instead of -.Fn rm_rlock . +Create a sleepable read-mostly lock. .El .It Fn rm_rlock "struct rmlock *rm" "struct rm_priotracker* tracker" Lock .Fa rm -as a reader. -Using +as a reader using .Fa tracker to track read owners of a lock for priority propagation. This data structure is only used internally by @@ -161,28 +160,32 @@ and must persist until .Fn rm_runlock has been called. This data structure can be allocated on the stack since -rmlocks cannot be held while sleeping. +readers cannot sleep. If any thread holds this lock exclusively, the current thread blocks, and its priority is propagated to the exclusive holder. If the lock was initialized with the -.Dv LO_RECURSABLE +.Dv RM_RECURSE option the .Fn rm_rlock -function can be called when the thread has already acquired reader +function can be called when the current thread has already acquired reader access on .Fa rm . -This is called -.Dq "recursing on a lock" . .It Fn rm_try_rlock "struct rmlock *rm" "struct rm_priotracker* tracker" Try to lock .Fa rm as a reader. .Fn rm_try_rlock will return 0 if the lock cannot be acquired immediately; -otherwise the lock will be acquired and a non-zero value will be returned. +otherwise, +the lock will be acquired and a non-zero value will be returned. Note that .Fn rm_try_rlock may fail even while the lock is not currently held by a writer. +If the lock was initialized with the +.Dv RM_RECURSE +option, +.Fn rm_try_rlock +will succeed if the current thread has already acquired reader access. .It Fn rm_wlock "struct rmlock *rm" Lock .Fa rm From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 21:57:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB0051065670; Fri, 8 Jun 2012 21:57:37 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D30698FC12; Fri, 8 Jun 2012 21:57:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58LvbsQ087156; Fri, 8 Jun 2012 21:57:37 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58Lvbtn087153; Fri, 8 Jun 2012 21:57:37 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201206082157.q58Lvbtn087153@svn.freebsd.org> From: "David E. O'Brien" Date: Fri, 8 Jun 2012 21:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236769 - in vendor/NetBSD/bmake: . dist dist/PSD.doc dist/lst.lib dist/unit-tests X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 21:57:38 -0000 Author: obrien Date: Fri Jun 8 21:57:36 2012 New Revision: 236769 URL: http://svn.freebsd.org/changeset/base/236769 Log: Import the 6-May-2012 release of the "Portable" BSD make tool (from NetBSD). Submitted by: sjg@juniper.net Added: vendor/NetBSD/bmake/ vendor/NetBSD/bmake/dist/ vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/FILES vendor/NetBSD/bmake/dist/Makefile.in (contents, props changed) vendor/NetBSD/bmake/dist/PSD.doc/ vendor/NetBSD/bmake/dist/PSD.doc/Makefile (contents, props changed) vendor/NetBSD/bmake/dist/PSD.doc/tutorial.ms vendor/NetBSD/bmake/dist/README vendor/NetBSD/bmake/dist/aclocal.m4 vendor/NetBSD/bmake/dist/arch.c (contents, props changed) vendor/NetBSD/bmake/dist/bmake.1 (contents, props changed) vendor/NetBSD/bmake/dist/bmake.cat1 vendor/NetBSD/bmake/dist/boot-strap (contents, props changed) vendor/NetBSD/bmake/dist/bsd.after-import.mk (contents, props changed) vendor/NetBSD/bmake/dist/buf.c (contents, props changed) vendor/NetBSD/bmake/dist/buf.h (contents, props changed) vendor/NetBSD/bmake/dist/compat.c (contents, props changed) vendor/NetBSD/bmake/dist/cond.c (contents, props changed) vendor/NetBSD/bmake/dist/config.h.in (contents, props changed) vendor/NetBSD/bmake/dist/configure (contents, props changed) vendor/NetBSD/bmake/dist/configure.in (contents, props changed) vendor/NetBSD/bmake/dist/dir.c (contents, props changed) vendor/NetBSD/bmake/dist/dir.h (contents, props changed) vendor/NetBSD/bmake/dist/dirname.c (contents, props changed) vendor/NetBSD/bmake/dist/find_lib.sh (contents, props changed) vendor/NetBSD/bmake/dist/for.c (contents, props changed) vendor/NetBSD/bmake/dist/getopt.c (contents, props changed) vendor/NetBSD/bmake/dist/hash.c (contents, props changed) vendor/NetBSD/bmake/dist/hash.h (contents, props changed) vendor/NetBSD/bmake/dist/install-sh (contents, props changed) vendor/NetBSD/bmake/dist/job.c (contents, props changed) vendor/NetBSD/bmake/dist/job.h (contents, props changed) vendor/NetBSD/bmake/dist/lst.h (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/ vendor/NetBSD/bmake/dist/lst.lib/Makefile (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstAppend.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstAtEnd.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstAtFront.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstClose.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstConcat.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstDatum.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstDeQueue.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstDestroy.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstDupl.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstEnQueue.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstFind.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstFindFrom.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstFirst.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstForEach.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstForEachFrom.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstInit.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstInsert.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstInt.h (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstIsAtEnd.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstIsEmpty.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstLast.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstMember.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstNext.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstOpen.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstPrev.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstRemove.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstReplace.c (contents, props changed) vendor/NetBSD/bmake/dist/lst.lib/lstSucc.c (contents, props changed) vendor/NetBSD/bmake/dist/machine.sh (contents, props changed) vendor/NetBSD/bmake/dist/main.c (contents, props changed) vendor/NetBSD/bmake/dist/make-bootstrap.sh.in (contents, props changed) vendor/NetBSD/bmake/dist/make-conf.h (contents, props changed) vendor/NetBSD/bmake/dist/make.1 (contents, props changed) vendor/NetBSD/bmake/dist/make.c (contents, props changed) vendor/NetBSD/bmake/dist/make.h (contents, props changed) vendor/NetBSD/bmake/dist/make_malloc.c (contents, props changed) vendor/NetBSD/bmake/dist/make_malloc.h (contents, props changed) vendor/NetBSD/bmake/dist/meta.c (contents, props changed) vendor/NetBSD/bmake/dist/meta.h (contents, props changed) vendor/NetBSD/bmake/dist/mkdeps.sh (contents, props changed) vendor/NetBSD/bmake/dist/nonints.h (contents, props changed) vendor/NetBSD/bmake/dist/os.sh (contents, props changed) vendor/NetBSD/bmake/dist/parse.c (contents, props changed) vendor/NetBSD/bmake/dist/pathnames.h (contents, props changed) vendor/NetBSD/bmake/dist/ranlib.h (contents, props changed) vendor/NetBSD/bmake/dist/realpath.c (contents, props changed) vendor/NetBSD/bmake/dist/setenv.c (contents, props changed) vendor/NetBSD/bmake/dist/sigcompat.c (contents, props changed) vendor/NetBSD/bmake/dist/sprite.h (contents, props changed) vendor/NetBSD/bmake/dist/str.c (contents, props changed) vendor/NetBSD/bmake/dist/stresep.c (contents, props changed) vendor/NetBSD/bmake/dist/strlcpy.c (contents, props changed) vendor/NetBSD/bmake/dist/strlist.c (contents, props changed) vendor/NetBSD/bmake/dist/strlist.h (contents, props changed) vendor/NetBSD/bmake/dist/suff.c (contents, props changed) vendor/NetBSD/bmake/dist/targ.c (contents, props changed) vendor/NetBSD/bmake/dist/trace.c (contents, props changed) vendor/NetBSD/bmake/dist/trace.h (contents, props changed) vendor/NetBSD/bmake/dist/unit-tests/ vendor/NetBSD/bmake/dist/unit-tests/Makefile.in (contents, props changed) vendor/NetBSD/bmake/dist/unit-tests/comment vendor/NetBSD/bmake/dist/unit-tests/cond1 vendor/NetBSD/bmake/dist/unit-tests/doterror vendor/NetBSD/bmake/dist/unit-tests/dotwait vendor/NetBSD/bmake/dist/unit-tests/error vendor/NetBSD/bmake/dist/unit-tests/export vendor/NetBSD/bmake/dist/unit-tests/export-all vendor/NetBSD/bmake/dist/unit-tests/forsubst vendor/NetBSD/bmake/dist/unit-tests/hash vendor/NetBSD/bmake/dist/unit-tests/misc vendor/NetBSD/bmake/dist/unit-tests/moderrs vendor/NetBSD/bmake/dist/unit-tests/modmatch vendor/NetBSD/bmake/dist/unit-tests/modmisc vendor/NetBSD/bmake/dist/unit-tests/modorder vendor/NetBSD/bmake/dist/unit-tests/modts vendor/NetBSD/bmake/dist/unit-tests/modword vendor/NetBSD/bmake/dist/unit-tests/phony-end vendor/NetBSD/bmake/dist/unit-tests/posix vendor/NetBSD/bmake/dist/unit-tests/qequals vendor/NetBSD/bmake/dist/unit-tests/sysv vendor/NetBSD/bmake/dist/unit-tests/ternary vendor/NetBSD/bmake/dist/unit-tests/test.exp vendor/NetBSD/bmake/dist/unit-tests/unexport vendor/NetBSD/bmake/dist/unit-tests/unexport-env vendor/NetBSD/bmake/dist/unit-tests/varcmd vendor/NetBSD/bmake/dist/util.c (contents, props changed) vendor/NetBSD/bmake/dist/var.c (contents, props changed) vendor/NetBSD/bmake/dist/wait.h (contents, props changed) vendor/NetBSD/bmake/do-update.sh (contents, props changed) Added: vendor/NetBSD/bmake/dist/ChangeLog ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/bmake/dist/ChangeLog Fri Jun 8 21:57:36 2012 (r236769) @@ -0,0 +1,1346 @@ +2012-06-06 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20120606 + Merge with NetBSD make, pick up + o compat.c: use kill(2) rather than raise(3). + * configure.in: look for sys/dev/filemon + * bsd.after-import.mk: add a .-include "Makefile.inc" to Makefile + and pass BOOTSTRAP_XTRAS to boot-strap. + +2012-06-04 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20120604 + Merge with NetBSD make, pick up + o util.c and var.c share same var for tracking if environ + has been reallocated. + o util.c provide getenv with setenv. + * Add MAKE_LEVEL_SAFE as an alternate means of passing MAKE_LEVEL + when the shell actively strips .MAKE.* from the environment. + We still refer to the variable always as .MAKE.LEVEL + * util.c fix bug in findenv() was finding prefix of name. + * compat.c: re-raising SIGINT etc after running .INTERRUPT + results in more reliable termination of all activity on many + platforms. + +2012-06-02 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20120602 + Merge with NetBSD make, pick up + o for.c: handle quoted items in .for list + +2012-05-30 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20120530 + Merge with NetBSD make, pick up + o compat.c: ignore empty command. + +2012-05-24 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20120524 + * FILES: add bsd.after-import.mk: + A simple means of integrating bmake into a BSD build system. + +2012-05-20 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20120520 + Merge with NetBSD make, pick up + o increased limit for nested conditionals. + +2012-05-18 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20120518 + Merge with NetBSD make, pick up + o use _exit(2) in signal hanlder + o Don't use the [dir] cache when building nodes that might have + changed since the last exec. + o Avoid nested extern declaration warnings. + +2012-04-27 Simon J. Gerraty + + * meta.c (fgetLine): avoid %z - not portable. + * parse.c: Since we moved include of sys/mman.h + and def's of MAP_COPY etc. we got dups from a merge. + +2012-04-24 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20120420 + Merge with NetBSD make, pick up + o restore duplicate supression in .MAKE.MAKEFILES + runtime saving can be significant. + o Var_Subst() uses Buf_DestroyCompact() to reduce memory + consumption up to 20%. + +2012-04-20 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20120420 + Merge with NetBSD make, pick up + o remove duplicate supression in .MAKE.MAKEFILES + o improved dir cache behavior + o gmake'ish export command + +2012-03-25 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20120325 + Merge with NetBSD make, pick up + o fix parsing of :[#] in conditionals. + +2012-02-10 Simon J. Gerraty + + * Makefile.in: replace use of .Nx in bmake.1 with NetBSD + since some systems cannot cope with .Nx + +2011-11-14 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20111111 + Merge with NetBSD make, pick up + o debug output for .PARSEDIR and .PARSEFILE + +2011-10-10 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20111010 + +2011-10-09 Simon J. Gerraty + + * boot-strap: check for an expected file in the dirs we look for. + * make-bootstrap.sh: pass on LDSTATIC + +2011-10-01 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20111001 + Merge with NetBSD make, pick up + o ensure .PREFIX is set for .PHONY + and .TARGET set for .PHONY run via .END + o __dead used consistently + +2011-09-10 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): 20110909 is a better number ;-) + +2011-09-05 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20110905 + Merge with NetBSD make, pick up + o meta_oodate: ignore makeDependfile + +2011-08-28 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20110828 + Merge with NetBSD make, pick up + o silent=yes in .MAKE.MODE causes meta mode to mark targets + as SILENT if a .meta file is created + +2011-08-18 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20110818 + Merge with NetBSD make, pick up + o in meta mode, if target flagged .META a missing .meta file + means target is out-of-date + o fixes for gcc 4.5 warnings + o simplify job printing code + +2011-08-09 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20110808 + Merge with NetBSD make, pick up + o do not touch OP_SPECIAL targets when doing make -t + +2011-06-22 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20110622 + Merge with NetBSD make, pick up + o meta_oodate detect corrupted .meta file and declare oodate. + * configure.in: add check for setsid + +2011-06-07 Simon J. Gerraty + + * Merge with NetBSD make, pick up + o unit-tests/modts now works on MirBSD + +2011-06-04 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20110606 + Merge with NetBSD make, pick up + o ApplyModifiers: when we parse a variable which is not + the entire modifier string, or not followed by ':', do not + consider it as containing modifiers. + o loadfile: ensure newline at end of mapped file. + +2011-05-05 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20110505 + Merge with NetBSD make, pick up + o .MAKE.META.BAILIWICK - list of prefixes which define the scope + of make's control. In meta mode, any generated file within + said bailiwick, which is found to be missing, causes current + target to be out-of-date. + +2011-04-11 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20110411 + Merge with NetBSD make, pick up + o when long modifiers fail to match, check sysV style. + - add a test case + +2011-04-10 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20110410 + Merge with NetBSD make, pick up + o :hash - cheap 32bit hash of value + o :localtime, :gmtime - use value as format string for strftime. + +2011-03-30 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20110330 + mostly because its a cooler version. + Merge with NetBSD make, pick up + o NetBSD tags for meta.[ch] + o job.c call meta_job_finish() after meta_job_error(). + o meta_job_error() should call meta_job_finish() to ensure + .meta file is closed, and safe to copy - if .ERROR target wants. + meta_job_finish() is safe to call repeatedly. + +2011-03-29 Simon J. Gerraty + + * unit-tests/modts: use printf if it is a builtin, + to save us from MirBSD + + * Makefile.in (MAKE_VERSION): bump version to 20110329 + Merge with NetBSD make, pick up + o fix for use after free() in CondDoExists(). + o meta_oodate() report extra commands and return earlier. + +2011-03-27 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20110327 + Merge with NetBSD make, pick up + o meta.c, if .MAKE.MODE contains curdirOk=yes + allow creating .meta files in .CURDIR + * boot-strap (TOOL_DIFF): aparently at least on linux distro + formats the output of 'type' differently - so eat any "()" + +2011-03-06 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20110306 + Merge with NetBSD make, pick up + o meta.c, only do getcwd() once + +2011-03-05 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20110305 + Merge with NetBSD make, pick up + o correct sysV substitution handling of empty lhs and variable + o correct exists() check for dir with trailing / + o correct handling of modifiers for non-existant variables + during evaluation of conditionals. + o ensure MAP_FILE is defined. + o meta.c use curdir[] now exported by main.c + +2011-02-25 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20110225 + Merge with NetBSD make, pick up + o fix for incorrect .PARSEDIR when .OBJDIR is re-computed after + makefiles have been read. + o fix example of :? modifier in man page. + +2011-02-13 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20110214 + Merge with NetBSD make, pick up + o meta.c handle realpath() failing when generating meta file + name. + + * sigcompat.c: convert to ansi so we can use higher warning levels. + + +2011-02-07 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20110207 + Merge with NetBSD make, pick up + o fix for bug in meta mode. + +2011-01-03 Simon J. Gerraty + + * parse.c: SunOS 5.8 at least does not have MAP_FILE + +2011-01-01 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20110101 + Merge with NetBSD make, pick up + o use mmap(2) if available, for reading makefiles + +2010-12-15 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20101215 + Merge with NetBSD make, pick up + o ensure meta_job_error() does not report a previous .meta file + as being culprit. + +2010-12-10 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20101210 + Merge with NetBSD make, pick up + o meta_oodate: track cwd per process, and only consider target + out-of-date if missing file is outside make's CWD. + Ignore files in /tmp/ etc. + o to ensure unit-tests results match, need to control LC_ALL + as well as LANG. + o fix for parsing bug in var.c + +2010-11-26 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20101126 + Merge with NetBSD make, pick up + o if stale dependency is an IMPSRC, search via .PATH + o meta_oodate: if a referenced file is missing, target is + out-of-date. + o meta_oodate: if a target uses .OODATE in its commands, + it (.OODATE) needs to be recomputed. + o keep a pointer to youngest child node, rather than just its + mtime. + +2010-11-02 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20101101 + +2010-10-16 Simon J. Gerraty + + * machine.sh: like os.sh, + allow for uname -p producing useless drivel + +2010-09-13 Simon J. Gerraty + + * boot-strap: document configure knobs for meta and filemon. + + * Makefile.in (MAKE_VERSION): bump version to 20100911 + Merge with NetBSD make, pick up + o meta.c - meta mode + + * make-bootstrap.sh.in: handle meta.c + * configure.in: add knobs for use_meta and filemon_h + also, look for dirname, str[e]sep and strlcpy + * util.c: add simple err[x] and warn[x] + +2010-08-08 Simon J. Gerraty + + * boot-strap (TOOL_DIFF): set this to ensure tests use + the same version of diff that configure tested + + * Makefile.in (MAKE_VERSION): bump version to 20100808 + Merge with NetBSD make, pick up + o in jobs mode, when we discover we cannot make something, + call PrintOnError before exit. + +2010-08-06 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20100806 + Merge with NetBSD make, pick up + o formatting fixes for ignored errors + o ensure jobs are cleaned up regardless of where wait() was called. + +2010-06-28 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20100618 + * os.sh (MACHINE_ARCH): watch out for drivel from uname -p + +2010-06-16 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20100616 + Merge with NetBSD make, pick up + o man page update + o call PrintOnError from JobFinish when we detect an error we + are not ignoring. + +2010-06-06 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20100606 + Merge with NetBSD make, pick up + o man page update + +2010-06-05 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20100605 + Merge with NetBSD make, pick up + o use bmake_signal() which is a wrapper around sigaction() + in place of signal() + o add .export-env to allow exporting variables to environment + without tracking (so no re-export when the internal value is + changed). + +2010-05-24 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20100524 + Merge with NetBSD make, pick up + o fix for .info et al being greedy. + +2010-05-23 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20100520 + Merge with NetBSD make, pick up + o back to using realpath on argv[0] + but only if contains '/' and does not start with '/'. + +2010-05-10 Simon J. Gerraty + + * boot-strap: use absolute path for bmake when running tests. + + * Makefile.in (MAKE_VERSION): bump version to 20100510 + Merge with NetBSD make, pick up + o revert use of realpath on argv[0] + too many corner cases. + o print MAKE_PRINT_VAR_ON_ERROR before running .ERROR target. + +2010-05-05 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20100505 + Merge with NetBSD make, pick up + o fix for missed SIGCHLD when compiled with SunPRO + actually for bmake, defining FORCE_POSIX_SIGNALS would have + done the job. + +2010-04-30 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20100430 + Merge with NetBSD make, pick up + o fflush stdout before writing to stdout + +2010-04-23 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20100423 + Merge with NetBSD make, pick up + o updated unit tests for Haiku (this time for sure). + * boot-strap: based on patch from joerg + honor --with-default-sys-path better. + * boot-strap: remove mention of --with-prefix-sys-path + +2010-04-22 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20100422 + * Merge with NetBSD make, pick up + o fix for vfork() on Darwin. + o fix for bogus $TMPDIR. + o set .MAKE.MODE=compat for -B + o set .MAKE.JOBS=max_jobs for -j max_jobs + o allow unit-tests to run without any *.mk + o unit-tests/modmisc be more conservative in dirs presumed to exist. + * boot-strap: ignore /usr/share/mk except on NetBSD. + * unit-tests/Makefile.in: set LANG=C when running unit-tests to + ensure sort(1) behaves as expected. + +2010-04-21 Simon J. Gerraty + + * boot-strap: add FindHereOrAbove so we can use -m .../mk + +2010-04-20 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20100420 + * Merge with NetBSD make, pick up + o fix for variable realpath() behavior. + we have to stat(2) the result to be sure. + o fix for .export (all) when nested vars use :sh + +2010-04-14 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20100414 + * Merge with NetBSD make, pick up + o use realpath to resolve argv[0] (for .MAKE) if needed. + o add realpath from libc. + o add :tA to resolve variable via realpath(3) if possible. + +2010-04-08 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20100408 + * Merge with NetBSD make, pick up + o unit tests for .ERROR, .error + o fix for .ERROR to ensure it cannot be default target. + +2010-04-06 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20100406 + * Merge with NetBSD make, pick up + o fix for compat mode "Error code" going to debug_file. + o fix for .ALLSRC being populated twice. + o support for .info, .warning and .error directives + o .MAKE.MODE to control make's operational mode + o .MAKE.MAKEFILE_PREFERENCE to control the preferred makefile + name(s). + o .MAKE.DEPENDFILE to control the name of the depend file + o .ERROR target - run on failure. + +2010-03-18 Simon J. Gerraty + + * make-bootstrap.sh.in: extract MAKE_VERSION from Makefile + + * os.sh,arch.c: patch for Haiku from joerg at netbsd + +2010-03-17 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20100222 + * Merge with NetBSD make, pick up + o better error msg for .for with mutiple inter vars + + * boot-strap: + o use make-bootstrap.sh from joerg at netbsd + to avoid the need for a native make when bootstrapping. + o add "" everywhere ;-) + o if /usr/share/tmac/andoc.tmac exists install nroff bmake.1 + otherwise the pre-formated version. + +2010-01-04 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20100102 + * Merge with NetBSD make, pick up: + o fix for -m .../ + +2009-11-18 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20091118 + * Merge with NetBSD make, pick up: + o .unexport + o report lines that start with '.' and should have ':' + (catch typo's of .el*if). + +2009-10-30 Simon J. Gerraty + + * configure.in: Ensure that srcdir and mksrc are absolute paths. + +2009-10-09 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): fix version to 20091007 + +2009-10-07 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 200910007 + * Merge with NetBSD make, pick up: + o fix for parsing of :S;...;...; applied to .for loop iterator + appearing in a dependency line. + +2009-09-09 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20090909 + * Merge with NetBSD make, pick up: + o fix for -C, .CURDIR and .OBJDIR + * boot-strap: + o allow share_dir to be set independent of prefix. + o select default share_dir better when prefix ends in $HOST_TARGET + o if FORCE_BSD_MK etc were set, include them in the suggested + install-mk command. + +2009-09-08 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20090908 + * Merge with NetBSD make, pick up: + o .MAKE.LEVEL for recursion tracking + o fix for :M scanning \: + +2009-09-03 Simon J. Gerraty + + * configure.in: Don't -D__EXTENSIONS__ if + AC_USE_SYSTEM_EXTENSIONS says "no". + +2009-08-26 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20090826 + Simplify MAKE_VERSION to just the bare date. + * Merge with NetBSD make, pick up: + o -C directory support. + o support for SIGINFO + o use $TMPDIR for temp files. + o child of vfork should be careful about modifying parent's state. + + +2009-03-26 Simon J. Gerraty + + * Appy some patches for MiNT from David Brownlee + +2009-02-26 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump version to 20090222 + * Merge with NetBSD make, pick up: + o Possible null pointer de-ref in Var_Set. + +2009-02-08 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump version to 20090204 + * Merge with NetBSD make, pick up: + o bmake_malloc et al moved to their own .c + o Count both () and {} when looking for the end of a :M pattern + o Change 'Buffer' so that it is the actual struct, not a pointer to it. + o strlist.c - functions for processing extendable arrays of pointers to strings. + o ClientData replaced with void *, so const void * can be used. + o New debug flag C for DEBUG_CWD + +2008-11-11 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump version to 20081111 + Apply patch from Joerg Sonnenberge to + configure.in: + o remove some redundant checks + o check for emlloc etc only in libutil and require the whole family. + util.c: + o remove [v]asprintf which is no longer used. + +2008-11-04 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump version to 20081101 + * Merge with NetBSD make, pick up: + o util.c: avoid use of putenv() - christos + +2008-10-30 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump version to 20081030 + pick up man page tweaks. + +2008-10-29 Simon J. Gerraty + + * Makefile.in: move processing of LIBOBJS to after is definition! + thus we'll have getenv.c in SRCS only if needed. + + * make.1: add examples of how to use :? + + * Makefile.in (BMAKE_VERSION): bump version to 20081029 + * Merge with NetBSD make, pick up: + o fix for .END processing with -j + o segfault from Parse_Error when no makefile is open + o handle numeric expressions in any variable expansion + o debug output now defaults to stderr, -dF to change it - apb + o make now uses bmake_malloc etc so that it can build natively + on A/UX - wasn't an issue for bmake, but we want to keep in sync. + +2008-09-27 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump version to 20080808 + * Merge with NetBSD make, pick up: + o fix for PR/38840: Pierre Pronchery: make crashes while parsing + long lines in Makefiles + o optimizations for VarQuote by joerg + o fix for PR/38756: dominik: make dumps core on invalid makefile + +2008-05-15 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump version to 20080515 + * Merge with NetBSD make, pick up: + o fix skip setting vars in VAR_GLOBAL context, to handle + cases where VAR_CMD is used for other than command line vars. + +2008-05-14 Simon J. Gerraty + + * boot-strap (make_version): we may need to look in + $prefix/share/mk for sys.mk + + * Makefile.in (BMAKE_VERSION): bump version to 20080514 + * Merge with NetBSD make, pick up: + o skip setting vars in VAR_GLOBAL context, when already set in + VAR_CMD which takes precedence. + +2008-03-30 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump version to 20080330 + * Merge with NetBSD make, pick up: + o fix for ?= when LHS contains variable reference. + +2008-02-15 Simon J. Gerraty + + * merge some patches from NetBSD pkgsrc. + + * makefile.boot.in (BOOTSTRAP_SYS_PATH): Allow better control of + the MAKSYSPATH used during bootstrap. + + * Makefile.in (BMAKE_VERSION): bump version to 20080215 + * Merge with NetBSD make, pick up: + o warn if non-space chars follow 'empty' in a conditional. + +2008-01-18 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump version to 20080118 + * Merge with NetBSD make, pick up: + o consider dependencies read from .depend as optional - dsl + o remember when buffer for reading makefile grows - dsl + o add -dl (aka LOUD) - David O'Brien + +2007-10-22 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump version to 20071022 + * Merge with NetBSD make, pick up: + o Allow .PATH to be used for .include "" + + * boot-strap: source default settings from .bmake-boot-strap.rc + +2007-10-16 Simon J. Gerraty + + * Makefile.in: fix maninstall on various systems + provided that our man.mk is used. + For non-BSD systems we install the preformatted page + into $MANDIR/cat1 + +2007-10-15 Simon J. Gerraty + + * boot-strap: make bmake.1 too, so maninstall works. + +2007-10-14 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump version to 20071014 + * Merge with NetBSD make, pick up: + o revamped handling of defshell - configure no longer needs to + know the content of the shells array - apb + o stop Var_Subst modifying its input - apb + o avoid calling ParseTrackInput too often - dsl + +2007-10-11 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump version to 20071011 + * Merge with NetBSD make, pick up: + o fix Shell_Init for case that _BASENAME_DEFSHELL is absolute path. + + * sigcompat.c: some tweaks for HP-UX 11.x based on + patch from Tobias Nygren + + * configure.in: update handling of --with-defshell to match + new make behavior. --with-defshell=/usr/xpg4/bin/sh + will now do what one might hope - provided the chosen shell + behaves enough like sh. + +2007-10-08 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump to 20071008 + * Merge with NetBSD make, pick up: + o .MAKE.JOB.PREFIX - control the token output before jobs - sjg + o .export/.MAKE.EXPORTED - export of variables - sjg + o .MAKE.MAKEFILES - track all makefiles read - sjg + o performance improvements - dsl + o revamp parallel job scheduling - dsl + +2006-07-28 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump to 20060728 + * Merge with NetBSD make, pick up: + o extra debug info during variable and cond processing - sjg + o shell definition now covers newline - rillig + o minor mem leak in PrintOnError - sjg + +2006-05-11 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump to 20060511 + * Merge with NetBSD make, pick up: + o more memory leaks - coverity + o possible overflow in ArchFindMember - coverity + o extract variable modifier code out of Var_Parse() + so it can be called recursively - sjg + o unit-tests/moderrs - sjg + +2006-04-12 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump to 20060412 + * Merge with NetBSD make, pick up: + o fixes for some memory leaks - coverity + o only read first sys.mk etc when searching sysIncPath - sjg + + * main.c (ReadMakefile): remove hack for __INTERIX that prevented + setting ${MAKEFILE} - OBATA Akio + +2006-03-18 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump to 20060318 + * Merge with NetBSD make, pick up: + o cleanup of job.c to remove remote handling, distcc is more + useful and this code was likely bit-rotting - dsl + o fix for :P modifier - sjg + * boot-strap: set default prefix to something reasonable + (for me anyway). + +2006-03-01 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump to 20060301 + * Merge with NetBSD make, pick up: + o make .WAIT apply recursively, document and test case - apb + o allow variable modifiers in a variable appear anywhere in + modifier list, document and test case - sjg + +2006-02-22 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump to 20060222 + * Merge with NetBSD make, pick up: + o improved job token handling - dsl + o SIG_DFL the correct signal before exec - dsl + o more debug info during parsing - dsl + o allow variable modifiers to be specified via variable - sjg + * boot-strap: explain why we died if no mksrc + +2005-11-05 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump to 20051105 + * configure.in: always set default_sys_path + default is ${prefix}/share/mk + - remove prefix_sys_path, anyone wanting more than above + needs to set it manually. + +2005-11-04 Simon J. Gerraty + + * boot-strap: make this a bit easier for pkgsrc folk. + bootstrap still fails on IRIX64 since MACHINE_ARCH gets set to + 'mips' while pkgsrc wants 'mipseb' or 'mipsel' + +2005-11-02 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump to 20051102 + * job.c (JobFinish): fix likely ancient merge lossage + fix from Todd Vierling. + * boot-strap (srcdir): allow setting mksrc=none + +2005-10-31 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump to 20051031 + * ranlib.h: skip on OSF too. + (NetBSD PR 31864) + +2005-10-10 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump to 20051002 + fix a silly typo + +2005-10-09 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump to 20051001 + support for UnixWare and some other systems, + based on patches from pkgsrc/bootstrap + +2005-09-03 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump to 20050901 + * Merge with NetBSD make, pick up: + o possible parse error causing us to wander off. + +2005-06-06 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump to 20050606 + * Merge with NetBSD make, pick up: + o :0x modifier for randomizing a list + o fixes for a number of -Wuninitialized issues. + +2005-05-30 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump to 20050530 + * Merge with NetBSD make, pick up: + o Handle dependencies for .BEGIN, .END and .INTERRUPT + + * README: was seriously out of date. + +2005-03-22 Simon J. Gerraty + + * Important to use .MAKE rather than MAKE. + +2005-03-15 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump to 20050315 + * Merge with NetBSD make, pick up: + o don't mistake .elsefoo for .else + o use suffix-specific search path correctly + o bunch of style nits + +2004-05-11 Simon J. Gerraty + + * boot-strap: + o ensure that args to --src and --with-mksrc + are resolved before giving them to configure. + o add -o "objdir" so that builder can control it, + default is $OS as determined by os.sh + o add -q to suppress all the install instructions. + +2004-05-08 Simon J. Gerraty + + * Remove __IDSTRING() + + * Makefile.in (BMAKE_VERSION): bump to 20040508 + * Merge with NetBSD make, pick up: + o posix fixes + - remove '-e' from compat mode + - add support for '+' command-line prefix. + o fix for handling '--' on command-line. + o fix include in lst.lib/lstInt.h to simplify '-I's + o we also picked up replacement of MAKE_BOOTSTRAP + with !MAKE_NATIVE which is a noop, but possibly confusing. + +2004-04-14 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump to 20040414 + * Merge with NetBSD make, pick up: + o allow quoted strings on lhs of conditionals + o issue warning when extra .else is seen + o print line numer when errors encountered during parsing from + string. + +2004-02-20 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump to 20040220 + * Merge with NetBSD make, pick up: + o fix for old :M parsing bug. + o re-jigged unit-tests + +2004-02-15 Simon J. Gerraty + + * Makefile.in (accept test): use ${.MAKE:S,^./,${.CURDIR}/,} + so that './bmake -f Makefile test' works. + +2004-02-14 Simon J. Gerraty + + * Makefile.in: (BMAKE_VERSION): bump to 20040214 + * Merge with NetBSD make, pick up: + o search upwards for *.mk + o fix for double free of var substitution buffers + o use of getopt replaced with custom code, since the usage + (re-scanning) isn't posix compatible. + +2004-02-12 Simon J. Gerraty + + * arch.c: don't include ranlib.h on ELF systems + (thanks to Chuck Cranor ). + +2004-01-18 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump to 20040118 + + * boot-strap (while): export vars we assign to on cmdline + * unit-test/Makefile.in: ternary is .PHONY + +2004-01-08 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump version to 20040108 + * Merge with NetBSD make, pick up: + o fix for ternary modifier + +2004-01-06 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump version to 20040105 + * Merge with NetBSD make, pick up: + o fix for cond.c to handle compound expressions better + o variable expansion within sysV style replacements + +2003-12-22 Simon J. Gerraty + + * Make portable snprintf safer - output to /dev/null first to + check space needed. + + * Makefile.in (BMAKE_VERSION): bump version to 20031222 + * Merge with NetBSD make, pick up: + o -dg3 to show input graph when things go wrong. + o explicitly look for makefiles in objdir if not found in curdir so + that errors in .depend etc will be reported accurarely. + o avoid use of -e in shell scripts in jobs mode, use '|| exit $?' + instead as it more accurately reflects the expected behavior and + is more consistently implemented. + o avoid use of asprintf. + +2003-09-28 Simon J. Gerraty + + * util.c: Add asprintf and vasprintf. + + * Makefile.in (BMAKE_VERSION): bump version to 20030928 + * Merge with NetBSD make, pick up: + :[] modifier - allows picking words from a variable. + :tW modifier - allows treating value as one big word. + W flag for :C and :S - allows treating value as one big word. + +2003-09-12 Simon J. Gerraty + + * Merge with NetBSD make + pick up -de flag to enable printing failed command. + don't skip 1st two dir entries (normally . and ..) since + coda does not have them. + +2003-09-09 Simon J. Gerraty + + * Makefile.in (BMAKE_VERSION): bump version to 20030909 + * Merge with NetBSD make, pick up: + - changes for -V '${VAR}' to print fully expanded value + cf. -V VAR + - CompatRunCommand now prints the command that failed. + - several files got updated 3 clause Berkeley license. + +2003-08-02 Simon J. Gerraty + + * boot-strap: Allow setting configure args on command line. + +2003-07-31 Simon J. Gerraty + + * configure.in: add --with-defshell to allow sh or ksh + to be selected as default shell. + + * Makefile.in: bump version to 20030731 + + * Merge with NetBSD make + Pick up .SHELL spec for ksh and associate man page changes. + Also compat mode now uses the same shell specs. + +2003-07-29 Simon J. Gerraty + + * var.c (Var_Parse): ensure delim is initialized. + + * unit-tests/Makefile.in: use single quotes to avoid problems from + some shells. + + * makefile.boot.in: + Run the unit-tests as part of the bootstrap procedure. + +2003-07-28 Simon J. Gerraty + + * unit-tests/Makefile.in: always force complaints from + ${TEST_MAKE} to be from 'make'. + + * configure.in: add check for 'diff -u' + also fix some old autoconf'isms + + * Makefile.in (BMAKE_VERSION): bump version to 20030728. + if using GCC add -Wno-cast-qual to CFLAGS for var.o + + * Merge with NetBSD make + Pick up fix for :ts parsing error in some cases. + Pick unit-tests. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 21:58:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4520F1065670; Fri, 8 Jun 2012 21:58:52 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 171FC8FC15; Fri, 8 Jun 2012 21:58:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58LwpNd087248; Fri, 8 Jun 2012 21:58:51 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58LwpV9087247; Fri, 8 Jun 2012 21:58:51 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201206082158.q58LwpV9087247@svn.freebsd.org> From: "David E. O'Brien" Date: Fri, 8 Jun 2012 21:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236770 - vendor/NetBSD/bmake/20120606 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 21:58:52 -0000 Author: obrien Date: Fri Jun 8 21:58:51 2012 New Revision: 236770 URL: http://svn.freebsd.org/changeset/base/236770 Log: "Tag" the r236769 Portable BSD make 6-May-2012 import. Added: vendor/NetBSD/bmake/20120606/ - copied from r236769, vendor/NetBSD/bmake/dist/ From owner-svn-src-all@FreeBSD.ORG Fri Jun 8 22:54:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BA3B1065675; Fri, 8 Jun 2012 22:54:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 370638FC16; Fri, 8 Jun 2012 22:54:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q58MsQV2090384; Fri, 8 Jun 2012 22:54:26 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q58MsPoP090382; Fri, 8 Jun 2012 22:54:26 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201206082254.q58MsPoP090382@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 8 Jun 2012 22:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236771 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 22:54:26 -0000 Author: jilles Date: Fri Jun 8 22:54:25 2012 New Revision: 236771 URL: http://svn.freebsd.org/changeset/base/236771 Log: sh: Do not assume that SIGPIPE will only kill a subshell in builtins/wait3.0 test. POSIX says that SIGPIPE affects a process and therefore a SIGPIPE caused and received by a subshell environment may or may not affect the parent shell environment. The change assumes that ${SH} is executed in a new process. This must be the case if it contains a slash and everyone appears to do so anyway even though POSIX might permit otherwise. This change makes builtins/wait3.0 work in ksh93. Modified: head/tools/regression/bin/sh/builtins/wait3.0 Modified: head/tools/regression/bin/sh/builtins/wait3.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/wait3.0 Fri Jun 8 21:58:51 2012 (r236770) +++ head/tools/regression/bin/sh/builtins/wait3.0 Fri Jun 8 22:54:25 2012 (r236771) @@ -15,7 +15,7 @@ for i in 1 2 3 4 5 6 7 8 9 10; do done exec 3>fifo1 wait || failure $LINENO -(echo >&3) 2>/dev/null && failure $LINENO +(${SH} -c echo >&3) 2>/dev/null && failure $LINENO wait || failure $LINENO test -z "$failures" From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 00:37:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00A38106564A; Sat, 9 Jun 2012 00:37:27 +0000 (UTC) (envelope-from iwasaki@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD0A98FC12; Sat, 9 Jun 2012 00:37:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q590bQ8m095755; Sat, 9 Jun 2012 00:37:26 GMT (envelope-from iwasaki@svn.freebsd.org) Received: (from iwasaki@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q590bQSo095739; Sat, 9 Jun 2012 00:37:26 GMT (envelope-from iwasaki@svn.freebsd.org) Message-Id: <201206090037.q590bQSo095739@svn.freebsd.org> From: Mitsuru IWASAKI Date: Sat, 9 Jun 2012 00:37:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236772 - in head/sys: amd64/acpica amd64/amd64 amd64/include conf dev/acpica i386/acpica i386/i386 i386/include kern sys x86/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 00:37:27 -0000 Author: iwasaki Date: Sat Jun 9 00:37:26 2012 New Revision: 236772 URL: http://svn.freebsd.org/changeset/base/236772 Log: Add x86/acpica/acpi_wakeup.c for amd64 and i386. Difference of suspend/resume procedures are minimized among them. common: - Add global cpuset suspended_cpus to indicate APs are suspended/resumed. - Remove acpi_waketag and acpi_wakemap from acpivar.h (no longer used). - Add some variables in acpi_wakecode.S in order to minimize the difference among amd64 and i386. - Disable load_cr3() because now CR3 is restored in resumectx(). amd64: - Add suspend/resume related members (such as MSR) in PCB. - Modify savectx() for above new PCB members. - Merge acpi_switch.S into cpu_switch.S as resumectx(). i386: - Merge(and remove) suspendctx() into savectx() in order to match with amd64 code. Reviewed by: attilio@, acpi@ Added: head/sys/x86/acpica/acpi_wakeup.c (contents, props changed) Deleted: head/sys/amd64/acpica/acpi_switch.S head/sys/amd64/acpica/acpi_wakeup.c head/sys/i386/acpica/acpi_wakeup.c Modified: head/sys/amd64/acpica/acpi_wakecode.S head/sys/amd64/amd64/cpu_switch.S head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/include/pcb.h head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/dev/acpica/acpivar.h head/sys/i386/acpica/acpi_wakecode.S head/sys/i386/i386/mp_machdep.c head/sys/i386/i386/swtch.s head/sys/i386/include/pcb.h head/sys/kern/subr_smp.c head/sys/sys/smp.h Modified: head/sys/amd64/acpica/acpi_wakecode.S ============================================================================== --- head/sys/amd64/acpica/acpi_wakecode.S Fri Jun 8 22:54:25 2012 (r236771) +++ head/sys/amd64/acpica/acpi_wakecode.S Sat Jun 9 00:37:26 2012 (r236772) @@ -219,10 +219,15 @@ wakeup_64: mov $bootdata64 - bootgdt, %eax mov %ax, %ds - /* Restore arguments and return. */ - movq wakeup_kpml4 - wakeup_start(%rbx), %rdi - movq wakeup_ctx - wakeup_start(%rbx), %rsi - movq wakeup_retaddr - wakeup_start(%rbx), %rax + /* Restore arguments. */ + movq wakeup_cr3 - wakeup_start(%rbx), %rsi + movq wakeup_pcb - wakeup_start(%rbx), %rdi + movq wakeup_ret - wakeup_start(%rbx), %rax + + /* Restore GDT. */ + lgdt wakeup_gdt - wakeup_start(%rbx) + + /* Jump to return address. */ jmp *%rax .data @@ -268,34 +273,15 @@ bootgdtdesc: .long bootgdt - wakeup_start /* Offset plus %ds << 4 */ ALIGN_DATA -wakeup_retaddr: +wakeup_cr4: /* not used */ .quad 0 -wakeup_kpml4: - .quad 0 - -wakeup_ctx: +wakeup_cr3: .quad 0 wakeup_pcb: .quad 0 -wakeup_fpusave: +wakeup_ret: .quad 0 wakeup_gdt: .word 0 .quad 0 - - ALIGN_DATA -wakeup_efer: - .quad 0 -wakeup_star: - .quad 0 -wakeup_lstar: - .quad 0 -wakeup_cstar: - .quad 0 -wakeup_sfmask: - .quad 0 -wakeup_xsmask: - .quad 0 -wakeup_cpu: - .long 0 dummy: Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Fri Jun 8 22:54:25 2012 (r236771) +++ head/sys/amd64/amd64/cpu_switch.S Sat Jun 9 00:37:26 2012 (r236772) @@ -357,6 +357,30 @@ ENTRY(savectx) rdmsr movl %eax,PCB_KGSBASE(%rdi) movl %edx,PCB_KGSBASE+4(%rdi) + movl $MSR_EFER,%ecx + rdmsr + movl %eax,PCB_EFER(%rdi) + movl %edx,PCB_EFER+4(%rdi) + movl $MSR_STAR,%ecx + rdmsr + movl %eax,PCB_STAR(%rdi) + movl %edx,PCB_STAR+4(%rdi) + movl $MSR_LSTAR,%ecx + rdmsr + movl %eax,PCB_LSTAR(%rdi) + movl %edx,PCB_LSTAR+4(%rdi) + movl $MSR_CSTAR,%ecx + rdmsr + movl %eax,PCB_CSTAR(%rdi) + movl %edx,PCB_CSTAR+4(%rdi) + movl $MSR_SF_MASK,%ecx + rdmsr + movl %eax,PCB_SFMASK(%rdi) + movl %edx,PCB_SFMASK+4(%rdi) + movl xsave_mask,%eax + movl %eax,PCB_XSMASK(%rdi) + movl xsave_mask+4,%eax + movl %eax,PCB_XSMASK+4(%rdi) sgdt PCB_GDT(%rdi) sidt PCB_IDT(%rdi) @@ -370,6 +394,141 @@ ENTRY(savectx) END(savectx) /* + * resumectx(pcb in %rdi, cr3 in %rsi) + * Resuming processor state from pcb. + */ +ENTRY(resumectx) + /* Switch to KPML4phys. */ + movq %rsi,%cr3 + + /* Force kernel segment registers. */ + movl $KDSEL,%eax + movw %ax,%ds + movw %ax,%es + movw %ax,%ss + movl $KUF32SEL,%eax + movw %ax,%fs + movl $KUG32SEL,%eax + movw %ax,%gs + + movl $MSR_FSBASE,%ecx + movl PCB_FSBASE(%rdi),%eax + movl 4 + PCB_FSBASE(%rdi),%edx + wrmsr + movl $MSR_GSBASE,%ecx + movl PCB_GSBASE(%rdi),%eax + movl 4 + PCB_GSBASE(%rdi),%edx + wrmsr + movl $MSR_KGSBASE,%ecx + movl PCB_KGSBASE(%rdi),%eax + movl 4 + PCB_KGSBASE(%rdi),%edx + wrmsr + + /* Restore EFER. */ + movl $MSR_EFER,%ecx + movl PCB_EFER(%rdi),%eax + wrmsr + + /* Restore fast syscall stuff. */ + movl $MSR_STAR,%ecx + movl PCB_STAR(%rdi),%eax + movl 4 + PCB_STAR(%rdi),%edx + wrmsr + movl $MSR_LSTAR,%ecx + movl PCB_LSTAR(%rdi),%eax + movl 4 + PCB_LSTAR(%rdi),%edx + wrmsr + movl $MSR_CSTAR,%ecx + movl PCB_CSTAR(%rdi),%eax + movl 4 + PCB_CSTAR(%rdi),%edx + wrmsr + movl $MSR_SF_MASK,%ecx + movl PCB_SFMASK(%rdi),%eax + wrmsr + + /* Restore CR0 except for FPU mode. */ + movq PCB_CR0(%rdi),%rax + andq $~(CR0_EM | CR0_TS),%rax + movq %rax,%cr0 + + /* Restore CR2, CR4 and CR3. */ + movq PCB_CR2(%rdi),%rax + movq %rax,%cr2 + movq PCB_CR4(%rdi),%rax + movq %rax,%cr4 + movq PCB_CR3(%rdi),%rax + movq %rax,%cr3 + + /* Restore descriptor tables. */ + lidt PCB_IDT(%rdi) + lldt PCB_LDT(%rdi) + +#define SDT_SYSTSS 9 +#define SDT_SYSBSY 11 + + /* Clear "task busy" bit and reload TR. */ + movq PCPU(TSS),%rax + andb $(~SDT_SYSBSY | SDT_SYSTSS),5(%rax) + movw PCB_TR(%rdi),%ax + ltr %ax + +#undef SDT_SYSTSS +#undef SDT_SYSBSY + + /* Restore debug registers. */ + movq PCB_DR0(%rdi),%rax + movq %rax,%dr0 + movq PCB_DR1(%rdi),%rax + movq %rax,%dr1 + movq PCB_DR2(%rdi),%rax + movq %rax,%dr2 + movq PCB_DR3(%rdi),%rax + movq %rax,%dr3 + movq PCB_DR6(%rdi),%rax + movq %rax,%dr6 + movq PCB_DR7(%rdi),%rax + movq %rax,%dr7 + + /* Restore FPU state. */ + fninit + movq PCB_FPUSUSPEND(%rdi),%rbx + movq PCB_XSMASK(%rdi),%rax + testq %rax,%rax + jz 1f + movq %rax,%rdx + shrq $32,%rdx + movl $XCR0,%ecx +/* xsetbv */ + .byte 0x0f, 0x01, 0xd1 +/* xrstor (%rbx) */ + .byte 0x0f, 0xae, 0x2b + jmp 2f +1: + fxrstor (%rbx) +2: + + /* Reload CR0. */ + movq PCB_CR0(%rdi),%rax + movq %rax,%cr0 + + /* Restore other callee saved registers. */ + movq PCB_R15(%rdi),%r15 + movq PCB_R14(%rdi),%r14 + movq PCB_R13(%rdi),%r13 + movq PCB_R12(%rdi),%r12 + movq PCB_RBP(%rdi),%rbp + movq PCB_RSP(%rdi),%rsp + movq PCB_RBX(%rdi),%rbx + + /* Restore return address. */ + movq PCB_RIP(%rdi),%rax + movq %rax,(%rsp) + + xorl %eax,%eax + ret +END(resumectx) + +/* * Wrapper around fpusave to care about TS0_CR. */ ENTRY(ctx_fpusave) Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Fri Jun 8 22:54:25 2012 (r236771) +++ head/sys/amd64/amd64/genassym.c Sat Jun 9 00:37:26 2012 (r236772) @@ -157,6 +157,13 @@ ASSYM(PCB_TSSP, offsetof(struct pcb, pcb ASSYM(PCB_SAVEFPU, offsetof(struct pcb, pcb_save)); ASSYM(PCB_SAVEFPU_SIZE, sizeof(struct savefpu)); ASSYM(PCB_USERFPU, sizeof(struct pcb)); +ASSYM(PCB_EFER, offsetof(struct pcb, pcb_efer)); +ASSYM(PCB_STAR, offsetof(struct pcb, pcb_star)); +ASSYM(PCB_LSTAR, offsetof(struct pcb, pcb_lstar)); +ASSYM(PCB_CSTAR, offsetof(struct pcb, pcb_cstar)); +ASSYM(PCB_SFMASK, offsetof(struct pcb, pcb_sfmask)); +ASSYM(PCB_XSMASK, offsetof(struct pcb, pcb_xsmask)); +ASSYM(PCB_FPUSUSPEND, offsetof(struct pcb, pcb_fpususpend)); ASSYM(PCB_SIZE, sizeof(struct pcb)); ASSYM(PCB_FULL_IRET, PCB_FULL_IRET); ASSYM(PCB_DBREGS, PCB_DBREGS); Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Fri Jun 8 22:54:25 2012 (r236771) +++ head/sys/amd64/amd64/mp_machdep.c Sat Jun 9 00:37:26 2012 (r236772) @@ -100,7 +100,6 @@ void *dpcpu; struct pcb stoppcbs[MAXCPU]; struct pcb **susppcbs; -void **suspfpusave; /* Variables needed for SMP tlb shootdown. */ vm_offset_t smp_tlb_addr1; @@ -1415,15 +1414,19 @@ cpususpend_handler(void) cpu = PCPU_GET(cpuid); if (savectx(susppcbs[cpu])) { - ctx_fpusave(suspfpusave[cpu]); + ctx_fpusave(susppcbs[cpu]->pcb_fpususpend); wbinvd(); CPU_SET_ATOMIC(cpu, &stopped_cpus); + CPU_SET_ATOMIC(cpu, &suspended_cpus); } else { pmap_init_pat(); +#if 0 load_cr3(susppcbs[cpu]->pcb_cr3); +#endif initializecpu(); PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); + CPU_CLR_ATOMIC(cpu, &suspended_cpus); } /* Wait for resume */ Modified: head/sys/amd64/include/pcb.h ============================================================================== --- head/sys/amd64/include/pcb.h Fri Jun 8 22:54:25 2012 (r236771) +++ head/sys/amd64/include/pcb.h Sat Jun 9 00:37:26 2012 (r236772) @@ -91,9 +91,20 @@ struct pcb { /* local tss, with i/o bitmap; NULL for common */ struct amd64tss *pcb_tssp; + /* model specific registers */ + register_t pcb_efer; + register_t pcb_star; + register_t pcb_lstar; + register_t pcb_cstar; + register_t pcb_sfmask; + register_t pcb_xsmask; + + /* fpu context for suspend/resume */ + void * pcb_fpususpend; + struct savefpu *pcb_save; - uint64_t pcb_pad[2]; + uint64_t pcb_pad[3]; }; #ifdef _KERNEL @@ -131,6 +142,7 @@ clear_pcb_flags(struct pcb *pcb, const u void makectx(struct trapframe *, struct pcb *); int savectx(struct pcb *) __returns_twice; +void resumectx(struct pcb *); #endif Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Fri Jun 8 22:54:25 2012 (r236771) +++ head/sys/conf/files.amd64 Sat Jun 9 00:37:26 2012 (r236772) @@ -72,7 +72,6 @@ hptrr_lib.o optional hptrr \ no-implicit-rule # amd64/acpica/acpi_machdep.c optional acpi -amd64/acpica/acpi_switch.S optional acpi acpi_wakecode.o optional acpi \ dependency "$S/amd64/acpica/acpi_wakecode.S assym.s" \ compile-with "${NORMAL_S}" \ @@ -94,7 +93,7 @@ acpi_wakedata.h optional acpi \ no-obj no-implicit-rule before-depend \ clean "acpi_wakedata.h" # -amd64/acpica/acpi_wakeup.c optional acpi +x86/acpica/acpi_wakeup.c optional acpi amd64/amd64/amd64_mem.c optional mem #amd64/amd64/apic_vector.S standard amd64/amd64/atomic.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Fri Jun 8 22:54:25 2012 (r236771) +++ head/sys/conf/files.i386 Sat Jun 9 00:37:26 2012 (r236772) @@ -381,7 +381,7 @@ acpi_wakedata.h optional acpi \ no-obj no-implicit-rule before-depend \ clean "acpi_wakedata.h" # -i386/acpica/acpi_wakeup.c optional acpi +x86/acpica/acpi_wakeup.c optional acpi i386/bios/apm.c optional apm i386/bios/mca_machdep.c optional mca i386/bios/smapi.c optional smapi Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Fri Jun 8 22:54:25 2012 (r236771) +++ head/sys/dev/acpica/acpivar.h Sat Jun 9 00:37:26 2012 (r236772) @@ -71,8 +71,6 @@ struct acpi_softc { int acpi_verbose; int acpi_handle_reboot; - bus_dma_tag_t acpi_waketag; - bus_dmamap_t acpi_wakemap; vm_offset_t acpi_wakeaddr; vm_paddr_t acpi_wakephys; Modified: head/sys/i386/acpica/acpi_wakecode.S ============================================================================== --- head/sys/i386/acpica/acpi_wakecode.S Fri Jun 8 22:54:25 2012 (r236771) +++ head/sys/i386/acpica/acpi_wakecode.S Sat Jun 9 00:37:26 2012 (r236772) @@ -202,4 +202,7 @@ wakeup_pcb: .long 0 wakeup_ret: .long 0 +wakeup_gdt: /* not used */ + .word 0 + .long 0 dummy: Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Fri Jun 8 22:54:25 2012 (r236771) +++ head/sys/i386/i386/mp_machdep.c Sat Jun 9 00:37:26 2012 (r236772) @@ -1512,14 +1512,15 @@ cpususpend_handler(void) cpu = PCPU_GET(cpuid); - if (suspendctx(susppcbs[cpu])) { + if (savectx(susppcbs[cpu])) { wbinvd(); CPU_SET_ATOMIC(cpu, &stopped_cpus); + CPU_SET_ATOMIC(cpu, &suspended_cpus); } else { pmap_init_pat(); PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); - susppcbs[cpu]->pcb_eip = 0; + CPU_CLR_ATOMIC(cpu, &suspended_cpus); } /* Wait for resume */ Modified: head/sys/i386/i386/swtch.s ============================================================================== --- head/sys/i386/i386/swtch.s Fri Jun 8 22:54:25 2012 (r236771) +++ head/sys/i386/i386/swtch.s Sat Jun 9 00:37:26 2012 (r236772) @@ -386,6 +386,36 @@ ENTRY(savectx) pushfl popl PCB_PSL(%ecx) + movl %cr0,%eax + movl %eax,PCB_CR0(%ecx) + movl %cr2,%eax + movl %eax,PCB_CR2(%ecx) + movl %cr4,%eax + movl %eax,PCB_CR4(%ecx) + + movl %dr0,%eax + movl %eax,PCB_DR0(%ecx) + movl %dr1,%eax + movl %eax,PCB_DR1(%ecx) + movl %dr2,%eax + movl %eax,PCB_DR2(%ecx) + movl %dr3,%eax + movl %eax,PCB_DR3(%ecx) + movl %dr6,%eax + movl %eax,PCB_DR6(%ecx) + movl %dr7,%eax + movl %eax,PCB_DR7(%ecx) + + mov %ds,PCB_DS(%ecx) + mov %es,PCB_ES(%ecx) + mov %fs,PCB_FS(%ecx) + mov %ss,PCB_SS(%ecx) + + sgdt PCB_GDT(%ecx) + sidt PCB_IDT(%ecx) + sldt PCB_LDT(%ecx) + str PCB_TR(%ecx) + #ifdef DEV_NPX /* * If fpcurthread == NULL, then the npx h/w state is irrelevant and the @@ -425,64 +455,9 @@ ENTRY(savectx) popfl #endif /* DEV_NPX */ - ret -END(savectx) - -/* - * suspendctx(pcb) - * Update pcb, suspending current processor state. - */ -ENTRY(suspendctx) - /* Fetch PCB. */ - movl 4(%esp),%ecx - - /* Save context by calling savectx(). */ - pushl %ecx - call savectx - addl $4,%esp - - /* Fetch PCB again. */ - movl 4(%esp),%ecx - - /* Update caller's return address and stack pointer. */ - movl (%esp),%eax - movl %eax,PCB_EIP(%ecx) - movl %esp,PCB_ESP(%ecx) - - /* Save other registers and descriptor tables. */ - movl %cr0,%eax - movl %eax,PCB_CR0(%ecx) - movl %cr2,%eax - movl %eax,PCB_CR2(%ecx) - movl %cr4,%eax - movl %eax,PCB_CR4(%ecx) - - movl %dr0,%eax - movl %eax,PCB_DR0(%ecx) - movl %dr1,%eax - movl %eax,PCB_DR1(%ecx) - movl %dr2,%eax - movl %eax,PCB_DR2(%ecx) - movl %dr3,%eax - movl %eax,PCB_DR3(%ecx) - movl %dr6,%eax - movl %eax,PCB_DR6(%ecx) - movl %dr7,%eax - movl %eax,PCB_DR7(%ecx) - - mov %ds,PCB_DS(%ecx) - mov %es,PCB_ES(%ecx) - mov %fs,PCB_FS(%ecx) - mov %ss,PCB_SS(%ecx) - - sgdt PCB_GDT(%ecx) - sidt PCB_IDT(%ecx) - sldt PCB_LDT(%ecx) - str PCB_TR(%ecx) - movl $1,%eax ret -END(suspendctx) +END(savectx) /* * resumectx(pcb in %esi) Modified: head/sys/i386/include/pcb.h ============================================================================== --- head/sys/i386/include/pcb.h Fri Jun 8 22:54:25 2012 (r236771) +++ head/sys/i386/include/pcb.h Sat Jun 9 00:37:26 2012 (r236772) @@ -96,8 +96,7 @@ struct pcb { struct trapframe; void makectx(struct trapframe *, struct pcb *); -void savectx(struct pcb *) __returns_twice; -int suspendctx(struct pcb *) __returns_twice; +int savectx(struct pcb *) __returns_twice; void resumectx(struct pcb *); #endif Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Fri Jun 8 22:54:25 2012 (r236771) +++ head/sys/kern/subr_smp.c Sat Jun 9 00:37:26 2012 (r236772) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #ifdef SMP volatile cpuset_t stopped_cpus; volatile cpuset_t started_cpus; +volatile cpuset_t suspended_cpus; cpuset_t hlt_cpus_mask; cpuset_t logical_cpus_mask; Modified: head/sys/sys/smp.h ============================================================================== --- head/sys/sys/smp.h Fri Jun 8 22:54:25 2012 (r236771) +++ head/sys/sys/smp.h Sat Jun 9 00:37:26 2012 (r236772) @@ -75,6 +75,7 @@ extern int smp_active; extern int smp_cpus; extern volatile cpuset_t started_cpus; extern volatile cpuset_t stopped_cpus; +extern volatile cpuset_t suspended_cpus; extern cpuset_t hlt_cpus_mask; extern cpuset_t logical_cpus_mask; #endif /* SMP */ Added: head/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/acpica/acpi_wakeup.c Sat Jun 9 00:37:26 2012 (r236772) @@ -0,0 +1,434 @@ +/*- + * Copyright (c) 2001 Takanori Watanabe + * Copyright (c) 2001-2012 Mitsuru IWASAKI + * Copyright (c) 2003 Peter Wemm + * Copyright (c) 2008-2012 Jung-uk Kim + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#ifdef SMP +#include +#include +#include +#endif + +#include + +#include + +#include "acpi_wakecode.h" +#include "acpi_wakedata.h" + +/* Make sure the code is less than a page and leave room for the stack. */ +CTASSERT(sizeof(wakecode) < PAGE_SIZE - 1024); + +extern int acpi_resume_beep; +extern int acpi_reset_video; + +#ifdef SMP +extern struct pcb **susppcbs; +static cpuset_t suspcpus; +#else +static struct pcb **susppcbs; +#endif + +static void *acpi_alloc_wakeup_handler(void); +static void acpi_stop_beep(void *); + +#ifdef SMP +static int acpi_wakeup_ap(struct acpi_softc *, int); +static void acpi_wakeup_cpus(struct acpi_softc *); +#endif + +#ifdef __amd64__ +#define ACPI_PAGETABLES 3 +#else +#define ACPI_PAGETABLES 0 +#endif + +#define WAKECODE_VADDR(sc) ((sc)->acpi_wakeaddr + (ACPI_PAGETABLES * PAGE_SIZE)) +#define WAKECODE_PADDR(sc) ((sc)->acpi_wakephys + (ACPI_PAGETABLES * PAGE_SIZE)) +#define WAKECODE_FIXUP(offset, type, val) do { \ + type *addr; \ + addr = (type *)(WAKECODE_VADDR(sc) + offset); \ + *addr = val; \ +} while (0) + +static void +acpi_stop_beep(void *arg) +{ + + if (acpi_resume_beep != 0) + timer_spkr_release(); +} + +#ifdef SMP +static int +acpi_wakeup_ap(struct acpi_softc *sc, int cpu) +{ + int vector = (WAKECODE_PADDR(sc) >> 12) & 0xff; + int apic_id = cpu_apic_ids[cpu]; + int ms; + + WAKECODE_FIXUP(wakeup_pcb, struct pcb *, susppcbs[cpu]); + WAKECODE_FIXUP(wakeup_gdt, uint16_t, susppcbs[cpu]->pcb_gdt.rd_limit); + WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, + susppcbs[cpu]->pcb_gdt.rd_base); + + /* do an INIT IPI: assert RESET */ + lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE | + APIC_LEVEL_ASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT, apic_id); + + /* wait for pending status end */ + lapic_ipi_wait(-1); + + /* do an INIT IPI: deassert RESET */ + lapic_ipi_raw(APIC_DEST_ALLESELF | APIC_TRIGMOD_LEVEL | + APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT, 0); + + /* wait for pending status end */ + DELAY(10000); /* wait ~10mS */ + lapic_ipi_wait(-1); + + /* + * next we do a STARTUP IPI: the previous INIT IPI might still be + * latched, (P5 bug) this 1st STARTUP would then terminate + * immediately, and the previously started INIT IPI would continue. OR + * the previous INIT IPI has already run. and this STARTUP IPI will + * run. OR the previous INIT IPI was ignored. and this STARTUP IPI + * will run. + */ + + /* do a STARTUP IPI */ + lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE | + APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_STARTUP | + vector, apic_id); + lapic_ipi_wait(-1); + DELAY(200); /* wait ~200uS */ + + /* + * finally we do a 2nd STARTUP IPI: this 2nd STARTUP IPI should run IF + * the previous STARTUP IPI was cancelled by a latched INIT IPI. OR + * this STARTUP IPI will be ignored, as only ONE STARTUP IPI is + * recognized after hardware RESET or INIT IPI. + */ + + lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE | + APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_STARTUP | + vector, apic_id); + lapic_ipi_wait(-1); + DELAY(200); /* wait ~200uS */ + + /* Wait up to 5 seconds for it to resume. */ + for (ms = 0; ms < 5000; ms++) { + if (!CPU_ISSET(cpu, &suspended_cpus)) + return (1); /* return SUCCESS */ + DELAY(1000); + } + return (0); /* return FAILURE */ +} + +#define WARMBOOT_TARGET 0 +#define WARMBOOT_OFF (KERNBASE + 0x0467) +#define WARMBOOT_SEG (KERNBASE + 0x0469) + +#define CMOS_REG (0x70) +#define CMOS_DATA (0x71) +#define BIOS_RESET (0x0f) +#define BIOS_WARM (0x0a) + +static void +acpi_wakeup_cpus(struct acpi_softc *sc) +{ + uint32_t mpbioswarmvec; + int cpu; + u_char mpbiosreason; + + /* save the current value of the warm-start vector */ + mpbioswarmvec = *((uint32_t *)WARMBOOT_OFF); + outb(CMOS_REG, BIOS_RESET); + mpbiosreason = inb(CMOS_DATA); + + /* setup a vector to our boot code */ + *((volatile u_short *)WARMBOOT_OFF) = WARMBOOT_TARGET; + *((volatile u_short *)WARMBOOT_SEG) = WAKECODE_PADDR(sc) >> 4; + outb(CMOS_REG, BIOS_RESET); + outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */ + + /* Wake up each AP. */ + for (cpu = 1; cpu < mp_ncpus; cpu++) { + if (!CPU_ISSET(cpu, &suspcpus)) + continue; + if (acpi_wakeup_ap(sc, cpu) == 0) { + /* restore the warmstart vector */ + *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; + panic("acpi_wakeup: failed to resume AP #%d (PHY #%d)", + cpu, cpu_apic_ids[cpu]); + } + } + + /* restore the warmstart vector */ + *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; + + outb(CMOS_REG, BIOS_RESET); + outb(CMOS_DATA, mpbiosreason); +} +#endif + +int +acpi_sleep_machdep(struct acpi_softc *sc, int state) +{ + ACPI_STATUS status; + + if (sc->acpi_wakeaddr == 0ul) + return (-1); /* couldn't alloc wake memory */ + +#ifdef SMP + suspcpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &suspcpus); +#endif + + if (acpi_resume_beep != 0) + timer_spkr_acquire(); + + AcpiSetFirmwareWakingVector(WAKECODE_PADDR(sc)); + + intr_suspend(); + + if (savectx(susppcbs[0])) { +#ifdef __amd64__ + ctx_fpusave(susppcbs[0]->pcb_fpususpend); +#endif +#ifdef SMP + if (!CPU_EMPTY(&suspcpus) && suspend_cpus(suspcpus) == 0) { + device_printf(sc->acpi_dev, "Failed to suspend APs\n"); + return (0); /* couldn't sleep */ + } +#endif + + WAKECODE_FIXUP(resume_beep, uint8_t, (acpi_resume_beep != 0)); + WAKECODE_FIXUP(reset_video, uint8_t, (acpi_reset_video != 0)); + + WAKECODE_FIXUP(wakeup_cr4, register_t, susppcbs[0]->pcb_cr4); + WAKECODE_FIXUP(wakeup_pcb, struct pcb *, susppcbs[0]); + WAKECODE_FIXUP(wakeup_gdt, uint16_t, + susppcbs[0]->pcb_gdt.rd_limit); + WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, + susppcbs[0]->pcb_gdt.rd_base); + + /* Call ACPICA to enter the desired sleep state */ + if (state == ACPI_STATE_S4 && sc->acpi_s4bios) + status = AcpiEnterSleepStateS4bios(); + else + status = AcpiEnterSleepState(state, acpi_sleep_flags); + if (ACPI_FAILURE(status)) { + device_printf(sc->acpi_dev, + "AcpiEnterSleepState failed - %s\n", + AcpiFormatException(status)); + return (0); /* couldn't sleep */ + } + + for (;;) + ia32_pause(); + } + + return (1); /* wakeup successfully */ +} + +int +acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result, + int intr_enabled) +{ + + if (sleep_result == -1) + return (sleep_result); + + if (!intr_enabled) { + /* Wakeup MD procedures in interrupt disabled context */ + if (sleep_result == 1) { + pmap_init_pat(); +#if 0 + load_cr3(susppcbs[0]->pcb_cr3); +#endif + initializecpu(); + PCPU_SET(switchtime, 0); + PCPU_SET(switchticks, ticks); +#ifdef SMP + if (!CPU_EMPTY(&suspcpus)) + acpi_wakeup_cpus(sc); +#endif + } + +#ifdef SMP + if (!CPU_EMPTY(&suspcpus)) + restart_cpus(suspcpus); +#endif + mca_resume(); + intr_resume(); + + AcpiSetFirmwareWakingVector(0); + } else { + /* Wakeup MD procedures in interrupt enabled context */ + if (sleep_result == 1 && mem_range_softc.mr_op != NULL && + mem_range_softc.mr_op->reinit != NULL) + mem_range_softc.mr_op->reinit(&mem_range_softc); + } + + return (sleep_result); +} + +static void * +acpi_alloc_wakeup_handler(void) +{ + void *wakeaddr; + int i; + + /* + * Specify the region for our wakeup code. We want it in the low 1 MB + * region, excluding real mode IVT (0-0x3ff), BDA (0x400-0x4ff), EBDA + * (less than 128KB, below 0xa0000, must be excluded by SMAP and DSDT), + * and ROM area (0xa0000 and above). The temporary page tables must be + * page-aligned. + */ + wakeaddr = contigmalloc((ACPI_PAGETABLES + 1) * PAGE_SIZE, M_DEVBUF, + M_WAITOK, 0x500, 0xa0000, PAGE_SIZE, 0ul); + if (wakeaddr == NULL) { + printf("%s: can't alloc wake memory\n", __func__); + return (NULL); + } + if (EVENTHANDLER_REGISTER(power_resume, acpi_stop_beep, NULL, + EVENTHANDLER_PRI_LAST) == NULL) { + printf("%s: can't register event handler\n", __func__); + contigfree(wakeaddr, (ACPI_PAGETABLES + 1) * PAGE_SIZE, M_DEVBUF); + return (NULL); + } + susppcbs = malloc(mp_ncpus * sizeof(*susppcbs), M_DEVBUF, M_WAITOK); + for (i = 0; i < mp_ncpus; i++) { + susppcbs[i] = malloc(sizeof(**susppcbs), M_DEVBUF, M_WAITOK); +#ifdef __amd64__ + susppcbs[i]->pcb_fpususpend = alloc_fpusave(M_WAITOK); +#endif + } + + return (wakeaddr); +} + +void +acpi_install_wakeup_handler(struct acpi_softc *sc) +{ + static void *wakeaddr = NULL; +#ifdef __amd64__ + uint64_t *pt4, *pt3, *pt2; + int i; +#endif + + if (wakeaddr != NULL) + return; + + wakeaddr = acpi_alloc_wakeup_handler(); + if (wakeaddr == NULL) + return; + + sc->acpi_wakeaddr = (vm_offset_t)wakeaddr; + sc->acpi_wakephys = vtophys(wakeaddr); + + bcopy(wakecode, (void *)WAKECODE_VADDR(sc), sizeof(wakecode)); + + /* Patch GDT base address, ljmp targets. */ + WAKECODE_FIXUP((bootgdtdesc + 2), uint32_t, + WAKECODE_PADDR(sc) + bootgdt); + WAKECODE_FIXUP((wakeup_sw32 + 2), uint32_t, + WAKECODE_PADDR(sc) + wakeup_32); +#ifdef __amd64__ + WAKECODE_FIXUP((wakeup_sw64 + 1), uint32_t, + WAKECODE_PADDR(sc) + wakeup_64); + WAKECODE_FIXUP(wakeup_pagetables, uint32_t, sc->acpi_wakephys); +#endif + + /* Save pointers to some global data. */ + WAKECODE_FIXUP(wakeup_ret, void *, resumectx); +#ifdef __amd64__ + WAKECODE_FIXUP(wakeup_cr3, uint64_t, KPML4phys); +#else +#ifdef PAE + WAKECODE_FIXUP(wakeup_cr3, register_t, vtophys(kernel_pmap->pm_pdpt)); +#else + WAKECODE_FIXUP(wakeup_cr3, register_t, vtophys(kernel_pmap->pm_pdir)); +#endif +#endif + +#ifdef __amd64__ + /* Build temporary page tables below realmode code. */ + pt4 = wakeaddr; + pt3 = pt4 + (PAGE_SIZE) / sizeof(uint64_t); + pt2 = pt3 + (PAGE_SIZE) / sizeof(uint64_t); + + /* Create the initial 1GB replicated page tables */ + for (i = 0; i < 512; i++) { + /* + * Each slot of the level 4 pages points + * to the same level 3 page + */ + pt4[i] = (uint64_t)(sc->acpi_wakephys + PAGE_SIZE); + pt4[i] |= PG_V | PG_RW | PG_U; + + /* + * Each slot of the level 3 pages points + * to the same level 2 page + */ + pt3[i] = (uint64_t)(sc->acpi_wakephys + (2 * PAGE_SIZE)); + pt3[i] |= PG_V | PG_RW | PG_U; + + /* The level 2 page slots are mapped with 2MB pages for 1GB. */ + pt2[i] = i * (2 * 1024 * 1024); + pt2[i] |= PG_V | PG_RW | PG_PS | PG_U; + } +#endif + + if (bootverbose) + device_printf(sc->acpi_dev, "wakeup code va %#jx pa %#jx\n", + (uintmax_t)sc->acpi_wakeaddr, (uintmax_t)sc->acpi_wakephys); +} From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 01:41:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 50B68106566B; Sat, 9 Jun 2012 01:41:42 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3AFE38FC08; Sat, 9 Jun 2012 01:41:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q591fgI1098660; Sat, 9 Jun 2012 01:41:42 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q591fgJf098658; Sat, 9 Jun 2012 01:41:42 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201206090141.q591fgJf098658@svn.freebsd.org> From: Warren Block Date: Sat, 9 Jun 2012 01:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236773 - stable/9/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 01:41:42 -0000 Author: wblock (doc committer) Date: Sat Jun 9 01:41:41 2012 New Revision: 236773 URL: http://svn.freebsd.org/changeset/base/236773 Log: MFC r236122,r236595: Wording corrections and simplifications. Approved by: gjb (mentor) Modified: stable/9/share/man/man4/vlan.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/vlan.4 ============================================================================== --- stable/9/share/man/man4/vlan.4 Sat Jun 9 00:37:26 2012 (r236772) +++ stable/9/share/man/man4/vlan.4 Sat Jun 9 01:41:41 2012 (r236773) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 25, 2011 +.Dd June 4, 2012 .Dt VLAN 4 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd "IEEE 802.1Q VLAN network interface" .Sh SYNOPSIS To compile this driver into the kernel, -place the following lines in your +place the following line in your kernel configuration file: .Bd -ragged -offset indent .Cd "device vlan" @@ -79,16 +79,16 @@ to a properly configured switch port. The VLAN tag should match one of those set up in the switched network. .Pp -Initially .Nm -assumes the same minimum length for tagged and untagged frames. -This mode is selected by the +initially assumes the same minimum length for tagged and untagged frames. +This mode is selected by setting the .Xr sysctl 8 variable .Va net.link.vlan.soft_pad -set to 0 (default). -However, there are network devices that fail to adjust frame length, -should it fall below the allowed minimum due to untagging. +to 0 +.Pq default . +However, there are network devices that fail to adjust frame length +when it falls below the allowed minimum due to untagging. Such devices should be able to interoperate with .Nm after changing the value of @@ -97,7 +97,7 @@ to 1. In the latter mode, .Nm will pad short frames before tagging them -so that their length stays not less than the minimum value +so that their length is not less than the minimum value after untagging by the non-compliant devices. .Sh HARDWARE The @@ -111,7 +111,7 @@ receive and transmit long frames (up to header and FCS). The capabilities may be user-controlled by the respective parameters to .Xr ifconfig 8 , -.Cm vlanhwtag +.Cm vlanhwtag , and .Cm vlanmtu . However, a physical interface is not obliged to react to them: @@ -119,8 +119,8 @@ It may have either capability enabled pe a way to turn it off. The whole issue is very specific to a particular device and its driver. .Pp -By now, the list of physical interfaces able of full VLAN processing -in the hardware is limited to the following devices: +At present, these devices are capable of full VLAN processing +in hardware: .Xr ae 4 , .Xr age 4 , .Xr alc 4 , @@ -146,11 +146,10 @@ in the hardware is limited to the follow and .Xr vge 4 . .Pp -The rest of the Ethernet interfaces can run -VLANs using software emulation in the +Other Ethernet interfaces can run VLANs using software emulation in the .Nm driver. -However, some of them lack the capability +However, some lack the capability of transmitting and receiving long frames. Assigning such an interface as the parent to .Nm @@ -163,9 +162,8 @@ connectivity problems due to massive, in .Xr icmp 4 filtering that breaks the Path MTU Discovery mechanism. .Pp -The following interfaces support long frames for -.Nm -natively: +These interfaces natively support long frames for +.Nm : .Xr axe 4 , .Xr bfe 4 , .Xr cas 4 , @@ -198,7 +196,7 @@ for use and calculates the appropriate frame MTU based on the capabilities of the parent interface. Some other interfaces not listed above may handle long frames, -but they do not advertise this ability of theirs. +but they do not advertise this ability. The MTU setting on .Nm can be corrected manually if used in conjunction with such a parent interface. From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 01:42:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5858F106564A; Sat, 9 Jun 2012 01:42:23 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 418FF8FC14; Sat, 9 Jun 2012 01:42:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q591gNFI098725; Sat, 9 Jun 2012 01:42:23 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q591gNrv098723; Sat, 9 Jun 2012 01:42:23 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201206090142.q591gNrv098723@svn.freebsd.org> From: Warren Block Date: Sat, 9 Jun 2012 01:42:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236774 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 01:42:23 -0000 Author: wblock (doc committer) Date: Sat Jun 9 01:42:22 2012 New Revision: 236774 URL: http://svn.freebsd.org/changeset/base/236774 Log: MFC r236122,r236595: Wording corrections and simplifications. Approved by: gjb (mentor) Modified: stable/8/share/man/man4/vlan.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/vlan.4 ============================================================================== --- stable/8/share/man/man4/vlan.4 Sat Jun 9 01:41:41 2012 (r236773) +++ stable/8/share/man/man4/vlan.4 Sat Jun 9 01:42:22 2012 (r236774) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 25, 2011 +.Dd June 4, 2012 .Dt VLAN 4 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd "IEEE 802.1Q VLAN network interface" .Sh SYNOPSIS To compile this driver into the kernel, -place the following lines in your +place the following line in your kernel configuration file: .Bd -ragged -offset indent .Cd "device vlan" @@ -79,16 +79,16 @@ to a properly configured switch port. The VLAN tag should match one of those set up in the switched network. .Pp -Initially .Nm -assumes the same minimum length for tagged and untagged frames. -This mode is selected by the +initially assumes the same minimum length for tagged and untagged frames. +This mode is selected by setting the .Xr sysctl 8 variable .Va net.link.vlan.soft_pad -set to 0 (default). -However, there are network devices that fail to adjust frame length, -should it fall below the allowed minimum due to untagging. +to 0 +.Pq default . +However, there are network devices that fail to adjust frame length +when it falls below the allowed minimum due to untagging. Such devices should be able to interoperate with .Nm after changing the value of @@ -97,7 +97,7 @@ to 1. In the latter mode, .Nm will pad short frames before tagging them -so that their length stays not less than the minimum value +so that their length is not less than the minimum value after untagging by the non-compliant devices. .Sh HARDWARE The @@ -111,7 +111,7 @@ receive and transmit long frames (up to header and FCS). The capabilities may be user-controlled by the respective parameters to .Xr ifconfig 8 , -.Cm vlanhwtag +.Cm vlanhwtag , and .Cm vlanmtu . However, a physical interface is not obliged to react to them: @@ -119,8 +119,8 @@ It may have either capability enabled pe a way to turn it off. The whole issue is very specific to a particular device and its driver. .Pp -By now, the list of physical interfaces able of full VLAN processing -in the hardware is limited to the following devices: +At present, these devices are capable of full VLAN processing +in hardware: .Xr ae 4 , .Xr age 4 , .Xr alc 4 , @@ -146,11 +146,10 @@ in the hardware is limited to the follow and .Xr vge 4 . .Pp -The rest of the Ethernet interfaces can run -VLANs using software emulation in the +Other Ethernet interfaces can run VLANs using software emulation in the .Nm driver. -However, some of them lack the capability +However, some lack the capability of transmitting and receiving long frames. Assigning such an interface as the parent to .Nm @@ -163,9 +162,8 @@ connectivity problems due to massive, in .Xr icmp 4 filtering that breaks the Path MTU Discovery mechanism. .Pp -The following interfaces support long frames for -.Nm -natively: +These interfaces natively support long frames for +.Nm : .Xr axe 4 , .Xr bfe 4 , .Xr cas 4 , @@ -198,7 +196,7 @@ for use and calculates the appropriate frame MTU based on the capabilities of the parent interface. Some other interfaces not listed above may handle long frames, -but they do not advertise this ability of theirs. +but they do not advertise this ability. The MTU setting on .Nm can be corrected manually if used in conjunction with such a parent interface. From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 01:42:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 29F971065674; Sat, 9 Jun 2012 01:42:56 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14C068FC0A; Sat, 9 Jun 2012 01:42:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q591gtDm098780; Sat, 9 Jun 2012 01:42:55 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q591gtT1098778; Sat, 9 Jun 2012 01:42:55 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201206090142.q591gtT1098778@svn.freebsd.org> From: Warren Block Date: Sat, 9 Jun 2012 01:42:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236775 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 01:42:56 -0000 Author: wblock (doc committer) Date: Sat Jun 9 01:42:55 2012 New Revision: 236775 URL: http://svn.freebsd.org/changeset/base/236775 Log: MFC r236122,r236595: Wording corrections and simplifications. Approved by: gjb (mentor) Modified: stable/7/share/man/man4/vlan.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/vlan.4 ============================================================================== --- stable/7/share/man/man4/vlan.4 Sat Jun 9 01:42:22 2012 (r236774) +++ stable/7/share/man/man4/vlan.4 Sat Jun 9 01:42:55 2012 (r236775) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 30, 2010 +.Dd June 4, 2012 .Dt VLAN 4 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd "IEEE 802.1Q VLAN network interface" .Sh SYNOPSIS To compile this driver into the kernel, -place the following lines in your +place the following line in your kernel configuration file: .Bd -ragged -offset indent .Cd "device vlan" @@ -79,16 +79,16 @@ to a properly configured switch port. The VLAN tag should match one of those set up in the switched network. .Pp -Initially .Nm -assumes the same minimum length for tagged and untagged frames. -This mode is selected by the +initially assumes the same minimum length for tagged and untagged frames. +This mode is selected by setting the .Xr sysctl 8 variable .Va net.link.vlan.soft_pad -set to 0 (default). -However, there are network devices that fail to adjust frame length, -should it fall below the allowed minimum due to untagging. +to 0 +.Pq default . +However, there are network devices that fail to adjust frame length +when it falls below the allowed minimum due to untagging. Such devices should be able to interoperate with .Nm after changing the value of @@ -97,7 +97,7 @@ to 1. In the latter mode, .Nm will pad short frames before tagging them -so that their length stays not less than the minimum value +so that their length is not less than the minimum value after untagging by the non-compliant devices. .Sh HARDWARE The @@ -111,7 +111,7 @@ receive and transmit long frames (up to header and FCS). The capabilities may be user-controlled by the respective parameters to .Xr ifconfig 8 , -.Cm vlanhwtag +.Cm vlanhwtag , and .Cm vlanmtu . However, a physical interface is not obliged to react to them: @@ -119,8 +119,8 @@ It may have either capability enabled pe a way to turn it off. The whole issue is very specific to a particular device and its driver. .Pp -By now, the list of physical interfaces able of full VLAN processing -in the hardware is limited to the following devices: +At present, these devices are capable of full VLAN processing +in hardware: .Xr ae 4 , .Xr age 4 , .Xr alc 4 , @@ -145,11 +145,10 @@ in the hardware is limited to the follow and .Xr vge 4 . .Pp -The rest of the Ethernet interfaces can run -VLANs using software emulation in the +Other Ethernet interfaces can run VLANs using software emulation in the .Nm driver. -However, some of them lack the capability +However, some lack the capability of transmitting and receiving long frames. Assigning such an interface as the parent to .Nm @@ -162,9 +161,8 @@ connectivity problems due to massive, in .Xr icmp 4 filtering that breaks the Path MTU Discovery mechanism. .Pp -The following interfaces support long frames for -.Nm -natively: +These interfaces natively support long frames for +.Nm : .Xr bfe 4 , .Xr cas 4 , .Xr dc 4 , @@ -196,7 +194,7 @@ for use and calculates the appropriate frame MTU based on the capabilities of the parent interface. Some other interfaces not listed above may handle long frames, -but they do not advertise this ability of theirs. +but they do not advertise this ability. The MTU setting on .Nm can be corrected manually if used in conjunction with such a parent interface. From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 03:33:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45E65106564A; Sat, 9 Jun 2012 03:33:07 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30AA18FC08; Sat, 9 Jun 2012 03:33:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q593X7T1003638; Sat, 9 Jun 2012 03:33:07 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q593X64Y003636; Sat, 9 Jun 2012 03:33:06 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201206090333.q593X64Y003636@svn.freebsd.org> From: Glen Barber Date: Sat, 9 Jun 2012 03:33:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236776 - head/cddl/contrib/opensolaris/cmd/zpool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 03:33:07 -0000 Author: gjb (doc committer) Date: Sat Jun 9 03:33:06 2012 New Revision: 236776 URL: http://svn.freebsd.org/changeset/base/236776 Log: Fix a typo: s/deafult/default MFC after: 3 days Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sat Jun 9 01:42:55 2012 (r236775) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sat Jun 9 03:33:06 2012 (r236776) @@ -656,7 +656,7 @@ creates a temporary pool that is never c .It Sy dedupditto Ns = Ns Ar number Threshold for the number of block ditto copies. If the reference count for a deduplicated block increases above this number, a new ditto copy of this block -is automatically stored. Deafult setting is +is automatically stored. Default setting is .Cm 0 . .It Sy delegation Ns = Ns Cm on No | Cm off Controls whether a non-privileged user is granted access based on the dataset From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 03:34:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A20221065672; Sat, 9 Jun 2012 03:34:35 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 815658FC17; Sat, 9 Jun 2012 03:34:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q593YZ8Q003743; Sat, 9 Jun 2012 03:34:35 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q593YZdg003741; Sat, 9 Jun 2012 03:34:35 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201206090334.q593YZdg003741@svn.freebsd.org> From: Glen Barber Date: Sat, 9 Jun 2012 03:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236777 - head/cddl/contrib/opensolaris/cmd/zpool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 03:34:35 -0000 Author: gjb (doc committer) Date: Sat Jun 9 03:34:34 2012 New Revision: 236777 URL: http://svn.freebsd.org/changeset/base/236777 Log: Clean up trailing whitespace. MFC after: 3 days X-MFC-With: r236776 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sat Jun 9 03:33:06 2012 (r236776) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sat Jun 9 03:34:34 2012 (r236777) @@ -189,7 +189,7 @@ for information on managing datasets. A .Qq virtual device .Pq No vdev -describes a single device or a collection of devices organized according to +describes a single device or a collection of devices organized according to certain performance and fault characteristics. The following virtual devices are supported: .Bl -tag @@ -237,7 +237,7 @@ A group can have single-, double- , or triple parity, meaning that the .No raidz group can sustain one, two, or three failures, respectively, without -losing any data. The +losing any data. The .Sy raidz1 No vdev type specifies a single-parity .No raidz @@ -287,7 +287,7 @@ writes are load-balanced between devices .No raidz .No vdev types are not supported for the intent log. For more information, -see the +see the .Qq Sx Intent Log section. .It Sy cache @@ -309,13 +309,13 @@ A pool can have any number of virtual de (known as .Qq root .No vdev Ns s). -Data is dynamically distributed across all top-level devices to balance data +Data is dynamically distributed across all top-level devices to balance data among devices. As new virtual devices are added, .Tn ZFS automatically places data on the newly available devices. .Pp Virtual devices are specified one at a time on the command line, separated by -whitespace. The keywords +whitespace. The keywords .Qq mirror and .Qq raidz @@ -428,7 +428,7 @@ allows devices to be associated with poo .Qq hot spares . These devices are not actively used in the pool, but when an active device fails, it is automatically replaced by a hot spare. To create a pool with hot -spares, specify a +spares, specify a .Qq spare .No vdev with any number of devices. For example, @@ -458,7 +458,7 @@ pools. .Pp Spares cannot replace log devices. .Ss Intent Log -The +The .Tn ZFS Intent Log .Pq Tn ZIL @@ -582,7 +582,7 @@ the typical paths are not valid. .Sy altroot is not a persistent property. It is valid only while the system is up. Setting -.Sy altroot +.Sy altroot defaults to using .Cm cachefile=none , though this may be overridden using an explicit setting. @@ -627,9 +627,9 @@ This property can also be referred to by .It Sy autoreplace Ns = Ns Cm on No | Cm off Controls automatic device replacement. If set to .Qq Cm off , -device replacement must be initiated by the administrator by using the +device replacement must be initiated by the administrator by using the .Qq Nm Cm replace -command. If set to +command. If set to .Qq Cm on , any new device, found in the same physical location as a device that previously belonged to the pool, is @@ -650,7 +650,7 @@ pool configuration in a different locati .Qq Nm Cm import Fl c . Setting it to the special value .Qq Cm none -creates a temporary pool that is never cached, and the special value +creates a temporary pool that is never cached, and the special value .Cm '' (empty string) uses the default location. .It Sy dedupditto Ns = Ns Ar number @@ -861,7 +861,7 @@ root dataset cannot be mounted. This can option. .Bl -tag -width indent .It Fl f -Forces use of +Forces use of .Ar vdev Ns s, even if they appear in use or specify a conflicting replication level. Not all devices can be overridden in this manner. @@ -897,7 +897,7 @@ or .Qq Cm altroot Ns Pa /pool if .Sy altroot -is specified. The mount point must be an absolute path, +is specified. The mount point must be an absolute path, .Qq Cm legacy , or .Qq Cm none . @@ -1234,7 +1234,7 @@ seconds until .Sy Ctrl-C is pressed. If no .Ar pools -are specified, statistics for every pool in the system is shown. If +are specified, statistics for every pool in the system is shown. If .Ar count is specified, the command exits after .Ar count @@ -1292,7 +1292,7 @@ When given an interval, the output is pr .Ar interval seconds until .Sy Ctrl-C -is pressed. If +is pressed. If .Ar count is specified, the command exits after .Ar count @@ -1396,7 +1396,7 @@ This is equivalent to attaching waiting for it to resilver, and then detaching .Ar old_device . .Pp -The size of +The size of .Ar new_device must be greater than or equal to the minimum size of all the devices in a mirror or @@ -1407,7 +1407,7 @@ configuration. is required if the pool is not redundant. If .Ar new_device is not specified, it defaults to -.Ar old_device . +.Ar old_device . This form of replacement is useful after an existing disk has failed and has been physically replaced. In this case, the new disk may have the same .Pa /dev @@ -1494,12 +1494,12 @@ unless overridden by a device specificat .Pp When using a .Ar device -argument, +argument, .Cm split -includes the specified device(s) in a new pool and, should any devices remain +includes the specified device(s) in a new pool and, should any devices remain unspecified, assigns the last device in each mirror .No vdev -to that pool, as it does normally. If you are uncertain about the outcome of a +to that pool, as it does normally. If you are uncertain about the outcome of a .Cm split command, use the .Fl n @@ -1552,7 +1552,7 @@ When given an interval, the output is pr .Ar interval seconds until .Sy Ctrl-C -is pressed. If +is pressed. If .Ar count is specified, the command exits after .Ar count From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 06:31:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ADCBA106564A; Sat, 9 Jun 2012 06:31:06 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qa0-f47.google.com (mail-qa0-f47.google.com [209.85.216.47]) by mx1.freebsd.org (Postfix) with ESMTP id 1CFC28FC16; Sat, 9 Jun 2012 06:31:06 +0000 (UTC) Received: by qabg1 with SMTP id g1so1167228qab.13 for ; Fri, 08 Jun 2012 23:31:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; bh=tUsWgIBQ6jl0Z/9QuYnJgdrr0ZgMC2sNXuPfA2fMoQU=; b=v/8+Zhyc9fSqZ8ZL6pmVR/QmmNPbvv7+EJTa4UvBda8tqAMLg4bsGAmWrTgpwh+0XI qsLZVb0rCUOWTtWgk763yRGkuqGuwe/TimMrC+QE1ZcesR8ZrwKwCCnq2OLe9ATOlj8J thmSUPruVYDxo31TF81eCEkjMm2CB1tDYykEDdADtHP35hNbmu0M2svbt6+XqnK80QGA TgASKB5nt9eOmQhb7p3R5epOk7SHzEXQVSyNfNtW0TniwTc8nuwniIpQwsxyXqRSO3KD RjJT0RKRMz79aiEBYmaAgsewIY/2R84aD4x6zte8cRh3pbM013oHTC3Eie1hgXkHjLA6 FvzA== Received: by 10.224.73.1 with SMTP id o1mr1659835qaj.13.1339223465362; Fri, 08 Jun 2012 23:31:05 -0700 (PDT) Received: from kan.dyndns.org (c-24-63-226-98.hsd1.ma.comcast.net. [24.63.226.98]) by mx.google.com with ESMTPS id ci17sm9224796qab.1.2012.06.08.23.31.04 (version=SSLv3 cipher=OTHER); Fri, 08 Jun 2012 23:31:05 -0700 (PDT) Date: Sat, 9 Jun 2012 02:30:59 -0400 From: Alexander Kabaev To: David Chisnall Message-ID: <20120609023059.6cd9717a@kan.dyndns.org> In-Reply-To: <201205281211.q4SCB1EL010543@svn.freebsd.org> References: <201205281211.q4SCB1EL010543@svn.freebsd.org> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; amd64-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/6jIgiKMOmlPsVkSn.mVmZye"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r236177 - head/gnu/lib/libsupc++ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 06:31:06 -0000 --Sig_/6jIgiKMOmlPsVkSn.mVmZye Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 28 May 2012 12:11:01 +0000 (UTC) David Chisnall wrote: > Author: theraven > Date: Mon May 28 12:11:00 2012 > New Revision: 236177 > URL: http://svn.freebsd.org/changeset/base/236177 >=20 > Log: > Correctly export operator new / delete for things linking against > libsupc++ but not libstdc++. > =20 > Unfortunately, it appears that libsupc++ / libstdc++ have a > different idea of the type of size_t to the rest of the world, which > may cause problems later on... > =20 > Reported by: des > MFC after: 1 week >=20 > Modified: > head/gnu/lib/libsupc++/Version.map >=20 > Modified: head/gnu/lib/libsupc++/Version.map > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/gnu/lib/libsupc++/Version.map Mon May 28 10:45:51 > 2012 (r236176) +++ head/gnu/lib/libsupc++/Version.map > Mon May 28 12:11:00 2012 (r236177) @@ -126,6 +126,16 @@ > CXXABI_1.3 { # __gnu_cxx::_verbose_terminate_handler() > _ZN9__gnu_cxx27__verbose_terminate_handlerEv; > =20 > + # new / delete operators > + _Znaj; > + _ZnajRKSt9nothrow_t; > + _Znwj; > + _ZnwjRKSt9nothrow_t; > + _ZdaPv; > + _ZdaPvRKSt9nothrow_t; > + _ZdlPv; > + _ZdlPvRKSt9nothrow_t; > + > local: > *; > }; Please do not MFC this just yet. This commit is wrong and should be backed out. --=20 Alexander Kabaev --Sig_/6jIgiKMOmlPsVkSn.mVmZye Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iD8DBQFP0u2nQ6z1jMm+XZYRAvhnAKCGoXZXnmbAOmS3OTRhVmG7Zv3e7gCgzr25 ajOm42esjrr4buhxZLoS+rU= =jft7 -----END PGP SIGNATURE----- --Sig_/6jIgiKMOmlPsVkSn.mVmZye-- From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 06:43:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C90FA1065670; Sat, 9 Jun 2012 06:43:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B15018FC20; Sat, 9 Jun 2012 06:43:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q596hRaI011721; Sat, 9 Jun 2012 06:43:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q596hRco011710; Sat, 9 Jun 2012 06:43:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206090643.q596hRco011710@svn.freebsd.org> From: Alexander Motin Date: Sat, 9 Jun 2012 06:43:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236778 - in stable/9: sbin/camcontrol sys/cam sys/cam/ata sys/cam/scsi sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 06:43:27 -0000 Author: mav Date: Sat Jun 9 06:43:26 2012 New Revision: 236778 URL: http://svn.freebsd.org/changeset/base/236778 Log: MFC r235897: - Add low-level support for SATA Enclosure Management Bridge (SEMB) devices -- SATA equivalents of the SCSI SES/SAF-TE devices. - Add some utility functions for SCSI SAF-TE devices access. Sponsored by: iXsystems, Inc. Modified: stable/9/sbin/camcontrol/camcontrol.c stable/9/sys/cam/ata/ata_all.c stable/9/sys/cam/ata/ata_all.h stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/ata/ata_xpt.c stable/9/sys/cam/cam_ccb.h stable/9/sys/cam/cam_xpt.c stable/9/sys/cam/scsi/scsi_all.c stable/9/sys/cam/scsi/scsi_all.h stable/9/sys/sys/ata.h Directory Properties: stable/9/sbin/camcontrol/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.c Sat Jun 9 03:34:34 2012 (r236777) +++ stable/9/sbin/camcontrol/camcontrol.c Sat Jun 9 06:43:26 2012 (r236778) @@ -456,7 +456,7 @@ getdevtree(void) case DEV_MATCH_DEVICE: { struct device_match_result *dev_result; char vendor[16], product[48], revision[16]; - char tmpstr[256]; + char fw[5], tmpstr[256]; dev_result = &ccb.cdm.matches[i].result.device_result; @@ -495,6 +495,25 @@ getdevtree(void) sizeof(revision)); sprintf(tmpstr, "<%s %s>", product, revision); + } else if (dev_result->protocol == PROTO_SEMB) { + struct sep_identify_data *sid; + + sid = (struct sep_identify_data *) + &dev_result->ident_data; + cam_strvis(vendor, sid->vendor_id, + sizeof(sid->vendor_id), + sizeof(vendor)); + cam_strvis(product, sid->product_id, + sizeof(sid->product_id), + sizeof(product)); + cam_strvis(revision, sid->product_rev, + sizeof(sid->product_rev), + sizeof(revision)); + cam_strvis(fw, sid->firmware_rev, + sizeof(sid->firmware_rev), + sizeof(fw)); + sprintf(tmpstr, "<%s %s %s %s>", + vendor, product, revision, fw); } else { sprintf(tmpstr, "<>"); } Modified: stable/9/sys/cam/ata/ata_all.c ============================================================================== --- stable/9/sys/cam/ata/ata_all.c Sat Jun 9 03:34:34 2012 (r236777) +++ stable/9/sys/cam/ata/ata_all.c Sat Jun 9 06:43:26 2012 (r236778) @@ -108,6 +108,16 @@ ata_op_string(struct ata_cmd *cmd) case 0x51: return ("CONFIGURE_STREAM"); case 0x60: return ("READ_FPDMA_QUEUED"); case 0x61: return ("WRITE_FPDMA_QUEUED"); + case 0x67: + if (cmd->features == 0xec) + return ("SEP_ATTN IDENTIFY"); + switch (cmd->lba_low) { + case 0x00: return ("SEP_ATTN READ BUFFER"); + case 0x02: return ("SEP_ATTN RECEIVE DIAGNOSTIC RESULTS"); + case 0x80: return ("SEP_ATTN WRITE BUFFER"); + case 0x82: return ("SEP_ATTN SEND DIAGNOSTIC"); + } + return ("SEP_ATTN"); case 0x70: return ("SEEK"); case 0x87: return ("CFA_TRANSLATE_SECTOR"); case 0x90: return ("EXECUTE_DEVICE_DIAGNOSTIC"); @@ -286,6 +296,21 @@ ata_print_ident(struct ata_params *ident printf(" device\n"); } +void +semb_print_ident(struct sep_identify_data *ident_data) +{ + char vendor[9], product[17], revision[5], fw[5], in[7], ins[5]; + + cam_strvis(vendor, ident_data->vendor_id, 8, sizeof(vendor)); + cam_strvis(product, ident_data->product_id, 16, sizeof(product)); + cam_strvis(revision, ident_data->product_rev, 4, sizeof(revision)); + cam_strvis(fw, ident_data->firmware_rev, 4, sizeof(fw)); + cam_strvis(in, ident_data->interface_id, 6, sizeof(in)); + cam_strvis(ins, ident_data->interface_rev, 4, sizeof(ins)); + printf("<%s %s %s %s> SEMB %s %s device\n", + vendor, product, revision, fw, in, ins); +} + uint32_t ata_logical_sector_size(struct ata_params *ident_data) { @@ -695,3 +720,86 @@ ata_static_identify_match(caddr_t identb } return (-1); } + +void +semb_receive_diagnostic_results(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb*), + uint8_t tag_action, int pcv, uint8_t page_code, + uint8_t *data_ptr, uint16_t length, uint32_t timeout) +{ + + length = min(length, 1020); + length = (length + 3) & ~3; + cam_fill_ataio(ataio, + retries, + cbfcnp, + /*flags*/CAM_DIR_IN, + tag_action, + data_ptr, + length, + timeout); + ata_28bit_cmd(ataio, ATA_SEP_ATTN, + pcv ? page_code : 0, 0x02, length / 4); +} + +void +semb_send_diagnostic(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint8_t *data_ptr, uint16_t length, uint32_t timeout) +{ + + length = min(length, 1020); + length = (length + 3) & ~3; + cam_fill_ataio(ataio, + retries, + cbfcnp, + /*flags*/length ? CAM_DIR_OUT : CAM_DIR_NONE, + tag_action, + data_ptr, + length, + timeout); + ata_28bit_cmd(ataio, ATA_SEP_ATTN, + length > 0 ? data_ptr[0] : 0, 0x82, length / 4); +} + +void +semb_read_buffer(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb*), + uint8_t tag_action, uint8_t page_code, + uint8_t *data_ptr, uint16_t length, uint32_t timeout) +{ + + length = min(length, 1020); + length = (length + 3) & ~3; + cam_fill_ataio(ataio, + retries, + cbfcnp, + /*flags*/CAM_DIR_IN, + tag_action, + data_ptr, + length, + timeout); + ata_28bit_cmd(ataio, ATA_SEP_ATTN, + page_code, 0x00, length / 4); +} + +void +semb_write_buffer(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint8_t *data_ptr, uint16_t length, uint32_t timeout) +{ + + length = min(length, 1020); + length = (length + 3) & ~3; + cam_fill_ataio(ataio, + retries, + cbfcnp, + /*flags*/length ? CAM_DIR_OUT : CAM_DIR_NONE, + tag_action, + data_ptr, + length, + timeout); + ata_28bit_cmd(ataio, ATA_SEP_ATTN, + length > 0 ? data_ptr[0] : 0, 0x80, length / 4); +} + Modified: stable/9/sys/cam/ata/ata_all.h ============================================================================== --- stable/9/sys/cam/ata/ata_all.h Sat Jun 9 03:34:34 2012 (r236777) +++ stable/9/sys/cam/ata/ata_all.h Sat Jun 9 06:43:26 2012 (r236778) @@ -83,6 +83,20 @@ struct ata_res { u_int8_t sector_count_exp; }; +struct sep_identify_data { + uint8_t length; /* Enclosure descriptor length */ + uint8_t subenc_id; /* Sub-enclosure identifier */ + uint8_t logical_id[8]; /* Enclosure logical identifier (WWN) */ + uint8_t vendor_id[8]; /* Vendor identification string */ + uint8_t product_id[16]; /* Product identification string */ + uint8_t product_rev[4]; /* Product revision string */ + uint8_t channel_id; /* Channel identifier */ + uint8_t firmware_rev[4];/* Firmware revision */ + uint8_t interface_id[6];/* Interface spec ("S-E-S "/"SAF-TE")*/ + uint8_t interface_rev[4];/* Interface spec revision */ + uint8_t vend_spec[11]; /* Vendor specific information */ +}; + int ata_version(int ver); char * ata_op_string(struct ata_cmd *cmd); @@ -126,4 +140,26 @@ int ata_speed2revision(u_int speed); int ata_identify_match(caddr_t identbuffer, caddr_t table_entry); int ata_static_identify_match(caddr_t identbuffer, caddr_t table_entry); +void semb_print_ident(struct sep_identify_data *ident_data); + +void semb_receive_diagnostic_results(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb*), + uint8_t tag_action, int pcv, uint8_t page_code, + uint8_t *data_ptr, uint16_t allocation_length, uint32_t timeout); + +void semb_send_diagnostic(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint8_t *data_ptr, uint16_t param_list_length, + uint32_t timeout); + +void semb_read_buffer(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb*), + uint8_t tag_action, uint8_t page_code, + uint8_t *data_ptr, uint16_t allocation_length, uint32_t timeout); + +void semb_write_buffer(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint8_t *data_ptr, uint16_t param_list_length, + uint32_t timeout); + #endif Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Sat Jun 9 03:34:34 2012 (r236777) +++ stable/9/sys/cam/ata/ata_da.c Sat Jun 9 06:43:26 2012 (r236778) @@ -776,6 +776,20 @@ adaasync(void *callback_arg, u_int32_t c "due to status 0x%x\n", status); break; } + case AC_ADVINFO_CHANGED: + { + uintptr_t buftype; + + buftype = (uintptr_t)arg; + if (buftype == CDAI_TYPE_PHYS_PATH) { + struct ada_softc *softc; + + softc = periph->softc; + disk_attr_changed(softc->disk, "GEOM::physpath", + M_NOWAIT); + } + break; + } case AC_SENT_BDR: case AC_BUS_RESET: { @@ -1088,8 +1102,8 @@ adaregister(struct cam_periph *periph, v * them and the only alternative would be to * not attach the device on failure. */ - xpt_register_async(AC_SENT_BDR | AC_BUS_RESET | AC_LOST_DEVICE, - adaasync, periph, periph->path); + xpt_register_async(AC_SENT_BDR | AC_BUS_RESET | AC_LOST_DEVICE | + AC_ADVINFO_CHANGED, adaasync, periph, periph->path); /* * Schedule a periodic event to occasionally send an Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Sat Jun 9 03:34:34 2012 (r236777) +++ stable/9/sys/cam/ata/ata_xpt.c Sat Jun 9 06:43:26 2012 (r236778) @@ -93,6 +93,8 @@ typedef enum { PROBE_FULL_INQUIRY, PROBE_PM_PID, PROBE_PM_PRV, + PROBE_IDENTIFY_SES, + PROBE_IDENTIFY_SAFTE, PROBE_INVALID } probe_action; @@ -110,6 +112,8 @@ static char *probe_action_text[] = { "PROBE_FULL_INQUIRY", "PROBE_PM_PID", "PROBE_PM_PRV", + "PROBE_IDENTIFY_SES", + "PROBE_IDENTIFY_SAFTE", "PROBE_INVALID" }; @@ -266,7 +270,8 @@ probeschedule(struct cam_periph *periph) ccb = (union ccb *)TAILQ_FIRST(&softc->request_ccbs); if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) || - periph->path->device->protocol == PROTO_SATAPM) + periph->path->device->protocol == PROTO_SATAPM || + periph->path->device->protocol == PROTO_SEMB) PROBE_SET_ACTION(softc, PROBE_RESET); else PROBE_SET_ACTION(softc, PROBE_IDENTIFY); @@ -300,7 +305,8 @@ probestart(struct cam_periph *periph, un if (softc->restart) { softc->restart = 0; if ((path->device->flags & CAM_DEV_UNCONFIGURED) || - path->device->protocol == PROTO_SATAPM) + path->device->protocol == PROTO_SATAPM || + path->device->protocol == PROTO_SEMB) softc->action = PROBE_RESET; else softc->action = PROBE_IDENTIFY; @@ -622,6 +628,30 @@ negotiate: 10 * 1000); ata_pm_read_cmd(ataio, 1, 15); break; + case PROBE_IDENTIFY_SES: + cam_fill_ataio(ataio, + 1, + probedone, + /*flags*/CAM_DIR_IN, + 0, + /*data_ptr*/(u_int8_t *)&softc->ident_data, + /*dxfer_len*/sizeof(softc->ident_data), + 30 * 1000); + ata_28bit_cmd(ataio, ATA_SEP_ATTN, 0xEC, 0x02, + sizeof(softc->ident_data) / 4); + break; + case PROBE_IDENTIFY_SAFTE: + cam_fill_ataio(ataio, + 1, + probedone, + /*flags*/CAM_DIR_IN, + 0, + /*data_ptr*/(u_int8_t *)&softc->ident_data, + /*dxfer_len*/sizeof(softc->ident_data), + 30 * 1000); + ata_28bit_cmd(ataio, ATA_SEP_ATTN, 0xEC, 0x00, + sizeof(softc->ident_data) / 4); + break; case PROBE_INVALID: CAM_DEBUG(path, CAM_DEBUG_INFO, ("probestart: invalid action state\n")); @@ -758,12 +788,16 @@ probedone(struct cam_periph *periph, uni { struct ccb_trans_settings cts; struct ata_params *ident_buf; + struct scsi_inquiry_data *inq_buf; probe_softc *softc; struct cam_path *path; cam_status status; u_int32_t priority; u_int caps; - int found = 1; + int changed = 1, found = 1; + static const uint8_t fake_device_id_hdr[8] = + {0, SVPD_DEVICE_ID, 0, 12, + SVPD_ID_CODESET_BINARY, SVPD_ID_TYPE_NAA, 0, 8}; CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("probedone\n")); @@ -771,6 +805,7 @@ probedone(struct cam_periph *periph, uni path = done_ccb->ccb_h.path; priority = done_ccb->ccb_h.pinfo.priority; ident_buf = &path->device->ident_data; + inq_buf = &path->device->inq_data; if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { if (softc->restart) { @@ -819,6 +854,18 @@ probedone(struct cam_periph *periph, uni } else if (softc->action == PROBE_SETDMAAA && status == CAM_ATA_STATUS_ERROR) { goto noerror; + + /* + * SES and SAF-TE SEPs have different IDENTIFY commands, + * but SATA specification doesn't tell how to identify them. + * Until better way found, just try another if first fail. + */ + } else if (softc->action == PROBE_IDENTIFY_SES && + status == CAM_ATA_STATUS_ERROR) { + PROBE_SET_ACTION(softc, PROBE_IDENTIFY_SAFTE); + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; } /* @@ -862,6 +909,10 @@ noerror: xpt_action((union ccb *)&cts); path->device->protocol = PROTO_SATAPM; PROBE_SET_ACTION(softc, PROBE_PM_PID); + } else if (sign == 0xc33c && + done_ccb->ccb_h.target_id != 15) { + path->device->protocol = PROTO_SEMB; + PROBE_SET_ACTION(softc, PROBE_IDENTIFY_SES); } else if (sign == 0xeb14 && done_ccb->ccb_h.target_id != 15) { path->device->protocol = PROTO_SCSI; @@ -881,7 +932,6 @@ noerror: { struct ccb_pathinq cpi; int16_t *ptr; - int changed = 1; ident_buf = &softc->ident_data; for (ptr = (int16_t *)ident_buf; @@ -936,6 +986,11 @@ noerror: path->device->serial_num = NULL; path->device->serial_num_len = 0; } + if (path->device->device_id != NULL) { + free(path->device->device_id, M_CAMXPT); + path->device->device_id = NULL; + path->device->device_id_len = 0; + } path->device->serial_num = (u_int8_t *)malloc((sizeof(ident_buf->serial) + 1), M_CAMXPT, M_NOWAIT); @@ -948,6 +1003,18 @@ noerror: path->device->serial_num_len = strlen(path->device->serial_num); } + if (ident_buf->enabled.extension & + ATA_SUPPORT_64BITWWN) { + path->device->device_id = + malloc(16, M_CAMXPT, M_NOWAIT); + if (path->device->device_id != NULL) { + path->device->device_id_len = 16; + bcopy(&fake_device_id_hdr, + path->device->device_id, 8); + bcopy(ident_buf->wwn, + path->device->device_id + 8, 8); + } + } path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; } @@ -1092,11 +1159,9 @@ notsata: case PROBE_INQUIRY: case PROBE_FULL_INQUIRY: { - struct scsi_inquiry_data *inq_buf; u_int8_t periph_qual, len; path->device->flags |= CAM_DEV_INQUIRY_DATA_VALID; - inq_buf = &path->device->inq_data; periph_qual = SID_QUAL(inq_buf); @@ -1200,6 +1265,48 @@ notsata: xpt_async(AC_SCSI_AEN, done_ccb->ccb_h.path, done_ccb); } break; + case PROBE_IDENTIFY_SES: + case PROBE_IDENTIFY_SAFTE: + if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) == 0) { + /* Check that it is the same device. */ + if (bcmp(&softc->ident_data, ident_buf, 53)) { + /* Device changed. */ + xpt_async(AC_LOST_DEVICE, path, NULL); + } else { + bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); + changed = 0; + } + } + if (changed) { + bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); + /* Clean up from previous instance of this device */ + if (path->device->device_id != NULL) { + free(path->device->device_id, M_CAMXPT); + path->device->device_id = NULL; + path->device->device_id_len = 0; + } + path->device->device_id = + malloc(16, M_CAMXPT, M_NOWAIT); + if (path->device->device_id != NULL) { + path->device->device_id_len = 16; + bcopy(&fake_device_id_hdr, + path->device->device_id, 8); + bcopy(((uint8_t*)ident_buf) + 2, + path->device->device_id + 8, 8); + } + + path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; + } + + if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) { + path->device->flags &= ~CAM_DEV_UNCONFIGURED; + xpt_acquire_device(path->device); + done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; + xpt_action(done_ccb); + xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, + done_ccb); + } + break; case PROBE_INVALID: CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_INFO, ("probedone: invalid action state\n")); @@ -1624,10 +1731,20 @@ ata_dev_advinfo(union ccb *start_ccb) device = start_ccb->ccb_h.path->device; cdai = &start_ccb->cdai; switch(cdai->buftype) { - case CDAI_TYPE_SERIAL_NUM: + case CDAI_TYPE_SCSI_DEVID: if (cdai->flags & CDAI_FLAG_STORE) + return; + cdai->provsiz = device->device_id_len; + if (device->device_id_len == 0) break; - start_ccb->ccb_h.status = CAM_REQ_CMP; + amt = device->device_id_len; + if (cdai->provsiz > cdai->bufsiz) + amt = cdai->bufsiz; + memcpy(cdai->buf, device->device_id, amt); + break; + case CDAI_TYPE_SERIAL_NUM: + if (cdai->flags & CDAI_FLAG_STORE) + return; cdai->provsiz = device->serial_num_len; if (device->serial_num_len == 0) break; @@ -1636,8 +1753,45 @@ ata_dev_advinfo(union ccb *start_ccb) amt = cdai->bufsiz; memcpy(cdai->buf, device->serial_num, amt); break; - default: + case CDAI_TYPE_PHYS_PATH: + if (cdai->flags & CDAI_FLAG_STORE) { + if (device->physpath != NULL) + free(device->physpath, M_CAMXPT); + device->physpath_len = cdai->bufsiz; + /* Clear existing buffer if zero length */ + if (cdai->bufsiz == 0) + break; + device->physpath = malloc(cdai->bufsiz, M_CAMXPT, M_NOWAIT); + if (device->physpath == NULL) { + start_ccb->ccb_h.status = CAM_REQ_ABORTED; + return; + } + memcpy(device->physpath, cdai->buf, cdai->bufsiz); + } else { + cdai->provsiz = device->physpath_len; + if (device->physpath_len == 0) + break; + amt = device->physpath_len; + if (cdai->provsiz > cdai->bufsiz) + amt = cdai->bufsiz; + memcpy(cdai->buf, device->physpath, amt); + } break; + default: + return; + } + start_ccb->ccb_h.status = CAM_REQ_CMP; + + if (cdai->flags & CDAI_FLAG_STORE) { + int owned; + + owned = mtx_owned(start_ccb->ccb_h.path->bus->sim->mtx); + if (owned == 0) + mtx_lock(start_ccb->ccb_h.path->bus->sim->mtx); + xpt_async(AC_ADVINFO_CHANGED, start_ccb->ccb_h.path, + (void *)(uintptr_t)cdai->buftype); + if (owned == 0) + mtx_unlock(start_ccb->ccb_h.path->bus->sim->mtx); } } Modified: stable/9/sys/cam/cam_ccb.h ============================================================================== --- stable/9/sys/cam/cam_ccb.h Sat Jun 9 03:34:34 2012 (r236777) +++ stable/9/sys/cam/cam_ccb.h Sat Jun 9 06:43:26 2012 (r236778) @@ -242,6 +242,7 @@ typedef enum { PROTO_ATA, /* AT Attachment */ PROTO_ATAPI, /* AT Attachment Packetized Interface */ PROTO_SATAPM, /* SATA Port Multiplier */ + PROTO_SEMB, /* SATA Enclosure Management Bridge */ } cam_proto; typedef enum { Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Sat Jun 9 03:34:34 2012 (r236777) +++ stable/9/sys/cam/cam_xpt.c Sat Jun 9 06:43:26 2012 (r236778) @@ -1080,6 +1080,9 @@ xpt_announce_periph(struct cam_periph *p else if (path->device->protocol == PROTO_ATA || path->device->protocol == PROTO_SATAPM) ata_print_ident(&path->device->ident_data); + else if (path->device->protocol == PROTO_SEMB) + semb_print_ident( + (struct sep_identify_data *)&path->device->ident_data); else printf("Unknown protocol device\n"); if (bootverbose && path->device->serial_num_len > 0) { @@ -4848,7 +4851,8 @@ xpt_finishconfig_task(void *context, int * attached. For any devices like that, announce the * passthrough driver so the user will see something. */ - xpt_for_all_devices(xptpassannouncefunc, NULL); + if (!bootverbose) + xpt_for_all_devices(xptpassannouncefunc, NULL); /* Release our hook so that the boot can continue. */ config_intrhook_disestablish(xsoftc.xpt_config_hook); Modified: stable/9/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_all.c Sat Jun 9 03:34:34 2012 (r236777) +++ stable/9/sys/cam/scsi/scsi_all.c Sat Jun 9 06:43:26 2012 (r236778) @@ -5740,6 +5740,66 @@ scsi_send_diagnostic(struct ccb_scsiio * timeout); } +void +scsi_read_buffer(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb*), + uint8_t tag_action, int mode, + uint8_t buffer_id, u_int32_t offset, + uint8_t *data_ptr, uint32_t allocation_length, + uint8_t sense_len, uint32_t timeout) +{ + struct scsi_read_buffer *scsi_cmd; + + scsi_cmd = (struct scsi_read_buffer *)&csio->cdb_io.cdb_bytes; + memset(scsi_cmd, 0, sizeof(*scsi_cmd)); + scsi_cmd->opcode = READ_BUFFER; + scsi_cmd->byte2 = mode; + scsi_cmd->buffer_id = buffer_id; + scsi_ulto3b(offset, scsi_cmd->offset); + scsi_ulto3b(allocation_length, scsi_cmd->length); + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_IN, + tag_action, + data_ptr, + allocation_length, + sense_len, + sizeof(*scsi_cmd), + timeout); +} + +void +scsi_write_buffer(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, int mode, + uint8_t buffer_id, u_int32_t offset, + uint8_t *data_ptr, uint32_t param_list_length, + uint8_t sense_len, uint32_t timeout) +{ + struct scsi_write_buffer *scsi_cmd; + + scsi_cmd = (struct scsi_write_buffer *)&csio->cdb_io.cdb_bytes; + memset(scsi_cmd, 0, sizeof(*scsi_cmd)); + scsi_cmd->opcode = WRITE_BUFFER; + scsi_cmd->byte2 = mode; + scsi_cmd->buffer_id = buffer_id; + scsi_ulto3b(offset, scsi_cmd->offset); + scsi_ulto3b(param_list_length, scsi_cmd->length); + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/param_list_length ? CAM_DIR_OUT : CAM_DIR_NONE, + tag_action, + data_ptr, + param_list_length, + sense_len, + sizeof(*scsi_cmd), + timeout); +} + void scsi_start_stop(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), Modified: stable/9/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/9/sys/cam/scsi/scsi_all.h Sat Jun 9 03:34:34 2012 (r236777) +++ stable/9/sys/cam/scsi/scsi_all.h Sat Jun 9 06:43:26 2012 (r236778) @@ -1267,6 +1267,8 @@ struct scsi_vpd_id_descriptor #define SCSI_PROTO_RDMA 0x04 #define SCSI_PROTO_iSCSI 0x05 #define SCSI_PROTO_SAS 0x06 +#define SCSI_PROTO_ADT 0x07 +#define SCSI_PROTO_ATA 0x08 #define SVPD_ID_PROTO_SHIFT 4 #define SVPD_ID_CODESET_BINARY 0x01 #define SVPD_ID_CODESET_ASCII 0x02 @@ -1400,6 +1402,13 @@ struct scsi_service_action_in uint8_t control; }; +struct scsi_diag_page { + uint8_t page_code; + uint8_t page_specific_flags; + uint8_t length[2]; + uint8_t params[0]; +}; + struct scsi_read_capacity { u_int8_t opcode; @@ -2342,6 +2351,20 @@ void scsi_send_diagnostic(struct ccb_scs uint16_t param_list_length, uint8_t sense_len, uint32_t timeout); +void scsi_read_buffer(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb*), + uint8_t tag_action, int mode, + uint8_t buffer_id, u_int32_t offset, + uint8_t *data_ptr, uint32_t allocation_length, + uint8_t sense_len, uint32_t timeout); + +void scsi_write_buffer(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, int mode, + uint8_t buffer_id, u_int32_t offset, + uint8_t *data_ptr, uint32_t param_list_length, + uint8_t sense_len, uint32_t timeout); + void scsi_read_write(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, int readop, u_int8_t byte2, Modified: stable/9/sys/sys/ata.h ============================================================================== --- stable/9/sys/sys/ata.h Sat Jun 9 03:34:34 2012 (r236777) +++ stable/9/sys/sys/ata.h Sat Jun 9 06:43:26 2012 (r236778) @@ -318,6 +318,7 @@ struct ata_params { #define ATA_READ_VERIFY48 0x42 #define ATA_READ_FPDMA_QUEUED 0x60 /* read DMA NCQ */ #define ATA_WRITE_FPDMA_QUEUED 0x61 /* write DMA NCQ */ +#define ATA_SEP_ATTN 0x67 /* SEP request */ #define ATA_SEEK 0x70 /* seek */ #define ATA_PACKET_CMD 0xa0 /* packet command */ #define ATA_ATAPI_IDENTIFY 0xa1 /* get ATAPI params*/ From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 07:18:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9D084106564A; Sat, 9 Jun 2012 07:18:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F17F8FC0C; Sat, 9 Jun 2012 07:18:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q597IEWg013442; Sat, 9 Jun 2012 07:18:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q597IDAt013439; Sat, 9 Jun 2012 07:18:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206090718.q597IDAt013439@svn.freebsd.org> From: Alexander Motin Date: Sat, 9 Jun 2012 07:18:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236779 - in stable/9/sys/cam: ata scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 07:18:14 -0000 Author: mav Date: Sat Jun 9 07:18:13 2012 New Revision: 236779 URL: http://svn.freebsd.org/changeset/base/236779 Log: MFC r236228: Plug request and references leak caused by race between invalidated ond probe periph destruction and new incoming probe request. This at least caused problems with SATA Port Multipliers hot-plug. Modified: stable/9/sys/cam/ata/ata_xpt.c stable/9/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Sat Jun 9 06:43:26 2012 (r236778) +++ stable/9/sys/cam/ata/ata_xpt.c Sat Jun 9 07:18:13 2012 (r236779) @@ -1327,9 +1327,9 @@ done: done_ccb->ccb_h.status = found ? CAM_REQ_CMP : CAM_REQ_CMP_ERR; xpt_done(done_ccb); } + cam_periph_invalidate(periph); cam_release_devq(periph->path, RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_XPT + 1, FALSE); - cam_periph_invalidate(periph); cam_periph_release_locked(periph); } @@ -1580,12 +1580,17 @@ ata_scan_lun(struct cam_periph *periph, } if ((old_periph = cam_periph_find(path, "aprobe")) != NULL) { - probe_softc *softc; + if ((old_periph->flags & CAM_PERIPH_INVALID) == 0) { + probe_softc *softc; - softc = (probe_softc *)old_periph->softc; - TAILQ_INSERT_TAIL(&softc->request_ccbs, &request_ccb->ccb_h, - periph_links.tqe); - softc->restart = 1; + softc = (probe_softc *)old_periph->softc; + TAILQ_INSERT_TAIL(&softc->request_ccbs, + &request_ccb->ccb_h, periph_links.tqe); + softc->restart = 1; + } else { + request_ccb->ccb_h.status = CAM_REQ_CMP_ERR; + xpt_done(request_ccb); + } } else { status = cam_periph_alloc(proberegister, NULL, probecleanup, probestart, "aprobe", Modified: stable/9/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_xpt.c Sat Jun 9 06:43:26 2012 (r236778) +++ stable/9/sys/cam/scsi/scsi_xpt.c Sat Jun 9 07:18:13 2012 (r236779) @@ -1710,9 +1710,9 @@ probe_device_check: done_ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(done_ccb); if (TAILQ_FIRST(&softc->request_ccbs) == NULL) { + cam_periph_invalidate(periph); cam_release_devq(periph->path, RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_XPT + 1, FALSE); - cam_periph_invalidate(periph); cam_periph_release_locked(periph); } else { probeschedule(periph); @@ -2278,11 +2278,16 @@ scsi_scan_lun(struct cam_periph *periph, } if ((old_periph = cam_periph_find(path, "probe")) != NULL) { - probe_softc *softc; + if ((old_periph->flags & CAM_PERIPH_INVALID) == 0) { + probe_softc *softc; - softc = (probe_softc *)old_periph->softc; - TAILQ_INSERT_TAIL(&softc->request_ccbs, &request_ccb->ccb_h, - periph_links.tqe); + softc = (probe_softc *)old_periph->softc; + TAILQ_INSERT_TAIL(&softc->request_ccbs, + &request_ccb->ccb_h, periph_links.tqe); + } else { + request_ccb->ccb_h.status = CAM_REQ_CMP_ERR; + xpt_done(request_ccb); + } } else { status = cam_periph_alloc(proberegister, NULL, probecleanup, probestart, "probe", From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 07:18:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F3FA1065688; Sat, 9 Jun 2012 07:18:54 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71FE58FC0C; Sat, 9 Jun 2012 07:18:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q597Is6w013517; Sat, 9 Jun 2012 07:18:54 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q597IsbM013515; Sat, 9 Jun 2012 07:18:54 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201206090718.q597IsbM013515@svn.freebsd.org> From: Joel Dahl Date: Sat, 9 Jun 2012 07:18:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236780 - head/sbin/devfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 07:18:54 -0000 Author: joel (doc committer) Date: Sat Jun 9 07:18:53 2012 New Revision: 236780 URL: http://svn.freebsd.org/changeset/base/236780 Log: mdoc: minor improvements to a few lists with tags. Modified: head/sbin/devfs/devfs.8 Modified: head/sbin/devfs/devfs.8 ============================================================================== --- head/sbin/devfs/devfs.8 Sat Jun 9 07:18:13 2012 (r236779) +++ head/sbin/devfs/devfs.8 Sat Jun 9 07:18:53 2012 (r236780) @@ -52,7 +52,7 @@ most of the commands related to the rule .Cm rule keyword. The following flags are common to all keywords: -.Bl -tag -offset indent +.Bl -tag -width 15n .It Fl m Ar mount-point Operate on .Ar mount-point , @@ -88,7 +88,7 @@ Rule manipulation commands follow the .Cm rule keyword. The following flags are common to all of the rule manipulation commands: -.Bl -tag -offset indent +.Bl -tag -width 15n .It Fl s Ar ruleset Operate on the ruleset with the number .Ar ruleset . @@ -98,7 +98,7 @@ specified mount-point. .El .Pp The following commands are recognized: -.Bl -tag -offset indent +.Bl -tag -width 15n .It Cm rule add Oo Ar rulenum Oc Ar rulespec Add the rule described by .Ar rulespec @@ -156,7 +156,7 @@ is ignored. The following conditions are recognized. Conditions are ANDed together when matching a device; if OR is desired, multiple rules can be written. -.Bl -tag -offset indent +.Bl -tag -width 15n .It Cm path Ar pattern Matches any node with a path that matches .Ar pattern , @@ -175,7 +175,7 @@ and The following actions are recognized. Although there is no explicit delimiter between conditions and actions, they may not be intermixed. -.Bl -tag -offset indent +.Bl -tag -width 15n .It Cm group Ar gid Set the GID of the node to .Ar gid , @@ -238,7 +238,7 @@ will return the same information regardl The mount-point is only relevant when changing what its current ruleset is or when using one of the apply commands. .Sh FILES -.Bl -tag -compact +.Bl -tag -width "Pa /usr/share/examples/etc/devfs.conf" -compact .It Pa /etc/defaults/devfs.rules Default .Nm From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 07:22:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A31C1065780; Sat, 9 Jun 2012 07:22:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A4128FC0C; Sat, 9 Jun 2012 07:22:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q597MoXj013743; Sat, 9 Jun 2012 07:22:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q597MoOc013740; Sat, 9 Jun 2012 07:22:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206090722.q597MoOc013740@svn.freebsd.org> From: Alexander Motin Date: Sat, 9 Jun 2012 07:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236781 - in stable/8/sys/cam: ata scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 07:22:51 -0000 Author: mav Date: Sat Jun 9 07:22:50 2012 New Revision: 236781 URL: http://svn.freebsd.org/changeset/base/236781 Log: MFC r236228: Plug request and references leak caused by race between invalidated probe periph destruction and new incoming probe request. This at least caused problems with SATA Port Multipliers hot-plug. Modified: stable/8/sys/cam/ata/ata_xpt.c stable/8/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Sat Jun 9 07:18:53 2012 (r236780) +++ stable/8/sys/cam/ata/ata_xpt.c Sat Jun 9 07:22:50 2012 (r236781) @@ -1220,9 +1220,9 @@ done: done_ccb->ccb_h.status = found ? CAM_REQ_CMP : CAM_REQ_CMP_ERR; xpt_done(done_ccb); } + cam_periph_invalidate(periph); cam_release_devq(periph->path, RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_XPT + 1, FALSE); - cam_periph_invalidate(periph); cam_periph_release_locked(periph); } @@ -1473,12 +1473,17 @@ ata_scan_lun(struct cam_periph *periph, } if ((old_periph = cam_periph_find(path, "aprobe")) != NULL) { - probe_softc *softc; + if ((old_periph->flags & CAM_PERIPH_INVALID) == 0) { + probe_softc *softc; - softc = (probe_softc *)old_periph->softc; - TAILQ_INSERT_TAIL(&softc->request_ccbs, &request_ccb->ccb_h, - periph_links.tqe); - softc->restart = 1; + softc = (probe_softc *)old_periph->softc; + TAILQ_INSERT_TAIL(&softc->request_ccbs, + &request_ccb->ccb_h, periph_links.tqe); + softc->restart = 1; + } else { + request_ccb->ccb_h.status = CAM_REQ_CMP_ERR; + xpt_done(request_ccb); + } } else { status = cam_periph_alloc(proberegister, NULL, probecleanup, probestart, "aprobe", Modified: stable/8/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_xpt.c Sat Jun 9 07:18:53 2012 (r236780) +++ stable/8/sys/cam/scsi/scsi_xpt.c Sat Jun 9 07:22:50 2012 (r236781) @@ -1609,9 +1609,9 @@ probedone(struct cam_periph *periph, uni done_ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(done_ccb); if (TAILQ_FIRST(&softc->request_ccbs) == NULL) { + cam_periph_invalidate(periph); cam_release_devq(periph->path, RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_XPT + 1, FALSE); - cam_periph_invalidate(periph); cam_periph_release_locked(periph); } else { probeschedule(periph); @@ -2177,11 +2177,16 @@ scsi_scan_lun(struct cam_periph *periph, } if ((old_periph = cam_periph_find(path, "probe")) != NULL) { - probe_softc *softc; + if ((old_periph->flags & CAM_PERIPH_INVALID) == 0) { + probe_softc *softc; - softc = (probe_softc *)old_periph->softc; - TAILQ_INSERT_TAIL(&softc->request_ccbs, &request_ccb->ccb_h, - periph_links.tqe); + softc = (probe_softc *)old_periph->softc; + TAILQ_INSERT_TAIL(&softc->request_ccbs, + &request_ccb->ccb_h, periph_links.tqe); + } else { + request_ccb->ccb_h.status = CAM_REQ_CMP_ERR; + xpt_done(request_ccb); + } } else { status = cam_periph_alloc(proberegister, NULL, probecleanup, probestart, "probe", From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 07:28:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5794D106567D; Sat, 9 Jun 2012 07:28:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28D698FC20; Sat, 9 Jun 2012 07:28:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q597SC88014031; Sat, 9 Jun 2012 07:28:12 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q597SBx0014027; Sat, 9 Jun 2012 07:28:11 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206090728.q597SBx0014027@svn.freebsd.org> From: Alexander Motin Date: Sat, 9 Jun 2012 07:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236782 - in stable/9/sys/cam: . ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 07:28:12 -0000 Author: mav Date: Sat Jun 9 07:28:11 2012 New Revision: 236782 URL: http://svn.freebsd.org/changeset/base/236782 Log: MFC r236234: Allow to change number of openings (used tags) for ATA/SATA devices via `camcontrol tags ... -N ...`. There is no need to tune it in usual cases, but some users want to have it for debugging purposes. Modified: stable/9/sys/cam/ata/ata_xpt.c stable/9/sys/cam/cam_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Sat Jun 9 07:22:50 2012 (r236781) +++ stable/9/sys/cam/ata/ata_xpt.c Sat Jun 9 07:28:11 2012 (r236782) @@ -65,6 +65,7 @@ struct ata_quirk_entry { struct scsi_inquiry_pattern inq_pat; u_int8_t quirks; #define CAM_QUIRK_MAXTAGS 0x01 + u_int mintags; u_int maxtags; }; @@ -153,7 +154,7 @@ static struct ata_quirk_entry ata_quirk_ T_ANY, SIP_MEDIA_REMOVABLE|SIP_MEDIA_FIXED, /*vendor*/"*", /*product*/"*", /*revision*/"*" }, - /*quirks*/0, /*maxtags*/0 + /*quirks*/0, /*mintags*/0, /*maxtags*/0 }, }; @@ -1019,7 +1020,8 @@ noerror: path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; } if (ident_buf->satacapabilities & ATA_SUPPORT_NCQ) { - path->device->mintags = path->device->maxtags = + path->device->mintags = 2; + path->device->maxtags = ATA_QUEUE_LEN(ident_buf->queue) + 1; } ata_find_quirk(path->device); @@ -1355,8 +1357,10 @@ ata_find_quirk(struct cam_ed *device) quirk = (struct ata_quirk_entry *)match; device->quirk = quirk; - if (quirk->quirks & CAM_QUIRK_MAXTAGS) - device->mintags = device->maxtags = quirk->maxtags; + if (quirk->quirks & CAM_QUIRK_MAXTAGS) { + device->mintags = quirk->mintags; + device->maxtags = quirk->maxtags; + } } typedef struct { Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Sat Jun 9 07:22:50 2012 (r236781) +++ stable/9/sys/cam/cam_xpt.c Sat Jun 9 07:28:11 2012 (r236782) @@ -2905,17 +2905,13 @@ xpt_action_default(union ccb *start_ccb) if ((crs->release_flags & RELSIM_ADJUST_OPENINGS) != 0) { - if (INQ_DATA_TQ_ENABLED(&dev->inq_data)) { - /* Don't ever go below one opening */ - if (crs->openings > 0) { - xpt_dev_ccbq_resize(path, - crs->openings); - - if (bootverbose) { - xpt_print(path, - "tagged openings now %d\n", - crs->openings); - } + /* Don't ever go below one opening */ + if (crs->openings > 0) { + xpt_dev_ccbq_resize(path, crs->openings); + if (bootverbose) { + xpt_print(path, + "number of openings is now %d\n", + crs->openings); } } } From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 07:29:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B740106564A; Sat, 9 Jun 2012 07:29:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CD3E8FC15; Sat, 9 Jun 2012 07:29:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q597T78s014117; Sat, 9 Jun 2012 07:29:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q597T7ME014114; Sat, 9 Jun 2012 07:29:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206090729.q597T7ME014114@svn.freebsd.org> From: Alexander Motin Date: Sat, 9 Jun 2012 07:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236783 - in stable/8/sys/cam: . ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 07:29:08 -0000 Author: mav Date: Sat Jun 9 07:29:07 2012 New Revision: 236783 URL: http://svn.freebsd.org/changeset/base/236783 Log: MFC r236234: Allow to change number of openings (used tags) for ATA/SATA devices via `camcontrol tags ... -N ...`. There is no need to tune it in usual cases, but some users want to have it for debugging purposes. Modified: stable/8/sys/cam/ata/ata_xpt.c stable/8/sys/cam/cam_xpt.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Sat Jun 9 07:28:11 2012 (r236782) +++ stable/8/sys/cam/ata/ata_xpt.c Sat Jun 9 07:29:07 2012 (r236783) @@ -65,6 +65,7 @@ struct ata_quirk_entry { struct scsi_inquiry_pattern inq_pat; u_int8_t quirks; #define CAM_QUIRK_MAXTAGS 0x01 + u_int mintags; u_int maxtags; }; @@ -149,7 +150,7 @@ static struct ata_quirk_entry ata_quirk_ T_ANY, SIP_MEDIA_REMOVABLE|SIP_MEDIA_FIXED, /*vendor*/"*", /*product*/"*", /*revision*/"*" }, - /*quirks*/0, /*maxtags*/0 + /*quirks*/0, /*mintags*/0, /*maxtags*/0 }, }; @@ -952,7 +953,8 @@ noerror: path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; } if (ident_buf->satacapabilities & ATA_SUPPORT_NCQ) { - path->device->mintags = path->device->maxtags = + path->device->mintags = 2; + path->device->maxtags = ATA_QUEUE_LEN(ident_buf->queue) + 1; } ata_find_quirk(path->device); @@ -1248,8 +1250,10 @@ ata_find_quirk(struct cam_ed *device) quirk = (struct ata_quirk_entry *)match; device->quirk = quirk; - if (quirk->quirks & CAM_QUIRK_MAXTAGS) - device->mintags = device->maxtags = quirk->maxtags; + if (quirk->quirks & CAM_QUIRK_MAXTAGS) { + device->mintags = quirk->mintags; + device->maxtags = quirk->maxtags; + } } typedef struct { Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Sat Jun 9 07:28:11 2012 (r236782) +++ stable/8/sys/cam/cam_xpt.c Sat Jun 9 07:29:07 2012 (r236783) @@ -2860,17 +2860,13 @@ xpt_action_default(union ccb *start_ccb) if ((crs->release_flags & RELSIM_ADJUST_OPENINGS) != 0) { - if (INQ_DATA_TQ_ENABLED(&dev->inq_data)) { - /* Don't ever go below one opening */ - if (crs->openings > 0) { - xpt_dev_ccbq_resize(path, - crs->openings); - - if (bootverbose) { - xpt_print(path, - "tagged openings now %d\n", - crs->openings); - } + /* Don't ever go below one opening */ + if (crs->openings > 0) { + xpt_dev_ccbq_resize(path, crs->openings); + if (bootverbose) { + xpt_print(path, + "number of openings is now %d\n", + crs->openings); } } } From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 07:31:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39A441065670; Sat, 9 Jun 2012 07:31:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A7898FC08; Sat, 9 Jun 2012 07:31:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q597V4uX014302; Sat, 9 Jun 2012 07:31:04 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q597V4bG014297; Sat, 9 Jun 2012 07:31:04 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206090731.q597V4bG014297@svn.freebsd.org> From: Alexander Motin Date: Sat, 9 Jun 2012 07:31:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236784 - in stable/9/sys/cam: . ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 07:31:05 -0000 Author: mav Date: Sat Jun 9 07:31:04 2012 New Revision: 236784 URL: http://svn.freebsd.org/changeset/base/236784 Log: NFC r236393: Use AC_GETDEV_CHANGED async to notify ada driver about DMA and NCQ status change. Now that allows switching between PIO and DMA modes on the fly. Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/ata/ata_xpt.c stable/9/sys/cam/cam_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Sat Jun 9 07:29:07 2012 (r236783) +++ stable/9/sys/cam/ata/ata_da.c Sat Jun 9 07:31:04 2012 (r236784) @@ -742,6 +742,7 @@ static void adaasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg) { + struct ccb_getdev cgd; struct cam_periph *periph; struct ada_softc *softc; @@ -776,6 +777,32 @@ adaasync(void *callback_arg, u_int32_t c "due to status 0x%x\n", status); break; } + case AC_GETDEV_CHANGED: + { + softc = (struct ada_softc *)periph->softc; + xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL); + cgd.ccb_h.func_code = XPT_GDEV_TYPE; + xpt_action((union ccb *)&cgd); + + if ((cgd.ident_data.capabilities1 & ATA_SUPPORT_DMA) && + (cgd.inq_flags & SID_DMA)) + softc->flags |= ADA_FLAG_CAN_DMA; + else + softc->flags &= ~ADA_FLAG_CAN_DMA; + if ((cgd.ident_data.satacapabilities & ATA_SUPPORT_NCQ) && + (cgd.inq_flags & SID_DMA) && (cgd.inq_flags & SID_CmdQue)) + softc->flags |= ADA_FLAG_CAN_NCQ; + else + softc->flags &= ~ADA_FLAG_CAN_NCQ; + if ((cgd.ident_data.support_dsm & ATA_SUPPORT_DSM_TRIM) && + (cgd.inq_flags & SID_DMA)) + softc->flags |= ADA_FLAG_CAN_TRIM; + else + softc->flags &= ~ADA_FLAG_CAN_TRIM; + + cam_periph_async(periph, code, path, arg); + break; + } case AC_ADVINFO_CHANGED: { uintptr_t buftype; @@ -793,8 +820,6 @@ adaasync(void *callback_arg, u_int32_t c case AC_SENT_BDR: case AC_BUS_RESET: { - struct ccb_getdev cgd; - softc = (struct ada_softc *)periph->softc; cam_periph_async(periph, code, path, arg); if (softc->state != ADA_STATE_NORMAL) @@ -933,7 +958,7 @@ adaregister(struct cam_periph *periph, v bioq_init(&softc->bio_queue); bioq_init(&softc->trim_queue); - if (cgd->ident_data.capabilities1 & ATA_SUPPORT_DMA && + if ((cgd->ident_data.capabilities1 & ATA_SUPPORT_DMA) && (cgd->inq_flags & SID_DMA)) softc->flags |= ADA_FLAG_CAN_DMA; if (cgd->ident_data.support.command2 & ATA_SUPPORT_ADDRESS48) @@ -942,10 +967,11 @@ adaregister(struct cam_periph *periph, v softc->flags |= ADA_FLAG_CAN_FLUSHCACHE; if (cgd->ident_data.support.command1 & ATA_SUPPORT_POWERMGT) softc->flags |= ADA_FLAG_CAN_POWERMGT; - if (cgd->ident_data.satacapabilities & ATA_SUPPORT_NCQ && + if ((cgd->ident_data.satacapabilities & ATA_SUPPORT_NCQ) && (cgd->inq_flags & SID_DMA) && (cgd->inq_flags & SID_CmdQue)) softc->flags |= ADA_FLAG_CAN_NCQ; - if (cgd->ident_data.support_dsm & ATA_SUPPORT_DSM_TRIM) { + if ((cgd->ident_data.support_dsm & ATA_SUPPORT_DSM_TRIM) && + (cgd->inq_flags & SID_DMA)) { softc->flags |= ADA_FLAG_CAN_TRIM; softc->trim_max_ranges = TRIM_MAX_RANGES; if (cgd->ident_data.max_dsm_blocks != 0) { @@ -1103,7 +1129,8 @@ adaregister(struct cam_periph *periph, v * not attach the device on failure. */ xpt_register_async(AC_SENT_BDR | AC_BUS_RESET | AC_LOST_DEVICE | - AC_ADVINFO_CHANGED, adaasync, periph, periph->path); + AC_GETDEV_CHANGED | AC_ADVINFO_CHANGED, + adaasync, periph, periph->path); /* * Schedule a periodic event to occasionally send an Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Sat Jun 9 07:29:07 2012 (r236783) +++ stable/9/sys/cam/ata/ata_xpt.c Sat Jun 9 07:31:04 2012 (r236784) @@ -413,6 +413,7 @@ negotiate: path->device->inq_flags &= ~SID_DMA; else path->device->inq_flags |= SID_DMA; + xpt_async(AC_GETDEV_CHANGED, path, NULL); cam_fill_ataio(ataio, 1, probedone, @@ -1018,6 +1019,7 @@ noerror: } path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; + xpt_async(AC_GETDEV_CHANGED, path, NULL); } if (ident_buf->satacapabilities & ATA_SUPPORT_NCQ) { path->device->mintags = 2; Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Sat Jun 9 07:29:07 2012 (r236783) +++ stable/9/sys/cam/cam_xpt.c Sat Jun 9 07:31:04 2012 (r236784) @@ -4704,6 +4704,7 @@ xpt_start_tags(struct cam_path *path) newopenings = min(device->maxtags, sim->max_tagged_dev_openings); xpt_dev_ccbq_resize(path, newopenings); + xpt_async(AC_GETDEV_CHANGED, path, NULL); xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NORMAL); crs.ccb_h.func_code = XPT_REL_SIMQ; crs.release_flags = RELSIM_RELEASE_AFTER_QEMPTY; @@ -4728,6 +4729,7 @@ xpt_stop_tags(struct cam_path *path) xpt_freeze_devq(path, /*count*/1); device->inq_flags &= ~SID_CmdQue; xpt_dev_ccbq_resize(path, sim->max_dev_openings); + xpt_async(AC_GETDEV_CHANGED, path, NULL); xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NORMAL); crs.ccb_h.func_code = XPT_REL_SIMQ; crs.release_flags = RELSIM_RELEASE_AFTER_QEMPTY; From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 07:36:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 041C6106564A; Sat, 9 Jun 2012 07:36:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8AC88FC1A; Sat, 9 Jun 2012 07:36:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q597aIDi014562; Sat, 9 Jun 2012 07:36:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q597aIsv014557; Sat, 9 Jun 2012 07:36:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206090736.q597aIsv014557@svn.freebsd.org> From: Alexander Motin Date: Sat, 9 Jun 2012 07:36:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236785 - in stable/8/sys/cam: . ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 07:36:19 -0000 Author: mav Date: Sat Jun 9 07:36:18 2012 New Revision: 236785 URL: http://svn.freebsd.org/changeset/base/236785 Log: MFC r236393: Use AC_GETDEV_CHANGED async to notify ada driver about DMA and NCQ status change. Now that allows switching between PIO and DMA modes on the fly. Modified: stable/8/sys/cam/ata/ata_da.c stable/8/sys/cam/ata/ata_xpt.c stable/8/sys/cam/cam_xpt.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Sat Jun 9 07:31:04 2012 (r236784) +++ stable/8/sys/cam/ata/ata_da.c Sat Jun 9 07:36:18 2012 (r236785) @@ -726,6 +726,7 @@ static void adaasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg) { + struct ccb_getdev cgd; struct cam_periph *periph; struct ada_softc *softc; @@ -760,11 +761,35 @@ adaasync(void *callback_arg, u_int32_t c "due to status 0x%x\n", status); break; } + case AC_GETDEV_CHANGED: + { + softc = (struct ada_softc *)periph->softc; + xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL); + cgd.ccb_h.func_code = XPT_GDEV_TYPE; + xpt_action((union ccb *)&cgd); + + if ((cgd.ident_data.capabilities1 & ATA_SUPPORT_DMA) && + (cgd.inq_flags & SID_DMA)) + softc->flags |= ADA_FLAG_CAN_DMA; + else + softc->flags &= ~ADA_FLAG_CAN_DMA; + if ((cgd.ident_data.satacapabilities & ATA_SUPPORT_NCQ) && + (cgd.inq_flags & SID_DMA) && (cgd.inq_flags & SID_CmdQue)) + softc->flags |= ADA_FLAG_CAN_NCQ; + else + softc->flags &= ~ADA_FLAG_CAN_NCQ; + if ((cgd.ident_data.support_dsm & ATA_SUPPORT_DSM_TRIM) && + (cgd.inq_flags & SID_DMA)) + softc->flags |= ADA_FLAG_CAN_TRIM; + else + softc->flags &= ~ADA_FLAG_CAN_TRIM; + + cam_periph_async(periph, code, path, arg); + break; + } case AC_SENT_BDR: case AC_BUS_RESET: { - struct ccb_getdev cgd; - softc = (struct ada_softc *)periph->softc; cam_periph_async(periph, code, path, arg); if (softc->state != ADA_STATE_NORMAL) @@ -884,7 +909,7 @@ adaregister(struct cam_periph *periph, v bioq_init(&softc->bio_queue); bioq_init(&softc->trim_queue); - if (cgd->ident_data.capabilities1 & ATA_SUPPORT_DMA && + if ((cgd->ident_data.capabilities1 & ATA_SUPPORT_DMA) && (cgd->inq_flags & SID_DMA)) softc->flags |= ADA_FLAG_CAN_DMA; if (cgd->ident_data.support.command2 & ATA_SUPPORT_ADDRESS48) @@ -893,10 +918,11 @@ adaregister(struct cam_periph *periph, v softc->flags |= ADA_FLAG_CAN_FLUSHCACHE; if (cgd->ident_data.support.command1 & ATA_SUPPORT_POWERMGT) softc->flags |= ADA_FLAG_CAN_POWERMGT; - if (cgd->ident_data.satacapabilities & ATA_SUPPORT_NCQ && + if ((cgd->ident_data.satacapabilities & ATA_SUPPORT_NCQ) && (cgd->inq_flags & SID_DMA) && (cgd->inq_flags & SID_CmdQue)) softc->flags |= ADA_FLAG_CAN_NCQ; - if (cgd->ident_data.support_dsm & ATA_SUPPORT_DSM_TRIM) { + if ((cgd->ident_data.support_dsm & ATA_SUPPORT_DSM_TRIM) && + (cgd->inq_flags & SID_DMA)) { softc->flags |= ADA_FLAG_CAN_TRIM; softc->trim_max_ranges = TRIM_MAX_RANGES; if (cgd->ident_data.max_dsm_blocks != 0) { @@ -1048,8 +1074,9 @@ adaregister(struct cam_periph *periph, v * them and the only alternative would be to * not attach the device on failure. */ - xpt_register_async(AC_SENT_BDR | AC_BUS_RESET | AC_LOST_DEVICE, - adaasync, periph, periph->path); + xpt_register_async(AC_SENT_BDR | AC_BUS_RESET | AC_LOST_DEVICE | + AC_GETDEV_CHANGED, + adaasync, periph, periph->path); /* * Schedule a periodic event to occasionally send an Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Sat Jun 9 07:31:04 2012 (r236784) +++ stable/8/sys/cam/ata/ata_xpt.c Sat Jun 9 07:36:18 2012 (r236785) @@ -407,6 +407,7 @@ negotiate: path->device->inq_flags &= ~SID_DMA; else path->device->inq_flags |= SID_DMA; + xpt_async(AC_GETDEV_CHANGED, path, NULL); cam_fill_ataio(ataio, 1, probedone, @@ -951,6 +952,7 @@ noerror: } path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; + xpt_async(AC_GETDEV_CHANGED, path, NULL); } if (ident_buf->satacapabilities & ATA_SUPPORT_NCQ) { path->device->mintags = 2; Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Sat Jun 9 07:31:04 2012 (r236784) +++ stable/8/sys/cam/cam_xpt.c Sat Jun 9 07:36:18 2012 (r236785) @@ -4621,6 +4621,7 @@ xpt_start_tags(struct cam_path *path) newopenings = min(device->maxtags, sim->max_tagged_dev_openings); xpt_dev_ccbq_resize(path, newopenings); + xpt_async(AC_GETDEV_CHANGED, path, NULL); xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NORMAL); crs.ccb_h.func_code = XPT_REL_SIMQ; crs.release_flags = RELSIM_RELEASE_AFTER_QEMPTY; @@ -4645,6 +4646,7 @@ xpt_stop_tags(struct cam_path *path) xpt_freeze_devq(path, /*count*/1); device->inq_flags &= ~SID_CmdQue; xpt_dev_ccbq_resize(path, sim->max_dev_openings); + xpt_async(AC_GETDEV_CHANGED, path, NULL); xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NORMAL); crs.ccb_h.func_code = XPT_REL_SIMQ; crs.release_flags = RELSIM_RELEASE_AFTER_QEMPTY; From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 07:43:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9B6B31065672; Sat, 9 Jun 2012 07:43:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84C7C8FC18; Sat, 9 Jun 2012 07:43:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q597hC7S014915; Sat, 9 Jun 2012 07:43:12 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q597hCwN014910; Sat, 9 Jun 2012 07:43:12 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206090743.q597hCwN014910@svn.freebsd.org> From: Alexander Motin Date: Sat, 9 Jun 2012 07:43:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236786 - in stable/9: sbin/camcontrol sys/cam sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 07:43:12 -0000 Author: mav Date: Sat Jun 9 07:43:11 2012 New Revision: 236786 URL: http://svn.freebsd.org/changeset/base/236786 Log: MFC r236437: Rewrite enabling NCQ for SATA devices in a way more alike to SCSI TCQ. This allows to control it with `camcontrol negotiate adaX -T (en|dis)able` on the fly, same as for SCSI devices. Sponsored by: iXsystems, Inc. Modified: stable/9/sbin/camcontrol/camcontrol.c stable/9/sys/cam/ata/ata_xpt.c stable/9/sys/cam/cam_ccb.h stable/9/sys/cam/cam_xpt.c Directory Properties: stable/9/sbin/camcontrol/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.c Sat Jun 9 07:36:18 2012 (r236785) +++ stable/9/sbin/camcontrol/camcontrol.c Sat Jun 9 07:43:11 2012 (r236786) @@ -1025,11 +1025,11 @@ camxferrate(struct cam_device *device) if (sas->valid & CTS_SAS_VALID_SPEED) speed = sas->bitrate; } else if (ccb->cts.transport == XPORT_ATA) { - struct ccb_trans_settings_ata *ata = + struct ccb_trans_settings_pata *pata = &ccb->cts.xport_specific.ata; - if (ata->valid & CTS_ATA_VALID_MODE) - speed = ata_mode2speed(ata->mode); + if (pata->valid & CTS_ATA_VALID_MODE) + speed = ata_mode2speed(pata->mode); } else if (ccb->cts.transport == XPORT_SATA) { struct ccb_trans_settings_sata *sata = &ccb->cts.xport_specific.sata; @@ -1072,16 +1072,16 @@ camxferrate(struct cam_device *device) fprintf(stdout, ")"); } } else if (ccb->cts.transport == XPORT_ATA) { - struct ccb_trans_settings_ata *ata = + struct ccb_trans_settings_pata *pata = &ccb->cts.xport_specific.ata; printf(" ("); - if (ata->valid & CTS_ATA_VALID_MODE) - printf("%s, ", ata_mode2string(ata->mode)); - if ((ata->valid & CTS_ATA_VALID_ATAPI) && ata->atapi != 0) - printf("ATAPI %dbytes, ", ata->atapi); - if (ata->valid & CTS_ATA_VALID_BYTECOUNT) - printf("PIO %dbytes", ata->bytecount); + if (pata->valid & CTS_ATA_VALID_MODE) + printf("%s, ", ata_mode2string(pata->mode)); + if ((pata->valid & CTS_ATA_VALID_ATAPI) && pata->atapi != 0) + printf("ATAPI %dbytes, ", pata->atapi); + if (pata->valid & CTS_ATA_VALID_BYTECOUNT) + printf("PIO %dbytes", pata->bytecount); printf(")"); } else if (ccb->cts.transport == XPORT_SATA) { struct ccb_trans_settings_sata *sata = @@ -2891,21 +2891,45 @@ cts_print(struct cam_device *device, str "enabled" : "disabled"); } } + if (cts->transport == XPORT_FC) { + struct ccb_trans_settings_fc *fc = + &cts->xport_specific.fc; + + if (fc->valid & CTS_FC_VALID_WWNN) + fprintf(stdout, "%sWWNN: 0x%llx", pathstr, + (long long) fc->wwnn); + if (fc->valid & CTS_FC_VALID_WWPN) + fprintf(stdout, "%sWWPN: 0x%llx", pathstr, + (long long) fc->wwpn); + if (fc->valid & CTS_FC_VALID_PORT) + fprintf(stdout, "%sPortID: 0x%x", pathstr, fc->port); + if (fc->valid & CTS_FC_VALID_SPEED) + fprintf(stdout, "%stransfer speed: %d.%03dMB/s\n", + pathstr, fc->bitrate / 1000, fc->bitrate % 1000); + } + if (cts->transport == XPORT_SAS) { + struct ccb_trans_settings_sas *sas = + &cts->xport_specific.sas; + + if (sas->valid & CTS_SAS_VALID_SPEED) + fprintf(stdout, "%stransfer speed: %d.%03dMB/s\n", + pathstr, sas->bitrate / 1000, sas->bitrate % 1000); + } if (cts->transport == XPORT_ATA) { - struct ccb_trans_settings_ata *ata = + struct ccb_trans_settings_pata *pata = &cts->xport_specific.ata; - if ((ata->valid & CTS_ATA_VALID_MODE) != 0) { + if ((pata->valid & CTS_ATA_VALID_MODE) != 0) { fprintf(stdout, "%sATA mode: %s\n", pathstr, - ata_mode2string(ata->mode)); + ata_mode2string(pata->mode)); } - if ((ata->valid & CTS_ATA_VALID_ATAPI) != 0) { + if ((pata->valid & CTS_ATA_VALID_ATAPI) != 0) { fprintf(stdout, "%sATAPI packet length: %d\n", pathstr, - ata->atapi); + pata->atapi); } - if ((ata->valid & CTS_ATA_VALID_BYTECOUNT) != 0) { + if ((pata->valid & CTS_ATA_VALID_BYTECOUNT) != 0) { fprintf(stdout, "%sPIO transaction length: %d\n", - pathstr, ata->bytecount); + pathstr, pata->bytecount); } } if (cts->transport == XPORT_SATA) { @@ -2941,12 +2965,22 @@ cts_print(struct cam_device *device, str sata->caps); } } + if (cts->protocol == PROTO_ATA) { + struct ccb_trans_settings_ata *ata= + &cts->proto_specific.ata; + + if (ata->valid & CTS_ATA_VALID_TQ) { + fprintf(stdout, "%stagged queueing: %s\n", pathstr, + (ata->flags & CTS_ATA_FLAGS_TAG_ENB) ? + "enabled" : "disabled"); + } + } if (cts->protocol == PROTO_SCSI) { struct ccb_trans_settings_scsi *scsi= &cts->proto_specific.scsi; if (scsi->valid & CTS_SCSI_VALID_TQ) { - fprintf(stdout, "%stagged queueing is %s\n", pathstr, + fprintf(stdout, "%stagged queueing: %s\n", pathstr, (scsi->flags & CTS_SCSI_FLAGS_TAG_ENB) ? "enabled" : "disabled"); } @@ -3384,16 +3418,19 @@ ratecontrol(struct cam_device *device, i if (change_settings) { int didsettings = 0; struct ccb_trans_settings_spi *spi = NULL; - struct ccb_trans_settings_ata *ata = NULL; + struct ccb_trans_settings_pata *pata = NULL; struct ccb_trans_settings_sata *sata = NULL; + struct ccb_trans_settings_ata *ata = NULL; struct ccb_trans_settings_scsi *scsi = NULL; if (ccb->cts.transport == XPORT_SPI) spi = &ccb->cts.xport_specific.spi; if (ccb->cts.transport == XPORT_ATA) - ata = &ccb->cts.xport_specific.ata; + pata = &ccb->cts.xport_specific.ata; if (ccb->cts.transport == XPORT_SATA) sata = &ccb->cts.xport_specific.sata; + if (ccb->cts.protocol == PROTO_ATA) + ata = &ccb->cts.proto_specific.ata; if (ccb->cts.protocol == PROTO_SCSI) scsi = &ccb->cts.proto_specific.scsi; ccb->cts.xport_specific.valid = 0; @@ -3406,19 +3443,28 @@ ratecontrol(struct cam_device *device, i spi->flags |= CTS_SPI_FLAGS_DISC_ENB; didsettings++; } - if (scsi && tag_enable != -1) { + if (tag_enable != -1) { if ((cpi.hba_inquiry & PI_TAG_ABLE) == 0) { warnx("HBA does not support tagged queueing, " "so you cannot modify tag settings"); retval = 1; goto ratecontrol_bailout; } - scsi->valid |= CTS_SCSI_VALID_TQ; - if (tag_enable == 0) - scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB; - else - scsi->flags |= CTS_SCSI_FLAGS_TAG_ENB; - didsettings++; + if (ata) { + ata->valid |= CTS_SCSI_VALID_TQ; + if (tag_enable == 0) + ata->flags &= ~CTS_ATA_FLAGS_TAG_ENB; + else + ata->flags |= CTS_ATA_FLAGS_TAG_ENB; + didsettings++; + } else if (scsi) { + scsi->valid |= CTS_SCSI_VALID_TQ; + if (tag_enable == 0) + scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB; + else + scsi->flags |= CTS_SCSI_FLAGS_TAG_ENB; + didsettings++; + } } if (spi && offset != -1) { if ((cpi.hba_inquiry & PI_SDTR_ABLE) == 0) { @@ -3465,6 +3511,12 @@ ratecontrol(struct cam_device *device, i retval = 1; goto ratecontrol_bailout; } + if (!user_settings) { + warnx("You can modify only user rate " + "settings for SATA"); + retval = 1; + goto ratecontrol_bailout; + } sata->revision = ata_speed2revision(syncrate * 100); if (sata->revision < 0) { warnx("Invalid rate %f", syncrate); @@ -3474,16 +3526,22 @@ ratecontrol(struct cam_device *device, i sata->valid |= CTS_SATA_VALID_REVISION; didsettings++; } - if ((ata || sata) && mode != -1) { + if ((pata || sata) && mode != -1) { if ((cpi.hba_inquiry & PI_SDTR_ABLE) == 0) { warnx("HBA is not capable of changing " "transfer rates"); retval = 1; goto ratecontrol_bailout; } - if (ata) { - ata->mode = mode; - ata->valid |= CTS_ATA_VALID_MODE; + if (!user_settings) { + warnx("You can modify only user mode " + "settings for ATA/SATA"); + retval = 1; + goto ratecontrol_bailout; + } + if (pata) { + pata->mode = mode; + pata->valid |= CTS_ATA_VALID_MODE; } else { sata->mode = mode; sata->valid |= CTS_SATA_VALID_MODE; @@ -3530,11 +3588,6 @@ ratecontrol(struct cam_device *device, i if (didsettings == 0) { goto ratecontrol_bailout; } - if (!user_settings && (ata || sata)) { - warnx("You can modify only user settings for ATA/SATA"); - retval = 1; - goto ratecontrol_bailout; - } ccb->ccb_h.func_code = XPT_SET_TRAN_SETTINGS; if (cam_send_ccb(device, ccb) < 0) { perror("error sending XPT_SET_TRAN_SETTINGS CCB"); @@ -3566,13 +3619,10 @@ ratecontrol(struct cam_device *device, i fprintf(stderr, "Test Unit Ready failed\n"); goto ratecontrol_bailout; } - /* - * If the user wants things quiet, there's no sense in - * getting the transfer settings, if we're not going - * to print them. - */ - if (quiet != 0) - goto ratecontrol_bailout; + } + if ((change_settings || send_tur) && !quiet && + (ccb->cts.transport == XPORT_ATA || + ccb->cts.transport == XPORT_SATA || send_tur)) { fprintf(stdout, "New parameters:\n"); retval = get_print_cts(device, user_settings, 0, NULL); } Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Sat Jun 9 07:36:18 2012 (r236785) +++ stable/9/sys/cam/ata/ata_xpt.c Sat Jun 9 07:43:11 2012 (r236786) @@ -165,7 +165,7 @@ static cam_status proberegister(struct c void *arg); static void probeschedule(struct cam_periph *probe_periph); static void probestart(struct cam_periph *periph, union ccb *start_ccb); -//static void proberequestdefaultnegotiation(struct cam_periph *periph); +static void proberequestdefaultnegotiation(struct cam_periph *periph); //static int proberequestbackoff(struct cam_periph *periph, // struct cam_ed *device); static void probedone(struct cam_periph *periph, union ccb *done_ccb); @@ -180,6 +180,7 @@ static struct cam_ed * ata_alloc_device(struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id); static void ata_device_transport(struct cam_path *path); +static void ata_get_transfer_settings(struct ccb_trans_settings *cts); static void ata_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_ed *device, int async_update); @@ -662,7 +663,7 @@ negotiate: } xpt_action(start_ccb); } -#if 0 + static void proberequestdefaultnegotiation(struct cam_periph *periph) { @@ -672,14 +673,15 @@ proberequestdefaultnegotiation(struct ca cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_USER_SETTINGS; xpt_action((union ccb *)&cts); - if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) return; - } + cts.xport_specific.valid = 0; cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; xpt_action((union ccb *)&cts); } +#if 0 /* * Backoff Negotiation Code- only pertinent for SPI devices. */ @@ -1044,10 +1046,10 @@ noerror: cts.xport_specific.sata.tags = path->device->maxtags; cts.xport_specific.sata.valid = CTS_SATA_VALID_TAGS; xpt_action((union ccb *)&cts); - /* Reconfigure queues for tagged queueing. */ - xpt_start_tags(path); } } + if (changed) + proberequestdefaultnegotiation(periph); ata_device_transport(path); PROBE_SET_ACTION(softc, PROBE_SETMODE); xpt_release_ccb(done_ccb); @@ -1829,10 +1831,7 @@ ata_action(union ccb *start_ccb) break; case XPT_GET_TRAN_SETTINGS: { - struct cam_sim *sim; - - sim = start_ccb->ccb_h.path->bus->sim; - (*(sim->sim_action))(sim, start_ccb); + ata_get_transfer_settings(&start_ccb->cts); break; } case XPT_SCSI_IO: @@ -1871,14 +1870,48 @@ ata_action(union ccb *start_ccb) } static void +ata_get_transfer_settings(struct ccb_trans_settings *cts) +{ + struct ccb_trans_settings_ata *ata; + struct ccb_trans_settings_scsi *scsi; + struct cam_ed *device; + struct cam_sim *sim; + + device = cts->ccb_h.path->device; + sim = cts->ccb_h.path->bus->sim; + (*(sim->sim_action))(sim, (union ccb *)cts); + + if (cts->protocol == PROTO_ATA) { + ata = &cts->proto_specific.ata; + if ((ata->valid & CTS_ATA_VALID_TQ) == 0) { + ata->valid |= CTS_ATA_VALID_TQ; + if (cts->type == CTS_TYPE_USER_SETTINGS || + (device->flags & CAM_DEV_TAG_AFTER_COUNT) != 0 || + (device->inq_flags & SID_CmdQue) != 0) + ata->flags |= CTS_ATA_FLAGS_TAG_ENB; + } + } + if (cts->protocol == PROTO_SCSI) { + scsi = &cts->proto_specific.scsi; + if ((scsi->valid & CTS_SCSI_VALID_TQ) == 0) { + scsi->valid |= CTS_SCSI_VALID_TQ; + if (cts->type == CTS_TYPE_USER_SETTINGS || + (device->flags & CAM_DEV_TAG_AFTER_COUNT) != 0 || + (device->inq_flags & SID_CmdQue) != 0) + scsi->flags |= CTS_SCSI_FLAGS_TAG_ENB; + } + } +} + +static void ata_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_ed *device, int async_update) { struct ccb_pathinq cpi; - struct ccb_trans_settings cur_cts; + struct ccb_trans_settings_ata *ata; struct ccb_trans_settings_scsi *scsi; - struct ccb_trans_settings_scsi *cur_scsi; struct cam_sim *sim; + struct ata_params *ident_data; struct scsi_inquiry_data *inq_data; if (device == NULL) { @@ -1938,95 +1971,63 @@ ata_set_transfer_settings(struct ccb_tra } sim = cts->ccb_h.path->bus->sim; - - /* - * Nothing more of interest to do unless - * this is a device connected via the - * SCSI protocol. - */ - if (cts->protocol != PROTO_SCSI) { - if (async_update == FALSE) - (*(sim->sim_action))(sim, (union ccb *)cts); - return; - } - + ident_data = &device->ident_data; inq_data = &device->inq_data; - scsi = &cts->proto_specific.scsi; + if (cts->protocol == PROTO_ATA) + ata = &cts->proto_specific.ata; + else + ata = NULL; + if (cts->protocol == PROTO_SCSI) + scsi = &cts->proto_specific.scsi; + else + scsi = NULL; xpt_setup_ccb(&cpi.ccb_h, cts->ccb_h.path, CAM_PRIORITY_NONE); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); - /* SCSI specific sanity checking */ + /* Sanity checking */ if ((cpi.hba_inquiry & PI_TAG_ABLE) == 0 - || (INQ_DATA_TQ_ENABLED(inq_data)) == 0 + || (ata && (ident_data->satacapabilities & ATA_SUPPORT_NCQ) == 0) + || (scsi && (INQ_DATA_TQ_ENABLED(inq_data)) == 0) || (device->queue_flags & SCP_QUEUE_DQUE) != 0 || (device->mintags == 0)) { /* * Can't tag on hardware that doesn't support tags, * doesn't have it enabled, or has broken tag support. */ - scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB; - } - - if (async_update == FALSE) { - /* - * Perform sanity checking against what the - * controller and device can do. - */ - xpt_setup_ccb(&cur_cts.ccb_h, cts->ccb_h.path, CAM_PRIORITY_NONE); - cur_cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; - cur_cts.type = cts->type; - xpt_action((union ccb *)&cur_cts); - if ((cur_cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - return; - } - cur_scsi = &cur_cts.proto_specific.scsi; - if ((scsi->valid & CTS_SCSI_VALID_TQ) == 0) { - scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB; - scsi->flags |= cur_scsi->flags & CTS_SCSI_FLAGS_TAG_ENB; - } - if ((cur_scsi->valid & CTS_SCSI_VALID_TQ) == 0) + if (ata) + ata->flags &= ~CTS_ATA_FLAGS_TAG_ENB; + if (scsi) scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB; } - if (cts->type == CTS_TYPE_CURRENT_SETTINGS - && (scsi->valid & CTS_SCSI_VALID_TQ) != 0) { - int device_tagenb; - - /* - * If we are transitioning from tags to no-tags or - * vice-versa, we need to carefully freeze and restart - * the queue so that we don't overlap tagged and non-tagged - * commands. We also temporarily stop tags if there is - * a change in transfer negotiation settings to allow - * "tag-less" negotiation. - */ - if ((device->flags & CAM_DEV_TAG_AFTER_COUNT) != 0 - || (device->inq_flags & SID_CmdQue) != 0) - device_tagenb = TRUE; - else - device_tagenb = FALSE; + /* Start/stop tags use. */ + if (cts->type == CTS_TYPE_CURRENT_SETTINGS && + ((ata && (ata->valid & CTS_ATA_VALID_TQ) != 0) || + (scsi && (scsi->valid & CTS_SCSI_VALID_TQ) != 0))) { + int nowt, newt = 0; + + nowt = ((device->flags & CAM_DEV_TAG_AFTER_COUNT) != 0 || + (device->inq_flags & SID_CmdQue) != 0); + if (ata) + newt = (ata->flags & CTS_ATA_FLAGS_TAG_ENB) != 0; + if (scsi) + newt = (scsi->flags & CTS_SCSI_FLAGS_TAG_ENB) != 0; - if (((scsi->flags & CTS_SCSI_FLAGS_TAG_ENB) != 0 - && device_tagenb == FALSE) - || ((scsi->flags & CTS_SCSI_FLAGS_TAG_ENB) == 0 - && device_tagenb == TRUE)) { - - if ((scsi->flags & CTS_SCSI_FLAGS_TAG_ENB) != 0) { - /* - * Delay change to use tags until after a - * few commands have gone to this device so - * the controller has time to perform transfer - * negotiations without tagged messages getting - * in the way. - */ - device->tag_delay_count = CAM_TAG_DELAY_COUNT; - device->flags |= CAM_DEV_TAG_AFTER_COUNT; - } else { - xpt_stop_tags(cts->ccb_h.path); - } - } + if (newt && !nowt) { + /* + * Delay change to use tags until after a + * few commands have gone to this device so + * the controller has time to perform transfer + * negotiations without tagged messages getting + * in the way. + */ + device->tag_delay_count = CAM_TAG_DELAY_COUNT; + device->flags |= CAM_DEV_TAG_AFTER_COUNT; + } else if (nowt && !newt) + xpt_stop_tags(cts->ccb_h.path); } + if (async_update == FALSE) (*(sim->sim_action))(sim, (union ccb *)cts); } @@ -2116,11 +2117,11 @@ ata_announce_periph(struct cam_periph *p /* Report connection speed */ speed = cpi.base_transfer_speed; if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_ATA) { - struct ccb_trans_settings_ata *ata = + struct ccb_trans_settings_pata *pata = &cts.xport_specific.ata; - if (ata->valid & CTS_ATA_VALID_MODE) - speed = ata_mode2speed(ata->mode); + if (pata->valid & CTS_ATA_VALID_MODE) + speed = ata_mode2speed(pata->mode); } if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SATA) { struct ccb_trans_settings_sata *sata = @@ -2139,16 +2140,16 @@ ata_announce_periph(struct cam_periph *p periph->unit_number, speed); /* Report additional information about connection */ if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_ATA) { - struct ccb_trans_settings_ata *ata = + struct ccb_trans_settings_pata *pata = &cts.xport_specific.ata; printf(" ("); - if (ata->valid & CTS_ATA_VALID_MODE) - printf("%s, ", ata_mode2string(ata->mode)); - if ((ata->valid & CTS_ATA_VALID_ATAPI) && ata->atapi != 0) - printf("ATAPI %dbytes, ", ata->atapi); - if (ata->valid & CTS_ATA_VALID_BYTECOUNT) - printf("PIO %dbytes", ata->bytecount); + if (pata->valid & CTS_ATA_VALID_MODE) + printf("%s, ", ata_mode2string(pata->mode)); + if ((pata->valid & CTS_ATA_VALID_ATAPI) && pata->atapi != 0) + printf("ATAPI %dbytes, ", pata->atapi); + if (pata->valid & CTS_ATA_VALID_BYTECOUNT) + printf("PIO %dbytes", pata->bytecount); printf(")"); } if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SATA) { Modified: stable/9/sys/cam/cam_ccb.h ============================================================================== --- stable/9/sys/cam/cam_ccb.h Sat Jun 9 07:36:18 2012 (r236785) +++ stable/9/sys/cam/cam_ccb.h Sat Jun 9 07:43:11 2012 (r236786) @@ -844,6 +844,14 @@ struct ccb_trans_settings_scsi #define CTS_SCSI_FLAGS_TAG_ENB 0x01 }; +struct ccb_trans_settings_ata +{ + u_int valid; /* Which fields to honor */ +#define CTS_ATA_VALID_TQ 0x01 + u_int flags; +#define CTS_ATA_FLAGS_TAG_ENB 0x01 +}; + struct ccb_trans_settings_spi { u_int valid; /* Which fields to honor */ @@ -878,7 +886,7 @@ struct ccb_trans_settings_sas { u_int32_t bitrate; /* Mbps */ }; -struct ccb_trans_settings_ata { +struct ccb_trans_settings_pata { u_int valid; /* Which fields to honor */ #define CTS_ATA_VALID_MODE 0x01 #define CTS_ATA_VALID_BYTECOUNT 0x02 @@ -924,6 +932,7 @@ struct ccb_trans_settings { u_int transport_version; union { u_int valid; /* Which fields to honor */ + struct ccb_trans_settings_ata ata; struct ccb_trans_settings_scsi scsi; } proto_specific; union { @@ -931,7 +940,7 @@ struct ccb_trans_settings { struct ccb_trans_settings_spi spi; struct ccb_trans_settings_fc fc; struct ccb_trans_settings_sas sas; - struct ccb_trans_settings_ata ata; + struct ccb_trans_settings_pata ata; struct ccb_trans_settings_sata sata; } xport_specific; }; Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Sat Jun 9 07:36:18 2012 (r236785) +++ stable/9/sys/cam/cam_xpt.c Sat Jun 9 07:43:11 2012 (r236786) @@ -5053,10 +5053,16 @@ camisr_runqueue(void *V_queue) ccb_h->path->bus->sim->devq->send_openings++; runq = TRUE; - if (((dev->flags & CAM_DEV_REL_ON_COMPLETE) != 0 - && (ccb_h->status&CAM_STATUS_MASK) != CAM_REQUEUE_REQ) - || ((dev->flags & CAM_DEV_REL_ON_QUEUE_EMPTY) != 0 + if (((dev->flags & CAM_DEV_REL_ON_QUEUE_EMPTY) != 0 && (dev->ccbq.dev_active == 0))) { + dev->flags &= ~CAM_DEV_REL_ON_QUEUE_EMPTY; + xpt_release_devq(ccb_h->path, /*count*/1, + /*run_queue*/FALSE); + } + + if (((dev->flags & CAM_DEV_REL_ON_COMPLETE) != 0 + && (ccb_h->status&CAM_STATUS_MASK) != CAM_REQUEUE_REQ)) { + dev->flags &= ~CAM_DEV_REL_ON_COMPLETE; xpt_release_devq(ccb_h->path, /*count*/1, /*run_queue*/FALSE); } From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 07:44:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C57D71065672; Sat, 9 Jun 2012 07:44:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEB488FC15; Sat, 9 Jun 2012 07:44:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q597ipUX015051; Sat, 9 Jun 2012 07:44:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q597ipFp015046; Sat, 9 Jun 2012 07:44:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206090744.q597ipFp015046@svn.freebsd.org> From: Alexander Motin Date: Sat, 9 Jun 2012 07:44:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236787 - in stable/8: sbin/camcontrol sys/cam sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 07:44:51 -0000 Author: mav Date: Sat Jun 9 07:44:51 2012 New Revision: 236787 URL: http://svn.freebsd.org/changeset/base/236787 Log: MFC r236437: Rewrite enabling NCQ for SATA devices in a way more alike to SCSI TCQ. This allows to control it with `camcontrol negotiate adaX -T (en|dis)able` on the fly, same as for SCSI devices. Sponsored by: iXsystems, Inc. Modified: stable/8/sbin/camcontrol/camcontrol.c stable/8/sys/cam/ata/ata_xpt.c stable/8/sys/cam/cam_ccb.h stable/8/sys/cam/cam_xpt.c Directory Properties: stable/8/sbin/camcontrol/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/8/sbin/camcontrol/camcontrol.c Sat Jun 9 07:43:11 2012 (r236786) +++ stable/8/sbin/camcontrol/camcontrol.c Sat Jun 9 07:44:51 2012 (r236787) @@ -957,11 +957,11 @@ camxferrate(struct cam_device *device) if (sas->valid & CTS_SAS_VALID_SPEED) speed = sas->bitrate; } else if (ccb->cts.transport == XPORT_ATA) { - struct ccb_trans_settings_ata *ata = + struct ccb_trans_settings_pata *pata = &ccb->cts.xport_specific.ata; - if (ata->valid & CTS_ATA_VALID_MODE) - speed = ata_mode2speed(ata->mode); + if (pata->valid & CTS_ATA_VALID_MODE) + speed = ata_mode2speed(pata->mode); } else if (ccb->cts.transport == XPORT_SATA) { struct ccb_trans_settings_sata *sata = &ccb->cts.xport_specific.sata; @@ -1004,16 +1004,16 @@ camxferrate(struct cam_device *device) fprintf(stdout, ")"); } } else if (ccb->cts.transport == XPORT_ATA) { - struct ccb_trans_settings_ata *ata = + struct ccb_trans_settings_pata *pata = &ccb->cts.xport_specific.ata; printf(" ("); - if (ata->valid & CTS_ATA_VALID_MODE) - printf("%s, ", ata_mode2string(ata->mode)); - if ((ata->valid & CTS_ATA_VALID_ATAPI) && ata->atapi != 0) - printf("ATAPI %dbytes, ", ata->atapi); - if (ata->valid & CTS_ATA_VALID_BYTECOUNT) - printf("PIO %dbytes", ata->bytecount); + if (pata->valid & CTS_ATA_VALID_MODE) + printf("%s, ", ata_mode2string(pata->mode)); + if ((pata->valid & CTS_ATA_VALID_ATAPI) && pata->atapi != 0) + printf("ATAPI %dbytes, ", pata->atapi); + if (pata->valid & CTS_ATA_VALID_BYTECOUNT) + printf("PIO %dbytes", pata->bytecount); printf(")"); } else if (ccb->cts.transport == XPORT_SATA) { struct ccb_trans_settings_sata *sata = @@ -2818,21 +2818,45 @@ cts_print(struct cam_device *device, str "enabled" : "disabled"); } } + if (cts->transport == XPORT_FC) { + struct ccb_trans_settings_fc *fc = + &cts->xport_specific.fc; + + if (fc->valid & CTS_FC_VALID_WWNN) + fprintf(stdout, "%sWWNN: 0x%llx", pathstr, + (long long) fc->wwnn); + if (fc->valid & CTS_FC_VALID_WWPN) + fprintf(stdout, "%sWWPN: 0x%llx", pathstr, + (long long) fc->wwpn); + if (fc->valid & CTS_FC_VALID_PORT) + fprintf(stdout, "%sPortID: 0x%x", pathstr, fc->port); + if (fc->valid & CTS_FC_VALID_SPEED) + fprintf(stdout, "%stransfer speed: %d.%03dMB/s\n", + pathstr, fc->bitrate / 1000, fc->bitrate % 1000); + } + if (cts->transport == XPORT_SAS) { + struct ccb_trans_settings_sas *sas = + &cts->xport_specific.sas; + + if (sas->valid & CTS_SAS_VALID_SPEED) + fprintf(stdout, "%stransfer speed: %d.%03dMB/s\n", + pathstr, sas->bitrate / 1000, sas->bitrate % 1000); + } if (cts->transport == XPORT_ATA) { - struct ccb_trans_settings_ata *ata = + struct ccb_trans_settings_pata *pata = &cts->xport_specific.ata; - if ((ata->valid & CTS_ATA_VALID_MODE) != 0) { + if ((pata->valid & CTS_ATA_VALID_MODE) != 0) { fprintf(stdout, "%sATA mode: %s\n", pathstr, - ata_mode2string(ata->mode)); + ata_mode2string(pata->mode)); } - if ((ata->valid & CTS_ATA_VALID_ATAPI) != 0) { + if ((pata->valid & CTS_ATA_VALID_ATAPI) != 0) { fprintf(stdout, "%sATAPI packet length: %d\n", pathstr, - ata->atapi); + pata->atapi); } - if ((ata->valid & CTS_ATA_VALID_BYTECOUNT) != 0) { + if ((pata->valid & CTS_ATA_VALID_BYTECOUNT) != 0) { fprintf(stdout, "%sPIO transaction length: %d\n", - pathstr, ata->bytecount); + pathstr, pata->bytecount); } } if (cts->transport == XPORT_SATA) { @@ -2868,12 +2892,22 @@ cts_print(struct cam_device *device, str sata->caps); } } + if (cts->protocol == PROTO_ATA) { + struct ccb_trans_settings_ata *ata= + &cts->proto_specific.ata; + + if (ata->valid & CTS_ATA_VALID_TQ) { + fprintf(stdout, "%stagged queueing: %s\n", pathstr, + (ata->flags & CTS_ATA_FLAGS_TAG_ENB) ? + "enabled" : "disabled"); + } + } if (cts->protocol == PROTO_SCSI) { struct ccb_trans_settings_scsi *scsi= &cts->proto_specific.scsi; if (scsi->valid & CTS_SCSI_VALID_TQ) { - fprintf(stdout, "%stagged queueing is %s\n", pathstr, + fprintf(stdout, "%stagged queueing: %s\n", pathstr, (scsi->flags & CTS_SCSI_FLAGS_TAG_ENB) ? "enabled" : "disabled"); } @@ -3301,16 +3335,19 @@ ratecontrol(struct cam_device *device, i if (change_settings) { int didsettings = 0; struct ccb_trans_settings_spi *spi = NULL; - struct ccb_trans_settings_ata *ata = NULL; + struct ccb_trans_settings_pata *pata = NULL; struct ccb_trans_settings_sata *sata = NULL; + struct ccb_trans_settings_ata *ata = NULL; struct ccb_trans_settings_scsi *scsi = NULL; if (ccb->cts.transport == XPORT_SPI) spi = &ccb->cts.xport_specific.spi; if (ccb->cts.transport == XPORT_ATA) - ata = &ccb->cts.xport_specific.ata; + pata = &ccb->cts.xport_specific.ata; if (ccb->cts.transport == XPORT_SATA) sata = &ccb->cts.xport_specific.sata; + if (ccb->cts.protocol == PROTO_ATA) + ata = &ccb->cts.proto_specific.ata; if (ccb->cts.protocol == PROTO_SCSI) scsi = &ccb->cts.proto_specific.scsi; ccb->cts.xport_specific.valid = 0; @@ -3323,19 +3360,28 @@ ratecontrol(struct cam_device *device, i spi->flags |= CTS_SPI_FLAGS_DISC_ENB; didsettings++; } - if (scsi && tag_enable != -1) { + if (tag_enable != -1) { if ((cpi.hba_inquiry & PI_TAG_ABLE) == 0) { warnx("HBA does not support tagged queueing, " "so you cannot modify tag settings"); retval = 1; goto ratecontrol_bailout; } - scsi->valid |= CTS_SCSI_VALID_TQ; - if (tag_enable == 0) - scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB; - else - scsi->flags |= CTS_SCSI_FLAGS_TAG_ENB; - didsettings++; + if (ata) { + ata->valid |= CTS_SCSI_VALID_TQ; + if (tag_enable == 0) + ata->flags &= ~CTS_ATA_FLAGS_TAG_ENB; + else + ata->flags |= CTS_ATA_FLAGS_TAG_ENB; + didsettings++; + } else if (scsi) { + scsi->valid |= CTS_SCSI_VALID_TQ; + if (tag_enable == 0) + scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB; + else + scsi->flags |= CTS_SCSI_FLAGS_TAG_ENB; + didsettings++; + } } if (spi && offset != -1) { if ((cpi.hba_inquiry & PI_SDTR_ABLE) == 0) { @@ -3384,6 +3430,12 @@ ratecontrol(struct cam_device *device, i retval = 1; goto ratecontrol_bailout; } + if (!user_settings) { + warnx("You can modify only user rate " + "settings for SATA"); + retval = 1; + goto ratecontrol_bailout; + } sata->revision = ata_speed2revision(syncrate * 100); if (sata->revision < 0) { warnx("Invalid rate %f", syncrate); @@ -3393,16 +3445,22 @@ ratecontrol(struct cam_device *device, i sata->valid |= CTS_SATA_VALID_REVISION; didsettings++; } - if ((ata || sata) && mode != -1) { + if ((pata || sata) && mode != -1) { if ((cpi.hba_inquiry & PI_SDTR_ABLE) == 0) { warnx("HBA is not capable of changing " "transfer rates"); retval = 1; goto ratecontrol_bailout; } - if (ata) { - ata->mode = mode; - ata->valid |= CTS_ATA_VALID_MODE; + if (!user_settings) { + warnx("You can modify only user mode " + "settings for ATA/SATA"); + retval = 1; + goto ratecontrol_bailout; + } + if (pata) { + pata->mode = mode; + pata->valid |= CTS_ATA_VALID_MODE; } else { sata->mode = mode; sata->valid |= CTS_SATA_VALID_MODE; @@ -3449,11 +3507,6 @@ ratecontrol(struct cam_device *device, i if (didsettings == 0) { goto ratecontrol_bailout; } - if (!user_settings && (ata || sata)) { - warnx("You can modify only user settings for ATA/SATA"); - retval = 1; - goto ratecontrol_bailout; - } ccb->ccb_h.func_code = XPT_SET_TRAN_SETTINGS; if (cam_send_ccb(device, ccb) < 0) { perror("error sending XPT_SET_TRAN_SETTINGS CCB"); @@ -3485,13 +3538,10 @@ ratecontrol(struct cam_device *device, i fprintf(stderr, "Test Unit Ready failed\n"); goto ratecontrol_bailout; } - /* - * If the user wants things quiet, there's no sense in - * getting the transfer settings, if we're not going - * to print them. - */ - if (quiet != 0) - goto ratecontrol_bailout; + } + if ((change_settings || send_tur) && !quiet && + (ccb->cts.transport == XPORT_ATA || + ccb->cts.transport == XPORT_SATA || send_tur)) { fprintf(stdout, "New parameters:\n"); retval = get_print_cts(device, user_settings, 0, NULL); } Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Sat Jun 9 07:43:11 2012 (r236786) +++ stable/8/sys/cam/ata/ata_xpt.c Sat Jun 9 07:44:51 2012 (r236787) @@ -161,7 +161,7 @@ static cam_status proberegister(struct c void *arg); static void probeschedule(struct cam_periph *probe_periph); static void probestart(struct cam_periph *periph, union ccb *start_ccb); -//static void proberequestdefaultnegotiation(struct cam_periph *periph); +static void proberequestdefaultnegotiation(struct cam_periph *periph); //static int proberequestbackoff(struct cam_periph *periph, // struct cam_ed *device); static void probedone(struct cam_periph *periph, union ccb *done_ccb); @@ -176,6 +176,7 @@ static struct cam_ed * ata_alloc_device(struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id); static void ata_device_transport(struct cam_path *path); +static void ata_get_transfer_settings(struct ccb_trans_settings *cts); static void ata_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_ed *device, int async_update); @@ -632,7 +633,7 @@ negotiate: } xpt_action(start_ccb); } -#if 0 + static void proberequestdefaultnegotiation(struct cam_periph *periph) { @@ -642,14 +643,15 @@ proberequestdefaultnegotiation(struct ca cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_USER_SETTINGS; xpt_action((union ccb *)&cts); - if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) return; - } + cts.xport_specific.valid = 0; cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; xpt_action((union ccb *)&cts); } +#if 0 /* * Backoff Negotiation Code- only pertinent for SPI devices. */ @@ -977,10 +979,10 @@ noerror: cts.xport_specific.sata.tags = path->device->maxtags; cts.xport_specific.sata.valid = CTS_SATA_VALID_TAGS; xpt_action((union ccb *)&cts); - /* Reconfigure queues for tagged queueing. */ - xpt_start_tags(path); } } + if (changed) + proberequestdefaultnegotiation(periph); ata_device_transport(path); PROBE_SET_ACTION(softc, PROBE_SETMODE); xpt_release_ccb(done_ccb); @@ -1647,10 +1649,7 @@ ata_action(union ccb *start_ccb) break; case XPT_GET_TRAN_SETTINGS: { - struct cam_sim *sim; - - sim = start_ccb->ccb_h.path->bus->sim; - (*(sim->sim_action))(sim, start_ccb); + ata_get_transfer_settings(&start_ccb->cts); break; } case XPT_SCSI_IO: @@ -1683,14 +1682,48 @@ ata_action(union ccb *start_ccb) } static void +ata_get_transfer_settings(struct ccb_trans_settings *cts) +{ + struct ccb_trans_settings_ata *ata; + struct ccb_trans_settings_scsi *scsi; + struct cam_ed *device; + struct cam_sim *sim; + + device = cts->ccb_h.path->device; + sim = cts->ccb_h.path->bus->sim; + (*(sim->sim_action))(sim, (union ccb *)cts); + + if (cts->protocol == PROTO_ATA) { + ata = &cts->proto_specific.ata; + if ((ata->valid & CTS_ATA_VALID_TQ) == 0) { + ata->valid |= CTS_ATA_VALID_TQ; + if (cts->type == CTS_TYPE_USER_SETTINGS || + (device->flags & CAM_DEV_TAG_AFTER_COUNT) != 0 || + (device->inq_flags & SID_CmdQue) != 0) + ata->flags |= CTS_ATA_FLAGS_TAG_ENB; + } + } + if (cts->protocol == PROTO_SCSI) { + scsi = &cts->proto_specific.scsi; + if ((scsi->valid & CTS_SCSI_VALID_TQ) == 0) { + scsi->valid |= CTS_SCSI_VALID_TQ; + if (cts->type == CTS_TYPE_USER_SETTINGS || + (device->flags & CAM_DEV_TAG_AFTER_COUNT) != 0 || + (device->inq_flags & SID_CmdQue) != 0) + scsi->flags |= CTS_SCSI_FLAGS_TAG_ENB; + } + } +} + +static void ata_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_ed *device, int async_update) { struct ccb_pathinq cpi; - struct ccb_trans_settings cur_cts; + struct ccb_trans_settings_ata *ata; struct ccb_trans_settings_scsi *scsi; - struct ccb_trans_settings_scsi *cur_scsi; struct cam_sim *sim; + struct ata_params *ident_data; struct scsi_inquiry_data *inq_data; if (device == NULL) { @@ -1750,95 +1783,63 @@ ata_set_transfer_settings(struct ccb_tra } sim = cts->ccb_h.path->bus->sim; - - /* - * Nothing more of interest to do unless - * this is a device connected via the - * SCSI protocol. - */ - if (cts->protocol != PROTO_SCSI) { - if (async_update == FALSE) - (*(sim->sim_action))(sim, (union ccb *)cts); - return; - } - + ident_data = &device->ident_data; inq_data = &device->inq_data; - scsi = &cts->proto_specific.scsi; + if (cts->protocol == PROTO_ATA) + ata = &cts->proto_specific.ata; + else + ata = NULL; + if (cts->protocol == PROTO_SCSI) + scsi = &cts->proto_specific.scsi; + else + scsi = NULL; xpt_setup_ccb(&cpi.ccb_h, cts->ccb_h.path, CAM_PRIORITY_NONE); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); - /* SCSI specific sanity checking */ + /* Sanity checking */ if ((cpi.hba_inquiry & PI_TAG_ABLE) == 0 - || (INQ_DATA_TQ_ENABLED(inq_data)) == 0 + || (ata && (ident_data->satacapabilities & ATA_SUPPORT_NCQ) == 0) + || (scsi && (INQ_DATA_TQ_ENABLED(inq_data)) == 0) || (device->queue_flags & SCP_QUEUE_DQUE) != 0 || (device->mintags == 0)) { /* * Can't tag on hardware that doesn't support tags, * doesn't have it enabled, or has broken tag support. */ - scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB; - } - - if (async_update == FALSE) { - /* - * Perform sanity checking against what the - * controller and device can do. - */ - xpt_setup_ccb(&cur_cts.ccb_h, cts->ccb_h.path, CAM_PRIORITY_NONE); - cur_cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; - cur_cts.type = cts->type; - xpt_action((union ccb *)&cur_cts); - if ((cur_cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - return; - } - cur_scsi = &cur_cts.proto_specific.scsi; - if ((scsi->valid & CTS_SCSI_VALID_TQ) == 0) { - scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB; - scsi->flags |= cur_scsi->flags & CTS_SCSI_FLAGS_TAG_ENB; - } - if ((cur_scsi->valid & CTS_SCSI_VALID_TQ) == 0) + if (ata) + ata->flags &= ~CTS_ATA_FLAGS_TAG_ENB; + if (scsi) scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB; } - if (cts->type == CTS_TYPE_CURRENT_SETTINGS - && (scsi->valid & CTS_SCSI_VALID_TQ) != 0) { - int device_tagenb; - - /* - * If we are transitioning from tags to no-tags or - * vice-versa, we need to carefully freeze and restart - * the queue so that we don't overlap tagged and non-tagged - * commands. We also temporarily stop tags if there is - * a change in transfer negotiation settings to allow - * "tag-less" negotiation. - */ - if ((device->flags & CAM_DEV_TAG_AFTER_COUNT) != 0 - || (device->inq_flags & SID_CmdQue) != 0) - device_tagenb = TRUE; - else - device_tagenb = FALSE; + /* Start/stop tags use. */ + if (cts->type == CTS_TYPE_CURRENT_SETTINGS && + ((ata && (ata->valid & CTS_ATA_VALID_TQ) != 0) || + (scsi && (scsi->valid & CTS_SCSI_VALID_TQ) != 0))) { + int nowt, newt = 0; + + nowt = ((device->flags & CAM_DEV_TAG_AFTER_COUNT) != 0 || + (device->inq_flags & SID_CmdQue) != 0); + if (ata) + newt = (ata->flags & CTS_ATA_FLAGS_TAG_ENB) != 0; + if (scsi) + newt = (scsi->flags & CTS_SCSI_FLAGS_TAG_ENB) != 0; - if (((scsi->flags & CTS_SCSI_FLAGS_TAG_ENB) != 0 - && device_tagenb == FALSE) - || ((scsi->flags & CTS_SCSI_FLAGS_TAG_ENB) == 0 - && device_tagenb == TRUE)) { - - if ((scsi->flags & CTS_SCSI_FLAGS_TAG_ENB) != 0) { - /* - * Delay change to use tags until after a - * few commands have gone to this device so - * the controller has time to perform transfer - * negotiations without tagged messages getting - * in the way. - */ - device->tag_delay_count = CAM_TAG_DELAY_COUNT; - device->flags |= CAM_DEV_TAG_AFTER_COUNT; - } else { - xpt_stop_tags(cts->ccb_h.path); - } - } + if (newt && !nowt) { + /* + * Delay change to use tags until after a + * few commands have gone to this device so + * the controller has time to perform transfer + * negotiations without tagged messages getting + * in the way. + */ + device->tag_delay_count = CAM_TAG_DELAY_COUNT; + device->flags |= CAM_DEV_TAG_AFTER_COUNT; + } else if (nowt && !newt) + xpt_stop_tags(cts->ccb_h.path); } + if (async_update == FALSE) (*(sim->sim_action))(sim, (union ccb *)cts); } @@ -1928,11 +1929,11 @@ ata_announce_periph(struct cam_periph *p /* Report connection speed */ speed = cpi.base_transfer_speed; if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_ATA) { - struct ccb_trans_settings_ata *ata = + struct ccb_trans_settings_pata *pata = &cts.xport_specific.ata; - if (ata->valid & CTS_ATA_VALID_MODE) - speed = ata_mode2speed(ata->mode); + if (pata->valid & CTS_ATA_VALID_MODE) + speed = ata_mode2speed(pata->mode); } if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SATA) { struct ccb_trans_settings_sata *sata = @@ -1951,16 +1952,16 @@ ata_announce_periph(struct cam_periph *p periph->unit_number, speed); /* Report additional information about connection */ if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_ATA) { - struct ccb_trans_settings_ata *ata = + struct ccb_trans_settings_pata *pata = &cts.xport_specific.ata; printf(" ("); - if (ata->valid & CTS_ATA_VALID_MODE) - printf("%s, ", ata_mode2string(ata->mode)); - if ((ata->valid & CTS_ATA_VALID_ATAPI) && ata->atapi != 0) - printf("ATAPI %dbytes, ", ata->atapi); - if (ata->valid & CTS_ATA_VALID_BYTECOUNT) - printf("PIO %dbytes", ata->bytecount); + if (pata->valid & CTS_ATA_VALID_MODE) + printf("%s, ", ata_mode2string(pata->mode)); + if ((pata->valid & CTS_ATA_VALID_ATAPI) && pata->atapi != 0) + printf("ATAPI %dbytes, ", pata->atapi); + if (pata->valid & CTS_ATA_VALID_BYTECOUNT) + printf("PIO %dbytes", pata->bytecount); printf(")"); } if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SATA) { Modified: stable/8/sys/cam/cam_ccb.h ============================================================================== --- stable/8/sys/cam/cam_ccb.h Sat Jun 9 07:43:11 2012 (r236786) +++ stable/8/sys/cam/cam_ccb.h Sat Jun 9 07:44:51 2012 (r236787) @@ -798,6 +798,14 @@ struct ccb_trans_settings_scsi #define CTS_SCSI_FLAGS_TAG_ENB 0x01 }; +struct ccb_trans_settings_ata +{ + u_int valid; /* Which fields to honor */ +#define CTS_ATA_VALID_TQ 0x01 + u_int flags; +#define CTS_ATA_FLAGS_TAG_ENB 0x01 +}; + struct ccb_trans_settings_spi { u_int valid; /* Which fields to honor */ @@ -832,7 +840,7 @@ struct ccb_trans_settings_sas { u_int32_t bitrate; /* Mbps */ }; -struct ccb_trans_settings_ata { +struct ccb_trans_settings_pata { u_int valid; /* Which fields to honor */ #define CTS_ATA_VALID_MODE 0x01 #define CTS_ATA_VALID_BYTECOUNT 0x02 @@ -878,6 +886,7 @@ struct ccb_trans_settings { u_int transport_version; union { u_int valid; /* Which fields to honor */ + struct ccb_trans_settings_ata ata; struct ccb_trans_settings_scsi scsi; } proto_specific; union { @@ -885,7 +894,7 @@ struct ccb_trans_settings { struct ccb_trans_settings_spi spi; struct ccb_trans_settings_fc fc; struct ccb_trans_settings_sas sas; - struct ccb_trans_settings_ata ata; + struct ccb_trans_settings_pata ata; struct ccb_trans_settings_sata sata; } xport_specific; }; Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Sat Jun 9 07:43:11 2012 (r236786) +++ stable/8/sys/cam/cam_xpt.c Sat Jun 9 07:44:51 2012 (r236787) @@ -4967,10 +4967,16 @@ camisr_runqueue(void *V_queue) ccb_h->path->bus->sim->devq->send_openings++; runq = TRUE; - if (((dev->flags & CAM_DEV_REL_ON_COMPLETE) != 0 - && (ccb_h->status&CAM_STATUS_MASK) != CAM_REQUEUE_REQ) - || ((dev->flags & CAM_DEV_REL_ON_QUEUE_EMPTY) != 0 + if (((dev->flags & CAM_DEV_REL_ON_QUEUE_EMPTY) != 0 && (dev->ccbq.dev_active == 0))) { + dev->flags &= ~CAM_DEV_REL_ON_QUEUE_EMPTY; + xpt_release_devq(ccb_h->path, /*count*/1, + /*run_queue*/FALSE); + } + + if (((dev->flags & CAM_DEV_REL_ON_COMPLETE) != 0 + && (ccb_h->status&CAM_STATUS_MASK) != CAM_REQUEUE_REQ)) { + dev->flags &= ~CAM_DEV_REL_ON_COMPLETE; xpt_release_devq(ccb_h->path, /*count*/1, /*run_queue*/FALSE); } From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 07:48:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6FB31065674; Sat, 9 Jun 2012 07:48:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D188C8FC17; Sat, 9 Jun 2012 07:48:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q597m8gK015250; Sat, 9 Jun 2012 07:48:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q597m8H8015248; Sat, 9 Jun 2012 07:48:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206090748.q597m8H8015248@svn.freebsd.org> From: Alexander Motin Date: Sat, 9 Jun 2012 07:48:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236788 - stable/9/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 07:48:09 -0000 Author: mav Date: Sat Jun 9 07:48:08 2012 New Revision: 236788 URL: http://svn.freebsd.org/changeset/base/236788 Log: MFC r236552: Remove some dead code that I doubt will ever be implemented. Modified: stable/9/sys/cam/ata/ata_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Sat Jun 9 07:44:51 2012 (r236787) +++ stable/9/sys/cam/ata/ata_xpt.c Sat Jun 9 07:48:08 2012 (r236788) @@ -166,8 +166,6 @@ static cam_status proberegister(struct c static void probeschedule(struct cam_periph *probe_periph); static void probestart(struct cam_periph *periph, union ccb *start_ccb); static void proberequestdefaultnegotiation(struct cam_periph *periph); -//static int proberequestbackoff(struct cam_periph *periph, -// struct cam_ed *device); static void probedone(struct cam_periph *periph, union ccb *done_ccb); static void probecleanup(struct cam_periph *periph); static void ata_find_quirk(struct cam_ed *device); @@ -681,112 +679,6 @@ proberequestdefaultnegotiation(struct ca xpt_action((union ccb *)&cts); } -#if 0 -/* - * Backoff Negotiation Code- only pertinent for SPI devices. - */ -static int -proberequestbackoff(struct cam_periph *periph, struct cam_ed *device) -{ - struct ccb_trans_settings cts; - struct ccb_trans_settings_spi *spi; - - memset(&cts, 0, sizeof (cts)); - xpt_setup_ccb(&cts.ccb_h, periph->path, CAM_PRIORITY_NONE); - cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; - cts.type = CTS_TYPE_CURRENT_SETTINGS; - xpt_action((union ccb *)&cts); - if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - if (bootverbose) { - xpt_print(periph->path, - "failed to get current device settings\n"); - } - return (0); - } - if (cts.transport != XPORT_SPI) { - if (bootverbose) { - xpt_print(periph->path, "not SPI transport\n"); - } - return (0); - } - spi = &cts.xport_specific.spi; - - /* - * We cannot renegotiate sync rate if we don't have one. - */ - if ((spi->valid & CTS_SPI_VALID_SYNC_RATE) == 0) { - if (bootverbose) { - xpt_print(periph->path, "no sync rate known\n"); - } - return (0); - } - - /* - * We'll assert that we don't have to touch PPR options- the - * SIM will see what we do with period and offset and adjust - * the PPR options as appropriate. - */ - - /* - * A sync rate with unknown or zero offset is nonsensical. - * A sync period of zero means Async. - */ - if ((spi->valid & CTS_SPI_VALID_SYNC_OFFSET) == 0 - || spi->sync_offset == 0 || spi->sync_period == 0) { - if (bootverbose) { - xpt_print(periph->path, "no sync rate available\n"); - } - return (0); - } - - if (device->flags & CAM_DEV_DV_HIT_BOTTOM) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, - ("hit async: giving up on DV\n")); - return (0); - } - - - /* - * Jump sync_period up by one, but stop at 5MHz and fall back to Async. - * We don't try to remember 'last' settings to see if the SIM actually - * gets into the speed we want to set. We check on the SIM telling - * us that a requested speed is bad, but otherwise don't try and - * check the speed due to the asynchronous and handshake nature - * of speed setting. - */ - spi->valid = CTS_SPI_VALID_SYNC_RATE | CTS_SPI_VALID_SYNC_OFFSET; - for (;;) { - spi->sync_period++; - if (spi->sync_period >= 0xf) { - spi->sync_period = 0; - spi->sync_offset = 0; - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, - ("setting to async for DV\n")); - /* - * Once we hit async, we don't want to try - * any more settings. - */ - device->flags |= CAM_DEV_DV_HIT_BOTTOM; - } else if (bootverbose) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, - ("DV: period 0x%x\n", spi->sync_period)); - printf("setting period to 0x%x\n", spi->sync_period); - } - cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; - cts.type = CTS_TYPE_CURRENT_SETTINGS; - xpt_action((union ccb *)&cts); - if ((cts.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { - break; - } - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, - ("DV: failed to set period 0x%x\n", spi->sync_period)); - if (spi->sync_period == 0) { - return (0); - } - } - return (1); -} -#endif static void probedone(struct cam_periph *periph, union ccb *done_ccb) { From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 07:49:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56BF21065670; Sat, 9 Jun 2012 07:49:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 411B48FC21; Sat, 9 Jun 2012 07:49:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q597nAEe015336; Sat, 9 Jun 2012 07:49:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q597nA0q015334; Sat, 9 Jun 2012 07:49:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206090749.q597nA0q015334@svn.freebsd.org> From: Alexander Motin Date: Sat, 9 Jun 2012 07:49:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236789 - stable/8/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 07:49:10 -0000 Author: mav Date: Sat Jun 9 07:49:09 2012 New Revision: 236789 URL: http://svn.freebsd.org/changeset/base/236789 Log: MFC r236552: Remove some dead code that I doubt will ever be implemented. Modified: stable/8/sys/cam/ata/ata_xpt.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Sat Jun 9 07:48:08 2012 (r236788) +++ stable/8/sys/cam/ata/ata_xpt.c Sat Jun 9 07:49:09 2012 (r236789) @@ -162,8 +162,6 @@ static cam_status proberegister(struct c static void probeschedule(struct cam_periph *probe_periph); static void probestart(struct cam_periph *periph, union ccb *start_ccb); static void proberequestdefaultnegotiation(struct cam_periph *periph); -//static int proberequestbackoff(struct cam_periph *periph, -// struct cam_ed *device); static void probedone(struct cam_periph *periph, union ccb *done_ccb); static void probecleanup(struct cam_periph *periph); static void ata_find_quirk(struct cam_ed *device); @@ -651,112 +649,6 @@ proberequestdefaultnegotiation(struct ca xpt_action((union ccb *)&cts); } -#if 0 -/* - * Backoff Negotiation Code- only pertinent for SPI devices. - */ -static int -proberequestbackoff(struct cam_periph *periph, struct cam_ed *device) -{ - struct ccb_trans_settings cts; - struct ccb_trans_settings_spi *spi; - - memset(&cts, 0, sizeof (cts)); - xpt_setup_ccb(&cts.ccb_h, periph->path, CAM_PRIORITY_NONE); - cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; - cts.type = CTS_TYPE_CURRENT_SETTINGS; - xpt_action((union ccb *)&cts); - if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - if (bootverbose) { - xpt_print(periph->path, - "failed to get current device settings\n"); - } - return (0); - } - if (cts.transport != XPORT_SPI) { - if (bootverbose) { - xpt_print(periph->path, "not SPI transport\n"); - } - return (0); - } - spi = &cts.xport_specific.spi; - - /* - * We cannot renegotiate sync rate if we don't have one. - */ - if ((spi->valid & CTS_SPI_VALID_SYNC_RATE) == 0) { - if (bootverbose) { - xpt_print(periph->path, "no sync rate known\n"); - } - return (0); - } - - /* - * We'll assert that we don't have to touch PPR options- the - * SIM will see what we do with period and offset and adjust - * the PPR options as appropriate. - */ - - /* - * A sync rate with unknown or zero offset is nonsensical. - * A sync period of zero means Async. - */ - if ((spi->valid & CTS_SPI_VALID_SYNC_OFFSET) == 0 - || spi->sync_offset == 0 || spi->sync_period == 0) { - if (bootverbose) { - xpt_print(periph->path, "no sync rate available\n"); - } - return (0); - } - - if (device->flags & CAM_DEV_DV_HIT_BOTTOM) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, - ("hit async: giving up on DV\n")); - return (0); - } - - - /* - * Jump sync_period up by one, but stop at 5MHz and fall back to Async. - * We don't try to remember 'last' settings to see if the SIM actually - * gets into the speed we want to set. We check on the SIM telling - * us that a requested speed is bad, but otherwise don't try and - * check the speed due to the asynchronous and handshake nature - * of speed setting. - */ - spi->valid = CTS_SPI_VALID_SYNC_RATE | CTS_SPI_VALID_SYNC_OFFSET; - for (;;) { - spi->sync_period++; - if (spi->sync_period >= 0xf) { - spi->sync_period = 0; - spi->sync_offset = 0; - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, - ("setting to async for DV\n")); - /* - * Once we hit async, we don't want to try - * any more settings. - */ - device->flags |= CAM_DEV_DV_HIT_BOTTOM; - } else if (bootverbose) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, - ("DV: period 0x%x\n", spi->sync_period)); - printf("setting period to 0x%x\n", spi->sync_period); - } - cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; - cts.type = CTS_TYPE_CURRENT_SETTINGS; - xpt_action((union ccb *)&cts); - if ((cts.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { - break; - } - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, - ("DV: failed to set period 0x%x\n", spi->sync_period)); - if (spi->sync_period == 0) { - return (0); - } - } - return (1); -} -#endif static void probedone(struct cam_periph *periph, union ccb *done_ccb) { From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 07:53:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25EC81065670; Sat, 9 Jun 2012 07:53:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1066B8FC1C; Sat, 9 Jun 2012 07:53:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q597rvGo015599; Sat, 9 Jun 2012 07:53:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q597rvXB015593; Sat, 9 Jun 2012 07:53:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206090753.q597rvXB015593@svn.freebsd.org> From: Alexander Motin Date: Sat, 9 Jun 2012 07:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236790 - in stable/9/sys: cam/ata dev/ahci dev/ata dev/mvs dev/siis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 07:53:58 -0000 Author: mav Date: Sat Jun 9 07:53:57 2012 New Revision: 236790 URL: http://svn.freebsd.org/changeset/base/236790 Log: r236666: ATA/SATA controllers have no idea about protocol of the connected device until transport will do some probe actions (at least soft reset). Make ATA/SATA SIMs to not report bogus and confusing PROTO_ATA protocol. Make ATA/SATA transport to fill that gap by reporting protocol to SIM with XPT_SET_TRAN_SETTINGS and patching XPT_GET_TRAN_SETTINGS results if needed. Modified: stable/9/sys/cam/ata/ata_xpt.c stable/9/sys/dev/ahci/ahci.c stable/9/sys/dev/ata/ata-all.c stable/9/sys/dev/mvs/mvs.c stable/9/sys/dev/siis/siis.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Sat Jun 9 07:49:09 2012 (r236789) +++ stable/9/sys/cam/ata/ata_xpt.c Sat Jun 9 07:53:57 2012 (r236790) @@ -940,9 +940,9 @@ noerror: xpt_action((union ccb *)&cts); } } + ata_device_transport(path); if (changed) proberequestdefaultnegotiation(periph); - ata_device_transport(path); PROBE_SET_ACTION(softc, PROBE_SETMODE); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); @@ -1119,6 +1119,9 @@ notsata: snprintf(ident_buf->revision, sizeof(ident_buf->revision), "%04x", softc->pm_prv); path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; + ata_device_transport(path); + if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) + proberequestdefaultnegotiation(periph); /* Set supported bits. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); @@ -1195,6 +1198,9 @@ notsata: path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; } + ata_device_transport(path); + if (changed) + proberequestdefaultnegotiation(periph); if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) { path->device->flags &= ~CAM_DEV_UNCONFIGURED; @@ -1773,6 +1779,12 @@ ata_get_transfer_settings(struct ccb_tra sim = cts->ccb_h.path->bus->sim; (*(sim->sim_action))(sim, (union ccb *)cts); + if (cts->protocol == PROTO_UNKNOWN || + cts->protocol == PROTO_UNSPECIFIED) { + cts->protocol = device->protocol; + cts->protocol_version = device->protocol_version; + } + if (cts->protocol == PROTO_ATA) { ata = &cts->proto_specific.ata; if ((ata->valid & CTS_ATA_VALID_TQ) == 0) { @@ -1793,6 +1805,12 @@ ata_get_transfer_settings(struct ccb_tra scsi->flags |= CTS_SCSI_FLAGS_TAG_ENB; } } + + if (cts->transport == XPORT_UNKNOWN || + cts->transport == XPORT_UNSPECIFIED) { + cts->transport = device->transport; + cts->transport_version = device->transport_version; + } } static void Modified: stable/9/sys/dev/ahci/ahci.c ============================================================================== --- stable/9/sys/dev/ahci/ahci.c Sat Jun 9 07:49:09 2012 (r236789) +++ stable/9/sys/dev/ahci/ahci.c Sat Jun 9 07:53:57 2012 (r236790) @@ -2881,7 +2881,7 @@ ahciaction(struct cam_sim *sim, union cc d = &ch->curr[ccb->ccb_h.target_id]; else d = &ch->user[ccb->ccb_h.target_id]; - cts->protocol = PROTO_ATA; + cts->protocol = PROTO_UNSPECIFIED; cts->protocol_version = PROTO_VERSION_UNSPECIFIED; cts->transport = XPORT_SATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; @@ -2967,7 +2967,7 @@ ahciaction(struct cam_sim *sim, union cc cpi->unit_number = cam_sim_unit(sim); cpi->transport = XPORT_SATA; cpi->transport_version = XPORT_VERSION_UNSPECIFIED; - cpi->protocol = PROTO_ATA; + cpi->protocol = PROTO_UNSPECIFIED; cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; cpi->maxio = MAXPHYS; /* ATI SB600 can't handle 256 sectors with FPDMA (NCQ). */ Modified: stable/9/sys/dev/ata/ata-all.c ============================================================================== --- stable/9/sys/dev/ata/ata-all.c Sat Jun 9 07:49:09 2012 (r236789) +++ stable/9/sys/dev/ata/ata-all.c Sat Jun 9 07:53:57 2012 (r236790) @@ -1787,7 +1787,7 @@ ataaction(struct cam_sim *sim, union ccb d = &ch->curr[ccb->ccb_h.target_id]; else d = &ch->user[ccb->ccb_h.target_id]; - cts->protocol = PROTO_ATA; + cts->protocol = PROTO_UNSPECIFIED; cts->protocol_version = PROTO_VERSION_UNSPECIFIED; if (ch->flags & ATA_SATA) { cts->transport = XPORT_SATA; @@ -1875,7 +1875,7 @@ ataaction(struct cam_sim *sim, union ccb else cpi->transport = XPORT_ATA; cpi->transport_version = XPORT_VERSION_UNSPECIFIED; - cpi->protocol = PROTO_ATA; + cpi->protocol = PROTO_UNSPECIFIED; cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; cpi->maxio = ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS; if (device_get_devclass(device_get_parent(parent)) == Modified: stable/9/sys/dev/mvs/mvs.c ============================================================================== --- stable/9/sys/dev/mvs/mvs.c Sat Jun 9 07:49:09 2012 (r236789) +++ stable/9/sys/dev/mvs/mvs.c Sat Jun 9 07:53:57 2012 (r236790) @@ -2301,7 +2301,7 @@ mvsaction(struct cam_sim *sim, union ccb d = &ch->curr[ccb->ccb_h.target_id]; else d = &ch->user[ccb->ccb_h.target_id]; - cts->protocol = PROTO_ATA; + cts->protocol = PROTO_UNSPECIFIED; cts->protocol_version = PROTO_VERSION_UNSPECIFIED; cts->transport = XPORT_SATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; @@ -2385,7 +2385,7 @@ mvsaction(struct cam_sim *sim, union ccb cpi->unit_number = cam_sim_unit(sim); cpi->transport = XPORT_SATA; cpi->transport_version = XPORT_VERSION_UNSPECIFIED; - cpi->protocol = PROTO_ATA; + cpi->protocol = PROTO_UNSPECIFIED; cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; cpi->maxio = MAXPHYS; if ((ch->quirks & MVS_Q_SOC) == 0) { Modified: stable/9/sys/dev/siis/siis.c ============================================================================== --- stable/9/sys/dev/siis/siis.c Sat Jun 9 07:49:09 2012 (r236789) +++ stable/9/sys/dev/siis/siis.c Sat Jun 9 07:53:57 2012 (r236790) @@ -1884,7 +1884,7 @@ siisaction(struct cam_sim *sim, union cc d = &ch->curr[ccb->ccb_h.target_id]; else d = &ch->user[ccb->ccb_h.target_id]; - cts->protocol = PROTO_ATA; + cts->protocol = PROTO_UNSPECIFIED; cts->protocol_version = PROTO_VERSION_UNSPECIFIED; cts->transport = XPORT_SATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; @@ -1960,7 +1960,7 @@ siisaction(struct cam_sim *sim, union cc cpi->unit_number = cam_sim_unit(sim); cpi->transport = XPORT_SATA; cpi->transport_version = XPORT_VERSION_UNSPECIFIED; - cpi->protocol = PROTO_ATA; + cpi->protocol = PROTO_UNSPECIFIED; cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; cpi->maxio = MAXPHYS; cpi->hba_vendor = pci_get_vendor(parent); From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 07:57:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F52A1065670; Sat, 9 Jun 2012 07:57:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18F4C8FC1F; Sat, 9 Jun 2012 07:57:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q597vqfL015839; Sat, 9 Jun 2012 07:57:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q597vqec015833; Sat, 9 Jun 2012 07:57:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206090757.q597vqec015833@svn.freebsd.org> From: Alexander Motin Date: Sat, 9 Jun 2012 07:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236791 - in stable/8/sys: cam/ata dev/ahci dev/ata dev/mvs dev/siis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 07:57:53 -0000 Author: mav Date: Sat Jun 9 07:57:52 2012 New Revision: 236791 URL: http://svn.freebsd.org/changeset/base/236791 Log: r236666: ATA/SATA controllers have no idea about protocol of the connected device until transport will do some probe actions (at least soft reset). Make ATA/SATA SIMs to not report bogus and confusing PROTO_ATA protocol. Make ATA/SATA transport to fill that gap by reporting protocol to SIM with XPT_SET_TRAN_SETTINGS and patching XPT_GET_TRAN_SETTINGS results if needed. Modified: stable/8/sys/cam/ata/ata_xpt.c stable/8/sys/dev/ahci/ahci.c stable/8/sys/dev/ata/ata-all.c stable/8/sys/dev/mvs/mvs.c stable/8/sys/dev/siis/siis.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Sat Jun 9 07:53:57 2012 (r236790) +++ stable/8/sys/cam/ata/ata_xpt.c Sat Jun 9 07:57:52 2012 (r236791) @@ -873,9 +873,9 @@ noerror: xpt_action((union ccb *)&cts); } } + ata_device_transport(path); if (changed) proberequestdefaultnegotiation(periph); - ata_device_transport(path); PROBE_SET_ACTION(softc, PROBE_SETMODE); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); @@ -1054,6 +1054,9 @@ notsata: snprintf(ident_buf->revision, sizeof(ident_buf->revision), "%04x", softc->pm_prv); path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; + ata_device_transport(path); + if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) + proberequestdefaultnegotiation(periph); /* Set supported bits. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); @@ -1585,6 +1588,12 @@ ata_get_transfer_settings(struct ccb_tra sim = cts->ccb_h.path->bus->sim; (*(sim->sim_action))(sim, (union ccb *)cts); + if (cts->protocol == PROTO_UNKNOWN || + cts->protocol == PROTO_UNSPECIFIED) { + cts->protocol = device->protocol; + cts->protocol_version = device->protocol_version; + } + if (cts->protocol == PROTO_ATA) { ata = &cts->proto_specific.ata; if ((ata->valid & CTS_ATA_VALID_TQ) == 0) { @@ -1605,6 +1614,12 @@ ata_get_transfer_settings(struct ccb_tra scsi->flags |= CTS_SCSI_FLAGS_TAG_ENB; } } + + if (cts->transport == XPORT_UNKNOWN || + cts->transport == XPORT_UNSPECIFIED) { + cts->transport = device->transport; + cts->transport_version = device->transport_version; + } } static void Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Sat Jun 9 07:53:57 2012 (r236790) +++ stable/8/sys/dev/ahci/ahci.c Sat Jun 9 07:57:52 2012 (r236791) @@ -2878,7 +2878,7 @@ ahciaction(struct cam_sim *sim, union cc d = &ch->curr[ccb->ccb_h.target_id]; else d = &ch->user[ccb->ccb_h.target_id]; - cts->protocol = PROTO_ATA; + cts->protocol = PROTO_UNSPECIFIED; cts->protocol_version = PROTO_VERSION_UNSPECIFIED; cts->transport = XPORT_SATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; @@ -2963,7 +2963,7 @@ ahciaction(struct cam_sim *sim, union cc cpi->unit_number = cam_sim_unit(sim); cpi->transport = XPORT_SATA; cpi->transport_version = XPORT_VERSION_UNSPECIFIED; - cpi->protocol = PROTO_ATA; + cpi->protocol = PROTO_UNSPECIFIED; cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; cpi->maxio = MAXPHYS; /* ATI SB600 can't handle 256 sectors with FPDMA (NCQ). */ Modified: stable/8/sys/dev/ata/ata-all.c ============================================================================== --- stable/8/sys/dev/ata/ata-all.c Sat Jun 9 07:53:57 2012 (r236790) +++ stable/8/sys/dev/ata/ata-all.c Sat Jun 9 07:57:52 2012 (r236791) @@ -1786,7 +1786,7 @@ ataaction(struct cam_sim *sim, union ccb d = &ch->curr[ccb->ccb_h.target_id]; else d = &ch->user[ccb->ccb_h.target_id]; - cts->protocol = PROTO_ATA; + cts->protocol = PROTO_UNSPECIFIED; cts->protocol_version = PROTO_VERSION_UNSPECIFIED; if (ch->flags & ATA_SATA) { cts->transport = XPORT_SATA; @@ -1873,7 +1873,7 @@ ataaction(struct cam_sim *sim, union ccb else cpi->transport = XPORT_ATA; cpi->transport_version = XPORT_VERSION_UNSPECIFIED; - cpi->protocol = PROTO_ATA; + cpi->protocol = PROTO_UNSPECIFIED; cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; cpi->maxio = ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS; cpi->ccb_h.status = CAM_REQ_CMP; Modified: stable/8/sys/dev/mvs/mvs.c ============================================================================== --- stable/8/sys/dev/mvs/mvs.c Sat Jun 9 07:53:57 2012 (r236790) +++ stable/8/sys/dev/mvs/mvs.c Sat Jun 9 07:57:52 2012 (r236791) @@ -2300,7 +2300,7 @@ mvsaction(struct cam_sim *sim, union ccb d = &ch->curr[ccb->ccb_h.target_id]; else d = &ch->user[ccb->ccb_h.target_id]; - cts->protocol = PROTO_ATA; + cts->protocol = PROTO_UNSPECIFIED; cts->protocol_version = PROTO_VERSION_UNSPECIFIED; cts->transport = XPORT_SATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; @@ -2383,7 +2383,7 @@ mvsaction(struct cam_sim *sim, union ccb cpi->unit_number = cam_sim_unit(sim); cpi->transport = XPORT_SATA; cpi->transport_version = XPORT_VERSION_UNSPECIFIED; - cpi->protocol = PROTO_ATA; + cpi->protocol = PROTO_UNSPECIFIED; cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; cpi->maxio = MAXPHYS; cpi->ccb_h.status = CAM_REQ_CMP; Modified: stable/8/sys/dev/siis/siis.c ============================================================================== --- stable/8/sys/dev/siis/siis.c Sat Jun 9 07:53:57 2012 (r236790) +++ stable/8/sys/dev/siis/siis.c Sat Jun 9 07:57:52 2012 (r236791) @@ -1889,7 +1889,7 @@ siisaction(struct cam_sim *sim, union cc d = &ch->curr[ccb->ccb_h.target_id]; else d = &ch->user[ccb->ccb_h.target_id]; - cts->protocol = PROTO_ATA; + cts->protocol = PROTO_UNSPECIFIED; cts->protocol_version = PROTO_VERSION_UNSPECIFIED; cts->transport = XPORT_SATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; @@ -1964,7 +1964,7 @@ siisaction(struct cam_sim *sim, union cc cpi->unit_number = cam_sim_unit(sim); cpi->transport = XPORT_SATA; cpi->transport_version = XPORT_VERSION_UNSPECIFIED; - cpi->protocol = PROTO_ATA; + cpi->protocol = PROTO_UNSPECIFIED; cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; cpi->ccb_h.status = CAM_REQ_CMP; cpi->maxio = MAXPHYS; From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 08:04:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 04ED6106564A; Sat, 9 Jun 2012 08:04:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA7648FC1D; Sat, 9 Jun 2012 08:04:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q59848Fl016146; Sat, 9 Jun 2012 08:04:08 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q59848EN016143; Sat, 9 Jun 2012 08:04:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206090804.q59848EN016143@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 9 Jun 2012 08:04:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236792 - in stable/9/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 08:04:09 -0000 Author: kib Date: Sat Jun 9 08:04:08 2012 New Revision: 236792 URL: http://svn.freebsd.org/changeset/base/236792 Log: MFC r236043: Add a vn_bmap_seekhole(9) vnode helper which can be used by any filesystem which supports VOP_BMAP(9) to implement SEEK_HOLE/SEEK_DATA commands for lseek(2). Modified: stable/9/sys/kern/vfs_vnops.c stable/9/sys/sys/vnode.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_vnops.c ============================================================================== --- stable/9/sys/kern/vfs_vnops.c Sat Jun 9 07:57:52 2012 (r236791) +++ stable/9/sys/kern/vfs_vnops.c Sat Jun 9 08:04:08 2012 (r236792) @@ -1461,3 +1461,56 @@ vn_pages_remove(struct vnode *vp, vm_pin vm_object_page_remove(object, start, end, 0); VM_OBJECT_UNLOCK(object); } + +int +vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, struct ucred *cred) +{ + struct vattr va; + daddr_t bn, bnp; + uint64_t bsize; + off_t noff; + int error; + + KASSERT(cmd == FIOSEEKHOLE || cmd == FIOSEEKDATA, + ("Wrong command %lu", cmd)); + + if (vn_lock(vp, LK_SHARED) != 0) + return (EBADF); + if (vp->v_type != VREG) { + error = ENOTTY; + goto unlock; + } + error = VOP_GETATTR(vp, &va, cred); + if (error != 0) + goto unlock; + noff = *off; + if (noff >= va.va_size) { + error = ENXIO; + goto unlock; + } + bsize = vp->v_mount->mnt_stat.f_iosize; + for (bn = noff / bsize; noff < va.va_size; bn++, noff += bsize) { + error = VOP_BMAP(vp, bn, NULL, &bnp, NULL, NULL); + if (error == EOPNOTSUPP) { + error = ENOTTY; + goto unlock; + } + if ((bnp == -1 && cmd == FIOSEEKHOLE) || + (bnp != -1 && cmd == FIOSEEKDATA)) { + noff = bn * bsize; + if (noff < *off) + noff = *off; + goto unlock; + } + } + if (noff > va.va_size) + noff = va.va_size; + /* noff == va.va_size. There is an implicit hole at the end of file. */ + if (cmd == FIOSEEKDATA) + error = ENXIO; +unlock: + VOP_UNLOCK(vp, 0); + if (error == 0) + *off = noff; + return (error); +} Modified: stable/9/sys/sys/vnode.h ============================================================================== --- stable/9/sys/sys/vnode.h Sat Jun 9 07:57:52 2012 (r236791) +++ stable/9/sys/sys/vnode.h Sat Jun 9 08:04:08 2012 (r236792) @@ -643,6 +643,8 @@ void vunref(struct vnode *); void vn_printf(struct vnode *vp, const char *fmt, ...) __printflike(2,3); #define vprint(label, vp) vn_printf((vp), "%s\n", (label)) int vrecycle(struct vnode *vp, struct thread *td); +int vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, + struct ucred *cred); int vn_close(struct vnode *vp, int flags, struct ucred *file_cred, struct thread *td); void vn_finished_write(struct mount *mp); From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 08:06:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 929491065698; Sat, 9 Jun 2012 08:06:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E2998FC1A; Sat, 9 Jun 2012 08:06:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5986oSM016319; Sat, 9 Jun 2012 08:06:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5986oQ9016317; Sat, 9 Jun 2012 08:06:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206090806.q5986oQ9016317@svn.freebsd.org> From: Alexander Motin Date: Sat, 9 Jun 2012 08:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236793 - stable/9/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 08:06:50 -0000 Author: mav Date: Sat Jun 9 08:06:49 2012 New Revision: 236793 URL: http://svn.freebsd.org/changeset/base/236793 Log: MFC r236691: Remove declaration of scsi_interpret_sense(), removed 11 years ago. Modified: stable/9/sys/cam/scsi/scsi_all.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/9/sys/cam/scsi/scsi_all.h Sat Jun 9 08:04:08 2012 (r236792) +++ stable/9/sys/cam/scsi/scsi_all.h Sat Jun 9 08:06:49 2012 (r236793) @@ -2172,12 +2172,6 @@ int scsi_sense_sbuf(struct ccb_scsiio * char * scsi_sense_string(struct ccb_scsiio *csio, char *str, int str_len); void scsi_sense_print(struct ccb_scsiio *csio); -int scsi_interpret_sense(union ccb *ccb, - u_int32_t sense_flags, - u_int32_t *relsim_flags, - u_int32_t *reduction, - u_int32_t *timeout, - scsi_sense_action error_action); #else /* _KERNEL */ int scsi_command_string(struct cam_device *device, struct ccb_scsiio *csio, struct sbuf *sb); @@ -2189,13 +2183,6 @@ char * scsi_sense_string(struct cam_dev char *str, int str_len); void scsi_sense_print(struct cam_device *device, struct ccb_scsiio *csio, FILE *ofile); -int scsi_interpret_sense(struct cam_device *device, - union ccb *ccb, - u_int32_t sense_flags, - u_int32_t *relsim_flags, - u_int32_t *reduction, - u_int32_t *timeout, - scsi_sense_action error_action); #endif /* _KERNEL */ #define SF_RETRY_UA 0x01 From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 08:07:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1957106564A; Sat, 9 Jun 2012 08:07:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C7278FC08; Sat, 9 Jun 2012 08:07:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5987cg3016402; Sat, 9 Jun 2012 08:07:38 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5987cnT016400; Sat, 9 Jun 2012 08:07:38 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206090807.q5987cnT016400@svn.freebsd.org> From: Alexander Motin Date: Sat, 9 Jun 2012 08:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236794 - stable/8/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 08:07:38 -0000 Author: mav Date: Sat Jun 9 08:07:38 2012 New Revision: 236794 URL: http://svn.freebsd.org/changeset/base/236794 Log: MFC r236691: Remove declaration of scsi_interpret_sense(), removed 11 years ago. Modified: stable/8/sys/cam/scsi/scsi_all.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.h Sat Jun 9 08:06:49 2012 (r236793) +++ stable/8/sys/cam/scsi/scsi_all.h Sat Jun 9 08:07:38 2012 (r236794) @@ -1135,12 +1135,6 @@ int scsi_sense_sbuf(struct ccb_scsiio * char * scsi_sense_string(struct ccb_scsiio *csio, char *str, int str_len); void scsi_sense_print(struct ccb_scsiio *csio); -int scsi_interpret_sense(union ccb *ccb, - u_int32_t sense_flags, - u_int32_t *relsim_flags, - u_int32_t *reduction, - u_int32_t *timeout, - scsi_sense_action error_action); #else /* _KERNEL */ int scsi_command_string(struct cam_device *device, struct ccb_scsiio *csio, struct sbuf *sb); @@ -1152,13 +1146,6 @@ char * scsi_sense_string(struct cam_dev char *str, int str_len); void scsi_sense_print(struct cam_device *device, struct ccb_scsiio *csio, FILE *ofile); -int scsi_interpret_sense(struct cam_device *device, - union ccb *ccb, - u_int32_t sense_flags, - u_int32_t *relsim_flags, - u_int32_t *reduction, - u_int32_t *timeout, - scsi_sense_action error_action); #endif /* _KERNEL */ #define SF_RETRY_UA 0x01 From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 08:09:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0379A1065670; Sat, 9 Jun 2012 08:09:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8F098FC08; Sat, 9 Jun 2012 08:09:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5989GAD016512; Sat, 9 Jun 2012 08:09:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5989GtA016510; Sat, 9 Jun 2012 08:09:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206090809.q5989GtA016510@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 9 Jun 2012 08:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236795 - stable/9/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 08:09:17 -0000 Author: kib Date: Sat Jun 9 08:09:16 2012 New Revision: 236795 URL: http://svn.freebsd.org/changeset/base/236795 Log: MFC r236044: Implement SEEK_HOLE/SEEK_DATA for UFS. Modified: stable/9/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/9/sys/ufs/ufs/ufs_vnops.c Sat Jun 9 08:07:38 2012 (r236794) +++ stable/9/sys/ufs/ufs/ufs_vnops.c Sat Jun 9 08:09:16 2012 (r236795) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -104,6 +105,7 @@ static int ufs_chown(struct vnode *, uid static vop_close_t ufs_close; static vop_create_t ufs_create; static vop_getattr_t ufs_getattr; +static vop_ioctl_t ufs_ioctl; static vop_link_t ufs_link; static int ufs_makeinode(int mode, struct vnode *, struct vnode **, struct componentname *); static vop_markatime_t ufs_markatime; @@ -2513,6 +2515,9 @@ ufs_pathconf(ap) *ap->a_retval = 0; #endif break; + case _PC_MIN_HOLE_SIZE: + *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize; + break; case _PC_ASYNC_IO: /* _PC_ASYNC_IO should have been handled by upper layers. */ KASSERT(0, ("_PC_ASYNC_IO should not get here")); @@ -2746,6 +2751,20 @@ bad: return (error); } +static int +ufs_ioctl(struct vop_ioctl_args *ap) +{ + + switch (ap->a_command) { + case FIOSEEKDATA: + case FIOSEEKHOLE: + return (vn_bmap_seekhole(ap->a_vp, ap->a_command, + (off_t *)ap->a_data, ap->a_cred)); + default: + return (ENOTTY); + } +} + /* Global vfs data structures for ufs. */ struct vop_vector ufs_vnodeops = { .vop_default = &default_vnodeops, @@ -2760,6 +2779,7 @@ struct vop_vector ufs_vnodeops = { .vop_create = ufs_create, .vop_getattr = ufs_getattr, .vop_inactive = ufs_inactive, + .vop_ioctl = ufs_ioctl, .vop_link = ufs_link, .vop_lookup = vfs_cache_lookup, .vop_markatime = ufs_markatime, From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 08:13:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1ED49106564A; Sat, 9 Jun 2012 08:13:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4A668FC14; Sat, 9 Jun 2012 08:13:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q598Dvbs016758; Sat, 9 Jun 2012 08:13:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q598DvQb016755; Sat, 9 Jun 2012 08:13:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206090813.q598DvQb016755@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 9 Jun 2012 08:13:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236796 - in stable/9/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 08:13:58 -0000 Author: kib Date: Sat Jun 9 08:13:57 2012 New Revision: 236796 URL: http://svn.freebsd.org/changeset/base/236796 Log: MFC r236465: Update the print mask for decoding b_flags. Add print masks for b_vflags and b_xflags_t and print them as well. MFC r236487: Fix typo. Use commas to separate flag printouts, in style with other parts of function. Modified: stable/9/sys/kern/vfs_bio.c stable/9/sys/sys/buf.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_bio.c ============================================================================== --- stable/9/sys/kern/vfs_bio.c Sat Jun 9 08:09:16 2012 (r236795) +++ stable/9/sys/kern/vfs_bio.c Sat Jun 9 08:13:57 2012 (r236796) @@ -4017,7 +4017,9 @@ DB_SHOW_COMMAND(buffer, db_show_buffer) } db_printf("buf at %p\n", bp); - db_printf("b_flags = 0x%b\n", (u_int)bp->b_flags, PRINT_BUF_FLAGS); + db_printf("b_flags = 0x%b, b_xflags=0x%b, b_vflags=0x%b\n", + (u_int)bp->b_flags, PRINT_BUF_FLAGS, (u_int)bp->b_xflags, + PRINT_BUF_XFLAGS, (u_int)bp->b_vflags, PRINT_BUF_VFLAGS); db_printf( "b_error = %d, b_bufsize = %ld, b_bcount = %ld, b_resid = %ld\n" "b_bufobj = (%p), b_data = %p, b_blkno = %jd, b_lblkno = %jd, " Modified: stable/9/sys/sys/buf.h ============================================================================== --- stable/9/sys/sys/buf.h Sat Jun 9 08:09:16 2012 (r236795) +++ stable/9/sys/sys/buf.h Sat Jun 9 08:13:57 2012 (r236796) @@ -224,8 +224,8 @@ struct buf { #define B_CLUSTER 0x40000000 /* pagein op, so swap() can count it */ #define B_REMFREE 0x80000000 /* Delayed bremfree */ -#define PRINT_BUF_FLAGS "\20\40remfree\37cluster\36vmio\35ram\34b27" \ - "\33paging\32b25\31b24\30b23\27relbuf\26dirty\25b20" \ +#define PRINT_BUF_FLAGS "\20\40remfree\37cluster\36vmio\35ram\34managed" \ + "\33paging\32needsgiant\31nocopy\30b23\27relbuf\26dirty\25b20" \ "\24b19\23b18\22clusterok\21malloc\20nocache\17b14\16inval" \ "\15b12\14b11\13eintr\12done\11persist\10delwri\7validsuspwrt" \ "\6cache\5deferred\4direct\3async\2needcommit\1age" @@ -239,6 +239,8 @@ struct buf { #define BX_BKGRDMARKER 0x00000020 /* Mark buffer for splay tree */ #define BX_ALTDATA 0x00000040 /* Holds extended data */ +#define PRINT_BUF_XFLAGS "\20\7altdata\6bkgrdmarker\5bkgrdwrite\2clean\1dirty" + #define NOOFFSET (-1LL) /* No buffer offset calculated yet */ /* @@ -249,6 +251,8 @@ struct buf { #define BV_BKGRDWAIT 0x00000004 /* Background write waiting */ #define BV_INFREECNT 0x80000000 /* buf is counted in numfreebufs */ +#define PRINT_BUF_VFLAGS "\20\40infreecnt\3bkgrdwait\2bkgrdinprog\1scanned" + #ifdef _KERNEL /* * Buffer locking From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 08:23:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CCC8A1065673; Sat, 9 Jun 2012 08:23:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B78788FC0A; Sat, 9 Jun 2012 08:23:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q598NtD6017368; Sat, 9 Jun 2012 08:23:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q598Ntn0017366; Sat, 9 Jun 2012 08:23:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206090823.q598Ntn0017366@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 9 Jun 2012 08:23:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236797 - stable/9/tools/tools/syscall_timing X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 08:23:55 -0000 Author: kib Date: Sat Jun 9 08:23:55 2012 New Revision: 236797 URL: http://svn.freebsd.org/changeset/base/236797 Log: MFC r236686: Add gettimeofday() test. Modified: stable/9/tools/tools/syscall_timing/syscall_timing.c Directory Properties: stable/9/tools/tools/syscall_timing/ (props changed) Modified: stable/9/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- stable/9/tools/tools/syscall_timing/syscall_timing.c Sat Jun 9 08:13:57 2012 (r236796) +++ stable/9/tools/tools/syscall_timing/syscall_timing.c Sat Jun 9 08:23:55 2012 (r236797) @@ -142,6 +142,22 @@ test_clock_gettime(uintmax_t num, uintma } uintmax_t +test_gettimeofday(uintmax_t num, uintmax_t int_arg, const char *path) +{ + struct timeval tv; + uintmax_t i; + + benchmark_start(); + for (i = 0; i < num; i++) { + if (alarm_fired) + break; + (void)gettimeofday(&tv, NULL); + } + benchmark_stop(); + return (i); +} + +uintmax_t test_pipe(uintmax_t num, uintmax_t int_arg, const char *path) { int fd[2], i; @@ -608,6 +624,7 @@ static const struct test tests[] = { { "getuid", test_getuid }, { "getppid", test_getppid }, { "clock_gettime", test_clock_gettime }, + { "gettimeofday", test_gettimeofday }, { "pipe", test_pipe }, { "socket_local_stream", test_socket_stream, .t_int = PF_LOCAL }, { "socket_local_dgram", test_socket_dgram, .t_int = PF_LOCAL }, From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 08:25:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A87BE1065673; Sat, 9 Jun 2012 08:25:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 917DA8FC23; Sat, 9 Jun 2012 08:25:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q598Pd46017493; Sat, 9 Jun 2012 08:25:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q598Pdbq017491; Sat, 9 Jun 2012 08:25:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206090825.q598Pdbq017491@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 9 Jun 2012 08:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236798 - stable/9/tools/tools/syscall_timing X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 08:25:39 -0000 Author: kib Date: Sat Jun 9 08:25:39 2012 New Revision: 236798 URL: http://svn.freebsd.org/changeset/base/236798 Log: MFC r236690: Do not execute a needed statement with side-effect in assert(). Modified: stable/9/tools/tools/syscall_timing/syscall_timing.c Directory Properties: stable/9/tools/tools/syscall_timing/ (props changed) Modified: stable/9/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- stable/9/tools/tools/syscall_timing/syscall_timing.c Sat Jun 9 08:23:55 2012 (r236797) +++ stable/9/tools/tools/syscall_timing/syscall_timing.c Sat Jun 9 08:25:39 2012 (r236798) @@ -71,20 +71,24 @@ alarm_handler(int signum) static void benchmark_start(void) { + int error; alarm_fired = 0; if (alarm_timeout) { signal(SIGALRM, alarm_handler); alarm(alarm_timeout); } - assert(clock_gettime(CLOCK_REALTIME, &ts_start) == 0); + error = clock_gettime(CLOCK_REALTIME, &ts_start); + assert(error == 0); } static void benchmark_stop(void) { + int error; - assert(clock_gettime(CLOCK_REALTIME, &ts_end) == 0); + error = clock_gettime(CLOCK_REALTIME, &ts_end); + assert(error == 0); } uintmax_t @@ -687,7 +691,7 @@ main(int argc, char *argv[]) const char *path; long long ll; char *endp; - int ch, i, j, k; + int ch, error, i, j, k; uintmax_t iterations, loops; alarm_timeout = 1; @@ -756,7 +760,8 @@ main(int argc, char *argv[]) } } - assert(clock_getres(CLOCK_REALTIME, &ts_res) == 0); + error = clock_getres(CLOCK_REALTIME, &ts_res); + assert(error == 0); printf("Clock resolution: %ju.%09ju\n", (uintmax_t)ts_res.tv_sec, (uintmax_t)ts_res.tv_nsec); printf("test\tloop\ttime\titerations\tperiteration\n"); From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 08:41:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACF13106564A; Sat, 9 Jun 2012 08:41:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9773F8FC14; Sat, 9 Jun 2012 08:41:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q598fUkg018397; Sat, 9 Jun 2012 08:41:30 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q598fUnj018395; Sat, 9 Jun 2012 08:41:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206090841.q598fUnj018395@svn.freebsd.org> From: Alexander Motin Date: Sat, 9 Jun 2012 08:41:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236799 - stable/8/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 08:41:31 -0000 Author: mav Date: Sat Jun 9 08:41:30 2012 New Revision: 236799 URL: http://svn.freebsd.org/changeset/base/236799 Log: MFC r219241 (by mjacob): Don't automatically send a START UNIT to sequential access devices -- this might cause them to load the tape unintentionally. Modified: stable/8/sys/cam/cam_periph.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/cam_periph.c ============================================================================== --- stable/8/sys/cam/cam_periph.c Sat Jun 9 08:25:39 2012 (r236798) +++ stable/8/sys/cam/cam_periph.c Sat Jun 9 08:41:30 2012 (r236799) @@ -1539,6 +1539,15 @@ camperiphscsisenseerror(union ccb *ccb, case SS_START: { int le; + if (SID_TYPE(&cgd.inq_data) == T_SEQUENTIAL) { + xpt_free_ccb(orig_ccb); + ccb->ccb_h.status |= CAM_DEV_QFRZN; + *action_string = "Will not autostart a " + "sequential access device"; + err_action = SS_FAIL; + error = EIO; + break; + } /* * Send a start unit command to the device, and From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 08:51:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6B9D3106566B; Sat, 9 Jun 2012 08:51:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CB4E8FC1A; Sat, 9 Jun 2012 08:51:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q598pQV7018873; Sat, 9 Jun 2012 08:51:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q598pQxg018870; Sat, 9 Jun 2012 08:51:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206090851.q598pQxg018870@svn.freebsd.org> From: Alexander Motin Date: Sat, 9 Jun 2012 08:51:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236800 - stable/8/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 08:51:26 -0000 Author: mav Date: Sat Jun 9 08:51:25 2012 New Revision: 236800 URL: http://svn.freebsd.org/changeset/base/236800 Log: MFC r224806i (by mjacob): Fixes for sure bus reference miscounting and potential device and target reference miscounts. It also adds a helper function to get the current reference counts for components of cam_path for debug aid. One minor style(9) change. Modified: stable/8/sys/cam/cam_xpt.c stable/8/sys/cam/cam_xpt.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Sat Jun 9 08:41:30 2012 (r236799) +++ stable/8/sys/cam/cam_xpt.c Sat Jun 9 08:51:25 2012 (r236800) @@ -3396,8 +3396,10 @@ xpt_create_path_unlocked(struct cam_path } } status = xpt_compile_path(path, periph, path_id, target_id, lun_id); - if (need_unlock) + if (need_unlock) { CAM_SIM_UNLOCK(bus->sim); + xpt_release_bus(bus); + } if (status != CAM_REQ_CMP) { free(path, M_CAMXPT); path = NULL; @@ -3505,6 +3507,38 @@ xpt_free_path(struct cam_path *path) free(path, M_CAMXPT); } +void +xpt_path_counts(struct cam_path *path, uint32_t *bus_ref, + uint32_t *periph_ref, uint32_t *target_ref, uint32_t *device_ref) +{ + + mtx_lock(&xsoftc.xpt_topo_lock); + if (bus_ref) { + if (path->bus) + *bus_ref = path->bus->refcount; + else + *bus_ref = 0; + } + mtx_unlock(&xsoftc.xpt_topo_lock); + if (periph_ref) { + if (path->periph) + *periph_ref = path->periph->refcount; + else + *periph_ref = 0; + } + if (target_ref) { + if (path->target) + *target_ref = path->target->refcount; + else + *target_ref = 0; + } + if (device_ref) { + if (path->device) + *device_ref = path->device->refcount; + else + *device_ref = 0; + } +} /* * Return -1 for failure, 0 for exact match, 1 for match with wildcards @@ -4350,15 +4384,17 @@ static void xpt_release_bus(struct cam_eb *bus) { + mtx_lock(&xsoftc.xpt_topo_lock); + KASSERT(bus->refcount >= 1, ("bus->refcount >= 1")); if ((--bus->refcount == 0) && (TAILQ_FIRST(&bus->et_entries) == NULL)) { - mtx_lock(&xsoftc.xpt_topo_lock); TAILQ_REMOVE(&xsoftc.xpt_busses, bus, links); xsoftc.bus_generation++; mtx_unlock(&xsoftc.xpt_topo_lock); cam_sim_release(bus->sim); free(bus, M_CAMXPT); - } + } else + mtx_unlock(&xsoftc.xpt_topo_lock); } static struct cam_et * @@ -4381,7 +4417,9 @@ xpt_alloc_target(struct cam_eb *bus, tar * Hold a reference to our parent bus so it * will not go away before we do. */ + mtx_lock(&xsoftc.xpt_topo_lock); bus->refcount++; + mtx_unlock(&xsoftc.xpt_topo_lock); /* Insertion sort into our bus's target list */ cur_target = TAILQ_FIRST(&bus->et_entries); @@ -4402,15 +4440,17 @@ static void xpt_release_target(struct cam_et *target) { - if ((--target->refcount == 0) - && (TAILQ_FIRST(&target->ed_entries) == NULL)) { - TAILQ_REMOVE(&target->bus->et_entries, target, links); - target->bus->generation++; - xpt_release_bus(target->bus); - if (target->luns) - free(target->luns, M_CAMXPT); - free(target, M_CAMXPT); - } + if (target->refcount == 1) { + if (TAILQ_FIRST(&target->ed_entries) == NULL) { + TAILQ_REMOVE(&target->bus->et_entries, target, links); + target->bus->generation++; + xpt_release_bus(target->bus); + if (target->luns) + free(target->luns, M_CAMXPT); + free(target, M_CAMXPT); + } + } else + target->refcount--; } static struct cam_ed * @@ -4507,7 +4547,7 @@ void xpt_release_device(struct cam_ed *device) { - if (--device->refcount == 0) { + if (device->refcount == 1) { struct cam_devq *devq; if (device->alloc_ccb_entry.pinfo.index != CAM_UNQUEUED_INDEX @@ -4515,7 +4555,7 @@ xpt_release_device(struct cam_ed *device panic("Removing device while still queued for ccbs"); if ((device->flags & CAM_DEV_REL_TIMEOUT_PENDING) != 0) - callout_stop(&device->callout); + callout_stop(&device->callout); TAILQ_REMOVE(&device->target->ed_entries, device,links); device->target->generation++; @@ -4527,7 +4567,8 @@ xpt_release_device(struct cam_ed *device cam_ccbq_fini(&device->ccbq); xpt_release_target(device->target); free(device, M_CAMXPT); - } + } else + device->refcount--; } u_int32_t Modified: stable/8/sys/cam/cam_xpt.h ============================================================================== --- stable/8/sys/cam/cam_xpt.h Sat Jun 9 08:41:30 2012 (r236799) +++ stable/8/sys/cam/cam_xpt.h Sat Jun 9 08:51:25 2012 (r236800) @@ -104,6 +104,9 @@ cam_status xpt_create_path_unlocked(str path_id_t path_id, target_id_t target_id, lun_id_t lun_id); void xpt_free_path(struct cam_path *path); +void xpt_path_counts(struct cam_path *path, uint32_t *bus_ref, + uint32_t *periph_ref, uint32_t *target_ref, + uint32_t *device_ref); int xpt_path_comp(struct cam_path *path1, struct cam_path *path2); void xpt_print_path(struct cam_path *path); @@ -136,4 +139,3 @@ void xpt_release_path(struct cam_path #endif /* _KERNEL */ #endif /* _CAM_CAM_XPT_H */ - From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 09:01:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 238971065670; Sat, 9 Jun 2012 09:01:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E84DA8FC19; Sat, 9 Jun 2012 09:01:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5991OJP019364; Sat, 9 Jun 2012 09:01:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5991OA4019361; Sat, 9 Jun 2012 09:01:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206090901.q5991OA4019361@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 9 Jun 2012 09:01:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236801 - in stable/8/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 09:01:25 -0000 Author: kib Date: Sat Jun 9 09:01:24 2012 New Revision: 236801 URL: http://svn.freebsd.org/changeset/base/236801 Log: MFC r236043: Add a vn_bmap_seekhole(9) vnode helper which can be used by any filesystem which supports VOP_BMAP(9) to implement SEEK_HOLE/SEEK_DATA commands for lseek(2). Modified: stable/8/sys/kern/vfs_vnops.c stable/8/sys/sys/vnode.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/vfs_vnops.c ============================================================================== --- stable/8/sys/kern/vfs_vnops.c Sat Jun 9 08:51:25 2012 (r236800) +++ stable/8/sys/kern/vfs_vnops.c Sat Jun 9 09:01:24 2012 (r236801) @@ -1416,3 +1416,56 @@ vn_pages_remove(struct vnode *vp, vm_pin vm_object_page_remove(object, start, end, 0); VM_OBJECT_UNLOCK(object); } + +int +vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, struct ucred *cred) +{ + struct vattr va; + daddr_t bn, bnp; + uint64_t bsize; + off_t noff; + int error; + + KASSERT(cmd == FIOSEEKHOLE || cmd == FIOSEEKDATA, + ("Wrong command %lu", cmd)); + + if (vn_lock(vp, LK_SHARED) != 0) + return (EBADF); + if (vp->v_type != VREG) { + error = ENOTTY; + goto unlock; + } + error = VOP_GETATTR(vp, &va, cred); + if (error != 0) + goto unlock; + noff = *off; + if (noff >= va.va_size) { + error = ENXIO; + goto unlock; + } + bsize = vp->v_mount->mnt_stat.f_iosize; + for (bn = noff / bsize; noff < va.va_size; bn++, noff += bsize) { + error = VOP_BMAP(vp, bn, NULL, &bnp, NULL, NULL); + if (error == EOPNOTSUPP) { + error = ENOTTY; + goto unlock; + } + if ((bnp == -1 && cmd == FIOSEEKHOLE) || + (bnp != -1 && cmd == FIOSEEKDATA)) { + noff = bn * bsize; + if (noff < *off) + noff = *off; + goto unlock; + } + } + if (noff > va.va_size) + noff = va.va_size; + /* noff == va.va_size. There is an implicit hole at the end of file. */ + if (cmd == FIOSEEKDATA) + error = ENXIO; +unlock: + VOP_UNLOCK(vp, 0); + if (error == 0) + *off = noff; + return (error); +} Modified: stable/8/sys/sys/vnode.h ============================================================================== --- stable/8/sys/sys/vnode.h Sat Jun 9 08:51:25 2012 (r236800) +++ stable/8/sys/sys/vnode.h Sat Jun 9 09:01:24 2012 (r236801) @@ -645,6 +645,8 @@ void vunref(struct vnode *); void vn_printf(struct vnode *vp, const char *fmt, ...) __printflike(2,3); #define vprint(label, vp) vn_printf((vp), "%s\n", (label)) int vrecycle(struct vnode *vp, struct thread *td); +int vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, + struct ucred *cred); int vn_close(struct vnode *vp, int flags, struct ucred *file_cred, struct thread *td); void vn_finished_write(struct mount *mp); From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 09:05:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B37C1065670; Sat, 9 Jun 2012 09:05:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B1348FC16; Sat, 9 Jun 2012 09:05:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q59950kM019568; Sat, 9 Jun 2012 09:05:00 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q599501n019566; Sat, 9 Jun 2012 09:05:00 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206090905.q599501n019566@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 9 Jun 2012 09:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236802 - stable/8/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 09:05:00 -0000 Author: kib Date: Sat Jun 9 09:04:59 2012 New Revision: 236802 URL: http://svn.freebsd.org/changeset/base/236802 Log: MFC r236044: Implement SEEK_HOLE/SEEK_DATA for UFS. Modified: stable/8/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_vnops.c Sat Jun 9 09:01:24 2012 (r236801) +++ stable/8/sys/ufs/ufs/ufs_vnops.c Sat Jun 9 09:04:59 2012 (r236802) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -95,6 +96,7 @@ static int ufs_chown(struct vnode *, uid static vop_close_t ufs_close; static vop_create_t ufs_create; static vop_getattr_t ufs_getattr; +static vop_ioctl_t ufs_ioctl; static vop_link_t ufs_link; static int ufs_makeinode(int mode, struct vnode *, struct vnode **, struct componentname *); static vop_markatime_t ufs_markatime; @@ -2489,6 +2491,9 @@ ufs_pathconf(ap) *ap->a_retval = 0; #endif break; + case _PC_MIN_HOLE_SIZE: + *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize; + break; case _PC_ASYNC_IO: /* _PC_ASYNC_IO should have been handled by upper layers. */ KASSERT(0, ("_PC_ASYNC_IO should not get here")); @@ -2715,6 +2720,20 @@ bad: return (error); } +static int +ufs_ioctl(struct vop_ioctl_args *ap) +{ + + switch (ap->a_command) { + case FIOSEEKDATA: + case FIOSEEKHOLE: + return (vn_bmap_seekhole(ap->a_vp, ap->a_command, + (off_t *)ap->a_data, ap->a_cred)); + default: + return (ENOTTY); + } +} + /* Global vfs data structures for ufs. */ struct vop_vector ufs_vnodeops = { .vop_default = &default_vnodeops, @@ -2729,6 +2748,7 @@ struct vop_vector ufs_vnodeops = { .vop_create = ufs_create, .vop_getattr = ufs_getattr, .vop_inactive = ufs_inactive, + .vop_ioctl = ufs_ioctl, .vop_link = ufs_link, .vop_lookup = vfs_cache_lookup, .vop_markatime = ufs_markatime, From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 09:08:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96A731065686; Sat, 9 Jun 2012 09:08:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 816848FC16; Sat, 9 Jun 2012 09:08:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5998YHl019757; Sat, 9 Jun 2012 09:08:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5998YxB019755; Sat, 9 Jun 2012 09:08:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206090908.q5998YxB019755@svn.freebsd.org> From: Alexander Motin Date: Sat, 9 Jun 2012 09:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236803 - stable/8/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 09:08:34 -0000 Author: mav Date: Sat Jun 9 09:08:33 2012 New Revision: 236803 URL: http://svn.freebsd.org/changeset/base/236803 Log: MFC r231745 (by gibbs): Limit the ST3146855LW U320 drive to 55 tags to avoid command timeouts under load. Submitted by: Gelson Borsoi Modified: stable/8/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_xpt.c Sat Jun 9 09:04:59 2012 (r236802) +++ stable/8/sys/cam/scsi/scsi_xpt.c Sat Jun 9 09:08:33 2012 (r236803) @@ -293,6 +293,14 @@ static struct scsi_quirk_entry scsi_quir }, { /* + * Experiences command timeouts under load with a + * tag count higher than 55. + */ + { T_DIRECT, SIP_MEDIA_FIXED, seagate, "ST3146855LW", "*"}, + /*quirks*/0, /*mintags*/2, /*maxtags*/55 + }, + { + /* * Slow when tagged queueing is enabled. Write performance * steadily drops off with more and more concurrent * transactions. Best sequential write performance with From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 09:11:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E06B11065674; Sat, 9 Jun 2012 09:11:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBC918FC18; Sat, 9 Jun 2012 09:11:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q599B7IH019932; Sat, 9 Jun 2012 09:11:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q599B7h9019930; Sat, 9 Jun 2012 09:11:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206090911.q599B7h9019930@svn.freebsd.org> From: Alexander Motin Date: Sat, 9 Jun 2012 09:11:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236804 - stable/8/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 09:11:08 -0000 Author: mav Date: Sat Jun 9 09:11:07 2012 New Revision: 236804 URL: http://svn.freebsd.org/changeset/base/236804 Log: MFC r233746: Be more conservative in using READ CAPACITY(16) command. Previous code checked PROTECT bit in INQUIRY data for all SPC devices, while it is defined only since SPC-3. But there are some SPC-2 USB devices were reported, that have PROTECT bit set, return no error for READ CAPACITY(16) command, but return wrong sector count value in response. Modified: stable/8/sys/cam/scsi/scsi_da.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Sat Jun 9 09:08:33 2012 (r236803) +++ stable/8/sys/cam/scsi/scsi_da.c Sat Jun 9 09:11:07 2012 (r236804) @@ -1528,9 +1528,7 @@ daregister(struct cam_periph *periph, vo softc->minimum_cmd_size = 16; /* Predict whether device may support READ CAPACITY(16). */ - if (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC3 || - (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC && - (cgd->inq_data.spc3_flags & SPC3_SID_PROTECT))) { + if (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC3) { softc->flags |= DA_FLAG_CAN_RC16; softc->state = DA_STATE_PROBE2; } From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 09:54:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 33D1F1065676; Sat, 9 Jun 2012 09:54:08 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FE9E8FC14; Sat, 9 Jun 2012 09:54:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q599s71G021681; Sat, 9 Jun 2012 09:54:07 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q599s7w1021679; Sat, 9 Jun 2012 09:54:07 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201206090954.q599s7w1021679@svn.freebsd.org> From: Joel Dahl Date: Sat, 9 Jun 2012 09:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236805 - head/usr.sbin/newsyslog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 09:54:08 -0000 Author: joel (doc committer) Date: Sat Jun 9 09:54:07 2012 New Revision: 236805 URL: http://svn.freebsd.org/changeset/base/236805 Log: mdoc: fix mandoc "Oc breaks Op" warning. Modified: head/usr.sbin/newsyslog/newsyslog.conf.5 Modified: head/usr.sbin/newsyslog/newsyslog.conf.5 ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.conf.5 Sat Jun 9 09:11:07 2012 (r236804) +++ head/usr.sbin/newsyslog/newsyslog.conf.5 Sat Jun 9 09:54:07 2012 (r236805) @@ -155,12 +155,17 @@ The particular format of the time in res .Tn ISO 8601 is: .Sm off +.Oo Oo Oo Oo Oo +.Va cc Oc +.Va yy Oc +.Va mm Oc +.Va dd Oc .Oo -.Op Oo Oo Oo Va cc Oc Va yy Oc Va mm Oc Va dd -.Oo -.Li T -.Op Va hh Oo Va mm Oo Va ss Oc Oc Oc -.Oc . +.Li T Oo +.Va hh Oo +.Va mm Oo +.Va ss +.Oc Oc Oc Oc Oc . .Sm on Optional date fields default to the appropriate component of the current date; optional time fields default to midnight; hence if today From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 10:04:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54862106567C; Sat, 9 Jun 2012 10:04:41 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EF3A8FC12; Sat, 9 Jun 2012 10:04:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q59A4fC6022199; Sat, 9 Jun 2012 10:04:41 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q59A4fEQ022197; Sat, 9 Jun 2012 10:04:41 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201206091004.q59A4fEQ022197@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 9 Jun 2012 10:04:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236806 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 10:04:41 -0000 Author: melifaro Date: Sat Jun 9 10:04:40 2012 New Revision: 236806 URL: http://svn.freebsd.org/changeset/base/236806 Log: Fix typo introduced in r236559. Pointed by: bcr Approved by: kib(mentor) Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Sat Jun 9 09:54:07 2012 (r236805) +++ head/sys/net/bpf.c Sat Jun 9 10:04:40 2012 (r236806) @@ -2544,7 +2544,7 @@ bpfdetach(struct ifnet *ifp) /* * Interface departure handler. - * Note departure event does not guagantee interface is going down. + * Note departure event does not guarantee interface is going down. */ static void bpf_ifdetach(void *arg __unused, struct ifnet *ifp) From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 10:06:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BA57B1065675; Sat, 9 Jun 2012 10:06:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A4FAB8FC1E; Sat, 9 Jun 2012 10:06:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q59A6nMR022320; Sat, 9 Jun 2012 10:06:49 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q59A6nFU022317; Sat, 9 Jun 2012 10:06:49 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201206091006.q59A6nFU022317@svn.freebsd.org> From: Dimitry Andric Date: Sat, 9 Jun 2012 10:06:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236807 - in stable/9/lib/libc: include net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 10:06:49 -0000 Author: dim Date: Sat Jun 9 10:06:49 2012 New Revision: 236807 URL: http://svn.freebsd.org/changeset/base/236807 Log: MFC r236695: Fix two warnings about self-assignment in libc. These normally only trigger with clang, when you either use -save-temps, or ccache. Reported by: Sevan / Venture37 Modified: stable/9/lib/libc/include/port_before.h stable/9/lib/libc/net/getaddrinfo.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/include/port_before.h ============================================================================== --- stable/9/lib/libc/include/port_before.h Sat Jun 9 10:04:40 2012 (r236806) +++ stable/9/lib/libc/include/port_before.h Sat Jun 9 10:06:49 2012 (r236807) @@ -17,6 +17,6 @@ var = _u.v; \ } while (0) -#define UNUSED(x) (x) = (x) +#define UNUSED(x) (void)(x) #endif /* _PORT_BEFORE_H_ */ Modified: stable/9/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/9/lib/libc/net/getaddrinfo.c Sat Jun 9 10:04:40 2012 (r236806) +++ stable/9/lib/libc/net/getaddrinfo.c Sat Jun 9 10:06:49 2012 (r236807) @@ -464,7 +464,7 @@ getaddrinfo(const char *hostname, const } error = get_portmatch(pai, servname); if (error) - ERR(error); + goto bad; *pai = ai0; } From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 10:10:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D47DD106564A; Sat, 9 Jun 2012 10:10:12 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5E308FC15; Sat, 9 Jun 2012 10:10:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q59AACbY022494; Sat, 9 Jun 2012 10:10:12 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q59AACkC022491; Sat, 9 Jun 2012 10:10:12 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201206091010.q59AACkC022491@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 9 Jun 2012 10:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236808 - head/usr.sbin/flowctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 10:10:12 -0000 Author: melifaro Date: Sat Jun 9 10:10:12 2012 New Revision: 236808 URL: http://svn.freebsd.org/changeset/base/236808 Log: Add "human" option to print IPv4/IPv6 flows in human-readable format. Show IPv4/IPv6 header IFF there are some flows following. Wrap some long lines. Sponsored by Yandex LLC Reviewed by: glebius (previous version) Approved by: ae(mentor) MFC after: 1 week Modified: head/usr.sbin/flowctl/flowctl.8 head/usr.sbin/flowctl/flowctl.c Modified: head/usr.sbin/flowctl/flowctl.8 ============================================================================== --- head/usr.sbin/flowctl/flowctl.8 Sat Jun 9 10:06:49 2012 (r236807) +++ head/usr.sbin/flowctl/flowctl.8 Sat Jun 9 10:10:12 2012 (r236808) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 5, 2011 +.Dd June 8, 2012 .Dt FLOWCTL 8 .Os .Sh NAME @@ -55,7 +55,7 @@ Currently, .Nm supports only one command. .Bl -tag -width ".Cm show" -.It Cm show Op Cm ipv4|ipv6 +.It Cm show Oo Cm ipv4|ipv6 Oc Op Cm human|verbose This command is the analog of the .Dq "show ip cache flow" command of a Cisco router. @@ -69,7 +69,9 @@ It has optional parameter .Cm verbose , which is analog of the .Dq "show ip cache verbose flow" -command. +command. Additionally, +.Cm human +parameter can be specify to show selected flows in human-readable format. .El .Sh EXIT STATUS .Ex -std Modified: head/usr.sbin/flowctl/flowctl.c ============================================================================== --- head/usr.sbin/flowctl/flowctl.c Sat Jun 9 10:06:49 2012 (r236807) +++ head/usr.sbin/flowctl/flowctl.c Sat Jun 9 10:10:12 2012 (r236808) @@ -52,19 +52,33 @@ static const char rcs_id[] = #include #include -#define CISCO_SH_FLOW_HEADER "SrcIf SrcIPaddress DstIf DstIPaddress Pr SrcP DstP Pkts\n" +#define CISCO_SH_FLOW_HEADER "SrcIf SrcIPaddress " \ +"DstIf DstIPaddress Pr SrcP DstP Pkts\n" #define CISCO_SH_FLOW "%-13s %-15s %-13s %-15s %2u %4.4x %4.4x %6lu\n" -#define CISCO_SH_FLOW6_HEADER "SrcIf SrcIPaddress DstIf DstIPaddress Pr SrcP DstP Pkts\n" -#define CISCO_SH_FLOW6 "%-13s %-30s %-13s %-30s %2u %4.4x %4.4x %6lu\n" +/* human-readable IPv4 header */ +#define CISCO_SH_FLOW_HHEADER "SrcIf SrcIPaddress " \ +"DstIf DstIPaddress Proto SrcPort DstPort Pkts\n" +#define CISCO_SH_FLOW_H "%-13s %-15s %-13s %-15s %5u %8d %8d %8lu\n" + +#define CISCO_SH_FLOW6_HEADER "SrcIf SrcIPaddress " \ +"DstIf DstIPaddress Pr SrcP DstP Pkts\n" +#define CISCO_SH_FLOW6 "%-13s %-30s %-13s %-30s %2u %4.4x %4.4x %6lu\n" + +/* Human-readable IPv6 headers */ +#define CISCO_SH_FLOW6_HHEADER "SrcIf SrcIPaddress " \ +"DstIf DstIPaddress Proto SrcPort DstPort Pkts\n" +#define CISCO_SH_FLOW6_H "%-13s %-36s %-13s %-36s %5u %8d %8d %8lu\n" -#define CISCO_SH_VERB_FLOW_HEADER "SrcIf SrcIPaddress DstIf DstIPaddress Pr TOS Flgs Pkts\n" \ +#define CISCO_SH_VERB_FLOW_HEADER "SrcIf SrcIPaddress " \ +"DstIf DstIPaddress Pr TOS Flgs Pkts\n" \ "Port Msk AS Port Msk AS NextHop B/Pk Active\n" #define CISCO_SH_VERB_FLOW "%-14s %-15s %-14s %-15s %2u %3x %4x %6lu\n" \ "%4.4x /%-2u %-5u %4.4x /%-2u %-5u %-15s %9u %8u\n\n" -#define CISCO_SH_VERB_FLOW6_HEADER "SrcIf SrcIPaddress DstIf DstIPaddress Pr TOS Flgs Pkts\n" \ +#define CISCO_SH_VERB_FLOW6_HEADER "SrcIf SrcIPaddress " \ +"DstIf DstIPaddress Pr TOS Flgs Pkts\n" \ "Port Msk AS Port Msk AS NextHop B/Pk Active\n" #define CISCO_SH_VERB_FLOW6 "%-14s %-30s %-14s %-30s %2u %3x %4x %6lu\n" \ @@ -94,7 +108,7 @@ struct ip_ctl_cmd cmds[] = { {NULL, NULL}, }; -int cs; +int cs, human = 0; char *ng_path; int @@ -182,6 +196,9 @@ ctl_show(int argc, char **argv) if (argc > 0 && !strncmp(argv[0], "verbose", strlen(argv[0]))) verbose = 1; + if (argc > 0 && !strncmp(argv[0], "human", strlen(argv[0]))) + human = 1; + #ifdef INET if (ipv4) { if (verbose) @@ -259,13 +276,14 @@ flow_cache_print(struct ngnf_show_header errx(EX_SOFTWARE, "%s: version mismatch: %u", __func__, resp->version); - printf(CISCO_SH_FLOW_HEADER); + if (resp->nentries > 0) + printf(human ? CISCO_SH_FLOW_HHEADER : CISCO_SH_FLOW_HEADER); fle = (struct flow_entry_data *)(resp + 1); for (i = 0; i < resp->nentries; i++, fle++) { inet_ntop(AF_INET, &fle->r.r_src, src, sizeof(src)); inet_ntop(AF_INET, &fle->r.r_dst, dst, sizeof(dst)); - printf(CISCO_SH_FLOW, + printf(human ? CISCO_SH_FLOW_H : CISCO_SH_FLOW, if_indextoname(fle->fle_i_ifx, src_if), src, if_indextoname(fle->fle_o_ifx, dst_if), @@ -292,13 +310,14 @@ flow_cache_print6(struct ngnf_show_heade errx(EX_SOFTWARE, "%s: version mismatch: %u", __func__, resp->version); - printf(CISCO_SH_FLOW6_HEADER); + if (resp->nentries > 0) + printf(human ? CISCO_SH_FLOW6_HHEADER : CISCO_SH_FLOW6_HEADER); fle6 = (struct flow6_entry_data *)(resp + 1); for (i = 0; i < resp->nentries; i++, fle6++) { inet_ntop(AF_INET6, &fle6->r.src.r_src6, src6, sizeof(src6)); inet_ntop(AF_INET6, &fle6->r.dst.r_dst6, dst6, sizeof(dst6)); - printf(CISCO_SH_FLOW6, + printf(human ? CISCO_SH_FLOW6_H : CISCO_SH_FLOW6, if_indextoname(fle6->fle_i_ifx, src_if), src6, if_indextoname(fle6->fle_o_ifx, dst_if), From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 10:43:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BDA0106566B; Sat, 9 Jun 2012 10:43:34 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 47A258FC0A; Sat, 9 Jun 2012 10:43:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q59AhYFH028234; Sat, 9 Jun 2012 10:43:34 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q59AhYZO028232; Sat, 9 Jun 2012 10:43:34 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201206091043.q59AhYZO028232@svn.freebsd.org> From: Joel Dahl Date: Sat, 9 Jun 2012 10:43:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236809 - head/sbin/natd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 10:43:34 -0000 Author: joel (doc committer) Date: Sat Jun 9 10:43:33 2012 New Revision: 236809 URL: http://svn.freebsd.org/changeset/base/236809 Log: mdoc: fix a few badly nested blocks. Modified: head/sbin/natd/natd.8 Modified: head/sbin/natd/natd.8 ============================================================================== --- head/sbin/natd/natd.8 Sat Jun 9 10:10:12 2012 (r236808) +++ head/sbin/natd/natd.8 Sat Jun 9 10:43:33 2012 (r236809) @@ -130,9 +130,9 @@ According to RFC 1918, unregistered sour 172.16.0.0/12 and 192.168.0.0/16. .It Fl redirect_port Ar proto Xo .Ar targetIP Ns : Ns Xo -.Ar targetPORT Ns Op - Ns Ar targetPORT Xc -.Op Ar aliasIP Ns : Ns Xo -.Ar aliasPORT Ns Op - Ns Ar aliasPORT Xc +.Ar targetPORT Ns Oo - Ns Ar targetPORT Oc Xc +.Oo Ar aliasIP Ns : Oc Ns Xo +.Ar aliasPORT Ns Oo - Ns Ar aliasPORT Oc Xc .Oo Ar remoteIP Ns Oo : Ns .Ar remotePORT Ns Op - Ns Ar remotePORT .Oc Oc @@ -247,10 +247,8 @@ to appear from the specified .Ar targetIP Ns : Ns Xo .Ar targetPORT Ns Oo , Ns .Ar ...\& -.Oc Oc -.Xc -.Xc -.Op Ar aliasIP Ns : Ns Xo +.Oc Xc Oc Xc +.Oo Ar aliasIP Ns : Oc Ns Xo .Ar aliasPORT .Xc .Oo Ar remoteIP Ns From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 11:41:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67FFA106566B; Sat, 9 Jun 2012 11:41:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 532498FC0A; Sat, 9 Jun 2012 11:41:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q59BfUcm030625; Sat, 9 Jun 2012 11:41:30 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q59BfUUD030623; Sat, 9 Jun 2012 11:41:30 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201206091141.q59BfUUD030623@svn.freebsd.org> From: Dimitry Andric Date: Sat, 9 Jun 2012 11:41:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236810 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 11:41:30 -0000 Author: dim Date: Sat Jun 9 11:41:29 2012 New Revision: 236810 URL: http://svn.freebsd.org/changeset/base/236810 Log: Amend r227797 by also passing ${STATIC_CXXFLAGS} for the other supported C++ file extensions. MFC after: 3 days Modified: head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Sat Jun 9 10:43:33 2012 (r236809) +++ head/share/mk/bsd.lib.mk Sat Jun 9 11:41:29 2012 (r236810) @@ -74,7 +74,7 @@ PO_FLAG=-pg ${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -.cc.o: +.cc.o .C.o .cpp.o .cxx.o: ${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} .cc.po .C.po .cpp.po .cxx.po: From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 12:27:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C500F106566C; Sat, 9 Jun 2012 12:27:30 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B073F8FC0A; Sat, 9 Jun 2012 12:27:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q59CRU60032557; Sat, 9 Jun 2012 12:27:30 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q59CRU36032555; Sat, 9 Jun 2012 12:27:30 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201206091227.q59CRU36032555@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 9 Jun 2012 12:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236812 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 12:27:30 -0000 Author: pjd Date: Sat Jun 9 12:27:30 2012 New Revision: 236812 URL: http://svn.freebsd.org/changeset/base/236812 Log: Correct panic message. MFC after: 1 month MFC with: r236731 Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat Jun 9 12:25:30 2012 (r236811) +++ head/sys/kern/kern_descrip.c Sat Jun 9 12:27:30 2012 (r236812) @@ -1554,7 +1554,7 @@ fdalloc(struct thread *td, int minfd, in */ KASSERT(!fdisused(fdp, fd), ("fd_first_free() returned non-free descriptor")); - KASSERT(fdp->fd_ofiles[fd] == NULL, ("free descriptor isn't")); + KASSERT(fdp->fd_ofiles[fd] == NULL, ("file descriptor isn't free")); KASSERT(fdp->fd_ofileflags[fd] == 0, ("file flags are set")); fdused(fdp, fd); *result = fd; From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 13:07:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 159C71065674; Sat, 9 Jun 2012 13:07:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F32788FC16; Sat, 9 Jun 2012 13:07:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q59D7ibu034322; Sat, 9 Jun 2012 13:07:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q59D7iQE034315; Sat, 9 Jun 2012 13:07:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206091307.q59D7iQE034315@svn.freebsd.org> From: Alexander Motin Date: Sat, 9 Jun 2012 13:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236814 - in head/sys/cam: . ata scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 13:07:45 -0000 Author: mav Date: Sat Jun 9 13:07:44 2012 New Revision: 236814 URL: http://svn.freebsd.org/changeset/base/236814 Log: One more major cam_periph_error() rewrite to improve error handling and reporting. It includes: - removing of error messages controlled by bootverbose, replacing them with more universal and informative debugging on CAM_DEBUG_INFO level, that is now built into the kernel by default; - more close following to the arguments submitted by caller, such as SF_PRINT_ALWAYS, SF_QUIET_IR and SF_NO_PRINT; consumer knows better which errors are usual/expected at this point and which are really informative; - adding two new flags SF_NO_RECOVERY and SF_NO_RETRY to allow caller specify how much assistance it needs at this point; previously consumers controlled that by not calling cam_periph_error() at all, but that made behavior inconsistent and debugging complicated; - tuning debug messages and taken actions order to make debugging output more readable and cause-effect relationships visible; - making camperiphdone() (common device recovery completion handler) to also use cam_periph_error() in most cases, instead of own dumb code; - removing manual sense fetching code from cam_periph_error(); I was told by number of people that it is SIM obligation to fetch sense data, so this code is useless and only significantly complicates recovery logic; - making ada, da and pass driver to use cam_periph_error() with new limited recovery options to handle error recovery and debugging in common way; as one of results, CAM_REQUEUE_REQ and other retrying statuses are now working fine with pass driver, that caused many problems before. - reverting r186891 by raj@ to avoid burning few seconds in tight DELAY() loops on device probe, while device simply loads media; I think that problem may already be fixed in other way, and even if it is not, solution must be different. Sponsored by: iXsystems, Inc. MFC after: 2 weeks Modified: head/sys/cam/ata/ata_da.c head/sys/cam/ata/ata_xpt.c head/sys/cam/cam.h head/sys/cam/cam_periph.c head/sys/cam/cam_periph.h head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_pass.c head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sat Jun 9 12:58:00 2012 (r236813) +++ head/sys/cam/ata/ata_da.c Sat Jun 9 13:07:44 2012 (r236814) @@ -584,6 +584,7 @@ adadump(void *arg, void *virtual, vm_off struct disk *dp; uint64_t lba; uint16_t count; + int error = 0; dp = arg; periph = dp->d_drv1; @@ -622,13 +623,16 @@ adadump(void *arg, void *virtual, vm_off } xpt_polled_action(&ccb); - if ((ccb.ataio.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + error = cam_periph_error(&ccb, + 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); + if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, + /*reduction*/0, /*timeout*/0, /*getcount_only*/0); + if (error != 0) printf("Aborting dump due to I/O error.\n"); - cam_periph_unlock(periph); - return(EIO); - } + cam_periph_unlock(periph); - return(0); + return (error); } if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) { @@ -636,7 +640,7 @@ adadump(void *arg, void *virtual, vm_off ccb.ccb_h.ccb_state = ADA_CCB_DUMP; cam_fill_ataio(&ccb.ataio, - 1, + 0, adadone, CAM_DIR_NONE, 0, @@ -650,18 +654,16 @@ adadump(void *arg, void *virtual, vm_off ata_28bit_cmd(&ccb.ataio, ATA_FLUSHCACHE, 0, 0, 0); xpt_polled_action(&ccb); - if ((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) - xpt_print(periph->path, "Synchronize cache failed\n"); - + error = cam_periph_error(&ccb, + 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb.ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); + cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, + /*reduction*/0, /*timeout*/0, /*getcount_only*/0); + if (error != 0) + xpt_print(periph->path, "Synchronize cache failed\n"); } cam_periph_unlock(periph); - return (0); + return (error); } static void @@ -1716,6 +1718,7 @@ adaflush(void) { struct cam_periph *periph; struct ada_softc *softc; + int error; TAILQ_FOREACH(periph, &adadriver.units, unit_links) { union ccb ccb; @@ -1739,7 +1742,7 @@ adaflush(void) ccb.ccb_h.ccb_state = ADA_CCB_DUMP; cam_fill_ataio(&ccb.ataio, - 1, + 0, adadone, CAM_DIR_NONE, 0, @@ -1753,15 +1756,13 @@ adaflush(void) ata_28bit_cmd(&ccb.ataio, ATA_FLUSHCACHE, 0, 0, 0); xpt_polled_action(&ccb); - if ((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) - xpt_print(periph->path, "Synchronize cache failed\n"); - + error = cam_periph_error(&ccb, + 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb.ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); + cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, + /*reduction*/0, /*timeout*/0, /*getcount_only*/0); + if (error != 0) + xpt_print(periph->path, "Synchronize cache failed\n"); cam_periph_unlock(periph); } } @@ -1771,6 +1772,7 @@ adaspindown(uint8_t cmd, int flags) { struct cam_periph *periph; struct ada_softc *softc; + int error; TAILQ_FOREACH(periph, &adadriver.units, unit_links) { union ccb ccb; @@ -1795,7 +1797,7 @@ adaspindown(uint8_t cmd, int flags) ccb.ccb_h.ccb_state = ADA_CCB_DUMP; cam_fill_ataio(&ccb.ataio, - 1, + 0, adadone, CAM_DIR_NONE | flags, 0, @@ -1806,15 +1808,13 @@ adaspindown(uint8_t cmd, int flags) ata_28bit_cmd(&ccb.ataio, cmd, 0, 0, 0); xpt_polled_action(&ccb); - if ((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) - xpt_print(periph->path, "Spin-down disk failed\n"); - + error = cam_periph_error(&ccb, + 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb.ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); + cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, + /*reduction*/0, /*timeout*/0, /*getcount_only*/0); + if (error != 0) + xpt_print(periph->path, "Spin-down disk failed\n"); cam_periph_unlock(periph); } } Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Sat Jun 9 12:58:00 2012 (r236813) +++ head/sys/cam/ata/ata_xpt.c Sat Jun 9 13:07:44 2012 (r236814) @@ -705,12 +705,9 @@ probedone(struct cam_periph *periph, uni inq_buf = &path->device->inq_data; if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - if (softc->restart) { - if (bootverbose) { - cam_error_print(done_ccb, - CAM_ESF_ALL, CAM_EPF_ALL); - } - } else if (cam_periph_error(done_ccb, 0, 0, NULL) == ERESTART) + if (cam_periph_error(done_ccb, + 0, softc->restart ? (SF_NO_RECOVERY | SF_NO_RETRY) : 0, + NULL) == ERESTART) return; if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { /* Don't wedge the queue */ Modified: head/sys/cam/cam.h ============================================================================== --- head/sys/cam/cam.h Sat Jun 9 12:58:00 2012 (r236813) +++ head/sys/cam/cam.h Sat Jun 9 13:07:44 2012 (r236814) @@ -108,6 +108,15 @@ typedef enum { CAM_RETRY_SELTO = 0x02 /* Retry Selection Timeouts */ } cam_flags; +enum { + SF_RETRY_UA = 0x01, /* Retry UNIT ATTENTION conditions. */ + SF_NO_PRINT = 0x02, /* Never print error status. */ + SF_QUIET_IR = 0x04, /* Be quiet about Illegal Request reponses */ + SF_PRINT_ALWAYS = 0x08, /* Always print error status. */ + SF_NO_RECOVERY = 0x10, /* Don't do active error recovery. */ + SF_NO_RETRY = 0x20 /* Don't do any retries. */ +}; + /* CAM Status field values */ typedef enum { CAM_REQ_INPROG, /* CCB request is in progress */ Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Sat Jun 9 12:58:00 2012 (r236813) +++ head/sys/cam/cam_periph.c Sat Jun 9 13:07:44 2012 (r236814) @@ -69,18 +69,22 @@ static void camperiphdone(struct cam_pe union ccb *done_ccb); static void camperiphfree(struct cam_periph *periph); static int camperiphscsistatuserror(union ccb *ccb, + union ccb **orig_ccb, cam_flags camflags, u_int32_t sense_flags, int *openings, u_int32_t *relsim_flags, u_int32_t *timeout, + int *print, const char **action_string); static int camperiphscsisenseerror(union ccb *ccb, + union ccb **orig_ccb, cam_flags camflags, u_int32_t sense_flags, int *openings, u_int32_t *relsim_flags, u_int32_t *timeout, + int *print, const char **action_string); static int nperiph_drivers; @@ -1108,255 +1112,84 @@ cam_release_devq(struct cam_path *path, } #define saved_ccb_ptr ppriv_ptr0 -#define recovery_depth ppriv_field1 -static void -camperiphsensedone(struct cam_periph *periph, union ccb *done_ccb) -{ - union ccb *saved_ccb = (union ccb *)done_ccb->ccb_h.saved_ccb_ptr; - cam_status status; - int frozen = 0; - int depth = done_ccb->ccb_h.recovery_depth; - - status = done_ccb->ccb_h.status; - if (status & CAM_DEV_QFRZN) { - frozen = 1; - /* - * Clear freeze flag now for case of retry, - * freeze will be dropped later. - */ - done_ccb->ccb_h.status &= ~CAM_DEV_QFRZN; - } - status &= CAM_STATUS_MASK; - switch (status) { - case CAM_REQ_CMP: - { - int error_code, sense_key, asc, ascq; - - scsi_extract_sense_len(&saved_ccb->csio.sense_data, - saved_ccb->csio.sense_len - - saved_ccb->csio.sense_resid, - &error_code, &sense_key, &asc, &ascq, - /*show_errors*/ 1); - /* - * If we manually retrieved sense into a CCB and got - * something other than "NO SENSE" send the updated CCB - * back to the client via xpt_done() to be processed via - * the error recovery code again. - */ - if ((sense_key != -1) - && (sense_key != SSD_KEY_NO_SENSE)) { - saved_ccb->ccb_h.status |= CAM_AUTOSNS_VALID; - } else { - saved_ccb->ccb_h.status &= ~CAM_STATUS_MASK; - saved_ccb->ccb_h.status |= CAM_AUTOSENSE_FAIL; - } - saved_ccb->csio.sense_resid = done_ccb->csio.resid; - bcopy(saved_ccb, done_ccb, sizeof(union ccb)); - xpt_free_ccb(saved_ccb); - break; - } - default: - bcopy(saved_ccb, done_ccb, sizeof(union ccb)); - xpt_free_ccb(saved_ccb); - done_ccb->ccb_h.status &= ~CAM_STATUS_MASK; - done_ccb->ccb_h.status |= CAM_AUTOSENSE_FAIL; - break; - } - periph->flags &= ~CAM_PERIPH_SENSE_INPROG; - /* - * If it is the end of recovery, drop freeze, taken due to - * CAM_DEV_QFREEZE flag, set on recovery request. - */ - if (depth == 0) { - cam_release_devq(done_ccb->ccb_h.path, - /*relsim_flags*/0, - /*openings*/0, - /*timeout*/0, - /*getcount_only*/0); - } - /* - * Copy frozen flag from recovery request if it is set there - * for some reason. - */ - if (frozen != 0) - done_ccb->ccb_h.status |= CAM_DEV_QFRZN; - (*done_ccb->ccb_h.cbfcnp)(periph, done_ccb); -} - static void camperiphdone(struct cam_periph *periph, union ccb *done_ccb) { - union ccb *saved_ccb, *save_ccb; + union ccb *saved_ccb; cam_status status; - int frozen = 0; struct scsi_start_stop_unit *scsi_cmd; - u_int32_t relsim_flags, timeout; + scsi_cmd = (struct scsi_start_stop_unit *) + &done_ccb->csio.cdb_io.cdb_bytes; status = done_ccb->ccb_h.status; - if (status & CAM_DEV_QFRZN) { - frozen = 1; - /* - * Clear freeze flag now for case of retry, - * freeze will be dropped later. - */ - done_ccb->ccb_h.status &= ~CAM_DEV_QFRZN; - } - timeout = 0; - relsim_flags = 0; - saved_ccb = (union ccb *)done_ccb->ccb_h.saved_ccb_ptr; - - switch (status & CAM_STATUS_MASK) { - case CAM_REQ_CMP: - { - /* - * If we have successfully taken a device from the not - * ready to ready state, re-scan the device and re-get - * the inquiry information. Many devices (mostly disks) - * don't properly report their inquiry information unless - * they are spun up. - */ - scsi_cmd = (struct scsi_start_stop_unit *) - &done_ccb->csio.cdb_io.cdb_bytes; - - if (scsi_cmd->opcode == START_STOP_UNIT) - xpt_async(AC_INQ_CHANGED, - done_ccb->ccb_h.path, NULL); - goto final; - } - case CAM_SCSI_STATUS_ERROR: - scsi_cmd = (struct scsi_start_stop_unit *) - &done_ccb->csio.cdb_io.cdb_bytes; - if (status & CAM_AUTOSNS_VALID) { - struct ccb_getdev cgd; + if ((status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + if ((status & CAM_STATUS_MASK) == CAM_SCSI_STATUS_ERROR && + (status & CAM_AUTOSNS_VALID)) { struct scsi_sense_data *sense; int error_code, sense_key, asc, ascq, sense_len; - scsi_sense_action err_action; sense = &done_ccb->csio.sense_data; sense_len = done_ccb->csio.sense_len - done_ccb->csio.sense_resid; - scsi_extract_sense_len(sense, sense_len, &error_code, - &sense_key, &asc, &ascq, - /*show_errors*/ 1); - /* - * Grab the inquiry data for this device. - */ - xpt_setup_ccb(&cgd.ccb_h, done_ccb->ccb_h.path, - CAM_PRIORITY_NORMAL); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)&cgd); - err_action = scsi_error_action(&done_ccb->csio, - &cgd.inq_data, 0); + scsi_extract_sense_len(sense, sense_len, &error_code, + &sense_key, &asc, &ascq, /*show_errors*/ 1); /* - * If the error is "invalid field in CDB", - * and the load/eject flag is set, turn the - * flag off and try again. This is just in - * case the drive in question barfs on the - * load eject flag. The CAM code should set - * the load/eject flag by default for + * If the error is "invalid field in CDB", + * and the load/eject flag is set, turn the + * flag off and try again. This is just in + * case the drive in question barfs on the + * load eject flag. The CAM code should set + * the load/eject flag by default for * removable media. */ - /* XXX KDM - * Should we check to see what the specific - * scsi status is?? Or does it not matter - * since we already know that there was an - * error, and we know what the specific - * error code was, and we know what the - * opcode is.. - */ if ((scsi_cmd->opcode == START_STOP_UNIT) && ((scsi_cmd->how & SSS_LOEJ) != 0) && - (asc == 0x24) && (ascq == 0x00) && - (done_ccb->ccb_h.retry_count > 0)) { - + (asc == 0x24) && (ascq == 0x00)) { scsi_cmd->how &= ~SSS_LOEJ; + if (status & CAM_DEV_QFRZN) { + cam_release_devq(done_ccb->ccb_h.path, + 0, 0, 0, 0); + done_ccb->ccb_h.status &= + ~CAM_DEV_QFRZN; + } xpt_action(done_ccb); - } else if ((done_ccb->ccb_h.retry_count > 1) - && ((err_action & SS_MASK) != SS_FAIL)) { - - /* - * In this case, the error recovery - * command failed, but we've got - * some retries left on it. Give - * it another try unless this is an - * unretryable error. - */ - /* set the timeout to .5 sec */ - relsim_flags = - RELSIM_RELEASE_AFTER_TIMEOUT; - timeout = 500; - xpt_action(done_ccb); - break; - } else { - /* - * Perform the final retry with the original - * CCB so that final error processing is - * performed by the owner of the CCB. - */ - goto final; + goto out; } - } else { - save_ccb = xpt_alloc_ccb_nowait(); - if (save_ccb == NULL) - goto final; - bcopy(done_ccb, save_ccb, sizeof(*save_ccb)); - periph->flags |= CAM_PERIPH_SENSE_INPROG; - /* - * Send a Request Sense to the device. We - * assume that we are in a contingent allegiance - * condition so we do not tag this request. - */ - scsi_request_sense(&done_ccb->csio, /*retries*/1, - camperiphsensedone, - &save_ccb->csio.sense_data, - save_ccb->csio.sense_len, - CAM_TAG_ACTION_NONE, - /*sense_len*/SSD_FULL_SIZE, - /*timeout*/5000); - done_ccb->ccb_h.pinfo.priority--; - done_ccb->ccb_h.flags |= CAM_DEV_QFREEZE; - done_ccb->ccb_h.saved_ccb_ptr = save_ccb; - done_ccb->ccb_h.recovery_depth++; - xpt_action(done_ccb); } - break; - default: -final: - bcopy(saved_ccb, done_ccb, sizeof(*done_ccb)); - xpt_free_ccb(saved_ccb); - periph->flags &= ~CAM_PERIPH_RECOVERY_INPROG; - xpt_action(done_ccb); - break; + if (cam_periph_error(done_ccb, + 0, SF_RETRY_UA | SF_NO_PRINT, NULL) == ERESTART) + goto out; + if (done_ccb->ccb_h.status & CAM_DEV_QFRZN) { + cam_release_devq(done_ccb->ccb_h.path, 0, 0, 0, 0); + done_ccb->ccb_h.status &= ~CAM_DEV_QFRZN; + } + } else { + /* + * If we have successfully taken a device from the not + * ready to ready state, re-scan the device and re-get + * the inquiry information. Many devices (mostly disks) + * don't properly report their inquiry information unless + * they are spun up. + */ + if (scsi_cmd->opcode == START_STOP_UNIT) + xpt_async(AC_INQ_CHANGED, done_ccb->ccb_h.path, NULL); } - /* decrement the retry count */ - /* - * XXX This isn't appropriate in all cases. Restructure, - * so that the retry count is only decremented on an - * actual retry. Remeber that the orignal ccb had its - * retry count dropped before entering recovery, so - * doing it again is a bug. - */ - if (done_ccb->ccb_h.retry_count > 0) - done_ccb->ccb_h.retry_count--; /* - * Drop freeze taken due to CAM_DEV_QFREEZE flag set on recovery - * request. + * Perform the final retry with the original CCB so that final + * error processing is performed by the owner of the CCB. */ - cam_release_devq(done_ccb->ccb_h.path, - /*relsim_flags*/relsim_flags, - /*openings*/0, - /*timeout*/timeout, - /*getcount_only*/0); - /* Drop freeze taken, if this recovery request got error. */ - if (frozen != 0) { - cam_release_devq(done_ccb->ccb_h.path, - /*relsim_flags*/0, - /*openings*/0, - /*timeout*/0, - /*getcount_only*/0); - } + saved_ccb = (union ccb *)done_ccb->ccb_h.saved_ccb_ptr; + bcopy(saved_ccb, done_ccb, sizeof(*done_ccb)); + xpt_free_ccb(saved_ccb); + if (done_ccb->ccb_h.cbfcnp != camperiphdone) + periph->flags &= ~CAM_PERIPH_RECOVERY_INPROG; + xpt_action(done_ccb); + +out: + /* Drop freeze taken due to CAM_DEV_QFREEZE flag set. */ + cam_release_devq(done_ccb->ccb_h.path, 0, 0, 0, 0); } /* @@ -1415,10 +1248,10 @@ cam_periph_freeze_after_event(struct cam } static int -camperiphscsistatuserror(union ccb *ccb, cam_flags camflags, - u_int32_t sense_flags, - int *openings, u_int32_t *relsim_flags, - u_int32_t *timeout, const char **action_string) +camperiphscsistatuserror(union ccb *ccb, union ccb **orig_ccb, + cam_flags camflags, u_int32_t sense_flags, + int *openings, u_int32_t *relsim_flags, + u_int32_t *timeout, int *print, const char **action_string) { int error; @@ -1431,14 +1264,13 @@ camperiphscsistatuserror(union ccb *ccb, break; case SCSI_STATUS_CMD_TERMINATED: case SCSI_STATUS_CHECK_COND: - if (bootverbose) - xpt_print(ccb->ccb_h.path, "SCSI status error\n"); - error = camperiphscsisenseerror(ccb, + error = camperiphscsisenseerror(ccb, orig_ccb, camflags, sense_flags, openings, relsim_flags, timeout, + print, action_string); break; case SCSI_STATUS_QUEUE_FULL: @@ -1493,9 +1325,6 @@ camperiphscsistatuserror(union ccb *ccb, } *timeout = 0; error = ERESTART; - if (bootverbose) { - xpt_print(ccb->ccb_h.path, "Queue full\n"); - } break; } /* FALLTHROUGH */ @@ -1505,9 +1334,6 @@ camperiphscsistatuserror(union ccb *ccb, * Restart the queue after either another * command completes or a 1 second timeout. */ - if (bootverbose) { - xpt_print(ccb->ccb_h.path, "Device busy\n"); - } if (ccb->ccb_h.retry_count > 0) { ccb->ccb_h.retry_count--; error = ERESTART; @@ -1519,12 +1345,7 @@ camperiphscsistatuserror(union ccb *ccb, } break; case SCSI_STATUS_RESERV_CONFLICT: - xpt_print(ccb->ccb_h.path, "Reservation conflict\n"); - error = EIO; - break; default: - xpt_print(ccb->ccb_h.path, "SCSI status 0x%x\n", - ccb->csio.scsi_status); error = EIO; break; } @@ -1532,18 +1353,18 @@ camperiphscsistatuserror(union ccb *ccb, } static int -camperiphscsisenseerror(union ccb *ccb, cam_flags camflags, - u_int32_t sense_flags, - int *openings, u_int32_t *relsim_flags, - u_int32_t *timeout, const char **action_string) +camperiphscsisenseerror(union ccb *ccb, union ccb **orig, + cam_flags camflags, u_int32_t sense_flags, + int *openings, u_int32_t *relsim_flags, + u_int32_t *timeout, int *print, const char **action_string) { struct cam_periph *periph; union ccb *orig_ccb = ccb; - int error; + int error, recoveryccb; periph = xpt_path_periph(ccb->ccb_h.path); - if (periph->flags & - (CAM_PERIPH_RECOVERY_INPROG | CAM_PERIPH_SENSE_INPROG)) { + recoveryccb = (ccb->ccb_h.cbfcnp == camperiphdone); + if ((periph->flags & CAM_PERIPH_RECOVERY_INPROG) && !recoveryccb) { /* * If error recovery is already in progress, don't attempt * to process this error, but requeue it unconditionally @@ -1558,6 +1379,7 @@ camperiphscsisenseerror(union ccb *ccb, * imperitive that we don't violate this assumption. */ error = ERESTART; + *print = 0; } else { scsi_sense_action err_action; struct ccb_getdev cgd; @@ -1573,14 +1395,36 @@ camperiphscsisenseerror(union ccb *ccb, err_action = scsi_error_action(&ccb->csio, &cgd.inq_data, sense_flags); - else if ((ccb->ccb_h.flags & CAM_DIS_AUTOSENSE) == 0) - err_action = SS_REQSENSE; else err_action = SS_RETRY|SSQ_DECREMENT_COUNT|EIO; - error = err_action & SS_ERRMASK; /* + * Do not autostart sequential access devices + * to avoid unexpected tape loading. + */ + if ((err_action & SS_MASK) == SS_START && + SID_TYPE(&cgd.inq_data) == T_SEQUENTIAL) { + *action_string = "Will not autostart a " + "sequential access device"; + goto sense_error_done; + } + + /* + * Avoid recovery recursion if recovery action is the same. + */ + if ((err_action & SS_MASK) >= SS_START && recoveryccb) { + if (((err_action & SS_MASK) == SS_START && + ccb->csio.cdb_io.cdb_bytes[0] == START_STOP_UNIT) || + ((err_action & SS_MASK) == SS_TUR && + (ccb->csio.cdb_io.cdb_bytes[0] == TEST_UNIT_READY))) { + err_action = SS_RETRY|SSQ_DECREMENT_COUNT|EIO; + *relsim_flags = RELSIM_RELEASE_AFTER_TIMEOUT; + *timeout = 500; + } + } + + /* * If the recovery action will consume a retry, * make sure we actually have retries available. */ @@ -1627,15 +1471,6 @@ camperiphscsisenseerror(union ccb *ccb, case SS_START: { int le; - if (SID_TYPE(&cgd.inq_data) == T_SEQUENTIAL) { - xpt_free_ccb(orig_ccb); - ccb->ccb_h.status |= CAM_DEV_QFRZN; - *action_string = "Will not autostart a " - "sequential access device"; - err_action = SS_FAIL; - error = EIO; - break; - } /* * Send a start unit command to the device, and @@ -1699,24 +1534,6 @@ camperiphscsisenseerror(union ccb *ccb, *timeout = 500; break; } - case SS_REQSENSE: - { - *action_string = "Requesting SCSI sense data"; - periph->flags |= CAM_PERIPH_SENSE_INPROG; - /* - * Send a Request Sense to the device. We - * assume that we are in a contingent allegiance - * condition so we do not tag this request. - */ - scsi_request_sense(&ccb->csio, /*retries*/1, - camperiphsensedone, - &orig_ccb->csio.sense_data, - orig_ccb->csio.sense_len, - CAM_TAG_ACTION_NONE, - /*sense_len*/SSD_FULL_SIZE, - /*timeout*/5000); - break; - } default: panic("Unhandled error action %x", err_action); } @@ -1733,14 +1550,12 @@ camperiphscsisenseerror(union ccb *ccb, ccb->ccb_h.pinfo.priority--; ccb->ccb_h.flags |= CAM_DEV_QFREEZE; ccb->ccb_h.saved_ccb_ptr = orig_ccb; - ccb->ccb_h.recovery_depth = 0; error = ERESTART; + *orig = orig_ccb; } sense_error_done: - if ((err_action & SSQ_PRINT_SENSE) != 0 - && (ccb->ccb_h.status & CAM_AUTOSNS_VALID) != 0) - cam_error_print(orig_ccb, CAM_ESF_ALL, CAM_EPF_ALL); + *print = ((err_action & SSQ_PRINT_SENSE) != 0); } return (error); } @@ -1754,87 +1569,35 @@ int cam_periph_error(union ccb *ccb, cam_flags camflags, u_int32_t sense_flags, union ccb *save_ccb) { + union ccb *orig_ccb; struct cam_periph *periph; const char *action_string; cam_status status; - int frozen; - int error, printed = 0; - int openings; - u_int32_t relsim_flags; - u_int32_t timeout = 0; + int frozen, error, openings, print, lost_device; + u_int32_t relsim_flags, timeout; + print = 1; periph = xpt_path_periph(ccb->ccb_h.path); action_string = NULL; status = ccb->ccb_h.status; frozen = (status & CAM_DEV_QFRZN) != 0; status &= CAM_STATUS_MASK; - openings = relsim_flags = 0; + openings = relsim_flags = timeout = lost_device = 0; + orig_ccb = ccb; switch (status) { case CAM_REQ_CMP: error = 0; + print = 0; break; case CAM_SCSI_STATUS_ERROR: - error = camperiphscsistatuserror(ccb, - camflags, - sense_flags, - &openings, - &relsim_flags, - &timeout, - &action_string); + error = camperiphscsistatuserror(ccb, &orig_ccb, + camflags, sense_flags, &openings, &relsim_flags, + &timeout, &print, &action_string); break; case CAM_AUTOSENSE_FAIL: - xpt_print(ccb->ccb_h.path, "AutoSense failed\n"); error = EIO; /* we have to kill the command */ break; - case CAM_ATA_STATUS_ERROR: - if (bootverbose && printed == 0) { - xpt_print(ccb->ccb_h.path, "ATA status error\n"); - cam_error_print(ccb, CAM_ESF_ALL, CAM_EPF_ALL); - printed++; - } - /* FALLTHROUGH */ - case CAM_REQ_CMP_ERR: - if (bootverbose && printed == 0) { - xpt_print(ccb->ccb_h.path, - "Request completed with CAM_REQ_CMP_ERR\n"); - printed++; - } - /* FALLTHROUGH */ - case CAM_CMD_TIMEOUT: - if (bootverbose && printed == 0) { - xpt_print(ccb->ccb_h.path, "Command timed out\n"); - printed++; - } - /* FALLTHROUGH */ - case CAM_UNEXP_BUSFREE: - if (bootverbose && printed == 0) { - xpt_print(ccb->ccb_h.path, "Unexpected Bus Free\n"); - printed++; - } - /* FALLTHROUGH */ - case CAM_UNCOR_PARITY: - if (bootverbose && printed == 0) { - xpt_print(ccb->ccb_h.path, - "Uncorrected parity error\n"); - printed++; - } - /* FALLTHROUGH */ - case CAM_DATA_RUN_ERR: - if (bootverbose && printed == 0) { - xpt_print(ccb->ccb_h.path, "Data overrun\n"); - printed++; - } - /* decrement the number of retries */ - if (ccb->ccb_h.retry_count > 0 && - (periph->flags & CAM_PERIPH_INVALID) == 0) { - ccb->ccb_h.retry_count--; - error = ERESTART; - } else { - action_string = "Retries exhausted"; - error = EIO; - } - break; case CAM_UA_ABORT: case CAM_UA_TERMIO: case CAM_MSG_REJECT_REC: @@ -1845,14 +1608,8 @@ cam_periph_error(union ccb *ccb, cam_fla if ((camflags & CAM_RETRY_SELTO) != 0) { if (ccb->ccb_h.retry_count > 0 && (periph->flags & CAM_PERIPH_INVALID) == 0) { - ccb->ccb_h.retry_count--; error = ERESTART; - if (bootverbose && printed == 0) { - xpt_print(ccb->ccb_h.path, - "Selection timeout\n"); - printed++; - } /* * Wait a bit to give the device @@ -1866,38 +1623,10 @@ cam_periph_error(union ccb *ccb, cam_fla } /* FALLTHROUGH */ case CAM_DEV_NOT_THERE: - { - struct cam_path *newpath; - lun_id_t lun_id; - error = ENXIO; - - /* - * For a selection timeout, we consider all of the LUNs on - * the target to be gone. If the status is CAM_DEV_NOT_THERE, - * then we only get rid of the device(s) specified by the - * path in the original CCB. - */ - if (status == CAM_DEV_NOT_THERE) - lun_id = xpt_path_lun_id(ccb->ccb_h.path); - else - lun_id = CAM_LUN_WILDCARD; - - /* Should we do more if we can't create the path?? */ - if (xpt_create_path(&newpath, periph, - xpt_path_path_id(ccb->ccb_h.path), - xpt_path_target_id(ccb->ccb_h.path), - lun_id) != CAM_REQ_CMP) - break; - - /* - * Let peripheral drivers know that this device has gone - * away. - */ - xpt_async(AC_LOST_DEVICE, newpath, NULL); - xpt_free_path(newpath); + print = 0; + lost_device = 1; break; - } case CAM_REQ_INVALID: case CAM_PATH_INVALID: case CAM_NO_HBA: @@ -1917,27 +1646,16 @@ cam_periph_error(union ccb *ccb, cam_fla * these events and should be unconditionally * retried. */ - if (bootverbose && printed == 0) { - xpt_print_path(ccb->ccb_h.path); - if (status == CAM_BDR_SENT) - printf("Bus Device Reset sent\n"); - else - printf("Bus Reset issued\n"); - printed++; - } - /* FALLTHROUGH */ case CAM_REQUEUE_REQ: - /* Unconditional requeue */ - if (bootverbose && printed == 0) { - xpt_print(ccb->ccb_h.path, "Request requeued\n"); - printed++; - } - if ((periph->flags & CAM_PERIPH_INVALID) == 0) - error = ERESTART; - else { - action_string = "Retries exhausted"; + /* Unconditional requeue if device is still there */ + if (periph->flags & CAM_PERIPH_INVALID) { + action_string = "Periph was invalidated"; error = EIO; - } + } else if (sense_flags & SF_NO_RETRY) { + error = EIO; + action_string = "Retry was blocked"; + } else + error = ERESTART; break; case CAM_RESRC_UNAVAIL: /* Wait a bit for the resource shortage to abate. */ @@ -1950,30 +1668,37 @@ cam_periph_error(union ccb *ccb, cam_fla } relsim_flags = RELSIM_RELEASE_AFTER_TIMEOUT; /* FALLTHROUGH */ + case CAM_ATA_STATUS_ERROR: + case CAM_REQ_CMP_ERR: + case CAM_CMD_TIMEOUT: + case CAM_UNEXP_BUSFREE: + case CAM_UNCOR_PARITY: + case CAM_DATA_RUN_ERR: default: - /* decrement the number of retries */ - if (ccb->ccb_h.retry_count > 0 && - (periph->flags & CAM_PERIPH_INVALID) == 0) { - ccb->ccb_h.retry_count--; - error = ERESTART; - if (bootverbose && printed == 0) { - xpt_print(ccb->ccb_h.path, "CAM status 0x%x\n", - status); - printed++; - } - } else { + if (periph->flags & CAM_PERIPH_INVALID) { + error = EIO; + action_string = "Periph was invalidated"; + } else if (ccb->ccb_h.retry_count == 0) { error = EIO; action_string = "Retries exhausted"; + } else if (sense_flags & SF_NO_RETRY) { + error = EIO; + action_string = "Retry was blocked"; + } else { + ccb->ccb_h.retry_count--; + error = ERESTART; } break; } - /* - * If we have and error and are booting verbosely, whine - * *unless* this was a non-retryable selection timeout. - */ - if (error != 0 && bootverbose && - !(status == CAM_SEL_TIMEOUT && (camflags & CAM_RETRY_SELTO) == 0)) { + if ((sense_flags & SF_PRINT_ALWAYS) || + CAM_DEBUGGED(ccb->ccb_h.path, CAM_DEBUG_INFO)) + print = 1; + else if (sense_flags & SF_NO_PRINT) + print = 0; + if (print) + cam_error_print(orig_ccb, CAM_ESF_ALL, CAM_EPF_ALL); + if (error != 0 && print) { if (error != ERESTART) { if (action_string == NULL) action_string = "Unretryable error"; @@ -1985,6 +1710,36 @@ cam_periph_error(union ccb *ccb, cam_fla xpt_print(ccb->ccb_h.path, "Retrying command\n"); } + if (lost_device) { + struct cam_path *newpath; + lun_id_t lun_id; + + /* + * For a selection timeout, we consider all of the LUNs on + * the target to be gone. If the status is CAM_DEV_NOT_THERE, + * then we only get rid of the device(s) specified by the + * path in the original CCB. + */ + if (status == CAM_DEV_NOT_THERE) + lun_id = xpt_path_lun_id(ccb->ccb_h.path); + else + lun_id = CAM_LUN_WILDCARD; + + /* Should we do more if we can't create the path?? */ + if (xpt_create_path(&newpath, periph, + xpt_path_path_id(ccb->ccb_h.path), + xpt_path_target_id(ccb->ccb_h.path), + lun_id) == CAM_REQ_CMP) { + + /* + * Let peripheral drivers know that this + * device has gone away. + */ + xpt_async(AC_LOST_DEVICE, newpath, NULL); + xpt_free_path(newpath); + } + } + /* Attempt a retry */ if (error == ERESTART || error == 0) { if (frozen != 0) Modified: head/sys/cam/cam_periph.h ============================================================================== --- head/sys/cam/cam_periph.h Sat Jun 9 12:58:00 2012 (r236813) +++ head/sys/cam/cam_periph.h Sat Jun 9 13:07:44 2012 (r236814) @@ -118,7 +118,6 @@ struct cam_periph { #define CAM_PERIPH_INVALID 0x08 #define CAM_PERIPH_NEW_DEV_FOUND 0x10 #define CAM_PERIPH_RECOVERY_INPROG 0x20 -#define CAM_PERIPH_SENSE_INPROG 0x40 #define CAM_PERIPH_FREE 0x80 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 16:09:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F2D6106566C; Sat, 9 Jun 2012 16:09:54 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A09A8FC08; Sat, 9 Jun 2012 16:09:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q59G9sKH041850; Sat, 9 Jun 2012 16:09:54 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q59G9sJT041848; Sat, 9 Jun 2012 16:09:54 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201206091609.q59G9sJT041848@svn.freebsd.org> From: Tim Kientzle Date: Sat, 9 Jun 2012 16:09:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236816 - head/lib/libc/arm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 16:09:54 -0000 Author: kientzle Date: Sat Jun 9 16:09:53 2012 New Revision: 236816 URL: http://svn.freebsd.org/changeset/base/236816 Log: __flt_rounds was omitted from the exported symbols here. Submitted by: Jan Sieka Reviewed by: arm@ MFC after: 1 week Modified: head/lib/libc/arm/Symbol.map Modified: head/lib/libc/arm/Symbol.map ============================================================================== --- head/lib/libc/arm/Symbol.map Sat Jun 9 14:13:42 2012 (r236815) +++ head/lib/libc/arm/Symbol.map Sat Jun 9 16:09:53 2012 (r236816) @@ -70,6 +70,7 @@ FBSDprivate_1.0 { __divdf3; __floatsisf; __floatsidf; + __flt_rounds; __fixsfsi; __fixdfsi; __fixunssfsi; From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 17:39:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C712C1065670; Sat, 9 Jun 2012 17:39:05 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2F798FC17; Sat, 9 Jun 2012 17:39:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q59Hd5lU045582; Sat, 9 Jun 2012 17:39:05 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q59Hd5UX045580; Sat, 9 Jun 2012 17:39:05 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201206091739.q59Hd5UX045580@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 9 Jun 2012 17:39:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236819 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 17:39:05 -0000 Author: melifaro Date: Sat Jun 9 17:39:05 2012 New Revision: 236819 URL: http://svn.freebsd.org/changeset/base/236819 Log: Validate IPv4 network mask being passed to ipfw kernel interface. Incorrect mask can possibly be one of the reasons for kern/127209 existance. Approved by: kib(mentor) MFC after: 3 days Modified: head/sys/netinet/ipfw/ip_fw_table.c Modified: head/sys/netinet/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_table.c Sat Jun 9 16:44:35 2012 (r236818) +++ head/sys/netinet/ipfw/ip_fw_table.c Sat Jun 9 17:39:05 2012 (r236819) @@ -153,6 +153,9 @@ ipfw_add_table_entry(struct ip_fw_chain case IPFW_TABLE_CIDR: if (plen == sizeof(in_addr_t)) { #ifdef INET + /* IPv4 case */ + if (mlen > 32) + return (EINVAL); ent = malloc(sizeof(*ent), M_IPFW_TBL, M_WAITOK | M_ZERO); ent->value = value; /* Set 'total' structure length */ From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 18:03:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 49AB01065674; Sat, 9 Jun 2012 18:03:24 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BB4B8FC0A; Sat, 9 Jun 2012 18:03:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q59I3N1W046618; Sat, 9 Jun 2012 18:03:23 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q59I3Nsd046616; Sat, 9 Jun 2012 18:03:23 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201206091803.q59I3Nsd046616@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 9 Jun 2012 18:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236820 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 18:03:24 -0000 Author: pjd Date: Sat Jun 9 18:03:23 2012 New Revision: 236820 URL: http://svn.freebsd.org/changeset/base/236820 Log: Make some of the loops more readable. Reviewed by: tegge MFC after: 1 month Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat Jun 9 17:39:05 2012 (r236819) +++ head/sys/kern/kern_descrip.c Sat Jun 9 18:03:23 2012 (r236820) @@ -1570,7 +1570,6 @@ fdavail(struct thread *td, int n) { struct proc *p = td->td_proc; struct filedesc *fdp = td->td_proc->p_fd; - struct file **fpp; int i, lim, last; FILEDESC_LOCK_ASSERT(fdp); @@ -1586,9 +1585,8 @@ fdavail(struct thread *td, int n) if ((i = lim - fdp->fd_nfiles) > 0 && (n -= i) <= 0) return (1); last = min(fdp->fd_nfiles, lim); - fpp = &fdp->fd_ofiles[fdp->fd_freefile]; - for (i = last - fdp->fd_freefile; --i >= 0; fpp++) { - if (*fpp == NULL && --n <= 0) + for (i = fdp->fd_freefile; i < last; i++) { + if (fdp->fd_ofiles[i] == NULL && --n <= 0) return (1); } return (0); @@ -1874,13 +1872,10 @@ fdfree(struct thread *td) fdtol->fdl_refcount)); if (fdtol->fdl_refcount == 1 && (td->td_proc->p_leader->p_flag & P_ADVLOCK) != 0) { - for (i = 0, fpp = fdp->fd_ofiles; - i <= fdp->fd_lastfile; - i++, fpp++) { - if (*fpp == NULL || - (*fpp)->f_type != DTYPE_VNODE) + for (i = 0; i <= fdp->fd_lastfile; i++) { + fp = fdp->fd_ofiles[i]; + if (fp == NULL || fp->f_type != DTYPE_VNODE) continue; - fp = *fpp; fhold(fp); FILEDESC_XUNLOCK(fdp); lf.l_whence = SEEK_SET; @@ -1898,7 +1893,6 @@ fdfree(struct thread *td) VFS_UNLOCK_GIANT(locked); FILEDESC_XLOCK(fdp); fdrop(fp, td); - fpp = fdp->fd_ofiles + i; } } retry: @@ -1943,12 +1937,11 @@ fdfree(struct thread *td) if (i > 0) return; - fpp = fdp->fd_ofiles; - for (i = fdp->fd_lastfile; i-- >= 0; fpp++) { - if (*fpp) { + for (i = 0; i <= fdp->fd_lastfile; i++) { + fp = fdp->fd_ofiles[i]; + if (fp != NULL) { FILEDESC_XLOCK(fdp); - fp = *fpp; - *fpp = NULL; + fdp->fd_ofiles[i] = NULL; FILEDESC_XUNLOCK(fdp); (void) closef(fp, td); } From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 18:48:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80F8F106566C; Sat, 9 Jun 2012 18:48:07 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CB778FC08; Sat, 9 Jun 2012 18:48:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q59Im7Mq048471; Sat, 9 Jun 2012 18:48:07 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q59Im7KK048469; Sat, 9 Jun 2012 18:48:07 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201206091848.q59Im7KK048469@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 9 Jun 2012 18:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236821 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 18:48:07 -0000 Author: pjd Date: Sat Jun 9 18:48:06 2012 New Revision: 236821 URL: http://svn.freebsd.org/changeset/base/236821 Log: Remove now unused variable. MFC after: 1 month MFC with: r236820 Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat Jun 9 18:03:23 2012 (r236820) +++ head/sys/kern/kern_descrip.c Sat Jun 9 18:48:06 2012 (r236821) @@ -1845,7 +1845,6 @@ void fdfree(struct thread *td) { struct filedesc *fdp; - struct file **fpp; int i, locked; struct filedesc_to_leader *fdtol; struct file *fp; From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 18:50:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A627106566C; Sat, 9 Jun 2012 18:50:33 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2624D8FC14; Sat, 9 Jun 2012 18:50:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q59IoXTY048601; Sat, 9 Jun 2012 18:50:33 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q59IoWIi048599; Sat, 9 Jun 2012 18:50:32 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201206091850.q59IoWIi048599@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 9 Jun 2012 18:50:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236822 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 18:50:33 -0000 Author: pjd Date: Sat Jun 9 18:50:32 2012 New Revision: 236822 URL: http://svn.freebsd.org/changeset/base/236822 Log: There is no need to drop the FILEDESC lock around malloc(M_WAITOK) anymore, as we now use sx lock for filedesc structure protection. Reviewed by: kib MFC after: 1 month Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat Jun 9 18:48:06 2012 (r236821) +++ head/sys/kern/kern_descrip.c Sat Jun 9 18:50:32 2012 (r236822) @@ -1428,9 +1428,7 @@ out: } /* - * Grow the file table to accomodate (at least) nfd descriptors. This may - * block and drop the filedesc lock, but it will reacquire it before - * returning. + * Grow the file table to accomodate (at least) nfd descriptors. */ static void fdgrowtable(struct filedesc *fdp, int nfd) @@ -1456,7 +1454,6 @@ fdgrowtable(struct filedesc *fdp, int nf return; /* allocate a new table and (if required) new bitmaps */ - FILEDESC_XUNLOCK(fdp); ntable = malloc((nnfiles * OFILESIZE) + sizeof(struct freetable), M_FILEDESC, M_ZERO | M_WAITOK); nfileflags = (char *)&ntable[nnfiles]; @@ -1465,20 +1462,7 @@ fdgrowtable(struct filedesc *fdp, int nf M_FILEDESC, M_ZERO | M_WAITOK); else nmap = NULL; - FILEDESC_XLOCK(fdp); - /* - * We now have new tables ready to go. Since we dropped the - * filedesc lock to call malloc(), watch out for a race. - */ - onfiles = fdp->fd_nfiles; - if (onfiles >= nnfiles) { - /* we lost the race, but that's OK */ - free(ntable, M_FILEDESC); - if (nmap != NULL) - free(nmap, M_FILEDESC); - return; - } bcopy(fdp->fd_ofiles, ntable, onfiles * sizeof(*ntable)); bcopy(fdp->fd_ofileflags, nfileflags, onfiles); otable = fdp->fd_ofiles; From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 20:16:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C077B106566B; Sat, 9 Jun 2012 20:16:19 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA9BD8FC08; Sat, 9 Jun 2012 20:16:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q59KGJvb052044; Sat, 9 Jun 2012 20:16:19 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q59KGJkR052042; Sat, 9 Jun 2012 20:16:19 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201206092016.q59KGJkR052042@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 9 Jun 2012 20:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236823 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 20:16:19 -0000 Author: pjd Date: Sat Jun 9 20:16:19 2012 New Revision: 236823 URL: http://svn.freebsd.org/changeset/base/236823 Log: ds_guid of 0 is special, as it is used by snapshot receive code to differentiate between an incremental and full stream. Be sure not to generate guid equal to 0. Reported by: someone who saw 0 being generated as 64bit random guid MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Jun 9 18:50:32 2012 (r236822) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Jun 9 20:16:19 2012 (r236823) @@ -809,8 +809,10 @@ dsl_dataset_create_sync_dd(dsl_dir_t *dd dsphys->ds_dir_obj = dd->dd_object; dsphys->ds_flags = flags; dsphys->ds_fsid_guid = unique_create(); - (void) random_get_pseudo_bytes((void*)&dsphys->ds_guid, - sizeof (dsphys->ds_guid)); + do { + (void) random_get_pseudo_bytes((void*)&dsphys->ds_guid, + sizeof (dsphys->ds_guid)); + } while (dsphys->ds_guid == 0); dsphys->ds_snapnames_zapobj = zap_create_norm(mos, U8_TEXTPREP_TOUPPER, DMU_OT_DSL_DS_SNAP_MAP, DMU_OT_NONE, 0, tx); @@ -2082,8 +2084,10 @@ dsl_dataset_snapshot_sync(void *arg1, vo bzero(dsphys, sizeof (dsl_dataset_phys_t)); dsphys->ds_dir_obj = ds->ds_dir->dd_object; dsphys->ds_fsid_guid = unique_create(); - (void) random_get_pseudo_bytes((void*)&dsphys->ds_guid, - sizeof (dsphys->ds_guid)); + do { + (void) random_get_pseudo_bytes((void*)&dsphys->ds_guid, + sizeof (dsphys->ds_guid)); + } while (dsphys->ds_guid == 0); dsphys->ds_prev_snap_obj = ds->ds_phys->ds_prev_snap_obj; dsphys->ds_prev_snap_txg = ds->ds_phys->ds_prev_snap_txg; dsphys->ds_next_snap_obj = ds->ds_object; From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 20:47:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ED766106567E; Sat, 9 Jun 2012 20:47:58 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9A988FC12; Sat, 9 Jun 2012 20:47:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q59Klw0k053307; Sat, 9 Jun 2012 20:47:58 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q59KlwkR053305; Sat, 9 Jun 2012 20:47:58 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201206092047.q59KlwkR053305@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 9 Jun 2012 20:47:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236824 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 20:47:59 -0000 Author: melifaro Date: Sat Jun 9 20:47:58 2012 New Revision: 236824 URL: http://svn.freebsd.org/changeset/base/236824 Log: Update maximum number of tables available in ipfw to reflect changes done in r233478. Approved by: kib(mentor) MFC after: 3 days Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Sat Jun 9 20:16:19 2012 (r236823) +++ head/sbin/ipfw/ipfw.8 Sat Jun 9 20:47:58 2012 (r236824) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 9, 2012 +.Dd June 10, 2012 .Dt IPFW 8 .Os .Sh NAME @@ -1733,7 +1733,7 @@ connected networks instead of all source Lookup tables are useful to handle large sparse sets of addresses or other search keys (e.g. ports, jail IDs, interface names). In the rest of this section we will use the term ``address''. -There may be up to 4096 different lookup tables, numbered 0 to 4095. +There may be up to 65535 different lookup tables, numbered 0 to 65534. .Pp Each entry is represented by an .Ar addr Ns Op / Ns Ar masklen From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 22:26:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CF68E106564A; Sat, 9 Jun 2012 22:26:53 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BAAB28FC16; Sat, 9 Jun 2012 22:26:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q59MQrXL057508; Sat, 9 Jun 2012 22:26:53 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q59MQrO1057506; Sat, 9 Jun 2012 22:26:53 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201206092226.q59MQrO1057506@svn.freebsd.org> From: Kirk McKusick Date: Sat, 9 Jun 2012 22:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236825 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 22:26:53 -0000 Author: mckusick Date: Sat Jun 9 22:26:53 2012 New Revision: 236825 URL: http://svn.freebsd.org/changeset/base/236825 Log: When synchronously syncing a device (MNT_WAIT), wait for buffers to become available. Otherwise we may excessively spin and fail with ``fsync: giving up on dirty''. Reviewed by: kib Tested by: Peter Holm MFC after: 1 week Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Sat Jun 9 20:47:58 2012 (r236824) +++ head/sys/kern/vfs_default.c Sat Jun 9 22:26:53 2012 (r236825) @@ -646,8 +646,17 @@ loop2: if ((bp->b_vflags & BV_SCANNED) != 0) continue; bp->b_vflags |= BV_SCANNED; - if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL)) - continue; + if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL)) { + if (ap->a_waitfor != MNT_WAIT) + continue; + if (BUF_LOCK(bp, + LK_EXCLUSIVE | LK_INTERLOCK | LK_SLEEPFAIL, + BO_MTX(bo)) != 0) { + BO_LOCK(bo); + goto loop1; + } + BO_LOCK(bo); + } BO_UNLOCK(bo); KASSERT(bp->b_bufobj == bo, ("bp %p wrong b_bufobj %p should be %p", From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 22:29:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by hub.freebsd.org (Postfix) with ESMTP id E574B106564A; Sat, 9 Jun 2012 22:29:19 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 265F714F695; Sat, 9 Jun 2012 22:29:19 +0000 (UTC) Message-ID: <4FD3CE3E.3070007@FreeBSD.org> Date: Sat, 09 Jun 2012 15:29:18 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120609 Thunderbird/13.0 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201206091850.q59IoWIi048599@svn.freebsd.org> In-Reply-To: <201206091850.q59IoWIi048599@svn.freebsd.org> X-Enigmail-Version: 1.4.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r236822 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 22:29:20 -0000 According to the tinderbox these commits seem to have broken the build. I built r236818 successfully earlier today ... Doug -- This .signature sanitized for your protection From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 22:44:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 50C5C1065675; Sat, 9 Jun 2012 22:44:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BB078FC17; Sat, 9 Jun 2012 22:44:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q59MiPjV058307; Sat, 9 Jun 2012 22:44:25 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q59MiPdp058305; Sat, 9 Jun 2012 22:44:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201206092244.q59MiPdp058305@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 9 Jun 2012 22:44:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236826 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 22:44:25 -0000 Author: bz Date: Sat Jun 9 22:44:24 2012 New Revision: 236826 URL: http://svn.freebsd.org/changeset/base/236826 Log: MFC r236615: Plug two interface address refcount leaks in early error return cases in the ioctl path. Reported by: rpaulo Reviewed by: emax Modified: stable/9/sys/netinet6/in6.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/in6.c ============================================================================== --- stable/9/sys/netinet6/in6.c Sat Jun 9 22:26:53 2012 (r236825) +++ stable/9/sys/netinet6/in6.c Sat Jun 9 22:44:24 2012 (r236826) @@ -1638,14 +1638,19 @@ in6_lifaddr_ioctl(struct socket *so, u_l hostid = IFA_IN6(ifa); /* prefixlen must be <= 64. */ - if (64 < iflr->prefixlen) + if (64 < iflr->prefixlen) { + if (ifa != NULL) + ifa_free(ifa); return EINVAL; + } prefixlen = iflr->prefixlen; /* hostid part must be zero. */ sin6 = (struct sockaddr_in6 *)&iflr->addr; if (sin6->sin6_addr.s6_addr32[2] != 0 || sin6->sin6_addr.s6_addr32[3] != 0) { + if (ifa != NULL) + ifa_free(ifa); return EINVAL; } } else From owner-svn-src-all@FreeBSD.ORG Sat Jun 9 22:44:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C817106564A; Sat, 9 Jun 2012 22:44:50 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 373AB8FC18; Sat, 9 Jun 2012 22:44:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q59Mio70058358; Sat, 9 Jun 2012 22:44:50 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q59Min8a058356; Sat, 9 Jun 2012 22:44:49 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201206092244.q59Min8a058356@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 9 Jun 2012 22:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236827 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 22:44:50 -0000 Author: bz Date: Sat Jun 9 22:44:49 2012 New Revision: 236827 URL: http://svn.freebsd.org/changeset/base/236827 Log: MFC r236615: Plug two interface address refcount leaks in early error return cases in the ioctl path. Reported by: rpaulo Reviewed by: emax Modified: stable/8/sys/netinet6/in6.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/in6.c ============================================================================== --- stable/8/sys/netinet6/in6.c Sat Jun 9 22:44:24 2012 (r236826) +++ stable/8/sys/netinet6/in6.c Sat Jun 9 22:44:49 2012 (r236827) @@ -1556,14 +1556,19 @@ in6_lifaddr_ioctl(struct socket *so, u_l hostid = IFA_IN6(ifa); /* prefixlen must be <= 64. */ - if (64 < iflr->prefixlen) + if (64 < iflr->prefixlen) { + if (ifa != NULL) + ifa_free(ifa); return EINVAL; + } prefixlen = iflr->prefixlen; /* hostid part must be zero. */ sin6 = (struct sockaddr_in6 *)&iflr->addr; if (sin6->sin6_addr.s6_addr32[2] != 0 || sin6->sin6_addr.s6_addr32[3] != 0) { + if (ifa != NULL) + ifa_free(ifa); return EINVAL; } } else