From owner-svn-src-head@FreeBSD.ORG Sun Jun 3 00:54:11 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 3 01:00:55 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 3 01:07:55 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 3 05:36:26 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 3 06:57:48 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 3 07:36:59 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 07:37:00 -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-head@FreeBSD.ORG Sun Jun 3 07:45:43 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 3 08:01:13 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 3 08:30:00 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 3 10:50:47 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 3 11:09:52 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 3 11:29:49 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 3 11:52:17 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 3 12:19:16 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 3 14:54:51 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 3 16:06:56 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 3 16:19:37 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 3 18:14:58 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 3 18:34:33 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 3 20:35:42 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 3 21:03:17 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Mon Jun 4 03:51:09 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 04:25:01 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 08:40:15 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 08:42:19 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 09:22:22 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 09:25:02 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 09:47:20 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 10:01:39 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 10:42:10 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 10:50:29 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 12:36:59 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 12:49:22 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 12:51:04 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 14:05:26 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 14:18:13 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 14:27:54 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 15:21:14 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 15:59:23 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 16:04:02 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 16:15:41 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 16:25:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8BA5C1065676 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 4DC6B8FC16 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 17:22:43 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 17:50:12 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 18:02:10 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 18:43:52 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 18:58:01 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 19:09:15 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 19:40:52 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 20:36:12 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 20:45:34 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 20:56:41 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 21:34:50 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 22:01:13 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 22:11:21 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 22:46:05 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 22:54:20 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 22:59:07 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 22:59:34 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 4 23:07:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D7D7A1065673 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 A4FB38FC0A for ; Mon, 4 Jun 2012 23:07:49 +0000 (UTC) Received: by dadv36 with SMTP id v36so6832528dad.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=W5ABKiJZbd3VSc4ueBXgWPOpwqSXcRTLriFNJPPTRguYKgYLE/q0r1BvPxLEhGiSRd Teme5+mVjV27wn6q1e5rnhGZBn896pOR1W9bnNKerTCO5VZtISLa4e9aOg962SoyOe5C REtZzq/OTALbpJPg4rRAg+Toh31v21mEMJ/pCKpBgkzftZIdVZkMDxyVGxoE7kfmMmZM 8s51rdepWDQRs+fjhhKbP498eHFnLRwiurcaA737rZOc87PV56VuVocUcQiUdOFBFCtj 0HpsibN2IPd+Ai1K/FtTsYjhYk1IGJGOFdam007rAdJMEhjgZ1NACgdnyPHqE4MsrG/X Dszw== 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: ALoCoQnNRJNofyblWg3V+ueBCViRCM9JcqyfBD46Uyd8RYRy5oNwcZaRJaEOsGHDpoiJqU3I1ElX 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Tue Jun 5 02:18:55 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 02:48:59 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 03:14:40 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 03:14:50 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 05:14:12 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 05:16:05 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 06:03:55 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 06:03:56 -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-head@FreeBSD.ORG Tue Jun 5 07:49:34 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 08:08:15 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 08:35:59 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 09:45:43 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 10:08:23 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 10:23:42 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 11:48:33 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 12:34:09 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 12:40:22 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 12:48:51 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 12:53:00 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 12:55:25 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4534D106566C; Tue, 5 Jun 2012 12:55:25 +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 73FFC8FC12; Tue, 5 Jun 2012 12:55:24 +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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 12:55:25 -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-head@FreeBSD.ORG Tue Jun 5 13:09:24 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 13:10:08 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 13:13:07 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 13:27:38 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 13:35:36 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 14:03:43 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 14:20:00 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 14:25:30 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C00B106564A; Tue, 5 Jun 2012 14:25:30 +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 38DFE8FC12; Tue, 5 Jun 2012 14:25:29 +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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 14:25:30 -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-head@FreeBSD.ORG Tue Jun 5 14:31:17 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 15:17:58 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 15:23:34 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 15:56:49 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 16:16:34 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 16:46:34 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 17:13:25 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 17:36:29 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 17:37:30 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 17:44:54 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 17:46:51 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 17:49:11 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 17:58:48 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 18:07:20 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 18:09:23 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 18:19:53 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 18:48:02 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 18:57:38 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 18:58:05 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 19:41:05 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 19:42:58 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 20:09:00 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 20:11:05 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 20:12:55 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 20:32:39 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 20:39:13 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 20:48:14 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 21:01:57 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 21:30:42 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BB36D106564A; Tue, 5 Jun 2012 21:30:42 +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 94EE88FC0C; Tue, 5 Jun 2012 21:30:41 +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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 21:30:42 -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-head@FreeBSD.ORG Tue Jun 5 21:35:48 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 21:48:16 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 5 22:02:28 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Wed Jun 6 02:42:31 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 6 06:19:53 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 6 06:52:52 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 6 08:07:48 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 6 08:58:32 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 6 09:07:51 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 6 09:36:53 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 6 13:35:31 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 6 14:31:15 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 6 16:26:56 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 6 16:30:17 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 6 16:51:33 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 6 17:04:57 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 6 17:08:24 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 6 17:26:53 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 6 17:28:46 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 6 18:00:38 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 6 21:16:27 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Thu Jun 7 02:24:27 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 7 02:51:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8F6A41065672 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 1F5E48FC12 for ; Thu, 7 Jun 2012 02:51:48 +0000 (UTC) Received: by pbbro2 with SMTP id ro2so396460pbb.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=Gy2nr0gxKdHBQLA/8y4YJOfwtmalR2Ui18LvBrY9EEjdtdJYu+NtDvH/TKPYmFMzLN S7YDy1nmCA78AIgx8hrCAhxaVVdfeaQ4Rs0v6jedJnUqRA+g9bQ6En1vSWOiSLQgbK+f C06QfdEVoV9hdRfilD5mabM7omiLzmwqO0QIq6o+22eTYT/iPWSP3hDP4lm7WssNh6ig laE0cyyuc27NVgJXNh0o/6YAuHe/CUqFvGvKw+d62VggiOY0TMZ8AJjMzesaZ6/5F2CM EFaGHf63OrqYeTzHJcWQZtwqoriIHL0R8+7EjeoOIGZnKGWHuTIPE6uY/83XD9/VwHB0 yRCw== 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: ALoCoQkj5PqlJYel8/0LGQUOInHRtVMsxZ4/ndhaYr0ULns+6WmdrSit8tf9urrT9Wgke14qruPD 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 7 03:22:21 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 7 08:32:54 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 7 09:14:28 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 7 10:05:51 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 7 10:53:43 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 7 13:26:55 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 7 13:40:32 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 7 14:38:44 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 7 15:54:53 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 7 19:46:47 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 7 19:48:46 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 7 22:49:09 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 7 22:57:26 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 7 23:08:19 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 7 23:33:10 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Fri Jun 8 00:36:02 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jun 8 01:51:49 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jun 8 02:22:18 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jun 8 06:07:24 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jun 8 07:44:43 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jun 8 08:04:51 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jun 8 12:09:01 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jun 8 12:36:09 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jun 8 12:59:25 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jun 8 17:08:27 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jun 8 17:30:17 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jun 8 18:32:10 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jun 8 18:48:43 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jun 8 19:21:49 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jun 8 21:30:36 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jun 8 22:54:26 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Sat Jun 9 00:37:27 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 9 03:33:07 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 9 03:34:35 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 9 06:31:06 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 9 07:18:54 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 9 09:54:08 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 9 10:04:41 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 9 10:10:12 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 9 10:43:34 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 9 11:41:30 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 9 12:27:30 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 9 13:07:45 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 9 16:09:54 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 9 17:39:05 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 9 18:03:24 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 9 18:48:07 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 9 18:50:33 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 9 20:16:19 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 9 20:47:58 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 9 22:26:53 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 9 22:29:19 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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