From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 01:28:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D6297BCA; Sun, 20 Oct 2013 01:28:39 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C0FBB2C7F; Sun, 20 Oct 2013 01:28:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9K1SdJw036310; Sun, 20 Oct 2013 01:28:39 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9K1SdKv036309; Sun, 20 Oct 2013 01:28:39 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310200128.r9K1SdKv036309@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 20 Oct 2013 01:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256777 - head/sys/powerpc/pseries X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 01:28:39 -0000 Author: nwhitehorn Date: Sun Oct 20 01:28:39 2013 New Revision: 256777 URL: http://svnweb.freebsd.org/changeset/base/256777 Log: Allow hypervisor calls with more than 7 arguments. Modified: head/sys/powerpc/pseries/phyp-hvcall.S Modified: head/sys/powerpc/pseries/phyp-hvcall.S ============================================================================== --- head/sys/powerpc/pseries/phyp-hvcall.S Sat Oct 19 21:55:42 2013 (r256776) +++ head/sys/powerpc/pseries/phyp-hvcall.S Sun Oct 20 01:28:39 2013 (r256777) @@ -36,6 +36,8 @@ ASENTRY(phyp_hcall) mflr %r0 std %r0,16(%r1) + ld %r11,112(%r1) /* Last couple args into volatile regs*/ + ld %r12,120(%r1) hc /* invoke the hypervisor */ ld %r0,16(%r1) mtlr %r0 From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 01:31:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 86B88D08; Sun, 20 Oct 2013 01:31:10 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 577D52CAF; Sun, 20 Oct 2013 01:31:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9K1VA5G039636; Sun, 20 Oct 2013 01:31:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9K1V9U5039632; Sun, 20 Oct 2013 01:31:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310200131.r9K1V9U5039632@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 20 Oct 2013 01:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256778 - in head/sys: conf powerpc/conf powerpc/pseries X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 01:31:10 -0000 Author: nwhitehorn Date: Sun Oct 20 01:31:09 2013 New Revision: 256778 URL: http://svnweb.freebsd.org/changeset/base/256778 Log: Add initial driver for POWER hypervisor interpartition ethernet. This is sufficient to pass traffic but needs some more work before merging to STABLE. Added: head/sys/powerpc/pseries/phyp_llan.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/powerpc/conf/GENERIC64 Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun Oct 20 01:28:39 2013 (r256777) +++ head/sys/conf/files.powerpc Sun Oct 20 01:31:09 2013 (r256778) @@ -228,6 +228,7 @@ powerpc/ps3/ps3-hvcall.S optional ps3 sc powerpc/pseries/phyp-hvcall.S optional pseries powerpc64 powerpc/pseries/mmu_phyp.c optional pseries powerpc64 powerpc/pseries/phyp_console.c optional pseries powerpc64 uart +powerpc/pseries/phyp_llan.c optional llan powerpc/pseries/phyp_vscsi.c optional pseries powerpc64 scbus powerpc/pseries/platform_chrp.c optional pseries powerpc/pseries/plpar_iommu.c optional pseries powerpc64 Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Sun Oct 20 01:28:39 2013 (r256777) +++ head/sys/powerpc/conf/GENERIC64 Sun Oct 20 01:31:09 2013 (r256778) @@ -136,6 +136,7 @@ device em # Intel PRO/1000 Gigabit Eth device igb # Intel PRO/1000 PCIE Server Gigabit Family device ixgbe # Intel PRO/10GbE PCIE Ethernet Family device glc # Sony Playstation 3 Ethernet +device llan # IBM pSeries Virtual Ethernet # PCI Ethernet NICs that use the common MII bus controller code. device miibus # MII bus support Added: head/sys/powerpc/pseries/phyp_llan.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/pseries/phyp_llan.c Sun Oct 20 01:31:09 2013 (r256778) @@ -0,0 +1,454 @@ +/*- + * Copyright 2013 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#define LLAN_MAX_RX_PACKETS 100 +#define LLAN_MAX_TX_PACKETS 100 +#define LLAN_RX_BUF_LEN 8*PAGE_SIZE + +struct llan_xfer { + struct mbuf *rx_mbuf; + bus_dmamap_t rx_dmamap; + uint64_t rx_bufdesc; +}; + +struct llan_receive_queue_entry { /* PAPR page 539 */ + uint8_t control; + uint8_t reserved; + uint16_t offset; + uint32_t length; + uint64_t handle; +} __packed; + +struct llan_softc { + device_t dev; + struct mtx io_lock; + + cell_t unit; + uint8_t mac_address[8]; + + int irqid; + struct resource *irq; + void *irq_cookie; + + bus_dma_tag_t rx_dma_tag; + bus_dma_tag_t rxbuf_dma_tag; + bus_dma_tag_t tx_dma_tag; + + bus_dmamap_t tx_dma_map; + + struct llan_receive_queue_entry *rx_buf; + int rx_dma_slot; + int rx_valid_val; + bus_dmamap_t rx_buf_map; + bus_addr_t rx_buf_phys; + bus_size_t rx_buf_len; + bus_addr_t input_buf_phys; + bus_addr_t filter_buf_phys; + struct llan_xfer rx_xfer[LLAN_MAX_RX_PACKETS]; + + struct ifnet *ifp; +}; + +static int llan_probe(device_t); +static int llan_attach(device_t); +static void llan_intr(void *xsc); +static void llan_init(void *xsc); +static void llan_start(struct ifnet *ifp); +static int llan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); +static void llan_rx_load_cb(void *xsc, bus_dma_segment_t *segs, int nsegs, + int err); +static int llan_add_rxbuf(struct llan_softc *sc, struct llan_xfer *rx); + +static devclass_t llan_devclass; +static device_method_t llan_methods[] = { + DEVMETHOD(device_probe, llan_probe), + DEVMETHOD(device_attach, llan_attach), + + DEVMETHOD_END +}; +static driver_t llan_driver = { + "llan", + llan_methods, + sizeof(struct llan_softc) +}; +DRIVER_MODULE(llan, vdevice, llan_driver, llan_devclass, 0, 0); + +static int +llan_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev,"IBM,l-lan")) + return (ENXIO); + + device_set_desc(dev, "POWER Hypervisor Virtual Ethernet"); + return (0); +} + +static int +llan_attach(device_t dev) +{ + struct llan_softc *sc; + phandle_t node; + int error, i; + + sc = device_get_softc(dev); + sc->dev = dev; + + /* Get firmware properties */ + node = ofw_bus_get_node(dev); + OF_getprop(node, "local-mac-address", sc->mac_address, + sizeof(sc->mac_address)); + OF_getprop(node, "reg", &sc->unit, sizeof(sc->unit)); + + mtx_init(&sc->io_lock, "llan", NULL, MTX_DEF); + + /* Setup interrupt */ + sc->irqid = 0; + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid, + RF_ACTIVE); + + if (!sc->irq) { + device_printf(dev, "Could not allocate IRQ\n"); + mtx_destroy(&sc->io_lock); + return (ENXIO); + } + + bus_setup_intr(dev, sc->irq, INTR_TYPE_MISC | INTR_MPSAFE | + INTR_ENTROPY, NULL, llan_intr, sc, &sc->irq_cookie); + + /* Setup DMA */ + error = bus_dma_tag_create(bus_get_dma_tag(dev), 16, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + LLAN_RX_BUF_LEN, 1, BUS_SPACE_MAXSIZE_32BIT, + 0, NULL, NULL, &sc->rx_dma_tag); + error = bus_dma_tag_create(bus_get_dma_tag(dev), 4, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + BUS_SPACE_MAXSIZE, 1, BUS_SPACE_MAXSIZE_32BIT, + 0, NULL, NULL, &sc->rxbuf_dma_tag); + error = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + BUS_SPACE_MAXSIZE, 6, BUS_SPACE_MAXSIZE_32BIT, 0, + busdma_lock_mutex, &sc->io_lock, &sc->tx_dma_tag); + + error = bus_dmamem_alloc(sc->rx_dma_tag, (void **)&sc->rx_buf, + BUS_DMA_WAITOK | BUS_DMA_ZERO, &sc->rx_buf_map); + error = bus_dmamap_load(sc->rx_dma_tag, sc->rx_buf_map, sc->rx_buf, + LLAN_RX_BUF_LEN, llan_rx_load_cb, sc, 0); + + /* TX DMA maps */ + bus_dmamap_create(sc->tx_dma_tag, 0, &sc->tx_dma_map); + + /* RX DMA */ + for (i = 0; i < LLAN_MAX_RX_PACKETS; i++) { + error = bus_dmamap_create(sc->rxbuf_dma_tag, 0, + &sc->rx_xfer[i].rx_dmamap); + sc->rx_xfer[i].rx_mbuf = NULL; + } + + /* Attach to network stack */ + sc->ifp = if_alloc(IFT_ETHER); + sc->ifp->if_softc = sc; + + if_initname(sc->ifp, device_get_name(dev), device_get_unit(dev)); + sc->ifp->if_mtu = ETHERMTU; /* XXX max-frame-size from OF? */ + sc->ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + sc->ifp->if_hwassist = 0; /* XXX: ibm,illan-options */ + sc->ifp->if_capabilities = 0; + sc->ifp->if_capenable = 0; + sc->ifp->if_start = llan_start; + sc->ifp->if_ioctl = llan_ioctl; + sc->ifp->if_init = llan_init; + + IFQ_SET_MAXLEN(&sc->ifp->if_snd, LLAN_MAX_TX_PACKETS); + sc->ifp->if_snd.ifq_drv_maxlen = LLAN_MAX_TX_PACKETS; + IFQ_SET_READY(&sc->ifp->if_snd); + + ether_ifattach(sc->ifp, &sc->mac_address[2]); + + return (0); +} + +static void +llan_rx_load_cb(void *xsc, bus_dma_segment_t *segs, int nsegs, int err) +{ + struct llan_softc *sc = xsc; + + sc->rx_buf_phys = segs[0].ds_addr; + sc->rx_buf_len = segs[0].ds_len - 2*PAGE_SIZE; + sc->input_buf_phys = segs[0].ds_addr + segs[0].ds_len - PAGE_SIZE; + sc->filter_buf_phys = segs[0].ds_addr + segs[0].ds_len - 2*PAGE_SIZE; +} + +static void +llan_init(void *xsc) +{ + struct llan_softc *sc = xsc; + uint64_t rx_buf_desc; + uint64_t macaddr; + int err, i; + + mtx_lock(&sc->io_lock); + + phyp_hcall(H_FREE_LOGICAL_LAN, sc->unit); + + /* Create buffers (page 539) */ + sc->rx_dma_slot = 0; + sc->rx_valid_val = 1; + + rx_buf_desc = (1UL << 63); /* valid */ + rx_buf_desc |= (sc->rx_buf_len << 32); + rx_buf_desc |= sc->rx_buf_phys; + memcpy(&macaddr, sc->mac_address, 8); + err = phyp_hcall(H_REGISTER_LOGICAL_LAN, sc->unit, sc->input_buf_phys, + rx_buf_desc, sc->filter_buf_phys, macaddr); + + for (i = 0; i < LLAN_MAX_RX_PACKETS; i++) + llan_add_rxbuf(sc, &sc->rx_xfer[i]); + + phyp_hcall(H_VIO_SIGNAL, sc->unit, 1); /* Enable interrupts */ + + /* Tell stack we're up */ + sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + + mtx_unlock(&sc->io_lock); +} + +static int +llan_add_rxbuf(struct llan_softc *sc, struct llan_xfer *rx) +{ + struct mbuf *m; + bus_dma_segment_t segs[1]; + int error, nsegs; + + mtx_assert(&sc->io_lock, MA_OWNED); + + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return (ENOBUFS); + + m->m_len = m->m_pkthdr.len = m->m_ext.ext_size; + if (rx->rx_mbuf != NULL) { + bus_dmamap_sync(sc->rxbuf_dma_tag, rx->rx_dmamap, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->rxbuf_dma_tag, rx->rx_dmamap); + } + + /* Save pointer to buffer structure */ + m_copyback(m, 0, 8, (void *)&rx); + + error = bus_dmamap_load_mbuf_sg(sc->rxbuf_dma_tag, rx->rx_dmamap, m, + segs, &nsegs, BUS_DMA_NOWAIT); + if (error != 0) { + device_printf(sc->dev, + "cannot load RX DMA map %p, error = %d\n", rx, error); + m_freem(m); + return (error); + } + + /* If nsegs is wrong then the stack is corrupt. */ + KASSERT(nsegs == 1, + ("%s: too many DMA segments (%d)", __func__, nsegs)); + rx->rx_mbuf = m; + + bus_dmamap_sync(sc->rxbuf_dma_tag, rx->rx_dmamap, BUS_DMASYNC_PREREAD); + + rx->rx_bufdesc = (1UL << 63); /* valid */ + rx->rx_bufdesc |= (((uint64_t)segs[0].ds_len) << 32); + rx->rx_bufdesc |= segs[0].ds_addr; + error = phyp_hcall(H_ADD_LOGICAL_LAN_BUFFER, sc->unit, rx->rx_bufdesc); + if (error != 0) { + m_freem(m); + rx->rx_mbuf = NULL; + return (ENOBUFS); + } + + return (0); +} + +static void +llan_intr(void *xsc) +{ + struct llan_softc *sc = xsc; + struct llan_xfer *rx; + struct mbuf *m; + + mtx_lock(&sc->io_lock); + phyp_hcall(H_VIO_SIGNAL, sc->unit, 0); + + while ((sc->rx_buf[sc->rx_dma_slot].control >> 7) == sc->rx_valid_val) { + rx = (struct llan_xfer *)sc->rx_buf[sc->rx_dma_slot].handle; + m = rx->rx_mbuf; + m_adj(m, sc->rx_buf[sc->rx_dma_slot].offset - 8); + m->m_len = sc->rx_buf[sc->rx_dma_slot].length; + + /* llan_add_rxbuf does DMA sync and unload as well as requeue */ + if (llan_add_rxbuf(sc, rx) != 0) { + sc->ifp->if_ierrors++; + phyp_hcall(H_ADD_LOGICAL_LAN_BUFFER, sc->unit, + rx->rx_bufdesc); + continue; + } + + sc->ifp->if_ipackets++; + m_adj(m, sc->rx_buf[sc->rx_dma_slot].offset); + m->m_len = sc->rx_buf[sc->rx_dma_slot].length; + m->m_pkthdr.rcvif = sc->ifp; + m->m_pkthdr.len = m->m_len; + sc->rx_dma_slot++; + + if (sc->rx_dma_slot >= sc->rx_buf_len/sizeof(sc->rx_buf[0])) { + sc->rx_dma_slot = 0; + sc->rx_valid_val = !sc->rx_valid_val; + } + + mtx_unlock(&sc->io_lock); + (*sc->ifp->if_input)(sc->ifp, m); + mtx_lock(&sc->io_lock); + } + + phyp_hcall(H_VIO_SIGNAL, sc->unit, 1); + mtx_unlock(&sc->io_lock); +} + +static void +llan_send_packet(void *xsc, bus_dma_segment_t *segs, int nsegs, + bus_size_t mapsize, int error) +{ + struct llan_softc *sc = xsc; + uint64_t bufdescs[6]; + int i; + + bzero(bufdescs, sizeof(bufdescs)); + + for (i = 0; i < nsegs; i++) { + bufdescs[i] = (1UL << 63); /* valid */ + bufdescs[i] |= (((uint64_t)segs[i].ds_len) << 32); + bufdescs[i] |= segs[i].ds_addr; + } + + error = phyp_hcall(H_SEND_LOGICAL_LAN, sc->unit, bufdescs[0], + bufdescs[1], bufdescs[2], bufdescs[3], bufdescs[4], bufdescs[5], 0); +#if 0 + if (error) + sc->ifp->if_drv_flags |= IFF_DRV_OACTIVE; + + /* XXX: handle H_BUSY? */ + /* H_SEND_LOGICAL_LAN returning 0 implies completion of the send op */ +#endif +} + +static void +llan_start_locked(struct ifnet *ifp) +{ + struct llan_softc *sc = ifp->if_softc; + bus_addr_t first; + int nsegs; + struct mbuf *mb_head, *m; + + mtx_assert(&sc->io_lock, MA_OWNED); + first = 0; + + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) + return; + + while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { + IFQ_DRV_DEQUEUE(&ifp->if_snd, mb_head); + + if (mb_head == NULL) + break; + + BPF_MTAP(ifp, mb_head); + + for (m = mb_head, nsegs = 0; m != NULL; m = m->m_next) + nsegs++; + if (nsegs > 6) { + m = m_collapse(mb_head, M_NOWAIT, 6); + if (m == NULL) { + m_freem(mb_head); + continue; + } + } + + bus_dmamap_load_mbuf(sc->tx_dma_tag, sc->tx_dma_map, //xfer->dmamap, + mb_head, llan_send_packet, sc, 0); + bus_dmamap_unload(sc->tx_dma_tag, sc->tx_dma_map); // XXX + m_freem(mb_head); + } +} + +static void +llan_start(struct ifnet *ifp) +{ + struct llan_softc *sc = ifp->if_softc; + + mtx_lock(&sc->io_lock); + llan_start_locked(ifp); + mtx_unlock(&sc->io_lock); +} + +static int +llan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) +{ + int err; + + err = ether_ioctl(ifp, cmd, data); + + return (err); +} + From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 01:41:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 38A23F97; Sun, 20 Oct 2013 01:41:00 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 23C232D1A; Sun, 20 Oct 2013 01:41:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9K1f0Ae044293; Sun, 20 Oct 2013 01:41:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9K1exbj044291; Sun, 20 Oct 2013 01:40:59 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310200140.r9K1exbj044291@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 20 Oct 2013 01:40:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256779 - head/sys/powerpc/pseries X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 01:41:00 -0000 Author: nwhitehorn Date: Sun Oct 20 01:40:59 2013 New Revision: 256779 URL: http://svnweb.freebsd.org/changeset/base/256779 Log: Clean up some debug code that snuck in. Add a block comment on future work. Modified: head/sys/powerpc/pseries/phyp_llan.c Modified: head/sys/powerpc/pseries/phyp_llan.c ============================================================================== --- head/sys/powerpc/pseries/phyp_llan.c Sun Oct 20 01:31:09 2013 (r256778) +++ head/sys/powerpc/pseries/phyp_llan.c Sun Oct 20 01:40:59 2013 (r256779) @@ -381,15 +381,14 @@ llan_send_packet(void *xsc, bus_dma_segm bufdescs[i] |= segs[i].ds_addr; } - error = phyp_hcall(H_SEND_LOGICAL_LAN, sc->unit, bufdescs[0], + phyp_hcall(H_SEND_LOGICAL_LAN, sc->unit, bufdescs[0], bufdescs[1], bufdescs[2], bufdescs[3], bufdescs[4], bufdescs[5], 0); -#if 0 - if (error) - sc->ifp->if_drv_flags |= IFF_DRV_OACTIVE; - - /* XXX: handle H_BUSY? */ - /* H_SEND_LOGICAL_LAN returning 0 implies completion of the send op */ -#endif + /* + * The hypercall returning implies completion -- or that the call will + * not complete. In principle, we should try a few times if we get back + * H_BUSY based on the continuation token in R4. For now, just drop + * the packet in such cases. + */ } static void @@ -425,9 +424,9 @@ llan_start_locked(struct ifnet *ifp) } } - bus_dmamap_load_mbuf(sc->tx_dma_tag, sc->tx_dma_map, //xfer->dmamap, + bus_dmamap_load_mbuf(sc->tx_dma_tag, sc->tx_dma_map, mb_head, llan_send_packet, sc, 0); - bus_dmamap_unload(sc->tx_dma_tag, sc->tx_dma_map); // XXX + bus_dmamap_unload(sc->tx_dma_tag, sc->tx_dma_map); m_freem(mb_head); } } From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 11:10:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5D9A4B49; Sun, 20 Oct 2013 11:10:35 +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 1CEDB2274; Sun, 20 Oct 2013 11:10:34 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id BDB1E6D17; Sun, 20 Oct 2013 11:10:33 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 315B48FD; Sun, 20 Oct 2013 13:10:14 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Adrian Chadd Subject: Re: svn commit: r256768 - head/sbin/ifconfig References: <201310190959.r9J9xBI1036988@svn.freebsd.org> Date: Sun, 20 Oct 2013 13:10:14 +0200 In-Reply-To: (Adrian Chadd's message of "Sat, 19 Oct 2013 13:11:38 -0700") Message-ID: <86iowsdwq1.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 11:10:35 -0000 Adrian Chadd =20 > ... erm, this could break many existing scripts that stupidly(!) just > try adding an interface to a group to see if it's already there. Why would you do that instead of "ifconfig -g group | grep -w iface"? And is it really more important than being able to restart an interface? > Is the ifconfig error behavour in this instance documented anywhere? No. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 11:19:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6352AE5B; Sun, 20 Oct 2013 11:19:38 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 40D4D22FB; Sun, 20 Oct 2013 11:19:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KBJcQB055520; Sun, 20 Oct 2013 11:19:38 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KBJbEP055518; Sun, 20 Oct 2013 11:19:37 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201310201119.r9KBJbEP055518@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 20 Oct 2013 11:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256782 - in head/sys/dev/usb: . serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 11:19:38 -0000 Author: gavin Date: Sun Oct 20 11:19:37 2013 New Revision: 256782 URL: http://svnweb.freebsd.org/changeset/base/256782 Log: Add 26 new device IDs to uslcom(4). This brings us in sync with Linux v3.12 rc5. MFC after: 3 days Modified: head/sys/dev/usb/serial/uslcom.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/uslcom.c ============================================================================== --- head/sys/dev/usb/serial/uslcom.c Sun Oct 20 10:02:04 2013 (r256781) +++ head/sys/dev/usb/serial/uslcom.c Sun Oct 20 11:19:37 2013 (r256782) @@ -252,15 +252,37 @@ static const STRUCT_USB_HOST_ID uslcom_d USLCOM_DEV(JABLOTRON, PC60B), USLCOM_DEV(KAMSTRUP, OPTICALEYE), USLCOM_DEV(KAMSTRUP, MBUS_250D), + USLCOM_DEV(LAKESHORE, 121), + USLCOM_DEV(LAKESHORE, 218A), + USLCOM_DEV(LAKESHORE, 219), + USLCOM_DEV(LAKESHORE, 233), + USLCOM_DEV(LAKESHORE, 235), + USLCOM_DEV(LAKESHORE, 335), + USLCOM_DEV(LAKESHORE, 336), + USLCOM_DEV(LAKESHORE, 350), + USLCOM_DEV(LAKESHORE, 371), + USLCOM_DEV(LAKESHORE, 411), + USLCOM_DEV(LAKESHORE, 425), + USLCOM_DEV(LAKESHORE, 455A), + USLCOM_DEV(LAKESHORE, 465), + USLCOM_DEV(LAKESHORE, 475A), + USLCOM_DEV(LAKESHORE, 625A), + USLCOM_DEV(LAKESHORE, 642A), + USLCOM_DEV(LAKESHORE, 648), + USLCOM_DEV(LAKESHORE, 737), + USLCOM_DEV(LAKESHORE, 776), USLCOM_DEV(LINKINSTRUMENTS, MSO19), USLCOM_DEV(LINKINSTRUMENTS, MSO28), USLCOM_DEV(LINKINSTRUMENTS, MSO28_2), USLCOM_DEV(MEI, CASHFLOW_SC), USLCOM_DEV(MEI, S2000), + USLCOM_DEV(NETGEAR, M4100), USLCOM_DEV(OWEN, AC4), + USLCOM_DEV(OWL, CM_160), USLCOM_DEV(PHILIPS, ACE1001), USLCOM_DEV(PLX, CA42), USLCOM_DEV(RENESAS, RX610), + USLCOM_DEV(SEL, C662), USLCOM_DEV(SILABS, AC_SERV_CAN), USLCOM_DEV(SILABS, AC_SERV_CIS), USLCOM_DEV(SILABS, AC_SERV_IBUS), @@ -293,6 +315,7 @@ static const STRUCT_USB_HOST_ID uslcom_d USLCOM_DEV(SILABS, HELICOM), USLCOM_DEV(SILABS, IMS_USB_RS422), USLCOM_DEV(SILABS, INFINITY_MIC), + USLCOM_DEV(SILABS, INGENI_ZIGBEE), USLCOM_DEV(SILABS, INSYS_MODEM), USLCOM_DEV(SILABS, IRZ_SG10), USLCOM_DEV(SILABS, KYOCERA_GPS), @@ -300,6 +323,7 @@ static const STRUCT_USB_HOST_ID uslcom_d USLCOM_DEV(SILABS, LIPOWSKY_JTAG), USLCOM_DEV(SILABS, LIPOWSKY_LIN), USLCOM_DEV(SILABS, MC35PU), + USLCOM_DEV(SILABS, MMB_ZIGBEE), USLCOM_DEV(SILABS, MJS_TOSLINK), USLCOM_DEV(SILABS, MSD_DASHHAWK), USLCOM_DEV(SILABS, MULTIPLEX_RC), @@ -316,6 +340,7 @@ static const STRUCT_USB_HOST_ID uslcom_d USLCOM_DEV(SILABS, USBPULSE100), USLCOM_DEV(SILABS, USBSCOPE50), USLCOM_DEV(SILABS, USBWAVE12), + USLCOM_DEV(SILABS, V_PREON32), USLCOM_DEV(SILABS, VSTABI), USLCOM_DEV(SILABS, WAVIT), USLCOM_DEV(SILABS, WMRBATT), @@ -330,6 +355,7 @@ static const STRUCT_USB_HOST_ID uslcom_d USLCOM_DEV(VAISALA, CABLE), USLCOM_DEV(WAGO, SERVICECABLE), USLCOM_DEV(WAVESENSE, JAZZ), + USLCOM_DEV(WESTMOUNTAIN, RIGBLASTER_ADVANTAGE), USLCOM_DEV(WIENERPLEINBAUS, PL512), USLCOM_DEV(WIENERPLEINBAUS, RCM), USLCOM_DEV(WIENERPLEINBAUS, MPOD), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Oct 20 10:02:04 2013 (r256781) +++ head/sys/dev/usb/usbdevs Sun Oct 20 11:19:37 2013 (r256782) @@ -569,6 +569,7 @@ vendor FALCOM 0x0f94 Falcom Wireless Co vendor RIM 0x0fca Research In Motion vendor DYNASTREAM 0x0fcf Dynastream Innovations vendor LARSENBRUSGAARD 0x0fd8 Larsen and Brusgaard +vendor OWL 0x0fde OWL vendor KONTRON 0x0fe6 Kontron AG vendor QUALCOMM 0x1004 Qualcomm vendor APACER 0x1005 Apacer @@ -695,6 +696,7 @@ vendor QUALCOMMINC 0x19d2 Qualcomm, Inco vendor BAYER 0x1a79 Bayer vendor WCH2 0x1a86 QinHeng Electronics vendor STELERA 0x1a8d Stelera Wireless +vendor SEL 0x1adb Schweitzer Engineering Laboratories vendor CORSAIR 0x1b1c Corsair vendor MATRIXORBITAL 0x1b3d Matrix Orbital vendor OVISLINK 0x1b75 OvisLink @@ -715,6 +717,7 @@ vendor METAGEEK2 0x1dd5 MetaGeek vendor ALINK 0x1e0e Alink vendor AIRTIES 0x1eda AirTies vendor FESTO 0x1e29 Festo +vendor LAKESHORE 0x1fb9 Lake Shore Cryotronics, Inc. vendor VERTEX 0x1fe7 Vertex Wireless Co., Ltd. vendor DLINK 0x2001 D-Link vendor PLANEX2 0x2019 Planex Communications @@ -730,6 +733,7 @@ vendor VIALABS 0x2109 VIA Labs vendor ERICSSON 0x2282 Ericsson vendor MOTOROLA2 0x22b8 Motorola vendor WETELECOM 0x22de WeTelecom +vendor WESTMOUNTAIN 0x2405 West Mountain Radio vendor TRIPPLITE 0x2478 Tripp-Lite vendor HIROSE 0x2631 Hirose Electric vendor NHJ 0x2770 NHJ @@ -2487,6 +2491,27 @@ product KYOCERA2 KPC680 0x180a Qualcomm product LACIE HD 0xa601 Hard Disk product LACIE CDRW 0xa602 CD R/W +/* Lake Shore Cryotronics products */ +product LAKESHORE 121 0x0100 121 Current Source +product LAKESHORE 218A 0x0200 218A Temperature Monitor +product LAKESHORE 219 0x0201 219 Temperature Monitor +product LAKESHORE 233 0x0202 233 Temperature Transmitter +product LAKESHORE 235 0x0203 235 Temperature Transmitter +product LAKESHORE 335 0x0300 335 Temperature Controller +product LAKESHORE 336 0x0301 336 Temperature Controller +product LAKESHORE 350 0x0302 350 Temperature Controller +product LAKESHORE 371 0x0303 371 AC Bridge +product LAKESHORE 411 0x0400 411 Handheld Gaussmeter +product LAKESHORE 425 0x0401 425 Gaussmeter +product LAKESHORE 455A 0x0402 455A DSP Gaussmeter +product LAKESHORE 475A 0x0403 475A DSP Gaussmeter +product LAKESHORE 465 0x0404 465 Gaussmeter +product LAKESHORE 625A 0x0600 625A Magnet PSU +product LAKESHORE 642A 0x0601 642A Magnet PSU +product LAKESHORE 648 0x0602 648 Magnet PSU +product LAKESHORE 737 0x0700 737 VSM Controller +product LAKESHORE 776 0x0701 776 Matrix Switch + /* Larsen and Brusgaard products */ product LARSENBRUSGAARD ALTITRACK 0x0001 FTDI compatible adapter @@ -3086,6 +3111,7 @@ product NETGEAR EA101 0x1001 Ethernet product NETGEAR EA101X 0x1002 Ethernet product NETGEAR FA101 0x1020 Ethernet 10/100, USB1.1 product NETGEAR FA120 0x1040 USB 2.0 Ethernet +product NETGEAR M4100 0x1100 M4100/M5300/M7100 series switch product NETGEAR WG111V2_2 0x4240 PrismGT USB 2.0 WLAN product NETGEAR WG111V3 0x4260 WG111v3 product NETGEAR WG111U 0x4300 WG111U @@ -3250,6 +3276,9 @@ product OTI DKU5 0x6858 DKU-5 Serial /* Owen.ru products */ product OWEN AC4 0x0004 AC4 USB-RS485 converter +/* OWL producs */ +product OWL CM_160 0xca05 OWL CM-160 power monitor + /* Palm Computing, Inc. product */ product PALM SERIAL 0x0080 USB Serial product PALM M500 0x0001 Palm m500 @@ -3696,6 +3725,9 @@ product SANYO SCP4900 0x0701 Sanyo SCP product SCANLOGIC SL11R 0x0002 SL11R IDE Adapter product SCANLOGIC 336CX 0x0300 Phantom 336CX - C3 scanner +/* Schweitzer Engineering Laboratories products */ +product SEL C662 0x0001 C662 Cable + /* Sealevel products */ product SEALEVEL 2101 0x2101 FTDI compatible adapter product SEALEVEL 2102 0x2102 FTDI compatible adapter @@ -3936,8 +3968,11 @@ product SILABS BEI_VCP 0x846e BEI USB S product SILABS BALLUFF_RFID 0x8477 Balluff RFID reader product SILABS AC_SERV_IBUS 0x85ea AC-Services IBUS Interface product SILABS AC_SERV_CIS 0x85eb AC-Services CIS-IBUS +product SILABS V_PREON32 0x85f8 Virtenio Preon32 product SILABS AC_SERV_CAN 0x8664 AC-Services CAN Interface product SILABS AC_SERV_OBD 0x8665 AC-Services OBD Interface +product SILABS MMB_ZIGBEE 0x88a4 MMB Networks ZigBee +product SILABS INGENI_ZIGBEE 0x88a5 Planet Innovation Ingeni ZigBee product SILABS CP2102 0xea60 SILABS USB UART product SILABS CP210X_2 0xea61 CP210x Serial product SILABS CP210X_3 0xea70 CP210x Serial @@ -4327,6 +4362,9 @@ product WCH2 CH341SER_2 0x5523 CH341/CH product WCH2 CH341SER 0x7523 CH341/CH340 USB-Serial Bridge product WCH2 U2M 0X752d CH345 USB2.0-MIDI +/* West Mountain Radio products */ +product WESTMOUNTAIN RIGBLASTER_ADVANTAGE 0x0003 RIGblaster Advantage + /* Western Digital products */ product WESTERN COMBO 0x0200 Firewire USB Combo product WESTERN EXTHDD 0x0400 External HDD From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 13:41:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 18ADB6D; Sun, 20 Oct 2013 13:41:43 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 04FFA2911; Sun, 20 Oct 2013 13:41:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KDfgWa033771; Sun, 20 Oct 2013 13:41:42 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KDfg87033770; Sun, 20 Oct 2013 13:41:42 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201310201341.r9KDfg87033770@svn.freebsd.org> From: Antoine Brodin Date: Sun, 20 Oct 2013 13:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256787 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 13:41:43 -0000 Author: antoine Date: Sun Oct 20 13:41:42 2013 New Revision: 256787 URL: http://svnweb.freebsd.org/changeset/base/256787 Log: Add more obsolete files Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Oct 20 12:59:54 2013 (r256786) +++ head/ObsoleteFiles.inc Sun Oct 20 13:41:42 2013 (r256787) @@ -271,6 +271,7 @@ OLD_FILES+=usr/share/man/man8/dnssec-key OLD_FILES+=usr/share/man/man8/dnssec-revoke.8.gz OLD_FILES+=usr/share/man/man8/dnssec-settime.8.gz OLD_FILES+=usr/share/man/man8/dnssec-signzone.8.gz +OLD_FILES+=usr/share/man/man8/dnssec-verify.8.gz OLD_FILES+=usr/share/man/man8/genrandom.8.gz OLD_FILES+=usr/share/man/man8/isc-hmac-fixup.8.gz OLD_FILES+=usr/share/man/man8/lwresd.8.gz @@ -305,6 +306,8 @@ OLD_DIRS+=var/named/var/run OLD_DIRS+=var/named/var/run/named OLD_DIRS+=var/named/var/stats OLD_DIRS+=var/run/named +# 20130923: example moved +OLD_FILES+=usr/share/examples/bsdconfig/browse_packages.sh # 20130908: libssh becomes private OLD_FILES+=usr/lib/libssh.a OLD_FILES+=usr/lib/libssh.so From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 14:01:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 203AF4B6; Sun, 20 Oct 2013 14:01:10 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F33702A31; Sun, 20 Oct 2013 14:01:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KE19pU043746; Sun, 20 Oct 2013 14:01:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KE19mj043744; Sun, 20 Oct 2013 14:01:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310201401.r9KE19mj043744@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 20 Oct 2013 14:01:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256788 - head/sys/powerpc/pseries X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 14:01:10 -0000 Author: nwhitehorn Date: Sun Oct 20 14:01:09 2013 New Revision: 256788 URL: http://svnweb.freebsd.org/changeset/base/256788 Log: Add multicast filter control. Modified: head/sys/powerpc/pseries/phyp_llan.c Modified: head/sys/powerpc/pseries/phyp_llan.c ============================================================================== --- head/sys/powerpc/pseries/phyp_llan.c Sun Oct 20 13:41:42 2013 (r256787) +++ head/sys/powerpc/pseries/phyp_llan.c Sun Oct 20 14:01:09 2013 (r256788) @@ -60,6 +60,11 @@ __FBSDID("$FreeBSD$"); #define LLAN_MAX_TX_PACKETS 100 #define LLAN_RX_BUF_LEN 8*PAGE_SIZE +#define LLAN_BUFDESC_VALID (1ULL << 63) +#define LLAN_ADD_MULTICAST 0x1 +#define LLAN_DEL_MULTICAST 0x2 +#define LLAN_CLEAR_MULTICAST 0x3 + struct llan_xfer { struct mbuf *rx_mbuf; bus_dmamap_t rx_dmamap; @@ -113,6 +118,7 @@ static int llan_ioctl(struct ifnet *ifp, static void llan_rx_load_cb(void *xsc, bus_dma_segment_t *segs, int nsegs, int err); static int llan_add_rxbuf(struct llan_softc *sc, struct llan_xfer *rx); +static int llan_set_multicast(struct llan_softc *sc); static devclass_t llan_devclass; static device_method_t llan_methods[] = { @@ -249,7 +255,7 @@ llan_init(void *xsc) sc->rx_dma_slot = 0; sc->rx_valid_val = 1; - rx_buf_desc = (1UL << 63); /* valid */ + rx_buf_desc = LLAN_BUFDESC_VALID; rx_buf_desc |= (sc->rx_buf_len << 32); rx_buf_desc |= sc->rx_buf_phys; memcpy(&macaddr, sc->mac_address, 8); @@ -307,7 +313,7 @@ llan_add_rxbuf(struct llan_softc *sc, st bus_dmamap_sync(sc->rxbuf_dma_tag, rx->rx_dmamap, BUS_DMASYNC_PREREAD); - rx->rx_bufdesc = (1UL << 63); /* valid */ + rx->rx_bufdesc = LLAN_BUFDESC_VALID; rx->rx_bufdesc |= (((uint64_t)segs[0].ds_len) << 32); rx->rx_bufdesc |= segs[0].ds_addr; error = phyp_hcall(H_ADD_LOGICAL_LAN_BUFFER, sc->unit, rx->rx_bufdesc); @@ -376,7 +382,7 @@ llan_send_packet(void *xsc, bus_dma_segm bzero(bufdescs, sizeof(bufdescs)); for (i = 0; i < nsegs; i++) { - bufdescs[i] = (1UL << 63); /* valid */ + bufdescs[i] = LLAN_BUFDESC_VALID; bufdescs[i] |= (((uint64_t)segs[i].ds_len) << 32); bufdescs[i] |= segs[i].ds_addr; } @@ -442,11 +448,50 @@ llan_start(struct ifnet *ifp) } static int +llan_set_multicast(struct llan_softc *sc) +{ + struct ifnet *ifp = sc->ifp; + struct ifmultiaddr *inm; + uint64_t macaddr; + + mtx_assert(&sc->io_lock, MA_OWNED); + + phyp_hcall(H_MULTICAST_CTRL, sc->unit, LLAN_CLEAR_MULTICAST, 0); + + if_maddr_rlock(ifp); + TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) { + if (inm->ifma_addr->sa_family != AF_LINK) + continue; + + memcpy((uint8_t *)&macaddr + 2, + LLADDR((struct sockaddr_dl *)inm->ifma_addr), 6); + phyp_hcall(H_MULTICAST_CTRL, sc->unit, LLAN_ADD_MULTICAST, + macaddr); + } + if_maddr_runlock(ifp); + + return (0); +} + +static int llan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - int err; + int err = 0; + struct llan_softc *sc = ifp->if_softc; - err = ether_ioctl(ifp, cmd, data); + switch (cmd) { + case SIOCADDMULTI: + case SIOCDELMULTI: + mtx_lock(&sc->io_lock); + if ((sc->ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + llan_set_multicast(sc); + mtx_unlock(&sc->io_lock); + break; + case SIOCSIFFLAGS: + default: + err = ether_ioctl(ifp, cmd, data); + break; + } return (err); } From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 15:13:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 518FE5F5; Sun, 20 Oct 2013 15:13:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3EF8E2D8E; Sun, 20 Oct 2013 15:13:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KFDXBv082573; Sun, 20 Oct 2013 15:13:33 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KFDXMw082572; Sun, 20 Oct 2013 15:13:33 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201310201513.r9KFDXMw082572@svn.freebsd.org> From: Andrew Turner Date: Sun, 20 Oct 2013 15:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256790 - head/contrib/binutils/gas/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 15:13:33 -0000 Author: andrew Date: Sun Oct 20 15:13:32 2013 New Revision: 256790 URL: http://svnweb.freebsd.org/changeset/base/256790 Log: Merge from projects/arm_eabi_vfp r255380: Fix the VCVT instruction. It must round towards zero when converting from a floating-point to an integer value. This was not the case causing issues when printing certain values. There is a VCVTR instruction that will round depending on the current rounding mode. We don't yet support this instruction, or setting the rounding mode. Modified: head/contrib/binutils/gas/config/tc-arm.c Modified: head/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- head/contrib/binutils/gas/config/tc-arm.c Sun Oct 20 14:52:14 2013 (r256789) +++ head/contrib/binutils/gas/config/tc-arm.c Sun Oct 20 15:13:32 2013 (r256790) @@ -12660,14 +12660,14 @@ do_vfp_nsyn_cvt (enum neon_shape rs, int /* Conversions without bitshift. */ const char *enc[] = { - "ftosis", - "ftouis", + "ftosizs", + "ftouizs", "fsitos", "fuitos", "fcvtsd", "fcvtds", - "ftosid", - "ftouid", + "ftosizd", + "ftouizd", "fsitod", "fuitod" }; From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 15:24:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D3123A3C; Sun, 20 Oct 2013 15:24:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BC6242E2C; Sun, 20 Oct 2013 15:24:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KFOj7P088479; Sun, 20 Oct 2013 15:24:45 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KFOjaL088475; Sun, 20 Oct 2013 15:24:45 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201310201524.r9KFOjaL088475@svn.freebsd.org> From: Navdeep Parhar Date: Sun, 20 Oct 2013 15:24:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256791 - in stable/10/sys: conf dev/cxgbe dev/cxgbe/common dev/cxgbe/firmware dev/cxgbe/tom modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 15:24:45 -0000 Author: np Date: Sun Oct 20 15:24:44 2013 New Revision: 256791 URL: http://svnweb.freebsd.org/changeset/base/256791 Log: MFC r256459. cxgbe(4): Update T4 and T5 firmwares to 1.9.12.0 Approved by: re (glebius) Added: stable/10/sys/dev/cxgbe/firmware/t4fw-1.9.12.0.bin.uu - copied unchanged from r256459, head/sys/dev/cxgbe/firmware/t4fw-1.9.12.0.bin.uu stable/10/sys/dev/cxgbe/firmware/t5fw-1.9.12.0.bin.uu - copied unchanged from r256459, head/sys/dev/cxgbe/firmware/t5fw-1.9.12.0.bin.uu Deleted: stable/10/sys/dev/cxgbe/firmware/t4fw-1.8.11.0.bin.uu stable/10/sys/dev/cxgbe/firmware/t5fw-1.8.22.0.bin.uu Modified: stable/10/sys/conf/files stable/10/sys/dev/cxgbe/common/common.h stable/10/sys/dev/cxgbe/firmware/t4fw_cfg.txt stable/10/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt stable/10/sys/dev/cxgbe/firmware/t4fw_interface.h stable/10/sys/dev/cxgbe/firmware/t5fw_cfg.txt stable/10/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt stable/10/sys/dev/cxgbe/t4_main.c stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c stable/10/sys/modules/cxgbe/t4_firmware/Makefile stable/10/sys/modules/cxgbe/t5_firmware/Makefile Directory Properties: stable/10/sys/ (props changed) stable/10/sys/conf/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Sun Oct 20 15:13:32 2013 (r256790) +++ stable/10/sys/conf/files Sun Oct 20 15:24:44 2013 (r256791) @@ -1199,7 +1199,7 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.8.11.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.9.12.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t4fw.fw" @@ -1223,7 +1223,7 @@ t5fw.fwo optional cxgbe \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.8.22.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.9.12.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t5fw.fw" Modified: stable/10/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/10/sys/dev/cxgbe/common/common.h Sun Oct 20 15:13:32 2013 (r256790) +++ stable/10/sys/dev/cxgbe/common/common.h Sun Oct 20 15:24:44 2013 (r256791) @@ -246,7 +246,7 @@ struct pci_params { * Firmware device log. */ struct devlog_params { - u32 memtype; /* which memory (EDC0, EDC1, MC) */ + u32 memtype; /* which memory (FW_MEMTYPE_* ) */ u32 start; /* start of log in firmware memory */ u32 size; /* size of log */ }; Copied: stable/10/sys/dev/cxgbe/firmware/t4fw-1.9.12.0.bin.uu (from r256459, head/sys/dev/cxgbe/firmware/t4fw-1.9.12.0.bin.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/cxgbe/firmware/t4fw-1.9.12.0.bin.uu Sun Oct 20 15:24:44 2013 (r256791, copy of r256459, head/sys/dev/cxgbe/firmware/t4fw-1.9.12.0.bin.uu) @@ -0,0 +1,8705 @@ +/*- + * Copyright (c) 2013 Chelsio Communications, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE 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. + */ +begin-base64 644 t4fw +AAADxgEJDAAAAQkBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAA6sDugPBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAENoZWxzaW8gRlcgUlVOTUVNIERFQlVHPTAgKEJ1aWx0IEZyaSBPY3QgMTEgMjM6 +MDY6MDEgUERUIDIwMTMgb24gY2xlb3BhdHJhLmFzaWNkZXNpZ25lcnMuY29tOi9ob21lL2Zpcm13 +YXJlL2N2cy9mdy1yZWxlYXNlKSwgVmVyc2lvbiBUNHh4IDAxLjA5LjBjLjAwAAAAAAAAAJW7pA1g +AMgA4QB78AAQAADhADC4eP///x/84UCAAAAB4QB7cAAAEAAf//vg4QGUcCAAAADhAZwE4QB5AAAC +AEDhAHmAAAYAQAACAAoABgAK4QB5BAAKAACAAAEC4QB7POEAe0ThAHvk4gAAAAABAADhAHuQIAAA +AAAAgADhAHsAAABAAeEAe5wAAEAAREREQuAAAADjAARzREREQOMACAAgAAJcAAAAAB//kYAAAAAA +H/+RhAAAAAAf/5GIAAAAAB//kYwf/8AAAAAAAAAAAADAABL/zRP/zZMgEv/NE//NhCAEMwGTIBH/ +zBL/zJIQEf/MEv/MkhAR/8wB9DER/8siCv+SEADkMQAFMQECABL/yALnMQIWABH/x4EQAQFfwCEC +EQHJERH/xBL/xJIQEf/EEv/EkhBgAA8R/78S/8OSEBH/vxL/wpIQgRAR/8HAIJIREv/AkhLAIJIT +Ev+/khCCEALyUGUv9xH/vccvkhAR/7ySEBL/vBP/vJMgwDKTIRP/u5MigiIS/7oT/7qTICMiIRT/ +uQQzAck4E/+4gzADgxQIMxEU/7akM5MhE/+qkyJgAAjCMJMhE/+nkyIS/7GQIJAhkCKQI5AkkCWQ +JpAnkCiQKZAqkCuQLJAtkC6QLyAmECAmEYIiEv+kwDAtNzAtNzQtNzgtNzwjPQFyM+0AAgAS/6HA +MC83AC83EC83IC83MCM9AXIz7QACABL/l8AwKDcwKDc0KDc4KDc8Iz0BcjPtAwIAEv+UIwoAJzcA +JzcQJzcgJzcwIz0BcjPtAwIAEv+OFf+PFv+PwDDXIAVmAWAAEgQ2BQACANMP0w8FMwxuOxQHRxQH +BEN2MeYENgUFMwxvO+0AAgAS/4MV/4EjCgACJwIHBEMEPgUFMwwHRxRvO/ADAgAS/33JLoMghCGF +IrwidDsOhlC0VZYwtDN0M/Rj/+YAZT/iZV/fEv9xwDIDLgUDAgAS/2jAMCg3QCg3RCg3SCg3TCM9 +AXIz7QMCAAACABL/ay0nAMARAUkxAEgxAQIAwAAU/2cE0jEV/2aUUBT/ZgTTMRX/ZpRQFP9lBNQx +Ff9llFAU/2UE1TEV/2SUUBD/ZAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/AAA +H/wAAOMACfgf/AAAH/wAAOMACfgf/AAAH/wAAOMACfgf/4AAH/+J4OMACfgf/4ngH/+J4OMAE9gf +/4ngH/+J4OMAE9gf/4ngH/+LYOMAE9gf/4tgH/+ReOMAFVgf/5GAH/+ufOMAG3gf/658H/+ufOMA +OHQf/8AAH//83eMAOHQgAAAAIAABauMAdVQgAAF4IAABfOMAdsAgAAF8IAABheMAdsQgAAGYIAAB +nOMAdtAgAAGcIAABpeMAdtQgAAG4IAABvOMAduAgAAG8IAABxeMAduQgAAHYIAAB2OMAdvAgAAHc +IAAB4uMAdvAgAAH4IAAB+OMAdvggAAH8IAAB/OMAdvggAAIYIAACGOMAdvggAAIcIAACHOMAdvgg +AAI4IAACOOMAdvggAAI8IAACPOMAdvggAAJYIAACWOMAdvggAAJcIAACYuMAdvggAAJ4IAACeOMA +dwAgAAJ8IAACguMAdwAgAAKYIAG3deMAdwggAoAAIAKTOOMCK+ggApM4IAKTOOMCPyAgApM4IAYV +IOMCPyAgBhUgIAYZ4OMFwQggBoAAIAaNEOMFxcggBo0QIAeBkuMF0tggB4GgIAeCbOMGx2ggCMAA +IAjAAOMGyDQgCMAAIAjAAOMGyDQgCMAAIAlLz+MGyDQAAAAAAAAAAAAAAAAgAA/WIAAPyCAAE+Eg +AA/IIAATTSAAD8ggABB9IAAS5SAAEmogAA/IIAASGSAAEcogABFdIAAPtSAAEQcgAA/IIAAPyCAA +D8ggABCdAAAAAP///////w/8///w////APwgAJSTIACV0yAAlgMgAJXJIACViSAAlX8gAJVEIACV +OiAAlTAgAJTgIACWASAAlNYgAJS8AAAAAAAAAAAAAAAAAAAACgAAAAoAAAAUAAAACgAAAAoAAAAK +AAAACgAAAAoAAAAKAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAIAAwAEAAUABgAHAAgA +CQAKAA4AEQAVABkAHgAjAC0APABQAGQAyAEsAZAB9AAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAgAC +AAMAAwADAAMABAAEAAQABAAEAAUABQAFAAUABQAFAAYABgAHAAcAAAACAAAABgAAAAoAAAAOAAAA +FAAAABwAAAAoAAAAOAAAAFAAAABwAAAAoAAAAOAAAAFAAAABwAAAAoAAAAOAAAAFAQAABwAAAAoA +AAAOAAAAFAAAABwAAAAoAAAAOAAAAFAAAABwAAAAoAAAAOAAAAFAAAABwAAAAoAAAAOAAP8AAQIC +AAAAAAAAAAAAAAAgBwpHIAcINCAHC2cgBws3IAcLByAHCtcgBwqnIAcKdxAgQAAAAAAAAAAAAAAA +AAAEAAIAAQAAgABAACAAEAAIIECAAAAAAAAAAAAAAAAAACAHFCMgBxQjIAcTsSAHE3ggBxKnIAcS +jSAHEo0gBxQjIAcUIyAHEo0gBxJzIAcScyAHFCMgBxQjIAcSOiAHFCMgBxQjIAcUIyAHFCMgBxQj +IAcUIyAHFCMgBxQjIAcUIyAHFCMgBxQjIAcUIyAHFCMgBxQjIAcUIyAHFCMgBxJPIAKK6AAAAAEg +AorsAAAAAiACjZgAAAD/IAKJGAAAAP8gAokYAAAAACACjZgAAAAAIAKKEAAAAAEgAooYAAAABCAC +iiAAAAAIIAKKLAAAACAgAoo8AAAAQCACikQAAACAIAKKTAAAAQAgAopUAAACACACimgAAAQAIAKK +fAAACAAgAoqUAAAQACACiqgAACAAIAKKuAAAQAAgAorEAACAACACitgAAQAAAAAAAAAAAAAgAon8 +AAAAECACigQAAAARIAKJfAAAAQAgAomIAAAAgCACiZgAAABAIAKJqAAAACAgAom4AAAAECACicgA +AAAIIAKJ1AAAAAQgAongAAAAAiACiewAAAABAAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAQAA +AAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAABwAAAAcAAAAGAAAA +BgAMNQAAEEaqABRYVQAYagAAACtoAAAjgwAAGGoAAA0GAAALKgAAAAAAAAAAAAAAAAAAaCsAAGgr +AABsggAAb5wAAEpoAABKaAAATSkAAEpoAABO6gAATJgAAFI9AABPuAABhqAAAYagAAII1gACCNYA +AgjVAAII1QACiwsAAosLAAII1QACtnIAArZyAAMNQAAEBgcAAAAAAAAAAAAAAAAgB27IIAdupiAH +bsMgB27DIAdupiAHbqYgB27IIAduyCAHbqYgB27IIAdupiAHbsggB27DIAdupiAHbqYgB26mIAdu +piAHbqYgB27IIAdupiAHbqYgB26mIAdupiAHbqYAAgIFBQgICwsODhERFBQXFxoaHR0gICMjJiYp +KSwsLy8yMjU1ODg7OwAAAAAAAAABAxERCAgQCQMBAAAAAAAAIARCHCABd1AgADc4IAFMgCABctQg +AWxgIAEtSCADbmwf/+rAH//mkCAAlpQf/9rEIABe8CAAUUgAAAAAAAAAACABTgAgAH6oAAAAAAAA +AAAf/9TcH//GCB//w+gf/8GYIABMwCAARNQgAEIIIACNXB//32wgBeggAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACABfkAgAV14IACfgCAAnrAf/+/AH//QBB//y0AgAHwU +IASd4CABDqAgAO8YIADYoCAA0hAgAMNAIAC2BCAAojggBEXMIAONNCABAyQgA61YIAGmlCAAXrAA +AAAAIACf3CAFBKQgAJQIIAFWGCAAApggAIdEAAAAAAAAAAAf//LwIACfoCADj+QAAAAAAAAAACAD +EXAgACaQIAAb0CAAJWQAAAAAIAAxtCAALyggACtwAAAAACAANvggAQbgAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAIAA0ACAEQbwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAACAANbAgAxhcIAA0uAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAgLAAAAIAKQjAgAAAAg +ApCYCAAAACACkKQKAAAAIAKQsAwAAAAgApC8EgAAACACkMwNAAAAIAKQ4A4AAAAgApDwEwAAACAC +kQAKAAAAIAKRFA4AAAAgApEgGAAAACACkTANAAAAIAKRTA4AAAAgApFcEAAAACACkWwSAAAAIAKR +gA4AAAAgApGUEAAAACACkaQRAAAAIAKRuAoAAAAgApHMCwAAACACkdgNAAAAIAKR5BQAAAAgApH0 +CgAAACACkgwPAAAAIAKSGAYAAAAgApIoBgAAACACkjAGAAAAIAKSOAYAAAAgApJABgAAACACkkgJ +AAAAIAKSUAYAAAAgApJcBAAAACACkmQGAAAAIAKSbAsAAAAgApJ0CwAAACACkoAEAAAAIAKSZAQA +AAAgApKMCQAAACACkpQJAAAAIAKSoAAAAAAAAAAADQAAACACkqwKAAAAIAKSvAYAAAAgApLIAgAA +ACACktADAAAAIAKQiAEAAAAgApLUAAAAAAAAAADXaqR46Me3ViQgcNvBvc7u9XwPr0eHxiqoMEYT +/UaVAWmAmNiLRPev//9bsYlc175rkBEi/Zhxk6Z5Q45JtAgh9h4lYsBAs0AmXlpR6bbHqtYvEF0C +RBRT2KHmgefT+8gh4c3mwzcH1vTVDYdFWhTtqePpBfzvo/hnbwLZjSpMiv/6OUKHcfaBbZ1hIv3l +OAykvupES97Pqfa7S2C+v7xwKJt+xuqhJ/rU7zCFBIgdBdnU0Dnm25nlH6J8+MSsVmX0KSJEQyr/ +l6uUI6f8k6A5ZVtZw48MzJL/7/R9hYRd0W+ofk/+LObgowFDFE4IEaH3U36CvTryNSrX0rvrhtOR +BwwRFgcMERYHDBEWBwwRFgUJDhQFCQ4UBQkOFAUJDhQECxAXBAsQFwQLEBcECxAXBgoPFQYKDxUG +Cg8VBgoPFR//wAAABAAgIAYZ4CAGHUAEQQAIBAEACB//qwCBAAAAMAAAAB//nuClAAAAwAAAAMAE +AAAf/N4AIAYaEB//nvADgAAAAP/4AAEAAAAAEAAAgQQBAIEEAAABBAAAAQQBAIAAAAAABf//H/+F +EAYAAAAqAAAAH//PMCADx1wCAAAAgBAAAEFAAABBQAEAgwAAAf//v/8f/5bcBAAACCACi4CBgAAA +DAAAAB//nVgf/5HQ//8AAP//AP8f/5JwAAAPIB//m9Af/5xYH/+hfB/84gAf/6DwH/+hdB/84ODg +//4AH/+XSA////8A////H/+bOB//l8wf/54IH/+dFB//nYAAAA2QAAD/gCAGFSAgCRRQ4QAuAB// +nXQAAAw44QGSAB//nkQf/50E4AAAoOEAMLgAAIAA4QBgEAAAQADhAhAA4QIwAOECUADhAnAA4QAQ +CB/84UDhAHtwH/+uPB//rjQf/OAIH/+uOB//rlQf/65MH/+uUB//rmwf/65kH/+uaB//qwAgBhoQ +H/zeAAEAAAAf/5vQH/+bQAQAAAgFAAAAg/8AAIEAAAAAEAAAKgAAACAABkwgAorYH/+JIB//hRAf +/57wZ0UjAe/Nq4mYutz+EDJUdh//gAAgCMbAAAA/KCAIxhAgCMawIAjG4CAIxSAgApCIz////yAI +xVAgCMWgIAjF0BAAAAAgCMYwP////wIAAABAAAAAIAjGcP//f/8gCMkAH/+e4CAAIUAgCMmwCAAA +AAD///8gCMoQIAjJMPf///8gCNCwIAAdGP/+//8gCNdAACAAAAAAQAAMAAAAIAjXgAAA//8gCNfA +AACAAA0AAAAgACQY//v//w/2gAAAA///AAAn/yAI2zAgCNsAAAEAAAAEAAAfgAA/IAAxtCAAM7wg +AC8oIAjbsCAI3DAgACtwIAjcgCAI3PAgCN0gBAEACOAAAAAf/5xMIAjdkCAI3bAgCN1QUwAAAFIA +AABRAAAAIAGwFB//myAgCOBgIAjgwCAI4JAgCOFAH/+cYCADKjwf/5tQIAjisBQAAACAAAAAgAAA +AngAAACAAAAGgACwAAAACgAA4zCS///wAIAAsQDhAZoAAAIAACAI4nAf/5kMAAB+QAD/wAAf/5xQ +H/+SZCgAAAAmAAAAH/+R0B//koAGAAAABYAAAB//mogrAAAAIABH+DUAAAADgAAAAwAAAB//mowH +////AD///4BAAAAID///H////yAAAAAf/5w0PQAAAB//l4QHAAAAgQQBAIEEAAAAADqYwwAAABgA +AAAf/5LAAAAP/wBDAAAf/5wYAAAIAAQAAAAgCSSgH/+tsB//qyAf/5bcAAYAAOEAegAf/5dEIKAA +AB//mygf/5y0H/+cwB//mzggCSTQAAMHgCAJJUAf/5oIAEAAAAAACQAAADAC//z4f8AAAACj/7sA +o/+6AOADAACD/7YAD////w//+AD/AAAAIAklgCAI5hAgCOZAIAkmEAAPAAAACgAA//8ADwP/wACD +/8AAIAkmkCAJJwAf/5zwH/ziAB//oXwAAA04H/+rkP9g8AAf/6twH/+hgB//kZAEgAAIH/+AUABE +AAD/H///AMAAAAAADjwAAIEAH/ziDIGAAADuAAAADwAAAP//AAAf/5xUH/+heB/84ggf/5eAH/+A +YCAGF/AAADAAAAAnEB//2dgAAP/+H/+bEN6tvu80AAAAPwAAAAAAiQYAmQAAH/+q2BAABwIBwIAA +H/+pqJkAAAAf/6uUAIgACIKAAAEf/6soH/+qNAMVAAADEQAAAA8D/yAI6wAgCOwAIAjrQCAI64Ag +COwwIAjsYCAI7LAgCO1AIAjtECAAzIQpAAAAIADTrCAJLvAgCS8wIAkvYPDw8PD/AP8AqqqqqszM +zMwf/62gAAAb0B//q6ggAOPwIAkv8CAJMDAgCTBgAA9CQCADs2Af/5z4AAkAAACAAAAAAEgAggAA +ACABBuggCTDgIAkxICAJMVAACQAIH/+qnDAAAAAf/6roH/+cPAAACAYAAIjMAACJFH8AAADwAAAA +IAkz4CAJNHAAAOAAIAkyYCAJNEAf/5kEH/zgdAAEA/8KAAAAH/+pxB//qoQf/5rQg/+3AIP/tiAg +CPMwMwAAAOEAAAAf/6m0H/+beB//qvAD/+AAAD/2kAAAGxgD//AAAAAbIBoAAAAf/5rAIAjzcCAB +RCAf/6rsAA///wAA3q0f/6qgH/+cWCAGFSAf/5rYH/+czCAAYxAgAAXoH/+Y9B//lxAgCTWQH/+g +VCAJNeDABAAAIAKMECAAY/AAgQAA4AEAAADgAQAAAOABIAk3ICAI9hAAAA5EIACRrCAAjzQgCTag +IAk28B//mSggCPmw4P/+ACAJFuAf/6GMIAkA4B//nEgf/5PAIAkLECAJC6AgCQ5QIAkOgEgAAAAg +AYY4H/+cJCABiCwf/5dIH/+cDOEALgAf/5vs4QBeAOECDgD//7//4QAOAOEBjgD//77/H/+dFAAA +DDgf/55YH/+eVAAADnAAAP+AH/+eTB//nrgf/5sUIAGMnCABlmTgBQAAA/8AAP+///88AAAAAAX/ +/4MAAAAgAaoAH/+dtAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYAAAAAAAAAf//mwH//5sB//+XQf +//l0H//5dB//+XQf//RgH//3PB//9Zgf//WYH//1mCAF6hgAAAAAAAAAAAAAAAAAAAAAIAXwuCAF +8LgAAAAAAAAAAAAAAAAAAAAAIAGPUCAF6hgf//g0H//4NB//+DQf//g0H//4NB//+DQAAAAAH//0 +aAAAAAAAAAAAAAAAAAAAAAACAQAAAAAAAAAAAAAAAAAABAAAAAAAAACBgAAAAAAAEAUAAAAAAAAE +AAAAAAAAAAAAAAAAAAAAAIEAAAAAAAAYBQAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE +AAAAAAAAAoEAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAKABHydxPyd9MPA+YxAQIAFvJ1F/J2d2sG +kGC0Zndj+FQOkFWVFw8UAGP/+QAAAGwQBBjycx3ybisgBxzybiohCPoCAAdxuwEA7tw5DdwCgAAL +qgKcMOPyaBmwBIAACKoCHPJmIzCA+kAIFeANBQCdZexmAiG43QAA+sCGFaR3HQDpfP8t3gKAAOt7 +AgzPAoAA62YBJMvhAACZYwIEiZNnKGYGBiCLGPJXJSEJ9MFmFaQzHQDlZgorkASAAOgABQMowQAA +bTkCBQJh0Q8AAABsEAQc8kcmIAcb8kYf8kz+QQQVoNYRAA3LOZswhyD75IYFoAklAPpgRhWgGAUA +6DYDK74CgAD45gAMcWYBAPhgJhWgDAUA5SBXKzQCgAD3xgAOsCsFAP+mAA7wCjUA6PI2EoIBgACc +NZw3mzMZ8jUKdQKVMZk2JSEJnTQvIAecOZQ7+KYACTH/AQDiNgov/AKAAA/uAgjuAu42CC0QBIAA +0Q8nIQgqIQmcNZQ3BncCCKoCmjYIdwLnNgQskASAANEPAAAAAAAAAGwQCCggBScgBykxBfgghhXg +GUUA+QAMxWF3AQCKIhbyFxjyF/FVDA3gDZUADHsRprsssp79gAxD4AqlACuynesWBSWMOYAAjIj3 +gAxwkgCdAC1irmTROCtireSxNGZz/QAA7oYIJYm5gAAoIBSkiAgIRygkFPUAC73QDwUAGfIBLiIW +LCEpiBUa8gCuzJqA6iIeLmfCgAD9AGYVoA0lAP0ARhXgC2UA7fHvHVYCgAALqgKLFJqB6QAVBEBB +AACJFQgAiig8EP0gxhXgTAUA/SDmFaAMRQDsuzYEyIEAAG25BQgAhgkCYe7x4RWgh4AAiBXuAAUN +zwKAAKmI6IwgJaQ1AAALyQxtmQIIAmEoISnqISgkQAUAAAgITyglKflACEQiAJ0A/+OyBeAMFQD6 +IKgV4B7lAOoiHixtQoAA/CAmFeAJBQD4IAYV4A0FAOkWAiXZgQAAWHYoDH4R98AARzANlQD906YV +58UBAPmABilSAJ0AwCDRDwDqJAAJ2ASAAOxEAAroBIAAWHf50qDRDwDAsArPNO+GCC32jgAA2iD8 +QGgdoBvFAFh7BWP/ygAAAOokAArYBIAAWHlY0qDRDwD/+ewNoAsFAAAAK3wY6iQACWAEgABYevlj +/5zAoFmO2BjxqIyI+Z/zQJAKpQBj/6wqIQn8QrAVr/0FAA2NAQ2ODC4kFO20Ay5hAoAA77QALVYC +gAD9RgANMAkVAAmqApqx+NWmFe/5YgAvJSn/+9QNoAgFAIon60QACmgEgAD7RAAVoAwFAFhyPtKg +0Q8AAABsEAYoIAUrIhDkIAcqUASAAPgDAh3gHsUA+94ADPAZRQD5AAxdYUQBAIwiH/GA6hYALgse +AAAMSREPmQgtkp4PAgD3oAvjUgCdACeSnQwGPmRxbospKiIKC6oM90AJC6IAnQAqIE4sIEyxrfuA +CyQgCxUALSROKjABKSIY80ALRpIAnQArIAcsIST8YCQV4AhVAPlABAQwqxEA4IgRDVKCgAAKiAIa +8WYI3QIoIQcrIQkKzAL7pgAOuogBAOrxYhxDAoAACLsCKCEinXCNIJtznHT7BgAMMAplAOh2Ai7u +AoAACt0CnXEsIhCcdSsgOBjxVvwAIh3gTBUA/OEmFeC7GQALzTkc8VGeePsNAA5wCAUAmHcNzAKc +du3xRhTYBQAAKyYYG/E8mHuZeu0AFQPIwQAACQCK63YOIchBAADudg8j8QEAAAkghg4CYwkAhg4C +YQxMEa/M6sadIwCpgACOKS0gOKbuninzoAVXkgCdAAUPR/ngBFFSAJ0AwCDRDwDqJAALWASAAFh6 +OcHs7/EnFXaRgADqJAAJ2ASAAOwSACroBIAAWHde0qDRDwAAAADqJAAK2ASAAFh4xNKg0Q8AAAAr +TBjqJAAJYASAAFh6Z2P/wYgiwJQJiAL4QEYVr/7eAAAAAAAAAPxDqBWkiQEAAIEEAL0aDcwC/EOm +Fa/6HgCKJ40QwMDqrCAu2ASAAFhxuNKg0Q/aIFh3CGP/UQAAbBAMLSAFJiIQLyAHKyE15RYDKcAE +gAD7AIgVpzUBAPJ/wBXgDBUAA8M5+0EADXAVhQDrggIsYASAAPdeAAqx/wEA9wAwFaAVRQD1oB/V +Y7sBAIkiKBYA8z1cDeAOhQCYEPLAHgcSAJ0AnxKfGpsWFvDnkxXqFgQvrwKAAOZVCAIwDQAA5hYJ +InAFAACIGi4WCCsSCfUABmISAJ0AKlKe+0AJq+IAnQAvUp1k87sY8NiIiPcACViSAJ0AGfDUKZKu +DAM+6vDSFIn5gAAqoq0W8NDqFgska/0AAOsSCyUJaYAA7WYIJZuZgACIKYcqCHcM8uAJY+IAnQAp +GgDzIjIN4Pr1ACsgFpwR+2AJrSIAnQAY8MiGFI3DKiA4/eDmFeAJBQD54SYV4EcFAPfhBhWgqhkA +Cnk5F/C/KyIXm/orIhub+43ECng5/MAPEuIAnQCYF54dhhWcEZkc5xIMKwgeAABgAX4Y8KuIiGqB +JooZKVKeepNDK1KdmxuNG+nwpRQz/QAA79QABoHZgACWmGX/HGAC1Z4d/CAmFaAKBQBZjcwY8JyI +iIwR7hINJA8HAAD//2gNoA8FAADAkPghZhXv/u4AG/CTwKoKijT7YQYVr/7+AAAAAAAAAP/7OA2g +DwUAAJ4dnx78ICYVoAoFAFmNuBjwiIwRiIiPHo4d+R/12JIAnQBgAlHAkJkbihsd8IHAuguLNOvW +CC12jgAAYAI4AJ4dnx6cEeokAAnYBIAAWHmIjBGPHu4SDSV1+YAAYAHvAJ4dnx76QPAVoAwFAFh5 +X4wRjx7uEg0tdcYAAGACxgCIEY4X9iDIFa+MBQAsJDuMFAZ2AgbuAqy5DNoMmoTpJhssWASAAO0i +EClQBIAAWHgJjh2MEfqzphWhBwUAc3sIKyAWKAr/eLleiikpIDijquomCST5poAALyIQLSE1+4CI +FeAIFQD4IKYVoAY1AJYTDbs2+iCGFeAdhQD/fgAO//a2AIonnx6LEOqsICpgBIAAWHT9jx6aESsi +G/1AiBXv/YYAAAAAAADqIAcp4ASAAFh5GYwR/iGoFa/+QgDaIFh2P4wR/iGoFa/+QgAALSIQihYr +IDsW8EAKmQIJiQLmmAINifYAABrwPfhEhBXjaQEAh8DrIAcrMgKAAAaZAiYhB/rgBAOwuxEA6vAt +HdqCgAALdwIrISIKdwIqIQmX8IcgnfX54MYVqmYBAOn2BCszAoAABqoCFvAj6vYDK74CgADn5wIH +yMEAAOf2ASZAgQAA5rsCAlP5AADr9gIiFDUAAG2pBQgAhgkCYSggFKSICAhHKCQU9QAGrdIAnQCK +GPqzphWhCQUA8yHyDeD89QArIBb9YAkVIgCdAC0iF7Hd7SYXIYCpgACPKS4gOKP/nynzwAe/kgCd +AIYVZWDSwCDRDwAAAAAoIE5kjD0OmwKbIusSAClQBIAA7RIDKmAEgABYdi/SoNEPAOsSAylQBIAA +WHeW0qDRDwDaIPxAaB2gG8UAWHk6Y//HAIsS2iDrvBgpYASAAFh5NWP/tAAAAAAA6iQADlgEgAD8 +IIgVr44FAO4kOyxwBIAAWHeG+iEGFaAPBQAvJhv+R2Yd7/yCAIsbKiEJ/EKwFa/9BQANjQENjgwu +JBTkzBANVgKAAAyqAv1gZh3gDgUA/2AGHaAGFQAGqgKasRnvyvc1phWv+8oAAIon60QACmgEgAD7 +RAAVoAwFAFhwc9Kg0Q8AANogWHXDY/8EAAAAAADqIAcp4ASAAFh4lWP+04sS2iDrvBIpYASAAFh5 +BmP+92wQCCggBe3vtBnQBIAA899iBeAeRQD/AAq1IAylACsgTinSCNMP6hYDJdv9AAArJE73IAiY +kAcVAC8yrmTyMCoyreakAAURkYAAsJjo1gglCIGAACkgFLOZCQlHKSQU9SARLdIAnQApIHMrIh37 +IAQA3//1AOB6GgTABQAA/1cAD/SIAQAoJHP7QAQFcAgVAAqKOQ+7AesmHS0HPgAAiiJ8pwQrIE7K +tH2nCC0gTCwgTn3DGcxsLiAU7yICL1gcAABk8fzAINEPAAAAAAAAiCfHkwmpAekmAiRQwQAAWGeI +4++KFQE5gAAooADTD9MPA4gKKIIQ7KAHLVgEgAD6QGgdoA1FAAuAAGWv3Ikn0w9kn6EqmRTKp4qZ +ZK+XKKAAA4gKKIIQ7KAHLVgEgAD6QGgdoA01AAuAAGWv4GP/dQAA//9UDaAKBQDAoFmMkx3vYonY +LAoK+T/3AJAeRQAmCgApIBSzmfhChh3v+/oAAAAA6iQACtgEgABYdv7SoNEPAAAqIAUrIAcPAgD/ +QA8VIbsBAAUFR/igDylSAJ0AjhPu4gYveASAAJ4UC74C9WAKchIAnQAMuhEDqggoop73AA580gCd +ACqine4WASUK8YAA+kAIFeAMFQBYII8b70AvIQke7zYoISItIAcc70gpIST/BgAMMN0RAO4SBC7q +goAADZkCDJkCmaCMICimAv9AZhXgDSUA7qYFLmYCgAANzAL9QCYVoAkFAOsAFQVQYQAAsZnqgx4M +j+gAAI8RDP8R8+AAR/AOpQAu9p30v/KBEgCdACoiB+tEAApoBIAA+0QAFaAMBQBYb8xj/jIAAAAA +AP/3OA2gCgUADJs069YILW6uAABj/tkAAC8hCfhCsBWgCwUA+sAGHe/6BQAKmgEqZAPqmgwMQQKA +AOokFC/+AoAACP8CB/8Cn2H2daYV7/aqAIonwLD7RAAVoAwVAFh3OR3vEJ2gjCAb7w/rpgIuZgKA +AAfMAv1AJhWgG8UA7CQACVAEgABYeEfAINEPAACJ2PcgBKiSAJ0ADOoRo6ooop73AAV80gCdACqi +nWSgprCYmNjuFgEtdVYAAIki6xYAJIUZgACfEvi/6yFSAJ0AiifAsPtEABWgDBUAWHOZHu7wnqCN +IBvu8ewSAi7uAoAAB90CnaGMxpyj+0BGFe/0ygDrVAAJUASAAFh2fmP9H48Tj/P+IIYV7/iOAAAA +AAAAAP/40A2gCgUAAJ8SmxH6IAYV4AoFAFmL/B3uzIsQidiPEo4R+T/6iJAMpQD//YwNoAoFAMCg +DJg0+aEGFa/9WgAAAACLEO8WAilQBIAA67wYKWAEgABYeAv+IEgV7/0iAGwQBCggFO+LHmoYBIAA +iif6YGgd4AwFAOqsICnoBIAAWG9h0qDRDwCLInO+fhTurolIapF6G+6r0w8ssq5kwFgqsq1koFSw +ne1GCCUC4YAAKSAU6SQULNrcAAAvIQn4QrAVoA0FAP1ABh3v/AUADJwBLKQD7JwMDEECgADsJBQv +/gKAAPnmAA+wDhUADv8Cn6H/daYVr/3mAMCgwOoOnjTuRggtfWYAAI8iyfXAINEPwKBZi72JSPk/ ++9CSAJ0AY//lANog/EBoHaAbxQBYd9XAINEPbBAIiS/vITQpsASAAPZg6BXnhQEA7iAHKlgEgAD7 +H8AVoAQVAPqNAA0wHUUA/uEAC/HuAQDpfR8MFIAAACggTw8CAO8gTSRABQAACAhHKCRP+eASu6IA +nQAvIAWbEZoQ/eAQ3WIAnQCJIsej+UANgOIAnQAsIhmLMv1gEv0iAJ0AjTiPERjuYunuZBaRQYAA +6RYCLycCgADoRAgH+A0AAPXADKISAJ0AKUKe/yAZK+IAnQApQp3tlAAEkWGAAIspiioMBT4Lqgz1 +QAmr4gCdACwaAPWB8g3g+PUAKyAW+WAX1SIAnQAa7lwpISQrIQcKmQIqIQkLC0oMuxALqgIrIAcc +7kgLK0Do7lUd2oKAAAy7AiwhIpvQiyCZ1JrTCMwCnNL9YAAVsAxVAAy7ApvRG+5Mii+a1SkgOPvc +lAWgDAUA/aDmFaBIJQD3oQYV4JkZAPlNAA3wCiUACYo5iWSZ2YhlmNr8wMgVoAkFAOzWCyOH4YAA +6e49HMKCgAAJiAKY3Ixol9+c3owSiWkp1hCIaijWEewAFQbJIQAACQCKjGf84AqjogCdABnuJQq4 +AgmIApjWwPX+k6YV4Q4FAPXB8g3g+vUAKyAW+2ASBSIAnQAuIhmMKS0gTysgOOXMCAdwBQAA7iYZ +Juv9AAAtJE+cKfNgDgeSAJ0AjRBl0b7AINEPnxOeFJ4VnRbqJAAK2ASAAFh3EI0WjhTvEgMldaGA +AI4QZe/XiifbMOwSASVQwQAAWHJwwCDRDxrt94qo90AOyJIAnQArQp7/YA+z4gCdAClCnR3t8OSR +6mVj/QAAnNjtlAAM8tYAAGAAegAoIDnxH/gOEgCdAP/75A2gCRUAwaN6+RIpIDr+IKYVoAv1APsg +ECViAJ0A6iQACtgEgABYdYTSoNEPAAAAAAAA8AAYDaAa1QDAoYw3KyEJjTiOMuuvEQ3dAoAAD7sC +5LsCCVAEgABYdWbAINEPAAAA//9YDaAahQAAACvsGOokAAlgBIAAWHcXY/8oAAq5ApnWwIX4k6YV +oQwFAHXLDSsgFioK//tgDUUiAJ0AixBksTaLaoxnimmrewfMDJxn92DSDeANBQCxqoxlm2qLZppp +rNqre3e7AbGqm2aaZYgpLSA4pYiYKfOgCT+SAJ0AiScqmRTKpouZyrKfExnttyiwAJ4UnhUJiAoo +ghAssAf6QGgdoA01AAuAAI4UjxOLIsej+1/zYOIAnQAoITSHZ/xB6BXgCRUAmRD44QALsBxFAPz+ +AA5/88IA2iBYc5pj/juKJ+qsMCtYBIAAWGAf0qDRDwAAAAAAAAD/83gNoAkFAJ8TnhSeFZ0W+kDw +FaAMBQBYdniNFo4U7xIDLWd+AAAr7BLqJAAJYASAAFh20mP+E+ogByrgBIAAWHZZY/21nxOeFP4g +phWgCgUAWYqrGu16iqiOFI8T+V/weJIAnQD/+IgNoAkFAMCQHO10wLoLqzT7gQYV7/hCAJ8Tiiee +FO4WBSnYBIAA7BIBJVDBAABYceLuEgQtMASAAP4gaBXv+pIAnxOeFO4WBSlQBIAAWHNljhT+IGgV +7/siAADBU/pAaB2gCwUA/AACHaANNQBYbN8rIAWOFfV/3Z1iAJ0AY/1jnxOeFJ4V6iAHKuAEgABY +diyOFP4gaBXv+RYAAGwQDJUTJiAFLyAHhy/qMgQpwASAAPxGhBXnNQEA8n/AFeAOFQAD4zn9QQAN +cBtFAOerHwxgBIAA+sAehWH/AQCJIpgQ8zrMDeAOhQAmgAGYEPLAHKcSAJ0AnxKfGhntN5MXFu01 +6hYGIlgNAADrFgkvrwKAAOZVCAJwBQAAiBqeGI0Z9QAFWhIAnQArUp79YAgT4gCdAC9SnWTzkIiY +9wAH2JIAnQAW7SQmYq4MAz7q7SITCHmAACqireoWCyRr/QAA6xILJQgBgADtlgglmnGAAIcphioH +ZgzywAfb4gCdACgaAPMCMg3g+vUAKyAWnBH7YAgdIgCdABbtJCogOPvaRAXgDQUAnff3gIgV4KoZ +AAprOYYWxIAKjTn2wA9y4gCdAJ0UjRfrFgUuh14AAGABjoiYaoEgjRkrUp59szwvUp2fG4YbsIrv +ZAADAdGAAJqYZf9GYALUnhz8ICYVoAoFAFmKJhns9YiYjBHuEgwkDx8AAP//aA2gDwUAwLD6IWYV +7/8KAMDaDY00/SEGFe//DgAA//wEDaAPBQAAnhyfHfwgJhWgCgUAWYoUGezkjBGImI8djhz5H/dY +kgCdAGACWcBglhuKG8C6C4s065YILXgOAABgAkOeHJ8dnBHqJAAJ2ASAAFh15YwRjx3uEgwld4GA +AGAB+54cnx36QPAVoAwFAFh1vIwRjx3uEgwtd1YAAGAC05wR/iGGFa+IBQDoJDsmOEEAAOcDHgew +gQAABgJhhhaW+I3Hh8SIxq1tBncMl8R22wouFgzsFgEkQAUAAIwWixGGFI4VmLadtwbuAu0iDylQ +BIAAWHRdGey0jhyMEfqzphWhBwUAc3sIKyAWKAr/eLlciykqIDiju+smCSV5qoAAhi8vITT9gIgV +4AoVAPog5hWgCDUAmBMP3Tb8IMYV4B9FAPe+AA+/9wYAAJ4ciiefHYsQ6qwgKmAEgABYcVDvEg0t +YASAAP4hiBWv/NoA6iAHKeAEgABYdW2MEY4c+dkkBe/+QgAA2iBYcpKMEY4c+dkaBe/+NgAmIDsX +7JXtuwIHyIEAAPmCABWjqwEA57cCCwjGAACTH43AE+yOA90BIyAHAyNACjMQA90CE+yCJiEkA90C +IyEH6yEJLVICgAD6xgALOjMBAOohIimbAoAAA7sCgy+d8I0glvSX9pP1m/ODH+vsdh7uAoAADe0C +nfELqgLq9gIiDD0AALBKbakFCACGCQJhKCAUpIgICEcoJBT1AAZd0gCdACoSCPqzphWhCQUA8yHy +DeD89QArIBb9YAilIgCdAMg/jiktIDij7p4p86AHr5IAnQCPF2Xw0sAg0Q8AJiBOZGxpDpsCmyLr +EgApUASAAO0SAypgBIAAWHKJ0qDRDwDqJAAK2ASAAFhz8NKg0Q8A2iD8QGgdoBvFAFh1lGP/xwCL +Etog67wYKWAEgABYdY9j/7TbwPwgyBWvjgUALiQ7CCCGCQJj7PYIKVAEgADtIg8r8ASAAFhz3/oh +BhWgDwUA/kdmHe/8qgCLGyohCfxCsBWv/QUADY0BDY4MLiQU5MwQDVYCgAAMqgL9YGYd4A4FAP9g +Bh2gBhUABqoCmrEZ7CP3NaYVr/vyAACKJ+tEAApoBIAA+0QAFaAMBQBYbMzSoNEP2iBYch1j/wYA +AAAA6iAHKeAEgABYdO9j/uGLEtog67wSKWAEgABYdWBj/vdsEAYoIAUlIAckCgP3AAVkUVUBACgg +ImSAoQIqAlhrAPlABMDQBhUAKSAh4+wEGAQKgADzIAQv0gCdAOxZEQKlaQAAo5kqkp5uo3Qrkp1k +sGopICH6QAgVoPzlAAyZAfcmAAywDQUA+EQmHeAIBQD4IAYVoA6VAPggJhWgDwUA+CBGFaAMBQBY +cEwMXRGj3fWzphWgAgUA0Q8X6+mKeGqhJgxZEaOZLpKebuMtK5Kd5LApZWP9AACceGW/lMAg0Q// +/igNoAsFAMCgWYkNinhroc7//4wNoAsFAMCwwNoNrTT84QYV7/9SAAAAAGwQCiwgBfhA8BXgCxUA ++GBoHaelAQDoFgAlU/kAAOq6OQoYBIAA6hYELCAEgAD9gcAEUZkBAMGz+4AaXWIAnQCMImXC1xvr +wrQ+7hYDLMcCgACriOgWBizABIAA7BIGJCXxAACNEyzCno8W/YAG6+IAnQAv8p3vFgUnlWGAACUh +G4pChiqYGAWlNvVPAA3xBwUAe3MB1aCHKQdmDPTABaPiAJ0AKhoA9UIyDeD89QArIBaYGP1gBb0i +AJ0AikL6oAp6ogCdAIwUG+u5h0OYGJkZ63cBBggZgABgAK0a656KqOgWCCUMv4AAixaMEyuyno8W +fLNAL/KdG+uX5PA5ZTP9AACWuO8WBS/7rgAAYAIVAAAAAPghJhXgCgUAWYi9GuuNiqiJGegSCCUO +/wAA//9MDaAPBQDA8Bzrh8C6C6s0+4EGFe//BgAAAAAA//yYDaAPBQCZGeokAArYBIAAWHSNiRno +EggleemAAGABrgCZGfpA8BWgDAUAWHRliRnoEggtedYAAGAChAAFrQydQowp7nQAClgEgADvEgUp +UASAAOXMCAroBIAA7CYJKeAEgABYcE2IGIkZjxb786YVoQ4FAHXrCCsgFiYK/3a5LcCh+iCGFa/6 +IgCKJ4sQ6qwgKeAEgABYcBHAsiukAuqiAi0gBIAAY/+SAAAAAADqIAcq4ASAAFh0LYkZ+CEIFa// +BgCPKRjrZ4kVpf+fKYxDi0CNFOfEAATIgQAA/A4ABTfrAQDuFgEuiA4AACcgBwcHQQh3Cidyoe6t +EA1TwoAA7aoCAkBBAADqdwEB0/0AAOfHAgGMPQAAbakFCACGCQJhi0DAgJgSGetSGutRLyEahhUe +604kIQcY60v8ICgVodcxAP+gAEa6RAEA7dCAKicCgADszA8mcEEAAPiGAAo0zB0A5GYAJmAFAAAM +PAwU6x8NXQyIIJ9ml2eeY51lDKQ5CYkC6WYELEYCgADkZgIh0AUAAAioAphhJiAU42YIDSAEgADm +JBQlqdKAAIgW9ROmFaEHBQD04fIN4Pn1ACsgFvlgBI1iAJ0AiBLSgNEPihRkoJLAINEPK5wY6iQA +CWAEgABYdFdj/+WKJ/wg5hWn20EA6qwgKAQKgAD1oAQ50gCdAIwVwLHszCAp6ASAAFhrrZoS+oAI +Fe/8PgCLFexNEQlQBIAA/WAARfAMFQBYab/0gGAVr/3eAGWstfmf5ZDSAJ0ALyAg8f/lP5IAnQBj +/4EAAAAA6iAHKuAEgABYc8OIEtKA0Q+KJ9ww6xIAJVCBAABYb5rAsvtARh3gAgUA0Q8AAAAA6zQA +DjgEgAD8YGgd4AwFAFhri9tA7DQACugEgADqFgIr8ASAAO8SBSlQBIAAWG+5+oAIFe/7fgAAACuc +EuokAAlgBIAAWHQdY/79AGwQBBTq6CRAgAhEEfqAaB2gCxUAWYZhGOrRZKBC+EYADDAJJQCZoeim +ACEByYAAaCEcbyQZ7iIWZUghAAADQIgJCIoDIIgJBIoDAIgJAIraQPoAQh3gDBUAWYm1wCDRD8ck +0Q8P6DCfog7uMJ6jDcAwnaQMsTD9QKYVoAsFAJum+0DmFe//LgBsEBIjFhiIMCIWFPoiiBWnZQEA ++t/AFeAMFQALyzkpoAeKp/ohBhXniAEA+CImFaGZAQDpFgUlUIEAACoWGvTALGkSAJ0ALRIUjdJl +09US6peCKBPqlfZALNCQDKUAJjKuZGW9KTKtZJW5GuqQsCiYqOiUAASsyYAALRIamBEpEhj7oKQV +r84FAA7dAS0WGe2tCATIgQAA7dxALKgEgAD9ICyK4gCdACsSGCkSEZUc+2BoFe/yBQDrFg4kyD0A +AAKfAZ8apf/vFg0vqASAAP3gK1LiAJ0AlBAX6o0mEhju6nQSeEEAAJ8f/iBmFaSJHQAoFhMuEhSI +FSgWECZhDOYWFyKwEQAA5hYGLEcCgACjiCbhBygWFugSGSL4IQAA/iDmFepmAQDu4BYrNwKAAOdm +AgRBAQAAmBT2IWYVoP/1AP/ADVRiAJ0A9CAGFaALJgAAAAAA6iIMB/AFAADv5AAEyAUAAPMjwA3g +7gEAKhIaKxIZKMAAKqEFBYgLq6vrvEAsaASAAPsAEVrgaQEA+gAiHeAKBQAGujgNqwvtqgoF6CEA +ACcSGyYwAAdmCxfqXfoAIh3gCAUADrg4p4cncJDmiwsNcASAAOaICgXYYQAA5HQIBEBBAACK4A0A +iQKqNpqACwCLiODszAEhmAUAAPMf+xOiAJ0AAosMCowMnODzoAgVoAcVAPOgKBXgBgUAC3Y4qWmj +o5PRejsBsSLi1gAsngKAAPKAEKfSAJ0AJhIYEuo9LRISHuo8LBIaAtIB7t0BB/AFAAAC7gID3QIi +EhsjEhMswQX+QIYVoUQdAKQzkxkuEhQkEhedUIdnLRIZghsEdAytzJRnJBIVjR0W6iaSQI7g4hIR +IZgFAADmRgImYQEAAOJGAy92AoAA7j4CAhBBAADuRgEpoASAAP2ADaviAJ0AKhITAikC6BIMKaAE +gABtqQUIAIYJAmGGHmVh5ygSGIiHZIHuKhIWKRIUI6adKZAWKgr/+yAIdSIAnQArEhAsEhaNH/Vg +BhISAJ0ALMKeKRIW/YAT4+IAnQApkp3pFhUkiKmAACoSGCISF4lQiqf4IUgVoAQlAPgiRhXgDwUA ++kEACTeZQQDiFhckkXmAACoSGhPp5isSGSqhBaOTIzAAF+niq6sFMwvtNAAF2QEAAPpgELLgyQEA ++gAiHeAKBQAMujgNqwvtqgoF6CEAACsSFeecCA1wBIAA64gIC5gEgADoFhskWGEAAPkCgBWv+OIA +AIoW/CDoFe/35gAAAAAAAAD7DwAOv/dWABLpvIIo9kAOOJIAnQAmEhaHHyZinikSFvbADnPiAJ0A +KZKdG+mz5JHCYVP9AACauOkWFSz5PgAAYAAwACsSGCoSFCuxDVgqQywSFCzAFi0K//2f9uxiAJ0A +KhIUixhYKlNlrs1gAZQAwCDRD4sVLBIU67wYLlAEgABYcuzAINEPIhIbjBPygAIBMAcFAOwAFQEQ +QQAAsXfigx4Lj+gAAPSAIBWv9zYAAI0c7ckMCXAEgAD+ImgV5KkdAPFBIA3gDAUADQCG7gwABmAF +AAB6yfEuEhWNFAr6DP8gAEcwDAUA5K4qZ3BBAAANIIbuLAAGYAUAAHrJ8YYeZG4XiR4okQCxiPkg +BB2v+DYAKRIYKhIXDwIAKZEMCpkM6RYCLItuAAAqEhQqoAT1QAwBEgCdACcSGCISFehyASm3AoAA +piKHcuaBpWlYBIAA8wAOGFAFBQApEhSKECiQFIQZqoj0gABCd4gBAOiUFCIgBQAA9QANllIAnQAn +EhYmEhQkdp0mYBYnCv93YRArEhiMEiuxDSoSFAy7DFgp7yoSFI0QiqfAwOqsIC7YBIAAWGoB0qDR +DxfpXI0X+iDIFa/4LgAAAAD6bwAOv/eqAP/2HA2gCQUAwKBZhncS6UaCKPhf8XiSAJ0A//koDaAJ +BQDAkBjpQcBqBiY09wEGFa/44gCLFSwSFOu8Ei5QBIAAWHKIwCDRDwAAANsw6hIaJGg9AAD8gGgd +pN0dAFj6RPojBhWgDhUA/iEGFa/pWgDAoFmGXRLpLIIo+F/S4JAMpQD/6ZwNoAkFACwSFPuAaB2g +G8UAWHJzwCDRDwAAwJAY6SIMJjT3AQYVr+kOAAAA+y8ACr/pvgD77wAKv+paAAAALBIYjxwuwBUt +wBQrwBEswQmu3e4SFylQBIAAWPoZY/51KBIUiRAPAgAmgBQvEhgJZggmhBQv8gDx//V6kgCdACsS +FeoSFCnvAoAA/WAARfAMBQBYZ870YGAVr/pGAAAAKhIU6yQAC+AEgABb9qwoEhiIgQyrEesrCA0o +BIAA8R/yKFIAnQDqEhQr4ASAAFv2e/VAAEL/+MoAjBH4IogV7/8FAA+PAQ+GDCaUFC2RCf8isBWg +CwUAK8QAL8QD5O4QDu4CgAD/pgAOsAkVAAndAp3BGujk+VWmFe/4SgAAbBAIiCIvIAeVFPQgZhWg +/fUA8ResDeH/AQAoIBZ9gSeLFP4gxhXnuwEA+3/AFeAJFQDrmzkJUASAAFgpgi8SBvNOYA3g/fUA +LDAPFejHG+jOFujM5VCALgtuAACHE7B3JVw3/iCmFeRVHQDldQgPzwKAAOaZCAKoDQAA9eAG4hAM +pQAokp71ABSz4gCdACWSneRUAAKJ6YAAKrII90AKGJIAnQAuYq5k4P0pYq3kkPlle/0AAO+2CCSH +4YAAKCAW0w99gQ6ZEOsxBilQBIAAWClHiRCMEyogFCsgBKyq9WAI8RIAnQAKCkcqJBT1QAyGUgCd +AC0wD4kU8bDcDeeZAQD5IA3JUgCdAOlUAAHAQQAAbXkFCACGCQJhwKCaEgx0EaRUKCAE9QAJ2RIA +nQCJMeQWASpYBIAA5TICLI0CAADzIA3gUAQFAKR5ihXiEgItVwKAAKaqKaad0Q+KuPdADviSAJ0A +iRUMmRGmmS6SnvXAD6viAJ0ALpKdnhCIEOWEAAQPgYAAsKn5YQYV7/wWAOwSAylQBIAA7RIEKdgE +gABYbrXSoNEPAMCQDK407rYILPhmAADaIPxAaB2gG8UAWHHBY//KJzAO9uAAg//6UgAAACv8GOok +AAlgBIAAWHG5Y/+swKBZhZgb6GiKuC0K//lf9YCQDKUAY/+5AAAAAAD6QoYdr/vCAAAALCEHHeh2 ++9D2BerMAQDuMA4uZwKAAA3MAiy2KIogGOh4/UAAFTAMNQAMqgIqtinoBAUB+EEAAPkgCcFSAJ0A +bekOBAJjD0CGBAJlDwCGBAJhwND8IEYV7/sKAI4w88AK6pIAnQCPFeISAi//AoAApv8n9p3RDysh +CfxCsBWv/QUADa0BDa8M/kKGHeAOBQDtlAMuYQKAAO6UAC3eAoAA/WYADbAIFQAIuwKbkfjVphWv ++OoAiif8oGgdoAsVAO0SAyVQgQAAWGjd+iBGFa/5HgAA2iDrRAAK4ASAAFv11osRiTEMrBHsuwgN +IASAAPE/8mBSAJ0A6iQACuAEgABb9aWkpKR5ihXiEgItVwKAAKaqKaad0Q//9bQNoAUFAAAAK/wS +6iQACWAEgABYcWNj/lQAAAAAAP4gxhXgCgUAWYU/G+gPirj+IMgV4P31APlf8EiQDKUA//S0DaAF +BQDA4P4gBhWv+DoADKg0+WEGFa/0YgCKJyWhFftEABWvyQUACakBqVkpnEBt6RMEAmMPgIYEAmkP +YIYEAmd5+xjTD40T0w/7oGgd4AwFAFhopPogRhWv9Z4A9e8AD///jgDaIPqAaB3gDAUAWGa3s3uM +FeISAi5nAoAApswrxp3RD2wQBCMgACQK7XQxBiIhA7wi0Q+GIIUjhCH2cAAEOzYhAPhgAEGzZgEA +pjMOMxHyrwAJfUQBAOM8GiETyQAABCQsBDMooyLRD2wQCIoiJyAHiTCVFPhC0BWhdwEA8VsMDeiZ +AQD4ICYV4Pv1AHuBICsSBAsLR/t/wBXgCRUA65s5CVAEgABYKHXzT2AN4Pv1ABrnxIioFufB9wAM +YJIAnQAtYq5k0awlYq1kUaiwiJio6VQAAox5gAAV57IlUIAlXDf4IAYV5FUdAOVFCAvPAoAA5pkI +AqgNAAD04AhaEgCdACiSnvUAEsPiAJ0AJZKdZFFvKiAW+0MmDeDs1QArMBD9YBIkIgCdACsxC7y7 +2iBYKD0oIBQsIASkiPWACtESAJ0ACAhHKCQU9QAMblIAnQCKFB7ntY0RKCEHHOeSGeew/6HgFeqI +AQD/AAAUNP8dAOmIAgf4BQAAD08MmFCLIA/sOfygZhXnqgEA7FYCLd4CgADrSwICyEEAAOtWASHA +QQAA+UAH6VIAnQDoQQ1iU/0AAG2pBQgAhgkCYcCAmBPpIAQiW/0AAAy7Eatb9SAHgRIAnQCIMeUy +AiXYQQAA6xYCLAmyAADzAAqwUAMFAKNMiBMMfRGm3ezWnSwQBIAA0Q8AAAAAAAAA9wANOJIAnQAM +eRGmmS6SnvXADZPiAJ0AJZKdZFGpsIycqGVe5GAAUeokAAnYBIAA7RIEKmAEgABYbZvSoNEPAMCg +WYSNGudciKj5H/NQkPv1AP/5yA2gBQUAANog/EBoHaAbxQBYcKNj/7zAUMDaDYg0+UEGFa/5SgAr +fBjqJAAJYASAAFhwm2P/nAAAAAAA+EKGHa/60gAAAACKJ/0gaB2gCxUA6qwgKmgEgABYZ/L6IGYV +r/wOAIsw82AIupIAnQDiEgMr5wKAAKbMJMad0Q+PEC4hCfhCsBXv+gUACooBCowMLCQU5JkQD3YC +gAAJ7gL74GYdoAsFAPvgBh3gDRUADe4CnvH81aYV7/j2AADqJAAK4ASAAFv01YsSKDIB6hYFLWcC +gADsuwgNGASAAPEf9ZBSAJ0A6iQACuAEgABb9KOIE6Ojo0wMfRGm3ezWnSwQBIAA0Q//9qwNoAUF +AI40izeNNf5wAAe7ziEA/4AARnPuAQCuzA7MEf1vAA293QEA7MwaJdvJAAANvSwNzCj9YABFv/ZC +AAArfBLqJAAJYASAAFhwU2P+fMCgWYQyGucCiKj5H/J4kPv1AP/5hA2gBQUAAMBQwPoPjzT/QQYV +7/lGALBLDLsR61sICVAEgAD7YgAV4AwFAFhlvbNM4hIDK+8CgACm3SzWndEPAABsEAbaIFgoMRjn +DSQwFvnODgXipgUABqYohTepaQRECulECwlQBIAA6EQIAqghAABYKCaIQCswFh/nAvULXg2gBxUA +HucAL/KgLuKBqv8J/xGv7p4QHeb8GOb9Geb17W0IDX8CgACo/4zxLtJ9ALEE6cwBC8AKgAAI7gIo +0n8Z5tgu1n0MiAIImDgI7gKe8i3Sf8jTihBYAueIMupCASkBCoAAAHkaCYgClaCaUZRQlUGYMtEP +AAAAbBAI2iBYKAPUoBfm4xvm5PnNxgXipgUABkQoFebW6UkICVcCgACrqoqgKZJ/pUWnRAqZAfgg +BhXgYwUA4QAFATO5AADwAKANoAcVAAM8CgXMC+jCDClQBIAA60QAC2gEgADuPKAmYIEAAAuAAAEB +hwM3YOEBBwn3VAAA0Q8AAABsEAQW5sgV5qjTD6YiBTUCJSaAJCKAZ0ALbQgFKCKAZ4ACY//z0Q8A +bBAEKCAFJSAHijX1/6IdoAMlAP0BQBHRVQEAwCDRDwAAiCkZ5reaK/sAB+QiAJ0ACVkJKZ0CKpEI +KZEE+yAEw6IAnQCKIvNABHASAJ0A2iBYZWqLItMPDwIAA7oBZK+6iicEuwHrJgIlUMEAAFhehOPm +hhUBOYAAKKAA0w/TDwOICiiCEOygBy1YBIAA+kBoHaANRQALgABlr9yJJ9MPZJ94KpkUyqeKmWSv +biigAAOICiiCEOygBy1YBIAA+kBoHaANNQALgABlr+Bj/0wAAP//VA2gCgUA2iBYZVcrICLquwwJ +UASAAFhmqNpQ+gAiHeAMBQBYZz6LIgO6AfN/+uZiAJ0ALCAH5L0BCVAEgAD8QEYV4bwBAOu8Hylg +BIAAWG+cwCDRDwDrICIpUASAAFhmliogBcHjfqEMaKgpiyLzYAQFf/xmAC8gOsCPePnq+kBoHaAL +BQD8AAIdoA0lAFhlwmP/1wAA+kBoHaALBQD8AAIdoA0lAFhlP2P/vwAAbBAKiCsd5l8uICGLN/xg +yBWg/+UAD+4BLiQhDcwBDLsM64kIeMgEgADAINEPAwCGCQJhmxUoIAUlIAfHTfghBhXgAyUA/RwA +QdFVAQCKKSsmCw8CAPtAB/xiAJ0AG+ZIC1sJK70CLLEIK7EE/WAEw6IAnQAsIgLzgARoEgCdANog +WGT+iyLTD9MPA7oBZK+YiicEuwHrJgIlUMEAAFheGNug4+YZFQEZgAAosAADiAooghAssAf6QGgd +oA1FAAuAAOukAA1/LgAAiSdkn1oqmRQrkgnKqGS/TyiwANMPA4gKKIIQLLAH+kBoHaANNQALgADr +pAANfx4AAGP/KwAAAP//SA2gCwUA2iBYZOsrICLquwwJUASAAFhmPNpQ+gAiHeAMBQBYZtKLIgO6 +AfN/+uZiAJ0ALCAH5L0BCVAEgAD8QEYV4bwBAOu8HylgBIAAWG8wwCDRDwDrICIpUASAAFhmKiog +BcHjfqEMaKgpiyLzYAQFf/xmAC8gOsCPePnq+kBoHaALBQD8AAIdoA0lAFhlVmP/1wAA+kBoHaAL +BQD8AAIdoA0lAFhk02P/vwAAbBAEHOX1izQpMBb9YAQFtZkdAPUgB8iSAJ0A6uXwFIhJgADH3uTl +zBSksQAALKFsaZUcfLMJtM7/YAijogCdAC8gBrD/Dw9H7yQGJ4LRgADAINEPACyhbNMP7LMMdkAR +AAD5YAfTogCdACkgBrCZCQlH6SQGLP7WAACJJ4siKpkUDbsBmyKLmWSgtCiwAASICiiCENog/WDw +FaANNQALgADAINEPAIsiiicPAgANuwHrJgIlUMEAAFhdpcmtKKAABIgKKIIQ7KAHLVgEgAD6QGgd +oA1FAAuAAGWv4IknZJ9uKpkUZKBgiplkr2MooAAEiAooghDsoActWASAAPpAaB2gDTUAC4AAZa/g +Y/9BAADqJAAJ2ASAAOxEAAroBIAAWGXlwCDRDwDqJAAJ2ASAAOxEAAroBIAAW/9FwCDRDwD//RwN +oAsFAP/+dA2gCgUAiDcioskJiBH4QABBP/uSAIg3IqLJCYgR+EAAQT/7+gBsEATRDwAAAGwQCBXl +mRTldhflmZIS+CBIFaAKBQD6IGYVoAlFAJkUGuWTCIIJ4IEECReCgAD2QABD8AgVAOoiCAxACoAA ++CAmFa/59QD5FwAMcAYFAPggBhWgAIoAmxOMFLFm4iwMI7gxAADlXAImY/0AAOwWBCYFMYAALVHC ++sAEANALFQDguxoOo0wAAC5xfmTvygIqAlhmzo8R+sAEANAIFQDgiBoNGASAAOgWAyeAaYAAiaKK +EAqZAZkyijcqrDBYXUfKoSigANMP0w8EiAooghDsoActWASAAPpgaB2gDUUAC4AAZa/ciTfTD2Sf +bSqZFMuniplkr2MooAAEiAooghDsoActWASAAPpgaB2gDTUAC4AAZa/gY/9BixP6IEgVoAkVAAub +OVhnvdEP//8UDaAKBQBsEAYd5VALKxGtsyoyfxnlThflOIigwED44ABE8AYVAOm5CAQBqYAALDJ4 +LzJ7+YAFnGIAnQBl8SAsNnwrMnkrNnvdQA3kFgECAJSgDeQWwMn8QAX8IgCdAC8ye8HA7eU7F4Ox +gAAiMnwqIQSOIPPh/g2mugEAJDZ89G9mFaAAHgAuNnztrwEFw/0AAAj/Au8lBCWMYQAAIjJ8sMzv +MnshAQGAAMnIY/+/AADaIFhmOGWgzCohBP9BIAwWmgEAyJnRDwDaIFhngdEPANogWGe10Q8AAAAA +AAD6QGgdoAsFAFhngdEPLiz46tJgLwEKgAD8wAEF3/z1AAy7AwuqASrWYFmHnyQ2fCQ2e/pv6BWv +/NIAAAAV5NsvUGlk8HJZfc5YZekocrXIgVl9nilQaWSfJ1hl4WSvIRXlBg8CAA8CACxSdLDM7FZ0 +LniGAABZfVP6roYVr/wWAAAAHOT+/m+IFaAKVQD8b0gV4AtFAO0WACFr5QAAWYUL+m/oFa/7AgAu +MnviNnwvec4AACI2e9EPH+TyL/KucfaD9q0mHa/+AgAAAABsEAQU5O0Z5Ofo5NEZXsKAAKS0I0J/ +qYjouAgBgkGAAIoweKkCKkJ7HOTgKzEEKkZ/DLoB6jUEKdAEgABYZevOrikxBP8hAAwW2QEAyNfR +D9owWGc10Q/aMFhnadEPAAAAAAAA+kBoHaALBQBYZzXRDyNGf9EPAABsEATwYOAN7/n1AIgiCTkD +CYgBmCKKJyqsMFhcnOPknRUBGYAAKKAAA4gKKIIQ7KAHLVgEgAD6QGgdoA1FAAuAAGWv4Ikny5Iq +mRTKpYqZya0ooAADiAooghDsoActWASAAPpAaB2gDTUAC4AAZa/g0Q8AAP//XA2gCgUA0Q8AAGwQ +BPJdABXgGMUA+EAHnCczAQAU5HP0YAYSEgCdAAw5EQSZCCiSnvcAB07SAJ0AKZKdZJDYHOSIG+Sj +AioJDKoKq6pYZe/6QAQA0AkVAP0gAQTf+/UA4qQABIBxgACKogubAwuqAZoiiifTD9MPKqwwWFxm +4+RoFQE5gAAooADTD9MPA4gKKIIQ7KAHLVgEgAD6QGgdoA1FAAuAAGWv3IknZJBnKpkUyqmKmcmt +KKAAA4gKKIIQ7KAHLVgEgAD6QGgdoA01AAuAAGWv4NEPAAAAAAAA//9MDaAKBQAV5EKKWGqhNww5 +EaSZK5Kebr0+KZKd5JA6ZVv9AACbWGWfNWAAC9owWX02Za8q0Q/RD9EPAAAAAP/8aA2gCQUAwKBZ +gWGKWGuhvf//SA2gCQUAwJDAygysNPyhBhWv/w4AAAAAbBAEGOQnAgNHDDMRqDMrMoQZ5DAosAAq +sgEJiAoKIYwCCj4oghADAj78QGgdoA0lAAuAACI2hAwCANEPbBAEFOQYAgNHDDMRBDMIJDKEKkIB +JkAAKEAI+phoHaCpJQACBT4DAj55gSMY5BsIaAooghDqVAAKWASAAPxAaB2gDSUAC4AAIjaEDAIA +0Q/rJAAKUASAAFhlrvNAaB2v/zYAAAAAAABsEAQZ5BzTDymSRip60AqZKBTkMf8gABSwChUACpkC +KUa3+JboFaAFBQAF5DEBAgAjQrdmMAttCAUqQrdmoAJj//Mb5Cgitopj//wAbBAEWYCDEuPqE+QH +KSKC0w8JGo4DqAqIgAuAAGP/7ABsEAQqIgcqrBBYZqvRDwAAbBAEiCcijBDaIFhmimihAdEP2iBY +ZoQS5BULqBHoIggFAdmAAAzqMCsihSuyACKs/+y7CAlQBIAAWYZdHOQNKsJ/+kAEANALFQAAuxoL +qgIqxn9ZhozRDwAAAAD6AOIdoAsVAFhmYSwifywmg9EPAGwQBCYiBw8CAOZsECnQBIAAWGbE7DQA +CmgEgADuVAANWASAAO8iACtQBIAAWGYI0Q8AAABsEAQZ49CWIvRAZhWhhDEAF+PPqYgogIAHNwKX +IAhYDJgh0Q8S4+sD6DAE7jAFsTCTIJQhlSIS4+cT47OEIAQzApMgEuPlwDAoN0AoN0QoN0goN0wj +PQFyM+0DAgAS49/AMJMgxy8T494DIwMS496EIAQ0AZQgEuPchCAENAGUIBLj24QgBDQBlCAS49mE +IAQ0AZQgxy/AMQMjAxLj1oQgBDQBlCBj//wS49SDIAMTFA8zEZMgEuPRwDAjJgBX/9kQ49CRAJIB +kwKUAxHjzoIQAeowohEB8DHAQATkFgACABHjyoIQIxoAAyICkhAR48fAIZIQBOQxhAODAoIBgQAA +0jABIwAAAAAQ48KRAJIBkwKUAxHjwIIQAeowohEB8THAQATkFgACABHjuIIQIyoAAyICkhAR47jA +IZIQBOQxhAODAoIBgQAA0zABMwAAAAAQ47ORAJIBkwKUAxHjsYIQAeowohEB8jHAQATkFgACABHj +poIQI0oAAyICkhAR46nAIZIQBOQxhAODAoIBgQAA1DABQwAAAABsEAQkIBSjRCQkFNEPAAAAAFyU +AV2UAl6UA1+UAEMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAABckAFdkAJekANfkABTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAnJQAHZABnZQCnpQDn5QECJQFCZQGCpQHC5QAQwAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAJyQAZ2QAp6QBx2QA5+QBHiQBXmQBnqQB3uQAFMAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADclAAdkAHdlALelAPflAQElAUFlAYGlAcHlAgIlAkJ +lAoKlAsLlABDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3JAB3ZAC3pALHZAD35AEtJAFtZAGtpAH +t5AIuJAJuZAKupALu5AAUwAAAB//+/gA0jEQ//4KAAAAAAAf//xAANMxEP/+CgAAAAAAH//8iADU +MRD//goAAAAAAAD0MAoAAAAAAPQwCgAAAAAA9DAKAAAAAGwQCIgiJyAHKSIUmRPxEvwN4XcBABri +LGSRARbiLSqggAx4EeaICAVQ3QAA+RPIFeSqHQCqSuviJRVQCQAA+yAJ86AMpQAogp3oFgQkCdmA +AI2496AKOJIAnQAuYq7xz3AN4AkFACpireSg7mb7/QAA77YIJQeJgAArIBSkuwsLRyskFPVgCV5S +AJ0AizmJFPhiABWnxQEA+YAKgVa7HQD8geAA0AUFALBKbakFCACGCQJhiRMa4geJkOgSBCJj/QAA +6pkCDO4CgAANzQL9ACYV4AoFAG25B+mGBiRBAQAAiBTrMgEuTwKAAKmImBXpMgItjDIAAJoQ82AN +OFIAnQCLEOtLCAvnAoAA5swIBdv9AADrxp0qkASAANEPAAUMR2jCGIon+oBoHeAMBQDqrCAqaASA +AFhiQtKg0Q/AINEP6iQACdgEgADsRAAK6ASAAFhnx9Kg0Q8AAMCgDN407rYILXi+AACPImX/1Nog +/EBoHaAbxQBYatFj/8QAAAAAAP/7FA2gCAUAiCJlj7IrfBjqJAAJYASAAFhqyGP/ocCgWX6nG+HK +jbj5v/V4kAylAGP/si0hCf5CsBWv/wUAD78BD7gMKCQU76QDL3ECgADppAAu7gKAAP+mAA6wDBUA +DN0CnaH81aYVr/qSAI4nnhGF6fnCghWvyQUA7OEVJ2iBAAAJ2QGZEunJCApXAoAA6ogMAqhBAACV +6QiIMujlFCTJAQAA+KAIYuIAnQBoq0ClrCzM8P0gBNOiAJ0A7xIEIgyBAACwTm3pBQUAhg8CYSzS +AQ8CAAysCOjZBCZjwQAA+YAG7GIAnQDs1gEuKASAAGWOP2AAoQAA6xIFLOAEgADsFgYpUASAAFvu +64kWiBWLMeoWAC1vAoAArYjxf/MIUgCdANog7JQADFgEgABb7rqOEO6uCAqQBIAA7k4IC/8CgADm +/wgHc/0AAC72ndEPAAAABZkM/CCIFaT5HQBt+QUFIIYMAmOMEg9FDI8ULMxA6f8IAow9AACwWG2J +BQxAhg8CZYUSLNkECagMqFUlXDDl1gEubP4AAIkSwKDq1QQkyQEAAPmgJhXgBQUA+aAGFe/2DgCO +EQxVDPXBJhXv+74AhRIlXED1oCYV7/yaAAAAbBAEHeFhGuFhDwIALdKMLKLHKqFwo93qOgwO7kKA +AP2AAEZwCwUAK8QEK8QFWPGf+kBoHaALBQBb/GTRDwAAAGwQBPRCCBWkI0EA8loACT9TgQAEIgqE +JoIhBUQoCkQRpCLRD2wQBCkiEiYgB9NQ+D4ABHAFNQD1AAfokWYBAPXCgAWhieEA9QAH6JIAnQD0 +wAXqEgCdAAxpEaSZKpKe90AIKdIAnQAqkp3xToAN5zMBAC4hBx/hNv3CbgWq7gEA6OE2H3cCgAAP +7gKeoB7hM/pACBXgOQUAmaf5QKYVoB+FAJ+j/0BGFaAOBQCepuy7Ag3uAoAAm6QF3QKdoS0iEg2N +Qe6mCC7vAoAALaYJ6+EkG2cCgAAEzAglxp0qIhILqgIqJhLqIhApWASAAFi/TGgyGIon+gAiHeAM +BQD7RAAVoA0VAFhhatKg0Q/AINEPF+ELi3hqsVcMaRGkmSySnm7DXiqSneSgWmXj/QAA/OEGFa/8 +4gAAAC0aAA2ZAvhCRhXv+/YAAAAuKgAOngL+QkYVr/v2AI8iy/ZoMkXAINEPAAAAAAAAAP/7+A2g +CgUAwKBZfc+LeGuxnf/7sA2gCgUAwKDAigi4NPjhBhWv+3YAACtsGOokAAlgBIAAWGnjaTK5jCcr +yRSKyfmEABXvzQUA7ZkBBdhBAADrxRQlU8EAAOrGCSTJAQAAeasqLsEVGODlquqayZiggiD/wcYF +4AgVAO+mAikWAoAACCIC80AmFaACBQDRDxjg25iggiD/wbQF4AgVAO+mAikWAoAACCIC80AmFaAC +BQDRD2wQGJIQjiAV4NKJI4shiiIqFiIrFiT4JGYV4AQVAPQg5hWgCAUA+CCmFaAMRQD8IUYVoA01 +AJ0Z9CDGFeAPJQCfGPXBiAXgD6UA/iIGFeANtQD8IiYV4AzFAPwiRhWgCIUA+CHGFaAElQD0IeYV +oAl1APghphXgC1UA+iFmFeAKZQD6IYYVoAvVAPoiZhXgCuUAKhYU9cFgBaAJ9QD4IqYV4AhFAJgU +hhYrEiSJFSdhfiwSIiJhfweZKC9QgKkp+JyIFaOZAQADmQrukgAvUASAACZiPi0SI6juC2AAjhcs +EiQtEiIH7igvUIGuLvicqBWj7gEAA+4KjuAqFhbqEiMtWASAAKjuC2AAjhgsEhYtEiQH7igvUIKu +LvicyBWj7gEAA+4KjuAqFhfqEiItWASAAAjuCAtgAI4ZLBIXLRIWB+4oL1CDri74nOgVo+4BAAPu +Co7gKhYY6hIkLVgEgACo7gtgAI4aLBIYLRIXB+4oL1CEri74nQgVo+4BAAPuCo7gKhYZ6hIWLVgE +gACo7gtgAI4bLBIZLRIYB+4oL1CFri74nSgVo+4BAAPuCo7gKhYa6hIXLVgEgAAI7ggLYACOHCwS +Gi0SGQfuKC9Qhq4u+J1IFaPuAQAD7gqO4CoWG+oSGC1YBIAAqO4LYACOHSwSGy0SGgfuKC9Qh64u ++J1oFaPuAQAD7gqO4CoWHOoSGS1YBIAAqO4LYACOHiwSHC0SGwfuKC9QiA4uCPidiBWj7gEAA+4K +LuIAKhYd6hIaLVgEgAAI7ggLYACOHywSHS0SHAfuKC9Qia4u+J2oFaPuAQAD7gqO4CoWHuoSGy1Y +BIAACO4IC2AALhIQLBIeLRIdB+4oL1CKri74ncgVo+4BAAPuCi7iACoWH+oSHC1YBIAACO4IC2AA +LhIRLBIfLRIeB+4oL1CLri74negVo+4BAAPuCo7gKhYg6hIdLVgEgACo7gtgAC4SEiwSIC0SHwfu +KC9QjK4u+J4IFaPuAQAD7gqO4CoWIeoSHi1YBIAAqO4LYAAsEiEuEhMtEiAvUI0H7igoQvGuLvog +ZhWj7gEAA+4KjuDqEh8tWASAAJsRqO4LYACMES4SFC0SIS9QjgfuKChC8q4u+iBGFaPuAQAD7gqO +4OoSIC1YBIAAKxYjqO4LYAAuEhUsEiONEwfuKC9Qj64u+J5oFaPuAQAD7gqO4OoSIS04BIAAJxYi +6O4IC9gEgAALYACOESoWJCkSEi0SFY8VKxITLBIU6BIRJ/hBAADvFgUl2EEAAOsWEyZgQQAA7BYU +JEBBAADoFhEm6EEAAO0WFSTIQQAAKRYSjR+JHIgbjB6LHe8SECRAQQAA6BYLJmBBAADsFg4l2EEA +AOsWDSf4QQAA7xYQJMhBAADpFgwm6EEAAJ0fiRaNGY8a6xIHIqhBAADsEggm6EEAAO0WCSf4QQAA +7xYKIiEBAADvEgQmYEEAAOwWCCXYQQAA6xYHJMghAADpFgYn+/0AAO8WBC/iJgAAiRCPE4sSjpCI +k4ySjZGriKfMqt2v7p6QnZGckpiT0Q8AbBAEKSIV+KAABPA4dQDpjAwBIEEAAPMgAEU/iwUA66QQ +JVBFAAD5AAXTYgCdACsKAFl52SwiFSsiFO3NEQlABIAA/EJGFe6APQD9awANsAk1APpCZhXgCiUA +baoMjoQODo7uhgQkQBEAAA8CANMP0w9tmiHpggQkQEEAAIqBi4KMgwkJjgoKjgsLjgwMjpmAmoGb +gpyD60QACVAEgABb/raKIIgiiSGPIwgIjgkJjg8PjgoKjpognyMpJgHoJgIpQASAABnfhAIAhgMC +YfgAChXgCbUAbZoCCACK0Q8AAAAAAAAA/YEAFaALBQBZear4QGgdoAlFANMPbZoh6YIEJEBBAACK +gYuCjIMJCY4KCo4LC44MDI6ZgJqBm4Kcg+okAApYBIAAW/6U2kD/+/wNoDyFAABsEAYpIhX4QogV +oEYFANMP+IAARXWZAQAJZgx0qwGxiComFQYqDOgmFCVRQQAA9oAHs6IAnQDrNAALYASAAFl5ffhA +aB2gCUUA0w/TD22aIemCBCRAQQAAioGLgoyDCQmOCgqOCwuODAyOmYCagZuCnIMlLBDqJAAK2ASA +AFv+cQZHDPbgBY7SAJ0A5jQICtAEgAD24GgdoAMFAOQWACpABIAA+MhoHaAJRQAKAmcIQIYKAmUI +IIYKAmMIAIbqDAAJQASAAG2aIemCBCRAQQAAioGLgoyDCQmOCgqOCwuODAyOmYCagZuCnIPqJAAK +2ASAAFv+VOpUAAGYBQAA5mzAIiEBAADvbZpqQASAAIsQCjwRC8sI7HwMCtAEgABZeUXRDwAAAAAA +AOs0AApgBIAAWXlA0Q8AAAD2YABGMAMFAPwgBhWv/yYAbBAEGN8YGd8WGt8UE98XkyOYIpkh+kAG +FaALBQArJhUrJhTRDwAAAGwQBt4g5OIQKmAEgADnQgcr0ASAAPu+CgXgGDUA40IWKZAEgADncg4i +++kAAHj7JxjfBQj4CoiAmhOcEu4WASwAIoAAAJMQKrKV7FQACVgEgABZev9kpjfygsYV4AIFANEP +AAAAACviEgubUu4WASX/QYAAGt7u4xYAKVgEgADqorcq4ASAAFl68mSlyhre59sg6qK5KuAEgABZ +eu1kp0wa3uPbIOqiuyrgBIAAWXro90/ADeN2xQAa3t3bIOqivSrgBIAAWXriZKdXGt7Y2yDqor8q +4ASAAFl63SMqgONzCAgECoAA+0BJMBIAnQArMNnBWPVgL0hiAJ0AabchJTTZixD6gsYV4AIFANEP +kxAqso3sVAAJWASAAFl6zWSnn4sQ+oLGFeACBQDRDwCTECqym+xUAAlYBIAAWXrFZa8X+iBoHaAL +tQBYu1X6ACId4AMFAOqzOAUBiYAA6hICK1gEgABZeUjDsOzeuB0oBIAA/KBoHeAKVQBZfpTIWRze +s40RDFw2LNYXZTS1jRD8gsYV4AIFANEPLkByZO66kxAqsrHsVAAJWASAAFl6qWWup/ogaB2gG2UA +WLs5+gAiHeACBQDqsjgFAKmAAOoSAitYBIAAWXksLH0DKsUoZSRhjRD8gsYV4AIFANEPAACTECqy +o+xUAAlYBIAAWXqVZKLPGt6L2yDTD+qijyrgBIAAWXqQZa5C+iBoHaALVQBYuyD6ACId4AIFAOqy +OAUqqYAA6hICK1gEgABZeRIsQHPxgCn+0gCdAGSlN4oT+gCiHeAM1QBYuv3SoNEPkxAqsqnsVAAJ +WASAAFl6emWusvogaB2gGyUAWLsKZKPFK0By+2BA2BIAnQDqEgIrWASAAFl4/SxCF4sQK0YWCsw2 +/ILmFaACBQDRDwAAAJMQKrKn7FQACVgEgABZemZkokMa3lzbIOqioSrgBIAAWXphZa5Q+iBoHaAL +5QBYuvJko2PqEgIrWASAAFl45yt9Aiq1FIsQ+oLGFeACBQDRD5MQKrKZ7FQACVgEgABZelJkokoa +3kfbIOqipSrgBIAAWXpNZKPXGt5D2yDTD+qikyrgBIAAWXpIZa3q+iBoHaALdQBYuthkov0rQHJk +t4ca3jiLEuqi3ytgBIAAWXo+ZabpK0BzwMgMuwIrRHOLEPqCxhXgAgUA0Q8AAJMQKrKv7FQACVgE +gABZejNkog8a3inbINMP6qKRKuAEgABZei5lrYL6IGgdoAtlAFi6vmSilStAcmS3DhreHosS6qLf +K2AEgABZeiRkpx4rQHMsCv0MuwErRHOLEPqCxhXgAgUA0Q8AkxAqspfsVAAJWASAAFl6GWSh1xre +D9sg0w/qoosq4ASAAFl6FGSjKhreCdsg6qKrKuAEgABZeg9krD8a3gXbIOqisyrgBIAAWXoKZaws +wKX9vBAFoDsFAFl95Rrd/YsS6qLNK2AEgABZegJlpNiLESuyEguZUsiZaJIH+SARadIAnQCNEYwQ +K9YS/ILGFaACBQDRD5MQKrKH7FQACVgEgABZefRkoYsa3erbIOqiiSrgBIAAWXnvZayI+iBoHaAL +JQBYuoBkoZsa3eGLEuqi3ytgBIAAWXnnZaxnihP6AEId4AzVAFi6YdKg0Q8AAAAAAAAA+iBoHaAL +9QBYunFkoWLqEgIrWASAAFl4Z+sSACPgCwAAKsUV+oLGFeACBQDRDwAA+iBoHaAbFQBYumVkoTIt +QHJk1ZkpQHPxP+AvkgCdAPE/3+/SAJ0A6hICK1gEgABZeFUtQhgc3cf7oQAOsDsFAPyDBhXgClUA +WX2gixD6gsYV4AIFANEPAPogaB2gC6UAWLpPZKDaLkBy0w9k5PrqEgIrWASAAFl4Qy9BNvvgEIKi +AJ0AihP6AUId4AzVAFi6LtKg0Q8AAAD6IGgdoBtVAFi6P2SgmuoSASpYBIAA7BICK2gEgABYucaL +EPqCxhXgAgUA0Q8AAAD6IGgdoAuVAFi6M2SgaihAcmSEnhrdlIsS6qLfK2AEgABZeZllorgrQHON +EPyCxhXgDBUADLsC+o5mHeACBQDRDwAAAAAAAAD6IGgdoAsVAFi6IcqiGt2DixLqot8rYASAAFl5 +iWWq74oT+gAiHeAM1QBYugPSoNEPwKX9uwoFoDsFAFl9YMAg0Q8AAAAAAADqEgIrWASAAFl4CP1A +aB3gOwUA/br4BaAKVQBZfVbqEgIrWASAAFl4AfVAGDqSAJ0Axy/RDwAAAPogaB2gC4UAWLoB+gAi +HeACBQDqsjgFAUmAACxAcg8CAGTD1xrda+sSAitgBIAAWXlkZaK1LUBzwOgO3QItRHNlL22PEP6C +xhXgAgUA0Q8A6hIBKlgEgABYufdlr5orMNlj+gYAAAAA+iBoHaAbBQBYuedkrzooQHLTD2SDSeoS +AitYBIAAWXfbKUIZixArRhYKmTb4gyYV4AIFANEPAAD6IGgdoAs1AFi52WSvAhrdO4sS0w/qosUr +YASAAFl5QOPdRR0IhgAAixErshILyVHImWiSB/k/+QHSAJ0AjhGMEAO9AS3mEvyCxhWgAgUA0Q9l +LryPEP6CxhXgAgUA0Q/qEgIrWASAAFl3uipFNoIQ8oLGFaACBQDRDwAAAAAAAPbgAEGwCwUA+mBo +HaCMBQBZd0zqEgIp2ASAAFi6DyMqgKNzKzDZwMQMuwL6f2Ydp7sBAPp7Jh3v5CoAAAAjKoCjcygw +2fogSBWgCSUACYgC6DTZK1gEgABZd57DsPp7Bh2n2gEA/booBaAKVQBZfOtj+MqKEllrMP1AaB3g +OwUA/boeBaAKVQBZfOQqEgJZayrcoPogSBWj+9UAq3tZeQBkoaTAov26DAWgOwUAWXzbxy/RDxrc +8osS6qLHK2AEgABZePdlrhGLESuyEgvJUWiRCmiSB/k/8AHSAJ0AHtz5A70BDt0CjhGMEC3mEvyC +xhWgAgUA0Q8AihP6ASId4AzVAFi5ZdKg0Q8AAAAAAAAA+iBoHaALRQBYuXVkrXKNEf251AWgClUA +/aJIFeA7BQBZfLoa3NKLEuqixStgBIAAWXjX49ziHQVuAACLESuyEgvpUciZaJIH+T/r6dIAnQCO +EYwQA70BLeYS/ILGFaACBQDRDxrcwosS6qLPK2AEgABZeMdlrVGLESuyEguZUmiRCmiSB/k/6gHS +AJ0AEtzM+CAoFaKOBQCufgKyAiKGEi3g2fwgCBWgDxUAD90CLeTZ/ILGFaACBQDRD4oT+gECHeAM +1QBYuTDSoNEPIyqAo3MrMNnAwQy7AgsLR/p7Jh3v3UYAGtyiixLqoscrYASAAFl4p2Ws0YsRK7IS +C+lRaJEKaJIH+T/mAdIAnQAe3K2MEQO9AQ7dAv2CRhXgClUA/blUBaA7BQBZfHiLEPqCxhXgAgUA +0Q8AIyqAo3MrMNnAyAy7AgsLR/p7Jh3v25YA9uAAQrALBQD6oGgdoIwFAFl2tMFg6hICKtgEgABY +uXYrMNkGuwL6f2Ydp7sBAPp7Jh3v2r4AihP6AOId4AzVAFi4/dKg0Q8AihP6AgId4AzFAFi4+dKg +0Q+KE/oBQh3gDMUAWLj10qDRDwCKE/oBIh3gDMUAWLjw0qDRD4oT+gECHeAMxQBYuOzSoNEPihP6 +AkId4AzFAFi46NKg0Q+KE/oCIh3gDMUAWLjj0qDRDwCKE/oAwh3gDMUAWLjf0qDRD4oT+gDiHeAM +xQBYuNvSoNEPAIoT+gDCHeAM1QBYuNbSoNEPAAAAAGwQBCQiECsgB9MP8IQwDeG7AQAsMBAtMBHu +MBIuZgKAAA3MAu0wEy5mAoAADswCCMwRDcwCaMAfKSIS7dxWFMAogAANnQEtJhIuQAUvCpV/4U3A +INEPAAAoMBQpMBXqMBYsRgKAAAmIAukwFyxGAoAACogCCIgRCYgC/RdAAFCOBQApIhJ4lyfApf24 +hgWgOwUAWXwQwCDRDwAAAAAAAAD6gGgdoAtlAFjVgsAg0Q8AjScv2RSK2f2kABWvyAUA6MwBB/kB +AADv1RQlUwEAAOrWCSZhAQAAfKsGKdEVqpqa2R3cLtmg/AAIHeAMRQBtygIJAmEY3AyYoI8g/eAA +F7AIRQAI/wKfoS0wFC8wFRjcJOkwFi7uAoAAD90C7zAXLu4CgAAJ3QLopgIu7gKAAA/dAu2mBCHg +IQAA7AYABUhhAAAJAIooIhKPIg6IAugmEi/3xgAA2iDrvBgpYASAAFhk42P+4wAAAGwQBiQiEC9A +cvXgBriQm1UAHNwKLSIALjIGLzEL+GPwFaAKVQD4IAYVoDsFAFl7zxrcBCQiGCwxC4gsiUqFR/0A +AEQwCwUA+EGGFaANBQDlUg4kkEqAAC1GFAqeAv6BRhWgAB4AK0IU61oIAdiBAABZdfwuQhQtMQvT +D67dLUYUKlAELFAFGNvv61AGLVYCgAAMqgLpUActVgKAAAuqAuzb6h0uAoAACVUCCFUB9KBgFe/4 +xQD4oAQCsDsFAP6gaB2gClUAWXupKSITKDELK0IUqYjoJhMi+MEAAH+xPsAg0Q8AACpABXuh8xzb +2PxACBXgCiUA/oAIFaA7BQBZe5v6gGgdoAwlAPxMph2gCxUAWNUOwCDRDwAAAAAAAB7bzI1KDt0B +7UYKKVAEgABYzpn6QGgdoAsFAPwAAh2gDSUAWAHBwCDRDwBsEAYc28KNIC4yBfRA6BWnVQEA/r/A +FeAIFQAPjzn0goIVoApVAPQgBhWgOwUAWXt9iSLk264UhWmAAPigBQlSAJ0AiCeMiPsCpBWvzwUA +6YILJHCBAAAP7gGuquuJFCVRAQAA/SAIxCCtBQCtya27K4UU+UAIy+IAnQD7IAk0IgCdAJmI2cDk +AAUOQASAAPgAqB2gCqUACAJhCAJhCAJhCAJhCAJhCAJhCAJhCAJhCAJhGNtwbaoFAwCGCQJhmMCP +IP+3JgWgAqUA7sYCL/4CgAAC/wL/gCYV4AIFANEPAMAg0Q8mIAcX21oGBkHqMgUrRwKAAKeIKYKe +K6wfC0sU+yAFY+IAnQAogp3uhAAEBVmAACmsH/QACB2kSR0AbUkCCAJhiDQd206d4IkgHNtP6uYD +J1hBAADs5gIszgKAAOlJAgHggQAA6eYBKVAEgAALgAAMbhGn7uTmnSKUdQAAiif6AUId4AwFAPtE +ABWgDaUAWFuT0qDRD8Ag0Q8AAAD9IGgdoAsFAPsBZhXv++YADK0M/c8ADvDvBQCv3f0BBhXv+5IA +L+xA/wEGFe/7ZgD//VwNoAgFAAAAK2wY6iQACWAEgABYZB1j/m8AbBAEhycf20YqeRQpcRX44QgV +oK0FAP1AAEV/zgUA6pN0c9iBAACMew67AeuZCAwwBIAA6MFldMkBAAAqdRStinqTaHmhepp47wAF +CzgEgAAHAmEHAmEHAmEHAmEHAmEHAmEHAmEHAmEHAmEHAmEX2w6XYIUgk2WUZPO2ZAWgB6UA4mYC +Kq4CgAAHVQLlZgErEASAANEPwCDRDwAA94BoHaAIBQD44WYVr/6CAAiaDPtvAA0w7AUArKr64QYV +r/4uACy8QPzhBhWv/gIAbBAEx48IWAMIOAIISAOoaOgiCAuBCoAAAiIYojLRDwBsEAQEOAMIWAOo +aOgiCAuBCoAAAiIYojLRDwAAbBAEBDgDCFgBCEgDqGjoIggLgQqAAAIiGKIy0Q8AAABsEAQFSAMI +OAEIWAOoaOgiCAuBCoAAAiIYojLRDwAAAGwQBCMiECsgBygwBfwRYh3gmSUA+QWeDeG7AQAsIGT9 +hD4N4I4FACkiEnifFnCfG3+WSx7a8w6eAf5CRhWgAgUA0Q8AwCDRDwAAAAD9tdwFoApVAPxgCBXg +OwUAWXqsLzAFKAqVePHb+mBoHaAJJQD4TKYd4AsVAFjUHcAg0Q+NJy/ZFIrZ/aQAFa/IBQDozAEH ++QEAAO/VFCVTAQAA6tYJJmEBAAB8qwYp0RWqmprZHdrK2aD8AAgd4AxFAG3KAgkCYRjap5igjCAZ +2sT8AIId7//1AO+mBC5mAoAADcwCnKEoIhKPIpmiDogC6CYSL/qmAADaIOu8GClgBIAAWGOKwCDR +DwAAAGwQBBPavwMiAtEPAGwQBicgBygiAhnah/RCCBXhdwEA5YKVa9cCgAAJqggoop73ABRa0gCd +ACSinejaixIUAYAAJiISLCIJ+kFIFeBmQQAIZgomYoDsuwwDMMEAAPdgENuiAJ0AKyAWKAr/eLEN ++kDwFaAMBQBYYwpkolIe2qItIQca2qEf2m/7tOQF6t0BAOghGi7vAoAAD90CnUD8QAgV4EwFAJxD +m0L7pgANMAdVAOpGBC7OAoAAB5kCmUH+QkgV4DsFAJtFmEb+CAAGcv9RAOb/EQ5mgoAAD8wCDswC +nEcqIhWMKaaqpswsJgn6QqYVr+kFAPiADfxiAJ0ALzIE/bUEBaAIFQD54CAV4A4FAOmOOAvQBIAA +WXo7Ftpt+IQAFe+NBQD2AAgdoE4FAAkCYQkCYQkCYS1EIf6EBh2gCQUAKUQnKUQmKUQlKUQkL1IS +/odmHei/HQD6h0Yd6LsdAPqHJh3oux0AK0Q4KiIW+ofmHaiqHQD6h8YdqKodAPqHph2oqh0AKkQ8 +jTQY2lTq2mASYKEAAPWgB4gQ+/UALTwYDQCIDACKK0QwKkQx+IZGHa//9QAvRDMvUhKOX400/bSo +BaAFBQD4QsgVoApVAPggBhWgOwUAWXoL/GCIFajVHQAtRCIlRCP8huYdqMwdAPyGxh2ozB0A/Iam +HajMHQAsRDTmAAUCWQEAAAsCYSogBwoKQRvaBwyqEauqJ6adKyAWKQr/ebEK+kDwFaA8BQBYYoaO +NGjgKYon+gCCHeAMBQD7RAAVoA1FAFhaVSsiEiz6fwy7AfpCRhXgAgUA0Q8AAB7aLS0iEg7dAvxC +RhXv/yYAAAAAAAAAAOokAAtYBIAAWGKnZK3aYAArjl8a2hyx7p5fCuoC+oZmHaiKHQD4hkYdqIgd +APiGJh2oiB0A+IYGHa/8MgDAINEP2iDsJAAD2GEAAFhi1sAg0Q8A2iDrfBIpYASAAFhi0cAg0Q8A +AAAAbBAEKiIUKSIT/bOiBac1AQDqmQwBlB0AAGSQeCsgBwsLQQy6EayqLaKebtJuKqKdFNnnH9nL +7dnNFQMRgAAuIQcODkrklAIPdwKAAA/uAh/Z+p6g/kAIFaAYBQCYo52ilKUd2cn/xgAP8AQlAO+m +BC92AoAABO4CnqHtABUFUGEAAAoAigy4EayIJIadLyIUqf8vJhRpMg/AINEPiSLKkGgyL8Ag0Q8A +iif6ACId4AwFAPtEABWgDRUAWFoB0qDRDwArvBjqJAAJYASAAFhim2kyz4wnLckUisn7hAAV784F +AO67AQboQQAA7cUUJVPBAADqxgkl2QEAAHurKi/BFRnZnar6msmZoIgg87OYBaAJFQDipgIsRgKA +AAmIAvlAJhWgAgUA0Q8Z2ZOZoIgg87OGBaAJFQDipgIsRgKAAAmIAvlAJhWgAgUA0Q9sEAQsIGQo +Co75gAXkIgCdACkgBR3ZuOrZuBSFcYAAKyISDbsBKyYSjTkuIhMrMQv9QAYA4AMFACoiEfvAAEdw +n6UA7iYTJQbpgAAuoAX/wAQUYJi1APnPRg2gmWUA+c5GDeCLtQB7yWqMrH3PA9Iw0Q+Iq9sw/AAC +HaANJQALgAArIhQqIhMZ2Z0Lqgzs2ZwVWQMAAHuTE3rDEPJCJhXgAgUA0Q8AAAAAAAAA+kBoHaAL +BQD8AAIdoA0lAFv/ffJCJhXgAgUA0Q/AINEPAAAAAAAAAP1ACBXgOwUA/bMUBaAKVQBZeTzyQiYV +4AIFANEPAAAA/bMKBaAKJQD+QAgVoDsFAFl5NCoiEC2gBS4KlX7RtcDy/kymHeALFQBY0qbAINEP +2iBYzDZj/1RsEAgrIGQoCo54sQ0pIAUd2XTk2XQcgFYAAMAg0Q8AACwiEikiEQ3MAuwmEiY07oAA +jSyONiUwIP5hRBXv+MUA/cjmDeWlAQAqIhAvoAUoCpV48cXAkvhMph3gCxUAWNKLwCDRDwAAAOSS +hGHQgQAAiZeJnvkmABXgC2UAwCBtuQUKAIYJAmHRDwAADw9OL/zb+eAEB7COtQD/YBOcICclAK/Z +9YYADDA2FQD4QYYV4CxVAPhCRhWgLRUA/UJGDeAPBQB8oQp2oQf3QCAFYgCdAC8wMCgwMRTZROkw +Mi/+AoAACP8C6DAzL/4CgAAJ/wII/xEI/wL14Bu2KI+5AP0QABQ1TwEACEQCGNj1KYKTKIKjpJQJ +RBGkhCRMgC5ABfRCJhWgmaUA+cAZbGIAnQApCpv5wBkUYJhlAPnAGNQgibUA+WAYlWIAnQArCpn7 +wBk9YgCdAP1ABlRgBUUA/UAGFCIAnQApMEEuMEAvMDwrMD3oMD4vdgKAAOnuAg/+AoAAC/8CKTA/ +6zBCL/4CgAAI/wLoMEMvdgKAAOvuAg/+AoAA6f8CD3YCgAAI7gIP6AzrIhAkBKuAACiyE5gVf4EI +CPkMZpACL7YTL7IUDwIADwIAfvEID+gMZoACLrYUiUwFmQKZTHyhUPdACyQiAJ0A/UARRGIAnQD3 +QBTkYgCdACoQENMPZK4RikcpPCD7QcgVoAs1AG26BQkghgoCY8Ag0Q8AKzAjwOEL6zkrREErFBD9 +X/mFIgCdAC8wIX/3qC4wQSswQCwwPC8wPe0wPi3eAoAA7rsCDmYCgAAPzAIuMD/vMEIuZgKAAA3M +Au0wQy3eAoAA77sCDmYCgADuzAIN3gKAAA27Agy4DOoiECQEi4AALaITfNEIDc4MZuACLKYTLKIU +e8EIDL8MZvACK6YUKjA4KzA5iUzsMDotVgKAAAuqAuswOy1WAoAADKoC6NjHHVYCgAALqgLlmQIF +UAUAAComFplM+IFmFa/8WgAAACkiGImXKzELiZ6/uwtLS+W9eWTIwQAAY/0PAAAAAAAA+ABiHaOc +4QD5H+wuYgCdACgwJCkwJeYwJixGAoAACYgC6TAnLEYCgAAGiAIIiBHpiAIHsBEAAPjNAA+/9VoA +ACkwIfEgDA4SAJ0AKjAkKzAl7DAmLVYCgAALqgLrMCctVgKAAAyqAgiqEQuqAmWhVyswTCwwTe0w +Ti3eAoAADLsC7DBPLd4CgAANuwLqIhAt3gKAAAy7AmS8oCyiGfuf5NPiAJ0AK0YSLjBIKDBJ6TBK +L3YCgAAI7gLoMEsvdgKAAAnuAu/Yhx92AoAACO4CLkYUKDA2LTA0KjA1/mbwFaAJBQDpRhUu7gKA +AArdAulGEy7uAoAACN0C70YLLu4CgAAO3QL8gaYV7/eiACgwOCkwOeowOixGAoAACYgC6TA7LEYC +gAAKiAIIiBEJiALv2G0UQAUAACgmFv6BZhXv9s4AAAAAAAAAAPyACBXgClUA/bDMBaA7BQBZeBDA +INEPAP/yVA2v5KUA7NhhH2gEgAD+gAgVoAolAPQgBhXgOwUAWXgGY/uxAAAqMDgrMDnsMDotVgKA +AAuqAuswOy1WAoAADKoCCKoRC6oC6dhRFVAFAAAqJhb4gWYV7/T+ACQiGP5CJhXv9NIAKiIQY/ts +AABsEAYqIgcmIAcPAgAoqRQGBkEPAgDjogkkD/mAAPVByBXnhQEA+QAYOVIAnQD9sHoFoDsFAO2i +AilwBIAA/kAIFeAKVQBZd+H9sHAFoApVAPxgEBXgOwUAWXfcJDAhwKX0wAACMDsFAOzYMRpoBIAA +WXfW6dfhG1AEgAD0wA0SEgCdAAxrEQm7CCiyng8CAA8CAPcAFlJSAJ0AK7KdZLKd9IANYJIAnQD0 +gAshEgCdAPSACuKQDgUALSEHJiAHGNgd/EEEFardAQD2IAAHsGYRAOpmEA/8AoAA78wCDu8CgAAG +3QIf2BMIzAIW18oP3QKdsIcg92BGFaA/BQCfs5y0mLb84AATsAhFAOh3AgXogQAA92AmFeAHBQDn +tgUp4ASAAOe2By9GAoAADCCGDQJjDACG/ACoHeAMRQDA0g2IAui2CSXZAQAAKhYABYCGCwJpBWCG +CwJnBUCGCwJlLhIAH9emDO4RD+4I7OadIdChAABZdvmaEfWv4AXvywUA9IAGsp+WZQD0gAe4kgCd +AP5BiBXvk3UAIyQFI1KK5iQFJ/zAgAArIhIuMiQLikT7WgANMAwFAP9AAQUwDRUA+0AIFa+7gQBY +V6n2QkYV78sFAI8gjieXLChSdOflFCdogQAAC90B6PsMBukBAACd6f3BBhXgDAUA+mIoFaANFQBY +V5suMhKw7v5iRhWgAgUA0Q/+oFAVr/qSAP/4BA2gAwUAABfXdIx4lhD3gAngkgCdAAyrEam7L7Ke +9+AKQlIAnQArsp1ksT+wzZ14Zb5SYADt/hBCHa/5kgD9r3IFoApVAPwgKBXgOwUAWXdYiirsEgEp +WASAAFl2yPv4Ah3v/EoAAI03jDbqIgopcASAAFgnEY4R7NerHSAEgAD8gAgV4DsFAP6BSBXgClUA +WXdIjkwjUormRAUnfTqAAItAiEeXTPyuiBWvyQUA54UUJHiBAAAJ/wHsuwwH+QEAAJ+I/wEmFeAN +FQD6YigVoAwFAFhXXyoyEvtf4BWvywUA+mJGFa/6PgAAK0ISLjIkC4pE+1oADTAMBQD/QAEFMA0V +APtACBWvu4EAWFdR9oJGFe/+OgArIEAIuxD6YAYV7/POAIwiZMBP/GAIFeAKVQD9rvwFoDsFAFl3 +HsAg0Q8AAAAAAAD/9OQNoAsFAMCgWXP/jHgZ1yKKEPmf9cCSAJ0A//soDaALBQDAsMDaDc00/OEG +Fe/67gCPMNog/67YBaf/wQDvJEApYASAAO42ACNYYQAAWGANY/+NAAAAbBAGiScmIAcomRQGBkHn +kgkkC3GAAAUIR/kADOlSAJ0AKiBBE9cH+gCCHeAEBQDxWVwN4AwFAPTACmoSAJ0ADGoRo6otop77 +oBAr4gCdACmineqUAASNeYAALSBBnBDrFgEuji4AABTW/R3XQykhBy8gBxXXQvhBBBWqmQEA/iAA +B3D/EQDq/xAMzwKAAO+ZAg90AoAADogCBYgCDZkCmaCOIJiklab1QEYVoD8FAP9AZhXgBAUAlKX1 +QOYVoA9FAOXXLx92AoAAD+4C7qYBJUiBAAAHIIYJAmMHAIYJAmH9gAAUsA0lAA2ZApmpDGgRA4MI +Kzad/EGIFe+fdQAvJAXysUgV755lAO4kBSb8rIAAKyISLjIkC4pE+1oADTAMBQD/QAEFMA0VAPtA +CBWvu4EAWFbgJCYSiyCOJyQmDPyuiBWvzwUA5OUUJ2iBAAAP3QHsuwwG6QEAAC3mCf3BBhXgDAUA ++mIoFaANFQBYVtEiMhKwIvJiRhWgAgUA0Q8A//pIDaAHBQAV1q2NWPegBjiSAJ0ADGoRo6ooop77 +AAbT4gCdACqineSg0Wbz/QAAnlj5QGgd7/pyAC8gQAj/EP7gBhXv+XYAip4koAQsoAUY1sfroAYq +JgKAAAxEAuqgByomAoAAC0QCCEQRCkQCCEQBK0xn+o4ADfCMlQD7YIAV7/jaAIlw2iD5rcQFp5nB +AOkkQClgBIAA6HYAI1hhAABYX4LAINEP7UQAAmEhAADrTGcpcASAAP7gaB3kux0AWXZPixH8IAgV +r/h6AAAAAP/3+A2gCQUAnBD6ICYV4AoFAFlzU41YixGMEPm/+TCSAJ0A//zsDaAKBQDAoMDqDt40 +/qEGFa/8sgAAAGwQBIknJCAHKJkUBARB55IJJArRgAAT1mf2gGgdp4UBAPkAC7lSAJ0A9IAKOhIA +nQAMSRGjmSqSnvdADPpSAJ0AKZKdZJFiKiAHKCEHH9ZgG9an+UAABDDKEQDqzBAMRwKAAAyIAguI +ApiQjCD/IEYV4D4FAP8gZhWgDUUA7tacHmYCgAANzAKckSsgQfxBBBWgBAUA/yDGFaH6AQDklgUv +/AKAAO/MAgTQgQAA7swCDYkeAADAsJSX/SCGFaAFJQAHIIYKAmMHAIYKAmEIvxEF/wIV1oifmQxu +EaPuLead+EGIFa+cdQAsJAXysUgV75plAOokBSR8rIAAKyISLjIkC4pE+1oADTAMBQD/QAEFMA0V +APtACBWvu4EAWFZCJCYSiyCOJ5Qs/K6IFa/PBQDk5RQnaIEAAA/dAey7DAbpAQAAnen9wQYV4AwF +APpiKBWgDRUAWFY0IjISsCLyYkYVoAIFANEPAAAAAAD/+pgNoAcFABXWD4pYaqFnDGkRo5kokp5u +hG4pkp3kkGplW/0AAJtYZZ6vYAAPAAAsIEAIzBD84AYVr/oOAI5w2iD9rK4F5+7BAO4kQClgBIAA +7XYAIlhhAABYXvbAINEPAAAAAAAAAPoRIh3v+34A//mQDaAJBQDAoFlyz4pYa6GN//6IDaAJBQDA +kMD6D680/qEGFe/+TgAAAABsEASKKo6vGNZA6CYLIUiBAADp5gAleOEAAO8mCClYBIAA/kEmFaAM +BQD5QeYV75iFAPhAph2gDSUAWF8HwCDRDwAAAGwQBBvWMSoxDCuyfxzWDvhiEBXgFGUA+0PWDeAF +BQB8oRbqJAAK2ASAAOw0AApoBIAAWMr4wCDRD2iRSGiSKGiUCsBA//9oDaAFBQAAfKHRe6vO2jBY +yyXVoP//EA2gBAUAAAAAAAAA/UDmDaAUZQB7owJgAAHAQNowWMs5//6EDaAFBQDaMFjLSeWkAAUB +EYAA/awcBaAKVQD8YCgV4DsFAFl1pv/95A2gBAUAAAAA//24DaAExQBsEAQpMBPxJnAN4PWFAGiR +BMAg0Q8AhCeEThzV/+0wESJIDwAA/T+GHeAKVQDuMBIiQBMAAP8bph2gOwUAWXWR/GIwFaP61QDq +SggB2GEAAFjLSqU7/GJQFaTa5QCqSljLR+okAApYBIAAWMtPwCDRD4QnDwIADwIAJEIOHNXoLTAR +LUQC/mJQFaAKVQD+gGYdoDsFAFl1e/xiMBWhyoUA6koIAdhhAABYyzSlO/xiUBWiqoUAqkpYyzHA +INEPAABsEAT0WwId6LMdAPRAAELwSgUAI1R/K1R++q9GHaBENQD0r6YdoAh1APivhh2gCQUAKVR7 +0Q8AAGwQBI84/auQBaAKVQD8YhAV4DsFAP/gaB2h//EAWXVbKTAQ/SGAANACNQBokj3AINEPANow +WMvc/18gDeAIdQCLp4u+LLKODJlW+QLgHejcuQB9IA/7YEAl4AwFAFjLqMAg0Q8AWMsSwCDRDxLV +sIM2IiJ/CTMRoyKCKoIoLiIS//GCHeCDBQDvJGQnYJyAAIon+gCCHeAMBQD7RAAVoA1FAFhVoSsi +Eiz6f9MPDLsBKyYSjCcuyRSKyf2EABXvzwUA790BB3EBAADuxRQlUwEAAOrGCSbpAQAAfasGKMEV +qoqayRzVXNmg/AAIHaALRQBtugIJAmEf1Y4b1TiboPhACBWgCQUAKaUIKaQS/QAAFDAJRQAJiAKY +oS4iEo0in6ID7gLuJhIu+DYAACsgB/pAaB2huwEA67wYKWAEgABYXhnAINEPAABsEASILiMsOHOJ +BcAg0Q8AAIsuiLPsRAAK6ASAAOu84ClQBIAAC4AAjCLtIAUufu4AAGTf1Y4uc+nWY//NAAAAbBAW +KyAHIxYa5RYXKkgEgAD4ISYV4AoVAJofFdVkJhIa/CLoFeG7AQArFhaHZfjAiBWj/vUA+qyEFafd +AQD2weQVoHf5APgKAAGwyFkA/CNmFaxIHQD6jwANMLZ5APoiZhXvqgEA6hYUJFRKgAAGC0n6IcYV +4AAmAAAAAJ4eLhIaLRYVL+E9KOAdKBQALxYSLuIfLhYQ9aA7IRIAnQCJIvsgQKCSAJ0A8OVgDeAM +BQDsFhEjgEmAANpAWM1b9AACHeAGBQAuEhvacPwAYh3gDCUA7tw5CdgEgABYzUn3QABDMA/1AHbw +VfQhBhWkhh0A4xYHJEAFAAD4IwYVoAE+AAAAKRISZJdDKhIaiqV9pp/8IggVoAsVAOsWESpQBIAA +6xISKOgEgABYzXBmp3H8AGIdoAUFAArFOmRXW8NglBjyIOYV5NYdAC0WGC8SFh7UtxPUt+kSGC+g +BIAA9eAIchANpQAM9hGjZihinvkAQUPiAJ0AJmKd22DmtAAFvIGAAI/omxX34Dy4kgCdACgyrtMP +6hIJJDrRgAArMq3kt1Fny/0AAOnmCCW6oYAAKSAU0w+qmQkJRykkFPUgO75SAJ0AKxIbLhIU8WDA +DeANNQD/oD5gogCdAGRQyI8XDwIADwIAyPFkUGPrZAAJUASAAPwAYh2gHYUAWM1w7hIOLXgEgADm +Eggir1mAACgSE/upGgXgDAUAnPKc85z0nPXrawIPVAKAAOv2ACxAgoAACogC7NTfGs7CgAD5BgAM +cApVAPngJhWgG8UAWXRuLRIV+aA46VIAnQDAIO4SGCp/AoAAo/8u9p3RDwAAAAAAAI/o9+A5oJIA +nQDpEhgqNwKAAKNmKGKe+QA5++IAnQArYp3mtAAFueGAALD4mOj6wGgd7/tmACoSEWSgeusSBSlQ +BIAA/ABiHaAdhQBYzUAY1L0W1LsrEACOGBnUvPbZiBWh+x0A6O4CD/sCgAAJ/wLmtgsF/KSAACwS +EO0SEiNb/wAAKLI/K7F9nqCfoZ2inKObpPlAphWgAHYAAAAsEhAtEhIrYQWIY56gn6GbopijnaSc +pSasGC0SE4weAt0Q7RYKLmQCgADsFgsrpv4AABrUQfghCBWgDwUA/iDGFeAPJQCfHQqIAigWDOtk +AAlQBIAA/ABiHaAdhQBYzRSNHC8SGokWKxIaj/XxNWAN4/71ABzUj4u0/0BGFaCPmQD9QAYV4G+J +AP1AJhWg36EA8NAAEzDPkQDu1Ice6UKAAO6mAyxBAoAA/QYADHm7AQDrpgQuYMKAAAxmAghmApal +jB3pnAElMGEAAOkWBiZj/QAA7BYNLnu2AADrZAAJUASAAPwAYh2gHYUAWMzxFtRyiRqPG/ohiBXg +DQUAnRGdEp0TnRSdpP1AphXv/vUAnqKeo5ugLhIa6f8CCsbCgADo/wIA4DEAAOb/AgDYIQAA7RwQ +JTBhAADvpgEg0BEAAFjLwcDB6so5DSgEgADZoOoWHiKgOYAAJBYf/gAiHaANBQAJ7TjlFiAm6zmA +ABPUVIgbjBoa1FMrEhuEGBXUTPF4ABSwDhUA6+s5CieCgAD0hgAKdg8FAAuvOf0mAAywDTUA+SYA +DDAMJQAL3DksFh0J+QIpFhn55gAPsAUFAP4jhhXgAyIAD1ZQ/hgABfDPyQD8IYgV4I+xAP1ABhXg +73kA7O4RDEQCgADrzBAN2oKAAOy7AgszwoAA+MYACzDPgQD9iAAWMY9pAOzuAgxFAoAACO4CHNQm +nKEoEAAG7gL7xgAPcG+5APTIABM7vwEA98YADzAGJQDm7gIN3QKAAO6mBCxCAoAAC4gCmKUb1B6b +ohjUHvlAZhWv+aYAAAAAAAAAAJmhlKCeop6jnqSepZ2mnaedqJ2pLxId5VwBJTChAAD+oBGcYgCd +AOtkAAlQBIAA/ACCHaAthQBYzIXkUFFqzsKAAPSgCmCSAJ0AKxIcx+/7JgAM8A0FAOOZAgv9LgAA +jRMsEhqOEo8Ri8wswhCZoZup9UAGFaAIBQCYopimn6OepJ2nnKWMFP1BBhWv/iYALRIbLBIZG9P1 +DJkC65kCBoQZgADw4kAN7/71AJmhlKCeop6jnqT/QKYVoA0FAJ2mnaedqP1BJhXv/TYALxIaIhYh +K/IWJvE4IvE6LPIV6PE5KzQCgAAGIgIm8Tst8hvu8hosRAKAAAhmAijyFy/yGZ+inqOdpJymm6eY +qJalmaGUoJKp8iQoFa/79gAAAAAAAAAA8OJADe/79QCZoZSgm6Kbo5uk+0CmFeAIBQCYppinmKj5 +QSYVr/s6ACwSGo0SL8E7JsE5KME4LsE668IYKzQCgADm/wIMRAKAAAjuAibCFIjMLMIQm6SYp5ao +maGdopSgnKOfpZ6pjBT9QMYVr/oaACsSG+wSGSWDUYAAG9Ozx+/9JgAMsA0FAOuZAgOA8YAAmaGU +oJ6inqOepJ6lnaadp52o/UEmFe/5MgAuEhoiFiEt4hIs4hMr4hiI7YbuL+IUgu8u4hGeop2jnKSb +pZimlqefqZmhlKCSqPIkKBWv+FYAKxIcx9/7JgAM8AwFAOOZAgOA8YAAmaGUoJ2inaOdpJ2lnKac +p5yo/UEmFa/3mgCZoZSgjhP+ICgV4AgFAJiimKOYpJimmKeYqJ+l/0EmFa/3CgAqEhoZ04WKpRPT +GSUSIOQSHyVMMIAA49MVE4O5gAAc03+LGAy7Avs/RhXv57YAhR/A0vetAAr/6EYAwKX9pvIFoBvF +AO5OEQpoBIAAWXL8Y/iHAAD6IogVoA4FAJ4RnhKeE54UWMrEJBYf5RYgJWIxgAD6IogVoAsFAFjK +tyQWH/QkBhXv8MIALxIQZfi1Y/haGtM4iBgKiAL5P0YVr+XqAMCgWTE4yKcb018rsIBksFoqEhRY +yrDpEh4tXx4AAPoiiBWgCxUAWMqk+CPIFe/vQgAAAP/gpA2gNgUA6xISKlAEgADsEhAo6ASAAFjL +bWP4dwAAKxIajBntEhcpUASAAFhYwtKg0Q8AAAAA+6aOBaFLFQBZXZksGgAMrAL7poQFoUsVAFld +mWP/hQDAsA34NOjmCC3FpgAA2iD8QGgdoBvFAFhUoGP/qisSFtog67wYKWAEgABYVJtj/5fAoFlv +nx7SwY/o+f/C+JANpQBj/8eMHy0hCf5CsBWv/wUAD58BD5gM6CQUL3ECgAD/YGYd4AgFAOi0AC7u +AoAADt0CDN0CnbH8daYVr+FaAIonjRnAwOqsIC7YBIAAWFMI0qDrEhgqZwKAAKPMK8ad0Q8AAAAA +AAD/32wNoAYFAP/g3A2gBUUAwKBZb30e0p+P6Pn/xhCQDaUA/+N4DaAGBQAAAAAAAAD/4xANoAsF +AA34NPnBBhWv4xYAAGwQBBTS5IIgJEJ/E9MCBCIMAyIC0Q8AAGwQDBjTABnS/iiAfSqSeymSg/1I +ABUwhAUA6pkIBHw4gAD1IABCMAAuAAAAJCqApJQY0qnoAAUIyASAAAkCYQkCYQkCYQkCYRnStCpB +Kx/SfBvS7XmhahjSyI4gmxD+IEYV4AlFAOgWBi92AoAACekCmREvQAcPD0EA/xEPrwII/wKfFAjq +MBzS4QPuAvggphWgDwUAnxcrIDX+IWYVoA0lAJ0ZDLsC6xYIIZxtAADqRAAI2ASAAPwAgh2gDSUA +WE8V0Q8AACssNvonQBWgDGUAWWyNY//XAAAAAABsEAYoIAUtIAfBlA8CAPkADrVh3QEAKSICZZGT +LjABFtJQ/8FABtAMpQAvIE5l8lfu0kseyASAAPWgCdISAJ0ADNoRpqooop6dEPcAEZTSAJ0AKqKd +56QABQ0BgACL6JkR92ANMJIAnQAtYq5k0VgqYq3koVRl+/0AAO/mCCUKuYAAKyAUpLsLC0crJBT1 +YAy90A0FABjSNx/Sp44g/eXGFeALRQDo7gIPVgKAAAuqAhvSoi72NOr2LSvoBIAA6w8eDdAEgAAN +AmcLQIYNAmULIIYNAmMLAIbtDAAD2QEAAArghh3SlgsCbwrAhgsCbQqghgsCawqAhgsCaSohCS8g +By4wASgxASshJP4gAAcw/xEA6v8QD3QCgAAP7gIOuwIf0oguISINuwIrdiAP7gKNICp2I/jkhhWg +moUAqnoY0hYudiL9oAAWsA4lAA7dAi12IYszK3YlCACJCgCKDJoRpqr9U6YVp4UBAPkAB5lSAJ0A +wCDRD4vonRH3YAjQkgCdAAyaEaaqL6Ke9+AJhNIAnQAqop1koSewv5/o56QADXXuAAD8IAYV4AFG +AAAAAADqJAAJ2ASAAOxEAAroBIAAWFfP0qDRDwDAoAy4NOjmCC11jgAA2iD8QGgdoBvFAFha22P/ +ygAAAOokAArYBIAAWFku0qDRDwAAixDaIOu8GClgBIAAWFrRY/+kwKBZbrAe0dOL6IkR+X/ycJAM +pQBj/7IAAAAAAAD4QrAVr/4FAA6+AQ6/DC8kFC8hCe2kACxBAoAA7qQDL/4CgAD55gAPsA4VAA7/ +Ap+h/tWmFa/44gCKJ+tEAApoBIAA+0QAFaAMBQBYUhfSoNEPAAAAAAAA//dEDaAKBQDAuAubAvpA +RhXv/H4AAAAA/CAGFeAKBQBZbose0a6L6I0QiRH5f/aQkAylAP/7kA2gCgUAAADAoAy/NP/BBhXv ++1YAAGwQCCkgBSYgB+c0AAnABIAA+gKCHaADNQD7IA89IWYBAAUJR+XRnBSUUQAAjCLkZAAGBBGA +AMAg0Q8AAC0iHWXR2Ygni4j9AqQVr80FAOmCCyR4gQAADf0BrcztFgImYQEAAPsgDixiAJ0A7okU +Kk8CgACZE6uaqe4uhRT7gBDjogCdAMl0yULZsG1JBQcAhgkCYS0SAyryAA2qCP1AE6QiAJ0AmvD5 +YGgdr/4KAAAAAAAAAOxqEQMkoQAABaoILqKe98AKcdIAnQAqop3Pq9og7CQAA1hhAABYWmnAINEP +F9FsiXiYFPcgEAiSAJ0ADEoRpaorop73YBBR0gCdACqinWSiAbCbm3hkr8IZ0YSZoI4g/aOyBeAP +FQDvpgIvdgKAAAPuAp6hjoMt0n/9os4FqO4dAK7dHtFe7aYDJUhBAAD8AAoVoAgFALGI6YMeDA/o +AACephjRyflBBhWgHwUAn6eNIAjdEQPdAp2p6SIHKmcCgAClzCPGnSsgBo0iwOHu3QIF2AUAAOsk +BiTIgQAALJkE+SAoFa/LBQALmwHtJgImYMEAAOyVBCRDQQAA6JYBJdkBAAB7iyUqkQUd0T6oqJiR +nYCMIBvRruuGAi5mAoAAA8wC/QAmFaACBQDRDx3RNp2AjCAb0abrhgIuZgKAAAPMAv0AJhWgAgUA +0Q8AAAAAAOokAArYBIAAWFh00qDRDwD/+tQNoAoFAPiwyBXgGJUA+CAmFaABBgD7IGgd4AoFAPsB +ZhWv+boAKFKEK4AIKYAH+CAGFeCsJQB8sS4Y0YaIgMCgC4AAihCJEQqZDOkWASTu6YAAK1KCf7cJ +LFKCf8/GY/3JAFlpe2P/7y+BCy/8+A8PQ+/8/CTz/QAAD+k4+CAGFe/+5gAA68oMA4G5gAAKTBTt +zAgrwASAAO1NNg3IBIAA0w9t2QUIAIYJAmGJEqp47E4MBMkBAABt6QUIIIYJAmONE4wSCt0Mrcws +zED94AYVr/b+AADAoFltxYl4iBT5P++wkgCdAP/4IA2gCgUAwKDA6g6eNP7hBhWv9+YAiBIojED5 +4AYVr/YmAAAAAGwQCIgniSL8QPAVr8YFAOqBFSpfAoAA6zsIBECBAAAGiAH5QABEMA81AOiMQC3o +BIAA+WAg0qHMAQAu0Aft0MweqASAAAzLEersAyc7+QAA7bsIBIBBgADAINEPKLKemhHu0MIXSBkA +APkAH1viAJ0AKbKdLBYA5pQABJ85gAAp4gj3IB9wkgCdACzSrmTDnSrSreSjmWTD/QAA6OYIJRzx +gAAsIBQrUAesuwsLRyskFPVgHt3QDhUAGdD7HtEpixCKIIg07NCxHd8CgADtuwgNVgKAAPEABPpf +zQUALSAHI1EB/0YADHDdEQDtISQu0oKAAAmqAphhmmAa0MT8wEYVoBiFAPjAZhWgCCUA6gAFA1BB +AABtigIKAmEsIQn6QPAVoAgFAPjAphWgP6UA42YJLmUCgAD/hgAOcaoBAOxmBi1UAoAACtoCDqoC +mmQoIQn6QGgdoAwFAP6gJBWgCTUA6badLF0CgAD/ZgAN8A0FAFhXwcAg0Q+PJ7F+Dq4CKfEV6RYC +J/iBAAAN/QGdFa2Z7VwgJMkBAAB50wSIEgjdDInQ+PgABPCIFQB4mRmeYenQ7RPD/QAA+MAGFeGI +HQD4wEYVoABKAJ5hGdDnmWCI0QhYFJhiHtDmGNDkiTaN8SiCgP/gpBXimR0ADpkBqYiYY+gSBSJw +CQAA7xYDL3cCgACu3aj/50gIB/kBAADv0wl0QAkAAIkTCd0MDIgRDogM5IBIa/cCgADt6QgDQEEA +AJgU+eAPCuIAnQAN/wz5AGgd5K8dAG2pBQ0AhgkCYYkVCn0MpvjqjBAkyQEAAG3ZBQkghgoCYyoi +AAiqERjQva5p/6GEBaAPFQD/IMYV4A1FAA2qApiUGNC5mpWKUyiCfhbQuP+gigXoqh0Aqojolgck +6IEAAP4AChXgCgUAsartgx4ND+gAAP0hRhWgKgUAmpuPNIhTijUG/wH3oVYFp4gBAO6qAQxCQoAA +CP8CBv8Cn5woUAktUAsvUAomUAju0KQe6QKAAOb/EAxDAoAA+wYADDCmMQDt/wINUcKAAAr/Agj/ +Aoo2GNBBn53+YUgV5dYdAO6qAQ7oQoAADaoC+yHGFaRmAQDo/wELMgKAAAb/AohVmJ+GViaWEI5X +LpYRL5YSjVQtlhMqUAH/oKYF4BiFAO5RASgECoAA8UAED9IAnQAqIAcKKkDtISQtUoKAAA+qAiqW +FI8gKJYX/eAAF7AINQAI/wIY0B0slhbvlhUk0YEAAPgACB2gDyUAbfoCCgJhLyEJLCAH++AAF7AY +pQAI/wIvlhr/oMwF4cwBAADMEQzcAg/MAv4gKBXgCgUAKpYZLpYd7JYYJ/gNAACfEY4RLradLVAH +iif1oABGsAwFAOvUAAVQgQAAWFA10qDRDwAAAAAAAADphAAD8omAANMPbXkFDUCGCQJlY/44wKDA +igiYNOjmCC1jVgAA2iD8QGgdoBvFAFhYxcAg0Q8AAPtvAA6/75oAwJD8IAYVr/BmACvMGOokAAlg +BIAAWFi7wCDRD8CgWWyaHs+8iegdz7z5P+AokA81AGP/sAAAAAD4QrAVr/kFAAm5AQm8DCwkFCwh +CQSIEPlAZh3gCQUA6aQALmYCgAAIzAIOzAKcof+1phWv79oAAGwQBikgBSYgB9gw9gBiHeAaRQD7 +IA6NIWYBAAUJR/0jAAFfxQUAiyITz6DkZAAFg8mAAMAg0Q8AAACIJ4uILIEV6YILJHiBAAAF/QGt +zO0WACZhAQAA+yANNGIAnQDuiRQqTwKAAJkRq5qp7i6FFPuADOuiAJ0AyTXJQ9mwbUkFAwCGCQJh +jRGK8A8CAA2qCP1AD7wiAJ0AmvDTsPhgaB2v/hoAAAAAAOxqEQMkoQAAA6oILqKe98AJ8dIAnQAq +op3Pq9og7CQAA1hhAABYWHHAINEPG890ibiYEvcgDAiSAJ0ADEoRo6osop73gAxp0gCdACqinWSh +hLCcnLhkr8IZz4yZoI8g/5/CBaALFQDrpgIv/gKAAAf/Ap+hj4Mu4n/9nt4F6P8dAK/uH89m7qYD +JUhBAAD8AAoV4AgFALGI6YMeDA/oAACfphnP0flBBhXgGAUAmKeOIAjuEQfuAp6pDE0Ro90n1p0s +IAaJJ+0iAiZgBQAA7CQGJMiBAAAsmQQL3QKIke0mAiZgwQAALJUE5ZwBBENBAADolgEmYQEAAHyL +JCqRBR3PSaiomJGdgIsgwMDshgIt3gKAAAe7AvsAJhXgAgUA0Q8dz0CdgIsgwMDshgIt3gKAAAe7 +AvsAJhXgAgUA0Q8A6iQACtgEgABYVoDSoNEPAP/7FA2gCgUA8yBoHeAOBQD/AWYVr/pCAOvKDAGB +uYAACkwU7cwIKcAEgADtTTYNyASAANMPbdkFCACGCQJhiRCqOOxODATJAQAAbekFCCCGCQJjjRGM +EArdDK3MLMxA/eAGFa/4/gAAwKBZa+0bzw+JuIgS+T/zmJIAnQD/+hQNoAoFAMCgwOoOnjT/YQYV +r/naAIgQKIxA+eAGFa/4GgBsEAQVzwgWz3fwiAATsAlFAOTPdRnGAoAACYgCKGYtBTUC52YuKhgE +gADlZjQpMASAAANghgYCZwNAhgYCZQMghgYCYwMAhuYMAAEZAQAA9choHaCKBQCqIgMCbwTAhgMC +bQSghgMCawSAhgMCadEPbBAGIyAHFM7mAwNBDDkRpJkokp79CCBB0AU1ACuSncu2H89kGM9k+kAI +FaAJBQD4IAYV4AwFAPggRhXgDVUA+CAmFaAe5QBYUuAMOhGkqvVTphXgAgUA0Q/aIOs8GClgBIAA +WFfKxyTRDwAAbBAGKCBwwGTlzssUdbSAACQgBwQEQQxJEaWZKpKe4yIALSFsAAAqkp1koFDbMFje +NcDB/AACHeAOFQD5neQFoAkFAPggJhXgDwUA6RYCLVgEgADoFgAp0ASAAFhSwAxMEaXMJsadKiBw +Kwr7C6oB+k4GHaACBQDRD8Ag0Q/aIOtMGClgBIAAWFemxyTRDwAAbBAEJCAHE88tFc6mBARB4zJ/ +Kk8CgAAFmQgokp4PAgDkMwgMETgAACqSnWSgQwM7AvwAAh2gDSUA/gBCHaAfBQBZbSf9nj4FoA4V +AOymACnuAoAADt0CnaGLIJuiDEkR9SAARPAIJQD5M6YVoAIFANEP2iDrTBgpYASAAFhXhMck0Q8A +bBAWLzAQ950MBeAKdQDz4iAN4AYFAPXgQYCSAJ0AaPIDwCDRDysgB/oghhWnlQEA0w/4I4YV4bsB +AOsWHiyUaAAALCAF94BZ1FIAnQAtIHLzoFl/kgCdANogWFSxZafPjiJl58ovEh6JNSsiEPghRhXg +GoUA7xYQJMBdAAD7PgANdIgdAOgWCyRADQAAmB2YHPXgTDoSAJ0ALRIQDN0Rp90s0p63Tv+AXHOi +AJ0AK9Kd+2BaWBIAnQCMKY4qDA8+LxYaDO4Mf+t7KiAiKSAjCpkM+yBcGBIAnQAoIAcaztj9WAAV +4YgBAA2ICSiNAi6BBgnvNg/uDC6FBi0gIg/dCA0NRy0kIvugW0gSAJ0AKKJ/7iILJsv9AAD7AAQA +0AgVAOCZGgxACoAA6e4IBEP9AAAI7gIuJgooEhoM6Qz5IFnjogCdAIkdHs6/LCAHKCEHHc41/kEk +FeDMEQD1kAAWOogBAO3MAgxDAoAACP8CLSEknLCKIIgaHM4y7t0CDVYCgAAKmQKZsSohIp20n7MM +qgIczq2asikiEIoUmbUZzqv8RxAV4A8lAJ+5lrf5YQYVoA4VAJ66/AMABvBOdQAN6jkNyTkKmQKK +G+a2CyHAQQAA6bYGJcjBAABtqQUIAIYJAmEezhaevI0w86A/spIAnQAqEhDpEgwtVwKAAKeqKaad +KCAULxIapIjoJBQngMGAAC0SGowpKyA4rcycKfNgUF+SAJ0ALhIc+cBPOVIAnQDAINEPLCAHLyAF +KzAR/EBIFeHMAQAsFh754C6kULs5APugR+CQH6UA6hYELm8CgACn3S7SniwWECsWGf/ASMviAJ0A +KdKdKRYR6RYdKAQKgAD7IEhYEgCdAPpAaB2gC0UAWWrQHM3i+0BIQFIAnQCMyPeASHCSAJ0ALXKu +96BFzVIAnQApcq0fzdnvAgAGc/0AAPsgSNgSAJ0AmRXu9ggoBAqAAPsgRNgSAJ0ALjAULiQ4LTAV +LSQ5JiQ7jDiLNoo5iTqPPIg7KCUlKSUkKiUjKyUiLCUJLyRMjj0uJE0tMhAsMhEsJhUmJHEmJHL2 +TgYdoAsVACskcyYmHSsmGSsmGCsmFyYmGyYkTyYkTislKS0lKCowESgSBC4hGgoKQyokOv8ALZCi +AJ0ALSA4Kvr8+8AEBTAPJQAP3AHv0B11U7EAAP8AAAWwCBUA+w0ADfn+HQAPuwgOuxELqgwezgcf +zjD7m4wF4AkVAAycOQr4Lgr/LAiYOf8AAERwD0UAD90B7Z05C3gEgADsvzkLSASAAA3pOQn/Ai0g +FAipHOklNCVz8QAACOgcpN3oJTUvdAKAAA7+Ai4mEC4SGe0kFC1EAoAA+eYAD7AsBQDvJg8nKomA +ACohCB/N1CkgB44pniz4YcgVoLkRAPgiRhWhmQEA6BIRLdqCgADvuwIMzAKAAAmqApuAG84HjyCc +g/tGAA1wCTUA6/sCD/4CgAAJ/wKfgRnNepmCjyuWhZqEn4n/AQYVoAkVAPsAxhXgHkUA/iEmFaAL +BQDrFhMu+gKAAPnmAA/wGmUA6hYbJEjBAAApFh2fhyYkFCogBwoKQSqsFOrN7h0BCoAAwJHrMg8s +yAqAAAqZAhrN0CsWFCkWFSmmQBrN5ykSHZoYCiCGCQJjCgCGCQJhKyA4IxYg6mQACxgEgAD6AgAG +8OsBAP+NAAmwDCUA/Y0ADXDrGQDq7gILSASAAP1gBAWwGgUAC6k5KiA572QAC0AEgAD4ZgAJ8IsF +AP1ABAYwSQUA/WIADDCqAQAKnzgrEh0czcr6QAgVoA0FAJ0RCP8CA/8C/CAGFaANBQDyJAgV4AwV +AO/uAgXYgQAA/8AAFzAPRQD/xgAPcA8FAP4gRhWgDgUAWFEzwMHvzbkdWASAAPpACBWkCQUA+CAG +FeANBQD4IEYV4AgFAPggJhWgDhUAWFEoKBIU6RISLVgEgAD6QAgVr/71AJ4Q/ESkFe//9QD8RIQV +qJkBAPs4ABS4iAEA6YgCDuwCgAD9hgAOcB6lAPggRhWgDQUA/CAmFaAMFQBYURTboPpACBWv/fUA +/CAGFeAMBQCcESkhIighCcHs+SAAFL//9QD5BgAMcAwVAPggRhWgDQUAWFEGKhYWKiEoWUaW7c2L +HWAEgAD6QAgVr/71AJ4QLhITLdCMG82G7t0CBmP9AADi6RAO6EKAAO2ZAg5mQoAADJkCC5kCmREo +IhUZzX7//+Id4B7lAPoiyBXmiB0A+QYADHANBQD4IEYVoAwVAFhQ6xjNVYwYLxIV74ZALUgEgAAM +YIYJAmcMQIYJAmWJMPMgE0qSAJ0AG8zZLxIQLCEH7hIbJekhAADq0pEv/wKAAKf/LvadK7KOjyAu +IgAoIA0pIAyuu+4gFS3eQoAAq6oqFhcrIAcrpAcppAwspQcopA0sMgkupBUt0hwuMhH4YggVoAkV +ACmlKSilKC+mHv1BJB2gG0UA+0CmHe/MAQAspSP6IKgV5u4dAP+gAEaw//UA/CMGFaAOBQD9QsYV +4A0VAFjcMCwSFysSGCbEFP2CsBWgLQUAWSydLRIZZNJVLiA6wP//wBKsYgCdACkwVygKQAmIDJge +LQoB/h/iHeAOBQDsIQktWASAAOwWDylQBIAAWNwcJiQUix8sIBWNHlksi8C8iicczL6KrokZDACH +CgJhCgJhCgJhCgJhCgJhCgJhCgJhCgJhLRIZK3at+ECmHeAOFQDuJBcmgVmAAC8gOsCPePEeGcyU +KDBQCYgKKIIQ7DBXIdlBAAD6QGgdoA0lAAuAAAUKR/lAHQlSAJ0AwCDRDwDqJAAJ2ASAAOxEAAro +BIAAWFJf0qDRDwAAAAULR+sWHC2UaAAAKiAFwcT9QA/EIgCdAG6oei0gcn7fdNogWFKsZaB8jiJl +4HcoIBQEiAgoJBQvMgB69lgqIAcKCkEMqxEHuwgssp4KqQL3gCJaUgCdACuynekWHyWiUYAALyBx +5ZQACeAEgAD6QGgdoO6lAO/mOQpoBIAA/sBoHaAPFQBYUmsMWRH3IABE8AhFACiWnSoSHPlAGslS +AJ0AwCDRDwDqJAAJ2ASAAOxEAAroBIAAWFIv0qDRDwD9mbYFoApFAPxACBXgK6UAWWw2/kNEFa/o +7gAAAAAAAOw0AApoBIAA+0QAFeAOBQD6QGgdoA8VAFhSTisSG7S7+iNmFe/13gArEh4azMn/mZIF +4A4VAOqggC2BCoAA/cABB1ANNQD98AYd594BAOrYNH14BIAAGczA+CPIFa/79QAL2wMLqgEbzL0J +iAoZzLgK6gL7FCYV56oBAOqUgCeLyYAAZKF8wYP4ISYVoA8VAP4iZhXgDgUA/iJGFaAdNQD8I2YV +7+sqAP/3rA2gC2UAxJD4IcYV7/bSAACOHekgcSngBIAA6iQACmgEgAD4HUIdoA8VAOmGOQ93AoAA +7rsIC3AEgABYUhuPHbT//iGGFe/fZgAczACMyPeAFvCSAJ0ALRIQDN0Rp90u0p63T//AFyPiAJ0A +K9KdZLLbH8v2sM6e+Pt/s1CSAJ0AYAGpiScomRQunCDkgOZk+MEAAI2ZjPAp+sD5wAQE8AsFAO/I +DAZjIQAA6Ms5BoLhgAApFgaI4H2BTyzQAMGU+YAEFGIAnQDBhXjBeMGWecFzwYh4wW7BmXnBacGK +eMFkiBYs0Acp4QWZF+iZCA5nAoAA7N0IBMkBAADp2zt+4ASAAO3EAA59fgAAybjC3SywAH3BMI6+ +wLDu+AwHcyEAAAjrOWW/5yggTvzAaB2gH2UA+e0ADjAAQgCMF/2vAA4//w4AAAD8TiYdr/UaAGSu +ivAAGA2gCRUAwJAezFYt4tLH/g/dAQ2dAv3aRhXv+b4AAAAAAAD//HANoA0FAOokAAnYBIAA7EQA +CugEgABYUZfSoNEPAAAZy6zAigjINJiY2iD8QGgdoBvFAFhUo2P/zMAg0Q8A/9uoDaAJBQArEh7a *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 16:14:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 985619DF; Sun, 20 Oct 2013 16:14:04 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8440420EB; Sun, 20 Oct 2013 16:14:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KGE4qq015053; Sun, 20 Oct 2013 16:14:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KGE4S3015034; Sun, 20 Oct 2013 16:14:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310201614.r9KGE4S3015034@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 20 Oct 2013 16:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256792 - in head/sys: conf powerpc/aim powerpc/booke powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 16:14:04 -0000 Author: nwhitehorn Date: Sun Oct 20 16:14:03 2013 New Revision: 256792 URL: http://svnweb.freebsd.org/changeset/base/256792 Log: Unify the AIM and Book-E vm_machdep.c implementations, which previously differed only with respect to the AIM version not following style(9) and some additional features for 64-bit systems and machines with direct maps in the AIM implementation that are no-ops on Book-E (at least for now). Added: head/sys/powerpc/powerpc/vm_machdep.c - copied, changed from r256769, head/sys/powerpc/aim/vm_machdep.c Deleted: head/sys/powerpc/aim/vm_machdep.c head/sys/powerpc/booke/vm_machdep.c Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun Oct 20 15:24:44 2013 (r256791) +++ head/sys/conf/files.powerpc Sun Oct 20 16:14:03 2013 (r256792) @@ -101,7 +101,6 @@ powerpc/aim/swtch32.S optional aim powe powerpc/aim/swtch64.S optional aim powerpc64 powerpc/aim/trap.c optional aim powerpc/aim/uma_machdep.c optional aim -powerpc/aim/vm_machdep.c optional aim powerpc/booke/clock.c optional booke powerpc/booke/copyinout.c optional booke powerpc/booke/interrupt.c optional booke @@ -113,7 +112,6 @@ powerpc/booke/platform_bare.c optional m powerpc/booke/pmap.c optional booke powerpc/booke/swtch.S optional booke powerpc/booke/trap.c optional booke -powerpc/booke/vm_machdep.c optional booke powerpc/cpufreq/dfs.c optional cpufreq powerpc/cpufreq/pcr.c optional cpufreq aim powerpc/fpu/fpu_add.c optional fpu_emu powerpc @@ -214,6 +212,7 @@ powerpc/powerpc/suswintr.c standard powerpc/powerpc/syncicache.c standard powerpc/powerpc/sys_machdep.c standard powerpc/powerpc/uio_machdep.c standard +powerpc/powerpc/vm_machdep.c standard powerpc/ps3/ehci_ps3.c optional ps3 ehci powerpc/ps3/ohci_ps3.c optional ps3 ohci powerpc/ps3/if_glc.c optional ps3 glc Copied and modified: head/sys/powerpc/powerpc/vm_machdep.c (from r256769, head/sys/powerpc/aim/vm_machdep.c) ============================================================================== --- head/sys/powerpc/aim/vm_machdep.c Sat Oct 19 10:00:51 2013 (r256769, copy source) +++ head/sys/powerpc/powerpc/vm_machdep.c Sun Oct 20 16:14:03 2013 (r256792) @@ -108,7 +108,7 @@ */ #ifndef NSFBUFS -#define NSFBUFS (512 + maxusers * 16) +#define NSFBUFS (512 + maxusers * 16) #endif static int nsfbufs; @@ -205,7 +205,9 @@ cpu_fork(struct thread *td1, struct proc #else pcb->pcb_lr = (register_t)fork_trampoline; #endif + #ifdef AIM pcb->pcb_cpu.aim.usr_vsid = 0; + #endif /* Setup to release spin count in fork_exit(). */ td2->td_md.md_spinlock_count = 1; @@ -223,12 +225,9 @@ cpu_fork(struct thread *td1, struct proc * This is needed to make kernel threads stay in kernel mode. */ void -cpu_set_fork_handler(td, func, arg) - struct thread *td; - void (*func)(void *); - void *arg; +cpu_set_fork_handler(struct thread *td, void (*func)(void *), void *arg) { - struct callframe *cf; + struct callframe *cf; CTR4(KTR_PROC, "%s called with td=%p func=%p arg=%p", __func__, td, func, arg); @@ -240,9 +239,9 @@ cpu_set_fork_handler(td, func, arg) } void -cpu_exit(td) - register struct thread *td; +cpu_exit(struct thread *td) { + } /* @@ -251,29 +250,29 @@ cpu_exit(td) static void sf_buf_init(void *arg) { - struct sf_buf *sf_bufs; - vm_offset_t sf_base; - int i; + struct sf_buf *sf_bufs; + vm_offset_t sf_base; + int i; /* Don't bother on systems with a direct map */ - if (hw_direct_map) return; - nsfbufs = NSFBUFS; - TUNABLE_INT_FETCH("kern.ipc.nsfbufs", &nsfbufs); + nsfbufs = NSFBUFS; + TUNABLE_INT_FETCH("kern.ipc.nsfbufs", &nsfbufs); - sf_buf_active = hashinit(nsfbufs, M_TEMP, &sf_buf_hashmask); - TAILQ_INIT(&sf_buf_freelist); - sf_base = kva_alloc(nsfbufs * PAGE_SIZE); - sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP, M_NOWAIT | M_ZERO); - - for (i = 0; i < nsfbufs; i++) { - sf_bufs[i].kva = sf_base + i * PAGE_SIZE; - TAILQ_INSERT_TAIL(&sf_buf_freelist, &sf_bufs[i], free_entry); - } - sf_buf_alloc_want = 0; - mtx_init(&sf_buf_lock, "sf_buf", NULL, MTX_DEF); + sf_buf_active = hashinit(nsfbufs, M_TEMP, &sf_buf_hashmask); + TAILQ_INIT(&sf_buf_freelist); + sf_base = kva_alloc(nsfbufs * PAGE_SIZE); + sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP, + M_NOWAIT | M_ZERO); + + for (i = 0; i < nsfbufs; i++) { + sf_bufs[i].kva = sf_base + i * PAGE_SIZE; + TAILQ_INSERT_TAIL(&sf_buf_freelist, &sf_bufs[i], free_entry); + } + sf_buf_alloc_want = 0; + mtx_init(&sf_buf_lock, "sf_buf", NULL, MTX_DEF); } /* @@ -282,64 +281,63 @@ sf_buf_init(void *arg) struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags) { - struct sf_head *hash_list; - struct sf_buf *sf; - int error; + struct sf_head *hash_list; + struct sf_buf *sf; + int error; if (hw_direct_map) { /* Shortcut the direct mapped case */ - return ((struct sf_buf *)m); } - hash_list = &sf_buf_active[SF_BUF_HASH(m)]; - mtx_lock(&sf_buf_lock); - LIST_FOREACH(sf, hash_list, list_entry) { - if (sf->m == m) { - sf->ref_count++; - if (sf->ref_count == 1) { - TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); - nsfbufsused++; - nsfbufspeak = imax(nsfbufspeak, nsfbufsused); - } - goto done; - } - } - - while ((sf = TAILQ_FIRST(&sf_buf_freelist)) == NULL) { - if (flags & SFB_NOWAIT) - goto done; - - sf_buf_alloc_want++; - SFSTAT_INC(sf_allocwait); - error = msleep(&sf_buf_freelist, &sf_buf_lock, - (flags & SFB_CATCH) ? PCATCH | PVM : PVM, "sfbufa", 0); - sf_buf_alloc_want--; - - /* - * If we got a signal, don't risk going back to sleep. - */ - if (error) - goto done; - } - - TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); - if (sf->m != NULL) - LIST_REMOVE(sf, list_entry); - - LIST_INSERT_HEAD(hash_list, sf, list_entry); - sf->ref_count = 1; - sf->m = m; - nsfbufsused++; - nsfbufspeak = imax(nsfbufspeak, nsfbufsused); - pmap_qenter(sf->kva, &sf->m, 1); + hash_list = &sf_buf_active[SF_BUF_HASH(m)]; + mtx_lock(&sf_buf_lock); + LIST_FOREACH(sf, hash_list, list_entry) { + if (sf->m == m) { + sf->ref_count++; + if (sf->ref_count == 1) { + TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); + nsfbufsused++; + nsfbufspeak = imax(nsfbufspeak, nsfbufsused); + } + goto done; + } + } + + while ((sf = TAILQ_FIRST(&sf_buf_freelist)) == NULL) { + if (flags & SFB_NOWAIT) + goto done; + + sf_buf_alloc_want++; + SFSTAT_INC(sf_allocwait); + error = msleep(&sf_buf_freelist, &sf_buf_lock, + (flags & SFB_CATCH) ? PCATCH | PVM : PVM, "sfbufa", 0); + sf_buf_alloc_want--; + + /* + * If we got a signal, don't risk going back to sleep. + */ + if (error) + goto done; + } + + TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); + if (sf->m != NULL) + LIST_REMOVE(sf, list_entry); + + LIST_INSERT_HEAD(hash_list, sf, list_entry); + sf->ref_count = 1; + sf->m = m; + nsfbufsused++; + nsfbufspeak = imax(nsfbufspeak, nsfbufsused); + pmap_qenter(sf->kva, &sf->m, 1); done: - mtx_unlock(&sf_buf_lock); - return (sf); + mtx_unlock(&sf_buf_lock); + return (sf); } /* - * Detatch mapped page and release resources back to the system. + * Detach mapped page and release resources back to the system. * * Remove a reference from the given sf_buf, adding it to the free * list when its reference count reaches zero. A freed sf_buf still, @@ -352,16 +350,16 @@ sf_buf_free(struct sf_buf *sf) if (hw_direct_map) return; - mtx_lock(&sf_buf_lock); - sf->ref_count--; - if (sf->ref_count == 0) { - TAILQ_INSERT_TAIL(&sf_buf_freelist, sf, free_entry); - nsfbufsused--; - - if (sf_buf_alloc_want > 0) - wakeup(&sf_buf_freelist); - } - mtx_unlock(&sf_buf_lock); + mtx_lock(&sf_buf_lock); + sf->ref_count--; + if (sf->ref_count == 0) { + TAILQ_INSERT_TAIL(&sf_buf_freelist, sf, free_entry); + nsfbufsused--; + + if (sf_buf_alloc_want > 0) + wakeup(&sf_buf_freelist); + } + mtx_unlock(&sf_buf_lock); } /* @@ -381,18 +379,15 @@ swi_vm(void *dummy) * dumping the ``ISA memory hole'' which could cause indefinite hangs, * or other unpredictable behaviour. */ - - int -is_physical_memory(addr) - vm_offset_t addr; +is_physical_memory(vm_offset_t addr) { + /* * stuff other tests for known memory-mapped devices (PCI?) * here */ - - return 1; + return (1); } /* @@ -404,10 +399,12 @@ is_physical_memory(addr) void cpu_thread_swapin(struct thread *td) { + } void cpu_thread_swapout(struct thread *td) { + } From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 16:37:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D6CD2ECA; Sun, 20 Oct 2013 16:37:04 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C234921D6; Sun, 20 Oct 2013 16:37:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KGb433026663; Sun, 20 Oct 2013 16:37:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KGb4qw026660; Sun, 20 Oct 2013 16:37:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310201637.r9KGb4qw026660@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 20 Oct 2013 16:37:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256793 - in head/sys: conf powerpc/aim powerpc/booke powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 16:37:04 -0000 Author: nwhitehorn Date: Sun Oct 20 16:37:03 2013 New Revision: 256793 URL: http://svnweb.freebsd.org/changeset/base/256793 Log: Replace the two almost-exactly-identical AIM and Book-E clock.c implementations with a single one after the application of a very small amount of #ifdef. Added: head/sys/powerpc/powerpc/clock.c - copied, changed from r256769, head/sys/powerpc/aim/clock.c Deleted: head/sys/powerpc/aim/clock.c head/sys/powerpc/booke/clock.c Modified: head/sys/conf/files.powerpc head/sys/powerpc/aim/machdep.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun Oct 20 16:14:03 2013 (r256792) +++ head/sys/conf/files.powerpc Sun Oct 20 16:37:03 2013 (r256793) @@ -85,7 +85,6 @@ libkern/qdivrem.c optional powerpc libkern/ucmpdi2.c optional powerpc libkern/udivdi3.c optional powerpc libkern/umoddi3.c optional powerpc -powerpc/aim/clock.c optional aim powerpc/aim/copyinout.c optional aim powerpc/aim/interrupt.c optional aim powerpc/aim/locore.S optional aim no-obj @@ -101,7 +100,6 @@ powerpc/aim/swtch32.S optional aim powe powerpc/aim/swtch64.S optional aim powerpc64 powerpc/aim/trap.c optional aim powerpc/aim/uma_machdep.c optional aim -powerpc/booke/clock.c optional booke powerpc/booke/copyinout.c optional booke powerpc/booke/interrupt.c optional booke powerpc/booke/locore.S optional booke no-obj @@ -178,6 +176,7 @@ powerpc/powerpc/autoconf.c standard powerpc/powerpc/bcopy.c standard powerpc/powerpc/bus_machdep.c standard powerpc/powerpc/busdma_machdep.c standard +powerpc/powerpc/clock.c standard powerpc/powerpc/copystr.c standard powerpc/powerpc/cpu.c standard powerpc/powerpc/db_disasm.c optional ddb Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Sun Oct 20 16:14:03 2013 (r256792) +++ head/sys/powerpc/aim/machdep.c Sun Oct 20 16:37:03 2013 (r256793) @@ -646,14 +646,6 @@ cpu_flush_dcache(void *ptr, size_t len) /* TBD */ } -void -cpu_initclocks(void) -{ - - decr_tc_init(); - cpu_initclocks_bsp(); -} - /* * Shutdown the CPU as much as possible. */ Copied and modified: head/sys/powerpc/powerpc/clock.c (from r256769, head/sys/powerpc/aim/clock.c) ============================================================================== --- head/sys/powerpc/aim/clock.c Sat Oct 19 10:00:51 2013 (r256769, copy source) +++ head/sys/powerpc/powerpc/clock.c Sun Oct 20 16:37:03 2013 (r256793) @@ -119,6 +119,14 @@ decr_intr(struct trapframe *frame) (*decr_counts[curcpu])++; +#ifdef BOOKE + /* + * Interrupt handler must reset DIS to avoid getting another + * interrupt once EE is enabled. + */ + mtspr(SPR_TSR, TSR_DIS); +#endif + if (s->mode == 1) { /* * Based on the actual time delay since the last decrementer @@ -141,6 +149,14 @@ decr_intr(struct trapframe *frame) } } +void +cpu_initclocks(void) +{ + + decr_tc_init(); + cpu_initclocks_bsp(); +} + /* * BSP early initialization. */ @@ -207,11 +223,13 @@ decr_tc_init(void) * Event timer start method. */ static int -decr_et_start(struct eventtimer *et, - sbintime_t first, sbintime_t period) +decr_et_start(struct eventtimer *et, sbintime_t first, sbintime_t period) { struct decr_state *s = DPCPU_PTR(decr_state); uint32_t fdiv; +#ifdef BOOKE + uint32_t tcr; +#endif if (period != 0) { s->mode = 1; @@ -220,12 +238,25 @@ decr_et_start(struct eventtimer *et, s->mode = 2; s->div = 0; } - if (first != 0) { + if (first != 0) fdiv = (decr_et.et_frequency * first) >> 32; - } else + else fdiv = s->div; +#ifdef BOOKE + tcr = mfspr(SPR_TCR); + tcr |= TCR_DIE; + if (s->mode == 1) { + mtspr(SPR_DECAR, s->div); + tcr |= TCR_ARE; + } else + tcr &= ~TCR_ARE; mtdec(fdiv); + mtspr(SPR_TCR, tcr); +#else + mtdec(fdiv); +#endif + return (0); } @@ -236,10 +267,19 @@ static int decr_et_stop(struct eventtimer *et) { struct decr_state *s = DPCPU_PTR(decr_state); +#ifdef BOOKE + uint32_t tcr; +#endif s->mode = 0; s->div = 0x7fffffff; +#ifdef BOOKE + tcr = mfspr(SPR_TCR); + tcr &= ~(TCR_DIE | TCR_ARE); + mtspr(SPR_TCR, tcr); +#else mtdec(s->div); +#endif return (0); } @@ -249,10 +289,7 @@ decr_et_stop(struct eventtimer *et) static unsigned decr_get_timecount(struct timecounter *tc) { - register_t tb; - - __asm __volatile("mftb %0" : "=r"(tb)); - return (tb); + return (mftb()); } /* From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 16:45:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A3E671BB; Sun, 20 Oct 2013 16:45:02 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 76F5E2229; Sun, 20 Oct 2013 16:45:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KGj2RE031512; Sun, 20 Oct 2013 16:45:02 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KGj2ZT031509; Sun, 20 Oct 2013 16:45:02 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201310201645.r9KGj2ZT031509@svn.freebsd.org> From: Navdeep Parhar Date: Sun, 20 Oct 2013 16:45:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256794 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 16:45:02 -0000 Author: np Date: Sun Oct 20 16:45:01 2013 New Revision: 256794 URL: http://svnweb.freebsd.org/changeset/base/256794 Log: MFC r256477: cxgbe(4): Store the log2 of the # of doorbells per BAR2 page for both ingress and egress queues, and for both T4 and T5. These values are used by the T4/T5 iWARP driver. Approved by: re (glebius) Modified: stable/10/sys/dev/cxgbe/adapter.h stable/10/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/10/sys/dev/cxgbe/adapter.h Sun Oct 20 16:37:03 2013 (r256793) +++ stable/10/sys/dev/cxgbe/adapter.h Sun Oct 20 16:45:01 2013 (r256794) @@ -510,7 +510,8 @@ struct sge { int timer_val[SGE_NTIMERS]; int counter_val[SGE_NCOUNTERS]; int fl_starve_threshold; - int s_qpp; + int eq_s_qpp; + int iq_s_qpp; int nrxq; /* total # of Ethernet rx queues */ int ntxq; /* total # of Ethernet tx tx queues */ Modified: stable/10/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_sge.c Sun Oct 20 16:37:03 2013 (r256793) +++ stable/10/sys/dev/cxgbe/t4_sge.c Sun Oct 20 16:45:01 2013 (r256794) @@ -569,12 +569,17 @@ t4_read_chip_settings(struct adapter *sc r = t4_read_reg(sc, A_SGE_CONM_CTRL); s->fl_starve_threshold = G_EGRTHRESHOLD(r) * 2 + 1; - if (is_t5(sc)) { - r = t4_read_reg(sc, A_SGE_EGRESS_QUEUES_PER_PAGE_PF); - r >>= S_QUEUESPERPAGEPF0 + - (S_QUEUESPERPAGEPF1 - S_QUEUESPERPAGEPF0) * sc->pf; - s->s_qpp = r & M_QUEUESPERPAGEPF0; - } + /* egress queues: log2 of # of doorbells per BAR2 page */ + r = t4_read_reg(sc, A_SGE_EGRESS_QUEUES_PER_PAGE_PF); + r >>= S_QUEUESPERPAGEPF0 + + (S_QUEUESPERPAGEPF1 - S_QUEUESPERPAGEPF0) * sc->pf; + s->eq_s_qpp = r & M_QUEUESPERPAGEPF0; + + /* ingress queues: log2 of # of doorbells per BAR2 page */ + r = t4_read_reg(sc, A_SGE_INGRESS_QUEUES_PER_PAGE_PF); + r >>= S_QUEUESPERPAGEPF0 + + (S_QUEUESPERPAGEPF1 - S_QUEUESPERPAGEPF0) * sc->pf; + s->iq_s_qpp = r & M_QUEUESPERPAGEPF0; t4_init_tp_params(sc); @@ -2799,7 +2804,7 @@ alloc_eq(struct adapter *sc, struct port if (isset(&eq->doorbells, DOORBELL_UDB) || isset(&eq->doorbells, DOORBELL_UDBWC) || isset(&eq->doorbells, DOORBELL_WCWR)) { - uint32_t s_qpp = sc->sge.s_qpp; + uint32_t s_qpp = sc->sge.eq_s_qpp; uint32_t mask = (1 << s_qpp) - 1; volatile uint8_t *udb; From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 18:38:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2BF4F5B8; Sun, 20 Oct 2013 18:38:20 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1933128E0; Sun, 20 Oct 2013 18:38:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KIcJTP092506; Sun, 20 Oct 2013 18:38:19 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KIcJLQ092505; Sun, 20 Oct 2013 18:38:19 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310201838.r9KIcJLQ092505@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 20 Oct 2013 18:38:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256798 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 18:38:20 -0000 Author: nwhitehorn Date: Sun Oct 20 18:38:19 2013 New Revision: 256798 URL: http://svnweb.freebsd.org/changeset/base/256798 Log: Some nexus devices add wildcard children. Since fdtbus_probe returned BUS_PROBE_DEFAULT, it would attach to them all, producing both many fdtbus instances and preventing other devices from attaching. Instead return BUS_PROBE_NOWILDCARD, which exists for exactly this purpose. Modified: head/sys/dev/fdt/fdtbus.c Modified: head/sys/dev/fdt/fdtbus.c ============================================================================== --- head/sys/dev/fdt/fdtbus.c Sun Oct 20 18:13:06 2013 (r256797) +++ head/sys/dev/fdt/fdtbus.c Sun Oct 20 18:38:19 2013 (r256798) @@ -161,7 +161,7 @@ fdtbus_probe(device_t dev) device_set_desc(dev, "FDT main bus"); if (!bootverbose) device_quiet(dev); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_NOWILDCARD); } static int From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 18:40:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D12B487E; Sun, 20 Oct 2013 18:40:55 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BD21F2961; Sun, 20 Oct 2013 18:40:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KIett5095478; Sun, 20 Oct 2013 18:40:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KIetBd095476; Sun, 20 Oct 2013 18:40:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310201840.r9KIetBd095476@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 20 Oct 2013 18:40:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256799 - in head/sys: conf powerpc/aim powerpc/mpc85xx powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 18:40:55 -0000 Author: nwhitehorn Date: Sun Oct 20 18:40:55 2013 New Revision: 256799 URL: http://svnweb.freebsd.org/changeset/base/256799 Log: Since the PS3 port was committed, the AIM nexus device works perfectly fine on all PowerPC platforms, whether or not they have Open Firmware. Remove some more duplication and have there be only one nexus driver. Added: head/sys/powerpc/powerpc/nexus.c - copied unchanged from r256769, head/sys/powerpc/aim/nexus.c Deleted: head/sys/powerpc/aim/nexus.c head/sys/powerpc/mpc85xx/nexus.c Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun Oct 20 18:38:19 2013 (r256798) +++ head/sys/conf/files.powerpc Sun Oct 20 18:40:55 2013 (r256799) @@ -94,7 +94,6 @@ powerpc/aim/mmu_oea64.c optional aim powerpc/aim/moea64_if.m optional aim powerpc/aim/moea64_native.c optional aim powerpc/aim/mp_cpudep.c optional aim smp -powerpc/aim/nexus.c optional aim powerpc/aim/slb.c optional aim powerpc64 powerpc/aim/swtch32.S optional aim powerpc powerpc/aim/swtch64.S optional aim powerpc64 @@ -133,7 +132,6 @@ powerpc/mpc85xx/i2c.c optional iicbus f powerpc/mpc85xx/isa.c optional mpc85xx isa powerpc/mpc85xx/lbc.c optional mpc85xx powerpc/mpc85xx/mpc85xx.c optional mpc85xx -powerpc/mpc85xx/nexus.c optional mpc85xx powerpc/mpc85xx/pci_fdt.c optional pci mpc85xx powerpc/ofw/ofw_cpu.c optional aim powerpc/ofw/ofw_machdep.c optional aim @@ -196,6 +194,7 @@ powerpc/powerpc/iommu_if.m standard powerpc/powerpc/mem.c optional mem powerpc/powerpc/mmu_if.m standard powerpc/powerpc/mp_machdep.c optional smp +powerpc/powerpc/nexus.c standard powerpc/powerpc/openpic.c standard powerpc/powerpc/openpic_fdt.c optional fdt powerpc/powerpc/pic_if.m standard Copied: head/sys/powerpc/powerpc/nexus.c (from r256769, head/sys/powerpc/aim/nexus.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powerpc/nexus.c Sun Oct 20 18:40:55 2013 (r256799, copy of r256769, head/sys/powerpc/aim/nexus.c) @@ -0,0 +1,527 @@ +/*- + * Copyright 1998 Massachusetts Institute of Technology + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby + * granted, provided that both the above copyright notice and this + * permission notice appear in all copies, that both the above + * copyright notice and this permission notice appear in all + * supporting documentation, and that the name of M.I.T. not be used + * in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. M.I.T. makes + * no representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS + * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + * SHALL M.I.T. 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. + */ +/*- + * Copyright 2001 by Thomas Moestl . 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. + * + * from: FreeBSD: src/sys/i386/i386/nexus.c,v 1.43 2001/02/09 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#include "ofw_bus_if.h" +#include "pic_if.h" + +/* + * The nexus (which is a pseudo-bus actually) iterates over the nodes that + * exist in Open Firmware and adds them as devices to this bus so that drivers + * can be attached to them. + * + * Maybe this code should get into dev/ofw to some extent, as some of it should + * work for all Open Firmware based machines... + */ + +static MALLOC_DEFINE(M_NEXUS, "nexus", "nexus device information"); + +enum nexus_ivars { + NEXUS_IVAR_NODE, + NEXUS_IVAR_NAME, + NEXUS_IVAR_DEVICE_TYPE, + NEXUS_IVAR_COMPATIBLE, +}; + +struct nexus_devinfo { + phandle_t ndi_node; + /* Some common properties. */ + const char *ndi_name; + const char *ndi_device_type; + const char *ndi_compatible; +}; + +struct nexus_softc { + struct rman sc_rman; +}; + +/* + * Device interface + */ +static int nexus_probe(device_t); +static int nexus_attach(device_t); + +/* + * Bus interface + */ +static device_t nexus_add_child(device_t, u_int, const char *, int); +static void nexus_probe_nomatch(device_t, device_t); +static int nexus_read_ivar(device_t, device_t, int, uintptr_t *); +static int nexus_write_ivar(device_t, device_t, int, uintptr_t); +#ifdef SMP +static int nexus_bind_intr(device_t dev, device_t child, + struct resource *irq, int cpu); +#endif +static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, + enum intr_polarity pol); +static int nexus_setup_intr(device_t, device_t, struct resource *, int, + driver_filter_t *, driver_intr_t *, void *, void **); +static int nexus_teardown_intr(device_t, device_t, struct resource *, + void *); +static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, + u_long, u_long, u_long, u_int); +static int nexus_activate_resource(device_t, device_t, int, int, + struct resource *); +static int nexus_deactivate_resource(device_t, device_t, int, int, + struct resource *); +static int nexus_release_resource(device_t, device_t, int, int, + struct resource *); + +/* + * OFW bus interface. + */ +static phandle_t nexus_ofw_get_node(device_t, device_t); +static const char *nexus_ofw_get_name(device_t, device_t); +static const char *nexus_ofw_get_type(device_t, device_t); +static const char *nexus_ofw_get_compat(device_t, device_t); + +/* + * Local routines + */ +static device_t nexus_device_from_node(device_t, phandle_t); + +static device_method_t nexus_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, nexus_probe), + DEVMETHOD(device_attach, nexus_attach), + DEVMETHOD(device_detach, bus_generic_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + + /* Bus interface. Resource management is business of the children... */ + DEVMETHOD(bus_add_child, nexus_add_child), + DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), + DEVMETHOD(bus_probe_nomatch, nexus_probe_nomatch), + DEVMETHOD(bus_read_ivar, nexus_read_ivar), + DEVMETHOD(bus_write_ivar, nexus_write_ivar), + DEVMETHOD(bus_setup_intr, nexus_setup_intr), + DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), +#ifdef SMP + DEVMETHOD(bus_bind_intr, nexus_bind_intr), +#endif + DEVMETHOD(bus_config_intr, nexus_config_intr), + DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), + DEVMETHOD(bus_activate_resource, nexus_activate_resource), + DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), + DEVMETHOD(bus_release_resource, nexus_release_resource), + + /* OFW bus interface */ + DEVMETHOD(ofw_bus_get_node, nexus_ofw_get_node), + DEVMETHOD(ofw_bus_get_name, nexus_ofw_get_name), + DEVMETHOD(ofw_bus_get_type, nexus_ofw_get_type), + DEVMETHOD(ofw_bus_get_compat, nexus_ofw_get_compat), + + DEVMETHOD_END +}; + +static driver_t nexus_driver = { + "nexus", + nexus_methods, + sizeof(struct nexus_softc), +}; + +static devclass_t nexus_devclass; + +EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0, + BUS_PASS_BUS); + +static int +nexus_probe(device_t dev) +{ + bus_generic_probe(dev); + device_set_desc(dev, "Open Firmware Nexus device"); + return (0); +} + +static int +nexus_attach(device_t dev) +{ + phandle_t root; + phandle_t child; + struct nexus_softc *sc; + u_long start, end; + + sc = device_get_softc(dev); + + start = 0; + end = ~0; + + sc->sc_rman.rm_start = start; + sc->sc_rman.rm_end = end; + sc->sc_rman.rm_type = RMAN_ARRAY; + sc->sc_rman.rm_descr = "Interrupt request lines"; + if (rman_init(&sc->sc_rman) || + rman_manage_region(&sc->sc_rman, start, end)) + panic("nexus_probe IRQ rman"); + + if ((root = OF_peer(0)) == 0) + return (bus_generic_attach(dev)); + + /* + * Now walk the OFW tree to locate top-level devices + */ + for (child = OF_child(root); child != 0; child = OF_peer(child)) { + if (child == -1) + panic("nexus_probe(): OF_child failed."); + (void)nexus_device_from_node(dev, child); + + } + + return (bus_generic_attach(dev)); +} + +static void +nexus_probe_nomatch(device_t dev, device_t child) +{ + char *name, *type; + + if (BUS_READ_IVAR(dev, child, NEXUS_IVAR_NAME, + (uintptr_t *)&name) != 0 || + BUS_READ_IVAR(dev, child, NEXUS_IVAR_DEVICE_TYPE, + (uintptr_t *)&type) != 0) + return; + + if (type == NULL) + type = "(unknown)"; + + if (bootverbose) + device_printf(dev, "<%s>, type %s (no driver attached)\n", + name, type); +} + +static device_t +nexus_add_child(device_t dev, u_int order, const char *name, int unit) +{ + device_t child; + struct nexus_devinfo *dinfo; + + child = device_add_child_ordered(dev, order, name, unit); + if (child == NULL) + return (NULL); + + dinfo = malloc(sizeof(struct nexus_devinfo), M_NEXUS, M_NOWAIT|M_ZERO); + if (dinfo == NULL) + return (NULL); + + dinfo->ndi_node = -1; + dinfo->ndi_name = name; + device_set_ivars(child, dinfo); + + return (child); +} + + +static int +nexus_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) +{ + struct nexus_devinfo *dinfo; + + if ((dinfo = device_get_ivars(child)) == 0) + return (ENOENT); + switch (which) { + case NEXUS_IVAR_NODE: + *result = dinfo->ndi_node; + break; + case NEXUS_IVAR_NAME: + *result = (uintptr_t)dinfo->ndi_name; + break; + case NEXUS_IVAR_DEVICE_TYPE: + *result = (uintptr_t)dinfo->ndi_device_type; + break; + case NEXUS_IVAR_COMPATIBLE: + *result = (uintptr_t)dinfo->ndi_compatible; + break; + default: + return (ENOENT); + } + return 0; +} + +static int +nexus_write_ivar(device_t dev, device_t child, int which, uintptr_t value) +{ + struct nexus_devinfo *dinfo; + + if ((dinfo = device_get_ivars(child)) == 0) + return (ENOENT); + + switch (which) { + case NEXUS_IVAR_NAME: + return (EINVAL); + + /* Identified devices may want to set these */ + case NEXUS_IVAR_NODE: + dinfo->ndi_node = (phandle_t)value; + break; + + case NEXUS_IVAR_DEVICE_TYPE: + dinfo->ndi_device_type = (char *)value; + break; + + default: + return (ENOENT); + } + return 0; +} + +static int +nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, + driver_filter_t *filter, driver_intr_t *ihand, void *arg, void **cookiep) +{ + int error; + + /* somebody tried to setup an irq that failed to allocate! */ + if (res == NULL) + panic("nexus_setup_intr: NULL irq resource!"); + + *cookiep = 0; + if ((rman_get_flags(res) & RF_SHAREABLE) == 0) + flags |= INTR_EXCL; + + /* + * We depend here on rman_activate_resource() being idempotent. + */ + error = rman_activate_resource(res); + if (error) + return (error); + + error = powerpc_setup_intr(device_get_nameunit(child), + rman_get_start(res), filter, ihand, arg, flags, cookiep); + + return (error); +} + +static int +nexus_teardown_intr(device_t dev, device_t child, struct resource *res, + void *cookie) +{ + + return (powerpc_teardown_intr(cookie)); +} + +#ifdef SMP +static int +nexus_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu) +{ + + return (powerpc_bind_intr(rman_get_start(irq), cpu)); +} +#endif + +static int +nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, + enum intr_polarity pol) +{ + + return (powerpc_config_intr(irq, trig, pol)); +} + +/* + * Allocate resources at the behest of a child. This only handles interrupts, + * since I/O resources are handled by child busses. + */ +static struct resource * +nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct nexus_softc *sc; + struct resource *rv; + + if (type != SYS_RES_IRQ) { + device_printf(bus, "unknown resource request from %s\n", + device_get_nameunit(child)); + return (NULL); + } + + if (count == 0 || start + count - 1 != end) { + device_printf(bus, "invalid IRQ allocation from %s\n", + device_get_nameunit(child)); + return (NULL); + } + + sc = device_get_softc(bus); + + rv = rman_reserve_resource(&sc->sc_rman, start, end, count, + flags, child); + if (rv == NULL) { + device_printf(bus, "IRQ allocation failed for %s\n", + device_get_nameunit(child)); + } else + rman_set_rid(rv, *rid); + + return (rv); +} + +static int +nexus_activate_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + + /* Not much to be done yet... */ + return (rman_activate_resource(res)); +} + +static int +nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + + /* Not much to be done yet... */ + return (rman_deactivate_resource(res)); +} + +static int +nexus_release_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + + if (type != SYS_RES_IRQ) { + device_printf(bus, "unknown resource request from %s\n", + device_get_nameunit(child)); + return (EINVAL); + } + + return (rman_release_resource(res)); +} + +static device_t +nexus_device_from_node(device_t parent, phandle_t node) +{ + device_t cdev; + struct nexus_devinfo *dinfo; + char *name, *type, *compatible; + + OF_getprop_alloc(node, "name", 1, (void **)&name); + OF_getprop_alloc(node, "device_type", 1, (void **)&type); + OF_getprop_alloc(node, "compatible", 1, (void **)&compatible); + cdev = device_add_child(parent, NULL, -1); + if (cdev != NULL) { + dinfo = malloc(sizeof(*dinfo), M_NEXUS, M_WAITOK); + dinfo->ndi_node = node; + dinfo->ndi_name = name; + dinfo->ndi_device_type = type; + dinfo->ndi_compatible = compatible; + device_set_ivars(cdev, dinfo); + } else + free(name, M_OFWPROP); + + return (cdev); +} + +static const char * +nexus_ofw_get_name(device_t bus, device_t dev) +{ + struct nexus_devinfo *dinfo; + + if ((dinfo = device_get_ivars(dev)) == NULL) + return (NULL); + + return (dinfo->ndi_name); +} + +static phandle_t +nexus_ofw_get_node(device_t bus, device_t dev) +{ + struct nexus_devinfo *dinfo; + + if ((dinfo = device_get_ivars(dev)) == NULL) + return (0); + + return (dinfo->ndi_node); +} + +static const char * +nexus_ofw_get_type(device_t bus, device_t dev) +{ + struct nexus_devinfo *dinfo; + + if ((dinfo = device_get_ivars(dev)) == NULL) + return (NULL); + + return (dinfo->ndi_device_type); +} + +static const char * +nexus_ofw_get_compat(device_t bus, device_t dev) +{ + struct nexus_devinfo *dinfo; + + if ((dinfo = device_get_ivars(dev)) == NULL) + return (NULL); + + return (dinfo->ndi_compatible); +} + From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 20:10:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D49CCD34; Sun, 20 Oct 2013 20:10:31 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C20082CF2; Sun, 20 Oct 2013 20:10:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KKAVJl043612; Sun, 20 Oct 2013 20:10:31 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KKAVF0043611; Sun, 20 Oct 2013 20:10:31 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201310202010.r9KKAVF0043611@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 20 Oct 2013 20:10:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256800 - head/usr.bin/pathchk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 20:10:31 -0000 Author: jilles Date: Sun Oct 20 20:10:31 2013 New Revision: 256800 URL: http://svnweb.freebsd.org/changeset/base/256800 Log: pathchk: Ensure bytes >= 128 are considered non-portable characters. This was not broken on architectures such as ARM where char is unsigned. Also, remove the first non-portable character from the output. POSIX does not require this, and printing the first byte may yield an invalid byte sequence with UTF-8. PR: bin/165988 Reported by: Nicolas Rachinsky Modified: head/usr.bin/pathchk/pathchk.c Modified: head/usr.bin/pathchk/pathchk.c ============================================================================== --- head/usr.bin/pathchk/pathchk.c Sun Oct 20 18:40:55 2013 (r256799) +++ head/usr.bin/pathchk/pathchk.c Sun Oct 20 20:10:31 2013 (r256800) @@ -98,7 +98,7 @@ check(const char *path) { struct stat sb; long complen, namemax, pathmax, svnamemax; - int badch, last; + int last; char *end, *p, *pathd; if ((pathd = strdup(path)) == NULL) @@ -142,9 +142,9 @@ check(const char *path) goto bad; } - if (pflag && (badch = portable(p)) >= 0) { + if (pflag && !portable(p)) { warnx("%s: %s: component contains non-portable " - "character `%c'", path, p, badch); + "character", path, p); goto bad; } @@ -183,8 +183,7 @@ bad: free(pathd); } /* - * Check whether a path component contains only portable characters. Return - * the first non-portable character found. + * Check whether a path component contains only portable characters. */ static int portable(const char *path) @@ -197,7 +196,7 @@ portable(const char *path) s = strspn(path, charset); if (path[s] != '\0') - return (path[s]); + return (0); - return (-1); + return (1); } From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 20:41:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2B6A05B2; Sun, 20 Oct 2013 20:41:39 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 093ED2E85; Sun, 20 Oct 2013 20:41:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KKfcev059694; Sun, 20 Oct 2013 20:41:38 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KKfc3a059692; Sun, 20 Oct 2013 20:41:38 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201310202041.r9KKfc3a059692@svn.freebsd.org> From: Kirk McKusick Date: Sun, 20 Oct 2013 20:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256801 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 20:41:39 -0000 Author: mckusick Date: Sun Oct 20 20:41:38 2013 New Revision: 256801 URL: http://svnweb.freebsd.org/changeset/base/256801 Log: First of several cleanups to soft dependency implementation. Convert three functions exported from ffs_softdep.c to static functions as they are not used outside of ffs_softdep.c. No functional change. Tested by: Peter Holm and Scott Long Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Sun Oct 20 20:10:31 2013 (r256800) +++ head/sys/ufs/ffs/ffs_extern.h Sun Oct 20 20:41:38 2013 (r256801) @@ -152,9 +152,7 @@ void softdep_setup_sbupdate(struct ufsmo void softdep_fsync_mountdev(struct vnode *); int softdep_sync_metadata(struct vnode *); int softdep_sync_buf(struct vnode *, struct buf *, int); -int softdep_process_worklist(struct mount *, int); int softdep_fsync(struct vnode *); -int softdep_waitidle(struct mount *); int softdep_prealloc(struct vnode *, int); int softdep_journal_lookup(struct mount *, struct vnode **); void softdep_journal_freeblocks(struct inode *, struct ucred *, off_t, int); Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sun Oct 20 20:10:31 2013 (r256800) +++ head/sys/ufs/ffs/ffs_softdep.c Sun Oct 20 20:41:38 2013 (r256801) @@ -812,6 +812,8 @@ struct jextent { * Internal function prototypes. */ static void softdep_error(char *, int); +static int softdep_process_worklist(struct mount *, int); +static int softdep_waitidle(struct mount *); static void drain_output(struct vnode *); static struct buf *getdirtybuf(struct buf *, struct rwlock *, int); static void clear_remove(void); @@ -926,7 +928,7 @@ static inline void setup_freeindir(struc static inline struct freeblks *newfreeblks(struct mount *, struct inode *); static void freeblks_free(struct ufsmount *, struct freeblks *, int); static void indir_trunc(struct freework *, ufs2_daddr_t, ufs_lbn_t); -ufs2_daddr_t blkcount(struct fs *, ufs2_daddr_t, off_t); +static ufs2_daddr_t blkcount(struct fs *, ufs2_daddr_t, off_t); static int trunc_check_buf(struct buf *, int *, ufs_lbn_t, int, int); static void trunc_dependencies(struct inode *, struct freeblks *, ufs_lbn_t, int, int); @@ -1563,7 +1565,7 @@ wait_worklist(wk, wmesg) * ordering ensures that no new triples will be generated * until all the old ones have been purged from the dependency lists. */ -int +static int softdep_process_worklist(mp, full) struct mount *mp; int full; @@ -1909,7 +1911,7 @@ softdep_flushworklist(oldmnt, countp, td return (error); } -int +static int softdep_waitidle(struct mount *mp) { struct ufsmount *ump; @@ -6225,7 +6227,7 @@ complete_trunc_indir(freework) * Calculate the number of blocks we are going to release where datablocks * is the current total and length is the new file size. */ -ufs2_daddr_t +static ufs2_daddr_t blkcount(fs, datablocks, length) struct fs *fs; ufs2_daddr_t datablocks; From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 20:50:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5370383F; Sun, 20 Oct 2013 20:50:18 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 25C882EDE; Sun, 20 Oct 2013 20:50:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KKoIsk062746; Sun, 20 Oct 2013 20:50:18 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KKoIVG062745; Sun, 20 Oct 2013 20:50:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201310202050.r9KKoIVG062745@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 20 Oct 2013 20:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256802 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 20:50:18 -0000 Author: jilles Date: Sun Oct 20 20:50:17 2013 New Revision: 256802 URL: http://svnweb.freebsd.org/changeset/base/256802 Log: popen(): Try to prevent inappropriate fd passing even if 'e' is not used. Even though not all race conditions can be fixed if the 'e' option is not used, still fix some race conditions using pipe2(): * Prevent both ends of the pipe from leaking to a concurrent popen(). * Prevent the child process's end of the pipe from leaking to any concurrent fork and exec. This change also simplifies the code. Modified: head/lib/libc/gen/popen.c Modified: head/lib/libc/gen/popen.c ============================================================================== --- head/lib/libc/gen/popen.c Sun Oct 20 20:41:38 2013 (r256801) +++ head/lib/libc/gen/popen.c Sun Oct 20 20:50:17 2013 (r256802) @@ -90,7 +90,7 @@ popen(command, type) (type[1] && (type[1] != 'e' || type[2]))) return (NULL); } - if ((cloexec ? pipe2(pdes, O_CLOEXEC) : pipe(pdes)) < 0) + if (pipe2(pdes, O_CLOEXEC) < 0) return (NULL); if ((cur = malloc(sizeof(struct pid))) == NULL) { @@ -123,29 +123,20 @@ popen(command, type) * the compiler is free to corrupt all the local * variables. */ - if (!cloexec) - (void)_close(pdes[0]); if (pdes[1] != STDOUT_FILENO) { (void)_dup2(pdes[1], STDOUT_FILENO); - if (!cloexec) - (void)_close(pdes[1]); if (twoway) (void)_dup2(STDOUT_FILENO, STDIN_FILENO); } else if (twoway && (pdes[1] != STDIN_FILENO)) { (void)_dup2(pdes[1], STDIN_FILENO); - if (cloexec) - (void)_fcntl(pdes[1], F_SETFD, 0); - } else if (cloexec) + (void)_fcntl(pdes[1], F_SETFD, 0); + } else (void)_fcntl(pdes[1], F_SETFD, 0); } else { if (pdes[0] != STDIN_FILENO) { (void)_dup2(pdes[0], STDIN_FILENO); - if (!cloexec) - (void)_close(pdes[0]); - } else if (cloexec) + } else (void)_fcntl(pdes[0], F_SETFD, 0); - if (!cloexec) - (void)_close(pdes[1]); } SLIST_FOREACH(p, &pidlist, next) (void)_close(fileno(p->fp)); @@ -171,6 +162,14 @@ popen(command, type) SLIST_INSERT_HEAD(&pidlist, cur, next); THREAD_UNLOCK(); + /* + * To guard against undesired fd passing with concurrent calls, + * only clear the close-on-exec flag after linking the file into + * the list which will cause an explicit close. + */ + if (!cloexec) + (void)_fcntl(*type == 'r' ? pdes[0] : pdes[1], F_SETFD, 0); + return (iop); } From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 20:52:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1A9F398C; Sun, 20 Oct 2013 20:52:08 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ED56A2EED; Sun, 20 Oct 2013 20:52:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KKq7T7065549; Sun, 20 Oct 2013 20:52:07 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KKq7A3065547; Sun, 20 Oct 2013 20:52:07 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201310202052.r9KKq7A3065547@svn.freebsd.org> From: Kirk McKusick Date: Sun, 20 Oct 2013 20:52:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256803 - in head/sys/ufs: ffs ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 20:52:08 -0000 Author: mckusick Date: Sun Oct 20 20:52:07 2013 New Revision: 256803 URL: http://svnweb.freebsd.org/changeset/base/256803 Log: Second of several cleanups to soft dependency implementation. Delete two unused functions in ffs_sofdep.c. No functional change. Tested by: Peter Holm and Scott Long Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ufs/ufs_extern.h Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sun Oct 20 20:50:17 2013 (r256802) +++ head/sys/ufs/ffs/ffs_softdep.c Sun Oct 20 20:52:07 2013 (r256803) @@ -521,14 +521,6 @@ softdep_slowdown(vp) panic("softdep_slowdown called"); } -void -softdep_releasefile(ip) - struct inode *ip; /* inode with the zero effective link count */ -{ - - panic("softdep_releasefile called"); -} - int softdep_request_cleanup(fs, vp, cred, resource) struct fs *fs; @@ -4695,32 +4687,6 @@ softdep_revert_create(dp, ip) } /* - * Called to release the journal structures created by a failed dotdot link - * creation. Adjusts nlinkdelta for non-journaling softdep. - */ -void -softdep_revert_dotdot_link(dp, ip) - struct inode *dp; - struct inode *ip; -{ - struct inodedep *inodedep; - struct jaddref *jaddref; - struct vnode *dvp; - - dvp = ITOV(dp); - ACQUIRE_LOCK(&lk); - inodedep = inodedep_lookup_ip(dp); - if (DOINGSUJ(dvp)) { - jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst, - inoreflst); - KASSERT(jaddref->ja_parent == ip->i_number, - ("softdep_revert_dotdot_link: addref parent mismatch")); - cancel_jaddref(jaddref, inodedep, &inodedep->id_inowait); - } - FREE_LOCK(&lk); -} - -/* * Called to release the journal structures created by a failed link * addition. Adjusts nlinkdelta for non-journaling softdep. */ Modified: head/sys/ufs/ufs/ufs_extern.h ============================================================================== --- head/sys/ufs/ufs/ufs_extern.h Sun Oct 20 20:50:17 2013 (r256802) +++ head/sys/ufs/ufs/ufs_extern.h Sun Oct 20 20:52:07 2013 (r256803) @@ -98,7 +98,6 @@ void softdep_setup_remove(struct buf *,s void softdep_setup_directory_change(struct buf *, struct inode *, struct inode *, ino_t, int); void softdep_change_linkcnt(struct inode *); -void softdep_releasefile(struct inode *); int softdep_slowdown(struct vnode *); void softdep_setup_create(struct inode *, struct inode *); void softdep_setup_dotdot_link(struct inode *, struct inode *); @@ -107,7 +106,6 @@ void softdep_setup_mkdir(struct inode *, void softdep_setup_rmdir(struct inode *, struct inode *); void softdep_setup_unlink(struct inode *, struct inode *); void softdep_revert_create(struct inode *, struct inode *); -void softdep_revert_dotdot_link(struct inode *, struct inode *); void softdep_revert_link(struct inode *, struct inode *); void softdep_revert_mkdir(struct inode *, struct inode *); void softdep_revert_rmdir(struct inode *, struct inode *); From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 21:03:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BABB9D0D; Sun, 20 Oct 2013 21:03:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8D7092F9E; Sun, 20 Oct 2013 21:03:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KL3G78071209; Sun, 20 Oct 2013 21:03:16 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KL3G1C071207; Sun, 20 Oct 2013 21:03:16 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310202103.r9KL3G1C071207@svn.freebsd.org> From: Ian Lepore Date: Sun, 20 Oct 2013 21:03:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256804 - in head/sys: arm/freescale/imx boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 21:03:16 -0000 Author: ian Date: Sun Oct 20 21:03:15 2013 New Revision: 256804 URL: http://svnweb.freebsd.org/changeset/base/256804 Log: Switch to using the standard uart console driver instead of the special driver for early boot debugging. Modified: head/sys/arm/freescale/imx/files.imx53 head/sys/boot/fdt/dts/digi-ccwmx53.dts Modified: head/sys/arm/freescale/imx/files.imx53 ============================================================================== --- head/sys/arm/freescale/imx/files.imx53 Sun Oct 20 20:52:07 2013 (r256803) +++ head/sys/arm/freescale/imx/files.imx53 Sun Oct 20 21:03:15 2013 (r256804) @@ -12,8 +12,11 @@ arm/freescale/imx/imx53_machdep.c standa arm/freescale/imx/common.c standard arm/freescale/imx/bus_space.c standard -# Dummy serial console -arm/freescale/imx/console.c standard +# Special serial console for debuging early boot code +#arm/freescale/imx/console.c standard + +# UART driver (includes serial console support) +dev/uart/uart_dev_imx.c optional uart # TrustZone Interrupt Controller arm/freescale/imx/tzic.c standard @@ -33,9 +36,6 @@ arm/freescale/imx/imx51_ccm.c standard # i.MX5xx PATA controller dev/ata/chipsets/ata-fsl.c optional imxata -# UART driver -#dev/uart/uart_dev_imx.c optional uart - # USB join controller (1 OTG, 3 EHCI) dev/usb/controller/ehci_imx.c optional ehci Modified: head/sys/boot/fdt/dts/digi-ccwmx53.dts ============================================================================== --- head/sys/boot/fdt/dts/digi-ccwmx53.dts Sun Oct 20 20:52:07 2013 (r256803) +++ head/sys/boot/fdt/dts/digi-ccwmx53.dts Sun Oct 20 21:03:15 2013 (r256804) @@ -70,9 +70,9 @@ }; /* UART1, console */ - UART1: serial@53fbc000 { + console: serial@53fbc000 { status = "okay"; - clock-frequency = <3000000>; /* XXX */ + clock-frequency = <0>; /* won't load w/o this */ }; clock@53fd4000 { @@ -111,13 +111,12 @@ }; aliases { - UART1 = &UART1; SSI2 = &SSI2; }; chosen { bootargs = "-v"; - stdin = "UART1"; - stdout = "UART1"; + stdin = &console; + stdout = &console; }; }; From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 21:04:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 736ACE89; Sun, 20 Oct 2013 21:04:45 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 60F702FA8; Sun, 20 Oct 2013 21:04:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KL4jck071705; Sun, 20 Oct 2013 21:04:45 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KL4jfp071704; Sun, 20 Oct 2013 21:04:45 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201310202104.r9KL4jfp071704@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 20 Oct 2013 21:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256805 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 21:04:45 -0000 Author: jilles Date: Sun Oct 20 21:04:44 2013 New Revision: 256805 URL: http://svnweb.freebsd.org/changeset/base/256805 Log: syslog: Use SOCK_CLOEXEC instead of separate fcntl() call. Modified: head/lib/libc/gen/syslog.c Modified: head/lib/libc/gen/syslog.c ============================================================================== --- head/lib/libc/gen/syslog.c Sun Oct 20 21:03:15 2013 (r256804) +++ head/lib/libc/gen/syslog.c Sun Oct 20 21:04:44 2013 (r256805) @@ -341,9 +341,9 @@ connectlog(void) struct sockaddr_un SyslogAddr; /* AF_UNIX address of local logger */ if (LogFile == -1) { - if ((LogFile = _socket(AF_UNIX, SOCK_DGRAM, 0)) == -1) + if ((LogFile = _socket(AF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC, + 0)) == -1) return; - (void)_fcntl(LogFile, F_SETFD, FD_CLOEXEC); } if (LogFile != -1 && status == NOCONN) { SyslogAddr.sun_len = sizeof(SyslogAddr); From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 21:07:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5D4B793; Sun, 20 Oct 2013 21:07:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 497612FCF; Sun, 20 Oct 2013 21:07:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KL7dD8072614; Sun, 20 Oct 2013 21:07:39 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KL7dkl072599; Sun, 20 Oct 2013 21:07:39 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310202107.r9KL7dkl072599@svn.freebsd.org> From: Ian Lepore Date: Sun, 20 Oct 2013 21:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256806 - in head/sys: arm/freescale/imx dev/ffec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 21:07:39 -0000 Author: ian Date: Sun Oct 20 21:07:38 2013 New Revision: 256806 URL: http://svnweb.freebsd.org/changeset/base/256806 Log: Add a driver for the Freescale Fast Ethernet Controller found on various Freescale SoCs including the i.MX series. This also works for the newer SoCs with the ENET gigabit controller, but doesn't use any of the new hardware features other than enabling gigabit speed. Added: head/sys/dev/ffec/ head/sys/dev/ffec/if_ffec.c (contents, props changed) head/sys/dev/ffec/if_ffecreg.h (contents, props changed) Modified: head/sys/arm/freescale/imx/files.imx53 Modified: head/sys/arm/freescale/imx/files.imx53 ============================================================================== --- head/sys/arm/freescale/imx/files.imx53 Sun Oct 20 21:04:44 2013 (r256805) +++ head/sys/arm/freescale/imx/files.imx53 Sun Oct 20 21:07:38 2013 (r256806) @@ -49,3 +49,6 @@ dev/ofw/ofw_iicbus.c optional fsliic # IPU - Image Processing Unit (frame buffer also) arm/freescale/imx/imx51_ipuv3.c optional sc +# Fast Ethernet Controller +dev/ffec/if_ffec.c optional ffec + Added: head/sys/dev/ffec/if_ffec.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ffec/if_ffec.c Sun Oct 20 21:07:38 2013 (r256806) @@ -0,0 +1,1740 @@ +/*- + * Copyright (c) 2013 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Driver for Freescale Fast Ethernet Controller, found on imx-series SoCs among + * others. Also works for the ENET Gigibit controller found on imx6 and imx28, + * but the driver doesn't currently use any of the ENET advanced features other + * than enabling gigabit. + * + * The interface name 'fec' is already taken by netgraph's Fast Etherchannel + * (netgraph/ng_fec.c), so we use 'ffec'. + * + * Requires an FDT entry with at least these properties: + * fec: ethernet@02188000 { + * compatible = "fsl,imxNN-fec"; + * reg = <0x02188000 0x4000>; + * interrupts = <150 151>; + * phy-mode = "rgmii"; + * phy-disable-preamble; // optional + * }; + * The second interrupt number is for IEEE-1588, and is not currently used; it + * need not be present. phy-mode must be one of: "mii", "rmii", "rgmii". + * There is also an optional property, phy-disable-preamble, which if present + * will disable the preamble bits, cutting the size of each mdio transaction + * (and thus the busy-wait time) in half. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include "miibus_if.h" + +/* + * Driver data and defines. + */ +#define RX_DESC_COUNT 64 +#define RX_DESC_SIZE (sizeof(struct ffec_hwdesc) * RX_DESC_COUNT) +#define TX_DESC_COUNT 64 +#define TX_DESC_SIZE (sizeof(struct ffec_hwdesc) * TX_DESC_COUNT) + +#define WATCHDOG_TIMEOUT_SECS 5 +#define STATS_HARVEST_INTERVAL 3 + +struct ffec_bufmap { + struct mbuf *mbuf; + bus_dmamap_t map; +}; + +enum { + PHY_CONN_UNKNOWN, + PHY_CONN_MII, + PHY_CONN_RMII, + PHY_CONN_RGMII +}; + +enum { + FECTYPE_GENERIC, + FECTYPE_IMX51, + FECTYPE_IMX53, + FECTYPE_IMX6, +}; + +struct ffec_softc { + device_t dev; + device_t miibus; + struct mii_data * mii_softc; + struct ifnet *ifp; + int if_flags; + struct mtx mtx; + struct resource *irq_res; + struct resource *mem_res; + void * intr_cookie; + struct callout ffec_callout; + uint8_t phy_conn_type; + uint8_t fectype; + boolean_t link_is_up; + boolean_t is_attached; + boolean_t is_detaching; + int tx_watchdog_count; + int stats_harvest_count; + + bus_dma_tag_t rxdesc_tag; + bus_dmamap_t rxdesc_map; + struct ffec_hwdesc *rxdesc_ring; + bus_addr_t rxdesc_ring_paddr; + bus_dma_tag_t rxbuf_tag; + struct ffec_bufmap rxbuf_map[RX_DESC_COUNT]; + uint32_t rx_idx; + + bus_dma_tag_t txdesc_tag; + bus_dmamap_t txdesc_map; + struct ffec_hwdesc *txdesc_ring; + bus_addr_t txdesc_ring_paddr; + bus_dma_tag_t txbuf_tag; + struct ffec_bufmap txbuf_map[RX_DESC_COUNT]; + uint32_t tx_idx_head; + uint32_t tx_idx_tail; + int txcount; +}; + +#define FFEC_LOCK(sc) mtx_lock(&(sc)->mtx) +#define FFEC_UNLOCK(sc) mtx_unlock(&(sc)->mtx) +#define FFEC_LOCK_INIT(sc) mtx_init(&(sc)->mtx, \ + device_get_nameunit((sc)->dev), MTX_NETWORK_LOCK, MTX_DEF) +#define FFEC_LOCK_DESTROY(sc) mtx_destroy(&(sc)->mtx); +#define FFEC_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED); +#define FFEC_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, MA_NOTOWNED); + +static void ffec_init_locked(struct ffec_softc *sc); +static void ffec_stop_locked(struct ffec_softc *sc); +static void ffec_txstart_locked(struct ffec_softc *sc); +static void ffec_txfinish_locked(struct ffec_softc *sc); + +static inline uint16_t +RD2(struct ffec_softc *sc, bus_size_t off) +{ + + return (bus_read_2(sc->mem_res, off)); +} + +static inline void +WR2(struct ffec_softc *sc, bus_size_t off, uint16_t val) +{ + + bus_write_2(sc->mem_res, off, val); +} + +static inline uint32_t +RD4(struct ffec_softc *sc, bus_size_t off) +{ + + return (bus_read_4(sc->mem_res, off)); +} + +static inline void +WR4(struct ffec_softc *sc, bus_size_t off, uint32_t val) +{ + + bus_write_4(sc->mem_res, off, val); +} + +static inline uint32_t +next_rxidx(struct ffec_softc *sc, uint32_t curidx) +{ + + return ((curidx == RX_DESC_COUNT - 1) ? 0 : curidx + 1); +} + +static inline uint32_t +next_txidx(struct ffec_softc *sc, uint32_t curidx) +{ + + return ((curidx == TX_DESC_COUNT - 1) ? 0 : curidx + 1); +} + +static void +ffec_get1paddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + + if (error != 0) + return; + *(bus_addr_t *)arg = segs[0].ds_addr; +} + +static void +ffec_miigasket_setup(struct ffec_softc *sc) +{ + uint32_t ifmode; + + /* + * We only need the gasket for MII and RMII connections on certain SoCs. + */ + + switch (sc->fectype) + { + case FECTYPE_IMX53: + break; + default: + return; + } + + switch (sc->phy_conn_type) + { + case PHY_CONN_MII: + ifmode = 0; + break; + case PHY_CONN_RMII: + ifmode = FEC_MIIGSK_CFGR_IF_MODE_RMII; + break; + default: + return; + } + + /* + * Disable the gasket, configure for either MII or RMII, then enable. + */ + + WR2(sc, FEC_MIIGSK_ENR, 0); + while (RD2(sc, FEC_MIIGSK_ENR) & FEC_MIIGSK_ENR_READY) + continue; + + WR2(sc, FEC_MIIGSK_CFGR, ifmode); + + WR2(sc, FEC_MIIGSK_ENR, FEC_MIIGSK_ENR_EN); + while (!(RD2(sc, FEC_MIIGSK_ENR) & FEC_MIIGSK_ENR_READY)) + continue; +} + +static boolean_t +ffec_miibus_iowait(struct ffec_softc *sc) +{ + uint32_t timeout; + + for (timeout = 10000; timeout != 0; --timeout) + if (RD4(sc, FEC_IER_REG) & FEC_IER_MII) + return (true); + + return (false); +} + +static int +ffec_miibus_readreg(device_t dev, int phy, int reg) +{ + struct ffec_softc *sc; + int val; + + sc = device_get_softc(dev); + + WR4(sc, FEC_IER_REG, FEC_IER_MII); + + WR4(sc, FEC_MMFR_REG, FEC_MMFR_OP_READ | + FEC_MMFR_ST_VALUE | FEC_MMFR_TA_VALUE | + ((phy << FEC_MMFR_PA_SHIFT) & FEC_MMFR_PA_MASK) | + ((reg << FEC_MMFR_RA_SHIFT) & FEC_MMFR_RA_MASK)); + + if (!ffec_miibus_iowait(sc)) { + device_printf(dev, "timeout waiting for mii read\n"); + return (-1); /* All-ones is a symptom of bad mdio. */ + } + + val = RD4(sc, FEC_MMFR_REG) & FEC_MMFR_DATA_MASK; + + return (val); +} + +static int +ffec_miibus_writereg(device_t dev, int phy, int reg, int val) +{ + struct ffec_softc *sc; + + sc = device_get_softc(dev); + + WR4(sc, FEC_IER_REG, FEC_IER_MII); + + WR4(sc, FEC_MMFR_REG, FEC_MMFR_OP_WRITE | + FEC_MMFR_ST_VALUE | FEC_MMFR_TA_VALUE | + ((phy << FEC_MMFR_PA_SHIFT) & FEC_MMFR_PA_MASK) | + ((reg << FEC_MMFR_RA_SHIFT) & FEC_MMFR_RA_MASK) | + (val & FEC_MMFR_DATA_MASK)); + + if (!ffec_miibus_iowait(sc)) { + device_printf(dev, "timeout waiting for mii write\n"); + return (-1); + } + + return (0); +} + +static void +ffec_miibus_statchg(device_t dev) +{ + struct ffec_softc *sc; + struct mii_data *mii; + uint32_t ecr, rcr, tcr; + + /* + * Called by the MII bus driver when the PHY establishes link to set the + * MAC interface registers. + */ + + sc = device_get_softc(dev); + + FFEC_ASSERT_LOCKED(sc); + + mii = sc->mii_softc; + + if (mii->mii_media_status & IFM_ACTIVE) + sc->link_is_up = true; + else + sc->link_is_up = false; + + ecr = RD4(sc, FEC_ECR_REG) & ~FEC_ECR_SPEED; + rcr = RD4(sc, FEC_RCR_REG) & ~(FEC_RCR_RMII_10T | FEC_RCR_RMII_MODE | + FEC_RCR_RGMII_EN | FEC_RCR_DRT | FEC_RCR_FCE); + tcr = RD4(sc, FEC_TCR_REG) & ~FEC_TCR_FDEN; + + rcr |= FEC_RCR_MII_MODE; /* Must always be on even for R[G]MII. */ + switch (sc->phy_conn_type) { + case PHY_CONN_MII: + break; + case PHY_CONN_RMII: + rcr |= FEC_RCR_RMII_MODE; + break; + case PHY_CONN_RGMII: + rcr |= FEC_RCR_RGMII_EN; + break; + } + + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_1000_T: + case IFM_1000_SX: + ecr |= FEC_ECR_SPEED; + break; + case IFM_100_TX: + /* Not-FEC_ECR_SPEED + not-FEC_RCR_RMII_10T means 100TX */ + break; + case IFM_10_T: + rcr |= FEC_RCR_RMII_10T; + break; + case IFM_NONE: + sc->link_is_up = false; + return; + default: + sc->link_is_up = false; + device_printf(dev, "Unsupported media %u\n", + IFM_SUBTYPE(mii->mii_media_active)); + return; + } + + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) + tcr |= FEC_TCR_FDEN; + else + rcr |= FEC_RCR_DRT; + + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FLOW) != 0) + rcr |= FEC_RCR_FCE; + + WR4(sc, FEC_RCR_REG, rcr); + WR4(sc, FEC_TCR_REG, tcr); + WR4(sc, FEC_ECR_REG, ecr); +} + +static void +ffec_media_status(struct ifnet * ifp, struct ifmediareq *ifmr) +{ + struct ffec_softc *sc; + struct mii_data *mii; + + + sc = ifp->if_softc; + mii = sc->mii_softc; + FFEC_LOCK(sc); + mii_pollstat(mii); + ifmr->ifm_active = mii->mii_media_active; + ifmr->ifm_status = mii->mii_media_status; + FFEC_UNLOCK(sc); +} + +static int +ffec_media_change_locked(struct ffec_softc *sc) +{ + + return (mii_mediachg(sc->mii_softc)); +} + +static int +ffec_media_change(struct ifnet * ifp) +{ + struct ffec_softc *sc; + int error; + + sc = ifp->if_softc; + + FFEC_LOCK(sc); + error = ffec_media_change_locked(sc); + FFEC_UNLOCK(sc); + return (error); +} + +static void ffec_clear_stats(struct ffec_softc *sc) +{ + + WR4(sc, FEC_RMON_R_PACKETS, 0); + WR4(sc, FEC_RMON_R_MC_PKT, 0); + WR4(sc, FEC_RMON_R_CRC_ALIGN, 0); + WR4(sc, FEC_RMON_R_UNDERSIZE, 0); + WR4(sc, FEC_RMON_R_OVERSIZE, 0); + WR4(sc, FEC_RMON_R_FRAG, 0); + WR4(sc, FEC_RMON_R_JAB, 0); + WR4(sc, FEC_RMON_T_PACKETS, 0); + WR4(sc, FEC_RMON_T_MC_PKT, 0); + WR4(sc, FEC_RMON_T_CRC_ALIGN, 0); + WR4(sc, FEC_RMON_T_UNDERSIZE, 0); + WR4(sc, FEC_RMON_T_OVERSIZE , 0); + WR4(sc, FEC_RMON_T_FRAG, 0); + WR4(sc, FEC_RMON_T_JAB, 0); + WR4(sc, FEC_RMON_T_COL, 0); +} + +static void +ffec_harvest_stats(struct ffec_softc *sc) +{ + struct ifnet *ifp; + + /* We don't need to harvest too often. */ + if (++sc->stats_harvest_count < STATS_HARVEST_INTERVAL) + return; + + /* + * Try to avoid harvesting unless the IDLE flag is on, but if it has + * been too long just go ahead and do it anyway, the worst that'll + * happen is we'll lose a packet count or two as we clear at the end. + */ + if (sc->stats_harvest_count < (2 * STATS_HARVEST_INTERVAL) && + ((RD4(sc, FEC_MIBC_REG) & FEC_MIBC_IDLE) == 0)) + return; + + sc->stats_harvest_count = 0; + ifp = sc->ifp; + + ifp->if_ipackets += RD4(sc, FEC_RMON_R_PACKETS); + ifp->if_imcasts += RD4(sc, FEC_RMON_R_MC_PKT); + ifp->if_ierrors += RD4(sc, FEC_RMON_R_CRC_ALIGN); + ifp->if_ierrors += RD4(sc, FEC_RMON_R_UNDERSIZE); + ifp->if_ierrors += RD4(sc, FEC_RMON_R_OVERSIZE); + ifp->if_ierrors += RD4(sc, FEC_RMON_R_FRAG); + ifp->if_ierrors += RD4(sc, FEC_RMON_R_JAB); + + ifp->if_opackets += RD4(sc, FEC_RMON_T_PACKETS); + ifp->if_omcasts += RD4(sc, FEC_RMON_T_MC_PKT); + ifp->if_oerrors += RD4(sc, FEC_RMON_T_CRC_ALIGN); + ifp->if_oerrors += RD4(sc, FEC_RMON_T_UNDERSIZE); + ifp->if_oerrors += RD4(sc, FEC_RMON_T_OVERSIZE ); + ifp->if_oerrors += RD4(sc, FEC_RMON_T_FRAG); + ifp->if_oerrors += RD4(sc, FEC_RMON_T_JAB); + + ifp->if_collisions += RD4(sc, FEC_RMON_T_COL); + + ffec_clear_stats(sc); +} + +static void +ffec_tick(void *arg) +{ + struct ffec_softc *sc; + struct ifnet *ifp; + int link_was_up; + + sc = arg; + + FFEC_ASSERT_LOCKED(sc); + + ifp = sc->ifp; + + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) + return; + + /* + * Typical tx watchdog. If this fires it indicates that we enqueued + * packets for output and never got a txdone interrupt for them. Maybe + * it's a missed interrupt somehow, just pretend we got one. + */ + if (sc->tx_watchdog_count > 0) { + if (--sc->tx_watchdog_count == 0) { + ffec_txfinish_locked(sc); + } + } + + /* Gather stats from hardware counters. */ + ffec_harvest_stats(sc); + + /* Check the media status. */ + link_was_up = sc->link_is_up; + mii_tick(sc->mii_softc); + if (sc->link_is_up && !link_was_up) + ffec_txstart_locked(sc); + + /* Schedule another check one second from now. */ + callout_reset(&sc->ffec_callout, hz, ffec_tick, sc); +} + +inline static uint32_t +ffec_setup_txdesc(struct ffec_softc *sc, int idx, bus_addr_t paddr, + uint32_t len) +{ + uint32_t nidx; + uint32_t flags; + + nidx = next_txidx(sc, idx); + + /* Addr/len 0 means we're clearing the descriptor after xmit done. */ + if (paddr == 0 || len == 0) { + flags = 0; + --sc->txcount; + } else { + flags = FEC_TXDESC_READY | FEC_TXDESC_L | FEC_TXDESC_TC; + ++sc->txcount; + } + if (nidx == 0) + flags |= FEC_TXDESC_WRAP; + + /* + * The hardware requires 32-bit physical addresses. We set up the dma + * tag to indicate that, so the cast to uint32_t should never lose + * significant bits. + */ + sc->txdesc_ring[idx].buf_paddr = (uint32_t)paddr; + sc->txdesc_ring[idx].flags_len = flags | len; /* Must be set last! */ + + return (nidx); +} + +static int +ffec_setup_txbuf(struct ffec_softc *sc, int idx, struct mbuf **mp) +{ + struct mbuf * m; + int error, nsegs; + struct bus_dma_segment seg; + + if ((m = m_defrag(*mp, M_NOWAIT)) == NULL) + return (ENOMEM); + *mp = m; + + error = bus_dmamap_load_mbuf_sg(sc->txbuf_tag, sc->txbuf_map[idx].map, + m, &seg, &nsegs, 0); + if (error != 0) { + return (ENOMEM); + } + bus_dmamap_sync(sc->txbuf_tag, sc->txbuf_map[idx].map, + BUS_DMASYNC_PREWRITE); + + sc->txbuf_map[idx].mbuf = m; + ffec_setup_txdesc(sc, idx, seg.ds_addr, seg.ds_len); + + return (0); + +} + +static void +ffec_txstart_locked(struct ffec_softc *sc) +{ + struct ifnet *ifp; + struct mbuf *m; + int enqueued; + + FFEC_ASSERT_LOCKED(sc); + + if (!sc->link_is_up) + return; + + ifp = sc->ifp; + + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) + return; + + enqueued = 0; + + for (;;) { + if (sc->txcount == (TX_DESC_COUNT-1)) { + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + break; + } + IFQ_DRV_DEQUEUE(&ifp->if_snd, m); + if (m == NULL) + break; + if (ffec_setup_txbuf(sc, sc->tx_idx_head, &m) != 0) { + IFQ_DRV_PREPEND(&ifp->if_snd, m); + break; + } + BPF_MTAP(ifp, m); + sc->tx_idx_head = next_txidx(sc, sc->tx_idx_head); + ++enqueued; + } + + if (enqueued != 0) { + WR4(sc, FEC_TDAR_REG, FEC_TDAR_TDAR); + sc->tx_watchdog_count = WATCHDOG_TIMEOUT_SECS; + } +} + +static void +ffec_txstart(struct ifnet *ifp) +{ + struct ffec_softc *sc = ifp->if_softc; + + FFEC_LOCK(sc); + ffec_txstart_locked(sc); + FFEC_UNLOCK(sc); +} + +static void +ffec_txfinish_locked(struct ffec_softc *sc) +{ + struct ifnet *ifp; + struct ffec_hwdesc *desc; + struct ffec_bufmap *bmap; + boolean_t retired_buffer; + + FFEC_ASSERT_LOCKED(sc); + + ifp = sc->ifp; + retired_buffer = false; + while (sc->tx_idx_tail != sc->tx_idx_head) { + desc = &sc->txdesc_ring[sc->tx_idx_tail]; + if (desc->flags_len & FEC_TXDESC_READY) + break; + retired_buffer = true; + bmap = &sc->txbuf_map[sc->tx_idx_tail]; + bus_dmamap_sync(sc->txbuf_tag, bmap->map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->txbuf_tag, bmap->map); + m_freem(bmap->mbuf); + bmap->mbuf = NULL; + ffec_setup_txdesc(sc, sc->tx_idx_tail, 0, 0); + sc->tx_idx_tail = next_txidx(sc, sc->tx_idx_tail); + } + + /* + * If we retired any buffers, there will be open tx slots available in + * the descriptor ring, go try to start some new output. + */ + if (retired_buffer) { + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + ffec_txstart_locked(sc); + } + + /* If there are no buffers outstanding, muzzle the watchdog. */ + if (sc->tx_idx_tail == sc->tx_idx_head) { + sc->tx_watchdog_count = 0; + } +} + +inline static uint32_t +ffec_setup_rxdesc(struct ffec_softc *sc, int idx, bus_addr_t paddr) +{ + uint32_t nidx; + + /* + * The hardware requires 32-bit physical addresses. We set up the dma + * tag to indicate that, so the cast to uint32_t should never lose + * significant bits. + */ + nidx = next_rxidx(sc, idx); + sc->rxdesc_ring[idx].buf_paddr = (uint32_t)paddr; + sc->rxdesc_ring[idx].flags_len = FEC_RXDESC_EMPTY | + ((nidx == 0) ? FEC_RXDESC_WRAP : 0); + + return (nidx); +} + +static int +ffec_setup_rxbuf(struct ffec_softc *sc, int idx, struct mbuf * m) +{ + int error, nsegs; + struct bus_dma_segment seg; + + /* + * We need to leave at least ETHER_ALIGN bytes free at the beginning of + * the buffer to allow the data to be re-aligned after receiving it (by + * copying it backwards ETHER_ALIGN bytes in the same buffer). We also + * have to ensure that the beginning of the buffer is aligned to the + * hardware's requirements. + */ + m_adj(m, roundup(ETHER_ALIGN, FEC_RXBUF_ALIGN)); + + error = bus_dmamap_load_mbuf_sg(sc->rxbuf_tag, sc->rxbuf_map[idx].map, + m, &seg, &nsegs, 0); + if (error != 0) { + return (error); + } + + bus_dmamap_sync(sc->rxbuf_tag, sc->rxbuf_map[idx].map, + BUS_DMASYNC_PREREAD); + + sc->rxbuf_map[idx].mbuf = m; + ffec_setup_rxdesc(sc, idx, seg.ds_addr); + + return (0); +} + +static struct mbuf * +ffec_alloc_mbufcl(struct ffec_softc *sc) +{ + struct mbuf *m; + + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + m->m_pkthdr.len = m->m_len = m->m_ext.ext_size; + + return (m); +} + +static void +ffec_rxfinish_onebuf(struct ffec_softc *sc, int len) +{ + struct mbuf *m, *newmbuf; + struct ffec_bufmap *bmap; + uint8_t *dst, *src; + int error; + + /* + * First try to get a new mbuf to plug into this slot in the rx ring. + * If that fails, drop the current packet and recycle the current + * mbuf, which is still mapped and loaded. + */ + if ((newmbuf = ffec_alloc_mbufcl(sc)) == NULL) { + ++sc->ifp->if_iqdrops; + ffec_setup_rxdesc(sc, sc->rx_idx, + sc->rxdesc_ring[sc->rx_idx].buf_paddr); + return; + } + + /* + * Unfortunately, the protocol headers need to be aligned on a 32-bit + * boundary for the upper layers. The hardware requires receive + * buffers to be 16-byte aligned. The ethernet header is 14 bytes, + * leaving the protocol header unaligned. We used m_adj() after + * allocating the buffer to leave empty space at the start of the + * buffer, now we'll use the alignment agnostic bcopy() routine to + * shuffle all the data backwards 2 bytes and adjust m_data. + * + * XXX imx6 hardware is able to do this 2-byte alignment by setting the + * SHIFT16 bit in the RACC register. Older hardware doesn't have that + * feature, but for them could we speed this up by copying just the + * protocol headers into their own small mbuf then chaining the cluster + * to it? That way we'd only need to copy like 64 bytes or whatever + * the biggest header is, instead of the whole 1530ish-byte frame. + */ + + FFEC_UNLOCK(sc); + + bmap = &sc->rxbuf_map[sc->rx_idx]; + len -= ETHER_CRC_LEN; + bus_dmamap_sync(sc->rxbuf_tag, bmap->map, BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->rxbuf_tag, bmap->map); + m = bmap->mbuf; + bmap->mbuf = NULL; + m->m_len = len; + m->m_pkthdr.len = len; + m->m_pkthdr.rcvif = sc->ifp; + + src = mtod(m, uint8_t*); + dst = src - ETHER_ALIGN; + bcopy(src, dst, len); + m->m_data = dst; + sc->ifp->if_input(sc->ifp, m); + + FFEC_LOCK(sc); + + if ((error = ffec_setup_rxbuf(sc, sc->rx_idx, newmbuf)) != 0) { + device_printf(sc->dev, "ffec_setup_rxbuf error %d\n", error); + /* XXX Now what? We've got a hole in the rx ring. */ + } + +} + +static void +ffec_rxfinish_locked(struct ffec_softc *sc) +{ + struct ffec_hwdesc *desc; + int len; + boolean_t produced_empty_buffer; + + FFEC_ASSERT_LOCKED(sc); + + produced_empty_buffer = false; + for (;;) { + desc = &sc->rxdesc_ring[sc->rx_idx]; + if (desc->flags_len & FEC_RXDESC_EMPTY) + break; + produced_empty_buffer = true; + len = (desc->flags_len & FEC_RXDESC_LEN_MASK); + if (len < 64) { + /* + * Just recycle the descriptor and continue. . + */ + ffec_setup_rxdesc(sc, sc->rx_idx, + sc->rxdesc_ring[sc->rx_idx].buf_paddr); + } else if ((desc->flags_len & FEC_RXDESC_L) == 0) { + /* + * The entire frame is not in this buffer. Impossible. + * Recycle the descriptor and continue. + * + * XXX what's the right way to handle this? Probably we + * should stop/init the hardware because this should + * just really never happen when we have buffers bigger + * than the maximum frame size. + */ + device_printf(sc->dev, + "fec_rxfinish: received frame without LAST bit set"); + ffec_setup_rxdesc(sc, sc->rx_idx, + sc->rxdesc_ring[sc->rx_idx].buf_paddr); + } else if (desc->flags_len & FEC_RXDESC_ERROR_BITS) { + /* + * Something went wrong with receiving the frame, we + * don't care what (the hardware has counted the error + * in the stats registers already), we just reuse the + * same mbuf, which is still dma-mapped, by resetting + * the rx descriptor. + */ + ffec_setup_rxdesc(sc, sc->rx_idx, + sc->rxdesc_ring[sc->rx_idx].buf_paddr); + } else { + /* + * Normal case: a good frame all in one buffer. + */ + ffec_rxfinish_onebuf(sc, len); + } + sc->rx_idx = next_rxidx(sc, sc->rx_idx); + } + + if (produced_empty_buffer) { + WR4(sc, FEC_RDAR_REG, FEC_RDAR_RDAR); + } +} + +static void +ffec_get_hwaddr(struct ffec_softc *sc, uint8_t *hwaddr) +{ + uint32_t palr, paur, rnd; + + /* + * Try to recover a MAC address from the running hardware. If there's + * something non-zero there, assume the bootloader did the right thing + * and just use it. + * + * Otherwise, set the address to a convenient locally assigned address, + * 'bsd' + random 24 low-order bits. 'b' is 0x62, which has the locally + * assigned bit set, and the broadcast/multicast bit clear. + */ + palr = RD4(sc, FEC_PALR_REG); + paur = RD4(sc, FEC_PAUR_REG); + if ((palr | paur) != 0) { + hwaddr[0] = palr >> 24; + hwaddr[1] = palr >> 16; + hwaddr[2] = palr >> 8; + hwaddr[3] = palr >> 0; + hwaddr[4] = paur >> 24; + hwaddr[5] = paur >> 16; + return; + } else { + rnd = arc4random() & 0x00ffffff; + hwaddr[0] = 'b'; + hwaddr[1] = 's'; + hwaddr[2] = 'd'; + hwaddr[3] = rnd >> 16; + hwaddr[4] = rnd >> 8; + hwaddr[5] = rnd >> 0; + } + + if (bootverbose) { + device_printf(sc->dev, + "MAC address %02x:%02x:%02x:%02x:%02x:%02x:\n", + hwaddr[0], hwaddr[1], hwaddr[2], + hwaddr[3], hwaddr[4], hwaddr[5]); + } +} + +static void +ffec_setup_rxfilter(struct ffec_softc *sc) +{ + struct ifnet *ifp; + struct ifmultiaddr *ifma; + uint8_t *eaddr; + uint32_t crc; + uint64_t ghash, ihash; + + FFEC_ASSERT_LOCKED(sc); + + ifp = sc->ifp; + + /* + * Set the multicast (group) filter hash. + */ + if ((ifp->if_flags & IFF_ALLMULTI)) + ghash = 0xffffffffffffffffLLU; + else { + ghash = 0; + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) + ifma->ifma_addr), ETHER_ADDR_LEN); + ghash |= 1 << (crc & 0x3f); + } + if_maddr_runlock(ifp); + } + WR4(sc, FEC_GAUR_REG, (uint32_t)(ghash >> 32)); + WR4(sc, FEC_GALR_REG, (uint32_t)ghash); + + /* + * Set the individual address filter hash. + * + * XXX Is 0 the right value when promiscuous is off? This hw feature + * seems to support the concept of MAC address aliases, does such a + * thing even exist? + */ + if ((ifp->if_flags & IFF_PROMISC)) + ihash = 0xffffffffffffffffLLU; + else { + ihash = 0; + } + WR4(sc, FEC_IAUR_REG, (uint32_t)(ihash >> 32)); + WR4(sc, FEC_IALR_REG, (uint32_t)ihash); + + /* + * Set the primary address. + */ + eaddr = IF_LLADDR(ifp); + WR4(sc, FEC_PALR_REG, (eaddr[0] << 24) | (eaddr[1] << 16) | + (eaddr[2] << 8) | eaddr[3]); + WR4(sc, FEC_PAUR_REG, (eaddr[4] << 24) | (eaddr[5] << 16)); +} + +static void +ffec_stop_locked(struct ffec_softc *sc) +{ + struct ifnet *ifp; + struct ffec_hwdesc *desc; + struct ffec_bufmap *bmap; + int idx; + + FFEC_ASSERT_LOCKED(sc); + + ifp = sc->ifp; + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + sc->tx_watchdog_count = 0; + sc->stats_harvest_count = 0; + + /* + * Stop the hardware, mask all interrupts, and clear all current + * interrupt status bits. + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 21:11:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A44DD309; Sun, 20 Oct 2013 21:11:41 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 783552029; Sun, 20 Oct 2013 21:11:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KLBfne076012; Sun, 20 Oct 2013 21:11:41 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KLBfq5076008; Sun, 20 Oct 2013 21:11:41 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201310202111.r9KLBfq5076008@svn.freebsd.org> From: Kirk McKusick Date: Sun, 20 Oct 2013 21:11:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256808 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 21:11:41 -0000 Author: mckusick Date: Sun Oct 20 21:11:40 2013 New Revision: 256808 URL: http://svnweb.freebsd.org/changeset/base/256808 Log: Third of several cleanups to soft dependency implementation. Ensure that softdep_unmount() and softdep_setup_sbupdate() only get called for filesystems running with soft dependencies. No functional change. Tested by: Peter Holm and Scott Long Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sun Oct 20 21:11:36 2013 (r256807) +++ head/sys/ufs/ffs/ffs_softdep.c Sun Oct 20 21:11:40 2013 (r256808) @@ -13686,6 +13686,17 @@ DB_SHOW_COMMAND(mkdirs, db_show_mkdirs) } } +/* exported to ffs_vfsops.c */ +extern void db_print_ffs(struct ufsmount *ump); +void +db_print_ffs(struct ufsmount *ump) +{ + db_printf("mp %p %s devvp %p fs %p su_wl %d su_deps %d su_req %d\n", + ump->um_mountp, ump->um_mountp->mnt_stat.f_mntonname, + ump->um_devvp, ump->um_fs, ump->softdep_on_worklist, + ump->softdep_deps, ump->softdep_req); +} + #endif /* DDB */ #endif /* SOFTUPDATES */ Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sun Oct 20 21:11:36 2013 (r256807) +++ head/sys/ufs/ffs/ffs_vfsops.c Sun Oct 20 21:11:40 2013 (r256808) @@ -1286,7 +1286,8 @@ ffs_unmount(mp, mntflags) fs->fs_pendinginodes = 0; } UFS_UNLOCK(ump); - softdep_unmount(mp); + if (MOUNTEDSOFTDEP(mp)) + softdep_unmount(mp); if (fs->fs_ronly == 0 || ump->um_fsckpid > 0) { fs->fs_clean = fs->fs_flags & (FS_UNCLEAN|FS_NEEDSFSCK) ? 0 : 1; error = ffs_sbupdate(ump, MNT_WAIT, 0); @@ -1943,7 +1944,7 @@ ffs_sbupdate(ump, waitfor, suspended) } fs->fs_fmod = 0; fs->fs_time = time_second; - if (fs->fs_flags & FS_DOSOFTDEP) + if (MOUNTEDSOFTDEP(ump->um_mountp)) softdep_setup_sbupdate(ump, (struct fs *)bp->b_data, bp); bcopy((caddr_t)fs, bp->b_data, (u_int)fs->fs_sbsize); ffs_oldfscompat_write((struct fs *)bp->b_data, ump); @@ -2221,14 +2222,8 @@ ffs_own_mount(const struct mount *mp) #ifdef DDB -static void -db_print_ffs(struct ufsmount *ump) -{ - db_printf("mp %p %s devvp %p fs %p su_wl %d su_deps %d su_req %d\n", - ump->um_mountp, ump->um_mountp->mnt_stat.f_mntonname, - ump->um_devvp, ump->um_fs, ump->softdep_on_worklist, - ump->softdep_deps, ump->softdep_req); -} +/* defined in ffs_softdep.c */ +extern void db_print_ffs(struct ufsmount *ump); DB_SHOW_COMMAND(ffs, db_show_ffs) { From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 21:21:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 94AC97E6; Sun, 20 Oct 2013 21:21:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8156220EE; Sun, 20 Oct 2013 21:21:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KLL8D1081593; Sun, 20 Oct 2013 21:21:08 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KLL8vA081591; Sun, 20 Oct 2013 21:21:08 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310202121.r9KLL8vA081591@svn.freebsd.org> From: Ian Lepore Date: Sun, 20 Oct 2013 21:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256809 - in head/sys: arm/conf boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 21:21:08 -0000 Author: ian Date: Sun Oct 20 21:21:07 2013 New Revision: 256809 URL: http://svnweb.freebsd.org/changeset/base/256809 Log: Add configuration for the Freescale i.MX53 Quick Start Board. Added: head/sys/arm/conf/IMX53-QSB (contents, props changed) head/sys/boot/fdt/dts/imx53-qsb.dts (contents, props changed) Added: head/sys/arm/conf/IMX53-QSB ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/IMX53-QSB Sun Oct 20 21:21:07 2013 (r256809) @@ -0,0 +1,179 @@ +# Kernel configuration for Freescale i.MX53 Quick Start Board +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +ident IMX53-QSB + +include "../freescale/imx/std.imx53" + +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +#options DEBUG + +options HZ=250 # 4ms scheduling quantum +options SCHED_4BSD # 4BSD scheduler +#options PREEMPTION # Enable kernel thread preemption +options INET # InterNETworking +options INET6 # IPv6 communications protocols +#options SCTP # Stream Control Transmission Protocol +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options UFS_GJOURNAL # Enable gjournal-based UFS journaling +#options MD_ROOT # MD is a potential root device +options NFSCL # New Network Filesystem Client +#options NFSD # New Network Filesystem Server +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCL +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +#options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options TMPFS # TMP Memory Filesystem +options GEOM_PART_GPT # GUID Partition Tables. +options GEOM_LABEL # Provides labelization +#options COMPAT_FREEBSD5 # Compatible with FreeBSD5 +#options COMPAT_FREEBSD6 # Compatible with FreeBSD6 +#options COMPAT_FREEBSD7 # Compatible with FreeBSD7 +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE # ktrace(1) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options INCLUDE_CONFIG_FILE # Include this file in kernel +options VFP # vfp/neon + +# required for netbooting +#options BOOTP +#options BOOTP_COMPAT +#options BOOTP_NFSROOT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ue0 + +#options ROOTDEVNAME=\"ufs:ada0s2a\" + + +# kernel/memory size reduction +#options MUTEX_NOINLINE +#options NO_FFS_SNAPSHOT +#options NO_SWAPPING +#options NO_SYSCTL_DESCR +#options RWLOCK_NOINLINE + +# Debugging support. Always need this: +options KDB # Enable kernel debugger support. +# For minimum debugger support (stable branch) use: +#options KDB_TRACE # Print a stack trace for a panic. +# For full debugger support use this instead: +options DDB # Support DDB. +#options GDB # Support remote GDB. +#options DEADLKRES # Enable the deadlock resolver +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles + +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter + +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +#device vlan # 802.1Q VLAN support +#device tun # Packet tunnel. +device md # Memory "disks" +#device gif # IPv6 and IPv4 tunneling +#device faith # IPv6-to-IPv4 relaying (translation) +#device firmware # firmware assist module + +# Ethernet +device ffec # Freescale Fast Ethernet Controller +device miibus # Standard mii bus + +# Serial (COM) ports +device uart # Multi-uart driver +options ALT_BREAK_TO_DEBUGGER + +#device ata +#device atapci # Only for helper functions +#device imxata +#options ATA_STATIC_ID # Static device numbering + +device iomux # IO Multiplexor + +device gpio +device gpioled + +device fsliic +device iic +device iicbus + +# SCSI peripherals +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device cd # CD +device pass # Passthrough device (direct SCSI access) + +# USB support +#options USB_DEBUG # enable debug msgs +device ehci # OHCI USB interface +device usb # USB Bus (required) +device umass # Disks/Mass storage - Requires scbus and da +#device uhid # "Human Interface Devices" +#device ukbd # Allow keyboard like HIDs to control console +#device ums + +# USB Ethernet, requires miibus +#device miibus +#device aue # ADMtek USB Ethernet +#device axe # ASIX Electronics USB Ethernet +#device cdce # Generic USB over Ethernet +#device cue # CATC USB Ethernet +#device kue # Kawasaki LSI USB Ethernet +#device rue # RealTek RTL8150 USB Ethernet +#device udav # Davicom DM9601E USB + +# USB Wireless +#device rum # Ralink Technology RT2501USB wireless NICs + +# Watchdog timer. +# WARNING: can't be disabled!!! +device imxwdt # Watchdog + +# Wireless NIC cards +device wlan # 802.11 support +device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support +device wlan_amrr # AMRR transmit rate control algorithm + +# Flattened Device Tree +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=imx53-qsb.dts + +# NOTE: serial console will be disabled if syscons enabled +# Uncomment following lines for framebuffer/syscons support +#device sc +#device kbdmux +#options SC_DFLT_FONT # compile font in +#makeoptions SC_DFLT_FONT=cp437 + Added: head/sys/boot/fdt/dts/imx53-qsb.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/imx53-qsb.dts Sun Oct 20 21:21:07 2013 (r256809) @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2013 Rui Paulo + * All rights reserved. + * + * This software was developed by Semihalf under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Freescale i.MX53 Quick Start Board + * + * $FreeBSD$ + */ + +/dts-v1/; +/include/ "imx53x.dtsi" + +/ { + model = "Freescale i.MX53 Quick Start Board"; + compatible = "fsl,imx53-qsb", "fsl,imx53"; + + memory { + /* RAM 512M */ + reg = <0x70000000 0x20000000>; + }; + + localbus@18000000 { + ipu3@18000000 { + status = "okay"; + }; + }; + + soc@50000000 { + aips@50000000 { + spba@50000000 { + esdhc@50004000 { + clock-frequency = <216000000>; + status = "okay"; + }; + esdhc@50008000 { + clock-frequency = <216000000>; + status = "okay"; + }; + SSI2: ssi@50014000 { + status = "okay"; + }; + }; + timer@53fa0000 { + status = "okay"; + }; + + /* UART1, console */ + console: serial@53fbc000 { + status = "okay"; + clock-frequency = <0>; /* won't load w/o this */ + }; + + clock@53fd4000 { + status = "okay"; + }; + gpio@53f84000 { + status = "okay"; + }; + gpio@53f88000 { + status = "okay"; + }; + gpio@53f8c000 { + status = "okay"; + }; + gpio@53f90000 { + status = "okay"; + }; + wdog@53f98000 { + status = "okay"; + }; + }; + aips@60000000 { + ethernet@63fec000 { + status = "okay"; + phy-mode = "rmii"; + } + i2c@63fc4000 { + status = "okay"; + }; + i2c@63fc8000 { + status = "okay"; + }; + audmux@63fd4000 { + status = "okay"; + }; + ide@63fe0000 { + status = "okay"; + }; + }; + }; + + aliases { + SSI2 = &SSI2; + }; + + chosen { + bootargs = "-v"; + stdin = &console; + stdout = &console; + }; +}; From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 21:21:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 323DF931; Sun, 20 Oct 2013 21:21:51 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1DEA320FB; Sun, 20 Oct 2013 21:21:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KLLo8l081938; Sun, 20 Oct 2013 21:21:50 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KLLowW081937; Sun, 20 Oct 2013 21:21:50 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201310202121.r9KLLowW081937@svn.freebsd.org> From: Alfred Perlstein Date: Sun, 20 Oct 2013 21:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256810 - stable/10/sys/ofed/drivers/net/mlx4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 21:21:51 -0000 Author: alfred Date: Sun Oct 20 21:21:50 2013 New Revision: 256810 URL: http://svnweb.freebsd.org/changeset/base/256810 Log: Fix resource free. The order of releasing resources in mlxen was wrong, which caused panic on reload of the module. MFC: 256682 Submitted by: Shahar Klein (shahark at mellanox.com) Approved by: re Modified: stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Sun Oct 20 21:21:07 2013 (r256809) +++ stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Sun Oct 20 21:21:50 2013 (r256810) @@ -927,9 +927,6 @@ void mlx4_en_destroy_netdev(struct net_d if (priv->allocated) mlx4_free_hwq_res(mdev->dev, &priv->res, MLX4_EN_PAGE_SIZE); - if (priv->sysctl) - sysctl_ctx_free(&priv->conf_ctx); - mutex_lock(&mdev->state_lock); mlx4_en_stop_port(dev); mutex_unlock(&mdev->state_lock); @@ -946,6 +943,9 @@ void mlx4_en_destroy_netdev(struct net_d mlx4_en_free_resources(priv); + if (priv->sysctl) + sysctl_ctx_free(&priv->conf_ctx); + mtx_destroy(&priv->stats_lock.m); mtx_destroy(&priv->vlan_lock.m); kfree(priv); From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 22:21:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0AE1FB8C; Sun, 20 Oct 2013 22:21:02 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EBDCD2493; Sun, 20 Oct 2013 22:21:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KML1lc014197; Sun, 20 Oct 2013 22:21:01 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KML1Ij014196; Sun, 20 Oct 2013 22:21:01 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201310202221.r9KML1Ij014196@svn.freebsd.org> From: Kirk McKusick Date: Sun, 20 Oct 2013 22:21:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256812 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 22:21:02 -0000 Author: mckusick Date: Sun Oct 20 22:21:01 2013 New Revision: 256812 URL: http://svnweb.freebsd.org/changeset/base/256812 Log: Fourth of several cleanups to soft dependency implementation. Add KASSERTS that soft dependency functions only get called for filesystems running with soft dependencies. Calling these functions when soft updates are not compiled into the system become panic's. No functional change. Tested by: Peter Holm and Scott Long Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sun Oct 20 21:23:52 2013 (r256811) +++ head/sys/ufs/ffs/ffs_softdep.c Sun Oct 20 22:21:01 2013 (r256812) @@ -138,6 +138,7 @@ softdep_unmount(mp) struct mount *mp; { + panic("softdep_unmount called"); } void @@ -146,6 +147,8 @@ softdep_setup_sbupdate(ump, fs, bp) struct fs *fs; struct buf *bp; { + + panic("softdep_setup_sbupdate called"); } void @@ -433,8 +436,6 @@ softdep_prealloc(vp, waitok) { panic("%s called", __FUNCTION__); - - return (0); } int @@ -503,14 +504,14 @@ int softdep_sync_metadata(struct vnode *vp) { - return (0); + panic("softdep_sync_metadata called"); } int softdep_sync_buf(struct vnode *vp, struct buf *bp, int waitfor) { - return (0); + panic("softdep_sync_buf called"); } int @@ -1851,6 +1852,10 @@ softdep_move_dependencies(oldbp, newbp) struct worklist *wk, *wktail; int dirty; + if ((wk = LIST_FIRST(&oldbp->b_dep)) == NULL) + return (0); + KASSERT(MOUNTEDSOFTDEP(wk->wk_mp) != 0, + ("softdep_move_dependencies called on non-softdep filesystem")); dirty = 0; wktail = NULL; ACQUIRE_LOCK(&lk); @@ -1946,6 +1951,8 @@ softdep_flushfiles(oldmnt, flags, td) int error, early, depcount, loopcnt, retry_flush_count, retry; int morework; + KASSERT(MOUNTEDSOFTDEP(oldmnt) != 0, + ("softdep_flushfiles called on non-softdep filesystem")); loopcnt = 10; retry_flush_count = 3; retry_flush: @@ -2497,6 +2504,8 @@ softdep_unmount(mp) struct mount *mp; { + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_unmount called on non-softdep filesystem")); MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_SOFTDEP; if (MOUNTEDSUJ(mp) == 0) { @@ -2876,6 +2885,8 @@ softdep_prealloc(vp, waitok) { struct ufsmount *ump; + KASSERT(MOUNTEDSOFTDEP(vp->v_mount) != 0, + ("softdep_prealloc called on non-softdep filesystem")); /* * Nothing to do if we are not running journaled soft updates. * If we currently hold the snapshot lock, we must avoid handling @@ -4495,6 +4506,8 @@ softdep_setup_create(dp, ip) struct jaddref *jaddref; struct vnode *dvp; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + ("softdep_setup_create called on non-softdep filesystem")); KASSERT(ip->i_nlink == 1, ("softdep_setup_create: Invalid link count.")); dvp = ITOV(dp); @@ -4526,6 +4539,8 @@ softdep_setup_dotdot_link(dp, ip) struct vnode *dvp; struct vnode *vp; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + ("softdep_setup_dotdot_link called on non-softdep filesystem")); dvp = ITOV(dp); vp = ITOV(ip); jaddref = NULL; @@ -4560,6 +4575,8 @@ softdep_setup_link(dp, ip) struct jaddref *jaddref; struct vnode *dvp; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + ("softdep_setup_link called on non-softdep filesystem")); dvp = ITOV(dp); jaddref = NULL; if (DOINGSUJ(dvp)) @@ -4591,6 +4608,8 @@ softdep_setup_mkdir(dp, ip) struct jaddref *jaddref; struct vnode *dvp; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + ("softdep_setup_mkdir called on non-softdep filesystem")); dvp = ITOV(dp); dotaddref = dotdotaddref = NULL; if (DOINGSUJ(dvp)) { @@ -4633,6 +4652,8 @@ softdep_setup_rmdir(dp, ip) { struct vnode *dvp; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + ("softdep_setup_rmdir called on non-softdep filesystem")); dvp = ITOV(dp); ACQUIRE_LOCK(&lk); (void) inodedep_lookup_ip(ip); @@ -4652,6 +4673,8 @@ softdep_setup_unlink(dp, ip) { struct vnode *dvp; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + ("softdep_setup_unlink called on non-softdep filesystem")); dvp = ITOV(dp); ACQUIRE_LOCK(&lk); (void) inodedep_lookup_ip(ip); @@ -4673,6 +4696,8 @@ softdep_revert_create(dp, ip) struct jaddref *jaddref; struct vnode *dvp; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + ("softdep_revert_create called on non-softdep filesystem")); dvp = ITOV(dp); ACQUIRE_LOCK(&lk); inodedep = inodedep_lookup_ip(ip); @@ -4699,6 +4724,8 @@ softdep_revert_link(dp, ip) struct jaddref *jaddref; struct vnode *dvp; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + ("softdep_revert_link called on non-softdep filesystem")); dvp = ITOV(dp); ACQUIRE_LOCK(&lk); inodedep = inodedep_lookup_ip(ip); @@ -4726,6 +4753,8 @@ softdep_revert_mkdir(dp, ip) struct jaddref *dotaddref; struct vnode *dvp; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + ("softdep_revert_mkdir called on non-softdep filesystem")); dvp = ITOV(dp); ACQUIRE_LOCK(&lk); @@ -4762,6 +4791,8 @@ softdep_revert_rmdir(dp, ip) struct inode *ip; { + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + ("softdep_revert_rmdir called on non-softdep filesystem")); ACQUIRE_LOCK(&lk); (void) inodedep_lookup_ip(ip); (void) inodedep_lookup_ip(dp); @@ -4817,6 +4848,8 @@ softdep_setup_inomapdep(bp, ip, newinum, struct fs *fs; mp = UFSTOVFS(ip->i_ump); + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_setup_inomapdep called on non-softdep filesystem")); fs = ip->i_ump->um_fs; jaddref = NULL; @@ -4884,6 +4917,8 @@ softdep_setup_blkmapdep(bp, mp, newblkno struct jnewblk *jnewblk; struct fs *fs; + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_setup_blkmapdep called on non-softdep filesystem")); fs = VFSTOUFS(mp)->um_fs; jnewblk = NULL; /* @@ -5084,6 +5119,8 @@ softdep_setup_allocdirect(ip, off, newbl lbn = bp->b_lblkno; mp = UFSTOVFS(ip->i_ump); + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_setup_allocdirect called on non-softdep filesystem")); if (oldblkno && oldblkno != newblkno) freefrag = newfreefrag(ip, oldblkno, oldsize, lbn); else @@ -5460,12 +5497,13 @@ softdep_setup_allocext(ip, off, newblkno struct mount *mp; ufs_lbn_t lbn; - if (off >= NXADDR) - panic("softdep_setup_allocext: lbn %lld > NXADDR", - (long long)off); + mp = UFSTOVFS(ip->i_ump); + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_setup_allocext called on non-softdep filesystem")); + KASSERT(off < NXADDR, ("softdep_setup_allocext: lbn %lld > NXADDR", + (long long)off)); lbn = bp->b_lblkno; - mp = UFSTOVFS(ip->i_ump); if (oldblkno && oldblkno != newblkno) freefrag = newfreefrag(ip, oldblkno, oldsize, lbn); else @@ -5626,14 +5664,16 @@ softdep_setup_allocindir_page(ip, lbn, b struct mount *mp; int dflags; - if (lbn != nbp->b_lblkno) - panic("softdep_setup_allocindir_page: lbn %jd != lblkno %jd", - lbn, bp->b_lblkno); + mp = UFSTOVFS(ip->i_ump); + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_setup_allocindir_page called on non-softdep filesystem")); + KASSERT(lbn == nbp->b_lblkno, + ("softdep_setup_allocindir_page: lbn %jd != lblkno %jd", + lbn, bp->b_lblkno)); CTR4(KTR_SUJ, "softdep_setup_allocindir_page: ino %d blkno %jd oldblkno %jd " "lbn %jd", ip->i_number, newblkno, oldblkno, lbn); ASSERT_VOP_LOCKED(ITOV(ip), "softdep_setup_allocindir_page"); - mp = UFSTOVFS(ip->i_ump); aip = newallocindir(ip, ptrno, newblkno, oldblkno, lbn); dflags = DEPALLOC; if (IS_SNAPSHOT(ip)) @@ -5670,6 +5710,8 @@ softdep_setup_allocindir_meta(nbp, ip, b ufs_lbn_t lbn; int dflags; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0, + ("softdep_setup_allocindir_meta called on non-softdep filesystem")); CTR3(KTR_SUJ, "softdep_setup_allocindir_meta: ino %d blkno %jd ptrno %d", ip->i_number, newblkno, ptrno); @@ -6281,6 +6323,7 @@ softdep_journal_freeblocks(ip, cred, len struct inodedep *inodedep; struct jblkdep *jblkdep; struct allocdirect *adp, *adpn; + struct ufsmount *ump; struct fs *fs; struct buf *bp; struct vnode *vp; @@ -6290,7 +6333,10 @@ softdep_journal_freeblocks(ip, cred, len int frags, lastoff, iboff, allocblock, needj, dflags, error, i; fs = ip->i_fs; - mp = UFSTOVFS(ip->i_ump); + ump = ip->i_ump; + mp = UFSTOVFS(ump); + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_journal_freeblocks called on non-softdep filesystem")); vp = ITOV(ip); needj = 1; iboff = -1; @@ -6559,6 +6605,8 @@ softdep_journal_fsync(ip) { struct jfsync *jfsync; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0, + ("softdep_journal_fsync called on non-softdep filesystem")); if ((ip->i_flag & IN_TRUNCATED) == 0) return; ip->i_flag &= ~IN_TRUNCATED; @@ -6612,6 +6660,7 @@ softdep_setup_freeblocks(ip, length, fla struct freeblks *freeblks; struct inodedep *inodedep; struct allocdirect *adp; + struct ufsmount *ump; struct buf *bp; struct fs *fs; ufs2_daddr_t extblocks, datablocks; @@ -6620,12 +6669,14 @@ softdep_setup_freeblocks(ip, length, fla ufs_lbn_t tmpval; ufs_lbn_t lbn; + ump = ip->i_ump; + mp = UFSTOVFS(ump); + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_setup_freeblocks called on non-softdep filesystem")); CTR2(KTR_SUJ, "softdep_setup_freeblks: ip %d length %ld", ip->i_number, length); + KASSERT(length == 0, ("softdep_setup_freeblocks: non-zero length")); fs = ip->i_fs; - mp = UFSTOVFS(ip->i_ump); - if (length != 0) - panic("softdep_setup_freeblocks: non-zero length"); freeblks = newfreeblks(mp, ip); extblocks = 0; datablocks = 0; @@ -7295,7 +7346,11 @@ softdep_freefile(pvp, ino, mode) struct inodedep *inodedep; struct freefile *freefile; struct freeblks *freeblks; + struct ufsmount *ump; + ump = ip->i_ump; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ump)) != 0, + ("softdep_freefile called on non-softdep filesystem")); /* * This sets up the inode de-allocation dependency. */ @@ -7306,9 +7361,9 @@ softdep_freefile(pvp, ino, mode) freefile->fx_oldinum = ino; freefile->fx_devvp = ip->i_devvp; LIST_INIT(&freefile->fx_jwork); - UFS_LOCK(ip->i_ump); + UFS_LOCK(ump); ip->i_fs->fs_pendinginodes += 1; - UFS_UNLOCK(ip->i_ump); + UFS_UNLOCK(ump); /* * If the inodedep does not exist, then the zero'ed inode has @@ -8206,9 +8261,14 @@ softdep_setup_directory_add(bp, dp, diro struct newdirblk *newdirblk = 0; struct mkdir *mkdir1, *mkdir2; struct jaddref *jaddref; + struct ufsmount *ump; struct mount *mp; int isindir; + ump = dp->i_ump; + mp = UFSTOVFS(ump); + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_setup_directory_add called on non-softdep filesystem")); /* * Whiteouts have no dependencies. */ @@ -8219,7 +8279,6 @@ softdep_setup_directory_add(bp, dp, diro } jaddref = NULL; mkdir1 = mkdir2 = NULL; - mp = UFSTOVFS(dp->i_ump); fs = dp->i_fs; lbn = lblkno(fs, diroffset); offset = blkoff(fs, diroffset); @@ -8376,6 +8435,9 @@ softdep_change_directoryentry_offset(bp, int flags; mp = UFSTOVFS(dp->i_ump); + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_change_directoryentry_offset called on " + "non-softdep filesystem")); de = (struct direct *)oldloc; jmvref = NULL; flags = 0; @@ -8653,6 +8715,8 @@ softdep_setup_remove(bp, dp, ip, isrmdir struct inodedep *inodedep; int direct; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0, + ("softdep_setup_remove called on non-softdep filesystem")); /* * Allocate a new dirrem if appropriate and ACQUIRE_LOCK. We want * newdirrem() to setup the full directory remove which requires @@ -9011,6 +9075,8 @@ softdep_setup_directory_change(bp, dp, i offset = blkoff(dp->i_fs, dp->i_offset); mp = UFSTOVFS(dp->i_ump); + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_setup_directory_change called on non-softdep filesystem")); /* * Whiteouts do not need diradd dependencies. @@ -9148,6 +9214,8 @@ softdep_change_linkcnt(ip) struct inodedep *inodedep; int dflags; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0, + ("softdep_change_linkcnt called on non-softdep filesystem")); ACQUIRE_LOCK(&lk); dflags = DEPALLOC; if (IS_SNAPSHOT(ip)) @@ -9172,8 +9240,8 @@ softdep_setup_sbupdate(ump, fs, bp) struct sbdep *sbdep; struct worklist *wk; - if (MOUNTEDSUJ(UFSTOVFS(ump)) == 0) - return; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ump)) != 0, + ("softdep_setup_sbupdate called on non-softdep filesystem")); LIST_FOREACH(wk, &bp->b_dep, wk_list) if (wk->wk_type == D_SBDEP) break; @@ -10377,6 +10445,8 @@ softdep_setup_inofree(mp, bp, ino, wkhd) struct cg *cgp; struct fs *fs; + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_setup_inofree called on non-softdep filesystem")); ACQUIRE_LOCK(&lk); fs = VFSTOUFS(mp)->um_fs; cgp = (struct cg *)bp->b_data; @@ -10422,6 +10492,7 @@ softdep_setup_blkfree(mp, bp, blkno, fra { struct bmsafemap *bmsafemap; struct jnewblk *jnewblk; + struct ufsmount *ump; struct worklist *wk; struct fs *fs; #ifdef SUJ_DEBUG @@ -10438,9 +10509,12 @@ softdep_setup_blkfree(mp, bp, blkno, fra "softdep_setup_blkfree: blkno %jd frags %d wk head %p", blkno, frags, wkhd); + ump = VFSTOUFS(mp); + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ump)) != 0, + ("softdep_setup_blkfree called on non-softdep filesystem")); ACQUIRE_LOCK(&lk); /* Lookup the bmsafemap so we track when it is dirty. */ - fs = VFSTOUFS(mp)->um_fs; + fs = ump->um_fs; bmsafemap = bmsafemap_lookup(mp, bp, dtog(fs, blkno), NULL); /* * Detach any jnewblks which have been canceled. They must linger @@ -11727,6 +11801,8 @@ softdep_load_inodeblock(ip) { struct inodedep *inodedep; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0, + ("softdep_load_inodeblock called on non-softdep filesystem")); /* * Check for alternate nlink count. */ @@ -11759,13 +11835,17 @@ softdep_update_inodeblock(ip, bp, waitfo { struct inodedep *inodedep; struct inoref *inoref; + struct ufsmount *ump; struct worklist *wk; struct mount *mp; struct buf *ibp; struct fs *fs; int error; - mp = UFSTOVFS(ip->i_ump); + ump = ip->i_ump; + mp = UFSTOVFS(ump); + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_update_inodeblock called on non-softdep filesystem")); fs = ip->i_fs; /* * Preserve the freelink that is on disk. clear_unlinked_inodedep() @@ -12201,8 +12281,12 @@ sync_cgs(mp, waitfor) int softdep_sync_metadata(struct vnode *vp) { + struct inode *ip; int error; + ip = VTOI(vp); + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0, + ("softdep_sync_metadata called on non-softdep filesystem")); /* * Ensure that any direct block dependencies have been cleared, * truncations are started, and inode references are journaled. @@ -12213,7 +12297,7 @@ softdep_sync_metadata(struct vnode *vp) */ if (vp->v_type == VCHR) softdep_flushjournal(vp->v_mount); - error = flush_inodedep_deps(vp, vp->v_mount, VTOI(vp)->i_number); + error = flush_inodedep_deps(vp, vp->v_mount, ip->i_number); /* * Ensure that all truncates are written so we won't find deps on * indirect blocks. @@ -12242,6 +12326,8 @@ softdep_sync_buf(struct vnode *vp, struc struct worklist *wk; int i, error; + KASSERT(MOUNTEDSOFTDEP(vp->v_mount) != 0, + ("softdep_sync_buf called on non-softdep filesystem")); /* * For VCHR we just don't want to force flush any dependencies that * will cause rollbacks. @@ -12730,6 +12816,8 @@ softdep_slowdown(vp) int jlow; int max_softdeps_hard; + KASSERT(MOUNTEDSOFTDEP(vp->v_mount) != 0, + ("softdep_slowdown called on non-softdep filesystem")); ACQUIRE_LOCK(&lk); jlow = 0; /* @@ -13164,6 +13252,10 @@ softdep_buf_append(bp, wkhd) { struct worklist *wk; + if ((wk = LIST_FIRST(wkhd)) == NULL) + return; + KASSERT(MOUNTEDSOFTDEP(wk->wk_mp) != 0, + ("softdep_buf_append called on non-softdep filesystem")); ACQUIRE_LOCK(&lk); while ((wk = LIST_FIRST(wkhd)) != NULL) { WORKLIST_REMOVE(wk); @@ -13183,6 +13275,8 @@ softdep_inode_append(ip, cred, wkhd) struct fs *fs; int error; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0, + ("softdep_inode_append called on non-softdep filesystem")); fs = ip->i_fs; error = bread(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), (int)fs->fs_bsize, cred, &bp); @@ -13199,7 +13293,12 @@ void softdep_freework(wkhd) struct workhead *wkhd; { + struct worklist *wk; + if ((wk = LIST_FIRST(wkhd)) == NULL) + return; + KASSERT(MOUNTEDSOFTDEP(wk->wk_mp) != 0, + ("softdep_freework called on non-softdep filesystem")); ACQUIRE_LOCK(&lk); handle_jwork(wkhd); FREE_LOCK(&lk); From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 22:50:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3C89F19D; Sun, 20 Oct 2013 22:50:58 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 29C4825E7; Sun, 20 Oct 2013 22:50:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KMoweU029699; Sun, 20 Oct 2013 22:50:58 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KMowNs029698; Sun, 20 Oct 2013 22:50:58 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201310202250.r9KMowNs029698@svn.freebsd.org> From: "Justin T. Gibbs" Date: Sun, 20 Oct 2013 22:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256813 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 22:50:58 -0000 Author: gibbs Date: Sun Oct 20 22:50:57 2013 New Revision: 256813 URL: http://svnweb.freebsd.org/changeset/base/256813 Log: The Xen userland event channel driver isn't complete. Disabled it from the kernel build until it is ready. sys/conf/files: Remove the entry for xen/evtchn/evtchn_dev.c so it is not included in any kernel builds. Noticed by: smh Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Oct 20 22:21:01 2013 (r256812) +++ head/sys/conf/files Sun Oct 20 22:50:57 2013 (r256813) @@ -3846,7 +3846,6 @@ vm/vm_zeroidle.c standard vm/vnode_pager.c standard xen/gnttab.c optional xen | xenhvm xen/features.c optional xen | xenhvm -xen/evtchn/evtchn_dev.c optional xen | xenhvm xen/xenbus/xenbus_if.m optional xen | xenhvm xen/xenbus/xenbus.c optional xen | xenhvm xen/xenbus/xenbusb_if.m optional xen | xenhvm From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 23:02:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E5F9E53F; Sun, 20 Oct 2013 23:02:16 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D358126AD; Sun, 20 Oct 2013 23:02:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KN2GKM035609; Sun, 20 Oct 2013 23:02:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KN2GvX035608; Sun, 20 Oct 2013 23:02:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310202302.r9KN2GvX035608@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 20 Oct 2013 23:02:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256814 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 23:02:17 -0000 Author: nwhitehorn Date: Sun Oct 20 23:02:16 2013 New Revision: 256814 URL: http://svnweb.freebsd.org/changeset/base/256814 Log: Avoid sign overflow if there are more than 2 GB of RAM. Modified: head/sys/powerpc/booke/machdep.c Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Sun Oct 20 22:50:57 2013 (r256813) +++ head/sys/powerpc/booke/machdep.c Sun Oct 20 23:02:16 2013 (r256814) @@ -192,7 +192,8 @@ extern int elf32_nxstack; static void cpu_booke_startup(void *dummy) { - int indx, size; + int indx; + unsigned long size; /* Initialise the decrementer-based clock. */ decr_init(); @@ -200,7 +201,7 @@ cpu_booke_startup(void *dummy) /* Good {morning,afternoon,evening,night}. */ cpu_setup(PCPU_GET(cpuid)); - printf("real memory = %ld (%ld MB)\n", ptoa(physmem), + printf("real memory = %lu (%ld MB)\n", ptoa(physmem), ptoa(physmem) / 1048576); realmem = physmem; @@ -210,7 +211,7 @@ cpu_booke_startup(void *dummy) for (indx = 0; phys_avail[indx + 1] != 0; indx += 2) { size = phys_avail[indx + 1] - phys_avail[indx]; - printf("0x%08x - 0x%08x, %d bytes (%ld pages)\n", + printf("0x%08x - 0x%08x, %lu bytes (%lu pages)\n", phys_avail[indx], phys_avail[indx + 1] - 1, size, size / PAGE_SIZE); } @@ -218,7 +219,7 @@ cpu_booke_startup(void *dummy) vm_ksubmap_init(&kmi); - printf("avail memory = %ld (%ld MB)\n", ptoa(cnt.v_free_count), + printf("avail memory = %lu (%ld MB)\n", ptoa(cnt.v_free_count), ptoa(cnt.v_free_count) / 1048576); /* Set up buffers, so they can be used to read disk labels. */ From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 23:40:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E6FB3390; Sun, 20 Oct 2013 23:40:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D4DF829C5; Sun, 20 Oct 2013 23:40:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KNeGDA055247; Sun, 20 Oct 2013 23:40:16 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KNeGaP055246; Sun, 20 Oct 2013 23:40:16 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310202340.r9KNeGaP055246@svn.freebsd.org> From: Ian Lepore Date: Sun, 20 Oct 2013 23:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256815 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 23:40:17 -0000 Author: ian Date: Sun Oct 20 23:40:16 2013 New Revision: 256815 URL: http://svnweb.freebsd.org/changeset/base/256815 Log: Calculate the baud rate divisor rather than using a hard-coded value. Submitted by: Steven Lawrance Modified: head/sys/dev/uart/uart_dev_pl011.c Modified: head/sys/dev/uart/uart_dev_pl011.c ============================================================================== --- head/sys/dev/uart/uart_dev_pl011.c Sun Oct 20 23:02:16 2013 (r256814) +++ head/sys/dev/uart/uart_dev_pl011.c Sun Oct 20 23:40:16 2013 (r256815) @@ -147,9 +147,6 @@ uart_pl011_param(struct uart_bas *bas, i break; } - /* TODO: Calculate divisors */ - baud = (0x1 << 16) | 0x28; - if (stopbits == 2) line |= LCR_H_STP2; else @@ -164,8 +161,11 @@ uart_pl011_param(struct uart_bas *bas, i line &= ~LCR_H_FEN; ctrl |= (CR_RXE | CR_TXE | CR_UARTEN); - __uart_setreg(bas, UART_IBRD, ((uint32_t)(baud >> 16)) & IBRD_BDIVINT); - __uart_setreg(bas, UART_FBRD, (uint32_t)(baud) & FBRD_BDIVFRAC); + if (bas->rclk != 0 && baudrate != 0) { + baud = bas->rclk * 4 / baudrate; + __uart_setreg(bas, UART_IBRD, ((uint32_t)(baud >> 6)) & IBRD_BDIVINT); + __uart_setreg(bas, UART_FBRD, (uint32_t)(baud & 0x3F) & FBRD_BDIVFRAC); + } /* Add config. to line before reenabling UART */ __uart_setreg(bas, UART_LCR_H, (__uart_getreg(bas, UART_LCR_H) & From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 00:01:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DB25C7DD; Mon, 21 Oct 2013 00:01:18 +0000 (UTC) (envelope-from mcdouga9@egr.msu.edu) Received: from mail.egr.msu.edu (boomhauer.egr.msu.edu [35.9.37.167]) by mx1.freebsd.org (Postfix) with ESMTP id 737E92AE6; Mon, 21 Oct 2013 00:01:17 +0000 (UTC) Received: from boomhauer (localhost [127.0.0.1]) by mail.egr.msu.edu (Postfix) with ESMTP id 5FA3B2832E; Sun, 20 Oct 2013 20:01:11 -0400 (EDT) X-Virus-Scanned: amavisd-new at egr.msu.edu Received: from mail.egr.msu.edu ([127.0.0.1]) by boomhauer (boomhauer.egr.msu.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8AZlWjg8nnAZ; Sun, 20 Oct 2013 20:01:11 -0400 (EDT) Received: from daemon.localdomain (daemon.egr.msu.edu [35.9.44.65]) by mail.egr.msu.edu (Postfix) with ESMTP id 08E2E28329; Sun, 20 Oct 2013 20:01:11 -0400 (EDT) Received: by daemon.localdomain (Postfix, from userid 21281) id 0443F293EE0; Sun, 20 Oct 2013 20:01:11 -0400 (EDT) Date: Sun, 20 Oct 2013 20:01:10 -0400 From: Adam McDougall To: Jeremie Le Hen Subject: Re: svn commit: r254974 - in head: etc/defaults etc/periodic/monthly etc/periodic/security etc/periodic/weekly share/man/man5 Message-ID: <20131021000110.GJ2097@egr.msu.edu> References: <201308272120.r7RLKTvk066897@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201308272120.r7RLKTvk066897@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 00:01:18 -0000 Thanks for working on this, I look forward to taking advantage of it! I have a system with some old style adjustments in periodic.conf but the compat shim doesn't seem to be working (it is running r255793). I filed PR conf/183137 with more details. On Tue, Aug 27, 2013 at 09:20:29PM +0000, Jeremie Le Hen wrote: Author: jlh Date: Tue Aug 27 21:20:28 2013 New Revision: 254974 URL: http://svnweb.freebsd.org/changeset/base/254974 Log: Make the period of each periodic security script configurable. There are now six additional variables weekly_status_security_enable weekly_status_security_inline weekly_status_security_output monthly_status_security_enable monthly_status_security_inline monthly_status_security_output alongside their existing daily counterparts. They all have the same default values. All other "daily_status_security_${scriptname}_${whatever}" variables have been renamed to "security_status_${name}_${whatever}". A compatibility shim has been introduced for the old variable names, which we will be able to remove in 11.0-RELEASE. "security_status_${name}_enable" is still a boolean but a new "security_status_${name}_period" allows to define the period of each script. The value is one of "daily" (the default for backward compatibility), "weekly", "monthly" and "NO". Note that when the security periodic scripts are run directly from crontab(5) (as opposed to being called by daily or weekly periodic scripts), they will run unless the test is explicitely disabled with a "NO", either for in the "_enable" or the "_period" variable. When the security output is not inlined, the mail subject has been changed from "$host $arg run output" to "$host $arg $period run output". For instance: myfbsd security run output -> myfbsd security daily run output I don't think this is considered as a stable API, but feel free to correct me if I'm wrong. Finally, I will rearrange periodic.conf(5) and default/periodic.conf to put the security options in their own section. I left them in place for this commit to make reviewing easier. Reviewed by: hackers@ Added: head/etc/periodic/monthly/450.status-security (contents, props changed) head/etc/periodic/weekly/450.status-security (contents, props changed) Modified: head/etc/defaults/periodic.conf head/etc/periodic/security/100.chksetuid head/etc/periodic/security/110.neggrpperm head/etc/periodic/security/200.chkmounts head/etc/periodic/security/300.chkuid0 head/etc/periodic/security/400.passwdless head/etc/periodic/security/410.logincheck head/etc/periodic/security/460.chkportsum head/etc/periodic/security/500.ipfwdenied head/etc/periodic/security/510.ipfdenied head/etc/periodic/security/520.pfdenied head/etc/periodic/security/550.ipfwlimit head/etc/periodic/security/610.ipf6denied head/etc/periodic/security/700.kernelmsg head/etc/periodic/security/800.loginfail head/etc/periodic/security/900.tcpwrap head/etc/periodic/security/security.functions head/etc/periodic/weekly/Makefile head/share/man/man5/periodic.conf.5 Modified: head/etc/defaults/periodic.conf ============================================================================== --- head/etc/defaults/periodic.conf Tue Aug 27 20:52:02 2013 (r254973) +++ head/etc/defaults/periodic.conf Tue Aug 27 21:20:28 2013 (r254974) @@ -128,7 +128,9 @@ daily_status_include_submit_mailq="YES" # 450.status-security daily_status_security_enable="YES" # Security check -# See "Security options" below for more options +# See also "Security options" below for more options +daily_status_security_inline="NO" # Run inline ? +daily_status_security_output="root" # user or /file # 460.status-mail-rejects daily_status_mail_rejects_enable="YES" # Check mail rejects @@ -163,59 +165,78 @@ daily_local="/etc/daily.local" # Loca # Security options # These options are used by the security periodic(8) scripts spawned in -# 450.status-security above. -daily_status_security_inline="NO" # Run inline ? -daily_status_security_output="root" # user or /file -daily_status_security_logdir="/var/log" # Directory for logs -daily_status_security_diff_flags="-b -u" # flags for diff output +# daily and weekly 450.status-security. +security_status_logdir="/var/log" # Directory for logs +security_status_diff_flags="-b -u" # flags for diff output + +# Each of the security_status_*_enable options below can have one of the +# following values: +# - NO +# - daily: only run during the daily security status +# - weekly: only run during the weekly security status # 100.chksetuid -daily_status_security_chksetuid_enable="YES" +security_status_chksetuid_enable="YES" +security_status_chksetuid_period="daily" # 110.neggrpperm -daily_status_security_neggrpperm_enable="YES" +security_status_neggrpperm_enable="YES" +security_status_neggrpperm_period="daily" # 200.chkmounts -daily_status_security_chkmounts_enable="YES" -#daily_status_security_chkmounts_ignore="^amd:" # Don't check matching +security_status_chkmounts_enable="YES" +security_status_chkmounts_period="daily" +#security_status_chkmounts_ignore="^amd:" # Don't check matching # FS types -daily_status_security_noamd="NO" # Don't check amd mounts +security_status_noamd="NO" # Don't check amd mounts # 300.chkuid0 -daily_status_security_chkuid0_enable="YES" +security_status_chkuid0_enable="YES" +security_status_chkuid0_period="daily" # 400.passwdless -daily_status_security_passwdless_enable="YES" +security_status_passwdless_enable="YES" +security_status_passwdless_period="daily" # 410.logincheck -daily_status_security_logincheck_enable="YES" +security_status_logincheck_enable="YES" +security_status_logincheck_period="daily" # 460.chkportsum -daily_status_security_chkportsum_enable="NO" # Check ports w/ wrong checksum +security_status_chkportsum_enable="NO" # Check ports w/ wrong checksum +security_status_chkportsum_period="daily" # 500.ipfwdenied -daily_status_security_ipfwdenied_enable="YES" +security_status_ipfwdenied_enable="YES" +security_status_ipfwdenied_period="daily" # 510.ipfdenied -daily_status_security_ipfdenied_enable="YES" +security_status_ipfdenied_enable="YES" +security_status_ipfdenied_period="daily" # 520.pfdenied -daily_status_security_pfdenied_enable="YES" +security_status_pfdenied_enable="YES" +security_status_pfdenied_period="daily" # 550.ipfwlimit -daily_status_security_ipfwlimit_enable="YES" +security_status_ipfwlimit_enable="YES" +security_status_ipfwlimit_period="daily" # 610.ipf6denied -daily_status_security_ipf6denied_enable="YES" +security_status_ipf6denied_enable="YES" +security_status_ipf6denied_period="daily" # 700.kernelmsg -daily_status_security_kernelmsg_enable="YES" +security_status_kernelmsg_enable="YES" +security_status_kernelmsg_period="daily" # 800.loginfail -daily_status_security_loginfail_enable="YES" +security_status_loginfail_enable="YES" +security_status_loginfail_period="daily" # 900.tcpwrap -daily_status_security_tcpwrap_enable="YES" +security_status_tcpwrap_enable="YES" +security_status_tcpwrap_period="daily" # Weekly options @@ -248,6 +269,12 @@ weekly_status_pkg_enable="NO" # Find pkg_version=pkg_version # Use this program pkg_version_index=/usr/ports/INDEX-10 # Use this index file +# 450.status-security +weekly_status_security_enable="YES" # Security check +# See also "Security options" above for more options +weekly_status_security_inline="NO" # Run inline ? +weekly_status_security_output="root" # user or /file + # 999.local weekly_local="/etc/weekly.local" # Local scripts @@ -267,6 +294,12 @@ monthly_show_badconfig="NO" # scripts # 200.accounting monthly_accounting_enable="YES" # Login accounting +# 450.status-security +monthly_status_security_enable="YES" # Security check +# See also "Security options" above for more options +monthly_status_security_inline="NO" # Run inline ? +monthly_status_security_output="root" # user or /file + # 999.local monthly_local="/etc/monthly.local" # Local scripts @@ -276,6 +309,74 @@ monthly_local="/etc/monthly.local" # L if [ -z "${source_periodic_confs_defined}" ]; then source_periodic_confs_defined=yes + + # Compatibility with old daily variable names. + # They can be removed in stable/11. + security_daily_compat_var() { + local var=$1 dailyvar value + + dailyvar=daily_status_security${#status_security} + periodvar=${var%enable}period + eval value=\"\$$dailyvar\" + [ -z "$value" ] && return + echo "Warning: Variable \$$dailyvar is deprecated," \ + "use \$$var instead." >&2 + case "$value" in + [Yy][Ee][Ss]) + $var=YES + $periodvar=daily + ;; + *) + $var="$value" + ;; + esac + } + + check_yesno_period() { + local var="$1" periodvar value period + + eval value=\"\$$var\" + case "$value" in + [Yy][Ee][Ss]) ;; + *) return 1 ;; + esac + + periodvar=${var%enable}period + eval period=\"\$$periodvar\" + case "$PERIODIC" in + "security daily") + case "$period" in + [Dd][Aa][Ii][Ll][Yy]) return 0 ;; + *) return 1 ;; + esac + ;; + "security weekly") + case "$period" in + [Ww][Ee][Ee][Kk][Ll][Yy]) return 0 ;; + *) return 1 ;; + esac + ;; + "security monthly") + case "$period" in + [Mm][Oo][Nn][Tt][Hh][Ll][Yy]) return 0 ;; + *) return 1 ;; + esac + ;; + security) + # Run directly from crontab(5). + case "$period" in + [Nn][Oo]) return 1 ;; + *) return 0 ;; + esac + ;; + *) + echo "ASSERTION FAILED: Unexpected value for " \ + "\$PERIODIC: '$PERIODIC'" >&2 + exit 127 + ;; + esac + } + source_periodic_confs() { local i sourced_files Added: head/etc/periodic/monthly/450.status-security ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/periodic/monthly/450.status-security Tue Aug 27 21:20:28 2013 (r254974) @@ -0,0 +1,41 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + +case "$monthly_status_security_enable" in + [Yy][Ee][Ss]) + echo "" + echo "Security check:" + + case "$monthly_status_security_inline" in + [Yy][Ee][Ss]) + monthly_status_security_output="";; + esac + + export security_output="${monthly_status_security_output}" + case "${monthly_status_security_output}" in + "") + rc=3;; + /*) + echo " (output logged separately)" + rc=0;; + *) + echo " (output mailed separately)" + rc=0;; + esac + + periodic security || rc=3;; + + *) rc=0;; +esac + +exit $rc Modified: head/etc/periodic/security/100.chksetuid ============================================================================== --- head/etc/periodic/security/100.chksetuid Tue Aug 27 20:52:02 2013 (r254973) +++ head/etc/periodic/security/100.chksetuid Tue Aug 27 21:20:28 2013 (r254974) @@ -37,10 +37,12 @@ fi . /etc/periodic/security/security.functions +security_daily_compat_var security_status_chksetuid_enable + rc=0 -case "$daily_status_security_chksetuid_enable" in - [Yy][Ee][Ss]) +if check_yesno_period security_status_chksetuid_enable +then echo "" echo 'Checking setuid files and devices:' MP=`mount -t ufs,zfs | awk '$0 !~ /no(suid|exec)/ { print $3 }'` @@ -49,10 +51,6 @@ case "$daily_status_security_chksetuid_e \( -perm -u+s -or -perm -g+s \) -exec ls -liTd \{\} \+ | check_diff setuid - "${host} setuid diffs:" rc=$? - ;; - *) - rc=0 - ;; -esac +fi exit $rc Modified: head/etc/periodic/security/110.neggrpperm ============================================================================== --- head/etc/periodic/security/110.neggrpperm Tue Aug 27 20:52:02 2013 (r254973) +++ head/etc/periodic/security/110.neggrpperm Tue Aug 27 21:20:28 2013 (r254974) @@ -35,10 +35,12 @@ then source_periodic_confs fi +security_daily_compat_var security_status_neggrpperm_enable + rc=0 -case "$daily_status_security_neggrpperm_enable" in - [Yy][Ee][Ss]) +if check_yesno_period security_status_neggrpperm_enable +then echo "" echo 'Checking negative group permissions:' MP=`mount -t ufs,zfs | awk '$0 !~ /no(suid|exec)/ { print $3 }'` @@ -48,7 +50,6 @@ case "$daily_status_security_neggrpperm_ \( ! -perm +040 -and -perm +004 \) \) \ -exec ls -liTd \{\} \+ | tee /dev/stderr | wc -l) [ $n -gt 0 ] && rc=1 || rc=0 - ;; -esac +fi exit $rc Modified: head/etc/periodic/security/200.chkmounts ============================================================================== --- head/etc/periodic/security/200.chkmounts Tue Aug 27 20:52:02 2013 (r254973) +++ head/etc/periodic/security/200.chkmounts Tue Aug 27 21:20:28 2013 (r254974) @@ -40,12 +40,16 @@ fi . /etc/periodic/security/security.functions -ignore="${daily_status_security_chkmounts_ignore}" +security_daily_compat_var security_status_chkmounts_enable +security_daily_compat_var security_status_chkmounts_ignore +security_daily_compat_var security_status_noamd + +ignore="${security_status_chkmounts_ignore}" rc=0 -case "$daily_status_security_chkmounts_enable" in - [Yy][Ee][Ss]) - case "$daily_status_security_noamd" in +if check_yesno_period security_status_chkmounts_enable +then + case "$security_status_noamd" in [Yy][Ee][Ss]) ignore="${ignore}|^amd:" esac @@ -55,8 +59,7 @@ case "$daily_status_security_chkmounts_e fi mount -p | sort | ${cmd} | check_diff mount - "${host} changes in mounted filesystems:" - rc=$?;; - *) rc=0;; -esac + rc=$? +fi exit "$rc" Modified: head/etc/periodic/security/300.chkuid0 ============================================================================== --- head/etc/periodic/security/300.chkuid0 Tue Aug 27 20:52:02 2013 (r254973) +++ head/etc/periodic/security/300.chkuid0 Tue Aug 27 21:20:28 2013 (r254974) @@ -36,16 +36,19 @@ then source_periodic_confs fi -case "$daily_status_security_chkuid0_enable" in - [Yy][Ee][Ss]) +security_daily_compat_var security_status_chkuid0_enable + +rc=0 + +if check_yesno_period security_status_chkuid0_enable +then echo "" echo 'Checking for uids of 0:' n=$(awk -F: '/^#/ {next} $3==0 {print $1,$3}' /etc/master.passwd | tee /dev/stderr | sed -e '/^root 0$/d' -e '/^toor 0$/d' | wc -l) - [ $n -gt 0 ] && rc=1 || rc=0;; - *) rc=0;; -esac + [ $n -gt 0 ] && rc=1 || rc=0 +fi exit "$rc" Modified: head/etc/periodic/security/400.passwdless ============================================================================== --- head/etc/periodic/security/400.passwdless Tue Aug 27 20:52:02 2013 (r254973) +++ head/etc/periodic/security/400.passwdless Tue Aug 27 21:20:28 2013 (r254974) @@ -35,14 +35,17 @@ then source_periodic_confs fi -case "$daily_status_security_passwdless_enable" in - [Yy][Ee][Ss]) +security_daily_compat_var security_status_passwdless_enable + +rc=0 + +if check_yesno_period security_status_passwdless_enable +then echo "" echo 'Checking for passwordless accounts:' n=$(awk -F: 'NF > 1 && $1 !~ /^[#+-]/ && $2=="" {print $0}' /etc/master.passwd | tee /dev/stderr | wc -l) - [ $n -gt 0 ] && rc=1 || rc=0;; - *) rc=0;; -esac + [ $n -gt 0 ] && rc=1 || rc=0 +fi exit "$rc" Modified: head/etc/periodic/security/410.logincheck ============================================================================== --- head/etc/periodic/security/410.logincheck Tue Aug 27 20:52:02 2013 (r254973) +++ head/etc/periodic/security/410.logincheck Tue Aug 27 21:20:28 2013 (r254974) @@ -35,8 +35,12 @@ then source_periodic_confs fi -case "$daily_status_security_logincheck_enable" in - [Yy][Ee][Ss]) +security_daily_compat_var security_status_logincheck_enable + +rc=0 + +if check_yesno_period security_status_logincheck_enable +then echo "" echo 'Checking login.conf permissions:' if [ -G /etc/login.conf -a -O /etc/login.conf ]; then @@ -45,8 +49,7 @@ case "$daily_status_security_logincheck_ echo "Bad ownership of /etc/login.conf" n=1 fi - [ $n -gt 0 ] && rc=1 || rc=0;; - *) rc=0;; -esac + [ $n -gt 0 ] && rc=1 || rc=0 +fi exit "$rc" Modified: head/etc/periodic/security/460.chkportsum ============================================================================== --- head/etc/periodic/security/460.chkportsum Tue Aug 27 20:52:02 2013 (r254973) +++ head/etc/periodic/security/460.chkportsum Tue Aug 27 21:20:28 2013 (r254974) @@ -35,13 +35,15 @@ fi . /etc/periodic/security/security.functions +security_daily_compat_var security_status_chkportsum_enable + rc=0 echo "" echo 'Checking for ports with mismatched checksums:' -case "${daily_status_security_chkportsum_enable}" in - [Yy][Ee][Ss]) +if check_yesno_period security_status_chkportsum_enable +then set -f pkg_info -ga 2>/dev/null | \ while IFS= read -r line; do @@ -59,10 +61,6 @@ case "${daily_status_security_chkportsum ;; esac done - ;; - *) - rc=0 - ;; -esac +fi exit $rc Modified: head/etc/periodic/security/500.ipfwdenied ============================================================================== --- head/etc/periodic/security/500.ipfwdenied Tue Aug 27 20:52:02 2013 (r254973) +++ head/etc/periodic/security/500.ipfwdenied Tue Aug 27 21:20:28 2013 (r254974) @@ -37,17 +37,18 @@ fi . /etc/periodic/security/security.functions +security_daily_compat_var security_status_ipfwdenied_enable + rc=0 -case "$daily_status_security_ipfwdenied_enable" in - [Yy][Ee][Ss]) +if check_yesno_period security_status_ipfwdenied_enable +then TMP=`mktemp -t security` if ipfw -a list 2>/dev/null | egrep "deny|reset|unreach" > ${TMP}; then check_diff new_only ipfw ${TMP} "${host} ipfw denied packets:" fi rc=$? - rm -f ${TMP};; - *) rc=0;; -esac + rm -f ${TMP} +fi exit $rc Modified: head/etc/periodic/security/510.ipfdenied ============================================================================== --- head/etc/periodic/security/510.ipfdenied Tue Aug 27 20:52:02 2013 (r254973) +++ head/etc/periodic/security/510.ipfdenied Tue Aug 27 21:20:28 2013 (r254974) @@ -37,17 +37,18 @@ fi . /etc/periodic/security/security.functions +security_daily_compat_var security_status_ipfdenied_enable + rc=0 -case "$daily_status_security_ipfdenied_enable" in - [Yy][Ee][Ss]) +if check_yesno_period security_status_ipfdenied_enable +then TMP=`mktemp -t security` if ipfstat -nhio 2>/dev/null | grep block > ${TMP}; then check_diff new_only ipf ${TMP} "${host} ipf denied packets:" fi rc=$? - rm -f ${TMP};; - *) rc=0;; -esac + rm -f ${TMP} +fi exit $rc Modified: head/etc/periodic/security/520.pfdenied ============================================================================== --- head/etc/periodic/security/520.pfdenied Tue Aug 27 20:52:02 2013 (r254973) +++ head/etc/periodic/security/520.pfdenied Tue Aug 27 21:20:28 2013 (r254974) @@ -37,17 +37,18 @@ fi . /etc/periodic/security/security.functions +security_daily_compat_var security_status_pfdenied_enable + rc=0 -case "$daily_status_security_pfdenied_enable" in - [Yy][Ee][Ss]) +if check_yesno_period security_status_pfdenied_enable +then TMP=`mktemp -t security` if pfctl -sr -v 2>/dev/null | nawk '{if (/^block/) {buf=$0; getline; gsub(" +"," ",$0); print buf$0;} }' > ${TMP}; then check_diff new_only pf ${TMP} "${host} pf denied packets:" fi rc=$? - rm -f ${TMP};; - *) rc=0;; -esac + rm -f ${TMP} +fi exit $rc Modified: head/etc/periodic/security/550.ipfwlimit ============================================================================== --- head/etc/periodic/security/550.ipfwlimit Tue Aug 27 20:52:02 2013 (r254973) +++ head/etc/periodic/security/550.ipfwlimit Tue Aug 27 21:20:28 2013 (r254974) @@ -38,10 +38,12 @@ then source_periodic_confs fi +security_daily_compat_var security_status_ipfwlimit_enable + rc=0 -case "$daily_status_security_ipfwlimit_enable" in - [Yy][Ee][Ss]) +if check_yesno_period security_status_ipfwlimit_enable +then IPFW_VERBOSE=`sysctl -n net.inet.ip.fw.verbose 2> /dev/null` if [ $? -ne 0 ] || [ "$IPFW_VERBOSE" -eq 0 ]; then exit 0 @@ -61,8 +63,7 @@ case "$daily_status_security_ipfwlimit_e echo 'ipfw log limit reached:' cat ${TMP} fi - rm -f ${TMP};; - *) rc=0;; -esac + rm -f ${TMP} +fi exit $rc Modified: head/etc/periodic/security/610.ipf6denied ============================================================================== --- head/etc/periodic/security/610.ipf6denied Tue Aug 27 20:52:02 2013 (r254973) +++ head/etc/periodic/security/610.ipf6denied Tue Aug 27 21:20:28 2013 (r254974) @@ -37,17 +37,18 @@ fi . /etc/periodic/security/security.functions +security_daily_compat_var security_status_ipf6denied_enable + rc=0 -case "$daily_status_security_ipf6denied_enable" in - [Yy][Ee][Ss]) +if check_yesno_period security_status_ipf6denied_enable +then TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` if ipfstat -nhio6 2>/dev/null | grep block > ${TMP}; then check_diff new_only ipf6 ${TMP} "${host} ipf6 denied packets:" fi rc=$? - rm -f ${TMP};; - *) rc=0;; -esac + rm -f ${TMP} +fi exit $rc Modified: head/etc/periodic/security/700.kernelmsg ============================================================================== --- head/etc/periodic/security/700.kernelmsg Tue Aug 27 20:52:02 2013 (r254973) +++ head/etc/periodic/security/700.kernelmsg Tue Aug 27 21:20:28 2013 (r254974) @@ -40,14 +40,15 @@ fi . /etc/periodic/security/security.functions +security_daily_compat_var security_status_kernelmsg_enable + rc=0 -case "$daily_status_security_kernelmsg_enable" in - [Yy][Ee][Ss]) +if check_yesno_period security_status_kernelmsg_enable +then dmesg 2>/dev/null | check_diff new_only dmesg - "${host} kernel log messages:" - rc=$?;; - *) rc=0;; -esac + rc=$? +fi exit $rc Modified: head/etc/periodic/security/800.loginfail ============================================================================== --- head/etc/periodic/security/800.loginfail Tue Aug 27 20:52:02 2013 (r254973) +++ head/etc/periodic/security/800.loginfail Tue Aug 27 21:20:28 2013 (r254974) @@ -38,7 +38,10 @@ then source_periodic_confs fi -LOG="${daily_status_security_logdir}" +security_daily_compat_var security_status_logdir +security_daily_compat_var security_status_loginfail_enable + +LOG="${security_status_logdir}" yesterday=`date -v-1d "+%b %e "` @@ -55,14 +58,15 @@ catmsgs() { [ -f ${LOG}/auth.log ] && cat $LOG/auth.log } -case "$daily_status_security_loginfail_enable" in - [Yy][Ee][Ss]) +rc=0 + +if check_yesno_period security_status_loginfail_enable +then echo "" echo "${host} login failures:" n=$(catmsgs | egrep -ia "^$yesterday.*: .*(fail|invalid|bad|illegal)" | tee /dev/stderr | wc -l) - [ $n -gt 0 ] && rc=1 || rc=0;; - *) rc=0;; -esac + [ $n -gt 0 ] && rc=1 || rc=0 +fi exit $rc Modified: head/etc/periodic/security/900.tcpwrap ============================================================================== --- head/etc/periodic/security/900.tcpwrap Tue Aug 27 20:52:02 2013 (r254973) +++ head/etc/periodic/security/900.tcpwrap Tue Aug 27 21:20:28 2013 (r254974) @@ -38,7 +38,10 @@ then source_periodic_confs fi -LOG="${daily_status_security_logdir}" +security_daily_compat_var security_status_logdir +security_daily_compat_var security_status_tcpwrap_enable + +LOG="${security_status_logdir}" yesterday=`date -v-1d "+%b %e "` @@ -55,14 +58,15 @@ catmsgs() { [ -f ${LOG}/messages ] && cat $LOG/messages } -case "$daily_status_security_tcpwrap_enable" in - [Yy][Ee][Ss]) +rc=0 + +if check_yesno_period security_status_tcpwrap_enable +then echo "" echo "${host} refused connections:" n=$(catmsgs | grep -i "^$yesterday.*refused connect" | tee /dev/stderr | wc -l) - [ $n -gt 0 ] && rc=1 || rc=0;; - *) rc=0;; -esac + [ $n -gt 0 ] && rc=1 || rc=0 +fi exit $rc Modified: head/etc/periodic/security/security.functions ============================================================================== --- head/etc/periodic/security/security.functions Tue Aug 27 20:52:02 2013 (r254973) +++ head/etc/periodic/security/security.functions Tue Aug 27 21:20:28 2013 (r254974) @@ -27,11 +27,19 @@ # $FreeBSD$ # +# This is a library file, so we only try to do something when sourced. +case "$0" in +*/security.functions) exit 0 ;; +esac + +security_daily_compat_var security_status_logdir +security_daily_compat_var security_status_diff_flags + # # Show differences in the output of an audit command # -LOG="${daily_status_security_logdir}" +LOG="${security_status_logdir}" rc=0 # Usage: COMMAND | check_diff [new_only] LABEL - MSG @@ -67,7 +75,7 @@ check_diff() { [ $rc -lt 1 ] && rc=1 echo "" echo "${msg}" - diff ${daily_status_security_diff_flags} ${LOG}/${label}.today \ + diff ${security_status_diff_flags} ${LOG}/${label}.today \ ${tmpf} | eval "${filter}" mv ${LOG}/${label}.today ${LOG}/${label}.yesterday || rc=3 mv ${tmpf} ${LOG}/${label}.today || rc=3 Added: head/etc/periodic/weekly/450.status-security ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/periodic/weekly/450.status-security Tue Aug 27 21:20:28 2013 (r254974) @@ -0,0 +1,41 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + +case "$weekly_status_security_enable" in + [Yy][Ee][Ss]) + echo "" + echo "Security check:" + + case "$weekly_status_security_inline" in + [Yy][Ee][Ss]) + weekly_status_security_output="";; + esac + + export security_output="${weekly_status_security_output}" + case "${weekly_status_security_output}" in + "") + rc=3;; + /*) + echo " (output logged separately)" + rc=0;; + *) + echo " (output mailed separately)" + rc=0;; + esac + + periodic security || rc=3;; + + *) rc=0;; +esac + +exit $rc Modified: head/etc/periodic/weekly/Makefile ============================================================================== --- head/etc/periodic/weekly/Makefile Tue Aug 27 20:52:02 2013 (r254973) +++ head/etc/periodic/weekly/Makefile Tue Aug 27 21:20:28 2013 (r254974) @@ -3,6 +3,7 @@ .include FILES= 340.noid \ + 450.status-security \ 999.local # NB: keep these sorted by MK_* knobs Modified: head/share/man/man5/periodic.conf.5 ============================================================================== --- head/share/man/man5/periodic.conf.5 Tue Aug 27 20:52:02 2013 (r254973) +++ head/share/man/man5/periodic.conf.5 Tue Aug 27 21:20:28 2013 (r254974) @@ -1,4 +1,4 @@ -.\"- +\"- .\" Copyright (c) 2000 Brian Somers .\" All rights reserved. .\" @@ -482,26 +482,42 @@ This variable behaves in the same way as .Va *_output variables above, namely it can be set either to one or more email addresses or to an absolute file name. -.It Va daily_status_security_diff_flags +.It Va security_status_diff_flags .Pq Vt str Set to the arguments to pass to the .Xr diff 1 utility when generating differences. The default is .Fl b u . -.It Va daily_status_security_chksetuid_enable +.It Va security_status_chksetuid_enable .Pq Vt bool Set to .Dq Li YES to compare the modes and modification times of setuid executables with the previous day's values. -.It Va daily_status_security_chkportsum_enable +.It Va security_status_chksetuid_period +.Pq Vt str +Set to either +.Dq Li daily , +.Dq Li weekly , +.Dq Li monthly +or +.Dq Li NO . +.It Va security_status_chkportsum_enable .Pq Vt bool Set to .Dq Li YES to verify checksums of all installed packages against the known checksums in .Pa /var/db/pkg . -.It Va daily_status_security_neggrpperm_enable +.It Va security_status_chkportsum_period +.Pq Vt str +Set to either +.Dq Li daily , +.Dq Li weekly , +.Dq Li monthly +or +.Dq Li NO . +.It Va security_status_neggrpperm_enable .Pq Vt bool Set to .Dq Li YES @@ -509,35 +525,67 @@ to check for files where the group of a the world at large. When users are in more than 14 supplemental groups these negative permissions may not be enforced via NFS shares. -.It Va daily_status_security_chkmounts_enable +.It Va security_status_neggrpperm_period +.Pq Vt str +Set to either +.Dq Li daily , +.Dq Li weekly , +.Dq Li monthly +or +.Dq Li NO . +.It Va security_status_chkmounts_enable .Pq Vt bool Set to .Dq Li YES to check for changes mounted file systems to the previous day's values. -.It Va daily_status_security_noamd +.It Va security_status_chkmounts_period +.Pq Vt str +Set to either +.Dq Li daily , +.Dq Li weekly , +.Dq Li monthly +or +.Dq Li NO . +.It Va security_status_noamd .Pq Vt bool Set to .Dq Li YES if you want to ignore .Xr amd 8 mounts when comparing against yesterday's file system mounts in the -.Va daily_status_security_chkmounts_enable +.Va security_status_chkmounts_enable check. -.It Va daily_status_security_chkuid0_enable +.It Va security_status_chkuid0_enable .Pq Vt bool Set to .Dq Li YES to check .Pa /etc/master.passwd for accounts with UID 0. -.It Va daily_status_security_passwdless_enable +.It Va security_status_chkuid0_period +.Pq Vt str +Set to either +.Dq Li daily , +.Dq Li weekly , +.Dq Li monthly +or +.Dq Li NO . +.It Va security_status_passwdless_enable .Pq Vt bool Set to .Dq Li YES to check .Pa /etc/master.passwd for accounts with empty passwords. -.It Va daily_status_security_logincheck_enable +.It Va security_status_passwdless_period +.Pq Vt str +Set to either +.Dq Li daily , +.Dq Li weekly , +.Dq Li monthly +or +.Dq Li NO . +.It Va security_status_logincheck_enable .Pq Vt bool Set to .Dq Li YES @@ -546,49 +594,105 @@ to check ownership, see .Xr login.conf 5 for more information. -.It Va daily_status_security_ipfwdenied_enable +.It Va security_status_logincheck_period +.Pq Vt str +Set to either +.Dq Li daily , +.Dq Li weekly , +.Dq Li monthly +or +.Dq Li NO . +.It Va security_status_ipfwdenied_enable .Pq Vt bool Set to .Dq Li YES to show log entries for packets denied by .Xr ipfw 8 since yesterday's check. -.It Va daily_status_security_ipfdenied_enable +.It Va security_status_ipfwdenied_period +.Pq Vt str +Set to either +.Dq Li daily , +.Dq Li weekly , +.Dq Li monthly +or +.Dq Li NO . +.It Va security_status_ipfdenied_enable .Pq Vt bool Set to .Dq Li YES to show log entries for packets denied by .Xr ipf 8 since yesterday's check. -.It Va daily_status_security_pfdenied_enable +.It Va security_status_ipfdenied_period +.Pq Vt str +Set to either +.Dq Li daily , +.Dq Li weekly , +.Dq Li monthly +or +.Dq Li NO . +.It Va security_status_pfdenied_enable .Pq Vt bool Set to .Dq Li YES to show log entries for packets denied by .Xr pf 4 since yesterday's check. -.It Va daily_status_security_ipfwlimit_enable +.It Va security_status_pfdenied_period +.Pq Vt str +Set to either +.Dq Li daily , +.Dq Li weekly , +.Dq Li monthly +or +.Dq Li NO . +.It Va security_status_ipfwlimit_enable .Pq Vt bool Set to .Dq Li YES to display .Xr ipfw 8 rules that have reached their verbosity limit. -.It Va daily_status_security_kernelmsg_enable +.It Va security_status_ipfwlimit_period +.Pq Vt str +Set to either +.Dq Li daily , +.Dq Li weekly , +.Dq Li monthly +or +.Dq Li NO . +.It Va security_status_kernelmsg_enable .Pq Vt bool Set to .Dq Li YES to show new .Xr dmesg 8 entries since yesterday's check. -.It Va daily_status_security_loginfail_enable +.It Va security_status_kernelmsg_period +.Pq Vt str +Set to either +.Dq Li daily , +.Dq Li weekly , +.Dq Li monthly +or +.Dq Li NO . +.It Va security_status_loginfail_enable .Pq Vt bool Set to .Dq Li YES to display failed logins from .Pa /var/log/messages in the previous day. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 00:04:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AB9B0888; Mon, 21 Oct 2013 00:04:27 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 97CCF2AFB; Mon, 21 Oct 2013 00:04:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L04RU4069785; Mon, 21 Oct 2013 00:04:27 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L04QVU069763; Mon, 21 Oct 2013 00:04:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310210004.r9L04QVU069763@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 21 Oct 2013 00:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256816 - in head/sys: dev/ofw powerpc/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 00:04:27 -0000 Author: nwhitehorn Date: Mon Oct 21 00:04:26 2013 New Revision: 256816 URL: http://svnweb.freebsd.org/changeset/base/256816 Log: Allow the OFW interrupt mapping code to work with PCI devices not enumerated by Open Firmware, as in the case of FDT. Modified: head/sys/dev/ofw/ofw_bus_subr.c head/sys/powerpc/ofw/ofw_pci.c head/sys/powerpc/ofw/ofw_pcib_pci.c head/sys/powerpc/ofw/ofw_pcibus.c Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Sun Oct 20 23:40:16 2013 (r256815) +++ head/sys/dev/ofw/ofw_bus_subr.c Mon Oct 21 00:04:26 2013 (r256816) @@ -208,7 +208,6 @@ ofw_bus_has_prop(device_t dev, const cha return (OF_hasprop(node, propname)); } -#ifndef FDT void ofw_bus_setup_iinfo(phandle_t node, struct ofw_bus_iinfo *ii, int intrsz) { @@ -246,9 +245,11 @@ ofw_bus_lookup_imap(phandle_t node, stru KASSERT(regsz >= ii->opi_addrc, ("ofw_bus_lookup_imap: register size too small: %d < %d", regsz, ii->opi_addrc)); - rv = OF_getprop(node, "reg", reg, regsz); - if (rv < regsz) - panic("ofw_bus_lookup_imap: could not get reg property"); + if (node != -1) { + rv = OF_getprop(node, "reg", reg, regsz); + if (rv < regsz) + panic("ofw_bus_lookup_imap: cannot get reg property"); + } return (ofw_bus_search_intrmap(pintr, pintrsz, reg, ii->opi_addrc, ii->opi_imap, ii->opi_imapsz, ii->opi_imapmsk, maskbuf, mintr, mintrsz, iparent)); @@ -328,4 +329,4 @@ ofw_bus_search_intrmap(void *intr, int i } return (0); } -#endif /* !FDT */ + Modified: head/sys/powerpc/ofw/ofw_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pci.c Sun Oct 20 23:40:16 2013 (r256815) +++ head/sys/powerpc/ofw/ofw_pci.c Mon Oct 21 00:04:26 2013 (r256816) @@ -246,6 +246,13 @@ ofw_pci_route_interrupt(device_t bus, de sc = device_get_softc(bus); pintr = pin; + + /* Fabricate imap information in case this isn't an OFW device */ + bzero(®, sizeof(reg)); + reg.phys_hi = (pci_get_bus(dev) << OFW_PCI_PHYS_HI_BUSSHIFT) | + (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) | + (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT); + if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), &iparent, maskbuf)) Modified: head/sys/powerpc/ofw/ofw_pcib_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcib_pci.c Sun Oct 20 23:40:16 2013 (r256815) +++ head/sys/powerpc/ofw/ofw_pcib_pci.c Mon Oct 21 00:04:26 2013 (r256816) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -141,6 +142,13 @@ ofw_pcib_pci_route_interrupt(device_t br ii = &sc->ops_iinfo; if (ii->opi_imapsz > 0) { pintr = intpin; + + /* Fabricate imap information if this isn't an OFW device */ + bzero(®, sizeof(reg)); + reg.phys_hi = (pci_get_bus(dev) << OFW_PCI_PHYS_HI_BUSSHIFT) | + (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) | + (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT); + if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), ii, ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), &iparent, maskbuf)) { Modified: head/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcibus.c Sun Oct 20 23:40:16 2013 (r256815) +++ head/sys/powerpc/ofw/ofw_pcibus.c Mon Oct 21 00:04:26 2013 (r256816) @@ -322,20 +322,9 @@ ofw_pcibus_assign_interrupt(device_t dev if (node == -1) { /* Non-firmware enumerated child, use standard routing */ - /* - * XXX: Right now we don't have anything sensible to do here, - * since the ofw_imap stuff relies on nodes having a reg - * property. There exist ways around this, so the ePAPR - * spec will need to be studied. - */ - - return (PCI_INVALID_IRQ); - -#ifdef NOTYET intr = pci_get_intpin(child); return (PCIB_ROUTE_INTERRUPT(device_get_parent(dev), child, intr)); -#endif } /* From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 00:28:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0182DB5E; Mon, 21 Oct 2013 00:28:03 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E1B512BCD; Mon, 21 Oct 2013 00:28:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L0S2gH081165; Mon, 21 Oct 2013 00:28:02 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L0S2DX081161; Mon, 21 Oct 2013 00:28:02 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201310210028.r9L0S2DX081161@svn.freebsd.org> From: Kirk McKusick Date: Mon, 21 Oct 2013 00:28:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256817 - in head/sys/ufs: ffs ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 00:28:03 -0000 Author: mckusick Date: Mon Oct 21 00:28:02 2013 New Revision: 256817 URL: http://svnweb.freebsd.org/changeset/base/256817 Log: Restructuring of the soft updates code to set it up so that the single kernel-wide soft update lock can be replaced with a per-filesystem soft-updates lock. This per-filesystem lock will allow each filesystem to have its own soft-updates flushing thread rather than being limited to a single soft-updates flushing thread for the entire kernel. Move soft update variables out of the ufsmount structure and into their own mount_softdeps structure referenced by ufsmount field um_softdep. Eventually the per-filesystem lock will be in this structure. For now there is simply a pointer to the kernel-wide soft updates lock. Change all instances of ACQUIRE_LOCK and FREE_LOCK to pass the lock pointer in the mount_softdeps structure instead of a pointer to the kernel-wide soft-updates lock. Replace the five hash tables used by soft updates with per-filesystem copies of these tables allocated in the mount_softdeps structure. Several functions that flush dependencies when too many are allocated in the kernel used to operate across all filesystems. They are now parameterized to flush dependencies from a specified filesystem. For now, we stick with the round-robin flushing strategy when the kernel as a whole has too many dependencies allocated. While there are many lines of changes, there should be no functional change in the operation of soft updates. Tested by: Peter Holm and Scott Long Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/softdep.h head/sys/ufs/ufs/ufsmount.h Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Oct 21 00:04:26 2013 (r256816) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Oct 21 00:28:02 2013 (r256817) @@ -616,48 +616,6 @@ softdep_freework(wkhd) FEATURE(softupdates, "FFS soft-updates support"); -/* - * These definitions need to be adapted to the system to which - * this file is being ported. - */ - -#define M_SOFTDEP_FLAGS (M_WAITOK) - -#define D_PAGEDEP 0 -#define D_INODEDEP 1 -#define D_BMSAFEMAP 2 -#define D_NEWBLK 3 -#define D_ALLOCDIRECT 4 -#define D_INDIRDEP 5 -#define D_ALLOCINDIR 6 -#define D_FREEFRAG 7 -#define D_FREEBLKS 8 -#define D_FREEFILE 9 -#define D_DIRADD 10 -#define D_MKDIR 11 -#define D_DIRREM 12 -#define D_NEWDIRBLK 13 -#define D_FREEWORK 14 -#define D_FREEDEP 15 -#define D_JADDREF 16 -#define D_JREMREF 17 -#define D_JMVREF 18 -#define D_JNEWBLK 19 -#define D_JFREEBLK 20 -#define D_JFREEFRAG 21 -#define D_JSEG 22 -#define D_JSEGDEP 23 -#define D_SBDEP 24 -#define D_JTRUNC 25 -#define D_JFSYNC 26 -#define D_SENTINEL 27 -#define D_LAST D_SENTINEL - -unsigned long dep_current[D_LAST + 1]; -unsigned long dep_highuse[D_LAST + 1]; -unsigned long dep_total[D_LAST + 1]; -unsigned long dep_write[D_LAST + 1]; - static SYSCTL_NODE(_debug, OID_AUTO, softdep, CTLFLAG_RW, 0, "soft updates stats"); static SYSCTL_NODE(_debug_softdep, OID_AUTO, total, CTLFLAG_RW, 0, @@ -669,6 +627,11 @@ static SYSCTL_NODE(_debug_softdep, OID_A static SYSCTL_NODE(_debug_softdep, OID_AUTO, write, CTLFLAG_RW, 0, "current dependencies written"); +unsigned long dep_current[D_LAST + 1]; +unsigned long dep_highuse[D_LAST + 1]; +unsigned long dep_total[D_LAST + 1]; +unsigned long dep_write[D_LAST + 1]; + #define SOFTDEP_TYPE(type, str, long) \ static MALLOC_DEFINE(M_ ## type, #str, long); \ SYSCTL_ULONG(_debug_softdep_total, OID_AUTO, str, CTLFLAG_RD, \ @@ -713,6 +676,9 @@ static MALLOC_DEFINE(M_SENTINEL, "sentin static MALLOC_DEFINE(M_SAVEDINO, "savedino", "Saved inodes"); static MALLOC_DEFINE(M_JBLOCKS, "jblocks", "Journal block locations"); +static MALLOC_DEFINE(M_MOUNTDATA, "softdep", "Softdep per-mount data"); + +#define M_SOFTDEP_FLAGS (M_WAITOK) /* * translate from workitem type to memory type @@ -749,8 +715,6 @@ static struct malloc_type *memtype[] = { M_SENTINEL }; -static LIST_HEAD(mkdirlist, mkdir) mkdirlisthd; - #define DtoM(type) (memtype[type]) /* @@ -766,51 +730,16 @@ static LIST_HEAD(mkdirlist, mkdir) mkdir #define DOT_OFFSET offsetof(struct dirtemplate, dot_ino) /* - * Forward declarations. - */ -struct inodedep_hashhead; -struct newblk_hashhead; -struct pagedep_hashhead; -struct bmsafemap_hashhead; - -/* - * Private journaling structures. - */ -struct jblocks { - struct jseglst jb_segs; /* TAILQ of current segments. */ - struct jseg *jb_writeseg; /* Next write to complete. */ - struct jseg *jb_oldestseg; /* Oldest segment with valid entries. */ - struct jextent *jb_extent; /* Extent array. */ - uint64_t jb_nextseq; /* Next sequence number. */ - uint64_t jb_oldestwrseq; /* Oldest written sequence number. */ - uint8_t jb_needseg; /* Need a forced segment. */ - uint8_t jb_suspended; /* Did journal suspend writes? */ - int jb_avail; /* Available extents. */ - int jb_used; /* Last used extent. */ - int jb_head; /* Allocator head. */ - int jb_off; /* Allocator extent offset. */ - int jb_blocks; /* Total disk blocks covered. */ - int jb_free; /* Total disk blocks free. */ - int jb_min; /* Minimum free space. */ - int jb_low; /* Low on space. */ - int jb_age; /* Insertion time of oldest rec. */ -}; - -struct jextent { - ufs2_daddr_t je_daddr; /* Disk block address. */ - int je_blocks; /* Disk block count. */ -}; - -/* * Internal function prototypes. */ +static void check_clear_deps(struct mount *); static void softdep_error(char *, int); static int softdep_process_worklist(struct mount *, int); static int softdep_waitidle(struct mount *); static void drain_output(struct vnode *); static struct buf *getdirtybuf(struct buf *, struct rwlock *, int); -static void clear_remove(void); -static void clear_inodedeps(void); +static void clear_remove(struct mount *); +static void clear_inodedeps(struct mount *); static void unlinked_inodedep(struct mount *, struct inodedep *); static void clear_unlinked_inodedep(struct inodedep *); static struct inodedep *first_unlinked_inodedep(struct ufsmount *); @@ -954,20 +883,20 @@ static void allocdirect_merge(struct all struct allocdirect *, struct allocdirect *); static struct freefrag *allocindir_merge(struct allocindir *, struct allocindir *); -static int bmsafemap_find(struct bmsafemap_hashhead *, struct mount *, int, +static int bmsafemap_find(struct bmsafemap_hashhead *, int, struct bmsafemap **); static struct bmsafemap *bmsafemap_lookup(struct mount *, struct buf *, int cg, struct bmsafemap *); -static int newblk_find(struct newblk_hashhead *, struct mount *, ufs2_daddr_t, - int, struct newblk **); +static int newblk_find(struct newblk_hashhead *, ufs2_daddr_t, int, + struct newblk **); static int newblk_lookup(struct mount *, ufs2_daddr_t, int, struct newblk **); -static int inodedep_find(struct inodedep_hashhead *, struct fs *, ino_t, +static int inodedep_find(struct inodedep_hashhead *, ino_t, struct inodedep **); static int inodedep_lookup(struct mount *, ino_t, int, struct inodedep **); static int pagedep_lookup(struct mount *, struct buf *bp, ino_t, ufs_lbn_t, int, struct pagedep **); static int pagedep_find(struct pagedep_hashhead *, ino_t, ufs_lbn_t, - struct mount *mp, int, struct pagedep **); + struct pagedep **); static void pause_timer(void *); static int request_cleanup(struct mount *, int); static int process_worklist_item(struct mount *, int, int); @@ -982,9 +911,9 @@ static void remove_from_worklist(struct static void softdep_flush(void); static void softdep_flushjournal(struct mount *); static int softdep_speedup(void); -static void worklist_speedup(void); +static void worklist_speedup(struct mount *); static int journal_mount(struct mount *, struct fs *, struct ucred *); -static void journal_unmount(struct mount *); +static void journal_unmount(struct ufsmount *); static int journal_space(struct ufsmount *, int); static void journal_suspend(struct ufsmount *); static int journal_unsuspend(struct ufsmount *ump); @@ -1030,15 +959,25 @@ static void softdep_disk_write_complete( static void softdep_deallocate_dependencies(struct buf *); static int softdep_count_dependencies(struct buf *bp, int); +/* + * Global lock over all of soft updates. + */ static struct rwlock lk; RW_SYSINIT(softdep_lock, &lk, "Softdep Lock"); -#define TRY_ACQUIRE_LOCK(lk) rw_try_wlock(lk) -#define ACQUIRE_LOCK(lk) rw_wlock(lk) -#define FREE_LOCK(lk) rw_wunlock(lk) +/* + * Allow per-filesystem soft-updates locking. + * For now all use the same global lock defined above. + */ +#define LOCK_PTR(ump) ((ump)->um_softdep->sd_fslock) +#define TRY_ACQUIRE_LOCK(ump) rw_try_wlock((ump)->um_softdep->sd_fslock) +#define ACQUIRE_LOCK(ump) rw_wlock((ump)->um_softdep->sd_fslock) +#define FREE_LOCK(ump) rw_wunlock((ump)->um_softdep->sd_fslock) +#define LOCK_OWNED(ump) rw_assert((ump)->um_softdep->sd_fslock, \ + RA_WLOCKED) -#define BUF_AREC(bp) lockallowrecurse(&(bp)->b_lock) -#define BUF_NOREC(bp) lockdisablerecurse(&(bp)->b_lock) +#define BUF_AREC(bp) lockallowrecurse(&(bp)->b_lock) +#define BUF_NOREC(bp) lockdisablerecurse(&(bp)->b_lock) /* * Worklist queue management. @@ -1073,7 +1012,7 @@ worklist_insert(head, item, locked) { if (locked) - rw_assert(&lk, RA_WLOCKED); + LOCK_OWNED(VFSTOUFS(item->wk_mp)); if (item->wk_state & ONWORKLIST) panic("worklist_insert: %p %s(0x%X) already on list", item, TYPENAME(item->wk_type), item->wk_state); @@ -1088,7 +1027,7 @@ worklist_remove(item, locked) { if (locked) - rw_assert(&lk, RA_WLOCKED); + LOCK_OWNED(VFSTOUFS(item->wk_mp)); if ((item->wk_state & ONWORKLIST) == 0) panic("worklist_remove: %p %s(0x%X) not on list", item, TYPENAME(item->wk_type), item->wk_state); @@ -1161,7 +1100,6 @@ jwork_move(dst, src) freedep = freedep_merge(WK_FREEDEP(wk), freedep); } - rw_assert(&lk, RA_WLOCKED); while ((wk = LIST_FIRST(src)) != NULL) { WORKLIST_REMOVE(wk); WORKLIST_INSERT(dst, wk); @@ -1216,7 +1154,6 @@ workitem_free(item, type) int type; { struct ufsmount *ump; - rw_assert(&lk, RA_WLOCKED); #ifdef DEBUG if (item->wk_state & ONWORKLIST) @@ -1229,6 +1166,7 @@ workitem_free(item, type) if (item->wk_state & IOWAITING) wakeup(item); ump = VFSTOUFS(item->wk_mp); + LOCK_OWNED(ump); KASSERT(ump->softdep_deps > 0, ("workitem_free: %s: softdep_deps going negative", ump->um_fs->fs_fsmnt)); @@ -1237,7 +1175,11 @@ workitem_free(item, type) KASSERT(dep_current[item->wk_type] > 0, ("workitem_free: %s: dep_current[%s] going negative", ump->um_fs->fs_fsmnt, TYPENAME(item->wk_type))); + KASSERT(ump->softdep_curdeps[item->wk_type] > 0, + ("workitem_free: %s: softdep_curdeps[%s] going negative", + ump->um_fs->fs_fsmnt, TYPENAME(item->wk_type))); dep_current[item->wk_type]--; + ump->softdep_curdeps[item->wk_type] -= 1; free(item, DtoM(type)); } @@ -1254,14 +1196,15 @@ workitem_alloc(item, type, mp) item->wk_state = 0; ump = VFSTOUFS(mp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); dep_current[type]++; if (dep_current[type] > dep_highuse[type]) dep_highuse[type] = dep_current[type]; dep_total[type]++; + ump->softdep_curdeps[type] += 1; ump->softdep_deps++; ump->softdep_accdeps++; - FREE_LOCK(&lk); + FREE_LOCK(ump); } static void @@ -1269,7 +1212,15 @@ workitem_reassign(item, newtype) struct worklist *item; int newtype; { + struct ufsmount *ump; + ump = VFSTOUFS(item->wk_mp); + LOCK_OWNED(ump); + KASSERT(ump->softdep_curdeps[item->wk_type] > 0, + ("workitem_reassign: %s: softdep_curdeps[%s] going negative", + VFSTOUFS(item->wk_mp)->um_fs->fs_fsmnt, TYPENAME(item->wk_type))); + ump->softdep_curdeps[item->wk_type] -= 1; + ump->softdep_curdeps[newtype] += 1; KASSERT(dep_current[item->wk_type] > 0, ("workitem_reassign: %s: dep_current[%s] going negative", VFSTOUFS(item->wk_mp)->um_fs->fs_fsmnt, TYPENAME(item->wk_type))); @@ -1290,7 +1241,8 @@ static int tickdelay = 2; /* number of t static int proc_waiting; /* tracks whether we have a timeout posted */ static int *stat_countp; /* statistic to count in proc_waiting timeout */ static struct callout softdep_callout; -static int req_pending; +static struct mount *req_pending; +#define ALLCLEAN ((struct mount *)-1) static int req_clear_inodedeps; /* syncer process flush some inodedeps */ static int req_clear_remove; /* syncer process flush some freeblks */ static int softdep_flushcache = 0; /* Should we do BIO_FLUSH? */ @@ -1298,6 +1250,7 @@ static int softdep_flushcache = 0; /* Sh /* * runtime statistics */ +static int stat_softdep_mounts; /* number of softdep mounted filesystems */ static int stat_worklist_push; /* number of worklist cleanups */ static int stat_blk_limit_push; /* number of times block limit neared */ static int stat_ino_limit_push; /* number of times inode limit neared */ @@ -1329,6 +1282,8 @@ SYSCTL_INT(_debug_softdep, OID_AUTO, tic &tickdelay, 0, ""); SYSCTL_INT(_debug_softdep, OID_AUTO, maxindirdeps, CTLFLAG_RW, &maxindirdeps, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, softdep_mounts, CTLFLAG_RD, + &stat_softdep_mounts, 0, ""); SYSCTL_INT(_debug_softdep, OID_AUTO, worklist_push, CTLFLAG_RW, &stat_worklist_push, 0,""); SYSCTL_INT(_debug_softdep, OID_AUTO, blk_limit_push, CTLFLAG_RW, @@ -1382,13 +1337,10 @@ SYSCTL_INT(_debug_softdep, OID_AUTO, flu SYSCTL_DECL(_vfs_ffs); -LIST_HEAD(bmsafemap_hashhead, bmsafemap) *bmsafemap_hashtbl; -static u_long bmsafemap_hash; /* size of hash table - 1 */ - -static int compute_summary_at_mount = 0; /* Whether to recompute the summary at mount time */ +/* Whether to recompute the summary at mount time */ +static int compute_summary_at_mount = 0; SYSCTL_INT(_vfs_ffs, OID_AUTO, compute_summary_at_mount, CTLFLAG_RW, &compute_summary_at_mount, 0, "Recompute summary at mount"); - static struct proc *softdepproc; static struct kproc_desc softdep_kp = { "softdepflush", @@ -1413,21 +1365,6 @@ softdep_flush(void) for (;;) { kproc_suspend_check(softdepproc); - ACQUIRE_LOCK(&lk); - /* - * If requested, try removing inode or removal dependencies. - */ - if (req_clear_inodedeps) { - clear_inodedeps(); - req_clear_inodedeps -= 1; - wakeup_one(&proc_waiting); - } - if (req_clear_remove) { - clear_remove(); - req_clear_remove -= 1; - wakeup_one(&proc_waiting); - } - FREE_LOCK(&lk); remaining = progress = 0; mtx_lock(&mountlist_mtx); for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { @@ -1436,8 +1373,8 @@ softdep_flush(void) continue; if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) continue; - progress += softdep_process_worklist(mp, 0); ump = VFSTOUFS(mp); + progress += softdep_process_worklist(mp, 0); remaining += ump->softdep_on_worklist; mtx_lock(&mountlist_mtx); nmp = TAILQ_NEXT(mp, mnt_list); @@ -1446,20 +1383,21 @@ softdep_flush(void) mtx_unlock(&mountlist_mtx); if (remaining && progress) continue; - ACQUIRE_LOCK(&lk); - if (!req_pending) + rw_wlock(&lk); + if (req_pending == NULL) msleep(&req_pending, &lk, PVM, "sdflush", hz); - req_pending = 0; - FREE_LOCK(&lk); + req_pending = NULL; + rw_wunlock(&lk); } } static void -worklist_speedup(void) +worklist_speedup(mp) + struct mount *mp; { rw_assert(&lk, RA_WLOCKED); if (req_pending == 0) { - req_pending = 1; + req_pending = mp; wakeup(&req_pending); } } @@ -1468,9 +1406,9 @@ static int softdep_speedup(void) { - worklist_speedup(); + worklist_speedup(ALLCLEAN); bd_speedup(); - return speedup_syncer(); + return (speedup_syncer()); } /* @@ -1491,8 +1429,8 @@ add_to_worklist(wk, flags) { struct ufsmount *ump; - rw_assert(&lk, RA_WLOCKED); ump = VFSTOUFS(wk->wk_mp); + LOCK_OWNED(ump); if (wk->wk_state & ONWORKLIST) panic("add_to_worklist: %s(0x%X) already on list", TYPENAME(wk->wk_type), wk->wk_state); @@ -1508,7 +1446,7 @@ add_to_worklist(wk, flags) } ump->softdep_on_worklist += 1; if (flags & WK_NODELAY) - worklist_speedup(); + worklist_speedup(wk->wk_mp); } /* @@ -1544,9 +1482,11 @@ wait_worklist(wk, wmesg) struct worklist *wk; char *wmesg; { + struct ufsmount *ump; + ump = VFSTOUFS(wk->wk_mp); wk->wk_state |= IOWAITING; - msleep(wk, &lk, PVM, wmesg, 0); + msleep(wk, LOCK_PTR(ump), PVM, wmesg, 0); } /* @@ -1568,54 +1508,41 @@ softdep_process_worklist(mp, full) long starttime; KASSERT(mp != NULL, ("softdep_process_worklist: NULL mp")); - /* - * Record the process identifier of our caller so that we can give - * this process preferential treatment in request_cleanup below. - */ + if (MOUNTEDSOFTDEP(mp) == 0) + return (0); matchcnt = 0; ump = VFSTOUFS(mp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); starttime = time_second; - softdep_process_journal(mp, NULL, full?MNT_WAIT:0); + softdep_process_journal(mp, NULL, full ? MNT_WAIT : 0); + check_clear_deps(mp); while (ump->softdep_on_worklist > 0) { if ((cnt = process_worklist_item(mp, 10, LK_NOWAIT)) == 0) break; else matchcnt += cnt; - /* - * If requested, try removing inode or removal dependencies. - */ - if (req_clear_inodedeps) { - clear_inodedeps(); - req_clear_inodedeps -= 1; - wakeup_one(&proc_waiting); - } - if (req_clear_remove) { - clear_remove(); - req_clear_remove -= 1; - wakeup_one(&proc_waiting); - } + check_clear_deps(mp); /* * We do not generally want to stop for buffer space, but if * we are really being a buffer hog, we will stop and wait. */ if (should_yield()) { - FREE_LOCK(&lk); + FREE_LOCK(ump); kern_yield(PRI_USER); bwillwrite(); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); } /* * Never allow processing to run for more than one - * second. Otherwise the other mountpoints may get - * excessively backlogged. + * second. This gives the syncer thread the opportunity + * to pause if appropriate. */ if (!full && starttime != time_second) break; } if (full == 0) journal_unsuspend(ump); - FREE_LOCK(&lk); + FREE_LOCK(ump); return (matchcnt); } @@ -1630,12 +1557,13 @@ process_removes(vp) { struct inodedep *inodedep; struct dirrem *dirrem; + struct ufsmount *ump; struct mount *mp; ino_t inum; - rw_assert(&lk, RA_WLOCKED); - mp = vp->v_mount; + ump = VFSTOUFS(mp); + LOCK_OWNED(ump); inum = VTOI(vp)->i_number; for (;;) { top: @@ -1658,12 +1586,12 @@ top: if (dirrem == NULL) return; remove_from_worklist(&dirrem->dm_list); - FREE_LOCK(&lk); + FREE_LOCK(ump); if (vn_start_secondary_write(NULL, &mp, V_NOWAIT)) panic("process_removes: suspended filesystem"); handle_workitem_remove(dirrem, 0); vn_finished_secondary_write(mp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); } } @@ -1679,13 +1607,14 @@ process_truncates(vp) { struct inodedep *inodedep; struct freeblks *freeblks; + struct ufsmount *ump; struct mount *mp; ino_t inum; int cgwait; - rw_assert(&lk, RA_WLOCKED); - mp = vp->v_mount; + ump = VFSTOUFS(mp); + LOCK_OWNED(ump); inum = VTOI(vp)->i_number; for (;;) { if (inodedep_lookup(mp, inum, 0, &inodedep) == 0) @@ -1706,33 +1635,33 @@ process_truncates(vp) } /* Freeblks is waiting on a inode write. */ if ((freeblks->fb_state & COMPLETE) == 0) { - FREE_LOCK(&lk); + FREE_LOCK(ump); ffs_update(vp, 1); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); break; } if ((freeblks->fb_state & (ALLCOMPLETE | ONWORKLIST)) == (ALLCOMPLETE | ONWORKLIST)) { remove_from_worklist(&freeblks->fb_list); freeblks->fb_state |= INPROGRESS; - FREE_LOCK(&lk); + FREE_LOCK(ump); if (vn_start_secondary_write(NULL, &mp, V_NOWAIT)) panic("process_truncates: " "suspended filesystem"); handle_workitem_freeblocks(freeblks, 0); vn_finished_secondary_write(mp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); break; } if (freeblks->fb_cgwait) cgwait++; } if (cgwait) { - FREE_LOCK(&lk); + FREE_LOCK(ump); sync_cgs(mp, MNT_WAIT); ffs_sync_snap(mp, MNT_WAIT); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); continue; } if (freeblks == NULL) @@ -1756,7 +1685,6 @@ process_worklist_item(mp, target, flags) int matchcnt; int error; - rw_assert(&lk, RA_WLOCKED); KASSERT(mp != NULL, ("process_worklist_item: NULL mp")); /* * If we are being called because of a process doing a @@ -1767,6 +1695,7 @@ process_worklist_item(mp, target, flags) return (-1); PHOLD(curproc); /* Don't let the stack go away. */ ump = VFSTOUFS(mp); + LOCK_OWNED(ump); matchcnt = 0; sentinel.wk_mp = NULL; sentinel.wk_type = D_SENTINEL; @@ -1783,7 +1712,7 @@ process_worklist_item(mp, target, flags) wk); wk->wk_state |= INPROGRESS; remove_from_worklist(wk); - FREE_LOCK(&lk); + FREE_LOCK(ump); if (vn_start_secondary_write(NULL, &mp, V_NOWAIT)) panic("process_worklist_item: suspended filesystem"); switch (wk->wk_type) { @@ -1816,7 +1745,7 @@ process_worklist_item(mp, target, flags) /* NOTREACHED */ } vn_finished_secondary_write(mp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); if (error == 0) { if (++matchcnt == target) break; @@ -1850,6 +1779,7 @@ softdep_move_dependencies(oldbp, newbp) struct buf *newbp; { struct worklist *wk, *wktail; + struct ufsmount *ump; int dirty; if ((wk = LIST_FIRST(&oldbp->b_dep)) == NULL) @@ -1858,7 +1788,8 @@ softdep_move_dependencies(oldbp, newbp) ("softdep_move_dependencies called on non-softdep filesystem")); dirty = 0; wktail = NULL; - ACQUIRE_LOCK(&lk); + ump = VFSTOUFS(wk->wk_mp); + ACQUIRE_LOCK(ump); while ((wk = LIST_FIRST(&oldbp->b_dep)) != NULL) { LIST_REMOVE(wk, wk_list); if (wk->wk_type == D_BMSAFEMAP && @@ -1870,7 +1801,7 @@ softdep_move_dependencies(oldbp, newbp) LIST_INSERT_AFTER(wktail, wk, wk_list); wktail = wk; } - FREE_LOCK(&lk); + FREE_LOCK(ump); return (dirty); } @@ -1916,15 +1847,15 @@ softdep_waitidle(struct mount *mp) int i; ump = VFSTOUFS(mp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); for (i = 0; i < 10 && ump->softdep_deps; i++) { ump->softdep_req = 1; if (ump->softdep_on_worklist) panic("softdep_waitidle: work added after flush."); - msleep(&ump->softdep_deps, &lk, PVM, "softdeps", 1); + msleep(&ump->softdep_deps, LOCK_PTR(ump), PVM, "softdeps", 1); } ump->softdep_req = 0; - FREE_LOCK(&lk); + FREE_LOCK(ump); error = 0; if (i == 10) { error = EBUSY; @@ -2023,12 +1954,14 @@ retry_flush: /* * Structure hashing. * - * There are three types of structures that can be looked up: + * There are four types of structures that can be looked up: * 1) pagedep structures identified by mount point, inode number, * and logical block. * 2) inodedep structures identified by mount point and inode number. * 3) newblk structures identified by mount point and * physical block number. + * 4) bmsafemap structures identified by mount point and + * cylinder group number. * * The "pagedep" and "inodedep" dependency structures are hashed * separately from the file blocks and inodes to which they correspond. @@ -2040,7 +1973,8 @@ retry_flush: * their allocdirect or allocindir structure. * * The lookup routines optionally create and hash a new instance when - * an existing entry is not found. + * an existing entry is not found. The bmsafemap lookup routine always + * allocates a new structure if an existing one is not found. */ #define DEPALLOC 0x0001 /* allocate structure if lookup fails */ #define NODELAY 0x0002 /* cannot do background work */ @@ -2048,26 +1982,20 @@ retry_flush: /* * Structures and routines associated with pagedep caching. */ -LIST_HEAD(pagedep_hashhead, pagedep) *pagedep_hashtbl; -u_long pagedep_hash; /* size of hash table - 1 */ -#define PAGEDEP_HASH(mp, inum, lbn) \ - (&pagedep_hashtbl[((((register_t)(mp)) >> 13) + (inum) + (lbn)) & \ - pagedep_hash]) +#define PAGEDEP_HASH(ump, inum, lbn) \ + (&(ump)->pagedep_hashtbl[((inum) + (lbn)) & (ump)->pagedep_hash_size]) static int -pagedep_find(pagedephd, ino, lbn, mp, flags, pagedeppp) +pagedep_find(pagedephd, ino, lbn, pagedeppp) struct pagedep_hashhead *pagedephd; ino_t ino; ufs_lbn_t lbn; - struct mount *mp; - int flags; struct pagedep **pagedeppp; { struct pagedep *pagedep; LIST_FOREACH(pagedep, pagedephd, pd_hash) { - if (ino == pagedep->pd_ino && lbn == pagedep->pd_lbn && - mp == pagedep->pd_list.wk_mp) { + if (ino == pagedep->pd_ino && lbn == pagedep->pd_lbn) { *pagedeppp = pagedep; return (1); } @@ -2093,10 +2021,12 @@ pagedep_lookup(mp, bp, ino, lbn, flags, struct pagedep *pagedep; struct pagedep_hashhead *pagedephd; struct worklist *wk; + struct ufsmount *ump; int ret; int i; - rw_assert(&lk, RA_WLOCKED); + ump = VFSTOUFS(mp); + LOCK_OWNED(ump); if (bp) { LIST_FOREACH(wk, &bp->b_dep, wk_list) { if (wk->wk_type == D_PAGEDEP) { @@ -2105,8 +2035,8 @@ pagedep_lookup(mp, bp, ino, lbn, flags, } } } - pagedephd = PAGEDEP_HASH(mp, ino, lbn); - ret = pagedep_find(pagedephd, ino, lbn, mp, flags, pagedeppp); + pagedephd = PAGEDEP_HASH(ump, ino, lbn); + ret = pagedep_find(pagedephd, ino, lbn, pagedeppp); if (ret) { if (((*pagedeppp)->pd_state & ONWORKLIST) == 0 && bp) WORKLIST_INSERT(&bp->b_dep, &(*pagedeppp)->pd_list); @@ -2114,12 +2044,12 @@ pagedep_lookup(mp, bp, ino, lbn, flags, } if ((flags & DEPALLOC) == 0) return (0); - FREE_LOCK(&lk); + FREE_LOCK(ump); pagedep = malloc(sizeof(struct pagedep), M_PAGEDEP, M_SOFTDEP_FLAGS|M_ZERO); workitem_alloc(&pagedep->pd_list, D_PAGEDEP, mp); - ACQUIRE_LOCK(&lk); - ret = pagedep_find(pagedephd, ino, lbn, mp, flags, pagedeppp); + ACQUIRE_LOCK(ump); + ret = pagedep_find(pagedephd, ino, lbn, pagedeppp); if (*pagedeppp) { /* * This should never happen since we only create pagedeps @@ -2143,22 +2073,19 @@ pagedep_lookup(mp, bp, ino, lbn, flags, /* * Structures and routines associated with inodedep caching. */ -LIST_HEAD(inodedep_hashhead, inodedep) *inodedep_hashtbl; -static u_long inodedep_hash; /* size of hash table - 1 */ -#define INODEDEP_HASH(fs, inum) \ - (&inodedep_hashtbl[((((register_t)(fs)) >> 13) + (inum)) & inodedep_hash]) +#define INODEDEP_HASH(ump, inum) \ + (&(ump)->inodedep_hashtbl[(inum) & (ump)->inodedep_hash_size]) static int -inodedep_find(inodedephd, fs, inum, inodedeppp) +inodedep_find(inodedephd, inum, inodedeppp) struct inodedep_hashhead *inodedephd; - struct fs *fs; ino_t inum; struct inodedep **inodedeppp; { struct inodedep *inodedep; LIST_FOREACH(inodedep, inodedephd, id_hash) - if (inum == inodedep->id_ino && fs == inodedep->id_fs) + if (inum == inodedep->id_ino) break; if (inodedep) { *inodedeppp = inodedep; @@ -2183,13 +2110,15 @@ inodedep_lookup(mp, inum, flags, inodede { struct inodedep *inodedep; struct inodedep_hashhead *inodedephd; + struct ufsmount *ump; struct fs *fs; - rw_assert(&lk, RA_WLOCKED); - fs = VFSTOUFS(mp)->um_fs; - inodedephd = INODEDEP_HASH(fs, inum); + ump = VFSTOUFS(mp); + LOCK_OWNED(ump); + fs = ump->um_fs; + inodedephd = INODEDEP_HASH(ump, inum); - if (inodedep_find(inodedephd, fs, inum, inodedeppp)) + if (inodedep_find(inodedephd, inum, inodedeppp)) return (1); if ((flags & DEPALLOC) == 0) return (0); @@ -2198,12 +2127,12 @@ inodedep_lookup(mp, inum, flags, inodede */ if (dep_current[D_INODEDEP] > max_softdeps && (flags & NODELAY) == 0) request_cleanup(mp, FLUSH_INODES); - FREE_LOCK(&lk); + FREE_LOCK(ump); inodedep = malloc(sizeof(struct inodedep), M_INODEDEP, M_SOFTDEP_FLAGS); workitem_alloc(&inodedep->id_list, D_INODEDEP, mp); - ACQUIRE_LOCK(&lk); - if (inodedep_find(inodedephd, fs, inum, inodedeppp)) { + ACQUIRE_LOCK(ump); + if (inodedep_find(inodedephd, inum, inodedeppp)) { WORKITEM_FREE(inodedep, D_INODEDEP); return (1); } @@ -2235,15 +2164,12 @@ inodedep_lookup(mp, inum, flags, inodede /* * Structures and routines associated with newblk caching. */ -LIST_HEAD(newblk_hashhead, newblk) *newblk_hashtbl; -u_long newblk_hash; /* size of hash table - 1 */ -#define NEWBLK_HASH(fs, inum) \ - (&newblk_hashtbl[((((register_t)(fs)) >> 13) + (inum)) & newblk_hash]) +#define NEWBLK_HASH(ump, inum) \ + (&(ump)->newblk_hashtbl[(inum) & (ump)->newblk_hash_size]) static int -newblk_find(newblkhd, mp, newblkno, flags, newblkpp) +newblk_find(newblkhd, newblkno, flags, newblkpp) struct newblk_hashhead *newblkhd; - struct mount *mp; ufs2_daddr_t newblkno; int flags; struct newblk **newblkpp; @@ -2253,8 +2179,6 @@ newblk_find(newblkhd, mp, newblkno, flag LIST_FOREACH(newblk, newblkhd, nb_hash) { if (newblkno != newblk->nb_newblkno) continue; - if (mp != newblk->nb_list.wk_mp) - continue; /* * If we're creating a new dependency don't match those that * have already been converted to allocdirects. This is for @@ -2286,18 +2210,21 @@ newblk_lookup(mp, newblkno, flags, newbl { struct newblk *newblk; struct newblk_hashhead *newblkhd; + struct ufsmount *ump; - newblkhd = NEWBLK_HASH(VFSTOUFS(mp)->um_fs, newblkno); - if (newblk_find(newblkhd, mp, newblkno, flags, newblkpp)) + ump = VFSTOUFS(mp); + LOCK_OWNED(ump); + newblkhd = NEWBLK_HASH(ump, newblkno); + if (newblk_find(newblkhd, newblkno, flags, newblkpp)) return (1); if ((flags & DEPALLOC) == 0) return (0); - FREE_LOCK(&lk); + FREE_LOCK(ump); newblk = malloc(sizeof(union allblk), M_NEWBLK, M_SOFTDEP_FLAGS | M_ZERO); workitem_alloc(&newblk->nb_list, D_NEWBLK, mp); - ACQUIRE_LOCK(&lk); - if (newblk_find(newblkhd, mp, newblkno, flags, newblkpp)) { + ACQUIRE_LOCK(ump); + if (newblk_find(newblkhd, newblkno, flags, newblkpp)) { WORKITEM_FREE(newblk, D_NEWBLK); return (1); } @@ -2315,10 +2242,8 @@ newblk_lookup(mp, newblkno, flags, newbl /* * Structures and routines associated with freed indirect block caching. */ -struct freeworklst *indir_hashtbl; -u_long indir_hash; /* size of hash table - 1 */ -#define INDIR_HASH(mp, blkno) \ - (&indir_hashtbl[((((register_t)(mp)) >> 13) + (blkno)) & indir_hash]) +#define INDIR_HASH(ump, blkno) \ + (&(ump)->indir_hashtbl[(blkno) & (ump)->indir_hash_size]) /* * Lookup an indirect block in the indir hash table. The freework is @@ -2331,14 +2256,14 @@ indirblk_lookup(mp, blkno) ufs2_daddr_t blkno; { struct freework *freework; - struct freeworklst *wkhd; + struct indir_hashhead *wkhd; + struct ufsmount *ump; - wkhd = INDIR_HASH(mp, blkno); + ump = VFSTOUFS(mp); + wkhd = INDIR_HASH(ump, blkno); TAILQ_FOREACH(freework, wkhd, fw_next) { if (freework->fw_blkno != blkno) continue; - if (freework->fw_list.wk_mp != mp) - continue; indirblk_remove(freework); return (1); } @@ -2356,15 +2281,17 @@ indirblk_insert(freework) { struct jblocks *jblocks; struct jseg *jseg; + struct ufsmount *ump; - jblocks = VFSTOUFS(freework->fw_list.wk_mp)->softdep_jblocks; + ump = VFSTOUFS(freework->fw_list.wk_mp); + jblocks = ump->softdep_jblocks; jseg = TAILQ_LAST(&jblocks->jb_segs, jseglst); if (jseg == NULL) return; LIST_INSERT_HEAD(&jseg->js_indirs, freework, fw_segs); - TAILQ_INSERT_HEAD(INDIR_HASH(freework->fw_list.wk_mp, - freework->fw_blkno), freework, fw_next); + TAILQ_INSERT_HEAD(INDIR_HASH(ump, freework->fw_blkno), freework, + fw_next); freework->fw_state &= ~DEPCOMPLETE; } @@ -2372,10 +2299,11 @@ static void indirblk_remove(freework) struct freework *freework; { + struct ufsmount *ump; + ump = VFSTOUFS(freework->fw_list.wk_mp); LIST_REMOVE(freework, fw_segs); - TAILQ_REMOVE(INDIR_HASH(freework->fw_list.wk_mp, - freework->fw_blkno), freework, fw_next); + TAILQ_REMOVE(INDIR_HASH(ump, freework->fw_blkno), freework, fw_next); freework->fw_state |= DEPCOMPLETE; if ((freework->fw_state & ALLCOMPLETE) == ALLCOMPLETE) WORKITEM_FREE(freework, D_FREEWORK); @@ -2388,20 +2316,8 @@ indirblk_remove(freework) void softdep_initialize() { - int i; - LIST_INIT(&mkdirlisthd); max_softdeps = desiredvnodes * 4; - pagedep_hashtbl = hashinit(desiredvnodes / 5, M_PAGEDEP, &pagedep_hash); - inodedep_hashtbl = hashinit(desiredvnodes, M_INODEDEP, &inodedep_hash); - newblk_hashtbl = hashinit(max_softdeps / 2, M_NEWBLK, &newblk_hash); - bmsafemap_hashtbl = hashinit(1024, M_BMSAFEMAP, &bmsafemap_hash); - i = 1 << (ffs(desiredvnodes / 10) - 1); - indir_hashtbl = malloc(i * sizeof(indir_hashtbl[0]), M_FREEWORK, - M_WAITOK); - indir_hash = i - 1; - for (i = 0; i <= indir_hash; i++) - TAILQ_INIT(&indir_hashtbl[i]); /* initialise bioops hack */ bioops.io_start = softdep_disk_io_initiation; @@ -2421,12 +2337,13 @@ void softdep_uninitialize() { + /* clear bioops hack */ + bioops.io_start = NULL; + bioops.io_complete = NULL; + bioops.io_deallocate = NULL; + bioops.io_countdeps = NULL; + callout_drain(&softdep_callout); - hashdestroy(pagedep_hashtbl, M_PAGEDEP, pagedep_hash); - hashdestroy(inodedep_hashtbl, M_INODEDEP, inodedep_hash); - hashdestroy(newblk_hashtbl, M_NEWBLK, newblk_hash); - hashdestroy(bmsafemap_hashtbl, M_BMSAFEMAP, bmsafemap_hash); - free(indir_hashtbl, M_FREEWORK); } /* @@ -2441,19 +2358,24 @@ softdep_mount(devvp, mp, fs, cred) struct ucred *cred; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 00:58:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A0D483E3; Mon, 21 Oct 2013 00:58:35 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8D8592DAC; Mon, 21 Oct 2013 00:58:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L0wZk1097577; Mon, 21 Oct 2013 00:58:35 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L0wZF8097575; Mon, 21 Oct 2013 00:58:35 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310210058.r9L0wZF8097575@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 21 Oct 2013 00:58:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256818 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 00:58:35 -0000 Author: nwhitehorn Date: Mon Oct 21 00:58:35 2013 New Revision: 256818 URL: http://svnweb.freebsd.org/changeset/base/256818 Log: Fix 80-column line wrapping in a comment. Modified: head/sys/powerpc/powerpc/clock.c Modified: head/sys/powerpc/powerpc/clock.c ============================================================================== --- head/sys/powerpc/powerpc/clock.c Mon Oct 21 00:28:02 2013 (r256817) +++ head/sys/powerpc/powerpc/clock.c Mon Oct 21 00:58:35 2013 (r256818) @@ -167,8 +167,8 @@ decr_init(void) char buf[32]; /* - * Check the BSP's timebase frequency. Sometimes we can't find the BSP, so fall - * back to the first CPU in this case. + * Check the BSP's timebase frequency. Sometimes we can't find the BSP, + * so fall back to the first CPU in this case. */ if (platform_smp_get_bsp(&cpu) != 0) platform_smp_first_cpu(&cpu); From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 01:10:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BF196866; Mon, 21 Oct 2013 01:10:38 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9265F2E67; Mon, 21 Oct 2013 01:10:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L1Acea003957; Mon, 21 Oct 2013 01:10:38 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L1AcGu003945; Mon, 21 Oct 2013 01:10:38 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201310210110.r9L1AcGu003945@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 21 Oct 2013 01:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256819 - in stable/10/sys: dev/cxgbe/iw_cxgbe modules/cxgbe modules/cxgbe/iw_cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 01:10:38 -0000 Author: np Date: Mon Oct 21 01:10:37 2013 New Revision: 256819 URL: http://svnweb.freebsd.org/changeset/base/256819 Log: MFC r256694, r256713, r256714. r256694: iw_cxgbe: iWARP driver for Chelsio T4/T5 chips. This is a straight port of the iw_cxgb4 found in OFED distributions. r256713: iw_cxgbe should have a dependency on t4nex. r256714: Fix typo in previous commit. Approved by: re (hrs) Added: stable/10/sys/dev/cxgbe/iw_cxgbe/ - copied from r256694, head/sys/dev/cxgbe/iw_cxgbe/ stable/10/sys/modules/cxgbe/iw_cxgbe/ - copied from r256694, head/sys/modules/cxgbe/iw_cxgbe/ Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/device.c stable/10/sys/modules/cxgbe/Makefile Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/device.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/device.c Thu Oct 17 18:37:25 2013 (r256694) +++ stable/10/sys/dev/cxgbe/iw_cxgbe/device.c Mon Oct 21 01:10:37 2013 (r256819) @@ -363,6 +363,7 @@ static moduledata_t c4iw_mod_data = { }; MODULE_VERSION(iw_cxgbe, 1); +MODULE_DEPEND(iw_cxgbe, t4nex, 1, 1, 1); MODULE_DEPEND(iw_cxgbe, t4_tom, 1, 1, 1); MODULE_DEPEND(iw_cxgbe, ibcore, 1, 1, 1); DECLARE_MODULE(iw_cxgbe, c4iw_mod_data, SI_SUB_EXEC, SI_ORDER_ANY); Modified: stable/10/sys/modules/cxgbe/Makefile ============================================================================== --- stable/10/sys/modules/cxgbe/Makefile Mon Oct 21 00:58:35 2013 (r256818) +++ stable/10/sys/modules/cxgbe/Makefile Mon Oct 21 01:10:37 2013 (r256819) @@ -6,9 +6,16 @@ SUBDIR = if_cxgbe SUBDIR+= t4_firmware SUBDIR+= t5_firmware SUBDIR+= ${_tom} +SUBDIR+= ${_iw_cxgbe} -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +.if ${MACHINE_CPUARCH} == "amd64" _tom= tom +_iw_cxgbe= iw_cxgbe .endif +.if ${MACHINE_CPUARCH} == "i386" +_tom= tom +.endif + + .include From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 01:15:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8988F9F5; Mon, 21 Oct 2013 01:15:06 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5AEB62EC8; Mon, 21 Oct 2013 01:15:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L1F6PW007012; Mon, 21 Oct 2013 01:15:06 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L1F6Ir007011; Mon, 21 Oct 2013 01:15:06 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201310210115.r9L1F6Ir007011@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 21 Oct 2013 01:15:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256820 - in stable/10/sys: contrib/rdma modules/rdma modules/rdma/addr modules/rdma/cma modules/rdma/core modules/rdma/iwcm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 01:15:06 -0000 Author: np Date: Mon Oct 21 01:15:05 2013 New Revision: 256820 URL: http://svnweb.freebsd.org/changeset/base/256820 Log: MFC r256467: Delete all of the old RDMA code (except krping, which was switched to use sys/ofed some time back). This has been sitting around as dead code in the tree for a very long time. Approved by: re (hrs) Deleted: stable/10/sys/contrib/rdma/core_priv.h stable/10/sys/contrib/rdma/ib_addr.h stable/10/sys/contrib/rdma/ib_cache.h stable/10/sys/contrib/rdma/ib_cm.h stable/10/sys/contrib/rdma/ib_fmr_pool.h stable/10/sys/contrib/rdma/ib_mad.h stable/10/sys/contrib/rdma/ib_marshall.h stable/10/sys/contrib/rdma/ib_pack.h stable/10/sys/contrib/rdma/ib_sa.h stable/10/sys/contrib/rdma/ib_smi.h stable/10/sys/contrib/rdma/ib_umem.h stable/10/sys/contrib/rdma/ib_user_cm.h stable/10/sys/contrib/rdma/ib_user_mad.h stable/10/sys/contrib/rdma/ib_user_sa.h stable/10/sys/contrib/rdma/ib_user_verbs.h stable/10/sys/contrib/rdma/ib_verbs.h stable/10/sys/contrib/rdma/iw_cm.h stable/10/sys/contrib/rdma/rdma_addr.c stable/10/sys/contrib/rdma/rdma_cache.c stable/10/sys/contrib/rdma/rdma_cm.h stable/10/sys/contrib/rdma/rdma_cm_ib.h stable/10/sys/contrib/rdma/rdma_cma.c stable/10/sys/contrib/rdma/rdma_device.c stable/10/sys/contrib/rdma/rdma_iwcm.c stable/10/sys/contrib/rdma/rdma_user_cm.h stable/10/sys/contrib/rdma/rdma_verbs.c stable/10/sys/contrib/rdma/types.h stable/10/sys/modules/rdma/addr/ stable/10/sys/modules/rdma/cma/ stable/10/sys/modules/rdma/core/ stable/10/sys/modules/rdma/iwcm/ Modified: stable/10/sys/modules/rdma/Makefile Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/modules/rdma/Makefile ============================================================================== --- stable/10/sys/modules/rdma/Makefile Mon Oct 21 01:10:37 2013 (r256819) +++ stable/10/sys/modules/rdma/Makefile Mon Oct 21 01:15:05 2013 (r256820) @@ -1,9 +1,5 @@ # $FreeBSD$ -#SUBDIR= addr -#SUBDIR+= cma -#SUBDIR+= iwcm -#SUBDIR+= core SUBDIR+= krping .include From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 04:00:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 62957CB1; Mon, 21 Oct 2013 04:00:24 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 500602742; Mon, 21 Oct 2013 04:00:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L40OFe095915; Mon, 21 Oct 2013 04:00:24 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L40Opv095914; Mon, 21 Oct 2013 04:00:24 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201310210400.r9L40Opv095914@svn.freebsd.org> From: "Justin T. Gibbs" Date: Mon, 21 Oct 2013 04:00:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256821 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 04:00:24 -0000 Author: gibbs Date: Mon Oct 21 04:00:23 2013 New Revision: 256821 URL: http://svnweb.freebsd.org/changeset/base/256821 Log: MFC 256813: The Xen userland event channel driver isn't complete. Disabled it from the kernel build until it is ready. sys/conf/files: Remove the entry for xen/evtchn/evtchn_dev.c so it is not included in any kernel builds. Noticed by: smh Approved by: re (hrs) ------------------------------------------------------------------------ Modified: stable/10/sys/conf/files Directory Properties: stable/10/sys/ (props changed) stable/10/sys/conf/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Mon Oct 21 01:15:05 2013 (r256820) +++ stable/10/sys/conf/files Mon Oct 21 04:00:23 2013 (r256821) @@ -3845,7 +3845,6 @@ vm/vm_zeroidle.c standard vm/vnode_pager.c standard xen/gnttab.c optional xen | xenhvm xen/features.c optional xen | xenhvm -xen/evtchn/evtchn_dev.c optional xen | xenhvm xen/xenbus/xenbus_if.m optional xen | xenhvm xen/xenbus/xenbus.c optional xen | xenhvm xen/xenbus/xenbusb_if.m optional xen | xenhvm From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 04:15:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 94FD0FAE; Mon, 21 Oct 2013 04:15:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 690DB282F; Mon, 21 Oct 2013 04:15:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L4Ftj2005539; Mon, 21 Oct 2013 04:15:55 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L4Ftrk005535; Mon, 21 Oct 2013 04:15:55 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310210415.r9L4Ftrk005535@svn.freebsd.org> From: Mark Johnston Date: Mon, 21 Oct 2013 04:15:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256822 - in head/sys/cddl: contrib/opensolaris/uts/intel/dtrace dev/dtrace/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 04:15:56 -0000 Author: markj Date: Mon Oct 21 04:15:55 2013 New Revision: 256822 URL: http://svnweb.freebsd.org/changeset/base/256822 Log: When fetching function arguments out of a frame on amd64, explicitly select the register based on the argument index rather than relying on the fields in struct reg to be in the right order. This assumption is incorrect on FreeBSD and generally led to bogus argument values for the sixth argument of PID and USDT probes; the first five are passed directly to dtrace_probe() via the fasttrap trap handler and so were correctly handled. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Oct 21 04:00:23 2013 (r256821) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Oct 21 04:15:55 2013 (r256822) @@ -272,7 +272,20 @@ fasttrap_anarg(struct reg *rp, int funct * registers. */ if (argno < 6) - return ((&rp->r_rdi)[argno]); + switch (argno) { + case 0: + return (rp->r_rdi); + case 1: + return (rp->r_rsi); + case 2: + return (rp->r_rdx); + case 3: + return (rp->r_rcx); + case 4: + return (rp->r_r8); + case 5: + return (rp->r_r9); + } stack = (uintptr_t *)rp->r_rsp; DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Mon Oct 21 04:00:23 2013 (r256821) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Mon Oct 21 04:15:55 2013 (r256822) @@ -367,7 +367,27 @@ dtrace_getarg(int arg, int aframes) sizeof (uintptr_t)); if (arg <= inreg) { - stack = (uintptr_t *)&rp->r_rdi; + switch (arg) { + case 0: + stack = (uintptr_t *)&rp->r_rdi; + break; + case 1: + stack = (uintptr_t *)&rp->r_rsi; + break; + case 2: + stack = (uintptr_t *)&rp->r_rdx; + break; + case 3: + stack = (uintptr_t *)&rp->r_rcx; + break; + case 4: + stack = (uintptr_t *)&rp->r_r8; + break; + case 5: + stack = (uintptr_t *)&rp->r_r9; + break; + } + arg = 0; } else { stack = (uintptr_t *)(rp->r_rsp); arg -= inreg; From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 05:10:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 92C84587; Mon, 21 Oct 2013 05:10:49 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 73B982A25; Mon, 21 Oct 2013 05:10:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L5AnI9035472; Mon, 21 Oct 2013 05:10:49 GMT (envelope-from jasone@svn.freebsd.org) Received: (from jasone@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L5Ak40035450; Mon, 21 Oct 2013 05:10:46 GMT (envelope-from jasone@svn.freebsd.org) Message-Id: <201310210510.r9L5Ak40035450@svn.freebsd.org> From: Jason Evans Date: Mon, 21 Oct 2013 05:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256823 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 05:10:49 -0000 Author: jasone Date: Mon Oct 21 05:10:46 2013 New Revision: 256823 URL: http://svnweb.freebsd.org/changeset/base/256823 Log: Update jemalloc to version 3.4.1. Modified: head/contrib/jemalloc/ChangeLog head/contrib/jemalloc/FREEBSD-diffs head/contrib/jemalloc/FREEBSD-upgrade head/contrib/jemalloc/VERSION head/contrib/jemalloc/doc/jemalloc.3 head/contrib/jemalloc/include/jemalloc/internal/arena.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h head/contrib/jemalloc/include/jemalloc/internal/tcache.h head/contrib/jemalloc/include/jemalloc/jemalloc.h head/contrib/jemalloc/src/arena.c head/contrib/jemalloc/src/chunk.c head/contrib/jemalloc/src/ctl.c head/contrib/jemalloc/src/jemalloc.c Modified: head/contrib/jemalloc/ChangeLog ============================================================================== --- head/contrib/jemalloc/ChangeLog Mon Oct 21 04:15:55 2013 (r256822) +++ head/contrib/jemalloc/ChangeLog Mon Oct 21 05:10:46 2013 (r256823) @@ -6,6 +6,21 @@ found in the git revision history: http://www.canonware.com/cgi-bin/gitweb.cgi?p=jemalloc.git git://canonware.com/jemalloc.git +* 3.4.1 (October 20, 2013) + + Bug fixes: + - Fix a race in the "arenas.extend" mallctl that could cause memory corruption + of internal data structures and subsequent crashes. + - Fix Valgrind integration flaws that caused Valgrind warnings about reads of + uninitialized memory in: + + arena chunk headers + + internal zero-initialized data structures (relevant to tcache and prof + code) + - Preserve errno during the first allocation. A readlink(2) call during + initialization fails unless /etc/malloc.conf exists, so errno was typically + set during the first allocation prior to this fix. + - Fix compilation warnings reported by gcc 4.8.1. + * 3.4.0 (June 2, 2013) This version is essentially a small bugfix release, but the addition of @@ -60,7 +75,7 @@ found in the git revision history: Bug fixes: - Fix "arenas.extend" mallctl to output the number of arenas. - - Fix chunk_recycyle() to unconditionally inform Valgrind that returned memory + - Fix chunk_recycle() to unconditionally inform Valgrind that returned memory is undefined. - Fix build break on FreeBSD related to alloca.h. Modified: head/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- head/contrib/jemalloc/FREEBSD-diffs Mon Oct 21 04:15:55 2013 (r256822) +++ head/contrib/jemalloc/FREEBSD-diffs Mon Oct 21 05:10:46 2013 (r256823) @@ -45,7 +45,7 @@ index abd5e6f..1d7491a 100644 + diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in -index e46ac54..527449d 100644 +index 53c135c..c547339 100644 --- a/include/jemalloc/internal/jemalloc_internal.h.in +++ b/include/jemalloc/internal/jemalloc_internal.h.in @@ -1,5 +1,8 @@ @@ -97,10 +97,10 @@ index de44e14..564d604 100644 bool malloc_mutex_init(malloc_mutex_t *mutex); diff --git a/include/jemalloc/internal/private_namespace.h b/include/jemalloc/internal/private_namespace.h -index 65de316..366676b 100644 +index cdb0b0e..2a98d1f 100644 --- a/include/jemalloc/internal/private_namespace.h +++ b/include/jemalloc/internal/private_namespace.h -@@ -216,7 +216,6 @@ +@@ -218,7 +218,6 @@ #define iralloc JEMALLOC_N(iralloc) #define irallocx JEMALLOC_N(irallocx) #define isalloc JEMALLOC_N(isalloc) @@ -244,7 +244,7 @@ index 0000000..e6c8407 +#endif + diff --git a/src/jemalloc.c b/src/jemalloc.c -index bc350ed..352c98e 100644 +index ae56db6..1412a5e 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -8,6 +8,10 @@ malloc_tsd_data(, arenas, arena_t *, NULL) Modified: head/contrib/jemalloc/FREEBSD-upgrade ============================================================================== --- head/contrib/jemalloc/FREEBSD-upgrade Mon Oct 21 04:15:55 2013 (r256822) +++ head/contrib/jemalloc/FREEBSD-upgrade Mon Oct 21 05:10:46 2013 (r256823) @@ -60,7 +60,7 @@ do_extract() { local rev=$1 # Clone. rm -rf ${work} - git clone git://canonware.com/jemalloc.git ${work} + git clone https://github.com/jemalloc/jemalloc.git ${work} ( cd ${work} if [ "x${rev}" != "x" ] ; then Modified: head/contrib/jemalloc/VERSION ============================================================================== --- head/contrib/jemalloc/VERSION Mon Oct 21 04:15:55 2013 (r256822) +++ head/contrib/jemalloc/VERSION Mon Oct 21 05:10:46 2013 (r256823) @@ -1 +1 @@ -3.4.0-0-g0ed518e5dab789ad2171bb38977a8927e2a26775 +3.4.1-0-g0135fb806e4137dc9cdf152541926a2bc95e33f0 Modified: head/contrib/jemalloc/doc/jemalloc.3 ============================================================================== --- head/contrib/jemalloc/doc/jemalloc.3 Mon Oct 21 04:15:55 2013 (r256822) +++ head/contrib/jemalloc/doc/jemalloc.3 Mon Oct 21 05:10:46 2013 (r256823) @@ -2,12 +2,12 @@ .\" Title: JEMALLOC .\" Author: Jason Evans .\" Generator: DocBook XSL Stylesheets v1.76.1 -.\" Date: 06/02/2013 +.\" Date: 10/20/2013 .\" Manual: User Manual -.\" Source: jemalloc 3.4.0-0-g0ed518e5dab789ad2171bb38977a8927e2a26775 +.\" Source: jemalloc 3.4.1-0-g0135fb806e4137dc9cdf152541926a2bc95e33f0 .\" Language: English .\" -.TH "JEMALLOC" "3" "06/02/2013" "jemalloc 3.4.0-0-g0ed518e5dab7" "User Manual" +.TH "JEMALLOC" "3" "10/20/2013" "jemalloc 3.4.1-0-g0135fb806e41" "User Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -31,7 +31,7 @@ jemalloc \- general purpose memory allocation functions .SH "LIBRARY" .PP -This manual describes jemalloc 3\&.4\&.0\-0\-g0ed518e5dab789ad2171bb38977a8927e2a26775\&. More information can be found at the +This manual describes jemalloc 3\&.4\&.1\-0\-g0135fb806e4137dc9cdf152541926a2bc95e33f0\&. More information can be found at the \m[blue]\fBjemalloc website\fR\m[]\&\s-2\u[1]\d\s+2\&. .PP The following configuration options are enabled in libc\*(Aqs built\-in jemalloc: Modified: head/contrib/jemalloc/include/jemalloc/internal/arena.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/arena.h Mon Oct 21 04:15:55 2013 (r256822) +++ head/contrib/jemalloc/include/jemalloc/internal/arena.h Mon Oct 21 05:10:46 2013 (r256823) @@ -441,6 +441,7 @@ void arena_postfork_child(arena_t *arena #ifndef JEMALLOC_ENABLE_INLINE arena_chunk_map_t *arena_mapp_get(arena_chunk_t *chunk, size_t pageind); size_t *arena_mapbitsp_get(arena_chunk_t *chunk, size_t pageind); +size_t arena_mapbitsp_read(size_t *mapbitsp); size_t arena_mapbits_get(arena_chunk_t *chunk, size_t pageind); size_t arena_mapbits_unallocated_size_get(arena_chunk_t *chunk, size_t pageind); @@ -451,6 +452,7 @@ size_t arena_mapbits_dirty_get(arena_chu size_t arena_mapbits_unzeroed_get(arena_chunk_t *chunk, size_t pageind); size_t arena_mapbits_large_get(arena_chunk_t *chunk, size_t pageind); size_t arena_mapbits_allocated_get(arena_chunk_t *chunk, size_t pageind); +void arena_mapbitsp_write(size_t *mapbitsp, size_t mapbits); void arena_mapbits_unallocated_set(arena_chunk_t *chunk, size_t pageind, size_t size, size_t flags); void arena_mapbits_unallocated_size_set(arena_chunk_t *chunk, size_t pageind, @@ -498,10 +500,17 @@ arena_mapbitsp_get(arena_chunk_t *chunk, } JEMALLOC_ALWAYS_INLINE size_t +arena_mapbitsp_read(size_t *mapbitsp) +{ + + return (*mapbitsp); +} + +JEMALLOC_ALWAYS_INLINE size_t arena_mapbits_get(arena_chunk_t *chunk, size_t pageind) { - return (*arena_mapbitsp_get(chunk, pageind)); + return (arena_mapbitsp_read(arena_mapbitsp_get(chunk, pageind))); } JEMALLOC_ALWAYS_INLINE size_t @@ -585,82 +594,89 @@ arena_mapbits_allocated_get(arena_chunk_ } JEMALLOC_ALWAYS_INLINE void +arena_mapbitsp_write(size_t *mapbitsp, size_t mapbits) +{ + + *mapbitsp = mapbits; +} + +JEMALLOC_ALWAYS_INLINE void arena_mapbits_unallocated_set(arena_chunk_t *chunk, size_t pageind, size_t size, size_t flags) { - size_t *mapbitsp; + size_t *mapbitsp = arena_mapbitsp_get(chunk, pageind); - mapbitsp = arena_mapbitsp_get(chunk, pageind); assert((size & PAGE_MASK) == 0); assert((flags & ~CHUNK_MAP_FLAGS_MASK) == 0); assert((flags & (CHUNK_MAP_DIRTY|CHUNK_MAP_UNZEROED)) == flags); - *mapbitsp = size | CHUNK_MAP_BININD_INVALID | flags; + arena_mapbitsp_write(mapbitsp, size | CHUNK_MAP_BININD_INVALID | flags); } JEMALLOC_ALWAYS_INLINE void arena_mapbits_unallocated_size_set(arena_chunk_t *chunk, size_t pageind, size_t size) { - size_t *mapbitsp; + size_t *mapbitsp = arena_mapbitsp_get(chunk, pageind); + size_t mapbits = arena_mapbitsp_read(mapbitsp); - mapbitsp = arena_mapbitsp_get(chunk, pageind); assert((size & PAGE_MASK) == 0); - assert((*mapbitsp & (CHUNK_MAP_LARGE|CHUNK_MAP_ALLOCATED)) == 0); - *mapbitsp = size | (*mapbitsp & PAGE_MASK); + assert((mapbits & (CHUNK_MAP_LARGE|CHUNK_MAP_ALLOCATED)) == 0); + arena_mapbitsp_write(mapbitsp, size | (mapbits & PAGE_MASK)); } JEMALLOC_ALWAYS_INLINE void arena_mapbits_large_set(arena_chunk_t *chunk, size_t pageind, size_t size, size_t flags) { - size_t *mapbitsp; + size_t *mapbitsp = arena_mapbitsp_get(chunk, pageind); + size_t mapbits = arena_mapbitsp_read(mapbitsp); size_t unzeroed; - mapbitsp = arena_mapbitsp_get(chunk, pageind); assert((size & PAGE_MASK) == 0); assert((flags & CHUNK_MAP_DIRTY) == flags); - unzeroed = *mapbitsp & CHUNK_MAP_UNZEROED; /* Preserve unzeroed. */ - *mapbitsp = size | CHUNK_MAP_BININD_INVALID | flags | unzeroed | - CHUNK_MAP_LARGE | CHUNK_MAP_ALLOCATED; + unzeroed = mapbits & CHUNK_MAP_UNZEROED; /* Preserve unzeroed. */ + arena_mapbitsp_write(mapbitsp, size | CHUNK_MAP_BININD_INVALID | flags + | unzeroed | CHUNK_MAP_LARGE | CHUNK_MAP_ALLOCATED); } JEMALLOC_ALWAYS_INLINE void arena_mapbits_large_binind_set(arena_chunk_t *chunk, size_t pageind, size_t binind) { - size_t *mapbitsp; + size_t *mapbitsp = arena_mapbitsp_get(chunk, pageind); + size_t mapbits = arena_mapbitsp_read(mapbitsp); assert(binind <= BININD_INVALID); - mapbitsp = arena_mapbitsp_get(chunk, pageind); assert(arena_mapbits_large_size_get(chunk, pageind) == PAGE); - *mapbitsp = (*mapbitsp & ~CHUNK_MAP_BININD_MASK) | (binind << - CHUNK_MAP_BININD_SHIFT); + arena_mapbitsp_write(mapbitsp, (mapbits & ~CHUNK_MAP_BININD_MASK) | + (binind << CHUNK_MAP_BININD_SHIFT)); } JEMALLOC_ALWAYS_INLINE void arena_mapbits_small_set(arena_chunk_t *chunk, size_t pageind, size_t runind, size_t binind, size_t flags) { - size_t *mapbitsp; + size_t *mapbitsp = arena_mapbitsp_get(chunk, pageind); + size_t mapbits = arena_mapbitsp_read(mapbitsp); size_t unzeroed; assert(binind < BININD_INVALID); - mapbitsp = arena_mapbitsp_get(chunk, pageind); assert(pageind - runind >= map_bias); assert((flags & CHUNK_MAP_DIRTY) == flags); - unzeroed = *mapbitsp & CHUNK_MAP_UNZEROED; /* Preserve unzeroed. */ - *mapbitsp = (runind << LG_PAGE) | (binind << CHUNK_MAP_BININD_SHIFT) | - flags | unzeroed | CHUNK_MAP_ALLOCATED; + unzeroed = mapbits & CHUNK_MAP_UNZEROED; /* Preserve unzeroed. */ + arena_mapbitsp_write(mapbitsp, (runind << LG_PAGE) | (binind << + CHUNK_MAP_BININD_SHIFT) | flags | unzeroed | CHUNK_MAP_ALLOCATED); } JEMALLOC_ALWAYS_INLINE void arena_mapbits_unzeroed_set(arena_chunk_t *chunk, size_t pageind, size_t unzeroed) { - size_t *mapbitsp; + size_t *mapbitsp = arena_mapbitsp_get(chunk, pageind); + size_t mapbits = arena_mapbitsp_read(mapbitsp); - mapbitsp = arena_mapbitsp_get(chunk, pageind); - *mapbitsp = (*mapbitsp & ~CHUNK_MAP_UNZEROED) | unzeroed; + arena_mapbitsp_write(mapbitsp, (mapbits & ~CHUNK_MAP_UNZEROED) | + unzeroed); } JEMALLOC_INLINE bool Modified: head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h Mon Oct 21 04:15:55 2013 (r256822) +++ head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h Mon Oct 21 05:10:46 2013 (r256823) @@ -232,9 +232,18 @@ static const bool config_ivsalloc = # define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var)) #endif +/* + * JEMALLOC_ALWAYS_INLINE is used within header files for functions that are + * static inline functions if inlining is enabled, and single-definition + * library-private functions if inlining is disabled. + * + * JEMALLOC_ALWAYS_INLINE_C is for use in .c files, in which case the denoted + * functions are always static, regardless of whether inlining is enabled. + */ #ifdef JEMALLOC_DEBUG /* Disable inlining to make debugging easier. */ # define JEMALLOC_ALWAYS_INLINE +# define JEMALLOC_ALWAYS_INLINE_C static # define JEMALLOC_INLINE # define inline #else @@ -242,8 +251,11 @@ static const bool config_ivsalloc = # ifdef JEMALLOC_HAVE_ATTR # define JEMALLOC_ALWAYS_INLINE \ static inline JEMALLOC_ATTR(unused) JEMALLOC_ATTR(always_inline) +# define JEMALLOC_ALWAYS_INLINE_C \ + static inline JEMALLOC_ATTR(always_inline) # else # define JEMALLOC_ALWAYS_INLINE static inline +# define JEMALLOC_ALWAYS_INLINE_C static inline # endif # define JEMALLOC_INLINE static inline # ifdef _MSC_VER Modified: head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h Mon Oct 21 04:15:55 2013 (r256822) +++ head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h Mon Oct 21 05:10:46 2013 (r256823) @@ -33,6 +33,8 @@ #define arena_mapbits_unzeroed_get JEMALLOC_N(arena_mapbits_unzeroed_get) #define arena_mapbits_unzeroed_set JEMALLOC_N(arena_mapbits_unzeroed_set) #define arena_mapbitsp_get JEMALLOC_N(arena_mapbitsp_get) +#define arena_mapbitsp_read JEMALLOC_N(arena_mapbitsp_read) +#define arena_mapbitsp_write JEMALLOC_N(arena_mapbitsp_write) #define arena_mapp_get JEMALLOC_N(arena_mapp_get) #define arena_maxclass JEMALLOC_N(arena_maxclass) #define arena_new JEMALLOC_N(arena_new) Modified: head/contrib/jemalloc/include/jemalloc/internal/tcache.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/tcache.h Mon Oct 21 04:15:55 2013 (r256822) +++ head/contrib/jemalloc/include/jemalloc/internal/tcache.h Mon Oct 21 05:10:46 2013 (r256823) @@ -313,6 +313,7 @@ tcache_alloc_small(tcache_t *tcache, siz } else if (opt_zero) memset(ret, 0, size); } + VALGRIND_MAKE_MEM_UNDEFINED(ret, size); } else { if (config_fill && opt_junk) { arena_alloc_junk_small(ret, &arena_bin_info[binind], @@ -321,7 +322,6 @@ tcache_alloc_small(tcache_t *tcache, siz VALGRIND_MAKE_MEM_UNDEFINED(ret, size); memset(ret, 0, size); } - VALGRIND_MAKE_MEM_UNDEFINED(ret, size); if (config_stats) tbin->tstats.nrequests++; @@ -368,11 +368,11 @@ tcache_alloc_large(tcache_t *tcache, siz else if (opt_zero) memset(ret, 0, size); } + VALGRIND_MAKE_MEM_UNDEFINED(ret, size); } else { VALGRIND_MAKE_MEM_UNDEFINED(ret, size); memset(ret, 0, size); } - VALGRIND_MAKE_MEM_UNDEFINED(ret, size); if (config_stats) tbin->tstats.nrequests++; Modified: head/contrib/jemalloc/include/jemalloc/jemalloc.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/jemalloc.h Mon Oct 21 04:15:55 2013 (r256822) +++ head/contrib/jemalloc/include/jemalloc/jemalloc.h Mon Oct 21 05:10:46 2013 (r256823) @@ -7,12 +7,12 @@ extern "C" { #include #include -#define JEMALLOC_VERSION "3.4.0-0-g0ed518e5dab789ad2171bb38977a8927e2a26775" +#define JEMALLOC_VERSION "3.4.1-0-g0135fb806e4137dc9cdf152541926a2bc95e33f0" #define JEMALLOC_VERSION_MAJOR 3 #define JEMALLOC_VERSION_MINOR 4 -#define JEMALLOC_VERSION_BUGFIX 0 +#define JEMALLOC_VERSION_BUGFIX 1 #define JEMALLOC_VERSION_NREV 0 -#define JEMALLOC_VERSION_GID "0ed518e5dab789ad2171bb38977a8927e2a26775" +#define JEMALLOC_VERSION_GID "0135fb806e4137dc9cdf152541926a2bc95e33f0" #include "jemalloc_defs.h" #include "jemalloc_FreeBSD.h" Modified: head/contrib/jemalloc/src/arena.c ============================================================================== --- head/contrib/jemalloc/src/arena.c Mon Oct 21 04:15:55 2013 (r256822) +++ head/contrib/jemalloc/src/arena.c Mon Oct 21 05:10:46 2013 (r256823) @@ -369,13 +369,20 @@ arena_run_zero(arena_chunk_t *chunk, siz } static inline void +arena_run_page_mark_zeroed(arena_chunk_t *chunk, size_t run_ind) +{ + + VALGRIND_MAKE_MEM_DEFINED((void *)((uintptr_t)chunk + (run_ind << + LG_PAGE)), PAGE); +} + +static inline void arena_run_page_validate_zeroed(arena_chunk_t *chunk, size_t run_ind) { size_t i; UNUSED size_t *p = (size_t *)((uintptr_t)chunk + (run_ind << LG_PAGE)); - VALGRIND_MAKE_MEM_DEFINED((void *)((uintptr_t)chunk + (run_ind << - LG_PAGE)), PAGE); + arena_run_page_mark_zeroed(chunk, run_ind); for (i = 0; i < PAGE / sizeof(size_t); i++) assert(p[i] == 0); } @@ -458,6 +465,9 @@ arena_run_split(arena_t *arena, arena_ru } else if (config_debug) { arena_run_page_validate_zeroed( chunk, run_ind+i); + } else { + arena_run_page_mark_zeroed( + chunk, run_ind+i); } } } else { @@ -467,6 +477,9 @@ arena_run_split(arena_t *arena, arena_ru */ arena_run_zero(chunk, run_ind, need_pages); } + } else { + VALGRIND_MAKE_MEM_UNDEFINED((void *)((uintptr_t)chunk + + (run_ind << LG_PAGE)), (need_pages << LG_PAGE)); } /* @@ -508,9 +521,9 @@ arena_run_split(arena_t *arena, arena_ru arena_run_page_validate_zeroed(chunk, run_ind+need_pages-1); } + VALGRIND_MAKE_MEM_UNDEFINED((void *)((uintptr_t)chunk + + (run_ind << LG_PAGE)), (need_pages << LG_PAGE)); } - VALGRIND_MAKE_MEM_UNDEFINED((void *)((uintptr_t)chunk + (run_ind << - LG_PAGE)), (need_pages << LG_PAGE)); } static arena_chunk_t * @@ -569,17 +582,24 @@ arena_chunk_alloc(arena_t *arena) * unless the chunk is not zeroed. */ if (zero == false) { + VALGRIND_MAKE_MEM_UNDEFINED( + (void *)arena_mapp_get(chunk, map_bias+1), + (size_t)((uintptr_t) arena_mapp_get(chunk, + chunk_npages-1) - (uintptr_t)arena_mapp_get(chunk, + map_bias+1))); for (i = map_bias+1; i < chunk_npages-1; i++) arena_mapbits_unzeroed_set(chunk, i, unzeroed); - } else if (config_debug) { + } else { VALGRIND_MAKE_MEM_DEFINED( (void *)arena_mapp_get(chunk, map_bias+1), - (void *)((uintptr_t) - arena_mapp_get(chunk, chunk_npages-1) - - (uintptr_t)arena_mapp_get(chunk, map_bias+1))); - for (i = map_bias+1; i < chunk_npages-1; i++) { - assert(arena_mapbits_unzeroed_get(chunk, i) == - unzeroed); + (size_t)((uintptr_t) arena_mapp_get(chunk, + chunk_npages-1) - (uintptr_t)arena_mapp_get(chunk, + map_bias+1))); + if (config_debug) { + for (i = map_bias+1; i < chunk_npages-1; i++) { + assert(arena_mapbits_unzeroed_get(chunk, + i) == unzeroed); + } } } arena_mapbits_unallocated_set(chunk, chunk_npages-1, @@ -1458,6 +1478,7 @@ arena_malloc_small(arena_t *arena, size_ } else if (opt_zero) memset(ret, 0, size); } + VALGRIND_MAKE_MEM_UNDEFINED(ret, size); } else { if (config_fill && opt_junk) { arena_alloc_junk_small(ret, &arena_bin_info[binind], @@ -1466,7 +1487,6 @@ arena_malloc_small(arena_t *arena, size_ VALGRIND_MAKE_MEM_UNDEFINED(ret, size); memset(ret, 0, size); } - VALGRIND_MAKE_MEM_UNDEFINED(ret, size); return (ret); } Modified: head/contrib/jemalloc/src/chunk.c ============================================================================== --- head/contrib/jemalloc/src/chunk.c Mon Oct 21 04:15:55 2013 (r256822) +++ head/contrib/jemalloc/src/chunk.c Mon Oct 21 05:10:46 2013 (r256823) @@ -294,7 +294,7 @@ label_return: if (xnode != NULL) base_node_dealloc(xnode); if (xprev != NULL) - base_node_dealloc(prev); + base_node_dealloc(xprev); } void Modified: head/contrib/jemalloc/src/ctl.c ============================================================================== --- head/contrib/jemalloc/src/ctl.c Mon Oct 21 04:15:55 2013 (r256822) +++ head/contrib/jemalloc/src/ctl.c Mon Oct 21 05:10:46 2013 (r256823) @@ -546,43 +546,30 @@ ctl_arena_refresh(arena_t *arena, unsign static bool ctl_grow(void) { - size_t astats_size; ctl_arena_stats_t *astats; arena_t **tarenas; - /* Extend arena stats and arenas arrays. */ - astats_size = (ctl_stats.narenas + 2) * sizeof(ctl_arena_stats_t); - if (ctl_stats.narenas == narenas_auto) { - /* ctl_stats.arenas and arenas came from base_alloc(). */ - astats = (ctl_arena_stats_t *)imalloc(astats_size); - if (astats == NULL) - return (true); - memcpy(astats, ctl_stats.arenas, (ctl_stats.narenas + 1) * - sizeof(ctl_arena_stats_t)); - - tarenas = (arena_t **)imalloc((ctl_stats.narenas + 1) * - sizeof(arena_t *)); - if (tarenas == NULL) { - idalloc(astats); - return (true); - } - memcpy(tarenas, arenas, ctl_stats.narenas * sizeof(arena_t *)); - } else { - astats = (ctl_arena_stats_t *)iralloc(ctl_stats.arenas, - astats_size, 0, 0, false, false); - if (astats == NULL) - return (true); - - tarenas = (arena_t **)iralloc(arenas, (ctl_stats.narenas + 1) * - sizeof(arena_t *), 0, 0, false, false); - if (tarenas == NULL) - return (true); + /* Allocate extended arena stats and arenas arrays. */ + astats = (ctl_arena_stats_t *)imalloc((ctl_stats.narenas + 2) * + sizeof(ctl_arena_stats_t)); + if (astats == NULL) + return (true); + tarenas = (arena_t **)imalloc((ctl_stats.narenas + 1) * + sizeof(arena_t *)); + if (tarenas == NULL) { + idalloc(astats); + return (true); } - /* Initialize the new astats and arenas elements. */ + + /* Initialize the new astats element. */ + memcpy(astats, ctl_stats.arenas, (ctl_stats.narenas + 1) * + sizeof(ctl_arena_stats_t)); memset(&astats[ctl_stats.narenas + 1], 0, sizeof(ctl_arena_stats_t)); - if (ctl_arena_init(&astats[ctl_stats.narenas + 1])) + if (ctl_arena_init(&astats[ctl_stats.narenas + 1])) { + idalloc(tarenas); + idalloc(astats); return (true); - tarenas[ctl_stats.narenas] = NULL; + } /* Swap merged stats to their new location. */ { ctl_arena_stats_t tstats; @@ -593,13 +580,34 @@ ctl_grow(void) memcpy(&astats[ctl_stats.narenas + 1], &tstats, sizeof(ctl_arena_stats_t)); } + /* Initialize the new arenas element. */ + tarenas[ctl_stats.narenas] = NULL; + { + arena_t **arenas_old = arenas; + /* + * Swap extended arenas array into place. Although ctl_mtx + * protects this function from other threads extending the + * array, it does not protect from other threads mutating it + * (i.e. initializing arenas and setting array elements to + * point to them). Therefore, array copying must happen under + * the protection of arenas_lock. + */ + malloc_mutex_lock(&arenas_lock); + arenas = tarenas; + memcpy(arenas, arenas_old, ctl_stats.narenas * + sizeof(arena_t *)); + narenas_total++; + arenas_extend(narenas_total - 1); + malloc_mutex_unlock(&arenas_lock); + /* + * Deallocate arenas_old only if it came from imalloc() (not + * base_alloc()). + */ + if (ctl_stats.narenas != narenas_auto) + idalloc(arenas_old); + } ctl_stats.arenas = astats; ctl_stats.narenas++; - malloc_mutex_lock(&arenas_lock); - arenas = tarenas; - narenas_total++; - arenas_extend(narenas_total - 1); - malloc_mutex_unlock(&arenas_lock); return (false); } @@ -1109,7 +1117,7 @@ epoch_ctl(const size_t *mib, size_t mibl void *newp, size_t newlen) { int ret; - uint64_t newval; + UNUSED uint64_t newval; malloc_mutex_lock(&ctl_mtx); WRITE(newval, uint64_t); Modified: head/contrib/jemalloc/src/jemalloc.c ============================================================================== --- head/contrib/jemalloc/src/jemalloc.c Mon Oct 21 04:15:55 2013 (r256822) +++ head/contrib/jemalloc/src/jemalloc.c Mon Oct 21 05:10:46 2013 (r256823) @@ -286,7 +286,7 @@ arenas_cleanup(void *arg) malloc_mutex_unlock(&arenas_lock); } -static JEMALLOC_ATTR(always_inline) void +JEMALLOC_ALWAYS_INLINE_C void malloc_thread_init(void) { @@ -303,7 +303,7 @@ malloc_thread_init(void) quarantine_alloc_hook(); } -static JEMALLOC_ATTR(always_inline) bool +JEMALLOC_ALWAYS_INLINE_C bool malloc_init(void) { @@ -440,8 +440,9 @@ malloc_conf_init(void) } break; case 1: { + int linklen = 0; #ifndef _WIN32 - int linklen; + int saved_errno = errno; const char *linkname = # ifdef JEMALLOC_PREFIX "/etc/"JEMALLOC_PREFIX"malloc.conf" @@ -450,21 +451,20 @@ malloc_conf_init(void) # endif ; - if ((linklen = readlink(linkname, buf, - sizeof(buf) - 1)) != -1) { - /* - * Use the contents of the "/etc/malloc.conf" - * symbolic link's name. - */ - buf[linklen] = '\0'; - opts = buf; - } else -#endif - { + /* + * Try to use the contents of the "/etc/malloc.conf" + * symbolic link's name. + */ + linklen = readlink(linkname, buf, sizeof(buf) - 1); + if (linklen == -1) { /* No configuration specified. */ - buf[0] = '\0'; - opts = buf; + linklen = 0; + /* restore errno */ + set_errno(saved_errno); } +#endif + buf[linklen] = '\0'; + opts = buf; break; } case 2: { const char *envname = @@ -1407,7 +1407,7 @@ je_mallctlbymib(const size_t *mib, size_ */ #ifdef JEMALLOC_EXPERIMENTAL -static JEMALLOC_ATTR(always_inline) void * +JEMALLOC_ALWAYS_INLINE_C void * iallocm(size_t usize, size_t alignment, bool zero, bool try_tcache, arena_t *arena) { From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 05:14:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 68599714; Mon, 21 Oct 2013 05:14:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 56F022A38; Mon, 21 Oct 2013 05:14:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L5E1Lt036373; Mon, 21 Oct 2013 05:14:01 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L5E1Gx036372; Mon, 21 Oct 2013 05:14:01 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310210514.r9L5E1Gx036372@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 21 Oct 2013 05:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256824 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 05:14:01 -0000 Author: glebius Date: Mon Oct 21 05:14:00 2013 New Revision: 256824 URL: http://svnweb.freebsd.org/changeset/base/256824 Log: Provide a working example line for an interface with 1 address running with CARP. Currently, we've got a problem that interface isn't IFF_UP at the time we assign it a redundant address, and the latter gets stuck in INIT state. Additional SIOCSIFFLAGS from ifconfig(8) kicks it to a working state. A proper fix is kernel side and appeared to be non-trivial, not to be checked in before 10.0-RELEASE. Submitted by: Ole Myhre Modified: head/sbin/ifconfig/ifconfig.8 Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Mon Oct 21 05:10:46 2013 (r256823) +++ head/sbin/ifconfig/ifconfig.8 Mon Oct 21 05:14:00 2013 (r256824) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd January 10, 2013 +.Dd October 21, 2013 .Dt IFCONFIG 8 .Os .Sh NAME @@ -2690,7 +2690,7 @@ as a synonym for the canonical form of t .Pp Configure a single CARP redundant address on igb0, and then switch it to be master: -.Dl # ifconfig igb0 vhid 1 10.0.0.1/24 pass foobar +.Dl # ifconfig igb0 vhid 1 10.0.0.1/24 pass foobar up .Dl # ifconfig igb0 vhid 1 state master .Pp Configure the interface From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 05:57:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8A291D79; Mon, 21 Oct 2013 05:57:37 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 755052BFD; Mon, 21 Oct 2013 05:57:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L5vbEf058800; Mon, 21 Oct 2013 05:57:37 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L5vbcN058799; Mon, 21 Oct 2013 05:57:37 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201310210557.r9L5vbcN058799@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 21 Oct 2013 05:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256825 - stable/9/sys/dev/nfe X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 05:57:37 -0000 Author: yongari Date: Mon Oct 21 05:57:36 2013 New Revision: 256825 URL: http://svnweb.freebsd.org/changeset/base/256825 Log: MFC r256038: Fix clearing MAC stats registers. Previously it cleared every fourth register. Submitted by: Paul A. Patience Modified: stable/9/sys/dev/nfe/if_nfe.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/nfe/if_nfe.c ============================================================================== --- stable/9/sys/dev/nfe/if_nfe.c Mon Oct 21 05:14:00 2013 (r256824) +++ stable/9/sys/dev/nfe/if_nfe.c Mon Oct 21 05:57:36 2013 (r256825) @@ -3206,8 +3206,8 @@ nfe_stats_clear(struct nfe_softc *sc) else return; - for (i = 0; i < mib_cnt; i += sizeof(uint32_t)) - NFE_READ(sc, NFE_TX_OCTET + i); + for (i = 0; i < mib_cnt; i++) + NFE_READ(sc, NFE_TX_OCTET + i * sizeof(uint32_t)); if ((sc->nfe_flags & NFE_MIB_V3) != 0) { NFE_READ(sc, NFE_TX_UNICAST); From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 06:04:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7738F1AE; Mon, 21 Oct 2013 06:04:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 565A52C52; Mon, 21 Oct 2013 06:04:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L64fnx063237; Mon, 21 Oct 2013 06:04:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L64edC063231; Mon, 21 Oct 2013 06:04:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310210604.r9L64edC063231@svn.freebsd.org> From: Alexander Motin Date: Mon, 21 Oct 2013 06:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256826 - in head/sys/dev: aic7xxx firewire isp mpt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 06:04:41 -0000 Author: mav Date: Mon Oct 21 06:04:39 2013 New Revision: 256826 URL: http://svnweb.freebsd.org/changeset/base/256826 Log: Partial MFproject/camlock r256671: Fix several target mode SIMs to not blindly clear ccb_h.flags field of ATIO CCBs. Not all CCB flags there belong to them. Modified: head/sys/dev/aic7xxx/aic79xx.c head/sys/dev/aic7xxx/aic7xxx.c head/sys/dev/firewire/sbp_targ.c head/sys/dev/isp/isp_freebsd.c head/sys/dev/mpt/mpt_cam.c Modified: head/sys/dev/aic7xxx/aic79xx.c ============================================================================== --- head/sys/dev/aic7xxx/aic79xx.c Mon Oct 21 05:57:36 2013 (r256825) +++ head/sys/dev/aic7xxx/aic79xx.c Mon Oct 21 06:04:39 2013 (r256826) @@ -10343,9 +10343,9 @@ ahd_handle_target_cmd(struct ahd_softc * /* Tag was included */ atio->tag_action = *byte++; atio->tag_id = *byte++; - atio->ccb_h.flags = CAM_TAG_ACTION_VALID; + atio->ccb_h.flags |= CAM_TAG_ACTION_VALID; } else { - atio->ccb_h.flags = 0; + atio->ccb_h.flags &= ~CAM_TAG_ACTION_VALID; } byte++; Modified: head/sys/dev/aic7xxx/aic7xxx.c ============================================================================== --- head/sys/dev/aic7xxx/aic7xxx.c Mon Oct 21 05:57:36 2013 (r256825) +++ head/sys/dev/aic7xxx/aic7xxx.c Mon Oct 21 06:04:39 2013 (r256826) @@ -7843,9 +7843,9 @@ ahc_handle_target_cmd(struct ahc_softc * /* Tag was included */ atio->tag_action = *byte++; atio->tag_id = *byte++; - atio->ccb_h.flags = CAM_TAG_ACTION_VALID; + atio->ccb_h.flags |= CAM_TAG_ACTION_VALID; } else { - atio->ccb_h.flags = 0; + atio->ccb_h.flags &= ~CAM_TAG_ACTION_VALID; } byte++; Modified: head/sys/dev/firewire/sbp_targ.c ============================================================================== --- head/sys/dev/firewire/sbp_targ.c Mon Oct 21 05:57:36 2013 (r256825) +++ head/sys/dev/firewire/sbp_targ.c Mon Oct 21 06:04:39 2013 (r256826) @@ -1483,7 +1483,7 @@ sbp_targ_cmd_handler(struct fw_xfer *xfe atio->tag_id = orbi->orb_lo; atio->init_id = orbi->login->id; - atio->ccb_h.flags = CAM_TAG_ACTION_VALID; + atio->ccb_h.flags |= CAM_TAG_ACTION_VALID; bytes = (u_char *)&orb[5]; if (debug) printf("%s: %p %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Mon Oct 21 05:57:36 2013 (r256825) +++ head/sys/dev/isp/isp_freebsd.c Mon Oct 21 06:04:39 2013 (r256826) @@ -2286,9 +2286,9 @@ isp_handle_platform_atio(ispsoftc_t *isp atiop->ccb_h.target_id = aep->at_tgt; atiop->ccb_h.target_lun = aep->at_lun; if (aep->at_flags & AT_NODISC) { - atiop->ccb_h.flags = CAM_DIS_DISCONNECT; + atiop->ccb_h.flags |= CAM_DIS_DISCONNECT; } else { - atiop->ccb_h.flags = 0; + atiop->ccb_h.flags &= ~CAM_DIS_DISCONNECT; } if (status & QLTM_SVALID) { @@ -2456,15 +2456,15 @@ isp_handle_platform_atio2(ispsoftc_t *is atiop->tag_id = atp->tag; switch (aep->at_taskflags & ATIO2_TC_ATTR_MASK) { case ATIO2_TC_ATTR_SIMPLEQ: - atiop->ccb_h.flags = CAM_TAG_ACTION_VALID; + atiop->ccb_h.flags |= CAM_TAG_ACTION_VALID; atiop->tag_action = MSG_SIMPLE_Q_TAG; break; case ATIO2_TC_ATTR_HEADOFQ: - atiop->ccb_h.flags = CAM_TAG_ACTION_VALID; + atiop->ccb_h.flags |= CAM_TAG_ACTION_VALID; atiop->tag_action = MSG_HEAD_OF_Q_TAG; break; case ATIO2_TC_ATTR_ORDERED: - atiop->ccb_h.flags = CAM_TAG_ACTION_VALID; + atiop->ccb_h.flags |= CAM_TAG_ACTION_VALID; atiop->tag_action = MSG_ORDERED_Q_TAG; break; case ATIO2_TC_ATTR_ACAQ: /* ?? */ @@ -2676,15 +2676,15 @@ isp_handle_platform_atio7(ispsoftc_t *is atiop->tag_id = atp->tag; switch (aep->at_cmnd.fcp_cmnd_task_attribute & FCP_CMND_TASK_ATTR_MASK) { case FCP_CMND_TASK_ATTR_SIMPLE: - atiop->ccb_h.flags = CAM_TAG_ACTION_VALID; + atiop->ccb_h.flags |= CAM_TAG_ACTION_VALID; atiop->tag_action = MSG_SIMPLE_Q_TAG; break; case FCP_CMND_TASK_ATTR_HEAD: - atiop->ccb_h.flags = CAM_TAG_ACTION_VALID; + atiop->ccb_h.flags |= CAM_TAG_ACTION_VALID; atiop->tag_action = MSG_HEAD_OF_Q_TAG; break; case FCP_CMND_TASK_ATTR_ORDERED: - atiop->ccb_h.flags = CAM_TAG_ACTION_VALID; + atiop->ccb_h.flags |= CAM_TAG_ACTION_VALID; atiop->tag_action = MSG_ORDERED_Q_TAG; break; default: @@ -5004,7 +5004,6 @@ isp_action(struct cam_sim *sim, union cc } ccb->ccb_h.spriv_field0 = 0; ccb->ccb_h.spriv_ptr1 = isp; - ccb->ccb_h.flags = 0; if (ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) { if (ccb->atio.tag_id) { Modified: head/sys/dev/mpt/mpt_cam.c ============================================================================== --- head/sys/dev/mpt/mpt_cam.c Mon Oct 21 05:57:36 2013 (r256825) +++ head/sys/dev/mpt/mpt_cam.c Mon Oct 21 06:04:39 2013 (r256826) @@ -3683,7 +3683,6 @@ mpt_action(struct cam_sim *sim, union cc lun_id_t lun = ccb->ccb_h.target_lun; ccb->ccb_h.sim_priv.entries[0].field = 0; ccb->ccb_h.sim_priv.entries[1].ptr = mpt; - ccb->ccb_h.flags = 0; if (lun == CAM_LUN_WILDCARD) { if (ccb->ccb_h.target_id != CAM_TARGET_WILDCARD) { @@ -5156,7 +5155,7 @@ mpt_scsi_tgt_atio(struct mpt_softc *mpt, tgt->tag_id = atiop->tag_id; if (tag_action) { atiop->tag_action = tag_action; - atiop->ccb_h.flags = CAM_TAG_ACTION_VALID; + atiop->ccb_h.flags |= CAM_TAG_ACTION_VALID; } if (mpt->verbose >= MPT_PRT_DEBUG) { int i; From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 06:22:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 34BDC442; Mon, 21 Oct 2013 06:22:21 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 20C712D32; Mon, 21 Oct 2013 06:22:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L6MKge073738; Mon, 21 Oct 2013 06:22:20 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L6MKpK073732; Mon, 21 Oct 2013 06:22:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201310210622.r9L6MKpK073732@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 21 Oct 2013 06:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256827 - in head/sys: dev/re pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 06:22:21 -0000 Author: yongari Date: Mon Oct 21 06:22:20 2013 New Revision: 256827 URL: http://svnweb.freebsd.org/changeset/base/256827 Log: Correct MAC revision bits. Previously it always cleared bit 20 and bit 21. Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Mon Oct 21 06:04:39 2013 (r256826) +++ head/sys/dev/re/if_re.c Mon Oct 21 06:22:20 2013 (r256827) @@ -1367,10 +1367,11 @@ re_attach(device_t dev) break; default: device_printf(dev, "Chip rev. 0x%08x\n", hwrev & 0x7c800000); + sc->rl_macrev = hwrev & 0x00700000; hwrev &= RL_TXCFG_HWREV; break; } - device_printf(dev, "MAC rev. 0x%08x\n", hwrev & 0x00700000); + device_printf(dev, "MAC rev. 0x%08x\n", sc->rl_macrev); while (hw_rev->rl_desc != NULL) { if (hw_rev->rl_rev == hwrev) { sc->rl_type = hw_rev->rl_type; @@ -1429,7 +1430,7 @@ re_attach(device_t dev) sc->rl_flags |= RL_FLAG_MACSLEEP; /* FALLTHROUGH */ case RL_HWREV_8168C: - if ((hwrev & 0x00700000) == 0x00200000) + if (sc->rl_macrev == 0x00200000) sc->rl_flags |= RL_FLAG_MACSLEEP; /* FALLTHROUGH */ case RL_HWREV_8168CP: Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Mon Oct 21 06:04:39 2013 (r256826) +++ head/sys/pci/if_rlreg.h Mon Oct 21 06:22:20 2013 (r256827) @@ -877,6 +877,7 @@ struct rl_softc { bus_dma_tag_t rl_parent_tag; uint8_t rl_type; const struct rl_hwrev *rl_hwrev; + uint32_t rl_macrev; int rl_eecmd_read; int rl_eewidth; int rl_expcap; From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 06:27:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C74A46C4; Mon, 21 Oct 2013 06:27:20 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B4A172D69; Mon, 21 Oct 2013 06:27:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L6RKK3075215; Mon, 21 Oct 2013 06:27:20 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L6RKja075213; Mon, 21 Oct 2013 06:27:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201310210627.r9L6RKja075213@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 21 Oct 2013 06:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256828 - in head/sys: dev/re pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 06:27:20 -0000 Author: yongari Date: Mon Oct 21 06:27:20 2013 New Revision: 256828 URL: http://svnweb.freebsd.org/changeset/base/256828 Log: Add preliminary support for RTL8106E PCIe FastEthernet. H/W donated by: RealTek Semiconductor Corp. Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Mon Oct 21 06:22:20 2013 (r256827) +++ head/sys/dev/re/if_re.c Mon Oct 21 06:27:20 2013 (r256828) @@ -223,6 +223,7 @@ static const struct rl_hwrev re_hwrevs[] { RL_HWREV_8402, RL_8169, "8402", RL_MTU }, { RL_HWREV_8105E, RL_8169, "8105E", RL_MTU }, { RL_HWREV_8105E_SPIN1, RL_8169, "8105E", RL_MTU }, + { RL_HWREV_8106E, RL_8169, "8106E", RL_MTU }, { RL_HWREV_8168B_SPIN2, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168B_SPIN3, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168C, RL_8169, "8168C/8111C", RL_JUMBO_MTU_6K }, @@ -1409,6 +1410,7 @@ re_attach(device_t dev) case RL_HWREV_8401E: case RL_HWREV_8105E: case RL_HWREV_8105E_SPIN1: + case RL_HWREV_8106E: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD; Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Mon Oct 21 06:22:20 2013 (r256827) +++ head/sys/pci/if_rlreg.h Mon Oct 21 06:27:20 2013 (r256828) @@ -189,6 +189,7 @@ #define RL_HWREV_8105E 0x40800000 #define RL_HWREV_8105E_SPIN1 0x40C00000 #define RL_HWREV_8402 0x44000000 +#define RL_HWREV_8106E 0x44800000 #define RL_HWREV_8168F 0x48000000 #define RL_HWREV_8411 0x48800000 #define RL_HWREV_8139 0x60000000 From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 06:31:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F2C3E8A0; Mon, 21 Oct 2013 06:31:56 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF2902DB9; Mon, 21 Oct 2013 06:31:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L6VuAn078677; Mon, 21 Oct 2013 06:31:56 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L6Vuj7078674; Mon, 21 Oct 2013 06:31:56 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201310210631.r9L6Vuj7078674@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 21 Oct 2013 06:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256829 - stable/10/sys/contrib/rdma/krping X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 06:31:57 -0000 Author: np Date: Mon Oct 21 06:31:56 2013 New Revision: 256829 URL: http://svnweb.freebsd.org/changeset/base/256829 Log: MFC r256470: Update krping to the latest upstream code. Move all the FreeBSD specific parts to krping_dev.c, which leaves the other files as close to their upstream versions as possible. Approved by: re (glebius) Modified: stable/10/sys/contrib/rdma/krping/getopt.c stable/10/sys/contrib/rdma/krping/krping.c stable/10/sys/contrib/rdma/krping/krping.h stable/10/sys/contrib/rdma/krping/krping_dev.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/contrib/rdma/krping/getopt.c ============================================================================== --- stable/10/sys/contrib/rdma/krping/getopt.c Mon Oct 21 06:27:20 2013 (r256828) +++ stable/10/sys/contrib/rdma/krping/getopt.c Mon Oct 21 06:31:56 2013 (r256829) @@ -5,9 +5,10 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include +#include +#include +#include + #include "getopt.h" /** @@ -49,29 +50,29 @@ int krping_getopt(const char *caller, ch if (opts->has_arg & OPT_NOPARAM) { return opts->val; } - printf("%s: the %s option requires " + printk(KERN_INFO "%s: the %s option requires " "an argument\n", caller, token); return -EINVAL; } if (opts->has_arg & OPT_INT) { char* v; - *value = strtoul(val, &v, 0); + *value = simple_strtoul(val, &v, 0); if (!*v) { return opts->val; } - printf("%s: invalid numeric value " + printk(KERN_INFO "%s: invalid numeric value " "in %s=%s\n", caller, token, val); return -EDOM; } if (opts->has_arg & OPT_STRING) { return opts->val; } - printf("%s: unexpected argument %s to the " + printk(KERN_INFO "%s: unexpected argument %s to the " "%s option\n", caller, val, token); return -EINVAL; } } - printf("%s: Unrecognized option %s\n", caller, token); + printk(KERN_INFO "%s: Unrecognized option %s\n", caller, token); return -EOPNOTSUPP; } Modified: stable/10/sys/contrib/rdma/krping/krping.c ============================================================================== --- stable/10/sys/contrib/rdma/krping/krping.c Mon Oct 21 06:27:20 2013 (r256828) +++ stable/10/sys/contrib/rdma/krping/krping.c Mon Oct 21 06:31:56 2013 (r256829) @@ -1,6 +1,6 @@ /* * Copyright (c) 2005 Ammasso, Inc. All rights reserved. - * Copyright (c) 2006 Open Grid Computing, Inc. All rights reserved. + * Copyright (c) 2006-2009 Open Grid Computing, Inc. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -34,39 +34,52 @@ #include __FBSDID("$FreeBSD$"); -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include +#include -#include -#include - -#include +#include #include -#include "getopt.h" #include "krping.h" +#include "getopt.h" -#define PFX "krping: " +extern int krping_debug; +#define DEBUG_LOG(cb, x...) if (krping_debug) krping_printf((cb)->cookie, x) +#define PRINTF(cb, x...) krping_printf((cb)->cookie, x) -static int debug = 0; -#define DEBUG_LOG if (debug) printf +MODULE_AUTHOR("Steve Wise"); +MODULE_DESCRIPTION("RDMA ping client/server"); +MODULE_LICENSE("Dual BSD/GPL"); + +static __inline uint64_t +get_cycles(void) +{ + uint32_t low, high; + __asm __volatile("rdtsc" : "=a" (low), "=d" (high)); + return (low | ((u_int64_t)high << 32)); +} + +typedef uint64_t cycles_t; + +enum mem_type { + DMA = 1, + FASTREG = 2, + MW = 3, + MR = 4 +}; static const struct krping_option krping_opts[] = { {"count", OPT_INT, 'C'}, @@ -77,23 +90,29 @@ static const struct krping_option krping {"validate", OPT_NOPARAM, 'V'}, {"server", OPT_NOPARAM, 's'}, {"client", OPT_NOPARAM, 'c'}, - {"dmamr", OPT_NOPARAM, 'D'}, - {"debug", OPT_NOPARAM, 'd'}, - {"wlat", OPT_NOPARAM, 'l'}, - {"rlat", OPT_NOPARAM, 'L'}, - {"bw", OPT_NOPARAM, 'B'}, - {"tx-depth", OPT_INT, 't'}, - {"poll", OPT_NOPARAM, 'P'}, - {"memlimit", OPT_INT, 'm'}, + {"mem_mode", OPT_STRING, 'm'}, + {"server_inv", OPT_NOPARAM, 'I'}, + {"wlat", OPT_NOPARAM, 'l'}, + {"rlat", OPT_NOPARAM, 'L'}, + {"bw", OPT_NOPARAM, 'B'}, + {"duplex", OPT_NOPARAM, 'd'}, + {"txdepth", OPT_INT, 'T'}, + {"poll", OPT_NOPARAM, 'P'}, + {"local_dma_lkey", OPT_NOPARAM, 'Z'}, + {"read_inv", OPT_NOPARAM, 'R'}, + {"fr", OPT_NOPARAM, 'f'}, {NULL, 0, 0} }; -struct mtx krping_mutex; +#define htonll(x) cpu_to_be64((x)) +#define ntohll(x) cpu_to_be64((x)) + +static struct mutex krping_mutex; /* * List of running krping threads. */ -struct krping_cb_list krping_cbs; +static LIST_HEAD(krping_cbs); /* * krping "ping/pong" loop: @@ -109,24 +128,118 @@ struct krping_cb_list krping_cbs; */ /* + * These states are used to signal events between the completion handler + * and the main client or server thread. + * + * Once CONNECTED, they cycle through RDMA_READ_ADV, RDMA_WRITE_ADV, + * and RDMA_WRITE_COMPLETE for each ping. + */ +enum test_state { + IDLE = 1, + CONNECT_REQUEST, + ADDR_RESOLVED, + ROUTE_RESOLVED, + CONNECTED, + RDMA_READ_ADV, + RDMA_READ_COMPLETE, + RDMA_WRITE_ADV, + RDMA_WRITE_COMPLETE, + ERROR +}; + +struct krping_rdma_info { + uint64_t buf; + uint32_t rkey; + uint32_t size; +}; + +/* * Default max buffer size for IO... */ #define RPING_BUFSIZE 128*1024 -#define RPING_SQ_DEPTH 32 +#define RPING_SQ_DEPTH 64 -static void krping_wait(struct krping_cb *cb, int state) -{ - int rc; - mtx_lock(&cb->lock); - while (cb->state < state) { - rc = msleep(cb, &cb->lock, PCATCH, "krping", 0); - if (rc && rc != ERESTART) { - cb->state = ERROR; - break; - } - } - mtx_unlock(&cb->lock); -} +/* + * Control block struct. + */ +struct krping_cb { + void *cookie; + int server; /* 0 iff client */ + struct ib_cq *cq; + struct ib_pd *pd; + struct ib_qp *qp; + + enum mem_type mem; + struct ib_mr *dma_mr; + + struct ib_fast_reg_page_list *page_list; + int page_list_len; + struct ib_send_wr fastreg_wr; + struct ib_send_wr invalidate_wr; + struct ib_mr *fastreg_mr; + int server_invalidate; + int read_inv; + u8 key; + + struct ib_mw *mw; + struct ib_mw_bind bind_attr; + + struct ib_recv_wr rq_wr; /* recv work request record */ + struct ib_sge recv_sgl; /* recv single SGE */ + struct krping_rdma_info recv_buf;/* malloc'd buffer */ + u64 recv_dma_addr; + DECLARE_PCI_UNMAP_ADDR(recv_mapping) + struct ib_mr *recv_mr; + + struct ib_send_wr sq_wr; /* send work requrest record */ + struct ib_sge send_sgl; + struct krping_rdma_info send_buf;/* single send buf */ + u64 send_dma_addr; + DECLARE_PCI_UNMAP_ADDR(send_mapping) + struct ib_mr *send_mr; + + struct ib_send_wr rdma_sq_wr; /* rdma work request record */ + struct ib_sge rdma_sgl; /* rdma single SGE */ + char *rdma_buf; /* used as rdma sink */ + u64 rdma_dma_addr; + DECLARE_PCI_UNMAP_ADDR(rdma_mapping) + struct ib_mr *rdma_mr; + + uint32_t remote_rkey; /* remote guys RKEY */ + uint64_t remote_addr; /* remote guys TO */ + uint32_t remote_len; /* remote guys LEN */ + + char *start_buf; /* rdma read src */ + u64 start_dma_addr; + DECLARE_PCI_UNMAP_ADDR(start_mapping) + struct ib_mr *start_mr; + + enum test_state state; /* used for cond/signalling */ + wait_queue_head_t sem; + struct krping_stats stats; + + uint16_t port; /* dst port in NBO */ + struct in_addr addr; /* dst addr in NBO */ + char *addr_str; /* dst addr string */ + int verbose; /* verbose logging */ + int count; /* ping count */ + int size; /* ping data size */ + int validate; /* validate ping data */ + int wlat; /* run wlat test */ + int rlat; /* run rlat test */ + int bw; /* run bw test */ + int duplex; /* run bw full duplex test */ + int poll; /* poll or block for rlat test */ + int txdepth; /* SQ depth */ + int local_dma_lkey; /* use 0 for lkey */ + int frtest; /* fastreg test */ + + /* CM stuff */ + struct rdma_cm_id *cm_id; /* connection on client side,*/ + /* listener on server side. */ + struct rdma_cm_id *child_cm_id; /* connection on server side */ + struct list_head list; +}; static int krping_cma_event_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) @@ -134,39 +247,37 @@ static int krping_cma_event_handler(stru int ret; struct krping_cb *cb = cma_id->context; - DEBUG_LOG(PFX "cma_event type %d cma_id %p (%s)\n", event->event, cma_id, - (cma_id == cb->cm_id) ? "parent" : "child"); + DEBUG_LOG(cb, "cma_event type %d cma_id %p (%s)\n", event->event, + cma_id, (cma_id == cb->cm_id) ? "parent" : "child"); - mtx_lock(&cb->lock); switch (event->event) { case RDMA_CM_EVENT_ADDR_RESOLVED: cb->state = ADDR_RESOLVED; ret = rdma_resolve_route(cma_id, 2000); if (ret) { - log(LOG_ERR, "rdma_resolve_route error %d\n", - ret); - wakeup(cb); + PRINTF(cb, "rdma_resolve_route error %d\n", ret); + wake_up_interruptible(&cb->sem); } break; case RDMA_CM_EVENT_ROUTE_RESOLVED: cb->state = ROUTE_RESOLVED; - wakeup(cb); + wake_up_interruptible(&cb->sem); break; case RDMA_CM_EVENT_CONNECT_REQUEST: cb->state = CONNECT_REQUEST; cb->child_cm_id = cma_id; - DEBUG_LOG(PFX "child cma %p\n", cb->child_cm_id); - wakeup(cb); + DEBUG_LOG(cb, "child cma %p\n", cb->child_cm_id); + wake_up_interruptible(&cb->sem); break; case RDMA_CM_EVENT_ESTABLISHED: - DEBUG_LOG(PFX "ESTABLISHED\n"); + DEBUG_LOG(cb, "ESTABLISHED\n"); if (!cb->server) { cb->state = CONNECTED; - wakeup(cb); } + wake_up_interruptible(&cb->sem); break; case RDMA_CM_EVENT_ADDR_ERROR: @@ -174,40 +285,34 @@ static int krping_cma_event_handler(stru case RDMA_CM_EVENT_CONNECT_ERROR: case RDMA_CM_EVENT_UNREACHABLE: case RDMA_CM_EVENT_REJECTED: - log(LOG_ERR, "cma event %d, error %d\n", event->event, + PRINTF(cb, "cma event %d, error %d\n", event->event, event->status); cb->state = ERROR; - wakeup(cb); + wake_up_interruptible(&cb->sem); break; case RDMA_CM_EVENT_DISCONNECTED: - DEBUG_LOG(PFX "DISCONNECT EVENT...\n"); + PRINTF(cb, "DISCONNECT EVENT...\n"); cb->state = ERROR; - wakeup(cb); + wake_up_interruptible(&cb->sem); break; case RDMA_CM_EVENT_DEVICE_REMOVAL: - DEBUG_LOG(PFX "cma detected device removal!!!!\n"); - cb->state = ERROR; - wakeup(cb); - mtx_unlock(&cb->lock); - krping_wait(cb, CLEANUP); - tsleep(cb, 0, "krping", 5000); - return 0; + PRINTF(cb, "cma detected device removal!!!!\n"); + break; default: - log(LOG_ERR, "oof bad type!\n"); - wakeup(cb); + PRINTF(cb, "oof bad type!\n"); + wake_up_interruptible(&cb->sem); break; } - mtx_unlock(&cb->lock); return 0; } static int server_recv(struct krping_cb *cb, struct ib_wc *wc) { if (wc->byte_len != sizeof(cb->recv_buf)) { - log(LOG_ERR, "Received bogus data, size %d\n", + PRINTF(cb, "Received bogus data, size %d\n", wc->byte_len); return -1; } @@ -215,7 +320,7 @@ static int server_recv(struct krping_cb cb->remote_rkey = ntohl(cb->recv_buf.rkey); cb->remote_addr = ntohll(cb->recv_buf.buf); cb->remote_len = ntohl(cb->recv_buf.size); - DEBUG_LOG(PFX "Received rkey %x addr %llx len %d from peer\n", + DEBUG_LOG(cb, "Received rkey %x addr %llx len %d from peer\n", cb->remote_rkey, (unsigned long long)cb->remote_addr, cb->remote_len); @@ -230,7 +335,7 @@ static int server_recv(struct krping_cb static int client_recv(struct krping_cb *cb, struct ib_wc *wc) { if (wc->byte_len != sizeof(cb->recv_buf)) { - log(LOG_ERR, "Received bogus data, size %d\n", + PRINTF(cb, "Received bogus data, size %d\n", wc->byte_len); return -1; } @@ -250,11 +355,13 @@ static void krping_cq_event_handler(stru struct ib_recv_wr *bad_wr; int ret; - mtx_lock(&cb->lock); - KASSERT(cb->cq == cq, ("bad condition")); + BUG_ON(cb->cq != cq); if (cb->state == ERROR) { - log(LOG_ERR, "cq completion in ERROR state\n"); - mtx_unlock(&cb->lock); + PRINTF(cb, "cq completion in ERROR state\n"); + return; + } + if (cb->frtest) { + PRINTF(cb, "cq completion event in frtest!\n"); return; } if (!cb->wlat && !cb->rlat && !cb->bw) @@ -262,76 +369,77 @@ static void krping_cq_event_handler(stru while ((ret = ib_poll_cq(cb->cq, 1, &wc)) == 1) { if (wc.status) { if (wc.status == IB_WC_WR_FLUSH_ERR) { - DEBUG_LOG("cq flushed\n"); + DEBUG_LOG(cb, "cq flushed\n"); continue; } else { - log(LOG_CRIT, "cq completion failed status %d\n", - wc.status); + PRINTF(cb, "cq completion failed with " + "wr_id %Lx status %d opcode %d vender_err %x\n", + wc.wr_id, wc.status, wc.opcode, wc.vendor_err); goto error; } } switch (wc.opcode) { case IB_WC_SEND: - DEBUG_LOG(PFX "send completion\n"); + DEBUG_LOG(cb, "send completion\n"); cb->stats.send_bytes += cb->send_sgl.length; cb->stats.send_msgs++; break; case IB_WC_RDMA_WRITE: - DEBUG_LOG(PFX "rdma write completion\n"); + DEBUG_LOG(cb, "rdma write completion\n"); cb->stats.write_bytes += cb->rdma_sq_wr.sg_list->length; cb->stats.write_msgs++; cb->state = RDMA_WRITE_COMPLETE; - wakeup(cb); + wake_up_interruptible(&cb->sem); break; case IB_WC_RDMA_READ: - DEBUG_LOG(PFX "rdma read completion\n"); + DEBUG_LOG(cb, "rdma read completion\n"); cb->stats.read_bytes += cb->rdma_sq_wr.sg_list->length; cb->stats.read_msgs++; cb->state = RDMA_READ_COMPLETE; - wakeup(cb); + wake_up_interruptible(&cb->sem); break; case IB_WC_RECV: - DEBUG_LOG(PFX "recv completion\n"); + DEBUG_LOG(cb, "recv completion\n"); cb->stats.recv_bytes += sizeof(cb->recv_buf); cb->stats.recv_msgs++; if (cb->wlat || cb->rlat || cb->bw) ret = server_recv(cb, &wc); else ret = cb->server ? server_recv(cb, &wc) : - client_recv(cb, &wc); + client_recv(cb, &wc); if (ret) { - log(LOG_ERR, "recv wc error: %d\n", ret); + PRINTF(cb, "recv wc error: %d\n", ret); goto error; } ret = ib_post_recv(cb->qp, &cb->rq_wr, &bad_wr); if (ret) { - log(LOG_ERR, "post recv error: %d\n", + PRINTF(cb, "post recv error: %d\n", ret); goto error; } - wakeup(cb); + wake_up_interruptible(&cb->sem); break; default: - log(LOG_ERR, "unknown!!!!! completion\n"); + PRINTF(cb, + "%s:%d Unexpected opcode %d, Shutting down\n", + __func__, __LINE__, wc.opcode); goto error; } } if (ret) { - log(LOG_ERR, "poll error %d\n", ret); + PRINTF(cb, "poll error %d\n", ret); goto error; } - mtx_unlock(&cb->lock); return; error: cb->state = ERROR; - wakeup(cb); - mtx_unlock(&cb->lock); + wake_up_interruptible(&cb->sem); } static int krping_accept(struct krping_cb *cb) @@ -339,7 +447,7 @@ static int krping_accept(struct krping_c struct rdma_conn_param conn_param; int ret; - DEBUG_LOG(PFX "accepting client connection request\n"); + DEBUG_LOG(cb, "accepting client connection request\n"); memset(&conn_param, 0, sizeof conn_param); conn_param.responder_resources = 1; @@ -347,14 +455,15 @@ static int krping_accept(struct krping_c ret = rdma_accept(cb->child_cm_id, &conn_param); if (ret) { - log(LOG_ERR, "rdma_accept error: %d\n", ret); + PRINTF(cb, "rdma_accept error: %d\n", ret); return ret; } if (!cb->wlat && !cb->rlat && !cb->bw) { - krping_wait(cb, CONNECTED); + wait_event_interruptible(cb->sem, cb->state >= CONNECTED); if (cb->state == ERROR) { - log(LOG_ERR, "wait for CONNECTED state %d\n", cb->state); + PRINTF(cb, "wait for CONNECTED state %d\n", + cb->state); return -1; } } @@ -363,19 +472,22 @@ static int krping_accept(struct krping_c static void krping_setup_wr(struct krping_cb *cb) { - /* XXX X86 only here... not mapping for dma! */ - cb->recv_sgl.addr = vtophys(&cb->recv_buf); + cb->recv_sgl.addr = cb->recv_dma_addr; cb->recv_sgl.length = sizeof cb->recv_buf; - if (cb->use_dmamr) + if (cb->local_dma_lkey) + cb->recv_sgl.lkey = cb->qp->device->local_dma_lkey; + else if (cb->mem == DMA) cb->recv_sgl.lkey = cb->dma_mr->lkey; else cb->recv_sgl.lkey = cb->recv_mr->lkey; cb->rq_wr.sg_list = &cb->recv_sgl; cb->rq_wr.num_sge = 1; - cb->send_sgl.addr = vtophys(&cb->send_buf); + cb->send_sgl.addr = cb->send_dma_addr; cb->send_sgl.length = sizeof cb->send_buf; - if (cb->use_dmamr) + if (cb->local_dma_lkey) + cb->send_sgl.lkey = cb->qp->device->local_dma_lkey; + else if (cb->mem == DMA) cb->send_sgl.lkey = cb->dma_mr->lkey; else cb->send_sgl.lkey = cb->send_mr->lkey; @@ -385,18 +497,39 @@ static void krping_setup_wr(struct krpin cb->sq_wr.sg_list = &cb->send_sgl; cb->sq_wr.num_sge = 1; - cb->rdma_addr = vtophys(cb->rdma_buf); - cb->rdma_sgl.addr = cb->rdma_addr; - if (cb->use_dmamr) - cb->rdma_sgl.lkey = cb->dma_mr->lkey; - else - cb->rdma_sgl.lkey = cb->rdma_mr->lkey; - cb->rdma_sq_wr.send_flags = IB_SEND_SIGNALED; - cb->rdma_sq_wr.sg_list = &cb->rdma_sgl; - cb->rdma_sq_wr.num_sge = 1; + if (cb->server || cb->wlat || cb->rlat || cb->bw) { + cb->rdma_sgl.addr = cb->rdma_dma_addr; + if (cb->mem == MR) + cb->rdma_sgl.lkey = cb->rdma_mr->lkey; + cb->rdma_sq_wr.send_flags = IB_SEND_SIGNALED; + cb->rdma_sq_wr.sg_list = &cb->rdma_sgl; + cb->rdma_sq_wr.num_sge = 1; + } + + switch(cb->mem) { + case FASTREG: + + /* + * A chain of 2 WRs, INVALDATE_MR + FAST_REG_MR. + * both unsignaled. The client uses them to reregister + * the rdma buffers with a new key each iteration. + */ + cb->fastreg_wr.opcode = IB_WR_FAST_REG_MR; + cb->fastreg_wr.wr.fast_reg.page_shift = PAGE_SHIFT; + cb->fastreg_wr.wr.fast_reg.length = cb->size; + cb->fastreg_wr.wr.fast_reg.page_list = cb->page_list; + cb->fastreg_wr.wr.fast_reg.page_list_len = cb->page_list_len; - if (!cb->server || cb->wlat || cb->rlat || cb->bw) { - cb->start_addr = vtophys(cb->start_buf); + cb->invalidate_wr.next = &cb->fastreg_wr; + cb->invalidate_wr.opcode = IB_WR_LOCAL_INV; + break; + case MW: + cb->bind_attr.wr_id = 0xabbaabba; + cb->bind_attr.send_flags = 0; /* unsignaled */ + cb->bind_attr.length = cb->size; + break; + default: + break; } } @@ -406,134 +539,207 @@ static int krping_setup_buffers(struct k struct ib_phys_buf buf; u64 iovbase; - DEBUG_LOG(PFX "krping_setup_buffers called on cb %p\n", cb); + DEBUG_LOG(cb, "krping_setup_buffers called on cb %p\n", cb); + + cb->recv_dma_addr = dma_map_single(cb->pd->device->dma_device, + &cb->recv_buf, + sizeof(cb->recv_buf), DMA_BIDIRECTIONAL); + pci_unmap_addr_set(cb, recv_mapping, cb->recv_dma_addr); + cb->send_dma_addr = dma_map_single(cb->pd->device->dma_device, + &cb->send_buf, sizeof(cb->send_buf), + DMA_BIDIRECTIONAL); + pci_unmap_addr_set(cb, send_mapping, cb->send_dma_addr); - if (cb->use_dmamr) { + if (cb->mem == DMA) { cb->dma_mr = ib_get_dma_mr(cb->pd, IB_ACCESS_LOCAL_WRITE| IB_ACCESS_REMOTE_READ| IB_ACCESS_REMOTE_WRITE); if (IS_ERR(cb->dma_mr)) { - log(LOG_ERR, "reg_dmamr failed\n"); - return PTR_ERR(cb->dma_mr); + DEBUG_LOG(cb, "reg_dmamr failed\n"); + ret = PTR_ERR(cb->dma_mr); + goto bail; } } else { + if (!cb->local_dma_lkey) { + buf.addr = cb->recv_dma_addr; + buf.size = sizeof cb->recv_buf; + DEBUG_LOG(cb, "recv buf dma_addr %llx size %d\n", buf.addr, + (int)buf.size); + iovbase = cb->recv_dma_addr; + cb->recv_mr = ib_reg_phys_mr(cb->pd, &buf, 1, + IB_ACCESS_LOCAL_WRITE, + &iovbase); + + if (IS_ERR(cb->recv_mr)) { + DEBUG_LOG(cb, "recv_buf reg_mr failed\n"); + ret = PTR_ERR(cb->recv_mr); + goto bail; + } - buf.addr = vtophys(&cb->recv_buf); - buf.size = sizeof cb->recv_buf; - iovbase = vtophys(&cb->recv_buf); - cb->recv_mr = ib_reg_phys_mr(cb->pd, &buf, 1, - IB_ACCESS_LOCAL_WRITE, - &iovbase); - - if (IS_ERR(cb->recv_mr)) { - log(LOG_ERR, "recv_buf reg_mr failed\n"); - return PTR_ERR(cb->recv_mr); - } - - buf.addr = vtophys(&cb->send_buf); - buf.size = sizeof cb->send_buf; - iovbase = vtophys(&cb->send_buf); - cb->send_mr = ib_reg_phys_mr(cb->pd, &buf, 1, - 0, &iovbase); - - if (IS_ERR(cb->send_mr)) { - log(LOG_ERR, "send_buf reg_mr failed\n"); - ib_dereg_mr(cb->recv_mr); - return PTR_ERR(cb->send_mr); + buf.addr = cb->send_dma_addr; + buf.size = sizeof cb->send_buf; + DEBUG_LOG(cb, "send buf dma_addr %llx size %d\n", buf.addr, + (int)buf.size); + iovbase = cb->send_dma_addr; + cb->send_mr = ib_reg_phys_mr(cb->pd, &buf, 1, + 0, &iovbase); + + if (IS_ERR(cb->send_mr)) { + DEBUG_LOG(cb, "send_buf reg_mr failed\n"); + ret = PTR_ERR(cb->send_mr); + goto bail; + } } } - /* RNIC adapters have a limit upto which it can register physical memory - * If DMA-MR memory mode is set then normally driver registers maximum - * supported memory. After that if contigmalloc allocates memory beyond the - * specified RNIC limit then Krping may not work. - */ - if (cb->use_dmamr && cb->memlimit) - cb->rdma_buf = contigmalloc(cb->size, M_DEVBUF, M_WAITOK, 0, cb->memlimit, - PAGE_SIZE, 0); - else - cb->rdma_buf = contigmalloc(cb->size, M_DEVBUF, M_WAITOK, 0, -1UL, - PAGE_SIZE, 0); - + cb->rdma_buf = kmalloc(cb->size, GFP_KERNEL); if (!cb->rdma_buf) { - log(LOG_ERR, "rdma_buf malloc failed\n"); - ret = ENOMEM; - goto err1; - } - if (!cb->use_dmamr) { - - buf.addr = vtophys(cb->rdma_buf); - buf.size = cb->size; - iovbase = vtophys(cb->rdma_buf); - cb->rdma_mr = ib_reg_phys_mr(cb->pd, &buf, 1, + DEBUG_LOG(cb, "rdma_buf malloc failed\n"); + ret = -ENOMEM; + goto bail; + } + + cb->rdma_dma_addr = dma_map_single(cb->pd->device->dma_device, + cb->rdma_buf, cb->size, + DMA_BIDIRECTIONAL); + pci_unmap_addr_set(cb, rdma_mapping, cb->rdma_dma_addr); + if (cb->mem != DMA) { + switch (cb->mem) { + case FASTREG: + cb->page_list_len = (((cb->size - 1) & PAGE_MASK) + + PAGE_SIZE) >> PAGE_SHIFT; + cb->page_list = ib_alloc_fast_reg_page_list( + cb->pd->device, + cb->page_list_len); + if (IS_ERR(cb->page_list)) { + DEBUG_LOG(cb, "recv_buf reg_mr failed\n"); + ret = PTR_ERR(cb->page_list); + goto bail; + } + cb->fastreg_mr = ib_alloc_fast_reg_mr(cb->pd, + cb->page_list->max_page_list_len); + if (IS_ERR(cb->fastreg_mr)) { + DEBUG_LOG(cb, "recv_buf reg_mr failed\n"); + ret = PTR_ERR(cb->fastreg_mr); + goto bail; + } + DEBUG_LOG(cb, "fastreg rkey 0x%x page_list %p" + " page_list_len %u\n", cb->fastreg_mr->rkey, + cb->page_list, cb->page_list_len); + break; + case MW: + cb->mw = ib_alloc_mw(cb->pd); + if (IS_ERR(cb->mw)) { + DEBUG_LOG(cb, "recv_buf alloc_mw failed\n"); + ret = PTR_ERR(cb->mw); + goto bail; + } + DEBUG_LOG(cb, "mw rkey 0x%x\n", cb->mw->rkey); + /*FALLTHROUGH*/ + case MR: + buf.addr = cb->rdma_dma_addr; + buf.size = cb->size; + iovbase = cb->rdma_dma_addr; + cb->rdma_mr = ib_reg_phys_mr(cb->pd, &buf, 1, IB_ACCESS_REMOTE_READ| IB_ACCESS_REMOTE_WRITE, &iovbase); - - if (IS_ERR(cb->rdma_mr)) { - log(LOG_ERR, "rdma_buf reg_mr failed\n"); - ret = PTR_ERR(cb->rdma_mr); - goto err2; + if (IS_ERR(cb->rdma_mr)) { + DEBUG_LOG(cb, "rdma_buf reg_mr failed\n"); + ret = PTR_ERR(cb->rdma_mr); + goto bail; + } + DEBUG_LOG(cb, "rdma buf dma_addr %llx size %d mr rkey 0x%x\n", + buf.addr, (int)buf.size, cb->rdma_mr->rkey); + break; + default: + ret = -EINVAL; + goto bail; + break; } } if (!cb->server || cb->wlat || cb->rlat || cb->bw) { - if (cb->use_dmamr && cb->memlimit) - cb->start_buf = contigmalloc(cb->size, M_DEVBUF, M_WAITOK, - 0, cb->memlimit, PAGE_SIZE, 0); - else - cb->start_buf = contigmalloc(cb->size, M_DEVBUF, M_WAITOK, - 0, -1UL, PAGE_SIZE, 0); + + cb->start_buf = kmalloc(cb->size, GFP_KERNEL); if (!cb->start_buf) { - log(LOG_ERR, "start_buf malloc failed\n"); - ret = ENOMEM; - goto err2; + DEBUG_LOG(cb, "start_buf malloc failed\n"); + ret = -ENOMEM; + goto bail; } - if (!cb->use_dmamr) { + + cb->start_dma_addr = dma_map_single(cb->pd->device->dma_device, + cb->start_buf, cb->size, + DMA_BIDIRECTIONAL); + pci_unmap_addr_set(cb, start_mapping, cb->start_dma_addr); + + if (cb->mem == MR || cb->mem == MW) { unsigned flags = IB_ACCESS_REMOTE_READ; - if (cb->wlat || cb->rlat || cb->bw) + if (cb->wlat || cb->rlat || cb->bw) flags |= IB_ACCESS_REMOTE_WRITE; - buf.addr = vtophys(cb->start_buf); + + buf.addr = cb->start_dma_addr; buf.size = cb->size; - iovbase = vtophys(cb->start_buf); + DEBUG_LOG(cb, "start buf dma_addr %llx size %d\n", + buf.addr, (int)buf.size); + iovbase = cb->start_dma_addr; cb->start_mr = ib_reg_phys_mr(cb->pd, &buf, 1, flags, &iovbase); if (IS_ERR(cb->start_mr)) { - log(LOG_ERR, "start_buf reg_mr failed\n"); + DEBUG_LOG(cb, "start_buf reg_mr failed\n"); ret = PTR_ERR(cb->start_mr); - goto err3; + goto bail; } } } krping_setup_wr(cb); - DEBUG_LOG(PFX "allocated & registered buffers...\n"); + DEBUG_LOG(cb, "allocated & registered buffers...\n"); return 0; -err3: - contigfree(cb->start_buf, cb->size, M_DEVBUF); - - if (!cb->use_dmamr) +bail: + if (cb->fastreg_mr && !IS_ERR(cb->fastreg_mr)) + ib_dereg_mr(cb->fastreg_mr); + if (cb->mw && !IS_ERR(cb->mw)) + ib_dealloc_mw(cb->mw); + if (cb->rdma_mr && !IS_ERR(cb->rdma_mr)) ib_dereg_mr(cb->rdma_mr); -err2: - contigfree(cb->rdma_buf, cb->size, M_DEVBUF); -err1: - if (cb->use_dmamr) + if (cb->page_list && !IS_ERR(cb->page_list)) + ib_free_fast_reg_page_list(cb->page_list); + if (cb->dma_mr && !IS_ERR(cb->dma_mr)) ib_dereg_mr(cb->dma_mr); - else { + if (cb->recv_mr && !IS_ERR(cb->recv_mr)) ib_dereg_mr(cb->recv_mr); + if (cb->send_mr && !IS_ERR(cb->send_mr)) ib_dereg_mr(cb->send_mr); - } + if (cb->rdma_buf) + kfree(cb->rdma_buf); + if (cb->start_buf) + kfree(cb->start_buf); return ret; } static void krping_free_buffers(struct krping_cb *cb) { - DEBUG_LOG(PFX "krping_free_buffers called on cb %p\n", cb); + DEBUG_LOG(cb, "krping_free_buffers called on cb %p\n", cb); -#if 0 + if (cb->dma_mr) + ib_dereg_mr(cb->dma_mr); + if (cb->send_mr) + ib_dereg_mr(cb->send_mr); + if (cb->recv_mr) + ib_dereg_mr(cb->recv_mr); + if (cb->rdma_mr) + ib_dereg_mr(cb->rdma_mr); + if (cb->start_mr) + ib_dereg_mr(cb->start_mr); + if (cb->fastreg_mr) + ib_dereg_mr(cb->fastreg_mr); + if (cb->mw) + ib_dealloc_mw(cb->mw); + dma_unmap_single(cb->pd->device->dma_device, pci_unmap_addr(cb, recv_mapping), sizeof(cb->recv_buf), DMA_BIDIRECTIONAL); @@ -543,24 +749,12 @@ static void krping_free_buffers(struct k dma_unmap_single(cb->pd->device->dma_device, pci_unmap_addr(cb, rdma_mapping), cb->size, DMA_BIDIRECTIONAL); -#endif - contigfree(cb->rdma_buf, cb->size, M_DEVBUF); - if (!cb->server || cb->wlat || cb->rlat || cb->bw) { -#if 0 + kfree(cb->rdma_buf); + if (cb->start_buf) { dma_unmap_single(cb->pd->device->dma_device, pci_unmap_addr(cb, start_mapping), cb->size, DMA_BIDIRECTIONAL); -#endif - contigfree(cb->start_buf, cb->size, M_DEVBUF); - } - if (cb->use_dmamr) - ib_dereg_mr(cb->dma_mr); - else { - ib_dereg_mr(cb->send_mr); - ib_dereg_mr(cb->recv_mr); - ib_dereg_mr(cb->rdma_mr); - if (!cb->server) - ib_dereg_mr(cb->start_mr); + kfree(cb->start_buf); } } @@ -577,6 +771,7 @@ static int krping_create_qp(struct krpin init_attr.qp_type = IB_QPT_RC; init_attr.send_cq = cb->cq; init_attr.recv_cq = cb->cq; + init_attr.sq_sig_type = IB_SIGNAL_REQ_WR; if (cb->server) { ret = rdma_create_qp(cb->child_cm_id, cb->pd, &init_attr); @@ -603,36 +798,36 @@ static int krping_setup_qp(struct krping int ret; cb->pd = ib_alloc_pd(cm_id->device); if (IS_ERR(cb->pd)) { - log(LOG_ERR, "ib_alloc_pd failed\n"); + PRINTF(cb, "ib_alloc_pd failed\n"); return PTR_ERR(cb->pd); } - DEBUG_LOG(PFX "created pd %p\n", cb->pd); + DEBUG_LOG(cb, "created pd %p\n", cb->pd); - strlcpy(cb->name, cb->pd->device->name, sizeof(cb->name)); + strlcpy(cb->stats.name, cb->pd->device->name, sizeof(cb->stats.name)); cb->cq = ib_create_cq(cm_id->device, krping_cq_event_handler, NULL, cb, cb->txdepth * 2, 0); if (IS_ERR(cb->cq)) { - log(LOG_ERR, "ib_create_cq failed\n"); + PRINTF(cb, "ib_create_cq failed\n"); ret = PTR_ERR(cb->cq); goto err1; } - DEBUG_LOG(PFX "created cq %p\n", cb->cq); + DEBUG_LOG(cb, "created cq %p\n", cb->cq); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 06:44:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E0179EFE; Mon, 21 Oct 2013 06:44:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B601F2E5D; Mon, 21 Oct 2013 06:44:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L6itU7085433; Mon, 21 Oct 2013 06:44:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L6itBR085432; Mon, 21 Oct 2013 06:44:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310210644.r9L6itBR085432@svn.freebsd.org> From: Alexander Motin Date: Mon, 21 Oct 2013 06:44:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256830 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 06:44:56 -0000 Author: mav Date: Mon Oct 21 06:44:55 2013 New Revision: 256830 URL: http://svnweb.freebsd.org/changeset/base/256830 Log: MFprojects/camlock r256619: Restore BIO_UNMAPPED and BIO_TRANSIENT_MAPPING in biodonne() when unmapping temporary mapped buffer. That fixes double unmap if biodone() called twice for the same BIO (but with different done methods). Move mapping removal before calling bio_done() method. I believe that it is very wrong to do anything to BIO after reporting completion. kib@ thinks it was done for some forgotten now case when bio_done() method needed mapped buffer. But 1) if BIO was sent as unmapped, then IMO done() should be called in the same way; 2) IMO there is no guatantee that buffer will be mapped at this point at all, for example, if all underlying stack supports unmapped I/O, so bio_done() handler can not expect that. Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon Oct 21 06:31:56 2013 (r256829) +++ head/sys/kern/vfs_bio.c Mon Oct 21 06:44:55 2013 (r256830) @@ -3557,15 +3557,15 @@ biodone(struct bio *bp) struct mtx *mtxp; void (*done)(struct bio *); vm_offset_t start, end; - int transient; if ((bp->bio_flags & BIO_TRANSIENT_MAPPING) != 0) { + bp->bio_flags &= ~BIO_TRANSIENT_MAPPING; + bp->bio_flags |= BIO_UNMAPPED; start = trunc_page((vm_offset_t)bp->bio_data); end = round_page((vm_offset_t)bp->bio_data + bp->bio_length); - transient = 1; - } else { - transient = 0; - start = end = 0; + pmap_qremove(start, OFF_TO_IDX(end - start)); + vmem_free(transient_arena, start, end - start); + atomic_add_int(&inflight_transient_maps, -1); } done = bp->bio_done; if (done == NULL) { @@ -3578,11 +3578,6 @@ biodone(struct bio *bp) bp->bio_flags |= BIO_DONE; done(bp); } - if (transient) { - pmap_qremove(start, OFF_TO_IDX(end - start)); - vmem_free(transient_arena, start, end - start); - atomic_add_int(&inflight_transient_maps, -1); - } } /* From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 07:49:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 69F36FBE; Mon, 21 Oct 2013 07:49:37 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5767D2176; Mon, 21 Oct 2013 07:49:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L7nbTx019550; Mon, 21 Oct 2013 07:49:37 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L7nb9J019549; Mon, 21 Oct 2013 07:49:37 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201310210749.r9L7nb9J019549@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 21 Oct 2013 07:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256832 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 07:49:37 -0000 Author: ae Date: Mon Oct 21 07:49:36 2013 New Revision: 256832 URL: http://svnweb.freebsd.org/changeset/base/256832 Log: Add a note that lacp_compose_key() should be updated, when new media types will be added. Submitted by: melifaro X-MFC after: r256689 Modified: head/sys/net/if_media.h Modified: head/sys/net/if_media.h ============================================================================== --- head/sys/net/if_media.h Mon Oct 21 06:55:07 2013 (r256831) +++ head/sys/net/if_media.h Mon Oct 21 07:49:36 2013 (r256832) @@ -153,7 +153,10 @@ uint64_t ifmedia_baudrate(int); #define IFM_40G_CR4 27 /* 40GBase-CR4 */ #define IFM_40G_SR4 28 /* 40GBase-SR4 */ #define IFM_40G_LR4 29 /* 40GBase-LR4 */ - +/* + * Please update ieee8023ad_lacp.c:lacp_compose_key() + * after adding new Ethernet media types. + */ /* note 31 is the max! */ #define IFM_ETH_MASTER 0x00000100 /* master mode (1000baseT) */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 07:58:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C963F2C1; Mon, 21 Oct 2013 07:58:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B741A21E3; Mon, 21 Oct 2013 07:58:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L7wbbV024106; Mon, 21 Oct 2013 07:58:37 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L7wboY024105; Mon, 21 Oct 2013 07:58:37 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310210758.r9L7wboY024105@svn.freebsd.org> From: Xin LI Date: Mon, 21 Oct 2013 07:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256833 - head/lib/libc/iconv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 07:58:37 -0000 Author: delphij Date: Mon Oct 21 07:58:37 2013 New Revision: 256833 URL: http://svnweb.freebsd.org/changeset/base/256833 Log: Drop cm_lock before calling mapper_close, which in turn could call _citrus_mapper_close again and result in a deadlock otherwise. This is similar to NetBSD PR/24023 (fixed in their r1.5 of this file). PR: bin/182994 Submitted by: Fabian Keil MFC after: 3 days Modified: head/lib/libc/iconv/citrus_mapper.c Modified: head/lib/libc/iconv/citrus_mapper.c ============================================================================== --- head/lib/libc/iconv/citrus_mapper.c Mon Oct 21 07:49:36 2013 (r256832) +++ head/lib/libc/iconv/citrus_mapper.c Mon Oct 21 07:58:37 2013 (r256833) @@ -381,7 +381,9 @@ _citrus_mapper_close(struct _citrus_mapp _CITRUS_HASH_REMOVE(cm, cm_entry); free(cm->cm_key); } + UNLOCK(&cm_lock); mapper_close(cm); + return; quit: UNLOCK(&cm_lock); } From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 08:49:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6FF68969; Mon, 21 Oct 2013 08:49:47 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5D8C425C3; Mon, 21 Oct 2013 08:49:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L8nlKs052212; Mon, 21 Oct 2013 08:49:47 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L8nlgM052211; Mon, 21 Oct 2013 08:49:47 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201310210849.r9L8nlgM052211@svn.freebsd.org> From: Hiroki Sato Date: Mon, 21 Oct 2013 08:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256835 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 08:49:47 -0000 Author: hrs Date: Mon Oct 21 08:49:46 2013 New Revision: 256835 URL: http://svnweb.freebsd.org/changeset/base/256835 Log: - Fix jail_parallel_start="YES". - Fix ip[46].addr when interface parameter is not defined. Spotted by: rpaulo Modified: head/etc/rc.d/jail Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Mon Oct 21 08:37:17 2013 (r256834) +++ head/etc/rc.d/jail Mon Oct 21 08:49:46 2013 (r256835) @@ -132,7 +132,9 @@ parse_options() # _confwarn=1 if [ -r "$jail_conf" -o -r "$_jconf" ]; then - warn "$_conf is created and used for jail $_j." + if ! checkyesno jail_parallel_start; then + warn "$_conf is created and used for jail $_j." + fi fi /usr/bin/install -m 0644 -o root -g wheel /dev/null $_conf || return 1 @@ -367,10 +369,10 @@ jail_handle_ips_option() # Append address to list of addresses for the jail command. case $_type in inet) - echo " ip4.addr += \"${_iface}|${_addr}${_mask}\";" + echo " ip4.addr += \"${_iface:+${_iface}|}${_addr}${_mask}\";" ;; inet6) - echo " ip6.addr += \"${_iface}|${_addr}${_mask}\";" + echo " ip6.addr += \"${_iface:+${_iface}|}${_addr}${_mask}\";" need_dad_wait=1 ;; esac @@ -418,7 +420,7 @@ jail_status() jail_start() { - local _j _jid _jn + local _j _jid _jn _jl if [ $# = 0 ]; then return @@ -446,30 +448,62 @@ jail_start() return ;; esac - for _j in $@; do - _j=$(echo $_j | tr /. _) - parse_options $_j || continue - - eval rc_flags=\${jail_${_j}_flags:-$jail_flags} - eval command=\${jail_${_j}_program:-$jail_program} - if checkyesno jail_parallel_start; then - command_args="-i -f $_conf -c $_j &" - else + if checkyesno jail_parallel_start; then + # + # Start jails in parallel and then check jail id when + # jail_parallel_start is YES. + # + _jl= + for _j in $@; do + _j=$(echo $_j | tr /. _) + parse_options $_j || continue + + _jl="$_jl $_j" + eval rc_flags=\${jail_${_j}_flags:-$jail_flags} + eval command=\${jail_${_j}_program:-$jail_program} command_args="-i -f $_conf -c $_j" - fi - _tmp=`mktemp -t jail` || exit 3 - if $command $rc_flags $command_args \ - >> $_tmp 2>&1 /dev/null 2>&1 /var/run/jail_${_j}.id - else - rm -f /var/run/jail_${_j}.id - echo " cannot start jail \"${_hostname:-${_j}}\": " - cat $_tmp - fi - rm -f $_tmp - done + if _jid=$($jail_jls -n -j $_j | tr " " "\n" | \ + grep ^jid=); then + echo "${_jid#jid=}" > /var/run/jail_${_j}.id + else + rm -f /var/run/jail_${_j}.id + echo " cannot start jail " \ + "\"${_hostname:-${_j}}\": " + fi + done + else + # + # Start jails one-by-one when jail_parallel_start is NO. + # + for _j in $@; do + _j=$(echo $_j | tr /. _) + parse_options $_j || continue + + eval rc_flags=\${jail_${_j}_flags:-$jail_flags} + eval command=\${jail_${_j}_program:-$jail_program} + command_args="-i -f $_conf -c $_j" + _tmp=`mktemp -t jail` || exit 3 + if $command $rc_flags $command_args \ + >> $_tmp 2>&1 /var/run/jail_${_j}.id + else + rm -f /var/run/jail_${_j}.id + echo " cannot start jail " \ + "\"${_hostname:-${_j}}\": " + cat $_tmp + fi + rm -f $_tmp + done + fi echo '.' } From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 08:51:22 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DD052BB0; Mon, 21 Oct 2013 08:51:22 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5A36A2608; Mon, 21 Oct 2013 08:51:22 +0000 (UTC) Received: from alph.d.allbsd.org (p4181-ipbf1307funabasi.chiba.ocn.ne.jp [123.225.173.181]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id r9L8p3bF092146 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 21 Oct 2013 17:51:13 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.7/8.14.5) with ESMTP id r9L8p236095776; Mon, 21 Oct 2013 17:51:02 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Mon, 21 Oct 2013 17:50:57 +0900 (JST) Message-Id: <20131021.175057.1620369871932250305.hrs@allbsd.org> To: jase@FreeBSD.org Subject: Re: svn commit: r256498 - head/etc/rc.d From: Hiroki Sato In-Reply-To: <52617089.6090708@FreeBSD.org> References: <201310150454.r9F4snOM001275@svn.freebsd.org> <52617089.6090708@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Mon_Oct_21_17_50_57_2013_192)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Mon, 21 Oct 2013 17:51:13 +0900 (JST) X-Spam-Status: No, score=-99.0 required=13.0 tests=CONTENT_TYPE_PRESENT, SPF_SOFTFAIL,USER_IN_WHITELIST,X_CHINESE_RELAY autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 08:51:22 -0000 ----Security_Multipart(Mon_Oct_21_17_50_57_2013_192)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Jase Thew wrote in <52617089.6090708@FreeBSD.org>: ja> On 15/10/2013 05:54, Hiroki Sato wrote: ja> > Author: hrs ja> > Date: Tue Oct 15 04:54:49 2013 ja> > New Revision: 256498 ja> > URL: http://svnweb.freebsd.org/changeset/base/256498 ja> > ja> > Log: ja> > - Fix "ifname|addr" syntax support in jail_{jname}_ip. ja> > - Create /var/run/jail_{jname}.id because ezjail-admin depends on it. ja> > ja> > Modified: ja> > head/etc/rc.d/jail ja> > ja> ja> Hi Hiroki, ja> ja> This unfortunately breaks ezjail when the address list doesn't use iface ja> prefix syntax. ja> ja> Given this configuration : ja> ja> export jail_poudriere_ip="192.168.1.184,127.0.1.4,::1" ja> ja> results in the following being generated : ja> ja> ip4.addr += "|192.168.1.184/32"; ja> ip4.addr += "|127.0.1.4/32"; ja> ip6.addr += "|::1/64"; ja> ja> The attach patch corrects the issue by suffixing the iface value with ja> "|" only when it has a value. Thank you for your report. r256835 should fix it (and other issues). Please try it and let me know if it works fine. -- Hiroki ----Security_Multipart(Mon_Oct_21_17_50_57_2013_192)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (FreeBSD) iEYEABECAAYFAlJk6vEACgkQTyzT2CeTzy3vaQCgtXHAAm9oMspq6B/y8kYeVYYB COsAoJOI99Mt/A51ZsrwouUqZ3Q1ifAY =5lC0 -----END PGP SIGNATURE----- ----Security_Multipart(Mon_Oct_21_17_50_57_2013_192)---- From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 08:57:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 69820E29; Mon, 21 Oct 2013 08:57:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3D4CE2663; Mon, 21 Oct 2013 08:57:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L8vSF0056946; Mon, 21 Oct 2013 08:57:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L8vSmf056945; Mon, 21 Oct 2013 08:57:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310210857.r9L8vSmf056945@svn.freebsd.org> From: Alexander Motin Date: Mon, 21 Oct 2013 08:57:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256836 - head/sys/cam/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 08:57:28 -0000 Author: mav Date: Mon Oct 21 08:57:27 2013 New Revision: 256836 URL: http://svnweb.freebsd.org/changeset/base/256836 Log: MFprojects/camlock: Remove hard limit on number of BIOs handled with one ATA TRIM request. Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Mon Oct 21 08:49:46 2013 (r256835) +++ head/sys/cam/ata/ata_da.c Mon Oct 21 08:57:27 2013 (r256836) @@ -123,10 +123,9 @@ struct disk_params { #define TRIM_MAX_BLOCKS 8 #define TRIM_MAX_RANGES (TRIM_MAX_BLOCKS * ATA_DSM_BLK_RANGES) -#define TRIM_MAX_BIOS (TRIM_MAX_RANGES * 4) struct trim_request { uint8_t data[TRIM_MAX_RANGES * ATA_DSM_RANGE_SIZE]; - struct bio *bps[TRIM_MAX_BIOS]; + TAILQ_HEAD(, bio) bps; }; struct ada_softc { @@ -1427,10 +1426,11 @@ adastart(struct cam_periph *periph, unio struct trim_request *req = &softc->trim_req; struct bio *bp1; uint64_t lastlba = (uint64_t)-1; - int bps = 0, c, lastcount = 0, off, ranges = 0; + int c, lastcount = 0, off, ranges = 0; softc->trim_running = 1; bzero(req, sizeof(*req)); + TAILQ_INIT(&req->bps); bp1 = bp; do { uint64_t lba = bp1->bio_pblkno; @@ -1473,10 +1473,9 @@ adastart(struct cam_periph *periph, unio */ } lastlba = lba; - req->bps[bps++] = bp1; + TAILQ_INSERT_TAIL(&req->bps, bp1, bio_queue); bp1 = bioq_first(&softc->trim_queue); - if (bps >= TRIM_MAX_BIOS || - bp1 == NULL || + if (bp1 == NULL || bp1->bio_bcount / softc->params.secsize > (softc->trim_max_ranges - ranges) * ATA_DSM_RANGE_MAX) @@ -1764,23 +1763,22 @@ adadone(struct cam_periph *periph, union if (softc->outstanding_cmds == 0) softc->flags |= ADA_FLAG_WENT_IDLE; if (state == ADA_CCB_TRIM) { - struct trim_request *req = - (struct trim_request *)ataio->data_ptr; - int i; - - for (i = 1; i < TRIM_MAX_BIOS && req->bps[i]; i++) { - struct bio *bp1 = req->bps[i]; + TAILQ_HEAD(, bio) queue; + struct bio *bp1; - bp1->bio_error = bp->bio_error; - if (bp->bio_flags & BIO_ERROR) { + TAILQ_INIT(&queue); + TAILQ_CONCAT(&queue, &softc->trim_req.bps, bio_queue); + softc->trim_running = 0; + while ((bp1 = TAILQ_FIRST(&queue)) != NULL) { + TAILQ_REMOVE(&queue, bp1, bio_queue); + bp1->bio_error = error; + if (error != 0) { bp1->bio_flags |= BIO_ERROR; bp1->bio_resid = bp1->bio_bcount; } else bp1->bio_resid = 0; biodone(bp1); } - softc->trim_running = 0; - biodone(bp); adaschedule(periph); } else biodone(bp); From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 09:12:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 71F64682; Mon, 21 Oct 2013 09:12:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5FA522782; Mon, 21 Oct 2013 09:12:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L9C5PY066582; Mon, 21 Oct 2013 09:12:05 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L9C4hj066581; Mon, 21 Oct 2013 09:12:04 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310210912.r9L9C4hj066581@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 21 Oct 2013 09:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256838 - head/bin/ps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 09:12:05 -0000 Author: trasz Date: Mon Oct 21 09:12:04 2013 New Revision: 256838 URL: http://svnweb.freebsd.org/changeset/base/256838 Log: Don't test arrays for being NULL. MFC after: 1 month Modified: head/bin/ps/print.c Modified: head/bin/ps/print.c ============================================================================== --- head/bin/ps/print.c Mon Oct 21 09:03:30 2013 (r256837) +++ head/bin/ps/print.c Mon Oct 21 09:12:04 2013 (r256838) @@ -797,8 +797,6 @@ char * emulname(KINFO *k, VARENT *ve __unused) { - if (k->ki_p->ki_emul == NULL) - return (NULL); return (strdup(k->ki_p->ki_emul)); } @@ -827,7 +825,6 @@ out: char * loginclass(KINFO *k, VARENT *ve __unused) { - char *s; /* * Don't display login class for system processes; @@ -837,8 +834,5 @@ loginclass(KINFO *k, VARENT *ve __unused if (k->ki_p->ki_flag & P_SYSTEM) { return (strdup("-")); } - s = k->ki_p->ki_loginclass; - if (s == NULL) - return (NULL); - return (strdup(s)); + return (strdup(k->ki_p->ki_loginclass)); } From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 09:34:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B7C72D4B; Mon, 21 Oct 2013 09:34:05 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 97338290D; Mon, 21 Oct 2013 09:34:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9L9Y5wt078259; Mon, 21 Oct 2013 09:34:05 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9L9Y5sg078256; Mon, 21 Oct 2013 09:34:05 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201310210934.r9L9Y5sg078256@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Mon, 21 Oct 2013 09:34:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256839 - in head/sys: arm/broadcom/bcm2835 dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 09:34:05 -0000 Author: ganbold (doc committer) Date: Mon Oct 21 09:34:04 2013 New Revision: 256839 URL: http://svnweb.freebsd.org/changeset/base/256839 Log: Move and rename dwc otg driver to more generic one as it appears to work for rk3188 SoC based board too. No objections from: hselasky@ Reviewed by: ray@ Added: head/sys/dev/usb/controller/dwc_otg_fdt.c - copied unchanged from r256657, head/sys/arm/broadcom/bcm2835/dwc_otg_brcm.c Deleted: head/sys/arm/broadcom/bcm2835/dwc_otg_brcm.c Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm2835 Mon Oct 21 09:12:04 2013 (r256838) +++ head/sys/arm/broadcom/bcm2835/files.bcm2835 Mon Oct 21 09:34:04 2013 (r256839) @@ -11,7 +11,7 @@ arm/broadcom/bcm2835/bcm2835_systimer.c arm/broadcom/bcm2835/bcm2835_wdog.c standard arm/broadcom/bcm2835/bus_space.c optional fdt arm/broadcom/bcm2835/common.c optional fdt -arm/broadcom/bcm2835/dwc_otg_brcm.c optional dwcotg +dev/usb/controller/dwc_otg_fdt.c optional dwcotg arm/arm/bus_space_generic.c standard arm/arm/bus_space_asm_generic.S standard Copied: head/sys/dev/usb/controller/dwc_otg_fdt.c (from r256657, head/sys/arm/broadcom/bcm2835/dwc_otg_brcm.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/dwc_otg_fdt.c Mon Oct 21 09:34:04 2013 (r256839, copy of r256657, head/sys/arm/broadcom/bcm2835/dwc_otg_brcm.c) @@ -0,0 +1,211 @@ +/*- + * Copyright (c) 2012 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include + +static device_probe_t dwc_otg_probe; +static device_attach_t dwc_otg_attach; +static device_detach_t dwc_otg_detach; + +struct dwc_otg_super_softc { + struct dwc_otg_softc sc_otg; /* must be first */ +}; + +static int +dwc_otg_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "synopsys,designware-hs-otg2")) + return (ENXIO); + + device_set_desc(dev, "DWC OTG 2.0 integrated USB controller"); + + return (0); +} + +static int +dwc_otg_attach(device_t dev) +{ + struct dwc_otg_super_softc *sc = device_get_softc(dev); + int err; + int rid; + + /* initialise some bus fields */ + sc->sc_otg.sc_bus.parent = dev; + sc->sc_otg.sc_bus.devices = sc->sc_otg.sc_devices; + sc->sc_otg.sc_bus.devices_max = DWC_OTG_MAX_DEVICES; + + /* get all DMA memory */ + if (usb_bus_mem_alloc_all(&sc->sc_otg.sc_bus, + USB_GET_DMA_TAG(dev), NULL)) { + return (ENOMEM); + } + rid = 0; + sc->sc_otg.sc_io_res = + bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + + if (!(sc->sc_otg.sc_io_res)) { + err = ENOMEM; + goto error; + } + sc->sc_otg.sc_io_tag = rman_get_bustag(sc->sc_otg.sc_io_res); + sc->sc_otg.sc_io_hdl = rman_get_bushandle(sc->sc_otg.sc_io_res); + sc->sc_otg.sc_io_size = rman_get_size(sc->sc_otg.sc_io_res); + + rid = 0; + sc->sc_otg.sc_irq_res = + bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); + if (sc->sc_otg.sc_irq_res == NULL) + goto error; + + sc->sc_otg.sc_bus.bdev = device_add_child(dev, "usbus", -1); + if (sc->sc_otg.sc_bus.bdev == NULL) + goto error; + + device_set_ivars(sc->sc_otg.sc_bus.bdev, &sc->sc_otg.sc_bus); + + err = bus_setup_intr(dev, sc->sc_otg.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)dwc_otg_interrupt, sc, &sc->sc_otg.sc_intr_hdl); + if (err) { + sc->sc_otg.sc_intr_hdl = NULL; + goto error; + } + err = dwc_otg_init(&sc->sc_otg); + if (err == 0) { + err = device_probe_and_attach(sc->sc_otg.sc_bus.bdev); + } + if (err) + goto error; + + + return (0); + +error: + dwc_otg_detach(dev); + return (ENXIO); +} + +static int +dwc_otg_detach(device_t dev) +{ + struct dwc_otg_super_softc *sc = device_get_softc(dev); + device_t bdev; + int err; + + if (sc->sc_otg.sc_bus.bdev) { + bdev = sc->sc_otg.sc_bus.bdev; + device_detach(bdev); + device_delete_child(dev, bdev); + } + /* during module unload there are lots of children leftover */ + device_delete_children(dev); + + if (sc->sc_otg.sc_irq_res && sc->sc_otg.sc_intr_hdl) { + /* + * only call dwc_otg_uninit() after dwc_otg_init() + */ + dwc_otg_uninit(&sc->sc_otg); + + err = bus_teardown_intr(dev, sc->sc_otg.sc_irq_res, + sc->sc_otg.sc_intr_hdl); + sc->sc_otg.sc_intr_hdl = NULL; + } + /* free IRQ channel, if any */ + if (sc->sc_otg.sc_irq_res) { + bus_release_resource(dev, SYS_RES_IRQ, 0, + sc->sc_otg.sc_irq_res); + sc->sc_otg.sc_irq_res = NULL; + } + /* free memory resource, if any */ + if (sc->sc_otg.sc_io_res) { + bus_release_resource(dev, SYS_RES_MEMORY, 0, + sc->sc_otg.sc_io_res); + sc->sc_otg.sc_io_res = NULL; + } + usb_bus_mem_free_all(&sc->sc_otg.sc_bus, NULL); + + return (0); +} + +static device_method_t dwc_otg_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, dwc_otg_probe), + DEVMETHOD(device_attach, dwc_otg_attach), + DEVMETHOD(device_detach, dwc_otg_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + DEVMETHOD_END +}; + +static driver_t dwc_otg_driver = { + .name = "dwcotg", + .methods = dwc_otg_methods, + .size = sizeof(struct dwc_otg_super_softc), +}; + +static devclass_t dwc_otg_devclass; + +DRIVER_MODULE(dwcotg, simplebus, dwc_otg_driver, dwc_otg_devclass, 0, 0); +MODULE_DEPEND(dwcotg, usb, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 10:09:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1DAD3C09; Mon, 21 Oct 2013 10:09:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 09B482AB3; Mon, 21 Oct 2013 10:09:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LA9mj2096338; Mon, 21 Oct 2013 10:09:48 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LA9mFC096337; Mon, 21 Oct 2013 10:09:48 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310211009.r9LA9mFC096337@svn.freebsd.org> From: Bryan Drewery Date: Mon, 21 Oct 2013 10:09:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256842 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 10:09:49 -0000 Author: bdrewery (ports committer) Date: Mon Oct 21 10:09:48 2013 New Revision: 256842 URL: http://svnweb.freebsd.org/changeset/base/256842 Log: Fix 'make delete-old-libs' and 'make check-libs' to delete .debug files created by WITH_DEBUG_FILES. Also cleanup .symbols files from the period between r244236 when .symbols were supported and r251512 when they were renamed to .debug. Only propose to delete a .debug file if the corresponding library itself was deleted already. Reported by: des Reviewed by: emaste (earlier version) Approved by: bapt MFC after: 3 days Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Oct 21 10:08:39 2013 (r256841) +++ head/Makefile.inc1 Mon Oct 21 10:09:48 2013 (r256842) @@ -1722,6 +1722,13 @@ delete-old-libs: chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ rm ${RM_I} "${DESTDIR}/$${file}" <&3; \ fi; \ + for ext in debug symbols; do \ + if ! [ -e "${DESTDIR}/$${file}" ] && [ -f \ + "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \ + rm ${RM_I} "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" \ + <&3; \ + fi; \ + done; \ done @echo ">>> Old libraries removed" @@ -1733,6 +1740,11 @@ check-old-libs: if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ echo "${DESTDIR}/$${file}"; \ fi; \ + for ext in debug symbols; do \ + if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \ + echo "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}"; \ + fi; \ + done; \ done delete-old-dirs: From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 10:12:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 02FA9D6C; Mon, 21 Oct 2013 10:12:14 +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 80B012AF6; Mon, 21 Oct 2013 10:12:13 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 670F067D8; Mon, 21 Oct 2013 10:05:07 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 4504749E; Mon, 21 Oct 2013 12:04:48 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Colin Percival Subject: Re: svn commit: r256767 - head/usr.sbin/freebsd-update References: <201310190940.r9J9eUiT027701@svn.freebsd.org> <5262E5A7.5020608@freebsd.org> <20131019215333.GA1489@stack.nl> <52630031.4080205@freebsd.org> Date: Mon, 21 Oct 2013 12:04:48 +0200 In-Reply-To: <52630031.4080205@freebsd.org> (Colin Percival's message of "Sat, 19 Oct 2013 14:57:05 -0700") Message-ID: <867gd7rlbz.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jilles Tjoelker X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 10:12:14 -0000 Colin Percival writes: > Jilles Tjoelker writes: > > Colin Percival writes: > > > Dag-Erling Sm=C3=B8rgrav writes: > > > > + P=3D"[-+./:=3D%@_[~[:alnum:]]" > > > Shouldn't this be > > > P=3D"[-+./:=3D%@_~[[:alnum:]]" > > > instead? > > That is equivalent. Both versions match an open square bracket in > > addition to the other characters. > Duh. I hadn't fully woken up yet and my brain mis-matched the > brackets. I can neither confirm nor deny the allegation that I placed it there on purpose to twist the reader's brain. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 12:00:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F1FBC457; Mon, 21 Oct 2013 12:00:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DDD2A22F5; Mon, 21 Oct 2013 12:00:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LC0Spx056564; Mon, 21 Oct 2013 12:00:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LC0Rdh056548; Mon, 21 Oct 2013 12:00:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310211200.r9LC0Rdh056548@svn.freebsd.org> From: Alexander Motin Date: Mon, 21 Oct 2013 12:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256843 - in head/sys: cam cam/ata cam/ctl cam/scsi dev/ahci dev/ata dev/isp dev/mvs dev/siis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 12:00:29 -0000 Author: mav Date: Mon Oct 21 12:00:26 2013 New Revision: 256843 URL: http://svnweb.freebsd.org/changeset/base/256843 Log: Merge CAM locking changes from the projects/camlock branch to radically reduce lock congestion and improve SMP scalability of the SCSI/ATA stack, preparing the ground for the coming next GEOM direct dispatch support. Replace big per-SIM locks with bunch of smaller ones: - per-LUN locks to protect device and peripheral drivers state; - per-target locks to protect list of LUNs on target; - per-bus locks to protect reference counting; - per-send queue locks to protect queue of CCBs to be sent; - per-done queue locks to protect queue of completed CCBs; - remaining per-SIM locks now protect only HBA driver internals. While holding LUN lock it is allowed (while not recommended for performance reasons) to take SIM lock. The opposite acquisition order is forbidden. All the other locks are leaf locks, that can be taken anywhere, but should not be cascaded. Many functions, such as: xpt_action(), xpt_done(), xpt_async(), xpt_create_path(), etc. are no longer require (but allow) SIM lock to be held. To keep compatibility and solve cases where SIM lock can't be dropped, all xpt_async() calls in addition to xpt_done() calls are queued to completion threads for async processing in clean environment without SIM lock held. Instead of single CAM SWI thread, used for commands completion processing before, use multiple (depending on number of CPUs) threads. Load balanced between them using "hash" of the device B:T:L address. HBA drivers that can drop SIM lock during completion processing and have sufficient number of completion threads to efficiently scale to multiple CPUs can use new function xpt_done_direct() to avoid extra context switch. Make ahci(4) driver to use this mechanism depending on hardware setup. Sponsored by: iXsystems, Inc. MFC after: 2 months Modified: head/sys/cam/ata/ata_da.c head/sys/cam/ata/ata_pmp.c head/sys/cam/ata/ata_xpt.c head/sys/cam/cam_ccb.h head/sys/cam/cam_periph.c head/sys/cam/cam_periph.h head/sys/cam/cam_queue.c head/sys/cam/cam_queue.h head/sys/cam/cam_sim.c head/sys/cam/cam_sim.h head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt.h head/sys/cam/cam_xpt_internal.h head/sys/cam/cam_xpt_sim.h head/sys/cam/ctl/ctl_frontend_cam_sim.c head/sys/cam/ctl/scsi_ctl.c head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_ch.c head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_enc.c head/sys/cam/scsi/scsi_enc_internal.h head/sys/cam/scsi/scsi_enc_safte.c head/sys/cam/scsi/scsi_enc_ses.c head/sys/cam/scsi/scsi_pass.c head/sys/cam/scsi/scsi_pt.c head/sys/cam/scsi/scsi_sa.c head/sys/cam/scsi/scsi_sg.c head/sys/cam/scsi/scsi_targ_bh.c head/sys/cam/scsi/scsi_target.c head/sys/cam/scsi/scsi_xpt.c head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci.h head/sys/dev/ata/ata-all.c head/sys/dev/isp/isp_freebsd.c head/sys/dev/mvs/mvs.c head/sys/dev/siis/siis.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Mon Oct 21 10:09:48 2013 (r256842) +++ head/sys/cam/ata/ata_da.c Mon Oct 21 12:00:26 2013 (r256843) @@ -103,7 +103,6 @@ typedef enum { ADA_CCB_RAHEAD = 0x01, ADA_CCB_WCACHE = 0x02, ADA_CCB_BUFFER_IO = 0x03, - ADA_CCB_WAITING = 0x04, ADA_CCB_DUMP = 0x05, ADA_CCB_TRIM = 0x06, ADA_CCB_TYPE_MASK = 0x0F, @@ -154,6 +153,7 @@ struct ada_softc { struct sysctl_oid *sysctl_tree; struct callout sendordered_c; struct trim_request trim_req; + int refcount; }; struct ada_quirk_entry { @@ -637,14 +637,8 @@ adaclose(struct disk *dp) int error; periph = (struct cam_periph *)dp->d_drv1; - cam_periph_lock(periph); - if (cam_periph_hold(periph, PRIBIO) != 0) { - cam_periph_unlock(periph); - cam_periph_release(periph); - return (0); - } - softc = (struct ada_softc *)periph->softc; + cam_periph_lock(periph); CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, ("adaclose\n")); @@ -652,7 +646,8 @@ adaclose(struct disk *dp) /* We only sync the cache if the drive is capable of it. */ if ((softc->flags & ADA_FLAG_DIRTY) != 0 && (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) != 0 && - (periph->flags & CAM_PERIPH_INVALID) == 0) { + (periph->flags & CAM_PERIPH_INVALID) == 0 && + cam_periph_hold(periph, PRIBIO) == 0) { ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); cam_fill_ataio(&ccb->ataio, @@ -676,10 +671,13 @@ adaclose(struct disk *dp) else softc->flags &= ~ADA_FLAG_DIRTY; xpt_release_ccb(ccb); + cam_periph_unhold(periph); } softc->flags &= ~ADA_FLAG_OPEN; - cam_periph_unhold(periph); + + while (softc->refcount != 0) + cam_periph_sleep(periph, &softc->refcount, PRIBIO, "adaclose", 1); cam_periph_unlock(periph); cam_periph_release(periph); return (0); @@ -689,23 +687,15 @@ static void adaschedule(struct cam_periph *periph) { struct ada_softc *softc = (struct ada_softc *)periph->softc; - uint32_t prio; if (softc->state != ADA_STATE_NORMAL) return; - /* Check if cam_periph_getccb() was called. */ - prio = periph->immediate_priority; - /* Check if we have more work to do. */ if (bioq_first(&softc->bio_queue) || (!softc->trim_running && bioq_first(&softc->trim_queue))) { - prio = CAM_PRIORITY_NORMAL; + xpt_schedule(periph, CAM_PRIORITY_NORMAL); } - - /* Schedule CCB if any of above is true. */ - if (prio != CAM_PRIORITY_NONE) - xpt_schedule(periph, prio); } /* @@ -969,7 +959,7 @@ adaasync(void *callback_arg, u_int32_t c status = cam_periph_alloc(adaregister, adaoninvalidate, adacleanup, adastart, "ada", CAM_PERIPH_BIO, - cgd->ccb_h.path, adaasync, + path, adaasync, AC_FOUND_DEVICE, cgd); if (status != CAM_REQ_CMP @@ -1045,8 +1035,10 @@ adaasync(void *callback_arg, u_int32_t c softc->state = ADA_STATE_WCACHE; else break; - cam_periph_acquire(periph); - xpt_schedule(periph, CAM_PRIORITY_DEV); + if (cam_periph_acquire(periph) != CAM_REQ_CMP) + softc->state = ADA_STATE_NORMAL; + else + xpt_schedule(periph, CAM_PRIORITY_DEV); } default: cam_periph_async(periph, code, path, arg); @@ -1353,8 +1345,8 @@ adaregister(struct cam_periph *periph, v * Create our sysctl variables, now that we know * we have successfully attached. */ - cam_periph_acquire(periph); - taskqueue_enqueue(taskqueue_thread, &softc->sysctl_task); + if (cam_periph_acquire(periph) == CAM_REQ_CMP) + taskqueue_enqueue(taskqueue_thread, &softc->sysctl_task); /* * Add async callbacks for bus reset and @@ -1372,7 +1364,7 @@ adaregister(struct cam_periph *periph, v * Schedule a periodic event to occasionally send an * ordered tag to a device. */ - callout_init_mtx(&softc->sendordered_c, periph->sim->mtx, 0); + callout_init_mtx(&softc->sendordered_c, cam_periph_mtx(periph), 0); callout_reset(&softc->sendordered_c, (ada_default_timeout * hz) / ADA_ORDEREDTAG_INTERVAL, adasendorderedtag, softc); @@ -1380,16 +1372,17 @@ adaregister(struct cam_periph *periph, v if (ADA_RA >= 0 && cgd->ident_data.support.command1 & ATA_SUPPORT_LOOKAHEAD) { softc->state = ADA_STATE_RAHEAD; - cam_periph_acquire(periph); - xpt_schedule(periph, CAM_PRIORITY_DEV); } else if (ADA_WC >= 0 && cgd->ident_data.support.command1 & ATA_SUPPORT_WRITECACHE) { softc->state = ADA_STATE_WCACHE; - cam_periph_acquire(periph); - xpt_schedule(periph, CAM_PRIORITY_DEV); - } else + } else { softc->state = ADA_STATE_NORMAL; - + return(CAM_REQ_CMP); + } + if (cam_periph_acquire(periph) != CAM_REQ_CMP) + softc->state = ADA_STATE_NORMAL; + else + xpt_schedule(periph, CAM_PRIORITY_DEV); return(CAM_REQ_CMP); } @@ -1407,19 +1400,6 @@ adastart(struct cam_periph *periph, unio struct bio *bp; u_int8_t tag_code; - /* Execute immediate CCB if waiting. */ - if (periph->immediate_priority <= periph->pinfo.priority) { - 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, - periph_links.sle); - periph->immediate_priority = CAM_PRIORITY_NONE; - wakeup(&periph->ccb_list); - /* Have more work to do, so ensure we stay scheduled */ - adaschedule(periph); - break; - } /* Run TRIM if not running yet. */ if (!softc->trim_running && (bp = bioq_first(&softc->trim_queue)) != 0) { @@ -1494,6 +1474,7 @@ adastart(struct cam_periph *periph, unio ATA_DSM_TRIM, 0, (ranges + ATA_DSM_BLK_RANGES - 1) / ATA_DSM_BLK_RANGES); start_ccb->ccb_h.ccb_state = ADA_CCB_TRIM; + start_ccb->ccb_h.flags |= CAM_UNLOCKED; goto out; } /* Run regular command. */ @@ -1662,10 +1643,15 @@ adastart(struct cam_periph *periph, unio break; } start_ccb->ccb_h.ccb_state = ADA_CCB_BUFFER_IO; + start_ccb->ccb_h.flags |= CAM_UNLOCKED; out: start_ccb->ccb_h.ccb_bp = bp; softc->outstanding_cmds++; + softc->refcount++; + cam_periph_unlock(periph); xpt_action(start_ccb); + cam_periph_lock(periph); + softc->refcount--; /* May have more work to do, so ensure we stay scheduled */ adaschedule(periph); @@ -1674,13 +1660,6 @@ out: case ADA_STATE_RAHEAD: case ADA_STATE_WCACHE: { - if ((periph->flags & CAM_PERIPH_INVALID) != 0) { - softc->state = ADA_STATE_NORMAL; - xpt_release_ccb(start_ccb); - cam_periph_release_locked(periph); - return; - } - cam_fill_ataio(ataio, 1, adadone, @@ -1729,10 +1708,12 @@ adadone(struct cam_periph *periph, union struct bio *bp; int error; + cam_periph_lock(periph); if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { error = adaerror(done_ccb, 0, 0); if (error == ERESTART) { /* A retry was scheduled, so just return. */ + cam_periph_unlock(periph); return; } if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) @@ -1762,6 +1743,7 @@ adadone(struct cam_periph *periph, union softc->outstanding_cmds--; if (softc->outstanding_cmds == 0) softc->flags |= ADA_FLAG_WENT_IDLE; + xpt_release_ccb(done_ccb); if (state == ADA_CCB_TRIM) { TAILQ_HEAD(, bio) queue; struct bio *bp1; @@ -1769,6 +1751,8 @@ adadone(struct cam_periph *periph, union TAILQ_INIT(&queue); TAILQ_CONCAT(&queue, &softc->trim_req.bps, bio_queue); softc->trim_running = 0; + adaschedule(periph); + cam_periph_unlock(periph); while ((bp1 = TAILQ_FIRST(&queue)) != NULL) { TAILQ_REMOVE(&queue, bp1, bio_queue); bp1->bio_error = error; @@ -1779,10 +1763,11 @@ adadone(struct cam_periph *periph, union bp1->bio_resid = 0; biodone(bp1); } - adaschedule(periph); - } else + } else { + cam_periph_unlock(periph); biodone(bp); - break; + } + return; } case ADA_CCB_RAHEAD: { @@ -1858,12 +1843,6 @@ out: cam_periph_release_locked(periph); return; } - case ADA_CCB_WAITING: - { - /* Caller will release the CCB */ - wakeup(&done_ccb->ccb_h.cbfcnp); - return; - } case ADA_CCB_DUMP: /* No-op. We're polling */ return; Modified: head/sys/cam/ata/ata_pmp.c ============================================================================== --- head/sys/cam/ata/ata_pmp.c Mon Oct 21 10:09:48 2013 (r256842) +++ head/sys/cam/ata/ata_pmp.c Mon Oct 21 12:00:26 2013 (r256843) @@ -293,7 +293,7 @@ pmpasync(void *callback_arg, u_int32_t c status = cam_periph_alloc(pmpregister, pmponinvalidate, pmpcleanup, pmpstart, "pmp", CAM_PERIPH_BIO, - cgd->ccb_h.path, pmpasync, + path, pmpasync, AC_FOUND_DEVICE, cgd); if (status != CAM_REQ_CMP @@ -318,13 +318,17 @@ pmpasync(void *callback_arg, u_int32_t c if (code == AC_SENT_BDR || code == AC_BUS_RESET) softc->found = 0; /* We have to reset everything. */ if (softc->state == PMP_STATE_NORMAL) { - if (softc->pm_pid == 0x37261095 || - softc->pm_pid == 0x38261095) - softc->state = PMP_STATE_PM_QUIRKS_1; - else - softc->state = PMP_STATE_PRECONFIG; - cam_periph_acquire(periph); - xpt_schedule(periph, CAM_PRIORITY_DEV); + if (cam_periph_acquire(periph) == CAM_REQ_CMP) { + if (softc->pm_pid == 0x37261095 || + softc->pm_pid == 0x38261095) + softc->state = PMP_STATE_PM_QUIRKS_1; + else + softc->state = PMP_STATE_PRECONFIG; + xpt_schedule(periph, CAM_PRIORITY_DEV); + } else { + pmprelease(periph, softc->found); + xpt_release_boot(); + } } else softc->restart = 1; break; Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Mon Oct 21 10:09:48 2013 (r256842) +++ head/sys/cam/ata/ata_xpt.c Mon Oct 21 12:00:26 2013 (r256843) @@ -182,7 +182,7 @@ static struct cam_ed * static void ata_device_transport(struct cam_path *path); static void ata_get_transfer_settings(struct ccb_trans_settings *cts); static void ata_set_transfer_settings(struct ccb_trans_settings *cts, - struct cam_ed *device, + struct cam_path *path, int async_update); static void ata_dev_async(u_int32_t async_code, struct cam_eb *bus, @@ -249,6 +249,7 @@ proberegister(struct cam_periph *periph, return (status); } CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); + ata_device_transport(periph->path); probeschedule(periph); return(CAM_REQ_CMP); } @@ -1320,6 +1321,7 @@ ata_scan_bus(struct cam_periph *periph, struct cam_path *path; ata_scan_bus_info *scan_info; union ccb *work_ccb, *reset_ccb; + struct mtx *mtx; cam_status status; CAM_DEBUG(request_ccb->ccb_h.path, CAM_DEBUG_TRACE, @@ -1395,11 +1397,14 @@ ata_scan_bus(struct cam_periph *periph, xpt_done(request_ccb); break; } + mtx = xpt_path_mtx(scan_info->request_ccb->ccb_h.path); goto scan_next; case XPT_SCAN_LUN: work_ccb = request_ccb; /* Reuse the same CCB to query if a device was really found */ scan_info = (ata_scan_bus_info *)work_ccb->ccb_h.ppriv_ptr0; + mtx = xpt_path_mtx(scan_info->request_ccb->ccb_h.path); + mtx_lock(mtx); /* If there is PMP... */ if ((scan_info->cpi->hba_inquiry & PI_SATAPM) && (scan_info->counter == scan_info->cpi->max_target)) { @@ -1428,6 +1433,7 @@ ata_scan_bus(struct cam_periph *periph, ((scan_info->cpi->hba_inquiry & PI_SATAPM) ? 0 : scan_info->cpi->max_target)) { done: + mtx_unlock(mtx); xpt_free_ccb(work_ccb); xpt_free_ccb((union ccb *)scan_info->cpi); request_ccb = scan_info->request_ccb; @@ -1444,6 +1450,8 @@ scan_next: scan_info->request_ccb->ccb_h.path_id, scan_info->counter, 0); if (status != CAM_REQ_CMP) { + if (request_ccb->ccb_h.func_code == XPT_SCAN_LUN) + mtx_unlock(mtx); printf("xpt_scan_bus: xpt_create_path failed" " with status %#x, bus scan halted\n", status); @@ -1459,9 +1467,15 @@ scan_next: scan_info->request_ccb->ccb_h.pinfo.priority); work_ccb->ccb_h.func_code = XPT_SCAN_LUN; work_ccb->ccb_h.cbfcnp = ata_scan_bus; + work_ccb->ccb_h.flags |= CAM_UNLOCKED; work_ccb->ccb_h.ppriv_ptr0 = scan_info; work_ccb->crcn.flags = scan_info->request_ccb->crcn.flags; + mtx_unlock(mtx); + if (request_ccb->ccb_h.func_code == XPT_SCAN_LUN) + mtx = NULL; xpt_action(work_ccb); + if (mtx != NULL) + mtx_lock(mtx); break; default: break; @@ -1476,6 +1490,7 @@ ata_scan_lun(struct cam_periph *periph, cam_status status; struct cam_path *new_path; struct cam_periph *old_periph; + int lock; CAM_DEBUG(path, CAM_DEBUG_TRACE, ("xpt_scan_lun\n")); @@ -1510,10 +1525,14 @@ ata_scan_lun(struct cam_periph *periph, } xpt_setup_ccb(&request_ccb->ccb_h, new_path, CAM_PRIORITY_XPT); request_ccb->ccb_h.cbfcnp = xptscandone; + request_ccb->ccb_h.flags |= CAM_UNLOCKED; request_ccb->ccb_h.func_code = XPT_SCAN_LUN; request_ccb->crcn.flags = flags; } + lock = (xpt_path_owned(path) == 0); + if (lock) + xpt_path_lock(path); if ((old_periph = cam_periph_find(path, "aprobe")) != NULL) { if ((old_periph->flags & CAM_PERIPH_INVALID) == 0) { probe_softc *softc; @@ -1540,6 +1559,8 @@ ata_scan_lun(struct cam_periph *periph, xpt_done(request_ccb); } } + if (lock) + xpt_path_unlock(path); } static void @@ -1553,7 +1574,6 @@ xptscandone(struct cam_periph *periph, u static struct cam_ed * ata_alloc_device(struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id) { - struct cam_path path; struct ata_quirk_entry *quirk; struct cam_ed *device; @@ -1574,22 +1594,6 @@ ata_alloc_device(struct cam_eb *bus, str device->queue_flags = 0; device->serial_num = NULL; device->serial_num_len = 0; - - /* - * XXX should be limited by number of CCBs this bus can - * do. - */ - bus->sim->max_ccbs += device->ccbq.devq_openings; - if (lun_id != CAM_LUN_WILDCARD) { - xpt_compile_path(&path, - NULL, - bus->path_id, - target->target_id, - lun_id); - ata_device_transport(&path); - xpt_release_path(&path); - } - return (device); } @@ -1712,15 +1716,8 @@ ata_dev_advinfo(union ccb *start_ccb) start_ccb->ccb_h.status = CAM_REQ_CMP; if (cdai->flags & CDAI_FLAG_STORE) { - int owned; - - owned = mtx_owned(start_ccb->ccb_h.path->bus->sim->mtx); - if (owned == 0) - mtx_lock(start_ccb->ccb_h.path->bus->sim->mtx); xpt_async(AC_ADVINFO_CHANGED, start_ccb->ccb_h.path, (void *)(uintptr_t)cdai->buftype); - if (owned == 0) - mtx_unlock(start_ccb->ccb_h.path->bus->sim->mtx); } } @@ -1732,7 +1729,7 @@ ata_action(union ccb *start_ccb) case XPT_SET_TRAN_SETTINGS: { ata_set_transfer_settings(&start_ccb->cts, - start_ccb->ccb_h.path->device, + start_ccb->ccb_h.path, /*async_update*/FALSE); break; } @@ -1791,11 +1788,9 @@ ata_get_transfer_settings(struct ccb_tra struct ccb_trans_settings_ata *ata; struct ccb_trans_settings_scsi *scsi; struct cam_ed *device; - struct cam_sim *sim; device = cts->ccb_h.path->device; - sim = cts->ccb_h.path->bus->sim; - (*(sim->sim_action))(sim, (union ccb *)cts); + xpt_action_default((union ccb *)cts); if (cts->protocol == PROTO_UNKNOWN || cts->protocol == PROTO_UNSPECIFIED) { @@ -1832,17 +1827,17 @@ ata_get_transfer_settings(struct ccb_tra } static void -ata_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_ed *device, +ata_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_path *path, int async_update) { struct ccb_pathinq cpi; struct ccb_trans_settings_ata *ata; struct ccb_trans_settings_scsi *scsi; - struct cam_sim *sim; struct ata_params *ident_data; struct scsi_inquiry_data *inq_data; + struct cam_ed *device; - if (device == NULL) { + if (path == NULL || (device = path->device) == NULL) { cts->ccb_h.status = CAM_PATH_INVALID; xpt_done((union ccb *)cts); return; @@ -1859,14 +1854,14 @@ ata_set_transfer_settings(struct ccb_tra cts->protocol_version = device->protocol_version; if (cts->protocol != device->protocol) { - xpt_print(cts->ccb_h.path, "Uninitialized Protocol %x:%x?\n", + xpt_print(path, "Uninitialized Protocol %x:%x?\n", cts->protocol, device->protocol); cts->protocol = device->protocol; } if (cts->protocol_version > device->protocol_version) { if (bootverbose) { - xpt_print(cts->ccb_h.path, "Down reving Protocol " + xpt_print(path, "Down reving Protocol " "Version from %d to %d?\n", cts->protocol_version, device->protocol_version); } @@ -1884,21 +1879,20 @@ ata_set_transfer_settings(struct ccb_tra cts->transport_version = device->transport_version; if (cts->transport != device->transport) { - xpt_print(cts->ccb_h.path, "Uninitialized Transport %x:%x?\n", + xpt_print(path, "Uninitialized Transport %x:%x?\n", cts->transport, device->transport); cts->transport = device->transport; } if (cts->transport_version > device->transport_version) { if (bootverbose) { - xpt_print(cts->ccb_h.path, "Down reving Transport " + xpt_print(path, "Down reving Transport " "Version from %d to %d?\n", cts->transport_version, device->transport_version); } cts->transport_version = device->transport_version; } - sim = cts->ccb_h.path->bus->sim; ident_data = &device->ident_data; inq_data = &device->inq_data; if (cts->protocol == PROTO_ATA) @@ -1909,7 +1903,7 @@ ata_set_transfer_settings(struct ccb_tra scsi = &cts->proto_specific.scsi; else scsi = NULL; - xpt_setup_ccb(&cpi.ccb_h, cts->ccb_h.path, CAM_PRIORITY_NONE); + xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); @@ -1953,11 +1947,11 @@ ata_set_transfer_settings(struct ccb_tra device->tag_delay_count = CAM_TAG_DELAY_COUNT; device->flags |= CAM_DEV_TAG_AFTER_COUNT; } else if (nowt && !newt) - xpt_stop_tags(cts->ccb_h.path); + xpt_stop_tags(path); } if (async_update == FALSE) - (*(sim->sim_action))(sim, (union ccb *)cts); + xpt_action_default((union ccb *)cts); } /* @@ -2014,10 +2008,14 @@ ata_dev_async(u_int32_t async_code, stru xpt_release_device(device); } else if (async_code == AC_TRANSFER_NEG) { struct ccb_trans_settings *settings; + struct cam_path path; settings = (struct ccb_trans_settings *)async_arg; - ata_set_transfer_settings(settings, device, + xpt_compile_path(&path, NULL, bus->path_id, target->target_id, + device->lun_id); + ata_set_transfer_settings(settings, &path, /*async_update*/TRUE); + xpt_release_path(&path); } } @@ -2030,7 +2028,7 @@ ata_announce_periph(struct cam_periph *p u_int speed; u_int mb; - mtx_assert(periph->sim->mtx, MA_OWNED); + cam_periph_assert(periph, MA_OWNED); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Mon Oct 21 10:09:48 2013 (r256842) +++ head/sys/cam/cam_ccb.h Mon Oct 21 12:00:26 2013 (r256843) @@ -104,7 +104,9 @@ typedef enum { CAM_SEND_SENSE = 0x08000000,/* Send sense data with status */ CAM_TERM_IO = 0x10000000,/* Terminate I/O Message sup. */ CAM_DISCONNECT = 0x20000000,/* Disconnects are mandatory */ - CAM_SEND_STATUS = 0x40000000 /* Send status after data phase */ + CAM_SEND_STATUS = 0x40000000,/* Send status after data phase */ + + CAM_UNLOCKED = 0x80000000 /* Call callback without lock. */ } ccb_flags; typedef enum { @@ -151,6 +153,9 @@ typedef enum { /* Device statistics (error counts, etc.) */ XPT_DEV_ADVINFO = 0x0e, /* Get/Set Device advanced information */ + XPT_ASYNC = 0x0f | XPT_FC_QUEUED | XPT_FC_USER_CCB + | XPT_FC_XPT_ONLY, + /* Asynchronous event */ /* SCSI Control Functions: 0x10->0x1F */ XPT_ABORT = 0x10, /* Abort the specified CCB */ @@ -1154,6 +1159,16 @@ struct ccb_dev_advinfo { }; /* + * CCB for sending async events + */ +struct ccb_async { + struct ccb_hdr ccb_h; + uint32_t async_code; + off_t async_arg_size; + void *async_arg_ptr; +}; + +/* * Union of all CCB types for kernel space allocation. This union should * never be used for manipulating CCBs - its only use is for the allocation * and deallocation of raw CCB space and is the return type of xpt_ccb_alloc @@ -1192,6 +1207,7 @@ union ccb { struct ccb_debug cdbg; struct ccb_ataio ataio; struct ccb_dev_advinfo cdai; + struct ccb_async casync; }; __BEGIN_DECLS Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Mon Oct 21 10:09:48 2013 (r256842) +++ head/sys/cam/cam_periph.c Mon Oct 21 12:00:26 2013 (r256843) @@ -196,12 +196,12 @@ cam_periph_alloc(periph_ctor_t *periph_c path_id = xpt_path_path_id(path); target_id = xpt_path_target_id(path); lun_id = xpt_path_lun_id(path); - cam_init_pinfo(&periph->pinfo); periph->periph_start = periph_start; periph->periph_dtor = periph_dtor; periph->periph_oninval = periph_oninvalidate; periph->type = type; periph->periph_name = name; + periph->scheduled_priority = CAM_PRIORITY_NONE; periph->immediate_priority = CAM_PRIORITY_NONE; periph->refcount = 1; /* Dropped by invalidation. */ periph->sim = sim; @@ -298,7 +298,7 @@ cam_periph_find(struct cam_path *path, c TAILQ_FOREACH(periph, &(*p_drv)->units, unit_links) { if (xpt_path_comp(periph->path, path) == 0) { xpt_unlock_buses(); - mtx_assert(periph->sim->mtx, MA_OWNED); + cam_periph_assert(periph, MA_OWNED); return(periph); } } @@ -379,7 +379,7 @@ void cam_periph_release_locked_buses(struct cam_periph *periph) { - mtx_assert(periph->sim->mtx, MA_OWNED); + cam_periph_assert(periph, MA_OWNED); KASSERT(periph->refcount >= 1, ("periph->refcount >= 1")); if (--periph->refcount == 0) camperiphfree(periph); @@ -400,16 +400,16 @@ cam_periph_release_locked(struct cam_per void cam_periph_release(struct cam_periph *periph) { - struct cam_sim *sim; + struct mtx *mtx; if (periph == NULL) return; - sim = periph->sim; - mtx_assert(sim->mtx, MA_NOTOWNED); - mtx_lock(sim->mtx); + cam_periph_assert(periph, MA_NOTOWNED); + mtx = cam_periph_mtx(periph); + mtx_lock(mtx); cam_periph_release_locked(periph); - mtx_unlock(sim->mtx); + mtx_unlock(mtx); } int @@ -427,10 +427,10 @@ cam_periph_hold(struct cam_periph *perip if (cam_periph_acquire(periph) != CAM_REQ_CMP) return (ENXIO); - mtx_assert(periph->sim->mtx, MA_OWNED); + cam_periph_assert(periph, MA_OWNED); while ((periph->flags & CAM_PERIPH_LOCKED) != 0) { periph->flags |= CAM_PERIPH_LOCK_WANTED; - if ((error = mtx_sleep(periph, periph->sim->mtx, priority, + if ((error = cam_periph_sleep(periph, periph, priority, "caplck", 0)) != 0) { cam_periph_release_locked(periph); return (error); @@ -449,7 +449,7 @@ void cam_periph_unhold(struct cam_periph *periph) { - mtx_assert(periph->sim->mtx, MA_OWNED); + cam_periph_assert(periph, MA_OWNED); periph->flags &= ~CAM_PERIPH_LOCKED; if ((periph->flags & CAM_PERIPH_LOCK_WANTED) != 0) { @@ -577,7 +577,7 @@ void cam_periph_invalidate(struct cam_periph *periph) { - mtx_assert(periph->sim->mtx, MA_OWNED); + cam_periph_assert(periph, MA_OWNED); /* * We only call this routine the first time a peripheral is * invalidated. @@ -600,7 +600,9 @@ camperiphfree(struct cam_periph *periph) { struct periph_driver **p_drv; - mtx_assert(periph->sim->mtx, MA_OWNED); + cam_periph_assert(periph, MA_OWNED); + KASSERT(periph->periph_allocating == 0, ("%s%d: freed while allocating", + periph->periph_name, periph->unit_number)); for (p_drv = periph_drivers; *p_drv != NULL; p_drv++) { if (strcmp((*p_drv)->driver_name, periph->periph_name) == 0) break; @@ -947,40 +949,14 @@ cam_periph_unmapmem(union ccb *ccb, stru PRELE(curproc); } -union ccb * -cam_periph_getccb(struct cam_periph *periph, u_int32_t priority) -{ - struct ccb_hdr *ccb_h; - - mtx_assert(periph->sim->mtx, MA_OWNED); - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdgetccb\n")); - - while (SLIST_FIRST(&periph->ccb_list) == NULL) { - if (periph->immediate_priority > priority) - periph->immediate_priority = priority; - xpt_schedule(periph, priority); - if ((SLIST_FIRST(&periph->ccb_list) != NULL) - && (SLIST_FIRST(&periph->ccb_list)->pinfo.priority == priority)) - break; - mtx_assert(periph->sim->mtx, MA_OWNED); - mtx_sleep(&periph->ccb_list, periph->sim->mtx, PRIBIO, "cgticb", - 0); - } - - ccb_h = SLIST_FIRST(&periph->ccb_list); - SLIST_REMOVE_HEAD(&periph->ccb_list, periph_links.sle); - return ((union ccb *)ccb_h); -} - void cam_periph_ccbwait(union ccb *ccb) { - struct cam_sim *sim; - sim = xpt_path_sim(ccb->ccb_h.path); if ((ccb->ccb_h.pinfo.index != CAM_UNQUEUED_INDEX) || ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INPROG)) - mtx_sleep(&ccb->ccb_h.cbfcnp, sim->mtx, PRIBIO, "cbwait", 0); + xpt_path_sleep(ccb->ccb_h.path, &ccb->ccb_h.cbfcnp, PRIBIO, + "cbwait", 0); } int @@ -1045,6 +1021,14 @@ cam_periph_ioctl(struct cam_periph *peri return(error); } +static void +cam_periph_done(struct cam_periph *periph, union ccb *done_ccb) +{ + + /* Caller will release the CCB */ + wakeup(&done_ccb->ccb_h.cbfcnp); +} + int cam_periph_runccb(union ccb *ccb, int (*error_routine)(union ccb *ccb, @@ -1053,12 +1037,9 @@ cam_periph_runccb(union ccb *ccb, cam_flags camflags, u_int32_t sense_flags, struct devstat *ds) { - struct cam_sim *sim; int error; - error = 0; - sim = xpt_path_sim(ccb->ccb_h.path); - mtx_assert(sim->mtx, MA_OWNED); + xpt_path_assert(ccb->ccb_h.path, MA_OWNED); /* * If the user has supplied a stats structure, and if we understand @@ -1068,6 +1049,7 @@ cam_periph_runccb(union ccb *ccb, ccb->ccb_h.func_code == XPT_ATA_IO)) devstat_start_transaction(ds, NULL); + ccb->ccb_h.cbfcnp = cam_periph_done; xpt_action(ccb); do { Modified: head/sys/cam/cam_periph.h ============================================================================== --- head/sys/cam/cam_periph.h Mon Oct 21 10:09:48 2013 (r256842) +++ head/sys/cam/cam_periph.h Mon Oct 21 12:00:26 2013 (r256843) @@ -35,6 +35,7 @@ #include #ifdef _KERNEL +#include #include @@ -103,7 +104,6 @@ typedef cam_status periph_ctor_t (struct typedef void periph_oninv_t (struct cam_periph *periph); typedef void periph_dtor_t (struct cam_periph *periph); struct cam_periph { - cam_pinfo pinfo; periph_start_t *periph_start; periph_oninv_t *periph_oninval; periph_dtor_t *periph_dtor; @@ -120,15 +120,20 @@ struct cam_periph { #define CAM_PERIPH_INVALID 0x08 #define CAM_PERIPH_NEW_DEV_FOUND 0x10 #define CAM_PERIPH_RECOVERY_INPROG 0x20 +#define CAM_PERIPH_RUN_TASK 0x40 #define CAM_PERIPH_FREE 0x80 #define CAM_PERIPH_ANNOUNCED 0x100 - u_int32_t immediate_priority; + uint32_t scheduled_priority; + uint32_t immediate_priority; + int periph_allocating; + int periph_allocated; u_int32_t refcount; SLIST_HEAD(, ccb_hdr) ccb_list; /* For "immediate" requests */ SLIST_ENTRY(cam_periph) periph_links; TAILQ_ENTRY(cam_periph) unit_links; ac_callback_t *deferred_callback; ac_code deferred_ac; + struct task periph_run_task; }; #define CAM_PERIPH_MAXMAPS 2 @@ -185,30 +190,26 @@ void cam_periph_freeze_after_event(stru int cam_periph_error(union ccb *ccb, cam_flags camflags, u_int32_t sense_flags, union ccb *save_ccb); -static __inline void -cam_periph_lock(struct cam_periph *periph) +static __inline struct mtx * +cam_periph_mtx(struct cam_periph *periph) { - mtx_lock(periph->sim->mtx); + return (xpt_path_mtx(periph->path)); } -static __inline void -cam_periph_unlock(struct cam_periph *periph) -{ - mtx_unlock(periph->sim->mtx); -} +#define cam_periph_owned(periph) \ + mtx_owned(xpt_path_mtx((periph)->path)) -static __inline int -cam_periph_owned(struct cam_periph *periph) -{ - return (mtx_owned(periph->sim->mtx)); -} +#define cam_periph_lock(periph) \ + mtx_lock(xpt_path_mtx((periph)->path)) -static __inline int -cam_periph_sleep(struct cam_periph *periph, void *chan, int priority, - const char *wmesg, int timo) -{ - return (msleep(chan, periph->sim->mtx, priority, wmesg, timo)); -} +#define cam_periph_unlock(periph) \ + mtx_unlock(xpt_path_mtx((periph)->path)) + +#define cam_periph_assert(periph, what) \ + mtx_assert(xpt_path_mtx((periph)->path), (what)) + +#define cam_periph_sleep(periph, chan, priority, wmesg, timo) \ + xpt_path_sleep((periph)->path, (chan), (priority), (wmesg), (timo)) static inline struct cam_periph * cam_periph_acquire_first(struct periph_driver *driver) @@ -230,7 +231,7 @@ cam_periph_acquire_next(struct cam_perip { struct cam_periph *periph = pperiph; - mtx_assert(pperiph->sim->mtx, MA_NOTOWNED); + cam_periph_assert(pperiph, MA_NOTOWNED); xpt_lock_buses(); do { periph = TAILQ_NEXT(periph, unit_links); Modified: head/sys/cam/cam_queue.c ============================================================================== --- head/sys/cam/cam_queue.c Mon Oct 21 10:09:48 2013 (r256842) +++ head/sys/cam/cam_queue.c Mon Oct 21 12:00:26 2013 (r256843) @@ -220,27 +220,30 @@ cam_devq_alloc(int devices, int openings } if (cam_devq_init(devq, devices, openings) != 0) { free(devq, M_CAMDEVQ); - return (NULL); + return (NULL); } - return (devq); } int cam_devq_init(struct cam_devq *devq, int devices, int openings) { + bzero(devq, sizeof(*devq)); + mtx_init(&devq->send_mtx, "CAM queue lock", NULL, MTX_DEF); if (camq_init(&devq->send_queue, devices) != 0) return (1); devq->send_openings = openings; - devq->send_active = 0; - return (0); + devq->send_active = 0; + return (0); } void cam_devq_free(struct cam_devq *devq) { + camq_fini(&devq->send_queue); + mtx_destroy(&devq->send_mtx); free(devq, M_CAMDEVQ); } @@ -286,6 +289,7 @@ cam_ccbq_resize(struct cam_ccbq *ccbq, i int delta; delta = new_size - (ccbq->dev_active + ccbq->dev_openings); + ccbq->total_openings += delta; ccbq->devq_openings += delta; ccbq->dev_openings += delta; @@ -303,6 +307,7 @@ cam_ccbq_init(struct cam_ccbq *ccbq, int if (camq_init(&ccbq->queue, imax(64, 1 << fls(openings + openings / 2))) != 0) return (1); + ccbq->total_openings = openings; ccbq->devq_openings = openings; ccbq->dev_openings = openings; return (0); Modified: head/sys/cam/cam_queue.h ============================================================================== --- head/sys/cam/cam_queue.h Mon Oct 21 10:09:48 2013 (r256842) +++ head/sys/cam/cam_queue.h Mon Oct 21 12:00:26 2013 (r256843) @@ -33,6 +33,8 @@ #ifdef _KERNEL +#include +#include #include #include @@ -59,8 +61,8 @@ struct cam_ccbq { struct camq queue; struct ccb_hdr_tailq queue_extra_head; int queue_extra_entries; + int total_openings; int devq_openings; - int devq_allocating; int dev_openings; int dev_active; int held; @@ -69,9 +71,10 @@ struct cam_ccbq { struct cam_ed; struct cam_devq { - struct camq send_queue; - int send_openings; - int send_active; + struct mtx send_mtx; + struct camq send_queue; + int send_openings; + int send_active; }; Modified: head/sys/cam/cam_sim.c ============================================================================== --- head/sys/cam/cam_sim.c Mon Oct 21 10:09:48 2013 (r256842) +++ head/sys/cam/cam_sim.c Mon Oct 21 12:00:26 2013 (r256843) @@ -87,7 +87,6 @@ cam_sim_alloc(sim_action_func sim_action *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 13:09:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D5355D23; Mon, 21 Oct 2013 13:09:09 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C28E626E8; Mon, 21 Oct 2013 13:09:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LD99QY094844; Mon, 21 Oct 2013 13:09:09 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LD99li094843; Mon, 21 Oct 2013 13:09:09 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201310211309.r9LD99li094843@svn.freebsd.org> From: Kirk McKusick Date: Mon, 21 Oct 2013 13:09:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256845 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 13:09:09 -0000 Author: mckusick Date: Mon Oct 21 13:09:09 2013 New Revision: 256845 URL: http://svnweb.freebsd.org/changeset/base/256845 Log: Fix build problem on ARM (which defaults to building without soft updates). Reported by: Tinderbox Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Oct 21 12:12:17 2013 (r256844) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Oct 21 13:09:09 2013 (r256845) @@ -536,16 +536,16 @@ softdep_request_cleanup(fs, vp, cred, re int softdep_check_suspend(struct mount *mp, struct vnode *devvp, - int softdep_deps, - int softdep_accdeps, + int softdep_depcnt, + int softdep_accdepcnt, int secondary_writes, int secondary_accwrites) { struct bufobj *bo; int error; - (void) softdep_deps, - (void) softdep_accdeps; + (void) softdep_depcnt, + (void) softdep_accdepcnt; bo = &devvp->v_bufobj; ASSERT_BO_WLOCKED(bo); From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 13:57:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 96CD2EC6; Mon, 21 Oct 2013 13:57:35 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 69ACD29FC; Mon, 21 Oct 2013 13:57:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LDvZlu020636; Mon, 21 Oct 2013 13:57:35 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LDvZP7020634; Mon, 21 Oct 2013 13:57:35 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310211357.r9LDvZP7020634@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 21 Oct 2013 13:57:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256846 - head/sys/powerpc/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 13:57:35 -0000 Author: nwhitehorn Date: Mon Oct 21 13:57:34 2013 New Revision: 256846 URL: http://svnweb.freebsd.org/changeset/base/256846 Log: Provide an interface for PCI bus drivers that need some of ofw_pci's metadata during attach. Modified: head/sys/powerpc/ofw/ofw_pci.c head/sys/powerpc/ofw/ofw_pci.h Modified: head/sys/powerpc/ofw/ofw_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pci.c Mon Oct 21 13:09:09 2013 (r256845) +++ head/sys/powerpc/ofw/ofw_pci.c Mon Oct 21 13:57:34 2013 (r256846) @@ -124,7 +124,7 @@ static device_method_t ofw_pci_methods[] DEFINE_CLASS_0(ofw_pci, ofw_pci_driver, ofw_pci_methods, 0); int -ofw_pci_attach(device_t dev) +ofw_pci_init(device_t dev) { struct ofw_pci_softc *sc; phandle_t node; @@ -134,6 +134,7 @@ ofw_pci_attach(device_t dev) node = ofw_bus_get_node(dev); sc = device_get_softc(dev); + sc->sc_initialized = 1; if (OF_getprop(node, "reg", &sc->sc_pcir, sizeof(sc->sc_pcir)) == -1) return (ENXIO); @@ -217,13 +218,28 @@ ofw_pci_attach(device_t dev) "error = %d\n", rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK, rp->pci, rp->pci + rp->size - 1, error); - panic("AHOY"); return (error); } } ofw_bus_setup_iinfo(node, &sc->sc_pci_iinfo, sizeof(cell_t)); + return (error); +} + +int +ofw_pci_attach(device_t dev) +{ + struct ofw_pci_softc *sc; + int error; + + sc = device_get_softc(dev); + if (!sc->sc_initialized) { + error = ofw_pci_init(dev); + if (error) + return (error); + } + device_add_child(dev, "pci", device_get_unit(dev)); return (bus_generic_attach(dev)); } Modified: head/sys/powerpc/ofw/ofw_pci.h ============================================================================== --- head/sys/powerpc/ofw/ofw_pci.h Mon Oct 21 13:09:09 2013 (r256845) +++ head/sys/powerpc/ofw/ofw_pci.h Mon Oct 21 13:57:34 2013 (r256846) @@ -52,6 +52,7 @@ struct ofw_pci_softc { device_t sc_dev; phandle_t sc_node; int sc_bus; + int sc_initialized; int sc_quirks; @@ -68,6 +69,7 @@ struct ofw_pci_softc { struct ofw_bus_iinfo sc_pci_iinfo; }; +int ofw_pci_init(device_t dev); int ofw_pci_attach(device_t dev); #endif // POWERPC_OFW_OFW_PCI_H From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 14:53:11 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 40719C40; Mon, 21 Oct 2013 14:53:11 +0000 (UTC) (envelope-from jase@FreeBSD.org) Received: from smtp.btshosting.co.uk (mx-2.btshosting.co.uk [IPv6:2a01:4f8:121:2403:2::]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5BFE32D19; Mon, 21 Oct 2013 14:53:10 +0000 (UTC) Received: from [192.168.1.65] (unknown [94.4.78.78]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by svr06-mx.btshosting.co.uk (Postfix) with ESMTPSA id 02BFA84B1C; Mon, 21 Oct 2013 14:53:07 +0000 (UTC) Message-ID: <52653FBA.3050307@FreeBSD.org> Date: Mon, 21 Oct 2013 15:52:42 +0100 From: Jase Thew Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Hiroki Sato Subject: Re: svn commit: r256498 - head/etc/rc.d References: <201310150454.r9F4snOM001275@svn.freebsd.org> <52617089.6090708@FreeBSD.org> <20131021.175057.1620369871932250305.hrs@allbsd.org> In-Reply-To: <20131021.175057.1620369871932250305.hrs@allbsd.org> X-Enigmail-Version: 1.5.2 OpenPGP: id=3F9B9617; url=pool.sks-keyservers.net Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="8iV54r7Vfj41gtlA6Op80Kjogug3AXTwd" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 14:53:11 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --8iV54r7Vfj41gtlA6Op80Kjogug3AXTwd Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 21/10/2013 09:50, Hiroki Sato wrote: >=20 > Thank you for your report. r256835 should fix it (and other issues). > Please try it and let me know if it works fine. >=20 > -- Hiroki >=20 Hi Hiroki, r256835 appears to be working fine so far - thank you. Regards, Jase. --=20 Jase Thew jase@FreeBSD.org FreeBSD Ports Committer --8iV54r7Vfj41gtlA6Op80Kjogug3AXTwd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.21 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQJ8BAEBCgBmBQJSZT/EXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRGNzY3ODIxQkE1MTQ4MjNFQ0RGNUM3QkRE NEU2NUM4QkZGMUMzODI5AAoJENTmXIv/HDgp2K0P/RM40DNU2SXgoBnHr7KbmJuK btSTqH8E5pToccls+PzShKsRZlN0s3+F4Ns9it2jNV/+pw2hDu4/piaIjL5LBGvI J5uDz1bWifKhafoMohFO7y31CxDKVyIXtj0iEULUk0tXtoozjPjN1/uuYbHNaSJT Ov4F6P5a3C4VOBi7sHLA99riNdID94dZcx3y2J85GjGiWyERracHCox3o2S7XMui jcYCdjp9F8Ldje3CsmOnxnMF1l+W2mqjl0GV+ktOuwuOKMfG533y14EZLpKg4sFv +EevS6jqLrwR0fwXI7SE9TTSrwaXKY8GAa2fYsA4ugrT+l9sbbdXscXF5cS0QhtC BVGx/T5oFEIgUfAnlLT9uZMMEh95cF4IMVQlvaiTSH4UC8kZ3shbAOl5cpGCSiKn dM4IFqLa/b6OPjKg+w0E6KCK52ojRe0nX28/e3f24JlW0At+O5IEkboGF/0RNm5c A5xYL6JJjinP9QQAg2y71ItpBS7hjMDgUVbf/eS8G711/UPciCeEQ7AEDgCeIEKZ ZhtxqUmvq381qgwxwda47YX4dE2NzxTRcPadbsBiMNfFPRkqrL4XzHpCcv+feWex 0VBIYgodq8b+DSBhsLaq6VXAI3Hmos/D6TSDCgj4J8EQhCcxp5q31D476yHecuDO JDuu1qtfrXlYWOE77tsd =YNMF -----END PGP SIGNATURE----- --8iV54r7Vfj41gtlA6Op80Kjogug3AXTwd-- From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 15:07:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2B0E5115; Mon, 21 Oct 2013 15:07:58 +0000 (UTC) (envelope-from kp@vega.codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DFAB92DDF; Mon, 21 Oct 2013 15:07:57 +0000 (UTC) Received: from vega.codepro.be (unknown [172.16.1.3]) by venus.codepro.be (Postfix) with ESMTP id 102A811F84; Mon, 21 Oct 2013 17:07:53 +0200 (CEST) Received: by vega.codepro.be (Postfix, from userid 1001) id 0BF49946D; Mon, 21 Oct 2013 17:07:53 +0200 (CEST) Date: Mon, 21 Oct 2013 17:07:53 +0200 From: Kristof Provost To: Kirk McKusick Subject: Re: svn commit: r256808 - head/sys/ufs/ffs Message-ID: <20131021150752.GC77546@vega.codepro.be> References: <201310202111.r9KLBfq5076008@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201310202111.r9KLBfq5076008@svn.freebsd.org> X-PGP-Fingerprint: E114 D9EA 909E D469 8F57 17A5 7D15 91C6 9EFA F286 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 15:07:58 -0000 Hi Kirk, On 2013-10-20 21:11:41 (+0000), Kirk McKusick wrote: > Modified: head/sys/ufs/ffs/ffs_softdep.c > ============================================================================== > --- head/sys/ufs/ffs/ffs_softdep.c Sun Oct 20 21:11:36 2013 (r256807) > +++ head/sys/ufs/ffs/ffs_softdep.c Sun Oct 20 21:11:40 2013 (r256808) > @@ -13686,6 +13686,17 @@ DB_SHOW_COMMAND(mkdirs, db_show_mkdirs) > } > } > > +/* exported to ffs_vfsops.c */ > +extern void db_print_ffs(struct ufsmount *ump); > +void > +db_print_ffs(struct ufsmount *ump) > +{ > + db_printf("mp %p %s devvp %p fs %p su_wl %d su_deps %d su_req %d\n", > + ump->um_mountp, ump->um_mountp->mnt_stat.f_mntonname, > + ump->um_devvp, ump->um_fs, ump->softdep_on_worklist, > + ump->softdep_deps, ump->softdep_req); > +} > + > #endif /* DDB */ > > #endif /* SOFTUPDATES */ > This causes link failures for me: ffs_vfsops.o: In function `db_show_ffs': /usr/home/kp/openrd/sys/ufs/ffs/ffs_vfsops.c:2235: undefined reference to `db_print_ffs' /usr/home/kp/openrd/sys/ufs/ffs/ffs_vfsops.c:2241: undefined reference to `db_print_ffs' Presumably because I have DDB set, but not SOFTUPDATES. Regards, Kristof From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 16:17:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9B70D4FE; Mon, 21 Oct 2013 16:17:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 883F02265; Mon, 21 Oct 2013 16:17:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LGHkMo097377; Mon, 21 Oct 2013 16:17:46 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LGHkPw097376; Mon, 21 Oct 2013 16:17:46 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310211617.r9LGHkPw097376@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 21 Oct 2013 16:17:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256847 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 16:17:46 -0000 Author: kib Date: Mon Oct 21 16:17:46 2013 New Revision: 256847 URL: http://svnweb.freebsd.org/changeset/base/256847 Log: Print more useful information about the transfer that trigger the assertion. Other data is available with ddb command 'show pginfo'. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Mon Oct 21 13:57:34 2013 (r256846) +++ head/sys/kern/uipc_syscalls.c Mon Oct 21 16:17:46 2013 (r256847) @@ -2070,7 +2070,8 @@ free_page: } KASSERT(error != 0 || (m->wire_count > 0 && vm_page_is_valid(m, off & PAGE_MASK, xfsize)), - ("wrong page state m %p", m)); + ("wrong page state m %p off %#jx xfsize %d", m, (uintmax_t)off, + xfsize)); VM_OBJECT_WUNLOCK(obj); return (error); } From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 16:22:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CA730B94; Mon, 21 Oct 2013 16:22:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B8780230E; Mon, 21 Oct 2013 16:22:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LGMpsq000741; Mon, 21 Oct 2013 16:22:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LGMpO3000740; Mon, 21 Oct 2013 16:22:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310211622.r9LGMpO3000740@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 21 Oct 2013 16:22:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256848 - head/sys/dev/drm2/i915 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 16:22:51 -0000 Author: kib Date: Mon Oct 21 16:22:51 2013 New Revision: 256848 URL: http://svnweb.freebsd.org/changeset/base/256848 Log: Reset function on SandyBridge holds the gt_lock for the whole duration already. Also, according to the specs, GDRST register is not in the power well, so the forcewake for reset status read is excessive for this reason. Use plain register read for waiting of the reset completion notification, to avoid gt_lock recursion. Linux upstream did the similar change, but their code was already restructured. Reported by: ray Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/dev/drm2/i915/i915_drv.c Modified: head/sys/dev/drm2/i915/i915_drv.c ============================================================================== --- head/sys/dev/drm2/i915/i915_drv.c Mon Oct 21 16:17:46 2013 (r256847) +++ head/sys/dev/drm2/i915/i915_drv.c Mon Oct 21 16:22:51 2013 (r256848) @@ -685,7 +685,7 @@ gen6_do_reset(struct drm_device *dev, u8 /* Spin waiting for the device to ack the reset request */ ret = _intel_wait_for(dev, - (I915_READ(GEN6_GDRST) & GEN6_GRDOM_FULL) == 0, + (I915_READ_NOTRACE(GEN6_GDRST) & GEN6_GRDOM_FULL) == 0, 500, 1, "915rst"); /* If reset with a user forcewake, try to restore, otherwise turn it off */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 16:44:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 88163404; Mon, 21 Oct 2013 16:44:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 67662249A; Mon, 21 Oct 2013 16:44:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LGisc0012477; Mon, 21 Oct 2013 16:44:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LGirtR012470; Mon, 21 Oct 2013 16:44:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310211644.r9LGirtR012470@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 21 Oct 2013 16:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256849 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 16:44:54 -0000 Author: kib Date: Mon Oct 21 16:44:53 2013 New Revision: 256849 URL: http://svnweb.freebsd.org/changeset/base/256849 Log: Add a resource limit for the total number of kqueues available to the user. Kqueue now saves the ucred of the allocating thread, to correctly decrement the counter on close. Under some specific and not real-world use scenario for kqueue, it is possible for the kqueues to consume memory proportional to the square of the number of the filedescriptors available to the process. Limit allows administrator to prevent the abuse. This is kernel-mode side of the change, with the user-mode enabling commit following. Reported and tested by: pho Discussed with: jmg Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/kern_event.c head/sys/kern/kern_resource.c head/sys/sys/eventvar.h head/sys/sys/resource.h head/sys/sys/resourcevar.h Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Mon Oct 21 16:22:51 2013 (r256848) +++ head/sys/kern/kern_event.c Mon Oct 21 16:44:53 2013 (r256849) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -699,9 +700,23 @@ sys_kqueue(struct thread *td, struct kqu struct filedesc *fdp; struct kqueue *kq; struct file *fp; + struct proc *p; + struct ucred *cred; int fd, error; - fdp = td->td_proc->p_fd; + p = td->td_proc; + cred = td->td_ucred; + crhold(cred); + PROC_LOCK(p); + if (!chgkqcnt(cred->cr_ruidinfo, 1, lim_cur(td->td_proc, + RLIMIT_KQUEUES))) { + PROC_UNLOCK(p); + crfree(cred); + return (EMFILE); + } + PROC_UNLOCK(p); + + fdp = p->p_fd; error = falloc(td, &fp, &fd, 0); if (error) goto done2; @@ -711,6 +726,7 @@ sys_kqueue(struct thread *td, struct kqu mtx_init(&kq->kq_lock, "kqueue", NULL, MTX_DEF|MTX_DUPOK); TAILQ_INIT(&kq->kq_head); kq->kq_fdp = fdp; + kq->kq_cred = cred; knlist_init_mtx(&kq->kq_sel.si_note, &kq->kq_lock); TASK_INIT(&kq->kq_task, 0, kqueue_task, kq); @@ -723,6 +739,10 @@ sys_kqueue(struct thread *td, struct kqu td->td_retval[0] = fd; done2: + if (error != 0) { + chgkqcnt(cred->cr_ruidinfo, -1, 0); + crfree(cred); + } return (error); } @@ -1767,6 +1787,8 @@ kqueue_close(struct file *fp, struct thr free(kq->kq_knlist, M_KQUEUE); funsetown(&kq->kq_sigio); + chgkqcnt(kq->kq_cred->cr_ruidinfo, -1, 0); + crfree(kq->kq_cred); free(kq, M_KQUEUE); fp->f_data = NULL; Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Mon Oct 21 16:22:51 2013 (r256848) +++ head/sys/kern/kern_resource.c Mon Oct 21 16:44:53 2013 (r256849) @@ -1432,3 +1432,21 @@ chgptscnt(uip, diff, max) } return (1); } + +int +chgkqcnt(struct uidinfo *uip, int diff, rlim_t max) +{ + + if (diff > 0 && max != 0) { + if (atomic_fetchadd_long(&uip->ui_kqcnt, (long)diff) + + diff > max) { + atomic_subtract_long(&uip->ui_kqcnt, (long)diff); + return (0); + } + } else { + atomic_add_long(&uip->ui_kqcnt, (long)diff); + if (uip->ui_kqcnt < 0) + printf("negative kqcnt for uid = %d\n", uip->ui_uid); + } + return (1); +} Modified: head/sys/sys/eventvar.h ============================================================================== --- head/sys/sys/eventvar.h Mon Oct 21 16:22:51 2013 (r256848) +++ head/sys/sys/eventvar.h Mon Oct 21 16:44:53 2013 (r256849) @@ -60,6 +60,7 @@ struct kqueue { u_long kq_knhashmask; /* size of knhash */ struct klist *kq_knhash; /* hash table for knotes */ struct task kq_task; + struct ucred *kq_cred; }; #endif /* !_SYS_EVENTVAR_H_ */ Modified: head/sys/sys/resource.h ============================================================================== --- head/sys/sys/resource.h Mon Oct 21 16:22:51 2013 (r256848) +++ head/sys/sys/resource.h Mon Oct 21 16:44:53 2013 (r256849) @@ -103,8 +103,9 @@ struct __wrusage { #define RLIMIT_AS RLIMIT_VMEM /* standard name for RLIMIT_VMEM */ #define RLIMIT_NPTS 11 /* pseudo-terminals */ #define RLIMIT_SWAP 12 /* swap used */ +#define RLIMIT_KQUEUES 13 /* kqueues allocated */ -#define RLIM_NLIMITS 13 /* number of resource limits */ +#define RLIM_NLIMITS 14 /* number of resource limits */ #define RLIM_INFINITY ((rlim_t)(((uint64_t)1 << 63) - 1)) /* XXX Missing: RLIM_SAVED_MAX, RLIM_SAVED_CUR */ @@ -129,6 +130,7 @@ static const char *rlimit_ident[RLIM_NLI "vmem", "npts", "swap", + "kqueues", }; #endif Modified: head/sys/sys/resourcevar.h ============================================================================== --- head/sys/sys/resourcevar.h Mon Oct 21 16:22:51 2013 (r256848) +++ head/sys/sys/resourcevar.h Mon Oct 21 16:44:53 2013 (r256849) @@ -99,6 +99,7 @@ struct uidinfo { long ui_sbsize; /* (b) socket buffer space consumed */ long ui_proccnt; /* (b) number of processes */ long ui_ptscnt; /* (b) number of pseudo-terminals */ + long ui_kqcnt; /* (b) number of kqueues */ uid_t ui_uid; /* (a) uid */ u_int ui_ref; /* (b) reference count */ struct racct *ui_racct; /* (a) resource accounting */ @@ -115,6 +116,7 @@ void addupc_intr(struct thread *td, uin void addupc_task(struct thread *td, uintfptr_t pc, u_int ticks); void calccru(struct proc *p, struct timeval *up, struct timeval *sp); void calcru(struct proc *p, struct timeval *up, struct timeval *sp); +int chgkqcnt(struct uidinfo *uip, int diff, rlim_t max); int chgproccnt(struct uidinfo *uip, int diff, rlim_t maxval); int chgsbsize(struct uidinfo *uip, u_int *hiwat, u_int to, rlim_t maxval); From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 16:46:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BA5845F1; Mon, 21 Oct 2013 16:46:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A63E524C3; Mon, 21 Oct 2013 16:46:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LGkEoN012913; Mon, 21 Oct 2013 16:46:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LGkDl5012906; Mon, 21 Oct 2013 16:46:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310211646.r9LGkDl5012906@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 21 Oct 2013 16:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256850 - in head: bin/sh etc lib/libc/sys lib/libutil usr.bin/limits usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 16:46:14 -0000 Author: kib Date: Mon Oct 21 16:46:12 2013 New Revision: 256850 URL: http://svnweb.freebsd.org/changeset/base/256850 Log: Add a resource limit for the total number of kqueues available to the user. Kqueue now saves the ucred of the allocating thread, to correctly decrement the counter on close. Under some specific and not real-world use scenario for kqueue, it is possible for the kqueues to consume memory proportional to the square of the number of the filedescriptors available to the process. Limit allows administrator to prevent the abuse. This is kernel-mode side of the change, with the user-mode enabling commit following. Reported and tested by: pho Discussed with: jmg Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/bin/sh/miscbltin.c head/etc/login.conf head/lib/libc/sys/getrlimit.2 head/lib/libutil/login_class.3 head/lib/libutil/login_class.c head/usr.bin/limits/limits.c head/usr.bin/procstat/procstat_rlimit.c Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Mon Oct 21 16:44:53 2013 (r256849) +++ head/bin/sh/miscbltin.c Mon Oct 21 16:46:12 2013 (r256850) @@ -405,6 +405,9 @@ static const struct limits limits[] = { #ifdef RLIMIT_NPTS { "pseudo-terminals", (char *)0, RLIMIT_NPTS, 1, 'p' }, #endif +#ifdef RLIMIT_KQUEUES + { "kqueues", (char *)0, RLIMIT_KQUEUES, 1, 'k' }, +#endif { (char *) 0, (char *)0, 0, 0, '\0' } }; @@ -421,7 +424,7 @@ ulimitcmd(int argc __unused, char **argv struct rlimit limit; what = 'f'; - while ((optc = nextopt("HSatfdsmcnuvlbpw")) != '\0') + while ((optc = nextopt("HSatfdsmcnuvlbpwk")) != '\0') switch (optc) { case 'H': how = HARD; Modified: head/etc/login.conf ============================================================================== --- head/etc/login.conf Mon Oct 21 16:44:53 2013 (r256849) +++ head/etc/login.conf Mon Oct 21 16:46:12 2013 (r256850) @@ -42,6 +42,7 @@ default:\ :vmemoryuse=unlimited:\ :swapuse=unlimited:\ :pseudoterminals=unlimited:\ + :kqueues=unlimited:\ :priority=0:\ :ignoretime@:\ :umask=022: Modified: head/lib/libc/sys/getrlimit.2 ============================================================================== --- head/lib/libc/sys/getrlimit.2 Mon Oct 21 16:44:53 2013 (r256849) +++ head/lib/libc/sys/getrlimit.2 Mon Oct 21 16:46:12 2013 (r256850) @@ -108,6 +108,8 @@ Please see for a complete description of this sysctl. .It Dv RLIMIT_NPTS The maximum number of pseudo-terminals created by this user id. +.It Dv RLIMIT_KQUEUES +The maximum number of kqueues created by this user id. .El .Pp A resource limit is specified as a soft limit and a hard limit. Modified: head/lib/libutil/login_class.3 ============================================================================== --- head/lib/libutil/login_class.3 Mon Oct 21 16:44:53 2013 (r256849) +++ head/lib/libutil/login_class.3 Mon Oct 21 16:46:12 2013 (r256850) @@ -118,6 +118,7 @@ sbsize RLIMIT_SBSIZE vmemoryuse RLIMIT_VMEM pseudoterminals RLIMIT_NPTS swapuse RLIMIT_SWAP +kqueues RLIMIT_KQUEUES .Ed .It LOGIN_SETPRIORITY Set the scheduling priority for the current process based on the Modified: head/lib/libutil/login_class.c ============================================================================== --- head/lib/libutil/login_class.c Mon Oct 21 16:44:53 2013 (r256849) +++ head/lib/libutil/login_class.c Mon Oct 21 16:46:12 2013 (r256850) @@ -66,6 +66,7 @@ static struct login_res { { "vmemoryuse", login_getcapsize, RLIMIT_VMEM }, { "pseudoterminals", login_getcapnum, RLIMIT_NPTS }, { "swapuse", login_getcapsize, RLIMIT_SWAP }, + { "kqueues", login_getcapsize, RLIMIT_KQUEUES }, { NULL, 0, 0 } }; Modified: head/usr.bin/limits/limits.c ============================================================================== --- head/usr.bin/limits/limits.c Mon Oct 21 16:44:53 2013 (r256849) +++ head/usr.bin/limits/limits.c Mon Oct 21 16:46:12 2013 (r256850) @@ -89,7 +89,8 @@ static struct { { " sbsize%-4s %8s", " bytes\n", 1 }, { " vmemoryuse%-4s %8s", " kB\n", 1024 }, { " pseudo-terminals%-4s %8s", "\n", 1 }, - { " swapuse%-4s %8s", " kB\n", 1024 } + { " swapuse%-4s %8s", " kB\n", 1024 }, + { " kqueues%-4s %8s", "\n", 1 }, } }, { "sh", "unlimited", "", " -H", " -S", "", @@ -106,7 +107,8 @@ static struct { { "ulimit%s -b %s", ";\n", 1 }, { "ulimit%s -v %s", ";\n", 1024 }, { "ulimit%s -p %s", ";\n", 1 }, - { "ulimit%s -w %s", ";\n", 1024 } + { "ulimit%s -w %s", ";\n", 1024 }, + { "ulimit%s -k %s", ";\n", 1 }, } }, { "csh", "unlimited", "", " -h", "", NULL, @@ -123,7 +125,8 @@ static struct { { "limit%s sbsize %s", ";\n", 1 }, { "limit%s vmemoryuse %s", ";\n", 1024 }, { "limit%s pseudoterminals %s", ";\n", 1 }, - { "limit%s swapuse %s", ";\n", 1024 } + { "limit%s swapuse %s", ";\n", 1024 }, + { "limit%s kqueues %s", ";\n", 1 }, } }, { "bash|bash2", "unlimited", "", " -H", " -S", "", @@ -157,7 +160,8 @@ static struct { { "limit%s sbsize %s", ";\n", 1 }, { "limit%s vmemoryuse %s", ";\n", 1024 }, { "limit%s pseudoterminals %s", ";\n", 1 }, - { "limit%s swapuse %s", ";\n", 1024 } + { "limit%s swapuse %s", ";\n", 1024 }, + { "limit%s kqueues %s", ";\n", 1 }, } }, { "ksh|pdksh", "unlimited", "", " -H", " -S", "", @@ -232,7 +236,8 @@ static struct { { "sbsize", login_getcapsize }, { "vmemoryuse", login_getcapsize }, { "pseudoterminals",login_getcapnum }, - { "swapuse", login_getcapsize } + { "swapuse", login_getcapsize }, + { "kqueues", login_getcapnum }, }; /* @@ -647,6 +652,7 @@ resource_num(int which, int ch, const ch case RLIMIT_NPROC: case RLIMIT_NOFILE: case RLIMIT_NPTS: + case RLIMIT_KQUEUES: res = strtoq(s, &e, 0); s = e; break; Modified: head/usr.bin/procstat/procstat_rlimit.c ============================================================================== --- head/usr.bin/procstat/procstat_rlimit.c Mon Oct 21 16:44:53 2013 (r256849) +++ head/usr.bin/procstat/procstat_rlimit.c Mon Oct 21 16:46:12 2013 (r256850) @@ -46,7 +46,7 @@ static struct { const char *name; const char *suffix; -} rlimit_param[13] = { +} rlimit_param[14] = { {"cputime", "sec"}, {"filesize", "B "}, {"datasize", "B "}, @@ -60,9 +60,10 @@ static struct { {"vmemoryuse", "B "}, {"pseudo-terminals", " "}, {"swapuse", "B "}, + {"kqueues", " "}, }; -#if RLIM_NLIMITS > 13 +#if RLIM_NLIMITS > 14 #error "Resource limits have grown. Add new entries to rlimit_param[]." #endif From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 17:06:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 81E47E2B; Mon, 21 Oct 2013 17:06:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CB3152620; Mon, 21 Oct 2013 17:06:01 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r9LH5oi2025004; Mon, 21 Oct 2013 20:05:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r9LH5oi2025004 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r9LH5oTa025002; Mon, 21 Oct 2013 20:05:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 21 Oct 2013 20:05:50 +0300 From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r256850 - in head: bin/sh etc lib/libc/sys lib/libutil usr.bin/limits usr.bin/procstat Message-ID: <20131021170550.GT3865@kib.kiev.ua> References: <201310211646.r9LGkDl5012906@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="O/1O6NUaCrlCPhw5" Content-Disposition: inline In-Reply-To: <201310211646.r9LGkDl5012906@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 17:06:02 -0000 --O/1O6NUaCrlCPhw5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 21, 2013 at 04:46:13PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Mon Oct 21 16:46:12 2013 > New Revision: 256850 > URL: http://svnweb.freebsd.org/changeset/base/256850 >=20 > Log: > Add a resource limit for the total number of kqueues available to the > user. Kqueue now saves the ucred of the allocating thread, to > correctly decrement the counter on close. > =20 > Under some specific and not real-world use scenario for kqueue, it is > possible for the kqueues to consume memory proportional to the square > of the number of the filedescriptors available to the process. Limit > allows administrator to prevent the abuse. > =20 > This is kernel-mode side of the change, with the user-mode enabling > commit following. This is obviously user-mode part of the change. --O/1O6NUaCrlCPhw5 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJSZV7tAAoJEJDCuSvBvK1BL0cP/1IQ+/LMa+5fT5C8I4Yek/yS r3hg+UE1zWe5irJPOJvk3QGbbtRyTTWREZmnk5OZAx+M3Er0xEzs9tRpPnPaWhgV CbIUFobnOhkxPm5r3iWQIx6pY937qH9LMfumMiVJvZXB9ZPo5sQTpu7fCX0TyF2R sZZHsJcJao6SRwm3jJsfjKn5V1xph5vwALGNV4WMDUUTe/8LWsrPUC8eobRYumD7 g9yyPWlsZ7PtmKscj75hawxl+QKSHwMNNJQR7pwUM25Yr/osYXULnLL0/ZPnYwxp xoqlAtYf5eFFWDutqwo2dQMuvse3p1qlg3vFF0wD7SOUL2PNZ71iWVxwYCTzioKO GcpoFJRKJJRrVnnHkPa7CLgHIr1IohZR5TiZ76nH2/3HZQZRy33y5XLxomckwdQY a2/qVMRPq4WNmXKynVldefiHqGXVdMuKElVVyt2Vo4hSELBR+MiUf4ZLF7niP4VC pH7nQELZqT21/ek2qTchBnQ14+D76xhc1VBkJKMoDUwzPzZUJA/RKSqpb1PaPzqT oNW1olwUKzyNP+2D2Qb4J0fA+LBQCsf3aZREDe4uw3Jx5JX2oaaEHsfqjMo44xZh U8P1pk/W3cw9rlE/zOOP1KVbgzDn5bCf09kEJJ3IK9wenNRu84CI2/KH5Cj07EXV vSk+u27mz6zkxGDDZFRn =e4VK -----END PGP SIGNATURE----- --O/1O6NUaCrlCPhw5-- From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 18:20:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0887FB97; Mon, 21 Oct 2013 18:20:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB3F32AF4; Mon, 21 Oct 2013 18:20:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LIKLXn063551; Mon, 21 Oct 2013 18:20:21 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LIKKNa063541; Mon, 21 Oct 2013 18:20:20 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201310211820.r9LIKKNa063541@svn.freebsd.org> From: Ed Maste Date: Mon, 21 Oct 2013 18:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256851 - stable/9/contrib/gdb/gdb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 18:20:22 -0000 Author: emaste Date: Mon Oct 21 18:20:20 2013 New Revision: 256851 URL: http://svnweb.freebsd.org/changeset/base/256851 Log: MFC r244437: Support restrict qualifier in dwarf debug info Newer clang/llvm emit DW_TAG_restrict_type, which wasn't handled by gdb. Import support from Apple's gdb-1822: | 2009-03-24 Jason Molenda (jmolenda@apple.com) | | * gdbtypes.c (make_cv_type): Rename this function to make_cvr_type to | also handle restrict qualifiers. | (check_typedef): Handle TYPE_RESTRICT. | * gdbtypes.h (TYPE_FLAG_RESTRICT, TYPE_RESTRICT): New. | * hpread.c (hpread_type_lookup): Update to use make_cvr_type. | * stabsread.c (read_type): Pass the restrict qualifiers along. | * parse.c (follow_types): Pass the restrict qualifiers along. | * dwarf2read.c (read_tag_const_type): Call make_cvr_type. | (read_tag_volatile_type): Same. | (read_tag_restrict_type): New function. | (read_type_die): Handle DW_TAG_restrict_type. Obtained from: Apple Modified: stable/9/contrib/gdb/gdb/dwarf2read.c stable/9/contrib/gdb/gdb/gdbtypes.c stable/9/contrib/gdb/gdb/gdbtypes.h stable/9/contrib/gdb/gdb/hpread.c stable/9/contrib/gdb/gdb/parse.c stable/9/contrib/gdb/gdb/stabsread.c Directory Properties: stable/9/contrib/gdb/ (props changed) Modified: stable/9/contrib/gdb/gdb/dwarf2read.c ============================================================================== --- stable/9/contrib/gdb/gdb/dwarf2read.c Mon Oct 21 16:46:12 2013 (r256850) +++ stable/9/contrib/gdb/gdb/dwarf2read.c Mon Oct 21 18:20:20 2013 (r256851) @@ -834,6 +834,8 @@ static void read_tag_const_type (struct static void read_tag_volatile_type (struct die_info *, struct dwarf2_cu *); +static void read_tag_restrict_type (struct die_info *, struct dwarf2_cu *); + static void read_tag_string_type (struct die_info *, struct dwarf2_cu *); static void read_subroutine_type (struct die_info *, struct dwarf2_cu *); @@ -3729,7 +3731,8 @@ read_tag_const_type (struct die_info *di } base_type = die_type (die, cu); - die->type = make_cv_type (1, TYPE_VOLATILE (base_type), base_type, 0); + die->type = make_cvr_type (1, TYPE_VOLATILE (base_type), + TYPE_RESTRICT (base_type), base_type, 0); } static void @@ -3743,7 +3746,23 @@ read_tag_volatile_type (struct die_info } base_type = die_type (die, cu); - die->type = make_cv_type (TYPE_CONST (base_type), 1, base_type, 0); + die->type = make_cvr_type (TYPE_CONST (base_type), 1, + TYPE_RESTRICT (base_type), base_type, 0); +} + +static void +read_tag_restrict_type (struct die_info *die, struct dwarf2_cu *cu) +{ + struct type *base_type; + + if (die->type) + { + return; + } + + base_type = die_type (die, cu); + die->type = make_cvr_type (TYPE_CONST (base_type), TYPE_VOLATILE (base_type), + 1, base_type, 0); } /* Extract all information from a DW_TAG_string_type DIE and add to @@ -6086,6 +6105,9 @@ read_type_die (struct die_info *die, str case DW_TAG_volatile_type: read_tag_volatile_type (die, cu); break; + case DW_TAG_restrict_type: + read_tag_restrict_type (die, cu); + break; case DW_TAG_string_type: read_tag_string_type (die, cu); break; Modified: stable/9/contrib/gdb/gdb/gdbtypes.c ============================================================================== --- stable/9/contrib/gdb/gdb/gdbtypes.c Mon Oct 21 16:46:12 2013 (r256850) +++ stable/9/contrib/gdb/gdb/gdbtypes.c Mon Oct 21 18:20:20 2013 (r256851) @@ -502,7 +502,8 @@ make_type_with_address_space (struct typ We allocate new memory if needed. */ struct type * -make_cv_type (int cnst, int voltl, struct type *type, struct type **typeptr) +make_cvr_type (int cnst, int voltl, int restrct, struct type *type, + struct type **typeptr) { struct type *ntype; /* New type */ struct type *tmp_type = type; /* tmp type */ @@ -517,6 +518,9 @@ make_cv_type (int cnst, int voltl, struc if (voltl) new_flags |= TYPE_FLAG_VOLATILE; + if (restrct) + new_flags |= TYPE_FLAG_RESTRICT; + if (typeptr && *typeptr != NULL) { /* Objfile is per-core-type. This const-qualified type had best @@ -1371,7 +1375,7 @@ struct type * check_typedef (struct type *type) { struct type *orig_type = type; - int is_const, is_volatile; + int is_const, is_volatile, is_restrict; while (TYPE_CODE (type) == TYPE_CODE_TYPEDEF) { @@ -1407,6 +1411,7 @@ check_typedef (struct type *type) is_const = TYPE_CONST (type); is_volatile = TYPE_VOLATILE (type); + is_restrict = TYPE_RESTRICT (type); /* If this is a struct/class/union with no fields, then check whether a full definition exists somewhere else. This is for systems where a @@ -1424,7 +1429,7 @@ check_typedef (struct type *type) } newtype = lookup_transparent_type (name); if (newtype) - make_cv_type (is_const, is_volatile, newtype, &type); + make_cvr_type (is_const, is_volatile, is_restrict, newtype, &type); } /* Otherwise, rely on the stub flag being set for opaque/stubbed types */ else if (TYPE_STUB (type) && !currently_reading_symtab) @@ -1442,7 +1447,8 @@ check_typedef (struct type *type) } sym = lookup_symbol (name, 0, STRUCT_DOMAIN, 0, (struct symtab **) NULL); if (sym) - make_cv_type (is_const, is_volatile, SYMBOL_TYPE (sym), &type); + make_cvr_type (is_const, is_volatile, is_restrict, SYMBOL_TYPE (sym), + &type); } if (TYPE_TARGET_STUB (type)) Modified: stable/9/contrib/gdb/gdb/gdbtypes.h ============================================================================== --- stable/9/contrib/gdb/gdb/gdbtypes.h Mon Oct 21 16:46:12 2013 (r256850) +++ stable/9/contrib/gdb/gdb/gdbtypes.h Mon Oct 21 18:20:20 2013 (r256851) @@ -273,6 +273,13 @@ enum type_code #define TYPE_ADDRESS_CLASS_ALL(t) (TYPE_INSTANCE_FLAGS(t) \ & TYPE_FLAG_ADDRESS_CLASS_ALL) +/* Restrict type. If this is set, the corresponding type has a + * restrict modifier. + */ + +#define TYPE_FLAG_RESTRICT (1 << 17) +#define TYPE_RESTRICT(t) (TYPE_INSTANCE_FLAGS (t) & TYPE_FLAG_RESTRICT) + /* Array bound type. */ enum array_bound_type { @@ -1099,7 +1106,8 @@ extern struct type *lookup_reference_typ extern struct type *make_reference_type (struct type *, struct type **); -extern struct type *make_cv_type (int, int, struct type *, struct type **); +extern struct type *make_cvr_type (int, int, int, struct type *, + struct type **); extern void replace_type (struct type *, struct type *); Modified: stable/9/contrib/gdb/gdb/hpread.c ============================================================================== --- stable/9/contrib/gdb/gdb/hpread.c Mon Oct 21 16:46:12 2013 (r256850) +++ stable/9/contrib/gdb/gdb/hpread.c Mon Oct 21 18:20:20 2013 (r256851) @@ -4939,8 +4939,9 @@ hpread_type_lookup (dnttpointer hp_type, * "m_void" modifiers? Is static_flag really needed here? * (m_static used for methods of classes, elsewhere). */ - tmp_type = make_cv_type (dn_bufp->dmodifier.m_const, + tmp_type = make_cvr_type (dn_bufp->dmodifier.m_const, dn_bufp->dmodifier.m_volatile, + 0, hpread_type_lookup (dn_bufp->dmodifier.type, objfile), 0); return tmp_type; Modified: stable/9/contrib/gdb/gdb/parse.c ============================================================================== --- stable/9/contrib/gdb/gdb/parse.c Mon Oct 21 16:46:12 2013 (r256850) +++ stable/9/contrib/gdb/gdb/parse.c Mon Oct 21 18:20:20 2013 (r256851) @@ -1167,13 +1167,15 @@ follow_types (struct type *follow_type) case tp_end: done = 1; if (make_const) - follow_type = make_cv_type (make_const, - TYPE_VOLATILE (follow_type), - follow_type, 0); + follow_type = make_cvr_type (make_const, + TYPE_VOLATILE (follow_type), + TYPE_RESTRICT (follow_type), + follow_type, 0); if (make_volatile) - follow_type = make_cv_type (TYPE_CONST (follow_type), - make_volatile, - follow_type, 0); + follow_type = make_cvr_type (TYPE_CONST (follow_type), + make_volatile, + TYPE_RESTRICT (follow_type), + follow_type, 0); if (make_addr_space) follow_type = make_type_with_address_space (follow_type, make_addr_space); @@ -1192,13 +1194,15 @@ follow_types (struct type *follow_type) case tp_pointer: follow_type = lookup_pointer_type (follow_type); if (make_const) - follow_type = make_cv_type (make_const, - TYPE_VOLATILE (follow_type), - follow_type, 0); + follow_type = make_cvr_type (make_const, + TYPE_VOLATILE (follow_type), + TYPE_RESTRICT (follow_type), + follow_type, 0); if (make_volatile) - follow_type = make_cv_type (TYPE_CONST (follow_type), - make_volatile, - follow_type, 0); + follow_type = make_cvr_type (TYPE_CONST (follow_type), + make_volatile, + TYPE_RESTRICT (follow_type), + follow_type, 0); if (make_addr_space) follow_type = make_type_with_address_space (follow_type, make_addr_space); @@ -1208,13 +1212,15 @@ follow_types (struct type *follow_type) case tp_reference: follow_type = lookup_reference_type (follow_type); if (make_const) - follow_type = make_cv_type (make_const, - TYPE_VOLATILE (follow_type), - follow_type, 0); + follow_type = make_cvr_type (make_const, + TYPE_VOLATILE (follow_type), + TYPE_RESTRICT (follow_type), + follow_type, 0); if (make_volatile) - follow_type = make_cv_type (TYPE_CONST (follow_type), - make_volatile, - follow_type, 0); + follow_type = make_cvr_type (TYPE_CONST (follow_type), + make_volatile, + TYPE_RESTRICT (follow_type), + follow_type, 0); if (make_addr_space) follow_type = make_type_with_address_space (follow_type, make_addr_space); Modified: stable/9/contrib/gdb/gdb/stabsread.c ============================================================================== --- stable/9/contrib/gdb/gdb/stabsread.c Mon Oct 21 16:46:12 2013 (r256850) +++ stable/9/contrib/gdb/gdb/stabsread.c Mon Oct 21 18:20:20 2013 (r256851) @@ -1750,13 +1750,13 @@ again: case 'k': /* Const qualifier on some type (Sun) */ type = read_type (pp, objfile); - type = make_cv_type (1, TYPE_VOLATILE (type), type, + type = make_cvr_type (1, TYPE_VOLATILE (type), TYPE_RESTRICT(type), type, dbx_lookup_type (typenums)); break; case 'B': /* Volatile qual on some type (Sun) */ type = read_type (pp, objfile); - type = make_cv_type (TYPE_CONST (type), 1, type, + type = make_cvr_type (TYPE_CONST (type), 1, TYPE_RESTRICT(type), type, dbx_lookup_type (typenums)); break; From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 18:23:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CF608DA3; Mon, 21 Oct 2013 18:23:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A2F782B3F; Mon, 21 Oct 2013 18:23:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LINHRe066859; Mon, 21 Oct 2013 18:23:17 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LINHRa066840; Mon, 21 Oct 2013 18:23:17 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201310211823.r9LINHRa066840@svn.freebsd.org> From: Ed Maste Date: Mon, 21 Oct 2013 18:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256852 - in stable/9/contrib: binutils/include/elf gdb/gdb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 18:23:17 -0000 Author: emaste Date: Mon Oct 21 18:23:16 2013 New Revision: 256852 URL: http://svnweb.freebsd.org/changeset/base/256852 Log: MFC r251665: Handle DW_TAG_rvalue_reference_type 2012-05-21 Jim Ingham * dwarf2read.c (process_die): Handle DW_TAG_rvalue_reference_type. (read_type_die): Ditto. (dwarf_tag_name): Ditto. * elf/dwarf2.h: Add DW_TAG_rvalue_reference_type. Obtained from: Apple, gdb-1820 Modified: stable/9/contrib/binutils/include/elf/dwarf2.h stable/9/contrib/gdb/gdb/dwarf2read.c Directory Properties: stable/9/contrib/binutils/ (props changed) stable/9/contrib/gdb/ (props changed) Modified: stable/9/contrib/binutils/include/elf/dwarf2.h ============================================================================== --- stable/9/contrib/binutils/include/elf/dwarf2.h Mon Oct 21 18:20:20 2013 (r256851) +++ stable/9/contrib/binutils/include/elf/dwarf2.h Mon Oct 21 18:23:16 2013 (r256852) @@ -189,6 +189,7 @@ enum dwarf_tag DW_TAG_imported_unit = 0x3d, DW_TAG_condition = 0x3f, DW_TAG_shared_type = 0x40, + DW_TAG_rvalue_reference_type = 0x42, /* SGI/MIPS Extensions. */ DW_TAG_MIPS_loop = 0x4081, /* HP extensions. See: ftp://ftp.hp.com/pub/lang/tools/WDB/wdb-4.0.tar.gz . */ Modified: stable/9/contrib/gdb/gdb/dwarf2read.c ============================================================================== --- stable/9/contrib/gdb/gdb/dwarf2read.c Mon Oct 21 18:20:20 2013 (r256851) +++ stable/9/contrib/gdb/gdb/dwarf2read.c Mon Oct 21 18:23:16 2013 (r256852) @@ -1977,6 +1977,7 @@ process_die (struct die_info *die, struc read_tag_ptr_to_member_type (die, cu); break; case DW_TAG_reference_type: + case DW_TAG_rvalue_reference_type: read_tag_reference_type (die, cu); break; case DW_TAG_string_type: @@ -6097,6 +6098,7 @@ read_type_die (struct die_info *die, str read_tag_ptr_to_member_type (die, cu); break; case DW_TAG_reference_type: + case DW_TAG_rvalue_reference_type: read_tag_reference_type (die, cu); break; case DW_TAG_const_type: @@ -6425,6 +6427,8 @@ dwarf_tag_name (unsigned tag) return "DW_TAG_pointer_type"; case DW_TAG_reference_type: return "DW_TAG_reference_type"; + case DW_TAG_rvalue_reference_type: + return "DW_TAG_rvalue_reference_type"; case DW_TAG_compile_unit: return "DW_TAG_compile_unit"; case DW_TAG_string_type: From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 18:25:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C3020FEC; Mon, 21 Oct 2013 18:25:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 948182B62; Mon, 21 Oct 2013 18:25:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LIPaxm067874; Mon, 21 Oct 2013 18:25:36 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LIPavK067873; Mon, 21 Oct 2013 18:25:36 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201310211825.r9LIPavK067873@svn.freebsd.org> From: Ed Maste Date: Mon, 21 Oct 2013 18:25:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256853 - stable/9/contrib/gdb/gdb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 18:25:36 -0000 Author: emaste Date: Mon Oct 21 18:25:36 2013 New Revision: 256853 URL: http://svnweb.freebsd.org/changeset/base/256853 Log: MFC r251667: Handle DW_TAG_unspecified_type 2011-11-14 Jim Ingham * dwarf2read.c (read_type_die): Handle DW_TAG_unspecified_type. (read_tag_unspecified_type): New function, add a type for the DW_TAG_unspecified_type die. Obtained from: Apple, gdb-1752 Modified: stable/9/contrib/gdb/gdb/dwarf2read.c Directory Properties: stable/9/contrib/gdb/ (props changed) Modified: stable/9/contrib/gdb/gdb/dwarf2read.c ============================================================================== --- stable/9/contrib/gdb/gdb/dwarf2read.c Mon Oct 21 18:23:16 2013 (r256852) +++ stable/9/contrib/gdb/gdb/dwarf2read.c Mon Oct 21 18:25:36 2013 (r256853) @@ -825,6 +825,8 @@ static void read_array_type (struct die_ static void read_tag_pointer_type (struct die_info *, struct dwarf2_cu *); +static void read_tag_unspecified_type (struct die_info *, struct dwarf2_cu *); + static void read_tag_ptr_to_member_type (struct die_info *, struct dwarf2_cu *); @@ -3722,6 +3724,27 @@ read_tag_reference_type (struct die_info } static void +read_tag_unspecified_type (struct die_info *die, struct dwarf2_cu *cu) +{ + struct objfile *objfile = cu->objfile; + struct type *type; + struct attribute *attr; + + if (die->type) + { + return; + } + + type = alloc_type (objfile); + TYPE_LENGTH (type) = 0; + attr = dwarf2_attr (die, DW_AT_name, cu); + if (attr && DW_STRING (attr)) + TYPE_NAME (type) = DW_STRING (attr); + + die->type = type; +} + +static void read_tag_const_type (struct die_info *die, struct dwarf2_cu *cu) { struct type *base_type; @@ -6094,6 +6117,9 @@ read_type_die (struct die_info *die, str case DW_TAG_pointer_type: read_tag_pointer_type (die, cu); break; + case DW_TAG_unspecified_type: + read_tag_unspecified_type (die, cu); + break; case DW_TAG_ptr_to_member_type: read_tag_ptr_to_member_type (die, cu); break; From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 18:26:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A662C25D; Mon, 21 Oct 2013 18:26:23 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 48EAC2B6B; Mon, 21 Oct 2013 18:26:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LIQNfX068244; Mon, 21 Oct 2013 18:26:23 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LIQNWi068243; Mon, 21 Oct 2013 18:26:23 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201310211826.r9LIQNWi068243@svn.freebsd.org> From: Ed Maste Date: Mon, 21 Oct 2013 18:26:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256854 - stable/9/contrib/gdb/gdb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 18:26:23 -0000 Author: emaste Date: Mon Oct 21 18:26:22 2013 New Revision: 256854 URL: http://svnweb.freebsd.org/changeset/base/256854 Log: MFC r251844: Include die tag in error message Modified: stable/9/contrib/gdb/gdb/dwarf2read.c Directory Properties: stable/9/contrib/gdb/ (props changed) Modified: stable/9/contrib/gdb/gdb/dwarf2read.c ============================================================================== --- stable/9/contrib/gdb/gdb/dwarf2read.c Mon Oct 21 18:25:36 2013 (r256853) +++ stable/9/contrib/gdb/gdb/dwarf2read.c Mon Oct 21 18:26:22 2013 (r256854) @@ -6082,8 +6082,8 @@ tag_type_to_type (struct die_info *die, if (!die->type) { dump_die (die); - error ("Dwarf Error: Cannot find type of die [in module %s]", - cu->objfile->name); + error ("Dwarf Error: Cannot find type of die 0x%x [in module %s]", + die->tag, cu->objfile->name); } return die->type; } From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 18:47:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A985CBA7; Mon, 21 Oct 2013 18:47:02 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 964412CAD; Mon, 21 Oct 2013 18:47:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LIl2P6078486; Mon, 21 Oct 2013 18:47:02 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LIl2sR078485; Mon, 21 Oct 2013 18:47:02 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310211847.r9LIl2sR078485@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 21 Oct 2013 18:47:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256855 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 18:47:02 -0000 Author: nwhitehorn Date: Mon Oct 21 18:47:02 2013 New Revision: 256855 URL: http://svnweb.freebsd.org/changeset/base/256855 Log: Use standard ofw_bus helpers instead of reinventing the wheel. Modified: head/sys/powerpc/powerpc/nexus.c Modified: head/sys/powerpc/powerpc/nexus.c ============================================================================== --- head/sys/powerpc/powerpc/nexus.c Mon Oct 21 18:26:22 2013 (r256854) +++ head/sys/powerpc/powerpc/nexus.c Mon Oct 21 18:47:02 2013 (r256855) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -88,19 +89,8 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_NEXUS, "nexus", "nexus device information"); -enum nexus_ivars { - NEXUS_IVAR_NODE, - NEXUS_IVAR_NAME, - NEXUS_IVAR_DEVICE_TYPE, - NEXUS_IVAR_COMPATIBLE, -}; - struct nexus_devinfo { - phandle_t ndi_node; - /* Some common properties. */ - const char *ndi_name; - const char *ndi_device_type; - const char *ndi_compatible; + struct ofw_bus_devinfo ndi_ofwinfo; }; struct nexus_softc { @@ -118,8 +108,6 @@ static int nexus_attach(device_t); */ static device_t nexus_add_child(device_t, u_int, const char *, int); static void nexus_probe_nomatch(device_t, device_t); -static int nexus_read_ivar(device_t, device_t, int, uintptr_t *); -static int nexus_write_ivar(device_t, device_t, int, uintptr_t); #ifdef SMP static int nexus_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu); @@ -138,14 +126,8 @@ static int nexus_deactivate_resource(dev struct resource *); static int nexus_release_resource(device_t, device_t, int, int, struct resource *); - -/* - * OFW bus interface. - */ -static phandle_t nexus_ofw_get_node(device_t, device_t); -static const char *nexus_ofw_get_name(device_t, device_t); -static const char *nexus_ofw_get_type(device_t, device_t); -static const char *nexus_ofw_get_compat(device_t, device_t); +static const struct ofw_bus_devinfo *nexus_get_devinfo(device_t dev, + device_t child); /* * Local routines @@ -165,8 +147,6 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_add_child, nexus_add_child), DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), DEVMETHOD(bus_probe_nomatch, nexus_probe_nomatch), - DEVMETHOD(bus_read_ivar, nexus_read_ivar), - DEVMETHOD(bus_write_ivar, nexus_write_ivar), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), #ifdef SMP @@ -179,10 +159,12 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_release_resource, nexus_release_resource), /* OFW bus interface */ - DEVMETHOD(ofw_bus_get_node, nexus_ofw_get_node), - DEVMETHOD(ofw_bus_get_name, nexus_ofw_get_name), - DEVMETHOD(ofw_bus_get_type, nexus_ofw_get_type), - DEVMETHOD(ofw_bus_get_compat, nexus_ofw_get_compat), + DEVMETHOD(ofw_bus_get_devinfo, nexus_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), DEVMETHOD_END }; @@ -246,14 +228,13 @@ nexus_attach(device_t dev) static void nexus_probe_nomatch(device_t dev, device_t child) { - char *name, *type; + const char *name, *type; - if (BUS_READ_IVAR(dev, child, NEXUS_IVAR_NAME, - (uintptr_t *)&name) != 0 || - BUS_READ_IVAR(dev, child, NEXUS_IVAR_DEVICE_TYPE, - (uintptr_t *)&type) != 0) - return; + name = ofw_bus_get_name(child); + type = ofw_bus_get_type(child); + if (name == NULL) + name = "unknown"; if (type == NULL) type = "(unknown)"; @@ -276,67 +257,17 @@ nexus_add_child(device_t dev, u_int orde if (dinfo == NULL) return (NULL); - dinfo->ndi_node = -1; - dinfo->ndi_name = name; + dinfo->ndi_ofwinfo.obd_node = -1; + dinfo->ndi_ofwinfo.obd_name = NULL; + dinfo->ndi_ofwinfo.obd_compat = NULL; + dinfo->ndi_ofwinfo.obd_type = NULL; + dinfo->ndi_ofwinfo.obd_model = NULL; + device_set_ivars(child, dinfo); return (child); } - -static int -nexus_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) -{ - struct nexus_devinfo *dinfo; - - if ((dinfo = device_get_ivars(child)) == 0) - return (ENOENT); - switch (which) { - case NEXUS_IVAR_NODE: - *result = dinfo->ndi_node; - break; - case NEXUS_IVAR_NAME: - *result = (uintptr_t)dinfo->ndi_name; - break; - case NEXUS_IVAR_DEVICE_TYPE: - *result = (uintptr_t)dinfo->ndi_device_type; - break; - case NEXUS_IVAR_COMPATIBLE: - *result = (uintptr_t)dinfo->ndi_compatible; - break; - default: - return (ENOENT); - } - return 0; -} - -static int -nexus_write_ivar(device_t dev, device_t child, int which, uintptr_t value) -{ - struct nexus_devinfo *dinfo; - - if ((dinfo = device_get_ivars(child)) == 0) - return (ENOENT); - - switch (which) { - case NEXUS_IVAR_NAME: - return (EINVAL); - - /* Identified devices may want to set these */ - case NEXUS_IVAR_NODE: - dinfo->ndi_node = (phandle_t)value; - break; - - case NEXUS_IVAR_DEVICE_TYPE: - dinfo->ndi_device_type = (char *)value; - break; - - default: - return (ENOENT); - } - return 0; -} - static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, driver_filter_t *filter, driver_intr_t *ihand, void *arg, void **cookiep) @@ -462,66 +393,23 @@ nexus_device_from_node(device_t parent, { device_t cdev; struct nexus_devinfo *dinfo; - char *name, *type, *compatible; - OF_getprop_alloc(node, "name", 1, (void **)&name); - OF_getprop_alloc(node, "device_type", 1, (void **)&type); - OF_getprop_alloc(node, "compatible", 1, (void **)&compatible); cdev = device_add_child(parent, NULL, -1); if (cdev != NULL) { dinfo = malloc(sizeof(*dinfo), M_NEXUS, M_WAITOK); - dinfo->ndi_node = node; - dinfo->ndi_name = name; - dinfo->ndi_device_type = type; - dinfo->ndi_compatible = compatible; + ofw_bus_gen_setup_devinfo(&dinfo->ndi_ofwinfo, node); device_set_ivars(cdev, dinfo); - } else - free(name, M_OFWPROP); + } return (cdev); } -static const char * -nexus_ofw_get_name(device_t bus, device_t dev) -{ - struct nexus_devinfo *dinfo; - - if ((dinfo = device_get_ivars(dev)) == NULL) - return (NULL); - - return (dinfo->ndi_name); -} - -static phandle_t -nexus_ofw_get_node(device_t bus, device_t dev) -{ - struct nexus_devinfo *dinfo; - - if ((dinfo = device_get_ivars(dev)) == NULL) - return (0); - - return (dinfo->ndi_node); -} - -static const char * -nexus_ofw_get_type(device_t bus, device_t dev) +static const struct ofw_bus_devinfo * +nexus_get_devinfo(device_t dev, device_t child) { struct nexus_devinfo *dinfo; - if ((dinfo = device_get_ivars(dev)) == NULL) - return (NULL); - - return (dinfo->ndi_device_type); -} - -static const char * -nexus_ofw_get_compat(device_t bus, device_t dev) -{ - struct nexus_devinfo *dinfo; - - if ((dinfo = device_get_ivars(dev)) == NULL) - return (NULL); - - return (dinfo->ndi_compatible); + dinfo = device_get_ivars(child); + return (&dinfo->ndi_ofwinfo); } From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 19:11:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 11C3F49A; Mon, 21 Oct 2013 19:11:16 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E364C2E49; Mon, 21 Oct 2013 19:11:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LJBFli093142; Mon, 21 Oct 2013 19:11:15 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LJBF1I093130; Mon, 21 Oct 2013 19:11:15 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201310211911.r9LJBF1I093130@svn.freebsd.org> From: Andreas Tobler Date: Mon, 21 Oct 2013 19:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256857 - stable/10/sys/powerpc/powermac X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 19:11:16 -0000 Author: andreast Date: Mon Oct 21 19:11:15 2013 New Revision: 256857 URL: http://svnweb.freebsd.org/changeset/base/256857 Log: MFC: 256555 Move the resource allocation from the ata_*_probe section to the ata_*_attach section. This prevents a boot crash on nearly all iMacs and PowerMacs/Books. The allocation in the probe section was working before because ata_probe was returning 0 which did not invoke a second DEVICE_PROBE. Now it returns a BUS_PROBE_DEFAULT which can invoke a second DEVICE_PROBE which results in a "failed to reserve resource" exit. PR: powerpc/182978 Approved by: re(gjb) Modified: stable/10/sys/powerpc/powermac/ata_kauai.c stable/10/sys/powerpc/powermac/ata_macio.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/powerpc/powermac/ata_kauai.c ============================================================================== --- stable/10/sys/powerpc/powermac/ata_kauai.c Mon Oct 21 18:47:29 2013 (r256856) +++ stable/10/sys/powerpc/powermac/ata_kauai.c Mon Oct 21 19:11:15 2013 (r256857) @@ -194,12 +194,11 @@ static const u_int udma_timing_shasta[] static int ata_kauai_probe(device_t dev) { - struct ata_channel *ch; struct ata_kauai_softc *sc; u_int32_t devid; phandle_t node; const char *compatstring = NULL; - int i, found, rid; + int i, found; found = 0; devid = pci_get_devid(dev); @@ -216,7 +215,6 @@ ata_kauai_probe(device_t dev) node = ofw_bus_get_node(dev); sc = device_get_softc(dev); bzero(sc, sizeof(struct ata_kauai_softc)); - ch = &sc->sc_ch.sc_ch; compatstring = ofw_bus_get_compat(dev); if (compatstring != NULL && strcmp(compatstring,"shasta-ata") == 0) @@ -227,32 +225,6 @@ ata_kauai_probe(device_t dev) (compatstring == NULL || strcmp(compatstring, "K2-UATA") != 0)) bus_set_resource(dev, SYS_RES_IRQ, 0, 39, 1); - rid = PCIR_BARS; - sc->sc_memr = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, - RF_ACTIVE); - if (sc->sc_memr == NULL) { - device_printf(dev, "could not allocate memory\n"); - return (ENXIO); - } - - /* - * Set up the resource vectors - */ - for (i = ATA_DATA; i <= ATA_COMMAND; i++) { - ch->r_io[i].res = sc->sc_memr; - ch->r_io[i].offset = i*ATA_KAUAI_REGGAP + ATA_KAUAI_REGOFFSET; - } - ch->r_io[ATA_CONTROL].res = sc->sc_memr; - ch->r_io[ATA_CONTROL].offset = ATA_KAUAI_ALTOFFSET; - ata_default_registers(dev); - - ch->unit = 0; - ch->flags |= ATA_USE_16BIT; - - /* XXX: ATAPI DMA is unreliable. We should find out why. */ - ch->flags |= ATA_NO_ATAPI_DMA; - ata_generic_hw(dev); - return (ata_probe(dev)); } @@ -272,12 +244,42 @@ static int ata_kauai_attach(device_t dev) { struct ata_kauai_softc *sc = device_get_softc(dev); + struct ata_channel *ch; + int i, rid; #if USE_DBDMA_IRQ int dbdma_irq_rid = 1; struct resource *dbdma_irq; void *cookie; #endif + ch = &sc->sc_ch.sc_ch; + + rid = PCIR_BARS; + sc->sc_memr = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->sc_memr == NULL) { + device_printf(dev, "could not allocate memory\n"); + return (ENXIO); + } + + /* + * Set up the resource vectors + */ + for (i = ATA_DATA; i <= ATA_COMMAND; i++) { + ch->r_io[i].res = sc->sc_memr; + ch->r_io[i].offset = i*ATA_KAUAI_REGGAP + ATA_KAUAI_REGOFFSET; + } + ch->r_io[ATA_CONTROL].res = sc->sc_memr; + ch->r_io[ATA_CONTROL].offset = ATA_KAUAI_ALTOFFSET; + ata_default_registers(dev); + + ch->unit = 0; + ch->flags |= ATA_USE_16BIT; + + /* XXX: ATAPI DMA is unreliable. We should find out why. */ + ch->flags |= ATA_NO_ATAPI_DMA; + ata_generic_hw(dev); + pci_enable_busmaster(dev); /* Init DMA engine */ Modified: stable/10/sys/powerpc/powermac/ata_macio.c ============================================================================== --- stable/10/sys/powerpc/powermac/ata_macio.c Mon Oct 21 18:47:29 2013 (r256856) +++ stable/10/sys/powerpc/powermac/ata_macio.c Mon Oct 21 19:11:15 2013 (r256857) @@ -152,8 +152,6 @@ ata_macio_probe(device_t dev) const char *type = ofw_bus_get_type(dev); const char *name = ofw_bus_get_name(dev); struct ata_macio_softc *sc; - struct ata_channel *ch; - int rid, i; if (strcmp(type, "ata") != 0 && strcmp(type, "ide") != 0) @@ -161,7 +159,6 @@ ata_macio_probe(device_t dev) sc = device_get_softc(dev); bzero(sc, sizeof(struct ata_macio_softc)); - ch = &sc->sc_ch.sc_ch; if (strcmp(name,"ata-4") == 0) { device_set_desc(dev,"Apple MacIO Ultra ATA Controller"); @@ -173,7 +170,23 @@ ata_macio_probe(device_t dev) sc->max_mode = ATA_WDMA2; } + return (ata_probe(dev)); +} + +static int +ata_macio_attach(device_t dev) +{ + struct ata_macio_softc *sc = device_get_softc(dev); + uint32_t timingreg; + struct ata_channel *ch; + int rid, i; + + /* + * Allocate resources + */ + rid = 0; + ch = &sc->sc_ch.sc_ch; sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->sc_mem == NULL) { @@ -196,15 +209,6 @@ ata_macio_probe(device_t dev) ch->flags |= ATA_USE_16BIT | ATA_NO_ATAPI_DMA; ata_generic_hw(dev); - return (ata_probe(dev)); -} - -static int -ata_macio_attach(device_t dev) -{ - struct ata_macio_softc *sc = device_get_softc(dev); - uint32_t timingreg; - #if USE_DBDMA_IRQ int dbdma_irq_rid = 1; struct resource *dbdma_irq; From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 20:38:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 76F079DD; Mon, 21 Oct 2013 20:38:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6401C247F; Mon, 21 Oct 2013 20:38:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LKc31C039454; Mon, 21 Oct 2013 20:38:03 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LKc3uh039452; Mon, 21 Oct 2013 20:38:03 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201310212038.r9LKc3uh039452@svn.freebsd.org> From: Ed Maste Date: Mon, 21 Oct 2013 20:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256859 - head/contrib/binutils/gas/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 20:38:03 -0000 Author: emaste Date: Mon Oct 21 20:38:02 2013 New Revision: 256859 URL: http://svnweb.freebsd.org/changeset/base/256859 Log: Don't force 64-bit DWARF2 on MIPS 64-bit debug data is only necessary for objects with greater than 4GB of debug data, and is not used on other 64-bit FreeBSD targets. Sponsored by: DARPA, AFRL Modified: head/contrib/binutils/gas/config/tc-mips.c head/contrib/binutils/gas/config/tc-mips.h Modified: head/contrib/binutils/gas/config/tc-mips.c ============================================================================== --- head/contrib/binutils/gas/config/tc-mips.c Mon Oct 21 19:21:36 2013 (r256858) +++ head/contrib/binutils/gas/config/tc-mips.c Mon Oct 21 20:38:02 2013 (r256859) @@ -15420,21 +15420,6 @@ MIPS options:\n\ -mno-octeon-useun generate MIPS unaligned load/store instructions\n")); } -enum dwarf2_format -mips_dwarf2_format (void) -{ - if (HAVE_64BIT_SYMBOLS) - { -#ifdef TE_IRIX - return dwarf2_format_64bit_irix; -#else - return dwarf2_format_64bit; -#endif - } - else - return dwarf2_format_32bit; -} - int mips_dwarf2_addr_size (void) { Modified: head/contrib/binutils/gas/config/tc-mips.h ============================================================================== --- head/contrib/binutils/gas/config/tc-mips.h Mon Oct 21 19:21:36 2013 (r256858) +++ head/contrib/binutils/gas/config/tc-mips.h Mon Oct 21 20:38:02 2013 (r256859) @@ -155,10 +155,6 @@ extern void mips_emit_delays (void); extern void mips_enable_auto_align (void); #define md_elf_section_change_hook() mips_enable_auto_align() -enum dwarf2_format; -extern enum dwarf2_format mips_dwarf2_format (void); -#define DWARF2_FORMAT() mips_dwarf2_format () - extern int mips_dwarf2_addr_size (void); #define DWARF2_ADDR_SIZE(bfd) mips_dwarf2_addr_size () From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 20:51:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5FF0EED2; Mon, 21 Oct 2013 20:51:09 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1B92552; Mon, 21 Oct 2013 20:51:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LKp9Vb048435; Mon, 21 Oct 2013 20:51:09 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LKp9qr048434; Mon, 21 Oct 2013 20:51:09 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310212051.r9LKp9qr048434@svn.freebsd.org> From: Brooks Davis Date: Mon, 21 Oct 2013 20:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256860 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 20:51:09 -0000 Author: brooks Date: Mon Oct 21 20:51:08 2013 New Revision: 256860 URL: http://svnweb.freebsd.org/changeset/base/256860 Log: Allow kernels without options SOFTUPDATES to build. This should fix the embedded tinderboxes. Reviewed by: emaste Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Mon Oct 21 20:38:02 2013 (r256859) +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Oct 21 20:51:08 2013 (r256860) @@ -2221,6 +2221,7 @@ ffs_own_mount(const struct mount *mp) } #ifdef DDB +#ifdef SOFTUPDATES /* defined in ffs_softdep.c */ extern void db_print_ffs(struct ufsmount *ump); @@ -2242,4 +2243,5 @@ DB_SHOW_COMMAND(ffs, db_show_ffs) } } +#endif /* SOFTUPDATES */ #endif /* DDB */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 21:13:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A16556B4; Mon, 21 Oct 2013 21:13:02 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8DDDD2686; Mon, 21 Oct 2013 21:13:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LLD2mm060006; Mon, 21 Oct 2013 21:13:02 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LLD1ZB059998; Mon, 21 Oct 2013 21:13:01 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310212113.r9LLD1ZB059998@svn.freebsd.org> From: Brooks Davis Date: Mon, 21 Oct 2013 21:13:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256861 - in head/sys: conf dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 21:13:02 -0000 Author: brooks Date: Mon Oct 21 21:13:01 2013 New Revision: 256861 URL: http://svnweb.freebsd.org/changeset/base/256861 Log: MFP4: 223121 (FDT infrastructure portion) Implement support for interrupt-parent nodes in simplebus. The current implementation requires that device declarations have an interrupt-parent node and that it point to a device that has registered itself as a interrupt controller in fdt_ic_list_head and implements the fdt_ic interface. Sponsored by: DARPA/AFRL Added: head/sys/dev/fdt/fdt_ic_if.m (contents, props changed) - copied, changed from r256860, head/sys/kern/bus_if.m Modified: head/sys/conf/files head/sys/dev/fdt/fdt_common.c head/sys/dev/fdt/fdt_common.h head/sys/dev/fdt/simplebus.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Oct 21 20:51:08 2013 (r256860) +++ head/sys/conf/files Mon Oct 21 21:13:01 2013 (r256861) @@ -1401,6 +1401,7 @@ dev/exca/exca.c optional cbb dev/fatm/if_fatm.c optional fatm pci dev/fb/splash.c optional splash dev/fdt/fdt_common.c optional fdt +dev/fdt/fdt_ic_if.m optional fdt dev/fdt/fdt_pci.c optional fdt pci dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static \ Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Mon Oct 21 20:51:08 2013 (r256860) +++ head/sys/dev/fdt/fdt_common.c Mon Oct 21 21:13:01 2013 (r256861) @@ -63,6 +63,8 @@ vm_paddr_t fdt_immr_pa; vm_offset_t fdt_immr_va; vm_offset_t fdt_immr_size; +struct fdt_ic_list fdt_ic_list_head = SLIST_HEAD_INITIALIZER(fdt_ic_list_head); + int fdt_get_range(phandle_t node, int range_id, u_long *base, u_long *size) { Modified: head/sys/dev/fdt/fdt_common.h ============================================================================== --- head/sys/dev/fdt/fdt_common.h Mon Oct 21 20:51:08 2013 (r256860) +++ head/sys/dev/fdt/fdt_common.h Mon Oct 21 21:13:01 2013 (r256861) @@ -70,6 +70,13 @@ struct fdt_fixup_entry { }; extern struct fdt_fixup_entry fdt_fixup_table[]; +extern SLIST_HEAD(fdt_ic_list, fdt_ic) fdt_ic_list_head; +struct fdt_ic { + SLIST_ENTRY(fdt_ic) fdt_ics; + ihandle_t iph; + device_t dev; +}; + extern vm_paddr_t fdt_immr_pa; extern vm_offset_t fdt_immr_va; extern vm_offset_t fdt_immr_size; Copied and modified: head/sys/dev/fdt/fdt_ic_if.m (from r256860, head/sys/kern/bus_if.m) ============================================================================== --- head/sys/kern/bus_if.m Mon Oct 21 20:51:08 2013 (r256860, copy source) +++ head/sys/dev/fdt/fdt_ic_if.m Mon Oct 21 21:13:01 2013 (r256861) @@ -1,4 +1,5 @@ #- +# Copyright (c) 2013 SRI International # Copyright (c) 1998-2004 Doug Rabson # All rights reserved. # @@ -31,327 +32,79 @@ #include /** - * @defgroup BUS bus - KObj methods for drivers of devices with children - * @brief A set of methods required device drivers that support - * child devices. + * @defgroup FST_IC fdt_ic - KObj methods for interrupt controllers + * @brief A set of methods required device drivers that are interrupt + * controllers. Derived from sys/kern/bus_if.m. * @{ */ -INTERFACE bus; - -# -# Default implementations of some methods. -# -CODE { - static struct resource * - null_alloc_resource(device_t dev, device_t child, - int type, int *rid, u_long start, u_long end, - u_long count, u_int flags) - { - return (0); - } - - static int - null_remap_intr(device_t bus, device_t dev, u_int irq) - { - - if (dev != NULL) - return (BUS_REMAP_INTR(dev, NULL, irq)); - return (ENXIO); - } - - static device_t - null_add_child(device_t bus, int order, const char *name, - int unit) - { - - panic("bus_add_child is not implemented"); - } -}; - -/** - * @brief Print a description of a child device - * - * This is called from system code which prints out a description of a - * device. It should describe the attachment that the child has with - * the parent. For instance the TurboLaser bus prints which node the - * device is attached to. See bus_generic_print_child() for more - * information. - * - * @param _dev the device whose child is being printed - * @param _child the child device to describe - * - * @returns the number of characters output. - */ -METHOD int print_child { - device_t _dev; - device_t _child; -} DEFAULT bus_generic_print_child; - -/** - * @brief Print a notification about an unprobed child device. - * - * Called for each child device that did not succeed in probing for a - * driver. - * - * @param _dev the device whose child was being probed - * @param _child the child device which failed to probe - */ -METHOD void probe_nomatch { - device_t _dev; - device_t _child; -}; - -/** - * @brief Read the value of a bus-specific attribute of a device - * - * This method, along with BUS_WRITE_IVAR() manages a bus-specific set - * of instance variables of a child device. The intention is that - * each different type of bus defines a set of appropriate instance - * variables (such as ports and irqs for ISA bus etc.) - * - * This information could be given to the child device as a struct but - * that makes it hard for a bus to add or remove variables without - * forcing an edit and recompile for all drivers which may not be - * possible for vendor supplied binary drivers. - * - * This method copies the value of an instance variable to the - * location specified by @p *_result. - * - * @param _dev the device whose child was being examined - * @param _child the child device whose instance variable is - * being read - * @param _index the instance variable to read - * @param _result a loction to recieve the instance variable - * value - * - * @retval 0 success - * @retval ENOENT no such instance variable is supported by @p - * _dev - */ -METHOD int read_ivar { - device_t _dev; - device_t _child; - int _index; - uintptr_t *_result; -}; - -/** - * @brief Write the value of a bus-specific attribute of a device - * - * This method sets the value of an instance variable to @p _value. - * - * @param _dev the device whose child was being updated - * @param _child the child device whose instance variable is - * being written - * @param _index the instance variable to write - * @param _value the value to write to that instance variable - * - * @retval 0 success - * @retval ENOENT no such instance variable is supported by @p - * _dev - * @retval EINVAL the instance variable was recognised but - * contains a read-only value - */ -METHOD int write_ivar { - device_t _dev; - device_t _child; - int _indx; - uintptr_t _value; -}; +INTERFACE fdt_ic; /** - * @brief Notify a bus that a child was deleted + * @brief Allocate an interrupt resource * - * Called at the beginning of device_delete_child() to allow the parent - * to teardown any bus-specific state for the child. - * - * @param _dev the device whose child is being deleted - * @param _child the child device which is being deleted - */ -METHOD void child_deleted { - device_t _dev; - device_t _child; -}; - -/** - * @brief Notify a bus that a child was detached + * This method is called by child devices of an interrupt controller to + * allocate an interrup. The meaning of the resource-ID field varies + * from bus to bus and is opaque to the interrupt controller. If a + * resource was allocated and the caller did not use the RF_ACTIVE + * to specify that it should be activated immediately, the caller is + * responsible for calling FDT_IC_ACTIVATE_INTR() when it actually uses + * the interupt. * - * Called after the child's DEVICE_DETACH() method to allow the parent - * to reclaim any resources allocated on behalf of the child. - * - * @param _dev the device whose child changed state - * @param _child the child device which changed state - */ -METHOD void child_detached { - device_t _dev; - device_t _child; -}; - -/** - * @brief Notify a bus that a new driver was added - * - * Called when a new driver is added to the devclass which owns this - * bus. The generic implementation of this method attempts to probe and - * attach any un-matched children of the bus. - * - * @param _dev the device whose devclass had a new driver - * added to it - * @param _driver the new driver which was added - */ -METHOD void driver_added { - device_t _dev; - driver_t *_driver; -} DEFAULT bus_generic_driver_added; - -/** - * @brief Create a new child device - * - * For busses which use use drivers supporting DEVICE_IDENTIFY() to - * enumerate their devices, this method is used to create new - * device instances. The new device will be added after the last - * existing child with the same order. - * - * @param _dev the bus device which will be the parent of the - * new child device - * @param _order a value which is used to partially sort the - * children of @p _dev - devices created using - * lower values of @p _order appear first in @p - * _dev's list of children - * @param _name devclass name for new device or @c NULL if not - * specified - * @param _unit unit number for new device or @c -1 if not - * specified - */ -METHOD device_t add_child { - device_t _dev; - u_int _order; - const char *_name; - int _unit; -} DEFAULT null_add_child; - -/** - * @brief Allocate a system resource - * - * This method is called by child devices of a bus to allocate resources. - * The types are defined in ; the meaning of the - * resource-ID field varies from bus to bus (but @p *rid == 0 is always - * valid if the resource type is). If a resource was allocated and the - * caller did not use the RF_ACTIVE to specify that it should be - * activated immediately, the caller is responsible for calling - * BUS_ACTIVATE_RESOURCE() when it actually uses the resource. - * - * @param _dev the parent device of @p _child + * @param _dev the interrupt-parent device of @p _child * @param _child the device which is requesting an allocation - * @param _type the type of resource to allocate * @param _rid a pointer to the resource identifier - * @param _start hint at the start of the resource range - pass - * @c 0UL for any start address - * @param _end hint at the end of the resource range - pass - * @c ~0UL for any end address - * @param _count hint at the size of range required - pass @c 1 - * for any size + * @param _irq interrupt source to allocate * @param _flags any extra flags to control the resource * allocation - see @c RF_XXX flags in * for details * - * @returns the resource which was allocated or @c NULL if no + * @returns the interrupt which was allocated or @c NULL if no * resource could be allocated */ -METHOD struct resource * alloc_resource { +METHOD struct resource * alloc_intr { device_t _dev; device_t _child; - int _type; int *_rid; - u_long _start; - u_long _end; - u_long _count; + u_long _irq; u_int _flags; -} DEFAULT null_alloc_resource; - -/** - * @brief Activate a resource - * - * Activate a resource previously allocated with - * BUS_ALLOC_RESOURCE(). This may for instance map a memory region - * into the kernel's virtual address space. - * - * @param _dev the parent device of @p _child - * @param _child the device which allocated the resource - * @param _type the type of resource - * @param _rid the resource identifier - * @param _r the resource to activate - */ -METHOD int activate_resource { - device_t _dev; - device_t _child; - int _type; - int _rid; - struct resource *_r; }; /** - * @brief Deactivate a resource + * @brief Activate an interrupt * - * Deactivate a resource previously allocated with - * BUS_ALLOC_RESOURCE(). This may for instance unmap a memory region - * from the kernel's virtual address space. + * Activate an interrupt previously allocated with FDT_IC_ALLOC_INTR(). * * @param _dev the parent device of @p _child - * @param _child the device which allocated the resource - * @param _type the type of resource - * @param _rid the resource identifier - * @param _r the resource to deactivate + * @param _r interrupt to activate */ -METHOD int deactivate_resource { +METHOD int activate_intr { device_t _dev; - device_t _child; - int _type; - int _rid; struct resource *_r; }; /** - * @brief Adjust a resource + * @brief Deactivate an interrupt * - * Adjust the start and/or end of a resource allocated by - * BUS_ALLOC_RESOURCE. At least part of the new address range must overlap - * with the existing address range. If the successful, the resource's range - * will be adjusted to [start, end] on return. + * Deactivate a resource previously allocated with FDT_IC_ALLOC_INTR(). * * @param _dev the parent device of @p _child - * @param _child the device which allocated the resource - * @param _type the type of resource - * @param _res the resource to adjust - * @param _start the new starting address of the resource range - * @param _end the new ending address of the resource range + * @param _r the interrupt to deactivate */ -METHOD int adjust_resource { +METHOD int deactivate_intr { device_t _dev; - device_t _child; - int _type; - struct resource *_res; - u_long _start; - u_long _end; + struct resource *_r; }; /** - * @brief Release a resource + * @brief Release an interrupt * - * Free a resource allocated by the BUS_ALLOC_RESOURCE. The @p _rid - * value must be the same as the one returned by BUS_ALLOC_RESOURCE() - * (which is not necessarily the same as the one the client passed). + * Free an interupt allocated by the FDT_IC_ALLOC_INTR. * * @param _dev the parent device of @p _child - * @param _child the device which allocated the resource - * @param _type the type of resource - * @param _rid the resource identifier * @param _r the resource to release */ -METHOD int release_resource { +METHOD int release_intr { device_t _dev; - device_t _child; - int _type; - int _rid; struct resource *_res; }; @@ -363,9 +116,9 @@ METHOD int release_resource { * will be called with the value of @p _arg as its single * argument. The value returned in @p *_cookiep is used to cancel the * interrupt handler - the caller should save this value to use in a - * future call to BUS_TEARDOWN_INTR(). + * future call to FDT_IC_TEARDOWN_INTR(). * - * @param _dev the parent device of @p _child + * @param _dev the interrupt-parent device of @p _child * @param _child the device which allocated the resource * @param _irq the resource representing the interrupt * @param _flags a set of bits from enum intr_type specifying @@ -394,9 +147,9 @@ METHOD int setup_intr { * * This method is used to disassociate an interrupt handler function * with an irq resource. The value of @p _cookie must be the value - * returned from a previous call to BUS_SETUP_INTR(). + * returned from a previous call to FDT_IC_SETUP_INTR(). * - * @param _dev the parent device of @p _child + * @param _dev the interrupt-parent device of @p _child * @param _child the device which allocated the resource * @param _irq the resource representing the interrupt * @param _cookie the cookie value returned when the interrupt @@ -410,151 +163,10 @@ METHOD int teardown_intr { }; /** - * @brief Define a resource which can be allocated with - * BUS_ALLOC_RESOURCE(). - * - * This method is used by some busses (typically ISA) to allow a - * driver to describe a resource range that it would like to - * allocate. The resource defined by @p _type and @p _rid is defined - * to start at @p _start and to include @p _count indices in its - * range. - * - * @param _dev the parent device of @p _child - * @param _child the device which owns the resource - * @param _type the type of resource - * @param _rid the resource identifier - * @param _start the start of the resource range - * @param _count the size of the resource range - */ -METHOD int set_resource { - device_t _dev; - device_t _child; - int _type; - int _rid; - u_long _start; - u_long _count; -}; - -/** - * @brief Describe a resource - * - * This method allows a driver to examine the range used for a given - * resource without actually allocating it. - * - * @param _dev the parent device of @p _child - * @param _child the device which owns the resource - * @param _type the type of resource - * @param _rid the resource identifier - * @param _start the address of a location to recieve the start - * index of the resource range - * @param _count the address of a location to recieve the size - * of the resource range - */ -METHOD int get_resource { - device_t _dev; - device_t _child; - int _type; - int _rid; - u_long *_startp; - u_long *_countp; -}; - -/** - * @brief Delete a resource. - * - * Use this to delete a resource (possibly one previously added with - * BUS_SET_RESOURCE()). - * - * @param _dev the parent device of @p _child - * @param _child the device which owns the resource - * @param _type the type of resource - * @param _rid the resource identifier - */ -METHOD void delete_resource { - device_t _dev; - device_t _child; - int _type; - int _rid; -}; - -/** - * @brief Return a struct resource_list. - * - * Used by drivers which use bus_generic_rl_alloc_resource() etc. to - * implement their resource handling. It should return the resource - * list of the given child device. - * - * @param _dev the parent device of @p _child - * @param _child the device which owns the resource list - */ -METHOD struct resource_list * get_resource_list { - device_t _dev; - device_t _child; -} DEFAULT bus_generic_get_resource_list; - -/** - * @brief Is the hardware described by @p _child still attached to the - * system? - * - * This method should return 0 if the device is not present. It - * should return -1 if it is present. Any errors in determining - * should be returned as a normal errno value. Client drivers are to - * assume that the device is present, even if there is an error - * determining if it is there. Busses are to try to avoid returning - * errors, but newcard will return an error if the device fails to - * implement this method. - * - * @param _dev the parent device of @p _child - * @param _child the device which is being examined - */ -METHOD int child_present { - device_t _dev; - device_t _child; -} DEFAULT bus_generic_child_present; - -/** - * @brief Returns the pnp info for this device. - * - * Return it as a string. If the string is insufficient for the - * storage, then return EOVERFLOW. - * - * @param _dev the parent device of @p _child - * @param _child the device which is being examined - * @param _buf the address of a buffer to receive the pnp - * string - * @param _buflen the size of the buffer pointed to by @p _buf - */ -METHOD int child_pnpinfo_str { - device_t _dev; - device_t _child; - char *_buf; - size_t _buflen; -}; - -/** - * @brief Returns the location for this device. - * - * Return it as a string. If the string is insufficient for the - * storage, then return EOVERFLOW. - * - * @param _dev the parent device of @p _child - * @param _child the device which is being examined - * @param _buf the address of a buffer to receive the location - * string - * @param _buflen the size of the buffer pointed to by @p _buf - */ -METHOD int child_location_str { - device_t _dev; - device_t _child; - char *_buf; - size_t _buflen; -}; - -/** * @brief Allow drivers to request that an interrupt be bound to a specific * CPU. * - * @param _dev the parent device of @p _child + * @param _dev the interrupt-parent device of @p _child * @param _child the device which allocated the resource * @param _irq the resource representing the interrupt * @param _cpu the CPU to bind the interrupt to @@ -564,13 +176,13 @@ METHOD int bind_intr { device_t _child; struct resource *_irq; int _cpu; -} DEFAULT bus_generic_bind_intr; +}; /** - * @brief Allow (bus) drivers to specify the trigger mode and polarity + * @brief Allow drivers to specify the trigger mode and polarity * of the specified interrupt. * - * @param _dev the bus device + * @param _dev the interrupt-parent device * @param _irq the interrupt number to modify * @param _trig the trigger mode required * @param _pol the interrupt polarity required @@ -580,13 +192,13 @@ METHOD int config_intr { int _irq; enum intr_trigger _trig; enum intr_polarity _pol; -} DEFAULT bus_generic_config_intr; +}; /** * @brief Allow drivers to associate a description with an active * interrupt handler. * - * @param _dev the parent device of @p _child + * @param _dev the interrupt-parent device of @p _child * @param _child the device which allocated the resource * @param _irq the resource representing the interrupt * @param _cookie the cookie value returned when the interrupt @@ -599,74 +211,56 @@ METHOD int describe_intr { struct resource *_irq; void *_cookie; const char *_descr; -} DEFAULT bus_generic_describe_intr; - -/** - * @brief Notify a (bus) driver about a child that the hints mechanism - * believes it has discovered. - * - * The bus is responsible for then adding the child in the right order - * and discovering other things about the child. The bus driver is - * free to ignore this hint, to do special things, etc. It is all up - * to the bus driver to interpret. - * - * This method is only called in response to the parent bus asking for - * hinted devices to be enumerated. - * - * @param _dev the bus device - * @param _dname the name of the device w/o unit numbers - * @param _dunit the unit number of the device - */ -METHOD void hinted_child { - device_t _dev; - const char *_dname; - int _dunit; }; /** - * @brief Returns bus_dma_tag_t for use w/ devices on the bus. + * @brief Notify an ic that specified child's IRQ should be remapped. * - * @param _dev the parent device of @p _child - * @param _child the device to which the tag will belong + * @param _dev the interrupt-parent device + * @param _child the child device + * @param _irq the irq number */ -METHOD bus_dma_tag_t get_dma_tag { +METHOD int remap_intr { device_t _dev; device_t _child; -} DEFAULT bus_generic_get_dma_tag; + u_int _irq; +}; /** - * @brief Allow the bus to determine the unit number of a device. + * @brief Enable an IPI source. * - * @param _dev the parent device of @p _child - * @param _child the device whose unit is to be wired - * @param _name the name of the device's new devclass - * @param _unitp a pointer to the device's new unit value + * @param _dev the interrupt controller + * @param _tid the thread ID (relative to the interrupt controller) + * to enable IPIs for + * @param _ipi_irq hardware IRQ to send IPIs to */ -METHOD void hint_device_unit { +METHOD void setup_ipi { device_t _dev; - device_t _child; - const char *_name; - int *_unitp; + u_int _tid; + u_int _irq; }; /** - * @brief Notify a bus that the bus pass level has been changed + * @brief Send an IPI to the specified thread. * - * @param _dev the bus device + * @param _dev the interrupt controller + * @param _tid the thread ID (relative to the interrupt controller) + * to send IPIs to */ -METHOD void new_pass { +METHOD void send_ipi { device_t _dev; -} DEFAULT bus_generic_new_pass; + u_int _tid; +}; /** - * @brief Notify a bus that specified child's IRQ should be remapped. + * @brief Clear the IPI on the specfied thread. Only call with the + * local hardware thread or interrupts may be lost! * - * @param _dev the bus device - * @param _child the child device - * @param _irq the irq number + * @param _dev the interrupt controller + * @param _tid the thread ID (relative to the interrupt controller) + * to clear the IPI on */ -METHOD int remap_intr { +METHOD void clear_ipi { device_t _dev; - device_t _child; - u_int _irq; -} DEFAULT null_remap_intr; + u_int _tid; +}; Modified: head/sys/dev/fdt/simplebus.c ============================================================================== --- head/sys/dev/fdt/simplebus.c Mon Oct 21 20:51:08 2013 (r256860) +++ head/sys/dev/fdt/simplebus.c Mon Oct 21 21:13:01 2013 (r256861) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include "fdt_common.h" +#include "fdt_ic_if.h" #include "ofw_bus_if.h" #ifdef DEBUG @@ -80,9 +81,18 @@ static int simplebus_attach(device_t); static int simplebus_print_child(device_t, device_t); static int simplebus_setup_intr(device_t, device_t, struct resource *, int, driver_filter_t *, driver_intr_t *, void *, void **); +static int simplebus_teardown_intr(device_t, device_t, struct resource *, + void *); +static int simplebus_activate_resource(device_t, device_t, int, int, + struct resource *); static struct resource *simplebus_alloc_resource(device_t, device_t, int, int *, u_long, u_long, u_long, u_int); +static int simplebus_deactivate_resource(device_t, device_t, int, int, + struct resource *); +static int simplebus_release_resource(device_t, device_t, int, int, + struct resource *); +static device_t simplebus_get_interrupt_parent(device_t); static struct resource_list *simplebus_get_resource_list(device_t, device_t); static ofw_bus_get_devinfo_t simplebus_get_devinfo; @@ -102,11 +112,11 @@ static device_method_t simplebus_methods /* Bus interface */ DEVMETHOD(bus_print_child, simplebus_print_child), DEVMETHOD(bus_alloc_resource, simplebus_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_release_resource, simplebus_release_resource), + DEVMETHOD(bus_activate_resource, simplebus_activate_resource), + DEVMETHOD(bus_deactivate_resource, simplebus_deactivate_resource), DEVMETHOD(bus_setup_intr, simplebus_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_teardown_intr, simplebus_teardown_intr), DEVMETHOD(bus_get_resource_list, simplebus_get_resource_list), /* OFW bus interface */ @@ -217,6 +227,7 @@ simplebus_attach(device_t dev) static int simplebus_print_child(device_t dev, device_t child) { + device_t ip; struct simplebus_devinfo *di; struct resource_list *rl; int rv; @@ -228,6 +239,8 @@ simplebus_print_child(device_t dev, devi rv += bus_print_child_header(dev, child); rv += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); rv += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + if ((ip = simplebus_get_interrupt_parent(child)) != NULL) + rv += printf(" (%s)", device_get_nameunit(ip)); rv += bus_print_child_footer(dev, child); return (rv); @@ -237,6 +250,7 @@ static struct resource * simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { + device_t ic; struct simplebus_devinfo *di; struct resource_list_entry *rle; @@ -263,10 +277,53 @@ simplebus_alloc_resource(device_t bus, d count = rle->count; } + if (type == SYS_RES_IRQ && + (ic = simplebus_get_interrupt_parent(child)) != NULL) + return(FDT_IC_ALLOC_INTR(ic, child, rid, start, flags)); + return (bus_generic_alloc_resource(bus, child, type, rid, start, end, count, flags)); } +static int +simplebus_activate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + device_t ic; + + if (type == SYS_RES_IRQ && + (ic = simplebus_get_interrupt_parent(child)) != NULL) + return (FDT_IC_ACTIVATE_INTR(ic, r)); + + return (bus_generic_activate_resource(dev, child, type, rid, r)); +} + +static int +simplebus_deactivate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + device_t ic; + + if (type == SYS_RES_IRQ && + (ic = simplebus_get_interrupt_parent(child)) != NULL) + return (FDT_IC_DEACTIVATE_INTR(ic, r)); + + return (bus_generic_deactivate_resource(dev, child, type, rid, r)); +} + +static int +simplebus_release_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + device_t ic; + + if (type == SYS_RES_IRQ && + (ic = simplebus_get_interrupt_parent(child)) != NULL) + return (FDT_IC_RELEASE_INTR(ic, r)); + + return (bus_generic_release_resource(dev, child, type, rid, r)); +} + static struct resource_list * simplebus_get_resource_list(device_t bus, device_t child) { @@ -276,15 +333,45 @@ simplebus_get_resource_list(device_t bus return (&di->di_res); } +static device_t +simplebus_get_interrupt_parent(device_t dev) +{ + struct simplebus_devinfo *di; + struct fdt_ic *ic; + device_t ip; + ihandle_t iph; + phandle_t ph; + + ip = NULL; + + di = device_get_ivars(dev); + if (di == NULL) + return (NULL); + + if (OF_getprop(di->di_ofw.obd_node, "interrupt-parent", &iph, + sizeof(iph)) > 0) { + iph = fdt32_to_cpu(iph); + ph = OF_instance_to_package(iph); + SLIST_FOREACH(ic, &fdt_ic_list_head, fdt_ics) { + if (ic->iph == ph) { + ip = ic->dev; + break; + } + } + } + return (ip); +} + static int simplebus_setup_intr(device_t bus, device_t child, struct resource *res, int flags, driver_filter_t *filter, driver_intr_t *ihand, void *arg, void **cookiep) { struct simplebus_devinfo *di; + device_t ic; enum intr_trigger trig; enum intr_polarity pol; - int error, rid; + int error, irq, rid; di = device_get_ivars(child); if (di == NULL) @@ -297,20 +384,41 @@ simplebus_setup_intr(device_t bus, devic if (rid >= DI_MAX_INTR_NUM) return (ENOENT); + ic = simplebus_get_interrupt_parent(child); + trig = di->di_intr_sl[rid].trig; pol = di->di_intr_sl[rid].pol; if (trig != INTR_TRIGGER_CONFORM || pol != INTR_POLARITY_CONFORM) { - error = bus_generic_config_intr(bus, rman_get_start(res), - trig, pol); + irq = rman_get_start(res); + if (ic != NULL) + error = FDT_IC_CONFIG_INTR(ic, irq, trig, pol); + else + error = bus_generic_config_intr(bus, irq, trig, pol); if (error) return (error); } - error = bus_generic_setup_intr(bus, child, res, flags, filter, ihand, - arg, cookiep); + if (ic != NULL) + error = FDT_IC_SETUP_INTR(ic, child, res, flags, filter, + ihand, arg, cookiep); + else + error = bus_generic_setup_intr(bus, child, res, flags, filter, + ihand, arg, cookiep); return (error); } +static int +simplebus_teardown_intr(device_t bus, device_t child, struct resource *res, + void *cookie) +{ + device_t ic; + + if ((ic = simplebus_get_interrupt_parent(child)) != NULL) + return (FDT_IC_TEARDOWN_INTR(ic, child, res, cookie)); + + return (bus_generic_teardown_intr(bus, child, res, cookie)); +} + static const struct ofw_bus_devinfo * simplebus_get_devinfo(device_t bus, device_t child) { From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 21:16:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3D5E784D; Mon, 21 Oct 2013 21:16:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2B30026B4; Mon, 21 Oct 2013 21:16:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LLGojo061402; Mon, 21 Oct 2013 21:16:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LLGoJW061401; Mon, 21 Oct 2013 21:16:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310212116.r9LLGoJW061401@svn.freebsd.org> From: Alexander Motin Date: Mon, 21 Oct 2013 21:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256862 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 21:16:51 -0000 Author: mav Date: Mon Oct 21 21:16:50 2013 New Revision: 256862 URL: http://svnweb.freebsd.org/changeset/base/256862 Log: Add comments that taskqueue_enqueue_locked() returns without the lock. Modified: head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Mon Oct 21 21:13:01 2013 (r256861) +++ head/sys/kern/subr_taskqueue.c Mon Oct 21 21:16:50 2013 (r256862) @@ -237,6 +237,7 @@ taskqueue_enqueue_locked(struct taskqueu if ((queue->tq_flags & TQ_FLAGS_UNLOCKED_ENQUEUE) == 0) TQ_UNLOCK(queue); + /* Return with lock released. */ return (0); } int @@ -246,6 +247,7 @@ taskqueue_enqueue(struct taskqueue *queu TQ_LOCK(queue); res = taskqueue_enqueue_locked(queue, task); + /* The lock is released inside. */ return (res); } @@ -262,6 +264,7 @@ taskqueue_timeout_func(void *arg) timeout_task->f &= ~DT_CALLOUT_ARMED; queue->tq_callouts--; taskqueue_enqueue_locked(timeout_task->q, &timeout_task->t); + /* The lock is released inside. */ } int @@ -278,6 +281,7 @@ taskqueue_enqueue_timeout(struct taskque res = timeout_task->t.ta_pending; if (ticks == 0) { taskqueue_enqueue_locked(queue, &timeout_task->t); + /* The lock is released inside. */ } else { if ((timeout_task->f & DT_CALLOUT_ARMED) != 0) { res++; From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 22:25:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A4D3AEF4; Mon, 21 Oct 2013 22:25:54 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 908262B19; Mon, 21 Oct 2013 22:25:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LMPsCQ098503; Mon, 21 Oct 2013 22:25:54 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LMPs8A098502; Mon, 21 Oct 2013 22:25:54 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310212225.r9LMPs8A098502@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 21 Oct 2013 22:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256864 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 22:25:54 -0000 Author: nwhitehorn Date: Mon Oct 21 22:25:54 2013 New Revision: 256864 URL: http://svnweb.freebsd.org/changeset/base/256864 Log: Make hard-wired TLB allocations be at minimum one page. This is required by some implementations, most notably (in my case) QEMU's e500 emulation. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Mon Oct 21 21:32:24 2013 (r256863) +++ head/sys/powerpc/booke/pmap.c Mon Oct 21 22:25:54 2013 (r256864) @@ -2613,6 +2613,8 @@ mmu_booke_mapdev(mmu_t mmu, vm_paddr_t p va = (pa >= 0x80000000) ? pa : (0xe2000000 + pa); res = (void *)va; + if (size < PAGE_SIZE) + size = PAGE_SIZE; do { sz = 1 << (ilog2(size) & ~1); From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 22:43:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7B714795; Mon, 21 Oct 2013 22:43:40 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 66A1B2C35; Mon, 21 Oct 2013 22:43:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LMhelm008922; Mon, 21 Oct 2013 22:43:40 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LMhdpm008914; Mon, 21 Oct 2013 22:43:39 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310212243.r9LMhdpm008914@svn.freebsd.org> From: Brooks Davis Date: Mon, 21 Oct 2013 22:43:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256865 - in head: share/man/man4 sys/conf sys/dev/isf sys/mips/conf usr.sbin usr.sbin/isfctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 22:43:40 -0000 Author: brooks Date: Mon Oct 21 22:43:38 2013 New Revision: 256865 URL: http://svnweb.freebsd.org/changeset/base/256865 Log: Remove the isf(4) driver. It was created by accident and is subset of the cfi(4) driver. It remained in the tree longer than would be ideal due to the time required to bring cfi(4) to feature parity. Sponsored by: DARPA/AFRL MFC after: 3 days Deleted: head/share/man/man4/isf.4 head/sys/dev/isf/ head/usr.sbin/isfctl/ Modified: head/share/man/man4/Makefile head/sys/conf/files head/sys/mips/conf/BERI_DE4.hints head/sys/mips/conf/BERI_DE4_MDROOT head/sys/mips/conf/BERI_DE4_SDROOT head/usr.sbin/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Oct 21 22:25:54 2013 (r256864) +++ head/share/man/man4/Makefile Mon Oct 21 22:43:38 2013 (r256865) @@ -196,7 +196,6 @@ MAN= aac.4 \ ipwfw.4 \ isci.4 \ iscsi_initiator.4 \ - isf.4 \ isp.4 \ ispfw.4 \ iwi.4 \ Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Oct 21 22:25:54 2013 (r256864) +++ head/sys/conf/files Mon Oct 21 22:43:38 2013 (r256865) @@ -1541,9 +1541,6 @@ dev/iscsi_initiator/isc_cam.c optional i dev/iscsi_initiator/isc_soc.c optional iscsi_initiator scbus dev/iscsi_initiator/isc_sm.c optional iscsi_initiator scbus dev/iscsi_initiator/isc_subr.c optional iscsi_initiator scbus -dev/isf/isf.c optional isf -dev/isf/isf_fdt.c optional isf fdt -dev/isf/isf_nexus.c optional isf dev/isp/isp.c optional isp dev/isp/isp_freebsd.c optional isp dev/isp/isp_library.c optional isp Modified: head/sys/mips/conf/BERI_DE4.hints ============================================================================== --- head/sys/mips/conf/BERI_DE4.hints Mon Oct 21 22:25:54 2013 (r256864) +++ head/sys/mips/conf/BERI_DE4.hints Mon Oct 21 22:43:38 2013 (r256865) @@ -55,7 +55,6 @@ hint.altera_avgen.0.devname="berirom" # # Expose the DE4 flash via an Avalon "generic" device. -# This is incompatible with the isf(4) driver. # #hint.altera_avgen.0.at="nexus0" #hint.altera_avgen.0.maddr=0x74000000 @@ -74,38 +73,3 @@ hint.altera_avgen.0.msize=2 hint.altera_avgen.0.width=1 hint.altera_avgen.0.fileio="r" hint.altera_avgen.0.devname="de4bsw" - -# -# General Intel StrataFlash driver -# -hint.isf.0.at="nexus0" -hint.isf.0.maddr=0x74000000 -hint.isf.0.msize=0x2000000 -hint.isf.1.at="nexus0" -hint.isf.1.maddr=0x76000000 -hint.isf.1.msize=0x2000000 - -# Reserved configuration blocks. Don't touch. -hint.map.0.at="isf0" -hint.map.0.start=0x00000000 -hint.map.0.end=0x00020000 -hint.map.0.name="config" -hint.map.0.readonly=1 - -# Hardwired location of bitfile -hint.map.1.at="isf0" -hint.map.1.start=0x00020000 -hint.map.1.end=0x01820000 -hint.map.1.name="fpga" - -# Kernel on first chip -hint.map.2.at="isf0" -hint.map.2.start=0x01820000 -hint.map.2.end=0x02000000 -hint.map.2.name="reserved" - -# The second chip -hint.map.3.at="isf1" -hint.map.3.start=0x00000000 -hint.map.3.end=0x02000000 -hint.map.3.name="kernel" Modified: head/sys/mips/conf/BERI_DE4_MDROOT ============================================================================== --- head/sys/mips/conf/BERI_DE4_MDROOT Mon Oct 21 22:25:54 2013 (r256864) +++ head/sys/mips/conf/BERI_DE4_MDROOT Mon Oct 21 22:43:38 2013 (r256865) @@ -26,5 +26,4 @@ device altera_sdcard device terasic_de4led device terasic_mtl -device isf device sc Modified: head/sys/mips/conf/BERI_DE4_SDROOT ============================================================================== --- head/sys/mips/conf/BERI_DE4_SDROOT Mon Oct 21 22:25:54 2013 (r256864) +++ head/sys/mips/conf/BERI_DE4_SDROOT Mon Oct 21 22:43:38 2013 (r256865) @@ -20,5 +20,4 @@ device altera_sdcard device terasic_de4led device terasic_mtl -device isf device sc Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Mon Oct 21 22:25:54 2013 (r256864) +++ head/usr.sbin/Makefile Mon Oct 21 22:43:38 2013 (r256865) @@ -37,7 +37,6 @@ SUBDIR= adduser \ inetd \ iostat \ iscsid \ - isfctl \ kldxref \ mailwrapper \ makefs \ From owner-svn-src-all@FreeBSD.ORG Mon Oct 21 22:55:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D0360E2F; Mon, 21 Oct 2013 22:55:56 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BCA202D20; Mon, 21 Oct 2013 22:55:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LMtuQ4014525; Mon, 21 Oct 2013 22:55:56 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LMtuSX014524; Mon, 21 Oct 2013 22:55:56 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310212255.r9LMtuSX014524@svn.freebsd.org> From: Sean Bruno Date: Mon, 21 Oct 2013 22:55:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256866 - head/contrib/gcclibs/libssp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 22:55:56 -0000 Author: sbruno Date: Mon Oct 21 22:55:56 2013 New Revision: 256866 URL: http://svnweb.freebsd.org/changeset/base/256866 Log: Resolve clang warning about a use of syslog. By using a proper enforcement of string format in a call so syslog /usr/src/gnu/lib/libssp/../../../contrib/gcclibs/libssp/ssp.c:137:23: warning: format string is not a string literal (potentially insecure) [-Wformat-security] syslog (LOG_CRIT, msg1); ^~~~ Reviewed by: dim@ Modified: head/contrib/gcclibs/libssp/ssp.c Modified: head/contrib/gcclibs/libssp/ssp.c ============================================================================== --- head/contrib/gcclibs/libssp/ssp.c Mon Oct 21 22:43:38 2013 (r256865) +++ head/contrib/gcclibs/libssp/ssp.c Mon Oct 21 22:55:56 2013 (r256866) @@ -128,7 +128,7 @@ fail (const char *msg1, size_t msg1len, #ifdef HAVE_SYSLOG_H /* Only send the error to syslog if there was no tty available. */ else - syslog (LOG_CRIT, msg3); + syslog (LOG_CRIT, "%s", msg3); #endif /* HAVE_SYSLOG_H */ /* Try very hard to exit. Note that signals may be blocked preventing From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 00:50:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2CBE6B8A; Tue, 22 Oct 2013 00:50:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1A4E822DD; Tue, 22 Oct 2013 00:50:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9M0or8s077817; Tue, 22 Oct 2013 00:50:53 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9M0orao077816; Tue, 22 Oct 2013 00:50:53 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201310220050.r9M0orao077816@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 22 Oct 2013 00:50:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256868 - head/sys/dev/xen/netback X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 00:50:54 -0000 Author: bz Date: Tue Oct 22 00:50:53 2013 New Revision: 256868 URL: http://svnweb.freebsd.org/changeset/base/256868 Log: Make netback compile without INET support in the kernel. This shuld have been a problem since r230587. Not exactly sure why it was not detected the last weeks with the tinderbox. I would assume r255744 is what started to cause it. MFC after: 1 week Modified: head/sys/dev/xen/netback/netback.c Modified: head/sys/dev/xen/netback/netback.c ============================================================================== --- head/sys/dev/xen/netback/netback.c Mon Oct 21 23:46:37 2013 (r256867) +++ head/sys/dev/xen/netback/netback.c Tue Oct 22 00:50:53 2013 (r256868) @@ -2191,8 +2191,8 @@ static int xnb_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct xnb_softc *xnb = ifp->if_softc; -#ifdef INET struct ifreq *ifr = (struct ifreq*) data; +#ifdef INET struct ifaddr *ifa = (struct ifaddr*)data; #endif int error = 0; From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 00:58:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1E645D0D; Tue, 22 Oct 2013 00:58:54 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 085042307; Tue, 22 Oct 2013 00:58:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9M0wrMD080693; Tue, 22 Oct 2013 00:58:53 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9M0wppf080682; Tue, 22 Oct 2013 00:58:51 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201310220058.r9M0wppf080682@svn.freebsd.org> From: Neel Natu Date: Tue, 22 Oct 2013 00:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256869 - in stable/10: lib/libvmmapi sys/amd64/amd64 sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 00:58:54 -0000 Author: neel Date: Tue Oct 22 00:58:51 2013 New Revision: 256869 URL: http://svnweb.freebsd.org/changeset/base/256869 Log: MFC r256645. Add a new capability, VM_CAP_ENABLE_INVPCID, that can be enabled to expose 'invpcid' instruction to the guest. Currently bhyve will try to enable this capability unconditionally if it is available. Consolidate code in bhyve to set the capabilities so it is no longer duplicated in BSP and AP bringup. Add a sysctl 'vm.pmap.invpcid_works' to display whether the 'invpcid' instruction is available. Approved by: re (hrs) Modified: stable/10/lib/libvmmapi/vmmapi.c stable/10/sys/amd64/amd64/pmap.c stable/10/sys/amd64/include/vmm.h (contents, props changed) stable/10/sys/amd64/vmm/intel/vmx.c stable/10/sys/amd64/vmm/intel/vmx.h stable/10/sys/amd64/vmm/intel/vmx_controls.h stable/10/sys/amd64/vmm/x86.c stable/10/usr.sbin/bhyve/bhyverun.c stable/10/usr.sbin/bhyve/bhyverun.h stable/10/usr.sbin/bhyve/spinup_ap.c stable/10/usr.sbin/bhyvectl/bhyvectl.c Directory Properties: stable/10/lib/libvmmapi/ (props changed) stable/10/sys/ (props changed) stable/10/sys/amd64/vmm/ (props changed) stable/10/usr.sbin/bhyve/ (props changed) stable/10/usr.sbin/bhyvectl/ (props changed) Modified: stable/10/lib/libvmmapi/vmmapi.c ============================================================================== --- stable/10/lib/libvmmapi/vmmapi.c Tue Oct 22 00:50:53 2013 (r256868) +++ stable/10/lib/libvmmapi/vmmapi.c Tue Oct 22 00:58:51 2013 (r256869) @@ -415,6 +415,7 @@ static struct { { "mtrap_exit", VM_CAP_MTRAP_EXIT }, { "pause_exit", VM_CAP_PAUSE_EXIT }, { "unrestricted_guest", VM_CAP_UNRESTRICTED_GUEST }, + { "enable_invpcid", VM_CAP_ENABLE_INVPCID }, { 0 } }; Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Tue Oct 22 00:50:53 2013 (r256868) +++ stable/10/sys/amd64/amd64/pmap.c Tue Oct 22 00:58:51 2013 (r256869) @@ -371,6 +371,8 @@ int pmap_pcid_enabled = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN, &pmap_pcid_enabled, 0, "Is TLB Context ID enabled ?"); int invpcid_works = 0; +SYSCTL_INT(_vm_pmap, OID_AUTO, invpcid_works, CTLFLAG_RD, &invpcid_works, 0, + "Is the invpcid instruction available ?"); static int pmap_pcid_save_cnt_proc(SYSCTL_HANDLER_ARGS) Modified: stable/10/sys/amd64/include/vmm.h ============================================================================== --- stable/10/sys/amd64/include/vmm.h Tue Oct 22 00:50:53 2013 (r256868) +++ stable/10/sys/amd64/include/vmm.h Tue Oct 22 00:58:51 2013 (r256869) @@ -223,6 +223,7 @@ enum vm_cap_type { VM_CAP_MTRAP_EXIT, VM_CAP_PAUSE_EXIT, VM_CAP_UNRESTRICTED_GUEST, + VM_CAP_ENABLE_INVPCID, VM_CAP_MAX }; Modified: stable/10/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx.c Tue Oct 22 00:50:53 2013 (r256868) +++ stable/10/sys/amd64/vmm/intel/vmx.c Tue Oct 22 00:58:51 2013 (r256869) @@ -164,6 +164,7 @@ static int cap_halt_exit; static int cap_pause_exit; static int cap_unrestricted_guest; static int cap_monitor_trap; +static int cap_invpcid; static struct unrhdr *vpid_unr; static u_int vpid_alloc_failed; @@ -660,6 +661,11 @@ vmx_init(void) PROCBASED2_UNRESTRICTED_GUEST, 0, &tmp) == 0); + cap_invpcid = (vmx_set_ctlreg(MSR_VMX_PROCBASED_CTLS2, + MSR_VMX_PROCBASED_CTLS2, PROCBASED2_ENABLE_INVPCID, 0, + &tmp) == 0); + + /* Initialize EPT */ error = ept_init(); if (error) { @@ -828,6 +834,7 @@ vmx_vminit(struct vm *vm, pmap_t pmap) vmx->cap[i].set = 0; vmx->cap[i].proc_ctls = procbased_ctls; + vmx->cap[i].proc_ctls2 = procbased_ctls2; vmx->state[i].lastcpu = -1; vmx->state[i].vpid = vpid[i]; @@ -1932,6 +1939,10 @@ vmx_getcap(void *arg, int vcpu, int type if (cap_unrestricted_guest) ret = 0; break; + case VM_CAP_ENABLE_INVPCID: + if (cap_invpcid) + ret = 0; + break; default: break; } @@ -1988,11 +1999,21 @@ vmx_setcap(void *arg, int vcpu, int type case VM_CAP_UNRESTRICTED_GUEST: if (cap_unrestricted_guest) { retval = 0; - baseval = procbased_ctls2; + pptr = &vmx->cap[vcpu].proc_ctls2; + baseval = *pptr; flag = PROCBASED2_UNRESTRICTED_GUEST; reg = VMCS_SEC_PROC_BASED_CTLS; } break; + case VM_CAP_ENABLE_INVPCID: + if (cap_invpcid) { + retval = 0; + pptr = &vmx->cap[vcpu].proc_ctls2; + baseval = *pptr; + flag = PROCBASED2_ENABLE_INVPCID; + reg = VMCS_SEC_PROC_BASED_CTLS; + } + break; default: break; } Modified: stable/10/sys/amd64/vmm/intel/vmx.h ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx.h Tue Oct 22 00:50:53 2013 (r256868) +++ stable/10/sys/amd64/vmm/intel/vmx.h Tue Oct 22 00:58:51 2013 (r256869) @@ -84,6 +84,7 @@ struct vmxctx { struct vmxcap { int set; uint32_t proc_ctls; + uint32_t proc_ctls2; }; struct vmxstate { Modified: stable/10/sys/amd64/vmm/intel/vmx_controls.h ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx_controls.h Tue Oct 22 00:50:53 2013 (r256868) +++ stable/10/sys/amd64/vmm/intel/vmx_controls.h Tue Oct 22 00:58:51 2013 (r256869) @@ -68,6 +68,7 @@ #define PROCBASED2_WBINVD_EXITING (1 << 6) #define PROCBASED2_UNRESTRICTED_GUEST (1 << 7) #define PROCBASED2_PAUSE_LOOP_EXITING (1 << 10) +#define PROCBASED2_ENABLE_INVPCID (1 << 12) /* VM Exit Controls */ #define VM_EXIT_SAVE_DEBUG_CONTROLS (1 << 2) Modified: stable/10/sys/amd64/vmm/x86.c ============================================================================== --- stable/10/sys/amd64/vmm/x86.c Tue Oct 22 00:50:53 2013 (r256868) +++ stable/10/sys/amd64/vmm/x86.c Tue Oct 22 00:58:51 2013 (r256869) @@ -53,7 +53,7 @@ int x86_emulate_cpuid(struct vm *vm, int vcpu_id, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx) { - int error; + int error, enable_invpcid; unsigned int func, regs[4]; enum x2apic_state x2apic_state; @@ -202,8 +202,22 @@ x86_emulate_cpuid(struct vm *vm, int vcp regs[0] |= 0x04008000; break; - case CPUID_0000_0006: case CPUID_0000_0007: + regs[0] = 0; + regs[1] = 0; + regs[2] = 0; + regs[3] = 0; + + /* leaf 0 */ + if (*ecx == 0) { + error = vm_get_capability(vm, vcpu_id, + VM_CAP_ENABLE_INVPCID, &enable_invpcid); + if (error == 0 && enable_invpcid) + regs[1] |= CPUID_STDEXT_INVPCID; + } + break; + + case CPUID_0000_0006: case CPUID_0000_000A: case CPUID_0000_000D: /* Modified: stable/10/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.c Tue Oct 22 00:50:53 2013 (r256868) +++ stable/10/usr.sbin/bhyve/bhyverun.c Tue Oct 22 00:58:51 2013 (r256869) @@ -493,10 +493,54 @@ num_vcpus_allowed(struct vmctx *ctx) return (1); } +void +fbsdrun_set_capabilities(struct vmctx *ctx, int cpu) +{ + int err, tmp; + + if (fbsdrun_vmexit_on_hlt()) { + err = vm_get_capability(ctx, cpu, VM_CAP_HALT_EXIT, &tmp); + if (err < 0) { + fprintf(stderr, "VM exit on HLT not supported\n"); + exit(1); + } + vm_set_capability(ctx, cpu, VM_CAP_HALT_EXIT, 1); + if (cpu == BSP) + handler[VM_EXITCODE_HLT] = vmexit_hlt; + } + + if (fbsdrun_vmexit_on_pause()) { + /* + * pause exit support required for this mode + */ + err = vm_get_capability(ctx, cpu, VM_CAP_PAUSE_EXIT, &tmp); + if (err < 0) { + fprintf(stderr, + "SMP mux requested, no pause support\n"); + exit(1); + } + vm_set_capability(ctx, cpu, VM_CAP_PAUSE_EXIT, 1); + if (cpu == BSP) + handler[VM_EXITCODE_PAUSE] = vmexit_pause; + } + + if (fbsdrun_disable_x2apic()) + err = vm_set_x2apic_state(ctx, cpu, X2APIC_DISABLED); + else + err = vm_set_x2apic_state(ctx, cpu, X2APIC_ENABLED); + + if (err) { + fprintf(stderr, "Unable to set x2apic state (%d)\n", err); + exit(1); + } + + vm_set_capability(ctx, cpu, VM_CAP_ENABLE_INVPCID, 1); +} + int main(int argc, char *argv[]) { - int c, error, gdb_port, tmp, err, ioapic, bvmcons; + int c, error, gdb_port, err, ioapic, bvmcons; int max_vcpus; struct vmctx *ctx; uint64_t rip; @@ -586,39 +630,7 @@ main(int argc, char *argv[]) exit(1); } - if (fbsdrun_vmexit_on_hlt()) { - err = vm_get_capability(ctx, BSP, VM_CAP_HALT_EXIT, &tmp); - if (err < 0) { - fprintf(stderr, "VM exit on HLT not supported\n"); - exit(1); - } - vm_set_capability(ctx, BSP, VM_CAP_HALT_EXIT, 1); - handler[VM_EXITCODE_HLT] = vmexit_hlt; - } - - if (fbsdrun_vmexit_on_pause()) { - /* - * pause exit support required for this mode - */ - err = vm_get_capability(ctx, BSP, VM_CAP_PAUSE_EXIT, &tmp); - if (err < 0) { - fprintf(stderr, - "SMP mux requested, no pause support\n"); - exit(1); - } - vm_set_capability(ctx, BSP, VM_CAP_PAUSE_EXIT, 1); - handler[VM_EXITCODE_PAUSE] = vmexit_pause; - } - - if (fbsdrun_disable_x2apic()) - err = vm_set_x2apic_state(ctx, BSP, X2APIC_DISABLED); - else - err = vm_set_x2apic_state(ctx, BSP, X2APIC_ENABLED); - - if (err) { - fprintf(stderr, "Unable to set x2apic state (%d)\n", err); - exit(1); - } + fbsdrun_set_capabilities(ctx, BSP); err = vm_setup_memory(ctx, memsize, VM_MMAP_ALL); if (err) { Modified: stable/10/usr.sbin/bhyve/bhyverun.h ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.h Tue Oct 22 00:50:53 2013 (r256868) +++ stable/10/usr.sbin/bhyve/bhyverun.h Tue Oct 22 00:58:51 2013 (r256869) @@ -41,6 +41,7 @@ extern char *vmname; void *paddr_guest2host(struct vmctx *ctx, uintptr_t addr, size_t len); +void fbsdrun_set_capabilities(struct vmctx *ctx, int cpu); void fbsdrun_addcpu(struct vmctx *ctx, int cpu, uint64_t rip); int fbsdrun_muxed(void); int fbsdrun_vmexit_on_hlt(void); Modified: stable/10/usr.sbin/bhyve/spinup_ap.c ============================================================================== --- stable/10/usr.sbin/bhyve/spinup_ap.c Tue Oct 22 00:50:53 2013 (r256868) +++ stable/10/usr.sbin/bhyve/spinup_ap.c Tue Oct 22 00:58:51 2013 (r256869) @@ -85,22 +85,7 @@ spinup_ap(struct vmctx *ctx, int vcpu, i error = vcpu_reset(ctx, newcpu); assert(error == 0); - /* Set up capabilities */ - if (fbsdrun_vmexit_on_hlt()) { - error = vm_set_capability(ctx, newcpu, VM_CAP_HALT_EXIT, 1); - assert(error == 0); - } - - if (fbsdrun_vmexit_on_pause()) { - error = vm_set_capability(ctx, newcpu, VM_CAP_PAUSE_EXIT, 1); - assert(error == 0); - } - - if (fbsdrun_disable_x2apic()) - error = vm_set_x2apic_state(ctx, newcpu, X2APIC_DISABLED); - else - error = vm_set_x2apic_state(ctx, newcpu, X2APIC_ENABLED); - assert(error == 0); + fbsdrun_set_capabilities(ctx, newcpu); /* * Enable the 'unrestricted guest' mode for 'newcpu'. Modified: stable/10/usr.sbin/bhyvectl/bhyvectl.c ============================================================================== --- stable/10/usr.sbin/bhyvectl/bhyvectl.c Tue Oct 22 00:50:53 2013 (r256868) +++ stable/10/usr.sbin/bhyvectl/bhyvectl.c Tue Oct 22 00:58:51 2013 (r256869) @@ -1495,6 +1495,7 @@ main(int argc, char *argv[]) vm_capability_type2name(captype), val ? "set" : "not set", vcpu); } else if (errno == ENOENT) { + error = 0; printf("Capability \"%s\" is not available\n", vm_capability_type2name(captype)); } else { From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 02:39:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4E808617; Tue, 22 Oct 2013 02:39:57 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3C07D271D; Tue, 22 Oct 2013 02:39:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9M2du8e045708; Tue, 22 Oct 2013 02:39:57 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9M2duTH045707; Tue, 22 Oct 2013 02:39:56 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310220239.r9M2duTH045707@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 22 Oct 2013 02:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256870 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 02:39:57 -0000 Author: nwhitehorn Date: Tue Oct 22 02:39:56 2013 New Revision: 256870 URL: http://svnweb.freebsd.org/changeset/base/256870 Log: Return standards-compliant code from OF_nextprop() with FDT when no properties remain on this node. Modified: head/sys/dev/ofw/ofw_fdt.c Modified: head/sys/dev/ofw/ofw_fdt.c ============================================================================== --- head/sys/dev/ofw/ofw_fdt.c Tue Oct 22 00:58:51 2013 (r256869) +++ head/sys/dev/ofw/ofw_fdt.c Tue Oct 22 02:39:56 2013 (r256870) @@ -329,7 +329,7 @@ fdt_nextprop(int offset, char *buf, size depth = -1; } while (depth >= 0); - return (-1); + return (0); } /* From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 05:19:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AE43EC3C; Tue, 22 Oct 2013 05:19:43 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 801EB2E4E; Tue, 22 Oct 2013 05:19:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9M5JhYL032333; Tue, 22 Oct 2013 05:19:43 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9M5JhZb032332; Tue, 22 Oct 2013 05:19:43 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201310220519.r9M5JhZb032332@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 22 Oct 2013 05:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256871 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 05:19:43 -0000 Author: gonzo Date: Tue Oct 22 05:19:42 2013 New Revision: 256871 URL: http://svnweb.freebsd.org/changeset/base/256871 Log: - Implement watchdog function and register it with watchdog list Modified: head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c Tue Oct 22 02:39:56 2013 (r256870) +++ head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c Tue Oct 22 05:19:42 2013 (r256871) @@ -76,11 +76,10 @@ struct bcmwd_softc { int wdog_armed; int wdog_period; char wdog_passwd; + struct mtx mtx; }; -#ifdef notyet static void bcmwd_watchdog_fn(void *private, u_int cmd, int *error); -#endif static int bcmwd_probe(device_t dev) @@ -120,19 +119,59 @@ bcmwd_attach(device_t dev) sc->bsh = rman_get_bushandle(sc->res); bcmwd_lsc = sc; -#ifdef notyet + mtx_init(&sc->mtx, "BCM2835 Watchdog", "bcmwd", MTX_DEF); EVENTHANDLER_REGISTER(watchdog_list, bcmwd_watchdog_fn, sc, 0); -#endif + return (0); } -#ifdef notyet static void bcmwd_watchdog_fn(void *private, u_int cmd, int *error) { - /* XXX: not yet */ + struct bcmwd_softc *sc; + uint64_t sec; + uint32_t ticks, reg; + + sc = private; + mtx_lock(&sc->mtx); + + cmd &= WD_INTERVAL; + + if (cmd > 0) { + sec = ((uint64_t)1 << (cmd & WD_INTERVAL)) / 1000000000; + ticks = (sec << 16) & BCM2835_WDOG_TIME_MASK; + if (ticks == 0) { + /* + * Can't arm + * disable watchdog as watchdog(9) requires + */ + device_printf(sc->dev, + "Can't arm, timeout is less than 1 second\n"); + WRITE(sc, BCM2835_RSTC_REG, + (BCM2835_PASWORD << BCM2835_PASSWORD_SHIFT) | + BCM2835_RSTC_RESET); + mtx_unlock(&sc->mtx); + return; + } + + reg = (BCM2835_PASWORD << BCM2835_PASSWORD_SHIFT) | ticks; + WRITE(sc, BCM2835_WDOG_REG, reg); + + reg = READ(sc, BCM2835_RSTC_REG); + reg &= BCM2835_RSTC_WRCFG_CLR; + reg |= BCM2835_RSTC_WRCFG_FULL_RESET; + reg |= (BCM2835_PASWORD << BCM2835_PASSWORD_SHIFT); + WRITE(sc, BCM2835_RSTC_REG, reg); + + *error = 0; + } + else + WRITE(sc, BCM2835_RSTC_REG, + (BCM2835_PASWORD << BCM2835_PASSWORD_SHIFT) | + BCM2835_RSTC_RESET); + + mtx_unlock(&sc->mtx); } -#endif void bcmwd_watchdog_reset() From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 05:22:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AB34EE6F; Tue, 22 Oct 2013 05:22:46 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 997232E88; Tue, 22 Oct 2013 05:22:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9M5MkrL035462; Tue, 22 Oct 2013 05:22:46 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9M5Mk5b035461; Tue, 22 Oct 2013 05:22:46 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201310220522.r9M5Mk5b035461@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 22 Oct 2013 05:22:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256873 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 05:22:46 -0000 Author: gonzo Date: Tue Oct 22 05:22:46 2013 New Revision: 256873 URL: http://svnweb.freebsd.org/changeset/base/256873 Log: Make watchdog function conform watchdog(9): Set error to 0 when watchdog is armed and disable it when timeout is too large to be set. Modified: head/sys/arm/allwinner/a10_wdog.c Modified: head/sys/arm/allwinner/a10_wdog.c ============================================================================== --- head/sys/arm/allwinner/a10_wdog.c Tue Oct 22 05:22:25 2013 (r256872) +++ head/sys/arm/allwinner/a10_wdog.c Tue Oct 22 05:22:46 2013 (r256873) @@ -150,6 +150,18 @@ a10wd_watchdog_fn(void *private, u_int c (wd_intervals[i].value << WDOG_MODE_INTVL_SHIFT) | WDOG_MODE_EN | WDOG_MODE_RST_EN); WRITE(sc, WDOG_CTRL, WDOG_CTRL_RESTART); + *error = 0; + } + else { + /* + * Can't arm + * disable watchdog as watchdog(9) requires + */ + device_printf(sc->dev, + "Can't arm, timeout is more than 16 sec\n"); + mtx_unlock(&sc->mtx); + WRITE(sc, WDOG_MODE, 0); + return; } } else From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 06:02:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4C797464; Tue, 22 Oct 2013 06:02:41 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 293242063; Tue, 22 Oct 2013 06:02:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9M62f2n056351; Tue, 22 Oct 2013 06:02:41 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9M62fcj056350; Tue, 22 Oct 2013 06:02:41 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201310220602.r9M62fcj056350@svn.freebsd.org> From: Hiroki Sato Date: Tue, 22 Oct 2013 06:02:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256874 - stable/10/etc/rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 06:02:41 -0000 Author: hrs Date: Tue Oct 22 06:02:40 2013 New Revision: 256874 URL: http://svnweb.freebsd.org/changeset/base/256874 Log: MFC 256716,256835: - Fix jail_parallel_start="YES". - Fix ip[46].addr when interface parameter is not defined. - Fix a bug which prevented jails from starting when $jail_conf was used and no jail name was specified. - Display error messages when start/stop fails. Approved by: re (glebius) Modified: stable/10/etc/rc.d/jail Directory Properties: stable/10/etc/rc.d/ (props changed) Modified: stable/10/etc/rc.d/jail ============================================================================== --- stable/10/etc/rc.d/jail Tue Oct 22 05:22:46 2013 (r256873) +++ stable/10/etc/rc.d/jail Tue Oct 22 06:02:40 2013 (r256874) @@ -132,7 +132,9 @@ parse_options() # _confwarn=1 if [ -r "$jail_conf" -o -r "$_jconf" ]; then - warn "$_conf is created and used for jail $_j." + if ! checkyesno jail_parallel_start; then + warn "$_conf is created and used for jail $_j." + fi fi /usr/bin/install -m 0644 -o root -g wheel /dev/null $_conf || return 1 @@ -367,10 +369,10 @@ jail_handle_ips_option() # Append address to list of addresses for the jail command. case $_type in inet) - echo " ip4.addr += \"${_iface}|${_addr}${_mask}\";" + echo " ip4.addr += \"${_iface:+${_iface}|}${_addr}${_mask}\";" ;; inet6) - echo " ip6.addr += \"${_iface}|${_addr}${_mask}\";" + echo " ip6.addr += \"${_iface:+${_iface}|}${_addr}${_mask}\";" need_dad_wait=1 ;; esac @@ -418,7 +420,7 @@ jail_status() jail_start() { - local _j _jid _jn + local _j _jid _jn _jl if [ $# = 0 ]; then return @@ -426,47 +428,82 @@ jail_start() echo -n 'Starting jails:' case $1 in _ALL) - echo -n ' ' command=$jail_program rc_flags=$jail_flags command_args="-f $jail_conf -c" - $jail_jls -nq | while read IN; do - _jn=$(echo $IN | tr " " "\n" | grep name=) - _jid=$(echo $IN | tr " " "\n" | grep jid=) - if $command $rc_flags $command_args ${_jn#name=}; then + _tmp=`mktemp -t jail` || exit 3 + if $command $rc_flags $command_args >> $_tmp 2>&1; then + $jail_jls -nq | while read IN; do + _jn=$(echo $IN | tr " " "\n" | grep ^name=) + _jid=$(echo $IN | tr " " "\n" | grep ^jid=) echo -n " ${_jn#name=}" echo "${_jid#jid=}" \ > /var/run/jail_${_jn#name=}.id - fi - done + done + else + tail -1 $_tmp + fi + rm -f $_tmp echo '.' return ;; esac - _tmp=`mktemp -t jail` || exit 3 - for _j in $@; do - _j=$(echo $_j | tr /. _) - parse_options $_j || continue - - eval rc_flags=\${jail_${_j}_flags:-$jail_flags} - eval command=\${jail_${_j}_program:-$jail_program} - if checkyesno jail_parallel_start; then - command_args="-i -f $_conf -c $_j &" - else + if checkyesno jail_parallel_start; then + # + # Start jails in parallel and then check jail id when + # jail_parallel_start is YES. + # + _jl= + for _j in $@; do + _j=$(echo $_j | tr /. _) + parse_options $_j || continue + + _jl="$_jl $_j" + eval rc_flags=\${jail_${_j}_flags:-$jail_flags} + eval command=\${jail_${_j}_program:-$jail_program} command_args="-i -f $_conf -c $_j" - fi - if $command $rc_flags $command_args \ - >> $_tmp 2>&1 /dev/null 2>&1 /var/run/jail_${_j}.id - else - rm -f /var/run/jail_${_j}.id - echo " cannot start jail \"${_hostname:-${_j}}\": " - cat $_tmp - fi - rm -f $_tmp - done + if _jid=$($jail_jls -n -j $_j | tr " " "\n" | \ + grep ^jid=); then + echo "${_jid#jid=}" > /var/run/jail_${_j}.id + else + rm -f /var/run/jail_${_j}.id + echo " cannot start jail " \ + "\"${_hostname:-${_j}}\": " + fi + done + else + # + # Start jails one-by-one when jail_parallel_start is NO. + # + for _j in $@; do + _j=$(echo $_j | tr /. _) + parse_options $_j || continue + + eval rc_flags=\${jail_${_j}_flags:-$jail_flags} + eval command=\${jail_${_j}_program:-$jail_program} + command_args="-i -f $_conf -c $_j" + _tmp=`mktemp -t jail` || exit 3 + if $command $rc_flags $command_args \ + >> $_tmp 2>&1 /var/run/jail_${_j}.id + else + rm -f /var/run/jail_${_j}.id + echo " cannot start jail " \ + "\"${_hostname:-${_j}}\": " + cat $_tmp + fi + rm -f $_tmp + done + fi echo '.' } @@ -480,17 +517,21 @@ jail_stop() echo -n 'Stopping jails:' case $1 in _ALL) - echo -n ' ' command=$jail_program rc_flags=$jail_flags command_args="-f $jail_conf -r" $jail_jls -nq | while read IN; do - _jn=$(echo $IN | tr " " "\n" | grep name=) + _jn=$(echo $IN | tr " " "\n" | grep ^name=) echo -n " ${_jn#name=}" - $command $rc_flags $command_args ${_jn#name=} - if ! $jail_jls -j ${_jn#name=} > /dev/null 2>&1; then + _tmp=`mktemp -t jail` || exit 3 + $command $rc_flags $command_args ${_jn#name=} \ + >> $_tmp 2>&1 + if $jail_jls -j ${_jn#name=} > /dev/null 2>&1; then + tail -1 $_tmp + else rm -f /var/run/jail_${_jn#name=}.id fi + rm -f $_tmp done echo '.' return @@ -504,10 +545,14 @@ jail_stop() fi eval command=\${jail_${_j}_program:-$jail_program} echo -n " ${_hostname:-${_j}}" - $command -q -f $_conf -r $_j - if ! $jail_jls -j $_j > /dev/null 2>&1; then + _tmp=`mktemp -t jail` || exit 3 + $command -q -f $_conf -r $_j >> $_tmp 2>&1 + if $jail_jls -j $_j > /dev/null 2>&1; then + tail -1 $_tmp + else rm -f /var/run/jail_${_j}.id fi + rm -f $_tmp done echo '.' } From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 06:53:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 59EC3C80; Tue, 22 Oct 2013 06:53:02 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4027322E5; Tue, 22 Oct 2013 06:53:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9M6r2Fb082431; Tue, 22 Oct 2013 06:53:02 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9M6r2tr082429; Tue, 22 Oct 2013 06:53:02 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201310220653.r9M6r2tr082429@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 22 Oct 2013 06:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256875 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 06:53:02 -0000 Author: des Date: Tue Oct 22 06:53:01 2013 New Revision: 256875 URL: http://svnweb.freebsd.org/changeset/base/256875 Log: Start rtsold if necessary. Reviewed by: hrs MFC after: 3 days Modified: head/etc/netstart Modified: head/etc/netstart ============================================================================== --- head/etc/netstart Tue Oct 22 06:02:40 2013 (r256874) +++ head/etc/netstart Tue Oct 22 06:53:01 2013 (r256875) @@ -59,6 +59,7 @@ _start=quietstart /etc/rc.d/route6d ${_start} /etc/rc.d/mrouted ${_start} /etc/rc.d/routed ${_start} +/etc/rc.d/rtsold ${_start} /etc/rc.d/nisdomain ${_start} exit 0 From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 07:44:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D258C5A0; Tue, 22 Oct 2013 07:44:26 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C03862539; Tue, 22 Oct 2013 07:44:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9M7iQff009868; Tue, 22 Oct 2013 07:44:26 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9M7iQ0V009867; Tue, 22 Oct 2013 07:44:26 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201310220744.r9M7iQ0V009867@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 22 Oct 2013 07:44:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256878 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 07:44:26 -0000 Author: des Date: Tue Oct 22 07:44:26 2013 New Revision: 256878 URL: http://svnweb.freebsd.org/changeset/base/256878 Log: Add a reload command. Reviewed by: hrs MFC after: 3 days Modified: head/etc/rc.d/rtadvd Modified: head/etc/rc.d/rtadvd ============================================================================== --- head/etc/rc.d/rtadvd Tue Oct 22 07:17:22 2013 (r256877) +++ head/etc/rc.d/rtadvd Tue Oct 22 07:44:26 2013 (r256878) @@ -14,6 +14,8 @@ name="rtadvd" rcvar="rtadvd_enable" command="/usr/sbin/${name}" +extra_commands="reload" +reload_cmd="rtadvd_reload" start_precmd="rtadvd_precmd" rtadvd_precmd() @@ -62,5 +64,9 @@ rtadvd_precmd() return 0 } +rtadvd_reload() { + /usr/sbin/rtadvctl reload +} + load_rc_config $name run_rc_command "$1" From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 08:22:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8C315ECC; Tue, 22 Oct 2013 08:22:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 76D75279D; Tue, 22 Oct 2013 08:22:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9M8MNjC032129; Tue, 22 Oct 2013 08:22:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9M8MKXR032099; Tue, 22 Oct 2013 08:22:20 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310220822.r9M8MKXR032099@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Oct 2013 08:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256880 - in head/sys: cam/ata cam/scsi cddl/contrib/opensolaris/uts/common/fs/zfs dev/md geom geom/concat geom/gate geom/mirror geom/multipath geom/nop geom/part geom/raid geom/stripe ... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 08:22:23 -0000 Author: mav Date: Tue Oct 22 08:22:19 2013 New Revision: 256880 URL: http://svnweb.freebsd.org/changeset/base/256880 Log: Merge GEOM direct dispatch changes from the projects/camlock branch. When safety requirements are met, it allows to avoid passing I/O requests to GEOM g_up/g_down thread, executing them directly in the caller context. That allows to avoid CPU bottlenecks in g_up/g_down threads, plus avoid several context switches per I/O. The defined now safety requirements are: - caller should not hold any locks and should be reenterable; - callee should not depend on GEOM dual-threaded concurency semantics; - on the way down, if request is unmapped while callee doesn't support it, the context should be sleepable; - kernel thread stack usage should be below 50%. To keep compatibility with GEOM classes not meeting above requirements new provider and consumer flags added: - G_CF_DIRECT_SEND -- consumer code meets caller requirements (request); - G_CF_DIRECT_RECEIVE -- consumer code meets callee requirements (done); - G_PF_DIRECT_SEND -- provider code meets caller requirements (done); - G_PF_DIRECT_RECEIVE -- provider code meets callee requirements (request). Capable GEOM class can set them, allowing direct dispatch in cases where it is safe. If any of requirements are not met, request is queued to g_up or g_down thread same as before. Such GEOM classes were reviewed and updated to support direct dispatch: CONCAT, DEV, DISK, GATE, MD, MIRROR, MULTIPATH, NOP, PART, RAID, STRIPE, VFS, ZERO, ZFS::VDEV, ZFS::ZVOL, all classes based on g_slice KPI (LABEL, MAP, FLASHMAP, etc). To declare direct completion capability disk(9) KPI got new flag equivalent to G_PF_DIRECT_SEND -- DISKFLAG_DIRECT_COMPLETION. da(4) and ada(4) disk drivers got it set now thanks to earlier CAM locking work. This change more then twice increases peak block storage performance on systems with manu CPUs, together with earlier CAM locking changes reaching more then 1 million IOPS (512 byte raw reads from 16 SATA SSDs on 4 HBAs to 256 user-level threads). Sponsored by: iXsystems, Inc. MFC after: 2 months Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c head/sys/dev/md/md.c head/sys/geom/concat/g_concat.c head/sys/geom/concat/g_concat.h head/sys/geom/gate/g_gate.c head/sys/geom/geom.h head/sys/geom/geom_dev.c head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h head/sys/geom/geom_int.h head/sys/geom/geom_io.c head/sys/geom/geom_kern.c head/sys/geom/geom_slice.c head/sys/geom/geom_vfs.c head/sys/geom/mirror/g_mirror.c head/sys/geom/mirror/g_mirror.h head/sys/geom/multipath/g_multipath.c head/sys/geom/nop/g_nop.c head/sys/geom/nop/g_nop.h head/sys/geom/part/g_part.c head/sys/geom/raid/g_raid.c head/sys/geom/raid/md_ddf.c head/sys/geom/raid/md_intel.c head/sys/geom/raid/md_jmicron.c head/sys/geom/raid/md_nvidia.c head/sys/geom/raid/md_promise.c head/sys/geom/raid/md_sii.c head/sys/geom/stripe/g_stripe.c head/sys/geom/stripe/g_stripe.h head/sys/geom/zero/g_zero.c head/sys/kern/subr_devstat.c head/sys/sys/proc.h Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Tue Oct 22 07:59:14 2013 (r256879) +++ head/sys/cam/ata/ata_da.c Tue Oct 22 08:22:19 2013 (r256880) @@ -1253,7 +1253,7 @@ adaregister(struct cam_periph *periph, v maxio = min(maxio, 256 * softc->params.secsize); softc->disk->d_maxsize = maxio; softc->disk->d_unit = periph->unit_number; - softc->disk->d_flags = 0; + softc->disk->d_flags = DISKFLAG_DIRECT_COMPLETION; if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; if (softc->flags & ADA_FLAG_CAN_TRIM) { Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Oct 22 07:59:14 2013 (r256879) +++ head/sys/cam/scsi/scsi_da.c Tue Oct 22 08:22:19 2013 (r256880) @@ -2125,7 +2125,7 @@ daregister(struct cam_periph *periph, vo else softc->disk->d_maxsize = cpi.maxio; softc->disk->d_unit = periph->unit_number; - softc->disk->d_flags = 0; + softc->disk->d_flags = DISKFLAG_DIRECT_COMPLETION; if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0) softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; if ((cpi.hba_misc & PIM_UNMAPPED) != 0) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Oct 22 07:59:14 2013 (r256879) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Oct 22 08:22:19 2013 (r256880) @@ -147,6 +147,7 @@ vdev_geom_attach(struct g_provider *pp) ZFS_LOG(1, "Used existing consumer for %s.", pp->name); } } + cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; return (cp); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Tue Oct 22 07:59:14 2013 (r256879) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Tue Oct 22 08:22:19 2013 (r256880) @@ -2153,6 +2153,7 @@ zvol_geom_create(const char *name) gp->start = zvol_geom_start; gp->access = zvol_geom_access; pp = g_new_providerf(gp, "%s/%s", ZVOL_DRIVER, name); + pp->flags |= G_PF_DIRECT_RECEIVE | G_PF_DIRECT_SEND; pp->sectorsize = DEV_BSIZE; zv = kmem_zalloc(sizeof(*zv), KM_SLEEP); @@ -2256,18 +2257,20 @@ zvol_geom_start(struct bio *bp) zvol_state_t *zv; boolean_t first; + zv = bp->bio_to->private; + ASSERT(zv != NULL); switch (bp->bio_cmd) { + case BIO_FLUSH: + if (!THREAD_CAN_SLEEP()) + goto enqueue; + zil_commit(zv->zv_zilog, ZVOL_OBJ); + g_io_deliver(bp, 0); + break; case BIO_READ: case BIO_WRITE: - case BIO_FLUSH: - zv = bp->bio_to->private; - ASSERT(zv != NULL); - mtx_lock(&zv->zv_queue_mtx); - first = (bioq_first(&zv->zv_queue) == NULL); - bioq_insert_tail(&zv->zv_queue, bp); - mtx_unlock(&zv->zv_queue_mtx); - if (first) - wakeup_one(&zv->zv_queue); + if (!THREAD_CAN_SLEEP()) + goto enqueue; + zvol_strategy(bp); break; case BIO_GETATTR: case BIO_DELETE: @@ -2275,6 +2278,15 @@ zvol_geom_start(struct bio *bp) g_io_deliver(bp, EOPNOTSUPP); break; } + return; + +enqueue: + mtx_lock(&zv->zv_queue_mtx); + first = (bioq_first(&zv->zv_queue) == NULL); + bioq_insert_tail(&zv->zv_queue, bp); + mtx_unlock(&zv->zv_queue_mtx); + if (first) + wakeup_one(&zv->zv_queue); } static void @@ -2449,6 +2461,7 @@ zvol_rename_minor(struct g_geom *gp, con g_wither_provider(pp, ENXIO); pp = g_new_providerf(gp, "%s/%s", ZVOL_DRIVER, newname); + pp->flags |= G_PF_DIRECT_RECEIVE | G_PF_DIRECT_SEND; pp->sectorsize = DEV_BSIZE; pp->mediasize = zv->zv_volsize; pp->private = zv; Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Tue Oct 22 07:59:14 2013 (r256879) +++ head/sys/dev/md/md.c Tue Oct 22 08:22:19 2013 (r256880) @@ -189,6 +189,7 @@ struct md_s { LIST_ENTRY(md_s) list; struct bio_queue_head bio_queue; struct mtx queue_mtx; + struct mtx stat_mtx; struct cdev *dev; enum md_types type; off_t mediasize; @@ -415,8 +416,11 @@ g_md_start(struct bio *bp) struct md_s *sc; sc = bp->bio_to->geom->softc; - if ((bp->bio_cmd == BIO_READ) || (bp->bio_cmd == BIO_WRITE)) + if ((bp->bio_cmd == BIO_READ) || (bp->bio_cmd == BIO_WRITE)) { + mtx_lock(&sc->stat_mtx); devstat_start_transaction_bio(sc->devstat, bp); + mtx_unlock(&sc->stat_mtx); + } mtx_lock(&sc->queue_mtx); bioq_disksort(&sc->bio_queue, bp); mtx_unlock(&sc->queue_mtx); @@ -987,6 +991,7 @@ mdnew(int unit, int *errp, enum md_types sc->type = type; bioq_init(&sc->bio_queue); mtx_init(&sc->queue_mtx, "md bio queue", NULL, MTX_DEF); + mtx_init(&sc->stat_mtx, "md stat", NULL, MTX_DEF); sc->unit = unit; sprintf(sc->name, "md%d", unit); LIST_INSERT_HEAD(&md_softc_list, sc, list); @@ -994,6 +999,7 @@ mdnew(int unit, int *errp, enum md_types if (error == 0) return (sc); LIST_REMOVE(sc, list); + mtx_destroy(&sc->stat_mtx); mtx_destroy(&sc->queue_mtx); free_unr(md_uh, sc->unit); free(sc, M_MD); @@ -1011,6 +1017,7 @@ mdinit(struct md_s *sc) gp = g_new_geomf(&g_md_class, "md%d", sc->unit); gp->softc = sc; pp = g_new_providerf(gp, "md%d", sc->unit); + pp->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE; pp->mediasize = sc->mediasize; pp->sectorsize = sc->sectorsize; switch (sc->type) { @@ -1206,6 +1213,7 @@ mddestroy(struct md_s *sc, struct thread while (!(sc->flags & MD_EXITING)) msleep(sc->procp, &sc->queue_mtx, PRIBIO, "mddestroy", hz / 10); mtx_unlock(&sc->queue_mtx); + mtx_destroy(&sc->stat_mtx); mtx_destroy(&sc->queue_mtx); if (sc->vnode != NULL) { vn_lock(sc->vnode, LK_EXCLUSIVE | LK_RETRY); Modified: head/sys/geom/concat/g_concat.c ============================================================================== --- head/sys/geom/concat/g_concat.c Tue Oct 22 07:59:14 2013 (r256879) +++ head/sys/geom/concat/g_concat.c Tue Oct 22 08:22:19 2013 (r256880) @@ -239,6 +239,27 @@ g_concat_kernel_dump(struct bio *bp) } static void +g_concat_done(struct bio *bp) +{ + struct g_concat_softc *sc; + struct bio *pbp; + + pbp = bp->bio_parent; + sc = pbp->bio_to->geom->softc; + mtx_lock(&sc->sc_lock); + if (pbp->bio_error == 0) + pbp->bio_error = bp->bio_error; + pbp->bio_completed += bp->bio_completed; + pbp->bio_inbed++; + if (pbp->bio_children == pbp->bio_inbed) { + mtx_unlock(&sc->sc_lock); + g_io_deliver(pbp, pbp->bio_error); + } else + mtx_unlock(&sc->sc_lock); + g_destroy_bio(bp); +} + +static void g_concat_flush(struct g_concat_softc *sc, struct bio *bp) { struct bio_queue_head queue; @@ -250,23 +271,19 @@ g_concat_flush(struct g_concat_softc *sc for (no = 0; no < sc->sc_ndisks; no++) { cbp = g_clone_bio(bp); if (cbp == NULL) { - for (cbp = bioq_first(&queue); cbp != NULL; - cbp = bioq_first(&queue)) { - bioq_remove(&queue, cbp); + while ((cbp = bioq_takefirst(&queue)) != NULL) g_destroy_bio(cbp); - } if (bp->bio_error == 0) bp->bio_error = ENOMEM; g_io_deliver(bp, bp->bio_error); return; } bioq_insert_tail(&queue, cbp); - cbp->bio_done = g_std_done; + cbp->bio_done = g_concat_done; cbp->bio_caller1 = sc->sc_disks[no].d_consumer; cbp->bio_to = sc->sc_disks[no].d_consumer->provider; } - for (cbp = bioq_first(&queue); cbp != NULL; cbp = bioq_first(&queue)) { - bioq_remove(&queue, cbp); + while ((cbp = bioq_takefirst(&queue)) != NULL) { G_CONCAT_LOGREQ(cbp, "Sending request."); cp = cbp->bio_caller1; cbp->bio_caller1 = NULL; @@ -320,7 +337,10 @@ g_concat_start(struct bio *bp) offset = bp->bio_offset; length = bp->bio_length; - addr = bp->bio_data; + if ((bp->bio_flags & BIO_UNMAPPED) != 0) + addr = NULL; + else + addr = bp->bio_data; end = offset + length; bioq_init(&queue); @@ -338,11 +358,8 @@ g_concat_start(struct bio *bp) cbp = g_clone_bio(bp); if (cbp == NULL) { - for (cbp = bioq_first(&queue); cbp != NULL; - cbp = bioq_first(&queue)) { - bioq_remove(&queue, cbp); + while ((cbp = bioq_takefirst(&queue)) != NULL) g_destroy_bio(cbp); - } if (bp->bio_error == 0) bp->bio_error = ENOMEM; g_io_deliver(bp, bp->bio_error); @@ -352,11 +369,21 @@ g_concat_start(struct bio *bp) /* * Fill in the component buf structure. */ - cbp->bio_done = g_std_done; + if (len == bp->bio_length) + cbp->bio_done = g_std_done; + else + cbp->bio_done = g_concat_done; cbp->bio_offset = off; - cbp->bio_data = addr; - addr += len; cbp->bio_length = len; + if ((bp->bio_flags & BIO_UNMAPPED) != 0) { + cbp->bio_ma_offset += (uintptr_t)addr; + cbp->bio_ma += cbp->bio_ma_offset / PAGE_SIZE; + cbp->bio_ma_offset %= PAGE_SIZE; + cbp->bio_ma_n = round_page(cbp->bio_ma_offset + + cbp->bio_length) / PAGE_SIZE; + } else + cbp->bio_data = addr; + addr += len; cbp->bio_to = disk->d_consumer->provider; cbp->bio_caller1 = disk; @@ -366,8 +393,7 @@ g_concat_start(struct bio *bp) KASSERT(length == 0, ("Length is still greater than 0 (class=%s, name=%s).", bp->bio_to->geom->class->name, bp->bio_to->geom->name)); - for (cbp = bioq_first(&queue); cbp != NULL; cbp = bioq_first(&queue)) { - bioq_remove(&queue, cbp); + while ((cbp = bioq_takefirst(&queue)) != NULL) { G_CONCAT_LOGREQ(cbp, "Sending request."); disk = cbp->bio_caller1; cbp->bio_caller1 = NULL; @@ -379,7 +405,7 @@ static void g_concat_check_and_run(struct g_concat_softc *sc) { struct g_concat_disk *disk; - struct g_provider *pp; + struct g_provider *dp, *pp; u_int no, sectorsize = 0; off_t start; @@ -388,20 +414,27 @@ g_concat_check_and_run(struct g_concat_s return; pp = g_new_providerf(sc->sc_geom, "concat/%s", sc->sc_name); + pp->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE | + G_PF_ACCEPT_UNMAPPED; start = 0; for (no = 0; no < sc->sc_ndisks; no++) { disk = &sc->sc_disks[no]; + dp = disk->d_consumer->provider; disk->d_start = start; - disk->d_end = disk->d_start + - disk->d_consumer->provider->mediasize; + disk->d_end = disk->d_start + dp->mediasize; if (sc->sc_type == G_CONCAT_TYPE_AUTOMATIC) - disk->d_end -= disk->d_consumer->provider->sectorsize; + disk->d_end -= dp->sectorsize; start = disk->d_end; if (no == 0) - sectorsize = disk->d_consumer->provider->sectorsize; - else { - sectorsize = lcm(sectorsize, - disk->d_consumer->provider->sectorsize); + sectorsize = dp->sectorsize; + else + sectorsize = lcm(sectorsize, dp->sectorsize); + + /* A provider underneath us doesn't support unmapped */ + if ((dp->flags & G_PF_ACCEPT_UNMAPPED) == 0) { + G_CONCAT_DEBUG(1, "Cancelling unmapped " + "because of %s.", dp->name); + pp->flags &= ~G_PF_ACCEPT_UNMAPPED; } } pp->sectorsize = sectorsize; @@ -468,6 +501,7 @@ g_concat_add_disk(struct g_concat_softc fcp = LIST_FIRST(&gp->consumer); cp = g_new_consumer(gp); + cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; error = g_attach(cp, pp); if (error != 0) { g_destroy_consumer(cp); @@ -557,6 +591,7 @@ g_concat_create(struct g_class *mp, cons for (no = 0; no < sc->sc_ndisks; no++) sc->sc_disks[no].d_consumer = NULL; sc->sc_type = type; + mtx_init(&sc->sc_lock, "gconcat lock", NULL, MTX_DEF); gp->softc = sc; sc->sc_geom = gp; @@ -605,6 +640,7 @@ g_concat_destroy(struct g_concat_softc * KASSERT(sc->sc_provider == NULL, ("Provider still exists? (device=%s)", gp->name)); free(sc->sc_disks, M_CONCAT); + mtx_destroy(&sc->sc_lock); free(sc, M_CONCAT); G_CONCAT_DEBUG(0, "Device %s destroyed.", gp->name); Modified: head/sys/geom/concat/g_concat.h ============================================================================== --- head/sys/geom/concat/g_concat.h Tue Oct 22 07:59:14 2013 (r256879) +++ head/sys/geom/concat/g_concat.h Tue Oct 22 08:22:19 2013 (r256880) @@ -83,6 +83,7 @@ struct g_concat_softc { struct g_concat_disk *sc_disks; uint16_t sc_ndisks; + struct mtx sc_lock; }; #define sc_name sc_geom->name #endif /* _KERNEL */ Modified: head/sys/geom/gate/g_gate.c ============================================================================== --- head/sys/geom/gate/g_gate.c Tue Oct 22 07:59:14 2013 (r256879) +++ head/sys/geom/gate/g_gate.c Tue Oct 22 08:22:19 2013 (r256880) @@ -91,6 +91,7 @@ static struct mtx g_gate_units_lock; static int g_gate_destroy(struct g_gate_softc *sc, boolean_t force) { + struct bio_queue_head queue; struct g_provider *pp; struct g_consumer *cp; struct g_geom *gp; @@ -113,21 +114,22 @@ g_gate_destroy(struct g_gate_softc *sc, pp->flags |= G_PF_WITHER; g_orphan_provider(pp, ENXIO); callout_drain(&sc->sc_callout); + bioq_init(&queue); mtx_lock(&sc->sc_queue_mtx); - while ((bp = bioq_first(&sc->sc_inqueue)) != NULL) { - bioq_remove(&sc->sc_inqueue, bp); + while ((bp = bioq_takefirst(&sc->sc_inqueue)) != NULL) { sc->sc_queue_count--; - G_GATE_LOGREQ(1, bp, "Request canceled."); - g_io_deliver(bp, ENXIO); + bioq_insert_tail(&queue, bp); } - while ((bp = bioq_first(&sc->sc_outqueue)) != NULL) { - bioq_remove(&sc->sc_outqueue, bp); + while ((bp = bioq_takefirst(&sc->sc_outqueue)) != NULL) { sc->sc_queue_count--; - G_GATE_LOGREQ(1, bp, "Request canceled."); - g_io_deliver(bp, ENXIO); + bioq_insert_tail(&queue, bp); } mtx_unlock(&sc->sc_queue_mtx); g_topology_unlock(); + while ((bp = bioq_takefirst(&queue)) != NULL) { + G_GATE_LOGREQ(1, bp, "Request canceled."); + g_io_deliver(bp, ENXIO); + } mtx_lock(&g_gate_units_lock); /* One reference is ours. */ sc->sc_ref--; @@ -334,6 +336,7 @@ g_gate_getunit(int unit, int *errorp) static void g_gate_guard(void *arg) { + struct bio_queue_head queue; struct g_gate_softc *sc; struct bintime curtime; struct bio *bp, *bp2; @@ -341,24 +344,27 @@ g_gate_guard(void *arg) sc = arg; binuptime(&curtime); g_gate_hold(sc->sc_unit, NULL); + bioq_init(&queue); mtx_lock(&sc->sc_queue_mtx); TAILQ_FOREACH_SAFE(bp, &sc->sc_inqueue.queue, bio_queue, bp2) { if (curtime.sec - bp->bio_t0.sec < 5) continue; bioq_remove(&sc->sc_inqueue, bp); sc->sc_queue_count--; - G_GATE_LOGREQ(1, bp, "Request timeout."); - g_io_deliver(bp, EIO); + bioq_insert_tail(&queue, bp); } TAILQ_FOREACH_SAFE(bp, &sc->sc_outqueue.queue, bio_queue, bp2) { if (curtime.sec - bp->bio_t0.sec < 5) continue; bioq_remove(&sc->sc_outqueue, bp); sc->sc_queue_count--; + bioq_insert_tail(&queue, bp); + } + mtx_unlock(&sc->sc_queue_mtx); + while ((bp = bioq_takefirst(&queue)) != NULL) { G_GATE_LOGREQ(1, bp, "Request timeout."); g_io_deliver(bp, EIO); } - mtx_unlock(&sc->sc_queue_mtx); if ((sc->sc_flags & G_GATE_FLAG_DESTROY) == 0) { callout_reset(&sc->sc_callout, sc->sc_timeout * hz, g_gate_guard, sc); @@ -542,6 +548,7 @@ g_gate_create(struct g_gate_ctl_create * if (ropp != NULL) { cp = g_new_consumer(gp); + cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; error = g_attach(cp, ropp); if (error != 0) { G_GATE_DEBUG(1, "Unable to attach to %s.", ropp->name); @@ -560,6 +567,7 @@ g_gate_create(struct g_gate_ctl_create * ggio->gctl_unit = sc->sc_unit; pp = g_new_providerf(gp, "%s", name); + pp->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE; pp->mediasize = ggio->gctl_mediasize; pp->sectorsize = ggio->gctl_sectorsize; sc->sc_provider = pp; @@ -636,6 +644,7 @@ g_gate_modify(struct g_gate_softc *sc, s return (EINVAL); } cp = g_new_consumer(sc->sc_provider->geom); + cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; error = g_attach(cp, pp); if (error != 0) { G_GATE_DEBUG(1, "Unable to attach to %s.", Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Tue Oct 22 07:59:14 2013 (r256879) +++ head/sys/geom/geom.h Tue Oct 22 08:22:19 2013 (r256880) @@ -177,6 +177,8 @@ struct g_consumer { int flags; #define G_CF_SPOILED 0x1 #define G_CF_ORPHAN 0x4 +#define G_CF_DIRECT_SEND 0x10 +#define G_CF_DIRECT_RECEIVE 0x20 struct devstat *stat; u_int nstart, nend; @@ -206,6 +208,8 @@ struct g_provider { #define G_PF_WITHER 0x2 #define G_PF_ORPHAN 0x4 #define G_PF_ACCEPT_UNMAPPED 0x8 +#define G_PF_DIRECT_SEND 0x10 +#define G_PF_DIRECT_RECEIVE 0x20 /* Two fields for the implementing class to use */ void *private; @@ -393,6 +397,8 @@ g_free(void *ptr) }; \ DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); +int g_is_geom_thread(struct thread *td); + #endif /* _KERNEL */ /* geom_ctl.c */ Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Tue Oct 22 07:59:14 2013 (r256879) +++ head/sys/geom/geom_dev.c Tue Oct 22 08:22:19 2013 (r256880) @@ -222,6 +222,7 @@ g_dev_taste(struct g_class *mp, struct g mtx_init(&sc->sc_mtx, "g_dev", NULL, MTX_DEF); cp = g_new_consumer(gp); cp->private = sc; + cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; error = g_attach(cp, pp); KASSERT(error == 0, ("g_dev_taste(%s) failed to g_attach, err=%d", pp->name, error)); Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Tue Oct 22 07:59:14 2013 (r256879) +++ head/sys/geom/geom_disk.c Tue Oct 22 08:22:19 2013 (r256880) @@ -66,6 +66,7 @@ struct g_disk_softc { struct sysctl_oid *sysctl_tree; char led[64]; uint32_t state; + struct mtx start_mtx; }; static g_access_t g_disk_access; @@ -255,6 +256,25 @@ g_disk_done(struct bio *bp) g_destroy_bio(bp); } +static void +g_disk_done_single(struct bio *bp) +{ + struct bintime now; + struct g_disk_softc *sc; + + bp->bio_completed = bp->bio_length - bp->bio_resid; + bp->bio_done = (void *)bp->bio_to; + bp->bio_to = LIST_FIRST(&bp->bio_disk->d_geom->provider); + if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) != 0) { + binuptime(&now); + sc = bp->bio_to->private; + mtx_lock(&sc->done_mtx); + devstat_end_transaction_bio_bt(sc->dp->d_devstat, bp, &now); + mtx_unlock(&sc->done_mtx); + } + g_io_deliver(bp, bp->bio_error); +} + static int g_disk_ioctl(struct g_provider *pp, u_long cmd, void * data, int fflag, struct thread *td) { @@ -280,7 +300,7 @@ g_disk_start(struct bio *bp) struct disk *dp; struct g_disk_softc *sc; int error; - off_t off; + off_t d_maxsize, off; sc = bp->bio_to->private; if (sc == NULL || (dp = sc->dp) == NULL || dp->d_destroyed) { @@ -297,6 +317,22 @@ g_disk_start(struct bio *bp) /* fall-through */ case BIO_READ: case BIO_WRITE: + d_maxsize = (bp->bio_cmd == BIO_DELETE) ? + dp->d_delmaxsize : dp->d_maxsize; + if (bp->bio_length <= d_maxsize) { + bp->bio_disk = dp; + bp->bio_to = (void *)bp->bio_done; + bp->bio_done = g_disk_done_single; + bp->bio_pblkno = bp->bio_offset / dp->d_sectorsize; + bp->bio_bcount = bp->bio_length; + mtx_lock(&sc->start_mtx); + devstat_start_transaction_bio(dp->d_devstat, bp); + mtx_unlock(&sc->start_mtx); + g_disk_lock_giant(dp); + dp->d_strategy(bp); + g_disk_unlock_giant(dp); + break; + } off = 0; bp3 = NULL; bp2 = g_clone_bio(bp); @@ -305,10 +341,6 @@ g_disk_start(struct bio *bp) break; } do { - off_t d_maxsize; - - d_maxsize = (bp->bio_cmd == BIO_DELETE) ? - dp->d_delmaxsize : dp->d_maxsize; bp2->bio_offset += off; bp2->bio_length -= off; if ((bp->bio_flags & BIO_UNMAPPED) == 0) { @@ -349,7 +381,9 @@ g_disk_start(struct bio *bp) bp2->bio_pblkno = bp2->bio_offset / dp->d_sectorsize; bp2->bio_bcount = bp2->bio_length; bp2->bio_disk = dp; + mtx_lock(&sc->start_mtx); devstat_start_transaction_bio(dp->d_devstat, bp2); + mtx_unlock(&sc->start_mtx); g_disk_lock_giant(dp); dp->d_strategy(bp2); g_disk_unlock_giant(dp); @@ -405,15 +439,11 @@ g_disk_start(struct bio *bp) error = EOPNOTSUPP; break; } - bp2 = g_clone_bio(bp); - if (bp2 == NULL) { - g_io_deliver(bp, ENOMEM); - return; - } - bp2->bio_done = g_disk_done; - bp2->bio_disk = dp; + bp->bio_disk = dp; + bp->bio_to = (void *)bp->bio_done; + bp->bio_done = g_disk_done_single; g_disk_lock_giant(dp); - dp->d_strategy(bp2); + dp->d_strategy(bp); g_disk_unlock_giant(dp); break; default: @@ -518,17 +548,24 @@ g_disk_create(void *arg, int flag) g_topology_assert(); dp = arg; sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); + mtx_init(&sc->start_mtx, "g_disk_start", NULL, MTX_DEF); mtx_init(&sc->done_mtx, "g_disk_done", NULL, MTX_DEF); sc->dp = dp; gp = g_new_geomf(&g_disk_class, "%s%d", dp->d_name, dp->d_unit); gp->softc = sc; pp = g_new_providerf(gp, "%s", gp->name); + devstat_remove_entry(pp->stat); + pp->stat = NULL; + dp->d_devstat->id = pp; pp->mediasize = dp->d_mediasize; pp->sectorsize = dp->d_sectorsize; pp->stripeoffset = dp->d_stripeoffset; pp->stripesize = dp->d_stripesize; if ((dp->d_flags & DISKFLAG_UNMAPPED_BIO) != 0) pp->flags |= G_PF_ACCEPT_UNMAPPED; + if ((dp->d_flags & DISKFLAG_DIRECT_COMPLETION) != 0) + pp->flags |= G_PF_DIRECT_SEND; + pp->flags |= G_PF_DIRECT_RECEIVE; if (bootverbose) printf("GEOM: new disk %s\n", gp->name); sysctl_ctx_init(&sc->sysctl_ctx); @@ -577,6 +614,7 @@ g_disk_providergone(struct g_provider *p pp->private = NULL; pp->geom->softc = NULL; mtx_destroy(&sc->done_mtx); + mtx_destroy(&sc->start_mtx); g_free(sc); } Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Tue Oct 22 07:59:14 2013 (r256879) +++ head/sys/geom/geom_disk.h Tue Oct 22 08:22:19 2013 (r256880) @@ -107,6 +107,7 @@ struct disk { #define DISKFLAG_CANDELETE 0x4 #define DISKFLAG_CANFLUSHCACHE 0x8 #define DISKFLAG_UNMAPPED_BIO 0x10 +#define DISKFLAG_DIRECT_COMPLETION 0x20 struct disk *disk_alloc(void); void disk_create(struct disk *disk, int version); Modified: head/sys/geom/geom_int.h ============================================================================== --- head/sys/geom/geom_int.h Tue Oct 22 07:59:14 2013 (r256879) +++ head/sys/geom/geom_int.h Tue Oct 22 08:22:19 2013 (r256880) @@ -39,6 +39,9 @@ LIST_HEAD(class_list_head, g_class); TAILQ_HEAD(g_tailq_head, g_geom); extern int g_collectstats; +#define G_STATS_PROVIDERS 1 /* Collect I/O stats for providers */ +#define G_STATS_CONSUMERS 2 /* Collect I/O stats for consumers */ + extern int g_debugflags; /* * 1 G_T_TOPOLOGY Modified: head/sys/geom/geom_io.c ============================================================================== --- head/sys/geom/geom_io.c Tue Oct 22 07:59:14 2013 (r256879) +++ head/sys/geom/geom_io.c Tue Oct 22 08:22:19 2013 (r256880) @@ -65,6 +65,8 @@ __FBSDID("$FreeBSD$"); #include #include +static int g_io_transient_map_bio(struct bio *bp); + static struct g_bioq g_bio_run_down; static struct g_bioq g_bio_run_up; static struct g_bioq g_bio_run_task; @@ -310,6 +312,8 @@ g_io_check(struct bio *bp) { struct g_consumer *cp; struct g_provider *pp; + off_t excess; + int error; cp = bp->bio_from; pp = bp->bio_to; @@ -354,11 +358,44 @@ g_io_check(struct bio *bp) return (EIO); if (bp->bio_offset > pp->mediasize) return (EIO); + + /* Truncate requests to the end of providers media. */ + excess = bp->bio_offset + bp->bio_length; + if (excess > bp->bio_to->mediasize) { + KASSERT((bp->bio_flags & BIO_UNMAPPED) == 0 || + round_page(bp->bio_ma_offset + + bp->bio_length) / PAGE_SIZE == bp->bio_ma_n, + ("excess bio %p too short", bp)); + excess -= bp->bio_to->mediasize; + bp->bio_length -= excess; + if ((bp->bio_flags & BIO_UNMAPPED) != 0) { + bp->bio_ma_n = round_page(bp->bio_ma_offset + + bp->bio_length) / PAGE_SIZE; + } + if (excess > 0) + CTR3(KTR_GEOM, "g_down truncated bio " + "%p provider %s by %d", bp, + bp->bio_to->name, excess); + } + + /* Deliver zero length transfers right here. */ + if (bp->bio_length == 0) { + CTR2(KTR_GEOM, "g_down terminated 0-length " + "bp %p provider %s", bp, bp->bio_to->name); + return (0); + } + + if ((bp->bio_flags & BIO_UNMAPPED) != 0 && + (bp->bio_to->flags & G_PF_ACCEPT_UNMAPPED) == 0 && + (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE)) { + if ((error = g_io_transient_map_bio(bp)) >= 0) + return (error); + } break; default: break; } - return (0); + return (EJUSTRETURN); } /* @@ -422,7 +459,8 @@ void g_io_request(struct bio *bp, struct g_consumer *cp) { struct g_provider *pp; - int first; + struct mtx *mtxp; + int direct, error, first; KASSERT(cp != NULL, ("NULL cp in g_io_request")); KASSERT(bp != NULL, ("NULL bp in g_io_request")); @@ -472,40 +510,71 @@ g_io_request(struct bio *bp, struct g_co KASSERT(!(bp->bio_flags & BIO_ONQUEUE), ("Bio already on queue bp=%p", bp)); - bp->bio_flags |= BIO_ONQUEUE; - - if (g_collectstats) + if ((g_collectstats & G_STATS_CONSUMERS) != 0 || + ((g_collectstats & G_STATS_PROVIDERS) != 0 && pp->stat != NULL)) binuptime(&bp->bio_t0); else getbinuptime(&bp->bio_t0); +#ifdef GET_STACK_USAGE + direct = (cp->flags & G_CF_DIRECT_SEND) && + (pp->flags & G_PF_DIRECT_RECEIVE) && + !g_is_geom_thread(curthread) && + (((pp->flags & G_PF_ACCEPT_UNMAPPED) == 0 && + (bp->bio_flags & BIO_UNMAPPED) != 0) || THREAD_CAN_SLEEP()); + if (direct) { + /* Block direct execution if less then half of stack left. */ + size_t st, su; + GET_STACK_USAGE(st, su); + if (su * 2 > st) + direct = 0; + } +#else + direct = 0; +#endif + + if (!TAILQ_EMPTY(&g_classifier_tailq) && !bp->bio_classifier1) { + g_bioq_lock(&g_bio_run_down); + g_run_classifiers(bp); + g_bioq_unlock(&g_bio_run_down); + } + /* * The statistics collection is lockless, as such, but we * can not update one instance of the statistics from more * than one thread at a time, so grab the lock first. - * - * We also use the lock to protect the list of classifiers. */ - g_bioq_lock(&g_bio_run_down); - - if (!TAILQ_EMPTY(&g_classifier_tailq) && !bp->bio_classifier1) - g_run_classifiers(bp); - - if (g_collectstats & 1) + mtxp = mtx_pool_find(mtxpool_sleep, pp); + mtx_lock(mtxp); + if (g_collectstats & G_STATS_PROVIDERS) devstat_start_transaction(pp->stat, &bp->bio_t0); - if (g_collectstats & 2) + if (g_collectstats & G_STATS_CONSUMERS) devstat_start_transaction(cp->stat, &bp->bio_t0); - pp->nstart++; cp->nstart++; - first = TAILQ_EMPTY(&g_bio_run_down.bio_queue); - TAILQ_INSERT_TAIL(&g_bio_run_down.bio_queue, bp, bio_queue); - g_bio_run_down.bio_queue_length++; - g_bioq_unlock(&g_bio_run_down); + mtx_unlock(mtxp); - /* Pass it on down. */ - if (first) - wakeup(&g_wait_down); + if (direct) { + error = g_io_check(bp); + if (error >= 0) { + CTR3(KTR_GEOM, "g_io_request g_io_check on bp %p " + "provider %s returned %d", bp, bp->bio_to->name, + error); + g_io_deliver(bp, error); + return; + } + bp->bio_to->geom->start(bp); + } else { + g_bioq_lock(&g_bio_run_down); + first = TAILQ_EMPTY(&g_bio_run_down.bio_queue); + TAILQ_INSERT_TAIL(&g_bio_run_down.bio_queue, bp, bio_queue); + bp->bio_flags |= BIO_ONQUEUE; + g_bio_run_down.bio_queue_length++; + g_bioq_unlock(&g_bio_run_down); + /* Pass it on down. */ + if (first) + wakeup(&g_wait_down); + } } void @@ -514,7 +583,8 @@ g_io_deliver(struct bio *bp, int error) struct bintime now; struct g_consumer *cp; struct g_provider *pp; - int first; + struct mtx *mtxp; + int direct, first; KASSERT(bp != NULL, ("NULL bp in g_io_deliver")); pp = bp->bio_to; @@ -560,33 +630,55 @@ g_io_deliver(struct bio *bp, int error) bp->bio_bcount = bp->bio_length; bp->bio_resid = bp->bio_bcount - bp->bio_completed; +#ifdef GET_STACK_USAGE + direct = (pp->flags & G_PF_DIRECT_SEND) && + (cp->flags & G_CF_DIRECT_RECEIVE) && + !g_is_geom_thread(curthread); + if (direct) { + /* Block direct execution if less then half of stack left. */ + size_t st, su; + GET_STACK_USAGE(st, su); + if (su * 2 > st) + direct = 0; + } +#else + direct = 0; +#endif + /* * The statistics collection is lockless, as such, but we * can not update one instance of the statistics from more * than one thread at a time, so grab the lock first. */ - if (g_collectstats) + if ((g_collectstats & G_STATS_CONSUMERS) != 0 || + ((g_collectstats & G_STATS_PROVIDERS) != 0 && pp->stat != NULL)) binuptime(&now); - g_bioq_lock(&g_bio_run_up); - if (g_collectstats & 1) + mtxp = mtx_pool_find(mtxpool_sleep, cp); + mtx_lock(mtxp); + if (g_collectstats & G_STATS_PROVIDERS) devstat_end_transaction_bio_bt(pp->stat, bp, &now); - if (g_collectstats & 2) + if (g_collectstats & G_STATS_CONSUMERS) devstat_end_transaction_bio_bt(cp->stat, bp, &now); - cp->nend++; pp->nend++; + mtx_unlock(mtxp); + if (error != ENOMEM) { bp->bio_error = error; - first = TAILQ_EMPTY(&g_bio_run_up.bio_queue); - TAILQ_INSERT_TAIL(&g_bio_run_up.bio_queue, bp, bio_queue); - bp->bio_flags |= BIO_ONQUEUE; - g_bio_run_up.bio_queue_length++; - g_bioq_unlock(&g_bio_run_up); - if (first) - wakeup(&g_wait_up); + if (direct) { + biodone(bp); + } else { + g_bioq_lock(&g_bio_run_up); + first = TAILQ_EMPTY(&g_bio_run_up.bio_queue); + TAILQ_INSERT_TAIL(&g_bio_run_up.bio_queue, bp, bio_queue); + bp->bio_flags |= BIO_ONQUEUE; + g_bio_run_up.bio_queue_length++; + g_bioq_unlock(&g_bio_run_up); + if (first) + wakeup(&g_wait_up); + } return; } - g_bioq_unlock(&g_bio_run_up); if (bootverbose) printf("ENOMEM %p on %p(%s)\n", bp, pp, pp->name); @@ -642,11 +734,10 @@ retry: if (vmem_alloc(transient_arena, size, M_BESTFIT | M_NOWAIT, &addr)) { if (transient_map_retries != 0 && retried >= transient_map_retries) { - g_io_deliver(bp, EDEADLK/* XXXKIB */); CTR2(KTR_GEOM, "g_down cannot map bp %p provider %s", bp, bp->bio_to->name); atomic_add_int(&transient_map_hard_failures, 1); - return (1); + return (EDEADLK/* XXXKIB */); } else { /* * Naive attempt to quisce the I/O to get more @@ -666,14 +757,13 @@ retry: bp->bio_data = (caddr_t)addr + bp->bio_ma_offset; bp->bio_flags |= BIO_TRANSIENT_MAPPING; bp->bio_flags &= ~BIO_UNMAPPED; - return (0); + return (EJUSTRETURN); } void g_io_schedule_down(struct thread *tp __unused) { struct bio *bp; - off_t excess; int error; for(;;) { @@ -692,59 +782,15 @@ g_io_schedule_down(struct thread *tp __u pause("g_down", hz/10); pace--; } + CTR2(KTR_GEOM, "g_down processing bp %p provider %s", bp, + bp->bio_to->name); error = g_io_check(bp); - if (error) { + if (error >= 0) { CTR3(KTR_GEOM, "g_down g_io_check on bp %p provider " "%s returned %d", bp, bp->bio_to->name, error); g_io_deliver(bp, error); continue; } - CTR2(KTR_GEOM, "g_down processing bp %p provider %s", bp, - bp->bio_to->name); - switch (bp->bio_cmd) { - case BIO_READ: - case BIO_WRITE: - case BIO_DELETE: - /* Truncate requests to the end of providers media. */ - /* - * XXX: What if we truncate because of offset being - * bad, not length? - */ - excess = bp->bio_offset + bp->bio_length; - if (excess > bp->bio_to->mediasize) { - KASSERT((bp->bio_flags & BIO_UNMAPPED) == 0 || - round_page(bp->bio_ma_offset + - bp->bio_length) / PAGE_SIZE == bp->bio_ma_n, - ("excess bio %p too short", bp)); - excess -= bp->bio_to->mediasize; - bp->bio_length -= excess; - if ((bp->bio_flags & BIO_UNMAPPED) != 0) { - bp->bio_ma_n = round_page( - bp->bio_ma_offset + - bp->bio_length) / PAGE_SIZE; - } - if (excess > 0) - CTR3(KTR_GEOM, "g_down truncated bio " - "%p provider %s by %d", bp, - bp->bio_to->name, excess); - } - /* Deliver zero length transfers right here. */ - if (bp->bio_length == 0) { - g_io_deliver(bp, 0); - CTR2(KTR_GEOM, "g_down terminated 0-length " - "bp %p provider %s", bp, bp->bio_to->name); - continue; - } - break; - default: - break; - } - if ((bp->bio_flags & BIO_UNMAPPED) != 0 && - (bp->bio_to->flags & G_PF_ACCEPT_UNMAPPED) == 0 && - (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE)) { - if (g_io_transient_map_bio(bp)) - continue; - } THREAD_NO_SLEEPING(); CTR4(KTR_GEOM, "g_down starting bp %p provider %s off %ld " "len %ld", bp, bp->bio_to->name, bp->bio_offset, Modified: head/sys/geom/geom_kern.c ============================================================================== --- head/sys/geom/geom_kern.c Tue Oct 22 07:59:14 2013 (r256879) +++ head/sys/geom/geom_kern.c Tue Oct 22 08:22:19 2013 (r256880) @@ -124,6 +124,13 @@ g_event_procbody(void *arg) /* NOTREACHED */ } +int +g_is_geom_thread(struct thread *td) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 09:58:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1B6D8A5C; Tue, 22 Oct 2013 09:58:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ED31A2CCD; Tue, 22 Oct 2013 09:58:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9M9wVJo082403; Tue, 22 Oct 2013 09:58:31 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9M9wVqx082402; Tue, 22 Oct 2013 09:58:31 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310220958.r9M9wVqx082402@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 22 Oct 2013 09:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256882 - stable/9/sys/contrib/pf/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 09:58:32 -0000 Author: glebius Date: Tue Oct 22 09:58:31 2013 New Revision: 256882 URL: http://svnweb.freebsd.org/changeset/base/256882 Log: Merge r255143 from head: Merge 1.12 of pf_lb.c from OpenBSD, with some changes. Original commit: date: 2010/02/04 14:10:12; author: sthen; state: Exp; lines: +24 -19; pf_get_sport() picks a random port from the port range specified in a nat rule. It should check to see if it's in-use (i.e. matches an existing PF state), if it is, it cycles sequentially through other ports until it finds a free one. However the check was being done with the state keys the wrong way round so it was never actually finding the state to be in-use. - switch the keys to correct this, avoiding random state collisions with nat. Fixes PR 6300 and problems reported by robert@ and viq. - check pf_get_sport() return code in pf_test(); if port allocation fails the packet should be dropped rather than sent out untranslated. Help/ok claudio@. Some additional changes to 1.12: - We also need to bzero() the key to zero padding, otherwise key won't match. - Collapse two if blocks into one with ||, since both conditions lead to the same processing. - Only naddr changes in the cycle, so move initialization of other fields above the cycle. - s/u_intXX_t/uintXX_t/g PR: kern/181690 Submitted by: Olivier Cochard-Labbé Sponsored by: Nginx, Inc. Modified: stable/9/sys/contrib/pf/net/pf_lb.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/contrib/pf/ (props changed) Modified: stable/9/sys/contrib/pf/net/pf_lb.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf_lb.c Tue Oct 22 09:43:14 2013 (r256881) +++ stable/9/sys/contrib/pf/net/pf_lb.c Tue Oct 22 09:58:31 2013 (r256882) @@ -165,8 +165,8 @@ struct pf_rule *pf_match_translation(st struct pf_addr *, u_int16_t, struct pf_addr *, u_int16_t, int); int pf_get_sport(sa_family_t, u_int8_t, struct pf_rule *, - struct pf_addr *, struct pf_addr *, u_int16_t, - struct pf_addr *, u_int16_t*, u_int16_t, u_int16_t, + struct pf_addr *, uint16_t, struct pf_addr *, uint16_t, + struct pf_addr *, uint16_t*, uint16_t, uint16_t, struct pf_src_node **); #define mix(a,b,c) \ @@ -318,13 +318,13 @@ pf_match_translation(struct pf_pdesc *pd int pf_get_sport(sa_family_t af, u_int8_t proto, struct pf_rule *r, - struct pf_addr *saddr, struct pf_addr *daddr, u_int16_t dport, - struct pf_addr *naddr, u_int16_t *nport, u_int16_t low, u_int16_t high, - struct pf_src_node **sn) + struct pf_addr *saddr, uint16_t sport, struct pf_addr *daddr, + uint16_t dport, struct pf_addr *naddr, uint16_t *nport, uint16_t low, + uint16_t high, struct pf_src_node **sn) { struct pf_state_key_cmp key; struct pf_addr init_addr; - u_int16_t cut; + uint16_t cut; bzero(&init_addr, sizeof(init_addr)); if (pf_map_addr(af, r, saddr, naddr, &init_addr, sn)) @@ -335,34 +335,38 @@ pf_get_sport(sa_family_t af, u_int8_t pr high = 65535; } + bzero(&key,sizeof(key)); + key.af = af; + key.proto = proto; + key.port[0] = dport; + PF_ACPY(&key.addr[0], daddr, key.af); + do { - key.af = af; - key.proto = proto; - PF_ACPY(&key.addr[1], daddr, key.af); - PF_ACPY(&key.addr[0], naddr, key.af); - key.port[1] = dport; + PF_ACPY(&key.addr[1], naddr, key.af); /* * port search; start random, step; * similar 2 portloop in in_pcbbind */ if (!(proto == IPPROTO_TCP || proto == IPPROTO_UDP || - proto == IPPROTO_ICMP)) { - key.port[0] = dport; - if (pf_find_state_all(&key, PF_IN, NULL) == NULL) - return (0); - } else if (low == 0 && high == 0) { - key.port[0] = *nport; - if (pf_find_state_all(&key, PF_IN, NULL) == NULL) + proto == IPPROTO_ICMP) || (low == 0 && high == 0)) { + /* + * XXX bug: icmp state don't use the id on both sides. + * (traceroute -l through nat) + */ + key.port[1] = sport; + if (pf_find_state_all(&key, PF_IN, NULL) == NULL) { + *nport = sport; return (0); + } } else if (low == high) { - key.port[0] = htons(low); + key.port[1] = htons(low); if (pf_find_state_all(&key, PF_IN, NULL) == NULL) { *nport = htons(low); return (0); } } else { - u_int16_t tmp; + uint16_t tmp; if (low > high) { tmp = low; @@ -377,7 +381,7 @@ pf_get_sport(sa_family_t af, u_int8_t pr #endif /* low <= cut <= high */ for (tmp = cut; tmp <= high; ++(tmp)) { - key.port[0] = htons(tmp); + key.port[1] = htons(tmp); if (pf_find_state_all(&key, PF_IN, NULL) == #ifdef __FreeBSD__ NULL) { @@ -389,7 +393,7 @@ pf_get_sport(sa_family_t af, u_int8_t pr } } for (tmp = cut - 1; tmp >= low; --(tmp)) { - key.port[0] = htons(tmp); + key.port[1] = htons(tmp); if (pf_find_state_all(&key, PF_IN, NULL) == #ifdef __FreeBSD__ NULL) { @@ -655,8 +659,8 @@ pf_get_translation(struct pf_pdesc *pd, case PF_NORDR: return (NULL); case PF_NAT: - if (pf_get_sport(pd->af, pd->proto, r, saddr, - daddr, dport, naddr, nport, r->rpool.proxy_port[0], + if (pf_get_sport(pd->af, pd->proto, r, saddr, sport, daddr, + dport, naddr, nport, r->rpool.proxy_port[0], r->rpool.proxy_port[1], sn)) { DPFPRINTF(PF_DEBUG_MISC, ("pf: NAT proxy port allocation " From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 10:21:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CBBE049A; Tue, 22 Oct 2013 10:21:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B92762EAD; Tue, 22 Oct 2013 10:21:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MALLBG097277; Tue, 22 Oct 2013 10:21:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MALLhP097274; Tue, 22 Oct 2013 10:21:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310221021.r9MALLhP097274@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Oct 2013 10:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256884 - in head: share/man/man9 sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 10:21:22 -0000 Author: mav Date: Tue Oct 22 10:21:20 2013 New Revision: 256884 URL: http://svnweb.freebsd.org/changeset/base/256884 Log: Remove Giant-locked drivers support (DISKFLAG_NEEDSGIANT flag) from disk(9). Since at least FreeBSD 7 we had only four of them in the base tree, and in head branch, thanks to jhb@, we have no any for more then a year. Modified: head/share/man/man9/disk.9 head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h Modified: head/share/man/man9/disk.9 ============================================================================== --- head/share/man/man9/disk.9 Tue Oct 22 10:10:34 2013 (r256883) +++ head/share/man/man9/disk.9 Tue Oct 22 10:21:20 2013 (r256884) @@ -106,8 +106,6 @@ and may not be subsequently changed: Optional flags indicating to the storage framework what optional features or descriptions the storage device driver supports. Currently supported flags are -.Dv DISKFLAG_NEEDSGIANT -(maintained by device driver), .Dv DISKFLAG_OPEN (maintained by storage framework), .Dv DISKFLAG_CANDELETE Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Tue Oct 22 10:10:34 2013 (r256883) +++ head/sys/geom/geom_disk.c Tue Oct 22 10:21:20 2013 (r256884) @@ -91,22 +91,6 @@ static SYSCTL_NODE(_kern_geom, OID_AUTO, DECLARE_GEOM_CLASS(g_disk_class, g_disk); -static void __inline -g_disk_lock_giant(struct disk *dp) -{ - - if (dp->d_flags & DISKFLAG_NEEDSGIANT) - mtx_lock(&Giant); -} - -static void __inline -g_disk_unlock_giant(struct disk *dp) -{ - - if (dp->d_flags & DISKFLAG_NEEDSGIANT) - mtx_unlock(&Giant); -} - static int g_disk_access(struct g_provider *pp, int r, int w, int e) { @@ -133,12 +117,10 @@ g_disk_access(struct g_provider *pp, int error = 0; if ((pp->acr + pp->acw + pp->ace) == 0 && (r + w + e) > 0) { if (dp->d_open != NULL) { - g_disk_lock_giant(dp); error = dp->d_open(dp); if (bootverbose && error != 0) printf("Opened disk %s -> %d\n", pp->name, error); - g_disk_unlock_giant(dp); if (error != 0) return (error); } @@ -161,12 +143,10 @@ g_disk_access(struct g_provider *pp, int dp->d_flags |= DISKFLAG_OPEN; } else if ((pp->acr + pp->acw + pp->ace) > 0 && (r + w + e) == 0) { if (dp->d_close != NULL) { - g_disk_lock_giant(dp); error = dp->d_close(dp); if (error != 0) printf("Closed disk %s -> %d\n", pp->name, error); - g_disk_unlock_giant(dp); } sc->state = G_STATE_ACTIVE; if (sc->led[0] != 0) @@ -287,9 +267,7 @@ g_disk_ioctl(struct g_provider *pp, u_lo if (dp->d_ioctl == NULL) return (ENOIOCTL); - g_disk_lock_giant(dp); error = dp->d_ioctl(dp, cmd, data, fflag, td); - g_disk_unlock_giant(dp); return (error); } @@ -328,9 +306,7 @@ g_disk_start(struct bio *bp) mtx_lock(&sc->start_mtx); devstat_start_transaction_bio(dp->d_devstat, bp); mtx_unlock(&sc->start_mtx); - g_disk_lock_giant(dp); dp->d_strategy(bp); - g_disk_unlock_giant(dp); break; } off = 0; @@ -384,9 +360,7 @@ g_disk_start(struct bio *bp) mtx_lock(&sc->start_mtx); devstat_start_transaction_bio(dp->d_devstat, bp2); mtx_unlock(&sc->start_mtx); - g_disk_lock_giant(dp); dp->d_strategy(bp2); - g_disk_unlock_giant(dp); bp2 = bp3; bp3 = NULL; } while (bp2 != NULL); @@ -442,9 +416,7 @@ g_disk_start(struct bio *bp) bp->bio_disk = dp; bp->bio_to = (void *)bp->bio_done; bp->bio_done = g_disk_done_single; - g_disk_lock_giant(dp); dp->d_strategy(bp); - g_disk_unlock_giant(dp); break; default: error = EOPNOTSUPP; Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Tue Oct 22 10:10:34 2013 (r256883) +++ head/sys/geom/geom_disk.h Tue Oct 22 10:21:20 2013 (r256884) @@ -102,7 +102,6 @@ struct disk { void *d_drv1; }; -#define DISKFLAG_NEEDSGIANT 0x1 #define DISKFLAG_OPEN 0x2 #define DISKFLAG_CANDELETE 0x4 #define DISKFLAG_CANFLUSHCACHE 0x8 From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 10:40:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C16E2D52; Tue, 22 Oct 2013 10:40:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AF79A2FE1; Tue, 22 Oct 2013 10:40:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MAeQeG006907; Tue, 22 Oct 2013 10:40:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MAeQ7G006906; Tue, 22 Oct 2013 10:40:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310221040.r9MAeQ7G006906@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Oct 2013 10:40:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256885 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 10:40:26 -0000 Author: mav Date: Tue Oct 22 10:40:26 2013 New Revision: 256885 URL: http://svnweb.freebsd.org/changeset/base/256885 Log: Remove global device lock acquisition from dev_relthread(), replacing it with atomics on per-device data. Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Tue Oct 22 10:21:20 2013 (r256884) +++ head/sys/kern/kern_conf.c Tue Oct 22 10:40:26 2013 (r256885) @@ -193,7 +193,7 @@ dev_refthread(struct cdev *dev, int *ref if (csw != NULL) { cdp = cdev2priv(dev); if ((cdp->cdp_flags & CDP_SCHED_DTR) == 0) - dev->si_threadcount++; + atomic_add_long(&dev->si_threadcount, 1); else csw = NULL; } @@ -234,7 +234,7 @@ devvn_refthread(struct vnode *vp, struct if ((cdp->cdp_flags & CDP_SCHED_DTR) == 0) { csw = dev->si_devsw; if (csw != NULL) - dev->si_threadcount++; + atomic_add_long(&dev->si_threadcount, 1); } dev_unlock(); if (csw != NULL) { @@ -251,11 +251,9 @@ dev_relthread(struct cdev *dev, int ref) mtx_assert(&devmtx, MA_NOTOWNED); if (!ref) return; - dev_lock(); KASSERT(dev->si_threadcount > 0, ("%s threadcount is wrong", dev->si_name)); - dev->si_threadcount--; - dev_unlock(); + atomic_subtract_rel_long(&dev->si_threadcount, 1); } int From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 11:56:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 166C8E07; Tue, 22 Oct 2013 11:56:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E3E9A249A; Tue, 22 Oct 2013 11:56:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MBuk2D046279; Tue, 22 Oct 2013 11:56:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MBukOD046278; Tue, 22 Oct 2013 11:56:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310221156.r9MBukOD046278@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Oct 2013 11:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256886 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 11:56:47 -0000 Author: mav Date: Tue Oct 22 11:56:46 2013 New Revision: 256886 URL: http://svnweb.freebsd.org/changeset/base/256886 Log: Update ahci(4), respecting recent driver changes. Modified: head/share/man/man4/ahci.4 Modified: head/share/man/man4/ahci.4 ============================================================================== --- head/share/man/man4/ahci.4 Tue Oct 22 10:40:26 2013 (r256885) +++ head/share/man/man4/ahci.4 Tue Oct 22 11:56:46 2013 (r256886) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2009-2012 Alexander Motin +.\" Copyright (c) 2009-2013 Alexander Motin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 25, 2012 +.Dd October 22, 2013 .Dt AHCI 4 .Os .Sh NAME @@ -57,9 +57,9 @@ controls Message Signaled Interrupts (MS .It 0 MSI disabled; .It 1 -single MSI vector used, if supported (default); +single MSI vector used, if supported; .It 2 -multiple MSI vectors used, if supported; +multiple MSI vectors used, if supported (default); .El .It Va hint.ahci. Ns Ar X Ns Va .ccc controls Command Completion Coalescing (CCC) usage by the specified controller. @@ -68,6 +68,11 @@ for interrupt, if there are some more re CCC reduces number of context switches on systems with many parallel requests, but it can decrease disk performance on some workloads due to additional command latency. +.It Va hint.ahci. Ns Ar X Ns Va .direct +controls whether the driver should use direct command completion from +interrupt thread(s), or queue them to CAM completion threads. +Default value depends on number of MSI interrupts supported and number of +implemented SATA ports. .It Va hint.ahcich. Ns Ar X Ns Va .pm_level controls SATA interface Power Management for the specified channel, allowing some power to be saved at the cost of additional command From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 12:42:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B43922D1; Tue, 22 Oct 2013 12:42:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A17282855; Tue, 22 Oct 2013 12:42:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MCgnma073010; Tue, 22 Oct 2013 12:42:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MCgnQr073009; Tue, 22 Oct 2013 12:42:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310221242.r9MCgnQr073009@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Oct 2013 12:42:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256887 - head/sys/dev/aha X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 12:42:49 -0000 Author: mav Date: Tue Oct 22 12:42:49 2013 New Revision: 256887 URL: http://svnweb.freebsd.org/changeset/base/256887 Log: Fix memory and references leak due to unfreed path. Coverity CID: 1109817 Modified: head/sys/dev/aha/aha.c Modified: head/sys/dev/aha/aha.c ============================================================================== --- head/sys/dev/aha/aha.c Tue Oct 22 11:56:46 2013 (r256886) +++ head/sys/dev/aha/aha.c Tue Oct 22 12:42:49 2013 (r256887) @@ -1168,8 +1168,10 @@ ahadone(struct aha_softc *aha, struct ah cam_sim_path(aha->sim), accb->hccb.target, CAM_LUN_WILDCARD); - if (error == CAM_REQ_CMP) + if (error == CAM_REQ_CMP) { xpt_async(AC_SENT_BDR, path, NULL); + xpt_free_path(path); + } ccb_h = LIST_FIRST(&aha->pending_ccbs); while (ccb_h != NULL) { From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 12:58:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C73C67AB; Tue, 22 Oct 2013 12:58:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B4AEB2960; Tue, 22 Oct 2013 12:58:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MCwM25079206; Tue, 22 Oct 2013 12:58:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MCwMZp079205; Tue, 22 Oct 2013 12:58:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310221258.r9MCwMZp079205@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Oct 2013 12:58:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256888 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 12:58:22 -0000 Author: mav Date: Tue Oct 22 12:58:22 2013 New Revision: 256888 URL: http://svnweb.freebsd.org/changeset/base/256888 Log: Unconditionally acquire periph reference on CCB allocation failure. cam_periph_acquire() can return error if periph already invalidated, but that may be unacceptable and cause deadlock if the invalidated periph can't be destroyed without "executing" the scheduled request. Coverity CID: 1109822 MFC after: 2 months Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Tue Oct 22 12:42:49 2013 (r256887) +++ head/sys/cam/cam_xpt.c Tue Oct 22 12:58:22 2013 (r256888) @@ -3163,10 +3163,11 @@ restart: ccb = xpt_get_ccb(periph); goto restart; } - if (periph->flags & CAM_PERIPH_RUN_TASK) { + if (periph->flags & CAM_PERIPH_RUN_TASK) break; - } - cam_periph_acquire(periph); + xpt_lock_buses(); + periph->refcount++; /* Unconditionally acquire */ + xpt_unlock_buses(); periph->flags |= CAM_PERIPH_RUN_TASK; taskqueue_enqueue(xsoftc.xpt_taskq, &periph->periph_run_task); From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 13:31:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A490826D; Tue, 22 Oct 2013 13:31:36 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9151A2BAE; Tue, 22 Oct 2013 13:31:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MDVaX3099220; Tue, 22 Oct 2013 13:31:36 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MDVaBO099219; Tue, 22 Oct 2013 13:31:36 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201310221331.r9MDVaBO099219@svn.freebsd.org> From: Steven Hartland Date: Tue, 22 Oct 2013 13:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256889 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 13:31:36 -0000 Author: smh Date: Tue Oct 22 13:31:36 2013 New Revision: 256889 URL: http://svnweb.freebsd.org/changeset/base/256889 Log: Use the vdev's ashift to calculate the supported min block size passed to zio_compress_data(..) when compressing l2arc buffers. This eliminates l2arc I/O errors, which resulted in very poor performance on vdev's configured with block size greater than 512b due to compression assuming a smaller min block size than the vdev supports. MFC after: 2 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Oct 22 12:58:22 2013 (r256888) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Oct 22 13:31:36 2013 (r256889) @@ -5147,7 +5147,7 @@ l2arc_compress_buf(l2arc_buf_hdr_t *l2hd len = l2hdr->b_asize; cdata = zio_data_buf_alloc(len); csize = zio_compress_data(ZIO_COMPRESS_LZ4, l2hdr->b_tmp_cdata, - cdata, l2hdr->b_asize, (size_t)SPA_MINBLOCKSIZE); + cdata, l2hdr->b_asize, (size_t)(1ULL << l2hdr->b_dev->l2ad_vdev->vdev_ashift)); if (csize == 0) { /* zero block, indicate that there's nothing to write */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 13:52:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9FC39BA0; Tue, 22 Oct 2013 13:52:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8C14E2CDD; Tue, 22 Oct 2013 13:52:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MDqK05011260; Tue, 22 Oct 2013 13:52:20 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MDqKKb011258; Tue, 22 Oct 2013 13:52:20 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310221352.r9MDqKKb011258@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Oct 2013 13:52:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256893 - head/sys/dev/buslogic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 13:52:20 -0000 Author: mav Date: Tue Oct 22 13:52:20 2013 New Revision: 256893 URL: http://svnweb.freebsd.org/changeset/base/256893 Log: Fix memory and references leak due to unfreed path. Coverity CID: 1109815 Modified: head/sys/dev/buslogic/bt.c Modified: head/sys/dev/buslogic/bt.c ============================================================================== --- head/sys/dev/buslogic/bt.c Tue Oct 22 13:50:54 2013 (r256892) +++ head/sys/dev/buslogic/bt.c Tue Oct 22 13:52:20 2013 (r256893) @@ -1586,8 +1586,10 @@ btdone(struct bt_softc *bt, struct bt_cc bccb->hccb.target_id, CAM_LUN_WILDCARD); - if (error == CAM_REQ_CMP) + if (error == CAM_REQ_CMP) { xpt_async(AC_SENT_BDR, path, NULL); + xpt_free_path(path); + } ccb_h = LIST_FIRST(&bt->pending_ccbs); while (ccb_h != NULL) { From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 13:56:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 316DED1; Tue, 22 Oct 2013 13:56:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1F3992D0E; Tue, 22 Oct 2013 13:56:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MDuUnl017782; Tue, 22 Oct 2013 13:56:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MDuUkD017781; Tue, 22 Oct 2013 13:56:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310221356.r9MDuUkD017781@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Oct 2013 13:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256895 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 13:56:31 -0000 Author: mav Date: Tue Oct 22 13:56:30 2013 New Revision: 256895 URL: http://svnweb.freebsd.org/changeset/base/256895 Log: Fix memory and references leak due to unfreed path. Coverity CID: 1054773 Modified: head/sys/cam/cam_periph.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Tue Oct 22 13:53:58 2013 (r256894) +++ head/sys/cam/cam_periph.c Tue Oct 22 13:56:30 2013 (r256895) @@ -1768,9 +1768,11 @@ cam_periph_error(union ccb *ccb, cam_fla scan_ccb->ccb_h.func_code = XPT_SCAN_TGT; scan_ccb->crcn.flags = 0; xpt_rescan(scan_ccb); - } else + } else { xpt_print(newpath, "Can't allocate CCB to rescan target\n"); + xpt_free_path(newpath); + } } } From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 14:07:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E34D29D2; Tue, 22 Oct 2013 14:07:58 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CE8C92DA3; Tue, 22 Oct 2013 14:07:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9ME7wpC030503; Tue, 22 Oct 2013 14:07:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9ME7v2a030494; Tue, 22 Oct 2013 14:07:57 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310221407.r9ME7v2a030494@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 22 Oct 2013 14:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256898 - in head/sys: conf dev/fdt powerpc/mambo powerpc/ofw powerpc/powermac powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 14:07:59 -0000 Author: nwhitehorn Date: Tue Oct 22 14:07:57 2013 New Revision: 256898 URL: http://svnweb.freebsd.org/changeset/base/256898 Log: Standards-conformance and code deduplication: - Use bus reference phandles in place of FDT offsets as IRQ domain keys - Unify the identical macio/fdt/mambo OpenPIC drivers into one - Be more forgiving (following ePAPR) about what we need from the device tree to identify an OpenPIC - Correctly map all IRQs into an interrupt domain - Set IRQ_*_CONFORM for interrupts on an unknown PIC type instead of failing attachment for that device. Added: head/sys/powerpc/ofw/openpic_ofw.c - copied, changed from r256886, head/sys/powerpc/powermac/openpic_macio.c Deleted: head/sys/powerpc/mambo/mambo_openpic.c head/sys/powerpc/powermac/openpic_macio.c head/sys/powerpc/powerpc/openpic_fdt.c Modified: head/sys/conf/files.powerpc head/sys/dev/fdt/fdt_common.c head/sys/dev/fdt/fdt_pci.c head/sys/dev/fdt/fdt_powerpc.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Tue Oct 22 14:00:46 2013 (r256897) +++ head/sys/conf/files.powerpc Tue Oct 22 14:07:57 2013 (r256898) @@ -124,7 +124,6 @@ powerpc/mambo/mambocall.S optional mambo powerpc/mambo/mambo.c optional mambo powerpc/mambo/mambo_console.c optional mambo powerpc/mambo/mambo_disk.c optional mambo -powerpc/mambo/mambo_openpic.c optional mambo powerpc/mpc85xx/atpic.c optional mpc85xx isa powerpc/mpc85xx/ds1553_bus_fdt.c optional ds1553 fdt powerpc/mpc85xx/ds1553_core.c optional ds1553 @@ -143,6 +142,7 @@ powerpc/ofw/ofw_syscons.c optional sc ai powerpc/ofw/ofwcall32.S optional aim powerpc powerpc/ofw/ofwcall64.S optional aim powerpc64 powerpc/ofw/ofwmagic.S optional aim +powerpc/ofw/openpic_ofw.c optional aim | fdt powerpc/ofw/rtas.c optional aim powerpc/powermac/ata_kauai.c optional powermac ata | powermac atamacio powerpc/powermac/ata_macio.c optional powermac ata | powermac atamacio @@ -158,7 +158,6 @@ powerpc/powermac/kiic.c optional powerm powerpc/powermac/macgpio.c optional powermac pci powerpc/powermac/macio.c optional powermac pci powerpc/powermac/nvbl.c optional powermac nvbl -powerpc/powermac/openpic_macio.c optional powermac pci powerpc/powermac/platform_powermac.c optional powermac powerpc/powermac/powermac_thermal.c optional powermac powerpc/powermac/pswitch.c optional powermac pswitch @@ -196,7 +195,6 @@ powerpc/powerpc/mmu_if.m standard powerpc/powerpc/mp_machdep.c optional smp powerpc/powerpc/nexus.c standard powerpc/powerpc/openpic.c standard -powerpc/powerpc/openpic_fdt.c optional fdt powerpc/powerpc/pic_if.m standard powerpc/powerpc/pmap_dispatch.c standard powerpc/powerpc/platform.c standard Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Tue Oct 22 14:00:46 2013 (r256897) +++ head/sys/dev/fdt/fdt_common.c Tue Oct 22 14:07:57 2013 (r256898) @@ -478,21 +478,31 @@ fdt_intr_decode(phandle_t intr_parent, p int *trig, int *pol) { fdt_pic_decode_t intr_decode; + phandle_t intr_offset; int i, rv; + intr_offset = OF_xref_phandle(intr_parent); + for (i = 0; fdt_pic_table[i] != NULL; i++) { /* XXX check if pic_handle has interrupt-controller prop? */ intr_decode = fdt_pic_table[i]; - rv = intr_decode(intr_parent, intr, interrupt, trig, pol); + rv = intr_decode(intr_offset, intr, interrupt, trig, pol); - if (rv == 0) + if (rv == 0) { /* This was recognized as our PIC and decoded. */ + *interrupt = FDT_MAP_IRQ(intr_parent, *interrupt); return (0); + } } - return (ENXIO); + /* Not in table, so guess */ + *interrupt = FDT_MAP_IRQ(intr_parent, fdt32_to_cpu(*intr)); + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + + return (0); } int @@ -500,7 +510,7 @@ fdt_intr_to_rl(phandle_t node, struct re struct fdt_sense_level *intr_sl) { phandle_t intr_par; - ihandle_t iph; + phandle_t iph; pcell_t *intr; pcell_t intr_cells; int interrupt, trig, pol; @@ -517,8 +527,7 @@ fdt_intr_to_rl(phandle_t node, struct re debugf("no intr-parent phandle\n"); intr_par = OF_parent(node); } else { - iph = fdt32_to_cpu(iph); - intr_par = OF_instance_to_package(iph); + intr_par = OF_xref_phandle(iph); } if (OF_getprop(intr_par, "#interrupt-cells", &intr_cells, @@ -540,7 +549,7 @@ fdt_intr_to_rl(phandle_t node, struct re interrupt = -1; trig = pol = 0; - if (fdt_intr_decode(intr_par, &intr[i * intr_cells], + if (fdt_intr_decode(iph, &intr[i * intr_cells], &interrupt, &trig, &pol) != 0) { rv = ENXIO; goto out; @@ -557,7 +566,7 @@ fdt_intr_to_rl(phandle_t node, struct re intr_sl[i].trig = trig; intr_sl[i].pol = pol; - irq = FDT_MAP_IRQ(intr_par, interrupt); + irq = FDT_MAP_IRQ(iph, interrupt); resource_list_add(rl, SYS_RES_IRQ, i, irq, irq, 1); } @@ -570,7 +579,6 @@ int fdt_get_phyaddr(phandle_t node, device_t dev, int *phy_addr, void **phy_sc) { phandle_t phy_node; - ihandle_t phy_ihandle; pcell_t phy_handle, phy_reg; uint32_t i; device_t parent, child; @@ -579,9 +587,7 @@ fdt_get_phyaddr(phandle_t node, device_t sizeof(phy_handle)) <= 0) return (ENXIO); - phy_ihandle = (ihandle_t)phy_handle; - phy_ihandle = fdt32_to_cpu(phy_ihandle); - phy_node = OF_instance_to_package(phy_ihandle); + phy_node = OF_xref_phandle(phy_handle); if (OF_getprop(phy_node, "reg", (void *)&phy_reg, sizeof(phy_reg)) <= 0) Modified: head/sys/dev/fdt/fdt_pci.c ============================================================================== --- head/sys/dev/fdt/fdt_pci.c Tue Oct 22 14:00:46 2013 (r256897) +++ head/sys/dev/fdt/fdt_pci.c Tue Oct 22 14:07:57 2013 (r256898) @@ -317,7 +317,7 @@ fdt_pci_route_intr(int bus, int slot, in trig, pol); #if defined(__powerpc__) - powerpc_config_intr(FDT_MAP_IRQ(intr_par, *interrupt), trig, + powerpc_config_intr(FDT_MAP_IRQ(iph, *interrupt), trig, pol); #endif return (0); Modified: head/sys/dev/fdt/fdt_powerpc.c ============================================================================== --- head/sys/dev/fdt/fdt_powerpc.c Tue Oct 22 14:00:46 2013 (r256897) +++ head/sys/dev/fdt/fdt_powerpc.c Tue Oct 22 14:07:57 2013 (r256898) @@ -123,7 +123,8 @@ fdt_pic_decode_openpic(phandle_t node, p int *trig, int *pol) { - if (!fdt_is_compatible(node, "chrp,open-pic")) + if (!fdt_is_compatible(node, "chrp,open-pic") && + !fdt_is_type(node, "open-pic")) return (ENXIO); /* Copied and modified: head/sys/powerpc/ofw/openpic_ofw.c (from r256886, head/sys/powerpc/powermac/openpic_macio.c) ============================================================================== --- head/sys/powerpc/powermac/openpic_macio.c Tue Oct 22 11:56:46 2013 (r256886, copy source) +++ head/sys/powerpc/ofw/openpic_ofw.c Tue Oct 22 14:07:57 2013 (r256898) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -55,15 +56,15 @@ __FBSDID("$FreeBSD$"); #include "pic_if.h" /* - * MacIO interface + * OFW interface */ -static int openpic_macio_probe(device_t); -static int openpic_macio_attach(device_t); +static int openpic_ofw_probe(device_t); +static int openpic_ofw_attach(device_t); -static device_method_t openpic_macio_methods[] = { +static device_method_t openpic_ofw_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, openpic_macio_probe), - DEVMETHOD(device_attach, openpic_macio_attach), + DEVMETHOD(device_probe, openpic_ofw_probe), + DEVMETHOD(device_attach, openpic_ofw_attach), /* PIC interface */ DEVMETHOD(pic_bind, openpic_bind), @@ -75,26 +76,35 @@ static device_method_t openpic_macio_me DEVMETHOD(pic_mask, openpic_mask), DEVMETHOD(pic_unmask, openpic_unmask), - { 0, 0 }, + DEVMETHOD_END }; -static driver_t openpic_macio_driver = { +static driver_t openpic_ofw_driver = { "openpic", - openpic_macio_methods, + openpic_ofw_methods, sizeof(struct openpic_softc), }; -DRIVER_MODULE(openpic, macio, openpic_macio_driver, openpic_devclass, 0, 0); +DRIVER_MODULE(openpic, nexus, openpic_ofw_driver, openpic_devclass, 0, 0); +DRIVER_MODULE(openpic, simplebus, openpic_ofw_driver, openpic_devclass, 0, 0); +DRIVER_MODULE(openpic, macio, openpic_ofw_driver, openpic_devclass, 0, 0); static int -openpic_macio_probe(device_t dev) +openpic_ofw_probe(device_t dev) { const char *type = ofw_bus_get_type(dev); - if (strcmp(type, "open-pic") != 0) + if (type == NULL) return (ENXIO); - /* On some U4 systems, there is a phantom MPIC in the mac-io cell */ + if (!ofw_bus_is_compatible(dev, "chrp,open-pic") && + strcmp(type, "open-pic") != 0) + return (ENXIO); + + /* + * On some U4 systems, there is a phantom MPIC in the mac-io cell. + * The uninorth driver will pick up the real PIC, so ignore it here. + */ if (OF_finddevice("/u4") != (phandle_t)-1) return (ENXIO); @@ -103,8 +113,17 @@ openpic_macio_probe(device_t dev) } static int -openpic_macio_attach(device_t dev) +openpic_ofw_attach(device_t dev) { - - return (openpic_common_attach(dev, ofw_bus_get_node(dev))); + phandle_t xref, node; + + node = ofw_bus_get_node(dev); + + if (OF_getprop(node, "phandle", &xref, sizeof(xref)) == -1 && + OF_getprop(node, "ibm,phandle", &xref, sizeof(xref)) == -1 && + OF_getprop(node, "linux,phandle", &xref, sizeof(xref)) == -1) + xref = node; + + return (openpic_common_attach(dev, xref)); } + From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 14:08:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E36ECB18; Tue, 22 Oct 2013 14:08:57 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D0C9E2DB0; Tue, 22 Oct 2013 14:08:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9ME8vQA030727; Tue, 22 Oct 2013 14:08:57 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9ME8vZ1030726; Tue, 22 Oct 2013 14:08:57 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310221408.r9ME8vZ1030726@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 22 Oct 2013 14:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256899 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 14:08:58 -0000 Author: nwhitehorn Date: Tue Oct 22 14:08:57 2013 New Revision: 256899 URL: http://svnweb.freebsd.org/changeset/base/256899 Log: Allow lots of interrupts (useful on multi-domain platforms) and do not set device_quiet() on all devices attached under nexus(4). Modified: head/sys/dev/fdt/fdtbus.c Modified: head/sys/dev/fdt/fdtbus.c ============================================================================== --- head/sys/dev/fdt/fdtbus.c Tue Oct 22 14:07:57 2013 (r256898) +++ head/sys/dev/fdt/fdtbus.c Tue Oct 22 14:08:57 2013 (r256899) @@ -158,9 +158,7 @@ fdtbus_probe(device_t dev) debugf("%s(dev=%p); pass=%u\n", __func__, dev, bus_current_pass); - device_set_desc(dev, "FDT main bus"); - if (!bootverbose) - device_quiet(dev); + device_set_desc(dev, "Flattened Device Tree"); return (BUS_PROBE_NOWILDCARD); } @@ -182,7 +180,7 @@ fdtbus_attach(device_t dev) * IRQ rman. */ start = 0; - end = FDT_INTR_MAX - 1; + end = ~0; sc->sc_irq.rm_start = start; sc->sc_irq.rm_end = end; sc->sc_irq.rm_type = RMAN_ARRAY; From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 14:10:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 12415C5C; Tue, 22 Oct 2013 14:10:01 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F37772DBB; Tue, 22 Oct 2013 14:10:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MEA0jd031022; Tue, 22 Oct 2013 14:10:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MEA0n7031020; Tue, 22 Oct 2013 14:10:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310221410.r9MEA0n7031020@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 22 Oct 2013 14:10:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256900 - head/sys/dev/cfi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 14:10:01 -0000 Author: nwhitehorn Date: Tue Oct 22 14:10:00 2013 New Revision: 256900 URL: http://svnweb.freebsd.org/changeset/base/256900 Log: Set BUS_PROBE_NOWILDCARD on this attachment as a stopgap. Unconditionally poking at registers in unknown devices is not the best probe mechanism. This should be reverted and a better solution found later. Modified: head/sys/dev/cfi/cfi_bus_nexus.c Modified: head/sys/dev/cfi/cfi_bus_nexus.c ============================================================================== --- head/sys/dev/cfi/cfi_bus_nexus.c Tue Oct 22 14:08:57 2013 (r256899) +++ head/sys/dev/cfi/cfi_bus_nexus.c Tue Oct 22 14:10:00 2013 (r256900) @@ -50,14 +50,25 @@ __FBSDID("$FreeBSD$"); static int cfi_nexus_probe(device_t dev) { + return (BUS_PROBE_NOWILDCARD); +} + +static int +cfi_nexus_attach(device_t dev) +{ + int error; + + error = cfi_probe(dev); + if (error != 0) + return (error); - return cfi_probe(dev); + return cfi_attach(dev); } static device_method_t cfi_nexus_methods[] = { /* device interface */ DEVMETHOD(device_probe, cfi_nexus_probe), - DEVMETHOD(device_attach, cfi_attach), + DEVMETHOD(device_attach, cfi_nexus_attach), DEVMETHOD(device_detach, cfi_detach), {0, 0} From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 14:11:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BAB1BEAB; Tue, 22 Oct 2013 14:11:16 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A6F252DF4; Tue, 22 Oct 2013 14:11:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MEBG9f033549; Tue, 22 Oct 2013 14:11:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MEBG2t033548; Tue, 22 Oct 2013 14:11:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310221411.r9MEBG2t033548@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 22 Oct 2013 14:11:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256901 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 14:11:16 -0000 Author: nwhitehorn Date: Tue Oct 22 14:11:16 2013 New Revision: 256901 URL: http://svnweb.freebsd.org/changeset/base/256901 Log: Catch up on 6 years of improvements in Open Firmware nexus devices by importing the sparc64 one. At least 90% of this code is MI and will be moved into /sys/dev/ofw at some point in the future. Modified: head/sys/powerpc/powerpc/nexus.c Modified: head/sys/powerpc/powerpc/nexus.c ============================================================================== --- head/sys/powerpc/powerpc/nexus.c Tue Oct 22 14:10:00 2013 (r256900) +++ head/sys/powerpc/powerpc/nexus.c Tue Oct 22 14:11:16 2013 (r256901) @@ -1,5 +1,8 @@ /*- * Copyright 1998 Massachusetts Institute of Technology + * Copyright 2001 by Thomas Moestl . + * Copyright 2006 by Marius Strobl . + * All rights reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby @@ -25,30 +28,6 @@ * 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. - */ -/*- - * Copyright 2001 by Thomas Moestl . 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. * * from: FreeBSD: src/sys/i386/i386/nexus.c,v 1.43 2001/02/09 */ @@ -58,81 +37,71 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include -#include #include #include +#include +#include +#include + +#include +#include #include #include #include #include -#include #include #include -#include - -#include "ofw_bus_if.h" -#include "pic_if.h" - /* * The nexus (which is a pseudo-bus actually) iterates over the nodes that - * exist in Open Firmware and adds them as devices to this bus so that drivers - * can be attached to them. + * hang from the Open Firmware root node and adds them as devices to this bus + * (except some special nodes which are excluded) so that drivers can be + * attached to them. + * + * Additionally, interrupt setup/teardown and some resource management are + * done at this level. * * Maybe this code should get into dev/ofw to some extent, as some of it should * work for all Open Firmware based machines... */ -static MALLOC_DEFINE(M_NEXUS, "nexus", "nexus device information"); - struct nexus_devinfo { - struct ofw_bus_devinfo ndi_ofwinfo; + struct ofw_bus_devinfo ndi_obdinfo; + struct resource_list ndi_rl; }; struct nexus_softc { - struct rman sc_rman; + uint32_t acells, scells; + struct rman sc_intr_rman; + struct rman sc_mem_rman; }; -/* - * Device interface - */ -static int nexus_probe(device_t); -static int nexus_attach(device_t); - -/* - * Bus interface - */ -static device_t nexus_add_child(device_t, u_int, const char *, int); -static void nexus_probe_nomatch(device_t, device_t); +static device_probe_t nexus_probe; +static device_attach_t nexus_attach; +static bus_print_child_t nexus_print_child; +static bus_add_child_t nexus_add_child; +static bus_probe_nomatch_t nexus_probe_nomatch; +static bus_setup_intr_t nexus_setup_intr; +static bus_teardown_intr_t nexus_teardown_intr; +static bus_alloc_resource_t nexus_alloc_resource; +static bus_activate_resource_t nexus_activate_resource; +static bus_deactivate_resource_t nexus_deactivate_resource; +static bus_adjust_resource_t nexus_adjust_resource; +static bus_release_resource_t nexus_release_resource; +static bus_get_resource_list_t nexus_get_resource_list; #ifdef SMP -static int nexus_bind_intr(device_t dev, device_t child, - struct resource *irq, int cpu); +static bus_bind_intr_t nexus_bind_intr; #endif -static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, - enum intr_polarity pol); -static int nexus_setup_intr(device_t, device_t, struct resource *, int, - driver_filter_t *, driver_intr_t *, void *, void **); -static int nexus_teardown_intr(device_t, device_t, struct resource *, - void *); -static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, - u_long, u_long, u_long, u_int); -static int nexus_activate_resource(device_t, device_t, int, int, - struct resource *); -static int nexus_deactivate_resource(device_t, device_t, int, int, - struct resource *); -static int nexus_release_resource(device_t, device_t, int, int, - struct resource *); -static const struct ofw_bus_devinfo *nexus_get_devinfo(device_t dev, - device_t child); +static bus_config_intr_t nexus_config_intr; +static ofw_bus_get_devinfo_t nexus_get_devinfo; -/* - * Local routines - */ -static device_t nexus_device_from_node(device_t, phandle_t); +static int nexus_inlist(const char *, const char *const *); +static struct nexus_devinfo * nexus_setup_dinfo(device_t, phandle_t); +static void nexus_destroy_dinfo(struct nexus_devinfo *); +static int nexus_print_res(struct nexus_devinfo *); static device_method_t nexus_methods[] = { /* Device interface */ @@ -143,22 +112,29 @@ static device_method_t nexus_methods[] = DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, bus_generic_resume), - /* Bus interface. Resource management is business of the children... */ + /* Bus interface */ + DEVMETHOD(bus_print_child, nexus_print_child), + DEVMETHOD(bus_probe_nomatch, nexus_probe_nomatch), + DEVMETHOD(bus_read_ivar, bus_generic_read_ivar), + DEVMETHOD(bus_write_ivar, bus_generic_write_ivar), DEVMETHOD(bus_add_child, nexus_add_child), DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), - DEVMETHOD(bus_probe_nomatch, nexus_probe_nomatch), + DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), + DEVMETHOD(bus_activate_resource, nexus_activate_resource), + DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), + DEVMETHOD(bus_adjust_resource, nexus_adjust_resource), + DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), + DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), + DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + DEVMETHOD(bus_get_resource_list, nexus_get_resource_list), #ifdef SMP DEVMETHOD(bus_bind_intr, nexus_bind_intr), #endif DEVMETHOD(bus_config_intr, nexus_config_intr), - DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), - DEVMETHOD(bus_activate_resource, nexus_activate_resource), - DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), - DEVMETHOD(bus_release_resource, nexus_release_resource), - /* OFW bus interface */ + /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, nexus_get_devinfo), DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), @@ -169,21 +145,64 @@ static device_method_t nexus_methods[] = DEVMETHOD_END }; -static driver_t nexus_driver = { - "nexus", - nexus_methods, - sizeof(struct nexus_softc), -}; - static devclass_t nexus_devclass; +DEFINE_CLASS_0(nexus, nexus_driver, nexus_methods, sizeof(struct nexus_softc)); EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0, BUS_PASS_BUS); +MODULE_VERSION(nexus, 1); + +static const char *const nexus_excl_name[] = { + "FJSV,system", + "aliases", + "associations", + "chosen", + "cmp", + "counter-timer", /* No separate device; handled by psycho/sbus */ + "failsafe", + "memory", + "openprom", + "options", + "packages", + "physical-memory", + "rsc", + "sgcn", + "todsg", + "virtual-memory", + NULL +}; + +static const char *const nexus_excl_type[] = { + "core", + "cpu", + NULL +}; + +extern struct bus_space_tag nexus_bustag; +extern struct bus_dma_tag nexus_dmatag; + +static int +nexus_inlist(const char *name, const char *const *list) +{ + int i; + + if (name == NULL) + return (0); + for (i = 0; list[i] != NULL; i++) + if (strcmp(name, list[i]) == 0) + return (1); + return (0); +} + +#define NEXUS_EXCLUDED(name, type) \ + (nexus_inlist((name), nexus_excl_name) || \ + ((type) != NULL && nexus_inlist((type), nexus_excl_type))) static int nexus_probe(device_t dev) { - bus_generic_probe(dev); + + /* Nexus does always match. */ device_set_desc(dev, "Open Firmware Nexus device"); return (0); } @@ -191,225 +210,424 @@ nexus_probe(device_t dev) static int nexus_attach(device_t dev) { - phandle_t root; - phandle_t child; - struct nexus_softc *sc; - u_long start, end; + struct nexus_devinfo *ndi; + struct nexus_softc *sc; + device_t cdev; + phandle_t node; sc = device_get_softc(dev); - start = 0; - end = ~0; + if (strcmp(device_get_name(device_get_parent(dev)), "root") == 0) { + node = OF_peer(0); - sc->sc_rman.rm_start = start; - sc->sc_rman.rm_end = end; - sc->sc_rman.rm_type = RMAN_ARRAY; - sc->sc_rman.rm_descr = "Interrupt request lines"; - if (rman_init(&sc->sc_rman) || - rman_manage_region(&sc->sc_rman, start, end)) - panic("nexus_probe IRQ rman"); + sc->sc_intr_rman.rm_type = RMAN_ARRAY; + sc->sc_intr_rman.rm_descr = "Interrupts"; + sc->sc_mem_rman.rm_type = RMAN_ARRAY; + sc->sc_mem_rman.rm_descr = "Device Memory"; + if (rman_init(&sc->sc_intr_rman) != 0 || + rman_init(&sc->sc_mem_rman) != 0 || + rman_manage_region(&sc->sc_intr_rman, 0, ~0) != 0 || + rman_manage_region(&sc->sc_mem_rman, 0, BUS_SPACE_MAXADDR) + != 0) + panic("%s: failed to set up rmans.", __func__); + } else + node = ofw_bus_get_node(dev); - if ((root = OF_peer(0)) == 0) + /* + * Allow devices to identify. + */ + bus_generic_probe(dev); + + /* + * If no Open Firmware, bail early + */ + if (node == -1) return (bus_generic_attach(dev)); - + /* - * Now walk the OFW tree to locate top-level devices + * Some important numbers */ - for (child = OF_child(root); child != 0; child = OF_peer(child)) { - if (child == -1) - panic("nexus_probe(): OF_child failed."); - (void)nexus_device_from_node(dev, child); + sc->acells = 2; + OF_getprop(node, "#address-cells", &sc->acells, sizeof(sc->acells)); + sc->scells = 1; + OF_getprop(node, "#size-cells", &sc->scells, sizeof(sc->scells)); + /* + * Now walk the OFW tree and attach top-level devices. + */ + for (node = OF_child(node); node > 0; node = OF_peer(node)) { + if ((ndi = nexus_setup_dinfo(dev, node)) == NULL) + continue; + cdev = device_add_child(dev, NULL, -1); + if (cdev == NULL) { + device_printf(dev, "<%s>: device_add_child failed\n", + ndi->ndi_obdinfo.obd_name); + nexus_destroy_dinfo(ndi); + continue; + } + device_set_ivars(cdev, ndi); } - return (bus_generic_attach(dev)); } -static void -nexus_probe_nomatch(device_t dev, device_t child) +static device_t +nexus_add_child(device_t dev, u_int order, const char *name, int unit) { - const char *name, *type; + device_t cdev; + struct nexus_devinfo *ndi; - name = ofw_bus_get_name(child); - type = ofw_bus_get_type(child); + cdev = device_add_child_ordered(dev, order, name, unit); + if (cdev == NULL) + return (NULL); - if (name == NULL) - name = "unknown"; - if (type == NULL) - type = "(unknown)"; - - if (bootverbose) - device_printf(dev, "<%s>, type %s (no driver attached)\n", - name, type); + ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); + ndi->ndi_obdinfo.obd_node = -1; + resource_list_init(&ndi->ndi_rl); + device_set_ivars(cdev, ndi); + + return (cdev); } -static device_t -nexus_add_child(device_t dev, u_int order, const char *name, int unit) +static int +nexus_print_child(device_t bus, device_t child) { - device_t child; - struct nexus_devinfo *dinfo; + int rv; - child = device_add_child_ordered(dev, order, name, unit); - if (child == NULL) - return (NULL); + rv = bus_print_child_header(bus, child); + rv += nexus_print_res(device_get_ivars(child)); + rv += bus_print_child_footer(bus, child); + return (rv); +} - dinfo = malloc(sizeof(struct nexus_devinfo), M_NEXUS, M_NOWAIT|M_ZERO); - if (dinfo == NULL) - return (NULL); +static void +nexus_probe_nomatch(device_t bus, device_t child) +{ + const char *name, *type; - dinfo->ndi_ofwinfo.obd_node = -1; - dinfo->ndi_ofwinfo.obd_name = NULL; - dinfo->ndi_ofwinfo.obd_compat = NULL; - dinfo->ndi_ofwinfo.obd_type = NULL; - dinfo->ndi_ofwinfo.obd_model = NULL; + if (!bootverbose) + return; - device_set_ivars(child, dinfo); + name = ofw_bus_get_name(child); + type = ofw_bus_get_type(child); - return (child); + device_printf(bus, "<%s>", + name != NULL ? name : "unknown"); + nexus_print_res(device_get_ivars(child)); + printf(" type %s (no driver attached)\n", + type != NULL ? type : "unknown"); } static int -nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, - driver_filter_t *filter, driver_intr_t *ihand, void *arg, void **cookiep) +nexus_setup_intr(device_t bus __unused, device_t child, struct resource *r, + int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, + void **cookiep) { - int error; + int error; - /* somebody tried to setup an irq that failed to allocate! */ - if (res == NULL) - panic("nexus_setup_intr: NULL irq resource!"); + if (r == NULL) + panic("%s: NULL interrupt resource!", __func__); - *cookiep = 0; - if ((rman_get_flags(res) & RF_SHAREABLE) == 0) + if ((rman_get_flags(r) & RF_SHAREABLE) == 0) flags |= INTR_EXCL; - /* - * We depend here on rman_activate_resource() being idempotent. - */ - error = rman_activate_resource(res); + /* We depend here on rman_activate_resource() being idempotent. */ + error = rman_activate_resource(r); if (error) return (error); error = powerpc_setup_intr(device_get_nameunit(child), - rman_get_start(res), filter, ihand, arg, flags, cookiep); + rman_get_start(r), filt, intr, arg, flags, cookiep); return (error); } static int -nexus_teardown_intr(device_t dev, device_t child, struct resource *res, - void *cookie) +nexus_teardown_intr(device_t bus __unused, device_t child __unused, + struct resource *r, void *ih) { + + if (r == NULL) + return (EINVAL); - return (powerpc_teardown_intr(cookie)); + return (powerpc_teardown_intr(ih)); } #ifdef SMP static int -nexus_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu) +nexus_bind_intr(device_t bus __unused, device_t child __unused, + struct resource *r, int cpu) { - return (powerpc_bind_intr(rman_get_start(irq), cpu)); + return (powerpc_bind_intr(rman_get_start(r), cpu)); } #endif - + static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, enum intr_polarity pol) { + + return (powerpc_config_intr(irq, trig, pol)); +} - return (powerpc_config_intr(irq, trig, pol)); -} - -/* - * Allocate resources at the behest of a child. This only handles interrupts, - * since I/O resources are handled by child busses. - */ static struct resource * nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { struct nexus_softc *sc; + struct rman *rm; struct resource *rv; + struct resource_list_entry *rle; + device_t nexus; + int isdefault, passthrough; + + isdefault = (start == 0UL && end == ~0UL); + passthrough = (device_get_parent(child) != bus); + nexus = bus; + while (strcmp(device_get_name(device_get_parent(nexus)), "root") != 0) + nexus = device_get_parent(nexus); + sc = device_get_softc(nexus); + rle = NULL; + + if (!passthrough && isdefault) { + rle = resource_list_find(BUS_GET_RESOURCE_LIST(bus, child), + type, *rid); + if (rle == NULL) + return (NULL); + if (rle->res != NULL) + panic("%s: resource entry is busy", __func__); + start = rle->start; + count = ulmax(count, rle->count); + end = ulmax(rle->end, start + count - 1); + } - if (type != SYS_RES_IRQ) { - device_printf(bus, "unknown resource request from %s\n", - device_get_nameunit(child)); + switch (type) { + case SYS_RES_IRQ: + rm = &sc->sc_intr_rman; + break; + case SYS_RES_MEMORY: + rm = &sc->sc_mem_rman; + break; + default: return (NULL); } - if (count == 0 || start + count - 1 != end) { - device_printf(bus, "invalid IRQ allocation from %s\n", - device_get_nameunit(child)); + rv = rman_reserve_resource(rm, start, end, count, flags & ~RF_ACTIVE, + child); + if (rv == NULL) return (NULL); - } + rman_set_rid(rv, *rid); - sc = device_get_softc(bus); + if ((flags & RF_ACTIVE) != 0 && bus_activate_resource(child, type, + *rid, rv) != 0) { + rman_release_resource(rv); + return (NULL); + } - rv = rman_reserve_resource(&sc->sc_rman, start, end, count, - flags, child); - if (rv == NULL) { - device_printf(bus, "IRQ allocation failed for %s\n", - device_get_nameunit(child)); - } else - rman_set_rid(rv, *rid); + if (!passthrough && rle != NULL) { + rle->res = rv; + rle->start = rman_get_start(rv); + rle->end = rman_get_end(rv); + rle->count = rle->end - rle->start + 1; + } return (rv); } static int -nexus_activate_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) +nexus_activate_resource(device_t bus __unused, device_t child __unused, + int type, int rid __unused, struct resource *r) { - /* Not much to be done yet... */ - return (rman_activate_resource(res)); + if (type == SYS_RES_MEMORY) { + vm_offset_t start; + void *p; + + start = (vm_offset_t) rman_get_start(r); + if (bootverbose) + printf("nexus mapdev: start %zx, len %ld\n", start, + rman_get_size(r)); + + p = pmap_mapdev(start, (vm_size_t) rman_get_size(r)); + if (p == NULL) + return (ENOMEM); + rman_set_virtual(r, p); + rman_set_bustag(r, &bs_be_tag); + rman_set_bushandle(r, (u_long)p); + } + return (rman_activate_resource(r)); } static int -nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) +nexus_deactivate_resource(device_t bus __unused, device_t child __unused, + int type __unused, int rid __unused, struct resource *r) { - /* Not much to be done yet... */ - return (rman_deactivate_resource(res)); + /* + * If this is a memory resource, unmap it. + */ + if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { + bus_size_t psize; + + psize = rman_get_size(r); + pmap_unmapdev((vm_offset_t)rman_get_virtual(r), psize); + } + + return (rman_deactivate_resource(r)); } static int -nexus_release_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) +nexus_adjust_resource(device_t bus, device_t child __unused, int type, + struct resource *r, u_long start, u_long end) { + struct nexus_softc *sc; + struct rman *rm; + device_t nexus; - if (type != SYS_RES_IRQ) { - device_printf(bus, "unknown resource request from %s\n", - device_get_nameunit(child)); + nexus = bus; + while (strcmp(device_get_name(device_get_parent(nexus)), "root") != 0) + nexus = device_get_parent(nexus); + sc = device_get_softc(nexus); + switch (type) { + case SYS_RES_IRQ: + rm = &sc->sc_intr_rman; + break; + case SYS_RES_MEMORY: + rm = &sc->sc_mem_rman; + break; + default: return (EINVAL); } - - return (rman_release_resource(res)); + if (rm == NULL) + return (ENXIO); + if (rman_is_region_manager(r, rm) == 0) + return (EINVAL); + return (rman_adjust_resource(r, start, end)); } -static device_t -nexus_device_from_node(device_t parent, phandle_t node) +static int +nexus_release_resource(device_t bus __unused, device_t child, int type, + int rid, struct resource *r) { - device_t cdev; - struct nexus_devinfo *dinfo; + int error; - cdev = device_add_child(parent, NULL, -1); - if (cdev != NULL) { - dinfo = malloc(sizeof(*dinfo), M_NEXUS, M_WAITOK); - ofw_bus_gen_setup_devinfo(&dinfo->ndi_ofwinfo, node); - device_set_ivars(cdev, dinfo); + if ((rman_get_flags(r) & RF_ACTIVE) != 0) { + error = bus_deactivate_resource(child, type, rid, r); + if (error) + return (error); } + return (rman_release_resource(r)); +} - return (cdev); +static struct resource_list * +nexus_get_resource_list(device_t bus __unused, device_t child) +{ + struct nexus_devinfo *ndi; + + ndi = device_get_ivars(child); + return (&ndi->ndi_rl); } static const struct ofw_bus_devinfo * -nexus_get_devinfo(device_t dev, device_t child) +nexus_get_devinfo(device_t bus __unused, device_t child) +{ + struct nexus_devinfo *ndi; + + ndi = device_get_ivars(child); + return (&ndi->ndi_obdinfo); +} + +static struct nexus_devinfo * +nexus_setup_dinfo(device_t dev, phandle_t node) { - struct nexus_devinfo *dinfo; + struct nexus_softc *sc; + struct nexus_devinfo *ndi; + uint32_t *reg, *intr, icells; + uint64_t phys, size; + phandle_t iparent; + int i, j; + int nintr; + int nreg; - dinfo = device_get_ivars(child); - return (&dinfo->ndi_ofwinfo); + sc = device_get_softc(dev); + + ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); + if (ofw_bus_gen_setup_devinfo(&ndi->ndi_obdinfo, node) != 0) { + free(ndi, M_DEVBUF); + return (NULL); + } + if (NEXUS_EXCLUDED(ndi->ndi_obdinfo.obd_name, + ndi->ndi_obdinfo.obd_type)) { + ofw_bus_gen_destroy_devinfo(&ndi->ndi_obdinfo); + free(ndi, M_DEVBUF); + return (NULL); + } + + resource_list_init(&ndi->ndi_rl); + nreg = OF_getprop_alloc(node, "reg", sizeof(*reg), (void **)®); + if (nreg == -1) + nreg = 0; + + for (i = 0; i < nreg; i += sc->acells + sc->scells) { + phys = size = 0; + for (j = 0; j < sc->acells; j++) { + phys <<= 32; + phys |= reg[i + j]; + } + for (j = 0; j < sc->scells; j++) { + size <<= 32; + size |= reg[i + sc->acells + j]; + } + /* Skip the dummy reg property of glue devices like ssm(4). */ + if (size != 0) + resource_list_add(&ndi->ndi_rl, SYS_RES_MEMORY, i, + phys, phys + size - 1, size); + } + free(reg, M_OFWPROP); + + nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intr), + (void **)&intr); + if (nintr > 0) { + iparent = 0; + OF_searchprop(node, "interrupt-parent", &iparent, + sizeof(iparent)); + OF_searchprop(iparent, "#interrupt-cells", &icells, + sizeof(icells)); + for (i = 0; i < nintr; i+= icells) { + intr[i] = MAP_IRQ(iparent, intr[i]); + resource_list_add(&ndi->ndi_rl, SYS_RES_IRQ, i, intr[i], + intr[i], 1); + if (icells > 1) { + powerpc_config_intr(intr[i], (intr[i+1] & 1) ? + INTR_TRIGGER_LEVEL : INTR_TRIGGER_EDGE, + INTR_POLARITY_LOW); + } + } + free(intr, M_OFWPROP); + } + + return (ndi); +} + +static void +nexus_destroy_dinfo(struct nexus_devinfo *ndi) +{ + + resource_list_free(&ndi->ndi_rl); + ofw_bus_gen_destroy_devinfo(&ndi->ndi_obdinfo); + free(ndi, M_DEVBUF); +} + +static int +nexus_print_res(struct nexus_devinfo *ndi) +{ + int rv; + + rv = 0; + rv += resource_list_print_type(&ndi->ndi_rl, "mem", SYS_RES_MEMORY, + "%#lx"); + rv += resource_list_print_type(&ndi->ndi_rl, "irq", SYS_RES_IRQ, + "%ld"); + return (rv); } From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 15:30:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 41AA892F; Tue, 22 Oct 2013 15:30:00 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2E6412252; Tue, 22 Oct 2013 15:30:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MFU07A075133; Tue, 22 Oct 2013 15:30:00 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MFTxAV075088; Tue, 22 Oct 2013 15:29:59 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310221529.r9MFTxAV075088@svn.freebsd.org> From: Brooks Davis Date: Tue, 22 Oct 2013 15:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256911 - in head/sys: dev/fdt mips/beri X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 15:30:00 -0000 Author: brooks Date: Tue Oct 22 15:29:59 2013 New Revision: 256911 URL: http://svnweb.freebsd.org/changeset/base/256911 Log: MFP4: 223121 (PIC portion), 225861, 227822, 229692 (PIC only), 229693, 230523, 1123614 Implement a driver for Robert Norton's PIC as an FDT interrupt controller. Devices whose interrupt-parent property points to a beripic device will have their interrupt allocation, activation , and setup operations routed through the IC rather than down the traditional bus hierarchy. This driver largely abstracts the underlying CPU away allowing the PIC to be implemented on CPU's other than BERI. Due to insufficient abstractions a small amount of MIPS specific code is currently required in fdt_mips.c and to implement counters. MFC after: 3 days Sponsored by: DARPA/AFRL Added: head/sys/mips/beri/beri_pic.c (contents, props changed) Modified: head/sys/dev/fdt/fdt_mips.c head/sys/mips/beri/files.beri Modified: head/sys/dev/fdt/fdt_mips.c ============================================================================== --- head/sys/dev/fdt/fdt_mips.c Tue Oct 22 15:09:31 2013 (r256910) +++ head/sys/dev/fdt/fdt_mips.c Tue Oct 22 15:29:59 2013 (r256911) @@ -68,7 +68,26 @@ fdt_pic_decode_mips4k_cp0(phandle_t node return (0); } +/* + * CHERI PIC decoder. + */ +static int +fdt_pic_decode_beri(phandle_t node, pcell_t *intr, int *interrupt, + int *trig, int *pol) +{ + + if (!fdt_is_compatible(node, "sri-cambridge,beri-pic")) + return (ENXIO); + + *interrupt = fdt32_to_cpu(intr[0]); + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + + return (0); +} + fdt_pic_decode_t fdt_pic_table[] = { &fdt_pic_decode_mips4k_cp0, + &fdt_pic_decode_beri, NULL }; Added: head/sys/mips/beri/beri_pic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/beri/beri_pic.c Tue Oct 22 15:29:59 2013 (r256911) @@ -0,0 +1,706 @@ +/*- + * Copyright (c) 2013 SRI International + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 "fdt_ic_if.h" + +struct beripic_softc; + +static uint64_t bp_read_cfg(struct beripic_softc *, int); +static void bp_write_cfg(struct beripic_softc *, int, uint64_t); +static void bp_detach_resources(device_t); +static char *bp_strconfig(uint64_t, char *, size_t); +static void bp_config_source(device_t, int, int, u_long, u_long); +#ifdef __mips__ +static void bp_set_counter_name(device_t, device_t, int); +#endif + +static int beripic_fdt_probe(device_t); +static int beripic_fdt_attach(device_t); + +static int beripic_activate_intr(device_t, struct resource *); +static struct resource * + beripic_alloc_intr(device_t, device_t, int *, u_long, u_int); +static int beripic_config_intr(device_t, int, enum intr_trigger, + enum intr_polarity); +static int beripic_release_intr(device_t, struct resource *); +static int beripic_setup_intr(device_t, device_t, struct resource *, + int, driver_filter_t *, driver_intr_t *, void *, void **); +static int beripic_teardown_intr(device_t, device_t, struct resource *, + void *); + +static int beripic_filter(void *); +static void beripic_intr(void *); + +#define BP_MAX_HARD_IRQS 6 +#define BP_FIRST_SOFT 64 + +struct beripic_softc { + device_t bp_dev; + struct resource *bp_cfg_res; + struct resource *bp_read_res; + struct resource *bp_set_res; + struct resource *bp_clear_res; + int bp_cfg_rid; + int bp_read_rid; + int bp_set_rid; + int bp_clear_rid; + bus_space_tag_t bp_cfg_bst; + bus_space_tag_t bp_read_bst; + bus_space_tag_t bp_set_bst; + bus_space_tag_t bp_clear_bst; + bus_space_handle_t bp_cfg_bsh; + bus_space_handle_t bp_read_bsh; + bus_space_handle_t bp_set_bsh; + bus_space_handle_t bp_clear_bsh; + + struct resource *bp_irqs[BP_MAX_HARD_IRQS]; + int bp_irq_rids[BP_MAX_HARD_IRQS]; + int bp_nirqs; + int bp_next_irq; + int bp_next_tid; + + int bp_nthreads; + + int bp_nhard; + int bp_nsoft; + int bp_nsrcs; + struct rman bp_src_rman; + +#ifdef __mips__ + mips_intrcnt_t *bp_counters; +#endif + + struct mtx bp_cfgmtx; +}; + +struct beripic_intr_arg { + driver_filter_t *filter; + driver_intr_t *intr; + void *arg; + struct resource *irq; +#ifdef __mips__ + mips_intrcnt_t counter; +#endif +}; + +struct beripic_cookie { + struct beripic_intr_arg *bpia; + struct resource *hirq; + void *cookie; +}; + +#define BP_CFG_MASK_E 0x80000000ull +#define BP_CFG_SHIFT_E 31 +#define BP_CFG_MASK_TID 0x7FFFFF00ull /* Depends on CPU */ +#define BP_CFG_SHIFT_TID 8 +#define BP_CFG_MASK_IRQ 0x0000000Full +#define BP_CFG_SHIFT_IRQ 0 +#define BP_CFG_VALID (BP_CFG_MASK_E|BP_CFG_MASK_TID|BP_CFG_MASK_IRQ) +#define BP_CFG_RESERVED ~BP_CFG_VALID + +#define BP_CFG_ENABLED(cfg) (((cfg) & BP_CFG_MASK_E) >> BP_CFG_SHIFT_E) +#define BP_CFG_TID(cfg) (((cfg) & BP_CFG_MASK_TID) >> BP_CFG_SHIFT_TID) +#define BP_CFG_IRQ(cfg) (((cfg) & BP_CFG_MASK_IRQ) >> BP_CFG_SHIFT_IRQ) + +MALLOC_DEFINE(M_BERIPIC, "beripic", "beripic memory"); + +static uint64_t +bp_read_cfg(struct beripic_softc *sc, int irq) +{ + + KASSERT((irq >= 0 && irq < sc->bp_nsrcs), + ("IRQ of of range %d (0-%d)", irq, sc->bp_nsrcs - 1)); + return (bus_space_read_8(sc->bp_cfg_bst, sc->bp_cfg_bsh, irq * 8)); +} + +static void +bp_write_cfg(struct beripic_softc *sc, int irq, uint64_t config) +{ + + KASSERT((irq >= 0 && irq < sc->bp_nsrcs), + ("IRQ of of range %d (0-%d)", irq, sc->bp_nsrcs - 1)); + bus_space_write_8(sc->bp_cfg_bst, sc->bp_cfg_bsh, irq * 8, config); +} + +static void +bp_detach_resources(device_t dev) +{ + struct beripic_softc *sc; + int i; + + sc = device_get_softc(dev); + + if (sc->bp_cfg_res != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, sc->bp_cfg_rid, + sc->bp_cfg_res); + sc->bp_cfg_res = NULL; + } + if (sc->bp_read_res != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, sc->bp_read_rid, + sc->bp_read_res); + sc->bp_read_res = NULL; + } + if (sc->bp_set_res != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, sc->bp_set_rid, + sc->bp_set_res); + sc->bp_set_res = NULL; + } + if (sc->bp_clear_res != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, sc->bp_clear_rid, + sc->bp_clear_res); + sc->bp_clear_res = NULL; + } + for (i = sc->bp_nirqs - 1; i >= 0; i--) { + bus_release_resource(dev, SYS_RES_IRQ, sc->bp_irq_rids[i], + sc->bp_irqs[i]); + } + sc->bp_nirqs = 0; +} + +static char * +bp_strconfig(uint64_t config, char *configstr, size_t len) +{ + + if (snprintf(configstr, len, "%s tid: %llu hardintr %llu", + BP_CFG_ENABLED(config) ? "enabled" : "disabled", + BP_CFG_TID(config), BP_CFG_IRQ(config)) > len - 1) + return (NULL); + return (configstr); +} + +static void +bp_config_source(device_t ic, int src, int enable, u_long tid, u_long irq) +{ + struct beripic_softc *sc; + uint64_t config; + + sc = device_get_softc(ic); + + config = 0; + config |= enable << BP_CFG_SHIFT_E; + config |= tid << BP_CFG_SHIFT_TID; + config |= irq << BP_CFG_SHIFT_IRQ; + + bp_write_cfg(sc, src, config); +} + +#ifdef __mips__ +static void +bp_set_counter_name(device_t ic, device_t child, int src) +{ + struct beripic_softc *sc; + char name[MAXCOMLEN + 1]; + + sc = device_get_softc(ic); + + if (snprintf(name, sizeof(name), "bp%dsrc%d%s%s%s", + device_get_unit(ic), src, src < sc->bp_nhard ? "" : "s", + child == NULL ? "" : " ", + child == NULL ? " " : device_get_nameunit(child)) >= sizeof(name)) + name[sizeof(name) - 2] = '+'; + + mips_intrcnt_setname(sc->bp_counters[src], name); +} +#endif + +static int +beripic_fdt_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "sri-cambridge,beri-pic")) + return (ENXIO); + + device_set_desc(dev, "BERI Programmable Interrupt Controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +beripic_fdt_attach(device_t dev) +{ + char configstr[64]; + struct beripic_softc *sc; + struct fdt_ic *fic; + pcell_t nhard, nsoft; + phandle_t ph; + int error, i, src; + uint64_t config; + + sc = device_get_softc(dev); + sc->bp_dev = dev; + + mtx_init(&sc->bp_cfgmtx, "beripic config lock", NULL, MTX_DEF); + + /* + * FDT lists CONFIG, IP_READ, IP_SET, and IP_CLEAR registers as + * seperate memory regions in that order. + */ + sc->bp_cfg_rid = 0; + sc->bp_cfg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->bp_cfg_rid, RF_ACTIVE); + if (sc->bp_cfg_res == NULL) { + device_printf(dev, "failed to map config memory"); + error = ENXIO; + goto err; + } + if (bootverbose) + device_printf(sc->bp_dev, "config region at mem %p-%p\n", + (void *)rman_get_start(sc->bp_cfg_res), + (void *)(rman_get_start(sc->bp_cfg_res) + + rman_get_size(sc->bp_cfg_res))); + + sc->bp_read_rid = 1; + sc->bp_read_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->bp_read_rid, RF_ACTIVE); + if (sc->bp_read_res == NULL) { + device_printf(dev, "failed to map IP read memory"); + error = ENXIO; + goto err; + } + if (bootverbose) + device_printf(sc->bp_dev, "IP read region at mem %p-%p\n", + (void *)rman_get_start(sc->bp_read_res), + (void *)(rman_get_start(sc->bp_read_res) + + rman_get_size(sc->bp_read_res))); + + sc->bp_set_rid = 2; + sc->bp_set_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->bp_set_rid, RF_ACTIVE); + if (sc->bp_set_res == NULL) { + device_printf(dev, "failed to map IP read memory"); + error = ENXIO; + goto err; + } + if (bootverbose) + device_printf(sc->bp_dev, "IP set region at mem %p-%p\n", + (void *)rman_get_start(sc->bp_set_res), + (void *)(rman_get_start(sc->bp_set_res) + + rman_get_size(sc->bp_set_res))); + + sc->bp_clear_rid = 3; + sc->bp_clear_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->bp_clear_rid, RF_ACTIVE); + if (sc->bp_clear_res == NULL) { + device_printf(dev, "failed to map IP read memory"); + error = ENXIO; + goto err; + } + if (bootverbose) + device_printf(sc->bp_dev, "IP clear region at mem %p-%p\n", + (void *)rman_get_start(sc->bp_clear_res), + (void *)(rman_get_start(sc->bp_clear_res) + + rman_get_size(sc->bp_clear_res))); + + i = 0; + for (i = 0; i < BP_MAX_HARD_IRQS; i++) { + sc->bp_irq_rids[i] = i; + sc->bp_irqs[i] = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->bp_irq_rids[i], RF_ACTIVE | RF_SHAREABLE); + if (sc->bp_irqs[i] == NULL) + break; + } + if (i == 0) { + device_printf(dev, "failed to allocate any parent IRQs!"); + error = ENXIO; + goto err; + } + sc->bp_nirqs = i; + + ph = ofw_bus_gen_get_node(device_get_parent(dev), dev); + +#ifndef SMP + sc->bp_nthreads = 1; +#else + sc->bp_nthreads = 1; + /* XXX: get nthreads from cpu(s) somehow */ +#endif + + if (OF_getprop(ph, "hard-interrupt-sources", &nhard, sizeof(nhard)) + <= 0) { + device_printf(dev, "failed to get number of hard sources"); + error = ENXIO; + goto err; + } + if (OF_getprop(ph, "soft-interrupt-sources", &nsoft, sizeof(nsoft)) + <= 0) { + device_printf(dev, "failed to get number of soft sources"); + error = ENXIO; + goto err; + } + + sc->bp_nhard = nhard; + sc->bp_nsoft = nsoft; + sc->bp_nsrcs = sc->bp_nhard + sc->bp_nsoft; + /* XXX: should deal with gap between hard and soft */ + KASSERT(sc->bp_nhard <= BP_FIRST_SOFT, + ("too many hard sources")); + KASSERT(rman_get_size(sc->bp_cfg_res) / 8 == sc->bp_nsrcs, + ("config space size does not match sources")); + KASSERT(sc->bp_nhard % 64 == 0, + ("Non-multiple of 64 intr counts not supported")); + KASSERT(sc->bp_nsoft % 64 == 0, + ("Non-multiple of 64 intr counts not supported")); + if (bootverbose) + device_printf(dev, "%d hard and %d soft sources\n", + sc->bp_nhard, sc->bp_nsoft); + +#ifdef __mips__ + sc->bp_counters = malloc(sizeof(*sc->bp_counters) * sc->bp_nsrcs, + M_BERIPIC, M_WAITOK|M_ZERO); + for (i = 0; i < sc->bp_nsrcs; i++) { + sc->bp_counters[i] = mips_intrcnt_create(""); + bp_set_counter_name(dev, NULL, i); + } +#endif + + sc->bp_src_rman.rm_start = 0; + sc->bp_src_rman.rm_end = sc->bp_nsrcs - 1; + sc->bp_src_rman.rm_type = RMAN_ARRAY; + sc->bp_src_rman.rm_descr = "Interrupt source"; + if (rman_init(&(sc->bp_src_rman)) != 0 || + rman_manage_region(&(sc->bp_src_rman), 0, sc->bp_nsrcs - 1) != 0) { + device_printf(dev, "Failed to set up sources rman"); + error = ENXIO; + goto err; + } + + sc->bp_cfg_bst = rman_get_bustag(sc->bp_cfg_res); + sc->bp_cfg_bsh = rman_get_bushandle(sc->bp_cfg_res); + sc->bp_read_bst = rman_get_bustag(sc->bp_read_res); + sc->bp_read_bsh = rman_get_bushandle(sc->bp_read_res); + sc->bp_set_bst = rman_get_bustag(sc->bp_set_res); + sc->bp_set_bsh = rman_get_bushandle(sc->bp_set_res); + sc->bp_clear_bst = rman_get_bustag(sc->bp_clear_res); + sc->bp_clear_bsh = rman_get_bushandle(sc->bp_clear_res); + + for (src = 0; src < sc->bp_nsrcs; src++) { + config = bp_read_cfg(sc, src); + if (config == 0) + continue; + + if (bootverbose) { + device_printf(dev, "initial config: src %d: %s\n", src, + bp_strconfig(config, configstr, sizeof(configstr))); + if (config & BP_CFG_RESERVED) + device_printf(dev, + "reserved bits not 0: 0x%016jx\n", + (uintmax_t) config); + } + + bp_config_source(dev, src, 0, 0, 0); + } + + fic = malloc(sizeof(*fic), M_BERIPIC, M_WAITOK|M_ZERO); + fic->iph = ph; + fic->dev = dev; + SLIST_INSERT_HEAD(&fdt_ic_list_head, fic, fdt_ics); + + return (0); +err: + bp_detach_resources(dev); + + return (error); +} + +static struct resource * +beripic_alloc_intr(device_t ic, device_t child, int *rid, u_long irq, + u_int flags) +{ + struct beripic_softc *sc; + struct resource *rv; + + sc = device_get_softc(ic); + + rv = rman_reserve_resource(&(sc->bp_src_rman), irq, irq, 1, flags, + child); + if (rv == NULL) + printf("%s: could not reserve source interrupt for %s\n", + __func__, device_get_nameunit(child)); + rman_set_rid(rv, *rid); + + if ((flags & RF_ACTIVE) && + beripic_activate_intr(ic, rv) != 0) { + printf("%s: could not activate interrupt\n", __func__); + rman_release_resource(rv); + return (NULL); + } + + return (rv); +} + +static int +beripic_release_intr(device_t ic, struct resource *r) +{ + + return (rman_release_resource(r)); +} + +static int +beripic_activate_intr(device_t ic, struct resource *r) +{ + + return (rman_activate_resource(r)); +} + +static int +beripic_deactivate_intr(device_t ic, struct resource *r) +{ + + return (rman_deactivate_resource(r)); +} + +static int +beripic_config_intr(device_t dev, int irq, enum intr_trigger trig, + enum intr_polarity pol) +{ + + if (trig != INTR_TRIGGER_CONFORM || pol != INTR_POLARITY_CONFORM) + return (EINVAL); + + return (0); +} + +static int +beripic_setup_intr(device_t ic, device_t child, struct resource *irq, + int flags, driver_filter_t *filter, driver_intr_t *intr, void *arg, + void **cookiep) +{ + struct beripic_softc *sc; + struct beripic_intr_arg *bpia; + struct beripic_cookie *bpc; + int error; + u_long hirq, src, tid; + + sc = device_get_softc(ic); + + src = rman_get_start(irq); + + KASSERT(src < sc->bp_nsrcs, ("source (%lu) out of range 0-%d", + src, sc->bp_nsrcs - 1)); + + bpia = malloc(sizeof(*bpia), M_BERIPIC, M_WAITOK|M_ZERO); + bpia->filter = filter; + bpia->intr = intr; + bpia->arg = arg; + bpia->irq = irq; +#ifdef __mips__ + bpia->counter = sc->bp_counters[src]; + bp_set_counter_name(ic, child, src); +#endif + + bpc = malloc(sizeof(*bpc), M_BERIPIC, M_WAITOK|M_ZERO); + bpc->bpia = bpia; + + mtx_lock(&(sc->bp_cfgmtx)); + bpc->hirq = sc->bp_irqs[sc->bp_next_irq]; + hirq = rman_get_start(bpc->hirq); + tid = sc->bp_next_tid; + + error = BUS_SETUP_INTR(device_get_parent(ic), ic, bpc->hirq, flags, + beripic_filter, intr == NULL ? NULL : beripic_intr, bpia, + &(bpc->cookie)); + if (error != 0) + goto err; + +#ifdef NOTYET +#ifdef SMP + /* XXX: bind ithread to cpu */ + sc->bp_next_tid++; + if (sc->bp_next_tid >= sc->bp_nthreads) + sc->bp_next_tid = 0; +#endif +#endif + if (sc->bp_next_tid == 0) { + sc->bp_next_irq++; + if (sc->bp_next_irq >= sc->bp_nirqs) + sc->bp_next_irq = 0; + } + mtx_unlock(&(sc->bp_cfgmtx)); + + *cookiep = bpc; + + bp_config_source(ic, rman_get_start(irq), 1, tid, hirq); + + return (0); +err: + free(bpc, M_BERIPIC); + free(bpia, M_BERIPIC); + + return (error); +} + +static int +beripic_teardown_intr(device_t dev, device_t child, struct resource *irq, + void *cookie) +{ + struct beripic_cookie *bpc; + int error; + + bpc = cookie; + + bp_config_source(dev, rman_get_start(irq), 0, 0, 0); + + free(bpc->bpia, M_BERIPIC); + + error = BUS_TEARDOWN_INTR(device_get_parent(dev), dev, bpc->hirq, + bpc->cookie); + + free(bpc, M_BERIPIC); + + return (error); +} + +static int +beripic_filter(void *arg) +{ + struct beripic_intr_arg *bpic; + + bpic = arg; + +#ifdef __mips__ + mips_intrcnt_inc(bpic->counter); +#endif + + /* XXX: Add a check that our source is high */ + + if (bpic->filter == NULL) + return (FILTER_SCHEDULE_THREAD); + + return (bpic->filter(bpic->arg)); +} + +static void +beripic_intr(void *arg) +{ + struct beripic_intr_arg *bpic; + + bpic = arg; + + KASSERT(bpic->intr != NULL, + ("%s installed, but no child intr", __func__)); + + bpic->intr(bpic->arg); +} + +#ifdef SMP +static void +beripic_setup_ipi(device_t ic, u_int tid, u_int ipi_irq) +{ + + bp_config_source(ic, BP_FIRST_SOFT + tid, 1, tid, ipi_irq); +} + +static void +beripic_send_ipi(device_t ic, u_int tid) +{ + struct beripic_softc *sc; + uint64_t bit; + + sc = device_get_softc(ic); + + KASSERT(tid < sc->bp_nsoft, ("tid (%d) too large\n", tid)); + + printf("sending ipi to %d soft intrs %jx\n", tid, + bus_space_read_8(sc->bp_read_bst, sc->bp_read_bsh, 8)); + + bit = 1ULL << (tid % 64); + bus_space_write_8(sc->bp_set_bst, sc->bp_set_bsh, + (BP_FIRST_SOFT / 8) + (tid / 64), bit); + + printf("sent ipi to %d soft intrs %jx\n", tid, + bus_space_read_8(sc->bp_read_bst, sc->bp_read_bsh, 8)); +} + +static void +beripic_clear_ipi(device_t ic, u_int tid) +{ + struct beripic_softc *sc; + uint64_t bit; + + sc = device_get_softc(ic); + + KASSERT(tid < sc->bp_nsoft, ("tid (%d) to large\n", tid)); + + bit = 1ULL << (tid % 64); + bus_space_write_8(sc->bp_clear_bst, sc->bp_clear_bsh, + (BP_FIRST_SOFT / 8) + (tid / 64), bit); +} +#endif + +devclass_t beripic_devclass; + +static device_method_t beripic_fdt_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, beripic_fdt_probe), + DEVMETHOD(device_attach, beripic_fdt_attach), + + DEVMETHOD(fdt_ic_activate_intr, beripic_activate_intr), + DEVMETHOD(fdt_ic_alloc_intr, beripic_alloc_intr), + DEVMETHOD(fdt_ic_config_intr, beripic_config_intr), + DEVMETHOD(fdt_ic_deactivate_intr, beripic_deactivate_intr), + DEVMETHOD(fdt_ic_release_intr, beripic_release_intr), + DEVMETHOD(fdt_ic_setup_intr, beripic_setup_intr), + DEVMETHOD(fdt_ic_teardown_intr, beripic_teardown_intr), + +#ifdef SMP + DEVMETHOD(fdt_ic_setup_ipi, beripic_setup_ipi), + DEVMETHOD(fdt_ic_clear_ipi, beripic_clear_ipi), + DEVMETHOD(fdt_ic_send_ipi, beripic_send_ipi), +#endif + + { 0, 0 }, +}; + +static driver_t beripic_fdt_driver = { + "beripic", + beripic_fdt_methods, + sizeof(struct beripic_softc) +}; + +DRIVER_MODULE(beripic, simplebus, beripic_fdt_driver, beripic_devclass, 0, 0); Modified: head/sys/mips/beri/files.beri ============================================================================== --- head/sys/mips/beri/files.beri Tue Oct 22 15:09:31 2013 (r256910) +++ head/sys/mips/beri/files.beri Tue Oct 22 15:29:59 2013 (r256911) @@ -17,5 +17,6 @@ dev/terasic/mtl/terasic_mtl_reg.c option dev/terasic/mtl/terasic_mtl_syscons.c optional terasic_mtl dev/terasic/mtl/terasic_mtl_text.c optional terasic_mtl mips/beri/beri_machdep.c standard +mips/beri/beri_pic.c optional fdt mips/mips/intr_machdep.c standard mips/mips/tick.c standard From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 15:45:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DFBF3E39; Tue, 22 Oct 2013 15:45:33 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CC1BE2398; Tue, 22 Oct 2013 15:45:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MFjXKm083208; Tue, 22 Oct 2013 15:45:33 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MFjVWi083110; Tue, 22 Oct 2013 15:45:31 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310221545.r9MFjVWi083110@svn.freebsd.org> From: Brooks Davis Date: Tue, 22 Oct 2013 15:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256912 - in head/sys: boot/fdt/dts mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 15:45:34 -0000 Author: brooks Date: Tue Oct 22 15:45:31 2013 New Revision: 256912 URL: http://svnweb.freebsd.org/changeset/base/256912 Log: Sync BERI kernel configs with P4: Switch the majority of device configuration to FDT from hints. Add BERI_*_BASE configs to reduce duplication in the MDROOT and SDROOT kernels. Add NFS and GSSAPI support by default. MFC after: 3 days Sponsored by: DARPA/AFRL Added: head/sys/boot/fdt/dts/beri-sim.dts (contents, props changed) head/sys/boot/fdt/dts/beripad-de4.dts (contents, props changed) head/sys/mips/conf/BERI_DE4_BASE (contents, props changed) head/sys/mips/conf/BERI_SIM_BASE (contents, props changed) head/sys/mips/conf/BERI_SIM_SDROOT (contents, props changed) Modified: head/sys/mips/conf/BERI_DE4.hints head/sys/mips/conf/BERI_DE4_MDROOT head/sys/mips/conf/BERI_DE4_SDROOT head/sys/mips/conf/BERI_SIM_MDROOT head/sys/mips/conf/BERI_TEMPLATE Added: head/sys/boot/fdt/dts/beri-sim.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/beri-sim.dts Tue Oct 22 15:45:31 2013 (r256912) @@ -0,0 +1,144 @@ +/*- + * Copyright (c) 2012-2013 Robert N. M. Watson + * Copyright (c) 2013 SRI International + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/* + * Device names here have been largely made up on the spot, especially for the + * "compatible" strings, and might want to be revised. + * + * For now, use 32-bit addressing as our Avalon bus is 32-bit. However, in + * the future, we should likely change to 64-bit. + */ + +/ { + model = "SRI/Cambridge BERI simulation"; + compatible = "sri-cambridge,beri-sim"; + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <1>; + + /* + * Secondary CPUs all start disabled and use the + * spin-table enable method. cpu-release-addr must be + * specified for each cpu other than cpu@0. Values of + * cpu-release-addr grow down from 0x100000 (kernel). + */ + status = "disabled"; + enable-method = "spin-table"; + + cpu@0 { + device-type = "cpu"; + compatible = "sri-cambridge,beri"; + + reg = <0>; + status = "okay"; + }; + +/* + cpu@1 { + device-type = "cpu"; + compatible = "sri-cambridge,beri"; + + reg = <1>; + // XXX: should we need cached prefix? + cpu-release-addr = <0xffffffff 0x800fffe0>; + }; +*/ + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + #interrupt-cells = <1>; + + /* + * Declare mips,mips4k since BERI doesn't (yet) have a PIC, so + * we use mips4k coprocessor 0 interrupt management directly. + */ + compatible = "simple-bus", "mips,mips4k"; + ranges = <>; + + memory { + device_type = "memory"; + reg = <0x0 0x4000000>; // 64M at 0x0 + }; + + beripic: beripic@7f804000 { + compatible = "sri-cambridge,beri-pic"; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = <0x7f804000 0x400 + 0x7f806000 0x10 + 0x7f806080 0x10 + 0x7f806100 0x10>; + interrupts = <0 1 2 3 4>; + hard-interrupt-sources = <64>; + soft-interrupt-sources = <64>; + }; + + serial@7f000000 { + compatible = "altera,jtag_uart-11_0"; + reg = <0x7f000000 0x40>; + interrupts = <0>; + interrupt-parent = <&beripic>; + }; + + serial@7f001000 { + compatible = "altera,jtag_uart-11_0"; + reg = <0x7f001000 0x40>; + }; + + serial@7f002000 { + compatible = "altera,jtag_uart-11_0"; + reg = <0x7f002000 0x40>; + }; + + sdcard@7f008000 { + compatible = "altera,sdcard_11_2011"; + reg = <0x7f008000 0x400>; + }; + + avgen@0x7f00a000 { + compatible = "sri-cambridge,avgen"; + reg = <0x7f00a000 0x14>; + sri-cambridge,width = <4>; + sri-cambridge,fileio = "rw"; + sri-cambridge,devname = "berirom"; + }; + }; +}; Added: head/sys/boot/fdt/dts/beripad-de4.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/beripad-de4.dts Tue Oct 22 15:45:31 2013 (r256912) @@ -0,0 +1,266 @@ +/*- + * Copyright (c) 2012-2013 Robert N. M. Watson + * Copyright (c) 2013 SRI International + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/* + * Device names here have been largely made up on the spot, especially for the + * "compatible" strings, and might want to be revised. + * + * For now, use 32-bit addressing as our Avalon bus is 32-bit. However, in + * the future, we should likely change to 64-bit. + */ + +/ { + model = "SRI/Cambridge BeriPad (DE4)"; + compatible = "sri-cambridge,beripad-de4"; + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <1>; + + /* + * Secondary CPUs all start disabled and use the + * spin-table enable method. cpu-release-addr must be + * specified for each cpu other than cpu@0. Values of + * cpu-release-addr grow down from 0x100000 (kernel). + */ + status = "disabled"; + enable-method = "spin-table"; + + cpu@0 { + device-type = "cpu"; + compatible = "sri-cambridge,beri"; + + reg = <0>; + status = "okay"; + }; + +/* + cpu@1 { + device-type = "cpu"; + compatible = "sri-cambridge,beri"; + + reg = <1>; + // XXX: should we need cached prefix? + cpu-release-addr = <0xffffffff 0x800fffe0>; + }; +*/ + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + #interrupt-cells = <1>; + + /* + * Declare mips,mips4k since BERI doesn't (yet) have a PIC, so + * we use mips4k coprocessor 0 interrupt management directly. + */ + compatible = "simple-bus", "mips,mips4k"; + ranges = <>; + + memory { + device_type = "memory"; + reg = <0x0 0x40000000>; // 1G at 0x0 + }; + + beripic: beripic@7f804000 { + compatible = "sri-cambridge,beri-pic"; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = <0x7f804000 0x400 + 0x7f806000 0x10 + 0x7f806080 0x10 + 0x7f806100 0x10>; + interrupts = <0 1 2 3 4>; + hard-interrupt-sources = <64>; + soft-interrupt-sources = <64>; + }; + + serial@7f002100 { + compatible = "ns16550"; + reg = <0x7f002100 0x20>; + reg-shift = <2>; + clock-frequency = <50000000>; + interrupts = <6>; + interrupt-parent = <&beripic>; + }; + + serial@7f000000 { + compatible = "altera,jtag_uart-11_0"; + reg = <0x7f000000 0x40>; + interrupts = <0>; + interrupt-parent = <&beripic>; + }; + + serial@7f001000 { + compatible = "altera,jtag_uart-11_0"; + reg = <0x7f001000 0x40>; + }; + + serial@7f002000 { + compatible = "altera,jtag_uart-11_0"; + reg = <0x7f002000 0x40>; + }; + + sdcard@7f008000 { + compatible = "altera,sdcard_11_2011"; + reg = <0x7f008000 0x400>; + }; + + led@7f006000 { + compatible = "sri-cambridge,de4led"; + reg = <0x7f006000 0x1>; + }; + + /* + * XXX-BZ keep flash before ethernet so that atse can read the + * Ethernet addresses for now. + */ + flash@74000000 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x74000000 0x4000000>; + + /* Board configuration */ + partition@0 { + reg = <0x0 0x20000>; + label = "config"; + }; + + /* Power up FPGA image */ + partition@20000 { + reg = <0x20000 0xc00000>; + label = "fpga0"; + }; + + /* Secondary FPGA image (on RE_CONFIGn button) */ + partition@C20000 { + reg = <0xc20000 0xc00000>; + label = "fpga1"; + }; + + /* Space for operating system use */ + partition@1820000 { + reg = <0x1820000 0x027c0000>; + label = "os"; + }; + + /* Second stage bootloader */ + parition@3fe0000 { + reg = <0x3fe0000 0x20000>; + label = "boot"; + }; + }; + + ethernet@7f007000 { + compatible = "altera,atse"; + // MAC, RX+RXC, TX+TXC. + reg = <0x7f007000 0x400 + 0x7f007500 0x8 + 0x7f007520 0x20 + 0x7f007400 0x8 + 0x7f007420 0x20>; + // RX, TX + interrupts = <1 2>; + interrupt-parent = <&beripic>; + }; + + ethernet@7f005000 { + compatible = "altera,atse"; + // MAC, RX+RXC, TX+TXC. + reg = <0x7f005000 0x400 + 0x7f005500 0x8 + 0x7f005520 0x20 + 0x7f005400 0x8 + 0x7f005420 0x20>; + // RX, TX + interrupts = <11 12>; + interrupt-parent = <&beripic>; + }; + + touchscreen@70400000 { + compatible = "sri-cambridge,mtl"; + reg = <0x70400000 0x1000 + 0x70000000 0x177000 + 0x70177000 0x2000>; + }; + + usb@0x7f100000 { + compatible = "philips,isp1761"; + reg = <0x7f100000 0x40000 + 0x7f140000 0x4>; + // IRQ 4 is DC, IRQ 5 is HC. + interrupts = <4 5>; + interrupt-parent = <&beripic>; + }; + + avgen@0x7f009000 { + compatible = "sri-cambridge,avgen"; + reg = <0x7f009000 0x2>; + sri-cambridge,width = <1>; + sri-cambridge,fileio = "r"; + sri-cambridge,devname = "de4bsw"; + }; + + avgen@0x7f00a000 { + compatible = "sri-cambridge,avgen"; + reg = <0x7f00a000 0x14>; + sri-cambridge,width = <4>; + sri-cambridge,fileio = "rw"; + sri-cambridge,devname = "berirom"; + }; + + avgen@0x7f00c000 { + compatible = "sri-cambridge,avgen"; + reg = <0x7f00c000 0x8>; + sri-cambridge,width = <4>; + sri-cambridge,fileio = "rw"; + sri-cambridge,devname = "de4tempfan"; + }; + + avgen@0x7f100000 { + compatible = "sri-cambridge,avgen"; + reg = <0x7f100000 0x40000>; + sri-cambridge,width = <4>; + sri-cambridge,fileio = "r"; + sri-cambridge,devname = "usbmem"; + }; + + }; +}; Modified: head/sys/mips/conf/BERI_DE4.hints ============================================================================== --- head/sys/mips/conf/BERI_DE4.hints Tue Oct 22 15:29:59 2013 (r256911) +++ head/sys/mips/conf/BERI_DE4.hints Tue Oct 22 15:45:31 2013 (r256912) @@ -1,75 +1,26 @@ # $FreeBSD$ -# -# Altera JTAG UARTs configured for console, debugging, and data putput on the -# Terasic DE-4. -# -hint.altera_jtag_uart.0.at="nexus0" -hint.altera_jtag_uart.0.maddr=0x7f000000 -hint.altera_jtag_uart.0.msize=0x40 -hint.altera_jtag_uart.0.irq=0 +# Hardwired location of bitfile +hint.map.0.at="cfid0s.fpga0" +hint.map.0.start=0x00000000 +hint.map.0.end=0x00c00000 +hint.map.0.name="fpga" + +# Kernel on the second chip +hint.map.1.at="cfid0s.os" +hint.map.1.start=0x007e0000 +hint.map.1.end=0x01fe0000 +hint.map.1.name="kernel" + +# Altera Triple-Speed Ethernet Mac, present in tPad and DE-4 configurations +# configured from fdt(4) but PHYs are still described in here. +# Currently configured for individual tse_mac cores. +hint.e1000phy.0.at="miibus0" +hint.e1000phy.0.phyno=0 +hint.e1000phy.1.at="miibus0" +hint.e1000phy.1.phyno=0 +hint.e1000phy.2.at="miibus0" +hint.e1000phy.2.phyno=0 +hint.e1000phy.3.at="miibus0" +hint.e1000phy.3.phyno=0 -hint.altera_jtag_uart.1.at="nexus0" -hint.altera_jtag_uart.1.maddr=0x7f001000 -hint.altera_jtag_uart.1.msize=0x40 - -hint.altera_jtag_uart.2.at="nexus0" -hint.altera_jtag_uart.2.maddr=0x7f002000 -hint.altera_jtag_uart.2.msize=0x40 - -# -# On-board DE4 and tPad SD Card IP core -# -hint.altera_sdcardc.0.at="nexus0" -hint.altera_sdcardc.0.maddr=0x7f008000 -hint.altera_sdcardc.0.msize=0x400 - -# -# On-board DE4 8-element LED -# -hint.terasic_de4led.0.at="nexus0" -hint.terasic_de4led.0.maddr=0x7f006000 -hint.terasic_de4led.0.msize=1 -hint.terasic_de4led.0.de4led_0_cmd="f9" - -# -# Terasic Multi-touch LCD (MTL), an optional feature in DE-4 configurations. -# -hint.terasic_mtl.0.at="nexus0" -hint.terasic_mtl.0.reg_maddr=0x70400000 -hint.terasic_mtl.0.reg_msize=0x1000 -hint.terasic_mtl.0.pixel_maddr=0x70000000 -hint.terasic_mtl.0.pixel_msize=0x177000 -hint.terasic_mtl.0.text_maddr=0x70177000 -hint.terasic_mtl.0.text_msize=0x2000 - -# -# BERI Hardware Version ROM -# -hint.altera_avgen.0.at="nexus0" -hint.altera_avgen.0.maddr=0x7F00A000 -hint.altera_avgen.0.msize=20 -hint.altera_avgen.0.width=4 -hint.altera_avgen.0.fileio="rw" -hint.altera_avgen.0.devname="berirom" - -# -# Expose the DE4 flash via an Avalon "generic" device. -# -#hint.altera_avgen.0.at="nexus0" -#hint.altera_avgen.0.maddr=0x74000000 -#hint.altera_avgen.0.msize=0x4000000 -#hint.altera_avgen.0.width=2 -#hint.altera_avgen.0.fileio="rw" -#hint.altera_avgen.0.mmapio="rwx" -#hint.altera_avgen.0.devname="de4flash" - -# -# Expose the DE4 buttons and switches via an Avalon "generic" device. -# -hint.altera_avgen.0.at="nexus0" -hint.altera_avgen.0.maddr=0x7f009000 -hint.altera_avgen.0.msize=2 -hint.altera_avgen.0.width=1 -hint.altera_avgen.0.fileio="r" -hint.altera_avgen.0.devname="de4bsw" Added: head/sys/mips/conf/BERI_DE4_BASE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BERI_DE4_BASE Tue Oct 22 15:45:31 2013 (r256912) @@ -0,0 +1,41 @@ +# +# BERI_DE4_BASE -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible RISC +# Implementation) FPGA soft core, as configured in its Terasic DE-4 reference +# configuration. This kernel configration must be further specialized to +# to include a root filesystem specification. +# +# $FreeBSD$ +# + +include "BERI_TEMPLATE" + +ident BERI_DE4_BASE + +options NFSCL # New Network Filesystem Client +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCL + +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=beripad-de4.dts + +hints "BERI_DE4.hints" # Flash partitions still use hints. + +device altera_atse +device altera_avgen +device altera_jtag_uart +device altera_sdcard +device terasic_de4led +device terasic_mtl + +device bpf +device cfi +device cfid +options CFI_SUPPORT_STRATAFLASH +device sc + +device uart + +device miibus +options DEVICE_POLLING + Modified: head/sys/mips/conf/BERI_DE4_MDROOT ============================================================================== --- head/sys/mips/conf/BERI_DE4_MDROOT Tue Oct 22 15:29:59 2013 (r256911) +++ head/sys/mips/conf/BERI_DE4_MDROOT Tue Oct 22 15:45:31 2013 (r256912) @@ -1,29 +1,19 @@ # -# BERI_DE4 -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible RISC -# Implementation) FPGA soft core, as configured in its Terasic DE-4 reference -# configuration. +# BERI_DE4_MDROOT -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible +# RISC # Implementation) FPGA soft core, as configured in its Terasic DE-4 +# reference configuration. # # $FreeBSD$ # -include "BERI_TEMPLATE" +include "BERI_DE4_BASE" ident BERI_DE4_MDROOT -hints "BERI_DE4.hints" #Default places to look for devices. - # # This kernel configuration uses an embedded 8MB memory root file system. # Adjust the following path based on local requirements. # options MD_ROOT # MD is a potential root device -options MD_ROOT_SIZE=8192 +options MD_ROOT_SIZE=26112 # 25.5MB options ROOTDEVNAME=\"ufs:md0\" - -device altera_avgen -device altera_jtag_uart -device altera_sdcard -device terasic_de4led -device terasic_mtl - -device sc Modified: head/sys/mips/conf/BERI_DE4_SDROOT ============================================================================== --- head/sys/mips/conf/BERI_DE4_SDROOT Tue Oct 22 15:29:59 2013 (r256911) +++ head/sys/mips/conf/BERI_DE4_SDROOT Tue Oct 22 15:45:31 2013 (r256912) @@ -1,23 +1,16 @@ # -# BERI_DE4 -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible RISC -# Implementation) FPGA soft core, as configured in its Terasic DE-4 reference -# configuration. +# BERI_DE4_SDROOT -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible +# RISC Implementation) FPGA soft core, as configured in its Terasic DE-4 +# reference configuration. # # $FreeBSD$ # -include "BERI_TEMPLATE" +include "BERI_DE4_BASE" ident BERI_DE4_SDROOT -hints "BERI_DE4.hints" #Default places to look for devices. - -options ROOTDEVNAME=\"ufs:altera_sdcard0\" - -device altera_avgen -device altera_jtag_uart -device altera_sdcard -device terasic_de4led -device terasic_mtl - -device sc +# +# This kernel expects to find its root filesystem on the SD Card. +# +options ROOTDEVNAME=\"ufs:/dev/altera_sdcard0\" Added: head/sys/mips/conf/BERI_SIM_BASE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BERI_SIM_BASE Tue Oct 22 15:45:31 2013 (r256912) @@ -0,0 +1,19 @@ +# +# BERI_SIM_BASE -- Base kernel for the SRI/Cambridge "BERI" (Bluespec +# Extensible RISC Implementation) FPGA soft core, as configured for +# simulation. +# +# $FreeBSD$ +# + +include "BERI_TEMPLATE" + +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=beri-sim.dts + +options ALTERA_SDCARD_FAST_SIM + +device altera_avgen +device altera_jtag_uart +device altera_sdcard Modified: head/sys/mips/conf/BERI_SIM_MDROOT ============================================================================== --- head/sys/mips/conf/BERI_SIM_MDROOT Tue Oct 22 15:29:59 2013 (r256911) +++ head/sys/mips/conf/BERI_SIM_MDROOT Tue Oct 22 15:45:31 2013 (r256912) @@ -1,24 +1,18 @@ # -# BERI_SIM -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible RISC -# Implementation) FPGA soft core, as configured for simulation. +# BERI_SIM_MDROOT -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible +# RISC Implementation) FPGA soft core, as configured for simulation. # # $FreeBSD$ # -include "BERI_TEMPLATE" +include "BERI_SIM_BASE" ident BERI_SIM_MDROOT -hints "BERI_SIM.hints" #Default places to look for devices. - # -# This kernel configuration uses an embedded 8MB memory root file system. +# This kernel configuration uses an embedded memory root file system. # Adjust the following path based on local requirements. # options MD_ROOT # MD is a potential root device -options MD_ROOT_SIZE=8192 +options MD_ROOT_SIZE=26112 # 25.5MB options ROOTDEVNAME=\"ufs:md0\" - -device altera_avgen -device altera_jtag_uart -device altera_sdcard Added: head/sys/mips/conf/BERI_SIM_SDROOT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BERI_SIM_SDROOT Tue Oct 22 15:45:31 2013 (r256912) @@ -0,0 +1,15 @@ +# +# BERI_SIM_SDROOT -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible +# RISC Implementation) FPGA soft core, as configured for simulation. +# +# $FreeBSD$ +# + +include "BERI_SIM_BASE" + +ident BERI_SIM_SDROOT + +# +# This kernel expects to find its root filesystem on the SD Card. +# +options ROOTDEVNAME=\"ufs:/dev/altera_sdcard0\" Modified: head/sys/mips/conf/BERI_TEMPLATE ============================================================================== --- head/sys/mips/conf/BERI_TEMPLATE Tue Oct 22 15:29:59 2013 (r256911) +++ head/sys/mips/conf/BERI_TEMPLATE Tue Oct 22 15:45:31 2013 (r256912) @@ -39,7 +39,9 @@ options FFS #Berkeley Fast Filesystem options INET options INET6 +options KGSSAPI options NFSCL +options NFSLOCKD options NFS_ROOT # Debugging for use in -current @@ -49,10 +51,11 @@ options INVARIANT_SUPPORT #Extra sanity #options WITNESS #Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed -device geom_map - -device md +device crypto +device cryptodev device ether +device geom_map device loop +device md device random device snp From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 15:47:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8A9D0FE; Tue, 22 Oct 2013 15:47:14 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7809C23B2; Tue, 22 Oct 2013 15:47:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MFlEVs084229; Tue, 22 Oct 2013 15:47:14 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MFlEtu084228; Tue, 22 Oct 2013 15:47:14 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310221547.r9MFlEtu084228@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 22 Oct 2013 15:47:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256914 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 15:47:14 -0000 Author: nwhitehorn Date: Tue Oct 22 15:47:13 2013 New Revision: 256914 URL: http://svnweb.freebsd.org/changeset/base/256914 Log: Ignore registers on devices where the reg property is malformed. Issue a warning if this happens under bootverbose. This prevents some strange-looking entries in dmesg for SMU devices on Apple G5 systems. Modified: head/sys/powerpc/powerpc/nexus.c Modified: head/sys/powerpc/powerpc/nexus.c ============================================================================== --- head/sys/powerpc/powerpc/nexus.c Tue Oct 22 15:46:21 2013 (r256913) +++ head/sys/powerpc/powerpc/nexus.c Tue Oct 22 15:47:13 2013 (r256914) @@ -567,6 +567,12 @@ nexus_setup_dinfo(device_t dev, phandle_ nreg = OF_getprop_alloc(node, "reg", sizeof(*reg), (void **)®); if (nreg == -1) nreg = 0; + if (nreg % (sc->acells + sc->scells) != 0) { + if (bootverbose) + device_printf(dev, "Malformed reg property on <%s>\n", + ndi->ndi_obdinfo.obd_name); + nreg = 0; + } for (i = 0; i < nreg; i += sc->acells + sc->scells) { phys = size = 0; From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 15:53:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1CEAB3EC; Tue, 22 Oct 2013 15:53:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 07F362421; Tue, 22 Oct 2013 15:53:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MFrTwH088191; Tue, 22 Oct 2013 15:53:29 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MFrT4x088189; Tue, 22 Oct 2013 15:53:29 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310221553.r9MFrT4x088189@svn.freebsd.org> From: Brooks Davis Date: Tue, 22 Oct 2013 15:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256915 - in head: . share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 15:53:30 -0000 Author: brooks Date: Tue Oct 22 15:53:29 2013 New Revision: 256915 URL: http://svnweb.freebsd.org/changeset/base/256915 Log: Stop conflating WITHOUT_CLANG with WITHOUT_CLANG_IS_CC. This allows bootstrapping a copy of clang without building clang for the base system which is useful for nanobsd and similar setups. It's still probably wrong to conflate what is installed as /usr/bin/cc with the selection of a bootstrap compiler under WITH*_CLANG_IS_CC, but that's for another day. MFC after: 1 week Sponsored by: DARPA/AFRL Modified: head/Makefile.inc1 head/share/mk/bsd.own.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Oct 22 15:47:13 2013 (r256914) +++ head/Makefile.inc1 Tue Oct 22 15:53:29 2013 (r256915) @@ -1377,12 +1377,10 @@ _binutils= gnu/usr.bin/binutils # If an full path to an external cross compiler is given, don't build # a cross compiler. .if ${XCC:M/*} == "" && ${MK_CROSS_COMPILER} != "no" -.if ${MK_CLANG} != "no" && (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") +.if (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") && ${TARGET} != "pc98" _clang= usr.bin/clang _clang_libs= lib/clang -.endif - -.if ${MK_GCC} != "no" && (${MK_CLANG_IS_CC} == "no" || ${TARGET} == "pc98") +.else _cc= gnu/usr.bin/cc .endif .endif Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Tue Oct 22 15:47:13 2013 (r256914) +++ head/share/mk/bsd.own.mk Tue Oct 22 15:53:29 2013 (r256915) @@ -554,7 +554,6 @@ MK_GDB:= no .if ${MK_CLANG} == "no" MK_CLANG_EXTRAS:= no MK_CLANG_FULL:= no -MK_CLANG_IS_CC:= no .endif .if ${MK_CLANG_IS_CC} == "no" From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 16:09:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A57C0F25; Tue, 22 Oct 2013 16:09:45 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 91AA62500; Tue, 22 Oct 2013 16:09:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MG9j9p096204; Tue, 22 Oct 2013 16:09:45 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MG9iUu096182; Tue, 22 Oct 2013 16:09:44 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201310221609.r9MG9iUu096182@svn.freebsd.org> From: Colin Percival Date: Tue, 22 Oct 2013 16:09:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256916 - in stable/10: etc etc/defaults share/man/man5 share/man/man8 sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 16:09:45 -0000 Author: cperciva Date: Tue Oct 22 16:09:44 2013 New Revision: 256916 URL: http://svnweb.freebsd.org/changeset/base/256916 Log: MFC r256775,r256776: Add support for "first boot" rc.d scripts. Document this new functionality in rc.conf(5) and rc(8). Bump __FreeBSD_version so that ports can make use of this. Approved by: re (gjb) Modified: stable/10/etc/defaults/rc.conf stable/10/etc/rc stable/10/share/man/man5/rc.conf.5 stable/10/share/man/man8/rc.8 stable/10/sys/sys/param.h Directory Properties: stable/10/etc/ (props changed) stable/10/share/man/man5/ (props changed) stable/10/share/man/man8/ (props changed) stable/10/sys/ (props changed) Modified: stable/10/etc/defaults/rc.conf ============================================================================== --- stable/10/etc/defaults/rc.conf Tue Oct 22 15:53:29 2013 (r256915) +++ stable/10/etc/defaults/rc.conf Tue Oct 22 16:09:44 2013 (r256916) @@ -619,6 +619,9 @@ quotacheck_flags="-a" # Check all file s accounting_enable="NO" # Turn on process accounting (or NO). ibcs2_enable="NO" # Ibcs2 (SCO) emulation loaded at startup (or NO). ibcs2_loaders="coff" # List of additional Ibcs2 loaders (or NO). +firstboot_sentinel="/firstboot" # Scripts with "firstboot" keyword are run if + # this file exists. Should be on a R/W filesystem so + # the file can be deleted after the boot completes. # Emulation/compatibility services provided by /etc/rc.d/abi sysvipc_enable="NO" # Load System V IPC primitives at startup (or NO). Modified: stable/10/etc/rc ============================================================================== --- stable/10/etc/rc Tue Oct 22 15:53:29 2013 (r256915) +++ stable/10/etc/rc Tue Oct 22 16:09:44 2013 (r256916) @@ -82,10 +82,15 @@ if [ `/sbin/sysctl -n security.jail.jail fi fi +# If the firstboot sentinel doesn't exist, we want to skip firstboot scripts. +if ! [ -e ${firstboot_sentinel} ]; then + skip_firstboot="-s firstboot" +fi + # Do a first pass to get everything up to $early_late_divider so that # we can do a second pass that includes $local_startup directories # -files=`rcorder ${skip} /etc/rc.d/* 2>/dev/null` +files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* 2>/dev/null` _rc_elem_done=' ' for _rc_elem in ${files}; do @@ -107,7 +112,13 @@ case ${local_startup} in *) find_local_scripts_new ;; esac -files=`rcorder ${skip} /etc/rc.d/* ${local_rc} 2>/dev/null` +# The firstboot sentinel might be on a newly mounted filesystem; look for it +# again and unset skip_firstboot if we find it. +if [ -e ${firstboot_sentinel} ]; then + skip_firstboot="" +fi + +files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} 2>/dev/null` for _rc_elem in ${files}; do case "$_rc_elem_done" in *" $_rc_elem "*) continue ;; @@ -116,6 +127,15 @@ for _rc_elem in ${files}; do run_rc_script ${_rc_elem} ${_boot} done +# Remove the firstboot sentinel, and reboot if it was requested. +if [ -e ${firstboot_sentinel} ]; then + rm ${firstboot_sentinel} + if [ -e ${firstboot_sentinel}-reboot ]; then + rm ${firstboot_sentinel}-reboot + kill -INT 1 + fi +fi + echo '' date exit 0 Modified: stable/10/share/man/man5/rc.conf.5 ============================================================================== --- stable/10/share/man/man5/rc.conf.5 Tue Oct 22 15:53:29 2013 (r256915) +++ stable/10/share/man/man5/rc.conf.5 Tue Oct 22 16:09:44 2013 (r256916) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 12, 2013 +.Dd October 19, 2013 .Dt RC.CONF 5 .Os .Sh NAME @@ -3675,6 +3675,23 @@ and if is set to .Dq Li YES , this specifies a list of additional iBCS2 loaders to enable. +.It Va firstboot_sentinel +.Pq Vt str +This variable specifies the full path to a +.Dq first boot +sentinel file. +If a file exists with this path, +.Pa rc.d +scripts with the +.Dq firstboot +keyword will be run on startup and the sentinel file will be deleted +after the boot process completes. +The sentinel file must be located on a writable file system which is +mounted no later than +.Va early_late_divider +to function properly. +The default is +.Pa /firstboot . .It Va linux_enable .Pq Vt bool Set to Modified: stable/10/share/man/man8/rc.8 ============================================================================== --- stable/10/share/man/man8/rc.8 Tue Oct 22 15:53:29 2013 (r256915) +++ stable/10/share/man/man8/rc.8 Tue Oct 22 16:09:44 2013 (r256916) @@ -35,7 +35,7 @@ .\" @(#)rc.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd September 23, 2013 +.Dd October 19, 2013 .Dt RC 8 .Os .Sh NAME @@ -129,6 +129,13 @@ and add (only allow vnet-enabled jails) to the list of KEYWORDS to skip in .Xr rcorder 8 . .It +If the file +.Va ${firstboot_sentinel} +does not exist, add +.Dq Li firstboot +to the list of KEYWORDS to skip in +.Xr rcorder 8 . +.It Invoke .Xr rcorder 8 to order the files in @@ -156,6 +163,11 @@ Stop processing when the script that is .Va $early_late_divider has been run. .It +Check again to see if the file +.Va ${firstboot_sentinel} +exists (in case it is located on a newly mounted file system) +and adjust the list of KEYWORDs to skip appropriately. +.It Re-run .Xr rcorder 8 , this time including the scripts in the @@ -164,6 +176,13 @@ directories. Ignore everything up to the .Va $early_late_divider , then start executing the scripts as described above. +.It +If the file +.Va ${firstboot_sentinel} +exists, delete it. +If the file +.Va ${firstboot_sentinel}-reboot +also exists (because it was created by a script), then delete it and reboot. .El .Ss Operation of Nm rc.shutdown .Bl -enum Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Tue Oct 22 15:53:29 2013 (r256915) +++ stable/10/sys/sys/param.h Tue Oct 22 16:09:44 2013 (r256916) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000500 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000501 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 16:13:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DDB79251; Tue, 22 Oct 2013 16:13:16 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C9BAD2567; Tue, 22 Oct 2013 16:13:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MGDGSx099378; Tue, 22 Oct 2013 16:13:16 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MGDF7w099373; Tue, 22 Oct 2013 16:13:15 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201310221613.r9MGDF7w099373@svn.freebsd.org> From: Colin Percival Date: Tue, 22 Oct 2013 16:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256917 - in stable/9: etc etc/defaults share/man/man5 share/man/man8 sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 16:13:17 -0000 Author: cperciva Date: Tue Oct 22 16:13:15 2013 New Revision: 256917 URL: http://svnweb.freebsd.org/changeset/base/256917 Log: MFC r256775,r256776: Add support for "first boot" rc.d scripts. Document this new functionality in rc.conf(5) and rc(8). Bump __FreeBSD_version so that ports can make use of this. Modified: stable/9/etc/defaults/rc.conf stable/9/etc/rc stable/9/share/man/man5/rc.conf.5 stable/9/share/man/man8/rc.8 stable/9/sys/sys/param.h Directory Properties: stable/9/etc/ (props changed) stable/9/share/man/man5/ (props changed) stable/9/share/man/man8/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/etc/defaults/rc.conf ============================================================================== --- stable/9/etc/defaults/rc.conf Tue Oct 22 16:09:44 2013 (r256916) +++ stable/9/etc/defaults/rc.conf Tue Oct 22 16:13:15 2013 (r256917) @@ -613,6 +613,9 @@ quotacheck_flags="-a" # Check all file s accounting_enable="NO" # Turn on process accounting (or NO). ibcs2_enable="NO" # Ibcs2 (SCO) emulation loaded at startup (or NO). ibcs2_loaders="coff" # List of additional Ibcs2 loaders (or NO). +firstboot_sentinel="/firstboot" # Scripts with "firstboot" keyword are run if + # this file exists. Should be on a R/W filesystem so + # the file can be deleted after the boot completes. # Emulation/compatibility services provided by /etc/rc.d/abi sysvipc_enable="NO" # Load System V IPC primitives at startup (or NO). Modified: stable/9/etc/rc ============================================================================== --- stable/9/etc/rc Tue Oct 22 16:09:44 2013 (r256916) +++ stable/9/etc/rc Tue Oct 22 16:13:15 2013 (r256917) @@ -82,10 +82,15 @@ if [ `/sbin/sysctl -n security.jail.jail fi fi +# If the firstboot sentinel doesn't exist, we want to skip firstboot scripts. +if ! [ -e ${firstboot_sentinel} ]; then + skip_firstboot="-s firstboot" +fi + # Do a first pass to get everything up to $early_late_divider so that # we can do a second pass that includes $local_startup directories # -files=`rcorder ${skip} /etc/rc.d/* 2>/dev/null` +files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* 2>/dev/null` _rc_elem_done=' ' for _rc_elem in ${files}; do @@ -107,7 +112,13 @@ case ${local_startup} in *) find_local_scripts_new ;; esac -files=`rcorder ${skip} /etc/rc.d/* ${local_rc} 2>/dev/null` +# The firstboot sentinel might be on a newly mounted filesystem; look for it +# again and unset skip_firstboot if we find it. +if [ -e ${firstboot_sentinel} ]; then + skip_firstboot="" +fi + +files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} 2>/dev/null` for _rc_elem in ${files}; do case "$_rc_elem_done" in *" $_rc_elem "*) continue ;; @@ -116,6 +127,15 @@ for _rc_elem in ${files}; do run_rc_script ${_rc_elem} ${_boot} done +# Remove the firstboot sentinel, and reboot if it was requested. +if [ -e ${firstboot_sentinel} ]; then + rm ${firstboot_sentinel} + if [ -e ${firstboot_sentinel}-reboot ]; then + rm ${firstboot_sentinel}-reboot + kill -INT 1 + fi +fi + echo '' date exit 0 Modified: stable/9/share/man/man5/rc.conf.5 ============================================================================== --- stable/9/share/man/man5/rc.conf.5 Tue Oct 22 16:09:44 2013 (r256916) +++ stable/9/share/man/man5/rc.conf.5 Tue Oct 22 16:13:15 2013 (r256917) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 12, 2013 +.Dd October 19, 2013 .Dt RC.CONF 5 .Os .Sh NAME @@ -3629,6 +3629,23 @@ and if is set to .Dq Li YES , this specifies a list of additional iBCS2 loaders to enable. +.It Va firstboot_sentinel +.Pq Vt str +This variable specifies the full path to a +.Dq first boot +sentinel file. +If a file exists with this path, +.Pa rc.d +scripts with the +.Dq firstboot +keyword will be run on startup and the sentinel file will be deleted +after the boot process completes. +The sentinel file must be located on a writable file system which is +mounted no later than +.Va early_late_divider +to function properly. +The default is +.Pa /firstboot . .It Va linux_enable .Pq Vt bool Set to Modified: stable/9/share/man/man8/rc.8 ============================================================================== --- stable/9/share/man/man8/rc.8 Tue Oct 22 16:09:44 2013 (r256916) +++ stable/9/share/man/man8/rc.8 Tue Oct 22 16:13:15 2013 (r256917) @@ -35,7 +35,7 @@ .\" @(#)rc.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd November 17, 2009 +.Dd October 19, 2013 .Dt RC 8 .Os .Sh NAME @@ -129,6 +129,13 @@ and add (only allow vnet-enabled jails) to the list of KEYWORDS to skip in .Xr rcorder 8 . .It +If the file +.Va ${firstboot_sentinel} +does not exist, add +.Dq Li firstboot +to the list of KEYWORDS to skip in +.Xr rcorder 8 . +.It Invoke .Xr rcorder 8 to order the files in @@ -156,6 +163,11 @@ Stop processing when the script that is .Va $early_late_divider has been run. .It +Check again to see if the file +.Va ${firstboot_sentinel} +exists (in case it is located on a newly mounted file system) +and adjust the list of KEYWORDs to skip appropriately. +.It Re-run .Xr rcorder 8 , this time including the scripts in the @@ -164,6 +176,13 @@ directories. Ignore everything up to the .Va $early_late_divider , then start executing the scripts as described above. +.It +If the file +.Va ${firstboot_sentinel} +exists, delete it. +If the file +.Va ${firstboot_sentinel}-reboot +also exists (because it was created by a script), then delete it and reboot. .El .Ss Operation of Nm rc.shutdown .Bl -enum Modified: stable/9/sys/sys/param.h ============================================================================== --- stable/9/sys/sys/param.h Tue Oct 22 16:09:44 2013 (r256916) +++ stable/9/sys/sys/param.h Tue Oct 22 16:13:15 2013 (r256917) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 902503 /* Master, propagated to newvers */ +#define __FreeBSD_version 902504 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 18:07:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A4CED3DB; Tue, 22 Oct 2013 18:07:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 923D02C38; Tue, 22 Oct 2013 18:07:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MI7oWJ062574; Tue, 22 Oct 2013 18:07:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MI7o14062572; Tue, 22 Oct 2013 18:07:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201310221807.r9MI7o14062572@svn.freebsd.org> From: John Baldwin Date: Tue, 22 Oct 2013 18:07:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r256918 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 18:07:50 -0000 Author: jhb Date: Tue Oct 22 18:07:49 2013 New Revision: 256918 URL: http://svnweb.freebsd.org/changeset/base/256918 Log: Please welcome Oded Shanoon (odeds@) as a new src committer. Oded leads the OFED-FreeBSD team at Mellanox and will be maintaining our OFED stack. Alfred Perlstein and I will serve as co-mentors. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Tue Oct 22 16:13:15 2013 (r256917) +++ svnadmin/conf/access Tue Oct 22 18:07:49 2013 (r256918) @@ -158,6 +158,7 @@ np nwhitehorn nyan obrien +odeds oleg peter peter@wemm.org peterj Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Tue Oct 22 16:13:15 2013 (r256917) +++ svnadmin/conf/mentors Tue Oct 22 18:07:49 2013 (r256918) @@ -25,6 +25,7 @@ jwd rmacklem loos adrian miwi rwatson monthadar adrian +odeds jhb Co-mentor: alfred peterj jhb Co-mentor: grog snb dwmalone versus gavin Co-mentor: fjoe From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 18:14:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8F71669E; Tue, 22 Oct 2013 18:14:07 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7CC942CE0; Tue, 22 Oct 2013 18:14:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MIE7RM066917; Tue, 22 Oct 2013 18:14:07 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MIE7F1066916; Tue, 22 Oct 2013 18:14:07 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310221814.r9MIE7F1066916@svn.freebsd.org> From: Ian Lepore Date: Tue, 22 Oct 2013 18:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256919 - head/sys/dev/ffec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 18:14:07 -0000 Author: ian Date: Tue Oct 22 18:14:06 2013 New Revision: 256919 URL: http://svnweb.freebsd.org/changeset/base/256919 Log: Mask out non-address bits in the mac address register, for proper detection of an all-zeroes address. Also remove a misplaced return. Reviewed by: br@ Modified: head/sys/dev/ffec/if_ffec.c Modified: head/sys/dev/ffec/if_ffec.c ============================================================================== --- head/sys/dev/ffec/if_ffec.c Tue Oct 22 18:07:49 2013 (r256918) +++ head/sys/dev/ffec/if_ffec.c Tue Oct 22 18:14:06 2013 (r256919) @@ -883,7 +883,7 @@ ffec_get_hwaddr(struct ffec_softc *sc, u * assigned bit set, and the broadcast/multicast bit clear. */ palr = RD4(sc, FEC_PALR_REG); - paur = RD4(sc, FEC_PAUR_REG); + paur = RD4(sc, FEC_PAUR_REG) & FEC_PAUR_PADDR2_MASK; if ((palr | paur) != 0) { hwaddr[0] = palr >> 24; hwaddr[1] = palr >> 16; @@ -891,7 +891,6 @@ ffec_get_hwaddr(struct ffec_softc *sc, u hwaddr[3] = palr >> 0; hwaddr[4] = paur >> 24; hwaddr[5] = paur >> 16; - return; } else { rnd = arc4random() & 0x00ffffff; hwaddr[0] = 'b'; From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 18:24:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 64F54B17; Tue, 22 Oct 2013 18:24:35 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 37E9A2D8E; Tue, 22 Oct 2013 18:24:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MIOZtI072253; Tue, 22 Oct 2013 18:24:35 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MIOZJt072252; Tue, 22 Oct 2013 18:24:35 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201310221824.r9MIOZJt072252@svn.freebsd.org> From: Andre Oppermann Date: Tue, 22 Oct 2013 18:24:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256920 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 18:24:35 -0000 Author: andre Date: Tue Oct 22 18:24:34 2013 New Revision: 256920 URL: http://svnweb.freebsd.org/changeset/base/256920 Log: The TCP delayed ACK logic isn't aware of LRO passing up large aggregated segments thinking it received only one segment. This causes it to enable the delay the ACK for 100ms to wait for another segment which may never come because all the data was received already. Doing delayed ACK for LRO segments is bogus for two reasons: a) it pushes us further away from acking every other packet; b) it introduces additional delay in responding to the sender. The latter is especially bad because it is in the nature of LRO to aggregated all segments of a burst with no more coming until an ACK is sent back. Change the delayed ACK logic to detect LRO segments by being larger than the MSS for this connection and issuing an immediate ACK for them to keep the ACK clock ticking without interruption. Reported by: julian, cperciva Tested by: cperciva Reviewed by: lstewart MFC after: 3 days Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Oct 22 18:14:06 2013 (r256919) +++ head/sys/netinet/tcp_input.c Tue Oct 22 18:24:34 2013 (r256920) @@ -508,10 +508,13 @@ do { \ * the ack that opens up a 0-sized window and * - delayed acks are enabled or * - this is a half-synchronized T/TCP connection. + * - the segment size is not larger than the MSS and LRO wasn't used + * for this segment. */ -#define DELAY_ACK(tp) \ +#define DELAY_ACK(tp, tlen) \ ((!tcp_timer_active(tp, TT_DELACK) && \ (tp->t_flags & TF_RXWIN0SENT) == 0) && \ + (tlen <= tp->t_maxopd) && \ (V_tcp_delack_enabled || (tp->t_flags & TF_NEEDSYN))) /* @@ -1863,7 +1866,7 @@ tcp_do_segment(struct mbuf *m, struct tc } /* NB: sorwakeup_locked() does an implicit unlock. */ sorwakeup_locked(so); - if (DELAY_ACK(tp)) { + if (DELAY_ACK(tp, tlen)) { tp->t_flags |= TF_DELACK; } else { tp->t_flags |= TF_ACKNOW; @@ -1954,7 +1957,7 @@ tcp_do_segment(struct mbuf *m, struct tc * If there's data, delay ACK; if there's also a FIN * ACKNOW will be turned on later. */ - if (DELAY_ACK(tp) && tlen != 0) + if (DELAY_ACK(tp, tlen) && tlen != 0) tcp_timer_activate(tp, TT_DELACK, tcp_delacktime); else @@ -2926,7 +2929,7 @@ dodata: /* XXX */ if (th->th_seq == tp->rcv_nxt && LIST_EMPTY(&tp->t_segq) && TCPS_HAVEESTABLISHED(tp->t_state)) { - if (DELAY_ACK(tp)) + if (DELAY_ACK(tp, tlen)) tp->t_flags |= TF_DELACK; else tp->t_flags |= TF_ACKNOW; From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 18:36:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CDEF7F9A; Tue, 22 Oct 2013 18:36:39 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BAE862E55; Tue, 22 Oct 2013 18:36:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MIadmQ078366; Tue, 22 Oct 2013 18:36:39 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MIadrW078365; Tue, 22 Oct 2013 18:36:39 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201310221836.r9MIadrW078365@svn.freebsd.org> From: Colin Percival Date: Tue, 22 Oct 2013 18:36:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256921 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 18:36:39 -0000 Author: cperciva Date: Tue Oct 22 18:36:39 2013 New Revision: 256921 URL: http://svnweb.freebsd.org/changeset/base/256921 Log: Thou shalt not leak build host state into the system being compiled. The VERSION variable is encoded into the SUNW_ctf sections of the kernel and every kernel module when dtrace is enabled; starting with 9.2-RELEASE (when dtrace was turned on in GENERIC) this means that different host kernels will result in very different kernel binaries being generated. This tripped up freebsd-update builds after the build boxes were updated from 9.x to 10.x. MFC after: 3 days (stable/9) X-MFC after: 0 days (stable/10) Security: Rendered two members of so@ temporarily insane Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Oct 22 18:24:34 2013 (r256920) +++ head/Makefile.inc1 Tue Oct 22 18:36:39 2013 (r256921) @@ -128,8 +128,11 @@ OSRELDATE= 0 .endif .if !defined(VERSION) -VERSION!= uname -srp -VERSION+= ${OSRELDATE} +REVISION!= make -C ${.CURDIR}/release -V REVISION +BRANCH!= make -C ${.CURDIR}/release -V BRANCH +SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ + ${.CURDIR}/sys/sys/param.h +VERSION= FreeBSD ${REVISION}-${BRANCH} ${TARGET_ARCH} ${SRCRELDATE} .endif KNOWN_ARCHES?= amd64 arm armeb/arm armv6/arm i386 i386/pc98 ia64 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64 From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 18:47:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7877C4BA; Tue, 22 Oct 2013 18:47:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 51B922F08; Tue, 22 Oct 2013 18:47:37 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7A6CCB918; Tue, 22 Oct 2013 14:47:36 -0400 (EDT) From: John Baldwin To: Alexander Motin Subject: Re: svn commit: r256884 - in head: share/man/man9 sys/geom Date: Tue, 22 Oct 2013 14:47:35 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201310221021.r9MALLhP097274@svn.freebsd.org> In-Reply-To: <201310221021.r9MALLhP097274@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201310221447.35676.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 22 Oct 2013 14:47:36 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 18:47:37 -0000 On Tuesday, October 22, 2013 6:21:21 am Alexander Motin wrote: > Author: mav > Date: Tue Oct 22 10:21:20 2013 > New Revision: 256884 > URL: http://svnweb.freebsd.org/changeset/base/256884 > > Log: > Remove Giant-locked drivers support (DISKFLAG_NEEDSGIANT flag) from disk(9). > > Since at least FreeBSD 7 we had only four of them in the base tree, and > in head branch, thanks to jhb@, we have no any for more then a year. I had this additional change in my local branch, what do you think of it? We should probably keep it unless we bump DISK_VERSION and drop support for older disk structures. I think we could probably merge it to 10 along with your change as well: --- //depot/vendor/freebsd/src/sys/geom/geom_disk.c +++ //depot/user/jhb/cleanup/sys/geom/geom_disk.c @@ -654,6 +654,13 @@ dp->d_name, dp->d_unit); return; } + if (dp->d_flags & DISKFLAG_RESERVED) { + printf("WARNING: Attempt to add non-MPSAFE disk %s%d\n", + dp->d_name, dp->d_unit); + printf("WARNING: Ignoring disk %s%d\n", + dp->d_name, dp->d_unit); + return; + } KASSERT(dp->d_strategy != NULL, ("disk_create need d_strategy")); KASSERT(dp->d_name != NULL, ("disk_create need d_name")); KASSERT(*dp->d_name != 0, ("disk_create need d_name")); --- //depot/vendor/freebsd/src/sys/geom/geom_disk.h +++ //depot/user/jhb/cleanup/sys/geom/geom_disk.h @@ -102,6 +102,7 @@ void *d_drv1; }; +#define DISKFLAG_RESERVED 0x1 /* Was NEEDSGIANT */ #define DISKFLAG_OPEN 0x2 #define DISKFLAG_CANDELETE 0x4 #define DISKFLAG_CANFLUSHCACHE 0x8 -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 18:55:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 514247AD; Tue, 22 Oct 2013 18:55:41 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qa0-x22f.google.com (mail-qa0-x22f.google.com [IPv6:2607:f8b0:400d:c00::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BFB532F74; Tue, 22 Oct 2013 18:55:40 +0000 (UTC) Received: by mail-qa0-f47.google.com with SMTP id k15so3627090qaq.13 for ; Tue, 22 Oct 2013 11:55:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=JLlRKbQB0+s1dK3MSq9AgiwstoyWtf0IkOrXd2Hfefs=; b=eE7vjfO6C1r/WjkNtXNbm4xKUWchMrv9ll72E8z1FmGPqSoM2xtNhX0f9U7PL+2Id/ mQoAmfez/UHHvnEpa4iKOq8LQcvAziy94eyOBrN1tCrRKeosKJd5f2K5XijiwnO/zrSh esiEkJ5UEa2JJVSE7+Hstsdgc0WGIh90IGrNgIAXycfUknOXr0eBCb/VEBD6w3vi02oo k0heVgzNH73Bkr2KNlw1b+6Ysoijf+aZfX4ZLJmtW0bkz2ss7tVRPYoA2AZB6U8DPAXv Vj6PxmPvb05oJIjyf8p272HNtTh6wqz/Vndptsxr7bZLKg2akrxksdS9dQlyVL5stS04 akRA== MIME-Version: 1.0 X-Received: by 10.224.36.201 with SMTP id u9mr31828508qad.76.1382468139942; Tue, 22 Oct 2013 11:55:39 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Tue, 22 Oct 2013 11:55:39 -0700 (PDT) In-Reply-To: <201310221447.35676.jhb@freebsd.org> References: <201310221021.r9MALLhP097274@svn.freebsd.org> <201310221447.35676.jhb@freebsd.org> Date: Tue, 22 Oct 2013 11:55:39 -0700 X-Google-Sender-Auth: ftFFiG9Sl0G5rbtanvIteZaagig Message-ID: Subject: Re: svn commit: r256884 - in head: share/man/man9 sys/geom From: Adrian Chadd To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "svn-src-head@freebsd.org" , Alexander Motin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 18:55:41 -0000 Hi, I definitely agree with marking 0x1 as being reserved, at least for the lifecycle of 10.x up until 11.x. -adrian On 22 October 2013 11:47, John Baldwin wrote: > On Tuesday, October 22, 2013 6:21:21 am Alexander Motin wrote: > > Author: mav > > Date: Tue Oct 22 10:21:20 2013 > > New Revision: 256884 > > URL: http://svnweb.freebsd.org/changeset/base/256884 > > > > Log: > > Remove Giant-locked drivers support (DISKFLAG_NEEDSGIANT flag) from > disk(9). > > > > Since at least FreeBSD 7 we had only four of them in the base tree, and > > in head branch, thanks to jhb@, we have no any for more then a year. > > I had this additional change in my local branch, what do you think of it? > We > should probably keep it unless we bump DISK_VERSION and drop support for > older > disk structures. I think we could probably merge it to 10 along with your > change as well: > > --- //depot/vendor/freebsd/src/sys/geom/geom_disk.c > +++ //depot/user/jhb/cleanup/sys/geom/geom_disk.c > @@ -654,6 +654,13 @@ > dp->d_name, dp->d_unit); > return; > } > + if (dp->d_flags & DISKFLAG_RESERVED) { > + printf("WARNING: Attempt to add non-MPSAFE disk %s%d\n", > + dp->d_name, dp->d_unit); > + printf("WARNING: Ignoring disk %s%d\n", > + dp->d_name, dp->d_unit); > + return; > + } > KASSERT(dp->d_strategy != NULL, ("disk_create need d_strategy")); > KASSERT(dp->d_name != NULL, ("disk_create need d_name")); > KASSERT(*dp->d_name != 0, ("disk_create need d_name")); > --- //depot/vendor/freebsd/src/sys/geom/geom_disk.h > +++ //depot/user/jhb/cleanup/sys/geom/geom_disk.h > @@ -102,6 +102,7 @@ > void *d_drv1; > }; > > +#define DISKFLAG_RESERVED 0x1 /* Was NEEDSGIANT */ > #define DISKFLAG_OPEN 0x2 > #define DISKFLAG_CANDELETE 0x4 > #define DISKFLAG_CANFLUSHCACHE 0x8 > > -- > John Baldwin > From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 18:55:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 25E878F0; Tue, 22 Oct 2013 18:55:53 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EE6B02F7C; Tue, 22 Oct 2013 18:55:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MItqWZ088926; Tue, 22 Oct 2013 18:55:52 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MItqPg088924; Tue, 22 Oct 2013 18:55:52 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201310221855.r9MItqPg088924@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 22 Oct 2013 18:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256923 - head/usr.sbin/portsnap/portsnap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 18:55:53 -0000 Author: gavin Date: Tue Oct 22 18:55:52 2013 New Revision: 256923 URL: http://svnweb.freebsd.org/changeset/base/256923 Log: Rename the "alfred" command to "auto", and document it. Retain support for "portsnap alfred" for now. Discussed: many times, most recently on svn-src-all MFC after: 1 week Modified: head/usr.sbin/portsnap/portsnap/portsnap.8 head/usr.sbin/portsnap/portsnap/portsnap.sh Modified: head/usr.sbin/portsnap/portsnap/portsnap.8 ============================================================================== --- head/usr.sbin/portsnap/portsnap/portsnap.8 Tue Oct 22 18:39:43 2013 (r256922) +++ head/usr.sbin/portsnap/portsnap/portsnap.8 Tue Oct 22 18:55:52 2013 (r256923) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 14, 2012 +.Dd October 22, 2013 .Dt PORTSNAP 8 .Os FreeBSD .Sh NAME @@ -161,6 +161,18 @@ or commands. Again, note that in the parts of the ports tree which are being updated, any local changes or additions will be removed. +.It auto +Run +.Cm fetch +or +.Cm cron +depending on whether stdin is a terminal; then run +.Cm update +or +.Cm extract +depending on whether +.Ar portsdir +exists. .El .Sh TIPS .Bl -bullet Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh ============================================================================== --- head/usr.sbin/portsnap/portsnap/portsnap.sh Tue Oct 22 18:39:43 2013 (r256922) +++ head/usr.sbin/portsnap/portsnap/portsnap.sh Tue Oct 22 18:55:52 2013 (r256923) @@ -61,6 +61,8 @@ Commands: files and directories. update -- Update ports tree to match current snapshot, replacing files and directories which have changed. + auto -- Fetch updates, and either extract a new ports tree or + update an existing tree. EOF exit 0 } @@ -147,12 +149,15 @@ parse_cmdline() { if [ ! -z "${SERVERNAME}" ]; then usage; fi shift; SERVERNAME="$1" ;; - cron | extract | fetch | update | alfred) + cron | extract | fetch | update | auto) COMMANDS="${COMMANDS} $1" ;; up) COMMANDS="${COMMANDS} update" ;; + alfred) + COMMANDS="${COMMANDS} auto" + ;; *) if [ $# -gt 1 ]; then usage; fi if echo ${COMMANDS} | grep -vq extract; then @@ -1104,10 +1109,10 @@ cmd_update() { update_run || exit 1 } -# Alfred command. Run 'fetch' or 'cron' depending on +# Auto command. Run 'fetch' or 'cron' depending on # whether stdin is a terminal; then run 'update' or # 'extract' depending on whether ${PORTSDIR} exists. -cmd_alfred() { +cmd_auto() { if [ "${INTERACTIVE}" = "YES" ]; then cmd_fetch else From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 19:01:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 29588AF5; Tue, 22 Oct 2013 19:01:17 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-ee0-x22a.google.com (mail-ee0-x22a.google.com [IPv6:2a00:1450:4013:c00::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 47F842FE1; Tue, 22 Oct 2013 19:01:16 +0000 (UTC) Received: by mail-ee0-f42.google.com with SMTP id b45so4706824eek.15 for ; Tue, 22 Oct 2013 12:01:14 -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=AefCGAm1VV3xz/zGPmrue3o/N5lXnuc98op6klhhiPU=; b=d7lg3YB1t+h3vsvuzi29yhCxugH5fNpwYsz7xS42qMvrnDbIwo5+Y5qz/l5SmG3FRh Bf8lMPUGHFKbMI43p9NZudZ3iqU7UxbCEXvoLkupt9PJDat3vvmSN6D4oGuE+m8as8Ak K9kmOaeBlaYbL7WDZBaPNXcOLEo8zXqV3QAjcvkfAk6DQRNm58O9r/ASh2QoqT3COkQg gw+DN6EhSHKPiWWr19ss2mXi1Id0cbFX1rE2w+5832VyQNDKdKgGjBheab8OYRr0JCSl g7365urUMdpxkNIDP+qvtX36SqfYrDb84NvhLEVLcNRLQ50BUQvbUI0pxG/IZe75ncDx g+Cg== X-Received: by 10.15.24.68 with SMTP id i44mr1606034eeu.87.1382468474649; Tue, 22 Oct 2013 12:01:14 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([178.137.150.35]) by mx.google.com with ESMTPSA id w6sm49593124eeo.12.2013.10.22.12.01.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Oct 2013 12:01:13 -0700 (PDT) Sender: Alexander Motin Message-ID: <5266CB77.7080001@FreeBSD.org> Date: Tue, 22 Oct 2013 22:01:11 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130616 Thunderbird/17.0.6 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r256884 - in head: share/man/man9 sys/geom References: <201310221021.r9MALLhP097274@svn.freebsd.org> <201310221447.35676.jhb@freebsd.org> In-Reply-To: <201310221447.35676.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 19:01:17 -0000 On 22.10.2013 21:47, John Baldwin wrote: > On Tuesday, October 22, 2013 6:21:21 am Alexander Motin wrote: >> Author: mav >> Date: Tue Oct 22 10:21:20 2013 >> New Revision: 256884 >> URL: http://svnweb.freebsd.org/changeset/base/256884 >> >> Log: >> Remove Giant-locked drivers support (DISKFLAG_NEEDSGIANT flag) from disk(9). >> >> Since at least FreeBSD 7 we had only four of them in the base tree, and >> in head branch, thanks to jhb@, we have no any for more then a year. > > I had this additional change in my local branch, what do you think of it? We > should probably keep it unless we bump DISK_VERSION and drop support for older > disk structures. I think we could probably merge it to 10 along with your > change as well: It looks good to me, while I don't know how much useful can it be. I am not sure how many old binary drivers are there and how many of them survive switch from earlier FreeBSD versions to 10.x. But since it cost almost nothing I have no objections. > --- //depot/vendor/freebsd/src/sys/geom/geom_disk.c > +++ //depot/user/jhb/cleanup/sys/geom/geom_disk.c > @@ -654,6 +654,13 @@ > dp->d_name, dp->d_unit); > return; > } > + if (dp->d_flags & DISKFLAG_RESERVED) { > + printf("WARNING: Attempt to add non-MPSAFE disk %s%d\n", > + dp->d_name, dp->d_unit); > + printf("WARNING: Ignoring disk %s%d\n", > + dp->d_name, dp->d_unit); > + return; > + } > KASSERT(dp->d_strategy != NULL, ("disk_create need d_strategy")); > KASSERT(dp->d_name != NULL, ("disk_create need d_name")); > KASSERT(*dp->d_name != 0, ("disk_create need d_name")); > --- //depot/vendor/freebsd/src/sys/geom/geom_disk.h > +++ //depot/user/jhb/cleanup/sys/geom/geom_disk.h > @@ -102,6 +102,7 @@ > void *d_drv1; > }; > > +#define DISKFLAG_RESERVED 0x1 /* Was NEEDSGIANT */ > #define DISKFLAG_OPEN 0x2 > #define DISKFLAG_CANDELETE 0x4 > #define DISKFLAG_CANFLUSHCACHE 0x8 > -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 19:49:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BF81F956; Tue, 22 Oct 2013 19:49:19 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ABCB0231A; Tue, 22 Oct 2013 19:49:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MJnJkZ015297; Tue, 22 Oct 2013 19:49:19 GMT (envelope-from ambrisko@svn.freebsd.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MJnJIt015296; Tue, 22 Oct 2013 19:49:19 GMT (envelope-from ambrisko@svn.freebsd.org) Message-Id: <201310221949.r9MJnJIt015296@svn.freebsd.org> From: Doug Ambrisko Date: Tue, 22 Oct 2013 19:49:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256924 - stable/9/sys/dev/mfi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 19:49:19 -0000 Author: ambrisko Date: Tue Oct 22 19:49:19 2013 New Revision: 256924 URL: http://svnweb.freebsd.org/changeset/base/256924 Log: MFC r255869: Add PCI device ID for MegaRAID Invader cards. This was the only change needed to make it work on my card. Modified: stable/9/sys/dev/mfi/mfi_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mfi/mfi_pci.c ============================================================================== --- stable/9/sys/dev/mfi/mfi_pci.c Tue Oct 22 18:55:52 2013 (r256923) +++ stable/9/sys/dev/mfi/mfi_pci.c Tue Oct 22 19:49:19 2013 (r256924) @@ -131,6 +131,7 @@ struct mfi_ident { {0x1000, 0x005b, 0x8086, 0x9265, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Intel (R) RAID Controller RS25DB080"}, {0x1000, 0x005b, 0x8086, 0x9285, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Intel (R) RAID Controller RS25NB008"}, {0x1000, 0x005b, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "ThunderBolt"}, + {0x1000, 0x005d, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Invader"}, {0x1000, 0x0060, 0x1028, 0xffff, MFI_FLAGS_1078, "Dell PERC 6"}, {0x1000, 0x0060, 0xffff, 0xffff, MFI_FLAGS_1078, "LSI MegaSAS 1078"}, {0x1000, 0x0071, 0xffff, 0xffff, MFI_FLAGS_SKINNY, "Drake Skinny"}, From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 19:53:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 737B3BB8; Tue, 22 Oct 2013 19:53:53 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 60E46236B; Tue, 22 Oct 2013 19:53:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MJrrjw018183; Tue, 22 Oct 2013 19:53:53 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MJrrFl018182; Tue, 22 Oct 2013 19:53:53 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201310221953.r9MJrrFl018182@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 22 Oct 2013 19:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256925 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 19:53:53 -0000 Author: tijl Date: Tue Oct 22 19:53:52 2013 New Revision: 256925 URL: http://svnweb.freebsd.org/changeset/base/256925 Log: Add a dummy statement to the beginning of the pthread_cleanup_pop() macro to allow a call of the macro to be labelled as in: label: pthread_cleanup_pop(); Reviewed by: imp MFC after: 3 days Modified: head/include/pthread.h Modified: head/include/pthread.h ============================================================================== --- head/include/pthread.h Tue Oct 22 19:49:19 2013 (r256924) +++ head/include/pthread.h Tue Oct 22 19:53:52 2013 (r256925) @@ -175,6 +175,7 @@ int pthread_barrierattr_setpshared(pthr { #define pthread_cleanup_pop(execute) \ + (void)0; \ } \ __pthread_cleanup_pop_imp(execute); \ } From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 19:55:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EC58ECFF; Tue, 22 Oct 2013 19:55:04 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D86E5237A; Tue, 22 Oct 2013 19:55:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MJt4uQ018427; Tue, 22 Oct 2013 19:55:04 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MJt4BC018426; Tue, 22 Oct 2013 19:55:04 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310221955.r9MJt4BC018426@svn.freebsd.org> From: Peter Grehan Date: Tue, 22 Oct 2013 19:55:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256926 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 19:55:05 -0000 Author: grehan Date: Tue Oct 22 19:55:04 2013 New Revision: 256926 URL: http://svnweb.freebsd.org/changeset/base/256926 Log: Fix AHCI ATAPI emulation when backed with /dev/cd0 - remove assumption that the backing file/device had 512-byte sectors - fix incorrect iovec size variable that would result in a buffer overrun when an o/s issued an i/o request with more s/g elements than the blockif api Reviewed by: Zhixiang Yu (zxyu.core@gmail.com) MFC after: 3 days Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Tue Oct 22 19:53:52 2013 (r256925) +++ head/usr.sbin/bhyve/pci_ahci.c Tue Oct 22 19:55:04 2013 (r256926) @@ -663,8 +663,7 @@ atapi_read_capacity(struct ahci_port *p, uint8_t buf[8]; uint64_t sectors; - sectors = blockif_size(p->bctx) / blockif_sectsz(p->bctx); - sectors >>= 2; + sectors = blockif_size(p->bctx) / 2048; be32enc(buf, sectors - 1); be32enc(buf + 4, 2048); cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; @@ -908,9 +907,9 @@ atapi_read(struct ahci_port *p, int slot /* * Build up the iovec based on the prdt */ - for (i = 0; i < hdr->prdtl; i++) { + for (i = 0; i < iovcnt; i++) { breq->br_iov[i].iov_base = paddr_guest2host(ahci_ctx(sc), - prdt->dba, prdt->dbc + 1); + prdt->dba, prdt->dbc + 1); breq->br_iov[i].iov_len = prdt->dbc + 1; aior->done += (prdt->dbc + 1); prdt++; From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 20:10:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 05CD54F7; Tue, 22 Oct 2013 20:10:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E61D12485; Tue, 22 Oct 2013 20:10:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MKAcQs024222; Tue, 22 Oct 2013 20:10:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MKAc8j024220; Tue, 22 Oct 2013 20:10:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201310222010.r9MKAc8j024220@svn.freebsd.org> From: John Baldwin Date: Tue, 22 Oct 2013 20:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256927 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 20:10:39 -0000 Author: jhb Date: Tue Oct 22 20:10:38 2013 New Revision: 256927 URL: http://svnweb.freebsd.org/changeset/base/256927 Log: Add a manpage for the getenv() family of functions in the kernel. Added: head/share/man/man9/getenv.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Oct 22 19:55:04 2013 (r256926) +++ head/share/man/man9/Makefile Tue Oct 22 20:10:38 2013 (r256927) @@ -118,6 +118,7 @@ MAN= accept_filter.9 \ g_consumer.9 \ g_data.9 \ get_cyclecount.9 \ + getenv.9 \ getnewvnode.9 \ g_event.9 \ g_geom.9 \ @@ -677,6 +678,14 @@ MLINKS+=g_consumer.9 g_destroy_consumer. g_consumer.9 g_new_consumer.9 MLINKS+=g_data.9 g_read_data.9 \ g_data.9 g_write_data.9 +MLINKS+=getenv.9 freeenv.9 \ + getenv.9 getenv_int.9 \ + getenv.9 getenv_long.9 \ + getenv.9 getenv_string.9 \ + getenv.9 getenv_quad.9 \ + getenv.9 getenv_uint.9 \ + getenv.9 getenv_ulong.9 \ + getenv.9 testenv.9 MLINKS+=g_event.9 g_cancel_event.9 \ g_event.9 g_post_event.9 \ g_event.9 g_waitfor_event.9 Added: head/share/man/man9/getenv.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/getenv.9 Tue Oct 22 20:10:38 2013 (r256927) @@ -0,0 +1,210 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2013 Advanced Computing Technologies LLC +.\" Written by: John H. Baldwin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 22, 2013 +.Dt getenv 9 +.Os +.Sh NAME +.Nm freeenv , +.Nm getenv , +.Nm getenv_int , +.Nm getenv_long , +.Nm getenv_string , +.Nm getenv_quad , +.Nm getenv_uint , +.Nm getenv_ulong , +.Nm setenv , +.Nm testenv , +.Nm unsetenv +.Nd kernel environment variable functions +.Sh SYNOPSIS +.In sys/param.h +.In sys/systm.h +.Ft void +.Fn freeenv "char *env" +.Ft char * +.Fn getenv "const char *name" +.Ft int +.Fn getenv_int "const char *name" "int *data" +.Ft int +.Fn getenv_long "const char *name" "long *data" +.Ft int +.Fn getenv_string "const char *name" "char *data" "int size" +.Ft int +.Fn getenv_quad "const char *name" "quad_t *data" +.Ft int +.Fn getenv_uint "const char *name" "unsigned int *data" +.Ft int +.Fn getenv_ulong "const char *name" "unsigned long *data" +.Ft int +.Fn setenv "const char *name" "const char *value" +.Ft int +.Fn testenv "const char *name" +.Ft int +.Fn unsetenv "const char *name" +.Sh DESCRIPTION +These functions set, unset, fetch, and parse variables from the kernel's +environment. +.Pp +The +.Fn getenv +function obtains the current value of the kernel environment variable +.Fa name +and returns a pointer to the string value. +The caller should not modify the string pointed to by the return value. +.Pp +The +.Fn getenv +function may allocate temporary storage, +so the +.Fn freeenv +function must be called to release any allocated resources when the value +returned by +.Fn getenv +is no longer needed. +The +.Fa env +argument passed to +.Fn freeenv +is the pointer returned by the earlier call to +.Fn getenv . +.Pp +The +.Fn setenv +function inserts or resets the kernel environment variable +.Fa name +to +.Fa value . +If the variable +.Fa name +already exists, +its value is replaced. +This function can fail if an internal limit on the number of environment +variables is exceeded. +.Pp +The +.Fn unsetenv +function deletes the kernel environment variable +.Fa name . +.Pp +The +.Fn testenv +function is used to determine if a kernel environment variable exists. +It returns a non-zero value if the variable +.Fa name +exists and zero if it does not. +.Pp +The +.Fn getenv_int , +.Fn getenv_long , +.Fn getenv_quad , +.Fn getenv_uint , +and +.Fn getenv_ulong +functions look for a kernel environment variable +.Fa name +and parse it as a signed integer, +long integer, +signed 64-bit integer, +unsigned integer, +or an unsigned long integer, +respectively. +These functions fail and return zero if +.Fa name +does not exist or if any invalid characters are present in its value. +On success, +these function store the parsed value in the integer variable pointed to +by +.Fa data . +If the parsed value overflows the integer type, +a truncated value is stored in +.Fa data +and zero is returned. +If the value begins with a prefix of +.Dq 0x +it is interpreted as hexadecimal. +If it begins with a prefix of +.Dq 0 +it is interpreted as octal. +Otherwise, +the value is interpreted as decimal. +The value may contain a single character suffix specifying a unit for +the value. +The interpreted value is multipled by the unit's magnitude before being returned. +The following unit suffixes are supported: +.Bl -column -offset indent ".Sy Unit" ".Sy Magnitude" +.It Sy Unit Ta Sy Magnitude +.It k Ta 2^10 +.It m Ta 2^20 +.It g Ta 2^30 +.It t Ta 2^40 +.El +.Pp +The +.Fn getenv_string +function stores a copy of the kernel environment variable +.Fa name +in the buffer described by +.Fa data +and +.Fa size. +If the variable does not exist, +zero is returned. +If the variable exists, +up to +.Fa size - 1 +characters of it's value are copied to the buffer pointed to by +.Fa data +followed by a null character and a non-zero value is returned. +.Sh RETURN VALUES +The +.Fn getenv +function returns a pointer to an environment variable's value on success or +.Dv NULL +if the variable does not exist. +.Pp +The +.Fn setenv +and +.Fn unsetenv +functions return zero on success and -1 on failure. +.Pp +The +.Fn testenv +function returns zero if the specified environment variable does not exist and +a non-zero value if it does exist. +The +.Fn getenv_int , +.Fn getenv_long , +.Fn getenv_string , +.Fn getenv_quad , +.Fn getenv_uint , +and +.Fn getenv_ulong +functions return a non-zero value on success and zero on failure. From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 20:50:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 07E70E6D; Tue, 22 Oct 2013 20:50:42 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E9BB2276F; Tue, 22 Oct 2013 20:50:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MKofv0041807; Tue, 22 Oct 2013 20:50:41 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MKoft6041806; Tue, 22 Oct 2013 20:50:41 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310222050.r9MKoft6041806@svn.freebsd.org> From: Brooks Davis Date: Tue, 22 Oct 2013 20:50:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256931 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 20:50:42 -0000 Author: brooks Date: Tue Oct 22 20:50:41 2013 New Revision: 256931 URL: http://svnweb.freebsd.org/changeset/base/256931 Log: Enable ATSE_CFI_HACK in BERI configs, stable MAC addresses are useful. MFC after: 3 days Sponsored by: DARPA/AFRL Modified: head/sys/mips/conf/BERI_DE4_BASE Modified: head/sys/mips/conf/BERI_DE4_BASE ============================================================================== --- head/sys/mips/conf/BERI_DE4_BASE Tue Oct 22 20:31:59 2013 (r256930) +++ head/sys/mips/conf/BERI_DE4_BASE Tue Oct 22 20:50:41 2013 (r256931) @@ -32,6 +32,7 @@ device bpf device cfi device cfid options CFI_SUPPORT_STRATAFLASH +options ATSE_CFI_HACK device sc device uart From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 20:57:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A0D22414; Tue, 22 Oct 2013 20:57:25 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 74CE627F0; Tue, 22 Oct 2013 20:57:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MKvPWx043043; Tue, 22 Oct 2013 20:57:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MKvPuS043008; Tue, 22 Oct 2013 20:57:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310222057.r9MKvPuS043008@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 22 Oct 2013 20:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256932 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 20:57:25 -0000 Author: nwhitehorn Date: Tue Oct 22 20:57:24 2013 New Revision: 256932 URL: http://svnweb.freebsd.org/changeset/base/256932 Log: Add a new function (OF_getencprop()) that undoes the transformation applied by encode-int. Specifically, it takes a set of 32-bit cell values and changes them to host byte order. Most non-string instances of OF_getprop() should be using this function, which is a no-op on big-endian platforms. Modified: head/sys/dev/ofw/openfirm.c head/sys/dev/ofw/openfirm.h Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Tue Oct 22 20:50:41 2013 (r256931) +++ head/sys/dev/ofw/openfirm.c Tue Oct 22 20:57:24 2013 (r256932) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -280,6 +281,21 @@ OF_getprop(phandle_t package, const char return (OFW_GETPROP(ofw_obj, package, propname, buf, buflen)); } +ssize_t +OF_getencprop(phandle_t node, const char *propname, pcell_t *buf, size_t len) +{ + ssize_t retval; + int i; + + KASSERT(len % 4 == 0, "Need a multiple of 4 bytes"); + + retval = OF_getprop(node, propname, buf, len); + for (i = 0; i < len/4; i++) + buf[i] = be32toh(buf[i]); + + return (retval); +} + /* * Recursively search the node and its parent for the given property, working * downward from the node to the device tree root. Returns the value of the Modified: head/sys/dev/ofw/openfirm.h ============================================================================== --- head/sys/dev/ofw/openfirm.h Tue Oct 22 20:50:41 2013 (r256931) +++ head/sys/dev/ofw/openfirm.h Tue Oct 22 20:57:24 2013 (r256932) @@ -105,6 +105,8 @@ phandle_t OF_parent(phandle_t node); ssize_t OF_getproplen(phandle_t node, const char *propname); ssize_t OF_getprop(phandle_t node, const char *propname, void *buf, size_t len); +ssize_t OF_getencprop(phandle_t node, const char *prop, pcell_t *buf, + size_t len); /* Same as getprop, but maintains endianness */ int OF_hasprop(phandle_t node, const char *propname); ssize_t OF_searchprop(phandle_t node, const char *propname, void *buf, size_t len); From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 21:06:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2206CAC7; Tue, 22 Oct 2013 21:06:28 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0E8E628C7; Tue, 22 Oct 2013 21:06:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9ML6RAl048213; Tue, 22 Oct 2013 21:06:27 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9ML6Rhn048212; Tue, 22 Oct 2013 21:06:27 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310222106.r9ML6Rhn048212@svn.freebsd.org> From: Brooks Davis Date: Tue, 22 Oct 2013 21:06:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256934 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 21:06:28 -0000 Author: brooks Date: Tue Oct 22 21:06:27 2013 New Revision: 256934 URL: http://svnweb.freebsd.org/changeset/base/256934 Log: MFP4: Change 221534 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/27 16:05:30 FreeBSD/mips stores page-table entries in a near-identical format to MIPS TLB entries -- only it overrides certain "reserved" bits in the MIPS-defined EntryLo register to hold software-defined bits (swbits) to avoid significantly increasing the page table memory footprint. On n32 and n64, these bits were (a) colliding with MIPS64r2 physical memory extensions and (b) being improperly cleared. Attempt to fix both of these problems by pushing swbits further along 64-bit EntryLo registers into the reserved space, and improving consistency between C-based and assembly-based clearing of swbits -- in particular, to use the same definition. This should stop swbits from leaking into TLB entries -- while ignored by most current MIPS hardware, this would cause a problem with (much) larger physical memory sizes, and also leads to confusing hardware-level tracing as physical addresses contain unexpected (and inconsistent) higher bits. Discussed with: imp, jmallett MFC after: 3 days Sponsored by: DARPA/AFRL Modified: head/sys/mips/include/pte.h Modified: head/sys/mips/include/pte.h ============================================================================== --- head/sys/mips/include/pte.h Tue Oct 22 20:58:23 2013 (r256933) +++ head/sys/mips/include/pte.h Tue Oct 22 21:06:27 2013 (r256934) @@ -56,16 +56,26 @@ typedef pt_entry_t *pd_entry_t; #define TLBMASK_MASK ((PAGE_MASK >> TLBMASK_SHIFT) << TLBMASK_SHIFT) /* - * PFN for EntryLo register. Upper bits are 0, which is to say that - * bit 28 is the last hardware bit; Bits 29 and upwards (EntryLo is - * 64 bit though it can be referred to in 32-bits providing 3 software - * bits safely. We use it as 64 bits to get many software bits, and - * god knows what else.) are unacknowledged by hardware. They may be - * written as anything, but otherwise they have as much meaning as - * other 0 fields. + * FreeBSD/mips page-table entries take a near-identical format to MIPS TLB + * entries, each consisting of two 32-bit or 64-bit values ("EntryHi" and + * "EntryLo"). MIPS4k and MIPS64 both define certain bits in TLB entries as + * reserved, and these must be zero-filled by software. We overload these + * bits in PTE entries to hold PTE_ flags such as RO, W, and MANAGED. + * However, we must mask these out when writing to TLB entries to ensure that + * they do not become visible to hardware -- especially on MIPS64r2 which has + * an extended physical memory space. + * + * When using n64 and n32, shift software-defined bits into the MIPS64r2 + * reserved range, which runs from bit 55 ... 63. In other configurations + * (32-bit MIPS4k and compatible), shift them out to bits 29 ... 31. + * + * NOTE: This means that for 32-bit use of CP0, we aren't able to set the top + * bit of PFN to a non-zero value, as software is using it! This physical + * memory size limit may not be sufficiently enforced elsewhere. */ #if defined(__mips_n64) || defined(__mips_n32) /* PHYSADDR_64_BIT */ -#define TLBLO_SWBITS_SHIFT (34) +#define TLBLO_SWBITS_SHIFT (55) +#define TLBLO_SWBITS_CLEAR_SHIFT (9) #define TLBLO_PFN_MASK 0x3FFFFFFC0ULL #else #define TLBLO_SWBITS_SHIFT (29) @@ -133,6 +143,9 @@ typedef pt_entry_t *pd_entry_t; * listen to requests to write to it. * W: Wired. ??? * MANAGED:Managed. This PTE maps a managed page. + * + * These bits should not be written into the TLB, so must first be masked out + * explicitly in C, or using CLEAR_PTE_SWBITS() in assembly. */ #define PTE_RO ((pt_entry_t)0x01 << TLBLO_SWBITS_SHIFT) #define PTE_W ((pt_entry_t)0x02 << TLBLO_SWBITS_SHIFT) @@ -162,7 +175,7 @@ typedef pt_entry_t *pd_entry_t; #define PTESIZE 4 #define PTE_L lw #define PTE_MTC0 mtc0 -#define CLEAR_PTE_SWBITS(r) sll r, 3; srl r, 3 /* remove 3 high bits */ +#define CLEAR_PTE_SWBITS(r) LONG_SLL r, TLBLO_SWBITS_CLEAR_SHIFT; LONG_SRL r, TLBLO_SWBITS_CLEAR_SHIFT /* remove swbits */ #endif /* defined(__mips_n64) || defined(__mips_n32) */ #if defined(__mips_n64) From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 21:08:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3E15DC2D; Tue, 22 Oct 2013 21:08:26 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2A87828DD; Tue, 22 Oct 2013 21:08:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9ML8QfN048618; Tue, 22 Oct 2013 21:08:26 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9ML8Pam048614; Tue, 22 Oct 2013 21:08:25 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310222108.r9ML8Pam048614@svn.freebsd.org> From: Brooks Davis Date: Tue, 22 Oct 2013 21:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256935 - in head/sys: conf mips/beri mips/include mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 21:08:26 -0000 Author: brooks Date: Tue Oct 22 21:08:25 2013 New Revision: 256935 URL: http://svnweb.freebsd.org/changeset/base/256935 Log: MFP4: Change 228019 by bz@bz_zenith on 2013/04/23 13:55:30 Add kernel side support for large TLB on BERI/CHERI. Modelled similar to NLM MFC after: 3 days Sponsored by: DAPRA/AFRL Modified: head/sys/conf/options.mips head/sys/mips/beri/std.beri head/sys/mips/include/cpufunc.h head/sys/mips/mips/cpu.c Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Tue Oct 22 21:06:27 2013 (r256934) +++ head/sys/conf/options.mips Tue Oct 22 21:08:25 2013 (r256935) @@ -81,6 +81,11 @@ OCTEON_VENDOR_GEFES opt_cvmx.h OCTEON_BOARD_CAPK_0100ND opt_cvmx.h # +# Options specific to the BERI platform. +# +BERI_LARGE_TLB opt_global.h + +# # Options that control the Atheros SoC peripherals # ARGE_DEBUG opt_arge.h Modified: head/sys/mips/beri/std.beri ============================================================================== --- head/sys/mips/beri/std.beri Tue Oct 22 21:06:27 2013 (r256934) +++ head/sys/mips/beri/std.beri Tue Oct 22 21:08:25 2013 (r256935) @@ -2,3 +2,5 @@ files "../beri/files.beri" cpu CPU_MIPS4KC + +options BERI_LARGE_TLB Modified: head/sys/mips/include/cpufunc.h ============================================================================== --- head/sys/mips/include/cpufunc.h Tue Oct 22 21:06:27 2013 (r256934) +++ head/sys/mips/include/cpufunc.h Tue Oct 22 21:08:25 2013 (r256935) @@ -242,8 +242,13 @@ MIPS_RW32_COP0_SEL(config3, MIPS_COP_0_C #ifdef CPU_CNMIPS MIPS_RW32_COP0_SEL(config4, MIPS_COP_0_CONFIG, 4); #endif -#ifdef CPU_NLM +#ifdef BERI_LARGE_TLB +MIPS_RW32_COP0_SEL(config5, MIPS_COP_0_CONFIG, 5); +#endif +#if defined(CPU_NLM) || defined(BERI_LARGE_TLB) MIPS_RW32_COP0_SEL(config6, MIPS_COP_0_CONFIG, 6); +#endif +#ifdef CPU_NLM MIPS_RW32_COP0_SEL(config7, MIPS_COP_0_CONFIG, 7); #endif MIPS_RW32_COP0(count, MIPS_COP_0_COUNT); Modified: head/sys/mips/mips/cpu.c ============================================================================== --- head/sys/mips/mips/cpu.c Tue Oct 22 21:06:27 2013 (r256934) +++ head/sys/mips/mips/cpu.c Tue Oct 22 21:08:25 2013 (r256935) @@ -99,17 +99,29 @@ mips_get_identity(struct mips_cpuinfo *c /* Learn TLB size and L1 cache geometry. */ cfg1 = mips_rd_config1(); -#ifndef CPU_NLM - cpuinfo->tlb_nentries = - ((cfg1 & MIPS_CONFIG1_TLBSZ_MASK) >> MIPS_CONFIG1_TLBSZ_SHIFT) + 1; -#else + +#if defined(CPU_NLM) /* Account for Extended TLB entries in XLP */ tmp = mips_rd_config6(); cpuinfo->tlb_nentries = ((tmp >> 16) & 0xffff) + 1; +#elif defined(BERI_LARGE_TLB) + /* Check if we support extended TLB entries and if so activate. */ + tmp = mips_rd_config5(); +#define BERI_CP5_LTLB_SUPPORTED 0x1 + if (tmp & BERI_CP5_LTLB_SUPPORTED) { + /* See how many extra TLB entries we have. */ + tmp = mips_rd_config6(); + cpuinfo->tlb_nentries = (tmp >> 16) + 1; + /* Activate the extended entries. */ + mips_wr_config6(tmp|0x4); + } else +#endif +#if !defined(CPU_NLM) + cpuinfo->tlb_nentries = + ((cfg1 & MIPS_CONFIG1_TLBSZ_MASK) >> MIPS_CONFIG1_TLBSZ_SHIFT) + 1; #endif - - /* Add extended TLB size information from config4. */ #if defined(CPU_CNMIPS) + /* Add extended TLB size information from config4. */ cfg4 = mips_rd_config4(); if ((cfg4 & MIPS_CONFIG4_MMUEXTDEF) == MIPS_CONFIG4_MMUEXTDEF_MMUSIZEEXT) cpuinfo->tlb_nentries += (cfg4 & MIPS_CONFIG4_MMUSIZEEXT) * 0x40; @@ -124,8 +136,8 @@ mips_get_identity(struct mips_cpuinfo *c 1 << (((cfg1 & MIPS_CONFIG1_IS_MASK) >> MIPS_CONFIG1_IS_SHIFT) + 6); } -#ifndef CPU_CNMIPS /* L1 data cache. */ +#ifndef CPU_CNMIPS tmp = (cfg1 & MIPS_CONFIG1_DL_MASK) >> MIPS_CONFIG1_DL_SHIFT; if (tmp != 0) { cpuinfo->l1.dc_linesize = 1 << (tmp + 1); From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 21:13:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1C138DE6; Tue, 22 Oct 2013 21:13:03 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0919E293F; Tue, 22 Oct 2013 21:13:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MLD26h051610; Tue, 22 Oct 2013 21:13:02 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MLD2hH051609; Tue, 22 Oct 2013 21:13:02 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310222113.r9MLD2hH051609@svn.freebsd.org> From: Brooks Davis Date: Tue, 22 Oct 2013 21:13:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256936 - head/sys/mips/beri X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 21:13:03 -0000 Author: brooks Date: Tue Oct 22 21:13:02 2013 New Revision: 256936 URL: http://svnweb.freebsd.org/changeset/base/256936 Log: Remove a bit of debugging output that slipped into r256911. MFC after: 3 days Sponsored by: DARPA/AFRL Modified: head/sys/mips/beri/beri_pic.c Modified: head/sys/mips/beri/beri_pic.c ============================================================================== --- head/sys/mips/beri/beri_pic.c Tue Oct 22 21:08:25 2013 (r256935) +++ head/sys/mips/beri/beri_pic.c Tue Oct 22 21:13:02 2013 (r256936) @@ -646,15 +646,9 @@ beripic_send_ipi(device_t ic, u_int tid) KASSERT(tid < sc->bp_nsoft, ("tid (%d) too large\n", tid)); - printf("sending ipi to %d soft intrs %jx\n", tid, - bus_space_read_8(sc->bp_read_bst, sc->bp_read_bsh, 8)); - bit = 1ULL << (tid % 64); bus_space_write_8(sc->bp_set_bst, sc->bp_set_bsh, (BP_FIRST_SOFT / 8) + (tid / 64), bit); - - printf("sent ipi to %d soft intrs %jx\n", tid, - bus_space_read_8(sc->bp_read_bst, sc->bp_read_bsh, 8)); } static void From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 21:16:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7A673290; Tue, 22 Oct 2013 21:16:58 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5811F296F; Tue, 22 Oct 2013 21:16:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MLGwpB052460; Tue, 22 Oct 2013 21:16:58 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MLGvls052455; Tue, 22 Oct 2013 21:16:57 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310222116.r9MLGvls052455@svn.freebsd.org> From: Brooks Davis Date: Tue, 22 Oct 2013 21:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256937 - in head/sys: conf mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 21:16:58 -0000 Author: brooks Date: Tue Oct 22 21:16:57 2013 New Revision: 256937 URL: http://svnweb.freebsd.org/changeset/base/256937 Log: MFP4: Change 231031 by brooks@brooks_zenith on 2013/07/11 16:22:08 Turn the unused and uncompilable MIPS_DISABLE_L1_CACHE define in cache.c into an option and when set force I- and D-cache line sizes to 0 (the latter part might be better as a tunable). Fix some casts in an #if 0'd bit of code which attempts to disable L1 cache ops when the cache is coherent. Sponsored by: DARPA/AFRL Modified: head/sys/conf/options.mips head/sys/mips/mips/cache.c head/sys/mips/mips/cpu.c Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Tue Oct 22 21:13:02 2013 (r256936) +++ head/sys/conf/options.mips Tue Oct 22 21:16:57 2013 (r256937) @@ -71,6 +71,11 @@ TICK_USE_MALTA_RTC opt_global.h MAXMEM opt_global.h # +# Manual override of cache config +# +MIPS_DISABLE_L1_CACHE opt_global.h + +# # Options that control the Cavium Simple Executive. # OCTEON_MODEL opt_cvmx.h Modified: head/sys/mips/mips/cache.c ============================================================================== --- head/sys/mips/mips/cache.c Tue Oct 22 21:13:02 2013 (r256936) +++ head/sys/mips/mips/cache.c Tue Oct 22 21:16:57 2013 (r256937) @@ -116,11 +116,9 @@ mips_config_cache(struct mips_cpuinfo * #ifdef MIPS_DISABLE_L1_CACHE case 0: - mips_cache_ops.mco_icache_sync_all = cache_noop; - mips_cache_ops.mco_icache_sync_range = - (void (*)(vaddr_t, vsize_t))cache_noop; - mips_cache_ops.mco_icache_sync_range_index = - (void (*)(vaddr_t, vsize_t))cache_noop; + mips_cache_ops.mco_icache_sync_all = (void (*)(void))cache_noop; + mips_cache_ops.mco_icache_sync_range = cache_noop; + mips_cache_ops.mco_icache_sync_range_index = cache_noop; break; #endif default: @@ -193,20 +191,16 @@ mips_config_cache(struct mips_cpuinfo * #endif #ifdef MIPS_DISABLE_L1_CACHE case 0: - mips_cache_ops.mco_pdcache_wbinv_all = cache_noop; - mips_cache_ops.mco_intern_pdcache_wbinv_all = cache_noop; - mips_cache_ops.mco_pdcache_wbinv_range = - (void (*)(vaddr_t, vsize_t))cache_noop; - mips_cache_ops.mco_pdcache_wbinv_range_index = - (void (*)(vaddr_t, vsize_t))cache_noop; + mips_cache_ops.mco_pdcache_wbinv_all = + mips_cache_ops.mco_intern_pdcache_wbinv_all = + (void (*)(void))cache_noop; + mips_cache_ops.mco_pdcache_wbinv_range = cache_noop; + mips_cache_ops.mco_pdcache_wbinv_range_index = cache_noop; mips_cache_ops.mco_intern_pdcache_wbinv_range_index = - (void (*)(vaddr_t, vsize_t))cache_noop; - mips_cache_ops.mco_pdcache_inv_range = - (void (*)(vaddr_t, vsize_t))cache_noop; - mips_cache_ops.mco_pdcache_wb_range = - (void (*)(vaddr_t, vsize_t))cache_noop; - mips_cache_ops.mco_intern_pdcache_wb_range = - (void (*)(vaddr_t, vsize_t))cache_noop; + cache_noop; + mips_cache_ops.mco_pdcache_inv_range = cache_noop; + mips_cache_ops.mco_pdcache_wb_range = cache_noop; + mips_cache_ops.mco_intern_pdcache_wb_range = cache_noop; break; #endif default: @@ -222,26 +216,22 @@ mips_config_cache(struct mips_cpuinfo * #ifdef CACHE_DEBUG printf(" Dcache is coherent\n"); #endif - mips_cache_ops.mco_pdcache_wbinv_all = cache_noop; - mips_cache_ops.mco_pdcache_wbinv_range = - (void (*)(vaddr_t, vsize_t))cache_noop; - mips_cache_ops.mco_pdcache_wbinv_range_index = - (void (*)(vaddr_t, vsize_t))cache_noop; - mips_cache_ops.mco_pdcache_inv_range = - (void (*)(vaddr_t, vsize_t))cache_noop; - mips_cache_ops.mco_pdcache_wb_range = - (void (*)(vaddr_t, vsize_t))cache_noop; + mips_cache_ops.mco_pdcache_wbinv_all = + (void (*)(void))cache_noop; + mips_cache_ops.mco_pdcache_wbinv_range = cache_noop; + mips_cache_ops.mco_pdcache_wbinv_range_index = cache_noop; + mips_cache_ops.mco_pdcache_inv_range = cache_noop; + mips_cache_ops.mco_pdcache_wb_range = cache_noop; } if (mips_cpu_flags & CPU_MIPS_I_D_CACHE_COHERENT) { #ifdef CACHE_DEBUG printf(" Icache is coherent against Dcache\n"); #endif mips_cache_ops.mco_intern_pdcache_wbinv_all = - cache_noop; + (void (*)(void))cache_noop; mips_cache_ops.mco_intern_pdcache_wbinv_range_index = - (void (*)(vaddr_t, vsize_t))cache_noop; - mips_cache_ops.mco_intern_pdcache_wb_range = - (void (*)(vaddr_t, vsize_t))cache_noop; + cache_noop; + mips_cache_ops.mco_intern_pdcache_wb_range = cache_noop; } #endif Modified: head/sys/mips/mips/cpu.c ============================================================================== --- head/sys/mips/mips/cpu.c Tue Oct 22 21:13:02 2013 (r256936) +++ head/sys/mips/mips/cpu.c Tue Oct 22 21:16:57 2013 (r256937) @@ -128,6 +128,9 @@ mips_get_identity(struct mips_cpuinfo *c #endif /* L1 instruction cache. */ +#ifdef MIPS_DISABLE_L1_CACHE + cpuinfo->l1.ic_linesize = 0; +#else tmp = (cfg1 & MIPS_CONFIG1_IL_MASK) >> MIPS_CONFIG1_IL_SHIFT; if (tmp != 0) { cpuinfo->l1.ic_linesize = 1 << (tmp + 1); @@ -135,8 +138,12 @@ mips_get_identity(struct mips_cpuinfo *c cpuinfo->l1.ic_nsets = 1 << (((cfg1 & MIPS_CONFIG1_IS_MASK) >> MIPS_CONFIG1_IS_SHIFT) + 6); } +#endif /* L1 data cache. */ +#ifdef MIPS_DISABLE_L1_CACHE + cpuinfo->l1.dc_linesize = 0; +#else #ifndef CPU_CNMIPS tmp = (cfg1 & MIPS_CONFIG1_DL_MASK) >> MIPS_CONFIG1_DL_SHIFT; if (tmp != 0) { @@ -173,6 +180,7 @@ mips_get_identity(struct mips_cpuinfo *c /* All Octeon models use 128 byte line size. */ cpuinfo->l1.dc_linesize = 128; #endif +#endif cpuinfo->l1.ic_size = cpuinfo->l1.ic_linesize * cpuinfo->l1.ic_nsets * cpuinfo->l1.ic_nways; From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 21:20:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 05F923EF; Tue, 22 Oct 2013 21:20:06 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CD0B32987; Tue, 22 Oct 2013 21:20:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MLK5HR053017; Tue, 22 Oct 2013 21:20:05 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MLK591053015; Tue, 22 Oct 2013 21:20:05 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310222120.r9MLK591053015@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 22 Oct 2013 21:20:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256938 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 21:20:06 -0000 Author: nwhitehorn Date: Tue Oct 22 21:20:05 2013 New Revision: 256938 URL: http://svnweb.freebsd.org/changeset/base/256938 Log: A few other common cases for encode-int decoding: OF_getencprop_alloc() and OF_searchencprop(). I thought about using the element size parameter to OF_getprop_alloc() to do endian-switching automatically, but it breaks use with structs and a *lot* of FDT code (which can hopefully be moved to these new APIs). MFC after: 2 weeks Modified: head/sys/dev/ofw/openfirm.c head/sys/dev/ofw/openfirm.h Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Tue Oct 22 21:16:57 2013 (r256937) +++ head/sys/dev/ofw/openfirm.c Tue Oct 22 21:20:05 2013 (r256938) @@ -312,6 +312,17 @@ OF_searchprop(phandle_t node, const char return (-1); } +ssize_t +OF_searchencprop(phandle_t node, const char *propname, void *buf, size_t len) +{ + ssize_t rv; + + for (; node != 0; node = OF_parent(node)) + if ((rv = OF_getencprop(node, propname, buf, len)) != -1) + return (rv); + return (-1); +} + /* * Store the value of a property of a package into newly allocated memory * (using the M_OFWPROP malloc pool and M_WAITOK). elsz is the size of a @@ -336,6 +347,26 @@ OF_getprop_alloc(phandle_t package, cons return (len / elsz); } +ssize_t +OF_getencprop_alloc(phandle_t package, const char *name, int elsz, void **buf) +{ + ssize_t retval; + pcell_t *cell; + int i; + + KASSERT(elsz % 4 == 0, "Need a multiple of 4 bytes"); + + retval = OF_getprop_alloc(package, name, elsz, buf); + if (retval == -1) + return (retval); + + cell = *buf; + for (i = 0; i < retval*elsz/4; i++) + cell[i] = be32toh(cell[i]); + + return (retval); +} + /* Get the next property of a package. */ int OF_nextprop(phandle_t package, const char *previous, char *buf, size_t size) Modified: head/sys/dev/ofw/openfirm.h ============================================================================== --- head/sys/dev/ofw/openfirm.h Tue Oct 22 21:16:57 2013 (r256937) +++ head/sys/dev/ofw/openfirm.h Tue Oct 22 21:20:05 2013 (r256938) @@ -110,8 +110,12 @@ ssize_t OF_getencprop(phandle_t node, c int OF_hasprop(phandle_t node, const char *propname); ssize_t OF_searchprop(phandle_t node, const char *propname, void *buf, size_t len); +ssize_t OF_searchencprop(phandle_t node, const char *propname, + void *buf, size_t len); ssize_t OF_getprop_alloc(phandle_t node, const char *propname, int elsz, void **buf); +ssize_t OF_getencprop_alloc(phandle_t node, const char *propname, + int elsz, void **buf); int OF_nextprop(phandle_t node, const char *propname, char *buf, size_t len); int OF_setprop(phandle_t node, const char *name, const void *buf, From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 21:27:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CD4F55FD; Tue, 22 Oct 2013 21:27:22 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B6E1929E7; Tue, 22 Oct 2013 21:27:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MLRMAH056139; Tue, 22 Oct 2013 21:27:22 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MLRM1H056138; Tue, 22 Oct 2013 21:27:22 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310222127.r9MLRM1H056138@svn.freebsd.org> From: Brooks Davis Date: Tue, 22 Oct 2013 21:27:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256939 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 21:27:22 -0000 Author: brooks Date: Tue Oct 22 21:27:22 2013 New Revision: 256939 URL: http://svnweb.freebsd.org/changeset/base/256939 Log: MFP4: Change 221767 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/02/05 14:18:53 When printing out information on a TLB MOD exception for a user process (e.g., an attempt to write to a read-only page), report it as a "write" in the console message, rather than "unknown". Change 221768 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/02/05 14:28:00 Fix post-compile but pre-commit typo in last changeset. MFC after: 3 days Sponsored by: DARPA/AFRL Modified: head/sys/mips/mips/trap.c Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Tue Oct 22 21:20:05 2013 (r256938) +++ head/sys/mips/mips/trap.c Tue Oct 22 21:27:22 2013 (r256939) @@ -1520,6 +1520,7 @@ log_bad_page_fault(char *msg, struct tra printf("cpuid = %d\n", PCPU_GET(cpuid)); #endif switch (trap_type) { + case T_TLB_MOD: case T_TLB_ST_MISS: case T_ADDR_ERR_ST: read_or_write = "write"; From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 21:32:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A664E853; Tue, 22 Oct 2013 21:32:29 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 786F42A32; Tue, 22 Oct 2013 21:32:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MLWTA8059145; Tue, 22 Oct 2013 21:32:29 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MLWTGo059142; Tue, 22 Oct 2013 21:32:29 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201310222132.r9MLWTGo059142@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 22 Oct 2013 21:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256940 - head/sys/boot/i386/libi386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 21:32:29 -0000 Author: jkim Date: Tue Oct 22 21:32:28 2013 New Revision: 256940 URL: http://svnweb.freebsd.org/changeset/base/256940 Log: Allow users to set UUID in network byte order regardless of SMBIOS version. Define BOOT_NETWORK_ENDIAN_UUID in make.conf(5) to enable this feature. Modified: head/sys/boot/i386/libi386/Makefile head/sys/boot/i386/libi386/smbios.c Modified: head/sys/boot/i386/libi386/Makefile ============================================================================== --- head/sys/boot/i386/libi386/Makefile Tue Oct 22 21:27:22 2013 (r256939) +++ head/sys/boot/i386/libi386/Makefile Tue Oct 22 21:32:28 2013 (r256940) @@ -36,6 +36,9 @@ CFLAGS+= -DSMBIOS_SERIAL_NUMBERS .if defined(BOOT_LITTLE_ENDIAN_UUID) # Use little-endian UUID format as defined in SMBIOS 2.6. CFLAGS+= -DSMBIOS_LITTLE_ENDIAN_UUID +.elif defined(BOOT_NETWORK_ENDIAN_UUID) +# Use network-endian UUID format for backward compatibility. +CFLAGS+= -DSMBIOS_NETWORK_ENDIAN_UUID .endif .endif Modified: head/sys/boot/i386/libi386/smbios.c ============================================================================== --- head/sys/boot/i386/libi386/smbios.c Tue Oct 22 21:27:22 2013 (r256939) +++ head/sys/boot/i386/libi386/smbios.c Tue Oct 22 21:32:28 2013 (r256940) @@ -122,7 +122,7 @@ static void smbios_setuuid(const char *name, const caddr_t addr, const int ver) { char uuid[37]; - int i, ones, zeros; + int byteorder, i, ones, zeros; UUID_TYPE n; uint32_t f1; uint16_t f2, f3; @@ -152,14 +152,18 @@ smbios_setuuid(const char *name, const c * Note: We use network byte order for backward compatibility * unless SMBIOS version is 2.6+ or little-endian is forced. */ -#ifndef SMBIOS_LITTLE_ENDIAN_UUID - if (ver < 0x0206) { +#if defined(SMBIOS_LITTLE_ENDIAN_UUID) + byteorder = LITTLE_ENDIAN; +#elif defined(SMBIOS_NETWORK_ENDIAN_UUID) + byteorder = BIG_ENDIAN; +#else + byteorder = ver < 0x0206 ? BIG_ENDIAN : LITTLE_ENDIAN; +#endif + if (byteorder != LITTLE_ENDIAN) { f1 = ntohl(SMBIOS_GET32(addr, 0)); f2 = ntohs(SMBIOS_GET16(addr, 4)); f3 = ntohs(SMBIOS_GET16(addr, 6)); - } else -#endif - { + } else { f1 = le32toh(SMBIOS_GET32(addr, 0)); f2 = le16toh(SMBIOS_GET16(addr, 4)); f3 = le16toh(SMBIOS_GET16(addr, 6)); From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 21:47:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2FEE4E1A; Tue, 22 Oct 2013 21:47:35 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1CE872ADD; Tue, 22 Oct 2013 21:47:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MLlYLL063532; Tue, 22 Oct 2013 21:47:34 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MLlYw0063531; Tue, 22 Oct 2013 21:47:34 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201310222147.r9MLlYw0063531@svn.freebsd.org> From: Olivier Houchard Date: Tue, 22 Oct 2013 21:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256941 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 21:47:35 -0000 Author: cognet Date: Tue Oct 22 21:47:34 2013 New Revision: 256941 URL: http://svnweb.freebsd.org/changeset/base/256941 Log: Try to make sure the frame is indeed in the kernel memory. Modified: head/sys/arm/arm/stack_machdep.c Modified: head/sys/arm/arm/stack_machdep.c ============================================================================== --- head/sys/arm/arm/stack_machdep.c Tue Oct 22 21:32:28 2013 (r256940) +++ head/sys/arm/arm/stack_machdep.c Tue Oct 22 21:47:34 2013 (r256941) @@ -43,13 +43,16 @@ __FBSDID("$FreeBSD$"); * APCS where it lays out the stack incorrectly. Because of this we disable * this when building for ARM EABI or when building with clang. */ + +extern vm_offset_t kernel_vm_end; + static void stack_capture(struct stack *st, u_int32_t *frame) { #if !defined(__ARM_EABI__) && !defined(__clang__) vm_offset_t callpc; - while (INKERNEL(frame)) { + while (INKERNEL(frame) && (vm_offset_t)frame < kernel_vm_end) { callpc = frame[FR_SCP]; if (stack_put(st, callpc) == -1) break; From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 21:49:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F323EF6D; Tue, 22 Oct 2013 21:49:58 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E070B2AF0; Tue, 22 Oct 2013 21:49:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MLnwMs063877; Tue, 22 Oct 2013 21:49:58 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MLnwbO063876; Tue, 22 Oct 2013 21:49:58 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201310222149.r9MLnwbO063876@svn.freebsd.org> From: Olivier Houchard Date: Tue, 22 Oct 2013 21:49:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256942 - head/sys/arm/xscale/ixp425 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 21:49:59 -0000 Author: cognet Date: Tue Oct 22 21:49:58 2013 New Revision: 256942 URL: http://svnweb.freebsd.org/changeset/base/256942 Log: Typo fix. Modified: head/sys/arm/xscale/ixp425/ixp425_mem.c Modified: head/sys/arm/xscale/ixp425/ixp425_mem.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_mem.c Tue Oct 22 21:47:34 2013 (r256941) +++ head/sys/arm/xscale/ixp425/ixp425_mem.c Tue Oct 22 21:49:58 2013 (r256942) @@ -76,7 +76,7 @@ ixp425_sdram_size(void) size = sdram_other[MCU_SDR_CONFIG_MCONF(sdr_config)]; if (size == 0) { - printf("** SDR_CONFIG retuns unknown value, using 32M\n"); + printf("** SDR_CONFIG returns unknown value, using 32M\n"); size = 32 * 1024 * 1024; } From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 21:51:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DB225148; Tue, 22 Oct 2013 21:51:07 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B96A82B24; Tue, 22 Oct 2013 21:51:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MLp78X066169; Tue, 22 Oct 2013 21:51:07 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MLp7lL066168; Tue, 22 Oct 2013 21:51:07 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201310222151.r9MLp7lL066168@svn.freebsd.org> From: Olivier Houchard Date: Tue, 22 Oct 2013 21:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256943 - head/sys/arm/xscale/ixp425 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 21:51:08 -0000 Author: cognet Date: Tue Oct 22 21:51:07 2013 New Revision: 256943 URL: http://svnweb.freebsd.org/changeset/base/256943 Log: - Use bus_dmamap_unload(), it is not optional. - The new allocator won't return coherent memory for any size > PAGE_SIZE, so don't assume we have coherent memory, and explicitely use bus_dmamap_sync(). Modified: head/sys/arm/xscale/ixp425/if_npe.c Modified: head/sys/arm/xscale/ixp425/if_npe.c ============================================================================== --- head/sys/arm/xscale/ixp425/if_npe.c Tue Oct 22 21:49:58 2013 (r256942) +++ head/sys/arm/xscale/ixp425/if_npe.c Tue Oct 22 21:51:07 2013 (r256943) @@ -507,7 +507,6 @@ npe_dma_setup(struct npe_softc *sc, stru dma->name, error); return error; } - /* XXX COHERENT for now */ if (bus_dmamem_alloc(dma->buf_tag, (void **)&dma->hwbuf, BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, &dma->buf_map) != 0) { @@ -1073,6 +1072,7 @@ npe_rxbuf_init(struct npe_softc *sc, str m->m_pkthdr.len = m->m_len = 1536; /* backload payload and align ip hdr */ m->m_data = m->m_ext.ext_buf + (m->m_ext.ext_size - (1536+ETHER_ALIGN)); + bus_dmamap_unload(dma->mtag, npe->ix_map); error = bus_dmamap_load_mbuf_sg(dma->mtag, npe->ix_map, m, segs, &nseg, 0); if (error != 0) { @@ -1085,6 +1085,8 @@ npe_rxbuf_init(struct npe_softc *sc, str /* NB: buffer length is shifted in word */ hw->ix_ne[0].len = htobe32(segs[0].ds_len << 16); hw->ix_ne[0].next = 0; + bus_dmamap_sync(dma->buf_tag, dma->buf_map, + BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); npe->ix_m = m; /* Flush the memory in the mbuf */ bus_dmamap_sync(dma->mtag, npe->ix_map, BUS_DMASYNC_PREREAD); @@ -1110,6 +1112,8 @@ npe_rxdone(int qid, void *arg) struct npebuf *npe = P2V(NPE_QM_Q_ADDR(entry), dma); struct mbuf *m; + bus_dmamap_sync(dma->buf_tag, dma->buf_map, + BUS_DMASYNC_POSTREAD); DPRINTF(sc, "%s: entry 0x%x neaddr 0x%x ne_len 0x%x\n", __func__, entry, npe->ix_neaddr, npe->ix_hw->ix_ne[0].len); /* @@ -1130,7 +1134,6 @@ npe_rxdone(int qid, void *arg) bus_dmamap_sync(dma->mtag, npe->ix_map, BUS_DMASYNC_POSTREAD); - /* XXX flush hw buffer; works now 'cuz coherent */ /* set m_len etc. per rx frame size */ mrx->m_len = be32toh(hw->ix_ne[0].len) & 0xffff; mrx->m_pkthdr.len = mrx->m_len; @@ -1313,6 +1316,7 @@ npestart_locked(struct ifnet *ifp) return; } npe = sc->tx_free; + bus_dmamap_unload(dma->mtag, npe->ix_map); error = bus_dmamap_load_mbuf_sg(dma->mtag, npe->ix_map, m, segs, &nseg, 0); if (error == EFBIG) { @@ -1355,7 +1359,8 @@ npestart_locked(struct ifnet *ifp) next += sizeof(hw->ix_ne[0]); } hw->ix_ne[i-1].next = 0; /* zero last in chain */ - /* XXX flush descriptor instead of using uncached memory */ + bus_dmamap_sync(dma->buf_tag, dma->buf_map, + BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); DPRINTF(sc, "%s: qwrite(%u, 0x%x) ne_data %x ne_len 0x%x\n", __func__, sc->tx_qid, npe->ix_neaddr, From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 21:53:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 19EB259E; Tue, 22 Oct 2013 21:53:33 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 061A32B41; Tue, 22 Oct 2013 21:53:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MLrWwg066697; Tue, 22 Oct 2013 21:53:32 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MLrW0i066696; Tue, 22 Oct 2013 21:53:32 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201310222153.r9MLrW0i066696@svn.freebsd.org> From: Colin Percival Date: Tue, 22 Oct 2013 21:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256944 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 21:53:33 -0000 Author: cperciva Date: Tue Oct 22 21:53:32 2013 New Revision: 256944 URL: http://svnweb.freebsd.org/changeset/base/256944 Log: MFC r256921: Thou shalt not leak build host state into the system being compiled. Approved by: re (gjb) Modified: stable/10/Makefile.inc1 (contents, props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Tue Oct 22 21:51:07 2013 (r256943) +++ stable/10/Makefile.inc1 Tue Oct 22 21:53:32 2013 (r256944) @@ -128,8 +128,11 @@ OSRELDATE= 0 .endif .if !defined(VERSION) -VERSION!= uname -srp -VERSION+= ${OSRELDATE} +REVISION!= make -C ${.CURDIR}/release -V REVISION +BRANCH!= make -C ${.CURDIR}/release -V BRANCH +SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ + ${.CURDIR}/sys/sys/param.h +VERSION= FreeBSD ${REVISION}-${BRANCH} ${TARGET_ARCH} ${SRCRELDATE} .endif KNOWN_ARCHES?= amd64 arm armeb/arm armv6/arm i386 i386/pc98 ia64 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64 From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 22:03:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A33D9974; Tue, 22 Oct 2013 22:03:01 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 910772BC6; Tue, 22 Oct 2013 22:03:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MM31hI070522; Tue, 22 Oct 2013 22:03:01 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MM31Vg070521; Tue, 22 Oct 2013 22:03:01 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310222203.r9MM31Vg070521@svn.freebsd.org> From: Brooks Davis Date: Tue, 22 Oct 2013 22:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256945 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 22:03:01 -0000 Author: brooks Date: Tue Oct 22 22:03:01 2013 New Revision: 256945 URL: http://svnweb.freebsd.org/changeset/base/256945 Log: MFP4: Change 221669 by bz@bz_zenith on 2013/02/01 12:26:04 Run the initialization for polling earlier along with INTRs so that we can put network interface into polling mode by default if DEVICE_POLLING is compiled in and no interrupts are available. MFC after: 3 days Sponsored by: DARPA/AFRL Modified: head/sys/kern/kern_poll.c Modified: head/sys/kern/kern_poll.c ============================================================================== --- head/sys/kern/kern_poll.c Tue Oct 22 21:53:32 2013 (r256944) +++ head/sys/kern/kern_poll.c Tue Oct 22 22:03:01 2013 (r256945) @@ -267,7 +267,7 @@ init_device_poll(void) EVENTHANDLER_REGISTER(shutdown_post_sync, poll_shutdown, NULL, SHUTDOWN_PRI_LAST); } -SYSINIT(device_poll, SI_SUB_CLOCKS, SI_ORDER_MIDDLE, init_device_poll, NULL); +SYSINIT(device_poll, SI_SUB_SOFTINTR, SI_ORDER_MIDDLE, init_device_poll, NULL); /* From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 22:17:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 599781A4; Tue, 22 Oct 2013 22:17:49 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 464262C81; Tue, 22 Oct 2013 22:17:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MMHn4U075647; Tue, 22 Oct 2013 22:17:49 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MMHmvj075645; Tue, 22 Oct 2013 22:17:48 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310222217.r9MMHmvj075645@svn.freebsd.org> From: Brooks Davis Date: Tue, 22 Oct 2013 22:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256946 - head/tools/tools/atsectl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 22:17:49 -0000 Author: brooks Date: Tue Oct 22 22:17:48 2013 New Revision: 256946 URL: http://svnweb.freebsd.org/changeset/base/256946 Log: MFP4: 1187103, 222076, 222057, 222051, 221799 Add atsectl, a simple utility to read and update MAC addresses stored in the default flash location on Altera DE4 boards. Typically used once when setting up a board so leaving in tools rather than inflicting on all users. To build with world add LOCAL_DIRS=tools/tools/atsectl to the make command line. MFC after: 3 days Sponsored by: DARPA/AFRL Added: head/tools/tools/atsectl/ head/tools/tools/atsectl/Makefile (contents, props changed) head/tools/tools/atsectl/atsectl.c (contents, props changed) Added: head/tools/tools/atsectl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/atsectl/Makefile Tue Oct 22 22:17:48 2013 (r256946) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +PROG= atsectl + +DPADD= ${LIBMD} +LDADD= -lmd + +BINDIR?= /usr/sbin + +NO_MAN= + +.include Added: head/tools/tools/atsectl/atsectl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/atsectl/atsectl.c Tue Oct 22 22:17:48 2013 (r256946) @@ -0,0 +1,327 @@ +/*- + * Copyright (c) 2012 SRI International + * Copyright (c) 2013 Bjoern A. Zeeb + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-11-C-0249) + * ("MRC2"), as part of the DARPA MRC research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $ FreeBSD: head/usr.sbin/isfctl/isfctl.c 239685 2012-08-25 18:08:20Z brooks $ + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +#define CONFIG_BLOCK (128 * 1024) +#define DEV_CFI0_PATH "/dev/cfi0" + +static u_char block[CONFIG_BLOCK]; + +#define UNKNOWN 0 +#define CFI 1 +static int fdev = UNKNOWN; +static const char *fdevs[] = { + "UNKNOWN", + "CFI" +}; +static int gflag; + +/* XXX-BZ should include if_atsereg.h. */ +#define ALTERA_ETHERNET_OPTION_BITS_OFF 0x00008000 +#define ALTERA_ETHERNET_OPTION_BITS_LEN 0x00007fff + + +static void +usage(int rc) +{ + + fprintf(stderr, "usage: atsectl [-ghlu] [-s ]\n"); + exit(rc); +} + +static void +read_block(void) +{ + int fd; + + fd = open(DEV_CFI0_PATH, O_RDONLY, 0); + if (fd == -1) + errx(1, "Failed to open " DEV_CFI0_PATH); + else + fdev = CFI; + + if (read(fd, block, sizeof(block)) != CONFIG_BLOCK) + errx(1, "Short read from %s", fdevs[fdev]); + + close(fd); +} + +static void +write_block(void) +{ + int fd; + + assert(fdev == CFI); + + fd = open(DEV_CFI0_PATH, O_WRONLY, 0); + if (fd == -1) + errx(1, "Failed to open " DEV_CFI0_PATH); + + if (write(fd, block, sizeof(block)) != CONFIG_BLOCK) + errx(1, "Short write on %s", fdevs[fdev]); + + close(fd); +} + +static void +print_eaddr(void) +{ + uint32_t safe; + + /* + * XXX-BZ we are on our own: keep in sync with atse(4). + * Everything past the first address is a guess currently. + * So we will always only write one address into there. + */ +#if 0 +root@cheri1:/root # dd if=/dev/isf0 bs=32k skip=1 count=1 | hd +00000000 fe 5a 00 00 00 07 ed ff ed 15 ff ff c0 a8 01 ea |.Z..............| +00000010 ff ff ff ff ff ff ff 00 c0 a8 01 ff ff ff ff ff |................| +00000020 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| +* +1+0 records in +1+0 records out +32768 bytes transferred in 0.053036 secs (617845 bytes/sec) +00008000 +#endif + + safe = block[ALTERA_ETHERNET_OPTION_BITS_OFF + 0] << 24; + safe |= block[ALTERA_ETHERNET_OPTION_BITS_OFF + 1] << 16; + safe |= block[ALTERA_ETHERNET_OPTION_BITS_OFF + 2] << 8; + safe |= block[ALTERA_ETHERNET_OPTION_BITS_OFF + 3]; + + printf("%02x:%02x:%02x:%02x:%02x:%02x%s\n", + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 4], + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 5], + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 6], + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 7], + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 8], + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 9], + (safe != le32toh(0x00005afe)) ? + " (invalid control pattern)" : ""); +} + +static void +list(void) +{ + + read_block(); + print_eaddr(); + exit(0); +} + +static void +_set(uint8_t *eaddr) +{ + uint8_t buf[32]; + MD5_CTX ctx; + int rc; + + printf("Original:\n"); + read_block(); + print_eaddr(); + + if (eaddr == NULL) { + /* cfi0.factory_ppr="0x0123456789abcdef" */ + rc = kenv(KENV_GET, "cfi0.factory_ppr", buf, sizeof(buf)); + if (rc == -1) + err(1, "Could not find Intel flash PPR serial\n"); + + MD5Init(&ctx); + MD5Update(&ctx, buf+2, 16); + MD5Final(buf, &ctx); + + /* Set the device specifc address (prefix). */ + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 7] = + buf[14] << 4 | buf[13] >> 4; + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 8] = + buf[13] << 4 | buf[12] >> 4; + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 9] = buf[12] << 4; + /* Just make sure the last half-byte is really zero. */ + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 9] &= ~0x0f; + + /* Set (or clear) locally administred flag. */ + if (gflag == 0) + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 4] |= 2; + else + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 4] &= ~2; + /* Make sure it is not a MC address by accident we start with. */ + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 4] &= ~1; + } else { + int e; + + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 4] = eaddr[0]; + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 5] = eaddr[1]; + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 6] = eaddr[2]; + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 7] = eaddr[3]; + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 8] = eaddr[4]; + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 9] = eaddr[5]; + + e = 0; + if ((eaddr[5] & 0xf) != 0x0) { + e++; + warnx("WARN: Selected Ethernet Address is " + "not multi-MAC compatible.\n"); + } + if (gflag == 0 && ((eaddr[0] & 0x2) == 0x0)) { + e++; + warnx("WARN: Locally administered bit not set.\n"); + } + if ((eaddr[0] & 0x1) != 0x0) { + e++; + warnx("WARN: You are setting a Multicast address.\n"); + } + if (e != 0) + warnx("Suggesting to re-run with: " + "%02x:%02x:%02x:%02x:%02x:%02x", + (eaddr[0] & 0xfe) | 0x2, + eaddr[1], eaddr[2], eaddr[3], eaddr[4], + eaddr[5] & 0xf0); + } + + /* Write the "safe" out, just to be sure. */ + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 0] = 0xfe; + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 1] = 0x5a; + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 2] = 0x00; + block[ALTERA_ETHERNET_OPTION_BITS_OFF + 3] = 0x00; + + write_block(); + + printf("Updated to:\n"); + read_block(); + print_eaddr(); + exit(0); +} + +static void +update(void) +{ + + _set(NULL); + exit(0); +} + +static void +set(char *eaddrstr) +{ + uint8_t eaddr[ETHER_ADDR_LEN]; + char *p; + long l; + int i; + + memset(eaddr, 0x00, ETHER_ADDR_LEN); + i = 0; + while ((p = strsep(&eaddrstr, ":")) != NULL && i < ETHER_ADDR_LEN) { + errno = 0; + l = strtol(p, (char **)NULL, 16); + if (l == 0 && errno != 0) + errx(1, "Failed to parse Ethernet address given: %s\n", p); + if (l < 0x00 || l > 0xff) + errx(1, "Failed to parse Ethernet address given: %lx\n", l); + eaddr[i++] = strtol(p, (char **)NULL, 16); + } + + if (i != ETHER_ADDR_LEN) + errx(1, "Failed to parse Ethernet address given\n"); + + _set(eaddr); + exit(0); +} + +int +main(int argc, char **argv) +{ + char ch, *s; + + s = NULL; + while ((ch = getopt(argc, argv, "ghlus:")) != -1) { + switch (ch) { + case 'g': + gflag = 1; + break; + case 'h': + usage(0); + /* NOTREACHED */ + break; + case 'l': + list(); + /* NOTREACHED */ + break; + case 'u': + update(); + /* NOTREACHED */ + break; + + case 's': + set(optarg); + /* NOTREACHED */ + break; + + case '?': + default: + usage(1); + /* NOTREACHED */ + break; + } + } + + usage(1); + /* NOTREACHED */ + + return (0); +} From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 23:16:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CDF8CDE; Tue, 22 Oct 2013 23:16:37 +0000 (UTC) (envelope-from h.skuhra@gmail.com) Received: from mail-ea0-x230.google.com (mail-ea0-x230.google.com [IPv6:2a00:1450:4013:c01::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C23362FCE; Tue, 22 Oct 2013 23:16:36 +0000 (UTC) Received: by mail-ea0-f176.google.com with SMTP id q16so10658ead.7 for ; Tue, 22 Oct 2013 16:16:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:message-id:from:to:cc:subject:in-reply-to:references :user-agent:mime-version:content-type; bh=CNDlB8TAdXlKEuQ5fFcQBJBIIrJohee5DWhPfZQTSYM=; b=goFaMBl+1AOM61AhA/2kWnDKj+OewrdbLtg0i5dPTPcDWuSbB3mthtaSw9uJfjc8vM UmxTqODtfYVL0FpWmMPreh1RUchxLoFdFxxwnoOo0CQSSIoGv6mC8zNq3Ruew+fHpU70 kKIFQuDji9ohfHY+9eDq8FiAplsw37Jcm+Ol1aO9idi3NXouqhkIEx0QWJFvZ+jjpLaL WrkQo46/K+AnM5GxBhWxQJIGIAx2FoJfCdQBiu4jVhNEmR2ewnsxYtlVUlsmj1UaVghx D+ZOLKegqGFdnKM26Xwc20YJoSGjAgRf0NpuwA3IJl6wcxj0Oz1MY6YvkgCpqxP/DZwv BDkQ== X-Received: by 10.14.211.136 with SMTP id w8mr2818767eeo.80.1382483794587; Tue, 22 Oct 2013 16:16:34 -0700 (PDT) Received: from oslo.ath.cx ([2001:470:6f:44d:6146:eeae:ce98:ec5d]) by mx.google.com with ESMTPSA id s3sm62448114eeo.3.2013.10.22.16.16.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Oct 2013 16:16:33 -0700 (PDT) Date: Wed, 23 Oct 2013 01:15:58 +0200 Message-ID: <87fvrsx5g1.wl%h.skuhra@gmail.com> From: "Herbert J. Skuhra" To: Colin Percival Subject: Re: svn commit: r256944 - stable/10 In-Reply-To: <201310222153.r9MLrW0i066696@svn.freebsd.org> References: <201310222153.r9MLrW0i066696@svn.freebsd.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/24.3.50 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 23:16:37 -0000 On Tue, 22 Oct 2013 21:53:32 +0000 (UTC) Colin Percival wrote: > Author: cperciva > Date: Tue Oct 22 21:53:32 2013 > New Revision: 256944 > URL: http://svnweb.freebsd.org/changeset/base/256944 > > Log: > MFC r256921: > Thou shalt not leak build host state into the system being compiled. > > Approved by: re (gjb) > > Modified: > stable/10/Makefile.inc1 (contents, props changed) > > Modified: stable/10/Makefile.inc1 > ============================================================================== > --- stable/10/Makefile.inc1 Tue Oct 22 21:51:07 2013 (r256943) > +++ stable/10/Makefile.inc1 Tue Oct 22 21:53:32 2013 (r256944) > @@ -128,8 +128,11 @@ OSRELDATE= 0 > .endif > > .if !defined(VERSION) > -VERSION!= uname -srp > -VERSION+= ${OSRELDATE} > +REVISION!= make -C ${.CURDIR}/release -V REVISION > +BRANCH!= make -C ${.CURDIR}/release -V BRANCH > +SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ > + ${.CURDIR}/sys/sys/param.h > +VERSION= FreeBSD ${REVISION}-${BRANCH} ${TARGET_ARCH} ${SRCRELDATE} > .endif > > KNOWN_ARCHES?= amd64 arm armeb/arm armv6/arm i386 i386/pc98 ia64 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64 # pwd /usr/src # make check-old >>> Checking for old files make[3]: chdir /usr/obj/usr/src/release: No such file or directory make[2]: "/usr/src/Makefile.inc1" line 131: warning: "make -C /usr/obj/usr/src/release -V REVISION" returned non-zero status make[3]: chdir /usr/obj/usr/src/release: No such file or directory make[2]: "/usr/src/Makefile.inc1" line 132: warning: "make -C /usr/obj/usr/src/release -V BRANCH" returned non-zero status awk: can't open file /usr/obj/usr/src/sys/sys/param.h source line number 1 make[2]: "/usr/src/Makefile.inc1" line 134: warning: "awk '/^#define[[:space:]]*__FreeBSD_version/ { print $3 }' /usr/obj/usr/src/sys/sys/param.h" returned non-zero status >>> Checking for old libraries make[3]: chdir /usr/obj/usr/src/release: No such file or directory make[2]: "/usr/src/Makefile.inc1" line 131: warning: "make -C /usr/obj/usr/src/release -V REVISION" returned non-zero status make[3]: chdir /usr/obj/usr/src/release: No such file or directory make[2]: "/usr/src/Makefile.inc1" line 132: warning: "make -C /usr/obj/usr/src/release -V BRANCH" returned non-zero status awk: can't open file /usr/obj/usr/src/sys/sys/param.h source line number 1 make[2]: "/usr/src/Makefile.inc1" line 134: warning: "awk '/^#define[[:space:]]*__FreeBSD_version/ { print $3 }' /usr/obj/usr/src/sys/sys/param.h" returned non-zero status >>> Checking for old directories make[3]: chdir /usr/obj/usr/src/release: No such file or directory make[2]: "/usr/src/Makefile.inc1" line 131: warning: "make -C /usr/obj/usr/src/release -V REVISION" returned non-zero status make[3]: chdir /usr/obj/usr/src/release: No such file or directory make[2]: "/usr/src/Makefile.inc1" line 132: warning: "make -C /usr/obj/usr/src/release -V BRANCH" returned non-zero status awk: can't open file /usr/obj/usr/src/sys/sys/param.h source line number 1 make[2]: "/usr/src/Makefile.inc1" line 134: warning: "awk '/^#define[[:space:]]*__FreeBSD_version/ { print $3 }' /usr/obj/usr/src/sys/sys/param.h" returned non-zero status -- Herbert From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 23:37:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6125343C; Tue, 22 Oct 2013 23:37:55 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4D17720E3; Tue, 22 Oct 2013 23:37:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MNbtt7003763; Tue, 22 Oct 2013 23:37:55 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MNbtra003762; Tue, 22 Oct 2013 23:37:55 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310222337.r9MNbtra003762@svn.freebsd.org> From: Glen Barber Date: Tue, 22 Oct 2013 23:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256947 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 23:37:55 -0000 Author: gjb Date: Tue Oct 22 23:37:54 2013 New Revision: 256947 URL: http://svnweb.freebsd.org/changeset/base/256947 Log: Revert r256944, which does not quite get the src/ directory correct. Discussed with: cperciva Approved by: re (implicit) Pointyhat: gjb Modified: stable/10/Makefile.inc1 (contents, props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Tue Oct 22 22:17:48 2013 (r256946) +++ stable/10/Makefile.inc1 Tue Oct 22 23:37:54 2013 (r256947) @@ -128,11 +128,8 @@ OSRELDATE= 0 .endif .if !defined(VERSION) -REVISION!= make -C ${.CURDIR}/release -V REVISION -BRANCH!= make -C ${.CURDIR}/release -V BRANCH -SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ - ${.CURDIR}/sys/sys/param.h -VERSION= FreeBSD ${REVISION}-${BRANCH} ${TARGET_ARCH} ${SRCRELDATE} +VERSION!= uname -srp +VERSION+= ${OSRELDATE} .endif KNOWN_ARCHES?= amd64 arm armeb/arm armv6/arm i386 i386/pc98 ia64 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64 From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 23:38:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3CA4A568; Tue, 22 Oct 2013 23:38:48 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 99B7820E9; Tue, 22 Oct 2013 23:38:47 +0000 (UTC) Received: from glenbarber.us (coral.nyi.net [96.47.64.130]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id A5D52DAA2; Tue, 22 Oct 2013 23:38:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us A5D52DAA2 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Tue, 22 Oct 2013 19:38:38 -0400 From: Glen Barber To: "Herbert J. Skuhra" Subject: Re: svn commit: r256944 - stable/10 Message-ID: <20131022233838.GM1833@glenbarber.us> References: <201310222153.r9MLrW0i066696@svn.freebsd.org> <87fvrsx5g1.wl%h.skuhra@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8m/hfNLtAhX2NvnO" Content-Disposition: inline In-Reply-To: <87fvrsx5g1.wl%h.skuhra@gmail.com> X-Operating-System: FreeBSD 11.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org, Colin Percival X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 23:38:48 -0000 --8m/hfNLtAhX2NvnO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 23, 2013 at 01:15:58AM +0200, Herbert J. Skuhra wrote: > > Log: > > MFC r256921: > > Thou shalt not leak build host state into the system being compiled. > > =20 > > Approved by: re (gjb) > >=20 > > Modified: > > stable/10/Makefile.inc1 (contents, props changed) > >=20 Reverted with r256947. Sorry for the breakage. Glen --8m/hfNLtAhX2NvnO Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJSZwx9AAoJELls3eqvi17QuB4P/ibGz23HFkVTbY+udoGicGTc dMHEkqmMYdX8ypRpKsllpk8HDVXgXcNhOMNC8GtDUd1XvqrorAqMPNNwz3zqoBRq eX6V8aGpLwYAX8APW+dmbtmTt4etpc+ciMfB5vesiwkKRSzXj5P9jt4Y7b1IrajH 2jMfzWFH8obom6QEZSFfRA/kC6oIiT35DHfC9yvjYDRRAUpMLwBbZQQ1Zs4piW0O +Mr9Gx3/+q4SrTCLO1TVHygRzXfSu42a7VwbooDzMsNUH7MJ7wuso0+G/zhIuk1Y dT7sv4X0lVhDrjnu40Zsa+cXwz7m7f7zcNmeLr24h96/UhYTCxCaAS2/IFkkNG1G aUuVp9SQ9P8DCoTQ9/drptWErimBzoN9QYujEDGnjjxPtUtb88sRSj9mZ9cMBA+C odHkE4yUNv8uX6twNlpIavg/m8h6/byWLEV9RFdHh5DlkX7dYwzZpwShrWC9Zepg HOHJQFZUJ16T5kire5CcrjAinFuj6l+XuG1HHT1CTHV8YWaIEFjC9TwfFRwV3tmV ejqzS3l56xH+1W8XGvjqSlCik7cKnQCKTmEjNIcv+1/2FqYKpRNcei8YZ+DDe4i6 WOpqqkXD9cBW+exC6GOIwNylSRj74ZnMgb+eddwM/HGWgx0WhRZnSkNZ0RLp4euN /QLf3qfxkioPT1X58HcO =kZF0 -----END PGP SIGNATURE----- --8m/hfNLtAhX2NvnO-- From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 00:34:52 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 99661639; Wed, 23 Oct 2013 00:34:52 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6C3322452; Wed, 23 Oct 2013 00:34:52 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1VYmPM-0001an-PS; Wed, 23 Oct 2013 00:34:44 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r9N0YgdH043128; Tue, 22 Oct 2013 18:34:42 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18PWP1Q+FVH4dSbaiuV2lmC Subject: Re: svn commit: r256943 - head/sys/arm/xscale/ixp425 From: Ian Lepore To: Olivier Houchard In-Reply-To: <201310222151.r9MLp7lL066168@svn.freebsd.org> References: <201310222151.r9MLp7lL066168@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Tue, 22 Oct 2013 18:34:42 -0600 Message-ID: <1382488482.92499.199.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 00:34:52 -0000 On Tue, 2013-10-22 at 21:51 +0000, Olivier Houchard wrote: > Author: cognet > Date: Tue Oct 22 21:51:07 2013 > New Revision: 256943 > URL: http://svnweb.freebsd.org/changeset/base/256943 > > Log: > - Use bus_dmamap_unload(), it is not optional. > - The new allocator won't return coherent memory for any size > PAGE_SIZE, > so don't assume we have coherent memory, and explicitely use > bus_dmamap_sync(). > > Modified: > head/sys/arm/xscale/ixp425/if_npe.c > [snip] Whoa, not true! If you ask for BUS_DMA_COHERENT memory on arm you are g'teed to get uncached memory. If the size you ask for is under one page it comes from the uma allocator, if you want a page or more it comes from either kmem_alloc_attr() or kmem_alloc_contig() using the VM_MEMATTR_UNCACHEABLE flag, which is handled in arm/pmap[-v6].c by turning off the cache and buffered bits on the pages. -- Ian From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 00:35:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6875C787; Wed, 23 Oct 2013 00:35:59 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 522D92463; Wed, 23 Oct 2013 00:35:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9N0ZxMN024290; Wed, 23 Oct 2013 00:35:59 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9N0ZwH0024285; Wed, 23 Oct 2013 00:35:58 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201310230035.r9N0ZwH0024285@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Wed, 23 Oct 2013 00:35:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256948 - head/sys/boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 00:35:59 -0000 Author: ganbold (doc committer) Date: Wed Oct 23 00:35:58 2013 New Revision: 256948 URL: http://svnweb.freebsd.org/changeset/base/256948 Log: Add FDT for Radxa Rock board and Rockchip RK3188 SoC. Reviewed by: ray@ Added: head/sys/boot/fdt/dts/rk3188-radxa.dts (contents, props changed) head/sys/boot/fdt/dts/rk3188.dtsi (contents, props changed) Added: head/sys/boot/fdt/dts/rk3188-radxa.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/rk3188-radxa.dts Wed Oct 23 00:35:58 2013 (r256948) @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/include/ "rk3188.dtsi" + +/ { + model = "Radxa RadxaRock"; + + memory { + device_type = "memory"; + reg = < 0x60000000 0x80000000 >; /* 2GB RAM */ + }; + + aliases { + soc = &SOC; + }; + + SOC: rk3188 { + + uart2: serial@20064000 { + status = "okay"; + }; + + }; + + chosen { + bootargs = "-v"; + stdin = &uart2; + stdout = &uart2; + }; +}; + Added: head/sys/boot/fdt/dts/rk3188.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/rk3188.dtsi Wed Oct 23 00:35:58 2013 (r256948) @@ -0,0 +1,251 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/ { + compatible = "rockchip,rk3188"; + #address-cells = <1>; + #size-cells = <1>; + + aliases { + soc = &SOC; + }; + + SOC: rk3188 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges; + bus-frequency = <0>; + + GIC: interrupt-controller@1013d000 { + compatible = "arm,gic"; + reg = <0x1013d000 0x1000>, /* Distributor Registers */ + <0x1013c100 0x0100>; /* CPU Interface Registers */ + interrupt-controller; + #interrupt-cells = <1>; + }; + + pmu@20004000 { + compatible = "rockchip,rk30xx-pmu"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x20004000 0x100>; + }; + + grf@20008000 { + compatible = "rockchip,rk30xx-grf"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x20008000 0x2000 >; + }; + + mp_tmr@1013c600 { + compatible = "arm,mpcore-timers"; + #address-cells = <1>; + #size-cells = <0>; + clock-frequency = < 148500000 >; + reg = <0x1013c200 0x100>, /* Global Timer Regs */ + <0x1013c600 0x20>; /* Private Timer Regs */ + interrupts = < 27 29 >; + interrupt-parent = <&GIC>; + }; + + timer@20038000 { + compatible = "rockchip,rk30xx-timer"; + compatible = "rockchip,rk3188-dw-apb-timer-osc"; + reg = <0x20038000 0x20>; + interrupts = <76>; + clocks = <24000000>; + status = "disabled"; + }; + + timer@20038020 { + compatible = "rockchip,rk30xx-timer"; + reg = <0x20038020 0x20>; + interrupts = <77>; + clocks = <24000000>; + status = "disabled"; + }; + + timer@20038060 { + compatible = "rockchip,rk30xx-timer"; + reg = <0x20038060 0x20>; + interrupts = <91>; + clocks = <24000000>; + status = "disabled"; + }; + + timer@20038080 { + compatible = "rockchip,rk30xx-timer"; + reg = <0x20038080 0x20>; + interrupts = <92>; + clocks = <24000000>; + status = "disabled"; + }; + + timer@200380a0 { + compatible = "rockchip,rk30xx-timer"; + reg = <0x200380a0 0x20>; + interrupts = <96>; + clocks = <24000000>; + status = "disabled"; + }; + + watchdog@2004c000 { + compatible = "rockchip,rk30xx-wdt"; + reg = <0x2004c000 0x100>; + }; + + gpio0: gpio@2000a000 { + compatible = "rockchip,rk30xx-gpio"; + gpio-controller; + #gpio-cells = <2>; + reg = <0x2000a000 0x100>; + interrupts = <86>; + interrupt-parent = <&GIC>; + }; + + gpio1: gpio@2003c000 { + compatible = "rockchip,rk30xx-gpio"; + gpio-controller; + #gpio-cells = <2>; + reg = <0x2003c000 0x100>; + interrupts = <87>; + interrupt-parent = <&GIC>; + }; + + gpio2: gpio@2003e000 { + compatible = "rockchip,rk30xx-gpio"; + gpio-controller; + #gpio-cells = <2>; + reg = <0x2003e000 0x100>; + interrupts = <88>; + interrupt-parent = <&GIC>; + }; + + gpio3: gpio@20080000 { + compatible = "rockchip,rk30xx-gpio"; + gpio-controller; + #gpio-cells = <2>; + reg = <0x20080000 0x100>; + interrupts = <89>; + interrupt-parent = <&GIC>; + }; + + usb0: usb@10180000 { + compatible = "synopsys,designware-hs-otg2"; + reg = <0x10180000 0x40000>; + interrupts = <48>; + interrupt-parent = <&GIC>; + #address-cells = <1>; + #size-cells = <0>; + }; + + usb1: usb@101c0000 { + compatible = "synopsys,designware-hs-otg2"; + reg = <0x101c0000 0x40000>; + interrupts = < 49 >; + interrupt-parent = <&GIC>; + #address-cells = <1>; + #size-cells = <0>; + }; + + uart0: serial@10124000 { + compatible = "ns16550"; + reg = <0x10124000 0x400>; + reg-shift = <2>; + interrupts = <66>; + interrupt-parent = <&GIC>; + current-speed = <115200>; + clock-frequency = < 24000000 >; + busy-detect = <1>; + broken-txfifo = <1>; + status = "disabled"; + }; + + uart1: serial@10126000 { + compatible = "ns16550"; + reg = <0x10126000 0x400>; + reg-shift = <2>; + interrupts = <67>; + interrupt-parent = <&GIC>; + current-speed = <115200>; + clock-frequency = < 24000000 >; + busy-detect = <1>; + broken-txfifo = <1>; + status = "disabled"; + }; + + uart2: serial@20064000 { + compatible = "ns16550"; + reg = <0x20064000 0x400>; + reg-shift = <2>; + interrupts = <68>; + interrupt-parent = <&GIC>; + current-speed = <115200>; + clock-frequency = < 24000000 >; + busy-detect = <1>; + broken-txfifo = <1>; + status = "disabled"; + }; + + uart3: serial@20068000 { + compatible = "ns16550"; + reg = <0x20068000 0x400>; + reg-shift = <2>; + interrupts = <69>; + interrupt-parent = <&GIC>; + current-speed = <115200>; + clock-frequency = < 24000000 >; + busy-detect = <1>; + broken-txfifo = <1>; + status = "disabled"; + }; + + mmc@10214000 { + compatible = "rockchip,rk30xx-mmc"; + reg = <0x10214000 0x1000>; + interrupts = <55>; + #address-cells = <1>; + #size-cells = <0>; + clocks = <24000000>; /* TODO: verify freq */ + status = "disabled"; + }; + + mmc@10218000 { + compatible = "rockchip,rk30xx-mmc"; + reg = <0x10218000 0x1000>; + interrupts = <56>; + #address-cells = <1>; + #size-cells = <0>; + clocks = <24000000>; /* TODO: verify freq */ + status = "disabled"; + }; + }; +}; + From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 00:39:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 520F58F5; Wed, 23 Oct 2013 00:39:45 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3C5882480; Wed, 23 Oct 2013 00:39:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9N0djlf024729; Wed, 23 Oct 2013 00:39:45 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9N0di6j024722; Wed, 23 Oct 2013 00:39:44 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201310230039.r9N0di6j024722@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Wed, 23 Oct 2013 00:39:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256949 - head/sys/arm/rockchip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 00:39:45 -0000 Author: ganbold (doc committer) Date: Wed Oct 23 00:39:43 2013 New Revision: 256949 URL: http://svnweb.freebsd.org/changeset/base/256949 Log: Import basic support for Rockchip RK3188 SoC. Reviewed by: ray@ Added: head/sys/arm/rockchip/ head/sys/arm/rockchip/bus_space.c (contents, props changed) head/sys/arm/rockchip/common.c (contents, props changed) head/sys/arm/rockchip/files.rk30xx (contents, props changed) head/sys/arm/rockchip/rk30xx_gpio.c (contents, props changed) head/sys/arm/rockchip/rk30xx_grf.c (contents, props changed) head/sys/arm/rockchip/rk30xx_grf.h (contents, props changed) head/sys/arm/rockchip/rk30xx_machdep.c (contents, props changed) head/sys/arm/rockchip/rk30xx_pmu.c (contents, props changed) head/sys/arm/rockchip/rk30xx_pmu.h (contents, props changed) head/sys/arm/rockchip/std.rk30xx (contents, props changed) Added: head/sys/arm/rockchip/bus_space.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/rockchip/bus_space.c Wed Oct 23 00:39:43 2013 (r256949) @@ -0,0 +1,113 @@ +/*- + * Copyright (C) 2012 FreeBSD Foundation + * 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. Neither the name of MARVELL nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include + +/* Prototypes for all the bus_space structure functions */ +bs_protos(generic); +bs_protos(generic_armv4); + +struct bus_space _base_tag = { + /* cookie */ + .bs_cookie = (void *) 0, + + /* mapping/unmapping */ + .bs_map = generic_bs_map, + .bs_unmap = generic_bs_unmap, + .bs_subregion = generic_bs_subregion, + + /* allocation/deallocation */ + .bs_alloc = generic_bs_alloc, + .bs_free = generic_bs_free, + + /* barrier */ + .bs_barrier = generic_bs_barrier, + + /* read (single) */ + .bs_r_1 = generic_bs_r_1, + .bs_r_2 = generic_armv4_bs_r_2, + .bs_r_4 = generic_bs_r_4, + .bs_r_8 = NULL, + + /* read multiple */ + .bs_rm_1 = generic_bs_rm_1, + .bs_rm_2 = generic_armv4_bs_rm_2, + .bs_rm_4 = generic_bs_rm_4, + .bs_rm_8 = NULL, + + /* read region */ + .bs_rr_1 = generic_bs_rr_1, + .bs_rr_2 = generic_armv4_bs_rr_2, + .bs_rr_4 = generic_bs_rr_4, + .bs_rr_8 = NULL, + + /* write (single) */ + .bs_w_1 = generic_bs_w_1, + .bs_w_2 = generic_armv4_bs_w_2, + .bs_w_4 = generic_bs_w_4, + .bs_w_8 = NULL, + + /* write multiple */ + .bs_wm_1 = generic_bs_wm_1, + .bs_wm_2 = generic_armv4_bs_wm_2, + .bs_wm_4 = generic_bs_wm_4, + .bs_wm_8 = NULL, + + /* write region */ + .bs_wr_1 = generic_bs_wr_1, + .bs_wr_2 = generic_armv4_bs_wr_2, + .bs_wr_4 = generic_bs_wr_4, + .bs_wr_8 = NULL, + + /* set multiple */ + /* XXX not implemented */ + + /* set region */ + .bs_sr_1 = NULL, + .bs_sr_2 = generic_armv4_bs_sr_2, + .bs_sr_4 = generic_bs_sr_4, + .bs_sr_8 = NULL, + + /* copy */ + .bs_c_1 = NULL, + .bs_c_2 = generic_armv4_bs_c_2, + .bs_c_4 = NULL, + .bs_c_8 = NULL, +}; + +bus_space_tag_t fdtbus_bs_tag = &_base_tag; Added: head/sys/arm/rockchip/common.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/rockchip/common.c Wed Oct 23 00:39:43 2013 (r256949) @@ -0,0 +1,64 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * 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 + +struct fdt_fixup_entry fdt_fixup_table[] = { + { NULL, NULL } +}; + +static int +fdt_aintc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, + int *pol) +{ + + if (!fdt_is_compatible(node, "arm,gic")) + return (ENXIO); + + *interrupt = fdt32_to_cpu(intr[0]); + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + + return (0); +} + +fdt_pic_decode_t fdt_pic_table[] = { + &fdt_aintc_decode_ic, + NULL +}; Added: head/sys/arm/rockchip/files.rk30xx ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/rockchip/files.rk30xx Wed Oct 23 00:39:43 2013 (r256949) @@ -0,0 +1,21 @@ +# $FreeBSD$ +kern/kern_clocksource.c standard + +arm/arm/bus_space_asm_generic.S standard +arm/arm/bus_space_generic.c standard +arm/arm/cpufunc_asm_armv5.S standard +arm/arm/cpufunc_asm_arm10.S standard +arm/arm/cpufunc_asm_arm11.S standard +arm/arm/cpufunc_asm_armv7.S standard +arm/arm/irq_dispatch.S standard + +arm/arm/gic.c standard +arm/arm/mpcore_timer.c standard + +arm/rockchip/bus_space.c standard +arm/rockchip/common.c standard +arm/rockchip/rk30xx_machdep.c standard +arm/rockchip/rk30xx_pmu.c standard +arm/rockchip/rk30xx_grf.c standard +arm/rockchip/rk30xx_gpio.c optional gpio +dev/usb/controller/dwc_otg_fdt.c optional dwcotg Added: head/sys/arm/rockchip/rk30xx_gpio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/rockchip/rk30xx_gpio.c Wed Oct 23 00:39:43 2013 (r256949) @@ -0,0 +1,528 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012 Luiz Otavio O Souza. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "gpio_if.h" + +#include "rk30xx_grf.h" +#include "rk30xx_pmu.h" + +/* + * RK3188 has 4 banks of gpio. + * 32 pins per bank + * PA0 - PA7 | PB0 - PB7 + * PC0 - PC7 | PD0 - PD7 + */ + +#define RK30_GPIO_PINS 128 +#define RK30_GPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ + GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN) + +#define RK30_GPIO_NONE 0 +#define RK30_GPIO_PULLUP 1 +#define RK30_GPIO_PULLDOWN 2 + +#define RK30_GPIO_INPUT 0 +#define RK30_GPIO_OUTPUT 1 + +struct rk30_gpio_softc { + device_t sc_dev; + struct mtx sc_mtx; + struct resource * sc_mem_res; + struct resource * sc_irq_res; + bus_space_tag_t sc_bst; + bus_space_handle_t sc_bsh; + void * sc_intrhand; + int sc_gpio_npins; + struct gpio_pin sc_gpio_pins[RK30_GPIO_PINS]; +}; + +#define RK30_GPIO_LOCK(_sc) mtx_lock(&_sc->sc_mtx) +#define RK30_GPIO_UNLOCK(_sc) mtx_unlock(&_sc->sc_mtx) +#define RK30_GPIO_LOCK_ASSERT(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED) + +#define RK30_GPIO_SWPORT_DR 0x00 +#define RK30_GPIO_SWPORT_DDR 0x04 +#define RK30_GPIO_INTEN 0x30 +#define RK30_GPIO_INTMASK 0x34 +#define RK30_GPIO_INTTYPE_LEVEL 0x38 +#define RK30_GPIO_INT_POLARITY 0x3c +#define RK30_GPIO_INT_STATUS 0x40 +#define RK30_GPIO_INT_RAWSTATUS 0x44 +#define RK30_GPIO_DEBOUNCE 0x48 +#define RK30_GPIO_PORTS_EOI 0x4c +#define RK30_GPIO_EXT_PORT 0x50 +#define RK30_GPIO_LS_SYNC 0x60 + +#define RK30_GPIO_WRITE(_sc, _off, _val) \ + bus_space_write_4(_sc->sc_bst, _sc->sc_bsh, _off, _val) +#define RK30_GPIO_READ(_sc, _off) \ + bus_space_read_4(_sc->sc_bst, _sc->sc_bsh, _off) + +static uint32_t +rk30_gpio_get_function(struct rk30_gpio_softc *sc, uint32_t pin) +{ + uint32_t bank, func, offset; + + bank = pin / 32; + pin = pin % 32; + offset = 1 << pin; + + func = RK30_GPIO_READ(sc, RK30_GPIO_SWPORT_DDR); + func &= offset; + + return (func); +} + +static uint32_t +rk30_gpio_func_flag(uint32_t nfunc) +{ + + switch (nfunc) { + case RK30_GPIO_INPUT: + return (GPIO_PIN_INPUT); + case RK30_GPIO_OUTPUT: + return (GPIO_PIN_OUTPUT); + } + return (0); +} + +static void +rk30_gpio_set_function(struct rk30_gpio_softc *sc, uint32_t pin, uint32_t f) +{ + uint32_t bank, data, offset; + + /* Must be called with lock held. */ + RK30_GPIO_LOCK_ASSERT(sc); + + bank = pin / 32; + pin = pin % 32; + offset = 1 << pin; + + data = RK30_GPIO_READ(sc, RK30_GPIO_SWPORT_DDR); + if (f) + data |= offset; + else + data &= ~offset; + RK30_GPIO_WRITE(sc, RK30_GPIO_SWPORT_DDR, data); +} + +static void +rk30_gpio_set_pud(struct rk30_gpio_softc *sc, uint32_t pin, uint32_t state) +{ + uint32_t bank; + + bank = pin / 32; + + /* Must be called with lock held. */ + RK30_GPIO_LOCK_ASSERT(sc); + + if (bank == 0 && pin < 12) + rk30_pmu_gpio_pud(pin, state); + else + rk30_grf_gpio_pud(bank, pin, state); +} + +static void +rk30_gpio_pin_configure(struct rk30_gpio_softc *sc, struct gpio_pin *pin, + unsigned int flags) +{ + + RK30_GPIO_LOCK(sc); + + /* + * Manage input/output. + */ + if (flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) { + pin->gp_flags &= ~(GPIO_PIN_INPUT|GPIO_PIN_OUTPUT); + if (flags & GPIO_PIN_OUTPUT) { + pin->gp_flags |= GPIO_PIN_OUTPUT; + rk30_gpio_set_function(sc, pin->gp_pin, + RK30_GPIO_OUTPUT); + } else { + pin->gp_flags |= GPIO_PIN_INPUT; + rk30_gpio_set_function(sc, pin->gp_pin, + RK30_GPIO_INPUT); + } + } + + /* Manage Pull-up/pull-down. */ + pin->gp_flags &= ~(GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN); + if (flags & (GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN)) { + if (flags & GPIO_PIN_PULLUP) { + pin->gp_flags |= GPIO_PIN_PULLUP; + rk30_gpio_set_pud(sc, pin->gp_pin, + RK30_GPIO_PULLUP); + } else { + pin->gp_flags |= GPIO_PIN_PULLDOWN; + rk30_gpio_set_pud(sc, pin->gp_pin, + RK30_GPIO_PULLDOWN); + } + } else + rk30_gpio_set_pud(sc, pin->gp_pin, RK30_GPIO_NONE); + + RK30_GPIO_UNLOCK(sc); +} + +static int +rk30_gpio_pin_max(device_t dev, int *maxpin) +{ + + *maxpin = RK30_GPIO_PINS - 1; + return (0); +} + +static int +rk30_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +{ + struct rk30_gpio_softc *sc = device_get_softc(dev); + int i; + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + RK30_GPIO_LOCK(sc); + *caps = sc->sc_gpio_pins[i].gp_caps; + RK30_GPIO_UNLOCK(sc); + + return (0); +} + +static int +rk30_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) +{ + struct rk30_gpio_softc *sc = device_get_softc(dev); + int i; + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + RK30_GPIO_LOCK(sc); + *flags = sc->sc_gpio_pins[i].gp_flags; + RK30_GPIO_UNLOCK(sc); + + return (0); +} + +static int +rk30_gpio_pin_getname(device_t dev, uint32_t pin, char *name) +{ + struct rk30_gpio_softc *sc = device_get_softc(dev); + int i; + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + RK30_GPIO_LOCK(sc); + memcpy(name, sc->sc_gpio_pins[i].gp_name, GPIOMAXNAME); + RK30_GPIO_UNLOCK(sc); + + return (0); +} + +static int +rk30_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +{ + struct rk30_gpio_softc *sc = device_get_softc(dev); + int i; + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + /* Check for unwanted flags. */ + if ((flags & sc->sc_gpio_pins[i].gp_caps) != flags) + return (EINVAL); + + /* Can't mix input/output together. */ + if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == + (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) + return (EINVAL); + + /* Can't mix pull-up/pull-down together. */ + if ((flags & (GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN)) == + (GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN)) + return (EINVAL); + + rk30_gpio_pin_configure(sc, &sc->sc_gpio_pins[i], flags); + + return (0); +} + +static int +rk30_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value) +{ + struct rk30_gpio_softc *sc = device_get_softc(dev); + uint32_t bank, offset, data; + int i; + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + bank = pin / 32; + pin = pin % 32; + offset = 1 << pin; + + RK30_GPIO_LOCK(sc); + data = RK30_GPIO_READ(sc, RK30_GPIO_SWPORT_DDR); + data |= offset; + RK30_GPIO_WRITE(sc, RK30_GPIO_SWPORT_DDR, data); + + data = RK30_GPIO_READ(sc, RK30_GPIO_SWPORT_DR); + if (value) + data |= offset; + else + data &= ~offset; + RK30_GPIO_WRITE(sc, RK30_GPIO_SWPORT_DR, data); + RK30_GPIO_UNLOCK(sc); + + return (0); +} + +static int +rk30_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val) +{ + struct rk30_gpio_softc *sc = device_get_softc(dev); + uint32_t bank, offset, reg_data; + int i; + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + bank = pin / 32; + pin = pin % 32; + offset = 1 << pin; + + RK30_GPIO_LOCK(sc); + reg_data = RK30_GPIO_READ(sc, RK30_GPIO_EXT_PORT); + RK30_GPIO_UNLOCK(sc); + *val = (reg_data & offset) ? 1 : 0; + + return (0); +} + +static int +rk30_gpio_pin_toggle(device_t dev, uint32_t pin) +{ + struct rk30_gpio_softc *sc = device_get_softc(dev); + uint32_t bank, data, offset; + int i; + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + bank = pin / 32; + pin = pin % 32; + offset = 1 << pin; + + RK30_GPIO_LOCK(sc); + data = RK30_GPIO_READ(sc, RK30_GPIO_SWPORT_DDR); + if (data & offset) + data &= ~offset; + else + data |= offset; + RK30_GPIO_WRITE(sc, RK30_GPIO_SWPORT_DDR, data); + + data = RK30_GPIO_READ(sc, RK30_GPIO_SWPORT_DR); + if (data & offset) + data &= ~offset; + else + data |= offset; + RK30_GPIO_WRITE(sc, RK30_GPIO_SWPORT_DR, data); + RK30_GPIO_UNLOCK(sc); + + return (0); +} + +static int +rk30_gpio_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "rockchip,rk30xx-gpio")) + return (ENXIO); + + device_set_desc(dev, "Rockchip RK30XX GPIO controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +rk30_gpio_attach(device_t dev) +{ + struct rk30_gpio_softc *sc = device_get_softc(dev); + uint32_t func; + int i, rid; + phandle_t gpio; + + sc->sc_dev = dev; + + mtx_init(&sc->sc_mtx, "rk30 gpio", "gpio", MTX_DEF); + + rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_mem_res) { + device_printf(dev, "cannot allocate memory window\n"); + return (ENXIO); + } + + sc->sc_bst = rman_get_bustag(sc->sc_mem_res); + sc->sc_bsh = rman_get_bushandle(sc->sc_mem_res); + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (!sc->sc_irq_res) { + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + device_printf(dev, "cannot allocate interrupt\n"); + return (ENXIO); + } + + /* Find our node. */ + gpio = ofw_bus_get_node(sc->sc_dev); + + if (!OF_hasprop(gpio, "gpio-controller")) + /* Node is not a GPIO controller. */ + goto fail; + + /* Initialize the software controlled pins. */ + for (i = 0; i < RK30_GPIO_PINS; i++) { + snprintf(sc->sc_gpio_pins[i].gp_name, GPIOMAXNAME, + "pin %d", i); + func = rk30_gpio_get_function(sc, i); + sc->sc_gpio_pins[i].gp_pin = i; + sc->sc_gpio_pins[i].gp_caps = RK30_GPIO_DEFAULT_CAPS; + sc->sc_gpio_pins[i].gp_flags = rk30_gpio_func_flag(func); + } + sc->sc_gpio_npins = i; + + device_add_child(dev, "gpioc", device_get_unit(dev)); + device_add_child(dev, "gpiobus", device_get_unit(dev)); + return (bus_generic_attach(dev)); + +fail: + if (sc->sc_irq_res) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + if (sc->sc_mem_res) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + return (ENXIO); +} + +static int +rk30_gpio_detach(device_t dev) +{ + + return (EBUSY); +} + +static device_method_t rk30_gpio_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, rk30_gpio_probe), + DEVMETHOD(device_attach, rk30_gpio_attach), + DEVMETHOD(device_detach, rk30_gpio_detach), + + /* GPIO protocol */ + DEVMETHOD(gpio_pin_max, rk30_gpio_pin_max), + DEVMETHOD(gpio_pin_getname, rk30_gpio_pin_getname), + DEVMETHOD(gpio_pin_getflags, rk30_gpio_pin_getflags), + DEVMETHOD(gpio_pin_getcaps, rk30_gpio_pin_getcaps), + DEVMETHOD(gpio_pin_setflags, rk30_gpio_pin_setflags), + DEVMETHOD(gpio_pin_get, rk30_gpio_pin_get), + DEVMETHOD(gpio_pin_set, rk30_gpio_pin_set), + DEVMETHOD(gpio_pin_toggle, rk30_gpio_pin_toggle), + + DEVMETHOD_END +}; + +static devclass_t rk30_gpio_devclass; + +static driver_t rk30_gpio_driver = { + "gpio", + rk30_gpio_methods, + sizeof(struct rk30_gpio_softc), +}; + +DRIVER_MODULE(rk30_gpio, simplebus, rk30_gpio_driver, rk30_gpio_devclass, 0, 0); Added: head/sys/arm/rockchip/rk30xx_grf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/rockchip/rk30xx_grf.c Wed Oct 23 00:39:43 2013 (r256949) @@ -0,0 +1,130 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * 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. + */ + +/* General Register File for Rockchip RK30xx */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include "rk30xx_grf.h" + +struct rk30_grf_softc { + struct resource *res; + bus_space_tag_t bst; + bus_space_handle_t bsh; +}; + +static struct rk30_grf_softc *rk30_grf_sc = NULL; + +#define grf_read_4(sc, reg) \ + bus_space_read_4((sc)->bst, (sc)->bsh, (reg)) +#define grf_write_4(sc, reg, val) \ + bus_space_write_4((sc)->bst, (sc)->bsh, (reg), (val)) + +static int +rk30_grf_probe(device_t dev) +{ + + if (ofw_bus_is_compatible(dev, "rockchip,rk30xx-grf")) { + device_set_desc(dev, "RK30XX General Register File"); + return(BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +rk30_grf_attach(device_t dev) +{ + struct rk30_grf_softc *sc = device_get_softc(dev); + int rid = 0; + + if (rk30_grf_sc) + return (ENXIO); + + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (!sc->res) { + device_printf(dev, "could not allocate resource\n"); + return (ENXIO); + } + + sc->bst = rman_get_bustag(sc->res); + sc->bsh = rman_get_bushandle(sc->res); + + rk30_grf_sc = sc; + + return (0); +} + +static device_method_t rk30_grf_methods[] = { + DEVMETHOD(device_probe, rk30_grf_probe), + DEVMETHOD(device_attach, rk30_grf_attach), + { 0, 0 } +}; + +static driver_t rk30_grf_driver = { + "rk30_grf", + rk30_grf_methods, + sizeof(struct rk30_grf_softc), +}; + +static devclass_t rk30_grf_devclass; + +DRIVER_MODULE(rk30_grf, simplebus, rk30_grf_driver, rk30_grf_devclass, 0, 0); + +void +rk30_grf_gpio_pud(uint32_t bank, uint32_t pin, uint32_t state) +{ + uint32_t offset; + + offset = GRF_GPIO0B_PULL - 4 + (bank * 16) + ((pin / 8) * 4); + pin = (7 - (pin % 8)) * 2; + grf_write_4(rk30_grf_sc, offset, (0x3 << (16 + pin)) | (state << pin)); +} + Added: head/sys/arm/rockchip/rk30xx_grf.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/rockchip/rk30xx_grf.h Wed Oct 23 00:39:43 2013 (r256949) @@ -0,0 +1,141 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _RK30_GRF_H_ +#define _RK30_GRF_H_ + +#define RK30_GRF_BASE 0xF0008000 + +#define GRF_GPIO0L_DIR 0x0000 +#define GRF_GPIO0H_DIR 0x0004 +#define GRF_GPIO1L_DIR 0x0008 +#define GRF_GPIO1H_DIR 0x000c +#define GRF_GPIO2L_DIR 0x0010 +#define GRF_GPIO2H_DIR 0x0014 +#define GRF_GPIO3L_DIR 0x0018 +#define GRF_GPIO3H_DIR 0x001c +#define GRF_GPIO0L_DO 0x0020 +#define GRF_GPIO0H_DO 0x0024 +#define GRF_GPIO1L_DO 0x0028 +#define GRF_GPIO1H_DO 0x002c +#define GRF_GPIO2L_DO 0x0030 +#define GRF_GPIO2H_DO 0x0034 +#define GRF_GPIO3L_DO 0x0038 +#define GRF_GPIO3H_DO 0x003c +#define GRF_GPIO0L_EN 0x0040 +#define GRF_GPIO0H_EN 0x0044 +#define GRF_GPIO1L_EN 0x0048 +#define GRF_GPIO1H_EN 0x004c +#define GRF_GPIO2L_EN 0x0050 +#define GRF_GPIO2H_EN 0x0054 +#define GRF_GPIO3L_EN 0x0058 +#define GRF_GPIO3H_EN 0x005c + +#define GRF_GPIO0C_IOMUX 0x0068 +#define GRF_GPIO0D_IOMUX 0x006c +#define GRF_GPIO1A_IOMUX 0x0070 +#define GRF_GPIO1B_IOMUX 0x0074 +#define GRF_GPIO1C_IOMUX 0x0078 +#define GRF_GPIO1D_IOMUX 0x007c +#define GRF_GPIO2A_IOMUX 0x0080 +#define GRF_GPIO2B_IOMUX 0x0084 +#define GRF_GPIO2C_IOMUX 0x0088 +#define GRF_GPIO2D_IOMUX 0x008c +#define GRF_GPIO3A_IOMUX 0x0090 +#define GRF_GPIO3B_IOMUX 0x0094 +#define GRF_GPIO3C_IOMUX 0x0098 +#define GRF_GPIO3D_IOMUX 0x009c +#define GRF_SOC_CON0 0x00a0 +#define GRF_SOC_CON1 0x00a4 +#define GRF_SOC_CON2 0x00a8 +#define GRF_SOC_STATUS0 0x00ac +#define GRF_DMAC1_CON0 0x00b0 +#define GRF_DMAC1_CON1 0x00b4 +#define GRF_DMAC1_CON2 0x00b8 +#define GRF_DMAC2_CON0 0x00bc +#define GRF_DMAC2_CON1 0x00c0 +#define GRF_DMAC2_CON2 0x00c4 +#define GRF_DMAC2_CON3 0x00c8 +#define GRF_CPU_CON0 0x00cc +#define GRF_CPU_CON1 0x00d0 +#define GRF_CPU_CON2 0x00d4 +#define GRF_CPU_CON3 0x00d8 +#define GRF_CPU_CON4 0x00dc +#define GRF_CPU_CON5 0x00e0 + +#define GRF_DDRC_CON0 0x00ec +#define GRF_DDRC_STAT 0x00f0 +#define GRF_IO_CON0 0x00f4 +#define GRF_IO_CON1 0x00f8 +#define GRF_IO_CON2 0x00fc +#define GRF_IO_CON3 0x0100 +#define GRF_IO_CON4 0x0104 +#define GRF_SOC_STATUS1 0x0108 +#define GRF_UOC0_CON0 0x010c +#define GRF_UOC0_CON1 0x0110 +#define GRF_UOC0_CON2 0x0114 +#define GRF_UOC0_CON3 0x0118 +#define GRF_UOC1_CON0 0x011c +#define GRF_UOC1_CON1 0x0120 +#define GRF_UOC1_CON2 0x0124 +#define GRF_UOC1_CON3 0x0128 +#define GRF_UOC2_CON0 0x012c +#define GRF_UOC2_CON1 0x0130 + +#define GRF_UOC3_CON0 0x0138 +#define GRF_UOC3_CON1 0x013c +#define GRF_HSIC_STAT 0x0140 +#define GRF_OS_REG0 0x0144 +#define GRF_OS_REG1 0x0148 +#define GRF_OS_REG2 0x014c +#define GRF_OS_REG3 0x0150 +#define GRF_OS_REG4 0x0154 +#define GRF_OS_REG5 0x0158 +#define GRF_OS_REG6 0x015c +#define GRF_OS_REG7 0x0160 +#define GRF_GPIO0B_PULL 0x0164 +#define GRF_GPIO0C_PULL 0x0168 +#define GRF_GPIO0D_PULL 0x016c +#define GRF_GPIO1A_PULL 0x0170 +#define GRF_GPIO1B_PULL 0x0174 +#define GRF_GPIO1C_PULL 0x0178 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 00:43:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8AC8CB6D; Wed, 23 Oct 2013 00:43:23 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7861E24CF; Wed, 23 Oct 2013 00:43:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9N0hNaE027297; Wed, 23 Oct 2013 00:43:23 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9N0hNuX027296; Wed, 23 Oct 2013 00:43:23 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201310230043.r9N0hNuX027296@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Wed, 23 Oct 2013 00:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256950 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 00:43:23 -0000 Author: ganbold (doc committer) Date: Wed Oct 23 00:43:22 2013 New Revision: 256950 URL: http://svnweb.freebsd.org/changeset/base/256950 Log: Radxa Rock board (by radxa.com) kernel config file. More info on the Wiki page: https://wiki.freebsd.org/FreeBSD/arm/Radxa%20Rock Reviewed by: ray@ Added: head/sys/arm/conf/RADXA (contents, props changed) Added: head/sys/arm/conf/RADXA ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/RADXA Wed Oct 23 00:43:22 2013 (r256950) @@ -0,0 +1,119 @@ +# RADXA -- Custom configuration for the RADXA ARM development +# platform, check out http://www.radxa.com +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +ident RADXA + +include "../rockchip/std.rk30xx" + +makeoptions MODULES_OVERRIDE="" +makeoptions WITHOUT_MODULES="ahc" + +options HZ=100 +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options INET6 #IPv6 communications protocols +options FFS #Berkeley Fast Filesystem +options SOFTUPDATES #Enable FFS soft updates support +options UFS_ACL #Support for access control lists +options UFS_DIRHASH #Improve performance on big directories +options MSDOSFS #MSDOS Filesystem +options CD9660 #ISO 9660 Filesystem +options PROCFS #Process filesystem (requires PSEUDOFS) +options PSEUDOFS #Pseudo-filesystem framework +options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI +options KTRACE #ktrace(1) support +options SYSVSHM #SYSV-style shared memory +options SYSVMSG #SYSV-style message queues +options SYSVSEM #SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options PREEMPTION +options FREEBSD_BOOT_LOADER +options VFP # vfp/neon + +# Debugging +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +options BREAK_TO_DEBUGGER +#options VERBOSE_SYSINIT #Enable verbose sysinit messages +options KDB +options DDB #Enable the kernel debugger +#options INVARIANTS #Enable calls of extra sanity checking +#options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +options WITNESS #Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options DIAGNOSTIC + +# NFS support +#options NFSCL +#options NFSSERVER #Network Filesystem Server +#options NFSCLIENT #Network Filesystem Client + +# MMC/SD/SDIO card slot support +#device mmc # mmc/sd bus +#device mmcsd # mmc/sd flash cards + +# Boot device is 2nd slice on MMC/SD card +options ROOTDEVNAME=\"ufs:/dev/da0s2\" + +# Console and misc +device uart +device uart_ns8250 +device pty +device snp +device md +device random # Entropy device + +# I2C support +#device iicbus +#device iic + +# GPIO +device gpio + +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device pass + +# USB support +device usb +options USB_DEBUG +#options USB_REQ_DEBUG +#options USB_VERBOSE +device dwcotg #DWC OTG controller + +device umass + +# Ethernet +device loop +device ether +device mii +device smscphy +device bpf + +# USB ethernet support, requires miibus +device miibus +device udav + +# Flattened Device Tree +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=rk3188-radxa.dts + From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 01:34:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 631C7A0D; Wed, 23 Oct 2013 01:34:19 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4F7EC2757; Wed, 23 Oct 2013 01:34:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9N1YJWN044373; Wed, 23 Oct 2013 01:34:19 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9N1YJgb044372; Wed, 23 Oct 2013 01:34:19 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201310230134.r9N1YJgb044372@svn.freebsd.org> From: Mateusz Guzik Date: Wed, 23 Oct 2013 01:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256951 - head/sys/geom/nop X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 01:34:19 -0000 Author: mjg Date: Wed Oct 23 01:34:18 2013 New Revision: 256951 URL: http://svnweb.freebsd.org/changeset/base/256951 Log: gnop: make sure that newly allocated memory for softc is zeroed This prevents mtx_init from encountering non-zeros and panicking the kernel as a result. Reported by: Keith White Modified: head/sys/geom/nop/g_nop.c Modified: head/sys/geom/nop/g_nop.c ============================================================================== --- head/sys/geom/nop/g_nop.c Wed Oct 23 00:43:22 2013 (r256950) +++ head/sys/geom/nop/g_nop.c Wed Oct 23 01:34:18 2013 (r256951) @@ -216,7 +216,7 @@ g_nop_create(struct gctl_req *req, struc } } gp = g_new_geomf(mp, "%s", name); - sc = g_malloc(sizeof(*sc), M_WAITOK); + sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); sc->sc_offset = offset; sc->sc_explicitsize = explicitsize; sc->sc_error = ioerror; From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 02:20:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C6D5FC8; Wed, 23 Oct 2013 02:20:28 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qe0-x232.google.com (mail-qe0-x232.google.com [IPv6:2607:f8b0:400d:c02::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4782F2949; Wed, 23 Oct 2013 02:20:28 +0000 (UTC) Received: by mail-qe0-f50.google.com with SMTP id 1so113096qee.37 for ; Tue, 22 Oct 2013 19:20:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=YY4dTlya70cDIUts/LznfyPs2/pYYquXTapV3RqbDqU=; b=j+axYNZiTsePAvWkDzKgtUwPkC5NpVmQLrHTEodwp2D0jnyUKfKTlsYkvH8wYsck93 PNtwmjcIx+2CtaqSRZ7wtMjwCOUtOHO+l/oiM+jE8rg0zxGSobXysNxGj46mp915NZ+2 vHfIcEJnwl9zcj1IwkHgrRzT0o4ahJ46aoh5Go1sAOI3sFm5+uXydpx9j4FlqKM634f9 t37Wkj115SGkh4pDRrnW4DCBngps9XxyY/CGmm4wppE30ieACK/6jshgXreIpNqXLVJq 8M6I+aoTmj5ntP9TPs8H+R8k6B/yXct0aRtL3gykbsNBcxZB+CcPd3sikdqGVF6y/Mmy sATA== MIME-Version: 1.0 X-Received: by 10.49.59.115 with SMTP id y19mr33782577qeq.8.1382494827402; Tue, 22 Oct 2013 19:20:27 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Tue, 22 Oct 2013 19:20:27 -0700 (PDT) In-Reply-To: <201310222106.r9ML6Rhn048212@svn.freebsd.org> References: <201310222106.r9ML6Rhn048212@svn.freebsd.org> Date: Tue, 22 Oct 2013 19:20:27 -0700 X-Google-Sender-Auth: xNkvZaA3lbza9M9UdcLom3niRi4 Message-ID: Subject: Re: svn commit: r256934 - head/sys/mips/include From: Adrian Chadd To: Brooks Davis Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 02:20:29 -0000 This fails to build: cc -c -x assembler-with-cpp -DLOCORE -O -pipe -march=mips32 -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc -I. -I/usr/home/adrian/work/freebsd/svn/head/src/sys -I/usr/home/adrian/work/freebsd/svn/head/src/sys/contrib/altq -I/usr/home/adrian/work/freebsd/svn/head/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=10000 --param large-function-growth=100000 --param max-inline-insns-single=10000 -fno-pic -mno-abicalls -G0 -DKERNLOADADDR=0x80050000 -march=mips32 -msoft-float -ffreestanding -O -pipe -march=mips32 -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc -I. -I/usr/home/adrian/work/freebsd/svn/head/src/sys -I/usr/home/adrian/work/freebsd/svn/head/src/sys/contrib/altq -I/usr/home/adrian/work/freebsd/svn/head/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=10000 --param large-function-growth=100000 --param max-inline-insns-single=10000 -fno-pic -mno-abicalls -G0 -DKERNLOADADDR=0x80050000 -march=mips32 -msoft-float -ffreestanding -D_LOCORE -DLOCORE -Werror /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/locore.S --- exception.o --- /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S: Assembler messages: /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:157: Error: Instruction sll requires absolute expression /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:157: Error: Instruction srl requires absolute expression /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:160: Error: Instruction sll requires absolute expression /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:160: Error: Instruction srl requires absolute expression --- support.o --- --- exception.o --- /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:907: Error: Instruction sll requires absolute expression /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:907: Error: Instruction srl requires absolute expression /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:910: Error: Instruction sll requires absolute expression /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:910: Error: Instruction srl requires absolute expression /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:920: Error: Instruction sll requires absolute expression /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:920: Error: Instruction srl requires absolute expression /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:923: Error: Instruction sll requires absolute expression /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:923: Error: Instruction srl requires absolute expression /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:1064: Error: Instruction sll requires absolute expression /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:1064: Error: Instruction srl requires absolute expression --- support.o --- cc -c -x assembler-with-cpp -DLOCORE -O -pipe -march=mips32 -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc -I. -I/usr/home/adrian/work/freebsd/svn/head/src/sys -I/usr/home/adrian/work/freebsd/svn/head/src/sys/contrib/altq -I/usr/home/adrian/work/freebsd/svn/head/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=10000 --param large-function-growth=100000 --param max-inline-insns-single=10000 -fno-pic -mno-abicalls -G0 -DKERNLOADADDR=0x80050000 -march=mips32 -msoft-float -ffreestanding -O -pipe -march=mips32 -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show---- exception.o --- /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:1067: Error: Instruction sll requires absolute expression /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:1067: Error: Instruction srl requires absolute expression -adrian On 22 October 2013 14:06, Brooks Davis wrote: > Author: brooks > Date: Tue Oct 22 21:06:27 2013 > New Revision: 256934 > URL: http://svnweb.freebsd.org/changeset/base/256934 > > Log: > MFP4: > Change 221534 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/27 > 16:05:30 > > FreeBSD/mips stores page-table entries in a near-identical format > to MIPS TLB entries -- only it overrides certain "reserved" bits > in the MIPS-defined EntryLo register to hold software-defined > bits > (swbits) to avoid significantly increasing the page table memory > footprint. On n32 and n64, these bits were (a) colliding with > MIPS64r2 physical memory extensions and (b) being improperly > cleared. > > Attempt to fix both of these problems by pushing swbits further > along 64-bit EntryLo registers into the reserved space, and > improving consistency between C-based and assembly-based clearing > of swbits -- in particular, to use the same definition. This > should stop swbits from leaking into TLB entries -- while ignored > by most current MIPS hardware, this would cause a problem with > (much) larger physical memory sizes, and also leads to confusing > hardware-level tracing as physical addresses contain unexpected > (and inconsistent) higher bits. > > Discussed with: imp, jmallett > > MFC after: 3 days > Sponsored by: DARPA/AFRL > > Modified: > head/sys/mips/include/pte.h > > Modified: head/sys/mips/include/pte.h > > ============================================================================== > --- head/sys/mips/include/pte.h Tue Oct 22 20:58:23 2013 (r256933) > +++ head/sys/mips/include/pte.h Tue Oct 22 21:06:27 2013 (r256934) > @@ -56,16 +56,26 @@ typedef pt_entry_t *pd_entry_t; > #define TLBMASK_MASK ((PAGE_MASK >> TLBMASK_SHIFT) << > TLBMASK_SHIFT) > > /* > - * PFN for EntryLo register. Upper bits are 0, which is to say that > - * bit 28 is the last hardware bit; Bits 29 and upwards (EntryLo is > - * 64 bit though it can be referred to in 32-bits providing 3 software > - * bits safely. We use it as 64 bits to get many software bits, and > - * god knows what else.) are unacknowledged by hardware. They may be > - * written as anything, but otherwise they have as much meaning as > - * other 0 fields. > + * FreeBSD/mips page-table entries take a near-identical format to MIPS > TLB > + * entries, each consisting of two 32-bit or 64-bit values ("EntryHi" and > + * "EntryLo"). MIPS4k and MIPS64 both define certain bits in TLB entries > as > + * reserved, and these must be zero-filled by software. We overload these > + * bits in PTE entries to hold PTE_ flags such as RO, W, and MANAGED. > + * However, we must mask these out when writing to TLB entries to ensure > that > + * they do not become visible to hardware -- especially on MIPS64r2 which > has > + * an extended physical memory space. > + * > + * When using n64 and n32, shift software-defined bits into the MIPS64r2 > + * reserved range, which runs from bit 55 ... 63. In other configurations > + * (32-bit MIPS4k and compatible), shift them out to bits 29 ... 31. > + * > + * NOTE: This means that for 32-bit use of CP0, we aren't able to set the > top > + * bit of PFN to a non-zero value, as software is using it! This physical > + * memory size limit may not be sufficiently enforced elsewhere. > */ > #if defined(__mips_n64) || defined(__mips_n32) /* PHYSADDR_64_BIT */ > -#define TLBLO_SWBITS_SHIFT (34) > +#define TLBLO_SWBITS_SHIFT (55) > +#define TLBLO_SWBITS_CLEAR_SHIFT (9) > #define TLBLO_PFN_MASK 0x3FFFFFFC0ULL > #else > #define TLBLO_SWBITS_SHIFT (29) > @@ -133,6 +143,9 @@ typedef pt_entry_t *pd_entry_t; > * listen to requests to write to it. > * W: Wired. ??? > * MANAGED:Managed. This PTE maps a managed page. > + * > + * These bits should not be written into the TLB, so must first be masked > out > + * explicitly in C, or using CLEAR_PTE_SWBITS() in assembly. > */ > #define PTE_RO ((pt_entry_t)0x01 << > TLBLO_SWBITS_SHIFT) > #define PTE_W ((pt_entry_t)0x02 << > TLBLO_SWBITS_SHIFT) > @@ -162,7 +175,7 @@ typedef pt_entry_t *pd_entry_t; > #define PTESIZE 4 > #define PTE_L lw > #define PTE_MTC0 mtc0 > -#define CLEAR_PTE_SWBITS(r) sll r, 3; srl r, 3 /* remove 3 > high bits */ > +#define CLEAR_PTE_SWBITS(r) LONG_SLL r, > TLBLO_SWBITS_CLEAR_SHIFT; LONG_SRL r, TLBLO_SWBITS_CLEAR_SHIFT /* remove > swbits */ > #endif /* defined(__mips_n64) || defined(__mips_n32) */ > > #if defined(__mips_n64) > From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 02:27:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8745224F; Wed, 23 Oct 2013 02:27:24 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qa0-x235.google.com (mail-qa0-x235.google.com [IPv6:2607:f8b0:400d:c00::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 06063298F; Wed, 23 Oct 2013 02:27:23 +0000 (UTC) Received: by mail-qa0-f53.google.com with SMTP id k15so194076qaq.19 for ; Tue, 22 Oct 2013 19:27:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=R50FHdl7rDcsrouzTPFxVCDquo6GTXfPG6MNhKrvl1s=; b=TGjLAbf0uUtmqh5UJYFz1WN24kR+2blXS4ET6+WMOQaihyuP5Zynw/XUky+uVS7g6K vr6ZtDLyJ/7+xgCRj5YCBetONcvVI4xvH2wA0uckIleu/2V+5cAHOElfSWi5BZLtIfog on4blKrypQDDg7xxEcl5yO4dH0PrFMluBXizkVBmpWdbHq31Mq0Rp9wYImLm3NwDMDAs NwgXLdG9gwOjCl2GNzb2BN1IWTPGTpNiC8hmk6cmF04vDW3TLIXowwqYzrkPef1eaGqx hVwNN5kaDwLASKwb3X8NYEla96Himd6GxnRZvKfzJDnfOE7sPcDswhMSNNT814Gr67QI OAMA== MIME-Version: 1.0 X-Received: by 10.49.25.1 with SMTP id y1mr34363216qef.22.1382495243205; Tue, 22 Oct 2013 19:27:23 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Tue, 22 Oct 2013 19:27:23 -0700 (PDT) In-Reply-To: References: <201310222106.r9ML6Rhn048212@svn.freebsd.org> Date: Tue, 22 Oct 2013 19:27:23 -0700 X-Google-Sender-Auth: oIhjb5Xnx4h7iPH4_wlFM_YMbJM Message-ID: Subject: Re: svn commit: r256934 - head/sys/mips/include From: Adrian Chadd To: Brooks Davis Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 02:27:24 -0000 .. and it didn't compile because TLBLO_SWBITS_CLEAR_SHIFT is just plain not defined in the 32-bit mips platform case. Did you attempt to do a tinderbox build on this? Or even build a 32 bit kernel? -adrian On 22 October 2013 19:20, Adrian Chadd wrote: > This fails to build: > > cc -c -x assembler-with-cpp -DLOCORE -O -pipe -march=mips32 -std=c99 -g > -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef > -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs > -fdiagnostics-show-option -nostdinc -I. > -I/usr/home/adrian/work/freebsd/svn/head/src/sys > -I/usr/home/adrian/work/freebsd/svn/head/src/sys/contrib/altq > -I/usr/home/adrian/work/freebsd/svn/head/src/sys/contrib/libfdt -D_KERNEL > -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common > -finline-limit=8000 --param inline-unit-growth=10000 --param > large-function-growth=100000 --param max-inline-insns-single=10000 > -fno-pic -mno-abicalls -G0 -DKERNLOADADDR=0x80050000 -march=mips32 > -msoft-float -ffreestanding -O -pipe -march=mips32 -std=c99 -g -Wall > -Wredundant-decls -Wnested-externs -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef > -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs > -fdiagnostics-show-option -nostdinc -I. > -I/usr/home/adrian/work/freebsd/svn/head/src/sys > -I/usr/home/adrian/work/freebsd/svn/head/src/sys/contrib/altq > -I/usr/home/adrian/work/freebsd/svn/head/src/sys/contrib/libfdt -D_KERNEL > -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common > -finline-limit=8000 --param inline-unit-growth=10000 --param > large-function-growth=100000 --param max-inline-insns-single=10000 > -fno-pic -mno-abicalls -G0 -DKERNLOADADDR=0x80050000 -march=mips32 > -msoft-float -ffreestanding -D_LOCORE -DLOCORE -Werror > /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/locore.S > --- exception.o --- > /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S: > Assembler messages: > /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:157: > Error: Instruction sll requires absolute expression > /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:157: > Error: Instruction srl requires absolute expression > /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:160: > Error: Instruction sll requires absolute expression > /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:160: > Error: Instruction srl requires absolute expression > --- support.o --- > --- exception.o --- > /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:907: > Error: Instruction sll requires absolute expression > /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:907: > Error: Instruction srl requires absolute expression > /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:910: > Error: Instruction sll requires absolute expression > /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:910: > Error: Instruction srl requires absolute expression > /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:920: > Error: Instruction sll requires absolute expression > /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:920: > Error: Instruction srl requires absolute expression > /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:923: > Error: Instruction sll requires absolute expression > /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:923: > Error: Instruction srl requires absolute expression > /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:1064: > Error: Instruction sll requires absolute expression > /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:1064: > Error: Instruction srl requires absolute expression > --- support.o --- > cc -c -x assembler-with-cpp -DLOCORE -O -pipe -march=mips32 -std=c99 -g > -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef > -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs > -fdiagnostics-show-option -nostdinc -I. > -I/usr/home/adrian/work/freebsd/svn/head/src/sys > -I/usr/home/adrian/work/freebsd/svn/head/src/sys/contrib/altq > -I/usr/home/adrian/work/freebsd/svn/head/src/sys/contrib/libfdt -D_KERNEL > -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common > -finline-limit=8000 --param inline-unit-growth=10000 --param > large-function-growth=100000 --param max-inline-insns-single=10000 > -fno-pic -mno-abicalls -G0 -DKERNLOADADDR=0x80050000 -march=mips32 > -msoft-float -ffreestanding -O -pipe -march=mips32 -std=c99 -g -Wall > -Wredundant-decls -Wnested-externs -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef > -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs > -fdiagnostics-show---- exception.o --- > /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:1067: > Error: Instruction sll requires absolute expression > /usr/home/adrian/work/freebsd/svn/head/src/sys/mips/mips/exception.S:1067: > Error: Instruction srl requires absolute expression > > > > > -adrian > > > On 22 October 2013 14:06, Brooks Davis wrote: > >> Author: brooks >> Date: Tue Oct 22 21:06:27 2013 >> New Revision: 256934 >> URL: http://svnweb.freebsd.org/changeset/base/256934 >> >> Log: >> MFP4: >> Change 221534 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/27 >> 16:05:30 >> >> FreeBSD/mips stores page-table entries in a near-identical >> format >> to MIPS TLB entries -- only it overrides certain "reserved" bits >> in the MIPS-defined EntryLo register to hold software-defined >> bits >> (swbits) to avoid significantly increasing the page table memory >> footprint. On n32 and n64, these bits were (a) colliding with >> MIPS64r2 physical memory extensions and (b) being improperly >> cleared. >> >> Attempt to fix both of these problems by pushing swbits further >> along 64-bit EntryLo registers into the reserved space, and >> improving consistency between C-based and assembly-based >> clearing >> of swbits -- in particular, to use the same definition. This >> should stop swbits from leaking into TLB entries -- while >> ignored >> by most current MIPS hardware, this would cause a problem with >> (much) larger physical memory sizes, and also leads to confusing >> hardware-level tracing as physical addresses contain unexpected >> (and inconsistent) higher bits. >> >> Discussed with: imp, jmallett >> >> MFC after: 3 days >> Sponsored by: DARPA/AFRL >> >> Modified: >> head/sys/mips/include/pte.h >> >> Modified: head/sys/mips/include/pte.h >> >> ============================================================================== >> --- head/sys/mips/include/pte.h Tue Oct 22 20:58:23 2013 (r256933) >> +++ head/sys/mips/include/pte.h Tue Oct 22 21:06:27 2013 (r256934) >> @@ -56,16 +56,26 @@ typedef pt_entry_t *pd_entry_t; >> #define TLBMASK_MASK ((PAGE_MASK >> TLBMASK_SHIFT) << >> TLBMASK_SHIFT) >> >> /* >> - * PFN for EntryLo register. Upper bits are 0, which is to say that >> - * bit 28 is the last hardware bit; Bits 29 and upwards (EntryLo is >> - * 64 bit though it can be referred to in 32-bits providing 3 software >> - * bits safely. We use it as 64 bits to get many software bits, and >> - * god knows what else.) are unacknowledged by hardware. They may be >> - * written as anything, but otherwise they have as much meaning as >> - * other 0 fields. >> + * FreeBSD/mips page-table entries take a near-identical format to MIPS >> TLB >> + * entries, each consisting of two 32-bit or 64-bit values ("EntryHi" and >> + * "EntryLo"). MIPS4k and MIPS64 both define certain bits in TLB >> entries as >> + * reserved, and these must be zero-filled by software. We overload >> these >> + * bits in PTE entries to hold PTE_ flags such as RO, W, and MANAGED. >> + * However, we must mask these out when writing to TLB entries to ensure >> that >> + * they do not become visible to hardware -- especially on MIPS64r2 >> which has >> + * an extended physical memory space. >> + * >> + * When using n64 and n32, shift software-defined bits into the MIPS64r2 >> + * reserved range, which runs from bit 55 ... 63. In other >> configurations >> + * (32-bit MIPS4k and compatible), shift them out to bits 29 ... 31. >> + * >> + * NOTE: This means that for 32-bit use of CP0, we aren't able to set >> the top >> + * bit of PFN to a non-zero value, as software is using it! This >> physical >> + * memory size limit may not be sufficiently enforced elsewhere. >> */ >> #if defined(__mips_n64) || defined(__mips_n32) /* PHYSADDR_64_BIT */ >> -#define TLBLO_SWBITS_SHIFT (34) >> +#define TLBLO_SWBITS_SHIFT (55) >> +#define TLBLO_SWBITS_CLEAR_SHIFT (9) >> #define TLBLO_PFN_MASK 0x3FFFFFFC0ULL >> #else >> #define TLBLO_SWBITS_SHIFT (29) >> @@ -133,6 +143,9 @@ typedef pt_entry_t *pd_entry_t; >> * listen to requests to write to it. >> * W: Wired. ??? >> * MANAGED:Managed. This PTE maps a managed page. >> + * >> + * These bits should not be written into the TLB, so must first be >> masked out >> + * explicitly in C, or using CLEAR_PTE_SWBITS() in assembly. >> */ >> #define PTE_RO ((pt_entry_t)0x01 << >> TLBLO_SWBITS_SHIFT) >> #define PTE_W ((pt_entry_t)0x02 << >> TLBLO_SWBITS_SHIFT) >> @@ -162,7 +175,7 @@ typedef pt_entry_t *pd_entry_t; >> #define PTESIZE 4 >> #define PTE_L lw >> #define PTE_MTC0 mtc0 >> -#define CLEAR_PTE_SWBITS(r) sll r, 3; srl r, 3 /* remove 3 >> high bits */ >> +#define CLEAR_PTE_SWBITS(r) LONG_SLL r, >> TLBLO_SWBITS_CLEAR_SHIFT; LONG_SRL r, TLBLO_SWBITS_CLEAR_SHIFT /* remove >> swbits */ >> #endif /* defined(__mips_n64) || defined(__mips_n32) */ >> >> #if defined(__mips_n64) >> > > From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 03:27:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9D17E61A; Wed, 23 Oct 2013 03:27:42 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8943A2D08; Wed, 23 Oct 2013 03:27:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9N3RgEk082771; Wed, 23 Oct 2013 03:27:42 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9N3RgDW082770; Wed, 23 Oct 2013 03:27:42 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201310230327.r9N3RgDW082770@svn.freebsd.org> From: Eitan Adler Date: Wed, 23 Oct 2013 03:27:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256952 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 03:27:42 -0000 Author: eadler Date: Wed Oct 23 03:27:42 2013 New Revision: 256952 URL: http://svnweb.freebsd.org/changeset/base/256952 Log: Add missing symlinks for the sbuf man page Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Wed Oct 23 01:34:18 2013 (r256951) +++ head/share/man/man9/Makefile Wed Oct 23 03:27:42 2013 (r256952) @@ -1143,11 +1143,14 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \ sbuf.9 sbuf_finish.9 \ sbuf.9 sbuf_len.9 \ sbuf.9 sbuf_new.9 \ + sbuf.9 sbuf_new_auto.9 \ sbuf.9 sbuf_new_for_sysctl.9 \ sbuf.9 sbuf_printf.9 \ sbuf.9 sbuf_putc.9 \ sbuf.9 sbuf_set_drain.9 \ sbuf.9 sbuf_setpos.9 \ + sbuf.9 sbuf_start_section.9 \ + sbuf.9 sbuf_end_section.9 \ sbuf.9 sbuf_trim.9 \ sbuf.9 sbuf_vprintf.9 MLINKS+=scheduler.9 curpriority_cmp.9 \ From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 03:59:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4E72BC2E; Wed, 23 Oct 2013 03:59:52 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3B3B02E64; Wed, 23 Oct 2013 03:59:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9N3xq03092505; Wed, 23 Oct 2013 03:59:52 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9N3xqlH092504; Wed, 23 Oct 2013 03:59:52 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201310230359.r9N3xqlH092504@svn.freebsd.org> From: Andreas Tobler Date: Wed, 23 Oct 2013 03:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256953 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 03:59:52 -0000 Author: andreast Date: Wed Oct 23 03:59:51 2013 New Revision: 256953 URL: http://svnweb.freebsd.org/changeset/base/256953 Log: Fix build. Modified: head/sys/dev/ofw/openfirm.c Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Wed Oct 23 03:27:42 2013 (r256952) +++ head/sys/dev/ofw/openfirm.c Wed Oct 23 03:59:51 2013 (r256953) @@ -287,7 +287,7 @@ OF_getencprop(phandle_t node, const char ssize_t retval; int i; - KASSERT(len % 4 == 0, "Need a multiple of 4 bytes"); + KASSERT(len % 4 == 0, ("Need a multiple of 4 bytes")); retval = OF_getprop(node, propname, buf, len); for (i = 0; i < len/4; i++) @@ -354,7 +354,7 @@ OF_getencprop_alloc(phandle_t package, c pcell_t *cell; int i; - KASSERT(elsz % 4 == 0, "Need a multiple of 4 bytes"); + KASSERT(elsz % 4 == 0, ("Need a multiple of 4 bytes")); retval = OF_getprop_alloc(package, name, elsz, buf); if (retval == -1) From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 04:00:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9F91FD6E; Wed, 23 Oct 2013 04:00:54 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from smtpauth4.wiscmail.wisc.edu (wmauth4.doit.wisc.edu [144.92.197.145]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6FA5A2E93; Wed, 23 Oct 2013 04:00:54 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth4.wiscmail.wisc.edu by smtpauth4.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0MV300400SG4AT00@smtpauth4.wiscmail.wisc.edu>; Tue, 22 Oct 2013 23:00:46 -0500 (CDT) X-Spam-PmxInfo: Server=avs-4, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.10.23.35414, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from comporellon.tachypleus.net (adsl-76-208-69-44.dsl.mdsnwi.sbcglobal.net [76.208.69.44]) by smtpauth4.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0MV3005QGSH92710@smtpauth4.wiscmail.wisc.edu>; Tue, 22 Oct 2013 23:00:46 -0500 (CDT) Message-id: <526749ED.4060300@freebsd.org> Date: Tue, 22 Oct 2013 23:00:45 -0500 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 To: Andreas Tobler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r256953 - head/sys/dev/ofw References: <201310230359.r9N3xqlH092504@svn.freebsd.org> In-reply-to: <201310230359.r9N3xqlH092504@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 04:00:54 -0000 On 10/22/13 22:59, Andreas Tobler wrote: > Author: andreast > Date: Wed Oct 23 03:59:51 2013 > New Revision: 256953 > URL: http://svnweb.freebsd.org/changeset/base/256953 > > Log: > Fix build. > > Modified: > head/sys/dev/ofw/openfirm.c > > Modified: head/sys/dev/ofw/openfirm.c > ============================================================================== > --- head/sys/dev/ofw/openfirm.c Wed Oct 23 03:27:42 2013 (r256952) > +++ head/sys/dev/ofw/openfirm.c Wed Oct 23 03:59:51 2013 (r256953) > @@ -287,7 +287,7 @@ OF_getencprop(phandle_t node, const char > ssize_t retval; > int i; > > - KASSERT(len % 4 == 0, "Need a multiple of 4 bytes"); > + KASSERT(len % 4 == 0, ("Need a multiple of 4 bytes")); > > retval = OF_getprop(node, propname, buf, len); > for (i = 0; i < len/4; i++) > @@ -354,7 +354,7 @@ OF_getencprop_alloc(phandle_t package, c > pcell_t *cell; > int i; > > - KASSERT(elsz % 4 == 0, "Need a multiple of 4 bytes"); > + KASSERT(elsz % 4 == 0, ("Need a multiple of 4 bytes")); > > retval = OF_getprop_alloc(package, name, elsz, buf); > if (retval == -1) Thank you! Serves me right for doing my test builds with INVARIANTS off. -Nathan From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 05:30:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BC2137A8; Wed, 23 Oct 2013 05:30:14 +0000 (UTC) (envelope-from joel@vnode.se) Received: from mail.vnode.se (mail.vnode.se [212.247.52.13]) by mx1.freebsd.org (Postfix) with ESMTP id 3ACEC2221; Wed, 23 Oct 2013 05:30:13 +0000 (UTC) Received: from mail.vnode.se (localhost [127.0.0.1]) by mail.vnode.se (Postfix) with ESMTP id 69EE6E3F07A; Wed, 23 Oct 2013 07:21:58 +0200 (CEST) X-Virus-Scanned: amavisd-new at vnode.se Received: from mail.vnode.se ([127.0.0.1]) by mail.vnode.se (mail.vnode.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c3CWkuTOrYVw; Wed, 23 Oct 2013 07:21:50 +0200 (CEST) Received: from [10.10.10.101] (unknown [83.223.1.131]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id 78D46E3F079; Wed, 23 Oct 2013 07:21:50 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: svn commit: r256949 - head/sys/arm/rockchip From: Joel Dahl In-Reply-To: <201310230039.r9N0di6j024722@svn.freebsd.org> Date: Wed, 23 Oct 2013 07:21:50 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <37066B73-58ED-401F-849E-D1BCF23FE88C@vnode.se> References: <201310230039.r9N0di6j024722@svn.freebsd.org> To: Ganbold Tsagaankhuu X-Mailer: Apple Mail (2.1510) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 05:30:14 -0000 23 okt 2013 kl. 02:39 skrev Ganbold Tsagaankhuu : > Author: ganbold (doc committer) > Date: Wed Oct 23 00:39:43 2013 > New Revision: 256949 > URL: http://svnweb.freebsd.org/changeset/base/256949 >=20 > Log: > Import basic support for Rockchip RK3188 SoC. >=20 > Added: head/sys/arm/rockchip/bus_space.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/arm/rockchip/bus_space.c Wed Oct 23 00:39:43 2013 = (r256949) > @@ -0,0 +1,113 @@ > +/*- > + * Copyright (C) 2012 FreeBSD Foundation > + * 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. Neither the name of MARVELL nor the names of contributors > + * may be used to endorse or promote products derived from this = software > + * without specific prior written permission. Hmm? If this is copyrighted the FreeBSD Foundation, why does the = copyright mention MARVELL? Copy/Paste mistake? -- Joel From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 05:42:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 89609AAA; Wed, 23 Oct 2013 05:42:08 +0000 (UTC) (envelope-from ganbold@gmail.com) Received: from mail-ie0-x236.google.com (mail-ie0-x236.google.com [IPv6:2607:f8b0:4001:c03::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3D6F122E9; Wed, 23 Oct 2013 05:42:08 +0000 (UTC) Received: by mail-ie0-f182.google.com with SMTP id as1so534674iec.27 for ; Tue, 22 Oct 2013 22:42:07 -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=Gc97Kmuq22nNJ6OdjfRRIgC2Si9JrrWO4QiPSgXdrpg=; b=AmuoB1JZBkmiXJ5GODJZ7lXhzLLmkq8wUUAVJnclhRdlgg0w8WxzGtFyJQnF7RUuav QvQdvDu/nb5A8inpB7l8hzTAVZ8PcTSlfinDpB0Ps2hlpHn7k4UjLxBAw90ufOd2eXQp pmYNMftPLi5gjgfMGUmDOYWiZkY8Uu89WRDQ+1TfrqUyDTN8xsaQTz+9IL49UVk2k4wi ubM1gGX4mpNZ+6nz8BBnKHKov4FmuUCc4ZcA6CgyGrwpQ8qMCl3YNzWUqfyYUqqBR31H /TO+Iq3M8gU5Y37jICu3w/IEuoRSJL570UbXK4GmEtZxB+JEaZiejskcVxmpXY4lXwTE dsLg== MIME-Version: 1.0 X-Received: by 10.50.16.68 with SMTP id e4mr323971igd.12.1382506927263; Tue, 22 Oct 2013 22:42:07 -0700 (PDT) Received: by 10.64.18.14 with HTTP; Tue, 22 Oct 2013 22:42:07 -0700 (PDT) In-Reply-To: <37066B73-58ED-401F-849E-D1BCF23FE88C@vnode.se> References: <201310230039.r9N0di6j024722@svn.freebsd.org> <37066B73-58ED-401F-849E-D1BCF23FE88C@vnode.se> Date: Wed, 23 Oct 2013 13:42:07 +0800 Message-ID: Subject: Re: svn commit: r256949 - head/sys/arm/rockchip From: Ganbold Tsagaankhuu To: Joel Dahl Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, Ganbold Tsagaankhuu , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 05:42:08 -0000 On Wed, Oct 23, 2013 at 1:21 PM, Joel Dahl wrote: > > 23 okt 2013 kl. 02:39 skrev Ganbold Tsagaankhuu : > > > Author: ganbold (doc committer) > > Date: Wed Oct 23 00:39:43 2013 > > New Revision: 256949 > > URL: http://svnweb.freebsd.org/changeset/base/256949 > > > > Log: > > Import basic support for Rockchip RK3188 SoC. > > > > Added: head/sys/arm/rockchip/bus_space.c > > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/sys/arm/rockchip/bus_space.c Wed Oct 23 00:39:43 2013 > (r256949) > > @@ -0,0 +1,113 @@ > > +/*- > > + * Copyright (C) 2012 FreeBSD Foundation > > + * 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. Neither the name of MARVELL nor the names of contributors > > + * may be used to endorse or promote products derived from this > software > > + * without specific prior written permission. > > Hmm? If this is copyrighted the FreeBSD Foundation, why does the copyright > mention MARVELL? > > Copy/Paste mistake? > > I have seen most of the bus_space.c in sys/arm has this type of license. Ganbold > -- > Joel > > From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 09:53:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0DFE38A2; Wed, 23 Oct 2013 09:53:38 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EE4572142; Wed, 23 Oct 2013 09:53:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9N9rbW7011579; Wed, 23 Oct 2013 09:53:37 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9N9rbAk011578; Wed, 23 Oct 2013 09:53:37 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201310230953.r9N9rbAk011578@svn.freebsd.org> From: Kevin Lo Date: Wed, 23 Oct 2013 09:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256955 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 09:53:38 -0000 Author: kevlo Date: Wed Oct 23 09:53:37 2013 New Revision: 256955 URL: http://svnweb.freebsd.org/changeset/base/256955 Log: Fix the RT2860_TX_SW_CFG2 init value on older revisions of RT3070 chip. Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Wed Oct 23 09:21:14 2013 (r256954) +++ head/sys/dev/usb/wlan/if_run.c Wed Oct 23 09:53:37 2013 (r256955) @@ -4634,7 +4634,7 @@ run_rt3070_rf_setup(struct run_softc *sc run_bbp_write(sc, 31, bbp & ~0x03); } - if (sc->mac_rev < 0x0211) { + if (sc->mac_rev < 0x0201) { run_write(sc, RT2860_TX_SW_CFG1, 0); run_write(sc, RT2860_TX_SW_CFG2, 0x2c); } else From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 09:55:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E4D5DA9F; Wed, 23 Oct 2013 09:55:01 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D0B7E2165; Wed, 23 Oct 2013 09:55:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9N9t1xR011846; Wed, 23 Oct 2013 09:55:01 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9N9sxAZ011750; Wed, 23 Oct 2013 09:54:59 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201310230954.r9N9sxAZ011750@svn.freebsd.org> From: Steven Hartland Date: Wed, 23 Oct 2013 09:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256956 - in head/sys: cam/ata cam/scsi cddl/contrib/opensolaris/uts/common/fs/zfs cddl/contrib/opensolaris/uts/common/fs/zfs/sys geom sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 09:55:02 -0000 Author: smh Date: Wed Oct 23 09:54:58 2013 New Revision: 256956 URL: http://svnweb.freebsd.org/changeset/base/256956 Log: Improve ZFS N-way mirror read performance by using load and locality information. The existing algorithm selects a preferred leaf vdev based on offset of the zio request modulo the number of members in the mirror. It assumes the devices are of equal performance and that spreading the requests randomly over both drives will be sufficient to saturate them. In practice this results in the leaf vdevs being under utilized. The new algorithm takes into the following additional factors: * Load of the vdevs (number outstanding I/O requests) * The locality of last queued I/O vs the new I/O request. Within the locality calculation additional knowledge about the underlying vdev is considered such as; is the device backing the vdev a rotating media device. This results in performance increases across the board as well as significant increases for predominantly streaming loads and for configurations which don't have evenly performing devices. The following are results from a setup with 3 Way Mirror with 2 x HD's and 1 x SSD from a basic test running multiple parrallel dd's. With pre-fetch disabled (vfs.zfs.prefetch_disable=1): == Stripe Balanced (default) == Read 15360MB using bs: 1048576, readers: 3, took 161 seconds @ 95 MB/s == Load Balanced (zfslinux) == Read 15360MB using bs: 1048576, readers: 3, took 297 seconds @ 51 MB/s == Load Balanced (locality freebsd) == Read 15360MB using bs: 1048576, readers: 3, took 54 seconds @ 284 MB/s With pre-fetch enabled (vfs.zfs.prefetch_disable=0): == Stripe Balanced (default) == Read 15360MB using bs: 1048576, readers: 3, took 91 seconds @ 168 MB/s == Load Balanced (zfslinux) == Read 15360MB using bs: 1048576, readers: 3, took 108 seconds @ 142 MB/s == Load Balanced (locality freebsd) == Read 15360MB using bs: 1048576, readers: 3, took 48 seconds @ 320 MB/s In addition to the performance changes the code was also restructured, with the help of Justin Gibbs, to provide a more logical flow which also ensures vdevs loads are only calculated from the set of valid candidates. The following additional sysctls where added to allow the administrator to tune the behaviour of the load algorithm: * vfs.zfs.vdev.mirror.rotating_inc * vfs.zfs.vdev.mirror.rotating_seek_inc * vfs.zfs.vdev.mirror.rotating_seek_offset * vfs.zfs.vdev.mirror.non_rotating_inc * vfs.zfs.vdev.mirror.non_rotating_seek_inc These changes where based on work started by the zfsonlinux developers: https://github.com/zfsonlinux/zfs/pull/1487 Reviewed by: gibbs, mav, will MFC after: 2 weeks Sponsored by: Multiplay Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_all.h head/sys/cam/scsi/scsi_da.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c head/sys/geom/geom.h head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h head/sys/geom/geom_subr.c head/sys/sys/ata.h Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Wed Oct 23 09:53:37 2013 (r256955) +++ head/sys/cam/ata/ata_da.c Wed Oct 23 09:54:58 2013 (r256956) @@ -1222,12 +1222,13 @@ adaregister(struct cam_periph *periph, v "kern.cam.ada.%d.write_cache", periph->unit_number); TUNABLE_INT_FETCH(announce_buf, &softc->write_cache); /* Disable queue sorting for non-rotational media by default. */ - if (cgd->ident_data.media_rotation_rate == 1) + if (cgd->ident_data.media_rotation_rate == ATA_RATE_NON_ROTATING) softc->sort_io_queue = 0; else softc->sort_io_queue = -1; adagetparams(periph, cgd); softc->disk = disk_alloc(); + softc->disk->d_rotation_rate = cgd->ident_data.media_rotation_rate; softc->disk->d_devstat = devstat_new_entry(periph->periph_name, periph->unit_number, softc->params.secsize, DEVSTAT_ALL_SUPPORTED, Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Wed Oct 23 09:53:37 2013 (r256955) +++ head/sys/cam/scsi/scsi_all.h Wed Oct 23 09:54:58 2013 (r256956) @@ -1451,7 +1451,7 @@ struct scsi_vpd_block_characteristics u_int8_t page_length[2]; u_int8_t medium_rotation_rate[2]; #define SVPD_BDC_RATE_NOT_REPORTED 0x00 -#define SVPD_BDC_RATE_NONE_ROTATING 0x01 +#define SVPD_BDC_RATE_NON_ROTATING 0x01 u_int8_t reserved1; u_int8_t nominal_form_factor; #define SVPD_BDC_FORM_NOT_REPORTED 0x00 Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Wed Oct 23 09:53:37 2013 (r256955) +++ head/sys/cam/scsi/scsi_da.c Wed Oct 23 09:54:58 2013 (r256956) @@ -3377,9 +3377,18 @@ dadone(struct cam_periph *periph, union * Disable queue sorting for non-rotational media * by default. */ - if (scsi_2btoul(bdc->medium_rotation_rate) == - SVPD_BDC_RATE_NONE_ROTATING) + u_int old_rate = softc->disk->d_rotation_rate; + + softc->disk->d_rotation_rate = + scsi_2btoul(bdc->medium_rotation_rate); + if (softc->disk->d_rotation_rate == + SVPD_BDC_RATE_NON_ROTATING) { softc->sort_io_queue = 0; + } + if (softc->disk->d_rotation_rate != old_rate) { + disk_attr_changed(softc->disk, + "GEOM::rotation_rate", M_NOWAIT); + } } else { int error; error = daerror(done_ccb, CAM_RETRY_SELTO, @@ -3414,6 +3423,8 @@ dadone(struct cam_periph *periph, union ptr = (uint16_t *)ata_params; if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { + uint16_t old_rate; + for (i = 0; i < sizeof(*ata_params) / 2; i++) ptr[i] = le16toh(ptr[i]); if (ata_params->support_dsm & ATA_SUPPORT_DSM_TRIM) { @@ -3428,8 +3439,18 @@ dadone(struct cam_periph *periph, union * Disable queue sorting for non-rotational media * by default. */ - if (ata_params->media_rotation_rate == 1) + old_rate = softc->disk->d_rotation_rate; + softc->disk->d_rotation_rate = + ata_params->media_rotation_rate; + if (softc->disk->d_rotation_rate == + ATA_RATE_NON_ROTATING) { softc->sort_io_queue = 0; + } + + if (softc->disk->d_rotation_rate != old_rate) { + disk_attr_changed(softc->disk, + "GEOM::rotation_rate", M_NOWAIT); + } } else { int error; error = daerror(done_ccb, CAM_RETRY_SELTO, Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Wed Oct 23 09:53:37 2013 (r256955) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Wed Oct 23 09:54:58 2013 (r256956) @@ -120,6 +120,9 @@ extern void vdev_queue_init(vdev_t *vd); extern void vdev_queue_fini(vdev_t *vd); extern zio_t *vdev_queue_io(zio_t *zio); extern void vdev_queue_io_done(zio_t *zio); +extern int vdev_queue_length(vdev_t *vd); +extern uint64_t vdev_queue_lastoffset(vdev_t *vd); +extern void vdev_queue_register_lastoffset(vdev_t *vd, zio_t *zio); extern void vdev_config_dirty(vdev_t *vd); extern void vdev_config_clean(vdev_t *vd); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Wed Oct 23 09:53:37 2013 (r256955) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Wed Oct 23 09:54:58 2013 (r256956) @@ -106,6 +106,7 @@ struct vdev_queue { avl_tree_t vq_pending_tree; hrtime_t vq_io_complete_ts; kmutex_t vq_lock; + uint64_t vq_lastoffset; }; /* @@ -217,7 +218,10 @@ struct vdev { spa_aux_vdev_t *vdev_aux; /* for l2cache vdevs */ zio_t *vdev_probe_zio; /* root of current probe */ vdev_aux_t vdev_label_aux; /* on-disk aux state */ - struct trim_map *vdev_trimmap; + struct trim_map *vdev_trimmap; /* map on outstanding trims */ + uint16_t vdev_rotation_rate; /* rotational rate of the media */ +#define VDEV_RATE_UNKNOWN 0 +#define VDEV_RATE_NON_ROTATING 1 /* * For DTrace to work in userland (libzpool) context, these fields must Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Wed Oct 23 09:53:37 2013 (r256955) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Wed Oct 23 09:54:58 2013 (r256956) @@ -42,9 +42,11 @@ * Virtual device vector for GEOM. */ +static g_attrchanged_t vdev_geom_attrchanged; struct g_class zfs_vdev_class = { .name = "ZFS::VDEV", .version = G_VERSION, + .attrchanged = vdev_geom_attrchanged, }; DECLARE_GEOM_CLASS(zfs_vdev_class, zfs_vdev); @@ -62,6 +64,34 @@ SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_ &vdev_geom_bio_delete_disable, 0, "Disable BIO_DELETE"); static void +vdev_geom_set_rotation_rate(vdev_t *vd, struct g_consumer *cp) +{ + int error; + uint16_t rate; + + error = g_getattr("GEOM::rotation_rate", cp, &rate); + if (error == 0) + vd->vdev_rotation_rate = rate; + else + vd->vdev_rotation_rate = VDEV_RATE_UNKNOWN; +} + +static void +vdev_geom_attrchanged(struct g_consumer *cp, const char *attr) +{ + vdev_t *vd; + + vd = cp->private; + if (vd == NULL) + return; + + if (strcmp(attr, "GEOM::rotation_rate") == 0) { + vdev_geom_set_rotation_rate(vd, cp); + return; + } +} + +static void vdev_geom_orphan(struct g_consumer *cp) { vdev_t *vd; @@ -683,6 +713,11 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi vd->vdev_physpath = kmem_alloc(bufsize, KM_SLEEP); snprintf(vd->vdev_physpath, bufsize, "/dev/%s", pp->name); + /* + * Determine the device's rotation rate. + */ + vdev_geom_set_rotation_rate(vd, cp); + return (0); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Wed Oct 23 09:53:37 2013 (r256955) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Wed Oct 23 09:54:58 2013 (r256956) @@ -41,27 +41,97 @@ typedef struct mirror_child { vdev_t *mc_vd; uint64_t mc_offset; int mc_error; + int mc_load; uint8_t mc_tried; uint8_t mc_skipped; uint8_t mc_speculative; } mirror_child_t; typedef struct mirror_map { + int *mm_preferred; + int mm_preferred_cnt; int mm_children; - int mm_replacing; - int mm_preferred; - int mm_root; - mirror_child_t mm_child[1]; + boolean_t mm_replacing; + boolean_t mm_root; + mirror_child_t mm_child[]; } mirror_map_t; -int vdev_mirror_shift = 21; +static int vdev_mirror_shift = 21; + +SYSCTL_DECL(_vfs_zfs_vdev); +static SYSCTL_NODE(_vfs_zfs_vdev, OID_AUTO, mirror, CTLFLAG_RD, 0, + "ZFS VDEV Mirror"); + +/* + * The load configuration settings below are tuned by default for + * the case where all devices are of the same rotational type. + * + * If there is a mixture of rotating and non-rotating media, setting + * non_rotating_seek_inc to 0 may well provide better results as it + * will direct more reads to the non-rotating vdevs which are more + * likely to have a higher performance. + */ + +/* Rotating media load calculation configuration. */ +static int rotating_inc = 0; +TUNABLE_INT("vfs.zfs.vdev.mirror.rotating_inc", &rotating_inc); +SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_inc, CTLFLAG_RW, + &rotating_inc, 0, "Rotating media load increment for non-seeking I/O's"); + +static int rotating_seek_inc = 5; +TUNABLE_INT("vfs.zfs.vdev.mirror.rotating_seek_inc", &rotating_seek_inc); +SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_inc, CTLFLAG_RW, + &rotating_seek_inc, 0, "Rotating media load increment for seeking I/O's"); + +static int rotating_seek_offset = 1 * 1024 * 1024; +TUNABLE_INT("vfs.zfs.vdev.mirror.rotating_seek_offset", &rotating_seek_offset); +SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_offset, CTLFLAG_RW, + &rotating_seek_offset, 0, "Offset in bytes from the last I/O which " + "triggers a reduced rotating media seek increment"); + +/* Non-rotating media load calculation configuration. */ +static int non_rotating_inc = 0; +TUNABLE_INT("vfs.zfs.vdev.mirror.non_rotating_inc", &non_rotating_inc); +SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_inc, CTLFLAG_RW, + &non_rotating_inc, 0, + "Non-rotating media load increment for non-seeking I/O's"); + +static int non_rotating_seek_inc = 1; +TUNABLE_INT("vfs.zfs.vdev.mirror.non_rotating_seek_inc", + &non_rotating_seek_inc); +SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_seek_inc, CTLFLAG_RW, + &non_rotating_seek_inc, 0, + "Non-rotating media load increment for seeking I/O's"); + + +static inline size_t +vdev_mirror_map_size(int children) +{ + return (offsetof(mirror_map_t, mm_child[children]) + + sizeof(int) * children); +} + +static inline mirror_map_t * +vdev_mirror_map_alloc(int children, boolean_t replacing, boolean_t root) +{ + mirror_map_t *mm; + + mm = kmem_zalloc(vdev_mirror_map_size(children), KM_SLEEP); + mm->mm_children = children; + mm->mm_replacing = replacing; + mm->mm_root = root; + mm->mm_preferred = (int *)((uintptr_t)mm + + offsetof(mirror_map_t, mm_child[children])); + + return mm; +} static void vdev_mirror_map_free(zio_t *zio) { mirror_map_t *mm = zio->io_vsd; - kmem_free(mm, offsetof(mirror_map_t, mm_child[mm->mm_children])); + kmem_free(mm, vdev_mirror_map_size(mm->mm_children)); } static const zio_vsd_ops_t vdev_mirror_vsd_ops = { @@ -69,55 +139,80 @@ static const zio_vsd_ops_t vdev_mirror_v zio_vsd_default_cksum_report }; +static int +vdev_mirror_load(mirror_map_t *mm, vdev_t *vd, uint64_t zio_offset) +{ + uint64_t lastoffset; + int load; + + /* All DVAs have equal weight at the root. */ + if (mm->mm_root) + return (INT_MAX); + + /* + * We don't return INT_MAX if the device is resilvering i.e. + * vdev_resilver_txg != 0 as when tested performance was slightly + * worse overall when resilvering with compared to without. + */ + + /* Standard load based on pending queue length. */ + load = vdev_queue_length(vd); + lastoffset = vdev_queue_lastoffset(vd); + + if (vd->vdev_rotation_rate == VDEV_RATE_NON_ROTATING) { + /* Non-rotating media. */ + if (lastoffset == zio_offset) + return (load + non_rotating_inc); + + /* + * Apply a seek penalty even for non-rotating devices as + * sequential I/O'a can be aggregated into fewer operations + * on the device, thus avoiding unnecessary per-command + * overhead and boosting performance. + */ + return (load + non_rotating_seek_inc); + } + + /* Rotating media I/O's which directly follow the last I/O. */ + if (lastoffset == zio_offset) + return (load + rotating_inc); + + /* + * Apply half the seek increment to I/O's within seek offset + * of the last I/O queued to this vdev as they should incure less + * of a seek increment. + */ + if (ABS(lastoffset - zio_offset) < rotating_seek_offset) + return (load + (rotating_seek_inc / 2)); + + /* Apply the full seek increment to all other I/O's. */ + return (load + rotating_seek_inc); +} + + static mirror_map_t * -vdev_mirror_map_alloc(zio_t *zio) +vdev_mirror_map_init(zio_t *zio) { mirror_map_t *mm = NULL; mirror_child_t *mc; vdev_t *vd = zio->io_vd; - int c, d; + int c; if (vd == NULL) { dva_t *dva = zio->io_bp->blk_dva; spa_t *spa = zio->io_spa; - c = BP_GET_NDVAS(zio->io_bp); - - mm = kmem_zalloc(offsetof(mirror_map_t, mm_child[c]), KM_SLEEP); - mm->mm_children = c; - mm->mm_replacing = B_FALSE; - mm->mm_preferred = spa_get_random(c); - mm->mm_root = B_TRUE; - - /* - * Check the other, lower-index DVAs to see if they're on - * the same vdev as the child we picked. If they are, use - * them since they are likely to have been allocated from - * the primary metaslab in use at the time, and hence are - * more likely to have locality with single-copy data. - */ - for (c = mm->mm_preferred, d = c - 1; d >= 0; d--) { - if (DVA_GET_VDEV(&dva[d]) == DVA_GET_VDEV(&dva[c])) - mm->mm_preferred = d; - } - + mm = vdev_mirror_map_alloc(BP_GET_NDVAS(zio->io_bp), B_FALSE, + B_TRUE); for (c = 0; c < mm->mm_children; c++) { mc = &mm->mm_child[c]; - mc->mc_vd = vdev_lookup_top(spa, DVA_GET_VDEV(&dva[c])); mc->mc_offset = DVA_GET_OFFSET(&dva[c]); } } else { - c = vd->vdev_children; - - mm = kmem_zalloc(offsetof(mirror_map_t, mm_child[c]), KM_SLEEP); - mm->mm_children = c; - mm->mm_replacing = (vd->vdev_ops == &vdev_replacing_ops || - vd->vdev_ops == &vdev_spare_ops); - mm->mm_preferred = mm->mm_replacing ? 0 : - (zio->io_offset >> vdev_mirror_shift) % c; - mm->mm_root = B_FALSE; - + mm = vdev_mirror_map_alloc(vd->vdev_children, + (vd->vdev_ops == &vdev_replacing_ops || + vd->vdev_ops == &vdev_spare_ops), B_FALSE); for (c = 0; c < mm->mm_children; c++) { mc = &mm->mm_child[c]; mc->mc_vd = vd->vdev_child[c]; @@ -211,50 +306,121 @@ vdev_mirror_scrub_done(zio_t *zio) } /* - * Try to find a child whose DTL doesn't contain the block we want to read. + * Check the other, lower-index DVAs to see if they're on the same + * vdev as the child we picked. If they are, use them since they + * are likely to have been allocated from the primary metaslab in + * use at the time, and hence are more likely to have locality with + * single-copy data. + */ +static int +vdev_mirror_dva_select(zio_t *zio, int preferred) +{ + dva_t *dva = zio->io_bp->blk_dva; + mirror_map_t *mm = zio->io_vsd; + int c; + + for (c = preferred - 1; c >= 0; c--) { + if (DVA_GET_VDEV(&dva[c]) == DVA_GET_VDEV(&dva[preferred])) + preferred = c; + } + return (preferred); +} + +static int +vdev_mirror_preferred_child_randomize(zio_t *zio) +{ + mirror_map_t *mm = zio->io_vsd; + int p; + + if (mm->mm_root) { + p = spa_get_random(mm->mm_preferred_cnt); + return (vdev_mirror_dva_select(zio, mm->mm_preferred[p])); + } + + /* + * To ensure we don't always favour the first matching vdev, + * which could lead to wear leveling issues on SSD's, we + * use the I/O offset as a pseudo random seed into the vdevs + * which have the lowest load. + */ + p = (zio->io_offset >> vdev_mirror_shift) % mm->mm_preferred_cnt; + return (mm->mm_preferred[p]); +} + +/* + * Try to find a vdev whose DTL doesn't contain the block we want to read + * prefering vdevs based on determined load. + * * If we can't, try the read on any vdev we haven't already tried. */ static int vdev_mirror_child_select(zio_t *zio) { mirror_map_t *mm = zio->io_vsd; - mirror_child_t *mc; uint64_t txg = zio->io_txg; - int i, c; + int c, lowest_load; ASSERT(zio->io_bp == NULL || BP_PHYSICAL_BIRTH(zio->io_bp) == txg); - /* - * Try to find a child whose DTL doesn't contain the block to read. - * If a child is known to be completely inaccessible (indicated by - * vdev_readable() returning B_FALSE), don't even try. - */ - for (i = 0, c = mm->mm_preferred; i < mm->mm_children; i++, c++) { - if (c >= mm->mm_children) - c = 0; + lowest_load = INT_MAX; + mm->mm_preferred_cnt = 0; + for (c = 0; c < mm->mm_children; c++) { + mirror_child_t *mc; + mc = &mm->mm_child[c]; if (mc->mc_tried || mc->mc_skipped) continue; + if (!vdev_readable(mc->mc_vd)) { mc->mc_error = SET_ERROR(ENXIO); mc->mc_tried = 1; /* don't even try */ mc->mc_skipped = 1; continue; } - if (!vdev_dtl_contains(mc->mc_vd, DTL_MISSING, txg, 1)) - return (c); - mc->mc_error = SET_ERROR(ESTALE); - mc->mc_skipped = 1; - mc->mc_speculative = 1; + + if (vdev_dtl_contains(mc->mc_vd, DTL_MISSING, txg, 1)) { + mc->mc_error = SET_ERROR(ESTALE); + mc->mc_skipped = 1; + mc->mc_speculative = 1; + continue; + } + + mc->mc_load = vdev_mirror_load(mm, mc->mc_vd, mc->mc_offset); + if (mc->mc_load > lowest_load) + continue; + + if (mc->mc_load < lowest_load) { + lowest_load = mc->mc_load; + mm->mm_preferred_cnt = 0; + } + mm->mm_preferred[mm->mm_preferred_cnt] = c; + mm->mm_preferred_cnt++; + } + + if (mm->mm_preferred_cnt == 1) { + vdev_queue_register_lastoffset( + mm->mm_child[mm->mm_preferred[0]].mc_vd, zio); + return (mm->mm_preferred[0]); + } + + if (mm->mm_preferred_cnt > 1) { + int c = vdev_mirror_preferred_child_randomize(zio); + + vdev_queue_register_lastoffset(mm->mm_child[c].mc_vd, zio); + return (c); } /* * Every device is either missing or has this txg in its DTL. * Look for any child we haven't already tried before giving up. */ - for (c = 0; c < mm->mm_children; c++) - if (!mm->mm_child[c].mc_tried) + for (c = 0; c < mm->mm_children; c++) { + if (!mm->mm_child[c].mc_tried) { + vdev_queue_register_lastoffset(mm->mm_child[c].mc_vd, + zio); return (c); + } + } /* * Every child failed. There's no place left to look. @@ -269,7 +435,7 @@ vdev_mirror_io_start(zio_t *zio) mirror_child_t *mc; int c, children; - mm = vdev_mirror_map_alloc(zio); + mm = vdev_mirror_map_init(zio); if (zio->io_type == ZIO_TYPE_READ) { if ((zio->io_flags & ZIO_FLAG_SCRUB) && !mm->mm_replacing) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Wed Oct 23 09:53:37 2013 (r256955) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Wed Oct 23 09:54:58 2013 (r256956) @@ -155,6 +155,8 @@ vdev_queue_init(vdev_t *vd) avl_create(&vq->vq_pending_tree, vdev_queue_offset_compare, sizeof (zio_t), offsetof(struct zio, io_offset_node)); + + vq->vq_lastoffset = 0; } void @@ -446,3 +448,26 @@ vdev_queue_io_done(zio_t *zio) mutex_exit(&vq->vq_lock); } + +/* + * As these three methods are only used for load calculations we're not concerned + * if we get an incorrect value on 32bit platforms due to lack of vq_lock mutex + * use here, instead we prefer to keep it lock free for performance. + */ +int +vdev_queue_length(vdev_t *vd) +{ + return (avl_numnodes(&vd->vdev_queue.vq_pending_tree)); +} + +uint64_t +vdev_queue_lastoffset(vdev_t *vd) +{ + return (vd->vdev_queue.vq_lastoffset); +} + +void +vdev_queue_register_lastoffset(vdev_t *vd, zio_t *zio) +{ + vd->vdev_queue.vq_lastoffset = zio->io_offset + zio->io_size; +} Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Wed Oct 23 09:53:37 2013 (r256955) +++ head/sys/geom/geom.h Wed Oct 23 09:54:58 2013 (r256956) @@ -274,6 +274,7 @@ int g_handleattr(struct bio *bp, const c int len); int g_handleattr_int(struct bio *bp, const char *attribute, int val); int g_handleattr_off_t(struct bio *bp, const char *attribute, off_t val); +int g_handleattr_uint16_t(struct bio *bp, const char *attribute, uint16_t val); int g_handleattr_str(struct bio *bp, const char *attribute, const char *str); struct g_consumer * g_new_consumer(struct g_geom *gp); struct g_geom * g_new_geomf(struct g_class *mp, const char *fmt, ...) Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Wed Oct 23 09:53:37 2013 (r256955) +++ head/sys/geom/geom_disk.c Wed Oct 23 09:54:58 2013 (r256956) @@ -387,22 +387,25 @@ g_disk_start(struct bio *bp) break; else if (g_handleattr_str(bp, "GEOM::ident", dp->d_ident)) break; - else if (g_handleattr(bp, "GEOM::hba_vendor", - &dp->d_hba_vendor, 2)) + else if (g_handleattr_uint16_t(bp, "GEOM::hba_vendor", + dp->d_hba_vendor)) break; - else if (g_handleattr(bp, "GEOM::hba_device", - &dp->d_hba_device, 2)) + else if (g_handleattr_uint16_t(bp, "GEOM::hba_device", + dp->d_hba_device)) break; - else if (g_handleattr(bp, "GEOM::hba_subvendor", - &dp->d_hba_subvendor, 2)) + else if (g_handleattr_uint16_t(bp, "GEOM::hba_subvendor", + dp->d_hba_subvendor)) break; - else if (g_handleattr(bp, "GEOM::hba_subdevice", - &dp->d_hba_subdevice, 2)) + else if (g_handleattr_uint16_t(bp, "GEOM::hba_subdevice", + dp->d_hba_subdevice)) break; else if (!strcmp(bp->bio_attribute, "GEOM::kerneldump")) g_disk_kerneldump(bp, dp); else if (!strcmp(bp->bio_attribute, "GEOM::setstate")) g_disk_setstate(bp, sc); + else if (g_handleattr_uint16_t(bp, "GEOM::rotation_rate", + dp->d_rotation_rate)) + break; else error = ENOIOCTL; break; Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Wed Oct 23 09:53:37 2013 (r256955) +++ head/sys/geom/geom_disk.h Wed Oct 23 09:54:58 2013 (r256956) @@ -97,6 +97,7 @@ struct disk { uint16_t d_hba_device; uint16_t d_hba_subvendor; uint16_t d_hba_subdevice; + uint16_t d_rotation_rate; /* Fields private to the driver */ void *d_drv1; @@ -121,7 +122,8 @@ int disk_resize(struct disk *dp, int fla #define DISK_VERSION_01 0x5856105a #define DISK_VERSION_02 0x5856105b #define DISK_VERSION_03 0x5856105c -#define DISK_VERSION DISK_VERSION_03 +#define DISK_VERSION_04 0x5856105d +#define DISK_VERSION DISK_VERSION_04 #endif /* _KERNEL */ #endif /* _GEOM_GEOM_DISK_H_ */ Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Wed Oct 23 09:53:37 2013 (r256955) +++ head/sys/geom/geom_subr.c Wed Oct 23 09:54:58 2013 (r256956) @@ -951,6 +951,13 @@ g_handleattr_int(struct bio *bp, const c } int +g_handleattr_uint16_t(struct bio *bp, const char *attribute, uint16_t val) +{ + + return (g_handleattr(bp, attribute, &val, sizeof val)); +} + +int g_handleattr_off_t(struct bio *bp, const char *attribute, off_t val) { Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Wed Oct 23 09:53:37 2013 (r256955) +++ head/sys/sys/ata.h Wed Oct 23 09:54:58 2013 (r256956) @@ -259,6 +259,8 @@ struct ata_params { /*215*/ u_int16_t nv_cache_size_1; u_int16_t nv_cache_size_2; /*217*/ u_int16_t media_rotation_rate; +#define ATA_RATE_NOT_REPORTED 0x0000 +#define ATA_RATE_NON_ROTATING 0x0001 u_int16_t reserved218; /*219*/ u_int16_t nv_cache_opt; /*220*/ u_int16_t wrv_mode; From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 12:29:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8585962F; Wed, 23 Oct 2013 12:29:41 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 620D92AD3; Wed, 23 Oct 2013 12:29:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NCTf86064368; Wed, 23 Oct 2013 12:29:41 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NCTesQ064359; Wed, 23 Oct 2013 12:29:40 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201310231229.r9NCTesQ064359@svn.freebsd.org> From: Luiz Otavio O Souza Date: Wed, 23 Oct 2013 12:29:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256959 - in head/sys: arm/broadcom/bcm2835 arm/conf boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 12:29:41 -0000 Author: loos Date: Wed Oct 23 12:29:39 2013 New Revision: 256959 URL: http://svnweb.freebsd.org/changeset/base/256959 Log: Add the Raspberry Pi BSC (I2C compliant) controller driver. Reviewed by: rpaulo Approved by: adrian (mentor) Added: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2835_bscreg.h (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h (contents, props changed) Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 head/sys/arm/conf/RPI-B head/sys/boot/fdt/dts/bcm2835.dtsi Added: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Wed Oct 23 12:29:39 2013 (r256959) @@ -0,0 +1,485 @@ +/*- + * Copyright (c) 2001 Tsubai Masanari. + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2013 Luiz Otavio O Souza + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "iicbus_if.h" + +static void bcm_bsc_intr(void *); + +static void +bcm_bsc_modifyreg(struct bcm_bsc_softc *sc, uint32_t off, uint32_t mask, + uint32_t value) +{ + uint32_t reg; + + mtx_assert(&sc->sc_mtx, MA_OWNED); + reg = BCM_BSC_READ(sc, off); + reg &= ~mask; + reg |= value; + BCM_BSC_WRITE(sc, off, reg); +} + +static int +bcm_bsc_clock_proc(SYSCTL_HANDLER_ARGS) +{ + struct bcm_bsc_softc *sc; + uint32_t clk; + int error; + + sc = (struct bcm_bsc_softc *)arg1; + + BCM_BSC_LOCK(sc); + clk = BCM_BSC_READ(sc, BCM_BSC_CLOCK); + BCM_BSC_UNLOCK(sc); + clk &= 0xffff; + if (clk == 0) + clk = 32768; + clk = BCM_BSC_CORE_CLK / clk; + error = sysctl_handle_int(oidp, &clk, sizeof(clk), req); + if (error != 0 || req->newptr == NULL) + return (error); + + clk = BCM_BSC_CORE_CLK / clk; + if (clk % 2) + clk--; + if (clk > 0xffff) + clk = 0xffff; + BCM_BSC_LOCK(sc); + BCM_BSC_WRITE(sc, BCM_BSC_CLOCK, clk); + BCM_BSC_UNLOCK(sc); + + return (0); +} + +static int +bcm_bsc_clkt_proc(SYSCTL_HANDLER_ARGS) +{ + struct bcm_bsc_softc *sc; + uint32_t clkt; + int error; + + sc = (struct bcm_bsc_softc *)arg1; + + BCM_BSC_LOCK(sc); + clkt = BCM_BSC_READ(sc, BCM_BSC_CLKT); + BCM_BSC_UNLOCK(sc); + clkt &= 0xffff; + error = sysctl_handle_int(oidp, &clkt, sizeof(clkt), req); + if (error != 0 || req->newptr == NULL) + return (error); + + BCM_BSC_LOCK(sc); + BCM_BSC_WRITE(sc, BCM_BSC_CLKT, clkt & 0xffff); + BCM_BSC_UNLOCK(sc); + + return (0); +} + +static int +bcm_bsc_fall_proc(SYSCTL_HANDLER_ARGS) +{ + struct bcm_bsc_softc *sc; + uint32_t clk, reg; + int error; + + sc = (struct bcm_bsc_softc *)arg1; + + BCM_BSC_LOCK(sc); + reg = BCM_BSC_READ(sc, BCM_BSC_DELAY); + BCM_BSC_UNLOCK(sc); + reg >>= 16; + error = sysctl_handle_int(oidp, ®, sizeof(reg), req); + if (error != 0 || req->newptr == NULL) + return (error); + + BCM_BSC_LOCK(sc); + clk = BCM_BSC_READ(sc, BCM_BSC_CLOCK); + clk = BCM_BSC_CORE_CLK / clk; + if (reg > clk / 2) + reg = clk / 2 - 1; + bcm_bsc_modifyreg(sc, BCM_BSC_DELAY, 0xffff0000, reg << 16); + BCM_BSC_UNLOCK(sc); + + return (0); +} + +static int +bcm_bsc_rise_proc(SYSCTL_HANDLER_ARGS) +{ + struct bcm_bsc_softc *sc; + uint32_t clk, reg; + int error; + + sc = (struct bcm_bsc_softc *)arg1; + + BCM_BSC_LOCK(sc); + reg = BCM_BSC_READ(sc, BCM_BSC_DELAY); + BCM_BSC_UNLOCK(sc); + reg &= 0xffff; + error = sysctl_handle_int(oidp, ®, sizeof(reg), req); + if (error != 0 || req->newptr == NULL) + return (error); + + BCM_BSC_LOCK(sc); + clk = BCM_BSC_READ(sc, BCM_BSC_CLOCK); + clk = BCM_BSC_CORE_CLK / clk; + if (reg > clk / 2) + reg = clk / 2 - 1; + bcm_bsc_modifyreg(sc, BCM_BSC_DELAY, 0xffff, reg); + BCM_BSC_UNLOCK(sc); + + return (0); +} + +static void +bcm_bsc_sysctl_init(struct bcm_bsc_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree_node; + struct sysctl_oid_list *tree; + + /* + * Add system sysctl tree/handlers. + */ + ctx = device_get_sysctl_ctx(sc->sc_dev); + tree_node = device_get_sysctl_tree(sc->sc_dev); + tree = SYSCTL_CHILDREN(tree_node); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "clock", + CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + bcm_bsc_clock_proc, "IU", "I2C BUS clock frequency"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "clock_stretch", + CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + bcm_bsc_clkt_proc, "IU", "I2C BUS clock stretch timeout"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "fall_edge_delay", + CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + bcm_bsc_fall_proc, "IU", "I2C BUS falling edge delay"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "rise_edge_delay", + CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + bcm_bsc_rise_proc, "IU", "I2C BUS rising edge delay"); +} + +static void +bcm_bsc_reset(struct bcm_bsc_softc *sc) +{ + + /* Clear pending interrupts. */ + BCM_BSC_WRITE(sc, BCM_BSC_STATUS, BCM_BSC_STATUS_CLKT | + BCM_BSC_STATUS_ERR | BCM_BSC_STATUS_DONE); + /* Clear the FIFO. */ + bcm_bsc_modifyreg(sc, BCM_BSC_CTRL, BCM_BSC_CTRL_CLEAR0, + BCM_BSC_CTRL_CLEAR0); +} + +static int +bcm_bsc_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-bsc")) + return (ENXIO); + + device_set_desc(dev, "BCM2708/2835 BSC controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +bcm_bsc_attach(device_t dev) +{ + struct bcm_bsc_softc *sc; + device_t gpio; + int rid; + + if (device_get_unit(dev) > 1) { + device_printf(dev, "only bsc0 and bsc1 are supported\n"); + return (ENXIO); + } + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + /* + * Configure the GPIO pins to ALT0 function to enable BSC control + * over the pins. + */ + gpio = devclass_get_device(devclass_find("gpio"), 0); + if (!gpio) { + device_printf(dev, "cannot find gpio0\n"); + return (ENXIO); + } + bcm_gpio_set_alternate(gpio, bcm_bsc_pins[device_get_unit(dev)].sda, + BCM_GPIO_ALT0); + bcm_gpio_set_alternate(gpio, bcm_bsc_pins[device_get_unit(dev)].scl, + BCM_GPIO_ALT0); + + rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_mem_res) { + device_printf(dev, "cannot allocate memory window\n"); + return (ENXIO); + } + + sc->sc_bst = rman_get_bustag(sc->sc_mem_res); + sc->sc_bsh = rman_get_bushandle(sc->sc_mem_res); + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE | RF_SHAREABLE); + if (!sc->sc_irq_res) { + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + device_printf(dev, "cannot allocate interrupt\n"); + return (ENXIO); + } + + /* Hook up our interrupt handler. */ + if (bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, bcm_bsc_intr, sc, &sc->sc_intrhand)) { + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + device_printf(dev, "cannot setup the interrupt handler\n"); + return (ENXIO); + } + + mtx_init(&sc->sc_mtx, "bcm_bsc", NULL, MTX_DEF); + + bcm_bsc_sysctl_init(sc); + + /* Enable the BSC controller. Flush the FIFO. */ + BCM_BSC_LOCK(sc); + BCM_BSC_WRITE(sc, BCM_BSC_CTRL, BCM_BSC_CTRL_I2CEN); + bcm_bsc_reset(sc); + BCM_BSC_UNLOCK(sc); + + device_add_child(dev, "iicbus", -1); + + return (bus_generic_attach(dev)); +} + +static int +bcm_bsc_detach(device_t dev) +{ + struct bcm_bsc_softc *sc; + + bus_generic_detach(dev); + + sc = device_get_softc(dev); + mtx_destroy(&sc->sc_mtx); + if (sc->sc_intrhand) + bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intrhand); + if (sc->sc_irq_res) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + if (sc->sc_mem_res) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + + return (0); +} + +static void +bcm_bsc_intr(void *arg) +{ + struct bcm_bsc_softc *sc; + uint32_t status; + + sc = (struct bcm_bsc_softc *)arg; + + BCM_BSC_LOCK(sc); + + /* The I2C interrupt is shared among all the BSC controllers. */ + if ((sc->sc_flags & BCM_I2C_BUSY) == 0) { + BCM_BSC_UNLOCK(sc); + return; + } + + status = BCM_BSC_READ(sc, BCM_BSC_STATUS); + + /* Check for errors. */ + if (status & (BCM_BSC_STATUS_CLKT | BCM_BSC_STATUS_ERR)) { + /* Disable interrupts. */ + BCM_BSC_WRITE(sc, BCM_BSC_CTRL, BCM_BSC_CTRL_I2CEN); + sc->sc_flags |= BCM_I2C_ERROR; + bcm_bsc_reset(sc); + wakeup(sc->sc_dev); + BCM_BSC_UNLOCK(sc); + return; + } + + if (sc->sc_flags & BCM_I2C_READ) { + while (sc->sc_resid > 0 && (status & BCM_BSC_STATUS_RXD)) { + *sc->sc_data++ = BCM_BSC_READ(sc, BCM_BSC_DATA); + sc->sc_resid--; + status = BCM_BSC_READ(sc, BCM_BSC_STATUS); + } + } else { + while (sc->sc_resid > 0 && (status & BCM_BSC_STATUS_TXD)) { + BCM_BSC_WRITE(sc, BCM_BSC_DATA, *sc->sc_data++); + sc->sc_resid--; + status = BCM_BSC_READ(sc, BCM_BSC_STATUS); + } + } + + if (status & BCM_BSC_STATUS_DONE) { + /* Disable interrupts. */ + BCM_BSC_WRITE(sc, BCM_BSC_CTRL, BCM_BSC_CTRL_I2CEN); + bcm_bsc_reset(sc); + wakeup(sc->sc_dev); + } + + BCM_BSC_UNLOCK(sc); +} + +static int +bcm_bsc_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) +{ + struct bcm_bsc_softc *sc; + uint32_t intr, read, status; + int i, err; + + sc = device_get_softc(dev); + BCM_BSC_LOCK(sc); + + /* If the controller is busy wait until it is available. */ + while (sc->sc_flags & BCM_I2C_BUSY) + mtx_sleep(dev, &sc->sc_mtx, 0, "bcm_bsc", 0); + + /* Now we have control over the BSC controller. */ + sc->sc_flags = BCM_I2C_BUSY; + + /* Clear the FIFO and the pending interrupts. */ + bcm_bsc_reset(sc); + + err = 0; + for (i = 0; i < nmsgs; i++) { + + /* Write the slave address. */ + BCM_BSC_WRITE(sc, BCM_BSC_SLAVE, (msgs[i].slave >> 1) & 0x7f); + + /* Write the data length. */ + BCM_BSC_WRITE(sc, BCM_BSC_DLEN, msgs[i].len); + + sc->sc_data = msgs[i].buf; + sc->sc_resid = msgs[i].len; + if ((msgs[i].flags & IIC_M_RD) == 0) { + /* Fill up the TX FIFO. */ + status = BCM_BSC_READ(sc, BCM_BSC_STATUS); + while (sc->sc_resid > 0 && + (status & BCM_BSC_STATUS_TXD)) { + BCM_BSC_WRITE(sc, BCM_BSC_DATA, *sc->sc_data); + sc->sc_data++; + sc->sc_resid--; + status = BCM_BSC_READ(sc, BCM_BSC_STATUS); + } + read = 0; + intr = BCM_BSC_CTRL_INTT; + sc->sc_flags &= ~BCM_I2C_READ; + } else { + sc->sc_flags |= BCM_I2C_READ; + read = BCM_BSC_CTRL_READ; + intr = BCM_BSC_CTRL_INTR; + } + intr |= BCM_BSC_CTRL_INTD; + + /* Start the transfer. */ + BCM_BSC_WRITE(sc, BCM_BSC_CTRL, BCM_BSC_CTRL_I2CEN | + BCM_BSC_CTRL_ST | read | intr); + + /* Wait for the transaction to complete. */ + err = mtx_sleep(dev, &sc->sc_mtx, 0, "bcm_bsc", hz); + + /* Check if we have a timeout or an I2C error. */ + if ((sc->sc_flags & BCM_I2C_ERROR) || err == EWOULDBLOCK) { + device_printf(sc->sc_dev, "I2C error\n"); + err = EIO; + break; + } + } + + /* Clean the controller flags. */ + sc->sc_flags = 0; + + BCM_BSC_UNLOCK(sc); + + return (err); +} + +static phandle_t +bcm_bsc_get_node(device_t bus, device_t dev) +{ + + /* We only have one child, the I2C bus, which needs our own node. */ + return (ofw_bus_get_node(bus)); +} + +static device_method_t bcm_bsc_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, bcm_bsc_probe), + DEVMETHOD(device_attach, bcm_bsc_attach), + DEVMETHOD(device_detach, bcm_bsc_detach), + + /* iicbus interface */ + DEVMETHOD(iicbus_callback, iicbus_null_callback), + DEVMETHOD(iicbus_transfer, bcm_bsc_transfer), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, bcm_bsc_get_node), + + DEVMETHOD_END +}; + +static devclass_t bcm_bsc_devclass; + +static driver_t bcm_bsc_driver = { + "iichb", + bcm_bsc_methods, + sizeof(struct bcm_bsc_softc), +}; + +DRIVER_MODULE(iicbus, bcm2835_bsc, iicbus_driver, iicbus_devclass, 0, 0); +DRIVER_MODULE(bcm2835_bsc, simplebus, bcm_bsc_driver, bcm_bsc_devclass, 0, 0); Added: head/sys/arm/broadcom/bcm2835/bcm2835_bscreg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bscreg.h Wed Oct 23 12:29:39 2013 (r256959) @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2013 Luiz Otavio O Souza + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _BCM2835_BSCREG_H_ +#define _BCM2835_BSCREG_H_ + +#define BCM_BSC_CORE_CLK 150000000U +#define BCM_BSC_CTRL 0x00 +#define BCM_BSC_CTRL_I2CEN (1 << 15) +#define BCM_BSC_CTRL_INTR (1 << 10) +#define BCM_BSC_CTRL_INTT (1 << 9) +#define BCM_BSC_CTRL_INTD (1 << 8) +#define BCM_BSC_CTRL_ST (1 << 7) +#define BCM_BSC_CTRL_CLEAR1 (1 << 5) +#define BCM_BSC_CTRL_CLEAR0 (1 << 4) +#define BCM_BSC_CTRL_READ (1 << 0) +#define BCM_BSC_STATUS 0x04 +#define BCM_BSC_STATUS_CLKT (1 << 9) +#define BCM_BSC_STATUS_ERR (1 << 8) +#define BCM_BSC_STATUS_RXF (1 << 7) +#define BCM_BSC_STATUS_TXE (1 << 6) +#define BCM_BSC_STATUS_RXD (1 << 5) +#define BCM_BSC_STATUS_TXD (1 << 4) +#define BCM_BSC_STATUS_RXR (1 << 3) +#define BCM_BSC_STATUS_TXW (1 << 2) +#define BCM_BSC_STATUS_DONE (1 << 1) +#define BCM_BSC_STATUS_TA (1 << 0) +#define BCM_BSC_DLEN 0x08 +#define BCM_BSC_SLAVE 0x0c +#define BCM_BSC_DATA 0x10 +#define BCM_BSC_CLOCK 0x14 +#define BCM_BSC_DELAY 0x18 +#define BCM_BSC_CLKT 0x1c + +#endif /* _BCM2835_BSCREG_H_ */ Added: head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h Wed Oct 23 12:29:39 2013 (r256959) @@ -0,0 +1,68 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2013 Luiz Otavio O Souza + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _BCM2835_BSCVAR_H +#define _BCM2835_BSCVAR_H + +struct { + uint32_t sda; + uint32_t scl; +} bcm_bsc_pins[] = { + { 0, 1 }, /* BSC0 GPIO pins. */ + { 2, 3 } /* BSC1 GPIO pins. */ +}; + +struct bcm_bsc_softc { + device_t sc_dev; + struct mtx sc_mtx; + struct resource * sc_mem_res; + struct resource * sc_irq_res; + bus_space_tag_t sc_bst; + bus_space_handle_t sc_bsh; + uint16_t sc_resid; + uint8_t *sc_data; + uint8_t sc_flags; + void * sc_intrhand; +}; + +#define BCM_I2C_BUSY 0x01 +#define BCM_I2C_READ 0x02 +#define BCM_I2C_ERROR 0x04 + +#define BCM_BSC_WRITE(_sc, _off, _val) \ + bus_space_write_4(_sc->sc_bst, _sc->sc_bsh, _off, _val) +#define BCM_BSC_READ(_sc, _off) \ + bus_space_read_4(_sc->sc_bst, _sc->sc_bsh, _off) + +#define BCM_BSC_LOCK(_sc) \ + mtx_lock(&(_sc)->sc_mtx) +#define BCM_BSC_UNLOCK(_sc) \ + mtx_unlock(&(_sc)->sc_mtx) + +#endif /* _BCM2835_BSCVAR_H_ */ Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm2835 Wed Oct 23 11:30:07 2013 (r256958) +++ head/sys/arm/broadcom/bcm2835/files.bcm2835 Wed Oct 23 12:29:39 2013 (r256959) @@ -1,5 +1,6 @@ # $FreeBSD$ +arm/broadcom/bcm2835/bcm2835_bsc.c optional bcm2835_bsc arm/broadcom/bcm2835/bcm2835_dma.c standard arm/broadcom/bcm2835/bcm2835_fb.c optional sc arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Wed Oct 23 11:30:07 2013 (r256958) +++ head/sys/arm/conf/RPI-B Wed Oct 23 12:29:39 2013 (r256959) @@ -79,6 +79,11 @@ device mmcsd device gpio device gpioled +# I2C +device iic +device iicbus +device bcm2835_bsc + options KDB options DDB #Enable the kernel debugger options INVARIANTS #Enable calls of extra sanity checking Modified: head/sys/boot/fdt/dts/bcm2835.dtsi ============================================================================== --- head/sys/boot/fdt/dts/bcm2835.dtsi Wed Oct 23 11:30:07 2013 (r256958) +++ head/sys/boot/fdt/dts/bcm2835.dtsi Wed Oct 23 12:29:39 2013 (r256959) @@ -396,6 +396,22 @@ }; }; + bsc0 { + compatible = "broadcom,bcm2835-bsc", + "broadcom,bcm2708-bsc"; + reg = <0x205000 0x20>; + interrupts = <61>; + interrupt-parent = <&intc>; + }; + + bsc1 { + compatible = "broadcom,bcm2835-bsc", + "broadcom,bcm2708-bsc"; + reg = <0x804000 0x20>; + interrupts = <61>; + interrupt-parent = <&intc>; + }; + dma: dma { compatible = "broadcom,bcm2835-dma", "broadcom,bcm2708-dma"; From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 12:53:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8A29116E; Wed, 23 Oct 2013 12:53:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 774E72C3E; Wed, 23 Oct 2013 12:53:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NCr6NQ073686; Wed, 23 Oct 2013 12:53:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NCr6sw073685; Wed, 23 Oct 2013 12:53:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310231253.r9NCr6sw073685@svn.freebsd.org> From: Alexander Motin Date: Wed, 23 Oct 2013 12:53:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256960 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 12:53:06 -0000 Author: mav Date: Wed Oct 23 12:53:05 2013 New Revision: 256960 URL: http://svnweb.freebsd.org/changeset/base/256960 Log: Move CAM_UNQUEUED_INDEX setting to the last moment and under the periph lock. This fixes race condition with cam_periph_ccbwait(), causing use-after-free. Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Wed Oct 23 12:29:39 2013 (r256959) +++ head/sys/cam/cam_xpt.c Wed Oct 23 12:53:05 2013 (r256960) @@ -5239,6 +5239,7 @@ xpt_done_process(struct ccb_hdr *ccb_h) } /* Call the peripheral driver's callback */ + ccb_h->pinfo.index = CAM_UNQUEUED_INDEX; (*ccb_h->cbfcnp)(ccb_h->path->periph, (union ccb *)ccb_h); if (mtx != NULL) mtx_unlock(mtx); @@ -5270,7 +5271,6 @@ xpt_done_td(void *arg) THREAD_NO_SLEEPING(); while ((ccb_h = STAILQ_FIRST(&doneq)) != NULL) { STAILQ_REMOVE_HEAD(&doneq, sim_links.stqe); - ccb_h->pinfo.index = CAM_UNQUEUED_INDEX; xpt_done_process(ccb_h); } THREAD_SLEEPING_OK(); From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 13:09:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DD12461D; Wed, 23 Oct 2013 13:09:57 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CAAE92D10; Wed, 23 Oct 2013 13:09:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9ND9vRJ079560; Wed, 23 Oct 2013 13:09:57 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9ND9vks079559; Wed, 23 Oct 2013 13:09:57 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201310231309.r9ND9vks079559@svn.freebsd.org> From: Luiz Otavio O Souza Date: Wed, 23 Oct 2013 13:09:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256961 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 13:09:57 -0000 Author: loos Date: Wed Oct 23 13:09:57 2013 New Revision: 256961 URL: http://svnweb.freebsd.org/changeset/base/256961 Log: Enable the build of OFW I2C bus for FDT systems. Approved by: adrian (mentor) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Oct 23 12:53:05 2013 (r256960) +++ head/sys/conf/files Wed Oct 23 13:09:57 2013 (r256961) @@ -1915,6 +1915,7 @@ dev/ofw/ofw_bus_if.m optional fdt dev/ofw/ofw_bus_subr.c optional fdt dev/ofw/ofw_fdt.c optional fdt dev/ofw/ofw_if.m optional fdt +dev/ofw/ofw_iicbus.c optional fdt iicbus dev/ofw/openfirm.c optional fdt dev/ofw/openfirmio.c optional fdt dev/patm/if_patm.c optional patm pci From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 13:22:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BE753B9F; Wed, 23 Oct 2013 13:22:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 90BE12DFB; Wed, 23 Oct 2013 13:22:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NDMotS085515; Wed, 23 Oct 2013 13:22:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NDMo1U085514; Wed, 23 Oct 2013 13:22:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201310231322.r9NDMo1U085514@svn.freebsd.org> From: John Baldwin Date: Wed, 23 Oct 2013 13:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256962 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 13:22:50 -0000 Author: jhb Date: Wed Oct 23 13:22:50 2013 New Revision: 256962 URL: http://svnweb.freebsd.org/changeset/base/256962 Log: Finish r254925 and remove the last remaining sysctl name list macro. The one port that used it has been fixed to use the more portable getprotoent(3) instead. Modified: head/sys/netinet/in.h Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Wed Oct 23 13:09:57 2013 (r256961) +++ head/sys/netinet/in.h Wed Oct 23 13:22:50 2013 (r256962) @@ -603,78 +603,6 @@ int getsourcefilter(int, uint32_t, struc * Third level is protocol number. * Fourth level is desired variable within that protocol. */ -#define IPPROTO_MAXID (IPPROTO_AH + 1) /* don't list to IPPROTO_MAX */ - -#define CTL_IPPROTO_NAMES { \ - { "ip", CTLTYPE_NODE }, \ - { "icmp", CTLTYPE_NODE }, \ - { "igmp", CTLTYPE_NODE }, \ - { "ggp", CTLTYPE_NODE }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { "tcp", CTLTYPE_NODE }, \ - { 0, 0 }, \ - { "egp", CTLTYPE_NODE }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { "pup", CTLTYPE_NODE }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { "udp", CTLTYPE_NODE }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { "idp", CTLTYPE_NODE }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { "ipsec", CTLTYPE_NODE }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ - { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { 0, 0 }, \ - { "pim", CTLTYPE_NODE }, \ -} /* * Names for IP sysctl objects From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 13:32:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A6B0A3E4; Wed, 23 Oct 2013 13:32:53 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 93A392F3F; Wed, 23 Oct 2013 13:32:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NDWrZ5088756; Wed, 23 Oct 2013 13:32:53 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NDWr7n088754; Wed, 23 Oct 2013 13:32:53 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310231332.r9NDWr7n088754@svn.freebsd.org> From: Brooks Davis Date: Wed, 23 Oct 2013 13:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256963 - in head/sys: mips/include sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 13:32:53 -0000 Author: brooks Date: Wed Oct 23 13:32:52 2013 New Revision: 256963 URL: http://svnweb.freebsd.org/changeset/base/256963 Log: Revert r256934, it needs work to build on mips32. Modified: head/sys/mips/include/pte.h head/sys/sys/time.h Modified: head/sys/mips/include/pte.h ============================================================================== --- head/sys/mips/include/pte.h Wed Oct 23 13:22:50 2013 (r256962) +++ head/sys/mips/include/pte.h Wed Oct 23 13:32:52 2013 (r256963) @@ -56,26 +56,16 @@ typedef pt_entry_t *pd_entry_t; #define TLBMASK_MASK ((PAGE_MASK >> TLBMASK_SHIFT) << TLBMASK_SHIFT) /* - * FreeBSD/mips page-table entries take a near-identical format to MIPS TLB - * entries, each consisting of two 32-bit or 64-bit values ("EntryHi" and - * "EntryLo"). MIPS4k and MIPS64 both define certain bits in TLB entries as - * reserved, and these must be zero-filled by software. We overload these - * bits in PTE entries to hold PTE_ flags such as RO, W, and MANAGED. - * However, we must mask these out when writing to TLB entries to ensure that - * they do not become visible to hardware -- especially on MIPS64r2 which has - * an extended physical memory space. - * - * When using n64 and n32, shift software-defined bits into the MIPS64r2 - * reserved range, which runs from bit 55 ... 63. In other configurations - * (32-bit MIPS4k and compatible), shift them out to bits 29 ... 31. - * - * NOTE: This means that for 32-bit use of CP0, we aren't able to set the top - * bit of PFN to a non-zero value, as software is using it! This physical - * memory size limit may not be sufficiently enforced elsewhere. + * PFN for EntryLo register. Upper bits are 0, which is to say that + * bit 28 is the last hardware bit; Bits 29 and upwards (EntryLo is + * 64 bit though it can be referred to in 32-bits providing 3 software + * bits safely. We use it as 64 bits to get many software bits, and + * god knows what else.) are unacknowledged by hardware. They may be + * written as anything, but otherwise they have as much meaning as + * other 0 fields. */ #if defined(__mips_n64) || defined(__mips_n32) /* PHYSADDR_64_BIT */ -#define TLBLO_SWBITS_SHIFT (55) -#define TLBLO_SWBITS_CLEAR_SHIFT (9) +#define TLBLO_SWBITS_SHIFT (34) #define TLBLO_PFN_MASK 0x3FFFFFFC0ULL #else #define TLBLO_SWBITS_SHIFT (29) @@ -143,9 +133,6 @@ typedef pt_entry_t *pd_entry_t; * listen to requests to write to it. * W: Wired. ??? * MANAGED:Managed. This PTE maps a managed page. - * - * These bits should not be written into the TLB, so must first be masked out - * explicitly in C, or using CLEAR_PTE_SWBITS() in assembly. */ #define PTE_RO ((pt_entry_t)0x01 << TLBLO_SWBITS_SHIFT) #define PTE_W ((pt_entry_t)0x02 << TLBLO_SWBITS_SHIFT) @@ -175,7 +162,7 @@ typedef pt_entry_t *pd_entry_t; #define PTESIZE 4 #define PTE_L lw #define PTE_MTC0 mtc0 -#define CLEAR_PTE_SWBITS(r) LONG_SLL r, TLBLO_SWBITS_CLEAR_SHIFT; LONG_SRL r, TLBLO_SWBITS_CLEAR_SHIFT /* remove swbits */ +#define CLEAR_PTE_SWBITS(r) sll r, 3; srl r, 3 /* remove 3 high bits */ #endif /* defined(__mips_n64) || defined(__mips_n32) */ #if defined(__mips_n64) Modified: head/sys/sys/time.h ============================================================================== --- head/sys/sys/time.h Wed Oct 23 13:22:50 2013 (r256962) +++ head/sys/sys/time.h Wed Oct 23 13:32:52 2013 (r256963) @@ -422,6 +422,15 @@ void bintime(struct bintime *bt); void nanotime(struct timespec *tsp); void microtime(struct timeval *tvp); +static __inline sbintime_t +sbintime(void) +{ + struct bintime bt; + + bintime(&bt); + return (bttosbt(bt)); +} + void getbinuptime(struct bintime *bt); void getnanouptime(struct timespec *tsp); void getmicrouptime(struct timeval *tvp); @@ -439,6 +448,15 @@ void getbintime(struct bintime *bt); void getnanotime(struct timespec *tsp); void getmicrotime(struct timeval *tvp); +static __inline sbintime_t +getsbintime(void) +{ + struct bintime bt; + + getbintime(&bt); + return (bttosbt(bt)); +} + /* Other functions */ int itimerdecr(struct itimerval *itp, int usec); int itimerfix(struct timeval *tv); From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 13:55:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1CE59E39; Wed, 23 Oct 2013 13:55:43 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F08D3211A; Wed, 23 Oct 2013 13:55:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NDtgeL095836; Wed, 23 Oct 2013 13:55:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NDtgvN095831; Wed, 23 Oct 2013 13:55:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310231355.r9NDtgvN095831@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 23 Oct 2013 13:55:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256966 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 13:55:43 -0000 Author: nwhitehorn Date: Wed Oct 23 13:55:41 2013 New Revision: 256966 URL: http://svnweb.freebsd.org/changeset/base/256966 Log: Make all Open Firmware internal interfaces endian-safe by using the new OF_getencprop() API. This removes one explicit endianness conversion in ofw_iicbus.c. Modified: head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/ofw_console.c head/sys/dev/ofw/ofw_iicbus.c head/sys/dev/ofw/openfirm.c Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Wed Oct 23 13:40:52 2013 (r256965) +++ head/sys/dev/ofw/ofw_bus_subr.c Wed Oct 23 13:55:41 2013 (r256966) @@ -214,14 +214,14 @@ ofw_bus_setup_iinfo(phandle_t node, stru pcell_t addrc; int msksz; - if (OF_getprop(node, "#address-cells", &addrc, sizeof(addrc)) == -1) + if (OF_getencprop(node, "#address-cells", &addrc, sizeof(addrc)) == -1) addrc = 2; ii->opi_addrc = addrc * sizeof(pcell_t); - ii->opi_imapsz = OF_getprop_alloc(node, "interrupt-map", 1, + ii->opi_imapsz = OF_getencprop_alloc(node, "interrupt-map", 1, (void **)&ii->opi_imap); if (ii->opi_imapsz > 0) { - msksz = OF_getprop_alloc(node, "interrupt-map-mask", 1, + msksz = OF_getencprop_alloc(node, "interrupt-map-mask", 1, (void **)&ii->opi_imapmsk); /* * Failure to get the mask is ignored; a full mask is used @@ -246,7 +246,7 @@ ofw_bus_lookup_imap(phandle_t node, stru ("ofw_bus_lookup_imap: register size too small: %d < %d", regsz, ii->opi_addrc)); if (node != -1) { - rv = OF_getprop(node, "reg", reg, regsz); + rv = OF_getencprop(node, "reg", reg, regsz); if (rv < regsz) panic("ofw_bus_lookup_imap: cannot get reg property"); } @@ -301,8 +301,8 @@ ofw_bus_search_intrmap(void *intr, int i i = imapsz; while (i > 0) { bcopy(mptr + physsz + intrsz, &parent, sizeof(parent)); - if (OF_searchprop(OF_xref_phandle(parent), "#interrupt-cells", - &pintrsz, sizeof(pintrsz)) == -1) + if (OF_searchencprop(OF_xref_phandle(parent), + "#interrupt-cells", &pintrsz, sizeof(pintrsz)) == -1) pintrsz = 1; /* default */ pintrsz *= sizeof(pcell_t); Modified: head/sys/dev/ofw/ofw_console.c ============================================================================== --- head/sys/dev/ofw/ofw_console.c Wed Oct 23 13:40:52 2013 (r256965) +++ head/sys/dev/ofw/ofw_console.c Wed Oct 23 13:55:41 2013 (r256966) @@ -106,8 +106,8 @@ cn_drvinit(void *unused) SYSINIT(cndev, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE, cn_drvinit, NULL); -static int stdin; -static int stdout; +static pcell_t stdin; +static pcell_t stdout; static int ofwtty_open(struct tty *tp) @@ -170,12 +170,12 @@ ofw_cnprobe(struct consdev *cp) return; } - if (OF_getprop(chosen, "stdin", &stdin, sizeof(stdin)) == -1) { + if (OF_getencprop(chosen, "stdin", &stdin, sizeof(stdin)) == -1) { cp->cn_pri = CN_DEAD; return; } - if (OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)) == -1) { + if (OF_getencprop(chosen, "stdout", &stdout, sizeof(stdout)) == -1) { cp->cn_pri = CN_DEAD; return; } Modified: head/sys/dev/ofw/ofw_iicbus.c ============================================================================== --- head/sys/dev/ofw/ofw_iicbus.c Wed Oct 23 13:40:52 2013 (r256965) +++ head/sys/dev/ofw/ofw_iicbus.c Wed Oct 23 13:55:41 2013 (r256966) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -104,7 +103,6 @@ ofw_iicbus_attach(device_t dev) phandle_t child; pcell_t paddr; device_t childdev; - uint32_t addr; sc->dev = dev; mtx_init(&sc->lock, "iicbus", NULL, MTX_DEF); @@ -123,11 +121,12 @@ ofw_iicbus_attach(device_t dev) * property, then try the reg property. It moves around * on different systems. */ - if (OF_getprop(child, "i2c-address", &paddr, sizeof(paddr)) == -1) - if (OF_getprop(child, "reg", &paddr, sizeof(paddr)) == -1) + if (OF_getencprop(child, "i2c-address", &paddr, + sizeof(paddr)) == -1) + if (OF_getencprop(child, "reg", &paddr, + sizeof(paddr)) == -1) continue; - addr = fdt32_to_cpu(paddr); /* * Now set up the I2C and OFW bus layer devinfo and add it * to the bus. @@ -136,7 +135,7 @@ ofw_iicbus_attach(device_t dev) M_NOWAIT | M_ZERO); if (dinfo == NULL) continue; - dinfo->opd_dinfo.addr = addr; + dinfo->opd_dinfo.addr = paddr; if (ofw_bus_gen_setup_devinfo(&dinfo->opd_obdinfo, child) != 0) { free(dinfo, M_DEVBUF); Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Wed Oct 23 13:40:52 2013 (r256965) +++ head/sys/dev/ofw/openfirm.c Wed Oct 23 13:55:41 2013 (r256966) @@ -135,7 +135,8 @@ OF_init(void *cookie) rv = OFW_INIT(ofw_obj, cookie); if ((chosen = OF_finddevice("/chosen")) != -1) - if (OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)) == -1) + if (OF_getencprop(chosen, "stdout", &stdout, + sizeof(stdout)) == -1) stdout = -1; return (rv); @@ -354,11 +355,9 @@ OF_getencprop_alloc(phandle_t package, c pcell_t *cell; int i; - KASSERT(elsz % 4 == 0, ("Need a multiple of 4 bytes")); - retval = OF_getprop_alloc(package, name, elsz, buf); - if (retval == -1) - return (retval); + if (retval == -1 || retval*elsz % 4 != 0) + return (-1); cell = *buf; for (i = 0; i < retval*elsz/4; i++) @@ -450,9 +449,9 @@ OF_child_xref_phandle(phandle_t parent, if (rxref != -1) return (rxref); - if (OF_getprop(child, "phandle", &rxref, sizeof(rxref)) == -1 && - OF_getprop(child, "ibm,phandle", &rxref, - sizeof(rxref)) == -1 && OF_getprop(child, + if (OF_getencprop(child, "phandle", &rxref, sizeof(rxref)) == + -1 && OF_getencprop(child, "ibm,phandle", &rxref, + sizeof(rxref)) == -1 && OF_getencprop(child, "linux,phandle", &rxref, sizeof(rxref)) == -1) continue; From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 14:04:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1BFF416F; Wed, 23 Oct 2013 14:04:11 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EDE3E2185; Wed, 23 Oct 2013 14:04:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NE4AfW099161; Wed, 23 Oct 2013 14:04:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NE49C0099156; Wed, 23 Oct 2013 14:04:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310231404.r9NE49C0099156@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 23 Oct 2013 14:04:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256967 - in head/sys: arm/mv dev/fdt dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 14:04:11 -0000 Author: nwhitehorn Date: Wed Oct 23 14:04:09 2013 New Revision: 256967 URL: http://svnweb.freebsd.org/changeset/base/256967 Log: Remove OF_instance_to_package() hack for FDT and replace with use of the generic OF_xref_phandle() API universally. Also replace some related explicit uses of fdt32_to_cpu() with OF_getencprop() calls. Modified: head/sys/arm/mv/gpio.c head/sys/dev/fdt/fdt_common.c head/sys/dev/fdt/fdt_pci.c head/sys/dev/fdt/simplebus.c head/sys/dev/ofw/ofw_fdt.c Modified: head/sys/arm/mv/gpio.c ============================================================================== --- head/sys/arm/mv/gpio.c Wed Oct 23 13:55:41 2013 (r256966) +++ head/sys/arm/mv/gpio.c Wed Oct 23 14:04:09 2013 (r256967) @@ -605,7 +605,6 @@ int platform_gpio_init(void) { phandle_t child, parent, root, ctrl; - ihandle_t ctrl_ihandle; pcell_t gpios[MAX_PINS_PER_NODE * GPIOS_PROP_CELLS]; struct gpio_ctrl_entry *e; int len, rv; @@ -639,9 +638,7 @@ platform_gpio_init(void) * contain a ref. to a node defining GPIO * controller. */ - ctrl_ihandle = (ihandle_t)gpios[0]; - ctrl_ihandle = fdt32_to_cpu(ctrl_ihandle); - ctrl = OF_instance_to_package(ctrl_ihandle); + ctrl = OF_xref_handle(fdt32_to_cpu(gpios[0])); if (fdt_is_compatible(ctrl, e->compat)) /* Call a handler. */ Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Wed Oct 23 13:55:41 2013 (r256966) +++ head/sys/dev/fdt/fdt_common.c Wed Oct 23 14:04:09 2013 (r256967) @@ -523,7 +523,7 @@ fdt_intr_to_rl(phandle_t node, struct re /* * Find #interrupt-cells of the interrupt domain. */ - if (OF_getprop(node, "interrupt-parent", &iph, sizeof(iph)) <= 0) { + if (OF_getencprop(node, "interrupt-parent", &iph, sizeof(iph)) <= 0) { debugf("no intr-parent phandle\n"); intr_par = OF_parent(node); } else { @@ -583,7 +583,7 @@ fdt_get_phyaddr(phandle_t node, device_t uint32_t i; device_t parent, child; - if (OF_getprop(node, "phy-handle", (void *)&phy_handle, + if (OF_getencprop(node, "phy-handle", (void *)&phy_handle, sizeof(phy_handle)) <= 0) return (ENXIO); Modified: head/sys/dev/fdt/fdt_pci.c ============================================================================== --- head/sys/dev/fdt/fdt_pci.c Wed Oct 23 13:55:41 2013 (r256966) +++ head/sys/dev/fdt/fdt_pci.c Wed Oct 23 14:04:09 2013 (r256967) @@ -255,7 +255,7 @@ fdt_pci_route_intr(int bus, int slot, in struct fdt_pci_intr *intr_info, int *interrupt) { pcell_t child_spec[4], masked[4]; - ihandle_t iph; + phandle_t iph; pcell_t intr_par; pcell_t *map_ptr; uint32_t addr; @@ -280,7 +280,7 @@ fdt_pci_route_intr(int bus, int slot, in i = 0; while (i < map_len) { iph = fdt32_to_cpu(map_ptr[par_idx]); - intr_par = OF_instance_to_package(iph); + intr_par = OF_xref_phandle(iph); err = fdt_addr_cells(intr_par, &par_addr_cells); if (err != 0) { Modified: head/sys/dev/fdt/simplebus.c ============================================================================== --- head/sys/dev/fdt/simplebus.c Wed Oct 23 13:55:41 2013 (r256966) +++ head/sys/dev/fdt/simplebus.c Wed Oct 23 14:04:09 2013 (r256967) @@ -339,8 +339,7 @@ simplebus_get_interrupt_parent(device_t struct simplebus_devinfo *di; struct fdt_ic *ic; device_t ip; - ihandle_t iph; - phandle_t ph; + phandle_t ph, iph; ip = NULL; @@ -348,10 +347,9 @@ simplebus_get_interrupt_parent(device_t if (di == NULL) return (NULL); - if (OF_getprop(di->di_ofw.obd_node, "interrupt-parent", &iph, + if (OF_getencprop(di->di_ofw.obd_node, "interrupt-parent", &iph, sizeof(iph)) > 0) { - iph = fdt32_to_cpu(iph); - ph = OF_instance_to_package(iph); + ph = OF_xref_phandle(iph); SLIST_FOREACH(ic, &fdt_ic_list_head, fdt_ics) { if (ic->iph == ph) { ip = ic->dev; Modified: head/sys/dev/ofw/ofw_fdt.c ============================================================================== --- head/sys/dev/ofw/ofw_fdt.c Wed Oct 23 13:55:41 2013 (r256966) +++ head/sys/dev/ofw/ofw_fdt.c Wed Oct 23 14:04:09 2013 (r256967) @@ -226,20 +226,8 @@ ofw_fdt_parent(ofw_t ofw, phandle_t node static phandle_t ofw_fdt_instance_to_package(ofw_t ofw, ihandle_t instance) { - int offset; - - /* - * Note: FDT does not have the notion of instances, but we somewhat - * abuse the semantics and let treat as 'instance' the internal - * 'phandle' prop, so that ofw I/F consumers have a uniform way of - * translation between internal representation (which appear in some - * contexts as property values) and effective phandles. - */ - offset = fdt_node_offset_by_phandle(fdtp, instance); - if (offset < 0) - return (-1); - return (fdt_offset_phandle(offset)); + return (-1); } /* Get the length of a property of a package. */ From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 14:06:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9131D2C9; Wed, 23 Oct 2013 14:06:08 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7DF052196; Wed, 23 Oct 2013 14:06:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NE68La099509; Wed, 23 Oct 2013 14:06:08 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NE6718099506; Wed, 23 Oct 2013 14:06:07 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201310231406.r9NE6718099506@svn.freebsd.org> From: Baptiste Daroussin Date: Wed, 23 Oct 2013 14:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256968 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 14:06:08 -0000 Author: bapt Date: Wed Oct 23 14:06:07 2013 New Revision: 256968 URL: http://svnweb.freebsd.org/changeset/base/256968 Log: Improve SRV records support for the pkg(8) bootstrap: - order srv records by priorities - for all entries of the same priority, order randomly respect the weight - select the port where to fetch from respect the port provided in the SRV record Obtained from: pkg git repo MFC after: 3 days Modified: head/usr.sbin/pkg/dns_utils.c head/usr.sbin/pkg/dns_utils.h head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/dns_utils.c ============================================================================== --- head/usr.sbin/pkg/dns_utils.c Wed Oct 23 14:04:09 2013 (r256967) +++ head/usr.sbin/pkg/dns_utils.c Wed Oct 23 14:06:07 2013 (r256968) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Baptiste Daroussin + * Copyright (c) 2012-2013 Baptiste Daroussin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,6 +39,77 @@ typedef union { unsigned char buf[1024]; } dns_query; +static int +srv_priority_cmp(const void *a, const void *b) +{ + unsigned int r, l; + struct dns_srvinfo *da, *db; + + da = *(struct dns_srvinfo **)a; + db = *(struct dns_srvinfo **)b; + + l = da->priority; + r = db->priority; + + return ((l > r) - (l < r)); +} + +static int +srv_final_cmp(const void *a, const void *b) +{ + unsigned int r, l, wr, wl; + int res; + struct dns_srvinfo *da, *db; + + da = *(struct dns_srvinfo **)a; + db = *(struct dns_srvinfo **)b; + + l = da->priority; + r = db->priority; + + res = ((l > r) - (l < r)); + + if (res == 0) { + wl = da->finalweight; + wr = db->finalweight; + res = ((wr > wl) - (wr < wl)); + } + + return (res); +} + +static void +compute_weight(struct dns_srvinfo **d, int first, int last) +{ + int i, j, totalweight; + int *chosen; + + chosen = malloc(sizeof(int) * (last - first + 1)); + totalweight = 0; + + for (i = 0; i <= last; i++) + totalweight += d[i]->weight; + + if (totalweight == 0) + return; + + for (i = 0; i <= last; i++) { + for (;;) { + chosen[i] = random() % (d[i]->weight * 100 / totalweight); + for (j = 0; j < i; j++) { + if (chosen[i] == chosen[j]) + break; + } + if (j == i) { + d[i]->finalweight = chosen[i]; + break; + } + } + } + + free(chosen); +} + struct dns_srvinfo * dns_getsrvinfo(const char *zone) { @@ -46,7 +117,7 @@ dns_getsrvinfo(const char *zone) unsigned char *end, *p; char host[MAXHOSTNAMELEN]; dns_query q; - int len, qdcount, ancount, n, i; + int len, qdcount, ancount, n, i, f, l; unsigned int type, class, ttl, priority, weight, port; if ((len = res_query(zone, C_IN, T_SRV, q.buf, sizeof(q.buf))) == -1 || @@ -125,6 +196,21 @@ dns_getsrvinfo(const char *zone) n++; } + qsort(res, n, sizeof(res[0]), srv_priority_cmp); + + priority = f = l = 0; + for (i = 0; i < n; i++) { + if (res[i]->priority != priority) { + if (f != l) + compute_weight(res, f, l); + f = i; + priority = res[i]->priority; + } + l = i; + } + + qsort(res, n, sizeof(res[0]), srv_final_cmp); + for (i = 0; i < n - 1; i++) res[i]->next = res[i + 1]; Modified: head/usr.sbin/pkg/dns_utils.h ============================================================================== --- head/usr.sbin/pkg/dns_utils.h Wed Oct 23 14:04:09 2013 (r256967) +++ head/usr.sbin/pkg/dns_utils.h Wed Oct 23 14:06:07 2013 (r256968) @@ -35,6 +35,7 @@ struct dns_srvinfo { unsigned int priority; unsigned int weight; unsigned int port; + unsigned int finalweight; char host[MAXHOSTNAMELEN]; struct dns_srvinfo *next; }; Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Wed Oct 23 14:04:09 2013 (r256967) +++ head/usr.sbin/pkg/pkg.c Wed Oct 23 14:06:07 2013 (r256968) @@ -191,8 +191,10 @@ bootstrap_pkg(void) } } - if (mirrors != NULL) + if (mirrors != NULL) { strlcpy(u->host, current->host, sizeof(u->host)); + u->port = current->port; + } remote = fetchXGet(u, &st, ""); if (remote == NULL) { From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 14:06:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EECA9421; Wed, 23 Oct 2013 14:06:41 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DC2A921A4; Wed, 23 Oct 2013 14:06:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NE6ffa099619; Wed, 23 Oct 2013 14:06:41 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NE6fEA099618; Wed, 23 Oct 2013 14:06:41 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310231406.r9NE6fEA099618@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 23 Oct 2013 14:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256969 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 14:06:42 -0000 Author: nwhitehorn Date: Wed Oct 23 14:06:41 2013 New Revision: 256969 URL: http://svnweb.freebsd.org/changeset/base/256969 Log: Use OF_getencprop() in preference to OF_getprop() for numerical quantities. Since all supported PowerPC systems are big-endian, this is a no-op, but this is preparatory work to moving this to /sys/dev/ofw. Modified: head/sys/powerpc/powerpc/nexus.c Modified: head/sys/powerpc/powerpc/nexus.c ============================================================================== --- head/sys/powerpc/powerpc/nexus.c Wed Oct 23 14:06:07 2013 (r256968) +++ head/sys/powerpc/powerpc/nexus.c Wed Oct 23 14:06:41 2013 (r256969) @@ -248,9 +248,9 @@ nexus_attach(device_t dev) * Some important numbers */ sc->acells = 2; - OF_getprop(node, "#address-cells", &sc->acells, sizeof(sc->acells)); + OF_getencprop(node, "#address-cells", &sc->acells, sizeof(sc->acells)); sc->scells = 1; - OF_getprop(node, "#size-cells", &sc->scells, sizeof(sc->scells)); + OF_getencprop(node, "#size-cells", &sc->scells, sizeof(sc->scells)); /* * Now walk the OFW tree and attach top-level devices. @@ -564,7 +564,7 @@ nexus_setup_dinfo(device_t dev, phandle_ } resource_list_init(&ndi->ndi_rl); - nreg = OF_getprop_alloc(node, "reg", sizeof(*reg), (void **)®); + nreg = OF_getencprop_alloc(node, "reg", sizeof(*reg), (void **)®); if (nreg == -1) nreg = 0; if (nreg % (sc->acells + sc->scells) != 0) { @@ -591,7 +591,7 @@ nexus_setup_dinfo(device_t dev, phandle_ } free(reg, M_OFWPROP); - nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intr), + nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), (void **)&intr); if (nintr > 0) { iparent = 0; From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 14:23:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AE8828C7; Wed, 23 Oct 2013 14:23:48 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9B68D22D9; Wed, 23 Oct 2013 14:23:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NENmdR006257; Wed, 23 Oct 2013 14:23:48 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NENm8T006256; Wed, 23 Oct 2013 14:23:48 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201310231423.r9NENm8T006256@svn.freebsd.org> From: Baptiste Daroussin Date: Wed, 23 Oct 2013 14:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256971 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 14:23:48 -0000 Author: bapt Date: Wed Oct 23 14:23:48 2013 New Revision: 256971 URL: http://svnweb.freebsd.org/changeset/base/256971 Log: Allow to bootstrap by doing pkg add ./a/path/to/a/pkg_package.txz Requested by: many MFC after: 3 days Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Wed Oct 23 14:15:46 2013 (r256970) +++ head/usr.sbin/pkg/pkg.c Wed Oct 23 14:23:48 2013 (r256971) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -297,7 +298,9 @@ int main(__unused int argc, char *argv[]) { char pkgpath[MAXPATHLEN]; + char pkgstatic[MAXPATHLEN]; bool yes = false; + int fd, ret; snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg", getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE); @@ -311,6 +314,19 @@ main(__unused int argc, char *argv[]) if (argv[1] != NULL && strcmp(argv[1], "-N") == 0) errx(EXIT_FAILURE, "pkg is not installed"); + if (argc > 2 && strcmp(argv[1], "add") == 0 && + access(argv[2], R_OK) == 0) { + fd = open(argv[2], O_RDONLY); + if (fd == -1) + err(EXIT_FAILURE, "Unable to open %s", argv[2]); + + if ((ret = extract_pkg_static(fd, pkgstatic, MAXPATHLEN)) == 0) + ret = install_pkg_static(pkgstatic, argv[2]); + close(fd); + if (ret != 0) + exit(EXIT_FAILURE); + exit(EXIT_SUCCESS); + } /* * Do not ask for confirmation if either of stdin or stdout is * not tty. Check the environment to see if user has answer From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 14:28:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1A278B52; Wed, 23 Oct 2013 14:28:43 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 073D5233C; Wed, 23 Oct 2013 14:28:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NESgnc006886; Wed, 23 Oct 2013 14:28:42 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NESgUq006885; Wed, 23 Oct 2013 14:28:42 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310231428.r9NESgUq006885@svn.freebsd.org> From: Brooks Davis Date: Wed, 23 Oct 2013 14:28:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256972 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 14:28:43 -0000 Author: brooks Date: Wed Oct 23 14:28:42 2013 New Revision: 256972 URL: http://svnweb.freebsd.org/changeset/base/256972 Log: Revert addition of sbintime and getsbintime that crept into r256963. Pointyhat: brooks Modified: head/sys/sys/time.h Modified: head/sys/sys/time.h ============================================================================== --- head/sys/sys/time.h Wed Oct 23 14:23:48 2013 (r256971) +++ head/sys/sys/time.h Wed Oct 23 14:28:42 2013 (r256972) @@ -422,15 +422,6 @@ void bintime(struct bintime *bt); void nanotime(struct timespec *tsp); void microtime(struct timeval *tvp); -static __inline sbintime_t -sbintime(void) -{ - struct bintime bt; - - bintime(&bt); - return (bttosbt(bt)); -} - void getbinuptime(struct bintime *bt); void getnanouptime(struct timespec *tsp); void getmicrouptime(struct timeval *tvp); @@ -448,15 +439,6 @@ void getbintime(struct bintime *bt); void getnanotime(struct timespec *tsp); void getmicrotime(struct timeval *tvp); -static __inline sbintime_t -getsbintime(void) -{ - struct bintime bt; - - getbintime(&bt); - return (bttosbt(bt)); -} - /* Other functions */ int itimerdecr(struct itimerval *itp, int usec); int itimerfix(struct timeval *tv); From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 14:29:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F2BC6C92; Wed, 23 Oct 2013 14:28:59 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DFFC92347; Wed, 23 Oct 2013 14:28:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NESxCJ006947; Wed, 23 Oct 2013 14:28:59 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NESxii006946; Wed, 23 Oct 2013 14:28:59 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310231428.r9NESxii006946@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 23 Oct 2013 14:28:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256973 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 14:29:00 -0000 Author: nwhitehorn Date: Wed Oct 23 14:28:59 2013 New Revision: 256973 URL: http://svnweb.freebsd.org/changeset/base/256973 Log: If the device tree directly contains the timebase frequency, use it. This property is required by ePAPR, but maintain the fallback to bus-frequency for compatibility. MFC after: 2 weeks Modified: head/sys/powerpc/booke/platform_bare.c Modified: head/sys/powerpc/booke/platform_bare.c ============================================================================== --- head/sys/powerpc/booke/platform_bare.c Wed Oct 23 14:28:42 2013 (r256972) +++ head/sys/powerpc/booke/platform_bare.c Wed Oct 23 14:28:59 2013 (r256973) @@ -188,6 +188,10 @@ bare_timebase_freq(platform_t plat, stru if ((child = OF_child(cpus)) == 0) goto out; + if (OF_getprop(child, "timebase-frequency", (void *)&ticks, + sizeof(ticks)) == sizeof(ticks)) + goto out; + freq = 0; if (OF_getprop(child, "bus-frequency", (void *)&freq, sizeof(freq)) <= 0) From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 14:34:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0587233F; Wed, 23 Oct 2013 14:34:05 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E58A02415; Wed, 23 Oct 2013 14:34:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NEY4RZ009700; Wed, 23 Oct 2013 14:34:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NEY4wn009699; Wed, 23 Oct 2013 14:34:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310231434.r9NEY4wn009699@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 23 Oct 2013 14:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256974 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 14:34:05 -0000 Author: nwhitehorn Date: Wed Oct 23 14:34:04 2013 New Revision: 256974 URL: http://svnweb.freebsd.org/changeset/base/256974 Log: A quick addendum: the standard says that timebase-frequency can be either 32 or 64 bits, so allow either. Modified: head/sys/powerpc/booke/platform_bare.c Modified: head/sys/powerpc/booke/platform_bare.c ============================================================================== --- head/sys/powerpc/booke/platform_bare.c Wed Oct 23 14:28:59 2013 (r256973) +++ head/sys/powerpc/booke/platform_bare.c Wed Oct 23 14:34:04 2013 (r256974) @@ -188,9 +188,24 @@ bare_timebase_freq(platform_t plat, stru if ((child = OF_child(cpus)) == 0) goto out; - if (OF_getprop(child, "timebase-frequency", (void *)&ticks, - sizeof(ticks)) == sizeof(ticks)) - goto out; + switch (OF_getproplen(child, "timebase-frequency")) { + case 4: + { + uint32_t tbase; + OF_getprop(child, "timebase-frequency", &tbase, sizeof(tbase)); + ticks = tbase; + return (ticks); + } + case 8: + { + uint64_t tbase; + OF_getprop(child, "timebase-frequency", &tbase, sizeof(tbase)); + ticks = tbase; + return (ticks); + } + default: + break; + } freq = 0; if (OF_getprop(child, "bus-frequency", (void *)&freq, From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 14:58:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 860F2B7C; Wed, 23 Oct 2013 14:58:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 71CAB25DF; Wed, 23 Oct 2013 14:58:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NEwAjG017115; Wed, 23 Oct 2013 14:58:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NEwAeB017114; Wed, 23 Oct 2013 14:58:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310231458.r9NEwAeB017114@svn.freebsd.org> From: Alexander Motin Date: Wed, 23 Oct 2013 14:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256975 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 14:58:10 -0000 Author: mav Date: Wed Oct 23 14:58:09 2013 New Revision: 256975 URL: http://svnweb.freebsd.org/changeset/base/256975 Log: Minor (mostly cosmetical) addition to r256960. Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Wed Oct 23 14:34:04 2013 (r256974) +++ head/sys/cam/cam_xpt.c Wed Oct 23 14:58:09 2013 (r256975) @@ -5293,7 +5293,6 @@ camisr_runqueue(void) while ((ccb_h = STAILQ_FIRST(&queue->cam_doneq)) != NULL) { STAILQ_REMOVE_HEAD(&queue->cam_doneq, sim_links.stqe); mtx_unlock(&queue->cam_doneq_mtx); - ccb_h->pinfo.index = CAM_UNQUEUED_INDEX; xpt_done_process(ccb_h); mtx_lock(&queue->cam_doneq_mtx); } From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 15:24:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C60BF427; Wed, 23 Oct 2013 15:24:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9A455272C; Wed, 23 Oct 2013 15:24:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NFO5gY027062; Wed, 23 Oct 2013 15:24:05 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NFO5ki027061; Wed, 23 Oct 2013 15:24:05 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310231524.r9NFO5ki027061@svn.freebsd.org> From: Brooks Davis Date: Wed, 23 Oct 2013 15:24:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256977 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 15:24:05 -0000 Author: brooks Date: Wed Oct 23 15:24:05 2013 New Revision: 256977 URL: http://svnweb.freebsd.org/changeset/base/256977 Log: BERI_SIM.hint is no longer used, remove it. MFC after: 3 days Sponsored by: DARPA/AFRL Deleted: head/sys/mips/conf/BERI_SIM.hints From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 15:29:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BE8795F2; Wed, 23 Oct 2013 15:29:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AC1052774; Wed, 23 Oct 2013 15:29:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NFTgu0027700; Wed, 23 Oct 2013 15:29:42 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NFTg1p027699; Wed, 23 Oct 2013 15:29:42 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201310231529.r9NFTg1p027699@svn.freebsd.org> From: Baptiste Daroussin Date: Wed, 23 Oct 2013 15:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256978 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 15:29:42 -0000 Author: bapt Date: Wed Oct 23 15:29:42 2013 New Revision: 256978 URL: http://svnweb.freebsd.org/changeset/base/256978 Log: Fix build with gcc MFC after: 3 days Modified: head/usr.sbin/pkg/dns_utils.c Modified: head/usr.sbin/pkg/dns_utils.c ============================================================================== --- head/usr.sbin/pkg/dns_utils.c Wed Oct 23 15:24:05 2013 (r256977) +++ head/usr.sbin/pkg/dns_utils.c Wed Oct 23 15:29:42 2013 (r256978) @@ -42,11 +42,11 @@ typedef union { static int srv_priority_cmp(const void *a, const void *b) { + const struct dns_srvinfo *da, *db; unsigned int r, l; - struct dns_srvinfo *da, *db; - da = *(struct dns_srvinfo **)a; - db = *(struct dns_srvinfo **)b; + da = *(struct dns_srvinfo * const *)a; + db = *(struct dns_srvinfo * const *)b; l = da->priority; r = db->priority; @@ -57,12 +57,12 @@ srv_priority_cmp(const void *a, const vo static int srv_final_cmp(const void *a, const void *b) { + const struct dns_srvinfo *da, *db; unsigned int r, l, wr, wl; int res; - struct dns_srvinfo *da, *db; - da = *(struct dns_srvinfo **)a; - db = *(struct dns_srvinfo **)b; + da = *(struct dns_srvinfo * const *)a; + db = *(struct dns_srvinfo * const *)b; l = da->priority; r = db->priority; From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 16:55:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 961A9CE3; Wed, 23 Oct 2013 16:55:21 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 806C62D77; Wed, 23 Oct 2013 16:55:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NGtLP0057394; Wed, 23 Oct 2013 16:55:21 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NGtKvq057361; Wed, 23 Oct 2013 16:55:20 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201310231655.r9NGtKvq057361@svn.freebsd.org> From: John-Mark Gurney Date: Wed, 23 Oct 2013 16:55:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256982 - in stable/10: etc/defaults etc/rc.d etc/sendmail share/man/man8 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 16:55:21 -0000 Author: jmg Date: Wed Oct 23 16:55:20 2013 New Revision: 256982 URL: http://svnweb.freebsd.org/changeset/base/256982 Log: MFC r256773: Enable the automatic creation of a certificate (if one does not exists) and enable the usage by sendmail if sendmail is enabled. Reviewed by: gshapiro Approved by: re (gjb) Modified: stable/10/etc/defaults/rc.conf stable/10/etc/rc.d/sendmail stable/10/etc/sendmail/freebsd.mc stable/10/share/man/man8/rc.sendmail.8 Directory Properties: stable/10/etc/ (props changed) stable/10/etc/rc.d/ (props changed) stable/10/share/man/man8/ (props changed) Modified: stable/10/etc/defaults/rc.conf ============================================================================== --- stable/10/etc/defaults/rc.conf Wed Oct 23 16:14:48 2013 (r256981) +++ stable/10/etc/defaults/rc.conf Wed Oct 23 16:55:20 2013 (r256982) @@ -573,6 +573,8 @@ sendmail_enable="NO" # Run the sendmail sendmail_pidfile="/var/run/sendmail.pid" # sendmail pid file sendmail_procname="/usr/sbin/sendmail" # sendmail process name sendmail_flags="-L sm-mta -bd -q30m" # Flags to sendmail (as a server) +sendmail_cert_create="YES" # Create a server certificate if none (YES/NO) +#sendmail_cert_cn="CN" # CN of the generate certificate sendmail_submit_enable="YES" # Start a localhost-only MTA for mail submission sendmail_submit_flags="-L sm-mta -bd -q30m -ODaemonPortOptions=Addr=localhost" # Flags for localhost-only MTA Modified: stable/10/etc/rc.d/sendmail ============================================================================== --- stable/10/etc/rc.d/sendmail Wed Oct 23 16:14:48 2013 (r256981) +++ stable/10/etc/rc.d/sendmail Wed Oct 23 16:55:20 2013 (r256982) @@ -24,6 +24,8 @@ command=${sendmail_program:-/usr/sbin/${ pidfile=${sendmail_pidfile:-/var/run/${name}.pid} procname=${sendmail_procname:-/usr/sbin/${name}} +CERTDIR=/etc/mail/certs + case ${sendmail_enable} in [Nn][Oo][Nn][Ee]) sendmail_enable="NO" @@ -44,6 +46,118 @@ if checkyesno sendmail_submit_enable; th sendmail_outbound_enable="NO" fi +sendmail_cert_create() +{ + cnname="${sendmail_cert_cn:-`hostname`}" + cnname="${cnname:-amnesiac}" + + # based upon: + # http://www.sendmail.org/~ca/email/other/cagreg.html + CAdir=`mktemp -d` && + certpass=`(date; ps ax ; hostname) | md5 -q` + + # make certificate authority + ( cd "$CAdir" && + chmod 700 "$CAdir" && + mkdir certs crl newcerts && + echo "01" > serial && + :> index.txt && + + cat <<-OPENSSL_CNF > openssl.cnf && + RANDFILE = $CAdir/.rnd + [ ca ] + default_ca = CA_default + [ CA_default ] + dir = . + certs = \$dir/certs # Where the issued certs are kept + crl_dir = \$dir/crl # Where the issued crl are kept + database = \$dir/index.txt # database index file. + new_certs_dir = \$dir/newcerts # default place for new certs. + certificate = \$dir/cacert.pem # The CA certificate + serial = \$dir/serial # The current serial number + crlnumber = \$dir/crlnumber # the current crl number + crl = \$dir/crl.pem # The current CRL + private_key = \$dir/cakey.pem + x509_extensions = usr_cert # The extentions to add to the cert + name_opt = ca_default # Subject Name options + cert_opt = ca_default # Certificate field options + default_days = 365 # how long to certify for + default_crl_days= 30 # how long before next CRL + default_md = default # use public key default MD + preserve = no # keep passed DN ordering + policy = policy_anything + [ policy_anything ] + countryName = optional + stateOrProvinceName = optional + localityName = optional + organizationName = optional + organizationalUnitName = optional + commonName = supplied + emailAddress = optional + [ req ] + default_bits = 2048 + default_keyfile = privkey.pem + distinguished_name = req_distinguished_name + attributes = req_attributes + x509_extensions = v3_ca # The extentions to add to the self signed cert + string_mask = utf8only + prompt = no + [ req_distinguished_name ] + countryName = XX + stateOrProvinceName = Some-state + localityName = Some-city + 0.organizationName = Some-org + CN = $cnname + [ req_attributes ] + challengePassword = foobar + unstructuredName = An optional company name + [ usr_cert ] + basicConstraints=CA:FALSE + nsComment = "OpenSSL Generated Certificate" + subjectKeyIdentifier=hash + authorityKeyIdentifier=keyid,issuer + [ v3_req ] + basicConstraints = CA:FALSE + keyUsage = nonRepudiation, digitalSignature, keyEncipherment + [ v3_ca ] + subjectKeyIdentifier=hash + authorityKeyIdentifier=keyid:always,issuer + basicConstraints = CA:true + OPENSSL_CNF + + # though we use a password, the key is discarded and never used + openssl req -batch -passout pass:"$certpass" -new -x509 \ + -keyout cakey.pem -out cacert.pem -days 3650 \ + -config openssl.cnf -newkey rsa:2048 >/dev/null 2>&1 && + + # make new certificate + openssl req -batch -nodes -new -x509 -keyout newkey.pem \ + -out newreq.pem -days 365 -config openssl.cnf \ + -newkey rsa:2048 >/dev/null 2>&1 && + + # sign certificate + openssl x509 -x509toreq -in newreq.pem -signkey newkey.pem \ + -out tmp.pem >/dev/null 2>&1 && + openssl ca -notext -config openssl.cnf \ + -out newcert.pem -keyfile cakey.pem -cert cacert.pem \ + -key "$certpass" -batch -infiles tmp.pem >/dev/null 2>&1 && + + mkdir -p "$CERTDIR" && + chmod 0755 "$CERTDIR" && + chmod 644 newcert.pem cacert.pem && + chmod 600 newkey.pem && + cp -p newcert.pem "$CERTDIR"/host.cert && + cp -p cacert.pem "$CERTDIR"/cacert.pem && + cp -p newkey.pem "$CERTDIR"/host.key && + ln -s cacert.pem "$CERTDIR"/`openssl x509 -hash -noout \ + -in cacert.pem`.0) + + retVal="$?" + rm -rf "$CAdir" + + return "$retVal" +} + sendmail_precmd() { # Die if there's pre-8.10 custom configuration file. This check is @@ -71,6 +185,17 @@ sendmail_precmd() /usr/bin/newaliases fi fi + + if checkyesno sendmail_cert_create && [ ! \( \ + -f "$CERTDIR/host.cert" -o -f "$CERTDIR/host.key" -o \ + -f "$CERTDIR/cacert.pem" \) ]; then + if ! openssl version >/dev/null 2>&1; then + warn "OpenSSL not available, but sendmail_cert_create is YES." + else + info Creating certificate for sendmail. + sendmail_cert_create + fi + fi } run_rc_command "$1" Modified: stable/10/etc/sendmail/freebsd.mc ============================================================================== --- stable/10/etc/sendmail/freebsd.mc Wed Oct 23 16:14:48 2013 (r256981) +++ stable/10/etc/sendmail/freebsd.mc Wed Oct 23 16:55:20 2013 (r256982) @@ -42,6 +42,11 @@ divert(-1) # /usr/share/sendmail/cf/README or # /usr/src/contrib/sendmail/cf/README # +# +# NOTE: If you enable RunAsUser, make sure that you adjust the permissions +# and owner of the SSL certificates and keys in /etc/mail/certs to be usable +# by that user. +# divert(0) VERSIONID(`$FreeBSD$') @@ -54,6 +59,16 @@ FEATURE(local_lmtp) FEATURE(mailertable, `hash -o /etc/mail/mailertable') FEATURE(virtusertable, `hash -o /etc/mail/virtusertable') +dnl Enable STARTTLS for receiving email. +define(`CERT_DIR', `/etc/mail/certs')dnl +define(`confSERVER_CERT', `CERT_DIR/host.cert')dnl +define(`confSERVER_KEY', `CERT_DIR/host.key')dnl +define(`confCLIENT_CERT', `CERT_DIR/host.cert')dnl +define(`confCLIENT_KEY', `CERT_DIR/host.key')dnl +define(`confCACERT', `CERT_DIR/cacert.pem')dnl +define(`confCACERT_PATH', `CERT_DIR')dnl +define(`confDH_PARAMETERS', `CERT_DIR/dh.param')dnl + dnl Uncomment to allow relaying based on your MX records. dnl NOTE: This can allow sites to use your server as a backup MX without dnl your permission. Modified: stable/10/share/man/man8/rc.sendmail.8 ============================================================================== --- stable/10/share/man/man8/rc.sendmail.8 Wed Oct 23 16:14:48 2013 (r256981) +++ stable/10/share/man/man8/rc.sendmail.8 Wed Oct 23 16:55:20 2013 (r256982) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 30, 2002 +.Dd October 19, 2013 .Dt RC.SENDMAIL 8 .Os .Sh NAME @@ -119,6 +119,42 @@ The .Dq Li NONE option is deprecated and should not be used. It will be removed in a future release. +.It Va sendmail_cert_create +.Pq Vt str +If +.Va sendmail_enable +is set to +.Dq Li YES , +create a signed certificate +.Pa /etc/mail/certs/host.cert +representing +.Pa /etc/mail/certs/host.key +by the CA certificate in +.Pa /etc/mail/certs/cacert.pem . +This will enable connecting hosts to negotiate STARTTLS allowing incoming +email to be encrypted in transit. +.Xr sendmail 8 +needs to be configured to use these generated files. +The default configuration in +.Pa /etc/mail/freebsd.mc +has the required options in it. +.It Va sendmail_cert_cn +.Pq Vt str +If +.Va sendmail_enable +is set to +.Dq Li YES +and +.Va sendmail_cert_create +is set to +.Dq Li YES , +this is the Common Name (CN) of the certificate that will be created. +If +.Va sendmail_cert_cn +is not set, the system's hostname will be used. +If there is no hostname set, +.Dq Li amnesiac +will be used. .It Va sendmail_flags .Pq Vt str If From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 17:08:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 46A045A8; Wed, 23 Oct 2013 17:08:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1941D2E2A; Wed, 23 Oct 2013 17:08:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NH8ovV061653; Wed, 23 Oct 2013 17:08:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NH8oVP061652; Wed, 23 Oct 2013 17:08:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310231708.r9NH8oVP061652@svn.freebsd.org> From: Alexander Motin Date: Wed, 23 Oct 2013 17:08:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256988 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 17:08:51 -0000 Author: mav Date: Wed Oct 23 17:08:50 2013 New Revision: 256988 URL: http://svnweb.freebsd.org/changeset/base/256988 Log: MFC r256188: Close the race on path ID allocation in xpt_bus_register() if two buses are registered simultaneously. Due to topology unlock between the ID allocation and the bus registration there is a chance that two buses may get the same IDs. That is supposed reason of lock assertion panic in CAM during initial bus scanning after new iscsid initiates two sessions same time. Modified: stable/9/sys/cam/cam_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Wed Oct 23 17:04:09 2013 (r256987) +++ stable/9/sys/cam/cam_xpt.c Wed Oct 23 17:08:50 2013 (r256988) @@ -2450,7 +2450,7 @@ xptsetasyncbusfunc(struct cam_eb *bus, v struct ccb_setasync *csa = (struct ccb_setasync *)arg; xpt_compile_path(&path, /*periph*/NULL, - bus->sim->path_id, + bus->path_id, CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); xpt_setup_ccb(&cpi.ccb_h, &path, CAM_PRIORITY_NORMAL); @@ -3874,13 +3874,8 @@ xpt_bus_register(struct cam_sim *sim, de /* Couldn't satisfy request */ return (CAM_RESRC_UNAVAIL); } - if (strcmp(sim->sim_name, "xpt") != 0) { - sim->path_id = - xptpathid(sim->sim_name, sim->unit_number, sim->bus_id); - } TAILQ_INIT(&new_bus->et_entries); - new_bus->path_id = sim->path_id; cam_sim_hold(sim); new_bus->sim = sim; timevalclear(&new_bus->last_reset); @@ -3889,6 +3884,8 @@ xpt_bus_register(struct cam_sim *sim, de new_bus->generation = 0; xpt_lock_buses(); + sim->path_id = new_bus->path_id = + xptpathid(sim->sim_name, sim->unit_number, sim->bus_id); old_bus = TAILQ_FIRST(&xsoftc.xpt_busses); while (old_bus != NULL && old_bus->path_id < new_bus->path_id) @@ -3991,8 +3988,8 @@ xptnextfreepathid(void) path_id_t pathid; const char *strval; + mtx_assert(&xsoftc.xpt_topo_lock, MA_OWNED); pathid = 0; - xpt_lock_buses(); bus = TAILQ_FIRST(&xsoftc.xpt_busses); retry: /* Find an unoccupied pathid */ @@ -4001,7 +3998,6 @@ retry: pathid++; bus = TAILQ_NEXT(bus, links); } - xpt_unlock_buses(); /* * Ensure that this pathid is not reserved for @@ -4010,7 +4006,6 @@ retry: if (resource_string_value("scbus", pathid, "at", &strval) == 0) { ++pathid; /* Start the search over */ - xpt_lock_buses(); goto retry; } return (pathid); @@ -4026,6 +4021,8 @@ xptpathid(const char *sim_name, int sim_ pathid = CAM_XPT_PATH_ID; snprintf(buf, sizeof(buf), "%s%d", sim_name, sim_unit); + if (strcmp(buf, "xpt0") == 0 && sim_bus == 0) + return (pathid); i = 0; while ((resource_find_match(&i, &dname, &dunit, "at", buf)) == 0) { if (strcmp(dname, "scbus")) { From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 17:24:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C782B30C; Wed, 23 Oct 2013 17:24:23 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B1FBB2F3A; Wed, 23 Oct 2013 17:24:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NHONIv068585; Wed, 23 Oct 2013 17:24:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NHOM31068574; Wed, 23 Oct 2013 17:24:22 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310231724.r9NHOM31068574@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 23 Oct 2013 17:24:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256994 - in head/sys: dev/ofw powerpc/ofw powerpc/powerpc powerpc/pseries X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 17:24:23 -0000 Author: nwhitehorn Date: Wed Oct 23 17:24:21 2013 New Revision: 256994 URL: http://svnweb.freebsd.org/changeset/base/256994 Log: Add two new interfaces to ofw_bus: - ofw_bus_map_intr() Maps an (iparent, IRQ) tuple to a system-global interrupt number in some platform dependent way. This is meant to be implemented as a replacement for [FDT_]MAP_IRQ() that is an MI interface that knows about the bus hierarchy. - ofw_bus_config_intr() Configures an interrupt (previously mapped) based on firmware sense flags. This replaces manual interpretation of the sense field in bus drivers and will, in a follow-up, allow that interpretation to be redirected to the PIC drivers where it belongs. This will eventually replace the tables in /sys/dev/fdt/fdt_ARCH.c The PowerPC/AIM code has been converted to use these globally, with an implementation in terms of MAP_IRQ() and powerpc_config_intr(), assuming OpenPIC, at the bus root in nexus(4). The ofw_bus_config_intr() will shortly be integrated into pic_if.m and bounced through nexus into the PIC tree. FDT integration will happen significantly later due to larger testing requirements. This patch in general also lays the groundwork for the removal of /sys/dev/fdt/fdt_ARCH.c and machine/fdt.h. Modified: head/sys/dev/ofw/ofw_bus.h head/sys/dev/ofw/ofw_bus_if.m head/sys/powerpc/ofw/ofw_pci.c head/sys/powerpc/ofw/ofw_pcib_pci.c head/sys/powerpc/ofw/ofw_pcibus.c head/sys/powerpc/powerpc/nexus.c head/sys/powerpc/pseries/vdevice.c Modified: head/sys/dev/ofw/ofw_bus.h ============================================================================== --- head/sys/dev/ofw/ofw_bus.h Wed Oct 23 17:18:53 2013 (r256993) +++ head/sys/dev/ofw/ofw_bus.h Wed Oct 23 17:24:21 2013 (r256994) @@ -70,4 +70,16 @@ ofw_bus_get_type(device_t dev) return (OFW_BUS_GET_TYPE(device_get_parent(dev), dev)); } +static __inline int +ofw_bus_map_intr(device_t dev, phandle_t iparent, int irq) +{ + return (OFW_BUS_MAP_INTR(dev, dev, iparent, irq)); +} + +static __inline int +ofw_bus_config_intr(device_t dev, int irq, int sense) +{ + return (OFW_BUS_CONFIG_INTR(dev, dev, irq, sense)); +} + #endif /* !_DEV_OFW_OFW_BUS_H_ */ Modified: head/sys/dev/ofw/ofw_bus_if.m ============================================================================== --- head/sys/dev/ofw/ofw_bus_if.m Wed Oct 23 17:18:53 2013 (r256993) +++ head/sys/dev/ofw/ofw_bus_if.m Wed Oct 23 17:24:21 2013 (r256994) @@ -56,6 +56,8 @@ CODE { static ofw_bus_get_name_t ofw_bus_default_get_name; static ofw_bus_get_node_t ofw_bus_default_get_node; static ofw_bus_get_type_t ofw_bus_default_get_type; + static ofw_bus_map_intr_t ofw_bus_default_map_intr; + static ofw_bus_config_intr_t ofw_bus_default_config_intr; static const struct ofw_bus_devinfo * ofw_bus_default_get_devinfo(device_t bus, device_t dev) @@ -98,6 +100,31 @@ CODE { return (NULL); } + + int + ofw_bus_default_map_intr(device_t bus, device_t dev, phandle_t iparent, + int irq) + { + /* Propagate up the bus hierarchy until someone handles it. */ + if (device_get_parent(bus) != NULL) + return OFW_BUS_MAP_INTR(device_get_parent(bus), dev, + iparent, irq); + + /* If that fails, then assume a one-domain system */ + return (irq); + } + + int + ofw_bus_default_config_intr(device_t bus, device_t dev, int irq, + int sense) + { + /* Propagate up the bus hierarchy until someone handles it. */ + if (device_get_parent(bus) != NULL) + return OFW_BUS_CONFIG_INTR(device_get_parent(bus), dev, + irq, sense); + + return (ENXIO); + } }; # Get the ofw_bus_devinfo struct for the device dev on the bus. Used for bus @@ -143,3 +170,22 @@ METHOD const char * get_type { device_t bus; device_t dev; } DEFAULT ofw_bus_default_get_type; + +# Map an (interrupt parent, IRQ) pair to a unique system-wide interrupt number. +METHOD int map_intr { + device_t bus; + device_t dev; + phandle_t iparent; + int irq; +} DEFAULT ofw_bus_default_map_intr; + +# Configure an interrupt using the device-tree encoded sense key (the second +# value in the interrupts property if interrupt-cells is 2). IRQ should be +# encoded as from ofw_bus_map_intr(). +METHOD int config_intr { + device_t bus; + device_t dev; + int irq; + int sense; +} DEFAULT ofw_bus_default_config_intr; + Modified: head/sys/powerpc/ofw/ofw_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pci.c Wed Oct 23 17:18:53 2013 (r256993) +++ head/sys/powerpc/ofw/ofw_pci.c Wed Oct 23 17:24:21 2013 (r256994) @@ -272,7 +272,7 @@ ofw_pci_route_interrupt(device_t bus, de if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), &iparent, maskbuf)) - return (MAP_IRQ(iparent, mintr)); + return (ofw_bus_map_intr(dev, iparent, mintr)); /* Maybe it's a real interrupt, not an intpin */ if (pin > 4) Modified: head/sys/powerpc/ofw/ofw_pcib_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcib_pci.c Wed Oct 23 17:18:53 2013 (r256993) +++ head/sys/powerpc/ofw/ofw_pcib_pci.c Wed Oct 23 17:24:21 2013 (r256994) @@ -157,7 +157,7 @@ ofw_pcib_pci_route_interrupt(device_t br * it again on higher levels - that causes problems * in some cases, and never seems to be required. */ - return (MAP_IRQ(iparent, mintr)); + return (ofw_bus_map_intr(dev, iparent, mintr)); } } else if (intpin >= 1 && intpin <= 4) { /* Modified: head/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcibus.c Wed Oct 23 17:18:53 2013 (r256993) +++ head/sys/powerpc/ofw/ofw_pcibus.c Wed Oct 23 17:24:21 2013 (r256994) @@ -218,15 +218,13 @@ ofw_pcibus_enum_devtree(device_t dev, u_ OF_getprop(OF_xref_phandle(iparent), "#interrupt-cells", &icells, sizeof(icells)); - intr[0] = MAP_IRQ(iparent, intr[0]); + intr[0] = ofw_bus_map_intr(dev, iparent, + intr[0]); } - if (iparent != 0 && icells > 1) { - powerpc_config_intr(intr[0], - (intr[1] & 1) ? INTR_TRIGGER_LEVEL : - INTR_TRIGGER_EDGE, - INTR_POLARITY_LOW); - } + if (iparent != 0 && icells > 1) + ofw_bus_config_intr(dev, intr[0], + intr[1]); resource_list_add(&dinfo->opd_dinfo.resources, SYS_RES_IRQ, 0, intr[0], intr[0], 1); @@ -343,12 +341,13 @@ ofw_pcibus_assign_interrupt(device_t dev isz = OF_getprop(node, "AAPL,interrupts", &intr, sizeof(intr)); if (isz == sizeof(intr)) - return ((iparent == -1) ? intr : MAP_IRQ(iparent, intr)); + return ((iparent == -1) ? intr : ofw_bus_map_intr(dev, iparent, + intr)); isz = OF_getprop(node, "interrupts", &intr, sizeof(intr)); if (isz == sizeof(intr)) { if (iparent != -1) - intr = MAP_IRQ(iparent, intr); + intr = ofw_bus_map_intr(dev, iparent, intr); } else { /* No property: our best guess is the intpin. */ intr = pci_get_intpin(child); Modified: head/sys/powerpc/powerpc/nexus.c ============================================================================== --- head/sys/powerpc/powerpc/nexus.c Wed Oct 23 17:18:53 2013 (r256993) +++ head/sys/powerpc/powerpc/nexus.c Wed Oct 23 17:24:21 2013 (r256994) @@ -96,6 +96,8 @@ static bus_get_resource_list_t nexus_get static bus_bind_intr_t nexus_bind_intr; #endif static bus_config_intr_t nexus_config_intr; +static ofw_bus_map_intr_t nexus_ofw_map_intr; +static ofw_bus_config_intr_t nexus_ofw_config_intr; static ofw_bus_get_devinfo_t nexus_get_devinfo; static int nexus_inlist(const char *, const char *const *); @@ -141,6 +143,8 @@ static device_method_t nexus_methods[] = DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + DEVMETHOD(ofw_bus_map_intr, nexus_ofw_map_intr), + DEVMETHOD(ofw_bus_config_intr, nexus_ofw_config_intr), DEVMETHOD_END }; @@ -370,6 +374,21 @@ nexus_config_intr(device_t dev, int irq, return (powerpc_config_intr(irq, trig, pol)); } +static int +nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int irq) +{ + return (MAP_IRQ(iparent, irq)); +} + +static int +nexus_ofw_config_intr(device_t dev, device_t child, int irq, int sense) +{ + + return (bus_generic_config_intr(child, irq, (sense & 1) ? + INTR_TRIGGER_LEVEL : INTR_TRIGGER_EDGE, + INTR_POLARITY_LOW)); +} + static struct resource * nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) @@ -600,14 +619,11 @@ nexus_setup_dinfo(device_t dev, phandle_ OF_searchprop(iparent, "#interrupt-cells", &icells, sizeof(icells)); for (i = 0; i < nintr; i+= icells) { - intr[i] = MAP_IRQ(iparent, intr[i]); + intr[i] = ofw_bus_map_intr(dev, iparent, intr[i]); resource_list_add(&ndi->ndi_rl, SYS_RES_IRQ, i, intr[i], intr[i], 1); - if (icells > 1) { - powerpc_config_intr(intr[i], (intr[i+1] & 1) ? - INTR_TRIGGER_LEVEL : INTR_TRIGGER_EDGE, - INTR_POLARITY_LOW); - } + if (icells > 1) + ofw_bus_config_intr(dev, intr[i], intr[i+1]); } free(intr, M_OFWPROP); } Modified: head/sys/powerpc/pseries/vdevice.c ============================================================================== --- head/sys/powerpc/pseries/vdevice.c Wed Oct 23 17:18:53 2013 (r256993) +++ head/sys/powerpc/pseries/vdevice.c Wed Oct 23 17:24:21 2013 (r256994) @@ -156,7 +156,8 @@ vdevice_attach(device_t dev) for (i = 0; i < nintr; i += icells) { u_int irq = intr[i]; if (iparent != -1) - irq = MAP_IRQ(iparent, intr[i]); + irq = ofw_bus_map_intr(dev, iparent, + intr[i]); resource_list_add(&dinfo->mdi_resources, SYS_RES_IRQ, i, irq, irq, i); From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 17:49:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 20796CCE; Wed, 23 Oct 2013 17:49:23 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9C1E320DA; Wed, 23 Oct 2013 17:49:21 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id r9NHnJiO020289; Wed, 23 Oct 2013 21:49:19 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id r9NHnJAo020288; Wed, 23 Oct 2013 21:49:19 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 23 Oct 2013 21:49:19 +0400 From: Gleb Smirnoff To: John Baldwin Subject: Re: svn commit: r256962 - head/sys/netinet Message-ID: <20131023174919.GQ52889@FreeBSD.org> References: <201310231322.r9NDMo1U085514@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201310231322.r9NDMo1U085514@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 17:49:23 -0000 On Wed, Oct 23, 2013 at 01:22:50PM +0000, John Baldwin wrote: J> Author: jhb J> Date: Wed Oct 23 13:22:50 2013 J> New Revision: 256962 J> URL: http://svnweb.freebsd.org/changeset/base/256962 J> J> Log: J> Finish r254925 and remove the last remaining sysctl name list macro. The J> one port that used it has been fixed to use the more portable J> getprotoent(3) instead. J> J> Modified: J> head/sys/netinet/in.h J> J> Modified: head/sys/netinet/in.h J> ============================================================================== J> --- head/sys/netinet/in.h Wed Oct 23 13:09:57 2013 (r256961) J> +++ head/sys/netinet/in.h Wed Oct 23 13:22:50 2013 (r256962) J> @@ -603,78 +603,6 @@ int getsourcefilter(int, uint32_t, struc J> * Third level is protocol number. J> * Fourth level is desired variable within that protocol. J> */ J> -#define IPPROTO_MAXID (IPPROTO_AH + 1) /* don't list to IPPROTO_MAX */ J> - Doesn't above comment belong to the deleted text? -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 17:55:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D02901EF; Wed, 23 Oct 2013 17:55:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BE2612157; Wed, 23 Oct 2013 17:55:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NHtZPO079193; Wed, 23 Oct 2013 17:55:35 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NHtZVG079192; Wed, 23 Oct 2013 17:55:35 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310231755.r9NHtZVG079192@svn.freebsd.org> From: Alexander Motin Date: Wed, 23 Oct 2013 17:55:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256995 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 17:55:36 -0000 Author: mav Date: Wed Oct 23 17:55:35 2013 New Revision: 256995 URL: http://svnweb.freebsd.org/changeset/base/256995 Log: Remove 128KB bzero() call done for every block I/O data buffer. On my tests this improves performance of the new iSCSI target backed by GEOM STRIPE of SSDs from 75K to 110K IOPS. Reviewed by: ken Modified: head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Wed Oct 23 17:24:21 2013 (r256994) +++ head/sys/cam/ctl/ctl_backend_block.c Wed Oct 23 17:55:35 2013 (r256995) @@ -1605,18 +1605,6 @@ ctl_be_block_open(struct ctl_be_block_so } static int -ctl_be_block_mem_ctor(void *mem, int size, void *arg, int flags) -{ - return (0); -} - -static void -ctl_be_block_mem_dtor(void *mem, int size, void *arg) -{ - bzero(mem, size); -} - -static int ctl_be_block_create(struct ctl_be_block_softc *softc, struct ctl_lun_req *req) { struct ctl_be_block_lun *be_lun; @@ -1644,8 +1632,7 @@ ctl_be_block_create(struct ctl_be_block_ mtx_init(&be_lun->lock, be_lun->lunname, NULL, MTX_DEF); be_lun->lun_zone = uma_zcreate(be_lun->lunname, MAXPHYS, - ctl_be_block_mem_ctor, ctl_be_block_mem_dtor, NULL, NULL, - /*align*/ 0, /*flags*/0); + NULL, NULL, NULL, NULL, /*align*/ 0, /*flags*/0); if (be_lun->lun_zone == NULL) { snprintf(req->error_str, sizeof(req->error_str), From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 17:59:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BB074377; Wed, 23 Oct 2013 17:59:18 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 98D042178; Wed, 23 Oct 2013 17:59:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NHxIGO079905; Wed, 23 Oct 2013 17:59:18 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NHxH40079900; Wed, 23 Oct 2013 17:59:17 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310231759.r9NHxH40079900@svn.freebsd.org> From: Brooks Davis Date: Wed, 23 Oct 2013 17:59:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256996 - stable/10/contrib/mtree X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 17:59:18 -0000 Author: brooks Date: Wed Oct 23 17:59:17 2013 New Revision: 256996 URL: http://svnweb.freebsd.org/changeset/base/256996 Log: MFC r256687: Upgrade to the latest version of mtree from NetBSD. This revision re-removes the printing of size for non-regular files, supports type-less root (.) entries as seen in a couple ports, and corrects a bug in -N that caused expanded Subversion $FreeBSD$ strings in comments to be processed as /etc/group entries. Includes one trivial portability fix (including in three files) that has been committed upstream. Approved by: re (glebius) Modified: stable/10/contrib/mtree/compare.c stable/10/contrib/mtree/create.c stable/10/contrib/mtree/getid.c stable/10/contrib/mtree/spec.c Directory Properties: stable/10/contrib/mtree/ (props changed) Modified: stable/10/contrib/mtree/compare.c ============================================================================== --- stable/10/contrib/mtree/compare.c Wed Oct 23 17:55:35 2013 (r256995) +++ stable/10/contrib/mtree/compare.c Wed Oct 23 17:59:17 2013 (r256996) @@ -1,4 +1,4 @@ -/* $NetBSD: compare.c,v 1.55 2012/10/05 00:59:35 christos Exp $ */ +/* $NetBSD: compare.c,v 1.56 2013/09/09 23:27:43 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)compare.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: compare.c,v 1.55 2012/10/05 00:59:35 christos Exp $"); +__RCSID("$NetBSD: compare.c,v 1.56 2013/09/09 23:27:43 christos Exp $"); #endif #endif /* not lint */ @@ -47,6 +47,7 @@ __RCSID("$NetBSD: compare.c,v 1.55 2012/ #include #include +#include #include #include #include @@ -192,9 +193,9 @@ typeerr: LABEL; (s->type == F_BLOCK || s->type == F_CHAR) && s->st_rdev != p->fts_statp->st_rdev) { LABEL; - printf("%sdevice (%#llx, %#llx", - tab, (long long)s->st_rdev, - (long long)p->fts_statp->st_rdev); + printf("%sdevice (%#jx, %#jx", + tab, (uintmax_t)s->st_rdev, + (uintmax_t)p->fts_statp->st_rdev); if (uflag) { if ((unlink(p->fts_accpath) == -1) || (mknod(p->fts_accpath, @@ -283,9 +284,9 @@ typeerr: LABEL; } if (s->flags & F_SIZE && s->st_size != p->fts_statp->st_size) { LABEL; - printf("%ssize (%lld, %lld)\n", - tab, (long long)s->st_size, - (long long)p->fts_statp->st_size); + printf("%ssize (%ju, %ju)\n", + tab, (uintmax_t)s->st_size, + (uintmax_t)p->fts_statp->st_size); tab = "\t"; } /* Modified: stable/10/contrib/mtree/create.c ============================================================================== --- stable/10/contrib/mtree/create.c Wed Oct 23 17:55:35 2013 (r256995) +++ stable/10/contrib/mtree/create.c Wed Oct 23 17:59:17 2013 (r256996) @@ -1,4 +1,4 @@ -/* $NetBSD: create.c,v 1.69 2013/02/03 19:15:17 christos Exp $ */ +/* $NetBSD: create.c,v 1.71 2013/10/16 17:24:20 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)create.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: create.c,v 1.69 2013/02/03 19:15:17 christos Exp $"); +__RCSID("$NetBSD: create.c,v 1.71 2013/10/16 17:24:20 christos Exp $"); #endif #endif /* not lint */ @@ -53,6 +53,7 @@ __RCSID("$NetBSD: create.c,v 1.69 2013/0 #include #include #include +#include #include #include #include @@ -216,22 +217,22 @@ statf(int indent, FTSENT *p) p->fts_statp->st_mode & MBITS); if (keys & F_DEV && (S_ISBLK(p->fts_statp->st_mode) || S_ISCHR(p->fts_statp->st_mode))) - output(indent, &offset, "device=%#llx", - (long long)p->fts_statp->st_rdev); + output(indent, &offset, "device=%#jx", + (uintmax_t)p->fts_statp->st_rdev); if (keys & F_NLINK && p->fts_statp->st_nlink != 1) output(indent, &offset, "nlink=%u", p->fts_statp->st_nlink); if (keys & F_SIZE && - (flavor != F_NETBSD6 || S_ISREG(p->fts_statp->st_mode))) - output(indent, &offset, "size=%lld", - (long long)p->fts_statp->st_size); + (flavor == F_FREEBSD9 || S_ISREG(p->fts_statp->st_mode))) + output(indent, &offset, "size=%ju", + (uintmax_t)p->fts_statp->st_size); if (keys & F_TIME) #if defined(BSD4_4) && !defined(HAVE_NBTOOL_CONFIG_H) - output(indent, &offset, "time=%ld.%09ld", - (long)p->fts_statp->st_mtimespec.tv_sec, + output(indent, &offset, "time=%jd.%09ld", + (intmax_t)p->fts_statp->st_mtimespec.tv_sec, p->fts_statp->st_mtimespec.tv_nsec); #else - output(indent, &offset, "time=%ld.%09ld", - (long)p->fts_statp->st_mtime, (long)0); + output(indent, &offset, "time=%jd.%09ld", + (intmax_t)p->fts_statp->st_mtime, (long)0); #endif if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) { if ((fd = open(p->fts_accpath, O_RDONLY, 0)) < 0 || Modified: stable/10/contrib/mtree/getid.c ============================================================================== --- stable/10/contrib/mtree/getid.c Wed Oct 23 17:55:35 2013 (r256995) +++ stable/10/contrib/mtree/getid.c Wed Oct 23 17:59:17 2013 (r256996) @@ -1,4 +1,4 @@ -/* $NetBSD: getid.c,v 1.7 2008/04/28 20:24:17 martin Exp $ */ +/* $NetBSD: getid.c,v 1.8 2013/10/16 17:27:42 christos Exp $ */ /* from: NetBSD: getpwent.c,v 1.48 2000/10/03 03:22:26 enami Exp */ /* from: NetBSD: getgrent.c,v 1.41 2002/01/12 23:51:30 lukem Exp */ @@ -65,7 +65,7 @@ #endif #include -__RCSID("$NetBSD: getid.c,v 1.7 2008/04/28 20:24:17 martin Exp $"); +__RCSID("$NetBSD: getid.c,v 1.8 2013/10/16 17:27:42 christos Exp $"); #include @@ -230,6 +230,9 @@ grscan(int search, gid_t gid, const char ; continue; } + /* skip comments */ + if (pwline[0] == '#') + continue; if (grmatchline(search, gid, name)) return 1; } @@ -371,6 +374,9 @@ pwscan(int search, uid_t uid, const char ; continue; } + /* skip comments */ + if (pwline[0] == '#') + continue; if (pwmatchline(search, uid, name)) return 1; } Modified: stable/10/contrib/mtree/spec.c ============================================================================== --- stable/10/contrib/mtree/spec.c Wed Oct 23 17:55:35 2013 (r256995) +++ stable/10/contrib/mtree/spec.c Wed Oct 23 17:59:17 2013 (r256996) @@ -1,4 +1,4 @@ -/* $NetBSD: spec.c,v 1.85 2012/12/20 16:43:16 christos Exp $ */ +/* $NetBSD: spec.c,v 1.87 2013/10/16 17:26:14 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -67,7 +67,7 @@ #if 0 static char sccsid[] = "@(#)spec.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: spec.c,v 1.85 2012/12/20 16:43:16 christos Exp $"); +__RCSID("$NetBSD: spec.c,v 1.87 2013/10/16 17:26:14 christos Exp $"); #endif #endif /* not lint */ @@ -80,6 +80,7 @@ __RCSID("$NetBSD: spec.c,v 1.85 2012/12/ #include #include #include +#include #include #include #include @@ -217,6 +218,12 @@ noparent: mtree_err("no parent node"); /* * empty tree */ + /* + * Allow a bare "." root node by forcing it to + * type=dir for compatibility with FreeBSD. + */ + if (strcmp(centry->name, ".") == 0 && centry->type == 0) + centry->type = F_DIR; if (strcmp(centry->name, ".") != 0 || centry->type != F_DIR) mtree_err( @@ -350,16 +357,18 @@ dump_nodes(const char *dir, NODE *root, appendfield(pathlast, "mode=%#o", cur->st_mode); if (MATCHFLAG(F_DEV) && (cur->type == F_BLOCK || cur->type == F_CHAR)) - appendfield(pathlast, "device=%#llx", (long long)cur->st_rdev); + appendfield(pathlast, "device=%#jx", + (uintmax_t)cur->st_rdev); if (MATCHFLAG(F_NLINK)) appendfield(pathlast, "nlink=%d", cur->st_nlink); if (MATCHFLAG(F_SLINK)) appendfield(pathlast, "link=%s", vispath(cur->slink)); if (MATCHFLAG(F_SIZE)) - appendfield(pathlast, "size=%lld", (long long)cur->st_size); + appendfield(pathlast, "size=%ju", + (uintmax_t)cur->st_size); if (MATCHFLAG(F_TIME)) - appendfield(pathlast, "time=%lld.%09ld", - (long long)cur->st_mtimespec.tv_sec, + appendfield(pathlast, "time=%jd.%09ld", + (intmax_t)cur->st_mtimespec.tv_sec, cur->st_mtimespec.tv_nsec); if (MATCHFLAG(F_CKSUM)) appendfield(pathlast, "cksum=%lu", cur->cksum); From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 18:07:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BB5C2A77; Wed, 23 Oct 2013 18:07:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 990F4222B; Wed, 23 Oct 2013 18:07:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NI79eY083886; Wed, 23 Oct 2013 18:07:09 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NI78EU083874; Wed, 23 Oct 2013 18:07:08 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310231807.r9NI78EU083874@svn.freebsd.org> From: Bryan Drewery Date: Wed, 23 Oct 2013 18:07:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256998 - in stable/10: . lib/libyaml share/mk tools usr.sbin/pkg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 18:07:09 -0000 Author: bdrewery (ports committer) Date: Wed Oct 23 18:07:07 2013 New Revision: 256998 URL: http://svnweb.freebsd.org/changeset/base/256998 Log: MFC r256450: Rename libbsdyml to libyaml, make private, and bump SHLIB_MAJOR to 1.0 Approved by: bapt Approved by: re (glebius) Deleted: stable/10/lib/libyaml/libbsdyml.3 Modified: stable/10/ObsoleteFiles.inc (contents, props changed) stable/10/UPDATING (contents, props changed) stable/10/lib/libyaml/Makefile stable/10/share/mk/bsd.libnames.mk stable/10/tools/make_libdeps.sh stable/10/usr.sbin/pkg/Makefile stable/10/usr.sbin/pkg/config.c Directory Properties: stable/10/lib/libyaml/ (props changed) stable/10/share/mk/ (props changed) stable/10/tools/ (props changed) stable/10/usr.sbin/pkg/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Wed Oct 23 17:59:46 2013 (r256997) +++ stable/10/ObsoleteFiles.inc Wed Oct 23 18:07:07 2013 (r256998) @@ -38,6 +38,17 @@ # xargs -n1 | sort | uniq -d; # done +# 20131014: libbsdyml becomes private +OLD_FILES+=usr/lib/libbsdyml.a +OLD_FILES+=usr/lib/libbsdyml.so +OLD_LIBS+=usr/lib/libbsdyml.so.0 +OLD_FILES+=usr/lib/libbsdyml_p.a +OLD_FILES+=usr/lib32/libbsdyml.a +OLD_FILES+=usr/lib32/libbsdyml.so +OLD_LIBS+=usr/lib32/libbsdyml.so.0 +OLD_FILES+=usr/lib32/libbsdyml_p.a +OLD_FILES+=usr/share/man/man3/libbsdyml.3.gz +OLD_FILES+=usr/include/bsdyml.h # 20131013: Removal of the ATF tools OLD_FILES+=etc/atf/FreeBSD.conf OLD_FILES+=etc/atf/atf-run.hooks Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Wed Oct 23 17:59:46 2013 (r256997) +++ stable/10/UPDATING Wed Oct 23 18:07:07 2013 (r256998) @@ -16,6 +16,15 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20131014: + libbsdyml has been renamed to libyaml and moved to /usr/lib/private. + This will break ports-mgmt/pkg. Rebuild the port, or upgrade to pkg + 1.1.4_8 and verify bsdyml not linked in, before running "make + delete-old-libs": + # make -C /usr/ports/ports-mgmt/pkg build deinstall install clean + or + # pkg install pkg; ldd /usr/local/sbin/pkg | grep bsdyml + 20131010: The rc.d/jail script has been updated to support jail(8) configuration file. The "jail__*" rc.conf(5) variables Modified: stable/10/lib/libyaml/Makefile ============================================================================== --- stable/10/lib/libyaml/Makefile Wed Oct 23 17:59:46 2013 (r256997) +++ stable/10/lib/libyaml/Makefile Wed Oct 23 18:07:07 2013 (r256998) @@ -2,15 +2,13 @@ LIBYAML= ${.CURDIR}/../../contrib/libyaml -LIB= bsdyml -SHLIB_MAJOR= 0 -INCS= bsdyml.h +LIB= yaml +PRIVATELIB= true +SHLIB_MAJOR= 1 SRCS= api.c dumper.c emitter.c loader.c \ parser.c reader.c scanner.c writer.c -MAN= libbsdyml.3 .PATH: ${LIBYAML}/src ${LIBYAML}/include -CLEANFILES= bsdyml.h WARNS?= 1 CFLAGS+= -I${LIBYAML}/include \ @@ -18,7 +16,4 @@ CFLAGS+= -I${LIBYAML}/include \ -I${.CURDIR} \ -DHAVE_CONFIG_H -bsdyml.h: yaml.h - cp -f ${.ALLSRC} ${.TARGET} - .include Modified: stable/10/share/mk/bsd.libnames.mk ============================================================================== --- stable/10/share/mk/bsd.libnames.mk Wed Oct 23 17:59:46 2013 (r256997) +++ stable/10/share/mk/bsd.libnames.mk Wed Oct 23 18:07:07 2013 (r256998) @@ -21,7 +21,6 @@ LIBAVL?= ${DESTDIR}${LIBDIR}/libavl.a LIBBEGEMOT?= ${DESTDIR}${LIBDIR}/libbegemot.a LIBBLUETOOTH?= ${DESTDIR}${LIBDIR}/libbluetooth.a LIBBSDXML?= ${DESTDIR}${LIBDIR}/libbsdxml.a -LIBBSDYML?= ${DESTDIR}${LIBDIR}/libbsdyml.a LIBBSM?= ${DESTDIR}${LIBDIR}/libbsm.a LIBBSNMP?= ${DESTDIR}${LIBDIR}/libbsnmp.a LIBBZ2?= ${DESTDIR}${LIBDIR}/libbz2.a @@ -166,6 +165,7 @@ LIBWIND?= ${DESTDIR}${LIBDIR}/libwind.a LIBWRAP?= ${DESTDIR}${LIBDIR}/libwrap.a LIBXPG4?= ${DESTDIR}${LIBDIR}/libxpg4.a LIBY?= ${DESTDIR}${LIBDIR}/liby.a +LIBYAML?= ${DESTDIR}${LIBPRIVATEDIR}/libyaml.a LIBYPCLNT?= ${DESTDIR}${LIBDIR}/libypclnt.a LIBZ?= ${DESTDIR}${LIBDIR}/libz.a LIBZFS?= ${DESTDIR}${LIBDIR}/libzfs.a Modified: stable/10/tools/make_libdeps.sh ============================================================================== --- stable/10/tools/make_libdeps.sh Wed Oct 23 17:59:46 2013 (r256997) +++ stable/10/tools/make_libdeps.sh Wed Oct 23 18:07:07 2013 (r256998) @@ -48,7 +48,6 @@ sed -E -e's; ;! ;g' -e's;$;!;' -e's;-lbsdxml!;lib/libexpat;g' - -e's;-lbsdyml!;lib/libyaml;g' -e's;-lpthread!;lib/libthr;g' -e's;-lm!;lib/msun;g' -e's;-l(ncurses|termcap)!;lib/ncurses/ncurses;g' Modified: stable/10/usr.sbin/pkg/Makefile ============================================================================== --- stable/10/usr.sbin/pkg/Makefile Wed Oct 23 17:59:46 2013 (r256997) +++ stable/10/usr.sbin/pkg/Makefile Wed Oct 23 18:07:07 2013 (r256998) @@ -4,7 +4,10 @@ PROG= pkg SRCS= pkg.c dns_utils.c config.c NO_MAN= yes -DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBBSDYML} ${LIBSBUF} -LDADD= -larchive -lelf -lfetch -lbsdyml -lsbuf +CFLAGS+=-I${.CURDIR}/../../contrib/libyaml/include +.PATH: ${.CURDIR}/../../contrib/libyaml/include +DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBYAML} ${LIBSBUF} +LDADD= -larchive -lelf -lfetch -lyaml -lsbuf +USEPRIVATELIB= yaml .include Modified: stable/10/usr.sbin/pkg/config.c ============================================================================== --- stable/10/usr.sbin/pkg/config.c Wed Oct 23 17:59:46 2013 (r256997) +++ stable/10/usr.sbin/pkg/config.c Wed Oct 23 18:07:07 2013 (r256998) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 18:22:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AF4F93B9; Wed, 23 Oct 2013 18:22:28 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8DB14235E; Wed, 23 Oct 2013 18:22:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NIMS0I090297; Wed, 23 Oct 2013 18:22:28 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NIMSm7090295; Wed, 23 Oct 2013 18:22:28 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201310231822.r9NIMSm7090295@svn.freebsd.org> From: Steven Hartland Date: Wed, 23 Oct 2013 18:22:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256999 - head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 18:22:28 -0000 Author: smh Date: Wed Oct 23 18:22:27 2013 New Revision: 256999 URL: http://svnweb.freebsd.org/changeset/base/256999 Log: Added support for the 'zfs list -t snap' and 'zfs snap' aliases which are available under Oracle Solaris 11. This includes an update to the ZFS(8) man page to reflect all the available alias (snap, umount, and recv). Initial changes obtained from ZFS On Linux + fixes for man page and cmd help: https://github.com/zfsonlinux/zfs/commit/10b75496bb0cb7a7b8146c263164adc37f1d176a https://github.com/zfsonlinux/zfs/commit/cf81b00a73fe47fdb21586ac1cc179b734540973 Obtained from: https://github.com/zfsonlinux/zfs MFC after: 2 weeks Sponsored by: Multiplay Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Oct 23 18:07:07 2013 (r256998) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Oct 23 18:22:27 2013 (r256999) @@ -25,10 +25,11 @@ .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. .\" Copyright (c) 2013 Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2013, Joyent, Inc. All rights reserved. +.\" Copyright (c) 2013, Steven Hartland .\" .\" $FreeBSD$ .\" -.Dd September 20, 2013 +.Dd October 23, 2013 .Dt ZFS 8 .Os .Sh NAME @@ -61,7 +62,7 @@ .Op , Ns ... .Sm on .Nm -.Cm snapshot +.Cm snapshot Ns | Ns Cm snap .Op Fl r .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... .Ar filesystem@snapname Ns | Ns Ar volume@snapname @@ -157,7 +158,7 @@ .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... .Fl a | Ar filesystem .Nm -.Cm unmount +.Cm unmount Ns | Ns Cm umount .Op Fl f .Fl a | Ar filesystem Ns | Ns Ar mountpoint .Nm @@ -172,11 +173,11 @@ .Op Fl i Ar snapshot | Fl I Ar snapshot .Ar snapshot .Nm -.Cm receive +.Cm receive Ns | Ns Cm recv .Op Fl vnFu .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm -.Cm receive +.Cm receive Ns | Ns Cm recv .Op Fl vnFu .Op Fl d | e .Ar filesystem @@ -1653,7 +1654,7 @@ options, as they can destroy large porti behavior for mounted file systems in use. .It Xo .Nm -.Cm snapshot +.Cm snapshot Ns | Ns Cm snap .Op Fl r .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... .Ar filesystem@snapname Ns | Ns volume@snapname @@ -1865,7 +1866,7 @@ syntax. A comma-separated list of types to display, where .Ar type is one of -.Sy filesystem , snapshot , volume , No or Sy all . +.Sy filesystem , snapshot , snap, volume , No or Sy all . For example, specifying .Fl t Cm snapshot displays only snapshots. @@ -2194,7 +2195,7 @@ Mount the specified filesystem. .El .It Xo .Nm -.Cm unmount +.Cm unmount Ns | Ns Cm umount .Op Fl f .Fl a | Ar filesystem Ns | Ns Ar mountpoint .Xc @@ -2377,13 +2378,13 @@ on future versions of .Tn ZFS . .It Xo .Nm -.Cm receive +.Cm receive Ns | Ns Cm recv .Op Fl vnFu .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Xc .It Xo .Nm -.Cm receive +.Cm receive Ns | Ns Cm recv .Op Fl vnFu .Op Fl d | e .Ar filesystem Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Oct 23 18:07:07 2013 (r256998) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Oct 23 18:22:27 2013 (r256999) @@ -259,9 +259,9 @@ get_usage(zfs_help_t idx) case HELP_PROMOTE: return (gettext("\tpromote \n")); case HELP_RECEIVE: - return (gettext("\treceive [-vnFu] \n" - "\treceive [-vnFu] [-d | -e] \n")); + "\treceive|recv [-vnFu] [-d | -e] \n")); case HELP_RENAME: return (gettext("\trename [-f] " "\n" @@ -280,10 +280,10 @@ get_usage(zfs_help_t idx) case HELP_SHARE: return (gettext("\tshare <-a | filesystem>\n")); case HELP_SNAPSHOT: - return (gettext("\tsnapshot [-r] [-o property=value] ... " + return (gettext("\tsnapshot|snap [-r] [-o property=value] ... " " ...\n")); case HELP_UNMOUNT: - return (gettext("\tunmount [-f] " + return (gettext("\tunmount|umount [-f] " "<-a | filesystem|mountpoint>\n")); case HELP_UNSHARE: return (gettext("\tunshare " @@ -3027,7 +3027,7 @@ zfs_do_list(int argc, char **argv) flags &= ~ZFS_ITER_PROP_LISTSNAPS; while (*optarg != '\0') { static char *type_subopts[] = { "filesystem", - "volume", "snapshot", "all", NULL }; + "volume", "snapshot", "snap", "all", NULL }; switch (getsubopt(&optarg, type_subopts, &value)) { @@ -3038,9 +3038,10 @@ zfs_do_list(int argc, char **argv) types |= ZFS_TYPE_VOLUME; break; case 2: + case 3: types |= ZFS_TYPE_SNAPSHOT; break; - case 3: + case 4: types = ZFS_TYPE_DATASET; break; @@ -6726,6 +6727,12 @@ main(int argc, char **argv) cmdname = "receive"; /* + * The 'snap' command is an alias for 'snapshot' + */ + if (strcmp(cmdname, "snap") == 0) + cmdname = "snapshot"; + + /* * Special case '-?' */ if (strcmp(cmdname, "-?") == 0) From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 18:40:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3A678F35; Wed, 23 Oct 2013 18:40:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 139F12467; Wed, 23 Oct 2013 18:40:59 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A6B35B94F; Wed, 23 Oct 2013 14:40:57 -0400 (EDT) From: John Baldwin To: Gleb Smirnoff Subject: Re: svn commit: r256962 - head/sys/netinet Date: Wed, 23 Oct 2013 14:29:11 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201310231322.r9NDMo1U085514@svn.freebsd.org> <20131023174919.GQ52889@FreeBSD.org> In-Reply-To: <20131023174919.GQ52889@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201310231429.11295.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 23 Oct 2013 14:40:57 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 18:40:59 -0000 On Wednesday, October 23, 2013 1:49:19 pm Gleb Smirnoff wrote: > On Wed, Oct 23, 2013 at 01:22:50PM +0000, John Baldwin wrote: > J> Author: jhb > J> Date: Wed Oct 23 13:22:50 2013 > J> New Revision: 256962 > J> URL: http://svnweb.freebsd.org/changeset/base/256962 > J> > J> Log: > J> Finish r254925 and remove the last remaining sysctl name list macro. The > J> one port that used it has been fixed to use the more portable > J> getprotoent(3) instead. > J> > J> Modified: > J> head/sys/netinet/in.h > J> > J> Modified: head/sys/netinet/in.h > J> ============================================================================== > J> --- head/sys/netinet/in.h Wed Oct 23 13:09:57 2013 (r256961) > J> +++ head/sys/netinet/in.h Wed Oct 23 13:22:50 2013 (r256962) > J> @@ -603,78 +603,6 @@ int getsourcefilter(int, uint32_t, struc > J> * Third level is protocol number. > J> * Fourth level is desired variable within that protocol. > J> */ > J> -#define IPPROTO_MAXID (IPPROTO_AH + 1) /* don't list to IPPROTO_MAX */ > J> - > > Doesn't above comment belong to the deleted text? Yes, and my previous commit also left various FOO_MAXID constants that are no longer relevant. I will test a patch to clean these up. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 18:54:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 28C397B8; Wed, 23 Oct 2013 18:54:59 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1636D2538; Wed, 23 Oct 2013 18:54:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NIswS4000675; Wed, 23 Oct 2013 18:54:58 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NIswRM000674; Wed, 23 Oct 2013 18:54:58 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310231854.r9NIswRM000674@svn.freebsd.org> From: Peter Grehan Date: Wed, 23 Oct 2013 18:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257005 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 18:54:59 -0000 Author: grehan Date: Wed Oct 23 18:54:58 2013 New Revision: 257005 URL: http://svnweb.freebsd.org/changeset/base/257005 Log: Export the block size capability to guests. - Use #defines for capability bits - Export the VTBLK_F_BLK_SIZE capability - Fix bug in calculating capacity: it is in 512-byte units, not the underlying sector size This allows virtio-blk to have backing devices with non 512-byte sector sizes e.g. /dev/cd0, and 4K-block harddrives. Reviewed by: neel MFC after: 3 days Modified: head/usr.sbin/bhyve/pci_virtio_block.c Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Wed Oct 23 18:36:05 2013 (r257004) +++ head/usr.sbin/bhyve/pci_virtio_block.c Wed Oct 23 18:54:58 2013 (r257005) @@ -66,11 +66,16 @@ __FBSDID("$FreeBSD$"); #define VTBLK_BLK_ID_BYTES 20 +/* Capability bits */ +#define VTBLK_F_SEG_MAX (1 << 2) /* Maximum request segments */ +#define VTBLK_F_BLK_SIZE (1 << 6) /* cfg block size valid */ + /* * Host capabilities */ #define VTBLK_S_HOSTCAPS \ - ( 0x00000004 | /* host maximum request segments */ \ + ( VTBLK_F_SEG_MAX | \ + VTBLK_F_BLK_SIZE | \ VIRTIO_RING_F_INDIRECT_DESC ) /* indirect descriptors */ /* @@ -315,7 +320,7 @@ pci_vtblk_init(struct vmctx *ctx, struct digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); /* setup virtio block config space */ - sc->vbsc_cfg.vbc_capacity = size / sectsz; + sc->vbsc_cfg.vbc_capacity = size / DEV_BSIZE; /* 512-byte units */ sc->vbsc_cfg.vbc_seg_max = VTBLK_MAXSEGS; sc->vbsc_cfg.vbc_blk_size = sectsz; sc->vbsc_cfg.vbc_size_max = 0; /* not negotiated */ From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 18:58:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7C0E5DBC; Wed, 23 Oct 2013 18:58:12 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 697F5256A; Wed, 23 Oct 2013 18:58:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NIwCH5001455; Wed, 23 Oct 2013 18:58:12 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NIwCZU001454; Wed, 23 Oct 2013 18:58:12 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201310231858.r9NIwCZU001454@svn.freebsd.org> From: Alan Somers Date: Wed, 23 Oct 2013 18:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257006 - head/sbin/geom/class/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 18:58:12 -0000 Author: asomers Date: Wed Oct 23 18:58:11 2013 New Revision: 257006 URL: http://svnweb.freebsd.org/changeset/base/257006 Log: sbin/geom/class/part/geom_part.c Always validate the return of find_geomcfg(). It could be NULL, for example when the geom is withering. Approved by: ken (mentor) Sponsored by: Spectra Logic Corporation MFC after: 3 weeks Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Wed Oct 23 18:54:58 2013 (r257005) +++ head/sbin/geom/class/part/geom_part.c Wed Oct 23 18:58:11 2013 (r257006) @@ -364,7 +364,11 @@ gpart_autofill_resize(struct gctl_req *r } offset = (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment; - last = (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0); + s = find_geomcfg(gp, "last"); + if (s == NULL) + errx(EXIT_FAILURE, "Final block not found for geom %s", + gp->lg_name); + last = (off_t)strtoimax(s, NULL, 0); LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { s = find_provcfg(pp, "index"); if (s == NULL) @@ -502,8 +506,16 @@ gpart_autofill(struct gctl_req *req) if (size > alignment) size = ALIGNDOWN(size, alignment); - first = (off_t)strtoimax(find_geomcfg(gp, "first"), NULL, 0); - last = (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0); + s = find_geomcfg(gp, "first"); + if (s == NULL) + errx(EXIT_FAILURE, "Starting block not found for geom %s", + gp->lg_name); + first = (off_t)strtoimax(s, NULL, 0); + s = find_geomcfg(gp, "last"); + if (s == NULL) + errx(EXIT_FAILURE, "Final block not found for geom %s", + gp->lg_name); + last = (off_t)strtoimax(s, NULL, 0); grade = ~0ULL; a_first = ALIGNUP(first + offset, alignment); last = ALIGNDOWN(last + offset, alignment); @@ -587,12 +599,22 @@ gpart_show_geom(struct ggeom *gp, const int idx, wblocks, wname, wmax; scheme = find_geomcfg(gp, "scheme"); + if (scheme == NULL) + errx(EXIT_FAILURE, "Scheme not found for geom %s", gp->lg_name); s = find_geomcfg(gp, "first"); + if (s == NULL) + errx(EXIT_FAILURE, "Starting block not found for geom %s", + gp->lg_name); first = (off_t)strtoimax(s, NULL, 0); s = find_geomcfg(gp, "last"); + if (s == NULL) + errx(EXIT_FAILURE, "Final block not found for geom %s", + gp->lg_name); last = (off_t)strtoimax(s, NULL, 0); wblocks = strlen(s); s = find_geomcfg(gp, "state"); + if (s == NULL) + errx(EXIT_FAILURE, "State not found for geom %s", gp->lg_name); if (s != NULL && *s != 'C') s = NULL; wmax = strlen(gp->lg_name); @@ -748,6 +770,8 @@ gpart_backup(struct gctl_req *req, unsig abort(); pp = LIST_FIRST(&gp->lg_consumer)->lg_provider; s = find_geomcfg(gp, "last"); + if (s == NULL) + abort(); wblocks = strlen(s); wtype = 0; LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { @@ -757,6 +781,8 @@ gpart_backup(struct gctl_req *req, unsig wtype = i; } s = find_geomcfg(gp, "entries"); + if (s == NULL) + abort(); windex = strlen(s); printf("%s %s\n", scheme, s); LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { @@ -1177,6 +1203,8 @@ gpart_bootcode(struct gctl_req *req, uns if (gp == NULL) errx(EXIT_FAILURE, "No such geom: %s.", s); s = find_geomcfg(gp, "scheme"); + if (s == NULL) + errx(EXIT_FAILURE, "Scheme not found for geom %s", gp->lg_name); vtoc8 = 0; if (strcmp(s, "VTOC8") == 0) vtoc8 = 1; From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 18:58:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8675DF02; Wed, 23 Oct 2013 18:58:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6EE842575; Wed, 23 Oct 2013 18:58:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NIwdUR001544; Wed, 23 Oct 2013 18:58:39 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NIwcxI001535; Wed, 23 Oct 2013 18:58:38 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310231858.r9NIwcxI001535@svn.freebsd.org> From: Xin LI Date: Wed, 23 Oct 2013 18:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257007 - head/sys/dev/oce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 18:58:39 -0000 Author: delphij Date: Wed Oct 23 18:58:38 2013 New Revision: 257007 URL: http://svnweb.freebsd.org/changeset/base/257007 Log: Update driver to version 10.0.664.0. Many thanks to Emulex for their continued support of FreeBSD. Submitted by: Venkata Duvvuru MFC after: 3 day Modified: head/sys/dev/oce/oce_hw.c head/sys/dev/oce/oce_hw.h head/sys/dev/oce/oce_if.c head/sys/dev/oce/oce_if.h head/sys/dev/oce/oce_mbox.c head/sys/dev/oce/oce_queue.c head/sys/dev/oce/oce_sysctl.c head/sys/dev/oce/oce_util.c Modified: head/sys/dev/oce/oce_hw.c ============================================================================== --- head/sys/dev/oce/oce_hw.c Wed Oct 23 18:58:11 2013 (r257006) +++ head/sys/dev/oce/oce_hw.c Wed Oct 23 18:58:38 2013 (r257007) @@ -38,6 +38,7 @@ /* $FreeBSD$ */ + #include "oce_if.h" static int oce_POST(POCE_SOFTC sc); @@ -203,12 +204,16 @@ void oce_get_pci_capabilities(POCE_SOFTC { uint32_t val; - if (pci_find_cap(sc->dev, PCIY_PCIX, &val) == 0) { +#if __FreeBSD_version >= 1000000 + #define pci_find_extcap pci_find_cap +#endif + + if (pci_find_extcap(sc->dev, PCIY_PCIX, &val) == 0) { if (val != 0) sc->flags |= OCE_FLAGS_PCIX; } - if (pci_find_cap(sc->dev, PCIY_EXPRESS, &val) == 0) { + if (pci_find_extcap(sc->dev, PCIY_EXPRESS, &val) == 0) { if (val != 0) { uint16_t link_status = pci_read_config(sc->dev, val + 0x12, 2); @@ -219,12 +224,12 @@ void oce_get_pci_capabilities(POCE_SOFTC } } - if (pci_find_cap(sc->dev, PCIY_MSI, &val) == 0) { + if (pci_find_extcap(sc->dev, PCIY_MSI, &val) == 0) { if (val != 0) sc->flags |= OCE_FLAGS_MSI_CAPABLE; } - if (pci_find_cap(sc->dev, PCIY_MSIX, &val) == 0) { + if (pci_find_extcap(sc->dev, PCIY_MSIX, &val) == 0) { if (val != 0) { val = pci_msix_count(sc->dev); sc->flags |= OCE_FLAGS_MSIX_CAPABLE; @@ -386,6 +391,9 @@ oce_create_nw_interface(POCE_SOFTC sc) capab_flags &= ~MBX_RX_IFACE_FLAGS_PASS_L3L4_ERR; } + if (IS_SH(sc) || IS_XE201(sc)) + capab_flags |= MBX_RX_IFACE_FLAGS_MULTICAST; + /* enable capabilities controlled via driver startup parameters */ if (is_rss_enabled(sc)) capab_en_flags |= MBX_RX_IFACE_FLAGS_RSS; Modified: head/sys/dev/oce/oce_hw.h ============================================================================== --- head/sys/dev/oce/oce_hw.h Wed Oct 23 18:58:11 2013 (r257006) +++ head/sys/dev/oce/oce_hw.h Wed Oct 23 18:58:38 2013 (r257007) @@ -59,6 +59,30 @@ #define INTR_EN 0x20000000 #define IMAGE_TRANSFER_SIZE (32 * 1024) /* 32K at a time */ + +/********* UE Status and Mask Registers ***/ +#define PCICFG_UE_STATUS_LOW 0xA0 +#define PCICFG_UE_STATUS_HIGH 0xA4 +#define PCICFG_UE_STATUS_LOW_MASK 0xA8 + +/* Lancer SLIPORT registers */ +#define SLIPORT_STATUS_OFFSET 0x404 +#define SLIPORT_CONTROL_OFFSET 0x408 +#define SLIPORT_ERROR1_OFFSET 0x40C +#define SLIPORT_ERROR2_OFFSET 0x410 +#define PHYSDEV_CONTROL_OFFSET 0x414 + +#define SLIPORT_STATUS_ERR_MASK 0x80000000 +#define SLIPORT_STATUS_DIP_MASK 0x02000000 +#define SLIPORT_STATUS_RN_MASK 0x01000000 +#define SLIPORT_STATUS_RDY_MASK 0x00800000 +#define SLI_PORT_CONTROL_IP_MASK 0x08000000 +#define PHYSDEV_CONTROL_FW_RESET_MASK 0x00000002 +#define PHYSDEV_CONTROL_DD_MASK 0x00000004 +#define PHYSDEV_CONTROL_INP_MASK 0x40000000 + +#define SLIPORT_ERROR_NO_RESOURCE1 0x2 +#define SLIPORT_ERROR_NO_RESOURCE2 0x9 /* CSR register offsets */ #define MPU_EP_CONTROL 0 #define MPU_EP_SEMAPHORE_BE3 0xac @@ -2079,7 +2103,8 @@ struct flash_file_hdr { uint32_t antidote; uint32_t num_imgs; uint8_t build[24]; - uint8_t rsvd[32]; + uint8_t asic_type_rev; + uint8_t rsvd[31]; }; struct image_hdr { @@ -3681,4 +3706,3 @@ enum OCE_QUEUE_RX_STATS { QUEUE_RX_BUFFER_ERRORS = 8, QUEUE_RX_N_WORDS = 10 }; - Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Wed Oct 23 18:58:11 2013 (r257006) +++ head/sys/dev/oce/oce_if.c Wed Oct 23 18:58:38 2013 (r257007) @@ -36,7 +36,6 @@ * Costa Mesa, CA 92626 */ - /* $FreeBSD$ */ #include "opt_inet6.h" @@ -44,6 +43,78 @@ #include "oce_if.h" +/* UE Status Low CSR */ +static char *ue_status_low_desc[] = { + "CEV", + "CTX", + "DBUF", + "ERX", + "Host", + "MPU", + "NDMA", + "PTC ", + "RDMA ", + "RXF ", + "RXIPS ", + "RXULP0 ", + "RXULP1 ", + "RXULP2 ", + "TIM ", + "TPOST ", + "TPRE ", + "TXIPS ", + "TXULP0 ", + "TXULP1 ", + "UC ", + "WDMA ", + "TXULP2 ", + "HOST1 ", + "P0_OB_LINK ", + "P1_OB_LINK ", + "HOST_GPIO ", + "MBOX ", + "AXGMAC0", + "AXGMAC1", + "JTAG", + "MPU_INTPEND" +}; + +/* UE Status High CSR */ +static char *ue_status_hi_desc[] = { + "LPCMEMHOST", + "MGMT_MAC", + "PCS0ONLINE", + "MPU_IRAM", + "PCS1ONLINE", + "PCTL0", + "PCTL1", + "PMEM", + "RR", + "TXPB", + "RXPP", + "XAUI", + "TXP", + "ARM", + "IPC", + "HOST2", + "HOST3", + "HOST4", + "HOST5", + "HOST6", + "HOST7", + "HOST8", + "HOST9", + "NETC", + "Unknown", + "Unknown", + "Unknown", + "Unknown", + "Unknown", + "Unknown", + "Unknown", + "Unknown" +}; + /* Driver entry points prototypes */ static int oce_probe(device_t dev); @@ -388,11 +459,11 @@ oce_ioctl(struct ifnet *ifp, u_long comm } if ((ifp->if_flags & IFF_PROMISC) && !sc->promisc) { - sc->promisc = TRUE; - oce_rxf_set_promiscuous(sc, sc->promisc); + if (!oce_rxf_set_promiscuous(sc, (1 | (1 << 1)))) + sc->promisc = TRUE; } else if (!(ifp->if_flags & IFF_PROMISC) && sc->promisc) { - sc->promisc = FALSE; - oce_rxf_set_promiscuous(sc, sc->promisc); + if (!oce_rxf_set_promiscuous(sc, 0)) + sc->promisc = FALSE; } break; @@ -862,10 +933,12 @@ retry: (m->m_pkthdr.csum_flags & CSUM_TCP) ? 1 : 0; nichdr->u0.s.num_wqe = num_wqes; nichdr->u0.s.total_length = m->m_pkthdr.len; + if (m->m_flags & M_VLANTAG) { nichdr->u0.s.vlan = 1; /*Vlan present*/ nichdr->u0.s.vlan_tag = m->m_pkthdr.ether_vtag; } + if (m->m_pkthdr.csum_flags & CSUM_TSO) { if (m->m_pkthdr.tso_segsz) { nichdr->u0.s.lso = 1; @@ -1156,6 +1229,18 @@ oce_wq_handler(void *arg) } +#if __FreeBSD_version >= 1000000 +static __inline void +drbr_stats_update(struct ifnet *ifp, int len, int mflags) +{ +#ifndef NO_SLOW_STATS + ifp->if_obytes += len; + if (mflags & M_MCAST) + ifp->if_omcasts++; +#endif +} +#endif + static int oce_multiq_transmit(struct ifnet *ifp, struct mbuf *m, struct oce_wq *wq) { @@ -1174,7 +1259,7 @@ oce_multiq_transmit(struct ifnet *ifp, s return status; } - if (m != NULL) { + if (m != NULL) { if ((status = drbr_enqueue(ifp, br, m)) != 0) return status; } @@ -1646,6 +1731,10 @@ oce_attach_ifp(POCE_SOFTC sc) sc->ifp->if_capenable = sc->ifp->if_capabilities; if_initbaudrate(sc->ifp, IF_Gbps(10)); +#if __FreeBSD_version >= 1000000 + sc->ifp->if_hw_tsomax = OCE_MAX_TSO_SIZE; +#endif + ether_ifattach(sc->ifp, sc->macaddr.mac_addr); return 0; @@ -1664,7 +1753,8 @@ oce_add_vlan(void *arg, struct ifnet *if sc->vlan_tag[vtag] = 1; sc->vlans_added++; - oce_vid_config(sc); + if (sc->vlans_added <= (sc->max_vlans + 1)) + oce_vid_config(sc); } @@ -1866,12 +1956,76 @@ done: } +static void oce_detect_hw_error(POCE_SOFTC sc) +{ + + uint32_t ue_low = 0, ue_high = 0, ue_low_mask = 0, ue_high_mask = 0; + uint32_t sliport_status = 0, sliport_err1 = 0, sliport_err2 = 0; + uint32_t i; + + if (sc->hw_error) + return; + + if (IS_XE201(sc)) { + sliport_status = OCE_READ_REG32(sc, db, SLIPORT_STATUS_OFFSET); + if (sliport_status & SLIPORT_STATUS_ERR_MASK) { + sliport_err1 = OCE_READ_REG32(sc, db, SLIPORT_ERROR1_OFFSET); + sliport_err2 = OCE_READ_REG32(sc, db, SLIPORT_ERROR2_OFFSET); + } + } else { + ue_low = OCE_READ_REG32(sc, devcfg, PCICFG_UE_STATUS_LOW); + ue_high = OCE_READ_REG32(sc, devcfg, PCICFG_UE_STATUS_HIGH); + ue_low_mask = OCE_READ_REG32(sc, devcfg, PCICFG_UE_STATUS_LOW_MASK); + ue_high_mask = OCE_READ_REG32(sc, devcfg, PCICFG_UE_STATUS_HI_MASK); + + ue_low = (ue_low & ~ue_low_mask); + ue_high = (ue_high & ~ue_high_mask); + } + + /* On certain platforms BE hardware can indicate spurious UEs. + * Allow the h/w to stop working completely in case of a real UE. + * Hence not setting the hw_error for UE detection. + */ + if (sliport_status & SLIPORT_STATUS_ERR_MASK) { + sc->hw_error = TRUE; + device_printf(sc->dev, "Error detected in the card\n"); + } + + if (sliport_status & SLIPORT_STATUS_ERR_MASK) { + device_printf(sc->dev, + "ERR: sliport status 0x%x\n", sliport_status); + device_printf(sc->dev, + "ERR: sliport error1 0x%x\n", sliport_err1); + device_printf(sc->dev, + "ERR: sliport error2 0x%x\n", sliport_err2); + } + + if (ue_low) { + for (i = 0; ue_low; ue_low >>= 1, i++) { + if (ue_low & 1) + device_printf(sc->dev, "UE: %s bit set\n", + ue_status_low_desc[i]); + } + } + + if (ue_high) { + for (i = 0; ue_high; ue_high >>= 1, i++) { + if (ue_high & 1) + device_printf(sc->dev, "UE: %s bit set\n", + ue_status_hi_desc[i]); + } + } + +} + + static void oce_local_timer(void *arg) { POCE_SOFTC sc = arg; int i = 0; + oce_detect_hw_error(sc); oce_refresh_nic_stats(sc); oce_refresh_queue_stats(sc); oce_mac_addr_set(sc); @@ -1890,7 +2044,7 @@ oce_local_timer(void *arg) /* NOTE : This should only be called holding * DEVICE_LOCK. -*/ + */ static void oce_if_deactivate(POCE_SOFTC sc) { @@ -2080,6 +2234,9 @@ setup_max_queues_want(POCE_SOFTC sc) (sc->flags & OCE_FLAGS_BE2)) { sc->nrqs = 1; sc->nwqs = 1; + } else { + sc->nrqs = MIN(OCE_NCPUS, sc->nrssqs) + 1; + sc->nwqs = MIN(OCE_NCPUS, sc->nrssqs); } } Modified: head/sys/dev/oce/oce_if.h ============================================================================== --- head/sys/dev/oce/oce_if.h Wed Oct 23 18:58:11 2013 (r257006) +++ head/sys/dev/oce/oce_if.h Wed Oct 23 18:58:38 2013 (r257007) @@ -36,7 +36,6 @@ * Costa Mesa, CA 92626 */ - /* $FreeBSD$ */ #include @@ -88,7 +87,8 @@ #include "oce_hw.h" -#define COMPONENT_REVISION "4.6.95.0" +/* OCE device driver module component revision informaiton */ +#define COMPONENT_REVISION "10.0.664.0" /* OCE devices supported by this driver */ #define PCI_VENDOR_EMULEX 0x10df /* Emulex */ @@ -150,6 +150,7 @@ extern int mp_ncpus; /* system's total #define OCE_MAX_TX_ELEMENTS 29 #define OCE_MAX_TX_DESC 1024 #define OCE_MAX_TX_SIZE 65535 +#define OCE_MAX_TSO_SIZE (65535 - ETHER_HDR_LEN) #define OCE_MAX_RX_SIZE 4096 #define OCE_MAX_RQ_POSTS 255 #define OCE_DEFAULT_PROMISCUOUS 0 @@ -173,6 +174,7 @@ extern int mp_ncpus; /* system's total #define OCE_CAPAB_FLAGS (MBX_RX_IFACE_FLAGS_BROADCAST | \ MBX_RX_IFACE_FLAGS_UNTAGGED | \ MBX_RX_IFACE_FLAGS_PROMISCUOUS | \ + MBX_RX_IFACE_FLAGS_VLAN_PROMISCUOUS | \ MBX_RX_IFACE_FLAGS_MCAST_PROMISCUOUS | \ MBX_RX_IFACE_FLAGS_RSS | \ MBX_RX_IFACE_FLAGS_PASS_L3L4_ERR) @@ -863,7 +865,7 @@ typedef struct oce_softc { uint32_t if_cap_flags; uint32_t flow_control; - uint32_t promisc; + uint8_t promisc; struct oce_aic_obj aic_obj[OCE_MAX_EQ]; @@ -877,9 +879,11 @@ typedef struct oce_softc { struct oce_drv_stats oce_stats_info; struct callout timer; int8_t be3_native; + uint8_t hw_error; uint16_t qnq_debug_event; uint16_t qnqid; uint16_t pvid; + uint16_t max_vlans; } OCE_SOFTC, *POCE_SOFTC; @@ -1010,7 +1014,7 @@ int oce_config_vlan(POCE_SOFTC sc, uint3 uint32_t untagged, uint32_t enable_promisc); int oce_set_flow_control(POCE_SOFTC sc, uint32_t flow_control); int oce_config_nic_rss(POCE_SOFTC sc, uint32_t if_id, uint16_t enable_rss); -int oce_rxf_set_promiscuous(POCE_SOFTC sc, uint32_t enable); +int oce_rxf_set_promiscuous(POCE_SOFTC sc, uint8_t enable); int oce_set_common_iface_rx_filter(POCE_SOFTC sc, POCE_DMA_MEM sgl); int oce_get_link_status(POCE_SOFTC sc, struct link_status *link); int oce_mbox_get_nic_stats_v0(POCE_SOFTC sc, POCE_DMA_MEM pstats_dma_mem); Modified: head/sys/dev/oce/oce_mbox.c ============================================================================== --- head/sys/dev/oce/oce_mbox.c Wed Oct 23 18:58:11 2013 (r257006) +++ head/sys/dev/oce/oce_mbox.c Wed Oct 23 18:58:38 2013 (r257007) @@ -36,11 +36,8 @@ * Costa Mesa, CA 92626 */ - - /* $FreeBSD$ */ - #include "oce_if.h" extern uint32_t sfp_vpd_dump_buffer[TRANSCEIVER_DATA_NUM_ELE]; @@ -281,8 +278,10 @@ oce_get_fw_version(POCE_SOFTC sc) if (!ret) ret = fwcmd->hdr.u0.rsp.status; if (ret) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, ret); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, ret, + fwcmd->hdr.u0.rsp.additional_status); goto error; } @@ -438,8 +437,10 @@ oce_read_mac_addr(POCE_SOFTC sc, uint32_ if (!ret) ret = fwcmd->hdr.u0.rsp.status; if (ret) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, ret); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, ret, + fwcmd->hdr.u0.rsp.additional_status); goto error; } @@ -481,25 +482,27 @@ oce_get_fw_config(POCE_SOFTC sc) if (!ret) ret = fwcmd->hdr.u0.rsp.status; if (ret) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, ret); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, ret, + fwcmd->hdr.u0.rsp.additional_status); goto error; } DW_SWAP(u32ptr(fwcmd), sizeof(struct mbx_common_query_fw_config)); - sc->config_number = fwcmd->params.rsp.config_number; - sc->asic_revision = fwcmd->params.rsp.asic_revision; - sc->port_id = fwcmd->params.rsp.port_id; - sc->function_mode = fwcmd->params.rsp.function_mode; - sc->function_caps = fwcmd->params.rsp.function_caps; + sc->config_number = HOST_32(fwcmd->params.rsp.config_number); + sc->asic_revision = HOST_32(fwcmd->params.rsp.asic_revision); + sc->port_id = HOST_32(fwcmd->params.rsp.port_id); + sc->function_mode = HOST_32(fwcmd->params.rsp.function_mode); + sc->function_caps = HOST_32(fwcmd->params.rsp.function_caps); if (fwcmd->params.rsp.ulp[0].ulp_mode & ULP_NIC_MODE) { - sc->max_tx_rings = fwcmd->params.rsp.ulp[0].nic_wq_tot; - sc->max_rx_rings = fwcmd->params.rsp.ulp[0].lro_rqid_tot; + sc->max_tx_rings = HOST_32(fwcmd->params.rsp.ulp[0].nic_wq_tot); + sc->max_rx_rings = HOST_32(fwcmd->params.rsp.ulp[0].lro_rqid_tot); } else { - sc->max_tx_rings = fwcmd->params.rsp.ulp[1].nic_wq_tot; - sc->max_rx_rings = fwcmd->params.rsp.ulp[1].lro_rqid_tot; + sc->max_tx_rings = HOST_32(fwcmd->params.rsp.ulp[1].nic_wq_tot); + sc->max_rx_rings = HOST_32(fwcmd->params.rsp.ulp[1].lro_rqid_tot); } error: @@ -561,15 +564,17 @@ oce_if_create(POCE_SOFTC sc, if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } - *if_id = LE_32(fwcmd->params.rsp.if_id); + *if_id = HOST_32(fwcmd->params.rsp.if_id); if (mac_addr != NULL) - sc->pmac_id = LE_32(fwcmd->params.rsp.pmac_id); + sc->pmac_id = HOST_32(fwcmd->params.rsp.pmac_id); error: return rc; } @@ -607,8 +612,10 @@ oce_if_del(POCE_SOFTC sc, uint32_t if_id if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); return rc; } @@ -630,7 +637,10 @@ oce_config_vlan(POCE_SOFTC sc, { struct oce_mbx mbx; struct mbx_common_config_vlan *fwcmd; - int rc; + int rc = 0; + + if (sc->vlans_added > sc->max_vlans) + goto vlan_promisc; bzero(&mbx, sizeof(struct oce_mbx)); fwcmd = (struct mbx_common_config_vlan *)&mbx.payload; @@ -659,9 +669,19 @@ oce_config_vlan(POCE_SOFTC sc, if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); - return 0; + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); + + goto done; + +vlan_promisc: + /* Enable Vlan Promis */ + oce_rxf_set_promiscuous(sc, (1 << 1)); + device_printf(sc->dev,"Enabling Vlan Promisc Mode\n"); +done: + return rc; } @@ -702,8 +722,10 @@ oce_set_flow_control(POCE_SOFTC sc, uint if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); return rc; } @@ -802,8 +824,10 @@ oce_config_nic_rss(POCE_SOFTC sc, uint32 if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); } return rc; } @@ -818,7 +842,7 @@ oce_config_nic_rss(POCE_SOFTC sc, uint32 * This function uses the COMMON_SET_IFACE_RX_FILTER command instead. */ int -oce_rxf_set_promiscuous(POCE_SOFTC sc, uint32_t enable) +oce_rxf_set_promiscuous(POCE_SOFTC sc, uint8_t enable) { struct mbx_set_common_iface_rx_filter *fwcmd; int sz = sizeof(struct mbx_set_common_iface_rx_filter); @@ -836,10 +860,13 @@ oce_rxf_set_promiscuous(POCE_SOFTC sc, u req = &fwcmd->params.req; req->iface_flags_mask = MBX_RX_IFACE_FLAGS_PROMISCUOUS | MBX_RX_IFACE_FLAGS_VLAN_PROMISCUOUS; - if (enable) { - req->iface_flags = MBX_RX_IFACE_FLAGS_PROMISCUOUS | - MBX_RX_IFACE_FLAGS_VLAN_PROMISCUOUS; - } + /* Bit 0 Mac promisc, Bit 1 Vlan promisc */ + if (enable & 0x01) + req->iface_flags = MBX_RX_IFACE_FLAGS_PROMISCUOUS; + + if (enable & 0x02) + req->iface_flags = MBX_RX_IFACE_FLAGS_VLAN_PROMISCUOUS; + req->if_id = sc->if_id; rc = oce_set_common_iface_rx_filter(sc, &sgl); @@ -886,9 +913,11 @@ oce_set_common_iface_rx_filter(POCE_SOFT if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); - return 0; + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); + return rc; } /** @@ -925,14 +954,16 @@ oce_get_link_status(POCE_SOFTC sc, struc if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } /* interpret response */ bcopy(&fwcmd->params.rsp, link, sizeof(struct link_status)); - link->logical_link_status = LE_32(link->logical_link_status); - link->qos_link_speed = LE_16(link->qos_link_speed); + link->logical_link_status = HOST_32(link->logical_link_status); + link->qos_link_speed = HOST_16(link->qos_link_speed); error: return rc; } @@ -978,8 +1009,10 @@ oce_mbox_get_nic_stats_v0(POCE_SOFTC sc, if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); return rc; } @@ -1028,8 +1061,10 @@ oce_mbox_get_nic_stats(POCE_SOFTC sc, PO if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); return rc; } @@ -1080,8 +1115,10 @@ oce_mbox_get_pport_stats(POCE_SOFTC sc, if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); return rc; } @@ -1133,8 +1170,10 @@ oce_mbox_get_vport_stats(POCE_SOFTC sc, if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); return rc; } @@ -1178,8 +1217,10 @@ oce_update_multicast(POCE_SOFTC sc, POCE if (!rc) rc = req->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + req->hdr.u0.rsp.additional_status); return rc; } @@ -1243,8 +1284,10 @@ oce_mbox_macaddr_add(POCE_SOFTC sc, uint if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } *pmac_id = fwcmd->params.rsp.pmac_id; @@ -1281,8 +1324,10 @@ oce_mbox_macaddr_del(POCE_SOFTC sc, uint if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); return rc; } @@ -1318,11 +1363,13 @@ oce_mbox_check_native_mode(POCE_SOFTC sc if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } - sc->be3_native = fwcmd->params.rsp.capability_flags + sc->be3_native = HOST_32(fwcmd->params.rsp.capability_flags) & CAP_BE3_NATIVE_ERX_API; error: @@ -1363,8 +1410,10 @@ oce_mbox_cmd_set_loopback(POCE_SOFTC sc, if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); return rc; @@ -1406,8 +1455,10 @@ oce_mbox_cmd_test_loopback(POCE_SOFTC sc if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); return rc; } @@ -1433,9 +1484,9 @@ oce_mbox_write_flashrom(POCE_SOFTC sc, u payload_len, OCE_MBX_VER_V0); - fwcmd->flash_op_type = optype; - fwcmd->flash_op_code = opcode; - fwcmd->data_buffer_size = num_bytes; + fwcmd->flash_op_type = LE_32(optype); + fwcmd->flash_op_code = LE_32(opcode); + fwcmd->data_buffer_size = LE_32(num_bytes); mbx.u0.s.embedded = 0; /*Non embeded*/ mbx.payload_length = payload_len; @@ -1451,8 +1502,10 @@ oce_mbox_write_flashrom(POCE_SOFTC sc, u if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); return rc; @@ -1497,8 +1550,10 @@ oce_mbox_get_flashrom_crc(POCE_SOFTC sc, if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } bcopy(fwcmd->data_buffer, flash_crc, 4); @@ -1532,18 +1587,20 @@ oce_mbox_get_phy_info(POCE_SOFTC sc, str if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } - phy_info->phy_type = fwcmd->params.rsp.phy_info.phy_type; + phy_info->phy_type = HOST_16(fwcmd->params.rsp.phy_info.phy_type); phy_info->interface_type = - fwcmd->params.rsp.phy_info.interface_type; + HOST_16(fwcmd->params.rsp.phy_info.interface_type); phy_info->auto_speeds_supported = - fwcmd->params.rsp.phy_info.auto_speeds_supported; + HOST_16(fwcmd->params.rsp.phy_info.auto_speeds_supported); phy_info->fixed_speeds_supported = - fwcmd->params.rsp.phy_info.fixed_speeds_supported; - phy_info->misc_params =fwcmd->params.rsp.phy_info.misc_params; + HOST_16(fwcmd->params.rsp.phy_info.fixed_speeds_supported); + phy_info->misc_params = HOST_32(fwcmd->params.rsp.phy_info.misc_params); error: return rc; @@ -1593,11 +1650,13 @@ oce_mbox_lancer_write_flashrom(POCE_SOFT if (!rc) rc = fwcmd->params.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->params.rsp.additional_status); goto error; } - *written_data = fwcmd->params.rsp.actual_write_length; + *written_data = HOST_32(fwcmd->params.rsp.actual_write_length); *additional_status = fwcmd->params.rsp.additional_status; error: return rc; @@ -1649,11 +1708,13 @@ oce_mbox_create_rq(struct oce_rq *rq) if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } - rq->rq_id = fwcmd->params.rsp.rq_id; + rq->rq_id = HOST_16(fwcmd->params.rsp.rq_id); rq->rss_cpuid = fwcmd->params.rsp.rss_cpuid; error: return rc; @@ -1673,15 +1734,17 @@ oce_mbox_create_wq(struct oce_wq *wq) bzero(&mbx, sizeof(struct oce_mbx)); fwcmd = (struct mbx_create_nic_wq *)&mbx.payload; - if (IS_XE201(sc)) { + if (IS_XE201(sc)) version = OCE_MBX_VER_V1; - fwcmd->params.req.if_id = sc->if_id; - } else if(IS_BE(sc)) + else if(IS_BE(sc)) IS_PROFILE_SUPER_NIC(sc) ? (version = OCE_MBX_VER_V2) : (version = OCE_MBX_VER_V0); else version = OCE_MBX_VER_V2; + if (version > OCE_MBX_VER_V0) + fwcmd->params.req.if_id = sc->if_id; + mbx_common_req_hdr_init(&fwcmd->hdr, 0, 0, MBX_SUBSYSTEM_NIC, NIC_CREATE_WQ, MBX_TIMEOUT_SEC, @@ -1703,13 +1766,15 @@ oce_mbox_create_wq(struct oce_wq *wq) if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } - wq->wq_id = LE_16(fwcmd->params.rsp.wq_id); + wq->wq_id = HOST_16(fwcmd->params.rsp.wq_id); if (version == OCE_MBX_VER_V2) - wq->db_offset = LE_32(fwcmd->params.rsp.db_offset); + wq->db_offset = HOST_32(fwcmd->params.rsp.db_offset); else wq->db_offset = PD_TXULP_DB; error: @@ -1754,11 +1819,13 @@ oce_mbox_create_eq(struct oce_eq *eq) if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } - eq->eq_id = LE_16(fwcmd->params.rsp.eq_id); + eq->eq_id = HOST_16(fwcmd->params.rsp.eq_id); error: return rc; } @@ -1832,11 +1899,13 @@ oce_mbox_cq_create(struct oce_cq *cq, ui if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } - cq->cq_id = LE_16(fwcmd->params.rsp.cq_id); + cq->cq_id = HOST_16(fwcmd->params.rsp.cq_id); error: return rc; @@ -1885,8 +1954,10 @@ oce_mbox_read_transrecv_data(POCE_SOFTC if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } if(fwcmd->params.rsp.page_num == PAGE_NUM_A0) @@ -1947,8 +2018,10 @@ oce_mbox_eqd_modify_periodic(POCE_SOFTC if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 19:35:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 96E4E6F5 for ; Wed, 23 Oct 2013 19:35:10 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 651032A57 for ; Wed, 23 Oct 2013 19:35:10 +0000 (UTC) Received: by mail-pa0-f50.google.com with SMTP id fb1so1072127pad.37 for ; Wed, 23 Oct 2013 12:35:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type; bh=lJ2D3ON6lC7z7TY61Xcz3AXtjs37DpeG7w/IK8aU8gE=; b=K4UAus/qRWNW2HW4pOusBNkEoJ5T4o6chnchAvndXs5dqnpw/ZH8hb/4Is7LQb6eWi OLM63vLknXfTQOkk43jiUY639C++qUbGRl6ryUASDThdeQ8BPLXCOX98Gq3wjC6Aw9XQ gNqW8/q2KKoO/lgDt7PZQdfZxZponn9jAAHChzQs3rgr2dKYd1+OX6iepsjDbOWwuGmc ErGnZ/EJ1qIbSpqY2q8pmvVoBzHikIwZCx+wjvszrjGtpq3i5YLCn7DJxYKe3oqh9ZFG ILToYF5kgWpaX6Be4GxdE32InM7VWNqd1wA1z1d7MnITCP4zQCaTxi2HOx30QDd24wCK rv7A== X-Gm-Message-State: ALoCoQmcv7V+siF26BrsWcyh5LuXBqsOudKdanGWbFf7PQGReMPel6FV1mU/nfdXtBW9qxdPuO0C X-Received: by 10.68.253.1 with SMTP id zw1mr3376483pbc.30.1382556909546; Wed, 23 Oct 2013 12:35:09 -0700 (PDT) Received: from zont-osx.local (h-74-3-97-61.snva.ca.megapath.net. [74.3.97.61]) by mx.google.com with ESMTPSA id zq10sm43238897pab.6.2013.10.23.12.35.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Oct 2013 12:35:05 -0700 (PDT) Sender: Andrey Zonov Message-ID: <526824E2.6000309@FreeBSD.org> Date: Wed, 23 Oct 2013 12:34:58 -0700 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Hilko Meyer Subject: Re: svn commit: r256710 - head/tools/build/mk References: <201310172200.r9HM0ZFM072006__34950.8864027031$1382047250$gmane$org@svn.freebsd.org> <97l269dokal3obs07tc792auspk1e0j0nj@4ax.com> In-Reply-To: <97l269dokal3obs07tc792auspk1e0j0nj@4ax.com> X-Enigmail-Version: 1.5.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Gw29xVMKjI0xNjtGSrRCFjTB7eaSojQqs" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 19:35:10 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Gw29xVMKjI0xNjtGSrRCFjTB7eaSojQqs Content-Type: multipart/mixed; boundary="------------050305090704050501080009" This is a multi-part message in MIME format. --------------050305090704050501080009 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 10/18/13 8:38 AM, Hilko Meyer wrote: > On Thu, 17 Oct 2013 22:00:35 +0000 (UTC), in gmane.os.freebsd.devel.cvs= you > wrote: >=20 >> Author: zont >> Date: Thu Oct 17 22:00:35 2013 >> New Revision: 256710 >> URL: http://svnweb.freebsd.org/changeset/base/256710 >> >> Log: >> Add lot of missed files and dirs >> >> Modified: >> head/tools/build/mk/OptionalObsoleteFiles.inc >=20 > This fixed two files I reported in conf/167133.2. Maybe you can look fo= r the > other four and close the PR. >=20 pccard.conf - is already in ObsoleteFiles.inc. pf.conf - we cannot just put it in ObsoleteFiles.inc because people may have working configuration in this place. usr/share/examples/netgraph/bluetooth - it was missed to remove when example file inside was removed in 2007. usr/share/examples/iscsi - never used since was added in 2007. I'll commit attached patch if no objections will be met. --=20 Andrey Zonov --------------050305090704050501080009 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="cleanup-dirs.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="cleanup-dirs.patch" diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index d77260c..7111d15 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done =20 +# 20131023: remove never used iscsi directory +OLD_FILES+=3Dusr/share/examples/iscsi # 20131014: libbsdyml becomes private OLD_FILES+=3Dusr/lib/libbsdyml.a OLD_FILES+=3Dusr/lib/libbsdyml.so @@ -2491,6 +2493,7 @@ OLD_FILES+=3Dusr/sbin/zfs OLD_FILES+=3Dusr/sbin/zpool # 20070423: rc.bluetooth (examples) removed OLD_FILES+=3Dusr/share/examples/netgraph/bluetooth/rc.bluetooth +OLD_DIRS+=3Dusr/share/examples/netgraph/bluetooth # 20070421: worm.4 removed OLD_FILES+=3Dusr/share/man/man4/worm.4.gz # 20070417: trunk(4) renamed to lagg(4) diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index 379a436..9b36acc 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -325,8 +325,6 @@ .. ipfw .. - iscsi - .. jails .. kld @@ -360,8 +358,6 @@ mdoc .. netgraph - bluetooth - .. .. pc-sysinstall .. --------------050305090704050501080009-- --Gw29xVMKjI0xNjtGSrRCFjTB7eaSojQqs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJSaCTkAAoJEBWLemxX/CvTBFEH/2QOUJUVH5+K1rRcR5cjqadw hwYPP9Vmp2TJQ38hcR3B7iILgwSemnLBjlEsZ28bUfbG9FHVGIfl3IQXYgOQN0yN GhQB++n4fpJBNHKOy2ZXzxlxCl9hfw0Wps7G/0sZeNaDkxdMP7Znr0FowptbyoQM AdjGAKTIEIXnzeFVQ+W7qHeII/CtwX+jBXMgo1nybusq2GqCNMkDz7YBLR5mL3W+ lRPpHexNa4apeyLwndX+HWLOkkku2zhK+N5pwMFxDDILmq93PAUeXiI259Dknbxi 64ocT6/G3JdAvheWTUxd96d6vEvhJqvrK+Qn+TBaljAPQZfwmvaMZXwcIrE/Leo= =Ot0B -----END PGP SIGNATURE----- --Gw29xVMKjI0xNjtGSrRCFjTB7eaSojQqs-- From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 19:56:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AD8143CB; Wed, 23 Oct 2013 19:56:13 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9A3A22C01; Wed, 23 Oct 2013 19:56:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NJuDtZ022228; Wed, 23 Oct 2013 19:56:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NJuDXF022227; Wed, 23 Oct 2013 19:56:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310231956.r9NJuDXF022227@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 23 Oct 2013 19:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257015 - head/sys/arm/mv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 19:56:13 -0000 Author: nwhitehorn Date: Wed Oct 23 19:56:13 2013 New Revision: 257015 URL: http://svnweb.freebsd.org/changeset/base/257015 Log: Typo while reviewing diffs. Sorry for the breakage! Modified: head/sys/arm/mv/gpio.c Modified: head/sys/arm/mv/gpio.c ============================================================================== --- head/sys/arm/mv/gpio.c Wed Oct 23 19:47:03 2013 (r257014) +++ head/sys/arm/mv/gpio.c Wed Oct 23 19:56:13 2013 (r257015) @@ -638,7 +638,7 @@ platform_gpio_init(void) * contain a ref. to a node defining GPIO * controller. */ - ctrl = OF_xref_handle(fdt32_to_cpu(gpios[0])); + ctrl = OF_xref_phandle(fdt32_to_cpu(gpios[0])); if (fdt_is_compatible(ctrl, e->compat)) /* Call a handler. */ From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 20:00:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E217D6A4; Wed, 23 Oct 2013 20:00:15 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C023F2C64; Wed, 23 Oct 2013 20:00:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NK0Ffo024539; Wed, 23 Oct 2013 20:00:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NK0Faw024533; Wed, 23 Oct 2013 20:00:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310232000.r9NK0Faw024533@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 23 Oct 2013 20:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257016 - in head/sys: conf dev/ofw powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 20:00:16 -0000 Author: nwhitehorn Date: Wed Oct 23 20:00:14 2013 New Revision: 257016 URL: http://svnweb.freebsd.org/changeset/base/257016 Log: Factor out MI portions of the PowerPC nexus device into /sys/dev/ofw. The sparc64 driver will be modified to use this shortly. Added: head/sys/dev/ofw/ofw_nexus.c - copied, changed from r257007, head/sys/powerpc/powerpc/nexus.c head/sys/dev/ofw/ofw_nexus.h - copied, changed from r257007, head/sys/sparc64/include/nexusvar.h Modified: head/sys/conf/files.powerpc head/sys/powerpc/powerpc/nexus.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Wed Oct 23 19:56:13 2013 (r257015) +++ head/sys/conf/files.powerpc Wed Oct 23 20:00:14 2013 (r257016) @@ -46,6 +46,7 @@ dev/ofw/ofw_bus_subr.c optional aim dev/ofw/ofw_console.c optional aim dev/ofw/ofw_disk.c optional ofwd aim dev/ofw/ofw_iicbus.c optional iicbus aim +dev/ofw/ofw_nexus.c optional aim | fdt dev/ofw/ofw_standard.c optional aim powerpc dev/powermac_nvram/powermac_nvram.c optional powermac_nvram powermac dev/quicc/quicc_bfe_fdt.c optional quicc mpc85xx Copied and modified: head/sys/dev/ofw/ofw_nexus.c (from r257007, head/sys/powerpc/powerpc/nexus.c) ============================================================================== --- head/sys/powerpc/powerpc/nexus.c Wed Oct 23 18:58:38 2013 (r257007, copy source) +++ head/sys/dev/ofw/ofw_nexus.c Wed Oct 23 20:00:14 2013 (r257016) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -64,8 +65,6 @@ __FBSDID("$FreeBSD$"); * Additionally, interrupt setup/teardown and some resource management are * done at this level. * - * Maybe this code should get into dev/ofw to some extent, as some of it should - * work for all Open Firmware based machines... */ struct nexus_devinfo { @@ -73,31 +72,15 @@ struct nexus_devinfo { struct resource_list ndi_rl; }; -struct nexus_softc { - uint32_t acells, scells; - struct rman sc_intr_rman; - struct rman sc_mem_rman; -}; - static device_probe_t nexus_probe; static device_attach_t nexus_attach; static bus_print_child_t nexus_print_child; static bus_add_child_t nexus_add_child; static bus_probe_nomatch_t nexus_probe_nomatch; -static bus_setup_intr_t nexus_setup_intr; -static bus_teardown_intr_t nexus_teardown_intr; static bus_alloc_resource_t nexus_alloc_resource; -static bus_activate_resource_t nexus_activate_resource; -static bus_deactivate_resource_t nexus_deactivate_resource; static bus_adjust_resource_t nexus_adjust_resource; static bus_release_resource_t nexus_release_resource; static bus_get_resource_list_t nexus_get_resource_list; -#ifdef SMP -static bus_bind_intr_t nexus_bind_intr; -#endif -static bus_config_intr_t nexus_config_intr; -static ofw_bus_map_intr_t nexus_ofw_map_intr; -static ofw_bus_config_intr_t nexus_ofw_config_intr; static ofw_bus_get_devinfo_t nexus_get_devinfo; static int nexus_inlist(const char *, const char *const *); @@ -122,19 +105,11 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_add_child, nexus_add_child), DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), - DEVMETHOD(bus_activate_resource, nexus_activate_resource), - DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), DEVMETHOD(bus_adjust_resource, nexus_adjust_resource), DEVMETHOD(bus_release_resource, nexus_release_resource), - DEVMETHOD(bus_setup_intr, nexus_setup_intr), - DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_get_resource_list, nexus_get_resource_list), -#ifdef SMP - DEVMETHOD(bus_bind_intr, nexus_bind_intr), -#endif - DEVMETHOD(bus_config_intr, nexus_config_intr), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, nexus_get_devinfo), @@ -143,18 +118,13 @@ static device_method_t nexus_methods[] = DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - DEVMETHOD(ofw_bus_map_intr, nexus_ofw_map_intr), - DEVMETHOD(ofw_bus_config_intr, nexus_ofw_config_intr), DEVMETHOD_END }; -static devclass_t nexus_devclass; - -DEFINE_CLASS_0(nexus, nexus_driver, nexus_methods, sizeof(struct nexus_softc)); -EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0, - BUS_PASS_BUS); -MODULE_VERSION(nexus, 1); +DEFINE_CLASS_0(ofw_nexus, ofw_nexus_driver, nexus_methods, + sizeof(struct ofw_nexus_softc)); +MODULE_VERSION(ofw_nexus, 1); static const char *const nexus_excl_name[] = { "FJSV,system", @@ -182,9 +152,6 @@ static const char *const nexus_excl_type NULL }; -extern struct bus_space_tag nexus_bustag; -extern struct bus_dma_tag nexus_dmatag; - static int nexus_inlist(const char *name, const char *const *list) { @@ -215,7 +182,7 @@ static int nexus_attach(device_t dev) { struct nexus_devinfo *ndi; - struct nexus_softc *sc; + struct ofw_nexus_softc *sc; device_t cdev; phandle_t node; @@ -321,79 +288,11 @@ nexus_probe_nomatch(device_t bus, device type != NULL ? type : "unknown"); } -static int -nexus_setup_intr(device_t bus __unused, device_t child, struct resource *r, - int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, - void **cookiep) -{ - int error; - - if (r == NULL) - panic("%s: NULL interrupt resource!", __func__); - - if ((rman_get_flags(r) & RF_SHAREABLE) == 0) - flags |= INTR_EXCL; - - /* We depend here on rman_activate_resource() being idempotent. */ - error = rman_activate_resource(r); - if (error) - return (error); - - error = powerpc_setup_intr(device_get_nameunit(child), - rman_get_start(r), filt, intr, arg, flags, cookiep); - - return (error); -} - -static int -nexus_teardown_intr(device_t bus __unused, device_t child __unused, - struct resource *r, void *ih) -{ - - if (r == NULL) - return (EINVAL); - - return (powerpc_teardown_intr(ih)); -} - -#ifdef SMP -static int -nexus_bind_intr(device_t bus __unused, device_t child __unused, - struct resource *r, int cpu) -{ - - return (powerpc_bind_intr(rman_get_start(r), cpu)); -} -#endif - -static int -nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, - enum intr_polarity pol) -{ - - return (powerpc_config_intr(irq, trig, pol)); -} - -static int -nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int irq) -{ - return (MAP_IRQ(iparent, irq)); -} - -static int -nexus_ofw_config_intr(device_t dev, device_t child, int irq, int sense) -{ - - return (bus_generic_config_intr(child, irq, (sense & 1) ? - INTR_TRIGGER_LEVEL : INTR_TRIGGER_EDGE, - INTR_POLARITY_LOW)); -} - static struct resource * nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { - struct nexus_softc *sc; + struct ofw_nexus_softc *sc; struct rman *rm; struct resource *rv; struct resource_list_entry *rle; @@ -454,52 +353,10 @@ nexus_alloc_resource(device_t bus, devic } static int -nexus_activate_resource(device_t bus __unused, device_t child __unused, - int type, int rid __unused, struct resource *r) -{ - - if (type == SYS_RES_MEMORY) { - vm_offset_t start; - void *p; - - start = (vm_offset_t) rman_get_start(r); - if (bootverbose) - printf("nexus mapdev: start %zx, len %ld\n", start, - rman_get_size(r)); - - p = pmap_mapdev(start, (vm_size_t) rman_get_size(r)); - if (p == NULL) - return (ENOMEM); - rman_set_virtual(r, p); - rman_set_bustag(r, &bs_be_tag); - rman_set_bushandle(r, (u_long)p); - } - return (rman_activate_resource(r)); -} - -static int -nexus_deactivate_resource(device_t bus __unused, device_t child __unused, - int type __unused, int rid __unused, struct resource *r) -{ - - /* - * If this is a memory resource, unmap it. - */ - if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { - bus_size_t psize; - - psize = rman_get_size(r); - pmap_unmapdev((vm_offset_t)rman_get_virtual(r), psize); - } - - return (rman_deactivate_resource(r)); -} - -static int nexus_adjust_resource(device_t bus, device_t child __unused, int type, struct resource *r, u_long start, u_long end) { - struct nexus_softc *sc; + struct ofw_nexus_softc *sc; struct rman *rm; device_t nexus; @@ -559,7 +416,7 @@ nexus_get_devinfo(device_t bus __unused, static struct nexus_devinfo * nexus_setup_dinfo(device_t dev, phandle_t node) { - struct nexus_softc *sc; + struct ofw_nexus_softc *sc; struct nexus_devinfo *ndi; uint32_t *reg, *intr, icells; uint64_t phys, size; Copied and modified: head/sys/dev/ofw/ofw_nexus.h (from r257007, head/sys/sparc64/include/nexusvar.h) ============================================================================== --- head/sys/sparc64/include/nexusvar.h Wed Oct 23 18:58:38 2013 (r257007, copy source) +++ head/sys/dev/ofw/ofw_nexus.h Wed Oct 23 20:00:14 2013 (r257016) @@ -26,9 +26,15 @@ * $FreeBSD$ */ -#ifndef _MACHINE_NEXUSVAR_H_ -#define _MACHINE_NEXUSVAR_H_ +#ifndef _OFW_NEXUS_H_ +#define _OFW_NEXUS_H_ -DECLARE_CLASS(nexus_driver); +struct ofw_nexus_softc { + uint32_t acells, scells; + struct rman sc_intr_rman; + struct rman sc_mem_rman; +}; -#endif /* _MACHINE_NEXUSVAR_H_ */ +DECLARE_CLASS(ofw_nexus_driver); + +#endif /* _OFW_NEXUS_H_ */ Modified: head/sys/powerpc/powerpc/nexus.c ============================================================================== --- head/sys/powerpc/powerpc/nexus.c Wed Oct 23 19:56:13 2013 (r257015) +++ head/sys/powerpc/powerpc/nexus.c Wed Oct 23 20:00:14 2013 (r257016) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -63,86 +64,31 @@ __FBSDID("$FreeBSD$"); * * Additionally, interrupt setup/teardown and some resource management are * done at this level. - * - * Maybe this code should get into dev/ofw to some extent, as some of it should - * work for all Open Firmware based machines... */ -struct nexus_devinfo { - struct ofw_bus_devinfo ndi_obdinfo; - struct resource_list ndi_rl; -}; - -struct nexus_softc { - uint32_t acells, scells; - struct rman sc_intr_rman; - struct rman sc_mem_rman; -}; - -static device_probe_t nexus_probe; -static device_attach_t nexus_attach; -static bus_print_child_t nexus_print_child; -static bus_add_child_t nexus_add_child; -static bus_probe_nomatch_t nexus_probe_nomatch; static bus_setup_intr_t nexus_setup_intr; static bus_teardown_intr_t nexus_teardown_intr; -static bus_alloc_resource_t nexus_alloc_resource; static bus_activate_resource_t nexus_activate_resource; static bus_deactivate_resource_t nexus_deactivate_resource; -static bus_adjust_resource_t nexus_adjust_resource; -static bus_release_resource_t nexus_release_resource; -static bus_get_resource_list_t nexus_get_resource_list; #ifdef SMP static bus_bind_intr_t nexus_bind_intr; #endif static bus_config_intr_t nexus_config_intr; static ofw_bus_map_intr_t nexus_ofw_map_intr; static ofw_bus_config_intr_t nexus_ofw_config_intr; -static ofw_bus_get_devinfo_t nexus_get_devinfo; - -static int nexus_inlist(const char *, const char *const *); -static struct nexus_devinfo * nexus_setup_dinfo(device_t, phandle_t); -static void nexus_destroy_dinfo(struct nexus_devinfo *); -static int nexus_print_res(struct nexus_devinfo *); static device_method_t nexus_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, nexus_probe), - DEVMETHOD(device_attach, nexus_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - /* Bus interface */ - DEVMETHOD(bus_print_child, nexus_print_child), - DEVMETHOD(bus_probe_nomatch, nexus_probe_nomatch), - DEVMETHOD(bus_read_ivar, bus_generic_read_ivar), - DEVMETHOD(bus_write_ivar, bus_generic_write_ivar), - DEVMETHOD(bus_add_child, nexus_add_child), - DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), - DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), DEVMETHOD(bus_activate_resource, nexus_activate_resource), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), - DEVMETHOD(bus_adjust_resource, nexus_adjust_resource), - DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), - DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), - DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), - DEVMETHOD(bus_get_resource_list, nexus_get_resource_list), #ifdef SMP DEVMETHOD(bus_bind_intr, nexus_bind_intr), #endif DEVMETHOD(bus_config_intr, nexus_config_intr), /* ofw_bus interface */ - DEVMETHOD(ofw_bus_get_devinfo, nexus_get_devinfo), - DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), - DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), - DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), - DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), - DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), DEVMETHOD(ofw_bus_map_intr, nexus_ofw_map_intr), DEVMETHOD(ofw_bus_config_intr, nexus_ofw_config_intr), @@ -151,176 +97,12 @@ static device_method_t nexus_methods[] = static devclass_t nexus_devclass; -DEFINE_CLASS_0(nexus, nexus_driver, nexus_methods, sizeof(struct nexus_softc)); +DEFINE_CLASS_1(nexus, nexus_driver, nexus_methods, + sizeof(struct ofw_nexus_softc), ofw_nexus_driver); EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0, BUS_PASS_BUS); MODULE_VERSION(nexus, 1); -static const char *const nexus_excl_name[] = { - "FJSV,system", - "aliases", - "associations", - "chosen", - "cmp", - "counter-timer", /* No separate device; handled by psycho/sbus */ - "failsafe", - "memory", - "openprom", - "options", - "packages", - "physical-memory", - "rsc", - "sgcn", - "todsg", - "virtual-memory", - NULL -}; - -static const char *const nexus_excl_type[] = { - "core", - "cpu", - NULL -}; - -extern struct bus_space_tag nexus_bustag; -extern struct bus_dma_tag nexus_dmatag; - -static int -nexus_inlist(const char *name, const char *const *list) -{ - int i; - - if (name == NULL) - return (0); - for (i = 0; list[i] != NULL; i++) - if (strcmp(name, list[i]) == 0) - return (1); - return (0); -} - -#define NEXUS_EXCLUDED(name, type) \ - (nexus_inlist((name), nexus_excl_name) || \ - ((type) != NULL && nexus_inlist((type), nexus_excl_type))) - -static int -nexus_probe(device_t dev) -{ - - /* Nexus does always match. */ - device_set_desc(dev, "Open Firmware Nexus device"); - return (0); -} - -static int -nexus_attach(device_t dev) -{ - struct nexus_devinfo *ndi; - struct nexus_softc *sc; - device_t cdev; - phandle_t node; - - sc = device_get_softc(dev); - - if (strcmp(device_get_name(device_get_parent(dev)), "root") == 0) { - node = OF_peer(0); - - sc->sc_intr_rman.rm_type = RMAN_ARRAY; - sc->sc_intr_rman.rm_descr = "Interrupts"; - sc->sc_mem_rman.rm_type = RMAN_ARRAY; - sc->sc_mem_rman.rm_descr = "Device Memory"; - if (rman_init(&sc->sc_intr_rman) != 0 || - rman_init(&sc->sc_mem_rman) != 0 || - rman_manage_region(&sc->sc_intr_rman, 0, ~0) != 0 || - rman_manage_region(&sc->sc_mem_rman, 0, BUS_SPACE_MAXADDR) - != 0) - panic("%s: failed to set up rmans.", __func__); - } else - node = ofw_bus_get_node(dev); - - /* - * Allow devices to identify. - */ - bus_generic_probe(dev); - - /* - * If no Open Firmware, bail early - */ - if (node == -1) - return (bus_generic_attach(dev)); - - /* - * Some important numbers - */ - sc->acells = 2; - OF_getencprop(node, "#address-cells", &sc->acells, sizeof(sc->acells)); - sc->scells = 1; - OF_getencprop(node, "#size-cells", &sc->scells, sizeof(sc->scells)); - - /* - * Now walk the OFW tree and attach top-level devices. - */ - for (node = OF_child(node); node > 0; node = OF_peer(node)) { - if ((ndi = nexus_setup_dinfo(dev, node)) == NULL) - continue; - cdev = device_add_child(dev, NULL, -1); - if (cdev == NULL) { - device_printf(dev, "<%s>: device_add_child failed\n", - ndi->ndi_obdinfo.obd_name); - nexus_destroy_dinfo(ndi); - continue; - } - device_set_ivars(cdev, ndi); - } - return (bus_generic_attach(dev)); -} - -static device_t -nexus_add_child(device_t dev, u_int order, const char *name, int unit) -{ - device_t cdev; - struct nexus_devinfo *ndi; - - cdev = device_add_child_ordered(dev, order, name, unit); - if (cdev == NULL) - return (NULL); - - ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); - ndi->ndi_obdinfo.obd_node = -1; - resource_list_init(&ndi->ndi_rl); - device_set_ivars(cdev, ndi); - - return (cdev); -} - -static int -nexus_print_child(device_t bus, device_t child) -{ - int rv; - - rv = bus_print_child_header(bus, child); - rv += nexus_print_res(device_get_ivars(child)); - rv += bus_print_child_footer(bus, child); - return (rv); -} - -static void -nexus_probe_nomatch(device_t bus, device_t child) -{ - const char *name, *type; - - if (!bootverbose) - return; - - name = ofw_bus_get_name(child); - type = ofw_bus_get_type(child); - - device_printf(bus, "<%s>", - name != NULL ? name : "unknown"); - nexus_print_res(device_get_ivars(child)); - printf(" type %s (no driver attached)\n", - type != NULL ? type : "unknown"); -} - static int nexus_setup_intr(device_t bus __unused, device_t child, struct resource *r, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, @@ -389,70 +171,6 @@ nexus_ofw_config_intr(device_t dev, devi INTR_POLARITY_LOW)); } -static struct resource * -nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) -{ - struct nexus_softc *sc; - struct rman *rm; - struct resource *rv; - struct resource_list_entry *rle; - device_t nexus; - int isdefault, passthrough; - - isdefault = (start == 0UL && end == ~0UL); - passthrough = (device_get_parent(child) != bus); - nexus = bus; - while (strcmp(device_get_name(device_get_parent(nexus)), "root") != 0) - nexus = device_get_parent(nexus); - sc = device_get_softc(nexus); - rle = NULL; - - if (!passthrough && isdefault) { - rle = resource_list_find(BUS_GET_RESOURCE_LIST(bus, child), - type, *rid); - if (rle == NULL) - return (NULL); - if (rle->res != NULL) - panic("%s: resource entry is busy", __func__); - start = rle->start; - count = ulmax(count, rle->count); - end = ulmax(rle->end, start + count - 1); - } - - switch (type) { - case SYS_RES_IRQ: - rm = &sc->sc_intr_rman; - break; - case SYS_RES_MEMORY: - rm = &sc->sc_mem_rman; - break; - default: - return (NULL); - } - - rv = rman_reserve_resource(rm, start, end, count, flags & ~RF_ACTIVE, - child); - if (rv == NULL) - return (NULL); - rman_set_rid(rv, *rid); - - if ((flags & RF_ACTIVE) != 0 && bus_activate_resource(child, type, - *rid, rv) != 0) { - rman_release_resource(rv); - return (NULL); - } - - if (!passthrough && rle != NULL) { - rle->res = rv; - rle->start = rman_get_start(rv); - rle->end = rman_get_end(rv); - rle->count = rle->end - rle->start + 1; - } - - return (rv); -} - static int nexus_activate_resource(device_t bus __unused, device_t child __unused, int type, int rid __unused, struct resource *r) @@ -495,161 +213,3 @@ nexus_deactivate_resource(device_t bus _ return (rman_deactivate_resource(r)); } -static int -nexus_adjust_resource(device_t bus, device_t child __unused, int type, - struct resource *r, u_long start, u_long end) -{ - struct nexus_softc *sc; - struct rman *rm; - device_t nexus; - - nexus = bus; - while (strcmp(device_get_name(device_get_parent(nexus)), "root") != 0) - nexus = device_get_parent(nexus); - sc = device_get_softc(nexus); - switch (type) { - case SYS_RES_IRQ: - rm = &sc->sc_intr_rman; - break; - case SYS_RES_MEMORY: - rm = &sc->sc_mem_rman; - break; - default: - return (EINVAL); - } - if (rm == NULL) - return (ENXIO); - if (rman_is_region_manager(r, rm) == 0) - return (EINVAL); - return (rman_adjust_resource(r, start, end)); -} - -static int -nexus_release_resource(device_t bus __unused, device_t child, int type, - int rid, struct resource *r) -{ - int error; - - if ((rman_get_flags(r) & RF_ACTIVE) != 0) { - error = bus_deactivate_resource(child, type, rid, r); - if (error) - return (error); - } - return (rman_release_resource(r)); -} - -static struct resource_list * -nexus_get_resource_list(device_t bus __unused, device_t child) -{ - struct nexus_devinfo *ndi; - - ndi = device_get_ivars(child); - return (&ndi->ndi_rl); -} - -static const struct ofw_bus_devinfo * -nexus_get_devinfo(device_t bus __unused, device_t child) -{ - struct nexus_devinfo *ndi; - - ndi = device_get_ivars(child); - return (&ndi->ndi_obdinfo); -} - -static struct nexus_devinfo * -nexus_setup_dinfo(device_t dev, phandle_t node) -{ - struct nexus_softc *sc; - struct nexus_devinfo *ndi; - uint32_t *reg, *intr, icells; - uint64_t phys, size; - phandle_t iparent; - int i, j; - int nintr; - int nreg; - - sc = device_get_softc(dev); - - ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); - if (ofw_bus_gen_setup_devinfo(&ndi->ndi_obdinfo, node) != 0) { - free(ndi, M_DEVBUF); - return (NULL); - } - if (NEXUS_EXCLUDED(ndi->ndi_obdinfo.obd_name, - ndi->ndi_obdinfo.obd_type)) { - ofw_bus_gen_destroy_devinfo(&ndi->ndi_obdinfo); - free(ndi, M_DEVBUF); - return (NULL); - } - - resource_list_init(&ndi->ndi_rl); - nreg = OF_getencprop_alloc(node, "reg", sizeof(*reg), (void **)®); - if (nreg == -1) - nreg = 0; - if (nreg % (sc->acells + sc->scells) != 0) { - if (bootverbose) - device_printf(dev, "Malformed reg property on <%s>\n", - ndi->ndi_obdinfo.obd_name); - nreg = 0; - } - - for (i = 0; i < nreg; i += sc->acells + sc->scells) { - phys = size = 0; - for (j = 0; j < sc->acells; j++) { - phys <<= 32; - phys |= reg[i + j]; - } - for (j = 0; j < sc->scells; j++) { - size <<= 32; - size |= reg[i + sc->acells + j]; - } - /* Skip the dummy reg property of glue devices like ssm(4). */ - if (size != 0) - resource_list_add(&ndi->ndi_rl, SYS_RES_MEMORY, i, - phys, phys + size - 1, size); - } - free(reg, M_OFWPROP); - - nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), - (void **)&intr); - if (nintr > 0) { - iparent = 0; - OF_searchprop(node, "interrupt-parent", &iparent, - sizeof(iparent)); - OF_searchprop(iparent, "#interrupt-cells", &icells, - sizeof(icells)); - for (i = 0; i < nintr; i+= icells) { - intr[i] = ofw_bus_map_intr(dev, iparent, intr[i]); - resource_list_add(&ndi->ndi_rl, SYS_RES_IRQ, i, intr[i], - intr[i], 1); - if (icells > 1) - ofw_bus_config_intr(dev, intr[i], intr[i+1]); - } - free(intr, M_OFWPROP); - } - - return (ndi); -} - -static void -nexus_destroy_dinfo(struct nexus_devinfo *ndi) -{ - - resource_list_free(&ndi->ndi_rl); - ofw_bus_gen_destroy_devinfo(&ndi->ndi_obdinfo); - free(ndi, M_DEVBUF); -} - -static int -nexus_print_res(struct nexus_devinfo *ndi) -{ - int rv; - - rv = 0; - rv += resource_list_print_type(&ndi->ndi_rl, "mem", SYS_RES_MEMORY, - "%#lx"); - rv += resource_list_print_type(&ndi->ndi_rl, "irq", SYS_RES_IRQ, - "%ld"); - return (rv); -} - From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 21:35:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6E8E7118; Wed, 23 Oct 2013 21:35:40 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5BA8522C6; Wed, 23 Oct 2013 21:35:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NLZeqd057461; Wed, 23 Oct 2013 21:35:40 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NLZe7b057460; Wed, 23 Oct 2013 21:35:40 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310232135.r9NLZe7b057460@svn.freebsd.org> From: Brooks Davis Date: Wed, 23 Oct 2013 21:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257017 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 21:35:40 -0000 Author: brooks Date: Wed Oct 23 21:35:39 2013 New Revision: 257017 URL: http://svnweb.freebsd.org/changeset/base/257017 Log: MFP4: Change 221534 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/27 16:05:30 FreeBSD/mips stores page-table entries in a near-identical format to MIPS TLB entries -- only it overrides certain "reserved" bits in the MIPS-defined EntryLo register to hold software-defined bits (swbits) to avoid significantly increasing the page table memory footprint. On n32 and n64, these bits were (a) colliding with MIPS64r2 physical memory extensions and (b) being improperly cleared. Attempt to fix both of these problems by pushing swbits further along 64-bit EntryLo registers into the reserved space, and improving consistency between C-based and assembly-based clearing of swbits -- in particular, to use the same definition. This should stop swbits from leaking into TLB entries -- while ignored by most current MIPS hardware, this would cause a problem with (much) larger physical memory sizes, and also leads to confusing hardware-level tracing as physical addresses contain unexpected (and inconsistent) higher bits. Discussed with: imp, jmallett Change 1187301 by brooks@brooks_zenith on 2013/10/23 14:40:10 Loop back the initial commit of 221534 to HEAD. Correct its implementation for mips32. MFC after: 3 days Sponsored by: DARPA/AFRL Modified: head/sys/mips/include/pte.h Modified: head/sys/mips/include/pte.h ============================================================================== --- head/sys/mips/include/pte.h Wed Oct 23 20:00:14 2013 (r257016) +++ head/sys/mips/include/pte.h Wed Oct 23 21:35:39 2013 (r257017) @@ -56,19 +56,30 @@ typedef pt_entry_t *pd_entry_t; #define TLBMASK_MASK ((PAGE_MASK >> TLBMASK_SHIFT) << TLBMASK_SHIFT) /* - * PFN for EntryLo register. Upper bits are 0, which is to say that - * bit 28 is the last hardware bit; Bits 29 and upwards (EntryLo is - * 64 bit though it can be referred to in 32-bits providing 3 software - * bits safely. We use it as 64 bits to get many software bits, and - * god knows what else.) are unacknowledged by hardware. They may be - * written as anything, but otherwise they have as much meaning as - * other 0 fields. + * FreeBSD/mips page-table entries take a near-identical format to MIPS TLB + * entries, each consisting of two 32-bit or 64-bit values ("EntryHi" and + * "EntryLo"). MIPS4k and MIPS64 both define certain bits in TLB entries as + * reserved, and these must be zero-filled by software. We overload these + * bits in PTE entries to hold PTE_ flags such as RO, W, and MANAGED. + * However, we must mask these out when writing to TLB entries to ensure that + * they do not become visible to hardware -- especially on MIPS64r2 which has + * an extended physical memory space. + * + * When using n64 and n32, shift software-defined bits into the MIPS64r2 + * reserved range, which runs from bit 55 ... 63. In other configurations + * (32-bit MIPS4k and compatible), shift them out to bits 29 ... 31. + * + * NOTE: This means that for 32-bit use of CP0, we aren't able to set the top + * bit of PFN to a non-zero value, as software is using it! This physical + * memory size limit may not be sufficiently enforced elsewhere. */ #if defined(__mips_n64) || defined(__mips_n32) /* PHYSADDR_64_BIT */ -#define TLBLO_SWBITS_SHIFT (34) +#define TLBLO_SWBITS_SHIFT (55) +#define TLBLO_SWBITS_CLEAR_SHIFT (9) #define TLBLO_PFN_MASK 0x3FFFFFFC0ULL #else #define TLBLO_SWBITS_SHIFT (29) +#define TLBLO_SWBITS_CLEAR_SHIFT (3) #define TLBLO_PFN_MASK (0x1FFFFFC0) #endif #define TLBLO_PFN_SHIFT (6) @@ -133,6 +144,9 @@ typedef pt_entry_t *pd_entry_t; * listen to requests to write to it. * W: Wired. ??? * MANAGED:Managed. This PTE maps a managed page. + * + * These bits should not be written into the TLB, so must first be masked out + * explicitly in C, or using CLEAR_PTE_SWBITS() in assembly. */ #define PTE_RO ((pt_entry_t)0x01 << TLBLO_SWBITS_SHIFT) #define PTE_W ((pt_entry_t)0x02 << TLBLO_SWBITS_SHIFT) @@ -162,7 +176,7 @@ typedef pt_entry_t *pd_entry_t; #define PTESIZE 4 #define PTE_L lw #define PTE_MTC0 mtc0 -#define CLEAR_PTE_SWBITS(r) sll r, 3; srl r, 3 /* remove 3 high bits */ +#define CLEAR_PTE_SWBITS(r) LONG_SLL r, TLBLO_SWBITS_CLEAR_SHIFT; LONG_SRL r, TLBLO_SWBITS_CLEAR_SHIFT /* remove swbits */ #endif /* defined(__mips_n64) || defined(__mips_n32) */ #if defined(__mips_n64) From owner-svn-src-all@FreeBSD.ORG Wed Oct 23 21:42:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4CD89550; Wed, 23 Oct 2013 21:42:54 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 202A72353; Wed, 23 Oct 2013 21:42:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NLgrme060388; Wed, 23 Oct 2013 21:42:53 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NLgrSB060386; Wed, 23 Oct 2013 21:42:53 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201310232142.r9NLgrSB060386@svn.freebsd.org> From: Neel Natu Date: Wed, 23 Oct 2013 21:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257018 - in head/usr.sbin: bhyve bhyveload X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 21:42:54 -0000 Author: neel Date: Wed Oct 23 21:42:53 2013 New Revision: 257018 URL: http://svnweb.freebsd.org/changeset/base/257018 Log: Tidy usage messages for bhyve and bhyveload. Submitted by: jhb Modified: head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyveload/bhyveload.c Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Wed Oct 23 21:35:39 2013 (r257017) +++ head/usr.sbin/bhyve/bhyverun.c Wed Oct 23 21:42:53 2013 (r257018) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -121,9 +122,8 @@ usage(int code) { fprintf(stderr, - "Usage: %s [-aehAHIPW][-g ][-s ][-S ]" - "[-c vcpus][-p pincpu][-m mem]" - " \n" + "Usage: %s [-aehAHIPW] [-g ] [-s ] [-S ]\n" + " %*s [-c vcpus] [-p pincpu] [-m mem] \n" " -a: local apic is in XAPIC mode (default is X2APIC)\n" " -A: create an ACPI table\n" " -g: gdb port\n" @@ -132,13 +132,13 @@ usage(int code) " -H: vmexit from the guest on hlt\n" " -I: present an ioapic to the guest\n" " -P: vmexit from the guest on pause\n" - " -W: force virtio to use single-vector MSI\n" - " -e: exit on unhandled i/o access\n" + " -W: force virtio to use single-vector MSI\n" + " -e: exit on unhandled I/O access\n" " -h: help\n" " -s: PCI slot config\n" " -S: legacy PCI slot config\n" " -m: memory size in MB\n", - progname); + progname, (int)strlen(progname), ""); exit(code); } Modified: head/usr.sbin/bhyveload/bhyveload.c ============================================================================== --- head/usr.sbin/bhyveload/bhyveload.c Wed Oct 23 21:35:39 2013 (r257017) +++ head/usr.sbin/bhyveload/bhyveload.c Wed Oct 23 21:42:53 2013 (r257018) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -568,8 +569,9 @@ usage(void) { fprintf(stderr, - "usage: %s [-m mem-size][-d ] [-h ] " - "[-e ] \n", progname); + "usage: %s [-m mem-size] [-d ] [-h ]\n" + " %*s [-e ] \n", progname, + (int)strlen(progname), ""); exit(1); } @@ -582,7 +584,7 @@ main(int argc, char** argv) int opt, error; char *disk_image; - progname = argv[0]; + progname = basename(argv[0]); mem_size = 256 * MB; disk_image = NULL; From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 00:33:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 63554EA8; Thu, 24 Oct 2013 00:33:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4F9C42BB5; Thu, 24 Oct 2013 00:33:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9O0XVQI019587; Thu, 24 Oct 2013 00:33:31 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9O0XUKG019579; Thu, 24 Oct 2013 00:33:30 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201310240033.r9O0XUKG019579@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 24 Oct 2013 00:33:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257029 - in head: sbin/fsck_ffs sbin/growfs sys/fs/ext2fs sys/ufs/ffs sys/ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 00:33:31 -0000 Author: pfg Date: Thu Oct 24 00:33:29 2013 New Revision: 257029 URL: http://svnweb.freebsd.org/changeset/base/257029 Log: UFS2: make di_extsize unsigned. di_extsize is the EA size and as such it should be unsigned. Adjust related types for consistency. Reviewed by: mckusick (previous version) MFC after: 3 weeks Modified: head/sbin/fsck_ffs/ea.c head/sbin/growfs/debug.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/ufs/ffs/ffs_vnops.c head/sys/ufs/ufs/dinode.h Modified: head/sbin/fsck_ffs/ea.c ============================================================================== --- head/sbin/fsck_ffs/ea.c Thu Oct 24 00:30:38 2013 (r257028) +++ head/sbin/fsck_ffs/ea.c Thu Oct 24 00:33:29 2013 (r257029) @@ -65,7 +65,7 @@ eascan(struct inodesc *idesc, struct ufs char dbuf[DIRBLKSIZ]; printf("Inode %ju extsize %ju\n", - (intmax_t)idesc->id_number, (intmax_t)dp->di_extsize); + (intmax_t)idesc->id_number, (uintmax_t)dp->di_extsize); if (dp->di_extsize == 0) return 0; if (dp->di_extsize <= sblock.fs_fsize) Modified: head/sbin/growfs/debug.c ============================================================================== --- head/sbin/growfs/debug.c Thu Oct 24 00:30:38 2013 (r257028) +++ head/sbin/growfs/debug.c Thu Oct 24 00:33:29 2013 (r257029) @@ -765,7 +765,7 @@ dbg_dump_ufs2_ino(struct fs *sb, const c fprintf(dbg_log, "gen int32_t 0x%08x\n", ino->di_gen); fprintf(dbg_log, "kernflags u_int32_t 0x%08x\n", ino->di_kernflags); fprintf(dbg_log, "flags u_int32_t 0x%08x\n", ino->di_flags); - fprintf(dbg_log, "extsize int32_t 0x%08x\n", ino->di_extsize); + fprintf(dbg_log, "extsize u_int32_t 0x%08x\n", ino->di_extsize); /* XXX: What do we do with di_extb[NXADDR]? */ Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Thu Oct 24 00:30:38 2013 (r257028) +++ head/sys/fs/ext2fs/ext2_vnops.c Thu Oct 24 00:33:29 2013 (r257029) @@ -1689,7 +1689,7 @@ ext2_ind_read(struct vop_read_args *ap) NOCRED, blkoffset + uio->uio_resid, seqcount, 0, &bp); } else if (seqcount > 1) { - int nextsize = blksize(fs, ip, nextlbn); + u_int nextsize = blksize(fs, ip, nextlbn); error = breadn(vp, lbn, size, &nextlbn, &nextsize, 1, NOCRED, &bp); } else Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Thu Oct 24 00:30:38 2013 (r257028) +++ head/sys/ufs/ffs/ffs_vnops.c Thu Oct 24 00:33:29 2013 (r257029) @@ -531,7 +531,7 @@ ffs_read(ap) * arguments point to arrays of the size specified in * the 6th argument. */ - int nextsize = blksize(fs, ip, nextlbn); + u_int nextsize = blksize(fs, ip, nextlbn); error = breadn_flags(vp, lbn, size, &nextlbn, &nextsize, 1, NOCRED, GB_UNMAPPED, &bp); } else { @@ -956,7 +956,7 @@ ffs_extread(struct vnode *vp, struct uio * arguments point to arrays of the size specified in * the 6th argument. */ - int nextsize = sblksize(fs, dp->di_extsize, nextlbn); + u_int nextsize = sblksize(fs, dp->di_extsize, nextlbn); nextlbn = -1 - nextlbn; error = breadn(vp, -1 - lbn, @@ -1218,7 +1218,8 @@ ffs_rdextattr(u_char **p, struct vnode * struct fs *fs; struct uio luio; struct iovec liovec; - int easize, error; + u_int easize; + int error; u_char *eae; ip = VTOI(vp); Modified: head/sys/ufs/ufs/dinode.h ============================================================================== --- head/sys/ufs/ufs/dinode.h Thu Oct 24 00:30:38 2013 (r257028) +++ head/sys/ufs/ufs/dinode.h Thu Oct 24 00:33:29 2013 (r257029) @@ -141,7 +141,7 @@ struct ufs2_dinode { u_int32_t di_gen; /* 80: Generation number. */ u_int32_t di_kernflags; /* 84: Kernel flags. */ u_int32_t di_flags; /* 88: Status flags (chflags). */ - int32_t di_extsize; /* 92: External attributes block. */ + u_int32_t di_extsize; /* 92: External attributes size. */ ufs2_daddr_t di_extb[NXADDR];/* 96: External attributes block. */ ufs2_daddr_t di_db[NDADDR]; /* 112: Direct disk blocks. */ ufs2_daddr_t di_ib[NIADDR]; /* 208: Indirect disk blocks. */ From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 01:02:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EC88FA25; Thu, 24 Oct 2013 01:02:54 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DA23D2DD8; Thu, 24 Oct 2013 01:02:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9O12sFo029540; Thu, 24 Oct 2013 01:02:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9O12sP7029539; Thu, 24 Oct 2013 01:02:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201310240102.r9O12sP7029539@svn.freebsd.org> From: Adrian Chadd Date: Thu, 24 Oct 2013 01:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257034 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 01:02:55 -0000 Author: adrian Date: Thu Oct 24 01:02:54 2013 New Revision: 257034 URL: http://svnweb.freebsd.org/changeset/base/257034 Log: Add #ifdef wrapper around definitions so they aren't included multiple times. Modified: head/sys/dev/iwn/if_iwnreg.h Modified: head/sys/dev/iwn/if_iwnreg.h ============================================================================== --- head/sys/dev/iwn/if_iwnreg.h Thu Oct 24 01:02:39 2013 (r257033) +++ head/sys/dev/iwn/if_iwnreg.h Thu Oct 24 01:02:54 2013 (r257034) @@ -17,6 +17,8 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#ifndef __IF_IWNREG_H__ +#define __IF_IWNREG_H__ #define IWN_CT_KILL_THRESHOLD 114 /* in Celsius */ #define IWN_CT_KILL_EXIT_THRESHOLD 95 /* in Celsius */ @@ -2052,3 +2054,5 @@ static const char * const iwn_fw_errmsg[ #define IWN_BARRIER_READ_WRITE(sc) \ bus_space_barrier((sc)->sc_st, (sc)->sc_sh, 0, (sc)->sc_sz, \ BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE) + +#endif /* __IF_IWNREG_H__ */ From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 01:03:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E2FB6B6F; Thu, 24 Oct 2013 01:03:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C132A2DDE; Thu, 24 Oct 2013 01:03:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9O13glL029732; Thu, 24 Oct 2013 01:03:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9O13ggV029730; Thu, 24 Oct 2013 01:03:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201310240103.r9O13ggV029730@svn.freebsd.org> From: Adrian Chadd Date: Thu, 24 Oct 2013 01:03:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257035 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 01:03:43 -0000 Author: adrian Date: Thu Oct 24 01:03:42 2013 New Revision: 257035 URL: http://svnweb.freebsd.org/changeset/base/257035 Log: Break out the debug code into a new include file in preparation for some more iwn work. Added: head/sys/dev/iwn/if_iwn_debug.h (contents, props changed) Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Thu Oct 24 01:02:54 2013 (r257034) +++ head/sys/dev/iwn/if_iwn.c Thu Oct 24 01:03:42 2013 (r257035) @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include struct iwn_ident { uint16_t vendor; @@ -331,80 +332,6 @@ static char *iwn_get_csr_string(int); static void iwn_debug_register(struct iwn_softc *); #endif -#ifdef IWN_DEBUG -enum { - IWN_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ - IWN_DEBUG_RECV = 0x00000002, /* basic recv operation */ - IWN_DEBUG_STATE = 0x00000004, /* 802.11 state transitions */ - IWN_DEBUG_TXPOW = 0x00000008, /* tx power processing */ - IWN_DEBUG_RESET = 0x00000010, /* reset processing */ - IWN_DEBUG_OPS = 0x00000020, /* iwn_ops processing */ - IWN_DEBUG_BEACON = 0x00000040, /* beacon handling */ - IWN_DEBUG_WATCHDOG = 0x00000080, /* watchdog timeout */ - IWN_DEBUG_INTR = 0x00000100, /* ISR */ - IWN_DEBUG_CALIBRATE = 0x00000200, /* periodic calibration */ - IWN_DEBUG_NODE = 0x00000400, /* node management */ - IWN_DEBUG_LED = 0x00000800, /* led management */ - IWN_DEBUG_CMD = 0x00001000, /* cmd submission */ - IWN_DEBUG_TXRATE = 0x00002000, /* TX rate debugging */ - IWN_DEBUG_PWRSAVE = 0x00004000, /* Power save operations */ - IWN_DEBUG_REGISTER = 0x20000000, /* print chipset register */ - IWN_DEBUG_TRACE = 0x40000000, /* Print begin and start driver function */ - IWN_DEBUG_FATAL = 0x80000000, /* fatal errors */ - IWN_DEBUG_ANY = 0xffffffff -}; - -#define DPRINTF(sc, m, fmt, ...) do { \ - if (sc->sc_debug & (m)) \ - printf(fmt, __VA_ARGS__); \ -} while (0) - -static const char * -iwn_intr_str(uint8_t cmd) -{ - switch (cmd) { - /* Notifications */ - case IWN_UC_READY: return "UC_READY"; - case IWN_ADD_NODE_DONE: return "ADD_NODE_DONE"; - case IWN_TX_DONE: return "TX_DONE"; - case IWN_START_SCAN: return "START_SCAN"; - case IWN_STOP_SCAN: return "STOP_SCAN"; - case IWN_RX_STATISTICS: return "RX_STATS"; - case IWN_BEACON_STATISTICS: return "BEACON_STATS"; - case IWN_STATE_CHANGED: return "STATE_CHANGED"; - case IWN_BEACON_MISSED: return "BEACON_MISSED"; - case IWN_RX_PHY: return "RX_PHY"; - case IWN_MPDU_RX_DONE: return "MPDU_RX_DONE"; - case IWN_RX_DONE: return "RX_DONE"; - - /* Command Notifications */ - case IWN_CMD_RXON: return "IWN_CMD_RXON"; - case IWN_CMD_RXON_ASSOC: return "IWN_CMD_RXON_ASSOC"; - case IWN_CMD_EDCA_PARAMS: return "IWN_CMD_EDCA_PARAMS"; - case IWN_CMD_TIMING: return "IWN_CMD_TIMING"; - case IWN_CMD_LINK_QUALITY: return "IWN_CMD_LINK_QUALITY"; - case IWN_CMD_SET_LED: return "IWN_CMD_SET_LED"; - case IWN5000_CMD_WIMAX_COEX: return "IWN5000_CMD_WIMAX_COEX"; - case IWN5000_CMD_CALIB_CONFIG: return "IWN5000_CMD_CALIB_CONFIG"; - case IWN5000_CMD_CALIB_RESULT: return "IWN5000_CMD_CALIB_RESULT"; - case IWN5000_CMD_CALIB_COMPLETE: return "IWN5000_CMD_CALIB_COMPLETE"; - case IWN_CMD_SET_POWER_MODE: return "IWN_CMD_SET_POWER_MODE"; - case IWN_CMD_SCAN: return "IWN_CMD_SCAN"; - case IWN_CMD_SCAN_RESULTS: return "IWN_CMD_SCAN_RESULTS"; - case IWN_CMD_TXPOWER: return "IWN_CMD_TXPOWER"; - case IWN_CMD_TXPOWER_DBM: return "IWN_CMD_TXPOWER_DBM"; - case IWN5000_CMD_TX_ANT_CONFIG: return "IWN5000_CMD_TX_ANT_CONFIG"; - case IWN_CMD_BT_COEX: return "IWN_CMD_BT_COEX"; - case IWN_CMD_SET_CRITICAL_TEMP: return "IWN_CMD_SET_CRITICAL_TEMP"; - case IWN_CMD_SET_SENSITIVITY: return "IWN_CMD_SET_SENSITIVITY"; - case IWN_CMD_PHY_CALIB: return "IWN_CMD_PHY_CALIB"; - } - return "UNKNOWN INTR NOTIF/CMD"; -} -#else -#define DPRINTF(sc, m, fmt, ...) do { (void) sc; } while (0) -#endif - static device_method_t iwn_methods[] = { /* Device interface */ DEVMETHOD(device_probe, iwn_probe), Added: head/sys/dev/iwn/if_iwn_debug.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iwn/if_iwn_debug.h Thu Oct 24 01:03:42 2013 (r257035) @@ -0,0 +1,102 @@ +/*- + * Copyright (c) 2013 Cedric GROSS + * Copyright (c) 2011 Intel Corporation + * Copyright (c) 2007-2009 + * Damien Bergamini + * Copyright (c) 2008 + * Benjamin Close + * Copyright (c) 2008 Sam Leffler, Errno Consulting + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ + +#ifndef __IF_IWN_DEBUG_H__ +#define __IF_IWN_DEBUG_H__ + +#ifdef IWN_DEBUG +enum { + IWN_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ + IWN_DEBUG_RECV = 0x00000002, /* basic recv operation */ + IWN_DEBUG_STATE = 0x00000004, /* 802.11 state transitions */ + IWN_DEBUG_TXPOW = 0x00000008, /* tx power processing */ + IWN_DEBUG_RESET = 0x00000010, /* reset processing */ + IWN_DEBUG_OPS = 0x00000020, /* iwn_ops processing */ + IWN_DEBUG_BEACON = 0x00000040, /* beacon handling */ + IWN_DEBUG_WATCHDOG = 0x00000080, /* watchdog timeout */ + IWN_DEBUG_INTR = 0x00000100, /* ISR */ + IWN_DEBUG_CALIBRATE = 0x00000200, /* periodic calibration */ + IWN_DEBUG_NODE = 0x00000400, /* node management */ + IWN_DEBUG_LED = 0x00000800, /* led management */ + IWN_DEBUG_CMD = 0x00001000, /* cmd submission */ + IWN_DEBUG_TXRATE = 0x00002000, /* TX rate debugging */ + IWN_DEBUG_PWRSAVE = 0x00004000, /* Power save operations */ + IWN_DEBUG_REGISTER = 0x20000000, /* print chipset register */ + IWN_DEBUG_TRACE = 0x40000000, /* Print begin and start driver function */ + IWN_DEBUG_FATAL = 0x80000000, /* fatal errors */ + IWN_DEBUG_ANY = 0xffffffff +}; + +#define DPRINTF(sc, m, fmt, ...) do { \ + if (sc->sc_debug & (m)) \ + printf(fmt, __VA_ARGS__); \ +} while (0) + +static const char * +iwn_intr_str(uint8_t cmd) +{ + switch (cmd) { + /* Notifications */ + case IWN_UC_READY: return "UC_READY"; + case IWN_ADD_NODE_DONE: return "ADD_NODE_DONE"; + case IWN_TX_DONE: return "TX_DONE"; + case IWN_START_SCAN: return "START_SCAN"; + case IWN_STOP_SCAN: return "STOP_SCAN"; + case IWN_RX_STATISTICS: return "RX_STATS"; + case IWN_BEACON_STATISTICS: return "BEACON_STATS"; + case IWN_STATE_CHANGED: return "STATE_CHANGED"; + case IWN_BEACON_MISSED: return "BEACON_MISSED"; + case IWN_RX_PHY: return "RX_PHY"; + case IWN_MPDU_RX_DONE: return "MPDU_RX_DONE"; + case IWN_RX_DONE: return "RX_DONE"; + + /* Command Notifications */ + case IWN_CMD_RXON: return "IWN_CMD_RXON"; + case IWN_CMD_RXON_ASSOC: return "IWN_CMD_RXON_ASSOC"; + case IWN_CMD_EDCA_PARAMS: return "IWN_CMD_EDCA_PARAMS"; + case IWN_CMD_TIMING: return "IWN_CMD_TIMING"; + case IWN_CMD_LINK_QUALITY: return "IWN_CMD_LINK_QUALITY"; + case IWN_CMD_SET_LED: return "IWN_CMD_SET_LED"; + case IWN5000_CMD_WIMAX_COEX: return "IWN5000_CMD_WIMAX_COEX"; + case IWN5000_CMD_CALIB_CONFIG: return "IWN5000_CMD_CALIB_CONFIG"; + case IWN5000_CMD_CALIB_RESULT: return "IWN5000_CMD_CALIB_RESULT"; + case IWN5000_CMD_CALIB_COMPLETE: return "IWN5000_CMD_CALIB_COMPLETE"; + case IWN_CMD_SET_POWER_MODE: return "IWN_CMD_SET_POWER_MODE"; + case IWN_CMD_SCAN: return "IWN_CMD_SCAN"; + case IWN_CMD_SCAN_RESULTS: return "IWN_CMD_SCAN_RESULTS"; + case IWN_CMD_TXPOWER: return "IWN_CMD_TXPOWER"; + case IWN_CMD_TXPOWER_DBM: return "IWN_CMD_TXPOWER_DBM"; + case IWN5000_CMD_TX_ANT_CONFIG: return "IWN5000_CMD_TX_ANT_CONFIG"; + case IWN_CMD_BT_COEX: return "IWN_CMD_BT_COEX"; + case IWN_CMD_SET_CRITICAL_TEMP: return "IWN_CMD_SET_CRITICAL_TEMP"; + case IWN_CMD_SET_SENSITIVITY: return "IWN_CMD_SET_SENSITIVITY"; + case IWN_CMD_PHY_CALIB: return "IWN_CMD_PHY_CALIB"; + } + return "UNKNOWN INTR NOTIF/CMD"; +} +#else +#define DPRINTF(sc, m, fmt, ...) do { (void) sc; } while (0) +#endif + +#endif /* __IF_IWN_DEBUG_H__ */ From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 01:06:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 16F1DCE3; Thu, 24 Oct 2013 01:06:45 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 048FF2DF3; Thu, 24 Oct 2013 01:06:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9O16iv4030280; Thu, 24 Oct 2013 01:06:44 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9O16iKG030279; Thu, 24 Oct 2013 01:06:44 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201310240106.r9O16iKG030279@svn.freebsd.org> From: Hiroki Sato Date: Thu, 24 Oct 2013 01:06:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257036 - head/sbin/mdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 01:06:45 -0000 Author: hrs Date: Thu Oct 24 01:06:44 2013 New Revision: 257036 URL: http://svnweb.freebsd.org/changeset/base/257036 Log: Return 0 if: 1. "-u N" specified, no -f, and mdN found, 2. no -u, "-f /pathname" specified, and mdN associated with /pathname found, 3. "-u N" specified, "-f /pathname" specified, and both of them found, 4. "-l" specified and no -f, 5. "-l" specified, "-f /pathname" specified, and /pathname found. otherwise return -1. Spotted by: Julian H. Stacey Modified: head/sbin/mdconfig/mdconfig.c Modified: head/sbin/mdconfig/mdconfig.c ============================================================================== --- head/sbin/mdconfig/mdconfig.c Thu Oct 24 01:03:42 2013 (r257035) +++ head/sbin/mdconfig/mdconfig.c Thu Oct 24 01:06:44 2013 (r257036) @@ -481,12 +481,18 @@ md_list(const char *units, int opt, cons printf("\n"); /* XXX: Check if it's enough to clean everything. */ geom_stats_snapshot_free(sq); - if (((opt & OPT_UNIT) && (fflag == NULL) && ufound) || - ((opt & OPT_UNIT) == 0 && (fflag != NULL) && ffound) || - ((opt & OPT_UNIT) && (fflag != NULL) && ufound && ffound)) - return (0); - else - return (-1); + if (opt & OPT_UNIT) { + if (((fflag == NULL) && ufound) || + ((fflag == NULL) && (units != NULL) && ufound) || + ((fflag != NULL) && ffound) || + ((fflag != NULL) && (units != NULL) && ufound && ffound)) + return (0); + } else if (opt & OPT_LIST) { + if ((fflag == NULL) || + ((fflag != NULL) && ffound)) + return (0); + } + return (-1); } /* From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 02:39:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7F527C5A; Thu, 24 Oct 2013 02:39:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6A773225B; Thu, 24 Oct 2013 02:39:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9O2d8Ef060969; Thu, 24 Oct 2013 02:39:08 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9O2d7JA060966; Thu, 24 Oct 2013 02:39:07 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310240239.r9O2d7JA060966@svn.freebsd.org> From: Mark Johnston Date: Thu, 24 Oct 2013 02:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257037 - in head/sys: kern modules/dtrace modules/dtrace/dtio modules/dtrace/dtraceall X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 02:39:08 -0000 Author: markj Date: Thu Oct 24 02:39:07 2013 New Revision: 257037 URL: http://svnweb.freebsd.org/changeset/base/257037 Log: Redefine the io provider using the SDT(9) macros instead of doing everything manually. This change has no functional impact. Discussed with: gnn Deleted: head/sys/kern/dtio_kdtrace.c head/sys/modules/dtrace/dtio/ Modified: head/sys/kern/subr_devstat.c head/sys/modules/dtrace/Makefile head/sys/modules/dtrace/dtraceall/dtraceall.c Modified: head/sys/kern/subr_devstat.c ============================================================================== --- head/sys/kern/subr_devstat.c Thu Oct 24 01:06:44 2013 (r257036) +++ head/sys/kern/subr_devstat.c Thu Oct 24 02:39:07 2013 (r257037) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -46,57 +47,21 @@ __FBSDID("$FreeBSD$"); #include -#ifdef KDTRACE_HOOKS -#include +SDT_PROVIDER_DEFINE(io); -dtrace_io_start_probe_func_t dtrace_io_start_probe; -dtrace_io_done_probe_func_t dtrace_io_done_probe; -dtrace_io_wait_start_probe_func_t dtrace_io_wait_start_probe; -dtrace_io_wait_done_probe_func_t dtrace_io_wait_done_probe; - -uint32_t dtio_start_id; -uint32_t dtio_done_id; -uint32_t dtio_wait_start_id; -uint32_t dtio_wait_done_id; - -#define DTRACE_DEVSTAT_START() \ - if (dtrace_io_start_probe != NULL) \ - (*dtrace_io_start_probe)(dtio_start_id, NULL, ds); - -#define DTRACE_DEVSTAT_BIO_START() \ - if (dtrace_io_start_probe != NULL) \ - (*dtrace_io_start_probe)(dtio_start_id, bp, ds); - -#define DTRACE_DEVSTAT_DONE() \ - if (dtrace_io_done_probe != NULL) \ - (*dtrace_io_done_probe)(dtio_done_id, NULL, ds); - -#define DTRACE_DEVSTAT_BIO_DONE() \ - if (dtrace_io_done_probe != NULL) \ - (*dtrace_io_done_probe)(dtio_done_id, bp, ds); - -#define DTRACE_DEVSTAT_WAIT_START() \ - if (dtrace_io_wait_start_probe != NULL) \ - (*dtrace_io_wait_start_probe)(dtio_wait_start_id, NULL, ds); - -#define DTRACE_DEVSTAT_WAIT_DONE() \ - if (dtrace_io_wait_done_probe != NULL) \ - (*dtrace_io_wait_done_probe)(dtio_wait_done_id, NULL, ds); - -#else /* ! KDTRACE_HOOKS */ - -#define DTRACE_DEVSTAT_START() - -#define DTRACE_DEVSTAT_BIO_START() - -#define DTRACE_DEVSTAT_DONE() - -#define DTRACE_DEVSTAT_BIO_DONE() - -#define DTRACE_DEVSTAT_WAIT_START() - -#define DTRACE_DEVSTAT_WAIT_DONE() -#endif /* KDTRACE_HOOKS */ +SDT_PROBE_DEFINE2(io, , , start, start, "struct bio *", "struct devstat *"); +SDT_PROBE_DEFINE2(io, , , done, done, "struct bio *", "struct devstat *"); +SDT_PROBE_DEFINE2(io, , , wait_start, wait-start, "struct bio *", + "struct devstat *"); +SDT_PROBE_DEFINE2(io, , , wait_done, wait-done, "struct bio *", + "struct devstat *"); + +#define DTRACE_DEVSTAT_START() SDT_PROBE2(io, , , start, NULL, ds) +#define DTRACE_DEVSTAT_BIO_START() SDT_PROBE2(io, , , start, bp, ds) +#define DTRACE_DEVSTAT_DONE() SDT_PROBE2(io, , , done, NULL, ds) +#define DTRACE_DEVSTAT_BIO_DONE() SDT_PROBE2(io, , , done, bp, ds) +#define DTRACE_DEVSTAT_WAIT_START() SDT_PROBE2(io, , , wait_start, NULL, ds) +#define DTRACE_DEVSTAT_WAIT_DONE() SDT_PROBE2(io, , , wait_done, NULL, ds) static int devstat_num_devs; static long devstat_generation = 1; Modified: head/sys/modules/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/Makefile Thu Oct 24 01:06:44 2013 (r257036) +++ head/sys/modules/dtrace/Makefile Thu Oct 24 02:39:07 2013 (r257037) @@ -9,7 +9,6 @@ SUBDIR= dtmalloc \ dtrace \ dtraceall \ dtrace_test \ - dtio \ lockstat \ profile \ prototype \ Modified: head/sys/modules/dtrace/dtraceall/dtraceall.c ============================================================================== --- head/sys/modules/dtrace/dtraceall/dtraceall.c Thu Oct 24 01:06:44 2013 (r257036) +++ head/sys/modules/dtrace/dtraceall/dtraceall.c Thu Oct 24 02:39:07 2013 (r257037) @@ -66,7 +66,6 @@ MODULE_VERSION(dtraceall, 1); MODULE_DEPEND(dtraceall, cyclic, 1, 1, 1); MODULE_DEPEND(dtraceall, opensolaris, 1, 1, 1); MODULE_DEPEND(dtraceall, dtrace, 1, 1, 1); -MODULE_DEPEND(dtraceall, dtio, 1, 1, 1); MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, 1); MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1); #if defined(NFSCLIENT) From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 03:36:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 677A4D1B; Thu, 24 Oct 2013 03:36:40 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 45F562579; Thu, 24 Oct 2013 03:36:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9O3aeSj082189; Thu, 24 Oct 2013 03:36:40 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9O3aeuW082188; Thu, 24 Oct 2013 03:36:40 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201310240336.r9O3aeuW082188@svn.freebsd.org> From: Colin Percival Date: Thu, 24 Oct 2013 03:36:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257038 - head/usr.sbin/freebsd-update X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 03:36:40 -0000 Author: cperciva Date: Thu Oct 24 03:36:39 2013 New Revision: 257038 URL: http://svnweb.freebsd.org/changeset/base/257038 Log: Be more selective when filtering for lib*.so.N files. These are deleted at the end of the upgrade process, after warning users to upgrade any 3rd party software (e.g., from the ports tree) which might link to the libraries being removed. Prior to this commit, the line /usr/lib/libc.so|...|/lib/libc.so.7 matched the regex, which -- upgrading from 9.x to 10.x, where libc.so is a regular file and thus was not part of a line which matched the regex -- resulted in freebsd-update thinking that /usr/lib/libc.so was a shared library which was being removed as part of the upgrade. This had some unfortunate consequences. This will be part of an upcoming Errata Notice. Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Thu Oct 24 02:39:07 2013 (r257037) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Thu Oct 24 03:36:39 2013 (r257038) @@ -2822,16 +2822,16 @@ Kernel updates have been installed. Ple # Install new shared libraries next grep -vE '^/boot/' $1/INDEX-NEW | grep -vE '^[^|]+\|d\|' | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 # Deal with everything else grep -vE '^/boot/' $1/INDEX-OLD | grep -vE '^[^|]+\|d\|' | - grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD + grep -vE '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-OLD grep -vE '^/boot/' $1/INDEX-NEW | grep -vE '^[^|]+\|d\|' | - grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 install_delete INDEX-OLD INDEX-NEW || return 1 @@ -2852,11 +2852,11 @@ Kernel updates have been installed. Ple # Do we need to ask the user to portupgrade now? grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' | cut -f 1 -d '|' | sort > newfiles if grep -vE '^/boot/' $1/INDEX-OLD | - grep -E '/lib/.*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' | cut -f 1 -d '|' | sort | join -v 1 - newfiles | @@ -2877,10 +2877,10 @@ again to finish installing updates. # Remove old shared libraries grep -vE '^/boot/' $1/INDEX-NEW | grep -vE '^[^|]+\|d\|' | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW grep -vE '^/boot/' $1/INDEX-OLD | grep -vE '^[^|]+\|d\|' | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-OLD install_delete INDEX-OLD INDEX-NEW || return 1 # Remove old directories From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 05:01:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BC90E402; Thu, 24 Oct 2013 05:01:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A90AD28F0; Thu, 24 Oct 2013 05:01:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9O51nPn011293; Thu, 24 Oct 2013 05:01:49 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9O51nu7011292; Thu, 24 Oct 2013 05:01:49 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310240501.r9O51nu7011292@svn.freebsd.org> From: Xin LI Date: Thu, 24 Oct 2013 05:01:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257039 - stable/10/lib/libc/iconv X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 05:01:49 -0000 Author: delphij Date: Thu Oct 24 05:01:49 2013 New Revision: 257039 URL: http://svnweb.freebsd.org/changeset/base/257039 Log: MFC r256833: Drop cm_lock before calling mapper_close, which in turn could call _citrus_mapper_close again and result in a deadlock otherwise. This is similar to NetBSD PR/24023 (fixed in their r1.5 of this file). PR: bin/182994 Submitted by: Fabian Keil Approved by: re (hrs) Modified: stable/10/lib/libc/iconv/citrus_mapper.c Directory Properties: stable/10/lib/libc/ (props changed) Modified: stable/10/lib/libc/iconv/citrus_mapper.c ============================================================================== --- stable/10/lib/libc/iconv/citrus_mapper.c Thu Oct 24 03:36:39 2013 (r257038) +++ stable/10/lib/libc/iconv/citrus_mapper.c Thu Oct 24 05:01:49 2013 (r257039) @@ -381,7 +381,9 @@ _citrus_mapper_close(struct _citrus_mapp _CITRUS_HASH_REMOVE(cm, cm_entry); free(cm->cm_key); } + UNLOCK(&cm_lock); mapper_close(cm); + return; quit: UNLOCK(&cm_lock); } From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 06:06:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 211FE1F9; Thu, 24 Oct 2013 06:06:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F2CBF2B9E; Thu, 24 Oct 2013 06:06:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9O66JJ5031929; Thu, 24 Oct 2013 06:06:19 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9O66HXB031913; Thu, 24 Oct 2013 06:06:17 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201310240606.r9O66HXB031913@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 24 Oct 2013 06:06:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r257040 - in stable/9/sys: dev/usb dev/usb/controller mips/cavium/usb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 06:06:20 -0000 Author: hselasky Date: Thu Oct 24 06:06:17 2013 New Revision: 257040 URL: http://svnweb.freebsd.org/changeset/base/257040 Log: MFC r241082: Inherit USB mode from RootHUB port where the USB device is connected. Only RootHUB ports can be dual mode. Disallow OTG ports on external HUBs. This simplifies some checks in the USB controller drivers. Modified: stable/9/sys/dev/usb/controller/at91dci.c stable/9/sys/dev/usb/controller/atmegadci.c stable/9/sys/dev/usb/controller/avr32dci.c stable/9/sys/dev/usb/controller/ehci.c stable/9/sys/dev/usb/controller/musb_otg.c stable/9/sys/dev/usb/controller/ohci.c stable/9/sys/dev/usb/controller/uhci.c stable/9/sys/dev/usb/controller/uss820dci.c stable/9/sys/dev/usb/controller/xhci.c stable/9/sys/dev/usb/usb_hub.c stable/9/sys/mips/cavium/usb/octusb.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/at91dci.c ============================================================================== --- stable/9/sys/dev/usb/controller/at91dci.c Thu Oct 24 05:01:49 2013 (r257039) +++ stable/9/sys/dev/usb/controller/at91dci.c Thu Oct 24 06:06:17 2013 (r257040) @@ -2277,10 +2277,6 @@ at91dci_ep_init(struct usb_device *udev, if (udev->device_index != sc->sc_rt_addr) { - if (udev->flags.usb_mode != USB_MODE_DEVICE) { - /* not supported */ - return; - } if (udev->speed != USB_SPEED_FULL) { /* not supported */ return; Modified: stable/9/sys/dev/usb/controller/atmegadci.c ============================================================================== --- stable/9/sys/dev/usb/controller/atmegadci.c Thu Oct 24 05:01:49 2013 (r257039) +++ stable/9/sys/dev/usb/controller/atmegadci.c Thu Oct 24 06:06:17 2013 (r257040) @@ -2110,10 +2110,6 @@ atmegadci_ep_init(struct usb_device *ude if (udev->device_index != sc->sc_rt_addr) { - if (udev->flags.usb_mode != USB_MODE_DEVICE) { - /* not supported */ - return; - } if (udev->speed != USB_SPEED_FULL) { /* not supported */ return; Modified: stable/9/sys/dev/usb/controller/avr32dci.c ============================================================================== --- stable/9/sys/dev/usb/controller/avr32dci.c Thu Oct 24 05:01:49 2013 (r257039) +++ stable/9/sys/dev/usb/controller/avr32dci.c Thu Oct 24 06:06:17 2013 (r257040) @@ -2054,10 +2054,6 @@ avr32dci_ep_init(struct usb_device *udev if (udev->device_index != sc->sc_rt_addr) { - if (udev->flags.usb_mode != USB_MODE_DEVICE) { - /* not supported */ - return; - } if ((udev->speed != USB_SPEED_FULL) && (udev->speed != USB_SPEED_HIGH)) { /* not supported */ Modified: stable/9/sys/dev/usb/controller/ehci.c ============================================================================== --- stable/9/sys/dev/usb/controller/ehci.c Thu Oct 24 05:01:49 2013 (r257039) +++ stable/9/sys/dev/usb/controller/ehci.c Thu Oct 24 06:06:17 2013 (r257040) @@ -3705,10 +3705,6 @@ ehci_ep_init(struct usb_device *udev, st edesc->bEndpointAddress, udev->flags.usb_mode, sc->sc_addr); - if (udev->flags.usb_mode != USB_MODE_HOST) { - /* not supported */ - return; - } if (udev->device_index != sc->sc_addr) { if ((udev->speed != USB_SPEED_HIGH) && Modified: stable/9/sys/dev/usb/controller/musb_otg.c ============================================================================== --- stable/9/sys/dev/usb/controller/musb_otg.c Thu Oct 24 05:01:49 2013 (r257039) +++ stable/9/sys/dev/usb/controller/musb_otg.c Thu Oct 24 06:06:17 2013 (r257040) @@ -2746,10 +2746,6 @@ musbotg_ep_init(struct usb_device *udev, if (udev->device_index != sc->sc_rt_addr) { - if (udev->flags.usb_mode != USB_MODE_DEVICE) { - /* not supported */ - return; - } if ((udev->speed != USB_SPEED_FULL) && (udev->speed != USB_SPEED_HIGH)) { /* not supported */ Modified: stable/9/sys/dev/usb/controller/ohci.c ============================================================================== --- stable/9/sys/dev/usb/controller/ohci.c Thu Oct 24 05:01:49 2013 (r257039) +++ stable/9/sys/dev/usb/controller/ohci.c Thu Oct 24 06:06:17 2013 (r257040) @@ -2314,6 +2314,7 @@ ohci_roothub_exec(struct usb_device *ude } v = OREAD4(sc, OHCI_RH_PORT_STATUS(index)); DPRINTFN(9, "port status=0x%04x\n", v); + v &= ~UPS_PORT_MODE_DEVICE; /* force host mode */ USETW(sc->sc_hub_desc.ps.wPortStatus, v); USETW(sc->sc_hub_desc.ps.wPortChange, v >> 16); len = sizeof(sc->sc_hub_desc.ps); @@ -2550,10 +2551,6 @@ ohci_ep_init(struct usb_device *udev, st edesc->bEndpointAddress, udev->flags.usb_mode, sc->sc_addr); - if (udev->flags.usb_mode != USB_MODE_HOST) { - /* not supported */ - return; - } if (udev->device_index != sc->sc_addr) { switch (edesc->bmAttributes & UE_XFERTYPE) { case UE_CONTROL: Modified: stable/9/sys/dev/usb/controller/uhci.c ============================================================================== --- stable/9/sys/dev/usb/controller/uhci.c Thu Oct 24 05:01:49 2013 (r257039) +++ stable/9/sys/dev/usb/controller/uhci.c Thu Oct 24 06:06:17 2013 (r257040) @@ -3029,10 +3029,6 @@ uhci_ep_init(struct usb_device *udev, st edesc->bEndpointAddress, udev->flags.usb_mode, sc->sc_addr); - if (udev->flags.usb_mode != USB_MODE_HOST) { - /* not supported */ - return; - } if (udev->device_index != sc->sc_addr) { switch (edesc->bmAttributes & UE_XFERTYPE) { case UE_CONTROL: Modified: stable/9/sys/dev/usb/controller/uss820dci.c ============================================================================== --- stable/9/sys/dev/usb/controller/uss820dci.c Thu Oct 24 05:01:49 2013 (r257039) +++ stable/9/sys/dev/usb/controller/uss820dci.c Thu Oct 24 06:06:17 2013 (r257040) @@ -2331,10 +2331,6 @@ uss820dci_ep_init(struct usb_device *ude if (udev->device_index != sc->sc_rt_addr) { - if (udev->flags.usb_mode != USB_MODE_DEVICE) { - /* not supported */ - return; - } if (udev->speed != USB_SPEED_FULL) { /* not supported */ return; Modified: stable/9/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.c Thu Oct 24 05:01:49 2013 (r257039) +++ stable/9/sys/dev/usb/controller/xhci.c Thu Oct 24 06:06:17 2013 (r257040) @@ -3742,10 +3742,6 @@ xhci_ep_init(struct usb_device *udev, st DPRINTFN(2, "endpoint=%p, addr=%d, endpt=%d, mode=%d\n", ep, udev->address, edesc->bEndpointAddress, udev->flags.usb_mode); - if (udev->flags.usb_mode != USB_MODE_HOST) { - /* not supported */ - return; - } if (udev->parent_hub == NULL) { /* root HUB has special endpoint handling */ return; Modified: stable/9/sys/dev/usb/usb_hub.c ============================================================================== --- stable/9/sys/dev/usb/usb_hub.c Thu Oct 24 05:01:49 2013 (r257039) +++ stable/9/sys/dev/usb/usb_hub.c Thu Oct 24 06:06:17 2013 (r257040) @@ -519,7 +519,10 @@ repeat: * * NOTE: This part is currently FreeBSD specific. */ - if (sc->sc_st.port_status & UPS_PORT_MODE_DEVICE) + if (udev->parent_hub != NULL) { + /* inherit mode from the parent HUB */ + mode = udev->parent_hub->flags.usb_mode; + } else if (sc->sc_st.port_status & UPS_PORT_MODE_DEVICE) mode = USB_MODE_DEVICE; else mode = USB_MODE_HOST; Modified: stable/9/sys/mips/cavium/usb/octusb.c ============================================================================== --- stable/9/sys/mips/cavium/usb/octusb.c Thu Oct 24 05:01:49 2013 (r257039) +++ stable/9/sys/mips/cavium/usb/octusb.c Thu Oct 24 06:06:17 2013 (r257040) @@ -1851,10 +1851,6 @@ octusb_ep_init(struct usb_device *udev, ep, udev->address, edesc->bEndpointAddress, udev->flags.usb_mode, sc->sc_addr); - if (udev->flags.usb_mode != USB_MODE_HOST) { - /* not supported */ - return; - } if (udev->device_index != sc->sc_addr) { switch (edesc->bmAttributes & UE_XFERTYPE) { case UE_CONTROL: From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 06:22:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EA1317B8; Thu, 24 Oct 2013 06:22:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C96962C94; Thu, 24 Oct 2013 06:22:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9O6MhZa038740; Thu, 24 Oct 2013 06:22:43 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9O6Mh7s038738; Thu, 24 Oct 2013 06:22:43 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201310240622.r9O6Mh7s038738@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 24 Oct 2013 06:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r257041 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 06:22:44 -0000 Author: hselasky Date: Thu Oct 24 06:22:43 2013 New Revision: 257041 URL: http://svnweb.freebsd.org/changeset/base/257041 Log: MFC r252912, r254828 and r256548: Add host mode support to the Mentor Graphics USB OTG controller driver. PR: usb/181987 Modified: stable/9/sys/dev/usb/controller/musb_otg.c stable/9/sys/dev/usb/controller/musb_otg.h stable/9/sys/dev/usb/controller/musb_otg_atmelarm.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/musb_otg.c ============================================================================== --- stable/9/sys/dev/usb/controller/musb_otg.c Thu Oct 24 06:06:17 2013 (r257040) +++ stable/9/sys/dev/usb/controller/musb_otg.c Thu Oct 24 06:22:43 2013 (r257041) @@ -90,6 +90,8 @@ SYSCTL_INT(_hw_usb_musbotg, OID_AUTO, de &musbotgdebug, 0, "Debug level"); #endif +#define MAX_NAK_TO 16 + /* prototypes */ struct usb_bus_methods musbotg_bus_methods; @@ -98,17 +100,35 @@ struct usb_pipe_methods musbotg_device_c struct usb_pipe_methods musbotg_device_intr_methods; struct usb_pipe_methods musbotg_device_isoc_methods; -static musbotg_cmd_t musbotg_setup_rx; -static musbotg_cmd_t musbotg_setup_data_rx; -static musbotg_cmd_t musbotg_setup_data_tx; -static musbotg_cmd_t musbotg_setup_status; -static musbotg_cmd_t musbotg_data_rx; -static musbotg_cmd_t musbotg_data_tx; +/* Control transfers: Device mode */ +static musbotg_cmd_t musbotg_dev_ctrl_setup_rx; +static musbotg_cmd_t musbotg_dev_ctrl_data_rx; +static musbotg_cmd_t musbotg_dev_ctrl_data_tx; +static musbotg_cmd_t musbotg_dev_ctrl_status; + +/* Control transfers: Host mode */ +static musbotg_cmd_t musbotg_host_ctrl_setup_tx; +static musbotg_cmd_t musbotg_host_ctrl_data_rx; +static musbotg_cmd_t musbotg_host_ctrl_data_tx; +static musbotg_cmd_t musbotg_host_ctrl_status_rx; +static musbotg_cmd_t musbotg_host_ctrl_status_tx; + +/* Bulk, Interrupt, Isochronous: Device mode */ +static musbotg_cmd_t musbotg_dev_data_rx; +static musbotg_cmd_t musbotg_dev_data_tx; + +/* Bulk, Interrupt, Isochronous: Host mode */ +static musbotg_cmd_t musbotg_host_data_rx; +static musbotg_cmd_t musbotg_host_data_tx; + static void musbotg_device_done(struct usb_xfer *, usb_error_t); static void musbotg_do_poll(struct usb_bus *); static void musbotg_standard_done(struct usb_xfer *); static void musbotg_interrupt_poll(struct musbotg_softc *); static void musbotg_root_intr(struct musbotg_softc *); +static int musbotg_channel_alloc(struct musbotg_softc *, struct musbotg_td *td); +static void musbotg_channel_free(struct musbotg_softc *, struct musbotg_td *td); +static void musbotg_ep_int_set(struct musbotg_softc *sc, int channel, int on); /* * Here is a configuration that the chip supports. @@ -123,6 +143,64 @@ static const struct usb_hw_ep_profile mu } }; +static int +musbotg_channel_alloc(struct musbotg_softc *sc, struct musbotg_td *td) +{ + int ch; + int ep; + + ep = td->ep_no; + + /* In device mode each EP got its own channel */ + if (sc->sc_mode == MUSB2_DEVICE_MODE) { + musbotg_ep_int_set(sc, ep, 1); + return (ep); + } + + /* + * All control transactions go through EP0 + */ + if (ep == 0) { + if (sc->sc_channel_mask & (1 << 0)) + return (-1); + sc->sc_channel_mask |= (1 << 0); + musbotg_ep_int_set(sc, ep, 1); + return (0); + } + + for (ch = 1; ch < MUSB2_EP_MAX; ch++) { + if (!(sc->sc_channel_mask & (1 << ch))) { + sc->sc_channel_mask |= (1 << ch); + musbotg_ep_int_set(sc, ch, 1); + return (ch); + } + } + + DPRINTFN(-1, "No available channels. Mask: %04x\n", sc->sc_channel_mask); + + return (-1); +} + +static void +musbotg_channel_free(struct musbotg_softc *sc, struct musbotg_td *td) +{ + + DPRINTFN(1, "ep_no=%d\n", td->channel); + + if (sc->sc_mode == MUSB2_DEVICE_MODE) + return; + + if (td == NULL) + return; + if (td->channel == -1) + return; + + musbotg_ep_int_set(sc, td->channel, 0); + sc->sc_channel_mask &= ~(1 << td->channel); + + td->channel = -1; +} + static void musbotg_get_hw_ep_profile(struct usb_device *udev, const struct usb_hw_ep_profile **ppf, uint8_t ep_addr) @@ -213,6 +291,46 @@ musbotg_pull_down(struct musbotg_softc * } static void +musbotg_suspend_host(struct musbotg_softc *sc) +{ + uint8_t temp; + + if (sc->sc_flags.status_suspend) { + return; + } + + temp = MUSB2_READ_1(sc, MUSB2_REG_POWER); + temp |= MUSB2_MASK_SUSPMODE; + MUSB2_WRITE_1(sc, MUSB2_REG_POWER, temp); + sc->sc_flags.status_suspend = 1; +} + +static void +musbotg_wakeup_host(struct musbotg_softc *sc) +{ + uint8_t temp; + + if (!(sc->sc_flags.status_suspend)) { + return; + } + + temp = MUSB2_READ_1(sc, MUSB2_REG_POWER); + temp &= ~MUSB2_MASK_SUSPMODE; + temp |= MUSB2_MASK_RESUME; + MUSB2_WRITE_1(sc, MUSB2_REG_POWER, temp); + + /* wait 20 milliseconds */ + /* Wait for reset to complete. */ + usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 50); + + temp = MUSB2_READ_1(sc, MUSB2_REG_POWER); + temp &= ~MUSB2_MASK_RESUME; + MUSB2_WRITE_1(sc, MUSB2_REG_POWER, temp); + + sc->sc_flags.status_suspend = 0; +} + +static void musbotg_wakeup_peer(struct musbotg_softc *sc) { uint8_t temp; @@ -243,7 +361,7 @@ musbotg_set_address(struct musbotg_softc } static uint8_t -musbotg_setup_rx(struct musbotg_td *td) +musbotg_dev_ctrl_setup_rx(struct musbotg_td *td) { struct musbotg_softc *sc; struct usb_device_request req; @@ -253,6 +371,15 @@ musbotg_setup_rx(struct musbotg_td *td) /* get pointer to softc */ sc = MUSBOTG_PC2SC(td->pc); + if (td->channel == -1) + td->channel = musbotg_channel_alloc(sc, td); + + /* EP0 is busy, wait */ + if (td->channel == -1) + return (1); + + DPRINTFN(1, "ep_no=%d\n", td->channel); + /* select endpoint 0 */ MUSB2_WRITE_1(sc, MUSB2_REG_EPINDEX, 0); @@ -269,8 +396,10 @@ musbotg_setup_rx(struct musbotg_td *td) /* do not stall at this point */ td->did_stall = 1; /* wait for interrupt */ + DPRINTFN(0, "CSR0 DATAEND\n"); goto not_complete; } + if (csr & MUSB2_MASK_CSR0L_SENTSTALL) { /* clear SENTSTALL */ MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, 0); @@ -289,6 +418,7 @@ musbotg_setup_rx(struct musbotg_td *td) sc->sc_ep0_busy = 0; } if (sc->sc_ep0_busy) { + DPRINTFN(0, "EP0 BUSY\n"); goto not_complete; } if (!(csr & MUSB2_MASK_CSR0L_RXPKTRDY)) { @@ -337,6 +467,8 @@ musbotg_setup_rx(struct musbotg_td *td) } else { sc->sc_dv_addr = 0xFF; } + + musbotg_channel_free(sc, td); return (0); /* complete */ not_complete: @@ -350,10 +482,117 @@ not_complete: return (1); /* not complete */ } +static uint8_t +musbotg_host_ctrl_setup_tx(struct musbotg_td *td) +{ + struct musbotg_softc *sc; + struct usb_device_request req; + uint8_t csr, csrh; + + /* get pointer to softc */ + sc = MUSBOTG_PC2SC(td->pc); + + if (td->channel == -1) + td->channel = musbotg_channel_alloc(sc, td); + + /* EP0 is busy, wait */ + if (td->channel == -1) + return (1); + + DPRINTFN(1, "ep_no=%d\n", td->channel); + + /* select endpoint 0 */ + MUSB2_WRITE_1(sc, MUSB2_REG_EPINDEX, 0); + + /* read out FIFO status */ + csr = MUSB2_READ_1(sc, MUSB2_REG_TXCSRL); + DPRINTFN(4, "csr=0x%02x\n", csr); + + /* Not ready yet yet */ + if (csr & MUSB2_MASK_CSR0L_TXPKTRDY) + return (1); + + /* Failed */ + if (csr & (MUSB2_MASK_CSR0L_RXSTALL | + MUSB2_MASK_CSR0L_ERROR)) + { + /* Clear status bit */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, 0); + DPRINTFN(1, "error bit set, csr=0x%02x\n", csr); + td->error = 1; + } + + if (csr & MUSB2_MASK_CSR0L_NAKTIMO) { + DPRINTFN(1, "NAK timeout\n"); + + if (csr & MUSB2_MASK_CSR0L_TXFIFONEMPTY) { + csrh = MUSB2_READ_1(sc, MUSB2_REG_TXCSRH); + csrh |= MUSB2_MASK_CSR0H_FFLUSH; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRH, csrh); + csr = MUSB2_READ_1(sc, MUSB2_REG_TXCSRL); + if (csr & MUSB2_MASK_CSR0L_TXFIFONEMPTY) { + csrh = MUSB2_READ_1(sc, MUSB2_REG_TXCSRH); + csrh |= MUSB2_MASK_CSR0H_FFLUSH; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRH, csrh); + csr = MUSB2_READ_1(sc, MUSB2_REG_TXCSRL); + } + } + + csr &= ~MUSB2_MASK_CSR0L_NAKTIMO; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, csr); + + td->error = 1; + } + + if (td->error) { + musbotg_channel_free(sc, td); + return (0); + } + + /* Fifo is not empty and there is no NAK timeout */ + if (csr & MUSB2_MASK_CSR0L_TXPKTRDY) + return (1); + + /* check if we are complete */ + if (td->remainder == 0) { + /* we are complete */ + musbotg_channel_free(sc, td); + return (0); + } + + /* copy data into real buffer */ + usbd_copy_out(td->pc, 0, &req, sizeof(req)); + + /* send data */ + bus_space_write_multi_1(sc->sc_io_tag, sc->sc_io_hdl, + MUSB2_REG_EPFIFO(0), (void *)&req, sizeof(req)); + + /* update offset and remainder */ + td->offset += sizeof(req); + td->remainder -= sizeof(req); + + + MUSB2_WRITE_1(sc, MUSB2_REG_TXNAKLIMIT, MAX_NAK_TO); + MUSB2_WRITE_1(sc, MUSB2_REG_TXFADDR(0), td->dev_addr); + MUSB2_WRITE_1(sc, MUSB2_REG_TXHADDR(0), td->haddr); + MUSB2_WRITE_1(sc, MUSB2_REG_TXHUBPORT(0), td->hport); + MUSB2_WRITE_1(sc, MUSB2_REG_TXTI, td->transfer_type); + + /* write command */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, + MUSB2_MASK_CSR0L_TXPKTRDY | + MUSB2_MASK_CSR0L_SETUPPKT); + + /* Just to be consistent, not used above */ + td->transaction_started = 1; + + return (1); /* in progress */ +} + /* Control endpoint only data handling functions (RX/TX/SYNC) */ static uint8_t -musbotg_setup_data_rx(struct musbotg_td *td) +musbotg_dev_ctrl_data_rx(struct musbotg_td *td) { struct usb_page_search buf_res; struct musbotg_softc *sc; @@ -496,7 +735,7 @@ musbotg_setup_data_rx(struct musbotg_td } static uint8_t -musbotg_setup_data_tx(struct musbotg_td *td) +musbotg_dev_ctrl_data_tx(struct musbotg_td *td) { struct usb_page_search buf_res; struct musbotg_softc *sc; @@ -614,77 +853,943 @@ musbotg_setup_data_tx(struct musbotg_td } static uint8_t -musbotg_setup_status(struct musbotg_td *td) +musbotg_host_ctrl_data_rx(struct musbotg_td *td) { + struct usb_page_search buf_res; struct musbotg_softc *sc; + uint16_t count; uint8_t csr; + uint8_t got_short; /* get pointer to softc */ sc = MUSBOTG_PC2SC(td->pc); + if (td->channel == -1) + td->channel = musbotg_channel_alloc(sc, td); + + /* EP0 is busy, wait */ + if (td->channel == -1) + return (1); + + DPRINTFN(1, "ep_no=%d\n", td->channel); + /* select endpoint 0 */ MUSB2_WRITE_1(sc, MUSB2_REG_EPINDEX, 0); - if (sc->sc_ep0_busy) { - sc->sc_ep0_busy = 0; - sc->sc_ep0_cmd |= MUSB2_MASK_CSR0L_DATAEND; - MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, sc->sc_ep0_cmd); - sc->sc_ep0_cmd = 0; - } /* read out FIFO status */ csr = MUSB2_READ_1(sc, MUSB2_REG_TXCSRL); DPRINTFN(4, "csr=0x%02x\n", csr); - if (csr & MUSB2_MASK_CSR0L_DATAEND) { - /* wait for interrupt */ - return (1); /* not complete */ + got_short = 0; + if (!td->transaction_started) { + td->transaction_started = 1; + + MUSB2_WRITE_1(sc, MUSB2_REG_RXNAKLIMIT, MAX_NAK_TO); + + MUSB2_WRITE_1(sc, MUSB2_REG_RXFADDR(0), + td->dev_addr); + MUSB2_WRITE_1(sc, MUSB2_REG_RXHADDR(0), td->haddr); + MUSB2_WRITE_1(sc, MUSB2_REG_RXHUBPORT(0), td->hport); + MUSB2_WRITE_1(sc, MUSB2_REG_RXTI, td->transfer_type); + + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, + MUSB2_MASK_CSR0L_REQPKT); + + return (1); + } + + if (csr & MUSB2_MASK_CSR0L_NAKTIMO) { + csr &= ~MUSB2_MASK_CSR0L_REQPKT; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, csr); + + csr &= ~MUSB2_MASK_CSR0L_NAKTIMO; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, csr); + + td->error = 1; + } + + /* Failed */ + if (csr & (MUSB2_MASK_CSR0L_RXSTALL | + MUSB2_MASK_CSR0L_ERROR)) + { + /* Clear status bit */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, 0); + DPRINTFN(1, "error bit set, csr=0x%02x\n", csr); + td->error = 1; + } + + if (td->error) { + musbotg_channel_free(sc, td); + return (0); /* we are complete */ + } + + if (!(csr & MUSB2_MASK_CSR0L_RXPKTRDY)) + return (1); /* not yet */ + + /* get the packet byte count */ + count = MUSB2_READ_2(sc, MUSB2_REG_RXCOUNT); + + /* verify the packet byte count */ + if (count != td->max_frame_size) { + if (count < td->max_frame_size) { + /* we have a short packet */ + td->short_pkt = 1; + got_short = 1; + } else { + /* invalid USB packet */ + td->error = 1; + musbotg_channel_free(sc, td); + return (0); /* we are complete */ + } + } + /* verify the packet byte count */ + if (count > td->remainder) { + /* invalid USB packet */ + td->error = 1; + musbotg_channel_free(sc, td); + return (0); /* we are complete */ + } + while (count > 0) { + uint32_t temp; + + usbd_get_page(td->pc, td->offset, &buf_res); + + /* get correct length */ + if (buf_res.length > count) { + buf_res.length = count; + } + /* check for unaligned memory address */ + if (USB_P2U(buf_res.buffer) & 3) { + + temp = count & ~3; + + if (temp) { + /* receive data 4 bytes at a time */ + bus_space_read_multi_4(sc->sc_io_tag, sc->sc_io_hdl, + MUSB2_REG_EPFIFO(0), sc->sc_bounce_buf, + temp / 4); + } + temp = count & 3; + if (temp) { + /* receive data 1 byte at a time */ + bus_space_read_multi_1(sc->sc_io_tag, sc->sc_io_hdl, + MUSB2_REG_EPFIFO(0), + (void *)(&sc->sc_bounce_buf[count / 4]), temp); + } + usbd_copy_in(td->pc, td->offset, + sc->sc_bounce_buf, count); + + /* update offset and remainder */ + td->offset += count; + td->remainder -= count; + break; + } + /* check if we can optimise */ + if (buf_res.length >= 4) { + + /* receive data 4 bytes at a time */ + bus_space_read_multi_4(sc->sc_io_tag, sc->sc_io_hdl, + MUSB2_REG_EPFIFO(0), buf_res.buffer, + buf_res.length / 4); + + temp = buf_res.length & ~3; + + /* update counters */ + count -= temp; + td->offset += temp; + td->remainder -= temp; + continue; + } + /* receive data */ + bus_space_read_multi_1(sc->sc_io_tag, sc->sc_io_hdl, + MUSB2_REG_EPFIFO(0), buf_res.buffer, buf_res.length); + + /* update counters */ + count -= buf_res.length; + td->offset += buf_res.length; + td->remainder -= buf_res.length; + } + + csr &= ~MUSB2_MASK_CSR0L_RXPKTRDY; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, csr); + + /* check if we are complete */ + if ((td->remainder == 0) || got_short) { + if (td->short_pkt) { + /* we are complete */ + + musbotg_channel_free(sc, td); + return (0); + } + /* else need to receive a zero length packet */ + } + + td->transaction_started = 1; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, + MUSB2_MASK_CSR0L_REQPKT); + + return (1); /* not complete */ +} + +static uint8_t +musbotg_host_ctrl_data_tx(struct musbotg_td *td) +{ + struct usb_page_search buf_res; + struct musbotg_softc *sc; + uint16_t count; + uint8_t csr, csrh; + + /* get pointer to softc */ + sc = MUSBOTG_PC2SC(td->pc); + + if (td->channel == -1) + td->channel = musbotg_channel_alloc(sc, td); + + /* No free EPs */ + if (td->channel == -1) + return (1); + + DPRINTFN(1, "ep_no=%d\n", td->channel); + + /* select endpoint */ + MUSB2_WRITE_1(sc, MUSB2_REG_EPINDEX, 0); + + /* read out FIFO status */ + csr = MUSB2_READ_1(sc, MUSB2_REG_TXCSRL); + DPRINTFN(4, "csr=0x%02x\n", csr); + + if (csr & (MUSB2_MASK_CSR0L_RXSTALL | + MUSB2_MASK_CSR0L_ERROR)) { + /* clear status bits */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, 0); + td->error = 1; + } + + if (csr & MUSB2_MASK_CSR0L_NAKTIMO ) { + + if (csr & MUSB2_MASK_CSR0L_TXFIFONEMPTY) { + csrh = MUSB2_READ_1(sc, MUSB2_REG_TXCSRH); + csrh |= MUSB2_MASK_CSR0H_FFLUSH; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRH, csrh); + csr = MUSB2_READ_1(sc, MUSB2_REG_TXCSRL); + if (csr & MUSB2_MASK_CSR0L_TXFIFONEMPTY) { + csrh = MUSB2_READ_1(sc, MUSB2_REG_TXCSRH); + csrh |= MUSB2_MASK_CSR0H_FFLUSH; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRH, csrh); + csr = MUSB2_READ_1(sc, MUSB2_REG_TXCSRL); + } + } + + csr &= ~MUSB2_MASK_CSR0L_NAKTIMO; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, csr); + + td->error = 1; + } + + + if (td->error) { + musbotg_channel_free(sc, td); + return (0); /* complete */ + } + + /* + * Wait while FIFO is empty. + * Do not flush it because it will cause transactions + * with size more then packet size. It might upset + * some devices + */ + if (csr & MUSB2_MASK_CSR0L_TXFIFONEMPTY) + return (1); + + /* Packet still being processed */ + if (csr & MUSB2_MASK_CSR0L_TXPKTRDY) + return (1); + + if (td->transaction_started) { + /* check remainder */ + if (td->remainder == 0) { + if (td->short_pkt) { + musbotg_channel_free(sc, td); + return (0); /* complete */ + } + /* else we need to transmit a short packet */ + } + + /* We're not complete - more transactions required */ + td->transaction_started = 0; + } + + /* check for short packet */ + count = td->max_frame_size; + if (td->remainder < count) { + /* we have a short packet */ + td->short_pkt = 1; + count = td->remainder; + } + + while (count > 0) { + uint32_t temp; + + usbd_get_page(td->pc, td->offset, &buf_res); + + /* get correct length */ + if (buf_res.length > count) { + buf_res.length = count; + } + /* check for unaligned memory address */ + if (USB_P2U(buf_res.buffer) & 3) { + + usbd_copy_out(td->pc, td->offset, + sc->sc_bounce_buf, count); + + temp = count & ~3; + + if (temp) { + /* transmit data 4 bytes at a time */ + bus_space_write_multi_4(sc->sc_io_tag, + sc->sc_io_hdl, MUSB2_REG_EPFIFO(0), + sc->sc_bounce_buf, temp / 4); + } + temp = count & 3; + if (temp) { + /* receive data 1 byte at a time */ + bus_space_write_multi_1(sc->sc_io_tag, sc->sc_io_hdl, + MUSB2_REG_EPFIFO(0), + ((void *)&sc->sc_bounce_buf[count / 4]), temp); + } + /* update offset and remainder */ + td->offset += count; + td->remainder -= count; + break; + } + /* check if we can optimise */ + if (buf_res.length >= 4) { + + /* transmit data 4 bytes at a time */ + bus_space_write_multi_4(sc->sc_io_tag, sc->sc_io_hdl, + MUSB2_REG_EPFIFO(0), buf_res.buffer, + buf_res.length / 4); + + temp = buf_res.length & ~3; + + /* update counters */ + count -= temp; + td->offset += temp; + td->remainder -= temp; + continue; + } + /* transmit data */ + bus_space_write_multi_1(sc->sc_io_tag, sc->sc_io_hdl, + MUSB2_REG_EPFIFO(0), buf_res.buffer, + buf_res.length); + + /* update counters */ + count -= buf_res.length; + td->offset += buf_res.length; + td->remainder -= buf_res.length; + } + + /* Function address */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXFADDR(0), td->dev_addr); + MUSB2_WRITE_1(sc, MUSB2_REG_TXHADDR(0), td->haddr); + MUSB2_WRITE_1(sc, MUSB2_REG_TXHUBPORT(0), td->hport); + MUSB2_WRITE_1(sc, MUSB2_REG_TXTI, td->transfer_type); + + /* TX NAK timeout */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXNAKLIMIT, MAX_NAK_TO); + + /* write command */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, + MUSB2_MASK_CSR0L_TXPKTRDY); + + td->transaction_started = 1; + + return (1); /* not complete */ +} + +static uint8_t +musbotg_dev_ctrl_status(struct musbotg_td *td) +{ + struct musbotg_softc *sc; + uint8_t csr; + + /* get pointer to softc */ + sc = MUSBOTG_PC2SC(td->pc); + + /* select endpoint 0 */ + MUSB2_WRITE_1(sc, MUSB2_REG_EPINDEX, 0); + + if (sc->sc_ep0_busy) { + sc->sc_ep0_busy = 0; + sc->sc_ep0_cmd |= MUSB2_MASK_CSR0L_DATAEND; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, sc->sc_ep0_cmd); + sc->sc_ep0_cmd = 0; + } + /* read out FIFO status */ + csr = MUSB2_READ_1(sc, MUSB2_REG_TXCSRL); + + DPRINTFN(4, "csr=0x%02x\n", csr); + + if (csr & MUSB2_MASK_CSR0L_DATAEND) { + /* wait for interrupt */ + return (1); /* not complete */ + } + if (sc->sc_dv_addr != 0xFF) { + /* write function address */ + musbotg_set_address(sc, sc->sc_dv_addr); + } + + musbotg_channel_free(sc, td); + return (0); /* complete */ +} + +static uint8_t +musbotg_host_ctrl_status_rx(struct musbotg_td *td) +{ + struct musbotg_softc *sc; + uint8_t csr, csrh; + + /* get pointer to softc */ + sc = MUSBOTG_PC2SC(td->pc); + + if (td->channel == -1) + td->channel = musbotg_channel_alloc(sc, td); + + /* EP0 is busy, wait */ + if (td->channel == -1) + return (1); + + DPRINTFN(1, "ep_no=%d\n", td->channel); + + /* select endpoint 0 */ + MUSB2_WRITE_1(sc, MUSB2_REG_EPINDEX, 0); + + if (!td->transaction_started) { + MUSB2_WRITE_1(sc, MUSB2_REG_RXFADDR(0), + td->dev_addr); + + MUSB2_WRITE_1(sc, MUSB2_REG_RXHADDR(0), td->haddr); + MUSB2_WRITE_1(sc, MUSB2_REG_RXHUBPORT(0), td->hport); + MUSB2_WRITE_1(sc, MUSB2_REG_RXTI, td->transfer_type); + + /* RX NAK timeout */ + MUSB2_WRITE_1(sc, MUSB2_REG_RXNAKLIMIT, MAX_NAK_TO); + + td->transaction_started = 1; + + /* Disable PING */ + csrh = MUSB2_READ_1(sc, MUSB2_REG_RXCSRH); + csrh |= MUSB2_MASK_CSR0H_PING_DIS; + MUSB2_WRITE_1(sc, MUSB2_REG_RXCSRH, csrh); + + /* write command */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, + MUSB2_MASK_CSR0L_STATUSPKT | + MUSB2_MASK_CSR0L_REQPKT); + + return (1); /* Just started */ + + } + + csr = MUSB2_READ_1(sc, MUSB2_REG_TXCSRL); + + DPRINTFN(4, "IN STATUS csr=0x%02x\n", csr); + + if (csr & MUSB2_MASK_CSR0L_RXPKTRDY) { + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, + MUSB2_MASK_CSR0L_RXPKTRDY_CLR); + musbotg_channel_free(sc, td); + return (0); /* complete */ + } + + if (csr & MUSB2_MASK_CSR0L_NAKTIMO) { + csr &= ~ (MUSB2_MASK_CSR0L_STATUSPKT | + MUSB2_MASK_CSR0L_REQPKT); + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, csr); + + csr &= ~MUSB2_MASK_CSR0L_NAKTIMO; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, csr); + td->error = 1; + } + + /* Failed */ + if (csr & (MUSB2_MASK_CSR0L_RXSTALL | + MUSB2_MASK_CSR0L_ERROR)) + { + /* Clear status bit */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, 0); + DPRINTFN(1, "error bit set, csr=0x%02x\n", csr); + td->error = 1; + } + + if (td->error) { + musbotg_channel_free(sc, td); + return (0); + } + + return (1); /* Not ready yet */ +} + +static uint8_t +musbotg_host_ctrl_status_tx(struct musbotg_td *td) +{ + struct musbotg_softc *sc; + uint8_t csr; + + /* get pointer to softc */ + sc = MUSBOTG_PC2SC(td->pc); + + if (td->channel == -1) + td->channel = musbotg_channel_alloc(sc, td); + + /* EP0 is busy, wait */ + if (td->channel == -1) + return (1); + + DPRINTFN(1, "ep_no=%d/%d [%d@%d.%d/%02x]\n", td->channel, td->transaction_started, + td->dev_addr,td->haddr,td->hport, td->transfer_type); + + /* select endpoint 0 */ + MUSB2_WRITE_1(sc, MUSB2_REG_EPINDEX, 0); + + csr = MUSB2_READ_1(sc, MUSB2_REG_TXCSRL); + DPRINTFN(4, "csr=0x%02x\n", csr); + + /* Not yet */ + if (csr & MUSB2_MASK_CSR0L_TXPKTRDY) + return (1); + + /* Failed */ + if (csr & (MUSB2_MASK_CSR0L_RXSTALL | + MUSB2_MASK_CSR0L_ERROR)) + { + /* Clear status bit */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, 0); + DPRINTFN(1, "error bit set, csr=0x%02x\n", csr); + td->error = 1; + musbotg_channel_free(sc, td); + return (0); /* complete */ + } + + if (td->transaction_started) { + musbotg_channel_free(sc, td); + return (0); /* complete */ + } + + MUSB2_WRITE_1(sc, MUSB2_REG_RXCSRH, MUSB2_MASK_CSR0H_PING_DIS); + + MUSB2_WRITE_1(sc, MUSB2_REG_TXFADDR(0), td->dev_addr); + MUSB2_WRITE_1(sc, MUSB2_REG_TXHADDR(0), td->haddr); + MUSB2_WRITE_1(sc, MUSB2_REG_TXHUBPORT(0), td->hport); + MUSB2_WRITE_1(sc, MUSB2_REG_TXTI, td->transfer_type); + + /* TX NAK timeout */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXNAKLIMIT, MAX_NAK_TO); + + td->transaction_started = 1; + + /* write command */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, + MUSB2_MASK_CSR0L_STATUSPKT | + MUSB2_MASK_CSR0L_TXPKTRDY); + + return (1); /* wait for interrupt */ +} + +static uint8_t +musbotg_dev_data_rx(struct musbotg_td *td) +{ + struct usb_page_search buf_res; + struct musbotg_softc *sc; + uint16_t count; + uint8_t csr; + uint8_t to; + uint8_t got_short; + + to = 8; /* don't loop forever! */ + got_short = 0; + + /* get pointer to softc */ + sc = MUSBOTG_PC2SC(td->pc); + + if (td->channel == -1) + td->channel = musbotg_channel_alloc(sc, td); + + /* EP0 is busy, wait */ + if (td->channel == -1) + return (1); + + /* select endpoint */ + MUSB2_WRITE_1(sc, MUSB2_REG_EPINDEX, td->channel); + +repeat: + /* read out FIFO status */ + csr = MUSB2_READ_1(sc, MUSB2_REG_RXCSRL); + + DPRINTFN(4, "csr=0x%02x\n", csr); + + /* clear overrun */ + if (csr & MUSB2_MASK_CSRL_RXOVERRUN) { + /* make sure we don't clear "RXPKTRDY" */ + MUSB2_WRITE_1(sc, MUSB2_REG_RXCSRL, + MUSB2_MASK_CSRL_RXPKTRDY); + } + + /* check status */ + if (!(csr & MUSB2_MASK_CSRL_RXPKTRDY)) + return (1); /* not complete */ + + /* get the packet byte count */ + count = MUSB2_READ_2(sc, MUSB2_REG_RXCOUNT); + + DPRINTFN(4, "count=0x%04x\n", count); + + /* + * Check for short or invalid packet: + */ + if (count != td->max_frame_size) { + if (count < td->max_frame_size) { + /* we have a short packet */ + td->short_pkt = 1; + got_short = 1; + } else { + /* invalid USB packet */ + td->error = 1; + musbotg_channel_free(sc, td); + return (0); /* we are complete */ + } + } + /* verify the packet byte count */ + if (count > td->remainder) { + /* invalid USB packet */ + td->error = 1; + musbotg_channel_free(sc, td); + return (0); /* we are complete */ + } + while (count > 0) { + uint32_t temp; + + usbd_get_page(td->pc, td->offset, &buf_res); + + /* get correct length */ + if (buf_res.length > count) { + buf_res.length = count; + } + /* check for unaligned memory address */ + if (USB_P2U(buf_res.buffer) & 3) { + + temp = count & ~3; + + if (temp) { + /* receive data 4 bytes at a time */ + bus_space_read_multi_4(sc->sc_io_tag, sc->sc_io_hdl, + MUSB2_REG_EPFIFO(td->channel), sc->sc_bounce_buf, + temp / 4); + } + temp = count & 3; + if (temp) { + /* receive data 1 byte at a time */ + bus_space_read_multi_1(sc->sc_io_tag, + sc->sc_io_hdl, MUSB2_REG_EPFIFO(td->channel), + ((void *)&sc->sc_bounce_buf[count / 4]), temp); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 06:25:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 70C53945; Thu, 24 Oct 2013 06:25:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5E7132CB1; Thu, 24 Oct 2013 06:25:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9O6Prw3039136; Thu, 24 Oct 2013 06:25:53 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9O6PrBB039134; Thu, 24 Oct 2013 06:25:53 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201310240625.r9O6PrBB039134@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 24 Oct 2013 06:25:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r257042 - in stable/9/sys/dev/usb: . wlan X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 06:25:53 -0000 Author: hselasky Date: Thu Oct 24 06:25:52 2013 New Revision: 257042 URL: http://svnweb.freebsd.org/changeset/base/257042 Log: MFC r256500: Add new USB ID. PR: usb/182936 Modified: stable/9/sys/dev/usb/usbdevs stable/9/sys/dev/usb/wlan/if_run.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Thu Oct 24 06:22:43 2013 (r257041) +++ stable/9/sys/dev/usb/usbdevs Thu Oct 24 06:25:52 2013 (r257042) @@ -1228,6 +1228,7 @@ product BELKIN F5D8055V2 0x825b F5D8055 product BELKIN F5D9050V3 0x905b F5D9050 ver 3 Wireless Adapter product BELKIN2 F5U002 0x0002 F5U002 Parallel printer product BELKIN F6D4050V1 0x935a F6D4050 v1 +product BELKIN F6D4050V2 0x935b F6D4050 v2 /* Billionton products */ product BILLIONTON USB100 0x0986 USB100N 10/100 FastEthernet Modified: stable/9/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_run.c Thu Oct 24 06:22:43 2013 (r257041) +++ stable/9/sys/dev/usb/wlan/if_run.c Thu Oct 24 06:25:52 2013 (r257042) @@ -147,6 +147,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(BELKIN, F5D8055), RUN_DEV(BELKIN, F5D8055V2), RUN_DEV(BELKIN, F6D4050V1), + RUN_DEV(BELKIN, F6D4050V2), RUN_DEV(BELKIN, RT2870_1), RUN_DEV(BELKIN, RT2870_2), RUN_DEV(CISCOLINKSYS, AE1000), From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 07:38:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6D2A6B63; Thu, 24 Oct 2013 07:38:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4B5BA2111; Thu, 24 Oct 2013 07:38:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9O7cXoI062594; Thu, 24 Oct 2013 07:38:33 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9O7cWvE062592; Thu, 24 Oct 2013 07:38:32 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201310240738.r9O7cWvE062592@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 24 Oct 2013 07:38:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257043 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 07:38:33 -0000 Author: hselasky Date: Thu Oct 24 07:38:32 2013 New Revision: 257043 URL: http://svnweb.freebsd.org/changeset/base/257043 Log: MFC r256548: Correct programming of XXX_MAXP register. This register is 16-bit wide and not 8-bit. Fix support for isochronous transfers in USB host mode. Fix a whitespace while at it. PR: usb/181987 Approved by: re (Xin Li) Modified: stable/10/sys/dev/usb/controller/musb_otg.c stable/10/sys/dev/usb/controller/musb_otg.h Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/dev/usb/controller/musb_otg.c ============================================================================== --- stable/10/sys/dev/usb/controller/musb_otg.c Thu Oct 24 06:25:52 2013 (r257042) +++ stable/10/sys/dev/usb/controller/musb_otg.c Thu Oct 24 07:38:32 2013 (r257043) @@ -1661,7 +1661,7 @@ repeat: } /* Max packet size */ - MUSB2_WRITE_1(sc, MUSB2_REG_TXMAXP, td->max_packet); + MUSB2_WRITE_2(sc, MUSB2_REG_TXMAXP, td->reg_max_packet); /* write command */ MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, @@ -1726,13 +1726,16 @@ repeat: td->hport); /* RX NAK timeout */ - MUSB2_WRITE_1(sc, MUSB2_REG_RXNAKLIMIT, MAX_NAK_TO); + if (td->transfer_type & MUSB2_MASK_TI_PROTO_ISOC) + MUSB2_WRITE_1(sc, MUSB2_REG_RXNAKLIMIT, 0); + else + MUSB2_WRITE_1(sc, MUSB2_REG_RXNAKLIMIT, MAX_NAK_TO); /* Protocol, speed, device endpoint */ MUSB2_WRITE_1(sc, MUSB2_REG_RXTI, td->transfer_type); /* Max packet size */ - MUSB2_WRITE_1(sc, MUSB2_REG_RXMAXP, td->max_packet); + MUSB2_WRITE_2(sc, MUSB2_REG_RXMAXP, td->reg_max_packet); /* Data Toggle */ csrh = MUSB2_READ_1(sc, MUSB2_REG_RXCSRH); @@ -1938,7 +1941,7 @@ musbotg_host_data_tx(struct musbotg_td * return (0); /* complete */ } - if (csr & MUSB2_MASK_CSRL_TXNAKTO ) { + if (csr & MUSB2_MASK_CSRL_TXNAKTO) { /* * Flush TX FIFO before clearing NAK TO */ @@ -2069,13 +2072,16 @@ musbotg_host_data_tx(struct musbotg_td * td->hport); /* TX NAK timeout */ - MUSB2_WRITE_1(sc, MUSB2_REG_TXNAKLIMIT, MAX_NAK_TO); + if (td->transfer_type & MUSB2_MASK_TI_PROTO_ISOC) + MUSB2_WRITE_1(sc, MUSB2_REG_TXNAKLIMIT, 0); + else + MUSB2_WRITE_1(sc, MUSB2_REG_TXNAKLIMIT, MAX_NAK_TO); /* Protocol, speed, device endpoint */ MUSB2_WRITE_1(sc, MUSB2_REG_TXTI, td->transfer_type); /* Max packet size */ - MUSB2_WRITE_1(sc, MUSB2_REG_TXMAXP, td->max_packet); + MUSB2_WRITE_2(sc, MUSB2_REG_TXMAXP, td->reg_max_packet); if (!td->transaction_started) { csrh = MUSB2_READ_1(sc, MUSB2_REG_TXCSRH); @@ -2406,7 +2412,6 @@ musbotg_setup_standard_chain(struct usb_ if (xfer->flags_int.usb_mode == USB_MODE_HOST) { speed = usbd_get_speed(xfer->xroot->udev); - xfer_type = xfer->endpoint->edesc->bmAttributes & UE_XFERTYPE; switch (speed) { case USB_SPEED_LOW: @@ -2444,7 +2449,6 @@ musbotg_setup_standard_chain(struct usb_ } temp.transfer_type |= ep_no; - td->max_packet = xfer->max_packet_size; td->toggle = xfer->endpoint->toggle_next; } @@ -2469,9 +2473,9 @@ musbotg_setup_standard_chain(struct usb_ x = 0; } - if (x != xfer->nframes) { - tx = 0; + tx = 0; + if (x != xfer->nframes) { if (xfer->endpointno & UE_DIR_IN) tx = 1; @@ -2532,9 +2536,14 @@ musbotg_setup_standard_chain(struct usb_ } else { - /* regular data transfer */ - - temp.short_pkt = (xfer->flags.force_short_xfer) ? 0 : 1; + if (xfer->flags_int.isochronous_xfr) { + /* isochronous data transfer */ + /* don't force short */ + temp.short_pkt = 1; + } else { + /* regular data transfer */ + temp.short_pkt = (xfer->flags.force_short_xfer ? 0 : 1); + } } musbotg_setup_standard_chain_sub(&temp); @@ -3158,7 +3167,12 @@ musbotg_init(struct musbotg_softc *sc) if (dynfifo) { if (frx && (temp <= nrx)) { - if (temp < 8) { + if (temp == 1) { + frx = 12; /* 4K */ + MUSB2_WRITE_1(sc, MUSB2_REG_RXFIFOSZ, + MUSB2_VAL_FIFOSZ_4096 | + MUSB2_MASK_FIFODB); + } else if (temp < 8) { frx = 10; /* 1K */ MUSB2_WRITE_1(sc, MUSB2_REG_RXFIFOSZ, MUSB2_VAL_FIFOSZ_512 | @@ -3175,7 +3189,12 @@ musbotg_init(struct musbotg_softc *sc) offset += (1 << frx); } if (ftx && (temp <= ntx)) { - if (temp < 8) { + if (temp == 1) { + ftx = 12; /* 4K */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXFIFOSZ, + MUSB2_VAL_FIFOSZ_4096 | + MUSB2_MASK_FIFODB); + } else if (temp < 8) { ftx = 10; /* 1K */ MUSB2_WRITE_1(sc, MUSB2_REG_TXFIFOSZ, MUSB2_VAL_FIFOSZ_512 | @@ -4042,7 +4061,7 @@ musbotg_xfer_setup(struct usb_setup_para * reasonable dummies: */ parm->hc_max_packet_size = 0x400; - parm->hc_max_frame_size = 0x400; + parm->hc_max_frame_size = 0xc00; if ((parm->methods == &musbotg_device_isoc_methods) || (parm->methods == &musbotg_device_intr_methods)) @@ -4117,6 +4136,8 @@ musbotg_xfer_setup(struct usb_setup_para /* init TD */ td->max_frame_size = xfer->max_frame_size; + td->reg_max_packet = xfer->max_packet_size | + ((xfer->max_packet_count - 1) << 11); td->ep_no = ep_no; td->obj_next = last_obj; Modified: stable/10/sys/dev/usb/controller/musb_otg.h ============================================================================== --- stable/10/sys/dev/usb/controller/musb_otg.h Thu Oct 24 06:25:52 2013 (r257042) +++ stable/10/sys/dev/usb/controller/musb_otg.h Thu Oct 24 07:38:32 2013 (r257043) @@ -316,9 +316,9 @@ struct musbotg_td { uint32_t offset; uint32_t remainder; uint16_t max_frame_size; /* packet_size * mult */ + uint16_t reg_max_packet; uint8_t ep_no; uint8_t transfer_type; - uint8_t max_packet; uint8_t error:1; uint8_t alt_next:1; uint8_t short_pkt:1; From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 07:43:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 28202D76; Thu, 24 Oct 2013 07:43:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 152392167; Thu, 24 Oct 2013 07:43:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9O7hZTb065255; Thu, 24 Oct 2013 07:43:35 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9O7hZ7P065252; Thu, 24 Oct 2013 07:43:35 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201310240743.r9O7hZ7P065252@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 24 Oct 2013 07:43:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257044 - in stable/10/sys/dev/usb: . wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 07:43:36 -0000 Author: hselasky Date: Thu Oct 24 07:43:35 2013 New Revision: 257044 URL: http://svnweb.freebsd.org/changeset/base/257044 Log: MFC r256500: Add new USB ID. PR: usb/182936 Approved by: re (Xin LI) Obtainedrom: Modified: stable/10/sys/dev/usb/usbdevs stable/10/sys/dev/usb/wlan/if_run.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Thu Oct 24 07:38:32 2013 (r257043) +++ stable/10/sys/dev/usb/usbdevs Thu Oct 24 07:43:35 2013 (r257044) @@ -1259,6 +1259,7 @@ product BELKIN F5D8055V2 0x825b F5D8055 product BELKIN F5D9050V3 0x905b F5D9050 ver 3 Wireless Adapter product BELKIN2 F5U002 0x0002 F5U002 Parallel printer product BELKIN F6D4050V1 0x935a F6D4050 v1 +product BELKIN F6D4050V2 0x935b F6D4050 v2 /* Billionton products */ product BILLIONTON USB100 0x0986 USB100N 10/100 FastEthernet Modified: stable/10/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_run.c Thu Oct 24 07:38:32 2013 (r257043) +++ stable/10/sys/dev/usb/wlan/if_run.c Thu Oct 24 07:43:35 2013 (r257044) @@ -147,6 +147,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(BELKIN, F5D8055), RUN_DEV(BELKIN, F5D8055V2), RUN_DEV(BELKIN, F6D4050V1), + RUN_DEV(BELKIN, F6D4050V2), RUN_DEV(BELKIN, RT2870_1), RUN_DEV(BELKIN, RT2870_2), RUN_DEV(CISCOLINKSYS, AE1000), From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 07:46:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 718DAF2D; Thu, 24 Oct 2013 07:46:18 +0000 (UTC) (envelope-from hps@bitfrost.no) Received: from mta.bitpro.no (mta.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id 2C6B82188; Thu, 24 Oct 2013 07:46:18 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta.bitpro.no (Postfix) with ESMTP id EE6EA7A531; Thu, 24 Oct 2013 09:46:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id 004338F6FD4; Thu, 24 Oct 2013 09:46:42 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w14EDUPw+Ksx; Thu, 24 Oct 2013 09:46:42 +0200 (CEST) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) by mail.lockless.no (Postfix) with ESMTPSA id 254508F6FD3; Thu, 24 Oct 2013 09:46:42 +0200 (CEST) Message-ID: <5268D08D.6070701@bitfrost.no> Date: Thu, 24 Oct 2013 09:47:25 +0200 From: Hans Petter Selasky Organization: Bitfrost A/S User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130522 Thunderbird/17.0.6 MIME-Version: 1.0 Subject: Re: svn commit: r257044 - in stable/10/sys/dev/usb: . wlan References: <201310240743.r9O7hZ7P065252@svn.freebsd.org> In-Reply-To: <201310240743.r9O7hZ7P065252@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 07:46:18 -0000 On 10/24/13 09:43, Hans Petter Selasky wrote: > Author: hselasky > Date: Thu Oct 24 07:43:35 2013 > New Revision: 257044 > URL: http://svnweb.freebsd.org/changeset/base/257044 > > Log: > MFC r256500: > Add new USB ID. > > PR: usb/182936 > Approved by: re (Xin LI) > Obtainedrom: ^^^ this line was a minor "vi" accident :-) --HPS From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 09:27:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7F74284F; Thu, 24 Oct 2013 09:27:07 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6D9F72AFA; Thu, 24 Oct 2013 09:27:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9O9R79T099125; Thu, 24 Oct 2013 09:27:07 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9O9R7jp099124; Thu, 24 Oct 2013 09:27:07 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201310240927.r9O9R7jp099124@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 24 Oct 2013 09:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257045 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 09:27:07 -0000 Author: ray Date: Thu Oct 24 09:27:06 2013 New Revision: 257045 URL: http://svnweb.freebsd.org/changeset/base/257045 Log: Fix crossed fingers output. Only comment changed. Modified: head/sys/dev/uart/uart_dev_imx.c Modified: head/sys/dev/uart/uart_dev_imx.c ============================================================================== --- head/sys/dev/uart/uart_dev_imx.c Thu Oct 24 07:43:35 2013 (r257044) +++ head/sys/dev/uart/uart_dev_imx.c Thu Oct 24 09:27:06 2013 (r257045) @@ -189,7 +189,7 @@ imx_uart_bus_attach(struct uart_softc *s (void)imx_uart_bus_getsig(sc); - /* XXX workaround to have working console on manut prompt */ + /* XXX workaround to have working console on mount prompt */ if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE){ DIS(bas, UCR4, DREN); } else { From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 10:19:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A064CF4A; Thu, 24 Oct 2013 10:19:20 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id 5E6432F7D; Thu, 24 Oct 2013 10:19:20 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1VZI2Y-000FQx-MH; Thu, 24 Oct 2013 14:21:18 +0400 Date: Thu, 24 Oct 2013 14:21:18 +0400 From: Slawa Olhovchenkov To: Steven Hartland Subject: Re: svn commit: r256956 - in head/sys: cam/ata cam/scsi cddl/contrib/opensolaris/uts/common/fs/zfs cddl/contrib/opensolaris/uts/common/fs/zfs/sys geom sys Message-ID: <20131024102118.GA59011@zxy.spb.ru> References: <201310230954.r9N9sxAZ011750@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201310230954.r9N9sxAZ011750@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 10:19:20 -0000 On Wed, Oct 23, 2013 at 09:54:59AM +0000, Steven Hartland wrote: > Author: smh > Date: Wed Oct 23 09:54:58 2013 > New Revision: 256956 > URL: http://svnweb.freebsd.org/changeset/base/256956 > > Log: > Improve ZFS N-way mirror read performance by using load and locality > information. What about support F_READAHEAD in ZFS (with prefetch disabled by CPU-intensive)? From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 10:31:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 32832BF9; Thu, 24 Oct 2013 10:31:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2070420EA; Thu, 24 Oct 2013 10:31:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OAVrcO022251; Thu, 24 Oct 2013 10:31:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OAVrYY022250; Thu, 24 Oct 2013 10:31:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310241031.r9OAVrYY022250@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 Oct 2013 10:31:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r257048 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 10:31:54 -0000 Author: mav Date: Thu Oct 24 10:31:53 2013 New Revision: 257048 URL: http://svnweb.freebsd.org/changeset/base/257048 Log: MFC r256533: Unhide "Serial Number" lines from bootverbose. That information may be useful for system administration to have in hard copy (in logs) if one of several devices suddenly dies. Modified: stable/9/sys/cam/cam_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Thu Oct 24 10:31:02 2013 (r257047) +++ stable/9/sys/cam/cam_xpt.c Thu Oct 24 10:31:53 2013 (r257048) @@ -1045,7 +1045,7 @@ xpt_announce_periph(struct cam_periph *p (struct sep_identify_data *)&path->device->ident_data); else printf("Unknown protocol device\n"); - if (bootverbose && path->device->serial_num_len > 0) { + if (path->device->serial_num_len > 0) { /* Don't wrap the screen - print only the first 60 chars */ printf("%s%d: Serial Number %.60s\n", periph->periph_name, periph->unit_number, path->device->serial_num); From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 10:31:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 89B93AAD; Thu, 24 Oct 2013 10:31:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 774BA20D6; Thu, 24 Oct 2013 10:31:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OAV3Vp022119; Thu, 24 Oct 2013 10:31:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OAV3oS022118; Thu, 24 Oct 2013 10:31:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310241031.r9OAV3oS022118@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 Oct 2013 10:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257047 - stable/10/sys/cam X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 10:31:03 -0000 Author: mav Date: Thu Oct 24 10:31:02 2013 New Revision: 257047 URL: http://svnweb.freebsd.org/changeset/base/257047 Log: MFC r256533: Unhide "Serial Number" lines from bootverbose. That information may be useful for system administration to have in hard copy (in logs) if one of several devices suddenly dies. Approved by: re (hrs) Modified: stable/10/sys/cam/cam_xpt.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/cam/cam_xpt.c ============================================================================== --- stable/10/sys/cam/cam_xpt.c Thu Oct 24 10:18:08 2013 (r257046) +++ stable/10/sys/cam/cam_xpt.c Thu Oct 24 10:31:02 2013 (r257047) @@ -1043,7 +1043,7 @@ xpt_announce_periph(struct cam_periph *p (struct sep_identify_data *)&path->device->ident_data); else printf("Unknown protocol device\n"); - if (bootverbose && path->device->serial_num_len > 0) { + if (path->device->serial_num_len > 0) { /* Don't wrap the screen - print only the first 60 chars */ printf("%s%d: Serial Number %.60s\n", periph->periph_name, periph->unit_number, path->device->serial_num); From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 10:34:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C3993FB6; Thu, 24 Oct 2013 10:34:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B09E9211E; Thu, 24 Oct 2013 10:34:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OAYHKE022778; Thu, 24 Oct 2013 10:34:17 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OAYEvr022755; Thu, 24 Oct 2013 10:34:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310241034.r9OAYEvr022755@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 Oct 2013 10:34:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r257050 - in stable/9/sys/cam: . ata scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 10:34:17 -0000 Author: mav Date: Thu Oct 24 10:34:13 2013 New Revision: 257050 URL: http://svnweb.freebsd.org/changeset/base/257050 Log: MFC r256552: Unify periph invalidation and destruction reporting. Print message containing device model and serial number on invalidation. Modified: stable/9/sys/cam/ata/ata_all.c stable/9/sys/cam/ata/ata_all.h stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/ata/ata_pmp.c stable/9/sys/cam/cam_periph.c stable/9/sys/cam/cam_periph.h stable/9/sys/cam/cam_xpt.c stable/9/sys/cam/cam_xpt_periph.h stable/9/sys/cam/scsi/scsi_all.c stable/9/sys/cam/scsi/scsi_all.h stable/9/sys/cam/scsi/scsi_cd.c stable/9/sys/cam/scsi/scsi_ch.c stable/9/sys/cam/scsi/scsi_da.c stable/9/sys/cam/scsi/scsi_enc.c stable/9/sys/cam/scsi/scsi_pass.c stable/9/sys/cam/scsi/scsi_pt.c stable/9/sys/cam/scsi/scsi_sa.c stable/9/sys/cam/scsi/scsi_sg.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_all.c ============================================================================== --- stable/9/sys/cam/ata/ata_all.c Thu Oct 24 10:33:31 2013 (r257049) +++ stable/9/sys/cam/ata/ata_all.c Thu Oct 24 10:34:13 2013 (r257050) @@ -297,6 +297,18 @@ ata_print_ident(struct ata_params *ident } void +ata_print_ident_short(struct ata_params *ident_data) +{ + char product[48], revision[16]; + + cam_strvis(product, ident_data->model, sizeof(ident_data->model), + sizeof(product)); + cam_strvis(revision, ident_data->revision, sizeof(ident_data->revision), + sizeof(revision)); + printf("<%s %s>", product, revision); +} + +void semb_print_ident(struct sep_identify_data *ident_data) { char vendor[9], product[17], revision[5], fw[5], in[7], ins[5]; @@ -311,6 +323,18 @@ semb_print_ident(struct sep_identify_dat vendor, product, revision, fw, in, ins); } +void +semb_print_ident_short(struct sep_identify_data *ident_data) +{ + char vendor[9], product[17], revision[5], fw[5]; + + cam_strvis(vendor, ident_data->vendor_id, 8, sizeof(vendor)); + cam_strvis(product, ident_data->product_id, 16, sizeof(product)); + cam_strvis(revision, ident_data->product_rev, 4, sizeof(revision)); + cam_strvis(fw, ident_data->firmware_rev, 4, sizeof(fw)); + printf("<%s %s %s %s>", vendor, product, revision, fw); +} + uint32_t ata_logical_sector_size(struct ata_params *ident_data) { Modified: stable/9/sys/cam/ata/ata_all.h ============================================================================== --- stable/9/sys/cam/ata/ata_all.h Thu Oct 24 10:33:31 2013 (r257049) +++ stable/9/sys/cam/ata/ata_all.h Thu Oct 24 10:34:13 2013 (r257050) @@ -109,6 +109,7 @@ int ata_status_sbuf(struct ccb_ataio *at int ata_res_sbuf(struct ccb_ataio *ataio, struct sbuf *sb); void ata_print_ident(struct ata_params *ident_data); +void ata_print_ident_short(struct ata_params *ident_data); uint32_t ata_logical_sector_size(struct ata_params *ident_data); uint64_t ata_physical_sector_size(struct ata_params *ident_data); @@ -143,6 +144,7 @@ int ata_identify_match(caddr_t identbuff int ata_static_identify_match(caddr_t identbuffer, caddr_t table_entry); void semb_print_ident(struct sep_identify_data *ident_data); +void semb_print_ident_short(struct sep_identify_data *ident_data); void semb_receive_diagnostic_results(struct ccb_ataio *ataio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb*), Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Thu Oct 24 10:33:31 2013 (r257049) +++ stable/9/sys/cam/ata/ata_da.c Thu Oct 24 10:34:13 2013 (r257050) @@ -912,7 +912,6 @@ adaoninvalidate(struct cam_periph *perip bioq_flush(&softc->trim_queue, NULL, ENXIO); disk_gone(softc->disk); - xpt_print(periph->path, "lost device\n"); } static void @@ -922,7 +921,6 @@ adacleanup(struct cam_periph *periph) softc = (struct ada_softc *)periph->softc; - xpt_print(periph->path, "removing device entry\n"); cam_periph_unlock(periph); /* Modified: stable/9/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/9/sys/cam/ata/ata_pmp.c Thu Oct 24 10:33:31 2013 (r257049) +++ stable/9/sys/cam/ata/ata_pmp.c Thu Oct 24 10:34:13 2013 (r257050) @@ -241,7 +241,6 @@ pmponinvalidate(struct cam_periph *perip } } pmprelease(periph, -1); - xpt_print(periph->path, "lost device\n"); } static void @@ -251,7 +250,6 @@ pmpcleanup(struct cam_periph *periph) softc = (struct pmp_softc *)periph->softc; - xpt_print(periph->path, "removing device entry\n"); cam_periph_unlock(periph); /* Modified: stable/9/sys/cam/cam_periph.c ============================================================================== --- stable/9/sys/cam/cam_periph.c Thu Oct 24 10:33:31 2013 (r257049) +++ stable/9/sys/cam/cam_periph.c Thu Oct 24 10:34:13 2013 (r257050) @@ -586,6 +586,8 @@ cam_periph_invalidate(struct cam_periph return; CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph invalidated\n")); + if (periph->flags & CAM_PERIPH_ANNOUNCED) + xpt_denounce_periph(periph); periph->flags |= CAM_PERIPH_INVALID; periph->flags &= ~CAM_PERIPH_NEW_DEV_FOUND; if (periph->periph_oninval != NULL) @@ -648,7 +650,10 @@ camperiphfree(struct cam_periph *periph) xpt_remove_periph(periph); xpt_unlock_buses(); - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n")); + if (periph->flags & CAM_PERIPH_ANNOUNCED) { + xpt_print(periph->path, "Periph destroyed\n"); + } else + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n")); if (periph->flags & CAM_PERIPH_NEW_DEV_FOUND) { union ccb ccb; Modified: stable/9/sys/cam/cam_periph.h ============================================================================== --- stable/9/sys/cam/cam_periph.h Thu Oct 24 10:33:31 2013 (r257049) +++ stable/9/sys/cam/cam_periph.h Thu Oct 24 10:34:13 2013 (r257050) @@ -121,6 +121,7 @@ struct cam_periph { #define CAM_PERIPH_NEW_DEV_FOUND 0x10 #define CAM_PERIPH_RECOVERY_INPROG 0x20 #define CAM_PERIPH_FREE 0x80 +#define CAM_PERIPH_ANNOUNCED 0x100 u_int32_t immediate_priority; u_int32_t refcount; SLIST_HEAD(, ccb_hdr) ccb_list; /* For "immediate" requests */ Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Thu Oct 24 10:33:31 2013 (r257049) +++ stable/9/sys/cam/cam_xpt.c Thu Oct 24 10:34:13 2013 (r257050) @@ -1025,6 +1025,7 @@ xpt_announce_periph(struct cam_periph *p struct cam_path *path = periph->path; mtx_assert(periph->sim->mtx, MA_OWNED); + periph->flags |= CAM_PERIPH_ANNOUNCED; printf("%s%d at %s%d bus %d scbus%d target %d lun %d\n", periph->periph_name, periph->unit_number, @@ -1073,6 +1074,37 @@ xpt_announce_quirks(struct cam_periph *p } } +void +xpt_denounce_periph(struct cam_periph *periph) +{ + struct cam_path *path = periph->path; + + mtx_assert(periph->sim->mtx, MA_OWNED); + printf("%s%d at %s%d bus %d scbus%d target %d lun %d\n", + periph->periph_name, periph->unit_number, + path->bus->sim->sim_name, + path->bus->sim->unit_number, + path->bus->sim->bus_id, + path->bus->path_id, + path->target->target_id, + path->device->lun_id); + printf("%s%d: ", periph->periph_name, periph->unit_number); + if (path->device->protocol == PROTO_SCSI) + scsi_print_inquiry_short(&path->device->inq_data); + else if (path->device->protocol == PROTO_ATA || + path->device->protocol == PROTO_SATAPM) + ata_print_ident_short(&path->device->ident_data); + else if (path->device->protocol == PROTO_SEMB) + semb_print_ident_short( + (struct sep_identify_data *)&path->device->ident_data); + else + printf("Unknown protocol device"); + if (path->device->serial_num_len > 0) + printf(" s/n %.60s", path->device->serial_num); + printf(" detached\n"); +} + + int xpt_getattr(char *buf, size_t len, const char *attr, struct cam_path *path) { Modified: stable/9/sys/cam/cam_xpt_periph.h ============================================================================== --- stable/9/sys/cam/cam_xpt_periph.h Thu Oct 24 10:33:31 2013 (r257049) +++ stable/9/sys/cam/cam_xpt_periph.h Thu Oct 24 10:34:13 2013 (r257050) @@ -47,6 +47,7 @@ void xpt_announce_periph(struct cam_per char *announce_string); void xpt_announce_quirks(struct cam_periph *periph, int quirks, char *bit_string); +void xpt_denounce_periph(struct cam_periph *periph); #endif #endif /* _CAM_CAM_XPT_PERIPH_H */ Modified: stable/9/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_all.c Thu Oct 24 10:33:31 2013 (r257049) +++ stable/9/sys/cam/scsi/scsi_all.c Thu Oct 24 10:34:13 2013 (r257050) @@ -5249,6 +5249,21 @@ scsi_print_inquiry(struct scsi_inquiry_d dtype, rstr, qtype); } +void +scsi_print_inquiry_short(struct scsi_inquiry_data *inq_data) +{ + char vendor[16], product[48], revision[16]; + + cam_strvis(vendor, inq_data->vendor, sizeof(inq_data->vendor), + sizeof(vendor)); + cam_strvis(product, inq_data->product, sizeof(inq_data->product), + sizeof(product)); + cam_strvis(revision, inq_data->revision, sizeof(inq_data->revision), + sizeof(revision)); + + printf("<%s %s %s>", vendor, product, revision); +} + /* * Table of syncrates that don't follow the "divisible by 4" * rule. This table will be expanded in future SCSI specs. Modified: stable/9/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/9/sys/cam/scsi/scsi_all.h Thu Oct 24 10:33:31 2013 (r257049) +++ stable/9/sys/cam/scsi/scsi_all.h Thu Oct 24 10:34:13 2013 (r257050) @@ -2312,6 +2312,7 @@ char * scsi_cdb_string(u_int8_t *cdb_pt size_t len); void scsi_print_inquiry(struct scsi_inquiry_data *inq_data); +void scsi_print_inquiry_short(struct scsi_inquiry_data *inq_data); u_int scsi_calc_syncsrate(u_int period_factor); u_int scsi_calc_syncparam(u_int period); Modified: stable/9/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_cd.c Thu Oct 24 10:33:31 2013 (r257049) +++ stable/9/sys/cam/scsi/scsi_cd.c Thu Oct 24 10:34:13 2013 (r257050) @@ -428,7 +428,6 @@ cdoninvalidate(struct cam_periph *periph camq_remove(&softc->changer->devq, softc->pinfo.index); disk_gone(softc->disk); - xpt_print(periph->path, "lost device, %d refs\n", periph->refcount); } static void @@ -438,8 +437,6 @@ cdcleanup(struct cam_periph *periph) softc = (struct cd_softc *)periph->softc; - xpt_print(periph->path, "removing device entry\n"); - /* * In the queued, non-active case, the device in question * has already been removed from the changer run queue. Since this Modified: stable/9/sys/cam/scsi/scsi_ch.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_ch.c Thu Oct 24 10:33:31 2013 (r257049) +++ stable/9/sys/cam/scsi/scsi_ch.c Thu Oct 24 10:34:13 2013 (r257050) @@ -306,9 +306,6 @@ choninvalidate(struct cam_periph *periph * when it has cleaned up its state. */ destroy_dev_sched_cb(softc->dev, chdevgonecb, periph); - - xpt_print(periph->path, "lost device\n"); - } static void @@ -318,8 +315,6 @@ chcleanup(struct cam_periph *periph) softc = (struct ch_softc *)periph->softc; - xpt_print(periph->path, "removing device entry\n"); - devstat_remove_entry(softc->device_stats); free(softc, M_DEVBUF); Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Thu Oct 24 10:33:31 2013 (r257049) +++ stable/9/sys/cam/scsi/scsi_da.c Thu Oct 24 10:34:13 2013 (r257050) @@ -1561,9 +1561,6 @@ daoninvalidate(struct cam_periph *periph * done cleaning up its resources. */ disk_gone(softc->disk); - - xpt_print(periph->path, "lost device - %d outstanding, %d refs\n", - softc->outstanding_cmds, periph->refcount); } static void @@ -1573,7 +1570,6 @@ dacleanup(struct cam_periph *periph) softc = (struct da_softc *)periph->softc; - xpt_print(periph->path, "removing device entry\n"); cam_periph_unlock(periph); /* Modified: stable/9/sys/cam/scsi/scsi_enc.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_enc.c Thu Oct 24 10:33:31 2013 (r257049) +++ stable/9/sys/cam/scsi/scsi_enc.c Thu Oct 24 10:34:13 2013 (r257050) @@ -178,8 +178,6 @@ enc_oninvalidate(struct cam_periph *peri callout_drain(&enc->status_updater); destroy_dev_sched_cb(enc->enc_dev, enc_devgonecb, periph); - - xpt_print(periph->path, "lost device\n"); } static void @@ -189,9 +187,6 @@ enc_dtor(struct cam_periph *periph) enc = periph->softc; - xpt_print(periph->path, "removing device entry\n"); - - /* If the sub-driver has a cleanup routine, call it */ if (enc->enc_vec.softc_cleanup != NULL) enc->enc_vec.softc_cleanup(enc); Modified: stable/9/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_pass.c Thu Oct 24 10:33:31 2013 (r257049) +++ stable/9/sys/cam/scsi/scsi_pass.c Thu Oct 24 10:34:13 2013 (r257050) @@ -207,11 +207,6 @@ passoninvalidate(struct cam_periph *peri * XXX Handle any transactions queued to the card * with XPT_ABORT_CCB. */ - - if (bootverbose) { - xpt_print(periph->path, "lost device\n"); - } - } static void @@ -221,8 +216,6 @@ passcleanup(struct cam_periph *periph) softc = (struct pass_softc *)periph->softc; - if (bootverbose) - xpt_print(periph->path, "removing device entry\n"); devstat_remove_entry(softc->device_stats); cam_periph_unlock(periph); Modified: stable/9/sys/cam/scsi/scsi_pt.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_pt.c Thu Oct 24 10:33:31 2013 (r257049) +++ stable/9/sys/cam/scsi/scsi_pt.c Thu Oct 24 10:34:13 2013 (r257050) @@ -333,8 +333,6 @@ ptoninvalidate(struct cam_periph *periph * with XPT_ABORT_CCB. */ bioq_flush(&softc->bio_queue, NULL, ENXIO); - - xpt_print(periph->path, "lost device\n"); } static void @@ -344,7 +342,6 @@ ptdtor(struct cam_periph *periph) softc = (struct pt_softc *)periph->softc; - xpt_print(periph->path, "removing device entry\n"); devstat_remove_entry(softc->device_stats); cam_periph_unlock(periph); destroy_dev(softc->dev); Modified: stable/9/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_sa.c Thu Oct 24 10:33:31 2013 (r257049) +++ stable/9/sys/cam/scsi/scsi_sa.c Thu Oct 24 10:34:13 2013 (r257050) @@ -1377,9 +1377,6 @@ saoninvalidate(struct cam_periph *periph */ bioq_flush(&softc->bio_queue, NULL, ENXIO); softc->queue_count = 0; - - xpt_print(periph->path, "lost device\n"); - } static void @@ -1390,7 +1387,6 @@ sacleanup(struct cam_periph *periph) softc = (struct sa_softc *)periph->softc; - xpt_print(periph->path, "removing device entry\n"); devstat_remove_entry(softc->device_stats); cam_periph_unlock(periph); destroy_dev(softc->devs.ctl_dev); Modified: stable/9/sys/cam/scsi/scsi_sg.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_sg.c Thu Oct 24 10:33:31 2013 (r257049) +++ stable/9/sys/cam/scsi/scsi_sg.c Thu Oct 24 10:34:13 2013 (r257050) @@ -238,9 +238,6 @@ sgoninvalidate(struct cam_periph *periph * with XPT_ABORT_CCB. */ - if (bootverbose) { - xpt_print(periph->path, "lost device\n"); - } } static void @@ -249,8 +246,6 @@ sgcleanup(struct cam_periph *periph) struct sg_softc *softc; softc = (struct sg_softc *)periph->softc; - if (bootverbose) - xpt_print(periph->path, "removing device entry\n"); devstat_remove_entry(softc->device_stats); From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 10:33:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 74B30E37; Thu, 24 Oct 2013 10:33:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 60FBB210E; Thu, 24 Oct 2013 10:33:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OAXZJK022639; Thu, 24 Oct 2013 10:33:35 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OAXVgU022614; Thu, 24 Oct 2013 10:33:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310241033.r9OAXVgU022614@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 Oct 2013 10:33:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257049 - in stable/10/sys/cam: . ata scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 10:33:35 -0000 Author: mav Date: Thu Oct 24 10:33:31 2013 New Revision: 257049 URL: http://svnweb.freebsd.org/changeset/base/257049 Log: MFC r256552: Unify periph invalidation and destruction reporting. Print message containing device model and serial number on invalidation. Approved by: re (hrs) Modified: stable/10/sys/cam/ata/ata_all.c stable/10/sys/cam/ata/ata_all.h stable/10/sys/cam/ata/ata_da.c stable/10/sys/cam/ata/ata_pmp.c stable/10/sys/cam/cam_periph.c stable/10/sys/cam/cam_periph.h stable/10/sys/cam/cam_xpt.c stable/10/sys/cam/cam_xpt_periph.h stable/10/sys/cam/scsi/scsi_all.c stable/10/sys/cam/scsi/scsi_all.h stable/10/sys/cam/scsi/scsi_cd.c stable/10/sys/cam/scsi/scsi_ch.c stable/10/sys/cam/scsi/scsi_da.c stable/10/sys/cam/scsi/scsi_enc.c stable/10/sys/cam/scsi/scsi_pass.c stable/10/sys/cam/scsi/scsi_pt.c stable/10/sys/cam/scsi/scsi_sa.c stable/10/sys/cam/scsi/scsi_sg.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/cam/ata/ata_all.c ============================================================================== --- stable/10/sys/cam/ata/ata_all.c Thu Oct 24 10:31:53 2013 (r257048) +++ stable/10/sys/cam/ata/ata_all.c Thu Oct 24 10:33:31 2013 (r257049) @@ -297,6 +297,18 @@ ata_print_ident(struct ata_params *ident } void +ata_print_ident_short(struct ata_params *ident_data) +{ + char product[48], revision[16]; + + cam_strvis(product, ident_data->model, sizeof(ident_data->model), + sizeof(product)); + cam_strvis(revision, ident_data->revision, sizeof(ident_data->revision), + sizeof(revision)); + printf("<%s %s>", product, revision); +} + +void semb_print_ident(struct sep_identify_data *ident_data) { char vendor[9], product[17], revision[5], fw[5], in[7], ins[5]; @@ -311,6 +323,18 @@ semb_print_ident(struct sep_identify_dat vendor, product, revision, fw, in, ins); } +void +semb_print_ident_short(struct sep_identify_data *ident_data) +{ + char vendor[9], product[17], revision[5], fw[5]; + + cam_strvis(vendor, ident_data->vendor_id, 8, sizeof(vendor)); + cam_strvis(product, ident_data->product_id, 16, sizeof(product)); + cam_strvis(revision, ident_data->product_rev, 4, sizeof(revision)); + cam_strvis(fw, ident_data->firmware_rev, 4, sizeof(fw)); + printf("<%s %s %s %s>", vendor, product, revision, fw); +} + uint32_t ata_logical_sector_size(struct ata_params *ident_data) { Modified: stable/10/sys/cam/ata/ata_all.h ============================================================================== --- stable/10/sys/cam/ata/ata_all.h Thu Oct 24 10:31:53 2013 (r257048) +++ stable/10/sys/cam/ata/ata_all.h Thu Oct 24 10:33:31 2013 (r257049) @@ -109,6 +109,7 @@ int ata_status_sbuf(struct ccb_ataio *at int ata_res_sbuf(struct ccb_ataio *ataio, struct sbuf *sb); void ata_print_ident(struct ata_params *ident_data); +void ata_print_ident_short(struct ata_params *ident_data); uint32_t ata_logical_sector_size(struct ata_params *ident_data); uint64_t ata_physical_sector_size(struct ata_params *ident_data); @@ -143,6 +144,7 @@ int ata_identify_match(caddr_t identbuff int ata_static_identify_match(caddr_t identbuffer, caddr_t table_entry); void semb_print_ident(struct sep_identify_data *ident_data); +void semb_print_ident_short(struct sep_identify_data *ident_data); void semb_receive_diagnostic_results(struct ccb_ataio *ataio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb*), Modified: stable/10/sys/cam/ata/ata_da.c ============================================================================== --- stable/10/sys/cam/ata/ata_da.c Thu Oct 24 10:31:53 2013 (r257048) +++ stable/10/sys/cam/ata/ata_da.c Thu Oct 24 10:33:31 2013 (r257049) @@ -907,7 +907,6 @@ adaoninvalidate(struct cam_periph *perip bioq_flush(&softc->trim_queue, NULL, ENXIO); disk_gone(softc->disk); - xpt_print(periph->path, "lost device\n"); } static void @@ -917,7 +916,6 @@ adacleanup(struct cam_periph *periph) softc = (struct ada_softc *)periph->softc; - xpt_print(periph->path, "removing device entry\n"); cam_periph_unlock(periph); /* Modified: stable/10/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/10/sys/cam/ata/ata_pmp.c Thu Oct 24 10:31:53 2013 (r257048) +++ stable/10/sys/cam/ata/ata_pmp.c Thu Oct 24 10:33:31 2013 (r257049) @@ -241,7 +241,6 @@ pmponinvalidate(struct cam_periph *perip } } pmprelease(periph, -1); - xpt_print(periph->path, "lost device\n"); } static void @@ -251,7 +250,6 @@ pmpcleanup(struct cam_periph *periph) softc = (struct pmp_softc *)periph->softc; - xpt_print(periph->path, "removing device entry\n"); cam_periph_unlock(periph); /* Modified: stable/10/sys/cam/cam_periph.c ============================================================================== --- stable/10/sys/cam/cam_periph.c Thu Oct 24 10:31:53 2013 (r257048) +++ stable/10/sys/cam/cam_periph.c Thu Oct 24 10:33:31 2013 (r257049) @@ -586,6 +586,8 @@ cam_periph_invalidate(struct cam_periph return; CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph invalidated\n")); + if (periph->flags & CAM_PERIPH_ANNOUNCED) + xpt_denounce_periph(periph); periph->flags |= CAM_PERIPH_INVALID; periph->flags &= ~CAM_PERIPH_NEW_DEV_FOUND; if (periph->periph_oninval != NULL) @@ -648,7 +650,10 @@ camperiphfree(struct cam_periph *periph) xpt_remove_periph(periph); xpt_unlock_buses(); - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n")); + if (periph->flags & CAM_PERIPH_ANNOUNCED) { + xpt_print(periph->path, "Periph destroyed\n"); + } else + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n")); if (periph->flags & CAM_PERIPH_NEW_DEV_FOUND) { union ccb ccb; Modified: stable/10/sys/cam/cam_periph.h ============================================================================== --- stable/10/sys/cam/cam_periph.h Thu Oct 24 10:31:53 2013 (r257048) +++ stable/10/sys/cam/cam_periph.h Thu Oct 24 10:33:31 2013 (r257049) @@ -121,6 +121,7 @@ struct cam_periph { #define CAM_PERIPH_NEW_DEV_FOUND 0x10 #define CAM_PERIPH_RECOVERY_INPROG 0x20 #define CAM_PERIPH_FREE 0x80 +#define CAM_PERIPH_ANNOUNCED 0x100 u_int32_t immediate_priority; u_int32_t refcount; SLIST_HEAD(, ccb_hdr) ccb_list; /* For "immediate" requests */ Modified: stable/10/sys/cam/cam_xpt.c ============================================================================== --- stable/10/sys/cam/cam_xpt.c Thu Oct 24 10:31:53 2013 (r257048) +++ stable/10/sys/cam/cam_xpt.c Thu Oct 24 10:33:31 2013 (r257049) @@ -1023,6 +1023,7 @@ xpt_announce_periph(struct cam_periph *p struct cam_path *path = periph->path; mtx_assert(periph->sim->mtx, MA_OWNED); + periph->flags |= CAM_PERIPH_ANNOUNCED; printf("%s%d at %s%d bus %d scbus%d target %d lun %d\n", periph->periph_name, periph->unit_number, @@ -1071,6 +1072,37 @@ xpt_announce_quirks(struct cam_periph *p } } +void +xpt_denounce_periph(struct cam_periph *periph) +{ + struct cam_path *path = periph->path; + + mtx_assert(periph->sim->mtx, MA_OWNED); + printf("%s%d at %s%d bus %d scbus%d target %d lun %d\n", + periph->periph_name, periph->unit_number, + path->bus->sim->sim_name, + path->bus->sim->unit_number, + path->bus->sim->bus_id, + path->bus->path_id, + path->target->target_id, + path->device->lun_id); + printf("%s%d: ", periph->periph_name, periph->unit_number); + if (path->device->protocol == PROTO_SCSI) + scsi_print_inquiry_short(&path->device->inq_data); + else if (path->device->protocol == PROTO_ATA || + path->device->protocol == PROTO_SATAPM) + ata_print_ident_short(&path->device->ident_data); + else if (path->device->protocol == PROTO_SEMB) + semb_print_ident_short( + (struct sep_identify_data *)&path->device->ident_data); + else + printf("Unknown protocol device"); + if (path->device->serial_num_len > 0) + printf(" s/n %.60s", path->device->serial_num); + printf(" detached\n"); +} + + int xpt_getattr(char *buf, size_t len, const char *attr, struct cam_path *path) { Modified: stable/10/sys/cam/cam_xpt_periph.h ============================================================================== --- stable/10/sys/cam/cam_xpt_periph.h Thu Oct 24 10:31:53 2013 (r257048) +++ stable/10/sys/cam/cam_xpt_periph.h Thu Oct 24 10:33:31 2013 (r257049) @@ -47,6 +47,7 @@ void xpt_announce_periph(struct cam_per char *announce_string); void xpt_announce_quirks(struct cam_periph *periph, int quirks, char *bit_string); +void xpt_denounce_periph(struct cam_periph *periph); #endif #endif /* _CAM_CAM_XPT_PERIPH_H */ Modified: stable/10/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.c Thu Oct 24 10:31:53 2013 (r257048) +++ stable/10/sys/cam/scsi/scsi_all.c Thu Oct 24 10:33:31 2013 (r257049) @@ -5249,6 +5249,21 @@ scsi_print_inquiry(struct scsi_inquiry_d dtype, rstr, qtype); } +void +scsi_print_inquiry_short(struct scsi_inquiry_data *inq_data) +{ + char vendor[16], product[48], revision[16]; + + cam_strvis(vendor, inq_data->vendor, sizeof(inq_data->vendor), + sizeof(vendor)); + cam_strvis(product, inq_data->product, sizeof(inq_data->product), + sizeof(product)); + cam_strvis(revision, inq_data->revision, sizeof(inq_data->revision), + sizeof(revision)); + + printf("<%s %s %s>", vendor, product, revision); +} + /* * Table of syncrates that don't follow the "divisible by 4" * rule. This table will be expanded in future SCSI specs. Modified: stable/10/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.h Thu Oct 24 10:31:53 2013 (r257048) +++ stable/10/sys/cam/scsi/scsi_all.h Thu Oct 24 10:33:31 2013 (r257049) @@ -2313,6 +2313,7 @@ char * scsi_cdb_string(u_int8_t *cdb_pt size_t len); void scsi_print_inquiry(struct scsi_inquiry_data *inq_data); +void scsi_print_inquiry_short(struct scsi_inquiry_data *inq_data); u_int scsi_calc_syncsrate(u_int period_factor); u_int scsi_calc_syncparam(u_int period); Modified: stable/10/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_cd.c Thu Oct 24 10:31:53 2013 (r257048) +++ stable/10/sys/cam/scsi/scsi_cd.c Thu Oct 24 10:33:31 2013 (r257049) @@ -428,7 +428,6 @@ cdoninvalidate(struct cam_periph *periph camq_remove(&softc->changer->devq, softc->pinfo.index); disk_gone(softc->disk); - xpt_print(periph->path, "lost device, %d refs\n", periph->refcount); } static void @@ -438,8 +437,6 @@ cdcleanup(struct cam_periph *periph) softc = (struct cd_softc *)periph->softc; - xpt_print(periph->path, "removing device entry\n"); - /* * In the queued, non-active case, the device in question * has already been removed from the changer run queue. Since this Modified: stable/10/sys/cam/scsi/scsi_ch.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_ch.c Thu Oct 24 10:31:53 2013 (r257048) +++ stable/10/sys/cam/scsi/scsi_ch.c Thu Oct 24 10:33:31 2013 (r257049) @@ -306,9 +306,6 @@ choninvalidate(struct cam_periph *periph * when it has cleaned up its state. */ destroy_dev_sched_cb(softc->dev, chdevgonecb, periph); - - xpt_print(periph->path, "lost device\n"); - } static void @@ -318,8 +315,6 @@ chcleanup(struct cam_periph *periph) softc = (struct ch_softc *)periph->softc; - xpt_print(periph->path, "removing device entry\n"); - devstat_remove_entry(softc->device_stats); free(softc, M_DEVBUF); Modified: stable/10/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_da.c Thu Oct 24 10:31:53 2013 (r257048) +++ stable/10/sys/cam/scsi/scsi_da.c Thu Oct 24 10:33:31 2013 (r257049) @@ -1561,9 +1561,6 @@ daoninvalidate(struct cam_periph *periph * done cleaning up its resources. */ disk_gone(softc->disk); - - xpt_print(periph->path, "lost device - %d outstanding, %d refs\n", - softc->outstanding_cmds, periph->refcount); } static void @@ -1573,7 +1570,6 @@ dacleanup(struct cam_periph *periph) softc = (struct da_softc *)periph->softc; - xpt_print(periph->path, "removing device entry\n"); cam_periph_unlock(periph); /* Modified: stable/10/sys/cam/scsi/scsi_enc.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_enc.c Thu Oct 24 10:31:53 2013 (r257048) +++ stable/10/sys/cam/scsi/scsi_enc.c Thu Oct 24 10:33:31 2013 (r257049) @@ -178,8 +178,6 @@ enc_oninvalidate(struct cam_periph *peri callout_drain(&enc->status_updater); destroy_dev_sched_cb(enc->enc_dev, enc_devgonecb, periph); - - xpt_print(periph->path, "lost device\n"); } static void @@ -189,9 +187,6 @@ enc_dtor(struct cam_periph *periph) enc = periph->softc; - xpt_print(periph->path, "removing device entry\n"); - - /* If the sub-driver has a cleanup routine, call it */ if (enc->enc_vec.softc_cleanup != NULL) enc->enc_vec.softc_cleanup(enc); Modified: stable/10/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_pass.c Thu Oct 24 10:31:53 2013 (r257048) +++ stable/10/sys/cam/scsi/scsi_pass.c Thu Oct 24 10:33:31 2013 (r257049) @@ -207,11 +207,6 @@ passoninvalidate(struct cam_periph *peri * XXX Handle any transactions queued to the card * with XPT_ABORT_CCB. */ - - if (bootverbose) { - xpt_print(periph->path, "lost device\n"); - } - } static void @@ -221,8 +216,6 @@ passcleanup(struct cam_periph *periph) softc = (struct pass_softc *)periph->softc; - if (bootverbose) - xpt_print(periph->path, "removing device entry\n"); devstat_remove_entry(softc->device_stats); cam_periph_unlock(periph); Modified: stable/10/sys/cam/scsi/scsi_pt.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_pt.c Thu Oct 24 10:31:53 2013 (r257048) +++ stable/10/sys/cam/scsi/scsi_pt.c Thu Oct 24 10:33:31 2013 (r257049) @@ -333,8 +333,6 @@ ptoninvalidate(struct cam_periph *periph * with XPT_ABORT_CCB. */ bioq_flush(&softc->bio_queue, NULL, ENXIO); - - xpt_print(periph->path, "lost device\n"); } static void @@ -344,7 +342,6 @@ ptdtor(struct cam_periph *periph) softc = (struct pt_softc *)periph->softc; - xpt_print(periph->path, "removing device entry\n"); devstat_remove_entry(softc->device_stats); cam_periph_unlock(periph); destroy_dev(softc->dev); Modified: stable/10/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_sa.c Thu Oct 24 10:31:53 2013 (r257048) +++ stable/10/sys/cam/scsi/scsi_sa.c Thu Oct 24 10:33:31 2013 (r257049) @@ -1401,9 +1401,6 @@ saoninvalidate(struct cam_periph *periph */ bioq_flush(&softc->bio_queue, NULL, ENXIO); softc->queue_count = 0; - - xpt_print(periph->path, "lost device\n"); - } static void @@ -1414,7 +1411,6 @@ sacleanup(struct cam_periph *periph) softc = (struct sa_softc *)periph->softc; - xpt_print(periph->path, "removing device entry\n"); devstat_remove_entry(softc->device_stats); cam_periph_unlock(periph); destroy_dev(softc->devs.ctl_dev); Modified: stable/10/sys/cam/scsi/scsi_sg.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_sg.c Thu Oct 24 10:31:53 2013 (r257048) +++ stable/10/sys/cam/scsi/scsi_sg.c Thu Oct 24 10:33:31 2013 (r257049) @@ -238,9 +238,6 @@ sgoninvalidate(struct cam_periph *periph * with XPT_ABORT_CCB. */ - if (bootverbose) { - xpt_print(periph->path, "lost device\n"); - } } static void @@ -249,8 +246,6 @@ sgcleanup(struct cam_periph *periph) struct sg_softc *softc; softc = (struct sg_softc *)periph->softc; - if (bootverbose) - xpt_print(periph->path, "removing device entry\n"); devstat_remove_entry(softc->device_stats); From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 10:49:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DEC775CF; Thu, 24 Oct 2013 10:49:56 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B2DA22275; Thu, 24 Oct 2013 10:49:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OAnuK6026650; Thu, 24 Oct 2013 10:49:56 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OAnuW0026643; Thu, 24 Oct 2013 10:49:56 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310241049.r9OAnuW0026643@svn.freebsd.org> From: Bryan Drewery Date: Thu, 24 Oct 2013 10:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257051 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 10:49:57 -0000 Author: bdrewery (ports committer) Date: Thu Oct 24 10:49:55 2013 New Revision: 257051 URL: http://svnweb.freebsd.org/changeset/base/257051 Log: Add support for using "pkg+http://" for the PACKAGESITE. pkg 1.2 is adding this support as well. This should help lessen the confusion on why the default SRV PACKAGESITE does not load in a browser. Adapated from: matthew's upstream pkg change Approved by: bapt MFC after: 2 days Modified: head/usr.sbin/pkg/config.c head/usr.sbin/pkg/config.h head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/config.c ============================================================================== --- head/usr.sbin/pkg/config.c Thu Oct 24 10:34:13 2013 (r257050) +++ head/usr.sbin/pkg/config.c Thu Oct 24 10:49:55 2013 (r257051) @@ -62,7 +62,7 @@ static struct config_entry c[] = { [PACKAGESITE] = { PKG_CONFIG_STRING, "PACKAGESITE", - "http://pkg.FreeBSD.org/${ABI}/latest", + URL_SCHEME_PREFIX "http://pkg.FreeBSD.org/${ABI}/latest", NULL, false, }, Modified: head/usr.sbin/pkg/config.h ============================================================================== --- head/usr.sbin/pkg/config.h Thu Oct 24 10:34:13 2013 (r257050) +++ head/usr.sbin/pkg/config.h Thu Oct 24 10:49:55 2013 (r257051) @@ -30,6 +30,7 @@ #define _PKG_CONFIG_H #define _LOCALBASE "/usr/local" +#define URL_SCHEME_PREFIX "pkg+" typedef enum { PACKAGESITE = 0, Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Thu Oct 24 10:34:13 2013 (r257050) +++ head/usr.sbin/pkg/pkg.c Thu Oct 24 10:49:55 2013 (r257051) @@ -168,6 +168,13 @@ bootstrap_pkg(void) warnx("No MIRROR_TYPE defined"); return (-1); } + + /* Support pkg+http:// for PACKAGESITE which is the new format + in 1.2 to avoid confusion on why http://pkg.FreeBSD.org has + no A record. */ + if (strncmp(URL_SCHEME_PREFIX, packagesite, + strlen(URL_SCHEME_PREFIX)) == 0) + packagesite += strlen(URL_SCHEME_PREFIX); snprintf(url, MAXPATHLEN, "%s/Latest/pkg.txz", packagesite); snprintf(tmppkg, MAXPATHLEN, "%s/pkg.txz.XXXXXX", From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 10:53:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2CA87934; Thu, 24 Oct 2013 10:53:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 15C3122E6; Thu, 24 Oct 2013 10:53:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OArZtr029145; Thu, 24 Oct 2013 10:53:35 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OArZQh029144; Thu, 24 Oct 2013 10:53:35 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310241053.r9OArZQh029144@svn.freebsd.org> From: Bryan Drewery Date: Thu, 24 Oct 2013 10:53:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r257052 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 10:53:36 -0000 Author: bdrewery (ports committer) Date: Thu Oct 24 10:53:35 2013 New Revision: 257052 URL: http://svnweb.freebsd.org/changeset/base/257052 Log: MFC r256842: Fix 'make delete-old-libs' and 'make check-libs' to delete .debug files created by WITH_DEBUG_FILES. Also cleanup .symbols files from the period between r244236 when .symbols were supported and r251512 when they were renamed to .debug. Only propose to delete a .debug file if the corresponding library itself was deleted already. Approved by: bapt Modified: stable/9/Makefile.inc1 (contents, props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Thu Oct 24 10:49:55 2013 (r257051) +++ stable/9/Makefile.inc1 Thu Oct 24 10:53:35 2013 (r257052) @@ -1574,6 +1574,13 @@ delete-old-libs: chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ rm ${RM_I} "${DESTDIR}/$${file}" <&3; \ fi; \ + for ext in debug symbols; do \ + if ! [ -e "${DESTDIR}/$${file}" ] && [ -f \ + "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \ + rm ${RM_I} "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" \ + <&3; \ + fi; \ + done; \ done @echo ">>> Old libraries removed" @@ -1585,6 +1592,11 @@ check-old-libs: if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ echo "${DESTDIR}/$${file}"; \ fi; \ + for ext in debug symbols; do \ + if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \ + echo "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}"; \ + fi; \ + done; \ done delete-old-dirs: From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 11:01:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DAF2896; Thu, 24 Oct 2013 11:01:02 +0000 (UTC) (envelope-from prvs=1009ce2dcc=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2E5832387; Thu, 24 Oct 2013 11:01:01 +0000 (UTC) Received: from r2d2 ([82.69.141.170]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50006493677.msg; Thu, 24 Oct 2013 12:00:53 +0100 X-Spam-Processed: mail1.multiplay.co.uk, Thu, 24 Oct 2013 12:00:53 +0100 (not processed: message from valid local sender) X-MDDKIM-Result: neutral (mail1.multiplay.co.uk) X-MDRemoteIP: 82.69.141.170 X-Return-Path: prvs=1009ce2dcc=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk Message-ID: <062D17FCE7E44812812E249D864EF0DA@multiplay.co.uk> From: "Steven Hartland" To: "Slawa Olhovchenkov" References: <201310230954.r9N9sxAZ011750@svn.freebsd.org> <20131024102118.GA59011@zxy.spb.ru> Subject: Re: svn commit: r256956 - in head/sys: cam/ata cam/scsi cddl/contrib/opensolaris/uts/common/fs/zfs cddl/contrib/opensolaris/uts/common/fs/zfs/sys geom sys Date: Thu, 24 Oct 2013 12:00:54 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 11:01:02 -0000 Not familiar with that option, but having a quick look in src it doesn't seem to be FS specific, seems to be handled by vfs. Can anyone confirm or deny this? ----- Original Message ----- From: "Slawa Olhovchenkov" > On Wed, Oct 23, 2013 at 09:54:59AM +0000, Steven Hartland wrote: > >> Author: smh >> Date: Wed Oct 23 09:54:58 2013 >> New Revision: 256956 >> URL: http://svnweb.freebsd.org/changeset/base/256956 >> >> Log: >> Improve ZFS N-way mirror read performance by using load and locality >> information. > > What about support F_READAHEAD in ZFS (with prefetch disabled by > CPU-intensive)? > ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk. From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 11:20:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0588CE98; Thu, 24 Oct 2013 11:20:23 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id B7A29251E; Thu, 24 Oct 2013 11:20:22 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1VZIzd-000GKj-23; Thu, 24 Oct 2013 15:22:21 +0400 Date: Thu, 24 Oct 2013 15:22:21 +0400 From: Slawa Olhovchenkov To: Steven Hartland Subject: Re: svn commit: r256956 - in head/sys: cam/ata cam/scsi cddl/contrib/opensolaris/uts/common/fs/zfs cddl/contrib/opensolaris/uts/common/fs/zfs/sys geom sys Message-ID: <20131024112221.GY63359@zxy.spb.ru> References: <201310230954.r9N9sxAZ011750@svn.freebsd.org> <20131024102118.GA59011@zxy.spb.ru> <062D17FCE7E44812812E249D864EF0DA@multiplay.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <062D17FCE7E44812812E249D864EF0DA@multiplay.co.uk> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 11:20:23 -0000 On Thu, Oct 24, 2013 at 12:00:54PM +0100, Steven Hartland wrote: > Not familiar with that option, but having a quick look in src > it doesn't seem to be FS specific, seems to be handled by vfs. VFS set options include this (in high bits). This options next passed to FS code (.vop_read = zfs_freebsd_read), in FS(zfs) code options filtered: return (zfs_read(ap->a_vp, ap->a_uio, ioflags(ap->a_ioflag), ap->a_cred, NULL)); ioflags(int ioflags) { int flags = 0; if (ioflags & IO_APPEND) flags |= FAPPEND; if (ioflags & IO_NDELAY) flags |= FNONBLOCK; if (ioflags & IO_SYNC) flags |= (FSYNC | FDSYNC | FRSYNC); return (flags); } and we lost FRDAHEAD/ADVISE hints, IO_DIRECT, IO_INVAL and so. > Can anyone confirm or deny this? > > ----- Original Message ----- > From: "Slawa Olhovchenkov" > > > > On Wed, Oct 23, 2013 at 09:54:59AM +0000, Steven Hartland wrote: > > > >> Author: smh > >> Date: Wed Oct 23 09:54:58 2013 > >> New Revision: 256956 > >> URL: http://svnweb.freebsd.org/changeset/base/256956 > >> > >> Log: > >> Improve ZFS N-way mirror read performance by using load and locality > >> information. > > > > What about support F_READAHEAD in ZFS (with prefetch disabled by > > CPU-intensive)? > > > > ================================================ > This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. > > In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 > or return the E.mail to postmaster@multiplay.co.uk. > From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 11:35:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D9D5EDF2; Thu, 24 Oct 2013 11:35:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C77E22665; Thu, 24 Oct 2013 11:35:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OBZoaJ043194; Thu, 24 Oct 2013 11:35:50 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OBZo8M043193; Thu, 24 Oct 2013 11:35:50 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310241135.r9OBZo8M043193@svn.freebsd.org> From: Bryan Drewery Date: Thu, 24 Oct 2013 11:35:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257053 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 11:35:50 -0000 Author: bdrewery (ports committer) Date: Thu Oct 24 11:35:50 2013 New Revision: 257053 URL: http://svnweb.freebsd.org/changeset/base/257053 Log: MFC r256842: Fix 'make delete-old-libs' and 'make check-libs' to delete .debug files created by WITH_DEBUG_FILES. Also cleanup .symbols files from the period between r244236 when .symbols were supported and r251512 when they were renamed to .debug. Only propose to delete a .debug file if the corresponding library itself was deleted already. Approved by: bapt Approved by: re (glebius) Modified: stable/10/Makefile.inc1 (contents, props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Thu Oct 24 10:53:35 2013 (r257052) +++ stable/10/Makefile.inc1 Thu Oct 24 11:35:50 2013 (r257053) @@ -1722,6 +1722,13 @@ delete-old-libs: chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ rm ${RM_I} "${DESTDIR}/$${file}" <&3; \ fi; \ + for ext in debug symbols; do \ + if ! [ -e "${DESTDIR}/$${file}" ] && [ -f \ + "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \ + rm ${RM_I} "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" \ + <&3; \ + fi; \ + done; \ done @echo ">>> Old libraries removed" @@ -1733,6 +1740,11 @@ check-old-libs: if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ echo "${DESTDIR}/$${file}"; \ fi; \ + for ext in debug symbols; do \ + if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \ + echo "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}"; \ + fi; \ + done; \ done delete-old-dirs: From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 14:05:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 864BCD05; Thu, 24 Oct 2013 14:05:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 71049207A; Thu, 24 Oct 2013 14:05:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OE5jtp093173; Thu, 24 Oct 2013 14:05:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OE5jEE093171; Thu, 24 Oct 2013 14:05:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310241405.r9OE5jEE093171@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 Oct 2013 14:05:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257054 - in head/sys/cam: ata scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 14:05:45 -0000 Author: mav Date: Thu Oct 24 14:05:44 2013 New Revision: 257054 URL: http://svnweb.freebsd.org/changeset/base/257054 Log: Some microoptimizations for da and ada drivers: - Replace ordered_tag_count counter with single flag; - From da remove outstanding_cmds counter, duplicating pending_ccbs list; - From da_softc remove unused links field. Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Thu Oct 24 11:35:50 2013 (r257053) +++ head/sys/cam/ata/ata_da.c Thu Oct 24 14:05:44 2013 (r257054) @@ -80,7 +80,7 @@ typedef enum { ADA_FLAG_CAN_NCQ = 0x0008, ADA_FLAG_CAN_DMA = 0x0010, ADA_FLAG_NEED_OTAG = 0x0020, - ADA_FLAG_WENT_IDLE = 0x0040, + ADA_FLAG_WAS_OTAG = 0x0040, ADA_FLAG_CAN_TRIM = 0x0080, ADA_FLAG_OPEN = 0x0100, ADA_FLAG_SCTX_INIT = 0x0200, @@ -130,12 +130,12 @@ struct trim_request { struct ada_softc { struct bio_queue_head bio_queue; struct bio_queue_head trim_queue; + int outstanding_cmds; /* Number of active commands */ + int refcount; /* Active xpt_action() calls */ ada_state state; - ada_flags flags; + ada_flags flags; ada_quirks quirks; int sort_io_queue; - int ordered_tag_count; - int outstanding_cmds; int trim_max_ranges; int trim_running; int read_ahead; @@ -153,7 +153,6 @@ struct ada_softc { struct sysctl_oid *sysctl_tree; struct callout sendordered_c; struct trim_request trim_req; - int refcount; }; struct ada_quirk_entry { @@ -1489,7 +1488,7 @@ adastart(struct cam_periph *periph, unio if ((bp->bio_flags & BIO_ORDERED) != 0 || (softc->flags & ADA_FLAG_NEED_OTAG) != 0) { softc->flags &= ~ADA_FLAG_NEED_OTAG; - softc->ordered_tag_count++; + softc->flags |= ADA_FLAG_WAS_OTAG; tag_code = 0; } else { tag_code = 1; @@ -1743,7 +1742,7 @@ adadone(struct cam_periph *periph, union } softc->outstanding_cmds--; if (softc->outstanding_cmds == 0) - softc->flags |= ADA_FLAG_WENT_IDLE; + softc->flags |= ADA_FLAG_WAS_OTAG; xpt_release_ccb(done_ccb); if (state == ADA_CCB_TRIM) { TAILQ_HEAD(, bio) queue; @@ -1905,14 +1904,11 @@ adasendorderedtag(void *arg) struct ada_softc *softc = arg; if (ada_send_ordered) { - if ((softc->ordered_tag_count == 0) - && ((softc->flags & ADA_FLAG_WENT_IDLE) == 0)) { - softc->flags |= ADA_FLAG_NEED_OTAG; + if (softc->outstanding_cmds > 0) { + if ((softc->flags & ADA_FLAG_WAS_OTAG) == 0) + softc->flags |= ADA_FLAG_NEED_OTAG; + softc->flags &= ~ADA_FLAG_WAS_OTAG; } - if (softc->outstanding_cmds > 0) - softc->flags &= ~ADA_FLAG_WENT_IDLE; - - softc->ordered_tag_count = 0; } /* Queue us up again */ callout_reset(&softc->sendordered_c, Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Oct 24 11:35:50 2013 (r257053) +++ head/sys/cam/scsi/scsi_da.c Thu Oct 24 14:05:44 2013 (r257054) @@ -84,7 +84,7 @@ typedef enum { DA_FLAG_PACK_LOCKED = 0x004, DA_FLAG_PACK_REMOVABLE = 0x008, DA_FLAG_NEED_OTAG = 0x020, - DA_FLAG_WENT_IDLE = 0x040, + DA_FLAG_WAS_OTAG = 0x040, DA_FLAG_RETRY_UA = 0x080, DA_FLAG_OPEN = 0x100, DA_FLAG_SCTX_INIT = 0x200, @@ -198,19 +198,17 @@ struct da_softc { struct bio_queue_head bio_queue; struct bio_queue_head delete_queue; struct bio_queue_head delete_run_queue; - SLIST_ENTRY(da_softc) links; LIST_HEAD(, ccb_hdr) pending_ccbs; + int tur; /* TEST UNIT READY should be sent */ + int refcount; /* Active xpt_action() calls */ da_state state; da_flags flags; da_quirks quirks; int sort_io_queue; int minimum_cmd_size; int error_inject; - int ordered_tag_count; - int outstanding_cmds; int trim_max_ranges; int delete_running; - int tur; int delete_available; /* Delete methods possibly available */ uint32_t unmap_max_ranges; uint32_t unmap_max_lba; @@ -228,7 +226,6 @@ struct da_softc { uint8_t unmap_buf[UNMAP_BUF_SIZE]; struct scsi_read_capacity_data_long rcaplong; struct callout mediapoll_c; - int refcount; }; #define dadeleteflag(softc, delete_method, enable) \ @@ -2244,7 +2241,7 @@ skipstate: if ((bp->bio_flags & BIO_ORDERED) != 0 || (softc->flags & DA_FLAG_NEED_OTAG) != 0) { softc->flags &= ~DA_FLAG_NEED_OTAG; - softc->ordered_tag_count++; + softc->flags |= DA_FLAG_WAS_OTAG; tag_code = MSG_ORDERED_Q_TAG; } else { tag_code = MSG_SIMPLE_Q_TAG; @@ -2297,13 +2294,8 @@ skipstate: start_ccb->ccb_h.flags |= CAM_UNLOCKED; out: - /* - * Block out any asynchronous callbacks - * while we touch the pending ccb list. - */ LIST_INSERT_HEAD(&softc->pending_ccbs, &start_ccb->ccb_h, periph_links.le); - softc->outstanding_cmds++; /* We expect a unit attention from this device */ if ((softc->flags & DA_FLAG_RETRY_UA) != 0) { @@ -2969,14 +2961,9 @@ dadone(struct cam_periph *periph, union } } - /* - * Block out any asynchronous callbacks - * while we touch the pending ccb list. - */ LIST_REMOVE(&done_ccb->ccb_h, periph_links.le); - softc->outstanding_cmds--; - if (softc->outstanding_cmds == 0) - softc->flags |= DA_FLAG_WENT_IDLE; + if (LIST_EMPTY(&softc->pending_ccbs)) + softc->flags |= DA_FLAG_WAS_OTAG; xpt_release_ccb(done_ccb); if (state == DA_CCB_DELETE) { @@ -3583,7 +3570,7 @@ damediapoll(void *arg) struct cam_periph *periph = arg; struct da_softc *softc = periph->softc; - if (!softc->tur && softc->outstanding_cmds == 0) { + if (!softc->tur && LIST_EMPTY(&softc->pending_ccbs)) { if (cam_periph_acquire(periph) == CAM_REQ_CMP) { softc->tur = 1; daschedule(periph); @@ -3755,14 +3742,11 @@ dasendorderedtag(void *arg) struct da_softc *softc = arg; if (da_send_ordered) { - if ((softc->ordered_tag_count == 0) - && ((softc->flags & DA_FLAG_WENT_IDLE) == 0)) { - softc->flags |= DA_FLAG_NEED_OTAG; + if (!LIST_EMPTY(&softc->pending_ccbs)) { + if ((softc->flags & DA_FLAG_WAS_OTAG) == 0) + softc->flags |= DA_FLAG_NEED_OTAG; + softc->flags &= ~DA_FLAG_WAS_OTAG; } - if (softc->outstanding_cmds > 0) - softc->flags &= ~DA_FLAG_WENT_IDLE; - - softc->ordered_tag_count = 0; } /* Queue us up again */ callout_reset(&softc->sendordered_c, From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 14:15:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 215CAE1; Thu, 24 Oct 2013 14:15:06 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0E9712105; Thu, 24 Oct 2013 14:15:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OEF58w096761; Thu, 24 Oct 2013 14:15:05 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OEF5dh096760; Thu, 24 Oct 2013 14:15:05 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310241415.r9OEF5dh096760@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 24 Oct 2013 14:15:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257055 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 14:15:06 -0000 Author: nwhitehorn Date: Thu Oct 24 14:15:05 2013 New Revision: 257055 URL: http://svnweb.freebsd.org/changeset/base/257055 Log: interrupt-parent and #interrupt-cells are written to the tree using encode-int. Modified: head/sys/dev/ofw/ofw_nexus.c Modified: head/sys/dev/ofw/ofw_nexus.c ============================================================================== --- head/sys/dev/ofw/ofw_nexus.c Thu Oct 24 14:05:44 2013 (r257054) +++ head/sys/dev/ofw/ofw_nexus.c Thu Oct 24 14:15:05 2013 (r257055) @@ -471,9 +471,9 @@ nexus_setup_dinfo(device_t dev, phandle_ (void **)&intr); if (nintr > 0) { iparent = 0; - OF_searchprop(node, "interrupt-parent", &iparent, + OF_searchencprop(node, "interrupt-parent", &iparent, sizeof(iparent)); - OF_searchprop(iparent, "#interrupt-cells", &icells, + OF_searchencprop(iparent, "#interrupt-cells", &icells, sizeof(icells)); for (i = 0; i < nintr; i+= icells) { intr[i] = ofw_bus_map_intr(dev, iparent, intr[i]); From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 14:40:03 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AD8E3854 for ; Thu, 24 Oct 2013 14:40:03 +0000 (UTC) (envelope-from Hilko.Meyer@gmx.de) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4846922CF for ; Thu, 24 Oct 2013 14:40:02 +0000 (UTC) Received: from schrein.Speedport_W_700V ([93.200.253.129]) by mail.gmx.com (mrgmx003) with ESMTPA (Nemesis) id 0M70HF-1VwN533zOf-00wpHT for ; Thu, 24 Oct 2013 16:40:01 +0200 From: Hilko Meyer To: Andrey Zonov Subject: Re: svn commit: r256710 - head/tools/build/mk Date: Thu, 24 Oct 2013 16:39:59 +0200 Message-ID: <7pbi69h9bdfg71q981dod40ldap329n73s@mail.gmx.net> References: <201310172200.r9HM0ZFM072006__34950.8864027031$1382047250$gmane$org@svn.freebsd.org> <97l269dokal3obs07tc792auspk1e0j0nj@4ax.com> <526824E2.6000309@FreeBSD.org> In-Reply-To: <526824E2.6000309@FreeBSD.org> X-Mailer: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K0:Ef97p0o9ltBpY0XaQQ3L3vQsO5L/INDtcMgN2QKLRpfACSCF2vw F1Vv4Pvkbj4I5qKtdoJNdNczyv+Q16ne/RqhgnvbS+0TItMPs7gsx4cSfSxXUFYLOxesNb9 nEfPDM0MKfuOLuG9pG0+kO/J+Ot9A/rmRbcaucFWMl71LaCBDG57cntfjFIUFznnFMBJ2Gy z7ZP6/ctN1CLFoQt5bnMQ== Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 14:40:03 -0000 Andrey Zonov schrieb: >On 10/18/13 8:38 AM, Hilko Meyer wrote: >> On Thu, 17 Oct 2013 22:00:35 +0000 (UTC) you wrote: >>> Author: zont >>> Date: Thu Oct 17 22:00:35 2013 >>> New Revision: 256710 >>> URL: http://svnweb.freebsd.org/changeset/base/256710 >>> >>> Modified: >>> head/tools/build/mk/OptionalObsoleteFiles.inc >>=20 >> This fixed two files I reported in conf/167133.2. Maybe you can look = for the >> other four and close the PR. > >pccard.conf - is already in ObsoleteFiles.inc. >pf.conf - we cannot just put it in ObsoleteFiles.inc because people may >have working configuration in this place. Maybe put it under .if ${MK_PF} =3D=3D no like usr/share/examples/pf/pf.conf? >usr/share/examples/netgraph/bluetooth - it was missed to remove when >example file inside was removed in 2007. >usr/share/examples/iscsi - never used since was added in 2007. > >I'll commit attached patch if no objections will be met. Ok From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 15:00:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E27F9D9A; Thu, 24 Oct 2013 15:00:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D047423D4; Thu, 24 Oct 2013 15:00:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OF0JID010654; Thu, 24 Oct 2013 15:00:19 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OF0JH8010653; Thu, 24 Oct 2013 15:00:19 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310241500.r9OF0JH8010653@svn.freebsd.org> From: Glen Barber Date: Thu, 24 Oct 2013 15:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257056 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 15:00:20 -0000 Author: gjb Date: Thu Oct 24 15:00:19 2013 New Revision: 257056 URL: http://svnweb.freebsd.org/changeset/base/257056 Log: Revert r256921 to prevent error output when in the wrong directory. This should have been reverted with the stable/10/Makefile.inc1 revert, but apparently my commit did not go through. Discussed with: cperciva (originally) Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Oct 24 14:15:05 2013 (r257055) +++ head/Makefile.inc1 Thu Oct 24 15:00:19 2013 (r257056) @@ -128,11 +128,8 @@ OSRELDATE= 0 .endif .if !defined(VERSION) -REVISION!= make -C ${.CURDIR}/release -V REVISION -BRANCH!= make -C ${.CURDIR}/release -V BRANCH -SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ - ${.CURDIR}/sys/sys/param.h -VERSION= FreeBSD ${REVISION}-${BRANCH} ${TARGET_ARCH} ${SRCRELDATE} +VERSION!= uname -srp +VERSION+= ${OSRELDATE} .endif KNOWN_ARCHES?= amd64 arm armeb/arm armv6/arm i386 i386/pc98 ia64 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64 From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 15:11:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 24FC62F6; Thu, 24 Oct 2013 15:11:31 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EC1F32492; Thu, 24 Oct 2013 15:11:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OFBUaP016644; Thu, 24 Oct 2013 15:11:30 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OFBUlU016643; Thu, 24 Oct 2013 15:11:30 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310241511.r9OFBUlU016643@svn.freebsd.org> From: Brooks Davis Date: Thu, 24 Oct 2013 15:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257057 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 15:11:31 -0000 Author: brooks Date: Thu Oct 24 15:11:30 2013 New Revision: 257057 URL: http://svnweb.freebsd.org/changeset/base/257057 Log: Regenerate documentation post r256915: Stop conflating WITHOUT_CLANG with WITHOUT_CLANG_IS_CC. This allows bootstrapping a copy of clang without building clang for the base system which is useful for nanobsd and similar setups. It's still probably wrong to conflate what is installed as /usr/bin/cc with the selection of a bootstrap compiler under WITH*_CLANG_IS_CC, but that's for another day. Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Thu Oct 24 15:00:19 2013 (r257056) +++ head/share/man/man5/src.conf.5 Thu Oct 24 15:11:30 2013 (r257057) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd October 6, 2013 +.Dd October 24, 2013 .Dt SRC.CONF 5 .Os .Sh NAME @@ -208,10 +208,6 @@ When set, it also enforces the following .Va WITHOUT_CLANG_EXTRAS .It .Va WITHOUT_CLANG_FULL -.It -.Va WITHOUT_CLANG_IS_CC -.It -.Va WITHOUT_LLDB .El .It Va WITH_CLANG .\" from FreeBSD: head/tools/build/options/WITH_CLANG 221730 2011-05-10 11:14:40Z ru @@ -323,11 +319,7 @@ When set, it also enforces the following .It .Va WITHOUT_CLANG_FULL .It -.Va WITHOUT_CLANG_IS_CC -.It .Va WITHOUT_GROFF -.It -.Va WITHOUT_LLDB .El .It Va WITH_DEBUG_FILES .\" from FreeBSD: head/tools/build/options/WITH_DEBUG_FILES 251512 2013-06-07 21:40:02Z emaste @@ -910,7 +902,7 @@ This includes .Xr rsh 1 , etc. .It Va WITHOUT_RCS -.\" from FreeBSD: head/tools/build/options/WITHOUT_RCS 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_RCS 256198 2013-10-09 17:07:20Z gjb Set to not build .Xr rcs 1 and related utilities. @@ -1030,13 +1022,9 @@ When set, it also enforces the following .It .Va WITHOUT_CLANG_FULL .It -.Va WITHOUT_CLANG_IS_CC -.It .Va WITHOUT_GCC .It .Va WITHOUT_GDB -.It -.Va WITHOUT_LLDB .El .It Va WITHOUT_UNBOUND .\" from FreeBSD: head/tools/build/options/WITHOUT_UNBOUND 255597 2013-09-15 14:51:23Z des From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 15:21:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 51EC29A7; Thu, 24 Oct 2013 15:21:21 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3E40A2538; Thu, 24 Oct 2013 15:21:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OFLLfb020323; Thu, 24 Oct 2013 15:21:21 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OFLLYW020322; Thu, 24 Oct 2013 15:21:21 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201310241521.r9OFLLYW020322@svn.freebsd.org> From: Steven Hartland Date: Thu, 24 Oct 2013 15:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257058 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 15:21:21 -0000 Author: smh Date: Thu Oct 24 15:21:20 2013 New Revision: 257058 URL: http://svnweb.freebsd.org/changeset/base/257058 Log: MFC r256889: Use the vdev's ashift to calculate the supported min block size passed to zio_compress_data(..) when compressing l2arc buffers. This eliminates L2ARC I/O errors, which resulted in very poor performance on vdev's configured with block size greater than 512b due to compression assuming a smaller min block size than the vdev supports. Approved by: re (glebius) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/10/sys/ (props changed) stable/10/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Oct 24 15:11:30 2013 (r257057) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Oct 24 15:21:20 2013 (r257058) @@ -5147,7 +5147,7 @@ l2arc_compress_buf(l2arc_buf_hdr_t *l2hd len = l2hdr->b_asize; cdata = zio_data_buf_alloc(len); csize = zio_compress_data(ZIO_COMPRESS_LZ4, l2hdr->b_tmp_cdata, - cdata, l2hdr->b_asize, (size_t)SPA_MINBLOCKSIZE); + cdata, l2hdr->b_asize, (size_t)(1ULL << l2hdr->b_dev->l2ad_vdev->vdev_ashift)); if (csize == 0) { /* zero block, indicate that there's nothing to write */ From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 15:37:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B9A791A9; Thu, 24 Oct 2013 15:37:33 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 99AD32649; Thu, 24 Oct 2013 15:37:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OFbXCG024235; Thu, 24 Oct 2013 15:37:33 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OFbWFv024226; Thu, 24 Oct 2013 15:37:32 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310241537.r9OFbWFv024226@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 24 Oct 2013 15:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257059 - in head/sys/powerpc: include mpc85xx ofw powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 15:37:33 -0000 Author: nwhitehorn Date: Thu Oct 24 15:37:32 2013 New Revision: 257059 URL: http://svnweb.freebsd.org/changeset/base/257059 Log: Allow PIC drivers to translate firmware sense codes for themselves. This is designed to replace the tables in dev/fdt/fdt_ARCH.c, but will not happen quite yet. Modified: head/sys/powerpc/include/intr_machdep.h head/sys/powerpc/mpc85xx/atpic.c head/sys/powerpc/ofw/openpic_ofw.c head/sys/powerpc/powerpc/intr_machdep.c head/sys/powerpc/powerpc/nexus.c head/sys/powerpc/powerpc/pic_if.m Modified: head/sys/powerpc/include/intr_machdep.h ============================================================================== --- head/sys/powerpc/include/intr_machdep.h Thu Oct 24 15:21:20 2013 (r257058) +++ head/sys/powerpc/include/intr_machdep.h Thu Oct 24 15:37:32 2013 (r257059) @@ -56,5 +56,6 @@ int powerpc_setup_intr(const char *, u_i int powerpc_teardown_intr(void *); int powerpc_bind_intr(u_int irq, u_char cpu); int powerpc_config_intr(int, enum intr_trigger, enum intr_polarity); +int powerpc_fw_config_intr(int irq, int sense_code); #endif /* _MACHINE_INTR_MACHDEP_H_ */ Modified: head/sys/powerpc/mpc85xx/atpic.c ============================================================================== --- head/sys/powerpc/mpc85xx/atpic.c Thu Oct 24 15:21:20 2013 (r257058) +++ head/sys/powerpc/mpc85xx/atpic.c Thu Oct 24 15:37:32 2013 (r257059) @@ -79,6 +79,9 @@ static void atpic_ipi(device_t, u_int); static void atpic_mask(device_t, u_int); static void atpic_unmask(device_t, u_int); +static void atpic_ofw_translate_code(device_t, u_int irq, int code, + enum intr_trigger *trig, enum intr_polarity *pol); + static device_method_t atpic_isa_methods[] = { /* Device interface */ DEVMETHOD(device_identify, atpic_isa_identify), @@ -94,6 +97,8 @@ static device_method_t atpic_isa_methods DEVMETHOD(pic_mask, atpic_mask), DEVMETHOD(pic_unmask, atpic_unmask), + DEVMETHOD(pic_translate_code, atpic_ofw_translate_code), + { 0, 0 }, }; @@ -325,3 +330,35 @@ atpic_unmask(device_t dev, u_int irq) atpic_write(sc, ATPIC_MASTER, 1, sc->sc_mask[ATPIC_MASTER]); } } + +static void +atpic_ofw_translate_code(device_t dev, u_int irq, int code, + enum intr_trigger *trig, enum intr_polarity *pol) +{ + switch (code) { + case 0: + /* Active L level */ + *trig = INTR_TRIGGER_LEVEL; + *pol = INTR_POLARITY_LOW; + break; + case 1: + /* Active H level */ + *trig = INTR_TRIGGER_LEVEL; + *pol = INTR_POLARITY_HIGH; + break; + case 2: + /* H to L edge */ + *trig = INTR_TRIGGER_EDGE; + *pol = INTR_POLARITY_LOW; + break; + case 3: + /* L to H edge */ + *trig = INTR_TRIGGER_EDGE; + *pol = INTR_POLARITY_HIGH; + break; + default: + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + } +} + Modified: head/sys/powerpc/ofw/openpic_ofw.c ============================================================================== --- head/sys/powerpc/ofw/openpic_ofw.c Thu Oct 24 15:21:20 2013 (r257058) +++ head/sys/powerpc/ofw/openpic_ofw.c Thu Oct 24 15:37:32 2013 (r257059) @@ -61,6 +61,9 @@ __FBSDID("$FreeBSD$"); static int openpic_ofw_probe(device_t); static int openpic_ofw_attach(device_t); +static void openpic_ofw_translate_code(device_t, u_int irq, int code, + enum intr_trigger *trig, enum intr_polarity *pol); + static device_method_t openpic_ofw_methods[] = { /* Device interface */ DEVMETHOD(device_probe, openpic_ofw_probe), @@ -76,6 +79,8 @@ static device_method_t openpic_ofw_meth DEVMETHOD(pic_mask, openpic_mask), DEVMETHOD(pic_unmask, openpic_unmask), + DEVMETHOD(pic_translate_code, openpic_ofw_translate_code), + DEVMETHOD_END }; @@ -127,3 +132,34 @@ openpic_ofw_attach(device_t dev) return (openpic_common_attach(dev, xref)); } +static void +openpic_ofw_translate_code(device_t dev, u_int irq, int code, + enum intr_trigger *trig, enum intr_polarity *pol) +{ + switch (code) { + case 0: + /* L to H edge */ + *trig = INTR_TRIGGER_EDGE; + *pol = INTR_POLARITY_HIGH; + break; + case 1: + /* Active L level */ + *trig = INTR_TRIGGER_LEVEL; + *pol = INTR_POLARITY_LOW; + break; + case 2: + /* Active H level */ + *trig = INTR_TRIGGER_LEVEL; + *pol = INTR_POLARITY_HIGH; + break; + case 3: + /* H to L edge */ + *trig = INTR_TRIGGER_EDGE; + *pol = INTR_POLARITY_LOW; + break; + default: + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + } +} + Modified: head/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/intr_machdep.c Thu Oct 24 15:21:20 2013 (r257058) +++ head/sys/powerpc/powerpc/intr_machdep.c Thu Oct 24 15:37:32 2013 (r257059) @@ -102,6 +102,7 @@ struct powerpc_intr { cpuset_t cpu; enum intr_trigger trig; enum intr_polarity pol; + int fwcode; }; struct pic { @@ -427,6 +428,9 @@ powerpc_enable_intr(void) if (error) continue; + if (i->trig == -1) + PIC_TRANSLATE_CODE(i->pic, i->intline, i->fwcode, + &i->trig, &i->pol); if (i->trig != INTR_TRIGGER_CONFORM || i->pol != INTR_POLARITY_CONFORM) PIC_CONFIG(i->pic, i->intline, i->trig, i->pol); @@ -469,15 +473,21 @@ powerpc_setup_intr(const char *name, u_i if (!cold) { error = powerpc_map_irq(i); - if (!error && (i->trig != INTR_TRIGGER_CONFORM || - i->pol != INTR_POLARITY_CONFORM)) - PIC_CONFIG(i->pic, i->intline, i->trig, i->pol); + if (!error) { + if (i->trig == -1) + PIC_TRANSLATE_CODE(i->pic, i->intline, + i->fwcode, &i->trig, &i->pol); + + if (i->trig != INTR_TRIGGER_CONFORM || + i->pol != INTR_POLARITY_CONFORM) + PIC_CONFIG(i->pic, i->intline, i->trig, i->pol); - if (!error && i->pic == root_pic) - PIC_BIND(i->pic, i->intline, i->cpu); + if (i->pic == root_pic) + PIC_BIND(i->pic, i->intline, i->cpu); - if (!error && enable) - PIC_ENABLE(i->pic, i->intline, i->vector); + if (enable) + PIC_ENABLE(i->pic, i->intline, i->vector); + } } return (error); } @@ -504,6 +514,28 @@ powerpc_bind_intr(u_int irq, u_char cpu) #endif int +powerpc_fw_config_intr(int irq, int sense_code) +{ + struct powerpc_intr *i; + + i = intr_lookup(irq); + if (i == NULL) + return (ENOMEM); + + i->trig = -1; + i->pol = INTR_POLARITY_CONFORM; + i->fwcode = sense_code; + + if (!cold && i->pic != NULL) { + PIC_TRANSLATE_CODE(i->pic, i->intline, i->fwcode, &i->trig, + &i->pol); + PIC_CONFIG(i->pic, i->intline, i->trig, i->pol); + } + + return (0); +} + +int powerpc_config_intr(int irq, enum intr_trigger trig, enum intr_polarity pol) { struct powerpc_intr *i; Modified: head/sys/powerpc/powerpc/nexus.c ============================================================================== --- head/sys/powerpc/powerpc/nexus.c Thu Oct 24 15:21:20 2013 (r257058) +++ head/sys/powerpc/powerpc/nexus.c Thu Oct 24 15:37:32 2013 (r257059) @@ -166,9 +166,7 @@ static int nexus_ofw_config_intr(device_t dev, device_t child, int irq, int sense) { - return (bus_generic_config_intr(child, irq, (sense & 1) ? - INTR_TRIGGER_LEVEL : INTR_TRIGGER_EDGE, - INTR_POLARITY_LOW)); + return (powerpc_fw_config_intr(irq, sense)); } static int Modified: head/sys/powerpc/powerpc/pic_if.m ============================================================================== --- head/sys/powerpc/powerpc/pic_if.m Thu Oct 24 15:21:20 2013 (r257058) +++ head/sys/powerpc/powerpc/pic_if.m Thu Oct 24 15:37:32 2013 (r257059) @@ -33,12 +33,31 @@ INTERFACE pic; +CODE { + static pic_translate_code_t pic_translate_code_default; + + static void pic_translate_code_default(device_t dev, u_int irq, + int code, enum intr_trigger *trig, enum intr_polarity *pol) + { + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + } +}; + METHOD void bind { device_t dev; u_int irq; cpuset_t cpumask; }; +METHOD void translate_code { + device_t dev; + u_int irq; + int code; + enum intr_trigger *trig; + enum intr_polarity *pol; +} DEFAULT pic_translate_code_default; + METHOD void config { device_t dev; u_int irq; From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 15:44:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F3EE54A1; Thu, 24 Oct 2013 15:44:29 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E0F0226BC; Thu, 24 Oct 2013 15:44:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OFiTNM027274; Thu, 24 Oct 2013 15:44:29 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OFiTOO027273; Thu, 24 Oct 2013 15:44:29 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310241544.r9OFiTOO027273@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 24 Oct 2013 15:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257060 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 15:44:30 -0000 Author: nwhitehorn Date: Thu Oct 24 15:44:29 2013 New Revision: 257060 URL: http://svnweb.freebsd.org/changeset/base/257060 Log: Do not map IRQs twice. This fixes PowerPC/FDT systems with multiple PICs, which would try to treat the previously-mapped interrupts from fdt_decode_intr() as interrupt line numbers on the same parent PIC. Modified: head/sys/dev/fdt/fdt_common.c Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Thu Oct 24 15:37:32 2013 (r257059) +++ head/sys/dev/fdt/fdt_common.c Thu Oct 24 15:44:29 2013 (r257060) @@ -514,7 +514,7 @@ fdt_intr_to_rl(phandle_t node, struct re pcell_t *intr; pcell_t intr_cells; int interrupt, trig, pol; - int i, intr_num, irq, rv; + int i, intr_num, rv; if (OF_getproplen(node, "interrupts") <= 0) /* Node does not have 'interrupts' property. */ @@ -566,8 +566,7 @@ fdt_intr_to_rl(phandle_t node, struct re intr_sl[i].trig = trig; intr_sl[i].pol = pol; - irq = FDT_MAP_IRQ(iph, interrupt); - resource_list_add(rl, SYS_RES_IRQ, i, irq, irq, 1); + resource_list_add(rl, SYS_RES_IRQ, i, interrupt, interrupt, 1); } out: From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 15:54:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D5E609F0; Thu, 24 Oct 2013 15:54:06 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C325C2772; Thu, 24 Oct 2013 15:54:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OFs63A030493; Thu, 24 Oct 2013 15:54:06 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OFs6jm030492; Thu, 24 Oct 2013 15:54:06 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310241554.r9OFs6jm030492@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 24 Oct 2013 15:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257061 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 15:54:06 -0000 Author: trasz Date: Thu Oct 24 15:54:06 2013 New Revision: 257061 URL: http://svnweb.freebsd.org/changeset/base/257061 Log: Don't spin with mutex hold when there is not enough room in the send socket buffer. While here, make the code flow somewhat nicer. Thanks to mav@ for tracking it down. Tested by: mav MFC after: 3 days Sponsored by: FreeBSD Foundation Modified: head/sys/dev/iscsi/icl.c Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Thu Oct 24 15:44:29 2013 (r257060) +++ head/sys/dev/iscsi/icl.c Thu Oct 24 15:54:06 2013 (r257061) @@ -723,11 +723,7 @@ icl_receive_thread(void *arg) for (;;) { if (ic->ic_disconnecting) { //ICL_DEBUG("terminating"); - ICL_CONN_LOCK(ic); - ic->ic_receive_running = false; - ICL_CONN_UNLOCK(ic); - kthread_exit(); - return; + break; } SOCKBUF_LOCK(&so->so_rcv); @@ -740,6 +736,11 @@ icl_receive_thread(void *arg) icl_conn_receive_pdus(ic, available); } + + ICL_CONN_LOCK(ic); + ic->ic_receive_running = false; + ICL_CONN_UNLOCK(ic); + kthread_exit(); } static int @@ -879,22 +880,19 @@ icl_send_thread(void *arg) ICL_CONN_LOCK(ic); ic->ic_send_running = true; - ICL_CONN_UNLOCK(ic); for (;;) { - ICL_CONN_LOCK(ic); if (ic->ic_disconnecting) { //ICL_DEBUG("terminating"); - ic->ic_send_running = false; - ICL_CONN_UNLOCK(ic); - kthread_exit(); - return; + break; } - if (TAILQ_EMPTY(&ic->ic_to_send)) - cv_wait(&ic->ic_send_cv, &ic->ic_lock); icl_conn_send_pdus(ic); - ICL_CONN_UNLOCK(ic); + cv_wait(&ic->ic_send_cv, &ic->ic_lock); } + + ic->ic_send_running = false; + ICL_CONN_UNLOCK(ic); + kthread_exit(); } static int From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 16:27:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8CF9A51C; Thu, 24 Oct 2013 16:27:34 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7913A29AF; Thu, 24 Oct 2013 16:27:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OGRYsn041224; Thu, 24 Oct 2013 16:27:34 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OGRXr8041218; Thu, 24 Oct 2013 16:27:33 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201310241627.r9OGRXr8041218@svn.freebsd.org> From: Luiz Otavio O Souza Date: Thu, 24 Oct 2013 16:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257062 - in head/sys: arm/broadcom/bcm2835 arm/conf boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 16:27:34 -0000 Author: loos Date: Thu Oct 24 16:27:33 2013 New Revision: 257062 URL: http://svnweb.freebsd.org/changeset/base/257062 Log: Add the Raspberry Pi SPI controller driver. Reviewed by: rpaulo Approved by: adrian (mentor) Added: head/sys/arm/broadcom/bcm2835/bcm2835_spi.c (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2835_spireg.h (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2835_spivar.h (contents, props changed) Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 head/sys/arm/conf/RPI-B head/sys/boot/fdt/dts/bcm2835.dtsi Added: head/sys/arm/broadcom/bcm2835/bcm2835_spi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2835_spi.c Thu Oct 24 16:27:33 2013 (r257062) @@ -0,0 +1,521 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2013 Luiz Otavio O Souza + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "spibus_if.h" + +static void bcm_spi_intr(void *); + +#ifdef BCM_SPI_DEBUG +static void +bcm_spi_printr(device_t dev) +{ + struct bcm_spi_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + reg = BCM_SPI_READ(sc, SPI_CS); + device_printf(dev, "CS=%b\n", reg, + "\20\1CS0\2CS1\3CPHA\4CPOL\7CSPOL" + "\10TA\11DMAEN\12INTD\13INTR\14ADCS\15REN\16LEN" + "\21DONE\22RXD\23TXD\24RXR\25RXF\26CSPOL0\27CSPOL1" + "\30CSPOL2\31DMA_LEN\32LEN_LONG"); + reg = BCM_SPI_READ(sc, SPI_CLK) & SPI_CLK_MASK; + if (reg % 2) + reg--; + if (reg == 0) + reg = 65536; + device_printf(dev, "CLK=%uMhz/%d=%luhz\n", + SPI_CORE_CLK / 1000000, reg, SPI_CORE_CLK / reg); + reg = BCM_SPI_READ(sc, SPI_DLEN) & SPI_DLEN_MASK; + device_printf(dev, "DLEN=%d\n", reg); + reg = BCM_SPI_READ(sc, SPI_LTOH) & SPI_LTOH_MASK; + device_printf(dev, "LTOH=%d\n", reg); + reg = BCM_SPI_READ(sc, SPI_DC); + device_printf(dev, "DC=RPANIC=%#x RDREQ=%#x TPANIC=%#x TDREQ=%#x\n", + (reg & SPI_DC_RPANIC_MASK) >> SPI_DC_RPANIC_SHIFT, + (reg & SPI_DC_RDREQ_MASK) >> SPI_DC_RDREQ_SHIFT, + (reg & SPI_DC_TPANIC_MASK) >> SPI_DC_TPANIC_SHIFT, + (reg & SPI_DC_TDREQ_MASK) >> SPI_DC_TDREQ_SHIFT); +} +#endif + +static void +bcm_spi_modifyreg(struct bcm_spi_softc *sc, uint32_t off, uint32_t mask, + uint32_t value) +{ + uint32_t reg; + + mtx_assert(&sc->sc_mtx, MA_OWNED); + reg = BCM_SPI_READ(sc, off); + reg &= ~mask; + reg |= value; + BCM_SPI_WRITE(sc, off, reg); +} + +static int +bcm_spi_clock_proc(SYSCTL_HANDLER_ARGS) +{ + struct bcm_spi_softc *sc; + uint32_t clk; + int error; + + sc = (struct bcm_spi_softc *)arg1; + + BCM_SPI_LOCK(sc); + clk = BCM_SPI_READ(sc, SPI_CLK); + BCM_SPI_UNLOCK(sc); + clk &= 0xffff; + if (clk == 0) + clk = 65536; + clk = SPI_CORE_CLK / clk; + + error = sysctl_handle_int(oidp, &clk, sizeof(clk), req); + if (error != 0 || req->newptr == NULL) + return (error); + + clk = SPI_CORE_CLK / clk; + if (clk <= 1) + clk = 2; + else if (clk % 2) + clk--; + if (clk > 0xffff) + clk = 0; + BCM_SPI_LOCK(sc); + BCM_SPI_WRITE(sc, SPI_CLK, clk); + BCM_SPI_UNLOCK(sc); + + return (0); +} + +static int +bcm_spi_cs_bit_proc(SYSCTL_HANDLER_ARGS, uint32_t bit) +{ + struct bcm_spi_softc *sc; + uint32_t reg; + int error; + + sc = (struct bcm_spi_softc *)arg1; + BCM_SPI_LOCK(sc); + reg = BCM_SPI_READ(sc, SPI_CS); + BCM_SPI_UNLOCK(sc); + reg = (reg & bit) ? 1 : 0; + + error = sysctl_handle_int(oidp, ®, sizeof(reg), req); + if (error != 0 || req->newptr == NULL) + return (error); + + if (reg) + reg = bit; + BCM_SPI_LOCK(sc); + bcm_spi_modifyreg(sc, SPI_CS, bit, reg); + BCM_SPI_UNLOCK(sc); + + return (0); +} + +static int +bcm_spi_cpol_proc(SYSCTL_HANDLER_ARGS) +{ + + return (bcm_spi_cs_bit_proc(oidp, arg1, arg2, req, SPI_CS_CPOL)); +} + +static int +bcm_spi_cpha_proc(SYSCTL_HANDLER_ARGS) +{ + + return (bcm_spi_cs_bit_proc(oidp, arg1, arg2, req, SPI_CS_CPHA)); +} + +static int +bcm_spi_cspol0_proc(SYSCTL_HANDLER_ARGS) +{ + + return (bcm_spi_cs_bit_proc(oidp, arg1, arg2, req, SPI_CS_CSPOL0)); +} + +static int +bcm_spi_cspol1_proc(SYSCTL_HANDLER_ARGS) +{ + + return (bcm_spi_cs_bit_proc(oidp, arg1, arg2, req, SPI_CS_CSPOL1)); +} + +static void +bcm_spi_sysctl_init(struct bcm_spi_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree_node; + struct sysctl_oid_list *tree; + + /* + * Add system sysctl tree/handlers. + */ + ctx = device_get_sysctl_ctx(sc->sc_dev); + tree_node = device_get_sysctl_tree(sc->sc_dev); + tree = SYSCTL_CHILDREN(tree_node); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "clock", + CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + bcm_spi_clock_proc, "IU", "SPI BUS clock frequency"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "cpol", + CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + bcm_spi_cpol_proc, "IU", "SPI BUS clock polarity"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "cpha", + CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + bcm_spi_cpha_proc, "IU", "SPI BUS clock phase"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "cspol0", + CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + bcm_spi_cspol0_proc, "IU", "SPI BUS chip select 0 polarity"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "cspol1", + CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + bcm_spi_cspol1_proc, "IU", "SPI BUS chip select 1 polarity"); +} + +static int +bcm_spi_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-spi")) + return (ENXIO); + + device_set_desc(dev, "BCM2708/2835 SPI controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +bcm_spi_attach(device_t dev) +{ + struct bcm_spi_softc *sc; + device_t gpio; + int i, rid; + + if (device_get_unit(dev) != 0) { + device_printf(dev, "only one SPI controller supported\n"); + return (ENXIO); + } + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + /* Configure the GPIO pins to ALT0 function to enable SPI the pins. */ + gpio = devclass_get_device(devclass_find("gpio"), 0); + if (!gpio) { + device_printf(dev, "cannot find gpio0\n"); + return (ENXIO); + } + for (i = 0; i < nitems(bcm_spi_pins); i++) + bcm_gpio_set_alternate(gpio, bcm_spi_pins[i], BCM_GPIO_ALT0); + + rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_mem_res) { + device_printf(dev, "cannot allocate memory window\n"); + return (ENXIO); + } + + sc->sc_bst = rman_get_bustag(sc->sc_mem_res); + sc->sc_bsh = rman_get_bushandle(sc->sc_mem_res); + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (!sc->sc_irq_res) { + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + device_printf(dev, "cannot allocate interrupt\n"); + return (ENXIO); + } + + /* Hook up our interrupt handler. */ + if (bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, bcm_spi_intr, sc, &sc->sc_intrhand)) { + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + device_printf(dev, "cannot setup the interrupt handler\n"); + return (ENXIO); + } + + mtx_init(&sc->sc_mtx, "bcm_spi", NULL, MTX_DEF); + + /* Add sysctl nodes. */ + bcm_spi_sysctl_init(sc); + +#ifdef BCM_SPI_DEBUG + bcm_spi_printr(dev); +#endif + + /* + * Enable the SPI controller. Clear the rx and tx FIFO. + * Defaults to SPI mode 0. + */ + BCM_SPI_WRITE(sc, SPI_CS, SPI_CS_CLEAR_RXFIFO | SPI_CS_CLEAR_TXFIFO); + + /* Set the SPI clock to 500Khz. */ + BCM_SPI_WRITE(sc, SPI_CLK, SPI_CORE_CLK / 500000); + +#ifdef BCM_SPI_DEBUG + bcm_spi_printr(dev); +#endif + + device_add_child(dev, "spibus", -1); + + return (bus_generic_attach(dev)); +} + +static int +bcm_spi_detach(device_t dev) +{ + struct bcm_spi_softc *sc; + + bus_generic_detach(dev); + + sc = device_get_softc(dev); + mtx_destroy(&sc->sc_mtx); + if (sc->sc_intrhand) + bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intrhand); + if (sc->sc_irq_res) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + if (sc->sc_mem_res) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + + return (0); +} + +static void +bcm_spi_fill_fifo(struct bcm_spi_softc *sc) +{ + struct spi_command *cmd; + uint32_t cs, written; + uint8_t *data; + + cmd = sc->sc_cmd; + cs = BCM_SPI_READ(sc, SPI_CS) & (SPI_CS_TA | SPI_CS_TXD); + while (sc->sc_written < sc->sc_len && + cs == (SPI_CS_TA | SPI_CS_TXD)) { + data = (uint8_t *)cmd->tx_cmd; + written = sc->sc_written++; + if (written >= cmd->tx_cmd_sz) { + data = (uint8_t *)cmd->tx_data; + written -= cmd->tx_cmd_sz; + } + BCM_SPI_WRITE(sc, SPI_FIFO, data[written]); + cs = BCM_SPI_READ(sc, SPI_CS) & (SPI_CS_TA | SPI_CS_TXD); + } +} + +static void +bcm_spi_drain_fifo(struct bcm_spi_softc *sc) +{ + struct spi_command *cmd; + uint32_t cs, read; + uint8_t *data; + + cmd = sc->sc_cmd; + cs = BCM_SPI_READ(sc, SPI_CS) & SPI_CS_RXD; + while (sc->sc_read < sc->sc_len && cs == SPI_CS_RXD) { + data = (uint8_t *)cmd->rx_cmd; + read = sc->sc_read++; + if (read >= cmd->rx_cmd_sz) { + data = (uint8_t *)cmd->rx_data; + read -= cmd->rx_cmd_sz; + } + data[read] = BCM_SPI_READ(sc, SPI_FIFO) & 0xff; + cs = BCM_SPI_READ(sc, SPI_CS) & SPI_CS_RXD; + } +} + +static void +bcm_spi_intr(void *arg) +{ + struct bcm_spi_softc *sc; + + sc = (struct bcm_spi_softc *)arg; + BCM_SPI_LOCK(sc); + + /* Filter stray interrupts. */ + if ((sc->sc_flags & BCM_SPI_BUSY) == 0) { + BCM_SPI_UNLOCK(sc); + return; + } + + /* TX - Fill up the FIFO. */ + bcm_spi_fill_fifo(sc); + + /* RX - Drain the FIFO. */ + bcm_spi_drain_fifo(sc); + + /* Check for end of transfer. */ + if (sc->sc_written == sc->sc_len && sc->sc_read == sc->sc_len) { + /* Disable interrupts and the SPI engine. */ + bcm_spi_modifyreg(sc, SPI_CS, + SPI_CS_TA | SPI_CS_INTR | SPI_CS_INTD, 0); + wakeup(sc->sc_dev); + } + + BCM_SPI_UNLOCK(sc); +} + +static int +bcm_spi_transfer(device_t dev, device_t child, struct spi_command *cmd) +{ + struct bcm_spi_softc *sc; + int cs, err; + + sc = device_get_softc(dev); + + KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz, + ("TX/RX command sizes should be equal")); + KASSERT(cmd->tx_data_sz == cmd->rx_data_sz, + ("TX/RX data sizes should be equal")); + + BCM_SPI_LOCK(sc); + + /* If the controller is in use wait until it is available. */ + while (sc->sc_flags & BCM_SPI_BUSY) + mtx_sleep(dev, &sc->sc_mtx, 0, "bcm_spi", 0); + + /* Now we have control over SPI controller. */ + sc->sc_flags = BCM_SPI_BUSY; + + /* Clear the FIFO. */ + bcm_spi_modifyreg(sc, SPI_CS, + SPI_CS_CLEAR_RXFIFO | SPI_CS_CLEAR_TXFIFO, + SPI_CS_CLEAR_RXFIFO | SPI_CS_CLEAR_TXFIFO); + + /* Get the proper chip select for this child. */ + spibus_get_cs(child, &cs); + if (cs < 0 || cs > 2) { + device_printf(dev, + "Invalid chip select %d requested by %s\n", cs, + device_get_nameunit(child)); + BCM_SPI_UNLOCK(sc); + return (EINVAL); + } + + /* Save a pointer to the SPI command. */ + sc->sc_cmd = cmd; + sc->sc_read = 0; + sc->sc_written = 0; + sc->sc_len = cmd->tx_cmd_sz + cmd->tx_data_sz; + + /* + * Set the CS for this transaction, enable interrupts and announce + * we're ready to tx. This will kick off the first interrupt. + */ + bcm_spi_modifyreg(sc, SPI_CS, + SPI_CS_MASK | SPI_CS_TA | SPI_CS_INTR | SPI_CS_INTD, + cs | SPI_CS_TA | SPI_CS_INTR | SPI_CS_INTD); + + /* Wait for the transaction to complete. */ + err = mtx_sleep(dev, &sc->sc_mtx, 0, "bcm_spi", hz * 2); + + /* Make sure the SPI engine and interrupts are disabled. */ + bcm_spi_modifyreg(sc, SPI_CS, SPI_CS_TA | SPI_CS_INTR | SPI_CS_INTD, 0); + + /* Clear the controller flags. */ + sc->sc_flags = 0; + + /* + * Check for transfer timeout. The SPI controller doesn't + * return errors. + */ + if (err == EWOULDBLOCK) { + device_printf(sc->sc_dev, "SPI error\n"); + err = EIO; + } + + BCM_SPI_UNLOCK(sc); + + return (err); +} + +static phandle_t +bcm_spi_get_node(device_t bus, device_t dev) +{ + + /* We only have one child, the SPI bus, which needs our own node. */ + return (ofw_bus_get_node(bus)); +} + +static device_method_t bcm_spi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, bcm_spi_probe), + DEVMETHOD(device_attach, bcm_spi_attach), + DEVMETHOD(device_detach, bcm_spi_detach), + + /* SPI interface */ + DEVMETHOD(spibus_transfer, bcm_spi_transfer), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, bcm_spi_get_node), + + DEVMETHOD_END +}; + +static devclass_t bcm_spi_devclass; + +static driver_t bcm_spi_driver = { + "spi", + bcm_spi_methods, + sizeof(struct bcm_spi_softc), +}; + +DRIVER_MODULE(bcm2835_spi, simplebus, bcm_spi_driver, bcm_spi_devclass, 0, 0); Added: head/sys/arm/broadcom/bcm2835/bcm2835_spireg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2835_spireg.h Thu Oct 24 16:27:33 2013 (r257062) @@ -0,0 +1,75 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2013 Luiz Otavio O Souza + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _BCM2835_SPIREG_H_ +#define _BCM2835_SPIREG_H_ + +#define SPI_CORE_CLK 250000000U +#define SPI_CS 0x00 +#define SPI_CS_LEN_LONG (1 << 25) +#define SPI_CS_DMA_LEN (1 << 24) +#define SPI_CS_CSPOL2 (1 << 23) +#define SPI_CS_CSPOL1 (1 << 22) +#define SPI_CS_CSPOL0 (1 << 21) +#define SPI_CS_RXF (1 << 20) +#define SPI_CS_RXR (1 << 19) +#define SPI_CS_TXD (1 << 18) +#define SPI_CS_RXD (1 << 17) +#define SPI_CS_DONE (1 << 16) +#define SPI_CS_LEN (1 << 13) +#define SPI_CS_REN (1 << 12) +#define SPI_CS_ADCS (1 << 11) +#define SPI_CS_INTR (1 << 10) +#define SPI_CS_INTD (1 << 9) +#define SPI_CS_DMAEN (1 << 8) +#define SPI_CS_TA (1 << 7) +#define SPI_CS_CSPOL (1 << 6) +#define SPI_CS_CLEAR_RXFIFO (1 << 5) +#define SPI_CS_CLEAR_TXFIFO (1 << 4) +#define SPI_CS_CPOL (1 << 3) +#define SPI_CS_CPHA (1 << 2) +#define SPI_CS_MASK 0x3 +#define SPI_FIFO 0x04 +#define SPI_CLK 0x08 +#define SPI_CLK_MASK 0xffff +#define SPI_DLEN 0x0c +#define SPI_DLEN_MASK 0xffff +#define SPI_LTOH 0x10 +#define SPI_LTOH_MASK 0xf +#define SPI_DC 0x14 +#define SPI_DC_RPANIC_SHIFT 24 +#define SPI_DC_RPANIC_MASK (0xff << SPI_DC_RPANIC_SHIFT) +#define SPI_DC_RDREQ_SHIFT 16 +#define SPI_DC_RDREQ_MASK (0xff << SPI_DC_RDREQ_SHIFT) +#define SPI_DC_TPANIC_SHIFT 8 +#define SPI_DC_TPANIC_MASK (0xff << SPI_DC_TPANIC_SHIFT) +#define SPI_DC_TDREQ_SHIFT 0 +#define SPI_DC_TDREQ_MASK 0xff + +#endif /* _BCM2835_SPIREG_H_ */ Added: head/sys/arm/broadcom/bcm2835/bcm2835_spivar.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2835_spivar.h Thu Oct 24 16:27:33 2013 (r257062) @@ -0,0 +1,72 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2013 Luiz Otavio O Souza + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _BCM2835_SPIVAR_H_ +#define _BCM2835_SPIVAR_H_ + +/* + * Only the available pins are listed here. + * i.e. CS2 isn't available. + */ +uint32_t bcm_spi_pins[] = { + 7, /* CS1 */ + 8, /* CS0 */ + 9, /* MISO */ + 10, /* MOSI */ + 11 /* SCLK */ +}; + +struct bcm_spi_softc { + device_t sc_dev; + struct mtx sc_mtx; + struct resource * sc_mem_res; + struct resource * sc_irq_res; + struct spi_command *sc_cmd; + bus_space_tag_t sc_bst; + bus_space_handle_t sc_bsh; + uint32_t sc_len; + uint32_t sc_read; + uint32_t sc_flags; + uint32_t sc_written; + void * sc_intrhand; +}; + +#define BCM_SPI_BUSY 0x1 + +#define BCM_SPI_WRITE(_sc, _off, _val) \ + bus_space_write_4(_sc->sc_bst, _sc->sc_bsh, _off, _val) +#define BCM_SPI_READ(_sc, _off) \ + bus_space_read_4(_sc->sc_bst, _sc->sc_bsh, _off) + +#define BCM_SPI_LOCK(_sc) \ + mtx_lock(&(_sc)->sc_mtx) +#define BCM_SPI_UNLOCK(_sc) \ + mtx_unlock(&(_sc)->sc_mtx) + +#endif /* _BCM2835_SPIVAR_H_ */ Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm2835 Thu Oct 24 15:54:06 2013 (r257061) +++ head/sys/arm/broadcom/bcm2835/files.bcm2835 Thu Oct 24 16:27:33 2013 (r257062) @@ -8,6 +8,7 @@ arm/broadcom/bcm2835/bcm2835_intr.c sta arm/broadcom/bcm2835/bcm2835_machdep.c standard arm/broadcom/bcm2835/bcm2835_mbox.c standard arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci +arm/broadcom/bcm2835/bcm2835_spi.c optional bcm2835_spi arm/broadcom/bcm2835/bcm2835_systimer.c standard arm/broadcom/bcm2835/bcm2835_wdog.c standard arm/broadcom/bcm2835/bus_space.c optional fdt Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Thu Oct 24 15:54:06 2013 (r257061) +++ head/sys/arm/conf/RPI-B Thu Oct 24 16:27:33 2013 (r257062) @@ -107,6 +107,10 @@ device smcphy device mii device smsc +# SPI +device spibus +device bcm2835_spi + # Flattened Device Tree options FDT # Note: DTB is normally loaded and modified by RPi boot loader, then Modified: head/sys/boot/fdt/dts/bcm2835.dtsi ============================================================================== --- head/sys/boot/fdt/dts/bcm2835.dtsi Thu Oct 24 15:54:06 2013 (r257061) +++ head/sys/boot/fdt/dts/bcm2835.dtsi Thu Oct 24 16:27:33 2013 (r257062) @@ -412,6 +412,14 @@ interrupt-parent = <&intc>; }; + spi0 { + compatible = "broadcom,bcm2835-spi", + "broadcom,bcm2708-spi"; + reg = <0x204000 0x20>; + interrupts = <62>; + interrupt-parent = <&intc>; + }; + dma: dma { compatible = "broadcom,bcm2835-dma", "broadcom,bcm2708-dma"; From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 16:56:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 083B5F06; Thu, 24 Oct 2013 16:56:40 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DAABE2B4F; Thu, 24 Oct 2013 16:56:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OGudNB051002; Thu, 24 Oct 2013 16:56:39 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OGuddv050998; Thu, 24 Oct 2013 16:56:39 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201310241656.r9OGuddv050998@svn.freebsd.org> From: Luiz Otavio O Souza Date: Thu, 24 Oct 2013 16:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257064 - in head/sys: conf dev/spibus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 16:56:40 -0000 Author: loos Date: Thu Oct 24 16:56:38 2013 New Revision: 257064 URL: http://svnweb.freebsd.org/changeset/base/257064 Log: Add an OFW SPI compatible bus. Fix the spibus probe to return BUS_PROBE_GENERIC and not BUS_PROBE_SPECIFIC (0) so the OFW SPI bus can attach when enabled. Export the spibus devclass_t and driver_t declarations. Submitted by: ray Approved by: adrian (mentor) Added: head/sys/dev/spibus/ofw_spibus.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/spibus/spibus.c head/sys/dev/spibus/spibusvar.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Oct 24 16:42:48 2013 (r257063) +++ head/sys/conf/files Thu Oct 24 16:56:38 2013 (r257064) @@ -2177,6 +2177,7 @@ dev/sound/midi/mpu_if.m optional sound dev/sound/midi/mpufoi_if.m optional sound dev/sound/midi/sequencer.c optional sound dev/sound/midi/synth_if.m optional sound +dev/spibus/ofw_spibus.c optional fdt spibus dev/spibus/spibus.c optional spibus \ dependency "spibus_if.h" dev/spibus/spibus_if.m optional spibus Added: head/sys/dev/spibus/ofw_spibus.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/spibus/ofw_spibus.c Thu Oct 24 16:56:38 2013 (r257064) @@ -0,0 +1,192 @@ +/*- + * Copyright (c) 2009, Nathan Whitehorn + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by Oleksandr Rybalko + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "spibus_if.h" + +struct ofw_spibus_devinfo { + struct spibus_ivar opd_dinfo; + struct ofw_bus_devinfo opd_obdinfo; +}; + +/* Methods */ +static device_probe_t ofw_spibus_probe; +static device_attach_t ofw_spibus_attach; +static device_t ofw_spibus_add_child(device_t dev, u_int order, + const char *name, int unit); +static const struct ofw_bus_devinfo *ofw_spibus_get_devinfo(device_t bus, + device_t dev); + +static int +ofw_spibus_probe(device_t dev) +{ + + if (ofw_bus_get_node(dev) == -1) + return (ENXIO); + device_set_desc(dev, "OFW SPI bus"); + + return (0); +} + +static int +ofw_spibus_attach(device_t dev) +{ + struct spibus_softc *sc = device_get_softc(dev); + struct ofw_spibus_devinfo *dinfo; + phandle_t child; + pcell_t paddr; + device_t childdev; + + sc->dev = dev; + + bus_generic_probe(dev); + bus_enumerate_hinted_children(dev); + + /* + * Attach those children represented in the device tree. + */ + for (child = OF_child(ofw_bus_get_node(dev)); child != 0; + child = OF_peer(child)) { + /* + * Try to get the CS number first from the spi-chipselect + * property, then try the reg property. + */ + if (OF_getencprop(child, "spi-chipselect", &paddr, + sizeof(paddr)) == -1) { + if (OF_getencprop(child, "reg", &paddr, + sizeof(paddr)) == -1) + continue; + } + + /* + * Now set up the SPI and OFW bus layer devinfo and add it + * to the bus. + */ + dinfo = malloc(sizeof(struct ofw_spibus_devinfo), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (dinfo == NULL) + continue; + dinfo->opd_dinfo.cs = paddr; + if (ofw_bus_gen_setup_devinfo(&dinfo->opd_obdinfo, child) != + 0) { + free(dinfo, M_DEVBUF); + continue; + } + childdev = device_add_child(dev, NULL, -1); + device_set_ivars(childdev, dinfo); + } + + return (bus_generic_attach(dev)); +} + +static device_t +ofw_spibus_add_child(device_t dev, u_int order, const char *name, int unit) +{ + device_t child; + struct ofw_spibus_devinfo *devi; + + child = device_add_child_ordered(dev, order, name, unit); + if (child == NULL) + return (child); + devi = malloc(sizeof(struct ofw_spibus_devinfo), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (devi == NULL) { + device_delete_child(dev, child); + return (0); + } + + /* + * NULL all the OFW-related parts of the ivars for non-OFW + * children. + */ + devi->opd_obdinfo.obd_node = -1; + devi->opd_obdinfo.obd_name = NULL; + devi->opd_obdinfo.obd_compat = NULL; + devi->opd_obdinfo.obd_type = NULL; + devi->opd_obdinfo.obd_model = NULL; + + device_set_ivars(child, devi); + + return (child); +} + +static const struct ofw_bus_devinfo * +ofw_spibus_get_devinfo(device_t bus, device_t dev) +{ + struct ofw_spibus_devinfo *dinfo; + + dinfo = device_get_ivars(dev); + return (&dinfo->opd_obdinfo); +} + +static device_method_t ofw_spibus_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ofw_spibus_probe), + DEVMETHOD(device_attach, ofw_spibus_attach), + + /* Bus interface */ + DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), + DEVMETHOD(bus_add_child, ofw_spibus_add_child), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, ofw_spibus_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + DEVMETHOD_END +}; + +static devclass_t ofwspibus_devclass; + +DEFINE_CLASS_1(spibus, ofw_spibus_driver, ofw_spibus_methods, + sizeof(struct spibus_softc), spibus_driver); +DRIVER_MODULE(ofw_spibus, spi, ofw_spibus_driver, ofwspibus_devclass, 0, 0); +MODULE_VERSION(ofw_spibus, 1); +MODULE_DEPEND(ofw_spibus, spibus, 1, 1, 1); Modified: head/sys/dev/spibus/spibus.c ============================================================================== --- head/sys/dev/spibus/spibus.c Thu Oct 24 16:42:48 2013 (r257063) +++ head/sys/dev/spibus/spibus.c Thu Oct 24 16:56:38 2013 (r257064) @@ -23,7 +23,7 @@ static int spibus_probe(device_t dev) { device_set_desc(dev, "spibus bus"); - return (0); + return (BUS_PROBE_GENERIC); } static int @@ -185,7 +185,7 @@ static device_method_t spibus_methods[] DEVMETHOD_END }; -static driver_t spibus_driver = { +driver_t spibus_driver = { "spibus", spibus_methods, sizeof(struct spibus_softc) Modified: head/sys/dev/spibus/spibusvar.h ============================================================================== --- head/sys/dev/spibus/spibusvar.h Thu Oct 24 16:42:48 2013 (r257063) +++ head/sys/dev/spibus/spibusvar.h Thu Oct 24 16:56:38 2013 (r257064) @@ -26,3 +26,6 @@ spibus_get_ ## A(device_t dev, T *t) } SPIBUS_ACCESSOR(cs, CS, uint32_t) + +extern driver_t spibus_driver; +extern devclass_t spibus_devclass; From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 17:04:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DD8D52F7; Thu, 24 Oct 2013 17:04:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BCBE12BD6; Thu, 24 Oct 2013 17:04:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OH4H5T054211; Thu, 24 Oct 2013 17:04:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OH4H7M054208; Thu, 24 Oct 2013 17:04:17 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201310241704.r9OH4H7M054208@svn.freebsd.org> From: Adrian Chadd Date: Thu, 24 Oct 2013 17:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257065 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 17:04:18 -0000 Author: adrian Date: Thu Oct 24 17:04:16 2013 New Revision: 257065 URL: http://svnweb.freebsd.org/changeset/base/257065 Log: Fix a use-after-free node reference issue when waiting for a return from a management frame transmission. This bug is a bit loopy, so here goes. The underlying cause is pretty easy to understand - the node isn't referenced before passing into the callout, so if the node is deleted before the callout fires, it'll dereference free'd memory. The code path however is slightly more convoluted. The functions _say_ mgt_tx - ie management transmit - which is partially true. Yes, that callback is attached to the mbuf for some management frames. However, it's only for frames relating to scanning and authentication attempts. It helpfully drives the VAP state back to "SCAN" if the transmission fails _OR_ (as I subsequently found out!) if the transmission succeeds but the state machine doesn't make progress towards being authenticated and active. Now, the code itself isn't terribly clear about this. It _looks_ like it's just handling the transmit failure case. However, when you look at what goes on in the transmit success case, it's moving the VAP state back to SCAN if it hasn't changed state since the time the callback was scheduled. Ie, if it's in ASSOC or AUTH still, it'll go back to SCAN. But if it has transitioned to the RUN state, the comparison will fail and it'll not transition things back to the SCAN state. So, to fix this, I decided to leave everything the way it is and merely fix the locking and remove the node reference. The _better_ fix would be to turn this callout into a "assoc/auth request" timeout callback and make the callout locked, thus eliminating all races. However, until all the drivers have been fixed so that transmit completions occur outside of any locking that's going on, it's going to be impossible to do this without introducing LORs. So, I leave some of the evilness in there. Tested: * AR5212, ath(4), STA mode * 5100 and 4965 wifi, iwn(4), STA mode Modified: head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_proto.h Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Thu Oct 24 16:56:38 2013 (r257064) +++ head/sys/net80211/ieee80211_output.c Thu Oct 24 17:04:16 2013 (r257065) @@ -2732,20 +2732,35 @@ ieee80211_alloc_cts(struct ieee80211com static void ieee80211_tx_mgt_timeout(void *arg) { - struct ieee80211_node *ni = arg; - struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211vap *vap = arg; + IEEE80211_LOCK(vap->iv_ic); if (vap->iv_state != IEEE80211_S_INIT && (vap->iv_ic->ic_flags & IEEE80211_F_SCAN) == 0) { /* * NB: it's safe to specify a timeout as the reason here; * it'll only be used in the right state. */ - ieee80211_new_state(vap, IEEE80211_S_SCAN, + ieee80211_new_state_locked(vap, IEEE80211_S_SCAN, IEEE80211_SCAN_FAIL_TIMEOUT); } + IEEE80211_UNLOCK(vap->iv_ic); } +/* + * This is the callback set on net80211-sourced transmitted + * authentication request frames. + * + * This does a couple of things: + * + * + If the frame transmitted was a success, it schedules a future + * event which will transition the interface to scan. + * If a state transition _then_ occurs before that event occurs, + * said state transition will cancel this callout. + * + * + If the frame transmit was a failure, it immediately schedules + * the transition back to scan. + */ static void ieee80211_tx_mgt_cb(struct ieee80211_node *ni, void *arg, int status) { @@ -2763,10 +2778,11 @@ ieee80211_tx_mgt_cb(struct ieee80211_nod * * XXX what happens if !acked but response shows up before callback? */ - if (vap->iv_state == ostate) + if (vap->iv_state == ostate) { callout_reset(&vap->iv_mgtsend, status == 0 ? IEEE80211_TRANS_WAIT*hz : 0, - ieee80211_tx_mgt_timeout, ni); + ieee80211_tx_mgt_timeout, vap); + } } static void Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Thu Oct 24 16:56:38 2013 (r257064) +++ head/sys/net80211/ieee80211_proto.c Thu Oct 24 17:04:16 2013 (r257065) @@ -107,8 +107,6 @@ static void update_promisc(void *, int); static void update_channel(void *, int); static void update_chw(void *, int); static void ieee80211_newstate_cb(void *, int); -static int ieee80211_new_state_locked(struct ieee80211vap *, - enum ieee80211_state, int); static int null_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, @@ -1834,7 +1832,7 @@ done: * is usually a mistake and indicates lack of proper integration * with the net80211 layer. */ -static int +int ieee80211_new_state_locked(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Thu Oct 24 16:56:38 2013 (r257064) +++ head/sys/net80211/ieee80211_proto.h Thu Oct 24 17:04:16 2013 (r257065) @@ -332,6 +332,8 @@ void ieee80211_dturbo_switch(struct ieee void ieee80211_swbmiss(void *arg); void ieee80211_beacon_miss(struct ieee80211com *); int ieee80211_new_state(struct ieee80211vap *, enum ieee80211_state, int); +int ieee80211_new_state_locked(struct ieee80211vap *, enum ieee80211_state, + int); void ieee80211_print_essid(const uint8_t *, int); void ieee80211_dump_pkt(struct ieee80211com *, const uint8_t *, int, int, int); From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 17:06:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DF1644BD; Thu, 24 Oct 2013 17:06:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BC9002BFB; Thu, 24 Oct 2013 17:06:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OH6hJG054620; Thu, 24 Oct 2013 17:06:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OH6g3g054613; Thu, 24 Oct 2013 17:06:42 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201310241706.r9OH6g3g054613@svn.freebsd.org> From: Marius Strobl Date: Thu, 24 Oct 2013 17:06:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257066 - in head/sys/sparc64: include pci sbus sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 17:06:44 -0000 Author: marius Date: Thu Oct 24 17:06:41 2013 New Revision: 257066 URL: http://svnweb.freebsd.org/changeset/base/257066 Log: Move the implementation of bus_space_barrier(9) to the inline function in the header. Actually, there's only one version for all types of busses, so it doesn't make sense to walk up the hierarchy. Modified: head/sys/sparc64/include/bus.h head/sys/sparc64/include/bus_private.h head/sys/sparc64/pci/fire.c head/sys/sparc64/pci/psycho.c head/sys/sparc64/pci/schizo.c head/sys/sparc64/sbus/sbus.c head/sys/sparc64/sparc64/bus_machdep.c Modified: head/sys/sparc64/include/bus.h ============================================================================== --- head/sys/sparc64/include/bus.h Thu Oct 24 17:04:16 2013 (r257065) +++ head/sys/sparc64/include/bus.h Thu Oct 24 17:06:41 2013 (r257066) @@ -58,7 +58,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * from: NetBSD: bus.h,v 1.58 2008/04/28 20:23:36 martin Exp + * from: NetBSD: bus.h,v 1.58 2008/04/28 20:23:36 martin Exp * and * from: FreeBSD: src/sys/alpha/include/bus.h,v 1.9 2001/01/09 * @@ -104,11 +104,7 @@ extern const int bus_stream_asi[]; struct bus_space_tag { void *bst_cookie; - bus_space_tag_t bst_parent; int bst_type; - - void (*bst_bus_barrier)(bus_space_tag_t, bus_space_handle_t, - bus_size_t, bus_size_t, int); }; /* @@ -131,23 +127,23 @@ int bus_space_map(bus_space_tag_t tag, b void bus_space_unmap(bus_space_tag_t tag, bus_space_handle_t handle, bus_size_t size); -/* This macro finds the first "upstream" implementation of method `f' */ -#define _BS_CALL(t,f) \ - while (t->f == NULL) \ - t = t->bst_parent; \ - return (*(t)->f) - static __inline void -bus_space_barrier(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - bus_size_t s, int f) +bus_space_barrier(bus_space_tag_t t __unused, bus_space_handle_t h __unused, + bus_size_t o __unused, bus_size_t s __unused, int f __unused) { - _BS_CALL(t, bst_bus_barrier)(t, h, o, s, f); + /* + * We have lots of alternatives depending on whether we're + * synchronizing loads with loads, loads with stores, stores + * with loads, or stores with stores. The only ones that seem + * generic are #Sync and #MemIssue. We use #Sync for safety. + */ + membar(Sync); } static __inline int -bus_space_subregion(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - bus_size_t s, bus_space_handle_t *hp) +bus_space_subregion(bus_space_tag_t t __unused, bus_space_handle_t h, + bus_size_t o __unused, bus_size_t s __unused, bus_space_handle_t *hp) { *hp = h + o; Modified: head/sys/sparc64/include/bus_private.h ============================================================================== --- head/sys/sparc64/include/bus_private.h Thu Oct 24 17:04:16 2013 (r257065) +++ head/sys/sparc64/include/bus_private.h Thu Oct 24 17:06:41 2013 (r257066) @@ -40,8 +40,7 @@ int sparc64_bus_mem_map(bus_space_tag_t int flags, vm_offset_t vaddr, bus_space_handle_t *hp); int sparc64_bus_mem_unmap(bus_space_tag_t tag, bus_space_handle_t handle, bus_size_t size); -bus_space_tag_t sparc64_alloc_bus_tag(void *cookie, - struct bus_space_tag *ptag, int type, void *barrier); +bus_space_tag_t sparc64_alloc_bus_tag(void *cookie, int type); bus_space_handle_t sparc64_fake_bustag(int space, bus_addr_t addr, struct bus_space_tag *ptag); Modified: head/sys/sparc64/pci/fire.c ============================================================================== --- head/sys/sparc64/pci/fire.c Thu Oct 24 17:04:16 2013 (r257065) +++ head/sys/sparc64/pci/fire.c Thu Oct 24 17:06:41 2013 (r257066) @@ -756,12 +756,10 @@ fire_attach(device_t dev) free(range, M_OFWPROP); /* Allocate our tags. */ - sc->sc_pci_iot = sparc64_alloc_bus_tag(NULL, rman_get_bustag( - sc->sc_mem_res[FIRE_PCI]), PCI_IO_BUS_SPACE, NULL); + sc->sc_pci_iot = sparc64_alloc_bus_tag(NULL, PCI_IO_BUS_SPACE); if (sc->sc_pci_iot == NULL) panic("%s: could not allocate PCI I/O tag", __func__); - sc->sc_pci_cfgt = sparc64_alloc_bus_tag(NULL, rman_get_bustag( - sc->sc_mem_res[FIRE_PCI]), PCI_CONFIG_BUS_SPACE, NULL); + sc->sc_pci_cfgt = sparc64_alloc_bus_tag(NULL, PCI_CONFIG_BUS_SPACE); if (sc->sc_pci_cfgt == NULL) panic("%s: could not allocate PCI configuration space tag", __func__); @@ -2072,8 +2070,7 @@ fire_activate_resource(device_t bus, dev return (bus_generic_activate_resource(bus, child, type, rid, r)); case SYS_RES_MEMORY: - tag = sparc64_alloc_bus_tag(r, rman_get_bustag( - sc->sc_mem_res[FIRE_PCI]), PCI_MEMORY_BUS_SPACE, NULL); + tag = sparc64_alloc_bus_tag(r, PCI_MEMORY_BUS_SPACE); if (tag == NULL) return (ENOMEM); rman_set_bustag(r, tag); Modified: head/sys/sparc64/pci/psycho.c ============================================================================== --- head/sys/sparc64/pci/psycho.c Thu Oct 24 17:04:16 2013 (r257065) +++ head/sys/sparc64/pci/psycho.c Thu Oct 24 17:06:41 2013 (r257066) @@ -573,12 +573,10 @@ psycho_attach(device_t dev) } /* Allocate our tags. */ - sc->sc_pci_iot = sparc64_alloc_bus_tag(NULL, rman_get_bustag( - sc->sc_mem_res), PCI_IO_BUS_SPACE, NULL); + sc->sc_pci_iot = sparc64_alloc_bus_tag(NULL, PCI_IO_BUS_SPACE); if (sc->sc_pci_iot == NULL) panic("%s: could not allocate PCI I/O tag", __func__); - sc->sc_pci_cfgt = sparc64_alloc_bus_tag(NULL, rman_get_bustag( - sc->sc_mem_res), PCI_CONFIG_BUS_SPACE, NULL); + sc->sc_pci_cfgt = sparc64_alloc_bus_tag(NULL, PCI_CONFIG_BUS_SPACE); if (sc->sc_pci_cfgt == NULL) panic("%s: could not allocate PCI configuration space tag", __func__); @@ -1236,8 +1234,7 @@ psycho_activate_resource(device_t bus, d return (bus_generic_activate_resource(bus, child, type, rid, r)); case SYS_RES_MEMORY: - tag = sparc64_alloc_bus_tag(r, rman_get_bustag( - sc->sc_mem_res), PCI_MEMORY_BUS_SPACE, NULL); + tag = sparc64_alloc_bus_tag(r, PCI_MEMORY_BUS_SPACE); if (tag == NULL) return (ENOMEM); rman_set_bustag(r, tag); Modified: head/sys/sparc64/pci/schizo.c ============================================================================== --- head/sys/sparc64/pci/schizo.c Thu Oct 24 17:04:16 2013 (r257065) +++ head/sys/sparc64/pci/schizo.c Thu Oct 24 17:06:41 2013 (r257066) @@ -580,12 +580,10 @@ schizo_attach(device_t dev) SLIST_INSERT_HEAD(&schizo_softcs, sc, sc_link); /* Allocate our tags. */ - sc->sc_pci_iot = sparc64_alloc_bus_tag(NULL, rman_get_bustag( - sc->sc_mem_res[STX_PCI]), PCI_IO_BUS_SPACE, NULL); + sc->sc_pci_iot = sparc64_alloc_bus_tag(NULL, PCI_IO_BUS_SPACE); if (sc->sc_pci_iot == NULL) panic("%s: could not allocate PCI I/O tag", __func__); - sc->sc_pci_cfgt = sparc64_alloc_bus_tag(NULL, rman_get_bustag( - sc->sc_mem_res[STX_PCI]), PCI_CONFIG_BUS_SPACE, NULL); + sc->sc_pci_cfgt = sparc64_alloc_bus_tag(NULL, PCI_CONFIG_BUS_SPACE); if (sc->sc_pci_cfgt == NULL) panic("%s: could not allocate PCI configuration space tag", __func__); @@ -1412,8 +1410,7 @@ schizo_activate_resource(device_t bus, d return (bus_generic_activate_resource(bus, child, type, rid, r)); case SYS_RES_MEMORY: - tag = sparc64_alloc_bus_tag(r, rman_get_bustag( - sc->sc_mem_res[STX_PCI]), PCI_MEMORY_BUS_SPACE, NULL); + tag = sparc64_alloc_bus_tag(r, PCI_MEMORY_BUS_SPACE); if (tag == NULL) return (ENOMEM); rman_set_bustag(r, tag); Modified: head/sys/sparc64/sbus/sbus.c ============================================================================== --- head/sys/sparc64/sbus/sbus.c Thu Oct 24 17:04:16 2013 (r257065) +++ head/sys/sparc64/sbus/sbus.c Thu Oct 24 17:06:41 2013 (r257066) @@ -803,9 +803,7 @@ sbus_activate_resource(device_t bus, dev for (i = 0; i < sc->sc_nrange; i++) { if (rman_is_region_manager(r, &sc->sc_rd[i].rd_rman) != 0) { - tag = sparc64_alloc_bus_tag(r, - rman_get_bustag(sc->sc_sysio_res), - SBUS_BUS_SPACE, NULL); + tag = sparc64_alloc_bus_tag(r, SBUS_BUS_SPACE); if (tag == NULL) return (ENOMEM); rman_set_bustag(r, tag); Modified: head/sys/sparc64/sparc64/bus_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/bus_machdep.c Thu Oct 24 17:04:16 2013 (r257065) +++ head/sys/sparc64/sparc64/bus_machdep.c Thu Oct 24 17:06:41 2013 (r257066) @@ -119,9 +119,6 @@ __FBSDID("$FreeBSD$"); #include #include -static void nexus_bus_barrier(bus_space_tag_t, bus_space_handle_t, - bus_size_t, bus_size_t, int); - /* ASIs for bus access */ const int bus_type_asi[] = { ASI_PHYS_BYPASS_EC_WITH_EBIT, /* nexus */ @@ -715,18 +712,15 @@ sparc64_fake_bustag(int space, bus_addr_ { ptag->bst_cookie = NULL; - ptag->bst_parent = NULL; ptag->bst_type = space; - ptag->bst_bus_barrier = nexus_bus_barrier; return (addr); } /* - * Allocate a bus tag. + * Allocate a bus tag */ bus_space_tag_t -sparc64_alloc_bus_tag(void *cookie, struct bus_space_tag *ptag, int type, - void *barrier) +sparc64_alloc_bus_tag(void *cookie, int type) { bus_space_tag_t bt; @@ -734,42 +728,11 @@ sparc64_alloc_bus_tag(void *cookie, stru if (bt == NULL) return (NULL); bt->bst_cookie = cookie; - bt->bst_parent = ptag; bt->bst_type = type; - bt->bst_bus_barrier = barrier; return (bt); } -/* - * Base bus space handlers. - */ - -static void -nexus_bus_barrier(bus_space_tag_t t, bus_space_handle_t h, bus_size_t offset, - bus_size_t size, int flags) -{ - - /* - * We have lots of alternatives depending on whether we're - * synchronizing loads with loads, loads with stores, stores - * with loads, or stores with stores. The only ones that seem - * generic are #Sync and #MemIssue. I'll use #Sync for safety. - */ - switch(flags) { - case BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE: - case BUS_SPACE_BARRIER_READ: - case BUS_SPACE_BARRIER_WRITE: - membar(Sync); - break; - default: - panic("%s: unknown flags", __func__); - } - return; -} - struct bus_space_tag nexus_bustag = { NULL, /* cookie */ - NULL, /* parent bus tag */ - NEXUS_BUS_SPACE, /* type */ - nexus_bus_barrier, /* bus_space_barrier */ + NEXUS_BUS_SPACE /* type */ }; From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 19:32:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 49679F5; Thu, 24 Oct 2013 19:32:21 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 36525253A; Thu, 24 Oct 2013 19:32:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OJWLZN005629; Thu, 24 Oct 2013 19:32:21 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OJWLsg005628; Thu, 24 Oct 2013 19:32:21 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201310241932.r9OJWLsg005628@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 24 Oct 2013 19:32:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257067 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 19:32:21 -0000 Author: pluknet Date: Thu Oct 24 19:32:20 2013 New Revision: 257067 URL: http://svnweb.freebsd.org/changeset/base/257067 Log: Correct typo. s/an an/an/ Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Oct 24 17:06:41 2013 (r257066) +++ head/sys/conf/NOTES Thu Oct 24 19:32:20 2013 (r257067) @@ -127,7 +127,7 @@ options BLKDEV_IOSIZE=8192 # devices and DFLTPHYS for the rest. Some applications have better # performance with larger raw I/O access sizes. Note that certain VM # parameters are derived from these values and making them too large -# can make an an unbootable kernel. +# can make an unbootable kernel. # # The defaults are 64K and 128K respectively. options DFLTPHYS=(64*1024) From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 19:49:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B2355980; Thu, 24 Oct 2013 19:49:55 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9F76D269D; Thu, 24 Oct 2013 19:49:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OJntwn010043; Thu, 24 Oct 2013 19:49:55 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OJntrE010042; Thu, 24 Oct 2013 19:49:55 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201310241949.r9OJntrE010042@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 24 Oct 2013 19:49:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257068 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 19:49:55 -0000 Author: pluknet Date: Thu Oct 24 19:49:55 2013 New Revision: 257068 URL: http://svnweb.freebsd.org/changeset/base/257068 Log: Modernize pass(4) description to the 21st century. Reviewed by: mav Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Oct 24 19:32:20 2013 (r257067) +++ head/sys/conf/NOTES Thu Oct 24 19:49:55 2013 (r257068) @@ -1281,8 +1281,7 @@ hint.sa.1.target="6" # to incoming commands that do not otherwise have a logical unit assigned # to them. # -# The "unknown" device (uk? in pre-2.0.5) is now part of the base SCSI -# configuration as the "pass" driver. +# The pass driver provides a passthrough API to access the CAM subsystem. device scbus #base SCSI code device ch #SCSI media changers From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 20:13:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E8E40682; Thu, 24 Oct 2013 20:13:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C55D9280F; Thu, 24 Oct 2013 20:13:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OKDeFB020310; Thu, 24 Oct 2013 20:13:40 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OKDeEo020309; Thu, 24 Oct 2013 20:13:40 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310242013.r9OKDeEo020309@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 24 Oct 2013 20:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257069 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 20:13:41 -0000 Author: kib Date: Thu Oct 24 20:13:40 2013 New Revision: 257069 URL: http://svnweb.freebsd.org/changeset/base/257069 Log: Add ddb 'show ioapic' and 'show all ioapics' commands. Reviewed by: jhb (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/x86/io_apic.c Modified: head/sys/x86/x86/io_apic.c ============================================================================== --- head/sys/x86/x86/io_apic.c Thu Oct 24 19:49:55 2013 (r257068) +++ head/sys/x86/x86/io_apic.c Thu Oct 24 20:13:40 2013 (r257069) @@ -922,3 +922,99 @@ DEFINE_CLASS_0(apic, apic_driver, apic_m static devclass_t apic_devclass; DRIVER_MODULE(apic, nexus, apic_driver, apic_devclass, 0, 0); + +#include "opt_ddb.h" + +#ifdef DDB +#include + +static const char * +ioapic_delivery_mode(uint32_t mode) +{ + + switch (mode) { + case IOART_DELFIXED: + return ("fixed"); + case IOART_DELLOPRI: + return ("lowestpri"); + case IOART_DELSMI: + return ("SMI"); + case IOART_DELRSV1: + return ("rsrvd1"); + case IOART_DELNMI: + return ("NMI"); + case IOART_DELINIT: + return ("INIT"); + case IOART_DELRSV2: + return ("rsrvd2"); + case IOART_DELEXINT: + return ("ExtINT"); + default: + return (""); + } +} + +static u_int +db_ioapic_read(volatile ioapic_t *apic, int reg) +{ + + apic->ioregsel = reg; + return (apic->iowin); +} + +static void +db_show_ioapic_one(volatile ioapic_t *io_addr) +{ + uint32_t r, lo, hi; + int mre, i; + + r = db_ioapic_read(io_addr, IOAPIC_VER); + mre = (r & IOART_VER_MAXREDIR) >> MAXREDIRSHIFT; + db_printf("Id 0x%08x Ver 0x%02x MRE %d\n", + db_ioapic_read(io_addr, IOAPIC_ID), r & IOART_VER_VERSION, mre); + for (i = 0; i < mre; i++) { + lo = db_ioapic_read(io_addr, IOAPIC_REDTBL_LO(i)); + hi = db_ioapic_read(io_addr, IOAPIC_REDTBL_HI(i)); + db_printf(" pin %d Dest %s/%x %smasked Trig %s RemoteIRR %d " + "Polarity %s Status %s DeliveryMode %s Vec %d\n", i, + (lo & IOART_DESTMOD) == IOART_DESTLOG ? "log" : "phy", + (hi & IOART_DEST) >> 24, + (lo & IOART_INTMASK) == IOART_INTMSET ? "" : "not", + (lo & IOART_TRGRMOD) == IOART_TRGRLVL ? "lvl" : "edge", + (lo & IOART_REM_IRR) == IOART_REM_IRR ? 1 : 0, + (lo & IOART_INTPOL) == IOART_INTALO ? "low" : "high", + (lo & IOART_DELIVS) == IOART_DELIVS ? "pend" : "idle", + ioapic_delivery_mode(lo & IOART_DELMOD), + (lo & IOART_INTVEC)); + } +} + +DB_SHOW_COMMAND(ioapic, db_show_ioapic) +{ + struct ioapic *ioapic; + int idx, i; + + if (!have_addr) { + db_printf("usage: show ioapic index\n"); + return; + } + + idx = (int)addr; + i = 0; + STAILQ_FOREACH(ioapic, &ioapic_list, io_next) { + if (idx == i) { + db_show_ioapic_one(ioapic->io_addr); + break; + } + i++; + } +} + +DB_SHOW_ALL_COMMAND(ioapics, db_show_all_ioapics) +{ + struct ioapic *ioapic; + + STAILQ_FOREACH(ioapic, &ioapic_list, io_next) + db_show_ioapic_one(ioapic->io_addr); +} +#endif From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 20:21:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 236708E0; Thu, 24 Oct 2013 20:21:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1098C2887; Thu, 24 Oct 2013 20:21:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OKLbPU023332; Thu, 24 Oct 2013 20:21:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OKLbUB023330; Thu, 24 Oct 2013 20:21:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310242021.r9OKLbUB023330@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 24 Oct 2013 20:21:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257070 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 20:21:38 -0000 Author: kib Date: Thu Oct 24 20:21:37 2013 New Revision: 257070 URL: http://svnweb.freebsd.org/changeset/base/257070 Log: Move the PCI_DMA_BOUNDARY definition into the pcivar.h. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/dev/pci/pci.c head/sys/dev/pci/pcivar.h Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Thu Oct 24 20:13:40 2013 (r257069) +++ head/sys/dev/pci/pci.c Thu Oct 24 20:21:37 2013 (r257070) @@ -70,10 +70,6 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" #include "pci_if.h" -#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) -#define PCI_DMA_BOUNDARY 0x100000000 -#endif - #define PCIR_IS_BIOS(cfg, reg) \ (((cfg)->hdrtype == PCIM_HDRTYPE_NORMAL && reg == PCIR_BIOS) || \ ((cfg)->hdrtype == PCIM_HDRTYPE_BRIDGE && reg == PCIR_BIOS_1)) Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Thu Oct 24 20:13:40 2013 (r257069) +++ head/sys/dev/pci/pcivar.h Thu Oct 24 20:21:37 2013 (r257070) @@ -499,6 +499,15 @@ void pci_restore_state(device_t dev); void pci_save_state(device_t dev); int pci_set_max_read_req(device_t dev, int size); + +#ifdef BUS_SPACE_MAXADDR +#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) +#define PCI_DMA_BOUNDARY 0x100000000 +#else +#define PCI_DMA_BOUNDARY 0 +#endif +#endif + #endif /* _SYS_BUS_H_ */ /* From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 20:25:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 09268C0F; Thu, 24 Oct 2013 20:25:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EA5AF28B0; Thu, 24 Oct 2013 20:25:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OKPTS5023900; Thu, 24 Oct 2013 20:25:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OKPT2E023899; Thu, 24 Oct 2013 20:25:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310242025.r9OKPT2E023899@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 24 Oct 2013 20:25:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257071 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 20:25:30 -0000 Author: kib Date: Thu Oct 24 20:25:29 2013 New Revision: 257071 URL: http://svnweb.freebsd.org/changeset/base/257071 Log: Add some definitions for the bits in root control and status PCIe cap registers. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/dev/pci/pcireg.h Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Thu Oct 24 20:21:37 2013 (r257070) +++ head/sys/dev/pci/pcireg.h Thu Oct 24 20:25:29 2013 (r257071) @@ -762,8 +762,17 @@ #define PCIEM_SLOT_STA_EIS 0x0080 #define PCIEM_SLOT_STA_DLLSC 0x0100 #define PCIER_ROOT_CTL 0x1c +#define PCIEM_ROOT_CTL_SERR_CORR 0x0001 +#define PCIEM_ROOT_CTL_SERR_NONFATAL 0x0002 +#define PCIEM_ROOT_CTL_SERR_FATAL 0x0004 +#define PCIEM_ROOT_CTL_PME 0x0008 +#define PCIEM_ROOT_CTL_CRS_VIS 0x0010 #define PCIER_ROOT_CAP 0x1e +#define PCIEM_ROOT_CAP_CRS_VIS 0x0001 #define PCIER_ROOT_STA 0x20 +#define PCIEM_ROOT_STA_PME_REQID_MASK 0x0000ffff +#define PCIEM_ROOT_STA_PME_STATUS 0x00010000 +#define PCIEM_ROOT_STA_PME_PEND 0x00020000 #define PCIER_DEVICE_CAP2 0x24 #define PCIER_DEVICE_CTL2 0x28 #define PCIEM_CTL2_COMP_TIMEOUT_VAL 0x000f From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 20:29:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 60306E39; Thu, 24 Oct 2013 20:29:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4056328DA; Thu, 24 Oct 2013 20:29:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OKTUo1024346; Thu, 24 Oct 2013 20:29:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OKTTOi024343; Thu, 24 Oct 2013 20:29:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310242029.r9OKTTOi024343@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 24 Oct 2013 20:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257072 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 20:29:30 -0000 Author: kib Date: Thu Oct 24 20:29:29 2013 New Revision: 257072 URL: http://svnweb.freebsd.org/changeset/base/257072 Log: Make pci_get_dma_tag() non-static. Since the function is only referenced by pointer, making it non-static should not have even the negligible impact on the existing code. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/dev/pci/pci.c head/sys/dev/pci/pci_private.h Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Thu Oct 24 20:25:29 2013 (r257071) +++ head/sys/dev/pci/pci.c Thu Oct 24 20:29:29 2013 (r257072) @@ -96,7 +96,6 @@ static void pci_load_vendor_data(void); static int pci_describe_parse_line(char **ptr, int *vendor, int *device, char **desc); static char *pci_describe_device(device_t dev); -static bus_dma_tag_t pci_get_dma_tag(device_t bus, device_t dev); static int pci_modevent(module_t mod, int what, void *arg); static void pci_hdrtypedata(device_t pcib, int b, int s, int f, pcicfgregs *cfg); Modified: head/sys/dev/pci/pci_private.h ============================================================================== --- head/sys/dev/pci/pci_private.h Thu Oct 24 20:25:29 2013 (r257071) +++ head/sys/dev/pci/pci_private.h Thu Oct 24 20:29:29 2013 (r257072) @@ -116,6 +116,7 @@ int pci_child_pnpinfo_str_method(device int pci_assign_interrupt_method(device_t dev, device_t child); int pci_resume(device_t dev); int pci_suspend(device_t dev); +bus_dma_tag_t pci_get_dma_tag(device_t bus, device_t dev); /** Restore the config register state. The state must be previously * saved with pci_cfg_save. However, the pci bus driver takes care of From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 21:49:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 149C786B; Thu, 24 Oct 2013 21:49:24 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB8972D6A; Thu, 24 Oct 2013 21:49:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OLnNet050923; Thu, 24 Oct 2013 21:49:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OLnNUv050922; Thu, 24 Oct 2013 21:49:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310242149.r9OLnNUv050922@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 24 Oct 2013 21:49:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257075 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 21:49:24 -0000 Author: nwhitehorn Date: Thu Oct 24 21:49:23 2013 New Revision: 257075 URL: http://svnweb.freebsd.org/changeset/base/257075 Log: Remove some of the code required for supporting ssm(4) on SPARC in favor of a more PowerPC/FDT-focused design. Whenever SPARC64 is integrated into this rework, this should be (trivially) revisited. Modified: head/sys/dev/ofw/ofw_nexus.c Modified: head/sys/dev/ofw/ofw_nexus.c ============================================================================== --- head/sys/dev/ofw/ofw_nexus.c Thu Oct 24 21:43:46 2013 (r257074) +++ head/sys/dev/ofw/ofw_nexus.c Thu Oct 24 21:49:23 2013 (r257075) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include /* @@ -188,21 +187,17 @@ nexus_attach(device_t dev) sc = device_get_softc(dev); - if (strcmp(device_get_name(device_get_parent(dev)), "root") == 0) { - node = OF_peer(0); + node = OF_peer(0); - sc->sc_intr_rman.rm_type = RMAN_ARRAY; - sc->sc_intr_rman.rm_descr = "Interrupts"; - sc->sc_mem_rman.rm_type = RMAN_ARRAY; - sc->sc_mem_rman.rm_descr = "Device Memory"; - if (rman_init(&sc->sc_intr_rman) != 0 || - rman_init(&sc->sc_mem_rman) != 0 || - rman_manage_region(&sc->sc_intr_rman, 0, ~0) != 0 || - rman_manage_region(&sc->sc_mem_rman, 0, BUS_SPACE_MAXADDR) - != 0) - panic("%s: failed to set up rmans.", __func__); - } else - node = ofw_bus_get_node(dev); + sc->sc_intr_rman.rm_type = RMAN_ARRAY; + sc->sc_intr_rman.rm_descr = "Interrupts"; + sc->sc_mem_rman.rm_type = RMAN_ARRAY; + sc->sc_mem_rman.rm_descr = "Device Memory"; + if (rman_init(&sc->sc_intr_rman) != 0 || + rman_init(&sc->sc_mem_rman) != 0 || + rman_manage_region(&sc->sc_intr_rman, 0, ~0) != 0 || + rman_manage_region(&sc->sc_mem_rman, 0, BUS_SPACE_MAXADDR) != 0) + panic("%s: failed to set up rmans.", __func__); /* * Allow devices to identify. @@ -296,15 +291,11 @@ nexus_alloc_resource(device_t bus, devic struct rman *rm; struct resource *rv; struct resource_list_entry *rle; - device_t nexus; int isdefault, passthrough; isdefault = (start == 0UL && end == ~0UL); passthrough = (device_get_parent(child) != bus); - nexus = bus; - while (strcmp(device_get_name(device_get_parent(nexus)), "root") != 0) - nexus = device_get_parent(nexus); - sc = device_get_softc(nexus); + sc = device_get_softc(bus); rle = NULL; if (!passthrough && isdefault) { From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 21:58:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 18177E4B; Thu, 24 Oct 2013 21:58:15 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 04ED92DDF; Thu, 24 Oct 2013 21:58:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OLwEI0054063; Thu, 24 Oct 2013 21:58:14 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OLwEJr054061; Thu, 24 Oct 2013 21:58:14 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201310242158.r9OLwEJr054061@svn.freebsd.org> From: Andrey Zonov Date: Thu, 24 Oct 2013 21:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257077 - in head: . etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 21:58:15 -0000 Author: zont Date: Thu Oct 24 21:58:14 2013 New Revision: 257077 URL: http://svnweb.freebsd.org/changeset/base/257077 Log: Cleanup empty directories PR: conf/167133 Modified: head/ObsoleteFiles.inc head/etc/mtree/BSD.usr.dist Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Oct 24 21:54:24 2013 (r257076) +++ head/ObsoleteFiles.inc Thu Oct 24 21:58:14 2013 (r257077) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20131023: remove never used iscsi directory +OLD_DIRS+=usr/share/examples/iscsi # 20131014: libbsdyml becomes private OLD_FILES+=usr/lib/libbsdyml.a OLD_FILES+=usr/lib/libbsdyml.so @@ -2491,6 +2493,7 @@ OLD_FILES+=usr/sbin/zfs OLD_FILES+=usr/sbin/zpool # 20070423: rc.bluetooth (examples) removed OLD_FILES+=usr/share/examples/netgraph/bluetooth/rc.bluetooth +OLD_DIRS+=usr/share/examples/netgraph/bluetooth # 20070421: worm.4 removed OLD_FILES+=usr/share/man/man4/worm.4.gz # 20070417: trunk(4) renamed to lagg(4) Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Thu Oct 24 21:54:24 2013 (r257076) +++ head/etc/mtree/BSD.usr.dist Thu Oct 24 21:58:14 2013 (r257077) @@ -325,8 +325,6 @@ .. ipfw .. - iscsi - .. jails .. kld @@ -360,8 +358,6 @@ mdoc .. netgraph - bluetooth - .. .. pc-sysinstall .. From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 22:21:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 69CCAF69; Thu, 24 Oct 2013 22:21:32 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 578272F72; Thu, 24 Oct 2013 22:21:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OMLWGN063565; Thu, 24 Oct 2013 22:21:32 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OMLW2t063564; Thu, 24 Oct 2013 22:21:32 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310242221.r9OMLW2t063564@svn.freebsd.org> From: Peter Grehan Date: Thu, 24 Oct 2013 22:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257078 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 22:21:32 -0000 Author: grehan Date: Thu Oct 24 22:21:31 2013 New Revision: 257078 URL: http://svnweb.freebsd.org/changeset/base/257078 Log: Fix panic in the tap driver when a tap and vmnet interface were created after each other e.g. ifconfig tap0 ifconfig vmnet0 Appears to be a cut'n'paste error from the tap code to the vmnet code where the name string wasn't updated in the call to make_dev(). Reviewed by: glebius 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 Oct 24 21:58:14 2013 (r257077) +++ head/sys/net/if_tap.c Thu Oct 24 22:21:31 2013 (r257078) @@ -205,7 +205,7 @@ vmnet_clone_create(struct if_clone *ifc, i = clone_create(&tapclones, &tap_cdevsw, &unit, &dev, VMNET_DEV_MASK); if (i) { dev = make_dev(&tap_cdevsw, unit | VMNET_DEV_MASK, UID_ROOT, - GID_WHEEL, 0600, "%s%d", tapname, unit); + GID_WHEEL, 0600, "%s%d", vmnetname, unit); } tapcreate(dev); From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 22:53:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AAD899F3 for ; Thu, 24 Oct 2013 22:53:21 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-pb0-f46.google.com (mail-pb0-f46.google.com [209.85.160.46]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6EE11259A for ; Thu, 24 Oct 2013 22:53:21 +0000 (UTC) Received: by mail-pb0-f46.google.com with SMTP id un1so3324743pbc.19 for ; Thu, 24 Oct 2013 15:53:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type; bh=cHpOwpbPL1JPC3TnCeQ47UDRoXpvaKzV6fAHaZvMR3Y=; b=eEdm8GLk7zHvtFVemlYVIkKKgNljm6qQ2AqSrk6szMLyemwpL56uPwb0d5ach0VX0+ dpdeg85IlKW2OkiJgTW7hbiFXs1p1TqhZQJHQ0RAhIINMB3qYfu4EbHFXr+E3FWjoHbr t31wRWGLEZ87T3nk9DbxvXFC4NmUNZf4qwAtVMeNzs1m0EHIpZWT5FrLKmMooBWhPHeA zSVPif62bRS5hiUZQk8luuBjNiufTNzQWllJZ0mj8TCPlPDTb9NYe4kOwzMR6vJfQ/JY LRuLd1mUwso92pZyuMRoLErN9+W1nySYNbXawK74XcN1GnH2+2psVcii4JSDRJ+akrJJ twpQ== X-Gm-Message-State: ALoCoQngcQ8za+X1am2GgE9+HQXrbUdro0rpgV0q5K06YROanbOQVZtfQSQ0sY4RjjLqVsPhNqEP X-Received: by 10.68.48.166 with SMTP id m6mr5115196pbn.105.1382655194297; Thu, 24 Oct 2013 15:53:14 -0700 (PDT) Received: from zont-osx.local (h-74-3-97-61.snva.ca.megapath.net. [74.3.97.61]) by mx.google.com with ESMTPSA id va8sm5036050pbc.16.2013.10.24.15.53.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Oct 2013 15:53:13 -0700 (PDT) Sender: Andrey Zonov Message-ID: <5269A4D5.3090308@FreeBSD.org> Date: Thu, 24 Oct 2013 15:53:09 -0700 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Hilko Meyer Subject: Re: svn commit: r256710 - head/tools/build/mk References: <201310172200.r9HM0ZFM072006__34950.8864027031$1382047250$gmane$org@svn.freebsd.org> <97l269dokal3obs07tc792auspk1e0j0nj@4ax.com> <526824E2.6000309@FreeBSD.org> <7pbi69h9bdfg71q981dod40ldap329n73s@mail.gmx.net> In-Reply-To: <7pbi69h9bdfg71q981dod40ldap329n73s@mail.gmx.net> X-Enigmail-Version: 1.5.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7Dt53T4LGHfTNVAgjBGUUUEi9xhpRvOrk" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 22:53:21 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --7Dt53T4LGHfTNVAgjBGUUUEi9xhpRvOrk Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 10/24/13 7:39 AM, Hilko Meyer wrote: > Andrey Zonov schrieb: >> On 10/18/13 8:38 AM, Hilko Meyer wrote: >>> On Thu, 17 Oct 2013 22:00:35 +0000 (UTC) you wrote: >>>> Author: zont >>>> Date: Thu Oct 17 22:00:35 2013 >>>> New Revision: 256710 >>>> URL: http://svnweb.freebsd.org/changeset/base/256710 >>>> >>>> Modified: >>>> head/tools/build/mk/OptionalObsoleteFiles.inc >>> >>> This fixed two files I reported in conf/167133.2. Maybe you can look = for the >>> other four and close the PR. >> >> pccard.conf - is already in ObsoleteFiles.inc. >> pf.conf - we cannot just put it in ObsoleteFiles.inc because people ma= y >> have working configuration in this place. >=20 > Maybe put it under .if ${MK_PF} =3D=3D no like > usr/share/examples/pf/pf.conf? >=20 I don't like this behavior. All obsolete files should be listed in ObsoleteFiles.inc, all optional files should be listed in tools/build/mk/OptionalObsoleteFiles.inc, but if file became obsolete it should be moved to ObsoleteFiles.inc. Let's declare that this file is not obsolete. I committed proposed patch as r257077, please confirm that I can close conf/167133. --=20 Andrey Zonov --7Dt53T4LGHfTNVAgjBGUUUEi9xhpRvOrk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJSaaTXAAoJEBWLemxX/CvTiEkH/RpTl7nMF4ZZWSBEAlejBoEV LMtAQmb5MS/7RRU8v6CSJA957JEF5RWYGBPj4+KrNx8uvjDTXWXPoyb5bNOVPDPZ 3mHqWBe6GZR2H2rkS65X+y0lQROLPLkKOzURZBz9D/K6ltvERXLHCefTjRy0//JL cLMqpSQKuTlGfP6tXNTbGficNJDDoETBYtrFHMCZmGbJsaU6fKPCT7RhM4JrvBLB p6XsoGJo1PKWuElKAphMBST3yBJdhYuAws0GPlXLBHDgzCt+VYYQM5UKdVGu1CZ9 HBQw1K+CM/0qov9MW4mCDzFvubTJeIJVQcAKR1SMES2z182mo1Lt5nyt9qC/sOI= =GNYX -----END PGP SIGNATURE----- --7Dt53T4LGHfTNVAgjBGUUUEi9xhpRvOrk-- From owner-svn-src-all@FreeBSD.ORG Thu Oct 24 22:55:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BF720B79; Thu, 24 Oct 2013 22:55:15 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ACF5625AD; Thu, 24 Oct 2013 22:55:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9OMtFqO073551; Thu, 24 Oct 2013 22:55:15 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9OMtFbB073550; Thu, 24 Oct 2013 22:55:15 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310242255.r9OMtFbB073550@svn.freebsd.org> From: Glen Barber Date: Thu, 24 Oct 2013 22:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257079 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 22:55:15 -0000 Author: gjb Date: Thu Oct 24 22:55:15 2013 New Revision: 257079 URL: http://svnweb.freebsd.org/changeset/base/257079 Log: Fix build host pollution by avoiding calling 'uname -srp' to determine values for 'VERSION'. Looked at by: cperciva Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Oct 24 22:21:31 2013 (r257078) +++ head/Makefile.inc1 Thu Oct 24 22:55:15 2013 (r257079) @@ -58,6 +58,7 @@ # use that new version. And the new (dynamically-linked) /bin/sh # will expect to find appropriate libraries in /lib and /libexec. # +SRCDIR?= ${.CURDIR} .if defined(SUBDIR_OVERRIDE) SUBDIR= ${SUBDIR_OVERRIDE} .else @@ -128,8 +129,11 @@ OSRELDATE= 0 .endif .if !defined(VERSION) -VERSION!= uname -srp -VERSION+= ${OSRELDATE} +REVISION!= make -C ${SRCDIR}/release -V REVISION +BRANCH!= make -C ${SRCDIR}/release -V BRANCH +SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ + ${SRCDIR}/sys/sys/param.h +VERSION= FreeBSD ${REVISION}-${BRANCH} ${TARGET_ARCH} ${SRCRELDATE} .endif KNOWN_ARCHES?= amd64 arm armeb/arm armv6/arm i386 i386/pc98 ia64 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64 From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 00:17:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2FC2A7A7; Fri, 25 Oct 2013 00:17:13 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1CCDE29CE; Fri, 25 Oct 2013 00:17:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9P0HCCl001532; Fri, 25 Oct 2013 00:17:12 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9P0HCl2001531; Fri, 25 Oct 2013 00:17:12 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201310250017.r9P0HCl2001531@svn.freebsd.org> From: Justin Hibbits Date: Fri, 25 Oct 2013 00:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257081 - head/sys/cddl/dev/dtrace/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 00:17:13 -0000 Author: jhibbits Date: Fri Oct 25 00:17:12 2013 New Revision: 257081 URL: http://svnweb.freebsd.org/changeset/base/257081 Log: ELF PowerPC64 ABI puts the LR save word at 16 byte offset, not 8. Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c ============================================================================== --- head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c Thu Oct 24 23:47:31 2013 (r257080) +++ head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c Fri Oct 25 00:17:12 2013 (r257081) @@ -49,7 +49,8 @@ /* Offset to the LR Save word (ppc32) */ #define RETURN_OFFSET 4 -#define RETURN_OFFSET64 8 +/* Offset to LR Save word (ppc64). CR Save area sits between back chain and LR */ +#define RETURN_OFFSET64 16 #define INKERNEL(x) ((x) <= VM_MAX_KERNEL_ADDRESS && \ (x) >= VM_MIN_KERNEL_ADDRESS) From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 01:02:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2F550B96; Fri, 25 Oct 2013 01:02:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1BC842C4F; Fri, 25 Oct 2013 01:02:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9P12PqK017437; Fri, 25 Oct 2013 01:02:25 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9P12P2h017436; Fri, 25 Oct 2013 01:02:25 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201310250102.r9P12P2h017436@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 25 Oct 2013 01:02:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257084 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 01:02:26 -0000 Author: ae Date: Fri Oct 25 01:02:25 2013 New Revision: 257084 URL: http://svnweb.freebsd.org/changeset/base/257084 Log: Initialize inc_fibnum for properly handling ICMP6_PACKET_TOO_BIG errors in multifib environment. PR: 183265 MFC after: 1 week Modified: head/sys/netinet6/icmp6.c Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Fri Oct 25 00:35:26 2013 (r257083) +++ head/sys/netinet6/icmp6.c Fri Oct 25 01:02:25 2013 (r257084) @@ -1227,6 +1227,7 @@ icmp6_mtudisc_update(struct ip6ctlparam mtu = IPV6_MMTU - 8; bzero(&inc, sizeof(inc)); + inc.inc_fibnum = M_GETFIB(m); inc.inc_flags |= INC_ISIPV6; inc.inc6_faddr = *dst; if (in6_setscope(&inc.inc6_faddr, m->m_pkthdr.rcvif, NULL)) From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 01:10:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A41EBF0B; Fri, 25 Oct 2013 01:10:07 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 91F7E2C98; Fri, 25 Oct 2013 01:10:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9P1A7B0018713; Fri, 25 Oct 2013 01:10:07 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9P1A7Kw018712; Fri, 25 Oct 2013 01:10:07 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310250110.r9P1A7Kw018712@svn.freebsd.org> From: Sean Bruno Date: Fri, 25 Oct 2013 01:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257085 - head/contrib/gperf/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 01:10:07 -0000 Author: sbruno Date: Fri Oct 25 01:10:07 2013 New Revision: 257085 URL: http://svnweb.freebsd.org/changeset/base/257085 Log: Queisce quite a few clang warnings -Wdangling-else due to this work around for compiling gperf under Visual Studio from 1998. ref. http://msdn.microsoft.com/en-us/library/b80153d8%28v=vs.90%29.aspx ref. http://stackoverflow.com/questions/984878/what-is-the-possible-use-for-define-for-if-false-else-for Modified: head/contrib/gperf/src/search.cc Modified: head/contrib/gperf/src/search.cc ============================================================================== --- head/contrib/gperf/src/search.cc Fri Oct 25 01:02:25 2013 (r257084) +++ head/contrib/gperf/src/search.cc Fri Oct 25 01:10:07 2013 (r257085) @@ -36,7 +36,10 @@ /* ============================== Portability ============================== */ /* Assume ISO C++ 'for' scoping rule. */ -#define for if (0) ; else for +/* This code is used to work around scoping issues with visual studio 6 from + * 1998. Comment it out here to queisce numerous -Wdangling-else warnings + * from clang. +#define for if (0) ; else for */ /* Dynamically allocated array with dynamic extent: From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 03:18:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5E4FECB1; Fri, 25 Oct 2013 03:18:57 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3A8A92559; Fri, 25 Oct 2013 03:18:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9P3IvhQ064462; Fri, 25 Oct 2013 03:18:57 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9P3Iuj7064461; Fri, 25 Oct 2013 03:18:56 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310250318.r9P3Iuj7064461@svn.freebsd.org> From: Peter Grehan Date: Fri, 25 Oct 2013 03:18:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257092 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 03:18:57 -0000 Author: grehan Date: Fri Oct 25 03:18:56 2013 New Revision: 257092 URL: http://svnweb.freebsd.org/changeset/base/257092 Log: Fix bug in the ioapic emulation for level-triggered interrupts, where a pin assertion while a source was masked would result in the interrupt being lost, with the symptom being a console hang. The condition is now recorded, and the interrupt generated when the source is unmasked. Discovered by: OpenBSD 5.4 MP Reviewed by: neel MFC after: 3 days Modified: head/usr.sbin/bhyve/ioapic.c Modified: head/usr.sbin/bhyve/ioapic.c ============================================================================== --- head/usr.sbin/bhyve/ioapic.c Fri Oct 25 02:55:04 2013 (r257091) +++ head/usr.sbin/bhyve/ioapic.c Fri Oct 25 03:18:56 2013 (r257092) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -46,34 +47,40 @@ __FBSDID("$FreeBSD$"); #include +static uint64_t ioapic_clearpend, ioapic_togglepend, ioapic_setpend; + #define IOAPIC_PADDR 0xFEC00000 #define IOREGSEL 0x00 #define IOWIN 0x10 #define REDIR_ENTRIES 16 -#define INTR_ASSERTED(ioapic, pin) ((ioapic)->pinstate[(pin)] == true) +#define INTR_ASSERTED(ioapic, pin) \ + ((ioapic)->rtbl[(pin)].pinstate == true) struct ioapic { int inited; uint32_t id; - uint64_t redtbl[REDIR_ENTRIES]; - bool pinstate[REDIR_ENTRIES]; + struct { + uint64_t reg; + bool pinstate; + bool pending; + } rtbl[REDIR_ENTRIES]; uintptr_t paddr; /* gpa where the ioapic is mapped */ uint32_t ioregsel; struct memory_region *region; + pthread_mutex_t mtx; }; static struct ioapic ioapics[1]; /* only a single ioapic for now */ -static int ioapic_region_read(struct ioapic *ioapic, uintptr_t paddr, - int size, uint64_t *data); -static int ioapic_region_write(struct ioapic *ioapic, uintptr_t paddr, - int size, uint64_t data); +static int ioapic_region_read(struct vmctx *vm, struct ioapic *ioapic, + uintptr_t paddr, int size, uint64_t *data); +static int ioapic_region_write(struct vmctx *vm, struct ioapic *ioapic, + uintptr_t paddr, int size, uint64_t data); static int ioapic_region_handler(struct vmctx *vm, int vcpu, int dir, - uintptr_t paddr, int size, uint64_t *val, - void *arg1, long arg2); + uintptr_t paddr, int size, uint64_t *val, void *arg1, long arg2); static void ioapic_set_pinstate(struct vmctx *ctx, int pin, bool newstate) @@ -84,14 +91,11 @@ ioapic_set_pinstate(struct vmctx *ctx, i ioapic = &ioapics[0]; /* assume a single ioapic */ - if (pin < 0 || pin >= REDIR_ENTRIES) - return; - /* Nothing to do if interrupt pin has not changed state */ - if (ioapic->pinstate[pin] == newstate) + if (ioapic->rtbl[pin].pinstate == newstate) return; - ioapic->pinstate[pin] = newstate; /* record it */ + ioapic->rtbl[pin].pinstate = newstate; /* record it */ /* Nothing to do if interrupt pin is deasserted */ if (!INTR_ASSERTED(ioapic, pin)) @@ -105,8 +109,8 @@ ioapic_set_pinstate(struct vmctx *ctx, i * Level-triggered sources will work so long as there is * no sharing. */ - low = ioapic->redtbl[pin]; - high = ioapic->redtbl[pin] >> 32; + low = ioapic->rtbl[pin].reg; + high = ioapic->rtbl[pin].reg >> 32; if ((low & IOART_INTMASK) == IOART_INTMCLR && (low & IOART_DESTMOD) == IOART_DESTPHY && (low & IOART_DELMOD) == IOART_DELFIXED) { @@ -124,19 +128,47 @@ ioapic_set_pinstate(struct vmctx *ctx, i vcpu++; } } + } else if ((low & IOART_INTMASK) != IOART_INTMCLR && + low & IOART_TRGRLVL) { + /* + * For level-triggered interrupts that have been + * masked, set the pending bit so that an interrupt + * will be generated on unmask and if the level is + * still asserted + */ + ioapic_setpend++; + ioapic->rtbl[pin].pending = true; } } +static void +ioapic_set_pinstate_locked(struct vmctx *ctx, int pin, bool newstate) +{ + struct ioapic *ioapic; + + if (pin < 0 || pin >= REDIR_ENTRIES) + return; + + ioapic = &ioapics[0]; + + pthread_mutex_lock(&ioapic->mtx); + ioapic_set_pinstate(ctx, pin, newstate); + pthread_mutex_unlock(&ioapic->mtx); +} + +/* + * External entry points require locking + */ void ioapic_deassert_pin(struct vmctx *ctx, int pin) { - ioapic_set_pinstate(ctx, pin, false); + ioapic_set_pinstate_locked(ctx, pin, false); } void ioapic_assert_pin(struct vmctx *ctx, int pin) { - ioapic_set_pinstate(ctx, pin, true); + ioapic_set_pinstate_locked(ctx, pin, true); } void @@ -154,9 +186,11 @@ ioapic_init(int which) bzero(ioapic, sizeof(struct ioapic)); + pthread_mutex_init(&ioapic->mtx, NULL); + /* Initialize all redirection entries to mask all interrupts */ for (i = 0; i < REDIR_ENTRIES; i++) - ioapic->redtbl[i] = 0x0001000000010000UL; + ioapic->rtbl[i].reg = 0x0001000000010000UL; ioapic->paddr = IOAPIC_PADDR; @@ -206,14 +240,15 @@ ioapic_read(struct ioapic *ioapic, uint3 else rshift = 0; - return (ioapic->redtbl[pin] >> rshift); + return (ioapic->rtbl[pin].reg >> rshift); } return (0); } static void -ioapic_write(struct ioapic *ioapic, uint32_t addr, uint32_t data) +ioapic_write(struct vmctx *vm, struct ioapic *ioapic, uint32_t addr, + uint32_t data) { int regnum, pin, lshift; @@ -241,14 +276,31 @@ ioapic_write(struct ioapic *ioapic, uint else lshift = 0; - ioapic->redtbl[pin] &= ~((uint64_t)0xffffffff << lshift); - ioapic->redtbl[pin] |= ((uint64_t)data << lshift); + ioapic->rtbl[pin].reg &= ~((uint64_t)0xffffffff << lshift); + ioapic->rtbl[pin].reg |= ((uint64_t)data << lshift); + + if (ioapic->rtbl[pin].pending && + ((ioapic->rtbl[pin].reg & IOART_INTMASK) == + IOART_INTMCLR)) { + ioapic->rtbl[pin].pending = false; + ioapic_clearpend++; + /* + * Inject the deferred level-triggered int if it is + * still asserted. Simulate by toggling the pin + * off and then on. + */ + if (ioapic->rtbl[pin].pinstate == true) { + ioapic_togglepend++; + ioapic_set_pinstate(vm, pin, false); + ioapic_set_pinstate(vm, pin, true); + } + } } } static int -ioapic_region_read(struct ioapic *ioapic, uintptr_t paddr, int size, - uint64_t *data) +ioapic_region_read(struct vmctx *vm, struct ioapic *ioapic, uintptr_t paddr, + int size, uint64_t *data) { int offset; @@ -276,8 +328,8 @@ ioapic_region_read(struct ioapic *ioapic } static int -ioapic_region_write(struct ioapic *ioapic, uintptr_t paddr, int size, - uint64_t data) +ioapic_region_write(struct vmctx *vm, struct ioapic *ioapic, uintptr_t paddr, + int size, uint64_t data) { int offset; @@ -298,14 +350,14 @@ ioapic_region_write(struct ioapic *ioapi if (offset == IOREGSEL) ioapic->ioregsel = data; else - ioapic_write(ioapic, ioapic->ioregsel, data); + ioapic_write(vm, ioapic, ioapic->ioregsel, data); return (0); } static int ioapic_region_handler(struct vmctx *vm, int vcpu, int dir, uintptr_t paddr, - int size, uint64_t *val, void *arg1, long arg2) + int size, uint64_t *val, void *arg1, long arg2) { struct ioapic *ioapic; int which; @@ -315,10 +367,12 @@ ioapic_region_handler(struct vmctx *vm, assert(ioapic == &ioapics[which]); + pthread_mutex_lock(&ioapic->mtx); if (dir == MEM_F_READ) - ioapic_region_read(ioapic, paddr, size, val); + ioapic_region_read(vm, ioapic, paddr, size, val); else - ioapic_region_write(ioapic, paddr, size, *val); + ioapic_region_write(vm, ioapic, paddr, size, *val); + pthread_mutex_unlock(&ioapic->mtx); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 03:55:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DBCC8D88; Fri, 25 Oct 2013 03:55:52 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AE4B7278B; Fri, 25 Oct 2013 03:55:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9P3tqXP077119; Fri, 25 Oct 2013 03:55:52 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9P3tq4T077118; Fri, 25 Oct 2013 03:55:52 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310250355.r9P3tq4T077118@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 25 Oct 2013 03:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257093 - head/sys/powerpc/powermac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 03:55:52 -0000 Author: nwhitehorn Date: Fri Oct 25 03:55:52 2013 New Revision: 257093 URL: http://svnweb.freebsd.org/changeset/base/257093 Log: Be a little more suspicious of thermal sensors, which can have single crazy readings occasionally. One wild reading should not be enough to trigger a shutdown, so instead wait for several concerning readings in a row. PR: powerpc/180593 Submitted by: Julio Merino MFC after: 1 week Modified: head/sys/powerpc/powermac/powermac_thermal.c Modified: head/sys/powerpc/powermac/powermac_thermal.c ============================================================================== --- head/sys/powerpc/powermac/powermac_thermal.c Fri Oct 25 03:18:56 2013 (r257092) +++ head/sys/powerpc/powermac/powermac_thermal.c Fri Oct 25 03:55:52 2013 (r257093) @@ -68,6 +68,8 @@ struct pmac_fan_le { struct pmac_sens_le { struct pmac_therm *sensor; int last_val; +#define MAX_CRITICAL_COUNT 6 + int critical_count; SLIST_ENTRY(pmac_sens_le) entries; }; static SLIST_HEAD(pmac_fans, pmac_fan_le) fans = SLIST_HEAD_INITIALIZER(fans); @@ -106,14 +108,27 @@ pmac_therm_manage_fans(void) sensor->last_val = temp; if (sensor->last_val > sensor->sensor->max_temp) { + sensor->critical_count++; printf("WARNING: Current temperature (%s: %d.%d C) " - "exceeds critical temperature (%d.%d C)! " - "Shutting down!\n", sensor->sensor->name, - (sensor->last_val - ZERO_C_TO_K) / 10, - (sensor->last_val - ZERO_C_TO_K) % 10, - (sensor->sensor->max_temp - ZERO_C_TO_K) / 10, - (sensor->sensor->max_temp - ZERO_C_TO_K) % 10); - shutdown_nice(RB_POWEROFF); + "exceeds critical temperature (%d.%d C); " + "count=%d\n", + sensor->sensor->name, + (sensor->last_val - ZERO_C_TO_K) / 10, + (sensor->last_val - ZERO_C_TO_K) % 10, + (sensor->sensor->max_temp - ZERO_C_TO_K) / 10, + (sensor->sensor->max_temp - ZERO_C_TO_K) % 10, + sensor->critical_count); + if (sensor->critical_count >= MAX_CRITICAL_COUNT) { + printf("WARNING: %s temperature exceeded " + "critical temperature %d times in a row; " + "shutting down!\n", + sensor->sensor->name, + sensor->critical_count); + shutdown_nice(RB_POWEROFF); + } + } else { + if (sensor->critical_count > 0) + sensor->critical_count--; } } @@ -177,6 +192,8 @@ pmac_thermal_sensor_register(struct pmac list_entry = malloc(sizeof(struct pmac_sens_le), M_PMACTHERM, M_ZERO | M_WAITOK); list_entry->sensor = sensor; + list_entry->last_val = 0; + list_entry->critical_count = 0; SLIST_INSERT_HEAD(&sensors, list_entry, entries); } From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 04:06:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0FA4C1F2; Fri, 25 Oct 2013 04:06:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E21262815; Fri, 25 Oct 2013 04:06:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9P46sQW080764; Fri, 25 Oct 2013 04:06:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9P46s8A080761; Fri, 25 Oct 2013 04:06:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201310250406.r9P46s8A080761@svn.freebsd.org> From: Adrian Chadd Date: Fri, 25 Oct 2013 04:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257094 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 04:06:55 -0000 Author: adrian Date: Fri Oct 25 04:06:54 2013 New Revision: 257094 URL: http://svnweb.freebsd.org/changeset/base/257094 Log: Add a configuration file and hints file for the Alfa Networks Hornet UB board. This is another AR9331 board similar to the Carambola2. It has different ethernet and LED wiring though. They make a variety of boards that mostly differ on the amount of RAM/flash available. Alfa Networks graciously donated a handful of 64MB RAM/16MB flash boards so I can finish off 802.11s support for the AR93xx chips and do up a tech demonstration with it. This is enough to bring up the board. Tested: * Alfa networks UB Hornet board - 64MB ram, 16MB flash version. Thankyou to Alfa Networks for the development boards! Sponsored by: Alfa Networks (hardware only) Added: head/sys/mips/conf/ALFA_HORNET_UB (contents, props changed) head/sys/mips/conf/ALFA_HORNET_UB.hints (contents, props changed) Added: head/sys/mips/conf/ALFA_HORNET_UB ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/ALFA_HORNET_UB Fri Oct 25 04:06:54 2013 (r257094) @@ -0,0 +1,57 @@ +# +# Alfa Networks Hornet UB - an AR933x based SoC wifi device. +# +# http://www.alfa.com.tw/products_show.php?pc=99&ps=50 +# +# This is for the 64MB RAM/16MB flash part. They also +# do various other versions; they have different RAM/flash +# configurations. +# +# * AR9330 SoC +# * 64MB RAM +# * 16MB flash +# * Integrated 1x1 2GHz wifi and 10/100 bridge +# +# $FreeBSD$ +# + +# Include the default AR933x parameters +include "AR933X_BASE" + +ident ALFA_HORNET_UB + +# Override hints with board values +hints "ALFA_HORNET_UB.hints" + +# Board memory - 64MB +options AR71XX_REALMEM=(64*1024*1024) + +# i2c GPIO bus +#device gpioiic +#device iicbb +#device iicbus +#device iic + +# Options required for miiproxy and mdiobus +options ARGE_MDIO # Export an MDIO bus separate from arge +device miiproxy # MDIO bus <-> MII PHY rendezvous + +device etherswitch +device arswitch + +# read MSDOS formatted disks - USB +#options MSDOSFS + +# Enable the uboot environment stuff rather then the +# redboot stuff. +options AR71XX_ENV_UBOOT + +# uzip - to boot natively from flash +device geom_uncompress +options GEOM_UNCOMPRESS + +# Used for the static uboot partition map +device geom_map + +# Boot off of the rootfs, as defined in the geom_map setup. +options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" Added: head/sys/mips/conf/ALFA_HORNET_UB.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/ALFA_HORNET_UB.hints Fri Oct 25 04:06:54 2013 (r257094) @@ -0,0 +1,105 @@ +# +# This file adds to the values in AR933X_BASE.hints +# +# $FreeBSD$ + +# mdiobus on arge1 +hint.argemdio.0.at="nexus0" +hint.argemdio.0.maddr=0x1a000000 +hint.argemdio.0.msize=0x1000 +hint.argemdio.0.order=0 + +# There's no need to set the ar933x GMAC configuration bits. +# This just creates a switch instance and correctly uses it. + +# Embedded Atheros Switch +hint.arswitch.0.at="mdio0" + +# XXX this should really say it's an AR933x switch, as there +# are some vlan specific differences here! +hint.arswitch.0.is_7240=1 +hint.arswitch.0.numphys=4 +hint.arswitch.0.phy4cpu=1 # phy 4 is a "CPU" separate PHY +hint.arswitch.0.is_rgmii=0 +hint.arswitch.0.is_gmii=1 # arge1 <-> switch PHY is GMII + +# arge0 - MII, autoneg, phy(4) +hint.arge.0.phymask=0x10 # PHY4 +hint.arge.0.mdio=mdioproxy1 # .. off of the switch mdiobus + +# arge1 - GMII, 1000/full +hint.arge.1.phymask=0x0 # No directly mapped PHYs +hint.arge.1.media=1000 +hint.arge.1.fduplex=1 + +# Where the ART is - last 64k in the flash +# 0x9fff1000 ? +hint.ath.0.eepromaddr=0x1fff0000 +hint.ath.0.eepromsize=16384 + +# The board 16MiB flash layout in uboot env: +# +# 256k (uboot), 64k (uboot-env), 14336k (rootfs), 1600k (kernel), 64k (NVRAM), 64k (ART) + +# However, it boots from 0x9f050000, which is the front of the flsah! +# Thus the kernel/rootfs are switched around. + +# 256KB +hint.map.0.at="flash/spi0" +hint.map.0.start=0x00000000 +hint.map.0.end=0x000040000 +hint.map.0.name="uboot" +hint.map.0.readonly=1 + +# 64KB +hint.map.1.at="flash/spi0" +hint.map.1.start=0x00040000 +hint.map.1.end=0x00050000 +hint.map.1.name="uboot-env" +hint.map.1.readonly=0 + +# 1600KB +hint.map.2.at="flash/spi0" +hint.map.2.start=0x00050000 +hint.map.2.end=0x001e0000 +hint.map.2.name="kernel" +hint.map.2.readonly=0 + +# 14336KB +hint.map.3.at="flash/spi0" +hint.map.3.start=0x001e0000 +hint.map.3.end=0x00fe0000 +hint.map.3.name="rootfs" +hint.map.3.readonly=0 + +# NVRAM +hint.map.4.at="flash/spi0" +hint.map.4.start=0x00fe0000 +hint.map.4.end=0x00ff0000 +hint.map.4.name="cfg" +hint.map.4.readonly=0 + +# This is radio calibration section. It is (or should be!) unique +# for each board, to take into account thermal and electrical differences +# as well as the regulatory compliance data. +# +hint.map.5.at="flash/spi0" +hint.map.5.start=0x00ff0000 +hint.map.5.end=0x01000000 +hint.map.5.name="art" +hint.map.5.readonly=1 + +# GPIO specific configuration block + +# Don't flip on anything that isn't already enabled. +# This includes leaving the SPI CS1/CS2 pins as GPIO pins as they're +# not used here. +hint.gpio.0.function_set=0x00000000 +hint.gpio.0.function_clear=0x00000000 + +# These are the GPIO LEDs and buttons which can be software controlled. +#hint.gpio.0.pinmask=0x001c02ae +#hint.gpio.0.pinmask=0x00001803 + +# XXX TODO: the button and LEDs! + From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 05:11:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EED84921; Fri, 25 Oct 2013 05:11:10 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C2DB72B89; Fri, 25 Oct 2013 05:11:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9P5BAUm003507; Fri, 25 Oct 2013 05:11:10 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9P5BASp003506; Fri, 25 Oct 2013 05:11:10 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201310250511.r9P5BASp003506@svn.freebsd.org> From: Rui Paulo Date: Fri, 25 Oct 2013 05:11:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257095 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 05:11:11 -0000 Author: rpaulo Date: Fri Oct 25 05:11:10 2013 New Revision: 257095 URL: http://svnweb.freebsd.org/changeset/base/257095 Log: Allow mixing bsd.files.mk with bsd.subdir.mk. If a single Makefile wants to recurse into subdirectories and also wants to install files, bsd.files.mk's targets would get ignored in favor of those defined by bsd.subdir.mk because installfiles would not get defined in bsd.files.mk. Prevent this from happening by defining the targets in bsd.files.mk with auxiliary names and listing them as dependencies of installfiles instead. This is required by bsd.test.mk, which needs to install a Kyuafile in pretty much all cases but may also need to recurse into subdirectories for build purposes. Submitted by: Julio Merino jmmv google.com Reviewed by: sjg MFC after: 2 weeks Modified: head/share/mk/bsd.files.mk Modified: head/share/mk/bsd.files.mk ============================================================================== --- head/share/mk/bsd.files.mk Fri Oct 25 04:06:54 2013 (r257094) +++ head/share/mk/bsd.files.mk Fri Oct 25 05:11:10 2013 (r257095) @@ -14,9 +14,9 @@ buildfiles: ${${group}} all: buildfiles -.if !target(installfiles) .for group in ${FILESGROUPS} .if defined(${group}) && !empty(${group}) +installfiles: installfiles-${group} ${group}OWN?= ${SHAREOWN} ${group}GRP?= ${SHAREGRP} @@ -37,7 +37,7 @@ ${group}NAME_${file:T}?= ${${group}NAME} .else ${group}NAME_${file:T}?= ${file:T} .endif -installfiles: _${group}INS_${file:T} +installfiles-${group}: _${group}INS_${file:T} _${group}INS_${file:T}: ${file} ${INSTALL} -o ${${group}OWN_${.ALLSRC:T}} \ -g ${${group}GRP_${.ALLSRC:T}} -m ${${group}MODE_${.ALLSRC:T}} \ @@ -48,7 +48,7 @@ _${group}FILES+= ${file} .endif .endfor .if !empty(_${group}FILES) -installfiles: _${group}INS +installfiles-${group}: _${group}INS _${group}INS: ${_${group}FILES} .if defined(${group}NAME) ${INSTALL} -o ${${group}OWN} -g ${${group}GRP} \ @@ -63,7 +63,5 @@ _${group}INS: ${_${group}FILES} .endif # defined(${group}) && !empty(${group}) .endfor -.endif # !target(installfiles) - realinstall: installfiles .ORDER: beforeinstall installfiles From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 05:12:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 987A7AB6; Fri, 25 Oct 2013 05:12:32 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 867E02B94; Fri, 25 Oct 2013 05:12:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9P5CWD6003742; Fri, 25 Oct 2013 05:12:32 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9P5CWXG003740; Fri, 25 Oct 2013 05:12:32 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201310250512.r9P5CWXG003740@svn.freebsd.org> From: Rui Paulo Date: Fri, 25 Oct 2013 05:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257096 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 05:12:32 -0000 Author: rpaulo Date: Fri Oct 25 05:12:31 2013 New Revision: 257096 URL: http://svnweb.freebsd.org/changeset/base/257096 Log: Move the TESTSBASE definition to bsd.own.mk. We need to be able to reference the value of TESTSBASE without requiring the inclusion of bsd.test.mk (e.g. in etc/Makefile), so move its definition to the more generic bsd.own.mk. Submitted by: Julio Merino jmmv google.com Reviewed by: sjg MFC after: 2 weeks Modified: head/share/mk/bsd.own.mk head/share/mk/bsd.test.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Fri Oct 25 05:11:10 2013 (r257095) +++ head/share/mk/bsd.own.mk Fri Oct 25 05:12:31 2013 (r257096) @@ -664,4 +664,8 @@ $xGRP= ${_gid} .endif # !_WITHOUT_SRCCONF +# Pointer to the top directory into which tests are installed. Should not be +# overriden by Makefiles, but the user may choose to set this in src.conf(5). +TESTSBASE?= /usr/tests + .endif # !target(____) Modified: head/share/mk/bsd.test.mk ============================================================================== --- head/share/mk/bsd.test.mk Fri Oct 25 05:11:10 2013 (r257095) +++ head/share/mk/bsd.test.mk Fri Oct 25 05:12:31 2013 (r257096) @@ -12,10 +12,6 @@ .include -# Pointer to the top directory into which tests are installed. Should not be -# overriden by Makefiles, but the user may choose to set this in src.conf(5). -TESTSBASE?= /usr/tests - # Directory in which to install tests defined by the current Makefile. # Makefiles have to override this to point to a subdirectory of TESTSBASE. TESTSDIR?= . From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 05:25:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1937AEC4; Fri, 25 Oct 2013 05:25:22 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ECDF92C1C; Fri, 25 Oct 2013 05:25:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9P5PLs0007360; Fri, 25 Oct 2013 05:25:21 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9P5PJGi007346; Fri, 25 Oct 2013 05:25:19 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201310250525.r9P5PJGi007346@svn.freebsd.org> From: Rui Paulo Date: Fri, 25 Oct 2013 05:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257097 - in head: . etc etc/mtree lib/libcrypt lib/libcrypt/tests share/mk tests tests/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 05:25:22 -0000 Author: rpaulo Date: Fri Oct 25 05:25:19 2013 New Revision: 257097 URL: http://svnweb.freebsd.org/changeset/base/257097 Log: Set up the /usr/tests hierarchy. Populate /usr/tests with the only test programs that currently live in the tree (those in lib/libcrypt/tests/) and add all the build machinery to accompany this change. In particular: - Add a WITHOUT_TESTS variable that users can define to request that no tests be put in /usr/tests. - Add a top-level Kyuafile for /usr/tests and a way to create similar Kyuafiles in top-level subdirectories. - Add a BSD.tests.dist file to define the directory layout of /usr/tests. Submitted by: Julio Merino jmmv google.com Reviewed by: sjg MFC after: 2 weeks Added: head/etc/mtree/BSD.tests.dist (contents, props changed) head/tests/ head/tests/Kyuafile (contents, props changed) head/tests/Makefile (contents, props changed) head/tests/README (contents, props changed) head/tests/lib/ head/tests/lib/Makefile (contents, props changed) Modified: head/Makefile.inc1 head/etc/Makefile head/lib/libcrypt/Makefile head/lib/libcrypt/tests/Makefile head/share/mk/bsd.own.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Oct 25 05:12:31 2013 (r257096) +++ head/Makefile.inc1 Fri Oct 25 05:25:19 2013 (r257097) @@ -85,6 +85,9 @@ SUBDIR+=secure SUBDIR+=share .endif SUBDIR+=sys usr.bin usr.sbin +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .if ${MK_OFED} != "no" SUBDIR+=contrib/ofed .endif @@ -489,6 +492,10 @@ _worldtmp: mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ -p ${WORLDTMP}/usr/lib >/dev/null .endif +.if ${MK_TESTS} != "no" + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ + -p ${WORLDTMP}${TESTSBASE} >/dev/null +.endif .for _mtree in ${LOCAL_MTREE} mtree -deU -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null .endfor Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Fri Oct 25 05:12:31 2013 (r257096) +++ head/etc/Makefile Fri Oct 25 05:25:19 2013 (r257097) @@ -139,6 +139,9 @@ BIN1+= regdomain.xml BIN2= netstart pccard_ether rc.suspend rc.resume MTREE= BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist +.if ${MK_TESTS} != "no" +MTREE+= BSD.tests.dist +.endif .if ${MK_SENDMAIL} != "no" MTREE+= BSD.sendmail.dist .endif @@ -314,6 +317,9 @@ MTREES+= mtree/BSD.debug.dist /usr/lib .if ${MK_GROFF} != "no" MTREES+= mtree/BSD.groff.dist /usr .endif +.if ${MK_TESTS} != "no" +MTREES+= mtree/BSD.tests.dist ${TESTSBASE} +.endif .if ${MK_SENDMAIL} != "no" MTREES+= mtree/BSD.sendmail.dist / .endif Added: head/etc/mtree/BSD.tests.dist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/mtree/BSD.tests.dist Fri Oct 25 05:25:19 2013 (r257097) @@ -0,0 +1,12 @@ +# $FreeBSD$ +# +# Please see the file src/etc/mtree/README before making changes to this file. +# + +/set type=dir uname=root gname=wheel mode=0755 +. + lib + libcrypt + .. + .. +.. Modified: head/lib/libcrypt/Makefile ============================================================================== --- head/lib/libcrypt/Makefile Fri Oct 25 05:12:31 2013 (r257096) +++ head/lib/libcrypt/Makefile Fri Oct 25 05:25:19 2013 (r257097) @@ -37,4 +37,9 @@ WARNS?= 2 PRECIOUSLIB= +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include +.include Modified: head/lib/libcrypt/tests/Makefile ============================================================================== --- head/lib/libcrypt/tests/Makefile Fri Oct 25 05:12:31 2013 (r257096) +++ head/lib/libcrypt/tests/Makefile Fri Oct 25 05:25:19 2013 (r257097) @@ -2,6 +2,8 @@ # exercise libcrypt +TESTSDIR= ${TESTSBASE}/lib/libcrypt + ATF_TESTS_C= crypt_tests CFLAGS+= -I${.CURDIR:H} Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Fri Oct 25 05:12:31 2013 (r257096) +++ head/share/mk/bsd.own.mk Fri Oct 25 05:25:19 2013 (r257097) @@ -350,6 +350,7 @@ __DEFAULT_YES_OPTIONS = \ SYSINSTALL \ TCSH \ TELNET \ + TESTS \ TEXTPROC \ TOOLCHAIN \ UNBOUND \ Added: head/tests/Kyuafile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/Kyuafile Fri Oct 25 05:25:19 2013 (r257097) @@ -0,0 +1,52 @@ +-- $FreeBSD$ +-- +-- Copyright 2011 Google 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: +-- +-- * Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- * Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS AND CONTRIBUTORS +-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-- Automatically recurses into any subdirectory that holds a Kyuafile. +-- As such, this Kyuafile is suitable for installation into the root of +-- the tests hierarchy as well as into any other subdirectory that needs +-- "auto-discovery" of tests. +-- +-- This file is based on the Kyuafile.top sample file distributed in the +-- kyua-cli package. + +syntax(2) + +local directory = fs.dirname(current_kyuafile()) +for file in fs.files(directory) do + if file == "." or file == ".." then + -- Skip these special entries. + else + local kyuafile_relative = fs.join(file, "Kyuafile") + local kyuafile_absolute = fs.join(directory, kyuafile_relative) + if fs.exists(kyuafile_absolute) then + include(kyuafile_relative) + end + end +end Added: head/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/Makefile Fri Oct 25 05:25:19 2013 (r257097) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +.include + +TESTS_SUBDIRS= lib + +TESTSDIR= ${TESTSBASE} + +KYUAFILE= yes + +.include Added: head/tests/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/README Fri Oct 25 05:25:19 2013 (r257097) @@ -0,0 +1,56 @@ +src/tests: The FreeBSD test suite +================================= + +This file describes the build infrastructure of the FreeBSD test suite. +If you are only interested in using the test suite itself, please refer +to tests(7) instead. + +The build of the test suite is organized in the following manner: + +* The build of all test artifacts is protected by the MK_TESTS knob. + The user can disable these with the WITHOUT_TESTS setting in + src.conf(5). + +* The goal for /usr/tests/ (the installed test programs) is to follow + the same hierarchy as /usr/src/ wherever possible, which in turn drives + several of the design decisions described below. This simplifies the + discoverability of tests. We want a mapping such as: + + /usr/src/bin/cp/ -> /usr/tests/bin/cp/ + /usr/src/lib/libc/ -> /usr/tests/lib/libc/ + /usr/src/usr.bin/cut/ -> /usr/tests/usr.bin/cut/ + ... and many more ... + +* Test programs for specific utilities and libraries are located next + to the source code of such programs. For example, the tests for the + src/lib/libcrypt/ library live in src/lib/libcrypt/tests/. The tests/ + subdirectory is optional and should, in general, be avoided. + +* The src/tests/ hierarchy (this directory) provides generic test + infrastructure and glue code to join all test programs together into + a single test suite definition. + +* The src/tests/ hierarchy also includes cross-functional test programs: + i.e. test programs that cover more than a single utility or library + and thus don't fit anywhere else in the tree. Consider this to follow + the same rationale as src/share/man/: this directory contains generic + manual pages while the manual pages that are specific to individual + tools or libraries live next to the source code. + +In order to keep the src/tests/ hierarchy decoupled from the actual test +programs being installed --which is a worthy goal because it simplifies +the addition of new test programs and simplifies the maintenance of the +tree-- the top-level Kyuafile does not know which subdirectories may +exist upfront. Instead, such Kyuafile automatically detects, at +run-time, which */Kyuafile files exist and uses those directly. + +Similarly, every category subdirectory within src/tests/ provides the +same Kyuafile with auto-discovery features. For example: src/tests/lib/ +holds a generic Makefile to install test-suite related material but such +directory does not know upfront which libraries within src/lib/ will +install tests. For this reason, the Kyuafile in src/tests/lib/ has to +also use the auto-discovery features. The same applies for any other +category subdirectory (e.g. bin, usr.sbin, etc.). + +-- +$FreeBSD$ Added: head/tests/lib/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/lib/Makefile Fri Oct 25 05:25:19 2013 (r257097) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/lib + +KYUAFILE= yes + +CLEANFILES+= Kyuafile +Kyuafile: ${.CURDIR}/../Kyuafile + cp -f ${.CURDIR}/../Kyuafile . + +.include From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 05:27:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 34D4813A; Fri, 25 Oct 2013 05:27:37 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 22D3E2C35; Fri, 25 Oct 2013 05:27:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9P5RbN9007622; Fri, 25 Oct 2013 05:27:37 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9P5RaF9007621; Fri, 25 Oct 2013 05:27:36 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201310250527.r9P5RaF9007621@svn.freebsd.org> From: Rui Paulo Date: Fri, 25 Oct 2013 05:27:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257098 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 05:27:37 -0000 Author: rpaulo Date: Fri Oct 25 05:27:36 2013 New Revision: 257098 URL: http://svnweb.freebsd.org/changeset/base/257098 Log: Add missing WITHOUT_TESTS file. Submitted by: Julio Merio jmmv google.com Reviewed by: sjg MFC after: 2 weeks Added: head/tools/build/options/WITHOUT_TESTS (contents, props changed) Added: head/tools/build/options/WITHOUT_TESTS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_TESTS Fri Oct 25 05:27:36 2013 (r257098) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build any test programs nor install them in /usr/tests. From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 05:31:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 87FA84D2; Fri, 25 Oct 2013 05:31:27 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 75F6E2C8C; Fri, 25 Oct 2013 05:31:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9P5VRB3010244; Fri, 25 Oct 2013 05:31:27 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9P5VRGW010243; Fri, 25 Oct 2013 05:31:27 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201310250531.r9P5VRGW010243@svn.freebsd.org> From: Rui Paulo Date: Fri, 25 Oct 2013 05:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257099 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 05:31:27 -0000 Author: rpaulo Date: Fri Oct 25 05:31:26 2013 New Revision: 257099 URL: http://svnweb.freebsd.org/changeset/base/257099 Log: Add missing plain.test.mk. Submitted by: Julio Merino jmmv google.com MFC after: 2 weeks Added: head/share/mk/plain.test.mk (contents, props changed) Added: head/share/mk/plain.test.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/mk/plain.test.mk Fri Oct 25 05:31:26 2013 (r257099) @@ -0,0 +1,51 @@ +# $FreeBSD$ +# +# Logic to build and install plain test programs. A plain test programs it not +# supposed to use any specific testing framework: all it does is run some code +# and report the test's pass or fail status via a 0 or 1 exit code. + +.include + +# List of C, C++ and shell test programs to build. +# +# Programs listed here are built according to the semantics of bsd.prog.mk for +# PROGS, PROGS_CXX and SCRIPTS, respectively. +# +# Test programs registered in this manner are set to be installed into TESTSDIR +# (which should be overriden by the Makefile) and are not required to provide a +# manpage. +PLAIN_TESTS_C?= +PLAIN_TESTS_CXX?= +PLAIN_TESTS_SH?= + +.if !empty(PLAIN_TESTS_C) +PROGS+= ${PLAIN_TESTS_C} +_TESTS+= ${PLAIN_TESTS_C} +.for _T in ${PLAIN_TESTS_C} +BINDIR.${_T}= ${TESTSDIR} +MAN.${_T}?= # empty +TEST_INTERFACE.${_T}= plain +.endfor +.endif + +.if !empty(PLAIN_TESTS_CXX) +PROGS_CXX+= ${PLAIN_TESTS_CXX} +PROGS+= ${PLAIN_TESTS_CXX} +_TESTS+= ${PLAIN_TESTS_CXX} +.for _T in ${PLAIN_TESTS_CXX} +BINDIR.${_T}= ${TESTSDIR} +MAN.${_T}?= # empty +TEST_INTERFACE.${_T}= plain +.endfor +.endif + +.if !empty(PLAIN_TESTS_SH) +SCRIPTS+= ${PLAIN_TESTS_SH} +_TESTS+= ${PLAIN_TESTS_SH} +.for _T in ${PLAIN_TESTS_SH} +SCRIPTSDIR_${_T}= ${TESTSDIR} +TEST_INTERFACE.${_T}= plain +.endfor +.endif + +.include From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 05:33:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DA09A669; Fri, 25 Oct 2013 05:33:05 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B8C152C9D; Fri, 25 Oct 2013 05:33:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9P5X5p9010504; Fri, 25 Oct 2013 05:33:05 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9P5X5GV010499; Fri, 25 Oct 2013 05:33:05 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201310250533.r9P5X5GV010499@svn.freebsd.org> From: Rui Paulo Date: Fri, 25 Oct 2013 05:33:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257100 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 05:33:05 -0000 Author: rpaulo Date: Fri Oct 25 05:33:04 2013 New Revision: 257100 URL: http://svnweb.freebsd.org/changeset/base/257100 Log: Add a tests(7) manual page. This manual page intends to describe the structure and behavior of the FreeBSD test suite installed in /usr/tests. The contents have been inherited from the NetBSD manual page. As a side effect, this also updates the hier(7) manual page to mention /usr/tests and points at tests(7) for more details. Submitted by: Julio Merino jmmv google.com Reviewed by: sjg MFC after: 2 weeks Added: head/share/man/man7/tests.7 (contents, props changed) Modified: head/share/man/man7/Makefile head/share/man/man7/hier.7 Modified: head/share/man/man7/Makefile ============================================================================== --- head/share/man/man7/Makefile Fri Oct 25 05:31:26 2013 (r257099) +++ head/share/man/man7/Makefile Fri Oct 25 05:33:04 2013 (r257100) @@ -29,6 +29,10 @@ MAN= adding_user.7 \ sticky.7 \ tuning.7 +.if ${MK_TESTS} != "no" +MAN+= tests.7 +.endif + MLINKS= intro.7 miscellaneous.7 MLINKS+= security.7 securelevel.7 MLINKS+= c99.7 c.7 Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Fri Oct 25 05:31:26 2013 (r257099) +++ head/share/man/man7/hier.7 Fri Oct 25 05:33:04 2013 (r257100) @@ -32,7 +32,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd January 21, 2010 +.Dd October 19, 2013 .Dt HIER 7 .Os .Sh NAME @@ -692,6 +692,12 @@ source code for files in source code for files in .Pa /usr/sbin .El +.Pp +.It Pa tests/ +The +.Fx +test suite. +See tests(7) for more details. .El .It Pa /var/ multi-purpose log, temporary, transient, and spool files Added: head/share/man/man7/tests.7 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man7/tests.7 Fri Oct 25 05:33:04 2013 (r257100) @@ -0,0 +1,199 @@ +.\" $FreeBSD$ +.\" $NetBSD: tests.kyua.7,v 1.2 2013/07/20 21:39:59 wiz Exp $ +.\" +.\" Copyright (c) 2010 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND +.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY +.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd October 19, 2013 +.Dt TESTS 7 +.Os +.Sh NAME +.Nm tests +.Nd introduction to the FreeBSD test suite +.Sh DESCRIPTION +The +.Fx +test suite provides a collection of automated tests for two major purposes. +On the one hand, the test suite aids +.Em developers +in catching bugs and regressions in the code when they performing modifications +to the source tree. +On the other hand, the test suite allows +.Em end users +(and, in particular, system administrators) to verify that fresh installations +of the +.Fx +operating system behave correctly in their hardware platform and also to ensure +that the system does not suffer from regressions during regular system +operation and maintenance. +.Pp +The +.Fx +test suite is installed under the +.Pa /usr/tests +hierarchy. +.Pp +This manual page describes how to execute the test suite and how to configure +some of its optional features. +.Ss When to run the tests? +Before diving into the details of how to run the test suite, here are some +scenarios in which you should be running them: +.Bl -bullet -offset indent +.It +After a fresh installation of +.Fx +to ensure that the system works correctly on your hardware platform. +.It +After an upgrade of +.Fx +to a different version to ensure that the new code works well on your +hardware platform and that the upgrade did not introduce regressions in your +configuration. +.It +After performing changes to the source tree to catch any bugs and/or regressions +introduced by the modifications. +.It +Periodically, maybe from a +.Xr cron 8 +job, to ensure that any changes to the system (such as the installation of +third-party packages or manual modifications to configuration files) do not +introduce unexpected failures. +.El +.Ss Running the tests +First of all, you will need to install the +.Sq ports/devel/kyua +package. +.Pp +Use the following command to run the whole test suite: +.Bd -literal -offset indent +$ kyua test -k /usr/tests/Kyuafile +.Ed +.Pp +The above will go through all test programs in +.Pa /usr/tests +recursively, execute them, store their results and debugging data in Kyua +database (by default in +.Pa ~/.kyua/store.db ) , +and print a summary of the results. +This summary includes a brief count of all total tests run and how many of +them failed. +.Pp +It is possible to restrict which tests to run by providing their names in +the command line. +For example, this would execute the tests for the +.Xr cp 1 +and +.Xr cut 1 +utilities: +.Bd -literal -offset indent +$ kyua test -k /usr/tests/Kyuafile bin/cp usr.bin/cut +.Ed +.Ss Obtaining reports of the tests execution +Additional information of the results of the execution can be later extracted +from the database by using the various reporting commands of Kyua. +For example, the following would extract a plain-text report of the executed +tests and show which ones failed: +.Bd -literal -offset indent +$ kyua report +.Ed +.Pp +This other example would generate an HTML report ready to be published on a +web server: +.Bd -literal -offset indent +$ kyua report-html --output ~/public_html/tests +.Ed +.Pp +For further details on the command-line interface of Kyua, please refer +to its manual page +.Xr kyua 1 . +.\".Ss Configuring the tests +.\"Some test cases in the +.\".Fx +.\"test suite require the administrator to manually set up some configuration +.\"properties before they can run. +.\"Unless these properties are defined, the tests that require them will be marked +.\"as skipped and thus they will not be really executed. +.\".Pp +.\"Test suites are configured by defining the values to their configuration +.\"variables in +.\".Pa /usr/local/etc/kyua/kyua.conf . +.\"The format of this file is detailed in +.\".Xr kyua.conf 5 . +.\".Pp +.\"The following configuration variables are available in the +.\".Fx +.\"test suite: +.\".Bl -tag +.\".It NONE REGISTERED YET +.\"TBD. +.Ss What to do if something fails? +If there is +.Em any failure +during the execution of the test suite, please considering reporting it to the +.Fx +developers so that the failure can be analyzed and fixed. +To do so, either send a message to the appropriate mailing list or file a +problem report. +For more details please refer to: +.Bl -bullet -offset indent -compact +.It +.Lk http://lists.freebsd.org/ "FreeBSD Mailing Lists" +.It +.Lk http://www.freebsd.org/send-pr.html "Submit a FreeBSD Problem Report" +.El +.Sh FILES +.Bl -tag -compact -width usrXlocalXetcXkyuaXkyuaXconfXX +.It Pa /usr/local/etc/kyua/kyua.conf +System-wide configuration file for +.Xr kyua 1 . +.It Pa ~/.kyua/kyua.conf +User-specific configuration file for +.Xr kyua 1 ; +overrides the system file. +.It Pa ~/.kyua/store.db +Default database used by Kyua to maintain the data of the executed tests. +.It Pa /usr/tests/ +Location of the +.Fx +test suite. +.It Pa /usr/tests/Kyuafile +Top-level test suite definition file. +.El +.Sh SEE ALSO +.Xr kyua 1 . +.Sh HISTORY +The collection of test programs in +.Pa /usr/tests +first appeared in +.Fx 11.0 . +.Pp +The +.Nm +manual page first appeared in +.Nx 6.0 +and was later ported to +.Fx 11.0 . +.Sh AUTHORS +.An Julio Merino Aq Mt jmmv@google.com From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 06:03:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DF9B7F62; Fri, 25 Oct 2013 06:03:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CB7C12E11; Fri, 25 Oct 2013 06:03:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9P637hH020308; Fri, 25 Oct 2013 06:03:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9P637Ul020307; Fri, 25 Oct 2013 06:03:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310250603.r9P637Ul020307@svn.freebsd.org> From: Alexander Motin Date: Fri, 25 Oct 2013 06:03:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r257101 - stable/9/sbin/camcontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 06:03:08 -0000 Author: mav Date: Fri Oct 25 06:03:07 2013 New Revision: 257101 URL: http://svnweb.freebsd.org/changeset/base/257101 Log: MFC r256317: Fix mode page length calculation to remove last garbage line from the `camcontrol mode daX -l` output. Modified: stable/9/sbin/camcontrol/modeedit.c Directory Properties: stable/9/sbin/camcontrol/ (props changed) Modified: stable/9/sbin/camcontrol/modeedit.c ============================================================================== --- stable/9/sbin/camcontrol/modeedit.c Fri Oct 25 05:33:04 2013 (r257100) +++ stable/9/sbin/camcontrol/modeedit.c Fri Oct 25 06:03:07 2013 (r257101) @@ -886,12 +886,12 @@ mode_list(struct cam_device *device, int timeout, data, sizeof(data)); mh = (struct scsi_mode_header_6 *)data; - len = mh->blk_desc_len; /* Skip block descriptors. */ + len = sizeof(*mh) + mh->blk_desc_len; /* Skip block descriptors. */ /* Iterate through the pages in the reply. */ while (len < mh->data_length) { /* Locate the next mode page header. */ mph = (struct scsi_mode_page_header *) - ((intptr_t)mh + sizeof(*mh) + len); + ((intptr_t)mh + len); mph->page_code &= SMS_PAGE_CODE; nameentry = nameentry_lookup(mph->page_code); From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 06:04:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BBB67150; Fri, 25 Oct 2013 06:04:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A93982E1D; Fri, 25 Oct 2013 06:04:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9P64Lie020638; Fri, 25 Oct 2013 06:04:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9P64LA6020637; Fri, 25 Oct 2013 06:04:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310250604.r9P64LA6020637@svn.freebsd.org> From: Alexander Motin Date: Fri, 25 Oct 2013 06:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r257102 - stable/8/sbin/camcontrol X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 06:04:21 -0000 Author: mav Date: Fri Oct 25 06:04:21 2013 New Revision: 257102 URL: http://svnweb.freebsd.org/changeset/base/257102 Log: MFC r256317: Fix mode page length calculation to remove last garbage line from the `camcontrol mode daX -l` output. Modified: stable/8/sbin/camcontrol/modeedit.c Directory Properties: stable/8/sbin/camcontrol/ (props changed) Modified: stable/8/sbin/camcontrol/modeedit.c ============================================================================== --- stable/8/sbin/camcontrol/modeedit.c Fri Oct 25 06:03:07 2013 (r257101) +++ stable/8/sbin/camcontrol/modeedit.c Fri Oct 25 06:04:21 2013 (r257102) @@ -888,12 +888,12 @@ mode_list(struct cam_device *device, int timeout, data, sizeof(data)); mh = (struct scsi_mode_header_6 *)data; - len = mh->blk_desc_len; /* Skip block descriptors. */ + len = sizeof(*mh) + mh->blk_desc_len; /* Skip block descriptors. */ /* Iterate through the pages in the reply. */ while (len < mh->data_length) { /* Locate the next mode page header. */ mph = (struct scsi_mode_page_header *) - ((intptr_t)mh + sizeof(*mh) + len); + ((intptr_t)mh + len); mode_pars = MODE_PAGE_DATA(mph); mph->page_code &= SMS_PAGE_CODE; From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 06:37:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C5E3ED09; Fri, 25 Oct 2013 06:37:43 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B3ABD2FF9; Fri, 25 Oct 2013 06:37:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9P6bh2P032479; Fri, 25 Oct 2013 06:37:43 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9P6bhkC032478; Fri, 25 Oct 2013 06:37:43 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201310250637.r9P6bhkC032478@svn.freebsd.org> From: Rui Paulo Date: Fri, 25 Oct 2013 06:37:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257105 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 06:37:43 -0000 Author: rpaulo Date: Fri Oct 25 06:37:43 2013 New Revision: 257105 URL: http://svnweb.freebsd.org/changeset/base/257105 Log: Disable WITH_TESTS= for now. Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Fri Oct 25 06:15:23 2013 (r257104) +++ head/share/mk/bsd.own.mk Fri Oct 25 06:37:43 2013 (r257105) @@ -350,7 +350,6 @@ __DEFAULT_YES_OPTIONS = \ SYSINSTALL \ TCSH \ TELNET \ - TESTS \ TEXTPROC \ TOOLCHAIN \ UNBOUND \ @@ -378,6 +377,7 @@ __DEFAULT_NO_OPTIONS = \ PKGTOOLS \ SHARED_TOOLCHAIN \ SVN \ + TESTS \ USB_GADGET_EXAMPLES # From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 06:47:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B18E8360; Fri, 25 Oct 2013 06:47:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E1C520BE; Fri, 25 Oct 2013 06:47:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9P6l1I8035840; Fri, 25 Oct 2013 06:47:01 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9P6l1fW035839; Fri, 25 Oct 2013 06:47:01 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201310250647.r9P6l1fW035839@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 25 Oct 2013 06:47:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r257106 - stable/8/sys/dev/usb/controller X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 06:47:01 -0000 Author: hselasky Date: Fri Oct 25 06:47:01 2013 New Revision: 257106 URL: http://svnweb.freebsd.org/changeset/base/257106 Log: MFC r256750: Improve XHCI stability. When a command timeout happens, the command should be aborted else the command queue can stop. Refer to section "4.6.1.2" of the XHCI specification. Modified: stable/8/sys/dev/usb/controller/xhci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/8/sys/dev/usb/controller/xhci.c Fri Oct 25 06:37:43 2013 (r257105) +++ stable/8/sys/dev/usb/controller/xhci.c Fri Oct 25 06:47:01 2013 (r257106) @@ -1110,6 +1110,25 @@ xhci_do_command(struct xhci_softc *sc, s } if (err != 0) { DPRINTFN(0, "Command timeout!\n"); + + /* + * Try to abort the last command as per section + * 4.6.1.2 "Aborting a Command" of the XHCI + * specification: + */ + temp = XREAD4(sc, oper, XHCI_CRCR_LO); + XWRITE4(sc, oper, XHCI_CRCR_LO, temp | XHCI_CRCR_LO_CA); + + /* wait for abort event, if any */ + err = cv_timedwait(&sc->sc_cmd_cv, &sc->sc_bus.bus_mtx, hz / 16); + + if (err != 0 && xhci_interrupt_poll(sc) != 0) { + DPRINTF("Command was completed when polling\n"); + err = 0; + } + if (err != 0) { + DPRINTF("Command abort timeout!\n"); + } err = USB_ERR_TIMEOUT; trb->dwTrb2 = 0; trb->dwTrb3 = 0; From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 06:48:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2D55B504; Fri, 25 Oct 2013 06:48:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 191EA20D3; Fri, 25 Oct 2013 06:48:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9P6mvL6036095; Fri, 25 Oct 2013 06:48:57 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9P6mvni036094; Fri, 25 Oct 2013 06:48:57 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201310250648.r9P6mvni036094@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 25 Oct 2013 06:48:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r257107 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 06:48:58 -0000 Author: hselasky Date: Fri Oct 25 06:48:57 2013 New Revision: 257107 URL: http://svnweb.freebsd.org/changeset/base/257107 Log: MFC r256750: Improve XHCI stability. When a command timeout happens, the command should be aborted else the command queue can stop. Refer to section "4.6.1.2" of the XHCI specification. Modified: stable/9/sys/dev/usb/controller/xhci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.c Fri Oct 25 06:47:01 2013 (r257106) +++ stable/9/sys/dev/usb/controller/xhci.c Fri Oct 25 06:48:57 2013 (r257107) @@ -1110,6 +1110,25 @@ xhci_do_command(struct xhci_softc *sc, s } if (err != 0) { DPRINTFN(0, "Command timeout!\n"); + + /* + * Try to abort the last command as per section + * 4.6.1.2 "Aborting a Command" of the XHCI + * specification: + */ + temp = XREAD4(sc, oper, XHCI_CRCR_LO); + XWRITE4(sc, oper, XHCI_CRCR_LO, temp | XHCI_CRCR_LO_CA); + + /* wait for abort event, if any */ + err = cv_timedwait(&sc->sc_cmd_cv, &sc->sc_bus.bus_mtx, hz / 16); + + if (err != 0 && xhci_interrupt_poll(sc) != 0) { + DPRINTF("Command was completed when polling\n"); + err = 0; + } + if (err != 0) { + DPRINTF("Command abort timeout!\n"); + } err = USB_ERR_TIMEOUT; trb->dwTrb2 = 0; trb->dwTrb3 = 0; From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 07:48:18 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 66E9568C; Fri, 25 Oct 2013 07:48:18 +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 A3554242C; Fri, 25 Oct 2013 07:48:16 +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 KAA11918; Fri, 25 Oct 2013 10:48:13 +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 1VZc7x-000A96-1C; Fri, 25 Oct 2013 10:48:13 +0300 Message-ID: <526A2204.3000902@FreeBSD.org> Date: Fri, 25 Oct 2013 10:47:16 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Will Andrews , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r248653 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201303231634.r2NGYvoj099629@svn.freebsd.org> In-Reply-To: <201303231634.r2NGYvoj099629@svn.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 07:48:18 -0000 on 23/03/2013 18:34 Will Andrews said the following: > Author: will > Date: Sat Mar 23 16:34:56 2013 > New Revision: 248653 > URL: http://svnweb.freebsd.org/changeset/base/248653 > > Log: > ZFS: Fix a panic while unmounting a busy filesystem. > > This particular scenario was easily reproduced using a NFS export. When the > first 'zfs unmount' occurred, it returned EBUSY via this path, while > vflush() had flushed references on the filesystem's root vnode, which in > turn caused its v_interlock to be destroyed. The next time 'zfs unmount' > was called, vflush() tried to obtain this lock, which caused this panic. > > Since vflush() on FreeBSD is a definitive call, there is no need to check > vfsp->vfs_count after it completes. Simply #ifdef sun this check. > > Submitted by: avg > Reviewed by: avg > Approved by: ken (mentor) > MFC after: 1 month MFC timer expired half a year ago. Could you please MFC this change? I believe that we've just run into the same or similar panic on stable/9 (no NFS was involved though): #2 0xffffffff808f9d07 in panic (fmt=0x1
) at /usr/src/sys/kern/kern_shutdown.c:637 #3 0xffffffff80cecac0 in trap_fatal (frame=0xc, eva=) at /usr/src/sys/amd64/amd64/trap.c:879 #4 0xffffffff80cece21 in trap_pfault (frame=0xffffff911d7e85b0, usermode=0) at /usr/src/sys/amd64/amd64/trap.c:795 #5 0xffffffff80ced3d4 in trap (frame=0xffffff911d7e85b0) at /usr/src/sys/amd64/amd64/trap.c:463 #6 0xffffffff80cd61e3 in calltrap () at /usr/src/sys/amd64/amd64/exception.S:232 #7 0xffffffff808e5d1d in _mtx_lock_sleep (m=0xfffffe01ec9a50c8, tid=18446741917998455072, opts=, file=, line=0) at /usr/src/sys/kern/kern_mutex.c:394 #8 0xffffffff8099f38d in vflush (mp=, rootrefs=1, flags=, td=0xfffffe0a159b1920) at /usr/src/sys/kern/vfs_subr.c:2705 #9 0xffffffff817ed852 in zfs_umount (vfsp=0xfffffe02aa9ad9a8, fflag=) at /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c:1982 (kgdb) p *rootvp $1 = {v_type = VBAD, v_tag = 0xffffffff80f7fd7c "none", v_op = 0xffffffff812eb6a0, v_data = 0x0, v_mount = 0x0, v_nmntvnodes = {tqe_next = 0xfffffe0fc06a3800, tqe_prev = 0xfffffe02aa9ada08}, v_un = {vu_mount = 0x0, vu_socket = 0x0, vu_cdev = 0x0, vu_fifoinfo = 0x0}, v_hashlist = {le_next = 0x0, le_prev = 0x0}, v_hash = 2155554452, v_cache_src = {lh_first = 0x0}, v_cache_dst = {tqh_first = 0x0, tqh_last = 0xfffffe01ec9a5060}, v_cache_dd = 0x0, v_cstart = 0, v_lasta = 0, v_lastw = 0, v_clen = 0, v_lock = {lock_object = {lo_name = 0xffffffff8185f1ac "zfs", lo_flags = 108658688, lo_data = 0, lo_witness = 0x0}, lk_lock = 1, lk_exslpfail = 0, lk_timo = 51, lk_pri = 96}, v_interlock = {lock_object = {lo_name = 0xffffffff80f9ae39 "vnode interlock", lo_flags = 16908288, lo_data = 0, lo_witness = 0x0}, mtx_lock = 6}, v_vnlock = 0xfffffe01ec9a5098, v_holdcnt = 0, v_usecount = 0, v_iflag = 128, v_vflag = 1, v_writecount = 0, v_actfreelist = {tqe_next = 0x0, tqe_prev = 0xfffffe02aa9ada20}, v_bufobj = {bo_mtx = {lock_object = {lo_name = 0xffffffff80f9ae49 "bufobj interlock", lo_flags = 16908288, lo_data = 0, lo_witness = 0x0}, mtx_lock = 6}, bo_clean = {bv_hd = {tqh_first = 0x0, tqh_last = 0xfffffe01ec9a5140}, bv_root = 0x0, bv_cnt = 0}, bo_dirty = {bv_hd = {tqh_first = 0x0, tqh_last = 0xfffffe01ec9a5160}, bv_root = 0x0, bv_cnt = 0}, bo_numoutput = 0, bo_flag = 0, bo_ops = 0xffffffff81316f20, bo_bsize = 131072, bo_object = 0x0, bo_synclist = {le_next = 0x0, le_prev = 0x0}, bo_private = 0xfffffe01ec9a5000, __bo_vnode = 0xfffffe01ec9a5000}, v_pollinfo = 0x0, v_label = 0x0, v_lockf = 0x0, v_rl = {rl_waiters = {tqh_first = 0x0, tqh_last = 0xfffffe01ec9a51e0}, rl_currdep = 0x0}, v_fullpath = '\0' } > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Mar 23 16:06:20 2013 (r248652) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Mar 23 16:34:56 2013 (r248653) > @@ -1968,6 +1968,7 @@ zfs_umount(vfs_t *vfsp, int fflag) > return (ret); > } > > +#ifdef sun > if (!(fflag & MS_FORCE)) { > /* > * Check the number of active vnodes in the file system. > @@ -1988,6 +1989,7 @@ zfs_umount(vfs_t *vfsp, int fflag) > return (EBUSY); > } > } > +#endif > > VERIFY(zfsvfs_teardown(zfsvfs, B_TRUE) == 0); > os = zfsvfs->z_os; > -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 09:09:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1A9F69DC; Fri, 25 Oct 2013 09:09:01 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0826927CE; Fri, 25 Oct 2013 09:09:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9P990Tn083927; Fri, 25 Oct 2013 09:09:00 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9P990nk083926; Fri, 25 Oct 2013 09:09:00 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201310250909.r9P990nk083926@svn.freebsd.org> From: Steven Hartland Date: Fri, 25 Oct 2013 09:09:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257109 - head/contrib/llvm/tools/clang/tools/driver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 09:09:01 -0000 Author: smh Date: Fri Oct 25 09:09:00 2013 New Revision: 257109 URL: http://svnweb.freebsd.org/changeset/base/257109 Log: Add clang-CC and CC to list of hints allowing clang to identify its operating mode as c++ instead of defaulting to c for the binary names CC and clang-CC. This fixes builds that use cmake, which automatically sets CXX to /usr/bin/CC by default. PR: bin/182442 Reviewed by: dwhite, wca MFC after: 2 days Modified: head/contrib/llvm/tools/clang/tools/driver/driver.cpp Modified: head/contrib/llvm/tools/clang/tools/driver/driver.cpp ============================================================================== --- head/contrib/llvm/tools/clang/tools/driver/driver.cpp Fri Oct 25 08:41:36 2013 (r257108) +++ head/contrib/llvm/tools/clang/tools/driver/driver.cpp Fri Oct 25 09:09:00 2013 (r257109) @@ -284,11 +284,13 @@ static void ParseProgName(SmallVectorImp } suffixes [] = { { "clang", false, false }, { "clang++", true, false }, + { "clang-CC", true, false }, { "clang-c++", true, false }, { "clang-cc", false, false }, { "clang-cpp", false, true }, { "clang-g++", true, false }, { "clang-gcc", false, false }, + { "CC", true, false }, { "cc", false, false }, { "cpp", false, true }, { "++", true, false }, From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 09:35:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7DBF0DF; Fri, 25 Oct 2013 09:35:22 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 39BCE2960; Fri, 25 Oct 2013 09:35:21 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::808:bfde:4b8f:68a7] (unknown [IPv6:2001:7b8:3a7:0:808:bfde:4b8f:68a7]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 3451C5C43; Fri, 25 Oct 2013 11:35:13 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_6F0E808E-615A-417A-9CDC-25841B1EAC9E"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1816\)) Subject: Re: svn commit: r257109 - head/contrib/llvm/tools/clang/tools/driver From: Dimitry Andric In-Reply-To: <201310250909.r9P990nk083926@svn.freebsd.org> Date: Fri, 25 Oct 2013 11:34:50 +0200 Message-Id: References: <201310250909.r9P990nk083926@svn.freebsd.org> To: Steven Hartland X-Mailer: Apple Mail (2.1816) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 09:35:22 -0000 --Apple-Mail=_6F0E808E-615A-417A-9CDC-25841B1EAC9E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On 25 Oct 2013, at 11:09, Steven Hartland wrote: > Author: smh > Date: Fri Oct 25 09:09:00 2013 > New Revision: 257109 > URL: http://svnweb.freebsd.org/changeset/base/257109 >=20 > Log: > Add clang-CC and CC to list of hints allowing clang to identify its = operating > mode as c++ instead of defaulting to c for the binary names CC and = clang-CC. >=20 > This fixes builds that use cmake, which automatically sets CXX to > /usr/bin/CC by default. Huh, I=92ve never seen that behavior with cmake? At least, not with any fairly recent version...=20 Anyway, I do not really agree with this change, and I would rather just get rid of the /usr/bin/CC link instead. Build scripts and Makefiles should use "c++" instead, which is the standard name for a C++ compiler. Note that you also introduce yet another change from upstream... :-/ -Dimitry --Apple-Mail=_6F0E808E-615A-417A-9CDC-25841B1EAC9E Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlJqO0kACgkQsF6jCi4glqNcaQCgqHrze0j8xFBcWuwDPxoldayE PC0AnRrB3iYVY6yzCs9mku0+uYjSjcf/ =oKuE -----END PGP SIGNATURE----- --Apple-Mail=_6F0E808E-615A-417A-9CDC-25841B1EAC9E-- From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 10:03:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 64DB450F; Fri, 25 Oct 2013 10:03:20 +0000 (UTC) (envelope-from prvs=101050af22=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A9FF42AA1; Fri, 25 Oct 2013 10:03:19 +0000 (UTC) Received: from r2d2 ([82.69.141.170]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50006501204.msg; Fri, 25 Oct 2013 11:03:17 +0100 X-Spam-Processed: mail1.multiplay.co.uk, Fri, 25 Oct 2013 11:03:17 +0100 (not processed: message from valid local sender) X-MDDKIM-Result: neutral (mail1.multiplay.co.uk) X-MDRemoteIP: 82.69.141.170 X-Return-Path: prvs=101050af22=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk Message-ID: <2DE0EA95F6944DB28D4B2F03EEF582F8@multiplay.co.uk> From: "Steven Hartland" To: "Dimitry Andric" References: <201310250909.r9P990nk083926@svn.freebsd.org> Subject: Re: svn commit: r257109 - head/contrib/llvm/tools/clang/tools/driver Date: Fri, 25 Oct 2013 11:03:16 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 10:03:20 -0000 > On 25 Oct 2013, at 11:09, Steven Hartland wrote: > > Author: smh > > Date: Fri Oct 25 09:09:00 2013 > > New Revision: 257109 > > URL: http://svnweb.freebsd.org/changeset/base/257109 > > > > Log: > > Add clang-CC and CC to list of hints allowing clang to identify its operating > > mode as c++ instead of defaulting to c for the binary names CC and clang-CC. > > > > This fixes builds that use cmake, which automatically sets CXX to > > /usr/bin/CC by default. > > Huh, I’ve never seen that behavior with cmake? At least, not with any > fairly recent version... > > Anyway, I do not really agree with this change, and I would rather just > get rid of the /usr/bin/CC link instead. Build scripts and Makefiles > should use "c++" instead, which is the standard name for a C++ compiler. > > Note that you also introduce yet another change from upstream... :-/ As discussed on IRC while I agree removing CC is possibly the better fix moving forward, I think removing /usr/bin/CC has quite a bit more risk, especially at this stage in the release phase of 10. Given this I would suggest this for now we make the change to clang and then possibly look at remove CC at a later date. If there's no objections I intend to ask re@ for permission to MFC this for the release of 10, so if there are any objections please do speak up :) Regards Steve ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk. From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 10:20:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 75EF59EA; Fri, 25 Oct 2013 10:20:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 627192BC0; Fri, 25 Oct 2013 10:20:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PAKKY2007638; Fri, 25 Oct 2013 10:20:20 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PAKKPP007615; Fri, 25 Oct 2013 10:20:20 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201310251020.r9PAKKPP007615@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 25 Oct 2013 10:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257110 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 10:20:20 -0000 Author: hselasky Date: Fri Oct 25 10:20:19 2013 New Revision: 257110 URL: http://svnweb.freebsd.org/changeset/base/257110 Log: MFC r256750: Improve XHCI stability. When a command timeout happens, the command should be aborted else the command queue can stop. Refer to section "4.6.1.2" of the XHCI specification. Approved by: re (glebius) Modified: stable/10/sys/dev/usb/controller/xhci.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci.c Fri Oct 25 09:09:00 2013 (r257109) +++ stable/10/sys/dev/usb/controller/xhci.c Fri Oct 25 10:20:19 2013 (r257110) @@ -1144,6 +1144,25 @@ xhci_do_command(struct xhci_softc *sc, s } if (err != 0) { DPRINTFN(0, "Command timeout!\n"); + + /* + * Try to abort the last command as per section + * 4.6.1.2 "Aborting a Command" of the XHCI + * specification: + */ + temp = XREAD4(sc, oper, XHCI_CRCR_LO); + XWRITE4(sc, oper, XHCI_CRCR_LO, temp | XHCI_CRCR_LO_CA); + + /* wait for abort event, if any */ + err = cv_timedwait(&sc->sc_cmd_cv, &sc->sc_bus.bus_mtx, hz / 16); + + if (err != 0 && xhci_interrupt_poll(sc) != 0) { + DPRINTF("Command was completed when polling\n"); + err = 0; + } + if (err != 0) { + DPRINTF("Command abort timeout!\n"); + } err = USB_ERR_TIMEOUT; trb->dwTrb2 = 0; trb->dwTrb3 = 0; From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 10:43:06 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D738AEC; Fri, 25 Oct 2013 10:43:06 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A46092D1C; Fri, 25 Oct 2013 10:43:06 +0000 (UTC) Received: from [10.60.213.211] (173-13-112-142-NewEngland.hfc.comcastbusiness.net [173.13.112.142]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id r9PAgeNx063165 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 25 Oct 2013 10:42:41 GMT (envelope-from theraven@FreeBSD.org) Subject: Re: svn commit: r257109 - head/contrib/llvm/tools/clang/tools/driver Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Content-Type: text/plain; charset=windows-1252 From: David Chisnall X-Priority: 3 In-Reply-To: <2DE0EA95F6944DB28D4B2F03EEF582F8@multiplay.co.uk> Date: Fri, 25 Oct 2013 06:42:36 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <7DCDC9F2-776B-41AC-B34F-8A5144A4AF0D@FreeBSD.org> References: <201310250909.r9P990nk083926@svn.freebsd.org> <2DE0EA95F6944DB28D4B2F03EEF582F8@multiplay.co.uk> To: "Steven Hartland" X-Mailer: Apple Mail (2.1508) Cc: svn-src-head@FreeBSD.org, Dimitry Andric , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 10:43:06 -0000 On 25 Oct 2013, at 06:03, "Steven Hartland" = wrote: > As discussed on IRC while I agree removing CC is possibly the better > fix moving forward, I think removing /usr/bin/CC has quite a bit more > risk, especially at this stage in the release phase of 10. I'm not sure what the risk is. CC is an IRIXism that was never part of = any standard. Linux distros don't seem to provide a CC, just a c++, so = this is unlikely to cause problems with ported code. =20 We've discussed removing CC for a while, and I think it's the right = call. David From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 11:26:40 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 527D9810; Fri, 25 Oct 2013 11:26:40 +0000 (UTC) (envelope-from prvs=101050af22=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 70A952F10; Fri, 25 Oct 2013 11:26:39 +0000 (UTC) Received: from r2d2 ([82.69.141.170]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50006501842.msg; Fri, 25 Oct 2013 12:26:22 +0100 X-Spam-Processed: mail1.multiplay.co.uk, Fri, 25 Oct 2013 12:26:22 +0100 (not processed: message from valid local sender) X-MDDKIM-Result: neutral (mail1.multiplay.co.uk) X-MDRemoteIP: 82.69.141.170 X-Return-Path: prvs=101050af22=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk Message-ID: From: "Steven Hartland" To: "David Chisnall" References: <201310250909.r9P990nk083926@svn.freebsd.org> <2DE0EA95F6944DB28D4B2F03EEF582F8@multiplay.co.uk> <7DCDC9F2-776B-41AC-B34F-8A5144A4AF0D@FreeBSD.org> Subject: Re: svn commit: r257109 - head/contrib/llvm/tools/clang/tools/driver Date: Fri, 25 Oct 2013 12:26:21 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@FreeBSD.org, Dimitry Andric , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 11:26:40 -0000 ----- Original Message ----- From: "David Chisnall" On 25 Oct 2013, at 06:03, "Steven Hartland" wrote: > > As discussed on IRC while I agree removing CC is possibly the better > > fix moving forward, I think removing /usr/bin/CC has quite a bit more > > risk, especially at this stage in the release phase of 10. > > I'm not sure what the risk is. CC is an IRIXism that was never part of any > standard. Linux distros don't seem to provide a CC, just a c++, so this is > unlikely to cause problems with ported code. > > We've discussed removing CC for a while, and I think it's the right call. We shouldn't forget that removing the creation of the link is not enough to "remove" CC, it would also need to be added to the delete-old target and also needs the user to run delete-old, which is a step not everyone does ;-) Given this even if we do remove CC I think its still prudent to keep the fix for CC in clang as well. Regards Steve ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk. From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 11:44:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0EB95C64; Fri, 25 Oct 2013 11:44:40 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F1132200C; Fri, 25 Oct 2013 11:44:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PBid0v036471; Fri, 25 Oct 2013 11:44:39 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PBidEj036470; Fri, 25 Oct 2013 11:44:39 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201310251144.r9PBidEj036470@svn.freebsd.org> From: Aleksandr Rybalko Date: Fri, 25 Oct 2013 11:44:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257111 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 11:44:40 -0000 Author: ray Date: Fri Oct 25 11:44:39 2013 New Revision: 257111 URL: http://svnweb.freebsd.org/changeset/base/257111 Log: Test UARTs physical address instead of virtual. Modified: head/sys/dev/uart/uart_cpu_fdt.c Modified: head/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- head/sys/dev/uart/uart_cpu_fdt.c Fri Oct 25 10:20:19 2013 (r257110) +++ head/sys/dev/uart/uart_cpu_fdt.c Fri Oct 25 11:44:39 2013 (r257111) @@ -86,7 +86,13 @@ int uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) { - return ((b1->bsh == b2->bsh && b1->bst == b2->bst) ? 1 : 0); + if (b1->bst != b2->bst) + return (0); + if (pmap_kextract(b1->bsh) == 0) + return (0); + if (pmap_kextract(b2->bsh) == 0) + return (0); + return ((pmap_kextract(b1->bsh) == pmap_kextract(b2->bsh)) ? 1 : 0); } int From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 13:25:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 29952DE; Fri, 25 Oct 2013 13:25:50 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 16ED026A1; Fri, 25 Oct 2013 13:25:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PDPnRs070556; Fri, 25 Oct 2013 13:25:49 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PDPnM2070555; Fri, 25 Oct 2013 13:25:49 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201310251325.r9PDPnM2070555@svn.freebsd.org> From: Tijl Coosemans Date: Fri, 25 Oct 2013 13:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r257112 - stable/9/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 13:25:50 -0000 Author: tijl Date: Fri Oct 25 13:25:49 2013 New Revision: 257112 URL: http://svnweb.freebsd.org/changeset/base/257112 Log: MFC r256925: Add a dummy statement to the beginning of the pthread_cleanup_pop() macro to allow a call of the macro to be labelled as in: label: pthread_cleanup_pop(); Reviewed by: imp Modified: stable/9/include/pthread.h Directory Properties: stable/9/include/ (props changed) Modified: stable/9/include/pthread.h ============================================================================== --- stable/9/include/pthread.h Fri Oct 25 11:44:39 2013 (r257111) +++ stable/9/include/pthread.h Fri Oct 25 13:25:49 2013 (r257112) @@ -175,6 +175,7 @@ int pthread_barrierattr_setpshared(pthr { #define pthread_cleanup_pop(execute) \ + (void)0; \ } \ __pthread_cleanup_pop_imp(execute); \ } From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 13:27:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 67B3F2CF; Fri, 25 Oct 2013 13:27:56 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5501F26C0; Fri, 25 Oct 2013 13:27:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PDRuOQ070823; Fri, 25 Oct 2013 13:27:56 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PDRu4x070822; Fri, 25 Oct 2013 13:27:56 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201310251327.r9PDRu4x070822@svn.freebsd.org> From: Tijl Coosemans Date: Fri, 25 Oct 2013 13:27:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257113 - stable/10/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 13:27:56 -0000 Author: tijl Date: Fri Oct 25 13:27:55 2013 New Revision: 257113 URL: http://svnweb.freebsd.org/changeset/base/257113 Log: MFC r256925: Add a dummy statement to the beginning of the pthread_cleanup_pop() macro to allow a call of the macro to be labelled as in: label: pthread_cleanup_pop(); Reviewed by: imp Approved by: re (glebius) Modified: stable/10/include/pthread.h Directory Properties: stable/10/include/ (props changed) Modified: stable/10/include/pthread.h ============================================================================== --- stable/10/include/pthread.h Fri Oct 25 13:25:49 2013 (r257112) +++ stable/10/include/pthread.h Fri Oct 25 13:27:55 2013 (r257113) @@ -175,6 +175,7 @@ int pthread_barrierattr_setpshared(pthr { #define pthread_cleanup_pop(execute) \ + (void)0; \ } \ __pthread_cleanup_pop_imp(execute); \ } From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 13:29:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 03A3B40B; Fri, 25 Oct 2013 13:29:08 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D34E526D1; Fri, 25 Oct 2013 13:29:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PDT7ZB070998; Fri, 25 Oct 2013 13:29:07 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PDT7sq070996; Fri, 25 Oct 2013 13:29:07 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310251329.r9PDT7sq070996@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 25 Oct 2013 13:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257114 - in head/sys: conf dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 13:29:08 -0000 Author: nwhitehorn Date: Fri Oct 25 13:29:07 2013 New Revision: 257114 URL: http://svnweb.freebsd.org/changeset/base/257114 Log: Use common OFW root code to set up fdtbus. This is an almost purely negative diff that should improve reliability somewhat. There should be no differences in behavior -- please report any that crop up. This has been tested on ARM and PPC systems. Tested by: ray Modified: head/sys/conf/files head/sys/dev/fdt/fdtbus.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Oct 25 13:27:55 2013 (r257113) +++ head/sys/conf/files Fri Oct 25 13:29:07 2013 (r257114) @@ -1916,6 +1916,7 @@ dev/ofw/ofw_bus_subr.c optional fdt dev/ofw/ofw_fdt.c optional fdt dev/ofw/ofw_if.m optional fdt dev/ofw/ofw_iicbus.c optional fdt iicbus +dev/ofw/ofw_nexus.c optional fdt dev/ofw/openfirm.c optional fdt dev/ofw/openfirmio.c optional fdt dev/patm/if_patm.c optional patm pci Modified: head/sys/dev/fdt/fdtbus.c ============================================================================== --- head/sys/dev/fdt/fdtbus.c Fri Oct 25 13:27:55 2013 (r257113) +++ head/sys/dev/fdt/fdtbus.c Fri Oct 25 13:29:07 2013 (r257114) @@ -42,63 +42,20 @@ __FBSDID("$FreeBSD$"); #include #include +#include -#include "fdt_common.h" #include "ofw_bus_if.h" -#ifdef DEBUG -#define debugf(fmt, args...) do { printf("%s(): ", __func__); \ - printf(fmt,##args); } while (0) -#else -#define debugf(fmt, args...) -#endif - -static MALLOC_DEFINE(M_FDTBUS, "fdtbus", "FDTbus devices information"); - -struct fdtbus_devinfo { - phandle_t di_node; - char *di_name; - char *di_type; - char *di_compat; - struct resource_list di_res; - - /* Interrupts sense-level info for this device */ - struct fdt_sense_level di_intr_sl[DI_MAX_INTR_NUM]; -}; - -struct fdtbus_softc { - struct rman sc_irq; - struct rman sc_mem; -}; - /* * Prototypes. */ static void fdtbus_identify(driver_t *, device_t); static int fdtbus_probe(device_t); -static int fdtbus_attach(device_t); -static int fdtbus_print_child(device_t, device_t); -static struct resource *fdtbus_alloc_resource(device_t, device_t, int, - int *, u_long, u_long, u_long, u_int); -static int fdtbus_release_resource(device_t, device_t, int, int, - struct resource *); static int fdtbus_activate_resource(device_t, device_t, int, int, struct resource *); static int fdtbus_deactivate_resource(device_t, device_t, int, int, struct resource *); -static int fdtbus_setup_intr(device_t, device_t, struct resource *, int, - driver_filter_t *, driver_intr_t *, void *, void **); - -static const char *fdtbus_ofw_get_name(device_t, device_t); -static phandle_t fdtbus_ofw_get_node(device_t, device_t); -static const char *fdtbus_ofw_get_type(device_t, device_t); -static const char *fdtbus_ofw_get_compat(device_t, device_t); - -/* - * Local routines. - */ -static void newbus_device_from_fdt_node(device_t, phandle_t); /* * Bus interface definition. @@ -107,47 +64,26 @@ static device_method_t fdtbus_methods[] /* Device interface */ DEVMETHOD(device_identify, fdtbus_identify), DEVMETHOD(device_probe, fdtbus_probe), - DEVMETHOD(device_attach, fdtbus_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ - DEVMETHOD(bus_print_child, fdtbus_print_child), - DEVMETHOD(bus_alloc_resource, fdtbus_alloc_resource), - DEVMETHOD(bus_release_resource, fdtbus_release_resource), DEVMETHOD(bus_activate_resource, fdtbus_activate_resource), DEVMETHOD(bus_deactivate_resource, fdtbus_deactivate_resource), DEVMETHOD(bus_config_intr, bus_generic_config_intr), - DEVMETHOD(bus_setup_intr, fdtbus_setup_intr), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - /* OFW bus interface */ - DEVMETHOD(ofw_bus_get_node, fdtbus_ofw_get_node), - DEVMETHOD(ofw_bus_get_name, fdtbus_ofw_get_name), - DEVMETHOD(ofw_bus_get_type, fdtbus_ofw_get_type), - DEVMETHOD(ofw_bus_get_compat, fdtbus_ofw_get_compat), - - { 0, 0 } -}; - -static driver_t fdtbus_driver = { - "fdtbus", - fdtbus_methods, - sizeof(struct fdtbus_softc) + DEVMETHOD_END }; devclass_t fdtbus_devclass; - +DEFINE_CLASS_1(fdtbus, fdtbus_driver, fdtbus_methods, + sizeof(struct ofw_nexus_softc), ofw_nexus_driver); DRIVER_MODULE(fdtbus, nexus, fdtbus_driver, fdtbus_devclass, 0, 0); static void fdtbus_identify(driver_t *driver, device_t parent) { - debugf("%s(driver=%p, parent=%p)\n", __func__, driver, parent); - if (device_find_child(parent, "fdtbus", -1) == NULL) BUS_ADD_CHILD(parent, 0, "fdtbus", -1); } @@ -156,462 +92,11 @@ static int fdtbus_probe(device_t dev) { - debugf("%s(dev=%p); pass=%u\n", __func__, dev, bus_current_pass); - device_set_desc(dev, "Flattened Device Tree"); return (BUS_PROBE_NOWILDCARD); } static int -fdtbus_attach(device_t dev) -{ - phandle_t root; - phandle_t child; - struct fdtbus_softc *sc; - u_long start, end; - int error; - - if ((root = OF_finddevice("/")) == -1) - panic("fdtbus_attach: no root node."); - - sc = device_get_softc(dev); - - /* - * IRQ rman. - */ - start = 0; - end = ~0; - sc->sc_irq.rm_start = start; - sc->sc_irq.rm_end = end; - sc->sc_irq.rm_type = RMAN_ARRAY; - sc->sc_irq.rm_descr = "Interrupt request lines"; - if ((error = rman_init(&sc->sc_irq)) != 0) { - device_printf(dev, "could not init IRQ rman, error = %d\n", - error); - return (error); - } - if ((error = rman_manage_region(&sc->sc_irq, start, end)) != 0) { - device_printf(dev, "could not manage IRQ region, error = %d\n", - error); - return (error); - } - - /* - * Mem-mapped I/O space rman. - */ - start = 0; - end = ~0ul; - sc->sc_mem.rm_start = start; - sc->sc_mem.rm_end = end; - sc->sc_mem.rm_type = RMAN_ARRAY; - sc->sc_mem.rm_descr = "I/O memory"; - if ((error = rman_init(&sc->sc_mem)) != 0) { - device_printf(dev, "could not init I/O mem rman, error = %d\n", - error); - return (error); - } - if ((error = rman_manage_region(&sc->sc_mem, start, end)) != 0) { - device_printf(dev, "could not manage I/O mem region, " - "error = %d\n", error); - return (error); - } - - /* - * Walk the FDT root node and add top-level devices as our children. - */ - for (child = OF_child(root); child != 0; child = OF_peer(child)) { - /* Check and process 'status' property. */ - if (!(fdt_is_enabled(child))) - continue; - - newbus_device_from_fdt_node(dev, child); - } - - return (bus_generic_attach(dev)); -} - -static int -fdtbus_print_child(device_t dev, device_t child) -{ - struct fdtbus_devinfo *di; - struct resource_list *rl; - int rv; - - di = device_get_ivars(child); - rl = &di->di_res; - - rv = 0; - rv += bus_print_child_header(dev, child); - rv += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - rv += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); - rv += bus_print_child_footer(dev, child); - - return (rv); -} - -static void -newbus_device_destroy(device_t dev) -{ - struct fdtbus_devinfo *di; - - di = device_get_ivars(dev); - if (di == NULL) - return; - - free(di->di_name, M_OFWPROP); - free(di->di_type, M_OFWPROP); - free(di->di_compat, M_OFWPROP); - - resource_list_free(&di->di_res); - free(di, M_FDTBUS); -} - -static device_t -newbus_device_create(device_t dev_par, phandle_t node, char *name, char *type, - char *compat) -{ - device_t child; - struct fdtbus_devinfo *di; - - child = device_add_child(dev_par, NULL, -1); - if (child == NULL) { - free(name, M_OFWPROP); - free(type, M_OFWPROP); - free(compat, M_OFWPROP); - return (NULL); - } - - di = malloc(sizeof(*di), M_FDTBUS, M_WAITOK); - di->di_node = node; - di->di_name = name; - di->di_type = type; - di->di_compat = compat; - - resource_list_init(&di->di_res); - - if (fdt_reg_to_rl(node, &di->di_res)) { - device_printf(child, "could not process 'reg' property\n"); - newbus_device_destroy(child); - child = NULL; - goto out; - } - - if (fdt_intr_to_rl(node, &di->di_res, di->di_intr_sl)) { - device_printf(child, "could not process 'interrupts' " - "property\n"); - newbus_device_destroy(child); - child = NULL; - goto out; - } - - device_set_ivars(child, di); - debugf("added child name='%s', node=%p\n", name, (void *)node); - -out: - return (child); -} - -static device_t -newbus_pci_create(device_t dev_par, phandle_t dt_node, u_long par_base, - u_long par_size) -{ - pcell_t reg[3 + 2]; - device_t dev_child; - u_long start, end, count; - struct fdtbus_devinfo *di; - char *name, *type, *compat; - int len; - - OF_getprop_alloc(dt_node, "device_type", 1, (void **)&type); - if (!(type != NULL && strcmp(type, "pci") == 0)) { - /* Only process 'pci' subnodes. */ - free(type, M_OFWPROP); - return (NULL); - } - - OF_getprop_alloc(dt_node, "name", 1, (void **)&name); - OF_getprop_alloc(OF_parent(dt_node), "compatible", 1, - (void **)&compat); - - dev_child = device_add_child(dev_par, NULL, -1); - if (dev_child == NULL) { - free(name, M_OFWPROP); - free(type, M_OFWPROP); - free(compat, M_OFWPROP); - return (NULL); - } - - di = malloc(sizeof(*di), M_FDTBUS, M_WAITOK); - di->di_node = dt_node; - di->di_name = name; - di->di_type = type; - di->di_compat = compat; - - resource_list_init(&di->di_res); - - /* - * Produce and set SYS_RES_MEMORY resources. - */ - start = 0; - count = 0; - - len = OF_getprop(dt_node, "reg", ®, sizeof(reg)); - if (len > 0) { - if (fdt_data_verify((void *)®[1], 2) != 0) { - device_printf(dev_child, "'reg' address value out of " - "range\n"); - newbus_device_destroy(dev_child); - dev_child = NULL; - goto out; - } - start = fdt_data_get((void *)®[1], 2); - - if (fdt_data_verify((void *)®[3], 2) != 0) { - device_printf(dev_child, "'reg' size value out of " - "range\n"); - newbus_device_destroy(dev_child); - dev_child = NULL; - goto out; - } - count = fdt_data_get((void *)®[3], 2); - } - - /* Calculate address range relative to base. */ - par_base &= 0x000ffffful; - start &= 0x000ffffful; - start += par_base + fdt_immr_va; - if (count == 0) - count = par_size; - end = start + count - 1; - - debugf("start = 0x%08lx, end = 0x%08lx, count = 0x%08lx\n", - start, end, count); - - if (count > par_size) { - device_printf(dev_child, "'reg' size value out of range\n"); - newbus_device_destroy(dev_child); - dev_child = NULL; - goto out; - } - - resource_list_add(&di->di_res, SYS_RES_MEMORY, 0, start, end, count); - - /* - * Set SYS_RES_IRQ resources. - */ - if (fdt_intr_to_rl(OF_parent(dt_node), &di->di_res, di->di_intr_sl)) { - device_printf(dev_child, "could not process 'interrupts' " - "property\n"); - newbus_device_destroy(dev_child); - dev_child = NULL; - goto out; - } - - device_set_ivars(dev_child, di); - debugf("added child name='%s', node=%p\n", name, - (void *)dt_node); - -out: - return (dev_child); -} - -static void -pci_from_fdt_node(device_t dev_par, phandle_t dt_node, char *name, - char *type, char *compat) -{ - u_long reg_base, reg_size; - phandle_t dt_child; - - /* - * Retrieve 'reg' property. - */ - if (fdt_regsize(dt_node, ®_base, ®_size) != 0) { - device_printf(dev_par, "could not retrieve 'reg' prop\n"); - return; - } - - /* - * Walk the PCI node and instantiate newbus devices representing - * logical resources (bridges / ports). - */ - for (dt_child = OF_child(dt_node); dt_child != 0; - dt_child = OF_peer(dt_child)) { - - if (!(fdt_is_enabled(dt_child))) - continue; - - newbus_pci_create(dev_par, dt_child, reg_base, reg_size); - } -} - -/* - * These FDT nodes do not need a corresponding newbus device object. - */ -static char *fdt_devices_skip[] = { - "aliases", - "chosen", - "memory", - NULL -}; - -static void -newbus_device_from_fdt_node(device_t dev_par, phandle_t node) -{ - char *name, *type, *compat; - device_t child; - int i; - - OF_getprop_alloc(node, "name", 1, (void **)&name); - OF_getprop_alloc(node, "device_type", 1, (void **)&type); - OF_getprop_alloc(node, "compatible", 1, (void **)&compat); - - for (i = 0; fdt_devices_skip[i] != NULL; i++) - if (name != NULL && strcmp(name, fdt_devices_skip[i]) == 0) { - debugf("skipping instantiating FDT device='%s'\n", - name); - return; - } - - child = newbus_device_create(dev_par, node, name, type, compat); - if (type != NULL && strcmp(type, "pci") == 0) - pci_from_fdt_node(child, node, name, type, compat); -} - -static struct resource * -fdtbus_alloc_resource(device_t bus, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) -{ - struct fdtbus_softc *sc; - struct resource *res; - struct rman *rm; - struct fdtbus_devinfo *di; - struct resource_list_entry *rle; - int needactivate; - - /* - * Request for the default allocation with a given rid: use resource - * list stored in the local device info. - */ - if ((start == 0UL) && (end == ~0UL)) { - if ((di = device_get_ivars(child)) == NULL) - return (NULL); - - if (type == SYS_RES_IOPORT) - type = SYS_RES_MEMORY; - - rle = resource_list_find(&di->di_res, type, *rid); - if (rle == NULL) { - device_printf(bus, "no default resources for " - "rid = %d, type = %d\n", *rid, type); - return (NULL); - } - start = rle->start; - end = rle->end; - count = rle->count; - } - - sc = device_get_softc(bus); - - needactivate = flags & RF_ACTIVE; - flags &= ~RF_ACTIVE; - - switch (type) { - case SYS_RES_IRQ: - rm = &sc->sc_irq; - break; - - case SYS_RES_IOPORT: - case SYS_RES_MEMORY: - rm = &sc->sc_mem; - break; - - default: - return (NULL); - } - - res = rman_reserve_resource(rm, start, end, count, flags, child); - if (res == NULL) { - device_printf(bus, "failed to reserve resource %#lx - %#lx " - "(%#lx)\n", start, end, count); - return (NULL); - } - - rman_set_rid(res, *rid); - - if (type == SYS_RES_IOPORT || type == SYS_RES_MEMORY) { - /* XXX endianess should be set based on SOC node */ - rman_set_bustag(res, fdtbus_bs_tag); - rman_set_bushandle(res, rman_get_start(res)); - } - - if (needactivate) - if (bus_activate_resource(child, type, *rid, res)) { - device_printf(child, "resource activation failed\n"); - rman_release_resource(res); - return (NULL); - } - - return (res); -} - -static int -fdtbus_release_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) -{ - int err; - - if (rman_get_flags(res) & RF_ACTIVE) { - err = bus_deactivate_resource(child, type, rid, res); - if (err) - return (err); - } - - return (rman_release_resource(res)); -} - -static int -fdtbus_setup_intr(device_t bus, device_t child, struct resource *res, - int flags, driver_filter_t *filter, driver_intr_t *ihand, void *arg, - void **cookiep) -{ - struct fdtbus_devinfo *di; - enum intr_trigger trig; - enum intr_polarity pol; - int error, rid; - - if (res == NULL) - return (EINVAL); - - /* - * We are responsible for configuring the interrupts of our direct - * children. - */ - if (device_get_parent(child) == bus) { - di = device_get_ivars(child); - if (di == NULL) - return (ENXIO); - - rid = rman_get_rid(res); - if (rid >= DI_MAX_INTR_NUM) - return (ENOENT); - - trig = di->di_intr_sl[rid].trig; - pol = di->di_intr_sl[rid].pol; - if (trig != INTR_TRIGGER_CONFORM || - pol != INTR_POLARITY_CONFORM) { - error = bus_generic_config_intr(bus, - rman_get_start(res), trig, pol); - if (error) - return (error); - } - } - - error = bus_generic_setup_intr(bus, child, res, flags, filter, ihand, - arg, cookiep); - return (error); -} - -static int fdtbus_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { @@ -619,6 +104,10 @@ fdtbus_activate_resource(device_t bus, d int error; if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { + /* XXX endianess should be set based on SOC node */ + rman_set_bustag(res, fdtbus_bs_tag); + rman_set_bushandle(res, rman_get_start(res)); + error = bus_space_map(rman_get_bustag(res), rman_get_bushandle(res), rman_get_size(res), 0, &p); if (error) @@ -637,36 +126,3 @@ fdtbus_deactivate_resource(device_t bus, return (rman_deactivate_resource(res)); } -static const char * -fdtbus_ofw_get_name(device_t bus, device_t dev) -{ - struct fdtbus_devinfo *di; - - return ((di = device_get_ivars(dev)) == NULL ? NULL : di->di_name); -} - -static phandle_t -fdtbus_ofw_get_node(device_t bus, device_t dev) -{ - struct fdtbus_devinfo *di; - - return ((di = device_get_ivars(dev)) == NULL ? 0 : di->di_node); -} - -static const char * -fdtbus_ofw_get_type(device_t bus, device_t dev) -{ - struct fdtbus_devinfo *di; - - return ((di = device_get_ivars(dev)) == NULL ? NULL : di->di_type); -} - -static const char * -fdtbus_ofw_get_compat(device_t bus, device_t dev) -{ - struct fdtbus_devinfo *di; - - return ((di = device_get_ivars(dev)) == NULL ? NULL : di->di_compat); -} - - From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 14:21:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 84764FE6 for ; Fri, 25 Oct 2013 14:21:19 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from mail-pb0-f42.google.com (mail-pb0-f42.google.com [209.85.160.42]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5A97C2A32 for ; Fri, 25 Oct 2013 14:21:19 +0000 (UTC) Received: by mail-pb0-f42.google.com with SMTP id jt11so3546664pbb.29 for ; Fri, 25 Oct 2013 07:21:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=TJ0jFUw06qj8LgGq4IssPjnn3lcO890qwLSwSNH43B8=; b=mUCoO+dRPhEfAJNk6AzmYQA3vVaQqbrOu3O9Nnt8+jrtXGZLKctdXSqKtizD/G3Pow 4uDrap6zC9grnU5eIaVhMh/QHU8bteknBLObUuGxEnjkFWnFbolg5UiJhuGHZYYTtbwq 6YhagJJM479GbR+NXhesUa5vY5JonMu6+7/y4BNkPg41vmbffGZ0AjvIvOKVo4I5MtxP LEA2jw5x3Kg93iKiDY9rSLMRVl6ZbBLpZd2+q7tvZ8/K5CD3uduxvz4WyU0SZnI/TrdX 6TcgDUrnfqbW+YMVIr7Wma18+VJqwWAuAUA46JCOX9Vh4JXUYjz/xuYYhgsRYQ91vEo8 BjLA== X-Gm-Message-State: ALoCoQkAz8Ghj/X2wD/bKfeJgVtxKqk9vILXuvl4KWgSgPQrtTVj4G5sKad3rN2vdxjpQCFj65Hj X-Received: by 10.66.66.42 with SMTP id c10mr10901988pat.98.1382710873026; Fri, 25 Oct 2013 07:21:13 -0700 (PDT) Received: from [192.168.43.193] ([172.56.31.101]) by mx.google.com with ESMTPSA id be1sm9870997pbb.28.2013.10.25.07.21.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Oct 2013 07:21:12 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: svn commit: r257109 - head/contrib/llvm/tools/clang/tools/driver From: Tim Kientzle In-Reply-To: Date: Fri, 25 Oct 2013 07:20:57 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <1EFCA941-2972-40CD-8724-C16F8A0544CE@kientzle.com> References: <201310250909.r9P990nk083926@svn.freebsd.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1510) Cc: svn-src-head@FreeBSD.org, Steven Hartland , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 14:21:19 -0000 On Oct 25, 2013, at 2:34 AM, Dimitry Andric wrote: > On 25 Oct 2013, at 11:09, Steven Hartland wrote: >> Author: smh >> Date: Fri Oct 25 09:09:00 2013 >> New Revision: 257109 >> URL: http://svnweb.freebsd.org/changeset/base/257109 >>=20 >> Log: >> Add clang-CC and CC to list of hints allowing clang to identify its = operating >> mode as c++ instead of defaulting to c for the binary names CC and = clang-CC. >>=20 >> This fixes builds that use cmake, which automatically sets CXX to >> /usr/bin/CC by default. >=20 > Huh, I=92ve never seen that behavior with cmake? At least, not with = any > fairly recent version...=20 >=20 > Anyway, I do not really agree with this change, and I would rather = just > get rid of the /usr/bin/CC link instead. Even if FreeBSD removes the default symlink, clang should still default to C++ mode when invoked as CC (possibly through a symlink created by an individual user). > Build scripts and Makefiles > should use "c++" instead, which is the standard name for a C++ = compiler. Ours should, yes. Tim From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 14:37:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 29B105B2; Fri, 25 Oct 2013 14:37:16 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1660A2AF9; Fri, 25 Oct 2013 14:37:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PEbFwx095237; Fri, 25 Oct 2013 14:37:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PEbF0C095231; Fri, 25 Oct 2013 14:37:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310251437.r9PEbF0C095231@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 25 Oct 2013 14:37:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257115 - in head/sys/powerpc: include powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 14:37:16 -0000 Author: nwhitehorn Date: Fri Oct 25 14:37:15 2013 New Revision: 257115 URL: http://svnweb.freebsd.org/changeset/base/257115 Log: Remove some #ifdef and duplication in the MSR bit definitions. This adds some security features to the Book-E kernel as well. Modified: head/sys/powerpc/include/psl.h head/sys/powerpc/powerpc/exec_machdep.c head/sys/powerpc/powerpc/genassym.c Modified: head/sys/powerpc/include/psl.h ============================================================================== --- head/sys/powerpc/include/psl.h Fri Oct 25 13:29:07 2013 (r257114) +++ head/sys/powerpc/include/psl.h Fri Oct 25 14:37:15 2013 (r257115) @@ -35,96 +35,44 @@ #ifndef _MACHINE_PSL_H_ #define _MACHINE_PSL_H_ -#if defined(BOOKE_E500) /* - * Machine State Register (MSR) - e500 core - * - * The PowerPC e500 does not implement the following bits: - * - * FP, FE0, FE1 - reserved, always cleared, setting has no effect. - * + * Machine State Register (MSR) - All cores */ +#define PSL_VEC 0x02000000UL /* AltiVec/SPE vector unit available */ +#define PSL_EE 0x00008000UL /* external interrupt enable */ +#define PSL_PR 0x00004000UL /* privilege mode (1 == user) */ +#define PSL_FP 0x00002000UL /* floating point enable */ +#define PSL_ME 0x00001000UL /* machine check enable */ +#define PSL_FE0 0x00000800UL /* floating point interrupt mode 0 */ +#define PSL_BE 0x00000200UL /* branch trace enable */ +#define PSL_FE1 0x00000100UL /* floating point interrupt mode 1 */ +#define PSL_PMM 0x00000004UL /* performance monitor mark */ + +/* Machine State Register - Book-E cores */ #define PSL_UCLE 0x04000000UL /* User mode cache lock enable */ -#define PSL_SPE 0x02000000UL /* SPE enable */ #define PSL_WE 0x00040000UL /* Wait state enable */ #define PSL_CE 0x00020000UL /* Critical interrupt enable */ -#define PSL_EE 0x00008000UL /* External interrupt enable */ -#define PSL_PR 0x00004000UL /* User mode */ -#define PSL_FP 0x00002000UL /* Floating point available */ -#define PSL_ME 0x00001000UL /* Machine check interrupt enable */ -#define PSL_FE0 0x00000800UL /* Floating point exception mode 0 */ -#define PSL_UBLE 0x00000400UL /* BTB lock enable */ +#define PSL_UBLE 0x00000400UL /* BTB lock enable - e500 only */ +#define PSL_DWE 0x00000400UL /* Debug Wait Enable - 440 only*/ #define PSL_DE 0x00000200UL /* Debug interrupt enable */ -#define PSL_FE1 0x00000100UL /* Floating point exception mode 1 */ #define PSL_IS 0x00000020UL /* Instruction address space */ #define PSL_DS 0x00000010UL /* Data address space */ -#define PSL_PMM 0x00000004UL /* Performance monitor mark */ - -#define PSL_FE_DFLT 0x00000000UL /* default == none */ - -/* Initial kernel MSR, use IS=1 ad DS=1. */ -#define PSL_KERNSET_INIT (PSL_IS | PSL_DS) -#define PSL_KERNSET (PSL_CE | PSL_ME | PSL_EE) -#define PSL_USERSET (PSL_KERNSET | PSL_PR) - -#elif defined(BOOKE_PPC4XX) -/* - * Machine State Register (MSR) - PPC4xx core - */ -#define PSL_WE (0x80000000 >> 13) /* Wait State Enable */ -#define PSL_CE (0x80000000 >> 14) /* Critical Interrupt Enable */ -#define PSL_EE (0x80000000 >> 16) /* External Interrupt Enable */ -#define PSL_PR (0x80000000 >> 17) /* Problem State */ -#define PSL_FP (0x80000000 >> 18) /* Floating Point Available */ -#define PSL_ME (0x80000000 >> 19) /* Machine Check Enable */ -#define PSL_FE0 (0x80000000 >> 20) /* Floating-point exception mode 0 */ -#define PSL_DWE (0x80000000 >> 21) /* Debug Wait Enable */ -#define PSL_DE (0x80000000 >> 22) /* Debug interrupt Enable */ -#define PSL_FE1 (0x80000000 >> 23) /* Floating-point exception mode 1 */ -#define PSL_IS (0x80000000 >> 26) /* Instruction Address Space */ -#define PSL_DS (0x80000000 >> 27) /* Data Address Space */ - -#define PSL_KERNSET (PSL_CE | PSL_ME | PSL_EE | PSL_FP) -#define PSL_USERSET (PSL_KERNSET | PSL_PR) - -#define PSL_FE_DFLT 0x00000000UL /* default == none */ - -#else /* if defined(BOOKE_*) */ -/* - * Machine State Register (MSR) - * - * The PowerPC 601 does not implement the following bits: - * - * VEC, POW, ILE, BE, RI, LE[*] - * - * [*] Little-endian mode on the 601 is implemented in the HID0 register. - */ +/* Machine State Register (MSR) - AIM cores */ #ifdef __powerpc64__ #define PSL_SF 0x8000000000000000UL /* 64-bit addressing */ #define PSL_HV 0x1000000000000000UL /* hyper-privileged mode */ #endif -#define PSL_VEC 0x02000000UL /* AltiVec vector unit available */ #define PSL_POW 0x00040000UL /* power management */ #define PSL_ILE 0x00010000UL /* interrupt endian mode (1 == le) */ -#define PSL_EE 0x00008000UL /* external interrupt enable */ -#define PSL_PR 0x00004000UL /* privilege mode (1 == user) */ -#define PSL_FP 0x00002000UL /* floating point enable */ -#define PSL_ME 0x00001000UL /* machine check enable */ -#define PSL_FE0 0x00000800UL /* floating point interrupt mode 0 */ #define PSL_SE 0x00000400UL /* single-step trace enable */ -#define PSL_BE 0x00000200UL /* branch trace enable */ -#define PSL_FE1 0x00000100UL /* floating point interrupt mode 1 */ -#define PSL_IP 0x00000040UL /* interrupt prefix */ +#define PSL_IP 0x00000040UL /* interrupt prefix - 601 only */ #define PSL_IR 0x00000020UL /* instruction address relocation */ #define PSL_DR 0x00000010UL /* data address relocation */ -#define PSL_PMM 0x00000004UL /* performance monitor mark */ #define PSL_RI 0x00000002UL /* recoverable interrupt */ #define PSL_LE 0x00000001UL /* endian mode (1 == le) */ -#define PSL_601_MASK ~(PSL_POW|PSL_ILE|PSL_BE|PSL_RI|PSL_LE) - /* * Floating-point exception modes: */ @@ -134,20 +82,21 @@ #define PSL_FE_PREC (PSL_FE0 | PSL_FE1) /* precise */ #define PSL_FE_DFLT PSL_FE_DIS /* default == none */ -/* - * Note that PSL_POW and PSL_ILE are not in the saved copy of the MSR - */ -#define PSL_MBO 0 -#define PSL_MBZ 0 - +#if defined(BOOKE_E500) +/* Initial kernel MSR, use IS=1 ad DS=1. */ +#define PSL_KERNSET_INIT (PSL_IS | PSL_DS) +#define PSL_KERNSET (PSL_CE | PSL_ME | PSL_EE) +#elif defined(BOOKE_PPC4XX) +#define PSL_KERNSET (PSL_CE | PSL_ME | PSL_EE | PSL_FP) +#elif defined(AIM) #ifdef __powerpc64__ #define PSL_KERNSET (PSL_SF | PSL_EE | PSL_ME | PSL_IR | PSL_DR | PSL_RI) #else #define PSL_KERNSET (PSL_EE | PSL_ME | PSL_IR | PSL_DR | PSL_RI) #endif -#define PSL_USERSET (PSL_KERNSET | PSL_PR) +#endif -#define PSL_USERSTATIC (PSL_USERSET | PSL_IP | 0x87c0008c) +#define PSL_USERSET (PSL_KERNSET | PSL_PR) +#define PSL_USERSTATIC ~(PSL_VEC | PSL_FP | PSL_FE0 | PSL_FE1) -#endif /* if defined(BOOKE_E500) */ #endif /* _MACHINE_PSL_H_ */ Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Fri Oct 25 13:29:07 2013 (r257114) +++ head/sys/powerpc/powerpc/exec_machdep.c Fri Oct 25 14:37:15 2013 (r257115) @@ -449,14 +449,12 @@ set_mcontext(struct thread *td, const mc if (mcp->mc_vers != _MC_VERSION || mcp->mc_len != sizeof(*mcp)) return (EINVAL); -#ifdef AIM /* * Don't let the user set privileged MSR bits */ if ((mcp->mc_srr1 & PSL_USERSTATIC) != (tf->srr1 & PSL_USERSTATIC)) { return (EINVAL); } -#endif /* Copy trapframe, preserving TLS pointer across context change */ if (SV_PROC_FLAG(td->td_proc, SV_LP64)) @@ -594,7 +592,7 @@ ppc32_setregs(struct thread *td, struct tf->fixreg[8] = (register_t)imgp->ps_strings; /* NetBSD extension */ tf->srr0 = imgp->entry_addr; - tf->srr1 = PSL_MBO | PSL_USERSET | PSL_FE_DFLT; + tf->srr1 = PSL_USERSET | PSL_FE_DFLT; tf->srr1 &= ~PSL_SF; if (mfmsr() & PSL_HV) tf->srr1 |= PSL_HV; @@ -1024,7 +1022,7 @@ cpu_set_upcall_kse(struct thread *td, vo if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { tf->srr0 = (register_t)entry; #ifdef AIM - tf->srr1 = PSL_MBO | PSL_USERSET | PSL_FE_DFLT; + tf->srr1 = PSL_USERSET | PSL_FE_DFLT; #ifdef __powerpc64__ tf->srr1 &= ~PSL_SF; #endif Modified: head/sys/powerpc/powerpc/genassym.c ============================================================================== --- head/sys/powerpc/powerpc/genassym.c Fri Oct 25 13:29:07 2013 (r257114) +++ head/sys/powerpc/powerpc/genassym.c Fri Oct 25 14:37:15 2013 (r257115) @@ -214,28 +214,25 @@ ASSYM(SF_UC, offsetof(struct sigframe, s ASSYM(KERNBASE, KERNBASE); ASSYM(MAXCOMLEN, MAXCOMLEN); -#if defined(BOOKE) ASSYM(PSL_DE, PSL_DE); ASSYM(PSL_DS, PSL_DS); ASSYM(PSL_IS, PSL_IS); ASSYM(PSL_CE, PSL_CE); -#endif -#if defined(BOOKE_E500) ASSYM(PSL_UCLE, PSL_UCLE); -ASSYM(PSL_SPE, PSL_SPE); ASSYM(PSL_WE, PSL_WE); ASSYM(PSL_UBLE, PSL_UBLE); +#if defined(BOOKE_E500) ASSYM(PSL_KERNSET_INIT, PSL_KERNSET_INIT); -#elif defined(AIM) -#ifdef __powerpc64__ +#endif + +#if defined(AIM) && defined(__powerpc64__) ASSYM(PSL_SF, PSL_SF); ASSYM(PSL_HV, PSL_HV); #endif -ASSYM(PSL_VEC, PSL_VEC); + ASSYM(PSL_POW, PSL_POW); ASSYM(PSL_ILE, PSL_ILE); -ASSYM(PSL_BE, PSL_BE); ASSYM(PSL_LE, PSL_LE); ASSYM(PSL_SE, PSL_SE); ASSYM(PSL_RI, PSL_RI); @@ -248,18 +245,16 @@ ASSYM(PSL_FE_NONREC, PSL_FE_NONREC); ASSYM(PSL_FE_PREC, PSL_FE_PREC); ASSYM(PSL_FE_REC, PSL_FE_REC); -ASSYM(PSL_USERSTATIC, PSL_USERSTATIC); -#endif - +ASSYM(PSL_VEC, PSL_VEC); +ASSYM(PSL_BE, PSL_BE); ASSYM(PSL_EE, PSL_EE); ASSYM(PSL_FE0, PSL_FE0); ASSYM(PSL_FE1, PSL_FE1); ASSYM(PSL_FP, PSL_FP); ASSYM(PSL_ME, PSL_ME); ASSYM(PSL_PR, PSL_PR); -#if defined(BOOKE_E500) ASSYM(PSL_PMM, PSL_PMM); -#endif ASSYM(PSL_KERNSET, PSL_KERNSET); ASSYM(PSL_USERSET, PSL_USERSET); +ASSYM(PSL_USERSTATIC, PSL_USERSTATIC); From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 14:38:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E4778705; Fri, 25 Oct 2013 14:38:46 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D19A32B07; Fri, 25 Oct 2013 14:38:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PEckGn095434; Fri, 25 Oct 2013 14:38:46 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PEckZO095433; Fri, 25 Oct 2013 14:38:46 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310251438.r9PEckZO095433@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 25 Oct 2013 14:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257116 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 14:38:47 -0000 Author: nwhitehorn Date: Fri Oct 25 14:38:46 2013 New Revision: 257116 URL: http://svnweb.freebsd.org/changeset/base/257116 Log: Remove dead reference to PSL_MBO. Modified: head/sys/powerpc/powerpc/exec_machdep.c Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Fri Oct 25 14:37:15 2013 (r257115) +++ head/sys/powerpc/powerpc/exec_machdep.c Fri Oct 25 14:38:46 2013 (r257116) @@ -1036,7 +1036,7 @@ cpu_set_upcall_kse(struct thread *td, vo tf->srr0 = entry_desc[0]; tf->fixreg[2] = entry_desc[1]; tf->fixreg[11] = entry_desc[2]; - tf->srr1 = PSL_SF | PSL_MBO | PSL_USERSET | PSL_FE_DFLT; + tf->srr1 = PSL_SF | PSL_USERSET | PSL_FE_DFLT; #endif } From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 14:43:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 92FE1A5E; Fri, 25 Oct 2013 14:43:17 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7D6D72B5A; Fri, 25 Oct 2013 14:43:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PEhHDA098191; Fri, 25 Oct 2013 14:43:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PEhH5q098189; Fri, 25 Oct 2013 14:43:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310251443.r9PEhH5q098189@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 25 Oct 2013 14:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257117 - in head/sys: conf powerpc/mpc85xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 14:43:17 -0000 Author: nwhitehorn Date: Fri Oct 25 14:43:16 2013 New Revision: 257117 URL: http://svnweb.freebsd.org/changeset/base/257117 Log: Convert e500 PCI driver to use common PPC PCI bus glue. No functional changes. Added: head/sys/powerpc/mpc85xx/pci_mpc85xx.c - copied, changed from r257116, head/sys/powerpc/mpc85xx/pci_fdt.c Deleted: head/sys/powerpc/mpc85xx/pci_fdt.c Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Fri Oct 25 14:38:46 2013 (r257116) +++ head/sys/conf/files.powerpc Fri Oct 25 14:43:16 2013 (r257117) @@ -132,12 +132,12 @@ powerpc/mpc85xx/i2c.c optional iicbus f powerpc/mpc85xx/isa.c optional mpc85xx isa powerpc/mpc85xx/lbc.c optional mpc85xx powerpc/mpc85xx/mpc85xx.c optional mpc85xx -powerpc/mpc85xx/pci_fdt.c optional pci mpc85xx +powerpc/mpc85xx/pci_mpc85xx.c optional pci mpc85xx powerpc/ofw/ofw_cpu.c optional aim powerpc/ofw/ofw_machdep.c optional aim -powerpc/ofw/ofw_pci.c optional pci aim -powerpc/ofw/ofw_pcibus.c optional pci aim -powerpc/ofw/ofw_pcib_pci.c optional pci aim +powerpc/ofw/ofw_pci.c optional pci +powerpc/ofw/ofw_pcibus.c optional pci +powerpc/ofw/ofw_pcib_pci.c optional pci powerpc/ofw/ofw_real.c optional aim powerpc/ofw/ofw_syscons.c optional sc aim powerpc/ofw/ofwcall32.S optional aim powerpc Copied and modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c (from r257116, head/sys/powerpc/mpc85xx/pci_fdt.c) ============================================================================== --- head/sys/powerpc/mpc85xx/pci_fdt.c Fri Oct 25 14:38:46 2013 (r257116, copy source) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx.c Fri Oct 25 14:43:16 2013 (r257117) @@ -55,13 +55,15 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include #include #include +#include + #include "ofw_bus_if.h" #include "pcib_if.h" @@ -98,20 +100,15 @@ __FBSDID("$FreeBSD$"); #define DEVFN(b, s, f) ((b << 16) | (s << 8) | f) struct fsl_pcib_softc { + struct ofw_pci_softc pci_sc; device_t sc_dev; - struct rman sc_iomem; - bus_addr_t sc_iomem_va; /* Virtual mapping. */ - bus_addr_t sc_iomem_size; - bus_addr_t sc_iomem_alloc; /* Next allocation. */ int sc_iomem_target; - struct rman sc_ioport; - bus_addr_t sc_ioport_va; /* Virtual mapping. */ - bus_addr_t sc_ioport_size; - bus_addr_t sc_ioport_alloc; /* Next allocation. */ + bus_addr_t sc_iomem_alloc, sc_iomem_start, sc_iomem_end; int sc_ioport_target; + bus_addr_t sc_ioport_alloc, sc_ioport_start, sc_ioport_end; - struct resource *sc_res; + struct resource *sc_res; bus_space_handle_t sc_bsh; bus_space_tag_t sc_bst; int sc_rid; @@ -123,8 +120,6 @@ struct fsl_pcib_softc { /* Devices that need special attention. */ int sc_devfn_tundra; int sc_devfn_via_ide; - - struct fdt_pci_intr sc_intr_info; }; /* Local forward declerations. */ @@ -137,9 +132,6 @@ static void fsl_pcib_err_init(device_t); static void fsl_pcib_inbound(struct fsl_pcib_softc *, int, int, u_long, u_long, u_long); static int fsl_pcib_init(struct fsl_pcib_softc *, int, int); -static int fsl_pcib_intr_info(phandle_t, struct fsl_pcib_softc *); -static int fsl_pcib_set_range(struct fsl_pcib_softc *, int, int, u_long, - u_long); static void fsl_pcib_outbound(struct fsl_pcib_softc *, int, int, u_long, u_long, u_long); @@ -148,13 +140,6 @@ static int fsl_pcib_attach(device_t); static int fsl_pcib_detach(device_t); static int fsl_pcib_probe(device_t); -static struct resource *fsl_pcib_alloc_resource(device_t, device_t, int, int *, - u_long, u_long, u_long, u_int); -static int fsl_pcib_read_ivar(device_t, device_t, int, uintptr_t *); -static int fsl_pcib_release_resource(device_t, device_t, int, int, - struct resource *); -static int fsl_pcib_write_ivar(device_t, device_t, int, uintptr_t); - static int fsl_pcib_maxslots(device_t); static uint32_t fsl_pcib_read_config(device_t, u_int, u_int, u_int, u_int, int); static void fsl_pcib_write_config(device_t, u_int, u_int, u_int, u_int, @@ -173,53 +158,30 @@ static device_method_t fsl_pcib_methods[ DEVMETHOD(device_attach, fsl_pcib_attach), DEVMETHOD(device_detach, fsl_pcib_detach), - /* Bus interface */ - DEVMETHOD(bus_read_ivar, fsl_pcib_read_ivar), - DEVMETHOD(bus_write_ivar, fsl_pcib_write_ivar), - DEVMETHOD(bus_alloc_resource, fsl_pcib_alloc_resource), - DEVMETHOD(bus_release_resource, fsl_pcib_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - /* pcib interface */ DEVMETHOD(pcib_maxslots, fsl_pcib_maxslots), DEVMETHOD(pcib_read_config, fsl_pcib_read_config), DEVMETHOD(pcib_write_config, fsl_pcib_write_config), - DEVMETHOD(pcib_route_interrupt, pcib_route_interrupt), - - /* OFW bus interface */ - DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), - DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), - DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), - DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), - DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), DEVMETHOD_END }; -static driver_t fsl_pcib_driver = { - "pcib", - fsl_pcib_methods, - sizeof(struct fsl_pcib_softc), -}; - -devclass_t pcib_devclass; +static devclass_t fsl_pcib_devclass; -DRIVER_MODULE(pcib, fdtbus, fsl_pcib_driver, pcib_devclass, 0, 0); +DEFINE_CLASS_1(pcib, fsl_pcib_driver, fsl_pcib_methods, + sizeof(struct fsl_pcib_softc), ofw_pci_driver); +DRIVER_MODULE(pcib, fdtbus, fsl_pcib_driver, fsl_pcib_devclass, 0, 0); static int fsl_pcib_probe(device_t dev) { - phandle_t node; - node = ofw_bus_get_node(dev); - if (!fdt_is_type(node, "pci")) + if (ofw_bus_get_type(dev) == NULL || + strcmp(ofw_bus_get_type(dev), "pci") != 0) return (ENXIO); - if (!(fdt_is_compatible(node, "fsl,mpc8540-pci") || - fdt_is_compatible(node, "fsl,mpc8548-pcie"))) + if (!(ofw_bus_is_compatible(dev, "fsl,mpc8540-pci") || + ofw_bus_is_compatible(dev, "fsl,mpc8548-pcie"))) return (ENXIO); device_set_desc(dev, "Freescale Integrated PCI/PCI-E Controller"); @@ -232,7 +194,7 @@ fsl_pcib_attach(device_t dev) struct fsl_pcib_softc *sc; phandle_t node; uint32_t cfgreg; - int maxslot; + int maxslot, error; uint8_t ltssm, capptr; sc = device_get_softc(dev); @@ -273,13 +235,14 @@ fsl_pcib_attach(device_t dev) } node = ofw_bus_get_node(dev); + /* - * Get PCI interrupt info. + * Initialize generic OF PCI interface (ranges, etc.) */ - if (fsl_pcib_intr_info(node, sc) != 0) { - device_printf(dev, "could not retrieve interrupt info\n"); - goto err; - } + + error = ofw_pci_init(dev); + if (error) + return (error); /* * Configure decode windows for PCI(E) access. @@ -315,11 +278,9 @@ fsl_pcib_attach(device_t dev) fsl_pcib_err_init(dev); - device_add_child(dev, "pci", -1); - return (bus_generic_attach(dev)); + return (ofw_pci_attach(dev)); err: - bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_rid, sc->sc_res); return (ENXIO); } @@ -542,37 +503,6 @@ fsl_pcib_init_bar(struct fsl_pcib_softc return (width); } -static u_int -fsl_pcib_route_int(struct fsl_pcib_softc *sc, u_int bus, u_int slot, u_int func, - u_int intpin) -{ - int err, unit; - u_int devfn, intline; - - unit = device_get_unit(sc->sc_dev); - - devfn = DEVFN(bus, slot, func); - if (devfn == sc->sc_devfn_via_ide) - intline = MAP_IRQ(0, 14); - else if (devfn == sc->sc_devfn_via_ide + 1) - intline = MAP_IRQ(0, 10); - else if (devfn == sc->sc_devfn_via_ide + 2) - intline = MAP_IRQ(0, 10); - else { - if (intpin != 0) - err = fdt_pci_route_intr(bus, slot, func, intpin, - &sc->sc_intr_info, &intline); - else - intline = 0xff; - } - - if (bootverbose) - printf("PCI %u:%u:%u:%u: intpin %u: intline=%u\n", - unit, bus, slot, func, intpin, intline); - - return (intline); -} - static int fsl_pcib_init(struct fsl_pcib_softc *sc, int bus, int maxslot) { @@ -583,7 +513,6 @@ fsl_pcib_init(struct fsl_pcib_softc *sc, int bar, maxbar; uint16_t vendor, device; uint8_t command, hdrtype, class, subclass; - uint8_t intline, intpin; secbus = bus; for (slot = 0; slot <= maxslot; slot++) { @@ -624,13 +553,9 @@ fsl_pcib_init(struct fsl_pcib_softc *sc, bar += fsl_pcib_init_bar(sc, bus, slot, func, bar); - /* Perform interrupt routing. */ - intpin = fsl_pcib_read_config(sc->sc_dev, bus, slot, - func, PCIR_INTPIN, 1); - intline = fsl_pcib_route_int(sc, bus, slot, func, - intpin); + /* Put a placeholder interrupt value */ fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_INTLINE, intline, 1); + PCIR_INTLINE, PCI_INVALID_IRQ, 1); command |= PCIM_CMD_MEMEN | PCIM_CMD_PORTEN; fsl_pcib_write_config(sc->sc_dev, bus, slot, func, @@ -654,19 +579,19 @@ fsl_pcib_init(struct fsl_pcib_softc *sc, /* Program I/O decoder. */ fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_IOBASEL_1, sc->sc_ioport.rm_start >> 8, 1); + PCIR_IOBASEL_1, sc->sc_ioport_start >> 8, 1); fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_IOLIMITL_1, sc->sc_ioport.rm_end >> 8, 1); + PCIR_IOLIMITL_1, sc->sc_ioport_end >> 8, 1); fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_IOBASEH_1, sc->sc_ioport.rm_start >> 16, 2); + PCIR_IOBASEH_1, sc->sc_ioport_start >> 16, 2); fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_IOLIMITH_1, sc->sc_ioport.rm_end >> 16, 2); + PCIR_IOLIMITH_1, sc->sc_ioport_end >> 16, 2); /* Program (non-prefetchable) memory decoder. */ fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_MEMBASE_1, sc->sc_iomem.rm_start >> 16, 2); + PCIR_MEMBASE_1, sc->sc_iomem_start >> 16, 2); fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_MEMLIMIT_1, sc->sc_iomem.rm_end >> 16, 2); + PCIR_MEMLIMIT_1, sc->sc_iomem_end >> 16, 2); /* Program prefetchable memory decoder. */ fsl_pcib_write_config(sc->sc_dev, bus, slot, func, @@ -769,62 +694,6 @@ fsl_pcib_outbound(struct fsl_pcib_softc bus_space_write_4(sc->sc_bst, sc->sc_bsh, REG_POWAR(wnd), attr); } -static int -fsl_pcib_set_range(struct fsl_pcib_softc *sc, int type, int wnd, u_long start, - u_long size) -{ - struct rman *rm; - u_long end, alloc; - bus_addr_t pci_start, pci_end; - bus_addr_t *vap, *allocp; - int error; - - end = start + size - 1; - - switch (type) { - case SYS_RES_IOPORT: - rm = &sc->sc_ioport; - pci_start = 0x0000; - pci_end = 0xffff; - alloc = 0x1000; - vap = &sc->sc_ioport_va; - allocp = &sc->sc_ioport_alloc; - break; - case SYS_RES_MEMORY: - rm = &sc->sc_iomem; - pci_start = start; - pci_end = end; - alloc = 0; - vap = &sc->sc_iomem_va; - allocp = &sc->sc_iomem_alloc; - break; - default: - return (EINVAL); - } - - rm->rm_type = RMAN_ARRAY; - rm->rm_start = pci_start; - rm->rm_end = pci_end; - error = rman_init(rm); - if (error) - return (error); - - error = rman_manage_region(rm, pci_start, pci_end); - if (error) { - rman_fini(rm); - return (error); - } - - *allocp = pci_start + alloc; - if (size > 0) { - *vap = (uintptr_t)pmap_mapdev(start, size); - fsl_pcib_outbound(sc, wnd, type, start, size, pci_start); - } else { - *vap = 0; - fsl_pcib_outbound(sc, wnd, -1, 0, 0, 0); - } - return (0); -} static void fsl_pcib_err_init(device_t dev) @@ -880,106 +749,15 @@ fsl_pcib_detach(device_t dev) return (bus_generic_detach(dev)); } -static struct resource * -fsl_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) -{ - struct fsl_pcib_softc *sc = device_get_softc(dev); - struct rman *rm; - struct resource *res; - bus_addr_t va; - - switch (type) { - case SYS_RES_IOPORT: - rm = &sc->sc_ioport; - va = sc->sc_ioport_va; - break; - case SYS_RES_MEMORY: - rm = &sc->sc_iomem; - va = sc->sc_iomem_va; - break; - case SYS_RES_IRQ: - if (start < 16) { - device_printf(dev, "%s requested ISA interrupt %lu\n", - device_get_nameunit(child), start); - } - flags |= RF_SHAREABLE; - return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child, - type, rid, start, end, count, flags)); - default: - return (NULL); - } - - res = rman_reserve_resource(rm, start, end, count, flags, child); - if (res == NULL) - return (NULL); - - rman_set_bustag(res, &bs_le_tag); - rman_set_bushandle(res, va + rman_get_start(res) - rm->rm_start); - return (res); -} - -static int -fsl_pcib_release_resource(device_t dev, device_t child, int type, int rid, - struct resource *res) -{ - - return (rman_release_resource(res)); -} - -static int -fsl_pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) -{ - struct fsl_pcib_softc *sc = device_get_softc(dev); - - switch (which) { - case PCIB_IVAR_BUS: - *result = sc->sc_busnr; - return (0); - case PCIB_IVAR_DOMAIN: - *result = device_get_unit(dev); - return (0); - } - return (ENOENT); -} - -static int -fsl_pcib_write_ivar(device_t dev, device_t child, int which, uintptr_t value) -{ - struct fsl_pcib_softc *sc = device_get_softc(dev); - - switch (which) { - case PCIB_IVAR_BUS: - sc->sc_busnr = value; - return (0); - } - return (ENOENT); -} - -static int -fsl_pcib_intr_info(phandle_t node, struct fsl_pcib_softc *sc) -{ - int error; - - if ((error = fdt_pci_intr_info(node, &sc->sc_intr_info)) != 0) - return (error); - - return (0); -} - static int fsl_pcib_decode_win(phandle_t node, struct fsl_pcib_softc *sc) { - struct fdt_pci_range io_space, mem_space; device_t dev; - int error; + int error, i, trgt; dev = sc->sc_dev; - if ((error = fdt_pci_ranges(node, &io_space, &mem_space)) != 0) { - device_printf(dev, "could not retrieve 'ranges' data\n"); - return (error); - } + fsl_pcib_outbound(sc, 0, -1, 0, 0, 0); /* * Configure LAW decode windows. @@ -990,30 +768,52 @@ fsl_pcib_decode_win(phandle_t node, stru device_printf(dev, "could not retrieve PCI LAW target info\n"); return (error); } - error = law_enable(sc->sc_iomem_target, mem_space.base_parent, - mem_space.len); - if (error != 0) { - device_printf(dev, "could not program LAW for PCI MEM range\n"); - return (error); - } - error = law_enable(sc->sc_ioport_target, io_space.base_parent, - io_space.len); - if (error != 0) { - device_printf(dev, "could not program LAW for PCI IO range\n"); - return (error); + + for (i = 0; i < sc->pci_sc.sc_nrange; i++) { + switch (sc->pci_sc.sc_range[i].pci_hi & + OFW_PCI_PHYS_HI_SPACEMASK) { + case OFW_PCI_PHYS_HI_SPACE_CONFIG: + continue; + case OFW_PCI_PHYS_HI_SPACE_IO: + trgt = sc->sc_ioport_target; + fsl_pcib_outbound(sc, 2, SYS_RES_IOPORT, + sc->pci_sc.sc_range[i].host, + sc->pci_sc.sc_range[i].size, + sc->pci_sc.sc_range[i].pci); + sc->sc_ioport_start = sc->pci_sc.sc_range[i].host; + sc->sc_ioport_end = sc->pci_sc.sc_range[i].host + + sc->pci_sc.sc_range[i].size; + sc->sc_ioport_alloc = 0x1000 + sc->pci_sc.sc_range[i].pci; + break; + case OFW_PCI_PHYS_HI_SPACE_MEM32: + case OFW_PCI_PHYS_HI_SPACE_MEM64: + trgt = sc->sc_iomem_target; + fsl_pcib_outbound(sc, 1, SYS_RES_MEMORY, + sc->pci_sc.sc_range[i].host, + sc->pci_sc.sc_range[i].size, + sc->pci_sc.sc_range[i].pci); + sc->sc_iomem_start = sc->pci_sc.sc_range[i].host; + sc->sc_iomem_end = sc->pci_sc.sc_range[i].host + + sc->pci_sc.sc_range[i].size; + sc->sc_iomem_alloc = sc->pci_sc.sc_range[i].pci; + break; + default: + panic("Unknown range type %#x\n", + sc->pci_sc.sc_range[i].pci_hi & + OFW_PCI_PHYS_HI_SPACEMASK); + } + error = law_enable(trgt, sc->pci_sc.sc_range[i].host, + sc->pci_sc.sc_range[i].size); + if (error != 0) { + device_printf(dev, "could not program LAW for range " + "%d\n", i); + return (error); + } } /* * Set outbout and inbound windows. */ - fsl_pcib_outbound(sc, 0, -1, 0, 0, 0); - if ((error = fsl_pcib_set_range(sc, SYS_RES_MEMORY, 1, - mem_space.base_parent, mem_space.len)) != 0) - return (error); - if ((error = fsl_pcib_set_range(sc, SYS_RES_IOPORT, 2, - io_space.base_parent, io_space.len)) != 0) - return (error); - fsl_pcib_outbound(sc, 3, -1, 0, 0, 0); fsl_pcib_outbound(sc, 4, -1, 0, 0, 0); @@ -1024,3 +824,4 @@ fsl_pcib_decode_win(phandle_t node, stru return (0); } + From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 15:37:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CEB14E15; Fri, 25 Oct 2013 15:37:58 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BC1A82E54; Fri, 25 Oct 2013 15:37:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PFbwpr016255; Fri, 25 Oct 2013 15:37:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PFbwe3016254; Fri, 25 Oct 2013 15:37:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310251537.r9PFbwe3016254@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 25 Oct 2013 15:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257118 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 15:37:58 -0000 Author: nwhitehorn Date: Fri Oct 25 15:37:58 2013 New Revision: 257118 URL: http://svnweb.freebsd.org/changeset/base/257118 Log: Make sure to get the right node when looking up #interrupt-cells. Modified: head/sys/dev/ofw/ofw_nexus.c Modified: head/sys/dev/ofw/ofw_nexus.c ============================================================================== --- head/sys/dev/ofw/ofw_nexus.c Fri Oct 25 14:43:16 2013 (r257117) +++ head/sys/dev/ofw/ofw_nexus.c Fri Oct 25 15:37:58 2013 (r257118) @@ -464,8 +464,8 @@ nexus_setup_dinfo(device_t dev, phandle_ iparent = 0; OF_searchencprop(node, "interrupt-parent", &iparent, sizeof(iparent)); - OF_searchencprop(iparent, "#interrupt-cells", &icells, - sizeof(icells)); + OF_searchencprop(OF_xref_phandle(iparent), "#interrupt-cells", + &icells, sizeof(icells)); for (i = 0; i < nintr; i+= icells) { intr[i] = ofw_bus_map_intr(dev, iparent, intr[i]); resource_list_add(&ndi->ndi_rl, SYS_RES_IRQ, i, intr[i], From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 15:44:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2A9302CA; Fri, 25 Oct 2013 15:44:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 08CDA2EE0; Fri, 25 Oct 2013 15:44:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PFi1M2019052; Fri, 25 Oct 2013 15:44:01 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PFhxMr018989; Fri, 25 Oct 2013 15:43:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310251543.r9PFhxMr018989@svn.freebsd.org> From: Xin LI Date: Fri, 25 Oct 2013 15:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r257119 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 15:44:01 -0000 Author: delphij Date: Fri Oct 25 15:43:59 2013 New Revision: 257119 URL: http://svnweb.freebsd.org/changeset/base/257119 Log: MFC r253816: MFV r253780: To quote Illumos #3875: The problem here is that if we ever end up in the error path, we drop the locks protecting access to the zfsvfs_t prior to forcibly unmounting the filesystem. Because z_os is NULL, any thread that had already picked up the zfsvfs_t and was sitting in ZFS_ENTER() when we dropped our locks in zfs_resume_fs() will now acquire the lock, attempt to use z_os, and panic. Illumos ZFS issues: 3875 panic in zfs_root() after failed rollback Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Fri Oct 25 15:37:58 2013 (r257118) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Fri Oct 25 15:43:59 2013 (r257119) @@ -517,6 +517,38 @@ dmu_objset_rele(objset_t *os, void *tag) dsl_pool_rele(dp, tag); } +/* + * When we are called, os MUST refer to an objset associated with a dataset + * that is owned by 'tag'; that is, is held and long held by 'tag' and ds_owner + * == tag. We will then release and reacquire ownership of the dataset while + * holding the pool config_rwlock to avoid intervening namespace or ownership + * changes may occur. + * + * This exists solely to accommodate zfs_ioc_userspace_upgrade()'s desire to + * release the hold on its dataset and acquire a new one on the dataset of the + * same name so that it can be partially torn down and reconstructed. + */ +void +dmu_objset_refresh_ownership(objset_t *os, void *tag) +{ + dsl_pool_t *dp; + dsl_dataset_t *ds, *newds; + char name[MAXNAMELEN]; + + ds = os->os_dsl_dataset; + VERIFY3P(ds, !=, NULL); + VERIFY3P(ds->ds_owner, ==, tag); + VERIFY(dsl_dataset_long_held(ds)); + + dsl_dataset_name(ds, name); + dp = dmu_objset_pool(os); + dsl_pool_config_enter(dp, FTAG); + dmu_objset_disown(os, tag); + VERIFY0(dsl_dataset_own(dp, name, tag, &newds)); + VERIFY3P(newds, ==, os->os_dsl_dataset); + dsl_pool_config_exit(dp, FTAG); +} + void dmu_objset_disown(objset_t *os, void *tag) { Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri Oct 25 15:37:58 2013 (r257118) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri Oct 25 15:43:59 2013 (r257119) @@ -1602,7 +1602,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * if (error != 0) return (error); error = dsl_dataset_clone_swap_check_impl(drc->drc_ds, - origin_head, drc->drc_force); + origin_head, drc->drc_force, drc->drc_owner, tx); if (error != 0) { dsl_dataset_rele(origin_head, FTAG); return (error); @@ -1654,6 +1654,9 @@ dmu_recv_end_sync(void *arg, dmu_tx_t *t dsl_dataset_rele(origin_head, FTAG); dsl_destroy_head_sync_impl(drc->drc_ds, tx); + + if (drc->drc_owner != NULL) + VERIFY3P(origin_head->ds_owner, ==, drc->drc_owner); } else { dsl_dataset_t *ds = drc->drc_ds; @@ -1752,8 +1755,10 @@ dmu_recv_new_end(dmu_recv_cookie_t *drc) } int -dmu_recv_end(dmu_recv_cookie_t *drc) +dmu_recv_end(dmu_recv_cookie_t *drc, void *owner) { + drc->drc_owner = owner; + if (drc->drc_newfs) return (dmu_recv_new_end(drc)); else Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Oct 25 15:37:58 2013 (r257118) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Oct 25 15:43:59 2013 (r257119) @@ -1755,16 +1755,52 @@ dsl_dataset_rename_snapshot(const char * dsl_dataset_rename_snapshot_sync, &ddrsa, 1)); } +/* + * If we're doing an ownership handoff, we need to make sure that there is + * only one long hold on the dataset. We're not allowed to change anything here + * so we don't permanently release the long hold or regular hold here. We want + * to do this only when syncing to avoid the dataset unexpectedly going away + * when we release the long hold. + */ +static int +dsl_dataset_handoff_check(dsl_dataset_t *ds, void *owner, dmu_tx_t *tx) +{ + boolean_t held; + + if (!dmu_tx_is_syncing(tx)) + return (0); + + if (owner != NULL) { + VERIFY3P(ds->ds_owner, ==, owner); + dsl_dataset_long_rele(ds, owner); + } + + held = dsl_dataset_long_held(ds); + + if (owner != NULL) + dsl_dataset_long_hold(ds, owner); + + if (held) + return (SET_ERROR(EBUSY)); + + return (0); +} + +typedef struct dsl_dataset_rollback_arg { + const char *ddra_fsname; + void *ddra_owner; +} dsl_dataset_rollback_arg_t; + static int dsl_dataset_rollback_check(void *arg, dmu_tx_t *tx) { - const char *fsname = arg; + dsl_dataset_rollback_arg_t *ddra = arg; dsl_pool_t *dp = dmu_tx_pool(tx); dsl_dataset_t *ds; int64_t unused_refres_delta; int error; - error = dsl_dataset_hold(dp, fsname, FTAG, &ds); + error = dsl_dataset_hold(dp, ddra->ddra_fsname, FTAG, &ds); if (error != 0) return (error); @@ -1780,9 +1816,10 @@ dsl_dataset_rollback_check(void *arg, dm return (SET_ERROR(EINVAL)); } - if (dsl_dataset_long_held(ds)) { + error = dsl_dataset_handoff_check(ds, ddra->ddra_owner, tx); + if (error != 0) { dsl_dataset_rele(ds, FTAG); - return (SET_ERROR(EBUSY)); + return (error); } /* @@ -1819,12 +1856,12 @@ dsl_dataset_rollback_check(void *arg, dm static void dsl_dataset_rollback_sync(void *arg, dmu_tx_t *tx) { - const char *fsname = arg; + dsl_dataset_rollback_arg_t *ddra = arg; dsl_pool_t *dp = dmu_tx_pool(tx); dsl_dataset_t *ds, *clone; uint64_t cloneobj; - VERIFY0(dsl_dataset_hold(dp, fsname, FTAG, &ds)); + VERIFY0(dsl_dataset_hold(dp, ddra->ddra_fsname, FTAG, &ds)); cloneobj = dsl_dataset_create_sync(ds->ds_dir, "%rollback", ds->ds_prev, DS_CREATE_FLAG_NODIRTY, kcred, tx); @@ -1840,11 +1877,26 @@ dsl_dataset_rollback_sync(void *arg, dmu dsl_dataset_rele(ds, FTAG); } +/* + * If owner != NULL: + * + * - The existing dataset MUST be owned by the specified owner at entry + * - Upon return, dataset will still be held by the same owner, whether we + * succeed or not. + * + * This mode is required any time the existing filesystem is mounted. See + * notes above zfs_suspend_fs() for further details. + */ int -dsl_dataset_rollback(const char *fsname) +dsl_dataset_rollback(const char *fsname, void *owner) { + dsl_dataset_rollback_arg_t ddra; + + ddra.ddra_fsname = fsname; + ddra.ddra_owner = owner; + return (dsl_sync_task(fsname, dsl_dataset_rollback_check, - dsl_dataset_rollback_sync, (void *)fsname, 1)); + dsl_dataset_rollback_sync, (void *)&ddra, 1)); } struct promotenode { @@ -2362,7 +2414,7 @@ dsl_dataset_promote(const char *name, ch int dsl_dataset_clone_swap_check_impl(dsl_dataset_t *clone, - dsl_dataset_t *origin_head, boolean_t force) + dsl_dataset_t *origin_head, boolean_t force, void *owner, dmu_tx_t *tx) { int64_t unused_refres_delta; @@ -2391,7 +2443,7 @@ dsl_dataset_clone_swap_check_impl(dsl_da return (SET_ERROR(ETXTBSY)); /* origin_head should have no long holds (e.g. is not mounted) */ - if (dsl_dataset_long_held(origin_head)) + if (dsl_dataset_handoff_check(origin_head, owner, tx)) return (SET_ERROR(EBUSY)); /* check amount of any unconsumed refreservation */ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Fri Oct 25 15:37:58 2013 (r257118) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Fri Oct 25 15:43:59 2013 (r257119) @@ -136,6 +136,7 @@ struct objset { int dmu_objset_hold(const char *name, void *tag, objset_t **osp); int dmu_objset_own(const char *name, dmu_objset_type_t type, boolean_t readonly, void *tag, objset_t **osp); +void dmu_objset_refresh_ownership(objset_t *os, void *tag); void dmu_objset_rele(objset_t *os, void *tag); void dmu_objset_disown(objset_t *os, void *tag); int dmu_objset_from_ds(struct dsl_dataset *ds, objset_t **osp); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h Fri Oct 25 15:37:58 2013 (r257118) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h Fri Oct 25 15:43:59 2013 (r257119) @@ -62,6 +62,7 @@ typedef struct dmu_recv_cookie { struct avl_tree *drc_guid_to_ds_map; zio_cksum_t drc_cksum; uint64_t drc_newsnapobj; + void *drc_owner; } dmu_recv_cookie_t; int dmu_recv_begin(char *tofs, char *tosnap, struct drr_begin *drrb, @@ -72,6 +73,6 @@ int dmu_recv_stream(dmu_recv_cookie_t *d int dmu_recv_stream(dmu_recv_cookie_t *drc, struct file *fp, offset_t *voffp, #endif int cleanup_fd, uint64_t *action_handlep); -int dmu_recv_end(dmu_recv_cookie_t *drc); +int dmu_recv_end(dmu_recv_cookie_t *drc, void *owner); #endif /* _DMU_SEND_H */ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Fri Oct 25 15:37:58 2013 (r257118) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Fri Oct 25 15:43:59 2013 (r257119) @@ -247,7 +247,7 @@ void dsl_dataset_long_rele(dsl_dataset_t boolean_t dsl_dataset_long_held(dsl_dataset_t *ds); int dsl_dataset_clone_swap_check_impl(dsl_dataset_t *clone, - dsl_dataset_t *origin_head, boolean_t force); + dsl_dataset_t *origin_head, boolean_t force, void *owner, dmu_tx_t *tx); void dsl_dataset_clone_swap_sync_impl(dsl_dataset_t *clone, dsl_dataset_t *origin_head, dmu_tx_t *tx); int dsl_dataset_snapshot_check_impl(dsl_dataset_t *ds, const char *snapname, @@ -264,7 +264,7 @@ int dsl_dataset_snap_lookup(dsl_dataset_ int dsl_dataset_snap_remove(dsl_dataset_t *ds, const char *name, dmu_tx_t *tx); void dsl_dataset_set_refreservation_sync_impl(dsl_dataset_t *ds, zprop_source_t source, uint64_t value, dmu_tx_t *tx); -int dsl_dataset_rollback(const char *fsname); +int dsl_dataset_rollback(const char *fsname, void *owner); #ifdef ZFS_DEBUG #define dprintf_ds(ds, fmt, ...) do { \ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Oct 25 15:37:58 2013 (r257118) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Oct 25 15:43:59 2013 (r257119) @@ -3568,13 +3568,13 @@ zfs_ioc_rollback(zfs_cmd_t *zc) if (error == 0) { int resume_err; - error = dsl_dataset_rollback(zc->zc_name); + error = dsl_dataset_rollback(zc->zc_name, zfsvfs); resume_err = zfs_resume_fs(zfsvfs, zc->zc_name); error = error ? error : resume_err; } VFS_RELE(zfsvfs->z_vfs); } else { - error = dsl_dataset_rollback(zc->zc_name); + error = dsl_dataset_rollback(zc->zc_name, NULL); } return (error); } @@ -4110,13 +4110,13 @@ zfs_ioc_recv(zfs_cmd_t *zc) * If the suspend fails, then the recv_end will * likely also fail, and clean up after itself. */ - end_err = dmu_recv_end(&drc); + end_err = dmu_recv_end(&drc, zfsvfs); if (error == 0) error = zfs_resume_fs(zfsvfs, tofs); error = error ? error : end_err; VFS_RELE(zfsvfs->z_vfs); } else { - error = dmu_recv_end(&drc); + error = dmu_recv_end(&drc, NULL); } } @@ -4607,8 +4607,11 @@ zfs_ioc_userspace_upgrade(zfs_cmd_t *zc) * objset_phys_t). Suspend/resume the fs will do that. */ error = zfs_suspend_fs(zfsvfs); - if (error == 0) + if (error == 0) { + dmu_objset_refresh_ownership(zfsvfs->z_os, + zfsvfs); error = zfs_resume_fs(zfsvfs, zc->zc_name); + } } if (error == 0) error = dmu_objset_userspace_upgrade(zfsvfs->z_os); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Oct 25 15:37:58 2013 (r257118) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Oct 25 15:43:59 2013 (r257119) @@ -2210,7 +2210,9 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int * Block out VOPs and close zfsvfs_t::z_os * * Note, if successful, then we return with the 'z_teardown_lock' and - * 'z_teardown_inactive_lock' write held. + * 'z_teardown_inactive_lock' write held. We leave ownership of the underlying + * dataset and objset intact so that they can be atomically handed off during + * a subsequent rollback or recv operation and the resume thereafter. */ int zfs_suspend_fs(zfsvfs_t *zfsvfs) @@ -2219,71 +2221,76 @@ zfs_suspend_fs(zfsvfs_t *zfsvfs) if ((error = zfsvfs_teardown(zfsvfs, B_FALSE)) != 0) return (error); - dmu_objset_disown(zfsvfs->z_os, zfsvfs); return (0); } /* - * Reopen zfsvfs_t::z_os and release VOPs. + * Rebuild SA and release VOPs. Note that ownership of the underlying dataset + * is an invariant across any of the operations that can be performed while the + * filesystem was suspended. Whether it succeeded or failed, the preconditions + * are the same: the relevant objset and associated dataset are owned by + * zfsvfs, held, and long held on entry. */ int zfs_resume_fs(zfsvfs_t *zfsvfs, const char *osname) { int err; + znode_t *zp; + uint64_t sa_obj = 0; ASSERT(RRW_WRITE_HELD(&zfsvfs->z_teardown_lock)); ASSERT(RW_WRITE_HELD(&zfsvfs->z_teardown_inactive_lock)); - err = dmu_objset_own(osname, DMU_OST_ZFS, B_FALSE, zfsvfs, - &zfsvfs->z_os); - if (err) { - zfsvfs->z_os = NULL; - } else { - znode_t *zp; - uint64_t sa_obj = 0; + /* + * We already own this, so just hold and rele it to update the + * objset_t, as the one we had before may have been evicted. + */ + VERIFY0(dmu_objset_hold(osname, zfsvfs, &zfsvfs->z_os)); + VERIFY3P(zfsvfs->z_os->os_dsl_dataset->ds_owner, ==, zfsvfs); + VERIFY(dsl_dataset_long_held(zfsvfs->z_os->os_dsl_dataset)); + dmu_objset_rele(zfsvfs->z_os, zfsvfs); - /* - * Make sure version hasn't changed - */ + /* + * Make sure version hasn't changed + */ - err = zfs_get_zplprop(zfsvfs->z_os, ZFS_PROP_VERSION, - &zfsvfs->z_version); + err = zfs_get_zplprop(zfsvfs->z_os, ZFS_PROP_VERSION, + &zfsvfs->z_version); - if (err) - goto bail; + if (err) + goto bail; - err = zap_lookup(zfsvfs->z_os, MASTER_NODE_OBJ, - ZFS_SA_ATTRS, 8, 1, &sa_obj); + err = zap_lookup(zfsvfs->z_os, MASTER_NODE_OBJ, + ZFS_SA_ATTRS, 8, 1, &sa_obj); - if (err && zfsvfs->z_version >= ZPL_VERSION_SA) - goto bail; + if (err && zfsvfs->z_version >= ZPL_VERSION_SA) + goto bail; - if ((err = sa_setup(zfsvfs->z_os, sa_obj, - zfs_attr_table, ZPL_END, &zfsvfs->z_attr_table)) != 0) - goto bail; + if ((err = sa_setup(zfsvfs->z_os, sa_obj, + zfs_attr_table, ZPL_END, &zfsvfs->z_attr_table)) != 0) + goto bail; - if (zfsvfs->z_version >= ZPL_VERSION_SA) - sa_register_update_callback(zfsvfs->z_os, - zfs_sa_upgrade); + if (zfsvfs->z_version >= ZPL_VERSION_SA) + sa_register_update_callback(zfsvfs->z_os, + zfs_sa_upgrade); - VERIFY(zfsvfs_setup(zfsvfs, B_FALSE) == 0); + VERIFY(zfsvfs_setup(zfsvfs, B_FALSE) == 0); - zfs_set_fuid_feature(zfsvfs); + zfs_set_fuid_feature(zfsvfs); - /* - * Attempt to re-establish all the active znodes with - * their dbufs. If a zfs_rezget() fails, then we'll let - * any potential callers discover that via ZFS_ENTER_VERIFY_VP - * when they try to use their znode. - */ - mutex_enter(&zfsvfs->z_znodes_lock); - for (zp = list_head(&zfsvfs->z_all_znodes); zp; - zp = list_next(&zfsvfs->z_all_znodes, zp)) { - (void) zfs_rezget(zp); - } - mutex_exit(&zfsvfs->z_znodes_lock); + /* + * Attempt to re-establish all the active znodes with + * their dbufs. If a zfs_rezget() fails, then we'll let + * any potential callers discover that via ZFS_ENTER_VERIFY_VP + * when they try to use their znode. + */ + mutex_enter(&zfsvfs->z_znodes_lock); + for (zp = list_head(&zfsvfs->z_all_znodes); zp; + zp = list_next(&zfsvfs->z_all_znodes, zp)) { + (void) zfs_rezget(zp); } + mutex_exit(&zfsvfs->z_znodes_lock); bail: /* release the VOPs */ @@ -2292,8 +2299,8 @@ bail: if (err) { /* - * Since we couldn't reopen zfsvfs::z_os, or - * setup the sa framework force unmount this file system. + * Since we couldn't setup the sa framework, try to force + * unmount this file system. */ if (vn_vfswlock(zfsvfs->z_vfs->vfs_vnodecovered) == 0) (void) dounmount(zfsvfs->z_vfs, MS_FORCE, curthread); From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 15:45:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 38475419; Fri, 25 Oct 2013 15:45:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 14DE22EF1; Fri, 25 Oct 2013 15:45:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PFjVk2019320; Fri, 25 Oct 2013 15:45:31 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PFjTZe019312; Fri, 25 Oct 2013 15:45:29 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310251545.r9PFjTZe019312@svn.freebsd.org> From: Xin LI Date: Fri, 25 Oct 2013 15:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r257120 - in stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 15:45:31 -0000 Author: delphij Date: Fri Oct 25 15:45:29 2013 New Revision: 257120 URL: http://svnweb.freebsd.org/changeset/base/257120 Log: MFC r253816: MFV r253780: To quote Illumos #3875: The problem here is that if we ever end up in the error path, we drop the locks protecting access to the zfsvfs_t prior to forcibly unmounting the filesystem. Because z_os is NULL, any thread that had already picked up the zfsvfs_t and was sitting in ZFS_ENTER() when we dropped our locks in zfs_resume_fs() will now acquire the lock, attempt to use z_os, and panic. Illumos ZFS issues: 3875 panic in zfs_root() after failed rollback Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Fri Oct 25 15:43:59 2013 (r257119) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Fri Oct 25 15:45:29 2013 (r257120) @@ -514,6 +514,38 @@ dmu_objset_rele(objset_t *os, void *tag) dsl_pool_rele(dp, tag); } +/* + * When we are called, os MUST refer to an objset associated with a dataset + * that is owned by 'tag'; that is, is held and long held by 'tag' and ds_owner + * == tag. We will then release and reacquire ownership of the dataset while + * holding the pool config_rwlock to avoid intervening namespace or ownership + * changes may occur. + * + * This exists solely to accommodate zfs_ioc_userspace_upgrade()'s desire to + * release the hold on its dataset and acquire a new one on the dataset of the + * same name so that it can be partially torn down and reconstructed. + */ +void +dmu_objset_refresh_ownership(objset_t *os, void *tag) +{ + dsl_pool_t *dp; + dsl_dataset_t *ds, *newds; + char name[MAXNAMELEN]; + + ds = os->os_dsl_dataset; + VERIFY3P(ds, !=, NULL); + VERIFY3P(ds->ds_owner, ==, tag); + VERIFY(dsl_dataset_long_held(ds)); + + dsl_dataset_name(ds, name); + dp = dmu_objset_pool(os); + dsl_pool_config_enter(dp, FTAG); + dmu_objset_disown(os, tag); + VERIFY0(dsl_dataset_own(dp, name, tag, &newds)); + VERIFY3P(newds, ==, os->os_dsl_dataset); + dsl_pool_config_exit(dp, FTAG); +} + void dmu_objset_disown(objset_t *os, void *tag) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri Oct 25 15:43:59 2013 (r257119) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri Oct 25 15:45:29 2013 (r257120) @@ -1602,7 +1602,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * if (error != 0) return (error); error = dsl_dataset_clone_swap_check_impl(drc->drc_ds, - origin_head, drc->drc_force); + origin_head, drc->drc_force, drc->drc_owner, tx); if (error != 0) { dsl_dataset_rele(origin_head, FTAG); return (error); @@ -1654,6 +1654,9 @@ dmu_recv_end_sync(void *arg, dmu_tx_t *t dsl_dataset_rele(origin_head, FTAG); dsl_destroy_head_sync_impl(drc->drc_ds, tx); + + if (drc->drc_owner != NULL) + VERIFY3P(origin_head->ds_owner, ==, drc->drc_owner); } else { dsl_dataset_t *ds = drc->drc_ds; @@ -1752,8 +1755,10 @@ dmu_recv_new_end(dmu_recv_cookie_t *drc) } int -dmu_recv_end(dmu_recv_cookie_t *drc) +dmu_recv_end(dmu_recv_cookie_t *drc, void *owner) { + drc->drc_owner = owner; + if (drc->drc_newfs) return (dmu_recv_new_end(drc)); else Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Oct 25 15:43:59 2013 (r257119) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Oct 25 15:45:29 2013 (r257120) @@ -1755,16 +1755,52 @@ dsl_dataset_rename_snapshot(const char * dsl_dataset_rename_snapshot_sync, &ddrsa, 1)); } +/* + * If we're doing an ownership handoff, we need to make sure that there is + * only one long hold on the dataset. We're not allowed to change anything here + * so we don't permanently release the long hold or regular hold here. We want + * to do this only when syncing to avoid the dataset unexpectedly going away + * when we release the long hold. + */ +static int +dsl_dataset_handoff_check(dsl_dataset_t *ds, void *owner, dmu_tx_t *tx) +{ + boolean_t held; + + if (!dmu_tx_is_syncing(tx)) + return (0); + + if (owner != NULL) { + VERIFY3P(ds->ds_owner, ==, owner); + dsl_dataset_long_rele(ds, owner); + } + + held = dsl_dataset_long_held(ds); + + if (owner != NULL) + dsl_dataset_long_hold(ds, owner); + + if (held) + return (SET_ERROR(EBUSY)); + + return (0); +} + +typedef struct dsl_dataset_rollback_arg { + const char *ddra_fsname; + void *ddra_owner; +} dsl_dataset_rollback_arg_t; + static int dsl_dataset_rollback_check(void *arg, dmu_tx_t *tx) { - const char *fsname = arg; + dsl_dataset_rollback_arg_t *ddra = arg; dsl_pool_t *dp = dmu_tx_pool(tx); dsl_dataset_t *ds; int64_t unused_refres_delta; int error; - error = dsl_dataset_hold(dp, fsname, FTAG, &ds); + error = dsl_dataset_hold(dp, ddra->ddra_fsname, FTAG, &ds); if (error != 0) return (error); @@ -1780,9 +1816,10 @@ dsl_dataset_rollback_check(void *arg, dm return (SET_ERROR(EINVAL)); } - if (dsl_dataset_long_held(ds)) { + error = dsl_dataset_handoff_check(ds, ddra->ddra_owner, tx); + if (error != 0) { dsl_dataset_rele(ds, FTAG); - return (SET_ERROR(EBUSY)); + return (error); } /* @@ -1819,12 +1856,12 @@ dsl_dataset_rollback_check(void *arg, dm static void dsl_dataset_rollback_sync(void *arg, dmu_tx_t *tx) { - const char *fsname = arg; + dsl_dataset_rollback_arg_t *ddra = arg; dsl_pool_t *dp = dmu_tx_pool(tx); dsl_dataset_t *ds, *clone; uint64_t cloneobj; - VERIFY0(dsl_dataset_hold(dp, fsname, FTAG, &ds)); + VERIFY0(dsl_dataset_hold(dp, ddra->ddra_fsname, FTAG, &ds)); cloneobj = dsl_dataset_create_sync(ds->ds_dir, "%rollback", ds->ds_prev, DS_CREATE_FLAG_NODIRTY, kcred, tx); @@ -1840,11 +1877,26 @@ dsl_dataset_rollback_sync(void *arg, dmu dsl_dataset_rele(ds, FTAG); } +/* + * If owner != NULL: + * + * - The existing dataset MUST be owned by the specified owner at entry + * - Upon return, dataset will still be held by the same owner, whether we + * succeed or not. + * + * This mode is required any time the existing filesystem is mounted. See + * notes above zfs_suspend_fs() for further details. + */ int -dsl_dataset_rollback(const char *fsname) +dsl_dataset_rollback(const char *fsname, void *owner) { + dsl_dataset_rollback_arg_t ddra; + + ddra.ddra_fsname = fsname; + ddra.ddra_owner = owner; + return (dsl_sync_task(fsname, dsl_dataset_rollback_check, - dsl_dataset_rollback_sync, (void *)fsname, 1)); + dsl_dataset_rollback_sync, (void *)&ddra, 1)); } struct promotenode { @@ -2362,7 +2414,7 @@ dsl_dataset_promote(const char *name, ch int dsl_dataset_clone_swap_check_impl(dsl_dataset_t *clone, - dsl_dataset_t *origin_head, boolean_t force) + dsl_dataset_t *origin_head, boolean_t force, void *owner, dmu_tx_t *tx) { int64_t unused_refres_delta; @@ -2391,7 +2443,7 @@ dsl_dataset_clone_swap_check_impl(dsl_da return (SET_ERROR(ETXTBSY)); /* origin_head should have no long holds (e.g. is not mounted) */ - if (dsl_dataset_long_held(origin_head)) + if (dsl_dataset_handoff_check(origin_head, owner, tx)) return (SET_ERROR(EBUSY)); /* check amount of any unconsumed refreservation */ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Fri Oct 25 15:43:59 2013 (r257119) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Fri Oct 25 15:45:29 2013 (r257120) @@ -133,6 +133,7 @@ struct objset { int dmu_objset_hold(const char *name, void *tag, objset_t **osp); int dmu_objset_own(const char *name, dmu_objset_type_t type, boolean_t readonly, void *tag, objset_t **osp); +void dmu_objset_refresh_ownership(objset_t *os, void *tag); void dmu_objset_rele(objset_t *os, void *tag); void dmu_objset_disown(objset_t *os, void *tag); int dmu_objset_from_ds(struct dsl_dataset *ds, objset_t **osp); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h Fri Oct 25 15:43:59 2013 (r257119) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h Fri Oct 25 15:45:29 2013 (r257120) @@ -62,6 +62,7 @@ typedef struct dmu_recv_cookie { struct avl_tree *drc_guid_to_ds_map; zio_cksum_t drc_cksum; uint64_t drc_newsnapobj; + void *drc_owner; } dmu_recv_cookie_t; int dmu_recv_begin(char *tofs, char *tosnap, struct drr_begin *drrb, @@ -72,6 +73,6 @@ int dmu_recv_stream(dmu_recv_cookie_t *d int dmu_recv_stream(dmu_recv_cookie_t *drc, struct file *fp, offset_t *voffp, #endif int cleanup_fd, uint64_t *action_handlep); -int dmu_recv_end(dmu_recv_cookie_t *drc); +int dmu_recv_end(dmu_recv_cookie_t *drc, void *owner); #endif /* _DMU_SEND_H */ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Fri Oct 25 15:43:59 2013 (r257119) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Fri Oct 25 15:45:29 2013 (r257120) @@ -247,7 +247,7 @@ void dsl_dataset_long_rele(dsl_dataset_t boolean_t dsl_dataset_long_held(dsl_dataset_t *ds); int dsl_dataset_clone_swap_check_impl(dsl_dataset_t *clone, - dsl_dataset_t *origin_head, boolean_t force); + dsl_dataset_t *origin_head, boolean_t force, void *owner, dmu_tx_t *tx); void dsl_dataset_clone_swap_sync_impl(dsl_dataset_t *clone, dsl_dataset_t *origin_head, dmu_tx_t *tx); int dsl_dataset_snapshot_check_impl(dsl_dataset_t *ds, const char *snapname, @@ -264,7 +264,7 @@ int dsl_dataset_snap_lookup(dsl_dataset_ int dsl_dataset_snap_remove(dsl_dataset_t *ds, const char *name, dmu_tx_t *tx); void dsl_dataset_set_refreservation_sync_impl(dsl_dataset_t *ds, zprop_source_t source, uint64_t value, dmu_tx_t *tx); -int dsl_dataset_rollback(const char *fsname); +int dsl_dataset_rollback(const char *fsname, void *owner); #ifdef ZFS_DEBUG #define dprintf_ds(ds, fmt, ...) do { \ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Oct 25 15:43:59 2013 (r257119) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Oct 25 15:45:29 2013 (r257120) @@ -3568,13 +3568,13 @@ zfs_ioc_rollback(zfs_cmd_t *zc) if (error == 0) { int resume_err; - error = dsl_dataset_rollback(zc->zc_name); + error = dsl_dataset_rollback(zc->zc_name, zfsvfs); resume_err = zfs_resume_fs(zfsvfs, zc->zc_name); error = error ? error : resume_err; } VFS_RELE(zfsvfs->z_vfs); } else { - error = dsl_dataset_rollback(zc->zc_name); + error = dsl_dataset_rollback(zc->zc_name, NULL); } return (error); } @@ -4110,13 +4110,13 @@ zfs_ioc_recv(zfs_cmd_t *zc) * If the suspend fails, then the recv_end will * likely also fail, and clean up after itself. */ - end_err = dmu_recv_end(&drc); + end_err = dmu_recv_end(&drc, zfsvfs); if (error == 0) error = zfs_resume_fs(zfsvfs, tofs); error = error ? error : end_err; VFS_RELE(zfsvfs->z_vfs); } else { - error = dmu_recv_end(&drc); + error = dmu_recv_end(&drc, NULL); } } @@ -4607,8 +4607,11 @@ zfs_ioc_userspace_upgrade(zfs_cmd_t *zc) * objset_phys_t). Suspend/resume the fs will do that. */ error = zfs_suspend_fs(zfsvfs); - if (error == 0) + if (error == 0) { + dmu_objset_refresh_ownership(zfsvfs->z_os, + zfsvfs); error = zfs_resume_fs(zfsvfs, zc->zc_name); + } } if (error == 0) error = dmu_objset_userspace_upgrade(zfsvfs->z_os); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Oct 25 15:43:59 2013 (r257119) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Oct 25 15:45:29 2013 (r257120) @@ -2204,7 +2204,9 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vno * Block out VOPs and close zfsvfs_t::z_os * * Note, if successful, then we return with the 'z_teardown_lock' and - * 'z_teardown_inactive_lock' write held. + * 'z_teardown_inactive_lock' write held. We leave ownership of the underlying + * dataset and objset intact so that they can be atomically handed off during + * a subsequent rollback or recv operation and the resume thereafter. */ int zfs_suspend_fs(zfsvfs_t *zfsvfs) @@ -2213,71 +2215,76 @@ zfs_suspend_fs(zfsvfs_t *zfsvfs) if ((error = zfsvfs_teardown(zfsvfs, B_FALSE)) != 0) return (error); - dmu_objset_disown(zfsvfs->z_os, zfsvfs); return (0); } /* - * Reopen zfsvfs_t::z_os and release VOPs. + * Rebuild SA and release VOPs. Note that ownership of the underlying dataset + * is an invariant across any of the operations that can be performed while the + * filesystem was suspended. Whether it succeeded or failed, the preconditions + * are the same: the relevant objset and associated dataset are owned by + * zfsvfs, held, and long held on entry. */ int zfs_resume_fs(zfsvfs_t *zfsvfs, const char *osname) { int err; + znode_t *zp; + uint64_t sa_obj = 0; ASSERT(RRW_WRITE_HELD(&zfsvfs->z_teardown_lock)); ASSERT(RW_WRITE_HELD(&zfsvfs->z_teardown_inactive_lock)); - err = dmu_objset_own(osname, DMU_OST_ZFS, B_FALSE, zfsvfs, - &zfsvfs->z_os); - if (err) { - zfsvfs->z_os = NULL; - } else { - znode_t *zp; - uint64_t sa_obj = 0; + /* + * We already own this, so just hold and rele it to update the + * objset_t, as the one we had before may have been evicted. + */ + VERIFY0(dmu_objset_hold(osname, zfsvfs, &zfsvfs->z_os)); + VERIFY3P(zfsvfs->z_os->os_dsl_dataset->ds_owner, ==, zfsvfs); + VERIFY(dsl_dataset_long_held(zfsvfs->z_os->os_dsl_dataset)); + dmu_objset_rele(zfsvfs->z_os, zfsvfs); - /* - * Make sure version hasn't changed - */ + /* + * Make sure version hasn't changed + */ - err = zfs_get_zplprop(zfsvfs->z_os, ZFS_PROP_VERSION, - &zfsvfs->z_version); + err = zfs_get_zplprop(zfsvfs->z_os, ZFS_PROP_VERSION, + &zfsvfs->z_version); - if (err) - goto bail; + if (err) + goto bail; - err = zap_lookup(zfsvfs->z_os, MASTER_NODE_OBJ, - ZFS_SA_ATTRS, 8, 1, &sa_obj); + err = zap_lookup(zfsvfs->z_os, MASTER_NODE_OBJ, + ZFS_SA_ATTRS, 8, 1, &sa_obj); - if (err && zfsvfs->z_version >= ZPL_VERSION_SA) - goto bail; + if (err && zfsvfs->z_version >= ZPL_VERSION_SA) + goto bail; - if ((err = sa_setup(zfsvfs->z_os, sa_obj, - zfs_attr_table, ZPL_END, &zfsvfs->z_attr_table)) != 0) - goto bail; + if ((err = sa_setup(zfsvfs->z_os, sa_obj, + zfs_attr_table, ZPL_END, &zfsvfs->z_attr_table)) != 0) + goto bail; - if (zfsvfs->z_version >= ZPL_VERSION_SA) - sa_register_update_callback(zfsvfs->z_os, - zfs_sa_upgrade); + if (zfsvfs->z_version >= ZPL_VERSION_SA) + sa_register_update_callback(zfsvfs->z_os, + zfs_sa_upgrade); - VERIFY(zfsvfs_setup(zfsvfs, B_FALSE) == 0); + VERIFY(zfsvfs_setup(zfsvfs, B_FALSE) == 0); - zfs_set_fuid_feature(zfsvfs); + zfs_set_fuid_feature(zfsvfs); - /* - * Attempt to re-establish all the active znodes with - * their dbufs. If a zfs_rezget() fails, then we'll let - * any potential callers discover that via ZFS_ENTER_VERIFY_VP - * when they try to use their znode. - */ - mutex_enter(&zfsvfs->z_znodes_lock); - for (zp = list_head(&zfsvfs->z_all_znodes); zp; - zp = list_next(&zfsvfs->z_all_znodes, zp)) { - (void) zfs_rezget(zp); - } - mutex_exit(&zfsvfs->z_znodes_lock); + /* + * Attempt to re-establish all the active znodes with + * their dbufs. If a zfs_rezget() fails, then we'll let + * any potential callers discover that via ZFS_ENTER_VERIFY_VP + * when they try to use their znode. + */ + mutex_enter(&zfsvfs->z_znodes_lock); + for (zp = list_head(&zfsvfs->z_all_znodes); zp; + zp = list_next(&zfsvfs->z_all_znodes, zp)) { + (void) zfs_rezget(zp); } + mutex_exit(&zfsvfs->z_znodes_lock); bail: /* release the VOPs */ @@ -2286,8 +2293,8 @@ bail: if (err) { /* - * Since we couldn't reopen zfsvfs::z_os, or - * setup the sa framework force unmount this file system. + * Since we couldn't setup the sa framework, try to force + * unmount this file system. */ if (vn_vfswlock(zfsvfs->z_vfs->vfs_vnodecovered) == 0) (void) dounmount(zfsvfs->z_vfs, MS_FORCE, curthread); From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 16:31:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 48508ABD; Fri, 25 Oct 2013 16:31:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 350B32233; Fri, 25 Oct 2013 16:31:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PGVTUV036473; Fri, 25 Oct 2013 16:31:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PGVTdf036472; Fri, 25 Oct 2013 16:31:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310251631.r9PGVTdf036472@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 25 Oct 2013 16:31:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257121 - stable/10/sys/fs/devfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 16:31:29 -0000 Author: kib Date: Fri Oct 25 16:31:28 2013 New Revision: 257121 URL: http://svnweb.freebsd.org/changeset/base/257121 Log: MFC r256501: Remove two instances of ARGSUSED comment, and wrap lines nearby the code that is to be changed. Approved by: re (glebius) Modified: stable/10/sys/fs/devfs/devfs_vnops.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/10/sys/fs/devfs/devfs_vnops.c Fri Oct 25 15:45:29 2013 (r257120) +++ stable/10/sys/fs/devfs/devfs_vnops.c Fri Oct 25 16:31:28 2013 (r257121) @@ -1168,9 +1168,9 @@ devfs_print(struct vop_print_args *ap) return (0); } -/* ARGSUSED */ static int -devfs_read_f(struct file *fp, struct uio *uio, struct ucred *cred, int flags, struct thread *td) +devfs_read_f(struct file *fp, struct uio *uio, struct ucred *cred, + int flags, struct thread *td) { struct cdev *dev; int ioflag, error, ref; @@ -1643,9 +1643,9 @@ devfs_truncate_f(struct file *fp, off_t return (vnops.fo_truncate(fp, length, cred, td)); } -/* ARGSUSED */ static int -devfs_write_f(struct file *fp, struct uio *uio, struct ucred *cred, int flags, struct thread *td) +devfs_write_f(struct file *fp, struct uio *uio, struct ucred *cred, + int flags, struct thread *td) { struct cdev *dev; int error, ioflag, ref; From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 16:33:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3B40EC09; Fri, 25 Oct 2013 16:33:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0E72F2243; Fri, 25 Oct 2013 16:33:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PGXOnT036775; Fri, 25 Oct 2013 16:33:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PGXOdK036772; Fri, 25 Oct 2013 16:33:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310251633.r9PGXOdK036772@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 25 Oct 2013 16:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257122 - in stable/10/sys: fs/devfs kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 16:33:25 -0000 Author: kib Date: Fri Oct 25 16:33:24 2013 New Revision: 257122 URL: http://svnweb.freebsd.org/changeset/base/257122 Log: MFC r256502: Similar to debug.iosize_max_clamp sysctl, introduce devfs_iosize_max_clamp sysctl, which allows/disables SSIZE_MAX-sized i/o requests on the devfs files. Approved by: re (glebius) Modified: stable/10/sys/fs/devfs/devfs_vnops.c stable/10/sys/kern/sys_generic.c stable/10/sys/sys/systm.h Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/10/sys/fs/devfs/devfs_vnops.c Fri Oct 25 16:31:28 2013 (r257121) +++ stable/10/sys/fs/devfs/devfs_vnops.c Fri Oct 25 16:33:24 2013 (r257122) @@ -1178,6 +1178,8 @@ devfs_read_f(struct file *fp, struct uio struct cdevsw *dsw; struct file *fpop; + if (uio->uio_resid > DEVFS_IOSIZE_MAX) + return (EINVAL); fpop = td->td_fpop; error = devfs_fp_check(fp, &dev, &dsw, &ref); if (error) @@ -1653,6 +1655,8 @@ devfs_write_f(struct file *fp, struct ui struct cdevsw *dsw; struct file *fpop; + if (uio->uio_resid > DEVFS_IOSIZE_MAX) + return (EINVAL); fpop = td->td_fpop; error = devfs_fp_check(fp, &dev, &dsw, &ref); if (error) Modified: stable/10/sys/kern/sys_generic.c ============================================================================== --- stable/10/sys/kern/sys_generic.c Fri Oct 25 16:31:28 2013 (r257121) +++ stable/10/sys/kern/sys_generic.c Fri Oct 25 16:33:24 2013 (r257122) @@ -78,6 +78,10 @@ __FBSDID("$FreeBSD$"); int iosize_max_clamp = 1; SYSCTL_INT(_debug, OID_AUTO, iosize_max_clamp, CTLFLAG_RW, &iosize_max_clamp, 0, "Clamp max i/o size to INT_MAX"); +int devfs_iosize_max_clamp = 1; +SYSCTL_INT(_debug, OID_AUTO, devfs_iosize_max_clamp, CTLFLAG_RW, + &devfs_iosize_max_clamp, 0, "Clamp max i/o size to INT_MAX for devices"); + /* * Assert that the return value of read(2) and write(2) syscalls fits * into a register. If not, an architecture will need to provide the Modified: stable/10/sys/sys/systm.h ============================================================================== --- stable/10/sys/sys/systm.h Fri Oct 25 16:31:28 2013 (r257121) +++ stable/10/sys/sys/systm.h Fri Oct 25 16:33:24 2013 (r257122) @@ -146,7 +146,9 @@ extern const void *zero_region; /* addre extern int unmapped_buf_allowed; extern int iosize_max_clamp; +extern int devfs_iosize_max_clamp; #define IOSIZE_MAX (iosize_max_clamp ? INT_MAX : SSIZE_MAX) +#define DEVFS_IOSIZE_MAX (devfs_iosize_max_clamp ? INT_MAX : SSIZE_MAX) /* * General function declarations. From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 16:36:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9EB30E32; Fri, 25 Oct 2013 16:36:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 71AED2259; Fri, 25 Oct 2013 16:36:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PGaHHW037213; Fri, 25 Oct 2013 16:36:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PGaHT6037211; Fri, 25 Oct 2013 16:36:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310251636.r9PGaHT6037211@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 25 Oct 2013 16:36:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257123 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 16:36:17 -0000 Author: kib Date: Fri Oct 25 16:36:16 2013 New Revision: 257123 URL: http://svnweb.freebsd.org/changeset/base/257123 Log: MFC r256504: Add a sysctl kern.disallow_high_osrel which disables executing the images compiled on the world with higher major version number than the high version number of the booted kernel. Default to disable. Approved by: re (glebius) Modified: stable/10/sys/kern/kern_exec.c stable/10/sys/sys/param.h Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/kern/kern_exec.c ============================================================================== --- stable/10/sys/kern/kern_exec.c Fri Oct 25 16:33:24 2013 (r257122) +++ stable/10/sys/kern/kern_exec.c Fri Oct 25 16:36:16 2013 (r257123) @@ -123,6 +123,11 @@ u_long ps_arg_cache_limit = PAGE_SIZE / SYSCTL_ULONG(_kern, OID_AUTO, ps_arg_cache_limit, CTLFLAG_RW, &ps_arg_cache_limit, 0, ""); +static int disallow_high_osrel; +SYSCTL_INT(_kern, OID_AUTO, disallow_high_osrel, CTLFLAG_RW, + &disallow_high_osrel, 0, + "Disallow execution of binaries built for higher version of the world"); + static int map_at_zero = 0; TUNABLE_INT("security.bsd.map_at_zero", &map_at_zero); SYSCTL_INT(_security_bsd, OID_AUTO, map_at_zero, CTLFLAG_RW, &map_at_zero, 0, @@ -552,6 +557,15 @@ interpret: vn_fullpath(td, imgp->vp, &imgp->execpath, &imgp->freepath) != 0)) imgp->execpath = args->fname; + if (disallow_high_osrel && + P_OSREL_MAJOR(p->p_osrel) > P_OSREL_MAJOR(__FreeBSD_version)) { + error = ENOEXEC; + uprintf("Osrel %d for image %s too high\n", p->p_osrel, + imgp->execpath != NULL ? imgp->execpath : ""); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); + goto exec_fail_dealloc; + } + /* * Copy out strings (args and env) and initialize stack base */ Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Fri Oct 25 16:33:24 2013 (r257122) +++ stable/10/sys/sys/param.h Fri Oct 25 16:36:16 2013 (r257123) @@ -80,6 +80,8 @@ #define P_OSREL_SIGWAIT 700000 #define P_OSREL_SIGSEGV 700004 #define P_OSREL_MAP_ANON 800104 + +#define P_OSREL_MAJOR(x) ((x) / 100000) #endif #ifndef LOCORE From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 16:49:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4CBDF4C8; Fri, 25 Oct 2013 16:49:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3A382230B; Fri, 25 Oct 2013 16:49:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PGnXYL041247; Fri, 25 Oct 2013 16:49:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PGnX7B041246; Fri, 25 Oct 2013 16:49:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310251649.r9PGnX7B041246@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 25 Oct 2013 16:49:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r257124 - stable/9/sys/fs/devfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 16:49:33 -0000 Author: kib Date: Fri Oct 25 16:49:32 2013 New Revision: 257124 URL: http://svnweb.freebsd.org/changeset/base/257124 Log: MFC r256501: Remove two instances of ARGSUSED comment, and wrap lines nearby the code that is to be changed. Modified: stable/9/sys/fs/devfs/devfs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/9/sys/fs/devfs/devfs_vnops.c Fri Oct 25 16:36:16 2013 (r257123) +++ stable/9/sys/fs/devfs/devfs_vnops.c Fri Oct 25 16:49:32 2013 (r257124) @@ -1168,9 +1168,9 @@ devfs_print(struct vop_print_args *ap) return (0); } -/* ARGSUSED */ static int -devfs_read_f(struct file *fp, struct uio *uio, struct ucred *cred, int flags, struct thread *td) +devfs_read_f(struct file *fp, struct uio *uio, struct ucred *cred, + int flags, struct thread *td) { struct cdev *dev; int ioflag, error, ref; @@ -1643,9 +1643,9 @@ devfs_truncate_f(struct file *fp, off_t return (vnops.fo_truncate(fp, length, cred, td)); } -/* ARGSUSED */ static int -devfs_write_f(struct file *fp, struct uio *uio, struct ucred *cred, int flags, struct thread *td) +devfs_write_f(struct file *fp, struct uio *uio, struct ucred *cred, + int flags, struct thread *td) { struct cdev *dev; int error, ioflag, ref; From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 17:04:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 79273AA3; Fri, 25 Oct 2013 17:04:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4C59723DE; Fri, 25 Oct 2013 17:04:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PH4kXO047666; Fri, 25 Oct 2013 17:04:46 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PH4kuN047662; Fri, 25 Oct 2013 17:04:46 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310251704.r9PH4kuN047662@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 25 Oct 2013 17:04:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r257125 - in stable/9/sys: fs/devfs kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 17:04:47 -0000 Author: kib Date: Fri Oct 25 17:04:46 2013 New Revision: 257125 URL: http://svnweb.freebsd.org/changeset/base/257125 Log: MFC r256502: Similar to debug.iosize_max_clamp sysctl, introduce devfs_iosize_max_clamp sysctl, which allows/disables SSIZE_MAX-sized i/o requests on the devfs files. Modified: stable/9/sys/fs/devfs/devfs_vnops.c stable/9/sys/kern/sys_generic.c stable/9/sys/sys/systm.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/9/sys/fs/devfs/devfs_vnops.c Fri Oct 25 16:49:32 2013 (r257124) +++ stable/9/sys/fs/devfs/devfs_vnops.c Fri Oct 25 17:04:46 2013 (r257125) @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -1178,6 +1179,8 @@ devfs_read_f(struct file *fp, struct uio struct cdevsw *dsw; struct file *fpop; + if (uio->uio_resid > DEVFS_IOSIZE_MAX) + return (EINVAL); fpop = td->td_fpop; error = devfs_fp_check(fp, &dev, &dsw, &ref); if (error) @@ -1653,6 +1656,8 @@ devfs_write_f(struct file *fp, struct ui struct cdevsw *dsw; struct file *fpop; + if (uio->uio_resid > DEVFS_IOSIZE_MAX) + return (EINVAL); fpop = td->td_fpop; error = devfs_fp_check(fp, &dev, &dsw, &ref); if (error) Modified: stable/9/sys/kern/sys_generic.c ============================================================================== --- stable/9/sys/kern/sys_generic.c Fri Oct 25 16:49:32 2013 (r257124) +++ stable/9/sys/kern/sys_generic.c Fri Oct 25 17:04:46 2013 (r257125) @@ -77,6 +77,10 @@ __FBSDID("$FreeBSD$"); int iosize_max_clamp = 1; SYSCTL_INT(_debug, OID_AUTO, iosize_max_clamp, CTLFLAG_RW, &iosize_max_clamp, 0, "Clamp max i/o size to INT_MAX"); +int devfs_iosize_max_clamp = 1; +SYSCTL_INT(_debug, OID_AUTO, devfs_iosize_max_clamp, CTLFLAG_RW, + &devfs_iosize_max_clamp, 0, "Clamp max i/o size to INT_MAX for devices"); + /* * Assert that the return value of read(2) and write(2) syscalls fits * into a register. If not, an architecture will need to provide the Modified: stable/9/sys/sys/systm.h ============================================================================== --- stable/9/sys/sys/systm.h Fri Oct 25 16:49:32 2013 (r257124) +++ stable/9/sys/sys/systm.h Fri Oct 25 17:04:46 2013 (r257125) @@ -138,7 +138,9 @@ extern const void *zero_region; /* addre extern int unmapped_buf_allowed; extern int iosize_max_clamp; +extern int devfs_iosize_max_clamp; #define IOSIZE_MAX (iosize_max_clamp ? INT_MAX : SSIZE_MAX) +#define DEVFS_IOSIZE_MAX (devfs_iosize_max_clamp ? INT_MAX : SSIZE_MAX) /* * General function declarations. From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 17:15:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0AF3C16C; Fri, 25 Oct 2013 17:15:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D122C248F; Fri, 25 Oct 2013 17:15:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PHFvWS054228; Fri, 25 Oct 2013 17:15:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PHFvfG054225; Fri, 25 Oct 2013 17:15:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310251715.r9PHFvfG054225@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 25 Oct 2013 17:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r257126 - in stable/9/sys: kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 17:15:58 -0000 Author: kib Date: Fri Oct 25 17:15:57 2013 New Revision: 257126 URL: http://svnweb.freebsd.org/changeset/base/257126 Log: MFC r256504: Add a sysctl kern.disallow_high_osrel which disables executing the images compiled on the world with higher major version number than the high version number of the booted kernel. Default to disable. Modified: stable/9/sys/kern/kern_exec.c stable/9/sys/sys/param.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/kern/kern_exec.c ============================================================================== --- stable/9/sys/kern/kern_exec.c Fri Oct 25 17:04:46 2013 (r257125) +++ stable/9/sys/kern/kern_exec.c Fri Oct 25 17:15:57 2013 (r257126) @@ -122,6 +122,11 @@ u_long ps_arg_cache_limit = PAGE_SIZE / SYSCTL_ULONG(_kern, OID_AUTO, ps_arg_cache_limit, CTLFLAG_RW, &ps_arg_cache_limit, 0, ""); +static int disallow_high_osrel; +SYSCTL_INT(_kern, OID_AUTO, disallow_high_osrel, CTLFLAG_RW, + &disallow_high_osrel, 0, + "Disallow execution of binaries built for higher version of the world"); + static int map_at_zero = 0; TUNABLE_INT("security.bsd.map_at_zero", &map_at_zero); SYSCTL_INT(_security_bsd, OID_AUTO, map_at_zero, CTLFLAG_RW, &map_at_zero, 0, @@ -558,6 +563,15 @@ interpret: vn_fullpath(td, imgp->vp, &imgp->execpath, &imgp->freepath) != 0)) imgp->execpath = args->fname; + if (disallow_high_osrel && + P_OSREL_MAJOR(p->p_osrel) > P_OSREL_MAJOR(__FreeBSD_version)) { + error = ENOEXEC; + uprintf("Osrel %d for image %s too high\n", p->p_osrel, + imgp->execpath != NULL ? imgp->execpath : ""); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); + goto exec_fail_dealloc; + } + /* * Copy out strings (args and env) and initialize stack base */ Modified: stable/9/sys/sys/param.h ============================================================================== --- stable/9/sys/sys/param.h Fri Oct 25 17:04:46 2013 (r257125) +++ stable/9/sys/sys/param.h Fri Oct 25 17:15:57 2013 (r257126) @@ -80,6 +80,8 @@ #define P_OSREL_SIGWAIT 700000 #define P_OSREL_SIGSEGV 700004 #define P_OSREL_MAP_ANON 800104 + +#define P_OSREL_MAJOR(x) ((x) / 100000) #endif #ifndef LOCORE From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 18:38:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7E233C24; Fri, 25 Oct 2013 18:38:46 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 69C532953; Fri, 25 Oct 2013 18:38:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PIck90081163; Fri, 25 Oct 2013 18:38:46 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PIciJ7081155; Fri, 25 Oct 2013 18:38:44 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201310251838.r9PIciJ7081155@svn.freebsd.org> From: Luiz Otavio O Souza Date: Fri, 25 Oct 2013 18:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257127 - in head/sys: arm/broadcom/bcm2835 arm/lpc boot/uboot/lib dev/cesa dev/fdt powerpc/mpc85xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 18:38:46 -0000 Author: loos Date: Fri Oct 25 18:38:44 2013 New Revision: 257127 URL: http://svnweb.freebsd.org/changeset/base/257127 Log: Remove all the instances of '#undef DEBUG' from kernel. Suggested by: rpaulo Approved by: adrian (mentor) Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c head/sys/arm/lpc/if_lpe.c head/sys/arm/lpc/lpc_mmc.c head/sys/boot/uboot/lib/disk.c head/sys/boot/uboot/lib/glue.c head/sys/dev/cesa/cesa.c head/sys/dev/fdt/fdt_slicer.c head/sys/powerpc/mpc85xx/fsl_sdhc.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Fri Oct 25 17:15:57 2013 (r257126) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Fri Oct 25 18:38:44 2013 (r257127) @@ -56,8 +56,6 @@ __FBSDID("$FreeBSD$"); #include "gpio_if.h" -#undef DEBUG - #ifdef DEBUG #define dprintf(fmt, args...) do { printf("%s(): ", __func__); \ printf(fmt,##args); } while (0) Modified: head/sys/arm/lpc/if_lpe.c ============================================================================== --- head/sys/arm/lpc/if_lpe.c Fri Oct 25 17:15:57 2013 (r257126) +++ head/sys/arm/lpc/if_lpe.c Fri Oct 25 18:38:44 2013 (r257127) @@ -64,9 +64,6 @@ __FBSDID("$FreeBSD$"); #include "miibus_if.h" -#define DEBUG -#undef DEBUG - #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); \ printf(fmt,##args); } while (0) Modified: head/sys/arm/lpc/lpc_mmc.c ============================================================================== --- head/sys/arm/lpc/lpc_mmc.c Fri Oct 25 17:15:57 2013 (r257126) +++ head/sys/arm/lpc/lpc_mmc.c Fri Oct 25 18:38:44 2013 (r257127) @@ -65,9 +65,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define DEBUG -#undef DEBUG - #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); \ printf(fmt,##args); } while (0) Modified: head/sys/boot/uboot/lib/disk.c ============================================================================== --- head/sys/boot/uboot/lib/disk.c Fri Oct 25 17:15:57 2013 (r257126) +++ head/sys/boot/uboot/lib/disk.c Fri Oct 25 18:38:44 2013 (r257127) @@ -45,9 +45,6 @@ __FBSDID("$FreeBSD$"); #include "glue.h" #include "libuboot.h" -#define DEBUG -#undef DEBUG - #define stor_printf(fmt, args...) do { \ printf("%s%d: ", dev->d_dev->dv_name, dev->d_unit); \ printf(fmt, ##args); \ Modified: head/sys/boot/uboot/lib/glue.c ============================================================================== --- head/sys/boot/uboot/lib/glue.c Fri Oct 25 17:15:57 2013 (r257126) +++ head/sys/boot/uboot/lib/glue.c Fri Oct 25 18:38:44 2013 (r257127) @@ -34,9 +34,6 @@ __FBSDID("$FreeBSD$"); #include "api_public.h" #include "glue.h" -#define DEBUG -#undef DEBUG - #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); printf(fmt,##args); } while (0) #else Modified: head/sys/dev/cesa/cesa.c ============================================================================== --- head/sys/dev/cesa/cesa.c Fri Oct 25 17:15:57 2013 (r257126) +++ head/sys/dev/cesa/cesa.c Fri Oct 25 18:38:44 2013 (r257127) @@ -71,8 +71,6 @@ __FBSDID("$FreeBSD$"); #include #include "cesa.h" -#undef DEBUG - static int cesa_probe(device_t); static int cesa_attach(device_t); static int cesa_detach(device_t); Modified: head/sys/dev/fdt/fdt_slicer.c ============================================================================== --- head/sys/dev/fdt/fdt_slicer.c Fri Oct 25 17:15:57 2013 (r257126) +++ head/sys/dev/fdt/fdt_slicer.c Fri Oct 25 18:38:44 2013 (r257127) @@ -35,9 +35,6 @@ __FBSDID("$FreeBSD$"); #include -#define DEBUG -#undef DEBUG - #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); \ printf(fmt,##args); } while (0) Modified: head/sys/powerpc/mpc85xx/fsl_sdhc.c ============================================================================== --- head/sys/powerpc/mpc85xx/fsl_sdhc.c Fri Oct 25 17:15:57 2013 (r257126) +++ head/sys/powerpc/mpc85xx/fsl_sdhc.c Fri Oct 25 18:38:44 2013 (r257127) @@ -64,8 +64,6 @@ __FBSDID("$FreeBSD$"); #include "fsl_sdhc.h" -#define DEBUG -#undef DEBUG #ifdef DEBUG #define DPRINTF(fmt, arg...) printf("DEBUG %s(): " fmt, __FUNCTION__, ##arg) #else From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 18:39:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DE68DD59; Fri, 25 Oct 2013 18:39:01 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BC4552957; Fri, 25 Oct 2013 18:39:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PId1vX081252; Fri, 25 Oct 2013 18:39:01 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PId10v081250; Fri, 25 Oct 2013 18:39:01 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310251839.r9PId10v081250@svn.freebsd.org> From: Peter Grehan Date: Fri, 25 Oct 2013 18:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257128 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 18:39:02 -0000 Author: grehan Date: Fri Oct 25 18:39:01 2013 New Revision: 257128 URL: http://svnweb.freebsd.org/changeset/base/257128 Log: MFC r256926, r257005 r256926 Fix AHCI ATAPI emulation when backed with /dev/cd0 - remove assumption that the backing file/device had 512-byte sectors - fix incorrect iovec size variable that would result in a buffer overrun when an o/s issued an i/o request with more s/g elements than the blockif api r257005 Export the block size capability to guests. - Use #defines for capability bits - Export the VTBLK_F_BLK_SIZE capability - Fix bug in calculating capacity: it is in 512-byte units, not the underlying sector size This allows virtio-blk to have backing devices with non 512-byte sector sizes e.g. /dev/cd0, and 4K-block harddrives. Approved by: re (glebius) Modified: stable/10/usr.sbin/bhyve/pci_ahci.c stable/10/usr.sbin/bhyve/pci_virtio_block.c Directory Properties: stable/10/usr.sbin/bhyve/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Fri Oct 25 18:38:44 2013 (r257127) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Fri Oct 25 18:39:01 2013 (r257128) @@ -663,8 +663,7 @@ atapi_read_capacity(struct ahci_port *p, uint8_t buf[8]; uint64_t sectors; - sectors = blockif_size(p->bctx) / blockif_sectsz(p->bctx); - sectors >>= 2; + sectors = blockif_size(p->bctx) / 2048; be32enc(buf, sectors - 1); be32enc(buf + 4, 2048); cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; @@ -908,9 +907,9 @@ atapi_read(struct ahci_port *p, int slot /* * Build up the iovec based on the prdt */ - for (i = 0; i < hdr->prdtl; i++) { + for (i = 0; i < iovcnt; i++) { breq->br_iov[i].iov_base = paddr_guest2host(ahci_ctx(sc), - prdt->dba, prdt->dbc + 1); + prdt->dba, prdt->dbc + 1); breq->br_iov[i].iov_len = prdt->dbc + 1; aior->done += (prdt->dbc + 1); prdt++; Modified: stable/10/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_block.c Fri Oct 25 18:38:44 2013 (r257127) +++ stable/10/usr.sbin/bhyve/pci_virtio_block.c Fri Oct 25 18:39:01 2013 (r257128) @@ -66,11 +66,16 @@ __FBSDID("$FreeBSD$"); #define VTBLK_BLK_ID_BYTES 20 +/* Capability bits */ +#define VTBLK_F_SEG_MAX (1 << 2) /* Maximum request segments */ +#define VTBLK_F_BLK_SIZE (1 << 6) /* cfg block size valid */ + /* * Host capabilities */ #define VTBLK_S_HOSTCAPS \ - ( 0x00000004 | /* host maximum request segments */ \ + ( VTBLK_F_SEG_MAX | \ + VTBLK_F_BLK_SIZE | \ VIRTIO_RING_F_INDIRECT_DESC ) /* indirect descriptors */ /* @@ -315,7 +320,7 @@ pci_vtblk_init(struct vmctx *ctx, struct digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); /* setup virtio block config space */ - sc->vbsc_cfg.vbc_capacity = size / sectsz; + sc->vbsc_cfg.vbc_capacity = size / DEV_BSIZE; /* 512-byte units */ sc->vbsc_cfg.vbc_seg_max = VTBLK_MAXSEGS; sc->vbsc_cfg.vbc_blk_size = sectsz; sc->vbsc_cfg.vbc_size_max = 0; /* not negotiated */ From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 18:43:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A3EF8126; Fri, 25 Oct 2013 18:43:54 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7554D29D2; Fri, 25 Oct 2013 18:43:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PIhsLY083933; Fri, 25 Oct 2013 18:43:54 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PIhsGh083931; Fri, 25 Oct 2013 18:43:54 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201310251843.r9PIhsGh083931@svn.freebsd.org> From: Colin Percival Date: Fri, 25 Oct 2013 18:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257129 - head/contrib/subversion/subversion/libsvn_subr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 18:43:54 -0000 Author: cperciva Date: Fri Oct 25 18:43:53 2013 New Revision: 257129 URL: http://svnweb.freebsd.org/changeset/base/257129 Log: Remove time and date stamps from svn* binaries, in order to make the builds reproducible. Reviewed by: peter MFC after: 3 days Modified: head/contrib/subversion/subversion/libsvn_subr/opt.c head/contrib/subversion/subversion/libsvn_subr/version.c Modified: head/contrib/subversion/subversion/libsvn_subr/opt.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_subr/opt.c Fri Oct 25 18:39:01 2013 (r257128) +++ head/contrib/subversion/subversion/libsvn_subr/opt.c Fri Oct 25 18:43:53 2013 (r257129) @@ -1115,10 +1115,8 @@ svn_opt__print_version_info(const char * return svn_cmdline_printf(pool, "%s\n", SVN_VER_NUMBER); SVN_ERR(svn_cmdline_printf(pool, _("%s, version %s\n" - " compiled %s, %s on %s\n\n"), + " compiled on %s\n\n"), pgm_name, SVN_VERSION, - svn_version_ext_build_date(info), - svn_version_ext_build_time(info), svn_version_ext_build_host(info))); SVN_ERR(svn_cmdline_printf(pool, "%s\n", svn_version_ext_copyright(info))); Modified: head/contrib/subversion/subversion/libsvn_subr/version.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_subr/version.c Fri Oct 25 18:39:01 2013 (r257128) +++ head/contrib/subversion/subversion/libsvn_subr/version.c Fri Oct 25 18:43:53 2013 (r257129) @@ -125,8 +125,8 @@ svn_version_extended(svn_boolean_t verbo { svn_version_extended_t *info = apr_pcalloc(pool, sizeof(*info)); - info->build_date = __DATE__; - info->build_time = __TIME__; + info->build_date = NULL; + info->build_time = NULL; info->build_host = SVN_BUILD_HOST; info->copyright = apr_pstrdup (pool, _("Copyright (C) 2013 The Apache Software Foundation.\n" From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 19:15:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 53469A65; Fri, 25 Oct 2013 19:15:22 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 25A372BAC; Fri, 25 Oct 2013 19:15:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PJFMut094488; Fri, 25 Oct 2013 19:15:22 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PJFLxd094486; Fri, 25 Oct 2013 19:15:21 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310251915.r9PJFLxd094486@svn.freebsd.org> From: Ian Lepore Date: Fri, 25 Oct 2013 19:15:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257130 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 19:15:22 -0000 Author: ian Date: Fri Oct 25 19:15:21 2013 New Revision: 257130 URL: http://svnweb.freebsd.org/changeset/base/257130 Log: Add a helper routine to search for a compat string in a table that associates compat strings with arbitrary values that mean something to the driver. This is handy for drivers that support several variations of similar hardware and need to know which one matched. Reviewed by: imp, jmg, nwhitehorn Modified: head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/ofw_bus_subr.h Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Fri Oct 25 18:43:53 2013 (r257129) +++ head/sys/dev/ofw/ofw_bus_subr.c Fri Oct 25 19:15:21 2013 (r257130) @@ -197,6 +197,21 @@ ofw_bus_is_compatible_strict(device_t de return (0); } +const struct ofw_compat_data * +ofw_bus_search_compatible(device_t dev, const struct ofw_compat_data *compat) +{ + + if (compat == NULL) + return NULL; + + for (; compat->ocd_str != NULL; ++compat) { + if (ofw_bus_is_compatible(dev, compat->ocd_str)) + break; + } + + return (compat); +} + int ofw_bus_has_prop(device_t dev, const char *propname) { Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Fri Oct 25 18:43:53 2013 (r257129) +++ head/sys/dev/ofw/ofw_bus_subr.h Fri Oct 25 19:15:21 2013 (r257130) @@ -47,6 +47,11 @@ struct ofw_bus_iinfo { pcell_t opi_addrc; }; +struct ofw_compat_data { + const char *ocd_str; + uintptr_t ocd_data; +}; + /* Generic implementation of ofw_bus_if.m methods and helper routines */ int ofw_bus_gen_setup_devinfo(struct ofw_bus_devinfo *, phandle_t); void ofw_bus_gen_destroy_devinfo(struct ofw_bus_devinfo *); @@ -74,6 +79,16 @@ void ofw_bus_find_iparent(phandle_t); int ofw_bus_is_compatible(device_t, const char *); int ofw_bus_is_compatible_strict(device_t, const char *); +/* + * Helper routine to search a list of compat properties. The table is + * terminated by an entry with a NULL compat-string pointer; a pointer to that + * table entry is returned if none of the compat strings match for the device, + * giving you control over the not-found value. Will not return NULL unless the + * provided table pointer is NULL. + */ +const struct ofw_compat_data * + ofw_bus_search_compatible(device_t, const struct ofw_compat_data *); + /* Helper routine for checking existence of a prop */ int ofw_bus_has_prop(device_t, const char *); From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 19:19:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2C0B5BF0; Fri, 25 Oct 2013 19:19:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1888B2BD1; Fri, 25 Oct 2013 19:19:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PJJCuX094913; Fri, 25 Oct 2013 19:19:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PJJCwD094911; Fri, 25 Oct 2013 19:19:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201310251919.r9PJJCwD094911@svn.freebsd.org> From: John Baldwin Date: Fri, 25 Oct 2013 19:19:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257131 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 19:19:13 -0000 Author: jhb Date: Fri Oct 25 19:19:12 2013 New Revision: 257131 URL: http://svnweb.freebsd.org/changeset/base/257131 Log: Reject attempts to attack a disk device that has the old NEEDSGIANT flag set. Reviewed by: mav Modified: head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Fri Oct 25 19:15:21 2013 (r257130) +++ head/sys/geom/geom_disk.c Fri Oct 25 19:19:12 2013 (r257131) @@ -657,6 +657,13 @@ disk_create(struct disk *dp, int version dp->d_name, dp->d_unit); return; } + if (dp->d_flags & DISKFLAG_RESERVED) { + printf("WARNING: Attempt to add non-MPSAFE disk %s%d\n", + dp->d_name, dp->d_unit); + printf("WARNING: Ignoring disk %s%d\n", + dp->d_name, dp->d_unit); + return; + } KASSERT(dp->d_strategy != NULL, ("disk_create need d_strategy")); KASSERT(dp->d_name != NULL, ("disk_create need d_name")); KASSERT(*dp->d_name != 0, ("disk_create need d_name")); Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Fri Oct 25 19:15:21 2013 (r257130) +++ head/sys/geom/geom_disk.h Fri Oct 25 19:19:12 2013 (r257131) @@ -103,6 +103,7 @@ struct disk { void *d_drv1; }; +#define DISKFLAG_RESERVED 0x1 /* Was NEEDSGIANT */ #define DISKFLAG_OPEN 0x2 #define DISKFLAG_CANDELETE 0x4 #define DISKFLAG_CANFLUSHCACHE 0x8 From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 19:23:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 428C6EE6; Fri, 25 Oct 2013 19:23:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 19EA42C0E; Fri, 25 Oct 2013 19:23:07 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 312ACB93B; Fri, 25 Oct 2013 15:23:05 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r257131 - head/sys/geom Date: Fri, 25 Oct 2013 15:23:03 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201310251919.r9PJJCwD094911@svn.freebsd.org> In-Reply-To: <201310251919.r9PJJCwD094911@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201310251523.04052.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 25 Oct 2013 15:23:05 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 19:23:07 -0000 On Friday, October 25, 2013 3:19:12 pm John Baldwin wrote: > Author: jhb > Date: Fri Oct 25 19:19:12 2013 > New Revision: 257131 > URL: http://svnweb.freebsd.org/changeset/base/257131 > > Log: > Reject attempts to attack a disk device that has the old NEEDSGIANT > flag set. Actually, attacking a Giant disk device is just fine (and encouraged!), it's attaching that is forbidden. :-P Pointed out by: rdivacky -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 19:39:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EF20B5ED; Fri, 25 Oct 2013 19:39:22 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DBD272CF4; Fri, 25 Oct 2013 19:39:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PJdMxK001591; Fri, 25 Oct 2013 19:39:22 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PJdMRk001588; Fri, 25 Oct 2013 19:39:22 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201310251939.r9PJdMRk001588@svn.freebsd.org> From: Nick Hibma Date: Fri, 25 Oct 2013 19:39:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257132 - in head/sys/dev/usb: . serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 19:39:23 -0000 Author: n_hibma Date: Fri Oct 25 19:39:22 2013 New Revision: 257132 URL: http://svnweb.freebsd.org/changeset/base/257132 Log: Add id for GTM661W. Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Fri Oct 25 19:19:12 2013 (r257131) +++ head/sys/dev/usb/serial/u3g.c Fri Oct 25 19:39:22 2013 (r257132) @@ -387,6 +387,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(OPTION, GTMAXHSUPA, 0), U3G_DEV(OPTION, GTMAXHSUPAE, 0), U3G_DEV(OPTION, VODAFONEMC3G, 0), + U3G_DEV(OPTION, GTM661W, 0), U3G_DEV(QISDA, H20_1, 0), U3G_DEV(QISDA, H20_2, 0), U3G_DEV(QISDA, H21_1, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Oct 25 19:19:12 2013 (r257131) +++ head/sys/dev/usb/usbdevs Fri Oct 25 19:39:22 2013 (r257132) @@ -3248,6 +3248,7 @@ product OPTION GMT382 0x7501 Globetrott product OPTION GE40X_1 0x7301 Globetrotter HSUPA product OPTION GE40X_2 0x7361 Globetrotter HSUPA product OPTION GE40X_3 0x7381 Globetrotter HSUPA +product OPTION GTM661W 0x9000 GTM661W product OPTION ICONEDGE 0xc031 GlobeSurfer iCON EDGE product OPTION MODHSXPA 0xd013 Globetrotter HSUPA product OPTION ICON321 0xd031 Globetrotter HSUPA From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 19:44:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 507CA9D2; Fri, 25 Oct 2013 19:44:54 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3C47E2D54; Fri, 25 Oct 2013 19:44:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PJismS004420; Fri, 25 Oct 2013 19:44:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PJis6q004419; Fri, 25 Oct 2013 19:44:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201310251944.r9PJis6q004419@svn.freebsd.org> From: Adrian Chadd Date: Fri, 25 Oct 2013 19:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257133 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 19:44:54 -0000 Author: adrian Date: Fri Oct 25 19:44:53 2013 New Revision: 257133 URL: http://svnweb.freebsd.org/changeset/base/257133 Log: Temporarily disable multi-rate retry (link quality) and eliminate rate index lookups. * My recent(ish) change to iwn(4) and the net80211 rate control API to support 11n rates broke the link quality table use. So, until I or someone else decides to fix it, let's just disable it for now. * Teach iwn_tx_data_raw() to use the iwn_rate_to_plcp() function. * Eliminate two uses of the net80211 rate index lookup functions - they are only for legacy rates and they're not needed here. This fixes some invalid looking rate control TX issues that showed up on my 4965 but it doesn't fix the two TX hangs I've noticed. Those look like DMA related issues. Tested: * 4965, STA mode * 5100, STA mode Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Fri Oct 25 19:39:22 2013 (r257132) +++ head/sys/dev/iwn/if_iwn.c Fri Oct 25 19:44:53 2013 (r257133) @@ -3476,6 +3476,53 @@ iwn5000_reset_sched(struct iwn_softc *sc } #endif +/* + * Check whether OFDM 11g protection will be enabled for the given rate. + * + * The original driver code only enabled protection for OFDM rates. + * It didn't check to see whether it was operating in 11a or 11bg mode. + */ +static int +iwn_check_rate_needs_protection(struct iwn_softc *sc, + struct ieee80211vap *vap, uint8_t rate) +{ + struct ieee80211com *ic = vap->iv_ic; + + /* + * Not in 2GHz mode? Then there's no need to enable OFDM + * 11bg protection. + */ + if (! IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan)) { + return (0); + } + + /* + * 11bg protection not enabled? Then don't use it. + */ + if ((ic->ic_flags & IEEE80211_F_USEPROT) == 0) + return (0); + + /* + * If it's an 11n rate, then for now we enable + * protection. + */ + if (rate & IEEE80211_RATE_MCS) { + return (1); + } + + /* + * Do a rate table lookup. If the PHY is CCK, + * don't do protection. + */ + if (ieee80211_rate2phytype(ic->ic_rt, rate) == IEEE80211_T_CCK) + return (0); + + /* + * Yup, enable protection. + */ + return (1); +} + static int iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) { @@ -3496,7 +3543,7 @@ iwn_tx_data(struct iwn_softc *sc, struct uint16_t qos; u_int hdrlen; bus_dma_segment_t *seg, segs[IWN_MAX_SCATTER]; - uint8_t tid, ridx, txant, type; + uint8_t tid, type; int ac, i, totlen, error, pad, nsegs = 0, rate; DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); @@ -3546,8 +3593,6 @@ iwn_tx_data(struct iwn_softc *sc, struct (void) ieee80211_ratectl_rate(ni, NULL, 0); rate = ni->ni_txrate; } - ridx = ieee80211_legacy_rate_lookup(ic->ic_rt, - rate & IEEE80211_RATE_VAL); /* Encrypt the frame if need be. */ if (wh->i_fc[1] & IEEE80211_FC1_WEP) { @@ -3604,13 +3649,15 @@ iwn_tx_data(struct iwn_softc *sc, struct /* NB: Group frames are sent using CCK in 802.11b/g. */ if (totlen + IEEE80211_CRC_LEN > vap->iv_rtsthreshold) { flags |= IWN_TX_NEED_RTS; - } else if ((ic->ic_flags & IEEE80211_F_USEPROT) && - ridx >= IWN_RIDX_OFDM6) { + } else if (iwn_check_rate_needs_protection(sc, vap, rate)) { if (ic->ic_protmode == IEEE80211_PROT_CTSONLY) flags |= IWN_TX_NEED_CTS; else if (ic->ic_protmode == IEEE80211_PROT_RTSCTS) flags |= IWN_TX_NEED_RTS; } + + /* XXX HT protection? */ + if (flags & (IWN_TX_NEED_RTS | IWN_TX_NEED_CTS)) { if (sc->hw_type != IWN_HW_REV_TYPE_4965) { /* 5000 autoselects RTS/CTS or CTS-to-self. */ @@ -3654,6 +3701,7 @@ iwn_tx_data(struct iwn_softc *sc, struct tx->data_ntries = 15; tx->lifetime = htole32(IWN_LIFETIME_INFINITE); tx->rate = iwn_rate_to_plcp(sc, ni, rate); +#if 0 if (tx->id == sc->broadcast_id) { /* Group or management frame. */ tx->linkq = 0; @@ -3661,9 +3709,21 @@ iwn_tx_data(struct iwn_softc *sc, struct txant = IWN_LSB(sc->txchainmask); tx->rate |= htole32(IWN_RFLAG_ANT(txant)); } else { + /* + * XXX This is no longer true. ni_rates may actually + * XXX need to be ni_htrates (for 11n rates) and thus + * XXX ridx is totally bogus here. + * + * XXX So, break this out into a function and look up + * XXX the correct place to start the MRR table rate + * XXX attempt. + */ tx->linkq = ni->ni_rates.rs_nrates - ridx - 1; flags |= IWN_TX_LINKQ; /* enable MRR */ } +#else + tx->linkq = 0; /* Don't enable MRR for now */ +#endif /* Set physical address of "scratch area". */ tx->loaddr = htole32(IWN_LOADDR(data->scratch_paddr)); tx->hiaddr = IWN_HIADDR(data->scratch_paddr); @@ -3756,9 +3816,9 @@ iwn_tx_data_raw(struct iwn_softc *sc, st struct ieee80211_node *ni, const struct ieee80211_bpf_params *params) { struct iwn_ops *ops = &sc->ops; - struct ifnet *ifp = sc->sc_ifp; +// struct ifnet *ifp = sc->sc_ifp; struct ieee80211vap *vap = ni->ni_vap; - struct ieee80211com *ic = ifp->if_l2com; +// struct ieee80211com *ic = ifp->if_l2com; struct iwn_tx_cmd *cmd; struct iwn_cmd_data *tx; struct ieee80211_frame *wh; @@ -3770,7 +3830,7 @@ iwn_tx_data_raw(struct iwn_softc *sc, st uint32_t flags; u_int hdrlen; int ac, totlen, error, pad, nsegs = 0, i, rate; - uint8_t ridx, type, txant; + uint8_t type; DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); @@ -3786,16 +3846,8 @@ iwn_tx_data_raw(struct iwn_softc *sc, st desc = &ring->desc[ring->cur]; data = &ring->data[ring->cur]; - /* Choose a TX rate index. */ + /* Choose a TX rate. */ rate = params->ibp_rate0; - ridx = ieee80211_legacy_rate_lookup(ic->ic_rt, - rate & IEEE80211_RATE_VAL); - if (ridx == (uint8_t)-1) { - /* XXX fall back to mcast/mgmt rate? */ - m_freem(m); - return EINVAL; - } - totlen = m->m_pkthdr.len; /* Prepare TX firmware command. */ @@ -3865,17 +3917,10 @@ iwn_tx_data_raw(struct iwn_softc *sc, st tx->rts_ntries = params->ibp_try1; tx->data_ntries = params->ibp_try0; tx->lifetime = htole32(IWN_LIFETIME_INFINITE); - - /* XXX should just use iwn_rate_to_plcp() */ - tx->rate = htole32(rate2plcp(rate)); - if (ridx < IWN_RIDX_OFDM6 && - IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) - tx->rate |= htole32(IWN_RFLAG_CCK); + tx->rate = iwn_rate_to_plcp(sc, ni, rate); /* Group or management frame. */ tx->linkq = 0; - txant = IWN_LSB(sc->txchainmask); - tx->rate |= htole32(IWN_RFLAG_ANT(txant)); /* Set physical address of "scratch area". */ tx->loaddr = htole32(IWN_LOADDR(data->scratch_paddr)); From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 19:46:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EDF1CB21; Fri, 25 Oct 2013 19:46:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D92CE2D60; Fri, 25 Oct 2013 19:46:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PJkqk0004707; Fri, 25 Oct 2013 19:46:52 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PJkqGQ004704; Fri, 25 Oct 2013 19:46:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201310251946.r9PJkqGQ004704@svn.freebsd.org> From: Adrian Chadd Date: Fri, 25 Oct 2013 19:46:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257134 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 19:46:53 -0000 Author: adrian Date: Fri Oct 25 19:46:52 2013 New Revision: 257134 URL: http://svnweb.freebsd.org/changeset/base/257134 Log: Begin fleshing out a knob to enable/disable bluetooth coexistence. Some firmware versions seem to get very unhappy if they're sent btcoex commands when they don't actually have bluetooth hardware in them. So, disable sending them those commands. Tested: * 5100 (which has bluetooth, no problems) * 4965 (which doesn't have bluetooth, but didn't seem to crash) * 6200 (no bluetooth, seems to get unhappy being sent bluetooth commands.) Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnvar.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Fri Oct 25 19:44:53 2013 (r257133) +++ head/sys/dev/iwn/if_iwn.c Fri Oct 25 19:46:52 2013 (r257134) @@ -705,6 +705,8 @@ iwn4965_attach(struct iwn_softc *sc, uin /* Override chains masks, ROM is known to be broken. */ sc->txchainmask = IWN_ANT_AB; sc->rxchainmask = IWN_ANT_ABC; + /* Enable normal btcoex */ + sc->sc_flags |= IWN_FLAG_BTCOEX; DPRINTF(sc, IWN_DEBUG_TRACE, "%s: end\n",__func__); @@ -752,23 +754,40 @@ iwn5000_attach(struct iwn_softc *sc, uin /* Override chains masks, ROM is known to be broken. */ sc->txchainmask = IWN_ANT_B; sc->rxchainmask = IWN_ANT_AB; + /* Enable normal btcoex */ + sc->sc_flags |= IWN_FLAG_BTCOEX; break; case IWN_HW_REV_TYPE_5150: sc->limits = &iwn5150_sensitivity_limits; sc->fwname = "iwn5150fw"; + /* Enable normal btcoex */ + sc->sc_flags |= IWN_FLAG_BTCOEX; break; case IWN_HW_REV_TYPE_5300: case IWN_HW_REV_TYPE_5350: sc->limits = &iwn5000_sensitivity_limits; sc->fwname = "iwn5000fw"; + /* Enable normal btcoex */ + sc->sc_flags |= IWN_FLAG_BTCOEX; break; case IWN_HW_REV_TYPE_1000: sc->limits = &iwn1000_sensitivity_limits; sc->fwname = "iwn1000fw"; + /* Enable normal btcoex */ + sc->sc_flags |= IWN_FLAG_BTCOEX; break; case IWN_HW_REV_TYPE_6000: sc->limits = &iwn6000_sensitivity_limits; sc->fwname = "iwn6000fw"; + /* + * Disable btcoex for 6200. + * XXX TODO: disable for 6205; no btcoex as well + * (6230/6235 - enable bluetooth) + */ + if (pid != 0x422c) { + /* Enable normal btcoex */ + sc->sc_flags |= IWN_FLAG_BTCOEX; + } if (pid == 0x422c || pid == 0x4239) { sc->sc_flags |= IWN_FLAG_INTERNAL_PA; /* Override chains masks, ROM is known to be broken. */ @@ -782,14 +801,20 @@ iwn5000_attach(struct iwn_softc *sc, uin /* Override chains masks, ROM is known to be broken. */ sc->txchainmask = IWN_ANT_AB; sc->rxchainmask = IWN_ANT_AB; + /* Enable normal btcoex */ + sc->sc_flags |= IWN_FLAG_BTCOEX; break; case IWN_HW_REV_TYPE_6005: sc->limits = &iwn6000_sensitivity_limits; if (pid != 0x0082 && pid != 0x0085) { sc->fwname = "iwn6000g2bfw"; sc->sc_flags |= IWN_FLAG_ADV_BTCOEX; - } else + } else { sc->fwname = "iwn6000g2afw"; + /* + * 6250 - disable bluetooth coexistence. + */ + } break; default: device_printf(sc->sc_dev, "adapter type %d not supported\n", @@ -797,6 +822,15 @@ iwn5000_attach(struct iwn_softc *sc, uin DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end in error\n",__func__); return ENOTSUP; } + if (sc->sc_flags & IWN_FLAG_BTCOEX) + device_printf(sc->sc_dev, + "enable basic bluetooth coexistence\n"); + else if (sc->sc_flags & IWN_FLAG_ADV_BTCOEX) + device_printf(sc->sc_dev, + "enable advanced bluetooth coexistence\n"); + else + device_printf(sc->sc_dev, + "disable bluetooth coexistence\n"); return 0; } @@ -5404,9 +5438,10 @@ iwn_config(struct iwn_softc *sc) } /* Configure bluetooth coexistence. */ + error = 0; if (sc->sc_flags & IWN_FLAG_ADV_BTCOEX) error = iwn_send_advanced_btcoex(sc); - else + else if (sc->sc_flags & IWN_FLAG_BTCOEX) error = iwn_send_btcoex(sc); if (error != 0) { device_printf(sc->sc_dev, Modified: head/sys/dev/iwn/if_iwnvar.h ============================================================================== --- head/sys/dev/iwn/if_iwnvar.h Fri Oct 25 19:44:53 2013 (r257133) +++ head/sys/dev/iwn/if_iwnvar.h Fri Oct 25 19:46:52 2013 (r257134) @@ -249,6 +249,7 @@ struct iwn_softc { #define IWN_FLAG_ENH_SENS (1 << 7) #define IWN_FLAG_ADV_BTCOEX (1 << 8) #define IWN_FLAG_PAN_SUPPORT (1 << 9) +#define IWN_FLAG_BTCOEX (1 << 10) uint8_t hw_type; /* subdevice_id used to adjust configuration */ From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 19:49:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 38C14C7A; Fri, 25 Oct 2013 19:49:04 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 20E8E2D74; Fri, 25 Oct 2013 19:49:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PJn4ib004989; Fri, 25 Oct 2013 19:49:04 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PJn3Xd004987; Fri, 25 Oct 2013 19:49:03 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310251949.r9PJn3Xd004987@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 25 Oct 2013 19:49:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257135 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 19:49:04 -0000 Author: glebius Date: Fri Oct 25 19:49:03 2013 New Revision: 257135 URL: http://svnweb.freebsd.org/changeset/base/257135 Log: vnet.h needs to be included before raw_cb.h. Now it compiles due to pollution via if_var.h. Modified: head/sys/net/raw_cb.c head/sys/net/raw_usrreq.c Modified: head/sys/net/raw_cb.c ============================================================================== --- head/sys/net/raw_cb.c Fri Oct 25 19:46:52 2013 (r257134) +++ head/sys/net/raw_cb.c Fri Oct 25 19:49:03 2013 (r257135) @@ -44,8 +44,8 @@ #include #include -#include #include +#include /* * Routines to manage the raw protocol control blocks. Modified: head/sys/net/raw_usrreq.c ============================================================================== --- head/sys/net/raw_usrreq.c Fri Oct 25 19:46:52 2013 (r257134) +++ head/sys/net/raw_usrreq.c Fri Oct 25 19:49:03 2013 (r257135) @@ -46,8 +46,8 @@ #include #include -#include #include +#include MTX_SYSINIT(rawcb_mtx, &rawcb_mtx, "rawcb", MTX_DEF); From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 21:27:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 78E5F71F; Fri, 25 Oct 2013 21:27:36 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6528C22BA; Fri, 25 Oct 2013 21:27:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PLRae0039589; Fri, 25 Oct 2013 21:27:36 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PLRaAr039588; Fri, 25 Oct 2013 21:27:36 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310252127.r9PLRaAr039588@svn.freebsd.org> From: Glen Barber Date: Fri, 25 Oct 2013 21:27:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257136 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 21:27:36 -0000 Author: gjb Date: Fri Oct 25 21:27:35 2013 New Revision: 257136 URL: http://svnweb.freebsd.org/changeset/base/257136 Log: MFC r257079: Fix build host pollution by avoiding calling 'uname -srp' to determine values for 'VERSION'. Approved by: re (glebius) Modified: stable/10/Makefile.inc1 (contents, props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Fri Oct 25 19:49:03 2013 (r257135) +++ stable/10/Makefile.inc1 Fri Oct 25 21:27:35 2013 (r257136) @@ -58,6 +58,7 @@ # use that new version. And the new (dynamically-linked) /bin/sh # will expect to find appropriate libraries in /lib and /libexec. # +SRCDIR?= ${.CURDIR} .if defined(SUBDIR_OVERRIDE) SUBDIR= ${SUBDIR_OVERRIDE} .else @@ -128,8 +129,11 @@ OSRELDATE= 0 .endif .if !defined(VERSION) -VERSION!= uname -srp -VERSION+= ${OSRELDATE} +REVISION!= make -C ${SRCDIR}/release -V REVISION +BRANCH!= make -C ${SRCDIR}/release -V BRANCH +SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ + ${SRCDIR}/sys/sys/param.h +VERSION= FreeBSD ${REVISION}-${BRANCH} ${TARGET_ARCH} ${SRCRELDATE} .endif KNOWN_ARCHES?= amd64 arm armeb/arm armv6/arm i386 i386/pc98 ia64 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64 From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 22:45:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B294DE98; Fri, 25 Oct 2013 22:45:19 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 84B1F27EE; Fri, 25 Oct 2013 22:45:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PMjJKZ065795; Fri, 25 Oct 2013 22:45:19 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PMjICG065791; Fri, 25 Oct 2013 22:45:18 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310252245.r9PMjICG065791@svn.freebsd.org> From: Brooks Davis Date: Fri, 25 Oct 2013 22:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257138 - in head: . share/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 22:45:19 -0000 Author: brooks Date: Fri Oct 25 22:45:18 2013 New Revision: 257138 URL: http://svnweb.freebsd.org/changeset/base/257138 Log: Switch the default mtree to nmtree our new NetBSD derived mtree. Exp-run by: bdrewery MFC after: 3 days Sponsored by: DARPA/AFRL Added: head/tools/build/options/WITHOUT_NMTREE - copied, changed from r255666, head/tools/build/options/WITH_NMTREE Deleted: head/tools/build/options/WITH_NMTREE Modified: head/UPDATING head/share/mk/bsd.own.mk Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Oct 25 21:57:03 2013 (r257137) +++ head/UPDATING Fri Oct 25 22:45:18 2013 (r257138) @@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20131025: + The default version of mtree is nmtree which is obtained from + NetBSD. The output is generally the same, but may vary + slightly. If you found you need identical output adding + "-F freebsd9" to the command line should do the trick. For the + time being, the old mtree is available as fmtree. + 20131014: libbsdyml has been renamed to libyaml and moved to /usr/lib/private. This will break ports-mgmt/pkg. Rebuild the port, or upgrade to pkg Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Fri Oct 25 21:57:03 2013 (r257137) +++ head/share/mk/bsd.own.mk Fri Oct 25 22:45:18 2013 (r257138) @@ -320,6 +320,7 @@ __DEFAULT_YES_OPTIONS = \ NIS \ NLS \ NLS_CATALOGS \ + NMTREE \ NS_CACHING \ NTP \ OPENSSH \ @@ -370,7 +371,6 @@ __DEFAULT_NO_OPTIONS = \ LIBICONV_COMPAT \ INSTALL_AS_USER \ LLDB \ - NMTREE \ NAND \ OFED \ OPENSSH_NONE_CIPHER \ Copied and modified: head/tools/build/options/WITHOUT_NMTREE (from r255666, head/tools/build/options/WITH_NMTREE) ============================================================================== --- head/tools/build/options/WITH_NMTREE Wed Sep 18 11:07:32 2013 (r255666, copy source) +++ head/tools/build/options/WITHOUT_NMTREE Fri Oct 25 22:45:18 2013 (r257138) @@ -1,9 +1,9 @@ .\" $FreeBSD$ Set to install -.Xr nmtree 8 +.Xr fmtree 8 as .Xr mtree 8 . By default -.Xr fmtree 8 +.Xr nmtree 8 is installed as .Xr mtree 8 . From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 22:47:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 69352FE0; Fri, 25 Oct 2013 22:47:55 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5554A27FA; Fri, 25 Oct 2013 22:47:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PMltZw066104; Fri, 25 Oct 2013 22:47:55 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PMlt6R066103; Fri, 25 Oct 2013 22:47:55 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310252247.r9PMlt6R066103@svn.freebsd.org> From: Brooks Davis Date: Fri, 25 Oct 2013 22:47:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257139 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 22:47:55 -0000 Author: brooks Date: Fri Oct 25 22:47:54 2013 New Revision: 257139 URL: http://svnweb.freebsd.org/changeset/base/257139 Log: Regerate after r257138 swapped the default to WITH_NMTREE. MFC after: 3 days Sponsored by: DARPA/AFRL Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Fri Oct 25 22:45:18 2013 (r257138) +++ head/share/man/man5/src.conf.5 Fri Oct 25 22:47:54 2013 (r257139) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd October 24, 2013 +.Dd October 25, 2013 .Dt SRC.CONF 5 .Os .Sh NAME @@ -764,14 +764,14 @@ Set to not build NLS catalogs. .\" from FreeBSD: head/tools/build/options/WITHOUT_NLS_CATALOGS 156932 2006-03-21 07:50:50Z ru Set to not build NLS catalog support for .Xr csh 1 . -.It Va WITH_NMTREE -.\" from FreeBSD: head/tools/build/options/WITH_NMTREE 245435 2013-01-14 20:38:32Z brooks +.It Va WITHOUT_NMTREE +.\" from FreeBSD: head/tools/build/options/WITHOUT_NMTREE 257138 2013-10-25 22:45:18Z brooks Set to install -.Xr nmtree 8 +.Xr fmtree 8 as .Xr mtree 8 . By default -.Xr fmtree 8 +.Xr nmtree 8 is installed as .Xr mtree 8 . .It Va WITHOUT_NS_CACHING From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 23:08:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id ADAB7598 for ; Fri, 25 Oct 2013 23:08:27 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-qe0-x22c.google.com (mail-qe0-x22c.google.com [IPv6:2607:f8b0:400d:c02::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 693CF28ED for ; Fri, 25 Oct 2013 23:08:27 +0000 (UTC) Received: by mail-qe0-f44.google.com with SMTP id 6so2797705qeb.3 for ; Fri, 25 Oct 2013 16:08:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=bP7R7I3YxSDtFKVN600t1s3/mZF+t+4+LVxiXAXjNRM=; b=NWhT1hPTFDhcj8OyhNT2sYa6ApNugRcY7ze02TmWnuVg55tx6+T7DrL3eyuziTw/5z gZgcsQQBizh8VE0AKsxP3yWFzW7tQqYekdZPQOCoOQBEd17EDOU4LJogV6Kye+fcxWBl A/Md6DzbgkpLKjYu6mYPzBoMS1EMYXOQFEiFA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=bP7R7I3YxSDtFKVN600t1s3/mZF+t+4+LVxiXAXjNRM=; b=bs3tMO0lRkr0YUWqy2xZlYWH+m6cHWYTS4R6+maw6/OG/u9pFYH6kZSN5iLTbucQ9y vLGU6w7FvSdKO++MmlZFFXPBBIWTLUiZzTDdo1ohjMz7MkQBxc5qWQPcNQKqPdf3QFO0 i4v372pHWqRukTcamR7EhB3xr63J+GUn5nTMYikmCM+6kMVo8d+gFxOPGZ2BQwb4spNx 8FfIYlR8szzn0rSaRP8Y3Ueqmtu45zvCCM6C7Nj2Q0RqQUiufVEKe1ehGKllbMpgoVMZ nG+mzwKiDN4f5gq48yIl4IW6KyBp1gfEVorjCszC3WWipgxVVKDq3ttSAf+sbe6VbNed YYlg== X-Gm-Message-State: ALoCoQk/3BX4PU9nqSUf/vfyRMB0jTKmh1oRjCItaOUrhmRszoMclcqEMZMD/BZzeTO5ShH7hXq9 X-Received: by 10.224.24.201 with SMTP id w9mr14522622qab.103.1382742506581; Fri, 25 Oct 2013 16:08:26 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.63.101 with HTTP; Fri, 25 Oct 2013 16:07:56 -0700 (PDT) In-Reply-To: <201310251843.r9PIhsGh083931@svn.freebsd.org> References: <201310251843.r9PIhsGh083931@svn.freebsd.org> From: Eitan Adler Date: Fri, 25 Oct 2013 19:07:56 -0400 X-Google-Sender-Auth: _QfUrKNVU5MJt4OAK0OHUsOLkQc Message-ID: Subject: Re: svn commit: r257129 - head/contrib/subversion/subversion/libsvn_subr To: Colin Percival Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 23:08:27 -0000 On Fri, Oct 25, 2013 at 2:43 PM, Colin Percival wrote: > Author: cperciva > Date: Fri Oct 25 18:43:53 2013 > New Revision: 257129 > URL: http://svnweb.freebsd.org/changeset/base/257129 > > Log: > Remove time and date stamps from svn* binaries, in order to make the > builds reproducible. Thanks! I wonder if we could work on a wiki paging listing all the other non-reproducible portions of the FreeBSD build process. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 23:38:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D766D9C4; Fri, 25 Oct 2013 23:38:58 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB6F52A1C; Fri, 25 Oct 2013 23:38:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PNcwKe082843; Fri, 25 Oct 2013 23:38:58 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PNcwu1082842; Fri, 25 Oct 2013 23:38:58 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201310252338.r9PNcwu1082842@svn.freebsd.org> From: Olivier Houchard Date: Fri, 25 Oct 2013 23:38:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r257140 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 23:38:58 -0000 Author: cognet Date: Fri Oct 25 23:38:58 2013 New Revision: 257140 URL: http://svnweb.freebsd.org/changeset/base/257140 Log: Deliver zbb from my oppression. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Fri Oct 25 22:47:54 2013 (r257139) +++ svnadmin/conf/mentors Fri Oct 25 23:38:58 2013 (r257140) @@ -29,4 +29,3 @@ odeds jhb Co-mentor: alfred peterj jhb Co-mentor: grog snb dwmalone versus gavin Co-mentor: fjoe -zbb cognet From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 23:43:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E531AC01; Fri, 25 Oct 2013 23:43:50 +0000 (UTC) (envelope-from h.skuhra@gmail.com) Received: from mail-ea0-x22b.google.com (mail-ea0-x22b.google.com [IPv6:2a00:1450:4013:c01::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DD0112A7F; Fri, 25 Oct 2013 23:43:49 +0000 (UTC) Received: by mail-ea0-f171.google.com with SMTP id n15so1025892ead.2 for ; Fri, 25 Oct 2013 16:43:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:message-id:from:to:cc:subject:in-reply-to:references :user-agent:mime-version:content-type; bh=OyEdcaDw0RcKsoBmnSMAibcFzZBdwKrQxDoYBkIXnUA=; b=aMLIW4vHzW6gZptpLsmBLh/ODgSZduIXEUuELmJ1V8vaKKMVRO5hqaVNmPzWP+qRNt ERXymHLC9C+gMerhLPzFPJt3cU7sOZ4DAdZXjypuW/Mj973TufPbgyn4yk7ClfCFIKc3 LPWPOox0g5CgBaC2g/+boeN+0yeDWFbQXo/csCMSu61n2tDmALzPKkEeLXJtMz6hV+xk t0RgabgYCc1JUyEWRdEz18cI9bdGAipWgLGI7FET/Cahqx6VkuQnfOLTQScK/1Wt4CSz iwR6lPIl5QFfApL32tgIsuaBZP1eF2hk2FgX8azKkMehT5Wa/IcGALMIlstA1O1wbvlV rz/A== X-Received: by 10.15.31.9 with SMTP id x9mr10534243eeu.53.1382744626692; Fri, 25 Oct 2013 16:43:46 -0700 (PDT) Received: from oslo.ath.cx ([2001:470:6f:44d:853b:b71c:22bd:ee23]) by mx.google.com with ESMTPSA id e13sm23766293eeu.4.2013.10.25.16.43.45 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 25 Oct 2013 16:43:45 -0700 (PDT) Date: Sat, 26 Oct 2013 01:43:43 +0200 Message-ID: <86mwlw532o.wl%h.skuhra@gmail.com> From: "Herbert J. Skuhra" To: Glen Barber Subject: Re: svn commit: r257136 - stable/10 In-Reply-To: <201310252127.r9PLRaAr039588@svn.freebsd.org> References: <201310252127.r9PLRaAr039588@svn.freebsd.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/24.3.50 (i386-pc-freebsd10.0) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 23:43:51 -0000 Hi, On Fri, 25 Oct 2013 21:27:36 +0000 (UTC) Glen Barber wrote: > Author: gjb > Date: Fri Oct 25 21:27:35 2013 > New Revision: 257136 > URL: http://svnweb.freebsd.org/changeset/base/257136 > > Log: > MFC r257079: > Fix build host pollution by avoiding calling 'uname -srp' to > determine values for 'VERSION'. > > Approved by: re (glebius) > > Modified: > stable/10/Makefile.inc1 (contents, props changed) When running make (check|delete)-old I am still getting: >>> Checking for old files make[3]: chdir /usr/obj/usr/src/release: No such file or directory make[2]: "/usr/src/Makefile.inc1" line 132: warning: "make -C /usr/obj/usr/src/release -V REVISION" returned non-zero status make[3]: chdir /usr/obj/usr/src/release: No such file or directory make[2]: "/usr/src/Makefile.inc1" line 133: warning: "make -C /usr/obj/usr/src/release -V BRANCH" returned non-zero status awk: can't open file /usr/obj/usr/src/sys/sys/param.h source line number 1 make[2]: "/usr/src/Makefile.inc1" line 135: warning: "awk '/^#define[[:space:]]*__FreeBSD_version/ { print $3 }' /usr/obj/usr/src/sys/sys/param.h" returned non-zero status /usr/lib/libbsdyml.a /usr/lib/libbsdyml.so /usr/lib/libbsdyml_p.a /usr/share/man/man3/libbsdyml.3.gz /usr/include/bsdyml.h >>> Checking for old libraries make[3]: chdir /usr/obj/usr/src/release: No such file or directory make[2]: "/usr/src/Makefile.inc1" line 132: warning: "make -C /usr/obj/usr/src/release -V REVISION" returned non-zero status make[3]: chdir /usr/obj/usr/src/release: No such file or directory make[2]: "/usr/src/Makefile.inc1" line 133: warning: "make -C /usr/obj/usr/src/release -V BRANCH" returned non-zero status awk: can't open file /usr/obj/usr/src/sys/sys/param.h source line number 1 make[2]: "/usr/src/Makefile.inc1" line 135: warning: "awk '/^#define[[:space:]]*__FreeBSD_version/ { print $3 }' /usr/obj/usr/src/sys/sys/param.h" returned non-zero status /usr/lib/libbsdyml.so.0 >>> Checking for old directories make[3]: chdir /usr/obj/usr/src/release: No such file or directory make[2]: "/usr/src/Makefile.inc1" line 132: warning: "make -C /usr/obj/usr/src/release -V REVISION" returned non-zero status make[3]: chdir /usr/obj/usr/src/release: No such file or directory make[2]: "/usr/src/Makefile.inc1" line 133: warning: "make -C /usr/obj/usr/src/release -V BRANCH" returned non-zero status awk: can't open file /usr/obj/usr/src/sys/sys/param.h source line number 1 make[2]: "/usr/src/Makefile.inc1" line 135: warning: "awk '/^#define[[:space:]]*__FreeBSD_version/ { print $3 }' /usr/obj/usr/src/sys/sys/param.h" returned non-zero status /usr/share/doc/bind9 /usr/share/doc/bind9/arm /usr/share/doc/bind9/misc To remove old files and directories run 'make delete-old'. To remove old libraries run 'make delete-old-libs'. -- Herbert From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 00:05:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EBCA2E8A; Sat, 26 Oct 2013 00:05:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BF6A42B61; Sat, 26 Oct 2013 00:05:19 +0000 (UTC) Received: from glenbarber.us (unknown [64.197.173.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 2BCC6D41F; Sat, 26 Oct 2013 00:05:18 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 2BCC6D41F Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Fri, 25 Oct 2013 20:05:16 -0400 From: Glen Barber To: "Herbert J. Skuhra" Subject: Re: svn commit: r257136 - stable/10 Message-ID: <20131026000423.GA1740@glenbarber.us> References: <201310252127.r9PLRaAr039588@svn.freebsd.org> <86mwlw532o.wl%h.skuhra@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Fba/0zbH8Xs+Fj9o" Content-Disposition: inline In-Reply-To: <86mwlw532o.wl%h.skuhra@gmail.com> X-Operating-System: FreeBSD 11.0-CURRENT amd64 User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 00:05:20 -0000 --Fba/0zbH8Xs+Fj9o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 26, 2013 at 01:43:43AM +0200, Herbert J. Skuhra wrote: > Hi, >=20 > On Fri, 25 Oct 2013 21:27:36 +0000 (UTC) > Glen Barber wrote: >=20 > > Author: gjb > > Date: Fri Oct 25 21:27:35 2013 > > New Revision: 257136 > > URL: http://svnweb.freebsd.org/changeset/base/257136 > >=20 > > Log: > > MFC r257079: > > Fix build host pollution by avoiding calling 'uname -srp' to > > determine values for 'VERSION'. > > =20 > > Approved by: re (glebius) > >=20 > > Modified: > > stable/10/Makefile.inc1 (contents, props changed) >=20 > When running make (check|delete)-old I am still getting: >=20 > >>> Checking for old files > make[3]: chdir /usr/obj/usr/src/release: No such file or directory > make[2]: "/usr/src/Makefile.inc1" line 132: warning: "make -C /usr/obj/us= r/src/release -V REVISION" returned non-zero status > make[3]: chdir /usr/obj/usr/src/release: No such file or directory > make[2]: "/usr/src/Makefile.inc1" line 133: warning: "make -C /usr/obj/us= r/src/release -V BRANCH" returned non-zero status > awk: can't open file /usr/obj/usr/src/sys/sys/param.h > source line number 1 > make[2]: "/usr/src/Makefile.inc1" line 135: warning: "awk '/^#define[[:sp= ace:]]*__FreeBSD_version/ { print $3 }' /usr/obj/usr/src/sys/sys/param.h" = returned non-zero status > /usr/lib/libbsdyml.a > /usr/lib/libbsdyml.so > /usr/lib/libbsdyml_p.a > /usr/share/man/man3/libbsdyml.3.gz > /usr/include/bsdyml.h > >>> Checking for old libraries > make[3]: chdir /usr/obj/usr/src/release: No such file or directory > make[2]: "/usr/src/Makefile.inc1" line 132: warning: "make -C /usr/obj/us= r/src/release -V REVISION" returned non-zero status > make[3]: chdir /usr/obj/usr/src/release: No such file or directory > make[2]: "/usr/src/Makefile.inc1" line 133: warning: "make -C /usr/obj/us= r/src/release -V BRANCH" returned non-zero status > awk: can't open file /usr/obj/usr/src/sys/sys/param.h > source line number 1 > make[2]: "/usr/src/Makefile.inc1" line 135: warning: "awk '/^#define[[:sp= ace:]]*__FreeBSD_version/ { print $3 }' /usr/obj/usr/src/sys/sys/param.h" = returned non-zero status > /usr/lib/libbsdyml.so.0 > >>> Checking for old directories > make[3]: chdir /usr/obj/usr/src/release: No such file or directory > make[2]: "/usr/src/Makefile.inc1" line 132: warning: "make -C /usr/obj/us= r/src/release -V REVISION" returned non-zero status > make[3]: chdir /usr/obj/usr/src/release: No such file or directory > make[2]: "/usr/src/Makefile.inc1" line 133: warning: "make -C /usr/obj/us= r/src/release -V BRANCH" returned non-zero status > awk: can't open file /usr/obj/usr/src/sys/sys/param.h > source line number 1 > make[2]: "/usr/src/Makefile.inc1" line 135: warning: "awk '/^#define[[:sp= ace:]]*__FreeBSD_version/ { print $3 }' /usr/obj/usr/src/sys/sys/param.h" = returned non-zero status > /usr/share/doc/bind9 > /usr/share/doc/bind9/arm > /usr/share/doc/bind9/misc > To remove old files and directories run 'make delete-old'. > To remove old libraries run 'make delete-old-libs'. >=20 This will be fixed after -BETA2. I realize the output is annoying, but in these cases, they are non-fatal warnings. It *is* very high on my priority list, but the fix right now is not clear. I'll follow up on -stable@ and -current@ shortly with a full explanation of why -BETA2 is taking so long, by the way, which is directly related to the update this commit makes, and why it is important in order to move forward with this change in the tree, versus reverting it (again). Glen --Fba/0zbH8Xs+Fj9o Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIbBAEBCAAGBQJSawc7AAoJELls3eqvi17Q+GIP9jFyswMXpPfyWFUa0M44W3Nd 6+jWNvEhUvZlJ8D7MmnsP9LihqvLhQR/LK5HQpQYVW1eyuTQ/msMsxWqqh+/vO6E zGabEX7Yzv0kQTuozoAlIU1AD8HHpHyLn8TMy0PBELzqehGuiIsxJsXSR45XDzQ9 f40i9c7Je/k2KSRGd29xcDxkjxinHvwehBZtSLNbWzFdKwyb5f0CUNEjGTu7bHAQ YMrZrT30nV39Ay0LVuDUHqqEzkBX1wMu+LEnMnFY3Xld/4CclpDOYaCzfX703cAF 0jzzjceHoQKxB9SPC51LzmEO8LfF+Vi5Z7Zxfw46BH6/U09btW75NB7KzdapYAJR OrFVZQf3ho0AfNrOCPkr1r2inTePpqTknbEjYNuz0x/B0YAUBriPUKdtJR50QeJm EwBBW5wENZ0e6Lx+nFwM/L0pTLLXeolvnK5lQirnonCL7E9eYb9XIHqp9bEy8Vz4 xWAjWyxrIGmqtqDSJvQO0brOfSyVj2m1YP3GKTZwbxWQwCinmx6F1jPuKKq6M66y zUl3stz9Aab/Pt/pmnDqj88QcBQ7u4pkmLALPm0Y4ud/ABng04ap9ztUUpAXBLIi TJlDe/sqU4MvBpbanPZJ9xqojAMGcwfDST+tH1D/LvOvQx5E+4ITxTLH3kKseAyg 37ZkqIkFPa13OY+y2cA= =kMO+ -----END PGP SIGNATURE----- --Fba/0zbH8Xs+Fj9o-- From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 01:17:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4590C9EA; Sat, 26 Oct 2013 01:17:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3352E2E70; Sat, 26 Oct 2013 01:17:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9Q1Ht7j030629; Sat, 26 Oct 2013 01:17:55 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9Q1HtVB030628; Sat, 26 Oct 2013 01:17:55 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201310260117.r9Q1HtVB030628@svn.freebsd.org> From: Adrian Chadd Date: Sat, 26 Oct 2013 01:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257141 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 01:17:55 -0000 Author: adrian Date: Sat Oct 26 01:17:54 2013 New Revision: 257141 URL: http://svnweb.freebsd.org/changeset/base/257141 Log: add 0x8b, lifted from Linux iwlegacy/commands.h This is "STA invalid". I saw it during some 4965 testing (kern/183260) and I still have no idea what is causing it. Obtained from: Linux drivers/net/wireless/iwlegacy Modified: head/sys/dev/iwn/if_iwnreg.h Modified: head/sys/dev/iwn/if_iwnreg.h ============================================================================== --- head/sys/dev/iwn/if_iwnreg.h Fri Oct 25 23:38:58 2013 (r257140) +++ head/sys/dev/iwn/if_iwnreg.h Sat Oct 26 01:17:54 2013 (r257141) @@ -1234,6 +1234,7 @@ struct iwn_ucode_info { #define IWN_TX_FAIL_FIFO_UNDERRRUN 0x84 /* tx fifo not kept running */ #define IWN_TX_FAIL_DEST_IN_PS 0x88 /* sta found in power save */ #define IWN_TX_FAIL_TX_LOCKED 0x90 /* waiting to see traffic */ +#define IWN_TX_FAIL_STA_INVALID 0x8b /* XXX STA invalid (???) */ struct iwn4965_tx_stat { uint8_t nframes; From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 03:21:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DA94D910; Sat, 26 Oct 2013 03:21:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AF1D62386; Sat, 26 Oct 2013 03:21:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9Q3L9dI074439; Sat, 26 Oct 2013 03:21:09 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9Q3L9Mw074437; Sat, 26 Oct 2013 03:21:09 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310260321.r9Q3L9Mw074437@svn.freebsd.org> From: Bryan Drewery Date: Sat, 26 Oct 2013 03:21:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257142 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 03:21:09 -0000 Author: bdrewery (ports committer) Date: Sat Oct 26 03:21:08 2013 New Revision: 257142 URL: http://svnweb.freebsd.org/changeset/base/257142 Log: Wrap long lines Approved by: bapt MFC after: 2 days Modified: head/usr.sbin/pkg/config.c head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/config.c ============================================================================== --- head/usr.sbin/pkg/config.c Sat Oct 26 01:17:54 2013 (r257141) +++ head/usr.sbin/pkg/config.c Sat Oct 26 03:21:08 2013 (r257142) @@ -548,7 +548,8 @@ config_init(void) if ((fp = fopen(confpath, "r")) == NULL) { if (errno != ENOENT) - err(EXIT_FAILURE, "Unable to open configuration file %s", confpath); + err(EXIT_FAILURE, "Unable to open configuration " + "file %s", confpath); /* no configuration present */ goto finalize; } @@ -561,11 +562,13 @@ config_init(void) if (node != NULL) { if (node->type != YAML_MAPPING_NODE) - warnx("Invalid configuration format, ignoring the configuration file"); + warnx("Invalid configuration format, ignoring the " + "configuration file"); else config_parse(&doc, node); } else { - warnx("Invalid configuration format, ignoring the configuration file"); + warnx("Invalid configuration format, ignoring the " + "configuration file"); } yaml_document_delete(&doc); @@ -574,7 +577,8 @@ config_init(void) finalize: if (c[ABI].val == NULL && c[ABI].value == NULL) { if (pkg_get_myabi(abi, BUFSIZ) != 0) - errx(EXIT_FAILURE, "Failed to determine the system ABI"); + errx(EXIT_FAILURE, "Failed to determine the system " + "ABI"); c[ABI].val = abi; } Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Sat Oct 26 01:17:54 2013 (r257141) +++ head/usr.sbin/pkg/pkg.c Sat Oct 26 03:21:08 2013 (r257142) @@ -267,8 +267,10 @@ bootstrap_pkg(void) fetchfail: warnx("Error fetching %s: %s", url, fetchLastErrString); - fprintf(stderr, "A pre-built version of pkg could not be found for your system.\n"); - fprintf(stderr, "Consider changing PACKAGESITE or installing it from ports: 'ports-mgmt/pkg'.\n"); + fprintf(stderr, "A pre-built version of pkg could not be found for " + "your system.\n"); + fprintf(stderr, "Consider changing PACKAGESITE or installing it from " + "ports: 'ports-mgmt/pkg'.\n"); cleanup: if (remote != NULL) From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 03:21:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 433F1AE6; Sat, 26 Oct 2013 03:21:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 195D72397; Sat, 26 Oct 2013 03:21:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9Q3Lsf4074540; Sat, 26 Oct 2013 03:21:54 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9Q3LsSB074539; Sat, 26 Oct 2013 03:21:54 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310260321.r9Q3LsSB074539@svn.freebsd.org> From: Mark Johnston Date: Sat, 26 Oct 2013 03:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257143 - head/sys/cddl/contrib/opensolaris/uts/intel/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 03:21:55 -0000 Author: markj Date: Sat Oct 26 03:21:54 2013 New Revision: 257143 URL: http://svnweb.freebsd.org/changeset/base/257143 Log: Fix a couple of bugs in the fasttrap emulation of a "push %rbp" instruction: the code was trying to save the stack pointer rather than the frame pointer, and the arguments to copyout(9) were reversed, so nothing ended up being saved on the stack. This would cause process crashes when the pid provider was being used to instrument calls of a function starting with this instruction. Reported by: symbolics@gmx.com Tested by: symbolics@gmx.com (earlier version) MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sat Oct 26 03:21:08 2013 (r257142) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sat Oct 26 03:21:54 2013 (r257143) @@ -104,6 +104,7 @@ uwrite(proc_t *p, void *kaddr, size_t le #define r_rip r_eip #define r_rflags r_eflags #define r_rsp r_esp +#define r_rbp r_ebp #endif /* @@ -1394,29 +1395,27 @@ fasttrap_pid_probe(struct reg *rp) case FASTTRAP_T_PUSHL_EBP: { int ret = 0; - uintptr_t addr = 0; #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { - addr = rp->r_rsp - sizeof (uintptr_t); - ret = fasttrap_sulword((void *)addr, &rp->r_rsp); + rp->r_rsp -= sizeof (uintptr_t); + ret = fasttrap_sulword(&rp->r_rbp, (void *)rp->r_rsp); } else { #endif #ifdef __i386__ - addr = rp->r_rsp - sizeof (uint32_t); - ret = fasttrap_suword32((void *)addr, &rp->r_rsp); + rp->r_rsp -= sizeof (uint32_t); + ret = fasttrap_suword32(&rp->r_rbp, (void *)rp->r_rsp); #endif #ifdef __amd64 } #endif if (ret == -1) { - fasttrap_sigsegv(p, curthread, addr); + fasttrap_sigsegv(p, curthread, rp->r_rsp); new_pc = pc; break; } - rp->r_rsp = addr; new_pc = pc + tp->ftt_size; break; } From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 03:22:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 90D24C30; Sat, 26 Oct 2013 03:22:58 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7EDDB23A4; Sat, 26 Oct 2013 03:22:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9Q3MwBW074769; Sat, 26 Oct 2013 03:22:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9Q3Mw3f074768; Sat, 26 Oct 2013 03:22:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310260322.r9Q3Mw3f074768@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 26 Oct 2013 03:22:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257144 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 03:22:58 -0000 Author: nwhitehorn Date: Sat Oct 26 03:22:57 2013 New Revision: 257144 URL: http://svnweb.freebsd.org/changeset/base/257144 Log: Fix build after r257111 by including headers with definition of pmap_kextract(). Modified: head/sys/dev/uart/uart_cpu_fdt.c Modified: head/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- head/sys/dev/uart/uart_cpu_fdt.c Sat Oct 26 03:21:54 2013 (r257143) +++ head/sys/dev/uart/uart_cpu_fdt.c Sat Oct 26 03:22:57 2013 (r257144) @@ -35,6 +35,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include + #include #include From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 03:31:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 916BFDD4; Sat, 26 Oct 2013 03:31:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7EC6123F7; Sat, 26 Oct 2013 03:31:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9Q3V69l077781; Sat, 26 Oct 2013 03:31:06 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9Q3V5NQ077773; Sat, 26 Oct 2013 03:31:05 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310260331.r9Q3V5NQ077773@svn.freebsd.org> From: Bryan Drewery Date: Sat, 26 Oct 2013 03:31:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257145 - in head: etc etc/pkg usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 03:31:06 -0000 Author: bdrewery (ports committer) Date: Sat Oct 26 03:31:05 2013 New Revision: 257145 URL: http://svnweb.freebsd.org/changeset/base/257145 Log: Add support for reading configuration files from /etc/pkg. For now only /etc/pkg/FreeBSD.conf is supported. Its style is: Repo: { URL: "...", MIRROR_TYPE: "...", ... } The configuration will be read from /usr/local/etc/pkg.conf if exists, otherwise /etc/pkg/FreeBSD.conf Approved by: bapt MFC after: 2 days Added: head/etc/pkg/ head/etc/pkg/FreeBSD.conf (contents, props changed) head/etc/pkg/Makefile (contents, props changed) Modified: head/etc/Makefile head/usr.sbin/pkg/config.c head/usr.sbin/pkg/config.h Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sat Oct 26 03:22:57 2013 (r257144) +++ head/etc/Makefile Sat Oct 26 03:31:05 2013 (r257145) @@ -225,6 +225,9 @@ distribution: ${_+_}cd ${.CURDIR}/devd; ${MAKE} install ${_+_}cd ${.CURDIR}/gss; ${MAKE} install ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install +.if ${MK_PKGBOOTSTRAP} != "no" + ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install +.endif ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install ${_+_}cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap Added: head/etc/pkg/FreeBSD.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/pkg/FreeBSD.conf Sat Oct 26 03:31:05 2013 (r257145) @@ -0,0 +1,6 @@ +# $FreeBSD$ +FreeBSD: { + url: "pkg+http://pkg.freebsd.org/${ABI}/latest", + mirror_type: "srv", + enabled: "yes" +} Added: head/etc/pkg/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/pkg/Makefile Sat Oct 26 03:31:05 2013 (r257145) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +NO_OBJ= + +FILES= FreeBSD.conf + +FILESDIR= /etc/pkg +FILESMODE= 644 + +.include Modified: head/usr.sbin/pkg/config.c ============================================================================== --- head/usr.sbin/pkg/config.c Sat Oct 26 03:22:57 2013 (r257144) +++ head/usr.sbin/pkg/config.c Sat Oct 26 03:31:05 2013 (r257145) @@ -460,7 +460,7 @@ subst_packagesite(const char *abi) } static void -config_parse(yaml_document_t *doc, yaml_node_t *node) +config_parse(yaml_document_t *doc, yaml_node_t *node, pkg_conf_file_t conftype) { yaml_node_pair_t *pair; yaml_node_t *key, *val; @@ -495,15 +495,33 @@ config_parse(yaml_document_t *doc, yaml_ } sbuf_clear(buf); - for (j = 0; j < strlen(key->data.scalar.value); ++j) - sbuf_putc(buf, toupper(key->data.scalar.value[j])); - sbuf_finish(buf); + if (conftype == CONFFILE_PKG) { + for (j = 0; j < strlen(key->data.scalar.value); ++j) + sbuf_putc(buf, + toupper(key->data.scalar.value[j])); + sbuf_finish(buf); + } else if (conftype == CONFFILE_REPO) { + /* The CONFFILE_REPO type is more restrictive. Only + parse known elements. */ + if (strcasecmp(key->data.scalar.value, "url") == 0) + sbuf_cpy(buf, "PACKAGESITE"); + else if (strcasecmp(key->data.scalar.value, + "mirror_type") == 0) + sbuf_cpy(buf, "MIRROR_TYPE"); + else { /* Skip unknown entries for future use. */ + ++pair; + continue; + } + sbuf_finish(buf); + } + for (i = 0; i < CONFIG_SIZE; i++) { if (strcmp(sbuf_data(buf), c[i].key) == 0) break; } + /* Silently skip unknown keys to be future compatible. */ if (i == CONFIG_SIZE) { ++pair; continue; @@ -522,36 +540,53 @@ config_parse(yaml_document_t *doc, yaml_ sbuf_delete(buf); } -int -config_init(void) +/*- + * Parse new repo style configs in style: + * Name: + * URL: + * MIRROR_TYPE: + * etc... + */ +static void +parse_repo_file(yaml_document_t *doc, yaml_node_t *node) { - FILE *fp; - yaml_parser_t parser; - yaml_document_t doc; - yaml_node_t *node; - const char *val; - int i; - const char *localbase; - char confpath[MAXPATHLEN]; - char abi[BUFSIZ]; + yaml_node_pair_t *pair; - for (i = 0; i < CONFIG_SIZE; i++) { - val = getenv(c[i].key); - if (val != NULL) { - c[i].val = val; - c[i].envset = true; + pair = node->data.mapping.pairs.start; + while (pair < node->data.mapping.pairs.top) { + yaml_node_t *key = yaml_document_get_node(doc, pair->key); + yaml_node_t *val = yaml_document_get_node(doc, pair->value); + + if (key->data.scalar.length <= 0) { + ++pair; + continue; } + + if (val->type != YAML_MAPPING_NODE) { + ++pair; + continue; + } + + config_parse(doc, val, CONFFILE_REPO); + ++pair; } +} - localbase = getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE; - snprintf(confpath, sizeof(confpath), "%s/etc/pkg.conf", localbase); + +static int +read_conf_file(const char *confpath, pkg_conf_file_t conftype) +{ + FILE *fp; + yaml_parser_t parser; + yaml_document_t doc; + yaml_node_t *node; if ((fp = fopen(confpath, "r")) == NULL) { if (errno != ENOENT) err(EXIT_FAILURE, "Unable to open configuration " "file %s", confpath); /* no configuration present */ - goto finalize; + return (1); } yaml_parser_initialize(&parser); @@ -560,20 +595,52 @@ config_init(void) node = yaml_document_get_root_node(&doc); - if (node != NULL) { - if (node->type != YAML_MAPPING_NODE) - warnx("Invalid configuration format, ignoring the " - "configuration file"); - else - config_parse(&doc, node); - } else { + if (node == NULL || node->type != YAML_MAPPING_NODE) warnx("Invalid configuration format, ignoring the " - "configuration file"); + "configuration file %s", confpath); + else { + if (conftype == CONFFILE_PKG) + config_parse(&doc, node, conftype); + else if (conftype == CONFFILE_REPO) + parse_repo_file(&doc, node); } yaml_document_delete(&doc); yaml_parser_delete(&parser); + return (0); +} + +int +config_init(void) +{ + const char *val; + int i; + const char *localbase; + char confpath[MAXPATHLEN]; + char abi[BUFSIZ]; + + for (i = 0; i < CONFIG_SIZE; i++) { + val = getenv(c[i].key); + if (val != NULL) { + c[i].val = val; + c[i].envset = true; + } + } + + localbase = getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE; + snprintf(confpath, sizeof(confpath), "%s/etc/pkg.conf", + localbase); + + if (access(confpath, F_OK) == 0 && read_conf_file(confpath, + CONFFILE_PKG)) + goto finalize; + + snprintf(confpath, sizeof(confpath), "/etc/pkg/FreeBSD.conf"); + if (access(confpath, F_OK) == 0 && read_conf_file(confpath, + CONFFILE_REPO)) + goto finalize; + finalize: if (c[ABI].val == NULL && c[ABI].value == NULL) { if (pkg_get_myabi(abi, BUFSIZ) != 0) Modified: head/usr.sbin/pkg/config.h ============================================================================== --- head/usr.sbin/pkg/config.h Sat Oct 26 03:22:57 2013 (r257144) +++ head/usr.sbin/pkg/config.h Sat Oct 26 03:31:05 2013 (r257145) @@ -45,6 +45,11 @@ typedef enum { PKG_CONFIG_BOOL, } pkg_config_t; +typedef enum { + CONFFILE_PKG=0, + CONFFILE_REPO, +} pkg_conf_file_t; + int config_init(void); void config_finish(void); int config_string(pkg_config_key, const char **); From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 03:32:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EC9C8F11; Sat, 26 Oct 2013 03:32:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DA4D52403; Sat, 26 Oct 2013 03:32:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9Q3W6jV077923; Sat, 26 Oct 2013 03:32:06 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9Q3W66R077922; Sat, 26 Oct 2013 03:32:06 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310260332.r9Q3W66R077922@svn.freebsd.org> From: Bryan Drewery Date: Sat, 26 Oct 2013 03:32:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257146 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 03:32:07 -0000 Author: bdrewery (ports committer) Date: Sat Oct 26 03:32:06 2013 New Revision: 257146 URL: http://svnweb.freebsd.org/changeset/base/257146 Log: Be verbose and tell where pkg(8) is being bootstrapped from. Approved by: bapt MFC after: 2 days Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Sat Oct 26 03:31:05 2013 (r257145) +++ head/usr.sbin/pkg/pkg.c Sat Oct 26 03:32:06 2013 (r257146) @@ -158,7 +158,6 @@ bootstrap_pkg(void) config = NULL; current = mirrors = NULL; - printf("Bootstrapping pkg, please wait...\n"); if (config_string(PACKAGESITE, &packagesite) != 0) { warnx("No PACKAGESITE defined"); @@ -169,6 +168,8 @@ bootstrap_pkg(void) return (-1); } + printf("Bootstrapping pkg from %s, please wait...\n", packagesite); + /* Support pkg+http:// for PACKAGESITE which is the new format in 1.2 to avoid confusion on why http://pkg.FreeBSD.org has no A record. */ From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 03:43:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 868CB18F; Sat, 26 Oct 2013 03:43:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6D5B12457; Sat, 26 Oct 2013 03:43:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9Q3h3Et081220; Sat, 26 Oct 2013 03:43:03 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9Q3h2DX081214; Sat, 26 Oct 2013 03:43:02 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310260343.r9Q3h2DX081214@svn.freebsd.org> From: Bryan Drewery Date: Sat, 26 Oct 2013 03:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257147 - in head: etc/pkg usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 03:43:03 -0000 Author: bdrewery (ports committer) Date: Sat Oct 26 03:43:02 2013 New Revision: 257147 URL: http://svnweb.freebsd.org/changeset/base/257147 Log: Support checking signature for pkg bootstrap. If the pkg.conf is configured with SIGNATURE_TYPE: FINGERPRINTS, and FINGERPRINTS: /etc/keys/pkg then a pkg.sig file is fetched along with pkg.txz. The signature contains the signature provided by the signing server, and the public key. The .sig is the exact output from the signing server in the following format: SIGNATURE CERT END The signature is verified with the following logic: - If the .sig file is missing, it fails. - If the .sig doesn't validate, it fails. - If the public key in the .sig is not in the known trusted fingerprints, it fails. - If the public key is in the revoked key list, it fails. Approved by: bapt MFC after: 2 days Discussed by: bapt with des, jonathan, gavin Modified: head/etc/pkg/FreeBSD.conf head/usr.sbin/pkg/Makefile head/usr.sbin/pkg/config.c head/usr.sbin/pkg/config.h head/usr.sbin/pkg/pkg.c Modified: head/etc/pkg/FreeBSD.conf ============================================================================== --- head/etc/pkg/FreeBSD.conf Sat Oct 26 03:32:06 2013 (r257146) +++ head/etc/pkg/FreeBSD.conf Sat Oct 26 03:43:02 2013 (r257147) @@ -2,5 +2,7 @@ FreeBSD: { url: "pkg+http://pkg.freebsd.org/${ABI}/latest", mirror_type: "srv", + signature_type: "fingerprints", + fingerprints: "/etc/keys/pkg", enabled: "yes" } Modified: head/usr.sbin/pkg/Makefile ============================================================================== --- head/usr.sbin/pkg/Makefile Sat Oct 26 03:32:06 2013 (r257146) +++ head/usr.sbin/pkg/Makefile Sat Oct 26 03:43:02 2013 (r257147) @@ -7,7 +7,7 @@ NO_MAN= yes CFLAGS+=-I${.CURDIR}/../../contrib/libyaml/include .PATH: ${.CURDIR}/../../contrib/libyaml/include DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBYAML} ${LIBSBUF} -LDADD= -larchive -lelf -lfetch -lyaml -lsbuf +LDADD= -larchive -lelf -lfetch -lyaml -lsbuf -lssl USEPRIVATELIB= yaml .include Modified: head/usr.sbin/pkg/config.c ============================================================================== --- head/usr.sbin/pkg/config.c Sat Oct 26 03:32:06 2013 (r257146) +++ head/usr.sbin/pkg/config.c Sat Oct 26 03:43:02 2013 (r257147) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2013 Baptiste Daroussin + * Copyright (c) 2013 Bryan Drewery * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -86,7 +87,21 @@ static struct config_entry c[] = { "NO", NULL, false, - } + }, + [SIGNATURE_TYPE] = { + PKG_CONFIG_STRING, + "SIGNATURE_TYPE", + NULL, + NULL, + false, + }, + [FINGERPRINTS] = { + PKG_CONFIG_STRING, + "FINGERPRINTS", + NULL, + NULL, + false, + }, }; static const char * @@ -509,6 +524,12 @@ config_parse(yaml_document_t *doc, yaml_ else if (strcasecmp(key->data.scalar.value, "mirror_type") == 0) sbuf_cpy(buf, "MIRROR_TYPE"); + else if (strcasecmp(key->data.scalar.value, + "signature_type") == 0) + sbuf_cpy(buf, "SIGNATURE_TYPE"); + else if (strcasecmp(key->data.scalar.value, + "fingerprints") == 0) + sbuf_cpy(buf, "FINGERPRINTS"); else { /* Skip unknown entries for future use. */ ++pair; continue; Modified: head/usr.sbin/pkg/config.h ============================================================================== --- head/usr.sbin/pkg/config.h Sat Oct 26 03:32:06 2013 (r257146) +++ head/usr.sbin/pkg/config.h Sat Oct 26 03:43:02 2013 (r257147) @@ -37,6 +37,8 @@ typedef enum { ABI, MIRROR_TYPE, ASSUME_ALWAYS_YES, + SIGNATURE_TYPE, + FINGERPRINTS, CONFIG_SIZE } pkg_config_key; Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Sat Oct 26 03:32:06 2013 (r257146) +++ head/usr.sbin/pkg/pkg.c Sat Oct 26 03:43:02 2013 (r257147) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2012-2013 Baptiste Daroussin + * Copyright (c) 2013 Bryan Drewery * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,10 +29,15 @@ __FBSDID("$FreeBSD$"); #include +#include +#include +#include #include +#define _WITH_GETLINE #include #include +#include #include #include #include @@ -43,10 +49,35 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +#include +#include #include "dns_utils.h" #include "config.h" +struct sig_cert { + unsigned char *sig; + int siglen; + unsigned char *cert; + int certlen; + bool trusted; +}; + +typedef enum { + HASH_UNKNOWN, + HASH_SHA256, +} hash_t; + +struct fingerprint { + hash_t type; + char hash[BUFSIZ]; + STAILQ_ENTRY(fingerprint) next; +}; + +STAILQ_HEAD(fingerprint_list, fingerprint); + static int extract_pkg_static(int fd, char *p, int sz) { @@ -129,59 +160,34 @@ install_pkg_static(char *path, char *pkg } static int -bootstrap_pkg(void) +fetch_to_fd(const char *url, char *path) { struct url *u; - FILE *remote; - FILE *config; - char *site; struct dns_srvinfo *mirrors, *current; - /* To store _https._tcp. + hostname + \0 */ - char zone[MAXHOSTNAMELEN + 13]; - char url[MAXPATHLEN]; - char conf[MAXPATHLEN]; - char tmppkg[MAXPATHLEN]; - const char *packagesite, *mirror_type; - char buf[10240]; - char pkgstatic[MAXPATHLEN]; - int fd, retry, ret, max_retry; struct url_stat st; + FILE *remote; + /* To store _https._tcp. + hostname + \0 */ + int fd; + int retry, max_retry; off_t done, r; - time_t now; - time_t last; + time_t now, last; + char buf[10240]; + char zone[MAXHOSTNAMELEN + 13]; + static const char *mirror_type = NULL; done = 0; last = 0; max_retry = 3; - ret = -1; - remote = NULL; - config = NULL; current = mirrors = NULL; + remote = NULL; - - if (config_string(PACKAGESITE, &packagesite) != 0) { - warnx("No PACKAGESITE defined"); - return (-1); - } - if (config_string(MIRROR_TYPE, &mirror_type) != 0) { + if (mirror_type == NULL && config_string(MIRROR_TYPE, &mirror_type) + != 0) { warnx("No MIRROR_TYPE defined"); return (-1); } - printf("Bootstrapping pkg from %s, please wait...\n", packagesite); - - /* Support pkg+http:// for PACKAGESITE which is the new format - in 1.2 to avoid confusion on why http://pkg.FreeBSD.org has - no A record. */ - if (strncmp(URL_SCHEME_PREFIX, packagesite, - strlen(URL_SCHEME_PREFIX)) == 0) - packagesite += strlen(URL_SCHEME_PREFIX); - snprintf(url, MAXPATHLEN, "%s/Latest/pkg.txz", packagesite); - - snprintf(tmppkg, MAXPATHLEN, "%s/pkg.txz.XXXXXX", - getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP); - - if ((fd = mkstemp(tmppkg)) == -1) { + if ((fd = mkstemp(path)) == -1) { warn("mkstemp()"); return (-1); } @@ -229,7 +235,7 @@ bootstrap_pkg(void) if (write(fd, buf, r) != r) { warn("write()"); - goto cleanup; + goto fetchfail; } done += r; @@ -241,7 +247,544 @@ bootstrap_pkg(void) if (ferror(remote)) goto fetchfail; - if ((ret = extract_pkg_static(fd, pkgstatic, MAXPATHLEN)) == 0) + goto cleanup; + +fetchfail: + if (fd != -1) { + close(fd); + fd = -1; + unlink(path); + } + +cleanup: + if (remote != NULL) + fclose(remote); + + return fd; +} + +static struct fingerprint * +parse_fingerprint(yaml_document_t *doc, yaml_node_t *node) +{ + yaml_node_pair_t *pair; + yaml_char_t *function, *fp; + struct fingerprint *f; + hash_t fct = HASH_UNKNOWN; + + function = fp = NULL; + + pair = node->data.mapping.pairs.start; + while (pair < node->data.mapping.pairs.top) { + yaml_node_t *key = yaml_document_get_node(doc, pair->key); + yaml_node_t *val = yaml_document_get_node(doc, pair->value); + + if (key->data.scalar.length <= 0) { + ++pair; + continue; + } + + if (val->type != YAML_SCALAR_NODE) { + ++pair; + continue; + } + + if (strcasecmp(key->data.scalar.value, "function") == 0) + function = val->data.scalar.value; + else if (strcasecmp(key->data.scalar.value, "fingerprint") + == 0) + fp = val->data.scalar.value; + + ++pair; + continue; + } + + if (fp == NULL || function == NULL) + return (NULL); + + if (strcasecmp(function, "sha256") == 0) + fct = HASH_SHA256; + + if (fct == HASH_UNKNOWN) { + fprintf(stderr, "Unsupported hashing function: %s\n", function); + return (NULL); + } + + f = calloc(1, sizeof(struct fingerprint)); + f->type = fct; + strlcpy(f->hash, fp, sizeof(f->hash)); + + return (f); +} + +static struct fingerprint * +load_fingerprint(const char *dir, const char *filename) +{ + yaml_parser_t parser; + yaml_document_t doc; + yaml_node_t *node; + FILE *fp; + struct fingerprint *f; + char path[MAXPATHLEN]; + + f = NULL; + + snprintf(path, MAXPATHLEN, "%s/%s", dir, filename); + + if ((fp = fopen(path, "r")) == NULL) + return (NULL); + + yaml_parser_initialize(&parser); + yaml_parser_set_input_file(&parser, fp); + yaml_parser_load(&parser, &doc); + + node = yaml_document_get_root_node(&doc); + if (node == NULL || node->type != YAML_MAPPING_NODE) + goto out; + + f = parse_fingerprint(&doc, node); + +out: + yaml_document_delete(&doc); + yaml_parser_delete(&parser); + fclose(fp); + + return (f); +} + +static struct fingerprint_list * +load_fingerprints(const char *path, int *count) +{ + DIR *d; + struct dirent *ent; + struct fingerprint *finger; + struct fingerprint_list *fingerprints; + + *count = 0; + + fingerprints = calloc(1, sizeof(struct fingerprint_list)); + if (fingerprints == NULL) + return (NULL); + STAILQ_INIT(fingerprints); + + if ((d = opendir(path)) == NULL) + return (NULL); + + while ((ent = readdir(d))) { + if (strcmp(ent->d_name, ".") == 0 || + strcmp(ent->d_name, "..") == 0) + continue; + finger = load_fingerprint(path, ent->d_name); + if (finger != NULL) { + STAILQ_INSERT_TAIL(fingerprints, finger, next); + ++(*count); + } + } + + closedir(d); + + return (fingerprints); +} + +static void +sha256_hash(unsigned char hash[SHA256_DIGEST_LENGTH], + char out[SHA256_DIGEST_LENGTH * 2 + 1]) +{ + int i; + + for (i = 0; i < SHA256_DIGEST_LENGTH; i++) + sprintf(out + (i * 2), "%02x", hash[i]); + + out[SHA256_DIGEST_LENGTH * 2] = '\0'; +} + +static void +sha256_buf(char *buf, size_t len, char out[SHA256_DIGEST_LENGTH * 2 + 1]) +{ + unsigned char hash[SHA256_DIGEST_LENGTH]; + SHA256_CTX sha256; + + out[0] = '\0'; + + SHA256_Init(&sha256); + SHA256_Update(&sha256, buf, len); + SHA256_Final(hash, &sha256); + sha256_hash(hash, out); +} + +static int +sha256_fd(int fd, char out[SHA256_DIGEST_LENGTH * 2 + 1]) +{ + int my_fd; + FILE *fp; + char buffer[BUFSIZ]; + unsigned char hash[SHA256_DIGEST_LENGTH]; + size_t r; + int ret; + SHA256_CTX sha256; + + my_fd = -1; + fp = NULL; + r = 0; + ret = 1; + + out[0] = '\0'; + + /* Duplicate the fd so that fclose(3) does not close it. */ + if ((my_fd = dup(fd)) == -1) { + warnx("dup"); + goto cleanup; + } + + if ((fp = fdopen(my_fd, "rb")) == NULL) { + warnx("fdopen"); + goto cleanup; + } + + SHA256_Init(&sha256); + + while ((r = fread(buffer, 1, BUFSIZ, fp)) > 0) + SHA256_Update(&sha256, buffer, r); + + if (ferror(fp) != 0) { + warnx("fread"); + goto cleanup; + } + + SHA256_Final(hash, &sha256); + sha256_hash(hash, out); + ret = 0; + +cleanup: + if (fp != NULL) + fclose(fp); + else if (my_fd != -1) + close(my_fd); + (void)lseek(fd, 0, SEEK_SET); + + return (ret); +} + +static EVP_PKEY * +load_public_key_buf(const unsigned char *cert, int certlen) +{ + EVP_PKEY *pkey; + BIO *bp; + char errbuf[1024]; + + bp = BIO_new_mem_buf((void *)cert, certlen); + + if ((pkey = PEM_read_bio_PUBKEY(bp, NULL, NULL, NULL)) == NULL) + warnx("%s", ERR_error_string(ERR_get_error(), errbuf)); + + BIO_free(bp); + + return (pkey); +} + +static bool +rsa_verify_cert(int fd, const unsigned char *key, int keylen, + unsigned char *sig, int siglen) +{ + EVP_MD_CTX *mdctx; + EVP_PKEY *pkey; + char sha256[(SHA256_DIGEST_LENGTH * 2) + 2]; + char errbuf[1024]; + bool ret; + + pkey = NULL; + mdctx = NULL; + ret = false; + + /* Compute SHA256 of the package. */ + if (lseek(fd, 0, 0) == -1) { + warn("lseek"); + goto cleanup; + } + if ((sha256_fd(fd, sha256)) == -1) { + warnx("Error creating SHA256 hash for package"); + goto cleanup; + } + + if ((pkey = load_public_key_buf(key, keylen)) == NULL) { + warnx("Error reading public key"); + goto cleanup; + } + + /* Verify signature of the SHA256(pkg) is valid. */ + printf("Verifying signature... "); + if ((mdctx = EVP_MD_CTX_create()) == NULL) { + warnx("%s", ERR_error_string(ERR_get_error(), errbuf)); + goto error; + } + + if (EVP_DigestVerifyInit(mdctx, NULL, EVP_sha256(), NULL, pkey) != 1) { + warnx("%s", ERR_error_string(ERR_get_error(), errbuf)); + goto error; + } + if (EVP_DigestVerifyUpdate(mdctx, sha256, strlen(sha256)) != 1) { + warnx("%s", ERR_error_string(ERR_get_error(), errbuf)); + goto error; + } + + if (EVP_DigestVerifyFinal(mdctx, sig, siglen) != 1) { + warnx("%s", ERR_error_string(ERR_get_error(), errbuf)); + goto error; + } + + ret = true; + printf("done\n"); + goto cleanup; + +error: + printf("failed\n"); + +cleanup: + if (pkey) + EVP_PKEY_free(pkey); + if (mdctx) + EVP_MD_CTX_destroy(mdctx); + ERR_free_strings(); + + return (ret); +} + +static struct sig_cert * +parse_cert(int fd) { + int my_fd; + struct sig_cert *sc; + FILE *fp; + struct sbuf *buf, *sig, *cert; + char *line; + size_t linecap; + ssize_t linelen; + + my_fd = -1; + sc = NULL; + line = NULL; + linecap = 0; + + if (lseek(fd, 0, 0) == -1) { + warn("lseek"); + return (NULL); + } + + /* Duplicate the fd so that fclose(3) does not close it. */ + if ((my_fd = dup(fd)) == -1) { + warnx("dup"); + return (NULL); + } + + if ((fp = fdopen(my_fd, "rb")) == NULL) { + warn("fdopen"); + close(my_fd); + return (NULL); + } + + sig = sbuf_new_auto(); + cert = sbuf_new_auto(); + + while ((linelen = getline(&line, &linecap, fp)) > 0) { + if (strcmp(line, "SIGNATURE\n") == 0) { + buf = sig; + continue; + } else if (strcmp(line, "CERT\n") == 0) { + buf = cert; + continue; + } else if (strcmp(line, "END\n") == 0) { + break; + } + if (buf != NULL) + sbuf_bcat(buf, line, linelen); + } + + fclose(fp); + + /* Trim out unrelated trailing newline */ + sbuf_setpos(sig, sbuf_len(sig) - 1); + + sbuf_finish(sig); + sbuf_finish(cert); + + sc = calloc(1, sizeof(struct sig_cert)); + sc->siglen = sbuf_len(sig); + sc->sig = calloc(1, sc->siglen); + memcpy(sc->sig, sbuf_data(sig), sc->siglen); + + sc->certlen = sbuf_len(cert); + sc->cert = strdup(sbuf_data(cert)); + + sbuf_delete(sig); + sbuf_delete(cert); + + return (sc); +} + +static bool +verify_signature(int fd_pkg, int fd_sig) +{ + struct fingerprint_list *trusted, *revoked; + struct fingerprint *fingerprint; + struct sig_cert *sc; + bool ret; + int trusted_count, revoked_count; + const char *fingerprints; + char path[MAXPATHLEN]; + char hash[SHA256_DIGEST_LENGTH * 2 + 1]; + + trusted = revoked = NULL; + ret = false; + + /* Read and parse fingerprints. */ + if (config_string(FINGERPRINTS, &fingerprints) != 0) { + warnx("No CONFIG_FINGERPRINTS defined"); + goto cleanup; + } + + snprintf(path, MAXPATHLEN, "%s/trusted", fingerprints); + if ((trusted = load_fingerprints(path, &trusted_count)) == NULL) { + warnx("Error loading trusted certificates"); + goto cleanup; + } + + if (trusted_count == 0 || trusted == NULL) { + fprintf(stderr, "No trusted certificates found.\n"); + goto cleanup; + } + + snprintf(path, MAXPATHLEN, "%s/revoked", fingerprints); + if ((revoked = load_fingerprints(path, &revoked_count)) == NULL) { + warnx("Error loading revoked certificates"); + goto cleanup; + } + + /* Read certificate and signature in. */ + if ((sc = parse_cert(fd_sig)) == NULL) { + warnx("Error parsing certificate"); + goto cleanup; + } + /* Explicitly mark as non-trusted until proven otherwise. */ + sc->trusted = false; + + /* Parse signature and pubkey out of the certificate */ + sha256_buf(sc->cert, sc->certlen, hash); + + /* Check if this hash is revoked */ + if (revoked != NULL) { + STAILQ_FOREACH(fingerprint, revoked, next) { + if (strcasecmp(fingerprint->hash, hash) == 0) { + fprintf(stderr, "The certificate has been " + "revoked\n"); + goto cleanup; + } + } + } + + STAILQ_FOREACH(fingerprint, trusted, next) { + if (strcasecmp(fingerprint->hash, hash) == 0) { + sc->trusted = true; + break; + } + } + + if (sc->trusted == false) { + fprintf(stderr, "No trusted certificate found matching " + "package's certificate\n"); + goto cleanup; + } + + /* Verify the signature. */ + if (rsa_verify_cert(fd_pkg, sc->cert, sc->certlen, sc->sig, + sc->siglen) == false) { + fprintf(stderr, "Signature is not valid\n"); + goto cleanup; + } + + ret = true; + +cleanup: + if (trusted) { + STAILQ_FOREACH(fingerprint, trusted, next) + free(fingerprint); + free(trusted); + } + if (revoked) { + STAILQ_FOREACH(fingerprint, revoked, next) + free(fingerprint); + free(revoked); + } + if (sc) { + if (sc->cert) + free(sc->cert); + if (sc->sig) + free(sc->sig); + free(sc); + } + + return (ret); +} + +static int +bootstrap_pkg(void) +{ + FILE *config; + int fd_pkg, fd_sig; + int ret; + char *site; + char url[MAXPATHLEN]; + char conf[MAXPATHLEN]; + char tmppkg[MAXPATHLEN]; + char tmpsig[MAXPATHLEN]; + const char *packagesite; + const char *signature_type; + char pkgstatic[MAXPATHLEN]; + + fd_sig = -1; + ret = -1; + config = NULL; + + if (config_string(PACKAGESITE, &packagesite) != 0) { + warnx("No PACKAGESITE defined"); + return (-1); + } + + if (config_string(SIGNATURE_TYPE, &signature_type) != 0) { + warnx("Error looking up SIGNATURE_TYPE"); + return (-1); + } + + printf("Bootstrapping pkg from %s, please wait...\n", packagesite); + + /* Support pkg+http:// for PACKAGESITE which is the new format + in 1.2 to avoid confusion on why http://pkg.FreeBSD.org has + no A record. */ + if (strncmp(URL_SCHEME_PREFIX, packagesite, + strlen(URL_SCHEME_PREFIX)) == 0) + packagesite += strlen(URL_SCHEME_PREFIX); + snprintf(url, MAXPATHLEN, "%s/Latest/pkg.txz", packagesite); + + snprintf(tmppkg, MAXPATHLEN, "%s/pkg.txz.XXXXXX", + getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP); + + if ((fd_pkg = fetch_to_fd(url, tmppkg)) == -1) + goto fetchfail; + + if (signature_type != NULL && + strcasecmp(signature_type, "FINGERPRINTS") == 0) { + snprintf(tmpsig, MAXPATHLEN, "%s/pkg.txz.sig.XXXXXX", + getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP); + snprintf(url, MAXPATHLEN, "%s/Latest/pkg.txz.sig", + packagesite); + + if ((fd_sig = fetch_to_fd(url, tmpsig)) == -1) { + fprintf(stderr, "Signature for pkg not available.\n"); + goto fetchfail; + } + + if (verify_signature(fd_pkg, fd_sig) == false) + goto cleanup; + } + + if ((ret = extract_pkg_static(fd_pkg, pkgstatic, MAXPATHLEN)) == 0) ret = install_pkg_static(pkgstatic, tmppkg); snprintf(conf, MAXPATHLEN, "%s/etc/pkg.conf", @@ -274,9 +817,11 @@ fetchfail: "ports: 'ports-mgmt/pkg'.\n"); cleanup: - if (remote != NULL) - fclose(remote); - close(fd); + if (fd_sig != -1) { + close(fd_sig); + unlink(tmpsig); + } + close(fd_pkg); unlink(tmppkg); return (ret); From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 03:44:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BEBDF3B8; Sat, 26 Oct 2013 03:44:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AC38A2466; Sat, 26 Oct 2013 03:44:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9Q3i8cM081486; Sat, 26 Oct 2013 03:44:08 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9Q3i8cl081485; Sat, 26 Oct 2013 03:44:08 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310260344.r9Q3i8cl081485@svn.freebsd.org> From: Bryan Drewery Date: Sat, 26 Oct 2013 03:44:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257148 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 03:44:08 -0000 Author: bdrewery (ports committer) Date: Sat Oct 26 03:44:08 2013 New Revision: 257148 URL: http://svnweb.freebsd.org/changeset/base/257148 Log: Tell which fingerprint pkg is being validated against. Approved by: bapt MFC after: 2 days Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Sat Oct 26 03:43:02 2013 (r257147) +++ head/usr.sbin/pkg/pkg.c Sat Oct 26 03:44:08 2013 (r257148) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include "config.h" struct sig_cert { + char *name; unsigned char *sig; int siglen; unsigned char *cert; @@ -72,6 +73,7 @@ typedef enum { struct fingerprint { hash_t type; + char *name; char hash[BUFSIZ]; STAILQ_ENTRY(fingerprint) next; }; @@ -316,6 +318,19 @@ parse_fingerprint(yaml_document_t *doc, return (f); } +static void +free_fingerprint_list(struct fingerprint_list* list) +{ + struct fingerprint* fingerprint; + + STAILQ_FOREACH(fingerprint, list, next) { + if (fingerprint->name) + free(fingerprint->name); + free(fingerprint); + } + free(list); +} + static struct fingerprint * load_fingerprint(const char *dir, const char *filename) { @@ -342,6 +357,7 @@ load_fingerprint(const char *dir, const goto out; f = parse_fingerprint(&doc, node); + f->name = strdup(filename); out: yaml_document_delete(&doc); @@ -511,7 +527,6 @@ rsa_verify_cert(int fd, const unsigned c } /* Verify signature of the SHA256(pkg) is valid. */ - printf("Verifying signature... "); if ((mdctx = EVP_MD_CTX_create()) == NULL) { warnx("%s", ERR_error_string(ERR_get_error(), errbuf)); goto error; @@ -631,6 +646,7 @@ verify_signature(int fd_pkg, int fd_sig) char path[MAXPATHLEN]; char hash[SHA256_DIGEST_LENGTH * 2 + 1]; + sc = NULL; trusted = revoked = NULL; ret = false; @@ -672,8 +688,9 @@ verify_signature(int fd_pkg, int fd_sig) if (revoked != NULL) { STAILQ_FOREACH(fingerprint, revoked, next) { if (strcasecmp(fingerprint->hash, hash) == 0) { - fprintf(stderr, "The certificate has been " - "revoked\n"); + fprintf(stderr, "The package was signed with " + "revoked certificate %s\n", + fingerprint->name); goto cleanup; } } @@ -682,17 +699,19 @@ verify_signature(int fd_pkg, int fd_sig) STAILQ_FOREACH(fingerprint, trusted, next) { if (strcasecmp(fingerprint->hash, hash) == 0) { sc->trusted = true; + sc->name = strdup(fingerprint->name); break; } } if (sc->trusted == false) { - fprintf(stderr, "No trusted certificate found matching " + fprintf(stderr, "No trusted fingerprint found matching " "package's certificate\n"); goto cleanup; } /* Verify the signature. */ + printf("Verifying signature with trusted certificate %s... ", sc->name); if (rsa_verify_cert(fd_pkg, sc->cert, sc->certlen, sc->sig, sc->siglen) == false) { fprintf(stderr, "Signature is not valid\n"); @@ -702,21 +721,17 @@ verify_signature(int fd_pkg, int fd_sig) ret = true; cleanup: - if (trusted) { - STAILQ_FOREACH(fingerprint, trusted, next) - free(fingerprint); - free(trusted); - } - if (revoked) { - STAILQ_FOREACH(fingerprint, revoked, next) - free(fingerprint); - free(revoked); - } + if (trusted) + free_fingerprint_list(trusted); + if (revoked) + free_fingerprint_list(revoked); if (sc) { if (sc->cert) free(sc->cert); if (sc->sig) free(sc->sig); + if (sc->name) + free(sc->name); free(sc); } From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 03:47:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CCA8C527; Sat, 26 Oct 2013 03:47:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A9AB92481; Sat, 26 Oct 2013 03:47:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9Q3lnMo081919; Sat, 26 Oct 2013 03:47:49 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9Q3lnlm081918; Sat, 26 Oct 2013 03:47:49 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310260347.r9Q3lnlm081918@svn.freebsd.org> From: Bryan Drewery Date: Sat, 26 Oct 2013 03:47:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257149 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 03:47:50 -0000 Author: bdrewery (ports committer) Date: Sat Oct 26 03:47:49 2013 New Revision: 257149 URL: http://svnweb.freebsd.org/changeset/base/257149 Log: Add support to check the signature of a local pkg.txz file being added with "pkg add". If the pkg.conf is configured to check for signature, then the pkg.txz.sig file will be expected and validated per r257147 Approved by: bapt MFC after: 2 days Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Sat Oct 26 03:44:08 2013 (r257148) +++ head/usr.sbin/pkg/pkg.c Sat Oct 26 03:47:49 2013 (r257149) @@ -135,7 +135,7 @@ cleanup: } static int -install_pkg_static(char *path, char *pkgpath) +install_pkg_static(const char *path, const char *pkgpath) { int pstat; pid_t pid; @@ -864,13 +864,54 @@ pkg_query_yes_no(void) return (ret); } +static int +bootstrap_pkg_local(const char *pkgpath) +{ + char path[MAXPATHLEN]; + char pkgstatic[MAXPATHLEN]; + const char *signature_type; + int fd_pkg, fd_sig, ret; + + fd_sig = -1; + ret = -1; + + fd_pkg = open(pkgpath, O_RDONLY); + if (fd_pkg == -1) + err(EXIT_FAILURE, "Unable to open %s", pkgpath); + + if (config_string(SIGNATURE_TYPE, &signature_type) != 0) { + warnx("Error looking up SIGNATURE_TYPE"); + return (-1); + } + if (signature_type != NULL && + strcasecmp(signature_type, "FINGERPRINTS") == 0) { + snprintf(path, sizeof(path), "%s.sig", pkgpath); + + if ((fd_sig = open(path, O_RDONLY)) == -1) { + fprintf(stderr, "Signature for pkg not available.\n"); + goto cleanup; + } + + if (verify_signature(fd_pkg, fd_sig) == false) + goto cleanup; + } + + if ((ret = extract_pkg_static(fd_pkg, pkgstatic, MAXPATHLEN)) == 0) + ret = install_pkg_static(pkgstatic, pkgpath); + +cleanup: + close(fd_pkg); + if (fd_sig != -1) + close(fd_sig); + + return (ret); +} + int main(__unused int argc, char *argv[]) { char pkgpath[MAXPATHLEN]; - char pkgstatic[MAXPATHLEN]; bool yes = false; - int fd, ret; snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg", getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE); @@ -884,16 +925,11 @@ main(__unused int argc, char *argv[]) if (argv[1] != NULL && strcmp(argv[1], "-N") == 0) errx(EXIT_FAILURE, "pkg is not installed"); + config_init(); + if (argc > 2 && strcmp(argv[1], "add") == 0 && access(argv[2], R_OK) == 0) { - fd = open(argv[2], O_RDONLY); - if (fd == -1) - err(EXIT_FAILURE, "Unable to open %s", argv[2]); - - if ((ret = extract_pkg_static(fd, pkgstatic, MAXPATHLEN)) == 0) - ret = install_pkg_static(pkgstatic, argv[2]); - close(fd); - if (ret != 0) + if (bootstrap_pkg_local(argv[2]) != 0) exit(EXIT_FAILURE); exit(EXIT_SUCCESS); } @@ -902,7 +938,6 @@ main(__unused int argc, char *argv[]) * not tty. Check the environment to see if user has answer * tucked in there already. */ - config_init(); config_bool(ASSUME_ALWAYS_YES, &yes); if (!yes) { printf("%s", confirmation_message); From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 03:53:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5A4FD6AE; Sat, 26 Oct 2013 03:53:26 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 46F8124CC; Sat, 26 Oct 2013 03:53:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9Q3rQqq084617; Sat, 26 Oct 2013 03:53:26 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9Q3rOgL084606; Sat, 26 Oct 2013 03:53:24 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310260353.r9Q3rOgL084606@svn.freebsd.org> From: Bryan Drewery Date: Sat, 26 Oct 2013 03:53:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257150 - in head: etc etc/keys etc/keys/pkg etc/keys/pkg/trusted etc/mtree share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 03:53:26 -0000 Author: bdrewery (ports committer) Date: Sat Oct 26 03:53:24 2013 New Revision: 257150 URL: http://svnweb.freebsd.org/changeset/base/257150 Log: Add infrastructure for installing pkg(8) keys into /etc/keys/pkg and add the current test key that packages will be signed with until 10.0-RELEASE. Approved by: bapt Discussed by: bapt with des MFC after: 2 days Added: head/etc/keys/ head/etc/keys/Makefile (contents, props changed) head/etc/keys/pkg/ head/etc/keys/pkg/Makefile (contents, props changed) head/etc/keys/pkg/trusted/ head/etc/keys/pkg/trusted/Makefile (contents, props changed) head/etc/keys/pkg/trusted/pkg.freebsd.org.2013102301 (contents, props changed) Modified: head/etc/Makefile head/etc/mtree/BSD.root.dist head/share/man/man7/hier.7 Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sat Oct 26 03:47:49 2013 (r257149) +++ head/etc/Makefile Sat Oct 26 03:53:24 2013 (r257150) @@ -224,6 +224,7 @@ distribution: ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install ${_+_}cd ${.CURDIR}/devd; ${MAKE} install ${_+_}cd ${.CURDIR}/gss; ${MAKE} install + ${_+_}cd ${.CURDIR}/keys; ${MAKE} install ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install .if ${MK_PKGBOOTSTRAP} != "no" ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install Added: head/etc/keys/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/keys/Makefile Sat Oct 26 03:53:24 2013 (r257150) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR= pkg + +.include Added: head/etc/keys/pkg/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/keys/pkg/Makefile Sat Oct 26 03:53:24 2013 (r257150) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR= trusted + +.include Added: head/etc/keys/pkg/trusted/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/keys/pkg/trusted/Makefile Sat Oct 26 03:53:24 2013 (r257150) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +NO_OBJ= + +FILES= pkg.freebsd.org.2013102301 + +FILESDIR= /etc/keys/pkg/trusted +FILESMODE= 644 + +.include Added: head/etc/keys/pkg/trusted/pkg.freebsd.org.2013102301 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/keys/pkg/trusted/pkg.freebsd.org.2013102301 Sat Oct 26 03:53:24 2013 (r257150) @@ -0,0 +1,5 @@ +# $FreeBSD$ +# This key is for testing purposes only and will be revoked before 10.0-RELEASE + +function: "sha256" +fingerprint: "b0170035af3acc5f3f3ae1859dc717101b4e6c1d0a794ad554928ca0cbb2f438" Modified: head/etc/mtree/BSD.root.dist ============================================================================== --- head/etc/mtree/BSD.root.dist Sat Oct 26 03:47:49 2013 (r257149) +++ head/etc/mtree/BSD.root.dist Sat Oct 26 03:53:24 2013 (r257150) @@ -34,6 +34,14 @@ .. gss .. + keys + pkg + revoked + .. + trusted + .. + .. + .. mail .. mtree Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Sat Oct 26 03:47:49 2013 (r257149) +++ head/share/man/man7/hier.7 Sat Oct 26 03:53:24 2013 (r257150) @@ -32,7 +32,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 19, 2013 +.Dd October 23, 2013 .Dt HIER 7 .Os .Sh NAME @@ -94,6 +94,15 @@ bluetooth configuration files gnats configuration files; see .Xr send-pr 1 +.It Pa keys/ +known trusted and revoked keys. +.Pp +.Bl -tag -width ".Pa keys/pkg/" -compact +.It Pa keys/pkg/ +fingerprints for +.Xr pkg 8 +.El +.Pp .It Pa localtime local timezone information; see From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 03:55:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 73ADE80A; Sat, 26 Oct 2013 03:55:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6162624DD; Sat, 26 Oct 2013 03:55:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9Q3tUKj084923; Sat, 26 Oct 2013 03:55:30 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9Q3tUIC084922; Sat, 26 Oct 2013 03:55:30 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310260355.r9Q3tUIC084922@svn.freebsd.org> From: Bryan Drewery Date: Sat, 26 Oct 2013 03:55:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257151 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 03:55:30 -0000 Author: bdrewery (ports committer) Date: Sat Oct 26 03:55:29 2013 New Revision: 257151 URL: http://svnweb.freebsd.org/changeset/base/257151 Log: Document /var/cache/pkg into hier(7) which pkg(8) uses. Approved by: bapt MFC after: 2 days Modified: head/share/man/man7/hier.7 Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Sat Oct 26 03:53:24 2013 (r257150) +++ head/share/man/man7/hier.7 Sat Oct 26 03:55:29 2013 (r257151) @@ -735,6 +735,14 @@ directory containing output spool files .Pp .It Pa backups/ miscellaneous backup files +.It Pa cache/ +miscellaneous cached files +.Bl -tag -width ".Pa pkg/" -compact +.It Pa pkg/ +cached packages for +.Xr pkg 8 +.El +.Pp .It Pa crash/ default directory to store kernel crash dumps; see .Xr crash 8 From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 06:23:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C1319CFA; Sat, 26 Oct 2013 06:23:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ACEAD2B0E; Sat, 26 Oct 2013 06:23:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9Q6NqBT034974; Sat, 26 Oct 2013 06:23:52 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9Q6NqdA034971; Sat, 26 Oct 2013 06:23:52 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310260623.r9Q6NqdA034971@svn.freebsd.org> From: Mark Johnston Date: Sat, 26 Oct 2013 06:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257152 - in head/sys: cddl/dev/sdt sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 06:23:52 -0000 Author: markj Date: Sat Oct 26 06:23:51 2013 New Revision: 257152 URL: http://svnweb.freebsd.org/changeset/base/257152 Log: Do some cleanup of the SDT code. In particular, * Remove the unused sdt cdev. * Don't bother keeping a list of probes in struct sdt_prov; it's not needed. * Invoke sdt_load and sdt_unload from the module handler instead of registering separate SYSINITs. * Keep to within 80 columns. * Check for errors from dtrace_unregister(). Modified: head/sys/cddl/dev/sdt/sdt.c head/sys/sys/sdt.h Modified: head/sys/cddl/dev/sdt/sdt.c ============================================================================== --- head/sys/cddl/dev/sdt/sdt.c Sat Oct 26 03:55:29 2013 (r257151) +++ head/sys/cddl/dev/sdt/sdt.c Sat Oct 26 06:23:51 2013 (r257152) @@ -24,6 +24,21 @@ * */ +/* + * This file contains a reimplementation of the statically-defined tracing (SDT) + * framework for DTrace. Probes and SDT providers are defined using the macros + * in sys/sdt.h, which append all the needed structures to linker sets. When + * this module is loaded, it iterates over all of the loaded modules and + * registers probes and providers with the DTrace framework based on the + * contents of these linker sets. + * + * A list of SDT providers is maintained here since a provider may span multiple + * modules. When a kernel module is unloaded, a provider defined in that module + * is unregistered only if no other modules refer to it. The DTrace framework is + * responsible for destroying individual probes when a kernel module is + * unloaded; in particular, probes may not span multiple kernel modules. + */ + #include "opt_kdtrace.h" #include @@ -53,9 +68,8 @@ static void sdt_destroy(void *, dtrace_i static void sdt_enable(void *, dtrace_id_t, void *); static void sdt_disable(void *, dtrace_id_t, void *); -static d_open_t sdt_open; -static void sdt_load(void *); -static int sdt_unload(void *); +static void sdt_load(void); +static int sdt_unload(void); static void sdt_create_provider(struct sdt_provider *); static void sdt_create_probe(struct sdt_probe *); static void sdt_kld_load(void *, struct linker_file *); @@ -63,12 +77,6 @@ static void sdt_kld_unload_try(void *, s static MALLOC_DEFINE(M_SDT, "SDT", "DTrace SDT providers"); -static struct cdevsw sdt_cdevsw = { - .d_version = D_VERSION, - .d_open = sdt_open, - .d_name = "sdt", -}; - static dtrace_pattr_t sdt_attr = { { DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON }, { DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN }, @@ -90,8 +98,6 @@ static dtrace_pops_t sdt_pops = { sdt_destroy, }; -static struct cdev *sdt_cdev; - static TAILQ_HEAD(, sdt_provider) sdt_prov_list; eventhandler_tag sdt_kld_load_tag; @@ -117,7 +123,6 @@ sdt_create_provider(struct sdt_provider newprov = malloc(sizeof(*newprov), M_SDT, M_WAITOK | M_ZERO); newprov->name = strdup(prov->name, M_SDT); prov->sdt_refs = newprov->sdt_refs = 1; - TAILQ_INIT(&newprov->probe_list); TAILQ_INSERT_TAIL(&sdt_prov_list, newprov, prov_entry); @@ -161,12 +166,14 @@ sdt_create_probe(struct sdt_probe *probe if (dtrace_probe_lookup(prov->id, mod, func, name) != DTRACE_IDNONE) return; - TAILQ_INSERT_TAIL(&prov->probe_list, probe, probe_entry); - (void)dtrace_probe_create(prov->id, mod, func, name, 1, probe); } -/* Probes are created through the SDT module load/unload hook. */ +/* + * Probes are created through the SDT module load/unload hook, so this function + * has nothing to do. It only exists because the DTrace provider framework + * requires one of provide_probes and provide_module to be defined. + */ static void sdt_provide_probes(void *arg, dtrace_probedesc_t *desc) { @@ -198,39 +205,39 @@ sdt_getargdesc(void *arg, dtrace_id_t id struct sdt_argtype *argtype; struct sdt_probe *probe = parg; - if (desc->dtargd_ndx < probe->n_args) { - TAILQ_FOREACH(argtype, &probe->argtype_list, argtype_entry) { - if (desc->dtargd_ndx == argtype->ndx) { - desc->dtargd_mapping = desc->dtargd_ndx; - strlcpy(desc->dtargd_native, argtype->type, - sizeof(desc->dtargd_native)); - if (argtype->xtype != NULL) - strlcpy(desc->dtargd_xlate, - argtype->xtype, - sizeof(desc->dtargd_xlate)); - else - desc->dtargd_xlate[0] = '\0'; + if (desc->dtargd_ndx >= probe->n_args) { + desc->dtargd_ndx = DTRACE_ARGNONE; + return; + } + + TAILQ_FOREACH(argtype, &probe->argtype_list, argtype_entry) { + if (desc->dtargd_ndx == argtype->ndx) { + desc->dtargd_mapping = desc->dtargd_ndx; + if (argtype->type == NULL) { + desc->dtargd_native[0] = '\0'; + desc->dtargd_xlate[0] = '\0'; + continue; } + strlcpy(desc->dtargd_native, argtype->type, + sizeof(desc->dtargd_native)); + if (argtype->xtype != NULL) + strlcpy(desc->dtargd_xlate, argtype->xtype, + sizeof(desc->dtargd_xlate)); } - } else - desc->dtargd_ndx = DTRACE_ARGNONE; + } } static void sdt_destroy(void *arg, dtrace_id_t id, void *parg) { - struct sdt_probe *probe; - - probe = parg; - TAILQ_REMOVE(&probe->prov->probe_list, probe, probe_entry); } /* * Called from the kernel linker when a module is loaded, before * dtrace_module_loaded() is called. This is done so that it's possible to - * register new providers when modules are loaded. We cannot do this in the - * provide_module method since it's called with the provider lock held - * and dtrace_register() will try to acquire it again. + * register new providers when modules are loaded. The DTrace framework + * explicitly disallows calling into the framework from the provide_module + * provider method, so we cannot do this there. */ static void sdt_kld_load(void *arg __unused, struct linker_file *lf) @@ -264,14 +271,15 @@ sdt_kld_load(void *arg __unused, struct } static void -sdt_kld_unload_try(void *arg __unused, struct linker_file *lf, int *error __unused) +sdt_kld_unload_try(void *arg __unused, struct linker_file *lf, int *error) { struct sdt_provider *prov, **curr, **begin, **end, *tmp; if (*error != 0) /* We already have an error, so don't do anything. */ return; - else if (linker_file_lookup_set(lf, "sdt_providers_set", &begin, &end, NULL)) + else if (linker_file_lookup_set(lf, "sdt_providers_set", &begin, &end, + NULL)) /* No DTrace providers are declared in this file. */ return; @@ -281,17 +289,20 @@ sdt_kld_unload_try(void *arg __unused, s */ for (curr = begin; curr < end; curr++) { TAILQ_FOREACH_SAFE(prov, &sdt_prov_list, prov_entry, tmp) { - if (strcmp(prov->name, (*curr)->name) == 0) { - if (prov->sdt_refs == 1) { - TAILQ_REMOVE(&sdt_prov_list, prov, - prov_entry); - dtrace_unregister(prov->id); - free(prov->name, M_SDT); - free(prov, M_SDT); - } else - prov->sdt_refs--; - break; - } + if (strcmp(prov->name, (*curr)->name) != 0) + continue; + + if (prov->sdt_refs == 1) { + if (dtrace_unregister(prov->id) != 0) { + *error = 1; + return; + } + TAILQ_REMOVE(&sdt_prov_list, prov, prov_entry); + free(prov->name, M_SDT); + free(prov, M_SDT); + } else + prov->sdt_refs--; + break; } } } @@ -306,15 +317,11 @@ sdt_linker_file_cb(linker_file_t lf, voi } static void -sdt_load(void *arg __unused) +sdt_load() { TAILQ_INIT(&sdt_prov_list); - /* Create the /dev/dtrace/sdt entry. */ - sdt_cdev = make_dev(&sdt_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, - "dtrace/sdt"); - sdt_probe_func = dtrace_probe; sdt_kld_load_tag = EVENTHANDLER_REGISTER(kld_load, sdt_kld_load, NULL, @@ -327,9 +334,10 @@ sdt_load(void *arg __unused) } static int -sdt_unload(void *arg __unused) +sdt_unload() { struct sdt_provider *prov, *tmp; + int ret; EVENTHANDLER_DEREGISTER(kld_load, sdt_kld_load_tag); EVENTHANDLER_DEREGISTER(kld_unload_try, sdt_kld_unload_try_tag); @@ -337,18 +345,17 @@ sdt_unload(void *arg __unused) sdt_probe_func = sdt_probe_stub; TAILQ_FOREACH_SAFE(prov, &sdt_prov_list, prov_entry, tmp) { + ret = dtrace_unregister(prov->id); + if (ret != 0) + return (ret); TAILQ_REMOVE(&sdt_prov_list, prov, prov_entry); - dtrace_unregister(prov->id); free(prov->name, M_SDT); free(prov, M_SDT); } - destroy_dev(sdt_cdev); - return (0); } -/* ARGSUSED */ static int sdt_modevent(module_t mod __unused, int type, void *data __unused) { @@ -356,9 +363,11 @@ sdt_modevent(module_t mod __unused, int switch (type) { case MOD_LOAD: + sdt_load(); break; case MOD_UNLOAD: + error = sdt_unload(); break; case MOD_SHUTDOWN: @@ -372,18 +381,6 @@ sdt_modevent(module_t mod __unused, int return (error); } -/* ARGSUSED */ -static int -sdt_open(struct cdev *dev __unused, int oflags __unused, int devtype __unused, - struct thread *td __unused) -{ - - return (0); -} - -SYSINIT(sdt_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, sdt_load, NULL); -SYSUNINIT(sdt_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, sdt_unload, NULL); - DEV_MODULE(sdt, sdt_modevent, NULL); MODULE_VERSION(sdt, 1); MODULE_DEPEND(sdt, dtrace, 1, 1, 1); Modified: head/sys/sys/sdt.h ============================================================================== --- head/sys/sys/sdt.h Sat Oct 26 03:55:29 2013 (r257151) +++ head/sys/sys/sdt.h Sat Oct 26 06:23:51 2013 (r257152) @@ -134,7 +134,7 @@ SET_DECLARE(sdt_argtypes_set, struct sdt #define SDT_PROVIDER_DEFINE(prov) \ struct sdt_provider sdt_provider_##prov[1] = { \ - { #prov, { NULL, NULL }, { NULL, NULL }, 0, 0 } \ + { #prov, { NULL, NULL }, 0, 0 } \ }; \ DATA_SET(sdt_providers_set, sdt_provider_##prov); @@ -358,7 +358,6 @@ struct sdt_provider { char *name; /* Provider name. */ TAILQ_ENTRY(sdt_provider) prov_entry; /* SDT provider list entry. */ - TAILQ_HEAD(probe_list_head, sdt_probe) probe_list; uintptr_t id; /* DTrace provider ID. */ int sdt_refs; /* Number of module references. */ }; From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 08:34:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 49FD030D; Sat, 26 Oct 2013 08:34:36 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 366F12F97; Sat, 26 Oct 2013 08:34:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9Q8Ya86078348; Sat, 26 Oct 2013 08:34:36 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9Q8YaXL078347; Sat, 26 Oct 2013 08:34:36 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201310260834.r9Q8YaXL078347@svn.freebsd.org> From: Colin Percival Date: Sat, 26 Oct 2013 08:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257153 - stable/10/usr.sbin/freebsd-update X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 08:34:36 -0000 Author: cperciva Date: Sat Oct 26 08:34:35 2013 New Revision: 257153 URL: http://svnweb.freebsd.org/changeset/base/257153 Log: MFC r256646, r256767, r257038: When installing updates, install new directories first and remove old directories last. Allow ~ in file names so libtool droppings in contrib don't break updates. It has happened twice now, and is likely to happen again. Be more selective when filtering for lib*.so.N files. These are deleted at the end of the upgrade process, after warning users to upgrade any 3rd party software (e.g., from the ports tree) which might link to the libraries being removed. Approved by: re (gjb) Errata Notice: FreeBSD-EN-13:04.freebsd-update Modified: stable/10/usr.sbin/freebsd-update/freebsd-update.sh Directory Properties: stable/10/usr.sbin/freebsd-update/ (props changed) Modified: stable/10/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- stable/10/usr.sbin/freebsd-update/freebsd-update.sh Sat Oct 26 06:23:51 2013 (r257152) +++ stable/10/usr.sbin/freebsd-update/freebsd-update.sh Sat Oct 26 08:34:35 2013 (r257153) @@ -1200,7 +1200,7 @@ fetch_metadata_sanity () { # Some aliases to save space later: ${P} is a character which can # appear in a path; ${M} is the four numeric metadata fields; and # ${H} is a sha256 hash. - P="[-+./:=%@_[[:alnum:]]" + P="[-+./:=%@_[~[:alnum:]]" M="[0-9]+\|[0-9]+\|[0-9]+\|[0-9]+" H="[0-9a-f]{64}" @@ -2814,16 +2814,24 @@ Kernel updates have been installed. Ple # If we haven't already dealt with the world, deal with it. if ! [ -f $1/worlddone ]; then + # Create any necessary directories first + grep -vE '^/boot/' $1/INDEX-NEW | + grep -E '^[^|]+\|d\|' > INDEX-NEW + install_from_index INDEX-NEW || return 1 + # Install new shared libraries next grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 # Deal with everything else grep -vE '^/boot/' $1/INDEX-OLD | - grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD + grep -vE '^[^|]+\|d\|' | + grep -vE '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-OLD grep -vE '^/boot/' $1/INDEX-NEW | - grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -vE '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 install_delete INDEX-OLD INDEX-NEW || return 1 @@ -2844,11 +2852,11 @@ Kernel updates have been installed. Ple # Do we need to ask the user to portupgrade now? grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' | cut -f 1 -d '|' | sort > newfiles if grep -vE '^/boot/' $1/INDEX-OLD | - grep -E '/lib/.*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' | cut -f 1 -d '|' | sort | join -v 1 - newfiles | @@ -2868,9 +2876,18 @@ again to finish installing updates. # Remove old shared libraries grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW grep -vE '^/boot/' $1/INDEX-OLD | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-OLD + install_delete INDEX-OLD INDEX-NEW || return 1 + + # Remove old directories + grep -vE '^/boot/' $1/INDEX-OLD | + grep -E '^[^|]+\|d\|' > INDEX-OLD + grep -vE '^/boot/' $1/INDEX-OLD | + grep -E '^[^|]+\|d\|' > INDEX-OLD install_delete INDEX-OLD INDEX-NEW || return 1 # Remove temporary files From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 08:35:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D708943C; Sat, 26 Oct 2013 08:35:54 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C3B3B2F9D; Sat, 26 Oct 2013 08:35:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9Q8ZsXj078533; Sat, 26 Oct 2013 08:35:54 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9Q8Zs7I078532; Sat, 26 Oct 2013 08:35:54 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201310260835.r9Q8Zs7I078532@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 26 Oct 2013 08:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257154 - head/sbin/hastd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 08:35:54 -0000 Author: trociny Date: Sat Oct 26 08:35:54 2013 New Revision: 257154 URL: http://svnweb.freebsd.org/changeset/base/257154 Log: Merging local and remote bitmaps must be protected by hr_amp lock. This is believed to fix hastd crashes, which might occur during synchronization, triggered by the failed assertion: Assertion failed: (amp->am_memtab[ext] > 0), function activemap_write_complete, file activemap.c, line 351. MFC after: 1 week Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Sat Oct 26 08:34:35 2013 (r257153) +++ head/sbin/hastd/primary.c Sat Oct 26 08:35:54 2013 (r257154) @@ -781,6 +781,7 @@ init_remote(struct hast_resource *res, s free(map); goto close; } + mtx_lock(&res->hr_amp_lock); /* * Merge local and remote bitmaps. */ @@ -790,7 +791,6 @@ init_remote(struct hast_resource *res, s * Now that we merged bitmaps from both nodes, flush it to the * disk before we start to synchronize. */ - mtx_lock(&res->hr_amp_lock); (void)hast_activemap_flush(res); } nv_free(nvin); From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 08:38:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C833159B; Sat, 26 Oct 2013 08:38:22 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A5B922FAE; Sat, 26 Oct 2013 08:38:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9Q8cMBA078846; Sat, 26 Oct 2013 08:38:22 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9Q8cLbR078840; Sat, 26 Oct 2013 08:38:21 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201310260838.r9Q8cLbR078840@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 26 Oct 2013 08:38:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257155 - in head/sbin: hastctl hastd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 08:38:22 -0000 Author: trociny Date: Sat Oct 26 08:38:21 2013 New Revision: 257155 URL: http://svnweb.freebsd.org/changeset/base/257155 Log: Make hastctl list command output current queue sizes. Reviewed by: pjd MFC after: 1 month Modified: head/sbin/hastctl/hastctl.c head/sbin/hastd/control.c head/sbin/hastd/hast.h head/sbin/hastd/primary.c head/sbin/hastd/secondary.c Modified: head/sbin/hastctl/hastctl.c ============================================================================== --- head/sbin/hastctl/hastctl.c Sat Oct 26 08:35:54 2013 (r257154) +++ head/sbin/hastctl/hastctl.c Sat Oct 26 08:38:21 2013 (r257155) @@ -355,6 +355,13 @@ control_list(struct nv *nv) (uintmax_t)nv_get_uint64(nv, "stat_write_error%u", ii), (uintmax_t)nv_get_uint64(nv, "stat_delete_error%u", ii), (uintmax_t)nv_get_uint64(nv, "stat_flush_error%u", ii)); + printf(" queues: " + "local: %ju, send: %ju, recv: %ju, done: %ju, idle: %ju\n", + (uintmax_t)nv_get_uint64(nv, "local_queue_size%u", ii), + (uintmax_t)nv_get_uint64(nv, "send_queue_size%u", ii), + (uintmax_t)nv_get_uint64(nv, "recv_queue_size%u", ii), + (uintmax_t)nv_get_uint64(nv, "done_queue_size%u", ii), + (uintmax_t)nv_get_uint64(nv, "idle_queue_size%u", ii)); } return (ret); } Modified: head/sbin/hastd/control.c ============================================================================== --- head/sbin/hastd/control.c Sat Oct 26 08:35:54 2013 (r257154) +++ head/sbin/hastd/control.c Sat Oct 26 08:38:21 2013 (r257155) @@ -215,6 +215,16 @@ control_status_worker(struct hast_resour "stat_delete_error%u", no); nv_add_uint64(nvout, nv_get_uint64(cnvin, "stat_flush_error"), "stat_flush_error%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "idle_queue_size"), + "idle_queue_size%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "local_queue_size"), + "local_queue_size%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "send_queue_size"), + "send_queue_size%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "recv_queue_size"), + "recv_queue_size%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "done_queue_size"), + "done_queue_size%u", no); end: if (cnvin != NULL) nv_free(cnvin); @@ -478,6 +488,7 @@ ctrl_thread(void *arg) nv_add_uint64(nvout, res->hr_stat_flush_error + res->hr_stat_activemap_flush_error, "stat_flush_error"); + res->output_status_aux(nvout); nv_add_int16(nvout, 0, "error"); break; case CONTROL_RELOAD: Modified: head/sbin/hastd/hast.h ============================================================================== --- head/sbin/hastd/hast.h Sat Oct 26 08:35:54 2013 (r257154) +++ head/sbin/hastd/hast.h Sat Oct 26 08:38:21 2013 (r257155) @@ -137,6 +137,8 @@ struct hastd_config { #define HAST_CHECKSUM_CRC32 1 #define HAST_CHECKSUM_SHA256 2 +struct nv; + /* * Structure that describes single resource. */ @@ -254,6 +256,9 @@ struct hast_resource { /* Number of activemap flush errors. */ uint64_t hr_stat_activemap_flush_error; + /* Function to output worker specific info on control status request. */ + void (*output_status_aux)(struct nv *); + /* Next resource. */ TAILQ_ENTRY(hast_resource) hr_next; }; Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Sat Oct 26 08:35:54 2013 (r257154) +++ head/sbin/hastd/primary.c Sat Oct 26 08:38:21 2013 (r257155) @@ -108,6 +108,7 @@ struct hio { * until some in-progress requests are freed. */ static TAILQ_HEAD(, hio) hio_free_list; +static size_t hio_free_list_size; static pthread_mutex_t hio_free_list_lock; static pthread_cond_t hio_free_list_cond; /* @@ -116,20 +117,26 @@ static pthread_cond_t hio_free_list_cond * responsible for managing his own send list. */ static TAILQ_HEAD(, hio) *hio_send_list; +static size_t *hio_send_list_size; static pthread_mutex_t *hio_send_list_lock; static pthread_cond_t *hio_send_list_cond; +#define hio_send_local_list_size hio_send_list_size[0] +#define hio_send_remote_list_size hio_send_list_size[1] /* * There is one recv list for every component, although local components don't * use recv lists as local requests are done synchronously. */ static TAILQ_HEAD(, hio) *hio_recv_list; +static size_t *hio_recv_list_size; static pthread_mutex_t *hio_recv_list_lock; static pthread_cond_t *hio_recv_list_cond; +#define hio_recv_remote_list_size hio_recv_list_size[1] /* * Request is placed on done list by the slowest component (the one that * decreased hio_countdown from 1 to 0). */ static TAILQ_HEAD(, hio) hio_done_list; +static size_t hio_done_list_size; static pthread_mutex_t hio_done_list_lock; static pthread_cond_t hio_done_list_cond; /* @@ -170,6 +177,7 @@ static pthread_mutex_t metadata_lock; _wakeup = TAILQ_EMPTY(&hio_##name##_list[(ncomp)]); \ TAILQ_INSERT_TAIL(&hio_##name##_list[(ncomp)], (hio), \ hio_next[(ncomp)]); \ + hio_##name##_list_size[(ncomp)]++; \ mtx_unlock(&hio_##name##_list_lock[ncomp]); \ if (_wakeup) \ cv_broadcast(&hio_##name##_list_cond[(ncomp)]); \ @@ -180,6 +188,7 @@ static pthread_mutex_t metadata_lock; mtx_lock(&hio_##name##_list_lock); \ _wakeup = TAILQ_EMPTY(&hio_##name##_list); \ TAILQ_INSERT_TAIL(&hio_##name##_list, (hio), hio_##name##_next);\ + hio_##name##_list_size++; \ mtx_unlock(&hio_##name##_list_lock); \ if (_wakeup) \ cv_broadcast(&hio_##name##_list_cond); \ @@ -196,6 +205,8 @@ static pthread_mutex_t metadata_lock; _last = true; \ } \ if (hio != NULL) { \ + PJDLOG_ASSERT(hio_##name##_list_size[(ncomp)] != 0); \ + hio_##name##_list_size[(ncomp)]--; \ TAILQ_REMOVE(&hio_##name##_list[(ncomp)], (hio), \ hio_next[(ncomp)]); \ } \ @@ -207,6 +218,8 @@ static pthread_mutex_t metadata_lock; cv_wait(&hio_##name##_list_cond, \ &hio_##name##_list_lock); \ } \ + PJDLOG_ASSERT(hio_##name##_list_size != 0); \ + hio_##name##_list_size--; \ TAILQ_REMOVE(&hio_##name##_list, (hio), hio_##name##_next); \ mtx_unlock(&hio_##name##_list_lock); \ } while (0) @@ -239,6 +252,22 @@ static void *sync_thread(void *arg); static void *guard_thread(void *arg); static void +output_status_aux(struct nv *nvout) +{ + + nv_add_uint64(nvout, (uint64_t)hio_free_list_size, + "idle_queue_size"); + nv_add_uint64(nvout, (uint64_t)hio_send_local_list_size, + "local_queue_size"); + nv_add_uint64(nvout, (uint64_t)hio_send_remote_list_size, + "send_queue_size"); + nv_add_uint64(nvout, (uint64_t)hio_recv_remote_list_size, + "recv_queue_size"); + nv_add_uint64(nvout, (uint64_t)hio_done_list_size, + "done_queue_size"); +} + +static void cleanup(struct hast_resource *res) { int rerrno; @@ -355,6 +384,12 @@ init_environment(struct hast_resource *r "Unable to allocate %zu bytes of memory for send lists.", sizeof(hio_send_list[0]) * ncomps); } + hio_send_list_size = malloc(sizeof(hio_send_list_size[0]) * ncomps); + if (hio_send_list_size == NULL) { + primary_exitx(EX_TEMPFAIL, + "Unable to allocate %zu bytes of memory for send list counters.", + sizeof(hio_send_list_size[0]) * ncomps); + } hio_send_list_lock = malloc(sizeof(hio_send_list_lock[0]) * ncomps); if (hio_send_list_lock == NULL) { primary_exitx(EX_TEMPFAIL, @@ -373,6 +408,12 @@ init_environment(struct hast_resource *r "Unable to allocate %zu bytes of memory for recv lists.", sizeof(hio_recv_list[0]) * ncomps); } + hio_recv_list_size = malloc(sizeof(hio_recv_list_size[0]) * ncomps); + if (hio_recv_list_size == NULL) { + primary_exitx(EX_TEMPFAIL, + "Unable to allocate %zu bytes of memory for recv list counters.", + sizeof(hio_recv_list_size[0]) * ncomps); + } hio_recv_list_lock = malloc(sizeof(hio_recv_list_lock[0]) * ncomps); if (hio_recv_list_lock == NULL) { primary_exitx(EX_TEMPFAIL, @@ -393,16 +434,18 @@ init_environment(struct hast_resource *r } /* - * Initialize lists, their locks and theirs condition variables. + * Initialize lists, their counters, locks and condition variables. */ TAILQ_INIT(&hio_free_list); mtx_init(&hio_free_list_lock); cv_init(&hio_free_list_cond); for (ii = 0; ii < HAST_NCOMPONENTS; ii++) { TAILQ_INIT(&hio_send_list[ii]); + hio_send_list_size[ii] = 0; mtx_init(&hio_send_list_lock[ii]); cv_init(&hio_send_list_cond[ii]); TAILQ_INIT(&hio_recv_list[ii]); + hio_recv_list_size[ii] = 0; mtx_init(&hio_recv_list_lock[ii]); cv_init(&hio_recv_list_cond[ii]); rw_init(&hio_remote_lock[ii]); @@ -445,6 +488,7 @@ init_environment(struct hast_resource *r hio->hio_ggio.gctl_length = MAXPHYS; hio->hio_ggio.gctl_error = 0; TAILQ_INSERT_HEAD(&hio_free_list, hio, hio_free_next); + hio_free_list_size++; } } @@ -963,6 +1007,7 @@ hastd_primary(struct hast_resource *res) } gres = res; + res->output_status_aux = output_status_aux; mode = pjdlog_mode_get(); debuglevel = pjdlog_debug_get(); @@ -1617,6 +1662,7 @@ remote_send_thread(void *arg) mtx_lock(&hio_recv_list_lock[ncomp]); wakeup = TAILQ_EMPTY(&hio_recv_list[ncomp]); TAILQ_INSERT_TAIL(&hio_recv_list[ncomp], hio, hio_next[ncomp]); + hio_recv_list_size[ncomp]++; mtx_unlock(&hio_recv_list_lock[ncomp]); if (hast_proto_send(res, res->hr_remoteout, nv, data, data != NULL ? length : 0) == -1) { @@ -1635,6 +1681,7 @@ remote_send_thread(void *arg) mtx_lock(&hio_recv_list_lock[ncomp]); TAILQ_REMOVE(&hio_recv_list[ncomp], hio, hio_next[ncomp]); + hio_recv_list_size[ncomp]--; mtx_unlock(&hio_recv_list_lock[ncomp]); goto done_queue; } @@ -1719,6 +1766,7 @@ remote_recv_thread(void *arg) PJDLOG_ASSERT(hio != NULL); TAILQ_REMOVE(&hio_recv_list[ncomp], hio, hio_next[ncomp]); + hio_recv_list_size[ncomp]--; mtx_unlock(&hio_recv_list_lock[ncomp]); goto done_queue; } @@ -1742,6 +1790,7 @@ remote_recv_thread(void *arg) if (hio->hio_ggio.gctl_seq == seq) { TAILQ_REMOVE(&hio_recv_list[ncomp], hio, hio_next[ncomp]); + hio_recv_list_size[ncomp]--; break; } } @@ -1838,6 +1887,7 @@ done_queue: mtx_lock(&hio_recv_list_lock[ncomp]); TAILQ_INSERT_TAIL(&hio_recv_list[ncomp], hio, hio_next[ncomp]); + hio_recv_list_size[ncomp]++; mtx_unlock(&hio_recv_list_lock[ncomp]); } else { /* @@ -1860,6 +1910,7 @@ done_queue: mtx_lock(&hio_recv_list_lock[ncomp]); TAILQ_INSERT_TAIL(&hio_recv_list[ncomp], hio, hio_next[ncomp]); + hio_recv_list_size[ncomp]++; mtx_unlock(&hio_recv_list_lock[ncomp]); continue; default: Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Sat Oct 26 08:35:54 2013 (r257154) +++ head/sbin/hastd/secondary.c Sat Oct 26 08:38:21 2013 (r257155) @@ -82,18 +82,21 @@ static struct hast_resource *gres; * until some in-progress requests are freed. */ static TAILQ_HEAD(, hio) hio_free_list; +static size_t hio_free_list_size; static pthread_mutex_t hio_free_list_lock; static pthread_cond_t hio_free_list_cond; /* * Disk thread (the one that does I/O requests) takes requests from this list. */ static TAILQ_HEAD(, hio) hio_disk_list; +static size_t hio_disk_list_size; static pthread_mutex_t hio_disk_list_lock; static pthread_cond_t hio_disk_list_cond; /* * Thread that sends requests back to primary takes requests from this list. */ static TAILQ_HEAD(, hio) hio_send_list; +static size_t hio_send_list_size; static pthread_mutex_t hio_send_list_lock; static pthread_cond_t hio_send_list_cond; @@ -112,6 +115,7 @@ static void *send_thread(void *arg); mtx_lock(&hio_##name##_list_lock); \ _wakeup = TAILQ_EMPTY(&hio_##name##_list); \ TAILQ_INSERT_TAIL(&hio_##name##_list, (hio), hio_next); \ + hio_##name##_list_size++; \ mtx_unlock(&hio_##name##_list_lock); \ if (_wakeup) \ cv_broadcast(&hio_##name##_list_cond); \ @@ -122,11 +126,22 @@ static void *send_thread(void *arg); cv_wait(&hio_##name##_list_cond, \ &hio_##name##_list_lock); \ } \ + PJDLOG_ASSERT(hio_##name##_list_size != 0); \ + hio_##name##_list_size--; \ TAILQ_REMOVE(&hio_##name##_list, (hio), hio_next); \ mtx_unlock(&hio_##name##_list_lock); \ } while (0) static void +output_status_aux(struct nv *nvout) +{ + + nv_add_uint64(nvout, (uint64_t)hio_free_list_size, "idle_queue_size"); + nv_add_uint64(nvout, (uint64_t)hio_disk_list_size, "local_queue_size"); + nv_add_uint64(nvout, (uint64_t)hio_send_list_size, "send_queue_size"); +} + +static void hio_clear(struct hio *hio) { @@ -190,6 +205,7 @@ init_environment(void) } hio_clear(hio); TAILQ_INSERT_HEAD(&hio_free_list, hio, hio_next); + hio_free_list_size++; } } @@ -441,6 +457,7 @@ hastd_secondary(struct hast_resource *re } gres = res; + res->output_status_aux = output_status_aux; mode = pjdlog_mode_get(); debuglevel = pjdlog_debug_get(); From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 11:56:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8A4B7309; Sat, 26 Oct 2013 11:56:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 78C512930; Sat, 26 Oct 2013 11:56:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QBuqjG045324; Sat, 26 Oct 2013 11:56:52 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QBuqZi045323; Sat, 26 Oct 2013 11:56:52 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310261156.r9QBuqZi045323@svn.freebsd.org> From: Dimitry Andric Date: Sat, 26 Oct 2013 11:56:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r257156 - stable/9/sys/dev/random X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 11:56:52 -0000 Author: dim Date: Sat Oct 26 11:56:51 2013 New Revision: 257156 URL: http://svnweb.freebsd.org/changeset/base/257156 Log: MFC r256157: Now our binutils's assembler supports the Intel Random Number Generator extensions, we can change the .byte directives in sys/dev/random/ivy.c to plain 'rdrand' mnemonics. This already worked for clang users, but now it will also work for gcc users. Approved by: so (des) Modified: stable/9/sys/dev/random/ivy.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/random/ivy.c ============================================================================== --- stable/9/sys/dev/random/ivy.c Sat Oct 26 08:38:21 2013 (r257155) +++ stable/9/sys/dev/random/ivy.c Sat Oct 26 11:56:51 2013 (r257156) @@ -64,12 +64,12 @@ ivy_rng_store(long *tmp) __asm __volatile( #ifdef __amd64__ - ".byte\t0x48,0x0f,0xc7,0xf0\n\t" /* rdrand %rax */ + "rdrand\t%%rax\n\t" "jnc\t1f\n\t" "movq\t%%rax,%1\n\t" "movl\t$8,%%eax\n" #else /* i386 */ - ".byte\t0x0f,0xc7,0xf0\n\t" /* rdrand %eax */ + "rdrand\t%%eax\n\t" "jnc\t1f\n\t" "movl\t%%eax,%1\n\t" "movl\t$4,%%eax\n" From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 13:18:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B469D6C5; Sat, 26 Oct 2013 13:18:40 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A2A722D02; Sat, 26 Oct 2013 13:18:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QDIeSQ072877; Sat, 26 Oct 2013 13:18:40 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QDIenX072876; Sat, 26 Oct 2013 13:18:40 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310261318.r9QDIenX072876@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 26 Oct 2013 13:18:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257157 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 13:18:40 -0000 Author: nwhitehorn Date: Sat Oct 26 13:18:39 2013 New Revision: 257157 URL: http://svnweb.freebsd.org/changeset/base/257157 Log: machine/pmap.h is included by vm/pmap.h, so is redundant here. Thanks to Alan Cox for pointing this out. Modified: head/sys/dev/uart/uart_cpu_fdt.c Modified: head/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- head/sys/dev/uart/uart_cpu_fdt.c Sat Oct 26 11:56:51 2013 (r257156) +++ head/sys/dev/uart/uart_cpu_fdt.c Sat Oct 26 13:18:39 2013 (r257157) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 13:38:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8F4C7D8C; Sat, 26 Oct 2013 13:38:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7B00B2DE0; Sat, 26 Oct 2013 13:38:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QDco4S079598; Sat, 26 Oct 2013 13:38:50 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QDcodU079597; Sat, 26 Oct 2013 13:38:50 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310261338.r9QDcodU079597@svn.freebsd.org> From: Bryan Drewery Date: Sat, 26 Oct 2013 13:38:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257158 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 13:38:50 -0000 Author: bdrewery (ports committer) Date: Sat Oct 26 13:38:49 2013 New Revision: 257158 URL: http://svnweb.freebsd.org/changeset/base/257158 Log: Link in libcrypto as well to fix build in some cases. Approved by: bapt MFC after: 2 days Reported by: many Modified: head/usr.sbin/pkg/Makefile Modified: head/usr.sbin/pkg/Makefile ============================================================================== --- head/usr.sbin/pkg/Makefile Sat Oct 26 13:18:39 2013 (r257157) +++ head/usr.sbin/pkg/Makefile Sat Oct 26 13:38:49 2013 (r257158) @@ -6,8 +6,9 @@ SRCS= pkg.c dns_utils.c config.c NO_MAN= yes CFLAGS+=-I${.CURDIR}/../../contrib/libyaml/include .PATH: ${.CURDIR}/../../contrib/libyaml/include -DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBYAML} ${LIBSBUF} -LDADD= -larchive -lelf -lfetch -lyaml -lsbuf -lssl +DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBYAML} ${LIBSBUF} ${LIBSSL} \ + ${LIBCRYPTO} +LDADD= -larchive -lelf -lfetch -lyaml -lsbuf -lssl -lcrypto USEPRIVATELIB= yaml .include From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 14:19:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EA0D5925; Sat, 26 Oct 2013 14:19:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D5EEE2FBF; Sat, 26 Oct 2013 14:19:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QEJvuS093467; Sat, 26 Oct 2013 14:19:57 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QEJvJC093466; Sat, 26 Oct 2013 14:19:57 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310261419.r9QEJvJC093466@svn.freebsd.org> From: Bryan Drewery Date: Sat, 26 Oct 2013 14:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257159 - head/etc/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 14:19:58 -0000 Author: bdrewery (ports committer) Date: Sat Oct 26 14:19:57 2013 New Revision: 257159 URL: http://svnweb.freebsd.org/changeset/base/257159 Log: Disable fingerprint checking for now as the pkg repository mirrors will not receive the signature until later this week. Approved by: bapt Modified: head/etc/pkg/FreeBSD.conf Modified: head/etc/pkg/FreeBSD.conf ============================================================================== --- head/etc/pkg/FreeBSD.conf Sat Oct 26 13:38:49 2013 (r257158) +++ head/etc/pkg/FreeBSD.conf Sat Oct 26 14:19:57 2013 (r257159) @@ -2,7 +2,7 @@ FreeBSD: { url: "pkg+http://pkg.freebsd.org/${ABI}/latest", mirror_type: "srv", - signature_type: "fingerprints", + signature_type: "none", fingerprints: "/etc/keys/pkg", enabled: "yes" } From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 14:49:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 89DBC98A; Sat, 26 Oct 2013 14:49:20 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7686B216F; Sat, 26 Oct 2013 14:49:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QEnKkl003761; Sat, 26 Oct 2013 14:49:20 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QEnK99003760; Sat, 26 Oct 2013 14:49:20 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310261449.r9QEnK99003760@svn.freebsd.org> From: Sean Bruno Date: Sat, 26 Oct 2013 14:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257160 - head/contrib/gperf/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 14:49:20 -0000 Author: sbruno Date: Sat Oct 26 14:49:19 2013 New Revision: 257160 URL: http://svnweb.freebsd.org/changeset/base/257160 Log: Queisce warnings for gperf -Wlogical-op-parentheses with parens to explicitly define the logic Modified: head/contrib/gperf/src/options.cc Modified: head/contrib/gperf/src/options.cc ============================================================================== --- head/contrib/gperf/src/options.cc Sat Oct 26 14:19:57 2013 (r257159) +++ head/contrib/gperf/src/options.cc Sat Oct 26 14:49:19 2013 (r257160) @@ -281,7 +281,7 @@ Options::print_options () const { putchar (*arg); arg++; - if (*arg >= 'A' && *arg <= 'Z' || *arg >= 'a' && *arg <= 'z') + if ( (*arg >= 'A' && *arg <= 'Z') || (*arg >= 'a' && *arg <= 'z') ) { putchar (*arg); arg++; @@ -293,7 +293,9 @@ Options::print_options () const putchar (*arg); arg++; } - while (*arg >= 'A' && *arg <= 'Z' || *arg >= 'a' && *arg <= 'z' || *arg == '-'); + while ( (*arg >= 'A' && *arg <= 'Z') || + (*arg >= 'a' && *arg <= 'z') || + *arg == '-'); if (*arg == '=') { putchar (*arg); From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 14:52:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 92475B17; Sat, 26 Oct 2013 14:52:56 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6F10421B0; Sat, 26 Oct 2013 14:52:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QEqudo006224; Sat, 26 Oct 2013 14:52:56 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QEquZi006223; Sat, 26 Oct 2013 14:52:56 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310261452.r9QEquZi006223@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 26 Oct 2013 14:52:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257161 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 14:52:56 -0000 Author: nwhitehorn Date: Sat Oct 26 14:52:55 2013 New Revision: 257161 URL: http://svnweb.freebsd.org/changeset/base/257161 Log: Add pmap_mapdev_attr() and pmap_kenter_attr() interfaces. pmap_set_memattr() is slightly more complicated and is left unimplemented for now. Also prevent pmap_mapdev() from mapping over the kernel and KVA regions if devices happen to have high physical addresses. MFC after: 2 weeks Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sat Oct 26 14:49:19 2013 (r257160) +++ head/sys/powerpc/booke/pmap.c Sat Oct 26 14:52:55 2013 (r257161) @@ -315,9 +315,11 @@ static void mmu_booke_activate(mmu_t, s static void mmu_booke_deactivate(mmu_t, struct thread *); static void mmu_booke_bootstrap(mmu_t, vm_offset_t, vm_offset_t); static void *mmu_booke_mapdev(mmu_t, vm_paddr_t, vm_size_t); +static void *mmu_booke_mapdev_attr(mmu_t, vm_paddr_t, vm_size_t, vm_memattr_t); static void mmu_booke_unmapdev(mmu_t, vm_offset_t, vm_size_t); static vm_paddr_t mmu_booke_kextract(mmu_t, vm_offset_t); static void mmu_booke_kenter(mmu_t, vm_offset_t, vm_paddr_t); +static void mmu_booke_kenter_attr(mmu_t, vm_offset_t, vm_paddr_t, vm_memattr_t); static void mmu_booke_kremove(mmu_t, vm_offset_t); static boolean_t mmu_booke_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t); static void mmu_booke_sync_icache(mmu_t, pmap_t, vm_offset_t, @@ -371,7 +373,9 @@ static mmu_method_t mmu_booke_methods[] MMUMETHOD(mmu_bootstrap, mmu_booke_bootstrap), MMUMETHOD(mmu_dev_direct_mapped,mmu_booke_dev_direct_mapped), MMUMETHOD(mmu_mapdev, mmu_booke_mapdev), + MMUMETHOD(mmu_mapdev_attr, mmu_booke_mapdev_attr), MMUMETHOD(mmu_kenter, mmu_booke_kenter), + MMUMETHOD(mmu_kenter_attr, mmu_booke_kenter_attr), MMUMETHOD(mmu_kextract, mmu_booke_kextract), /* MMUMETHOD(mmu_kremove, mmu_booke_kremove), */ MMUMETHOD(mmu_unmapdev, mmu_booke_unmapdev), @@ -386,6 +390,42 @@ static mmu_method_t mmu_booke_methods[] MMU_DEF(booke_mmu, MMU_TYPE_BOOKE, mmu_booke_methods, 0); +static __inline uint32_t +tlb_calc_wimg(vm_offset_t pa, vm_memattr_t ma) +{ + uint32_t attrib; + int i; + + if (ma != VM_MEMATTR_DEFAULT) { + switch (ma) { + case VM_MEMATTR_UNCACHEABLE: + return (PTE_I | PTE_G); + case VM_MEMATTR_WRITE_COMBINING: + case VM_MEMATTR_WRITE_BACK: + case VM_MEMATTR_PREFETCHABLE: + return (PTE_I); + case VM_MEMATTR_WRITE_THROUGH: + return (PTE_W | PTE_M); + } + } + + /* + * Assume the page is cache inhibited and access is guarded unless + * it's in our available memory array. + */ + attrib = _TLB_ENTRY_IO; + for (i = 0; i < physmem_regions_sz; i++) { + if ((pa >= physmem_regions[i].mr_start) && + (pa < (physmem_regions[i].mr_start + + physmem_regions[i].mr_size))) { + attrib = _TLB_ENTRY_MEM; + break; + } + } + + return (attrib); +} + static inline void tlb_miss_lock(void) { @@ -1392,6 +1432,13 @@ mmu_booke_qremove(mmu_t mmu, vm_offset_t static void mmu_booke_kenter(mmu_t mmu, vm_offset_t va, vm_paddr_t pa) { + + mmu_booke_kenter_attr(mmu, va, pa, VM_MEMATTR_DEFAULT); +} + +static void +mmu_booke_kenter_attr(mmu_t mmu, vm_offset_t va, vm_paddr_t pa, vm_memattr_t ma) +{ unsigned int pdir_idx = PDIR_IDX(va); unsigned int ptbl_idx = PTBL_IDX(va); uint32_t flags; @@ -1400,7 +1447,8 @@ mmu_booke_kenter(mmu_t mmu, vm_offset_t KASSERT(((va >= VM_MIN_KERNEL_ADDRESS) && (va <= VM_MAX_KERNEL_ADDRESS)), ("mmu_booke_kenter: invalid va")); - flags = PTE_M | PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | PTE_VALID; + flags = PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | PTE_VALID; + flags |= tlb_calc_wimg(pa, ma); pte = &(kernel_pmap->pm_pdir[pdir_idx][ptbl_idx]); @@ -2595,6 +2643,13 @@ mmu_booke_scan_md(mmu_t mmu, struct pmap static void * mmu_booke_mapdev(mmu_t mmu, vm_paddr_t pa, vm_size_t size) { + + return (mmu_booke_mapdev_attr(mmu, pa, size, VM_MEMATTR_DEFAULT)); +} + +static void * +mmu_booke_mapdev_attr(mmu_t mmu, vm_paddr_t pa, vm_size_t size, vm_memattr_t ma) +{ void *res; uintptr_t va; vm_size_t sz; @@ -2606,22 +2661,28 @@ mmu_booke_mapdev(mmu_t mmu, vm_paddr_t p * would be 0. This creates a false positive (i.e. we think it's * within the CCSR) and not create a mapping. */ - if (pa >= ccsrbar_pa && (pa + size - 1) < (ccsrbar_pa + CCSRBAR_SIZE)) { + if (ma == VM_MEMATTR_DEFAULT && pa >= ccsrbar_pa && + (pa + size - 1) < (ccsrbar_pa + CCSRBAR_SIZE)) { va = CCSRBAR_VA + (pa - ccsrbar_pa); return ((void *)va); } - va = (pa >= 0x80000000) ? pa : (0xe2000000 + pa); - res = (void *)va; if (size < PAGE_SIZE) size = PAGE_SIZE; + if (pa >= (VM_MAXUSER_ADDRESS + PAGE_SIZE) && + (pa + size - 1) < VM_MIN_KERNEL_ADDRESS) + va = pa; + else + va = kva_alloc(size); + res = (void *)va; + do { sz = 1 << (ilog2(size) & ~1); if (bootverbose) printf("Wiring VA=%x to PA=%x (size=%x), " "using TLB1[%d]\n", va, pa, sz, tlb1_idx); - tlb1_set_entry(va, pa, sz, _TLB_ENTRY_IO); + tlb1_set_entry(va, pa, sz, tlb_calc_wimg(pa, ma)); size -= sz; pa += sz; va += sz; From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 14:54:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7592AC6D; Sat, 26 Oct 2013 14:54:44 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 623D321BF; Sat, 26 Oct 2013 14:54:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QEsihb006449; Sat, 26 Oct 2013 14:54:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QEsiGJ006448; Sat, 26 Oct 2013 14:54:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310261454.r9QEsiGJ006448@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 26 Oct 2013 14:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257162 - head/sys/powerpc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 14:54:44 -0000 Author: nwhitehorn Date: Sat Oct 26 14:54:43 2013 New Revision: 257162 URL: http://svnweb.freebsd.org/changeset/base/257162 Log: The old trap.h (then trap_aim.h) actually had trap ID codes for Book-E CPUs. Use it universally. Book-E traps may also need revisiting due to the introduction of fixed-offset traps and the deprecation of IVORs in POWER ISA 2.06, but that's very much an issue for another day. Deleted: head/sys/powerpc/include/trap_aim.h head/sys/powerpc/include/trap_booke.h Modified: head/sys/powerpc/include/trap.h Modified: head/sys/powerpc/include/trap.h ============================================================================== --- head/sys/powerpc/include/trap.h Sat Oct 26 14:52:55 2013 (r257161) +++ head/sys/powerpc/include/trap.h Sat Oct 26 14:54:43 2013 (r257162) @@ -1,8 +1,128 @@ -/* $FreeBSD$ */ +/*- + * Copyright (C) 1995, 1996 Wolfgang Solfrank. + * Copyright (C) 1995, 1996 TooLs GmbH. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by TooLs GmbH. + * 4. The name of TooLs GmbH may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $NetBSD: trap.h,v 1.7 2002/02/22 13:51:40 kleink Exp $ + * $FreeBSD$ + */ -#if defined(AIM) -#include -#elif defined(BOOKE) -#include +#ifndef _POWERPC_TRAP_H_ +#define _POWERPC_TRAP_H_ + +#define EXC_RSVD 0x0000 /* Reserved */ +#define EXC_RST 0x0100 /* Reset; all but IBM4xx */ +#define EXC_MCHK 0x0200 /* Machine Check */ +#define EXC_DSI 0x0300 /* Data Storage Interrupt */ +#define EXC_DSE 0x0380 /* Data Segment Interrupt */ +#define EXC_ISI 0x0400 /* Instruction Storage Interrupt */ +#define EXC_ISE 0x0480 /* Instruction Segment Interrupt */ +#define EXC_EXI 0x0500 /* External Interrupt */ +#define EXC_ALI 0x0600 /* Alignment Interrupt */ +#define EXC_PGM 0x0700 /* Program Interrupt */ +#define EXC_FPU 0x0800 /* Floating-point Unavailable */ +#define EXC_DECR 0x0900 /* Decrementer Interrupt */ +#define EXC_SC 0x0c00 /* System Call */ +#define EXC_TRC 0x0d00 /* Trace */ +#define EXC_FPA 0x0e00 /* Floating-point Assist */ + +/* The following is only available on the 601: */ +#define EXC_RUNMODETRC 0x2000 /* Run Mode/Trace Exception */ + +/* The following are only available on 970(G5): */ +#define EXC_VECAST_G5 0x1700 /* AltiVec Assist */ + +/* The following are only available on 7400(G4): */ +#define EXC_VEC 0x0f20 /* AltiVec Unavailable */ +#define EXC_VECAST_G4 0x1600 /* AltiVec Assist */ + +/* The following are only available on 604/750/7400: */ +#define EXC_PERF 0x0f00 /* Performance Monitoring */ +#define EXC_BPT 0x1300 /* Instruction Breakpoint */ +#define EXC_SMI 0x1400 /* System Managment Interrupt */ + +/* The following are only available on 750/7400: */ +#define EXC_THRM 0x1700 /* Thermal Management Interrupt */ + +/* And these are only on the 603: */ +#define EXC_IMISS 0x1000 /* Instruction translation miss */ +#define EXC_DLMISS 0x1100 /* Data load translation miss */ +#define EXC_DSMISS 0x1200 /* Data store translation miss */ + +/* The following are available on 4xx and 85xx */ +#define EXC_CRIT 0x0100 /* Critical Input Interrupt */ +#define EXC_PIT 0x1000 /* Programmable Interval Timer */ +#define EXC_FIT 0x1010 /* Fixed Interval Timer */ +#define EXC_WDOG 0x1020 /* Watchdog Timer */ +#define EXC_DTMISS 0x1100 /* Data TLB Miss */ +#define EXC_ITMISS 0x1200 /* Instruction TLB Miss */ +#define EXC_APU 0x1300 /* Auxiliary Processing Unit */ +#define EXC_DEBUG 0x2000 /* Debug trap */ + +#define EXC_LAST 0x2f00 /* Last possible exception vector */ + +#define EXC_AST 0x3000 /* Fake AST vector */ + +/* Trap was in user mode */ +#define EXC_USER 0x10000 + + +/* + * EXC_ALI sets bits in the DSISR and DAR to provide enough + * information to recover from the unaligned access without needing to + * parse the offending instruction. This includes certain bits of the + * opcode, and information about what registers are used. The opcode + * indicator values below come from Appendix F of Book III of "The + * PowerPC Architecture". + */ + +#define EXC_ALI_OPCODE_INDICATOR(dsisr) ((dsisr >> 10) & 0x7f) +#define EXC_ALI_LFD 0x09 +#define EXC_ALI_STFD 0x0b + +/* Macros to extract register information */ +#define EXC_ALI_RST(dsisr) ((dsisr >> 5) & 0x1f) /* source or target */ +#define EXC_ALI_RA(dsisr) (dsisr & 0x1f) + +/* + * SRR1 bits for program exception traps. These identify what caused + * the program exception. See section 6.5.9 of the Power ISA Version + * 2.05. + */ + +#define EXC_PGM_FPENABLED (1UL << 20) +#define EXC_PGM_ILLEGAL (1UL << 19) +#define EXC_PGM_PRIV (1UL << 18) +#define EXC_PGM_TRAP (1UL << 17) + +#ifndef LOCORE +struct trapframe; +void trap(struct trapframe *); #endif +#endif /* _POWERPC_TRAP_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 15:02:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B6791FD3; Sat, 26 Oct 2013 15:02:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A44A4220E; Sat, 26 Oct 2013 15:02:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QF2Y8F009751; Sat, 26 Oct 2013 15:02:34 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QF2YnN009750; Sat, 26 Oct 2013 15:02:34 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310261502.r9QF2YnN009750@svn.freebsd.org> From: Bryan Drewery Date: Sat, 26 Oct 2013 15:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257164 - head/etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 15:02:34 -0000 Author: bdrewery (ports committer) Date: Sat Oct 26 15:02:34 2013 New Revision: 257164 URL: http://svnweb.freebsd.org/changeset/base/257164 Log: Add missing /etc/pkg to BSD.root.dist Approved by: bapt MFC after: 2 days X-MFC-With: r257145 Modified: head/etc/mtree/BSD.root.dist Modified: head/etc/mtree/BSD.root.dist ============================================================================== --- head/etc/mtree/BSD.root.dist Sat Oct 26 14:57:08 2013 (r257163) +++ head/etc/mtree/BSD.root.dist Sat Oct 26 15:02:34 2013 (r257164) @@ -60,6 +60,8 @@ weekly .. .. + pkg + .. ppp .. rc.d From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 15:05:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B71A92AB; Sat, 26 Oct 2013 15:05:27 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8CBA3221E; Sat, 26 Oct 2013 15:05:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QF5Rjo010224; Sat, 26 Oct 2013 15:05:27 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QF5R7g010223; Sat, 26 Oct 2013 15:05:27 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201310261505.r9QF5R7g010223@svn.freebsd.org> From: John-Mark Gurney Date: Sat, 26 Oct 2013 15:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257165 - head/sbin/mdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 15:05:27 -0000 Author: jmg Date: Sat Oct 26 15:05:27 2013 New Revision: 257165 URL: http://svnweb.freebsd.org/changeset/base/257165 Log: Document that -a will output the device name when -u is not specified.. when -u is specified it is not... update the docs to say that you can use full device names w/ -u, and update the examples... Submitted by: #vbsdcon MFC after: 3 days Modified: head/sbin/mdconfig/mdconfig.8 Modified: head/sbin/mdconfig/mdconfig.8 ============================================================================== --- head/sbin/mdconfig/mdconfig.8 Sat Oct 26 15:02:34 2013 (r257164) +++ head/sbin/mdconfig/mdconfig.8 Sat Oct 26 15:05:27 2013 (r257165) @@ -89,6 +89,9 @@ Options indicate an action to be perform Attach a memory disk. This will configure and attach a memory disk with the parameters specified and attach it to the system. +If the +.Fl u Ar unit +option is not provided, the newly created device name will be printed on stdout. .It Fl d Detach a memory disk from the system and release all resources. .It Fl r @@ -209,9 +212,12 @@ that might adversely affect the system. Enable/disable readonly mode. .El .It Fl u Ar unit -Request a specific unit number for the +Request a specific unit number or device name for the .Xr md 4 device instead of automatic allocation. +If a device name is specified, it must be start with +.Dq md +followed by the unit number. .El .Pp The last form, @@ -237,19 +243,19 @@ with .Pa /tmp/boot.flp as backing storage: .Pp -.Dl mdconfig -a -t vnode -f /tmp/boot.flp -u 4 +.Dl mdconfig -a -t vnode -f /tmp/boot.flp -u md4 .Pp Detach and free all resources used by .Pa /dev/md4 : .Pp -.Dl mdconfig -d -u 4 +.Dl mdconfig -d -u md4 .Pp Create a 128MByte swap backed disk, initialize an .Xr ffs 7 file system on it, and mount it on .Pa /tmp : .Bd -literal -offset indent -mdconfig -a -t swap -s 128M -u 10 +mdconfig -a -t swap -s 128M -u md10 newfs -U /dev/md10 mount /dev/md10 /tmp chmod 1777 /tmp @@ -263,7 +269,7 @@ are implied .Pc : .Bd -literal -offset indent dd if=/dev/zero of=somebackingfile bs=1k count=5k -mdconfig -f somebackingfile -u 0 +mdconfig -f somebackingfile -u md0 bsdlabel -w md0 auto newfs md0c mount /dev/md0c /mnt @@ -290,7 +296,7 @@ is used to skip over the header informat .Pa md1.nop to the start of the filesystem in the image. .Bd -literal -offset indent -mdconfig -f diskimage.img -u 1 +mdconfig -f diskimage.img -u md1 gnop create -o 512K md1 mount /dev/md1.nop /mnt .Ed From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 15:10:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 68273548; Sat, 26 Oct 2013 15:10:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 548882285; Sat, 26 Oct 2013 15:10:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QFAxuS013135; Sat, 26 Oct 2013 15:10:59 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QFAxrw013134; Sat, 26 Oct 2013 15:10:59 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310261510.r9QFAxrw013134@svn.freebsd.org> From: Glen Barber Date: Sat, 26 Oct 2013 15:10:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257166 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 15:10:59 -0000 Author: gjb Date: Sat Oct 26 15:10:58 2013 New Revision: 257166 URL: http://svnweb.freebsd.org/changeset/base/257166 Log: Update stable/10 to BETA2 as part of the 10.0-RELEASE cycle. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/conf/newvers.sh Modified: stable/10/sys/conf/newvers.sh ============================================================================== --- stable/10/sys/conf/newvers.sh Sat Oct 26 15:05:27 2013 (r257165) +++ stable/10/sys/conf/newvers.sh Sat Oct 26 15:10:58 2013 (r257166) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.0" -BRANCH="BETA1" +BRANCH="BETA2" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 15:15:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 90F42776; Sat, 26 Oct 2013 15:15:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7E98622B6; Sat, 26 Oct 2013 15:15:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QFFWKo013980; Sat, 26 Oct 2013 15:15:32 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QFFW1w013979; Sat, 26 Oct 2013 15:15:32 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310261515.r9QFFW1w013979@svn.freebsd.org> From: Ian Lepore Date: Sat, 26 Oct 2013 15:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257167 - head/sys/dev/ffec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 15:15:32 -0000 Author: ian Date: Sat Oct 26 15:15:31 2013 New Revision: 257167 URL: http://svnweb.freebsd.org/changeset/base/257167 Log: Switch to using ofw_bus_search_compatible() table-driven compat lookup. Add compat strings for Freescale Vybrid family SoCs. Modified: head/sys/dev/ffec/if_ffec.c Modified: head/sys/dev/ffec/if_ffec.c ============================================================================== --- head/sys/dev/ffec/if_ffec.c Sat Oct 26 15:10:58 2013 (r257166) +++ head/sys/dev/ffec/if_ffec.c Sat Oct 26 15:15:31 2013 (r257167) @@ -86,6 +86,38 @@ __FBSDID("$FreeBSD$"); #include "miibus_if.h" /* + * There are small differences in the hardware on various SoCs. Not every SoC + * we support has its own FECTYPE; most work as GENERIC and only the ones that + * need different handling get their own entry. In addition to the types in + * this list, there are some flags below that can be ORed into the upper bits. + */ +enum { + FECTYPE_NONE, + FECTYPE_GENERIC, + FECTYPE_IMX53, + FECTYPE_IMX6, +}; + +/* + * Flags that describe general differences between the FEC hardware in various + * SoCs. These are ORed into the FECTYPE enum values. + */ +#define FECTYPE_MASK 0x0000ffff +#define FECFLAG_GBE (0x0001 << 16) + +/* + * Table of supported FDT compat strings and their associated FECTYPE values. + */ +static struct ofw_compat_data compat_data[] = { + {"fsl,imx51-fec", FECTYPE_GENERIC}, + {"fsl,imx53-fec", FECTYPE_IMX53}, + {"fsl,imx6q-fec", FECTYPE_IMX6 | FECFLAG_GBE}, + {"fsl,mvf600-fec", FECTYPE_GENERIC}, + {"fsl,vf-fec", FECTYPE_GENERIC}, + {NULL, FECTYPE_NONE}, +}; + +/* * Driver data and defines. */ #define RX_DESC_COUNT 64 @@ -108,13 +140,6 @@ enum { PHY_CONN_RGMII }; -enum { - FECTYPE_GENERIC, - FECTYPE_IMX51, - FECTYPE_IMX53, - FECTYPE_IMX6, -}; - struct ffec_softc { device_t dev; device_t miibus; @@ -226,7 +251,7 @@ ffec_miigasket_setup(struct ffec_softc * * We only need the gasket for MII and RMII connections on certain SoCs. */ - switch (sc->fectype) + switch (sc->fectype & FECTYPE_MASK) { case FECTYPE_IMX53: break; @@ -1404,14 +1429,7 @@ ffec_attach(device_t dev) * There are differences in the implementation and features of the FEC * hardware on different SoCs, so figure out what type we are. */ - if (ofw_bus_is_compatible(dev, "fsl,imx51-fec")) - sc->fectype = FECTYPE_IMX51; - else if (ofw_bus_is_compatible(dev, "fsl,imx53-fec")) - sc->fectype = FECTYPE_IMX53; - else if (ofw_bus_is_compatible(dev, "fsl,imx6q-fec")) - sc->fectype = FECTYPE_IMX6; - else - sc->fectype = FECTYPE_GENERIC; + sc->fectype = ofw_bus_search_compatible(dev, compat_data)->ocd_data; /* * We have to be told what kind of electrical connection exists between @@ -1691,15 +1709,16 @@ out: static int ffec_probe(device_t dev) { + uintptr_t fectype; - if (ofw_bus_is_compatible(dev, "fsl,imx51-fec") || - ofw_bus_is_compatible(dev, "fsl,imx53-fec")) { - device_set_desc(dev, "Freescale Fast Ethernet Controller"); - } else if (ofw_bus_is_compatible(dev, "fsl,imx6q-fec")) { - device_set_desc(dev, "Freescale Gigabit Ethernet Controller"); - } else { + fectype = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + if (fectype == FECTYPE_NONE) return (ENXIO); - } + + device_set_desc(dev, (fectype & FECFLAG_GBE) ? + "Freescale Gigabit Ethernet Controller" : + "Freescale Fast Ethernet Controller"); + return (BUS_PROBE_DEFAULT); } From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 16:11:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9CBADB4F for ; Sat, 26 Oct 2013 16:11:10 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 70F482586 for ; Sat, 26 Oct 2013 16:11:10 +0000 (UTC) Received: by mail-pa0-f43.google.com with SMTP id hz1so5339415pad.16 for ; Sat, 26 Oct 2013 09:11:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type; bh=2cy7tvrPE04t0ox5nlYJuycwMfSQLMLnmgw2mCIuwXE=; b=EGlPinT0jS7TXsfvlpa6TPiI0tKr6KNkESg6vrjtU1vAZ7PIXeXl39zKUfl/tMtoBN Bfo+1MgB8MdY93X/JOPUDL3mOF+ULw37GGpszvZDn9my8HScLhFLY9SXWKkWMvh40Xug F8+EfbXYUC8LX+PW6eHMra0+s/JltSPXWcGs8hvIJtaPJbTfONdOOfaaxg3EBh9f/rks EutvSLosnqaqFfNhNElg66f9c7d5iEf6m7ggwMbNUx/mzXQ7TFLOkquf4fTlqv969KEq ojrfbDxhR8VM7StSYl2m/w9C3sQtRaj3f+YG25hfz5lTkSJ0XevZoW29GsekwUOlChV2 P9TA== X-Gm-Message-State: ALoCoQlG5cruhv2mESqIH/3vlmIeKBNtA9/SAmyL5bQEbmn8zhyOt+YzDMMSiRcKd6Rypy5FJxjA X-Received: by 10.68.26.202 with SMTP id n10mr7325382pbg.97.1382803864358; Sat, 26 Oct 2013 09:11:04 -0700 (PDT) Received: from zont-osx.local (c-50-136-243-235.hsd1.ca.comcast.net. [50.136.243.235]) by mx.google.com with ESMTPSA id oj6sm21848427pab.9.2013.10.26.09.11.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 26 Oct 2013 09:11:03 -0700 (PDT) Sender: Andrey Zonov Message-ID: <526BE992.7010705@FreeBSD.org> Date: Sat, 26 Oct 2013 09:10:58 -0700 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Bryan Drewery Subject: Re: svn commit: r257164 - head/etc/mtree References: <201310261502.r9QF2YnN009750@svn.freebsd.org> In-Reply-To: <201310261502.r9QF2YnN009750@svn.freebsd.org> X-Enigmail-Version: 1.5.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8ppw8DjovWdWgbcOmBAfq7PC1sgLiRK9s" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 16:11:10 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --8ppw8DjovWdWgbcOmBAfq7PC1sgLiRK9s Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 10/26/13 8:02 AM, Bryan Drewery wrote: > Author: bdrewery (ports committer) > Date: Sat Oct 26 15:02:34 2013 > New Revision: 257164 > URL: http://svnweb.freebsd.org/changeset/base/257164 >=20 > Log: > Add missing /etc/pkg to BSD.root.dist > =20 > Approved by: bapt > MFC after: 2 days > X-MFC-With: r257145 >=20 > Modified: > head/etc/mtree/BSD.root.dist >=20 > Modified: head/etc/mtree/BSD.root.dist > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/etc/mtree/BSD.root.dist Sat Oct 26 14:57:08 2013 (r257163) > +++ head/etc/mtree/BSD.root.dist Sat Oct 26 15:02:34 2013 (r257164) > @@ -60,6 +60,8 @@ > weekly > .. > .. > + pkg > + .. > ppp > .. > rc.d >=20 etc/mtree/README: a) The files use 4 space indentation, and other than in the header comments, should not contain any tabs. Please fix it. --=20 Andrey Zonov --8ppw8DjovWdWgbcOmBAfq7PC1sgLiRK9s Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJSa+mWAAoJEBWLemxX/CvTVnsH/jTUHhv8m35ww/nxVH6Z9gKC BIP8vVJimqYmd7Uj6splkvN/bkSkJuEnkhN1updofypCIrPCBl9EcRQebl9c2wAg BY/OI+LM759hRmDtYgrAUF5NAL5IX56CM3qwxY3F82wbPDhWqV89EL2LEogdCA1D 2DPPx+w2Loq803dMKcr2dRzmlQP5PpIPqIyl9JV7VkfPdTUccNNc6ksf5qMkHPPB eaI8fXyyy7cEddbes2T1hUBfkVZ8qXpHDejt0QEuzWWCAHmz0TjD9C0S5jlIHiwR ImKdV0VprtpKOPbhpjv0wkCbTo8C4q4V6QtXIBj4d6RWGWH9Kf1RAhSXJc7mhBM= =tWqX -----END PGP SIGNATURE----- --8ppw8DjovWdWgbcOmBAfq7PC1sgLiRK9s-- From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 16:15:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A1837EA6 for ; Sat, 26 Oct 2013 16:15:38 +0000 (UTC) (envelope-from bryan@shatow.net) Received: from secure.xzibition.com (secure.xzibition.com [173.160.118.92]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 579B725D8 for ; Sat, 26 Oct 2013 16:15:38 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=shatow.net; h=date:from:to :cc:subject:message-id:references:mime-version:content-type :in-reply-to; q=dns; s=sweb; b=sSMXCL4E8wNV2jPRUrQ7MT9xwq5RYmdYc leKCt263MT/Q11DFmRXy4yTlbtp6WoWlRl1TA5WgVV+SUDRMQQR6vEbY8Ijbpd1k MPxSQmtnJhwG4gql8C23WG2jQFAPRBeGfG9vfiBKvVM2RFWAHrrCJTTLspPzadQZ 5mZlmWgov4= DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=shatow.net; h=date:from :to:cc:subject:message-id:references:mime-version:content-type :in-reply-to; s=sweb; bh=rstyDmafdwXwAqsrC5Cb/HP5Ncsfij9m5ZdkyqL ICX8=; b=yey08G59u7BysRfR769Avqtr0F0UJPSlOh0haQ58js+hql7CGVNfJtf nu3WIXeSr+Q6Fmj98rpaMyBd6Nvhnjt4VrSO0GfcBz4OPAPzdwGXiXakDzK5FwDI B/rACOFRLSxX49E3fqWR3brkwH52O2o51re5l7W63ivMBemYuDvc= Received: (qmail 81792 invoked from network); 26 Oct 2013 11:15:35 -0500 Received: from unknown (HELO admin.xzibition.com) (bryan@shatow.net@173.160.118.90) by sweb.xzibition.com with ESMTPA; 26 Oct 2013 11:15:35 -0500 Date: Sat, 26 Oct 2013 11:15:33 -0500 From: Bryan Drewery To: Andrey Zonov Subject: Re: svn commit: r257164 - head/etc/mtree Message-ID: <20131026161533.GG98118@admin.xzibition.com> References: <201310261502.r9QF2YnN009750@svn.freebsd.org> <526BE992.7010705@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5UGlQXeG3ziZS81+" Content-Disposition: inline In-Reply-To: <526BE992.7010705@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, Bryan Drewery X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 16:15:38 -0000 --5UGlQXeG3ziZS81+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 26, 2013 at 09:10:58AM -0700, Andrey Zonov wrote: > On 10/26/13 8:02 AM, Bryan Drewery wrote: > > Author: bdrewery (ports committer) > > Date: Sat Oct 26 15:02:34 2013 > > New Revision: 257164 > > URL: http://svnweb.freebsd.org/changeset/base/257164 > >=20 > > Log: > > Add missing /etc/pkg to BSD.root.dist > > =20 > > Approved by: bapt > > MFC after: 2 days > > X-MFC-With: r257145 > >=20 > > Modified: > > head/etc/mtree/BSD.root.dist > >=20 > > Modified: head/etc/mtree/BSD.root.dist > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/etc/mtree/BSD.root.dist Sat Oct 26 14:57:08 2013 (r257163) > > +++ head/etc/mtree/BSD.root.dist Sat Oct 26 15:02:34 2013 (r257164) > > @@ -60,6 +60,8 @@ > > weekly > > .. > > .. > > + pkg > > + .. > > ppp > > .. > > rc.d > >=20 >=20 > etc/mtree/README: >=20 > a) The files use 4 space indentation, and other than in the header > comments, should not contain any tabs. >=20 > Please fix it. Woops, vim strikes! Thanks for pointing out. >=20 > --=20 > Andrey Zonov >=20 --5UGlQXeG3ziZS81+ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.21 (FreeBSD) iQJ8BAEBCgBmBQJSa+qlXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQzNkZFQkU5OTJGNTI4MERGNDgxMTM2MkE2 RTc4MkFDMDNDOUIwQ0Y5AAoJEG54KsA8mwz5WiUP/iQzbzgeoVnXMPIwdhi2hStY JBXlKNW92AxEnayY1bzgic1fnuGCZ2wnA4kKO4HGb8VyC22J8oSk1W3m8CmNmTCa N6LV0NW0O+JQw1uOAQA+IH7LWEwcIfPtvLYVucCk9xKMLl++jlHyZ4woaxPx+wDI yAkp0cr9Dx5lrXGplKbNJyfNg5uU92bmarM1Ww7UtLjBda9u//OIi9uwaFF791aP 2i3i5tPiRIeefi/+LTSXVMmHyvpdn7WmpcxLu0pX0j2eIVijlQnSh6EW5v1KZGg8 ollUwdzCF2urER5Nw3KU6fqrigUwxPSYQE6vyc/Vrx7CqDTnRkGrGX4RJsfUL1BI lXjPXTqHl1dJ4OKXAQbFv3bLp0PlOEVC4Zqu7+/yxIsKWCBX8MX1u6g+wH4Fp014 U8eKYb6iVDNWZUGun4RTMrDkgwBqcoIrzsWAYYGYI/m9EDWQFd2MdwwBbOPHzDuj ORNjWlJ0h4k7X352QxWTLPGOs/ol+ndFp/lmHeterjlNfYOKDEDkPeaqrZJHZshF GahQOmif4y+MWawtq7O9zQFLuuKXVJ5neCNTOpiGzzUqaDsgWLBrLQ89F6euhWVt OJg96fM6I3GZYH8LhDK3Qk2NwpUXAMMZAeTg7Xel3oakkl7VfqzPks5hOZLVd6CR CJVXK15rcj1BgZoRRw/c =D61A -----END PGP SIGNATURE----- --5UGlQXeG3ziZS81+-- From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 16:19:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B1B981EB; Sat, 26 Oct 2013 16:19:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9FBA4260A; Sat, 26 Oct 2013 16:19:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QGJE86034958; Sat, 26 Oct 2013 16:19:14 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QGJEQa034957; Sat, 26 Oct 2013 16:19:14 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310261619.r9QGJEQa034957@svn.freebsd.org> From: Bryan Drewery Date: Sat, 26 Oct 2013 16:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257168 - head/etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 16:19:14 -0000 Author: bdrewery (ports committer) Date: Sat Oct 26 16:19:14 2013 New Revision: 257168 URL: http://svnweb.freebsd.org/changeset/base/257168 Log: Fix indentation Reported by: zont Approved by: bapt (implicit) MFC after: 2 days X-MFC-With: r257145 Modified: head/etc/mtree/BSD.root.dist Modified: head/etc/mtree/BSD.root.dist ============================================================================== --- head/etc/mtree/BSD.root.dist Sat Oct 26 15:15:31 2013 (r257167) +++ head/etc/mtree/BSD.root.dist Sat Oct 26 16:19:14 2013 (r257168) @@ -35,13 +35,13 @@ gss .. keys - pkg + pkg revoked .. trusted .. - .. - .. + .. + .. mail .. mtree @@ -60,8 +60,8 @@ weekly .. .. - pkg - .. + pkg + .. ppp .. rc.d From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 16:49:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C940EE8C; Sat, 26 Oct 2013 16:49:41 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9B7042754; Sat, 26 Oct 2013 16:49:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QGnfeQ045168; Sat, 26 Oct 2013 16:49:41 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QGnfSB045167; Sat, 26 Oct 2013 16:49:41 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310261649.r9QGnfSB045167@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 26 Oct 2013 16:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257169 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 16:49:41 -0000 Author: nwhitehorn Date: Sat Oct 26 16:49:41 2013 New Revision: 257169 URL: http://svnweb.freebsd.org/changeset/base/257169 Log: Fix concurrency issues with TLB1 updates and make pmap_kextract() search TLB1 mappings as well, which is required for the console to work after r257111. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sat Oct 26 16:19:14 2013 (r257168) +++ head/sys/powerpc/booke/pmap.c Sat Oct 26 16:49:41 2013 (r257169) @@ -1355,6 +1355,15 @@ mmu_booke_extract(mmu_t mmu, pmap_t pmap static vm_paddr_t mmu_booke_kextract(mmu_t mmu, vm_offset_t va) { + int i; + + /* Check TLB1 mappings */ + for (i = 0; i < tlb1_idx; i++) { + if (!(tlb1[i].mas1 & MAS1_VALID)) + continue; + if (va >= tlb1[i].virt && va < tlb1[i].virt + tlb1[i].size) + return (tlb1[i].phys + (va - tlb1[i].virt)); + } return (pte_vatopa(mmu, kernel_pmap, va)); } @@ -2697,6 +2706,7 @@ mmu_booke_mapdev_attr(mmu_t mmu, vm_padd static void mmu_booke_unmapdev(mmu_t mmu, vm_offset_t va, vm_size_t size) { +#ifdef SUPPORTS_SHRINKING_TLB1 vm_offset_t base, offset; /* @@ -2708,6 +2718,7 @@ mmu_booke_unmapdev(mmu_t mmu, vm_offset_ size = roundup(offset + size, PAGE_SIZE); kva_free(base, size); } +#endif } /* @@ -2974,9 +2985,10 @@ tlb1_set_entry(vm_offset_t va, vm_offset uint32_t flags) { uint32_t ts, tid; - int tsize; - - if (tlb1_idx >= TLB1_ENTRIES) { + int tsize, index; + + index = atomic_fetchadd_int(&tlb1_idx, 1); + if (index >= TLB1_ENTRIES) { printf("tlb1_set_entry: TLB1 full!\n"); return (-1); } @@ -2988,18 +3000,22 @@ tlb1_set_entry(vm_offset_t va, vm_offset /* XXX TS is hard coded to 0 for now as we only use single address space */ ts = (0 << MAS1_TS_SHIFT) & MAS1_TS_MASK; - /* XXX LOCK tlb1[] */ + /* + * Atomicity is preserved by the atomic increment above since nothing + * is ever removed from tlb1. + */ - tlb1[tlb1_idx].mas1 = MAS1_VALID | MAS1_IPROT | ts | tid; - tlb1[tlb1_idx].mas1 |= ((tsize << MAS1_TSIZE_SHIFT) & MAS1_TSIZE_MASK); - tlb1[tlb1_idx].mas2 = (va & MAS2_EPN_MASK) | flags; + tlb1[index].phys = pa; + tlb1[index].virt = va; + tlb1[index].size = size; + tlb1[index].mas1 = MAS1_VALID | MAS1_IPROT | ts | tid; + tlb1[index].mas1 |= ((tsize << MAS1_TSIZE_SHIFT) & MAS1_TSIZE_MASK); + tlb1[index].mas2 = (va & MAS2_EPN_MASK) | flags; /* Set supervisor RWX permission bits */ - tlb1[tlb1_idx].mas3 = (pa & MAS3_RPN) | MAS3_SR | MAS3_SW | MAS3_SX; - - tlb1_write_entry(tlb1_idx++); + tlb1[index].mas3 = (pa & MAS3_RPN) | MAS3_SR | MAS3_SW | MAS3_SX; - /* XXX UNLOCK tlb1[] */ + tlb1_write_entry(index); /* * XXX in general TLB1 updates should be propagated between CPUs, From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 17:25:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5F180B70; Sat, 26 Oct 2013 17:25:00 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3273128E0; Sat, 26 Oct 2013 17:25:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QHP0KF058745; Sat, 26 Oct 2013 17:25:00 GMT (envelope-from zbb@svn.freebsd.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QHOxfn058729; Sat, 26 Oct 2013 17:24:59 GMT (envelope-from zbb@svn.freebsd.org) Message-Id: <201310261724.r9QHOxfn058729@svn.freebsd.org> From: Zbigniew Bodek Date: Sat, 26 Oct 2013 17:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257170 - in head/sys/dev: ic uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 17:25:00 -0000 Author: zbb Date: Sat Oct 26 17:24:59 2013 New Revision: 257170 URL: http://svnweb.freebsd.org/changeset/base/257170 Log: Wait for DesignWare UART transfers completion before accessing line control When using DW UART with BUSY detection it is necessary to wait until all serial transfers are finished before manipulating the line control. LCR will not be affected when UART is busy. In addition, if Divisor Latch Access Bit is being set in order to modify UART divisors: 1. We will get BUSY interrupt if interrupts are enabled. 2. Because LCR will not be affected the THR and (even worse) IER contents will be corrupted. This will lead to console hang. Approved by: cognet (mentor) Modified: head/sys/dev/ic/ns16550.h head/sys/dev/uart/uart_dev_ns8250.c Modified: head/sys/dev/ic/ns16550.h ============================================================================== --- head/sys/dev/ic/ns16550.h Sat Oct 26 16:49:41 2013 (r257169) +++ head/sys/dev/ic/ns16550.h Sat Oct 26 17:24:59 2013 (r257170) @@ -185,6 +185,7 @@ #define DW_REG_USR 31 /* DesignWare derived Uart Status Reg */ #define com_usr 39 /* Octeon 16750/16550 Uart Status Reg */ #define REG_USR com_usr +#define USR_BUSY 1 /* Uart Busy. Serial transfer in progress */ #define USR_TXFIFO_NOTFULL 2 /* Uart TX FIFO Not full */ /* 16950 register #1. Access enabled by ACR[7]. Also requires !LCR[7]. */ Modified: head/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- head/sys/dev/uart/uart_dev_ns8250.c Sat Oct 26 16:49:41 2013 (r257169) +++ head/sys/dev/uart/uart_dev_ns8250.c Sat Oct 26 17:24:59 2013 (r257170) @@ -647,11 +647,35 @@ int ns8250_bus_param(struct uart_softc *sc, int baudrate, int databits, int stopbits, int parity) { + struct ns8250_softc *ns8250; struct uart_bas *bas; - int error; + int error, limit; + ns8250 = (struct ns8250_softc*)sc; bas = &sc->sc_bas; uart_lock(sc->sc_hwmtx); + /* + * When using DW UART with BUSY detection it is necessary to wait + * until all serial transfers are finished before manipulating the + * line control. LCR will not be affected when UART is busy. + */ + if (ns8250->busy_detect != 0) { + /* + * Pick an arbitrary high limit to avoid getting stuck in + * an infinite loop in case when the hardware is broken. + */ + limit = 10 * 1024; + while (((uart_getreg(bas, DW_REG_USR) & USR_BUSY) != 0) && + --limit) + DELAY(4); + + if (limit <= 0) { + /* UART appears to be stuck */ + uart_unlock(sc->sc_hwmtx); + return (EIO); + } + } + error = ns8250_param(bas, baudrate, databits, stopbits, parity); uart_unlock(sc->sc_hwmtx); return (error); From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 17:27:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 60B1ACCE; Sat, 26 Oct 2013 17:27:33 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4EC9328F0; Sat, 26 Oct 2013 17:27:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QHRXWJ059061; Sat, 26 Oct 2013 17:27:33 GMT (envelope-from zbb@svn.freebsd.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QHRXwK059060; Sat, 26 Oct 2013 17:27:33 GMT (envelope-from zbb@svn.freebsd.org) Message-Id: <201310261727.r9QHRXwK059060@svn.freebsd.org> From: Zbigniew Bodek Date: Sat, 26 Oct 2013 17:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257171 - head/sys/boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 17:27:33 -0000 Author: zbb Date: Sat Oct 26 17:27:32 2013 New Revision: 257171 URL: http://svnweb.freebsd.org/changeset/base/257171 Log: Enable UART busy detection handling for Armada XP - based board All Armada XP chips should be affected. It is necessary to handle busy interrupt/indication by enabling busy-detect property in DTS. Tested by: kevlo Approved by: cognet (mentor) Modified: head/sys/boot/fdt/dts/db78460.dts Modified: head/sys/boot/fdt/dts/db78460.dts ============================================================================== --- head/sys/boot/fdt/dts/db78460.dts Sat Oct 26 17:24:59 2013 (r257170) +++ head/sys/boot/fdt/dts/db78460.dts Sat Oct 26 17:27:32 2013 (r257171) @@ -116,6 +116,7 @@ reg-shift = <2>; current-speed = <115200>; clock-frequency = <0>; + busy-detect = <1>; interrupts = <41>; interrupt-parent = <&MPIC>; }; @@ -126,6 +127,7 @@ reg-shift = <2>; current-speed = <115200>; clock-frequency = <0>; + busy-detect = <1>; interrupts = <42>; interrupt-parent = <&MPIC>; }; @@ -136,6 +138,7 @@ reg-shift = <2>; current-speed = <115200>; clock-frequency = <0>; + busy-detect = <1>; interrupts = <43>; interrupt-parent = <&MPIC>; }; @@ -146,6 +149,7 @@ reg-shift = <2>; current-speed = <115200>; clock-frequency = <0>; + busy-detect = <1>; interrupts = <44>; interrupt-parent = <&MPIC>; }; From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 17:29:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id ED3EBE38; Sat, 26 Oct 2013 17:29:50 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DA648290D; Sat, 26 Oct 2013 17:29:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QHToMU059328; Sat, 26 Oct 2013 17:29:50 GMT (envelope-from zbb@svn.freebsd.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QHToRT059326; Sat, 26 Oct 2013 17:29:50 GMT (envelope-from zbb@svn.freebsd.org) Message-Id: <201310261729.r9QHToRT059326@svn.freebsd.org> From: Zbigniew Bodek Date: Sat, 26 Oct 2013 17:29:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257172 - in head/sys: arm/mv boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 17:29:51 -0000 Author: zbb Date: Sat Oct 26 17:29:50 2013 New Revision: 257172 URL: http://svnweb.freebsd.org/changeset/base/257172 Log: Enable SATA interface on Armada XP - Add appropriate entry to DTS - Allow for MV78460 SATA probe and configuration Tested by: kevlo Approved by: cognet (mentor) Modified: head/sys/arm/mv/mv_sata.c head/sys/boot/fdt/dts/db78460.dts Modified: head/sys/arm/mv/mv_sata.c ============================================================================== --- head/sys/arm/mv/mv_sata.c Sat Oct 26 17:27:32 2013 (r257171) +++ head/sys/arm/mv/mv_sata.c Sat Oct 26 17:29:50 2013 (r257172) @@ -200,6 +200,7 @@ sata_probe(device_t dev) case MV_DEV_88F6282: case MV_DEV_MV78100: case MV_DEV_MV78100_Z0: + case MV_DEV_MV78460: sc->sc_version = 2; sc->sc_edma_qlen = 32; break; Modified: head/sys/boot/fdt/dts/db78460.dts ============================================================================== --- head/sys/boot/fdt/dts/db78460.dts Sat Oct 26 17:27:32 2013 (r257171) +++ head/sys/boot/fdt/dts/db78460.dts Sat Oct 26 17:29:50 2013 (r257172) @@ -283,6 +283,13 @@ }; }; }; + + sata@A0000 { + compatible = "mrvl,sata"; + reg = <0xA0000 0x6000>; + interrupts = <55>; + interrupt-parent = <&MPIC>; + }; }; pci0: pcie@d0040000 { From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 17:40:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 473B4336; Sat, 26 Oct 2013 17:40:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 257D329A4; Sat, 26 Oct 2013 17:40:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QHedGi064595; Sat, 26 Oct 2013 17:40:39 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QHecK2064593; Sat, 26 Oct 2013 17:40:38 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310261740.r9QHecK2064593@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 26 Oct 2013 17:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257173 - head/sys/dev/bce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 17:40:39 -0000 Author: glebius Date: Sat Oct 26 17:40:38 2013 New Revision: 257173 URL: http://svnweb.freebsd.org/changeset/base/257173 Log: Move includes from if_bcereg.h to .c files. Modified: head/sys/dev/bce/if_bce.c head/sys/dev/bce/if_bcereg.h Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Sat Oct 26 17:29:50 2013 (r257172) +++ head/sys/dev/bce/if_bce.c Sat Oct 26 17:40:38 2013 (r257173) @@ -53,6 +53,54 @@ __FBSDID("$FreeBSD$"); #include "opt_bce.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include "miidevs.h" +#include + +#include +#include + +#include "miibus_if.h" + #include #include Modified: head/sys/dev/bce/if_bcereg.h ============================================================================== --- head/sys/dev/bce/if_bcereg.h Sat Oct 26 17:29:50 2013 (r257172) +++ head/sys/dev/bce/if_bcereg.h Sat Oct 26 17:40:38 2013 (r257173) @@ -32,51 +32,6 @@ #ifndef _BCEREG_H_DEFINED #define _BCEREG_H_DEFINED -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include "miidevs.h" -#include - -#include -#include - -#include "miibus_if.h" - /****************************************************************************/ /* Conversion to FreeBSD type definitions. */ /****************************************************************************/ From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 17:43:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4A656488; Sat, 26 Oct 2013 17:43:19 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 36A4E29D8; Sat, 26 Oct 2013 17:43:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QHhJ45065075; Sat, 26 Oct 2013 17:43:19 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QHhJeu065074; Sat, 26 Oct 2013 17:43:19 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310261743.r9QHhJeu065074@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 26 Oct 2013 17:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257174 - head/sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 17:43:19 -0000 Author: glebius Date: Sat Oct 26 17:43:18 2013 New Revision: 257174 URL: http://svnweb.freebsd.org/changeset/base/257174 Log: Remove unsigned < 0 comparison. Modified: head/sys/netgraph/ng_one2many.c Modified: head/sys/netgraph/ng_one2many.c ============================================================================== --- head/sys/netgraph/ng_one2many.c Sat Oct 26 17:40:38 2013 (r257173) +++ head/sys/netgraph/ng_one2many.c Sat Oct 26 17:43:18 2013 (r257174) @@ -220,7 +220,7 @@ ng_one2many_newhook(node_p node, hook_p if (!isdigit(*cp) || (cp[0] == '0' && cp[1] != '\0')) return (EINVAL); i = strtoul(cp, &eptr, 10); - if (*eptr != '\0' || i < 0 || i >= NG_ONE2MANY_MAX_LINKS) + if (*eptr != '\0' || i >= NG_ONE2MANY_MAX_LINKS) return (EINVAL); linkNum = (int)i; link = &priv->many[linkNum]; From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 17:54:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3558295F; Sat, 26 Oct 2013 17:54:32 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 229CA2A73; Sat, 26 Oct 2013 17:54:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QHsVnC068498; Sat, 26 Oct 2013 17:54:31 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QHsVrO068492; Sat, 26 Oct 2013 17:54:31 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310261754.r9QHsVrO068492@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 26 Oct 2013 17:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257175 - in head/sys/powerpc: aim pseries X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 17:54:32 -0000 Author: nwhitehorn Date: Sat Oct 26 17:54:31 2013 New Revision: 257175 URL: http://svnweb.freebsd.org/changeset/base/257175 Log: Clean up missed header references. Modified: head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mp_cpudep.c head/sys/powerpc/pseries/platform_chrp.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Sat Oct 26 17:43:18 2013 (r257174) +++ head/sys/powerpc/aim/mmu_oea.c Sat Oct 26 17:54:31 2013 (r257175) @@ -148,7 +148,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include "mmu_if.h" Modified: head/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- head/sys/powerpc/aim/mp_cpudep.c Sat Oct 26 17:43:18 2013 (r257174) +++ head/sys/powerpc/aim/mp_cpudep.c Sat Oct 26 17:54:31 2013 (r257175) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include Modified: head/sys/powerpc/pseries/platform_chrp.c ============================================================================== --- head/sys/powerpc/pseries/platform_chrp.c Sat Oct 26 17:43:18 2013 (r257174) +++ head/sys/powerpc/pseries/platform_chrp.c Sat Oct 26 17:54:31 2013 (r257175) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 17:58:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 91B6ABC0; Sat, 26 Oct 2013 17:58:56 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 798F12AA0; Sat, 26 Oct 2013 17:58:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QHwuCT069223; Sat, 26 Oct 2013 17:58:56 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QHwbWX069118; Sat, 26 Oct 2013 17:58:37 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310261758.r9QHwbWX069118@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 26 Oct 2013 17:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257176 - in head/sys: compat/linprocfs compat/linux compat/ndis dev/ae dev/age dev/alc dev/ale dev/an dev/ath dev/ath/ath_dfs/null dev/ath/ath_rate/sample dev/bfe dev/bge dev/bm dev/bw... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 17:58:56 -0000 Author: glebius Date: Sat Oct 26 17:58:36 2013 New Revision: 257176 URL: http://svnweb.freebsd.org/changeset/base/257176 Log: The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/compat/linux/linux_ioctl.c head/sys/compat/ndis/kern_ndis.c head/sys/compat/ndis/subr_ndis.c head/sys/compat/ndis/subr_usbd.c head/sys/dev/ae/if_ae.c head/sys/dev/age/if_age.c head/sys/dev/alc/if_alc.c head/sys/dev/ale/if_ale.c head/sys/dev/an/if_an.c head/sys/dev/ath/ath_dfs/null/dfs_null.c head/sys/dev/ath/ath_rate/sample/sample.c head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_beacon.c head/sys/dev/ath/if_ath_btcoex.c head/sys/dev/ath/if_ath_keycache.c head/sys/dev/ath/if_ath_lna_div.c head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_ath_rx_edma.c head/sys/dev/ath/if_ath_spectral.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_ath_tdma.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_ath_tx_edma.c head/sys/dev/bfe/if_bfe.c head/sys/dev/bge/if_bge.c head/sys/dev/bm/if_bm.c head/sys/dev/bwi/bwimac.c head/sys/dev/bwi/bwiphy.c head/sys/dev/bwi/bwirf.c head/sys/dev/bwi/if_bwi.c head/sys/dev/bwi/if_bwi_pci.c head/sys/dev/bwn/if_bwn.c head/sys/dev/cadence/if_cgem.c head/sys/dev/cas/if_cas.c head/sys/dev/ce/if_ce.c head/sys/dev/cm/smc90cx6.c head/sys/dev/cp/if_cp.c head/sys/dev/cs/if_cs.c head/sys/dev/ctau/if_ct.c head/sys/dev/cx/if_cx.c head/sys/dev/cxgb/cxgb_adapter.h head/sys/dev/cxgb/cxgb_main.c head/sys/dev/cxgbe/adapter.h head/sys/dev/dc/dcphy.c head/sys/dev/dc/if_dc.c head/sys/dev/dc/pnphy.c head/sys/dev/de/if_de.c head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_lem.c head/sys/dev/ed/if_ed.c head/sys/dev/ed/if_ed_3c503.c head/sys/dev/ed/if_ed_hpp.c head/sys/dev/ed/if_ed_pccard.c head/sys/dev/ed/if_ed_rtl80x9.c head/sys/dev/en/if_en_pci.c head/sys/dev/en/midway.c head/sys/dev/ep/if_ep.c head/sys/dev/et/if_et.c head/sys/dev/ex/if_ex.c head/sys/dev/fatm/if_fatm.c head/sys/dev/fe/if_fe.c head/sys/dev/fe/if_fe_pccard.c head/sys/dev/firewire/if_fwe.c head/sys/dev/firewire/if_fwip.c head/sys/dev/fxp/if_fxp.c head/sys/dev/fxp/inphy.c head/sys/dev/gem/if_gem.c head/sys/dev/hatm/if_hatm.c head/sys/dev/hatm/if_hatm_intr.c head/sys/dev/hatm/if_hatm_ioctl.c head/sys/dev/hatm/if_hatm_rx.c head/sys/dev/hatm/if_hatm_tx.c head/sys/dev/hme/if_hme.c head/sys/dev/hme/if_hme_pci.c head/sys/dev/ie/if_ie.c head/sys/dev/if_ndis/if_ndis.c head/sys/dev/if_ndis/if_ndis_pccard.c head/sys/dev/if_ndis/if_ndis_pci.c head/sys/dev/if_ndis/if_ndis_usb.c head/sys/dev/iicbus/if_ic.c head/sys/dev/ipw/if_ipw.c head/sys/dev/iwi/if_iwi.c head/sys/dev/iwn/if_iwn.c head/sys/dev/ixgb/if_ixgb.h head/sys/dev/ixgbe/ixgbe.h head/sys/dev/ixgbe/ixv.h head/sys/dev/jme/if_jme.c head/sys/dev/le/lance.c head/sys/dev/lge/if_lge.c head/sys/dev/lmc/if_lmc.c head/sys/dev/malo/if_malo.c head/sys/dev/malo/if_malo_pci.c head/sys/dev/malo/if_malohal.c head/sys/dev/mge/if_mge.c head/sys/dev/mii/mii.c head/sys/dev/msk/if_msk.c head/sys/dev/mwl/if_mwl.c head/sys/dev/mwl/if_mwl_pci.c head/sys/dev/mxge/if_mxge.c head/sys/dev/my/if_my.c head/sys/dev/netmap/netmap.c head/sys/dev/nfe/if_nfe.c head/sys/dev/nge/if_nge.c head/sys/dev/nve/if_nve.c head/sys/dev/nxge/if_nxge.c head/sys/dev/oce/oce_if.h head/sys/dev/patm/if_patm.c head/sys/dev/patm/if_patm_attach.c head/sys/dev/patm/if_patm_intr.c head/sys/dev/patm/if_patm_ioctl.c head/sys/dev/patm/if_patm_rx.c head/sys/dev/patm/if_patm_tx.c head/sys/dev/pcn/if_pcn.c head/sys/dev/pdq/if_fpa.c head/sys/dev/pdq/pdq_freebsd.h head/sys/dev/pdq/pdq_ifsubr.c head/sys/dev/ppbus/if_plip.c head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2661.c head/sys/dev/ral/rt2860.c head/sys/dev/re/if_re.c head/sys/dev/rt/if_rt.c head/sys/dev/sbni/if_sbni.c head/sys/dev/sf/if_sf.c head/sys/dev/sfxge/sfxge.c head/sys/dev/sfxge/sfxge.h head/sys/dev/sge/if_sge.c head/sys/dev/sis/if_sis.c head/sys/dev/sk/if_sk.c head/sys/dev/smc/if_smc.c head/sys/dev/sn/if_sn.c head/sys/dev/ste/if_ste.c head/sys/dev/stge/if_stge.c head/sys/dev/ti/if_ti.c head/sys/dev/tl/if_tl.c head/sys/dev/tsec/if_tsec.c head/sys/dev/tx/if_tx.c head/sys/dev/txp/if_txp.c head/sys/dev/usb/net/if_aue.c head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/net/if_cdce.c head/sys/dev/usb/net/if_cue.c head/sys/dev/usb/net/if_kue.c head/sys/dev/usb/net/if_mos.c head/sys/dev/usb/net/if_rue.c head/sys/dev/usb/net/if_udav.c head/sys/dev/usb/net/if_usie.c head/sys/dev/usb/net/uhso.c head/sys/dev/usb/net/usb_ethernet.c head/sys/dev/usb/usb_pf.c head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_zyd.c head/sys/dev/vge/if_vge.c head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/vmware/vmxnet3/if_vmx.c head/sys/dev/vr/if_vr.c head/sys/dev/vte/if_vte.c head/sys/dev/vx/if_vx.c head/sys/dev/vx/if_vx_pci.c head/sys/dev/wb/if_wb.c head/sys/dev/wi/if_wi.c head/sys/dev/wi/if_wi_pccard.c head/sys/dev/wi/if_wi_pci.c head/sys/dev/wl/if_wl.c head/sys/dev/wpi/if_wpi.c head/sys/dev/xe/if_xe.c head/sys/dev/xl/if_xl.c head/sys/fs/nfs/nfsport.h head/sys/kern/kern_jail.c head/sys/kern/kern_poll.c head/sys/kern/sys_socket.c head/sys/net/bpf.c head/sys/net/bridgestp.c head/sys/net/ieee8023ad_lacp.c head/sys/net/if_arcsubr.c head/sys/net/if_atmsubr.c head/sys/net/if_clone.c head/sys/net/if_disc.c head/sys/net/if_edsc.c head/sys/net/if_ef.c head/sys/net/if_enc.c head/sys/net/if_epair.c head/sys/net/if_ethersubr.c head/sys/net/if_faith.c head/sys/net/if_fddisubr.c head/sys/net/if_fwsubr.c head/sys/net/if_gif.c head/sys/net/if_gre.c head/sys/net/if_iso88025subr.c head/sys/net/if_loop.c head/sys/net/if_mib.c head/sys/net/if_spppfr.c head/sys/net/if_spppsubr.c head/sys/net/if_stf.c head/sys/net/if_tap.c head/sys/net/if_tun.c head/sys/net/if_vlan.c head/sys/net/pfil.c head/sys/net/route.c head/sys/net/rtsock.c head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_action.c head/sys/net80211/ieee80211_adhoc.c head/sys/net80211/ieee80211_ageq.c head/sys/net80211/ieee80211_amrr.c head/sys/net80211/ieee80211_ddb.c head/sys/net80211/ieee80211_dfs.c head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_input.c head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_monitor.c head/sys/net80211/ieee80211_node.c head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_power.c head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_radiotap.c head/sys/net80211/ieee80211_regdomain.c head/sys/net80211/ieee80211_scan.c head/sys/net80211/ieee80211_scan_sta.c head/sys/net80211/ieee80211_wds.c head/sys/netatalk/aarp.c head/sys/netatalk/at_control.c head/sys/netatalk/ddp_input.c head/sys/netatalk/ddp_output.c head/sys/netatalk/ddp_pcb.c head/sys/netatalk/ddp_usrreq.c head/sys/netgraph/netflow/netflow.c head/sys/netgraph/ng_bridge.c head/sys/netgraph/ng_cisco.c head/sys/netgraph/ng_eiface.c head/sys/netgraph/ng_fec.c head/sys/netgraph/ng_iface.c head/sys/netgraph/ng_ipfw.c head/sys/netgraph/ng_sppp.c head/sys/netinet/if_atm.c head/sys/netinet/if_ether.c head/sys/netinet/igmp.c head/sys/netinet/in_gif.c head/sys/netinet/in_mcast.c head/sys/netinet/in_pcb.c head/sys/netinet/in_proto.c head/sys/netinet/in_rmx.c head/sys/netinet/ip_carp.c head/sys/netinet/ip_divert.c head/sys/netinet/ip_gre.c head/sys/netinet/ip_icmp.c head/sys/netinet/ip_ipsec.c head/sys/netinet/ip_mroute.c head/sys/netinet/ip_output.c head/sys/netinet/raw_ip.c head/sys/netinet/tcp_hostcache.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_offload.c head/sys/netinet/tcp_reass.c head/sys/netinet/tcp_sack.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timewait.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/dest6.c head/sys/netinet6/frag6.c head/sys/netinet6/icmp6.c head/sys/netinet6/in6_gif.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_mcast.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_proto.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/in6_src.c head/sys/netinet6/ip6_forward.c head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_ipsec.c head/sys/netinet6/ip6_mroute.c head/sys/netinet6/ip6_output.c head/sys/netinet6/mld6.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_rtr.c head/sys/netinet6/raw_ip6.c head/sys/netinet6/route6.c head/sys/netinet6/scope6.c head/sys/netinet6/udp6_usrreq.c head/sys/netipsec/ipsec.c head/sys/netipsec/ipsec_input.c head/sys/netipsec/ipsec_output.c head/sys/netipsec/key.c head/sys/netipsec/xform_ipip.c head/sys/netipx/ipx.c head/sys/netipx/ipx_input.c head/sys/netipx/ipx_outputfl.c head/sys/netipx/ipx_pcb.c head/sys/netipx/ipx_usrreq.c head/sys/netnatm/natm.c head/sys/netnatm/natm_pcb.c head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_dynamic.c head/sys/netpfil/ipfw/ip_fw_log.c head/sys/netpfil/ipfw/ip_fw_nat.c head/sys/netpfil/pf/if_pflog.c head/sys/netpfil/pf/if_pfsync.c head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf_if.c head/sys/netpfil/pf/pf_ioctl.c head/sys/netpfil/pf/pf_lb.c head/sys/netpfil/pf/pf_osfp.c head/sys/nfs/bootp_subr.c head/sys/nfsclient/nfs_vfsops.c head/sys/nfsclient/nfs_vnops.c head/sys/nfsserver/nfs_srvkrpc.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h head/sys/ofed/include/linux/list.h head/sys/pci/if_rl.c head/sys/security/mac_ifoff/mac_ifoff.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/compat/linprocfs/linprocfs.c Sat Oct 26 17:58:36 2013 (r257176) @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/compat/linux/linux_ioctl.c Sat Oct 26 17:58:36 2013 (r257176) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/compat/ndis/kern_ndis.c ============================================================================== --- head/sys/compat/ndis/kern_ndis.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/compat/ndis/kern_ndis.c Sat Oct 26 17:58:36 2013 (r257176) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/compat/ndis/subr_ndis.c ============================================================================== --- head/sys/compat/ndis/subr_ndis.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/compat/ndis/subr_ndis.c Sat Oct 26 17:58:36 2013 (r257176) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/compat/ndis/subr_usbd.c ============================================================================== --- head/sys/compat/ndis/subr_usbd.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/compat/ndis/subr_usbd.c Sat Oct 26 17:58:36 2013 (r257176) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ae/if_ae.c Sat Oct 26 17:58:36 2013 (r257176) @@ -35,8 +35,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include @@ -47,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/age/if_age.c Sat Oct 26 17:58:36 2013 (r257176) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/alc/if_alc.c Sat Oct 26 17:58:36 2013 (r257176) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/ale/if_ale.c ============================================================================== --- head/sys/dev/ale/if_ale.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ale/if_ale.c Sat Oct 26 17:58:36 2013 (r257176) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/an/if_an.c ============================================================================== --- head/sys/dev/an/if_an.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/an/if_an.c Sat Oct 26 17:58:36 2013 (r257176) @@ -111,6 +111,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c ============================================================================== --- head/sys/dev/ath/ath_dfs/null/dfs_null.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ath/ath_dfs/null/dfs_null.c Sat Oct 26 17:58:36 2013 (r257176) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -53,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include /* XXX for ether_sprintf */ Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ath/ath_rate/sample/sample.c Sat Oct 26 17:58:36 2013 (r257176) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -61,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include /* XXX for ether_sprintf */ Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ath/if_ath.c Sat Oct 26 17:58:36 2013 (r257176) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/ath/if_ath_beacon.c ============================================================================== --- head/sys/dev/ath/if_ath_beacon.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ath/if_ath_beacon.c Sat Oct 26 17:58:36 2013 (r257176) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/ath/if_ath_btcoex.c ============================================================================== --- head/sys/dev/ath/if_ath_btcoex.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ath/if_ath_btcoex.c Sat Oct 26 17:58:36 2013 (r257176) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -54,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include /* XXX for ether_sprintf */ Modified: head/sys/dev/ath/if_ath_keycache.c ============================================================================== --- head/sys/dev/ath/if_ath_keycache.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ath/if_ath_keycache.c Sat Oct 26 17:58:36 2013 (r257176) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/ath/if_ath_lna_div.c ============================================================================== --- head/sys/dev/ath/if_ath_lna_div.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ath/if_ath_lna_div.c Sat Oct 26 17:58:36 2013 (r257176) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -54,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include /* XXX for ether_sprintf */ Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ath/if_ath_rx.c Sat Oct 26 17:58:36 2013 (r257176) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ath/if_ath_rx_edma.c Sat Oct 26 17:58:36 2013 (r257176) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/ath/if_ath_spectral.c ============================================================================== --- head/sys/dev/ath/if_ath_spectral.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ath/if_ath_spectral.c Sat Oct 26 17:58:36 2013 (r257176) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -53,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include /* XXX for ether_sprintf */ Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ath/if_ath_sysctl.c Sat Oct 26 17:58:36 2013 (r257176) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/ath/if_ath_tdma.c ============================================================================== --- head/sys/dev/ath/if_ath_tdma.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ath/if_ath_tdma.c Sat Oct 26 17:58:36 2013 (r257176) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ath/if_ath_tx.c Sat Oct 26 17:58:36 2013 (r257176) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ath/if_ath_tx_edma.c Sat Oct 26 17:58:36 2013 (r257176) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/bfe/if_bfe.c ============================================================================== --- head/sys/dev/bfe/if_bfe.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/bfe/if_bfe.c Sat Oct 26 17:58:36 2013 (r257176) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/bge/if_bge.c Sat Oct 26 17:58:36 2013 (r257176) @@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/bm/if_bm.c ============================================================================== --- head/sys/dev/bm/if_bm.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/bm/if_bm.c Sat Oct 26 17:58:36 2013 (r257176) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/bwi/bwimac.c ============================================================================== --- head/sys/dev/bwi/bwimac.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/bwi/bwimac.c Sat Oct 26 17:58:36 2013 (r257176) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/bwi/bwiphy.c ============================================================================== --- head/sys/dev/bwi/bwiphy.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/bwi/bwiphy.c Sat Oct 26 17:58:36 2013 (r257176) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/bwi/bwirf.c ============================================================================== --- head/sys/dev/bwi/bwirf.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/bwi/bwirf.c Sat Oct 26 17:58:36 2013 (r257176) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/bwi/if_bwi.c Sat Oct 26 17:58:36 2013 (r257176) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/bwi/if_bwi_pci.c ============================================================================== --- head/sys/dev/bwi/if_bwi_pci.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/bwi/if_bwi_pci.c Sat Oct 26 17:58:36 2013 (r257176) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -52,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/bwn/if_bwn.c Sat Oct 26 17:58:36 2013 (r257176) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/cadence/if_cgem.c ============================================================================== --- head/sys/dev/cadence/if_cgem.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/cadence/if_cgem.c Sat Oct 26 17:58:36 2013 (r257176) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/cas/if_cas.c ============================================================================== --- head/sys/dev/cas/if_cas.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/cas/if_cas.c Sat Oct 26 17:58:36 2013 (r257176) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/ce/if_ce.c ============================================================================== --- head/sys/dev/ce/if_ce.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ce/if_ce.c Sat Oct 26 17:58:36 2013 (r257176) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #if __FreeBSD_version > 501000 # include # include Modified: head/sys/dev/cm/smc90cx6.c ============================================================================== --- head/sys/dev/cm/smc90cx6.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/cm/smc90cx6.c Sat Oct 26 17:58:36 2013 (r257176) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/cp/if_cp.c ============================================================================== --- head/sys/dev/cp/if_cp.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/cp/if_cp.c Sat Oct 26 17:58:36 2013 (r257176) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/cs/if_cs.c ============================================================================== --- head/sys/dev/cs/if_cs.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/cs/if_cs.c Sat Oct 26 17:58:36 2013 (r257176) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/ctau/if_ct.c ============================================================================== --- head/sys/dev/ctau/if_ct.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ctau/if_ct.c Sat Oct 26 17:58:36 2013 (r257176) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/cx/if_cx.c ============================================================================== --- head/sys/dev/cx/if_cx.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/cx/if_cx.c Sat Oct 26 17:58:36 2013 (r257176) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/cxgb/cxgb_adapter.h ============================================================================== --- head/sys/dev/cxgb/cxgb_adapter.h Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/cxgb/cxgb_adapter.h Sat Oct 26 17:58:36 2013 (r257176) @@ -41,9 +41,11 @@ $FreeBSD$ #include #include #include +#include #include #include +#include #include #include #include Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/cxgb/cxgb_main.c Sat Oct 26 17:58:36 2013 (r257176) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/cxgbe/adapter.h Sat Oct 26 17:58:36 2013 (r257176) @@ -35,7 +35,12 @@ #include #include #include +#include #include +#include +#include +#include + #include #include #include @@ -43,6 +48,7 @@ #include #include #include +#include #include #include #include Modified: head/sys/dev/dc/dcphy.c ============================================================================== --- head/sys/dev/dc/dcphy.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/dc/dcphy.c Sat Oct 26 17:58:36 2013 (r257176) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/dc/if_dc.c Sat Oct 26 17:58:36 2013 (r257176) @@ -107,6 +107,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/dc/pnphy.c ============================================================================== --- head/sys/dev/dc/pnphy.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/dc/pnphy.c Sat Oct 26 17:58:36 2013 (r257176) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/dev/de/if_de.c ============================================================================== --- head/sys/dev/de/if_de.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/de/if_de.c Sat Oct 26 17:58:36 2013 (r257176) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/e1000/if_em.c Sat Oct 26 17:58:36 2013 (r257176) @@ -63,6 +63,7 @@ #include #include #include +#include #include #include #include Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/e1000/if_igb.c Sat Oct 26 17:58:36 2013 (r257176) @@ -68,6 +68,7 @@ #include #include #include +#include #include #include #include Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/e1000/if_lem.c Sat Oct 26 17:58:36 2013 (r257176) @@ -60,6 +60,7 @@ #include #include #include +#include #include #include #include Modified: head/sys/dev/ed/if_ed.c ============================================================================== --- head/sys/dev/ed/if_ed.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ed/if_ed.c Sat Oct 26 17:58:36 2013 (r257176) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/ed/if_ed_3c503.c ============================================================================== --- head/sys/dev/ed/if_ed_3c503.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ed/if_ed_3c503.c Sat Oct 26 17:58:36 2013 (r257176) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* XXX: ed_3c503_mediachg() */ #include #include #include Modified: head/sys/dev/ed/if_ed_hpp.c ============================================================================== --- head/sys/dev/ed/if_ed_hpp.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ed/if_ed_hpp.c Sat Oct 26 17:58:36 2013 (r257176) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* XXX: ed_hpp_set_physical_link() */ #include #include #include Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ed/if_ed_pccard.c Sat Oct 26 17:58:36 2013 (r257176) @@ -86,6 +86,7 @@ #include #include +#include #include #include #include Modified: head/sys/dev/ed/if_ed_rtl80x9.c ============================================================================== --- head/sys/dev/ed/if_ed_rtl80x9.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ed/if_ed_rtl80x9.c Sat Oct 26 17:58:36 2013 (r257176) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/en/if_en_pci.c ============================================================================== --- head/sys/dev/en/if_en_pci.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/en/if_en_pci.c Sat Oct 26 17:58:36 2013 (r257176) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/en/midway.c ============================================================================== --- head/sys/dev/en/midway.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/en/midway.c Sat Oct 26 17:58:36 2013 (r257176) @@ -138,6 +138,7 @@ enum { #include #include +#include #include #include Modified: head/sys/dev/ep/if_ep.c ============================================================================== --- head/sys/dev/ep/if_ep.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ep/if_ep.c Sat Oct 26 17:58:36 2013 (r257176) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/et/if_et.c ============================================================================== --- head/sys/dev/et/if_et.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/et/if_et.c Sat Oct 26 17:58:36 2013 (r257176) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/ex/if_ex.c ============================================================================== --- head/sys/dev/ex/if_ex.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ex/if_ex.c Sat Oct 26 17:58:36 2013 (r257176) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/fatm/if_fatm.c ============================================================================== --- head/sys/dev/fatm/if_fatm.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/fatm/if_fatm.c Sat Oct 26 17:58:36 2013 (r257176) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/fe/if_fe.c ============================================================================== --- head/sys/dev/fe/if_fe.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/fe/if_fe.c Sat Oct 26 17:58:36 2013 (r257176) @@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/fe/if_fe_pccard.c ============================================================================== --- head/sys/dev/fe/if_fe_pccard.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/fe/if_fe_pccard.c Sat Oct 26 17:58:36 2013 (r257176) @@ -28,7 +28,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include @@ -36,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/dev/firewire/if_fwe.c ============================================================================== --- head/sys/dev/firewire/if_fwe.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/firewire/if_fwe.c Sat Oct 26 17:58:36 2013 (r257176) @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #ifdef __DragonFly__ Modified: head/sys/dev/firewire/if_fwip.c ============================================================================== --- head/sys/dev/firewire/if_fwip.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/firewire/if_fwip.c Sat Oct 26 17:58:36 2013 (r257176) @@ -56,6 +56,7 @@ #include #include +#include #include #include #include Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/fxp/if_fxp.c Sat Oct 26 17:58:36 2013 (r257176) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/fxp/inphy.c ============================================================================== --- head/sys/dev/fxp/inphy.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/fxp/inphy.c Sat Oct 26 17:58:36 2013 (r257176) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/dev/gem/if_gem.c ============================================================================== --- head/sys/dev/gem/if_gem.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/gem/if_gem.c Sat Oct 26 17:58:36 2013 (r257176) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/hatm/if_hatm.c ============================================================================== --- head/sys/dev/hatm/if_hatm.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/hatm/if_hatm.c Sat Oct 26 17:58:36 2013 (r257176) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/hatm/if_hatm_intr.c ============================================================================== --- head/sys/dev/hatm/if_hatm_intr.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/hatm/if_hatm_intr.c Sat Oct 26 17:58:36 2013 (r257176) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/hatm/if_hatm_ioctl.c ============================================================================== --- head/sys/dev/hatm/if_hatm_ioctl.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/hatm/if_hatm_ioctl.c Sat Oct 26 17:58:36 2013 (r257176) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/hatm/if_hatm_rx.c ============================================================================== --- head/sys/dev/hatm/if_hatm_rx.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/hatm/if_hatm_rx.c Sat Oct 26 17:58:36 2013 (r257176) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/hatm/if_hatm_tx.c ============================================================================== --- head/sys/dev/hatm/if_hatm_tx.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/hatm/if_hatm_tx.c Sat Oct 26 17:58:36 2013 (r257176) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/hme/if_hme.c ============================================================================== --- head/sys/dev/hme/if_hme.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/hme/if_hme.c Sat Oct 26 17:58:36 2013 (r257176) @@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/hme/if_hme_pci.c ============================================================================== --- head/sys/dev/hme/if_hme_pci.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/hme/if_hme_pci.c Sat Oct 26 17:58:36 2013 (r257176) @@ -40,7 +40,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include +#include #include #include Modified: head/sys/dev/ie/if_ie.c ============================================================================== --- head/sys/dev/ie/if_ie.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ie/if_ie.c Sat Oct 26 17:58:36 2013 (r257176) @@ -130,6 +130,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/if_ndis/if_ndis.c Sat Oct 26 17:58:36 2013 (r257176) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/if_ndis/if_ndis_pccard.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_pccard.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/if_ndis/if_ndis_pccard.c Sat Oct 26 17:58:36 2013 (r257176) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/dev/if_ndis/if_ndis_pci.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_pci.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/if_ndis/if_ndis_pci.c Sat Oct 26 17:58:36 2013 (r257176) @@ -36,12 +36,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include +#include #include #include Modified: head/sys/dev/if_ndis/if_ndis_usb.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_usb.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/if_ndis/if_ndis_usb.c Sat Oct 26 17:58:36 2013 (r257176) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/iicbus/if_ic.c ============================================================================== --- head/sys/dev/iicbus/if_ic.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/iicbus/if_ic.c Sat Oct 26 17:58:36 2013 (r257176) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/dev/ipw/if_ipw.c ============================================================================== --- head/sys/dev/ipw/if_ipw.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ipw/if_ipw.c Sat Oct 26 17:58:36 2013 (r257176) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/iwi/if_iwi.c ============================================================================== --- head/sys/dev/iwi/if_iwi.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/iwi/if_iwi.c Sat Oct 26 17:58:36 2013 (r257176) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/iwn/if_iwn.c Sat Oct 26 17:58:36 2013 (r257176) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/ixgb/if_ixgb.h ============================================================================== --- head/sys/dev/ixgb/if_ixgb.h Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ixgb/if_ixgb.h Sat Oct 26 17:58:36 2013 (r257176) @@ -47,6 +47,7 @@ POSSIBILITY OF SUCH DAMAGE. #include #include +#include #include #include #include Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ixgbe/ixgbe.h Sat Oct 26 17:58:36 2013 (r257176) @@ -49,8 +49,10 @@ #include #include #include +#include #include +#include #include #include #include Modified: head/sys/dev/ixgbe/ixv.h ============================================================================== --- head/sys/dev/ixgbe/ixv.h Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/ixgbe/ixv.h Sat Oct 26 17:58:36 2013 (r257176) @@ -44,10 +44,14 @@ #include #include #include +#include #include +#include #include +#include #include +#include #include #include #include Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/jme/if_jme.c Sat Oct 26 17:58:36 2013 (r257176) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/le/lance.c ============================================================================== --- head/sys/dev/le/lance.c Sat Oct 26 17:54:31 2013 (r257175) +++ head/sys/dev/le/lance.c Sat Oct 26 17:58:36 2013 (r257176) @@ -86,6 +86,7 @@ __FBSDID("$FreeBSD$"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 18:18:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 99E3B2F1; Sat, 26 Oct 2013 18:18:16 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7858F2BB0; Sat, 26 Oct 2013 18:18:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QIIGDO076504; Sat, 26 Oct 2013 18:18:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QIIESa076490; Sat, 26 Oct 2013 18:18:14 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310261818.r9QIIESa076490@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 26 Oct 2013 18:18:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257178 - in head/sys/powerpc: aim booke include mpc85xx powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 18:18:16 -0000 Author: nwhitehorn Date: Sat Oct 26 18:18:14 2013 New Revision: 257178 URL: http://svnweb.freebsd.org/changeset/base/257178 Log: Interrelated improvements to early boot mappings: - Remove explicit requirement that the SOC registers be found except as an optimization (although the MPC85XX LAW drivers still require they be found externally, which should change). - Remove magic CCSRBAR_VA value. - Allow bus_machdep.c's early-boot code to handle non 1:1 mappings and systems not in real-mode or global 1:1 maps in early boot. - Allow pmap_mapdev() on Book-E to reissue previous addresses if the area is already mapped. Additionally have it check all mappings, not just the CCSR area. This allows the console on e500 systems to actually work on systems where the boot loader was not kind enough to set up a 1:1 mapping before starting the kernel. Modified: head/sys/powerpc/aim/machdep.c head/sys/powerpc/booke/machdep.c head/sys/powerpc/booke/machdep_e500.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/pmap.h head/sys/powerpc/include/tlb.h head/sys/powerpc/include/vmparam.h head/sys/powerpc/mpc85xx/mpc85xx.c head/sys/powerpc/mpc85xx/mpc85xx.h head/sys/powerpc/powerpc/bus_machdep.c Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Sat Oct 26 18:03:36 2013 (r257177) +++ head/sys/powerpc/aim/machdep.c Sat Oct 26 18:18:14 2013 (r257178) @@ -775,3 +775,11 @@ va_to_vsid(pmap_t pm, vm_offset_t va) } #endif + +vm_offset_t +pmap_early_io_map(vm_paddr_t pa, vm_size_t size) +{ + + return (pa); +} + Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Sat Oct 26 18:03:36 2013 (r257177) +++ head/sys/powerpc/booke/machdep.c Sat Oct 26 18:18:14 2013 (r257178) @@ -350,13 +350,18 @@ booke_init(uint32_t arg1, uint32_t arg2) if (OF_init((void *)dtbp) != 0) while (1); - if (fdt_immr_addr(CCSRBAR_VA) != 0) - while (1); - OF_interpret("perform-fixup", 0); /* Set up TLB initially */ - booke_init_tlb(fdt_immr_pa); + tlb1_init(); + + /* Set up IMMR */ + if (fdt_immr_addr(0) == 0) { + fdt_immr_va = pmap_early_io_map(fdt_immr_pa, fdt_immr_size); + } else { + printf("Warning: SOC base registers could not be found!\n"); + fdt_immr_va = 0; + } /* Reset Time Base */ mttb(0); Modified: head/sys/powerpc/booke/machdep_e500.c ============================================================================== --- head/sys/powerpc/booke/machdep_e500.c Sat Oct 26 18:03:36 2013 (r257177) +++ head/sys/powerpc/booke/machdep_e500.c Sat Oct 26 18:18:14 2013 (r257178) @@ -47,8 +47,6 @@ void booke_init_tlb(vm_paddr_t fdt_immr_pa) { - /* Initialize TLB1 handling */ - tlb1_init(fdt_immr_pa); } void Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sat Oct 26 18:03:36 2013 (r257177) +++ head/sys/powerpc/booke/pmap.c Sat Oct 26 18:18:14 2013 (r257178) @@ -113,7 +113,6 @@ extern uint32_t *bootinfo; extern uint32_t bp_ntlb1s; #endif -vm_paddr_t ccsrbar_pa; vm_paddr_t kernload; vm_offset_t kernstart; vm_size_t kernsize; @@ -2662,22 +2661,25 @@ mmu_booke_mapdev_attr(mmu_t mmu, vm_padd void *res; uintptr_t va; vm_size_t sz; + int i; /* - * CCSR is premapped. Note that (pa + size - 1) is there to make sure - * we don't wrap around. Devices on the local bus typically extend all - * the way up to and including 0xffffffff. In that case (pa + size) - * would be 0. This creates a false positive (i.e. we think it's - * within the CCSR) and not create a mapping. - */ - if (ma == VM_MEMATTR_DEFAULT && pa >= ccsrbar_pa && - (pa + size - 1) < (ccsrbar_pa + CCSRBAR_SIZE)) { - va = CCSRBAR_VA + (pa - ccsrbar_pa); - return ((void *)va); + * Check if this is premapped in TLB1. Note: this should probably also + * check whether a sequence of TLB1 entries exist that match the + * requirement, but now only checks the easy case. + */ + if (ma == VM_MEMATTR_DEFAULT) { + for (i = 0; i < tlb1_idx; i++) { + if (!(tlb1[i].mas1 & MAS1_VALID)) + continue; + if (pa >= tlb1[i].phys && + (pa + size) <= (tlb1[i].phys + tlb1[i].size)) + return (void *)(tlb1[i].virt + + (pa - tlb1[i].phys)); + } } - if (size < PAGE_SIZE) - size = PAGE_SIZE; + size = roundup(size, PAGE_SIZE); if (pa >= (VM_MAXUSER_ADDRESS + PAGE_SIZE) && (pa + size - 1) < VM_MIN_KERNEL_ADDRESS) @@ -2899,9 +2901,8 @@ tlb0_print_tlbentries(void) /* * TLB1 mapping notes: * - * TLB1[0] CCSRBAR - * TLB1[1] Kernel text and data. - * TLB1[2-15] Additional kernel text and data mappings (if required), PCI + * TLB1[0] Kernel text and data. + * TLB1[1-15] Additional kernel text and data mappings (if required), PCI * windows, other devices mappings. */ @@ -3094,14 +3095,12 @@ tlb1_mapin_region(vm_offset_t va, vm_pad * assembler level setup done in locore.S. */ void -tlb1_init(vm_offset_t ccsrbar) +tlb1_init() { - uint32_t mas0, mas1, mas3; + uint32_t mas0, mas1, mas2, mas3; uint32_t tsz; u_int i; - ccsrbar_pa = ccsrbar; - if (bootinfo != NULL && bootinfo[0] != 1) { tlb1_idx = *((uint16_t *)(bootinfo + 8)); } else @@ -3117,22 +3116,23 @@ tlb1_init(vm_offset_t ccsrbar) if ((mas1 & MAS1_VALID) == 0) continue; + mas2 = mfspr(SPR_MAS2); mas3 = mfspr(SPR_MAS3); tlb1[i].mas1 = mas1; tlb1[i].mas2 = mfspr(SPR_MAS2); tlb1[i].mas3 = mas3; + tlb1[i].virt = mas2 & MAS2_EPN_MASK; + tlb1[i].phys = mas3 & MAS3_RPN; if (i == 0) kernload = mas3 & MAS3_RPN; tsz = (mas1 & MAS1_TSIZE_MASK) >> MAS1_TSIZE_SHIFT; - kernsize += (tsz > 0) ? tsize2size(tsz) : 0; + tlb1[i].size = (tsz > 0) ? tsize2size(tsz) : 0; + kernsize += tlb1[i].size; } - /* Map in CCSRBAR. */ - tlb1_set_entry(CCSRBAR_VA, ccsrbar, CCSRBAR_SIZE, _TLB_ENTRY_IO); - #ifdef SMP bp_ntlb1s = tlb1_idx; #endif @@ -3145,6 +3145,43 @@ tlb1_init(vm_offset_t ccsrbar) set_mas4_defaults(); } +vm_offset_t +pmap_early_io_map(vm_paddr_t pa, vm_size_t size) +{ + static vm_offset_t early_io_map_base = VM_MAX_KERNEL_ADDRESS; + vm_paddr_t pa_base; + vm_offset_t va, sz; + int i; + + KASSERT(!pmap_bootstrapped, ("Do not use after PMAP is up!")); + + for (i = 0; i < tlb1_idx; i++) { + if (!(tlb1[i].mas1 & MAS1_VALID)) + continue; + if (pa >= tlb1[i].phys && (pa + size) <= + (tlb1[i].phys + tlb1[i].size)) + return (tlb1[i].virt + (pa - tlb1[i].phys)); + } + + pa_base = trunc_page(pa); + size = roundup(size + (pa - pa_base), PAGE_SIZE); + va = early_io_map_base + (pa - pa_base); + + do { + sz = 1 << (ilog2(size) & ~1); + tlb1_set_entry(early_io_map_base, pa_base, sz, _TLB_ENTRY_IO); + size -= sz; + pa_base += sz; + early_io_map_base += sz; + } while (size > 0); + +#ifdef SMP + bp_ntlb1s = tlb1_idx; +#endif + + return (va); +} + /* * Setup MAS4 defaults. * These values are loaded to MAS0-2 on a TLB miss. Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Sat Oct 26 18:03:36 2013 (r257177) +++ head/sys/powerpc/include/pmap.h Sat Oct 26 18:18:14 2013 (r257178) @@ -254,6 +254,8 @@ extern void pmap_dumpsys_unmap(struct pm extern struct pmap_md *pmap_scan_md(struct pmap_md *); +vm_offset_t pmap_early_io_map(vm_paddr_t pa, vm_size_t size); + #endif #endif /* !_MACHINE_PMAP_H_ */ Modified: head/sys/powerpc/include/tlb.h ============================================================================== --- head/sys/powerpc/include/tlb.h Sat Oct 26 18:03:36 2013 (r257177) +++ head/sys/powerpc/include/tlb.h Sat Oct 26 18:18:14 2013 (r257178) @@ -126,6 +126,9 @@ #if !defined(LOCORE) typedef struct tlb_entry { + vm_paddr_t phys; + vm_offset_t virt; + vm_size_t size; uint32_t mas1; uint32_t mas2; uint32_t mas3; @@ -134,7 +137,7 @@ typedef struct tlb_entry { void tlb0_print_tlbentries(void); void tlb1_inval_entry(unsigned int); -void tlb1_init(vm_offset_t); +void tlb1_init(void); void tlb1_print_entries(void); void tlb1_print_tlbentries(void); #endif /* !LOCORE */ Modified: head/sys/powerpc/include/vmparam.h ============================================================================== --- head/sys/powerpc/include/vmparam.h Sat Oct 26 18:03:36 2013 (r257177) +++ head/sys/powerpc/include/vmparam.h Sat Oct 26 18:18:14 2013 (r257178) @@ -108,12 +108,6 @@ #else /* Book-E */ -/* - * Kernel CCSRBAR location. We make this the reset location. - */ -#define CCSRBAR_VA 0xfef00000 -#define CCSRBAR_SIZE 0x00100000 - #define KERNBASE 0xc0000000 /* start of kernel virtual */ #define VM_MIN_KERNEL_ADDRESS KERNBASE Modified: head/sys/powerpc/mpc85xx/mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/mpc85xx.c Sat Oct 26 18:03:36 2013 (r257177) +++ head/sys/powerpc/mpc85xx/mpc85xx.c Sat Oct 26 18:18:14 2013 (r257178) @@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include /* Modified: head/sys/powerpc/mpc85xx/mpc85xx.h ============================================================================== --- head/sys/powerpc/mpc85xx/mpc85xx.h Sat Oct 26 18:03:36 2013 (r257177) +++ head/sys/powerpc/mpc85xx/mpc85xx.h Sat Oct 26 18:18:14 2013 (r257178) @@ -33,6 +33,7 @@ /* * Configuration control and status registers */ +#define CCSRBAR_VA fdt_immr_va #define OCP85XX_CCSRBAR (CCSRBAR_VA + 0x0) #define OCP85XX_BPTR (CCSRBAR_VA + 0x20) Modified: head/sys/powerpc/powerpc/bus_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/bus_machdep.c Sat Oct 26 18:03:36 2013 (r257177) +++ head/sys/powerpc/powerpc/bus_machdep.c Sat Oct 26 18:18:14 2013 (r257178) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #define MAX_EARLYBOOT_MAPPINGS 6 static struct { + vm_offset_t virt; bus_addr_t addr; bus_size_t size; int flags; @@ -86,10 +87,12 @@ bs_gen_map(bus_addr_t addr, bus_size_t s KASSERT(earlyboot_map_idx < MAX_EARLYBOOT_MAPPINGS, ("%s: too many early boot mapping requests", __func__)); earlyboot_mappings[earlyboot_map_idx].addr = addr; + earlyboot_mappings[earlyboot_map_idx].virt = + pmap_early_io_map(addr, size); earlyboot_mappings[earlyboot_map_idx].size = size; earlyboot_mappings[earlyboot_map_idx].flags = flags; + *bshp = earlyboot_mappings[earlyboot_map_idx].virt; earlyboot_map_idx++; - *bshp = addr; } else { ma = VM_MEMATTR_DEFAULT; switch (flags) { @@ -110,13 +113,13 @@ void bs_remap_earlyboot(void) { int i; - vm_offset_t pa, spa; + vm_offset_t pa, spa, va; vm_memattr_t ma; for (i = 0; i < earlyboot_map_idx; i++) { spa = earlyboot_mappings[i].addr; - if (pmap_dev_direct_mapped(spa, earlyboot_mappings[i].size) - == 0) + if (spa == earlyboot_mappings[i].virt && + pmap_dev_direct_mapped(spa, earlyboot_mappings[i].size) == 0) continue; ma = VM_MEMATTR_DEFAULT; @@ -130,8 +133,10 @@ bs_remap_earlyboot(void) } pa = trunc_page(spa); + va = trunc_page(earlyboot_mappings[i].virt); while (pa < spa + earlyboot_mappings[i].size) { - pmap_kenter_attr(pa, pa, ma); + pmap_kenter_attr(va, pa, ma); + va += PAGE_SIZE; pa += PAGE_SIZE; } } From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 18:18:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DD08E42C; Sat, 26 Oct 2013 18:18:55 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C81ED2BB6; Sat, 26 Oct 2013 18:18:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QIItjf076618; Sat, 26 Oct 2013 18:18:55 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QIIpu6076592; Sat, 26 Oct 2013 18:18:51 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310261818.r9QIIpu6076592@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 26 Oct 2013 18:18:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257179 - in head/sys: amd64/amd64 compat/linsysfs compat/linux dev/sfxge dev/sn dev/xe net80211 netinet/libalias netinet6 netipsec netnatm netpfil/ipfw netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 18:18:56 -0000 Author: glebius Date: Sat Oct 26 18:18:50 2013 New Revision: 257179 URL: http://svnweb.freebsd.org/changeset/base/257179 Log: Provide includes that are needed in these files, and before were read in implicitly via if.h -> if_var.h pollution. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/amd64/amd64/bpf_jit_machdep.c head/sys/compat/linsysfs/linsysfs.c head/sys/compat/linux/linux_socket.c head/sys/dev/sfxge/sfxge_dma.c head/sys/dev/sfxge/sfxge_ev.c head/sys/dev/sfxge/sfxge_intr.c head/sys/dev/sn/if_sn_isa.c head/sys/dev/xe/if_xe_pccard.c head/sys/net80211/ieee80211_phy.c head/sys/net80211/ieee80211_ratectl.c head/sys/net80211/ieee80211_ratectl_none.c head/sys/netinet/libalias/alias_db.c head/sys/netinet6/ip6_id.c head/sys/netipsec/keysock.c head/sys/netipsec/xform_ah.c head/sys/netipsec/xform_esp.c head/sys/netnatm/natm_proto.c head/sys/netpfil/ipfw/ip_dn_io.c head/sys/netpfil/ipfw/ip_dummynet.c head/sys/netpfil/pf/pf_ruleset.c head/sys/netpfil/pf/pf_table.c Modified: head/sys/amd64/amd64/bpf_jit_machdep.c ============================================================================== --- head/sys/amd64/amd64/bpf_jit_machdep.c Sat Oct 26 18:18:14 2013 (r257178) +++ head/sys/amd64/amd64/bpf_jit_machdep.c Sat Oct 26 18:18:50 2013 (r257179) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #else #include Modified: head/sys/compat/linsysfs/linsysfs.c ============================================================================== --- head/sys/compat/linsysfs/linsysfs.c Sat Oct 26 18:18:14 2013 (r257178) +++ head/sys/compat/linsysfs/linsysfs.c Sat Oct 26 18:18:50 2013 (r257179) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Sat Oct 26 18:18:14 2013 (r257178) +++ head/sys/compat/linux/linux_socket.c Sat Oct 26 18:18:50 2013 (r257179) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -60,7 +61,6 @@ __FBSDID("$FreeBSD$"); #ifdef INET6 #include #include -#include #endif #ifdef COMPAT_LINUX32 Modified: head/sys/dev/sfxge/sfxge_dma.c ============================================================================== --- head/sys/dev/sfxge/sfxge_dma.c Sat Oct 26 18:18:14 2013 (r257178) +++ head/sys/dev/sfxge/sfxge_dma.c Sat Oct 26 18:18:50 2013 (r257179) @@ -32,6 +32,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include +#include #include Modified: head/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- head/sys/dev/sfxge/sfxge_ev.c Sat Oct 26 18:18:14 2013 (r257178) +++ head/sys/dev/sfxge/sfxge_ev.c Sat Oct 26 18:18:50 2013 (r257179) @@ -31,7 +31,12 @@ __FBSDID("$FreeBSD$"); #include +#include +#include +#include +#include #include +#include #include "common/efx.h" Modified: head/sys/dev/sfxge/sfxge_intr.c ============================================================================== --- head/sys/dev/sfxge/sfxge_intr.c Sat Oct 26 18:18:14 2013 (r257178) +++ head/sys/dev/sfxge/sfxge_intr.c Sat Oct 26 18:18:50 2013 (r257179) @@ -32,9 +32,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include #include #include #include +#include #include #include Modified: head/sys/dev/sn/if_sn_isa.c ============================================================================== --- head/sys/dev/sn/if_sn_isa.c Sat Oct 26 18:18:14 2013 (r257178) +++ head/sys/dev/sn/if_sn_isa.c Sat Oct 26 18:18:50 2013 (r257179) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include Modified: head/sys/dev/xe/if_xe_pccard.c ============================================================================== --- head/sys/dev/xe/if_xe_pccard.c Sat Oct 26 18:18:14 2013 (r257178) +++ head/sys/dev/xe/if_xe_pccard.c Sat Oct 26 18:18:50 2013 (r257179) @@ -32,7 +32,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include Modified: head/sys/net80211/ieee80211_phy.c ============================================================================== --- head/sys/net80211/ieee80211_phy.c Sat Oct 26 18:18:14 2013 (r257178) +++ head/sys/net80211/ieee80211_phy.c Sat Oct 26 18:18:50 2013 (r257179) @@ -35,12 +35,16 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include +#include + #include #include Modified: head/sys/net80211/ieee80211_ratectl.c ============================================================================== --- head/sys/net80211/ieee80211_ratectl.c Sat Oct 26 18:18:14 2013 (r257178) +++ head/sys/net80211/ieee80211_ratectl.c Sat Oct 26 18:18:50 2013 (r257179) @@ -30,9 +30,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include +#include #include #include Modified: head/sys/net80211/ieee80211_ratectl_none.c ============================================================================== --- head/sys/net80211/ieee80211_ratectl_none.c Sat Oct 26 18:18:14 2013 (r257178) +++ head/sys/net80211/ieee80211_ratectl_none.c Sat Oct 26 18:18:50 2013 (r257179) @@ -29,13 +29,16 @@ __FBSDID("$FreeBSD$"); #include "opt_wlan.h" #include +#include #include +#include #include #include #include #include #include +#include #ifdef INET #include Modified: head/sys/netinet/libalias/alias_db.c ============================================================================== --- head/sys/netinet/libalias/alias_db.c Sat Oct 26 18:18:14 2013 (r257178) +++ head/sys/netinet/libalias/alias_db.c Sat Oct 26 18:18:50 2013 (r257179) @@ -146,6 +146,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/netinet6/ip6_id.c ============================================================================== --- head/sys/netinet6/ip6_id.c Sat Oct 26 18:18:14 2013 (r257178) +++ head/sys/netinet6/ip6_id.c Sat Oct 26 18:18:50 2013 (r257179) @@ -97,6 +97,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/netipsec/keysock.c ============================================================================== --- head/sys/netipsec/keysock.c Sat Oct 26 18:18:14 2013 (r257178) +++ head/sys/netipsec/keysock.c Sat Oct 26 18:18:50 2013 (r257179) @@ -52,9 +52,9 @@ #include #include +#include #include #include -#include #include Modified: head/sys/netipsec/xform_ah.c ============================================================================== --- head/sys/netipsec/xform_ah.c Sat Oct 26 18:18:14 2013 (r257178) +++ head/sys/netipsec/xform_ah.c Sat Oct 26 18:18:50 2013 (r257179) @@ -45,6 +45,8 @@ #include #include #include +#include +#include #include #include Modified: head/sys/netipsec/xform_esp.c ============================================================================== --- head/sys/netipsec/xform_esp.c Sat Oct 26 18:18:14 2013 (r257178) +++ head/sys/netipsec/xform_esp.c Sat Oct 26 18:18:50 2013 (r257179) @@ -44,7 +44,9 @@ #include #include #include +#include #include +#include #include #include Modified: head/sys/netnatm/natm_proto.c ============================================================================== --- head/sys/netnatm/natm_proto.c Sat Oct 26 18:18:14 2013 (r257178) +++ head/sys/netnatm/natm_proto.c Sat Oct 26 18:18:50 2013 (r257179) @@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include Modified: head/sys/netpfil/ipfw/ip_dn_io.c ============================================================================== --- head/sys/netpfil/ipfw/ip_dn_io.c Sat Oct 26 18:18:14 2013 (r257178) +++ head/sys/netpfil/ipfw/ip_dn_io.c Sat Oct 26 18:18:50 2013 (r257179) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/netpfil/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netpfil/ipfw/ip_dummynet.c Sat Oct 26 18:18:14 2013 (r257178) +++ head/sys/netpfil/ipfw/ip_dummynet.c Sat Oct 26 18:18:50 2013 (r257179) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/netpfil/pf/pf_ruleset.c ============================================================================== --- head/sys/netpfil/pf/pf_ruleset.c Sat Oct 26 18:18:14 2013 (r257178) +++ head/sys/netpfil/pf/pf_ruleset.c Sat Oct 26 18:18:50 2013 (r257179) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #ifdef INET6 Modified: head/sys/netpfil/pf/pf_table.c ============================================================================== --- head/sys/netpfil/pf/pf_table.c Sat Oct 26 18:18:14 2013 (r257178) +++ head/sys/netpfil/pf/pf_table.c Sat Oct 26 18:18:50 2013 (r257179) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 18:19:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 873D856F; Sat, 26 Oct 2013 18:19:37 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5A8282BC0; Sat, 26 Oct 2013 18:19:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QIJb1q076750; Sat, 26 Oct 2013 18:19:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QIJb1p076749; Sat, 26 Oct 2013 18:19:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310261819.r9QIJb1p076749@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 26 Oct 2013 18:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257180 - head/sys/powerpc/aim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 18:19:37 -0000 Author: nwhitehorn Date: Sat Oct 26 18:19:36 2013 New Revision: 257180 URL: http://svnweb.freebsd.org/changeset/base/257180 Log: Add some extra sanity checking and checks to printf format specifiers. Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sat Oct 26 18:18:50 2013 (r257179) +++ head/sys/powerpc/aim/mmu_oea64.c Sat Oct 26 18:19:36 2013 (r257180) @@ -498,15 +498,7 @@ moea64_add_ofw_mappings(mmu_t mmup, phan qsort(translations, sz, sizeof (*translations), om_cmp); for (i = 0; i < sz; i++) { - CTR3(KTR_PMAP, "translation: pa=%#x va=%#x len=%#x", - (uint32_t)(translations[i].om_pa_lo), translations[i].om_va, - translations[i].om_len); - - if (translations[i].om_pa_lo % PAGE_SIZE) - panic("OFW translation not page-aligned!"); - pa_base = translations[i].om_pa_lo; - #ifdef __powerpc64__ pa_base += (vm_offset_t)translations[i].om_pa_hi << 32; #else @@ -514,6 +506,14 @@ moea64_add_ofw_mappings(mmu_t mmup, phan panic("OFW translations above 32-bit boundary!"); #endif + if (pa_base % PAGE_SIZE) + panic("OFW translation not page-aligned (phys)!"); + if (translations[i].om_va % PAGE_SIZE) + panic("OFW translation not page-aligned (virt)!"); + + CTR3(KTR_PMAP, "translation: pa=%#zx va=%#x len=%#x", + pa_base, translations[i].om_va, translations[i].om_len); + /* Now enter the pages for this mapping */ DISABLE_TRANS(msr); @@ -690,9 +690,9 @@ moea64_early_bootstrap(mmu_t mmup, vm_of hwphyssz = 0; TUNABLE_ULONG_FETCH("hw.physmem", (u_long *) &hwphyssz); for (i = 0, j = 0; i < regions_sz; i++, j += 2) { - CTR3(KTR_PMAP, "region: %#x - %#x (%#x)", regions[i].mr_start, - regions[i].mr_start + regions[i].mr_size, - regions[i].mr_size); + CTR3(KTR_PMAP, "region: %#zx - %#zx (%#zx)", + regions[i].mr_start, regions[i].mr_start + + regions[i].mr_size, regions[i].mr_size); if (hwphyssz != 0 && (physsz + regions[i].mr_size) >= hwphyssz) { if (physsz < hwphyssz) { From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 18:23:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A3CC87B2; Sat, 26 Oct 2013 18:23:44 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7678F2BFD; Sat, 26 Oct 2013 18:23:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QINiFR079537; Sat, 26 Oct 2013 18:23:44 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QINijC079536; Sat, 26 Oct 2013 18:23:44 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201310261823.r9QINijC079536@svn.freebsd.org> From: John-Mark Gurney Date: Sat, 26 Oct 2013 18:23:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257182 - head/sbin/mdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 18:23:44 -0000 Author: jmg Date: Sat Oct 26 18:23:43 2013 New Revision: 257182 URL: http://svnweb.freebsd.org/changeset/base/257182 Log: bump date forgotten in r257165 Modified: head/sbin/mdconfig/mdconfig.8 Modified: head/sbin/mdconfig/mdconfig.8 ============================================================================== --- head/sbin/mdconfig/mdconfig.8 Sat Oct 26 18:22:16 2013 (r257181) +++ head/sbin/mdconfig/mdconfig.8 Sat Oct 26 18:23:43 2013 (r257182) @@ -41,7 +41,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 20, 2013 +.Dd October 26, 2013 .Dt MDCONFIG 8 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 18:25:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 992D391C; Sat, 26 Oct 2013 18:25:56 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6B8B62C19; Sat, 26 Oct 2013 18:25:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QIPuto079817; Sat, 26 Oct 2013 18:25:56 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QIPuhP079816; Sat, 26 Oct 2013 18:25:56 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310261825.r9QIPuhP079816@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 26 Oct 2013 18:25:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257183 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 18:25:56 -0000 Author: nwhitehorn Date: Sat Oct 26 18:25:55 2013 New Revision: 257183 URL: http://svnweb.freebsd.org/changeset/base/257183 Log: Be a bit more flexible in how we find the console from the properties on /chosen, following the list of allowed console properties in ePAPR. Also do not require that stdin be defined and equal to stdout: stdin is nonstandard (for ePAPR) and console in an unexpected place is after all better than no console. Modified: head/sys/dev/uart/uart_cpu_fdt.c Modified: head/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- head/sys/dev/uart/uart_cpu_fdt.c Sat Oct 26 18:23:43 2013 (r257182) +++ head/sys/dev/uart/uart_cpu_fdt.c Sat Oct 26 18:25:55 2013 (r257183) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -98,10 +99,25 @@ uart_cpu_eqres(struct uart_bas *b1, stru return ((pmap_kextract(b1->bsh) == pmap_kextract(b2->bsh)) ? 1 : 0); } +static int +phandle_chosen_propdev(phandle_t chosen, const char *name, phandle_t *node) +{ + char buf[64]; + + if (OF_getprop(chosen, name, buf, sizeof(buf)) <= 0) + return (ENXIO); + if ((*node = OF_finddevice(buf)) == -1) + return (ENXIO); + + return (0); +} + int uart_cpu_getdev(int devtype, struct uart_devinfo *di) { - char buf[64]; + const char *propnames[] = {"stdout-path", "linux,stdout-path", "stdout", + "stdin-path", "stdin", NULL}; + const char **name; struct uart_class *class; phandle_t node, chosen; pcell_t shift, br, rclk; @@ -111,7 +127,7 @@ uart_cpu_getdev(int devtype, struct uart uart_bus_space_mem = fdtbus_bs_tag; uart_bus_space_io = NULL; - /* Allow overriding the FDT uning the environment. */ + /* Allow overriding the FDT using the environment. */ class = &uart_ns8250_class; err = uart_getenv(devtype, di, class); if (!err) @@ -125,14 +141,11 @@ uart_cpu_getdev(int devtype, struct uart */ if ((chosen = OF_finddevice("/chosen")) == -1) return (ENXIO); - if (OF_getprop(chosen, "stdin", buf, sizeof(buf)) <= 0) - return (ENXIO); - if ((node = OF_finddevice(buf)) == -1) - return (ENXIO); - if (OF_getprop(chosen, "stdout", buf, sizeof(buf)) <= 0) - return (ENXIO); - if (OF_finddevice(buf) != node) - /* Only stdin == stdout is supported. */ + for (name = propnames; *name != NULL; name++) { + if (phandle_chosen_propdev(chosen, *name, &node) == 0) + break; + } + if (*name == NULL) return (ENXIO); /* * Retrieve serial attributes. From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 18:40:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D8E72C46; Sat, 26 Oct 2013 18:40:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B78F72CC1; Sat, 26 Oct 2013 18:40:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QIeO7k083969; Sat, 26 Oct 2013 18:40:24 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QIeH89083767; Sat, 26 Oct 2013 18:40:17 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310261840.r9QIeH89083767@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 26 Oct 2013 18:40:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257184 - in head/sys/dev: mii usb/net xl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 18:40:25 -0000 Author: glebius Date: Sat Oct 26 18:40:17 2013 New Revision: 257184 URL: http://svnweb.freebsd.org/changeset/base/257184 Log: The MII layer shouldn't care about administrative status of an interface. Make MII drivers forget about 'struct ifnet'. Later plan is to provide an administrative downcall from ifnet layer into drivers, to inform them about administrative status change. If someone thinks that processing MII events for an administratively down interface is a big problem, then drivers would turn MII processing off. The following MII drivers do evil things, like strcmp() on driver name, so they still need knowledge of ifnet and thus include if_var.h. They all need to be fixed: sys/dev/mii/brgphy.c sys/dev/mii/e1000phy.c sys/dev/mii/ip1000phy.c sys/dev/mii/jmphy.c sys/dev/mii/nsphy.c sys/dev/mii/rgephy.c sys/dev/mii/truephy.c Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/dev/mii/acphy.c head/sys/dev/mii/amphy.c head/sys/dev/mii/atphy.c head/sys/dev/mii/axphy.c head/sys/dev/mii/bmtphy.c head/sys/dev/mii/brgphy.c head/sys/dev/mii/ciphy.c head/sys/dev/mii/e1000phy.c head/sys/dev/mii/gentbi.c head/sys/dev/mii/icsphy.c head/sys/dev/mii/ip1000phy.c head/sys/dev/mii/jmphy.c head/sys/dev/mii/lxtphy.c head/sys/dev/mii/mii_physubr.c head/sys/dev/mii/mlphy.c head/sys/dev/mii/nsgphy.c head/sys/dev/mii/nsphy.c head/sys/dev/mii/nsphyter.c head/sys/dev/mii/pnaphy.c head/sys/dev/mii/qsphy.c head/sys/dev/mii/rdcphy.c head/sys/dev/mii/rgephy.c head/sys/dev/mii/rlphy.c head/sys/dev/mii/rlswitch.c head/sys/dev/mii/smcphy.c head/sys/dev/mii/smscphy.c head/sys/dev/mii/tdkphy.c head/sys/dev/mii/tlphy.c head/sys/dev/mii/truephy.c head/sys/dev/mii/ukphy.c head/sys/dev/mii/xmphy.c head/sys/dev/usb/net/ruephy.c head/sys/dev/xl/xlphy.c Modified: head/sys/dev/mii/acphy.c ============================================================================== --- head/sys/dev/mii/acphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/acphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -168,12 +168,6 @@ acphy_service(struct mii_softc *sc, stru break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - /* Wake & deisolate up if necessary */ reg = PHY_READ(sc, MII_BMCR); if (reg & (BMCR_ISO | BMCR_PDOWN)) @@ -184,12 +178,6 @@ acphy_service(struct mii_softc *sc, stru case MII_TICK: /* - * Is the interface even up? - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - return (0); - - /* * This PHY's autonegotiation doesn't need to be kicked. */ break; Modified: head/sys/dev/mii/amphy.c ============================================================================== --- head/sys/dev/mii/amphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/amphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -119,12 +119,6 @@ amphy_service(struct mii_softc *sc, stru break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - mii_phy_setmedia(sc); break; Modified: head/sys/dev/mii/atphy.c ============================================================================== --- head/sys/dev/mii/atphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/atphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -116,12 +116,6 @@ atphy_service(struct mii_softc *sc, stru break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - if (IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO || IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { atphy_setmedia(sc, ife->ifm_media); @@ -175,12 +169,6 @@ done: case MII_TICK: /* - * Is the interface even up? - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - return (0); - - /* * Only used for autonegotiation. */ if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) { Modified: head/sys/dev/mii/axphy.c ============================================================================== --- head/sys/dev/mii/axphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/axphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -113,12 +113,6 @@ axphy_service(struct mii_softc *sc, stru break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - mii_phy_setmedia(sc); break; Modified: head/sys/dev/mii/bmtphy.c ============================================================================== --- head/sys/dev/mii/bmtphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/bmtphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -159,12 +159,6 @@ bmtphy_service(struct mii_softc *sc, str break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - mii_phy_setmedia(sc); break; Modified: head/sys/dev/mii/brgphy.c ============================================================================== --- head/sys/dev/mii/brgphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/brgphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -314,10 +315,6 @@ brgphy_service(struct mii_softc *sc, str case MII_POLLSTAT: break; case MII_MEDIACHG: - /* If the interface is not up, don't do anything. */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - /* Todo: Why is this here? Is it really needed? */ PHY_RESET(sc); /* XXX hardware bug work-around */ @@ -337,11 +334,6 @@ brgphy_service(struct mii_softc *sc, str } break; case MII_TICK: - /* Bail if the interface isn't up. */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - return (0); - - /* Bail if autoneg isn't in process. */ if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) { sc->mii_ticks = 0; Modified: head/sys/dev/mii/ciphy.c ============================================================================== --- head/sys/dev/mii/ciphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/ciphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -131,12 +131,6 @@ ciphy_service(struct mii_softc *sc, stru break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - ciphy_fixup(sc); /* XXX hardware bug work-around */ switch (IFM_SUBTYPE(ife->ifm_media)) { @@ -187,12 +181,6 @@ setit: case MII_TICK: /* - * Is the interface even up? - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - return (0); - - /* * Only used for autonegotiation. */ if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) Modified: head/sys/dev/mii/e1000phy.c ============================================================================== --- head/sys/dev/mii/e1000phy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/e1000phy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -50,8 +50,8 @@ __FBSDID("$FreeBSD$"); #include #include - #include +#include #include #include @@ -311,12 +311,6 @@ e1000phy_service(struct mii_softc *sc, s break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - if (IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO) { e1000phy_mii_phy_auto(sc, ife->ifm_media); break; @@ -375,12 +369,6 @@ done: break; case MII_TICK: /* - * Is the interface even up? - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - return (0); - - /* * Only used for autonegotiation. */ if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) { Modified: head/sys/dev/mii/gentbi.c ============================================================================== --- head/sys/dev/mii/gentbi.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/gentbi.c Sat Oct 26 18:40:17 2013 (r257184) @@ -191,12 +191,6 @@ gentbi_service(struct mii_softc *sc, str break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - mii_phy_setmedia(sc); break; Modified: head/sys/dev/mii/icsphy.c ============================================================================== --- head/sys/dev/mii/icsphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/icsphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -145,12 +145,6 @@ icsphy_service(struct mii_softc *sc, str break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - mii_phy_setmedia(sc); break; Modified: head/sys/dev/mii/ip1000phy.c ============================================================================== --- head/sys/dev/mii/ip1000phy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/ip1000phy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -126,13 +127,6 @@ ip1000phy_service(struct mii_softc *sc, break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) { - break; - } - PHY_RESET(sc); switch (IFM_SUBTYPE(ife->ifm_media)) { case IFM_AUTO: @@ -180,12 +174,6 @@ done: case MII_TICK: /* - * Is the interface even up? - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - return (0); - - /* * Only used for autonegotiation. */ if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) { Modified: head/sys/dev/mii/jmphy.c ============================================================================== --- head/sys/dev/mii/jmphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/jmphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -121,24 +122,12 @@ jmphy_service(struct mii_softc *sc, stru break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - if (jmphy_setmedia(sc, ife) != EJUSTRETURN) return (EINVAL); break; case MII_TICK: /* - * Is the interface even up? - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - return (0); - - /* * Only used for autonegotiation. */ if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) { Modified: head/sys/dev/mii/lxtphy.c ============================================================================== --- head/sys/dev/mii/lxtphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/lxtphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -168,12 +168,6 @@ lxtphy_service(struct mii_softc *sc, str break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - if (IFM_SUBTYPE(ife->ifm_media) == IFM_100_FX) lxtphy_set_fx(sc); else Modified: head/sys/dev/mii/mii_physubr.c ============================================================================== --- head/sys/dev/mii/mii_physubr.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/mii_physubr.c Sat Oct 26 18:40:17 2013 (r257184) @@ -209,13 +209,8 @@ int mii_phy_tick(struct mii_softc *sc) { struct ifmedia_entry *ife = sc->mii_pdata->mii_media.ifm_cur; - struct ifnet *ifp = sc->mii_pdata->mii_ifp; int reg; - /* Just bail now if the interface is down. */ - if ((ifp->if_flags & IFF_UP) == 0) - return (EJUSTRETURN); - /* * If we're not doing autonegotiation, we don't need to do * any extra work here. However, we need to check the link Modified: head/sys/dev/mii/mlphy.c ============================================================================== --- head/sys/dev/mii/mlphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/mlphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -205,12 +205,6 @@ mlphy_service(xsc, mii, cmd) break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - switch (IFM_SUBTYPE(ife->ifm_media)) { case IFM_AUTO: /* @@ -266,12 +260,6 @@ mlphy_service(xsc, mii, cmd) case MII_TICK: /* - * Is the interface even up? - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - return (0); - - /* * Only used for autonegotiation. */ if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) Modified: head/sys/dev/mii/nsgphy.c ============================================================================== --- head/sys/dev/mii/nsgphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/nsgphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -159,12 +159,6 @@ nsgphy_service(struct mii_softc *sc, str break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - mii_phy_setmedia(sc); break; Modified: head/sys/dev/mii/nsphy.c ============================================================================== --- head/sys/dev/mii/nsphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/nsphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -152,12 +153,6 @@ nsphy_service(struct mii_softc *sc, stru break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - reg = PHY_READ(sc, MII_NSPHY_PCR); /* Modified: head/sys/dev/mii/nsphyter.c ============================================================================== --- head/sys/dev/mii/nsphyter.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/nsphyter.c Sat Oct 26 18:40:17 2013 (r257184) @@ -149,12 +149,6 @@ nsphyter_service(struct mii_softc *sc, s break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - mii_phy_setmedia(sc); break; Modified: head/sys/dev/mii/pnaphy.c ============================================================================== --- head/sys/dev/mii/pnaphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/pnaphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -121,12 +121,6 @@ pnaphy_service(struct mii_softc *sc, str break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - switch (IFM_SUBTYPE(ife->ifm_media)) { case IFM_HPNA_1: mii_phy_setmedia(sc); Modified: head/sys/dev/mii/qsphy.c ============================================================================== --- head/sys/dev/mii/qsphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/qsphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -143,23 +143,11 @@ qsphy_service(struct mii_softc *sc, stru break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - mii_phy_setmedia(sc); break; case MII_TICK: /* - * Is the interface even up? - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - return (0); - - /* * This PHY's autonegotiation doesn't need to be kicked. */ break; Modified: head/sys/dev/mii/rdcphy.c ============================================================================== --- head/sys/dev/mii/rdcphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/rdcphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -121,12 +121,6 @@ rdcphy_service(struct mii_softc *sc, str break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - mii_phy_setmedia(sc); switch (IFM_SUBTYPE(ife->ifm_media)) { case IFM_100_TX: Modified: head/sys/dev/mii/rgephy.c ============================================================================== --- head/sys/dev/mii/rgephy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/rgephy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -153,12 +154,6 @@ rgephy_service(struct mii_softc *sc, str break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - PHY_RESET(sc); /* XXX hardware bug work-around */ anar = PHY_READ(sc, RGEPHY_MII_ANAR); @@ -231,12 +226,6 @@ setit: case MII_TICK: /* - * Is the interface even up? - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - return (0); - - /* * Only used for autonegotiation. */ if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) { Modified: head/sys/dev/mii/rlphy.c ============================================================================== --- head/sys/dev/mii/rlphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/rlphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* XXXGL: if_rlreg.h contamination */ #include #include @@ -141,23 +142,11 @@ rlphy_service(struct mii_softc *sc, stru break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - mii_phy_setmedia(sc); break; case MII_TICK: /* - * Is the interface even up? - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - return (0); - - /* * The RealTek PHY's autonegotiation doesn't need to be * kicked; it continues in the background. */ Modified: head/sys/dev/mii/rlswitch.c ============================================================================== --- head/sys/dev/mii/rlswitch.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/rlswitch.c Sat Oct 26 18:40:17 2013 (r257184) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* XXXGL: if_rlreg.h contamination */ #include #include @@ -353,11 +354,6 @@ rlswitch_service(struct mii_softc *sc, s break; case MII_TICK: - /* - * Is the interface even up? - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - return (0); break; } Modified: head/sys/dev/mii/smcphy.c ============================================================================== --- head/sys/dev/mii/smcphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/smcphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -134,12 +134,6 @@ smcphy_service(struct mii_softc *sc, str break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - switch (IFM_SUBTYPE(ife->ifm_media)) { case IFM_AUTO: smcphy_auto(sc, ife->ifm_media); @@ -153,10 +147,6 @@ smcphy_service(struct mii_softc *sc, str break; case MII_TICK: - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) { - return (0); - } - if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) { break; } Modified: head/sys/dev/mii/smscphy.c ============================================================================== --- head/sys/dev/mii/smscphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/smscphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -120,12 +120,6 @@ smscphy_service(struct mii_softc *sc, st break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - switch (IFM_SUBTYPE(ife->ifm_media)) { case IFM_AUTO: smscphy_auto(sc, ife->ifm_media); @@ -139,10 +133,6 @@ smscphy_service(struct mii_softc *sc, st break; case MII_TICK: - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) { - return (0); - } - if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) { break; } Modified: head/sys/dev/mii/tdkphy.c ============================================================================== --- head/sys/dev/mii/tdkphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/tdkphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -122,12 +122,6 @@ tdkphy_service(struct mii_softc *sc, str break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - mii_phy_setmedia(sc); break; Modified: head/sys/dev/mii/tlphy.c ============================================================================== --- head/sys/dev/mii/tlphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/tlphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -217,12 +217,6 @@ tlphy_service(struct mii_softc *self, st break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - switch (IFM_SUBTYPE(ife->ifm_media)) { case IFM_AUTO: /* @@ -247,12 +241,6 @@ tlphy_service(struct mii_softc *self, st case MII_TICK: /* - * Is the interface even up? - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - return (0); - - /* * Only used for autonegotiation. */ if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) Modified: head/sys/dev/mii/truephy.c ============================================================================== --- head/sys/dev/mii/truephy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/truephy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -44,6 +44,7 @@ #include #include +#include #include #include #include @@ -180,12 +181,6 @@ truephy_service(struct mii_softc *sc, st break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) { bmcr = PHY_READ(sc, MII_BMCR) & ~BMCR_AUTOEN; PHY_WRITE(sc, MII_BMCR, bmcr); Modified: head/sys/dev/mii/ukphy.c ============================================================================== --- head/sys/dev/mii/ukphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/ukphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -140,12 +140,6 @@ ukphy_service(struct mii_softc *sc, stru break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - mii_phy_setmedia(sc); break; Modified: head/sys/dev/mii/xmphy.c ============================================================================== --- head/sys/dev/mii/xmphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/mii/xmphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -148,12 +148,6 @@ xmphy_service(struct mii_softc *sc, stru break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - switch (IFM_SUBTYPE(ife->ifm_media)) { case IFM_AUTO: #ifdef foo @@ -182,12 +176,6 @@ xmphy_service(struct mii_softc *sc, stru case MII_TICK: /* - * Is the interface even up? - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - return (0); - - /* * Only used for autonegotiation. */ if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) Modified: head/sys/dev/usb/net/ruephy.c ============================================================================== --- head/sys/dev/usb/net/ruephy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/usb/net/ruephy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -123,23 +123,11 @@ ruephy_service(struct mii_softc *sc, str break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - mii_phy_setmedia(sc); break; case MII_TICK: /* - * Is the interface even up? - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - return (0); - - /* * Only used for autonegotiation. */ if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) Modified: head/sys/dev/xl/xlphy.c ============================================================================== --- head/sys/dev/xl/xlphy.c Sat Oct 26 18:25:55 2013 (r257183) +++ head/sys/dev/xl/xlphy.c Sat Oct 26 18:40:17 2013 (r257184) @@ -152,23 +152,11 @@ xlphy_service(struct mii_softc *sc, stru break; case MII_MEDIACHG: - /* - * If the interface is not up, don't do anything. - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - break; - mii_phy_setmedia(sc); break; case MII_TICK: /* - * Is the interface even up? - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - return (0); - - /* * The 3Com PHY's autonegotiation doesn't need to be * kicked; it continues in the background. */ From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 19:00:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AC4DD226; Sat, 26 Oct 2013 19:00:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9615E2D75; Sat, 26 Oct 2013 19:00:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QJ001x090463; Sat, 26 Oct 2013 19:00:00 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QIxw57090334; Sat, 26 Oct 2013 18:59:58 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310261859.r9QIxw57090334@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 26 Oct 2013 18:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257186 - in head: contrib/libpcap sys/contrib/altq/altq sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 19:00:00 -0000 Author: glebius Date: Sat Oct 26 18:59:58 2013 New Revision: 257186 URL: http://svnweb.freebsd.org/changeset/base/257186 Log: Start splitting pfvar.h into internal and external parts. - Provide pf_altq.h that has only stuff needed for ALTQ. - Start pf.h, that would have all constant values and eventually non-kernel structures. - Build ALTQ w/o pfvar.h, include if_var.h, that before came via pollution. - Build tcpdump w/o pfvar.h. Sponsored by: Netflix Sponsored by: Nginx, Inc. Added: head/sys/net/pf.h - copied, changed from r257177, head/sys/net/pfvar.h head/sys/net/pf_altq.h - copied, changed from r257177, head/sys/net/pfvar.h Modified: head/contrib/libpcap/grammar.y head/sys/contrib/altq/altq/altq_cbq.c head/sys/contrib/altq/altq/altq_cdnr.c head/sys/contrib/altq/altq/altq_hfsc.c head/sys/contrib/altq/altq/altq_priq.c head/sys/contrib/altq/altq/altq_red.c head/sys/contrib/altq/altq/altq_rio.c head/sys/contrib/altq/altq/altq_rmclass.c head/sys/contrib/altq/altq/altq_subr.c head/sys/net/pfvar.h Modified: head/contrib/libpcap/grammar.y ============================================================================== --- head/contrib/libpcap/grammar.y Sat Oct 26 18:47:10 2013 (r257185) +++ head/contrib/libpcap/grammar.y Sat Oct 26 18:59:58 2013 (r257186) @@ -56,7 +56,7 @@ struct rtentry; #include "gencode.h" #ifdef HAVE_NET_PFVAR_H #include -#include +#include #include #endif #include "ieee80211.h" Modified: head/sys/contrib/altq/altq/altq_cbq.c ============================================================================== --- head/sys/contrib/altq/altq/altq_cbq.c Sat Oct 26 18:47:10 2013 (r257185) +++ head/sys/contrib/altq/altq/altq_cbq.c Sat Oct 26 18:59:58 2013 (r257186) @@ -54,9 +54,12 @@ #endif #include +#include #include -#include +#include +#include +#include #include #include #ifdef ALTQ3_COMPAT Modified: head/sys/contrib/altq/altq/altq_cdnr.c ============================================================================== --- head/sys/contrib/altq/altq/altq_cdnr.c Sat Oct 26 18:47:10 2013 (r257185) +++ head/sys/contrib/altq/altq/altq_cdnr.c Sat Oct 26 18:59:58 2013 (r257186) @@ -55,6 +55,7 @@ #include #endif +#include #include #ifdef ALTQ3_COMPAT #include Modified: head/sys/contrib/altq/altq/altq_hfsc.c ============================================================================== --- head/sys/contrib/altq/altq/altq_hfsc.c Sat Oct 26 18:47:10 2013 (r257185) +++ head/sys/contrib/altq/altq/altq_hfsc.c Sat Oct 26 18:59:58 2013 (r257186) @@ -66,9 +66,12 @@ #endif /* ALTQ3_COMPAT */ #include +#include #include -#include +#include +#include +#include #include #include #ifdef ALTQ3_COMPAT Modified: head/sys/contrib/altq/altq/altq_priq.c ============================================================================== --- head/sys/contrib/altq/altq/altq_priq.c Sat Oct 26 18:47:10 2013 (r257185) +++ head/sys/contrib/altq/altq/altq_priq.c Sat Oct 26 18:59:58 2013 (r257186) @@ -51,9 +51,12 @@ #include #include +#include #include -#include +#include +#include +#include #include #ifdef ALTQ3_COMPAT #include Modified: head/sys/contrib/altq/altq/altq_red.c ============================================================================== --- head/sys/contrib/altq/altq/altq_red.c Sat Oct 26 18:47:10 2013 (r257185) +++ head/sys/contrib/altq/altq/altq_red.c Sat Oct 26 18:59:58 2013 (r257186) @@ -86,6 +86,7 @@ #endif /* ALTQ3_COMPAT */ #include +#include #include #include @@ -94,7 +95,9 @@ #include #endif -#include +#include +#include +#include #include #include #ifdef ALTQ3_COMPAT Modified: head/sys/contrib/altq/altq/altq_rio.c ============================================================================== --- head/sys/contrib/altq/altq/altq_rio.c Sat Oct 26 18:47:10 2013 (r257185) +++ head/sys/contrib/altq/altq/altq_rio.c Sat Oct 26 18:59:58 2013 (r257186) @@ -81,6 +81,7 @@ #endif #include +#include #include #include @@ -89,7 +90,8 @@ #include #endif -#include +#include +#include #include #include #include Modified: head/sys/contrib/altq/altq/altq_rmclass.c ============================================================================== --- head/sys/contrib/altq/altq/altq_rmclass.c Sat Oct 26 18:47:10 2013 (r257185) +++ head/sys/contrib/altq/altq/altq_rmclass.c Sat Oct 26 18:59:58 2013 (r257186) @@ -59,12 +59,14 @@ #endif #include +#include #ifdef ALTQ3_COMPAT #include #include #include #endif +#include #include #include #include Modified: head/sys/contrib/altq/altq/altq_subr.c ============================================================================== --- head/sys/contrib/altq/altq/altq_subr.c Sat Oct 26 18:47:10 2013 (r257185) +++ head/sys/contrib/altq/altq/altq_subr.c Sat Oct 26 18:59:58 2013 (r257186) @@ -49,6 +49,7 @@ #include #include +#include #include #include #ifdef __FreeBSD__ @@ -64,7 +65,8 @@ #include #include -#include +#include +#include #include #ifdef ALTQ3_COMPAT #include Copied and modified: head/sys/net/pf.h (from r257177, head/sys/net/pfvar.h) ============================================================================== --- head/sys/net/pfvar.h Sat Oct 26 18:03:36 2013 (r257177, copy source) +++ head/sys/net/pf.h Sat Oct 26 18:59:58 2013 (r257186) @@ -30,18 +30,8 @@ * $FreeBSD$ */ -#ifndef _NET_PFVAR_H_ -#define _NET_PFVAR_H_ - -#include -#include -#include -#include - -#include -#include - -#include +#ifndef _NET_PF_H_ +#define _NET_PFAR_H_ #define PF_TCPS_PROXY_SRC ((TCP_NSTATES)+0) #define PF_TCPS_PROXY_DST ((TCP_NSTATES)+1) @@ -119,1082 +109,6 @@ enum { PF_ADDR_ADDRMASK, PF_ADDR_NOROUTE #define PF_LOG_ALL 0x02 #define PF_LOG_SOCKET_LOOKUP 0x04 -struct pf_addr { - union { - struct in_addr v4; - struct in6_addr v6; - u_int8_t addr8[16]; - u_int16_t addr16[8]; - u_int32_t addr32[4]; - } pfa; /* 128-bit address */ -#define v4 pfa.v4 -#define v6 pfa.v6 -#define addr8 pfa.addr8 -#define addr16 pfa.addr16 -#define addr32 pfa.addr32 -}; - -#define PF_TABLE_NAME_SIZE 32 - -#define PFI_AFLAG_NETWORK 0x01 -#define PFI_AFLAG_BROADCAST 0x02 -#define PFI_AFLAG_PEER 0x04 -#define PFI_AFLAG_MODEMASK 0x07 -#define PFI_AFLAG_NOALIAS 0x08 - -struct pf_addr_wrap { - union { - struct { - struct pf_addr addr; - struct pf_addr mask; - } a; - char ifname[IFNAMSIZ]; - char tblname[PF_TABLE_NAME_SIZE]; - } v; - union { - struct pfi_dynaddr *dyn; - struct pfr_ktable *tbl; - int dyncnt; - int tblcnt; - } p; - u_int8_t type; /* PF_ADDR_* */ - u_int8_t iflags; /* PFI_AFLAG_* */ -}; - -#ifdef _KERNEL - -struct pfi_dynaddr { - TAILQ_ENTRY(pfi_dynaddr) entry; - struct pf_addr pfid_addr4; - struct pf_addr pfid_mask4; - struct pf_addr pfid_addr6; - struct pf_addr pfid_mask6; - struct pfr_ktable *pfid_kt; - struct pfi_kif *pfid_kif; - int pfid_net; /* mask or 128 */ - int pfid_acnt4; /* address count IPv4 */ - int pfid_acnt6; /* address count IPv6 */ - sa_family_t pfid_af; /* rule af */ - u_int8_t pfid_iflags; /* PFI_AFLAG_* */ -}; - -/* - * Address manipulation macros - */ -#define HTONL(x) (x) = htonl((__uint32_t)(x)) -#define HTONS(x) (x) = htons((__uint16_t)(x)) -#define NTOHL(x) (x) = ntohl((__uint32_t)(x)) -#define NTOHS(x) (x) = ntohs((__uint16_t)(x)) - -#define PF_NAME "pf" - -#define PF_HASHROW_ASSERT(h) mtx_assert(&(h)->lock, MA_OWNED) -#define PF_HASHROW_LOCK(h) mtx_lock(&(h)->lock) -#define PF_HASHROW_UNLOCK(h) mtx_unlock(&(h)->lock) - -#define PF_STATE_LOCK(s) \ - do { \ - struct pf_idhash *_ih = &V_pf_idhash[PF_IDHASH(s)]; \ - PF_HASHROW_LOCK(_ih); \ - } while (0) - -#define PF_STATE_UNLOCK(s) \ - do { \ - struct pf_idhash *_ih = &V_pf_idhash[PF_IDHASH((s))]; \ - PF_HASHROW_UNLOCK(_ih); \ - } while (0) - -#ifdef INVARIANTS -#define PF_STATE_LOCK_ASSERT(s) \ - do { \ - struct pf_idhash *_ih = &V_pf_idhash[PF_IDHASH(s)]; \ - PF_HASHROW_ASSERT(_ih); \ - } while (0) -#else /* !INVARIANTS */ -#define PF_STATE_LOCK_ASSERT(s) do {} while (0) -#endif /* INVARIANTS */ - -extern struct mtx pf_unlnkdrules_mtx; -#define PF_UNLNKDRULES_LOCK() mtx_lock(&pf_unlnkdrules_mtx) -#define PF_UNLNKDRULES_UNLOCK() mtx_unlock(&pf_unlnkdrules_mtx) - -extern struct rwlock pf_rules_lock; -#define PF_RULES_RLOCK() rw_rlock(&pf_rules_lock) -#define PF_RULES_RUNLOCK() rw_runlock(&pf_rules_lock) -#define PF_RULES_WLOCK() rw_wlock(&pf_rules_lock) -#define PF_RULES_WUNLOCK() rw_wunlock(&pf_rules_lock) -#define PF_RULES_ASSERT() rw_assert(&pf_rules_lock, RA_LOCKED) -#define PF_RULES_RASSERT() rw_assert(&pf_rules_lock, RA_RLOCKED) -#define PF_RULES_WASSERT() rw_assert(&pf_rules_lock, RA_WLOCKED) - -#define PF_MODVER 1 -#define PFLOG_MODVER 1 -#define PFSYNC_MODVER 1 - -#define PFLOG_MINVER 1 -#define PFLOG_PREFVER PFLOG_MODVER -#define PFLOG_MAXVER 1 -#define PFSYNC_MINVER 1 -#define PFSYNC_PREFVER PFSYNC_MODVER -#define PFSYNC_MAXVER 1 - -#ifdef INET -#ifndef INET6 -#define PF_INET_ONLY -#endif /* ! INET6 */ -#endif /* INET */ - -#ifdef INET6 -#ifndef INET -#define PF_INET6_ONLY -#endif /* ! INET */ -#endif /* INET6 */ - -#ifdef INET -#ifdef INET6 -#define PF_INET_INET6 -#endif /* INET6 */ -#endif /* INET */ - -#else - -#define PF_INET_INET6 - -#endif /* _KERNEL */ - -/* Both IPv4 and IPv6 */ -#ifdef PF_INET_INET6 - -#define PF_AEQ(a, b, c) \ - ((c == AF_INET && (a)->addr32[0] == (b)->addr32[0]) || \ - ((a)->addr32[3] == (b)->addr32[3] && \ - (a)->addr32[2] == (b)->addr32[2] && \ - (a)->addr32[1] == (b)->addr32[1] && \ - (a)->addr32[0] == (b)->addr32[0])) \ - -#define PF_ANEQ(a, b, c) \ - ((c == AF_INET && (a)->addr32[0] != (b)->addr32[0]) || \ - ((a)->addr32[3] != (b)->addr32[3] || \ - (a)->addr32[2] != (b)->addr32[2] || \ - (a)->addr32[1] != (b)->addr32[1] || \ - (a)->addr32[0] != (b)->addr32[0])) \ - -#define PF_AZERO(a, c) \ - ((c == AF_INET && !(a)->addr32[0]) || \ - (!(a)->addr32[0] && !(a)->addr32[1] && \ - !(a)->addr32[2] && !(a)->addr32[3] )) \ - -#define PF_MATCHA(n, a, m, b, f) \ - pf_match_addr(n, a, m, b, f) - -#define PF_ACPY(a, b, f) \ - pf_addrcpy(a, b, f) - -#define PF_AINC(a, f) \ - pf_addr_inc(a, f) - -#define PF_POOLMASK(a, b, c, d, f) \ - pf_poolmask(a, b, c, d, f) - -#else - -/* Just IPv6 */ - -#ifdef PF_INET6_ONLY - -#define PF_AEQ(a, b, c) \ - ((a)->addr32[3] == (b)->addr32[3] && \ - (a)->addr32[2] == (b)->addr32[2] && \ - (a)->addr32[1] == (b)->addr32[1] && \ - (a)->addr32[0] == (b)->addr32[0]) \ - -#define PF_ANEQ(a, b, c) \ - ((a)->addr32[3] != (b)->addr32[3] || \ - (a)->addr32[2] != (b)->addr32[2] || \ - (a)->addr32[1] != (b)->addr32[1] || \ - (a)->addr32[0] != (b)->addr32[0]) \ - -#define PF_AZERO(a, c) \ - (!(a)->addr32[0] && \ - !(a)->addr32[1] && \ - !(a)->addr32[2] && \ - !(a)->addr32[3] ) \ - -#define PF_MATCHA(n, a, m, b, f) \ - pf_match_addr(n, a, m, b, f) - -#define PF_ACPY(a, b, f) \ - pf_addrcpy(a, b, f) - -#define PF_AINC(a, f) \ - pf_addr_inc(a, f) - -#define PF_POOLMASK(a, b, c, d, f) \ - pf_poolmask(a, b, c, d, f) - -#else - -/* Just IPv4 */ -#ifdef PF_INET_ONLY - -#define PF_AEQ(a, b, c) \ - ((a)->addr32[0] == (b)->addr32[0]) - -#define PF_ANEQ(a, b, c) \ - ((a)->addr32[0] != (b)->addr32[0]) - -#define PF_AZERO(a, c) \ - (!(a)->addr32[0]) - -#define PF_MATCHA(n, a, m, b, f) \ - pf_match_addr(n, a, m, b, f) - -#define PF_ACPY(a, b, f) \ - (a)->v4.s_addr = (b)->v4.s_addr - -#define PF_AINC(a, f) \ - do { \ - (a)->addr32[0] = htonl(ntohl((a)->addr32[0]) + 1); \ - } while (0) - -#define PF_POOLMASK(a, b, c, d, f) \ - do { \ - (a)->addr32[0] = ((b)->addr32[0] & (c)->addr32[0]) | \ - (((c)->addr32[0] ^ 0xffffffff ) & (d)->addr32[0]); \ - } while (0) - -#endif /* PF_INET_ONLY */ -#endif /* PF_INET6_ONLY */ -#endif /* PF_INET_INET6 */ - -/* - * XXX callers not FIB-aware in our version of pf yet. - * OpenBSD fixed it later it seems, 2010/05/07 13:33:16 claudio. - */ -#define PF_MISMATCHAW(aw, x, af, neg, ifp, rtid) \ - ( \ - (((aw)->type == PF_ADDR_NOROUTE && \ - pf_routable((x), (af), NULL, (rtid))) || \ - (((aw)->type == PF_ADDR_URPFFAILED && (ifp) != NULL && \ - pf_routable((x), (af), (ifp), (rtid))) || \ - ((aw)->type == PF_ADDR_TABLE && \ - !pfr_match_addr((aw)->p.tbl, (x), (af))) || \ - ((aw)->type == PF_ADDR_DYNIFTL && \ - !pfi_match_addr((aw)->p.dyn, (x), (af))) || \ - ((aw)->type == PF_ADDR_RANGE && \ - !pf_match_addr_range(&(aw)->v.a.addr, \ - &(aw)->v.a.mask, (x), (af))) || \ - ((aw)->type == PF_ADDR_ADDRMASK && \ - !PF_AZERO(&(aw)->v.a.mask, (af)) && \ - !PF_MATCHA(0, &(aw)->v.a.addr, \ - &(aw)->v.a.mask, (x), (af))))) != \ - (neg) \ - ) - - -struct pf_rule_uid { - uid_t uid[2]; - u_int8_t op; -}; - -struct pf_rule_gid { - uid_t gid[2]; - u_int8_t op; -}; - -struct pf_rule_addr { - struct pf_addr_wrap addr; - u_int16_t port[2]; - u_int8_t neg; - u_int8_t port_op; -}; - -struct pf_pooladdr { - struct pf_addr_wrap addr; - TAILQ_ENTRY(pf_pooladdr) entries; - char ifname[IFNAMSIZ]; - struct pfi_kif *kif; -}; - -TAILQ_HEAD(pf_palist, pf_pooladdr); - -struct pf_poolhashkey { - union { - u_int8_t key8[16]; - u_int16_t key16[8]; - u_int32_t key32[4]; - } pfk; /* 128-bit hash key */ -#define key8 pfk.key8 -#define key16 pfk.key16 -#define key32 pfk.key32 -}; - -struct pf_pool { - struct pf_palist list; - struct pf_pooladdr *cur; - struct pf_poolhashkey key; - struct pf_addr counter; - int tblidx; - u_int16_t proxy_port[2]; - u_int8_t opts; -}; - - -/* A packed Operating System description for fingerprinting */ -typedef u_int32_t pf_osfp_t; -#define PF_OSFP_ANY ((pf_osfp_t)0) -#define PF_OSFP_UNKNOWN ((pf_osfp_t)-1) -#define PF_OSFP_NOMATCH ((pf_osfp_t)-2) - -struct pf_osfp_entry { - SLIST_ENTRY(pf_osfp_entry) fp_entry; - pf_osfp_t fp_os; - int fp_enflags; -#define PF_OSFP_EXPANDED 0x001 /* expanded entry */ -#define PF_OSFP_GENERIC 0x002 /* generic signature */ -#define PF_OSFP_NODETAIL 0x004 /* no p0f details */ -#define PF_OSFP_LEN 32 - char fp_class_nm[PF_OSFP_LEN]; - char fp_version_nm[PF_OSFP_LEN]; - char fp_subtype_nm[PF_OSFP_LEN]; -}; -#define PF_OSFP_ENTRY_EQ(a, b) \ - ((a)->fp_os == (b)->fp_os && \ - memcmp((a)->fp_class_nm, (b)->fp_class_nm, PF_OSFP_LEN) == 0 && \ - memcmp((a)->fp_version_nm, (b)->fp_version_nm, PF_OSFP_LEN) == 0 && \ - memcmp((a)->fp_subtype_nm, (b)->fp_subtype_nm, PF_OSFP_LEN) == 0) - -/* handle pf_osfp_t packing */ -#define _FP_RESERVED_BIT 1 /* For the special negative #defines */ -#define _FP_UNUSED_BITS 1 -#define _FP_CLASS_BITS 10 /* OS Class (Windows, Linux) */ -#define _FP_VERSION_BITS 10 /* OS version (95, 98, NT, 2.4.54, 3.2) */ -#define _FP_SUBTYPE_BITS 10 /* patch level (NT SP4, SP3, ECN patch) */ -#define PF_OSFP_UNPACK(osfp, class, version, subtype) do { \ - (class) = ((osfp) >> (_FP_VERSION_BITS+_FP_SUBTYPE_BITS)) & \ - ((1 << _FP_CLASS_BITS) - 1); \ - (version) = ((osfp) >> _FP_SUBTYPE_BITS) & \ - ((1 << _FP_VERSION_BITS) - 1);\ - (subtype) = (osfp) & ((1 << _FP_SUBTYPE_BITS) - 1); \ -} while(0) -#define PF_OSFP_PACK(osfp, class, version, subtype) do { \ - (osfp) = ((class) & ((1 << _FP_CLASS_BITS) - 1)) << (_FP_VERSION_BITS \ - + _FP_SUBTYPE_BITS); \ - (osfp) |= ((version) & ((1 << _FP_VERSION_BITS) - 1)) << \ - _FP_SUBTYPE_BITS; \ - (osfp) |= (subtype) & ((1 << _FP_SUBTYPE_BITS) - 1); \ -} while(0) - -/* the fingerprint of an OSes TCP SYN packet */ -typedef u_int64_t pf_tcpopts_t; -struct pf_os_fingerprint { - SLIST_HEAD(pf_osfp_enlist, pf_osfp_entry) fp_oses; /* list of matches */ - pf_tcpopts_t fp_tcpopts; /* packed TCP options */ - u_int16_t fp_wsize; /* TCP window size */ - u_int16_t fp_psize; /* ip->ip_len */ - u_int16_t fp_mss; /* TCP MSS */ - u_int16_t fp_flags; -#define PF_OSFP_WSIZE_MOD 0x0001 /* Window modulus */ -#define PF_OSFP_WSIZE_DC 0x0002 /* Window don't care */ -#define PF_OSFP_WSIZE_MSS 0x0004 /* Window multiple of MSS */ -#define PF_OSFP_WSIZE_MTU 0x0008 /* Window multiple of MTU */ -#define PF_OSFP_PSIZE_MOD 0x0010 /* packet size modulus */ -#define PF_OSFP_PSIZE_DC 0x0020 /* packet size don't care */ -#define PF_OSFP_WSCALE 0x0040 /* TCP window scaling */ -#define PF_OSFP_WSCALE_MOD 0x0080 /* TCP window scale modulus */ -#define PF_OSFP_WSCALE_DC 0x0100 /* TCP window scale dont-care */ -#define PF_OSFP_MSS 0x0200 /* TCP MSS */ -#define PF_OSFP_MSS_MOD 0x0400 /* TCP MSS modulus */ -#define PF_OSFP_MSS_DC 0x0800 /* TCP MSS dont-care */ -#define PF_OSFP_DF 0x1000 /* IPv4 don't fragment bit */ -#define PF_OSFP_TS0 0x2000 /* Zero timestamp */ -#define PF_OSFP_INET6 0x4000 /* IPv6 */ - u_int8_t fp_optcnt; /* TCP option count */ - u_int8_t fp_wscale; /* TCP window scaling */ - u_int8_t fp_ttl; /* IPv4 TTL */ -#define PF_OSFP_MAXTTL_OFFSET 40 -/* TCP options packing */ -#define PF_OSFP_TCPOPT_NOP 0x0 /* TCP NOP option */ -#define PF_OSFP_TCPOPT_WSCALE 0x1 /* TCP window scaling option */ -#define PF_OSFP_TCPOPT_MSS 0x2 /* TCP max segment size opt */ -#define PF_OSFP_TCPOPT_SACK 0x3 /* TCP SACK OK option */ -#define PF_OSFP_TCPOPT_TS 0x4 /* TCP timestamp option */ -#define PF_OSFP_TCPOPT_BITS 3 /* bits used by each option */ -#define PF_OSFP_MAX_OPTS \ - (sizeof(((struct pf_os_fingerprint *)0)->fp_tcpopts) * 8) \ - / PF_OSFP_TCPOPT_BITS - - SLIST_ENTRY(pf_os_fingerprint) fp_next; -}; - -struct pf_osfp_ioctl { - struct pf_osfp_entry fp_os; - pf_tcpopts_t fp_tcpopts; /* packed TCP options */ - u_int16_t fp_wsize; /* TCP window size */ - u_int16_t fp_psize; /* ip->ip_len */ - u_int16_t fp_mss; /* TCP MSS */ - u_int16_t fp_flags; - u_int8_t fp_optcnt; /* TCP option count */ - u_int8_t fp_wscale; /* TCP window scaling */ - u_int8_t fp_ttl; /* IPv4 TTL */ - - int fp_getnum; /* DIOCOSFPGET number */ -}; - - -union pf_rule_ptr { - struct pf_rule *ptr; - u_int32_t nr; -}; - -#define PF_ANCHOR_NAME_SIZE 64 - -struct pf_rule { - struct pf_rule_addr src; - struct pf_rule_addr dst; -#define PF_SKIP_IFP 0 -#define PF_SKIP_DIR 1 -#define PF_SKIP_AF 2 -#define PF_SKIP_PROTO 3 -#define PF_SKIP_SRC_ADDR 4 -#define PF_SKIP_SRC_PORT 5 -#define PF_SKIP_DST_ADDR 6 -#define PF_SKIP_DST_PORT 7 -#define PF_SKIP_COUNT 8 - union pf_rule_ptr skip[PF_SKIP_COUNT]; -#define PF_RULE_LABEL_SIZE 64 - char label[PF_RULE_LABEL_SIZE]; -#define PF_QNAME_SIZE 64 - char ifname[IFNAMSIZ]; - char qname[PF_QNAME_SIZE]; - char pqname[PF_QNAME_SIZE]; -#define PF_TAG_NAME_SIZE 64 - char tagname[PF_TAG_NAME_SIZE]; - char match_tagname[PF_TAG_NAME_SIZE]; - - char overload_tblname[PF_TABLE_NAME_SIZE]; - - TAILQ_ENTRY(pf_rule) entries; - struct pf_pool rpool; - - u_int64_t evaluations; - u_int64_t packets[2]; - u_int64_t bytes[2]; - - struct pfi_kif *kif; - struct pf_anchor *anchor; - struct pfr_ktable *overload_tbl; - - pf_osfp_t os_fingerprint; - - int rtableid; - u_int32_t timeout[PFTM_MAX]; - u_int32_t states_cur; - u_int32_t states_tot; - u_int32_t max_states; - u_int32_t src_nodes; - u_int32_t max_src_nodes; - u_int32_t max_src_states; - u_int32_t spare1; /* netgraph */ - u_int32_t max_src_conn; - struct { - u_int32_t limit; - u_int32_t seconds; - } max_src_conn_rate; - u_int32_t qid; - u_int32_t pqid; - u_int32_t rt_listid; - u_int32_t nr; - u_int32_t prob; - uid_t cuid; - pid_t cpid; - - u_int16_t return_icmp; - u_int16_t return_icmp6; - u_int16_t max_mss; - u_int16_t tag; - u_int16_t match_tag; - u_int16_t spare2; /* netgraph */ - - struct pf_rule_uid uid; - struct pf_rule_gid gid; - - u_int32_t rule_flag; - u_int8_t action; - u_int8_t direction; - u_int8_t log; - u_int8_t logif; - u_int8_t quick; - u_int8_t ifnot; - u_int8_t match_tag_not; - u_int8_t natpass; - -#define PF_STATE_NORMAL 0x1 -#define PF_STATE_MODULATE 0x2 -#define PF_STATE_SYNPROXY 0x3 - u_int8_t keep_state; - sa_family_t af; - u_int8_t proto; - u_int8_t type; - u_int8_t code; - u_int8_t flags; - u_int8_t flagset; - u_int8_t min_ttl; - u_int8_t allow_opts; - u_int8_t rt; - u_int8_t return_ttl; - u_int8_t tos; - u_int8_t set_tos; - u_int8_t anchor_relative; - u_int8_t anchor_wildcard; - -#define PF_FLUSH 0x01 -#define PF_FLUSH_GLOBAL 0x02 - u_int8_t flush; - - struct { - struct pf_addr addr; - u_int16_t port; - } divert; -}; - -/* rule flags */ -#define PFRULE_DROP 0x0000 -#define PFRULE_RETURNRST 0x0001 -#define PFRULE_FRAGMENT 0x0002 -#define PFRULE_RETURNICMP 0x0004 -#define PFRULE_RETURN 0x0008 -#define PFRULE_NOSYNC 0x0010 -#define PFRULE_SRCTRACK 0x0020 /* track source states */ -#define PFRULE_RULESRCTRACK 0x0040 /* per rule */ -#define PFRULE_REFS 0x0080 /* rule has references */ - -/* scrub flags */ -#define PFRULE_NODF 0x0100 -#define PFRULE_FRAGCROP 0x0200 /* non-buffering frag cache */ -#define PFRULE_FRAGDROP 0x0400 /* drop funny fragments */ -#define PFRULE_RANDOMID 0x0800 -#define PFRULE_REASSEMBLE_TCP 0x1000 -#define PFRULE_SET_TOS 0x2000 - -/* rule flags again */ -#define PFRULE_IFBOUND 0x00010000 /* if-bound */ -#define PFRULE_STATESLOPPY 0x00020000 /* sloppy state tracking */ - -#define PFSTATE_HIWAT 10000 /* default state table size */ -#define PFSTATE_ADAPT_START 6000 /* default adaptive timeout start */ -#define PFSTATE_ADAPT_END 12000 /* default adaptive timeout end */ - - -struct pf_threshold { - u_int32_t limit; -#define PF_THRESHOLD_MULT 1000 -#define PF_THRESHOLD_MAX 0xffffffff / PF_THRESHOLD_MULT - u_int32_t seconds; - u_int32_t count; - u_int32_t last; -}; - -struct pf_src_node { - LIST_ENTRY(pf_src_node) entry; - struct pf_addr addr; - struct pf_addr raddr; - union pf_rule_ptr rule; - struct pfi_kif *kif; - u_int64_t bytes[2]; - u_int64_t packets[2]; - u_int32_t states; - u_int32_t conn; - struct pf_threshold conn_rate; - u_int32_t creation; - u_int32_t expire; - sa_family_t af; - u_int8_t ruletype; -}; - -#define PFSNODE_HIWAT 10000 /* default source node table size */ - -struct pf_state_scrub { - struct timeval pfss_last; /* time received last packet */ - u_int32_t pfss_tsecr; /* last echoed timestamp */ - u_int32_t pfss_tsval; /* largest timestamp */ - u_int32_t pfss_tsval0; /* original timestamp */ - u_int16_t pfss_flags; -#define PFSS_TIMESTAMP 0x0001 /* modulate timestamp */ -#define PFSS_PAWS 0x0010 /* stricter PAWS checks */ -#define PFSS_PAWS_IDLED 0x0020 /* was idle too long. no PAWS */ -#define PFSS_DATA_TS 0x0040 /* timestamp on data packets */ -#define PFSS_DATA_NOTS 0x0080 /* no timestamp on data packets */ - u_int8_t pfss_ttl; /* stashed TTL */ - u_int8_t pad; - u_int32_t pfss_ts_mod; /* timestamp modulation */ -}; - -struct pf_state_host { - struct pf_addr addr; - u_int16_t port; - u_int16_t pad; -}; - -struct pf_state_peer { - struct pf_state_scrub *scrub; /* state is scrubbed */ - u_int32_t seqlo; /* Max sequence number sent */ - u_int32_t seqhi; /* Max the other end ACKd + win */ - u_int32_t seqdiff; /* Sequence number modulator */ - u_int16_t max_win; /* largest window (pre scaling) */ - u_int16_t mss; /* Maximum segment size option */ - u_int8_t state; /* active state level */ - u_int8_t wscale; /* window scaling factor */ - u_int8_t tcp_est; /* Did we reach TCPS_ESTABLISHED */ - u_int8_t pad[1]; -}; - -/* Keep synced with struct pf_state_key. */ -struct pf_state_key_cmp { - struct pf_addr addr[2]; - u_int16_t port[2]; - sa_family_t af; - u_int8_t proto; - u_int8_t pad[2]; -}; - -struct pf_state_key { - struct pf_addr addr[2]; - u_int16_t port[2]; - sa_family_t af; - u_int8_t proto; - u_int8_t pad[2]; - - LIST_ENTRY(pf_state_key) entry; - TAILQ_HEAD(, pf_state) states[2]; -}; - -/* Keep synced with struct pf_state. */ -struct pf_state_cmp { - u_int64_t id; - u_int32_t creatorid; - u_int8_t direction; - u_int8_t pad[3]; -}; - -struct pf_state { - u_int64_t id; - u_int32_t creatorid; - u_int8_t direction; - u_int8_t pad[3]; - - u_int refs; - TAILQ_ENTRY(pf_state) sync_list; - TAILQ_ENTRY(pf_state) key_list[2]; - LIST_ENTRY(pf_state) entry; - struct pf_state_peer src; - struct pf_state_peer dst; - union pf_rule_ptr rule; - union pf_rule_ptr anchor; - union pf_rule_ptr nat_rule; - struct pf_addr rt_addr; - struct pf_state_key *key[2]; /* addresses stack and wire */ - struct pfi_kif *kif; - struct pfi_kif *rt_kif; - struct pf_src_node *src_node; - struct pf_src_node *nat_src_node; - u_int64_t packets[2]; - u_int64_t bytes[2]; - u_int32_t creation; - u_int32_t expire; - u_int32_t pfsync_time; - u_int16_t tag; - u_int8_t log; - u_int8_t state_flags; -#define PFSTATE_ALLOWOPTS 0x01 -#define PFSTATE_SLOPPY 0x02 -/* was PFSTATE_PFLOW 0x04 */ -#define PFSTATE_NOSYNC 0x08 -#define PFSTATE_ACK 0x10 - u_int8_t timeout; - u_int8_t sync_state; /* PFSYNC_S_x */ - - /* XXX */ - u_int8_t sync_updates; - u_int8_t _tail[3]; -}; - -/* - * Unified state structures for pulling states out of the kernel - * used by pfsync(4) and the pf(4) ioctl. - */ -struct pfsync_state_scrub { - u_int16_t pfss_flags; - u_int8_t pfss_ttl; /* stashed TTL */ -#define PFSYNC_SCRUB_FLAG_VALID 0x01 - u_int8_t scrub_flag; - u_int32_t pfss_ts_mod; /* timestamp modulation */ -} __packed; - -struct pfsync_state_peer { - struct pfsync_state_scrub scrub; /* state is scrubbed */ - u_int32_t seqlo; /* Max sequence number sent */ - u_int32_t seqhi; /* Max the other end ACKd + win */ - u_int32_t seqdiff; /* Sequence number modulator */ - u_int16_t max_win; /* largest window (pre scaling) */ - u_int16_t mss; /* Maximum segment size option */ - u_int8_t state; /* active state level */ - u_int8_t wscale; /* window scaling factor */ - u_int8_t pad[6]; -} __packed; - -struct pfsync_state_key { - struct pf_addr addr[2]; - u_int16_t port[2]; -}; - -struct pfsync_state { - u_int64_t id; - char ifname[IFNAMSIZ]; - struct pfsync_state_key key[2]; - struct pfsync_state_peer src; - struct pfsync_state_peer dst; - struct pf_addr rt_addr; - u_int32_t rule; - u_int32_t anchor; - u_int32_t nat_rule; - u_int32_t creation; - u_int32_t expire; - u_int32_t packets[2][2]; - u_int32_t bytes[2][2]; - u_int32_t creatorid; - sa_family_t af; - u_int8_t proto; - u_int8_t direction; - u_int8_t __spare[2]; - u_int8_t log; - u_int8_t state_flags; - u_int8_t timeout; - u_int8_t sync_flags; - u_int8_t updates; -} __packed; - -#ifdef _KERNEL -/* pfsync */ -typedef int pfsync_state_import_t(struct pfsync_state *, u_int8_t); -typedef void pfsync_insert_state_t(struct pf_state *); -typedef void pfsync_update_state_t(struct pf_state *); -typedef void pfsync_delete_state_t(struct pf_state *); -typedef void pfsync_clear_states_t(u_int32_t, const char *); -typedef int pfsync_defer_t(struct pf_state *, struct mbuf *); - -extern pfsync_state_import_t *pfsync_state_import_ptr; -extern pfsync_insert_state_t *pfsync_insert_state_ptr; -extern pfsync_update_state_t *pfsync_update_state_ptr; -extern pfsync_delete_state_t *pfsync_delete_state_ptr; -extern pfsync_clear_states_t *pfsync_clear_states_ptr; -extern pfsync_defer_t *pfsync_defer_ptr; - -void pfsync_state_export(struct pfsync_state *, - struct pf_state *); - -/* pflog */ -struct pf_ruleset; -struct pf_pdesc; -typedef int pflog_packet_t(struct pfi_kif *, struct mbuf *, sa_family_t, - u_int8_t, u_int8_t, struct pf_rule *, struct pf_rule *, - struct pf_ruleset *, struct pf_pdesc *, int); -extern pflog_packet_t *pflog_packet_ptr; - -#define V_pf_end_threads VNET(pf_end_threads) -#endif /* _KERNEL */ - -#define PFSYNC_FLAG_SRCNODE 0x04 -#define PFSYNC_FLAG_NATSRCNODE 0x08 - -/* for copies to/from network byte order */ -/* ioctl interface also uses network byte order */ -#define pf_state_peer_hton(s,d) do { \ - (d)->seqlo = htonl((s)->seqlo); \ - (d)->seqhi = htonl((s)->seqhi); \ - (d)->seqdiff = htonl((s)->seqdiff); \ - (d)->max_win = htons((s)->max_win); \ - (d)->mss = htons((s)->mss); \ - (d)->state = (s)->state; \ - (d)->wscale = (s)->wscale; \ - if ((s)->scrub) { \ - (d)->scrub.pfss_flags = \ - htons((s)->scrub->pfss_flags & PFSS_TIMESTAMP); \ - (d)->scrub.pfss_ttl = (s)->scrub->pfss_ttl; \ - (d)->scrub.pfss_ts_mod = htonl((s)->scrub->pfss_ts_mod);\ - (d)->scrub.scrub_flag = PFSYNC_SCRUB_FLAG_VALID; \ - } \ -} while (0) - -#define pf_state_peer_ntoh(s,d) do { \ - (d)->seqlo = ntohl((s)->seqlo); \ - (d)->seqhi = ntohl((s)->seqhi); \ - (d)->seqdiff = ntohl((s)->seqdiff); \ - (d)->max_win = ntohs((s)->max_win); \ - (d)->mss = ntohs((s)->mss); \ - (d)->state = (s)->state; \ - (d)->wscale = (s)->wscale; \ - if ((s)->scrub.scrub_flag == PFSYNC_SCRUB_FLAG_VALID && \ - (d)->scrub != NULL) { \ - (d)->scrub->pfss_flags = \ - ntohs((s)->scrub.pfss_flags) & PFSS_TIMESTAMP; \ - (d)->scrub->pfss_ttl = (s)->scrub.pfss_ttl; \ - (d)->scrub->pfss_ts_mod = ntohl((s)->scrub.pfss_ts_mod);\ - } \ -} while (0) - -#define pf_state_counter_hton(s,d) do { \ - d[0] = htonl((s>>32)&0xffffffff); \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 19:02:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0154839E; Sat, 26 Oct 2013 19:02:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E1C442DAF; Sat, 26 Oct 2013 19:02:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QJ2eku093159; Sat, 26 Oct 2013 19:02:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QJ2eWo093147; Sat, 26 Oct 2013 19:02:40 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310261902.r9QJ2eWo093147@svn.freebsd.org> From: Xin LI Date: Sat, 26 Oct 2013 19:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257187 - stable/10/sys/dev/oce X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 19:02:41 -0000 Author: delphij Date: Sat Oct 26 19:02:39 2013 New Revision: 257187 URL: http://svnweb.freebsd.org/changeset/base/257187 Log: MFC r257007: Update driver to version 10.0.664.0. Many thanks to Emulex for their continued support of FreeBSD. Submitted by: Venkata Duvvuru Approved by: re (glebius) Modified: stable/10/sys/dev/oce/oce_hw.c stable/10/sys/dev/oce/oce_hw.h stable/10/sys/dev/oce/oce_if.c stable/10/sys/dev/oce/oce_if.h stable/10/sys/dev/oce/oce_mbox.c stable/10/sys/dev/oce/oce_queue.c stable/10/sys/dev/oce/oce_sysctl.c stable/10/sys/dev/oce/oce_util.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/dev/oce/oce_hw.c ============================================================================== --- stable/10/sys/dev/oce/oce_hw.c Sat Oct 26 18:59:58 2013 (r257186) +++ stable/10/sys/dev/oce/oce_hw.c Sat Oct 26 19:02:39 2013 (r257187) @@ -38,6 +38,7 @@ /* $FreeBSD$ */ + #include "oce_if.h" static int oce_POST(POCE_SOFTC sc); @@ -203,12 +204,16 @@ void oce_get_pci_capabilities(POCE_SOFTC { uint32_t val; - if (pci_find_cap(sc->dev, PCIY_PCIX, &val) == 0) { +#if __FreeBSD_version >= 1000000 + #define pci_find_extcap pci_find_cap +#endif + + if (pci_find_extcap(sc->dev, PCIY_PCIX, &val) == 0) { if (val != 0) sc->flags |= OCE_FLAGS_PCIX; } - if (pci_find_cap(sc->dev, PCIY_EXPRESS, &val) == 0) { + if (pci_find_extcap(sc->dev, PCIY_EXPRESS, &val) == 0) { if (val != 0) { uint16_t link_status = pci_read_config(sc->dev, val + 0x12, 2); @@ -219,12 +224,12 @@ void oce_get_pci_capabilities(POCE_SOFTC } } - if (pci_find_cap(sc->dev, PCIY_MSI, &val) == 0) { + if (pci_find_extcap(sc->dev, PCIY_MSI, &val) == 0) { if (val != 0) sc->flags |= OCE_FLAGS_MSI_CAPABLE; } - if (pci_find_cap(sc->dev, PCIY_MSIX, &val) == 0) { + if (pci_find_extcap(sc->dev, PCIY_MSIX, &val) == 0) { if (val != 0) { val = pci_msix_count(sc->dev); sc->flags |= OCE_FLAGS_MSIX_CAPABLE; @@ -386,6 +391,9 @@ oce_create_nw_interface(POCE_SOFTC sc) capab_flags &= ~MBX_RX_IFACE_FLAGS_PASS_L3L4_ERR; } + if (IS_SH(sc) || IS_XE201(sc)) + capab_flags |= MBX_RX_IFACE_FLAGS_MULTICAST; + /* enable capabilities controlled via driver startup parameters */ if (is_rss_enabled(sc)) capab_en_flags |= MBX_RX_IFACE_FLAGS_RSS; Modified: stable/10/sys/dev/oce/oce_hw.h ============================================================================== --- stable/10/sys/dev/oce/oce_hw.h Sat Oct 26 18:59:58 2013 (r257186) +++ stable/10/sys/dev/oce/oce_hw.h Sat Oct 26 19:02:39 2013 (r257187) @@ -59,6 +59,30 @@ #define INTR_EN 0x20000000 #define IMAGE_TRANSFER_SIZE (32 * 1024) /* 32K at a time */ + +/********* UE Status and Mask Registers ***/ +#define PCICFG_UE_STATUS_LOW 0xA0 +#define PCICFG_UE_STATUS_HIGH 0xA4 +#define PCICFG_UE_STATUS_LOW_MASK 0xA8 + +/* Lancer SLIPORT registers */ +#define SLIPORT_STATUS_OFFSET 0x404 +#define SLIPORT_CONTROL_OFFSET 0x408 +#define SLIPORT_ERROR1_OFFSET 0x40C +#define SLIPORT_ERROR2_OFFSET 0x410 +#define PHYSDEV_CONTROL_OFFSET 0x414 + +#define SLIPORT_STATUS_ERR_MASK 0x80000000 +#define SLIPORT_STATUS_DIP_MASK 0x02000000 +#define SLIPORT_STATUS_RN_MASK 0x01000000 +#define SLIPORT_STATUS_RDY_MASK 0x00800000 +#define SLI_PORT_CONTROL_IP_MASK 0x08000000 +#define PHYSDEV_CONTROL_FW_RESET_MASK 0x00000002 +#define PHYSDEV_CONTROL_DD_MASK 0x00000004 +#define PHYSDEV_CONTROL_INP_MASK 0x40000000 + +#define SLIPORT_ERROR_NO_RESOURCE1 0x2 +#define SLIPORT_ERROR_NO_RESOURCE2 0x9 /* CSR register offsets */ #define MPU_EP_CONTROL 0 #define MPU_EP_SEMAPHORE_BE3 0xac @@ -2079,7 +2103,8 @@ struct flash_file_hdr { uint32_t antidote; uint32_t num_imgs; uint8_t build[24]; - uint8_t rsvd[32]; + uint8_t asic_type_rev; + uint8_t rsvd[31]; }; struct image_hdr { @@ -3681,4 +3706,3 @@ enum OCE_QUEUE_RX_STATS { QUEUE_RX_BUFFER_ERRORS = 8, QUEUE_RX_N_WORDS = 10 }; - Modified: stable/10/sys/dev/oce/oce_if.c ============================================================================== --- stable/10/sys/dev/oce/oce_if.c Sat Oct 26 18:59:58 2013 (r257186) +++ stable/10/sys/dev/oce/oce_if.c Sat Oct 26 19:02:39 2013 (r257187) @@ -36,7 +36,6 @@ * Costa Mesa, CA 92626 */ - /* $FreeBSD$ */ #include "opt_inet6.h" @@ -44,6 +43,78 @@ #include "oce_if.h" +/* UE Status Low CSR */ +static char *ue_status_low_desc[] = { + "CEV", + "CTX", + "DBUF", + "ERX", + "Host", + "MPU", + "NDMA", + "PTC ", + "RDMA ", + "RXF ", + "RXIPS ", + "RXULP0 ", + "RXULP1 ", + "RXULP2 ", + "TIM ", + "TPOST ", + "TPRE ", + "TXIPS ", + "TXULP0 ", + "TXULP1 ", + "UC ", + "WDMA ", + "TXULP2 ", + "HOST1 ", + "P0_OB_LINK ", + "P1_OB_LINK ", + "HOST_GPIO ", + "MBOX ", + "AXGMAC0", + "AXGMAC1", + "JTAG", + "MPU_INTPEND" +}; + +/* UE Status High CSR */ +static char *ue_status_hi_desc[] = { + "LPCMEMHOST", + "MGMT_MAC", + "PCS0ONLINE", + "MPU_IRAM", + "PCS1ONLINE", + "PCTL0", + "PCTL1", + "PMEM", + "RR", + "TXPB", + "RXPP", + "XAUI", + "TXP", + "ARM", + "IPC", + "HOST2", + "HOST3", + "HOST4", + "HOST5", + "HOST6", + "HOST7", + "HOST8", + "HOST9", + "NETC", + "Unknown", + "Unknown", + "Unknown", + "Unknown", + "Unknown", + "Unknown", + "Unknown", + "Unknown" +}; + /* Driver entry points prototypes */ static int oce_probe(device_t dev); @@ -388,11 +459,11 @@ oce_ioctl(struct ifnet *ifp, u_long comm } if ((ifp->if_flags & IFF_PROMISC) && !sc->promisc) { - sc->promisc = TRUE; - oce_rxf_set_promiscuous(sc, sc->promisc); + if (!oce_rxf_set_promiscuous(sc, (1 | (1 << 1)))) + sc->promisc = TRUE; } else if (!(ifp->if_flags & IFF_PROMISC) && sc->promisc) { - sc->promisc = FALSE; - oce_rxf_set_promiscuous(sc, sc->promisc); + if (!oce_rxf_set_promiscuous(sc, 0)) + sc->promisc = FALSE; } break; @@ -862,10 +933,12 @@ retry: (m->m_pkthdr.csum_flags & CSUM_TCP) ? 1 : 0; nichdr->u0.s.num_wqe = num_wqes; nichdr->u0.s.total_length = m->m_pkthdr.len; + if (m->m_flags & M_VLANTAG) { nichdr->u0.s.vlan = 1; /*Vlan present*/ nichdr->u0.s.vlan_tag = m->m_pkthdr.ether_vtag; } + if (m->m_pkthdr.csum_flags & CSUM_TSO) { if (m->m_pkthdr.tso_segsz) { nichdr->u0.s.lso = 1; @@ -1156,6 +1229,18 @@ oce_wq_handler(void *arg) } +#if __FreeBSD_version >= 1000000 +static __inline void +drbr_stats_update(struct ifnet *ifp, int len, int mflags) +{ +#ifndef NO_SLOW_STATS + ifp->if_obytes += len; + if (mflags & M_MCAST) + ifp->if_omcasts++; +#endif +} +#endif + static int oce_multiq_transmit(struct ifnet *ifp, struct mbuf *m, struct oce_wq *wq) { @@ -1174,7 +1259,7 @@ oce_multiq_transmit(struct ifnet *ifp, s return status; } - if (m != NULL) { + if (m != NULL) { if ((status = drbr_enqueue(ifp, br, m)) != 0) return status; } @@ -1646,6 +1731,10 @@ oce_attach_ifp(POCE_SOFTC sc) sc->ifp->if_capenable = sc->ifp->if_capabilities; if_initbaudrate(sc->ifp, IF_Gbps(10)); +#if __FreeBSD_version >= 1000000 + sc->ifp->if_hw_tsomax = OCE_MAX_TSO_SIZE; +#endif + ether_ifattach(sc->ifp, sc->macaddr.mac_addr); return 0; @@ -1664,7 +1753,8 @@ oce_add_vlan(void *arg, struct ifnet *if sc->vlan_tag[vtag] = 1; sc->vlans_added++; - oce_vid_config(sc); + if (sc->vlans_added <= (sc->max_vlans + 1)) + oce_vid_config(sc); } @@ -1866,12 +1956,76 @@ done: } +static void oce_detect_hw_error(POCE_SOFTC sc) +{ + + uint32_t ue_low = 0, ue_high = 0, ue_low_mask = 0, ue_high_mask = 0; + uint32_t sliport_status = 0, sliport_err1 = 0, sliport_err2 = 0; + uint32_t i; + + if (sc->hw_error) + return; + + if (IS_XE201(sc)) { + sliport_status = OCE_READ_REG32(sc, db, SLIPORT_STATUS_OFFSET); + if (sliport_status & SLIPORT_STATUS_ERR_MASK) { + sliport_err1 = OCE_READ_REG32(sc, db, SLIPORT_ERROR1_OFFSET); + sliport_err2 = OCE_READ_REG32(sc, db, SLIPORT_ERROR2_OFFSET); + } + } else { + ue_low = OCE_READ_REG32(sc, devcfg, PCICFG_UE_STATUS_LOW); + ue_high = OCE_READ_REG32(sc, devcfg, PCICFG_UE_STATUS_HIGH); + ue_low_mask = OCE_READ_REG32(sc, devcfg, PCICFG_UE_STATUS_LOW_MASK); + ue_high_mask = OCE_READ_REG32(sc, devcfg, PCICFG_UE_STATUS_HI_MASK); + + ue_low = (ue_low & ~ue_low_mask); + ue_high = (ue_high & ~ue_high_mask); + } + + /* On certain platforms BE hardware can indicate spurious UEs. + * Allow the h/w to stop working completely in case of a real UE. + * Hence not setting the hw_error for UE detection. + */ + if (sliport_status & SLIPORT_STATUS_ERR_MASK) { + sc->hw_error = TRUE; + device_printf(sc->dev, "Error detected in the card\n"); + } + + if (sliport_status & SLIPORT_STATUS_ERR_MASK) { + device_printf(sc->dev, + "ERR: sliport status 0x%x\n", sliport_status); + device_printf(sc->dev, + "ERR: sliport error1 0x%x\n", sliport_err1); + device_printf(sc->dev, + "ERR: sliport error2 0x%x\n", sliport_err2); + } + + if (ue_low) { + for (i = 0; ue_low; ue_low >>= 1, i++) { + if (ue_low & 1) + device_printf(sc->dev, "UE: %s bit set\n", + ue_status_low_desc[i]); + } + } + + if (ue_high) { + for (i = 0; ue_high; ue_high >>= 1, i++) { + if (ue_high & 1) + device_printf(sc->dev, "UE: %s bit set\n", + ue_status_hi_desc[i]); + } + } + +} + + static void oce_local_timer(void *arg) { POCE_SOFTC sc = arg; int i = 0; + oce_detect_hw_error(sc); oce_refresh_nic_stats(sc); oce_refresh_queue_stats(sc); oce_mac_addr_set(sc); @@ -1890,7 +2044,7 @@ oce_local_timer(void *arg) /* NOTE : This should only be called holding * DEVICE_LOCK. -*/ + */ static void oce_if_deactivate(POCE_SOFTC sc) { @@ -2080,6 +2234,9 @@ setup_max_queues_want(POCE_SOFTC sc) (sc->flags & OCE_FLAGS_BE2)) { sc->nrqs = 1; sc->nwqs = 1; + } else { + sc->nrqs = MIN(OCE_NCPUS, sc->nrssqs) + 1; + sc->nwqs = MIN(OCE_NCPUS, sc->nrssqs); } } Modified: stable/10/sys/dev/oce/oce_if.h ============================================================================== --- stable/10/sys/dev/oce/oce_if.h Sat Oct 26 18:59:58 2013 (r257186) +++ stable/10/sys/dev/oce/oce_if.h Sat Oct 26 19:02:39 2013 (r257187) @@ -36,7 +36,6 @@ * Costa Mesa, CA 92626 */ - /* $FreeBSD$ */ #include @@ -88,7 +87,8 @@ #include "oce_hw.h" -#define COMPONENT_REVISION "4.6.95.0" +/* OCE device driver module component revision informaiton */ +#define COMPONENT_REVISION "10.0.664.0" /* OCE devices supported by this driver */ #define PCI_VENDOR_EMULEX 0x10df /* Emulex */ @@ -150,6 +150,7 @@ extern int mp_ncpus; /* system's total #define OCE_MAX_TX_ELEMENTS 29 #define OCE_MAX_TX_DESC 1024 #define OCE_MAX_TX_SIZE 65535 +#define OCE_MAX_TSO_SIZE (65535 - ETHER_HDR_LEN) #define OCE_MAX_RX_SIZE 4096 #define OCE_MAX_RQ_POSTS 255 #define OCE_DEFAULT_PROMISCUOUS 0 @@ -173,6 +174,7 @@ extern int mp_ncpus; /* system's total #define OCE_CAPAB_FLAGS (MBX_RX_IFACE_FLAGS_BROADCAST | \ MBX_RX_IFACE_FLAGS_UNTAGGED | \ MBX_RX_IFACE_FLAGS_PROMISCUOUS | \ + MBX_RX_IFACE_FLAGS_VLAN_PROMISCUOUS | \ MBX_RX_IFACE_FLAGS_MCAST_PROMISCUOUS | \ MBX_RX_IFACE_FLAGS_RSS | \ MBX_RX_IFACE_FLAGS_PASS_L3L4_ERR) @@ -863,7 +865,7 @@ typedef struct oce_softc { uint32_t if_cap_flags; uint32_t flow_control; - uint32_t promisc; + uint8_t promisc; struct oce_aic_obj aic_obj[OCE_MAX_EQ]; @@ -877,9 +879,11 @@ typedef struct oce_softc { struct oce_drv_stats oce_stats_info; struct callout timer; int8_t be3_native; + uint8_t hw_error; uint16_t qnq_debug_event; uint16_t qnqid; uint16_t pvid; + uint16_t max_vlans; } OCE_SOFTC, *POCE_SOFTC; @@ -1010,7 +1014,7 @@ int oce_config_vlan(POCE_SOFTC sc, uint3 uint32_t untagged, uint32_t enable_promisc); int oce_set_flow_control(POCE_SOFTC sc, uint32_t flow_control); int oce_config_nic_rss(POCE_SOFTC sc, uint32_t if_id, uint16_t enable_rss); -int oce_rxf_set_promiscuous(POCE_SOFTC sc, uint32_t enable); +int oce_rxf_set_promiscuous(POCE_SOFTC sc, uint8_t enable); int oce_set_common_iface_rx_filter(POCE_SOFTC sc, POCE_DMA_MEM sgl); int oce_get_link_status(POCE_SOFTC sc, struct link_status *link); int oce_mbox_get_nic_stats_v0(POCE_SOFTC sc, POCE_DMA_MEM pstats_dma_mem); Modified: stable/10/sys/dev/oce/oce_mbox.c ============================================================================== --- stable/10/sys/dev/oce/oce_mbox.c Sat Oct 26 18:59:58 2013 (r257186) +++ stable/10/sys/dev/oce/oce_mbox.c Sat Oct 26 19:02:39 2013 (r257187) @@ -36,11 +36,8 @@ * Costa Mesa, CA 92626 */ - - /* $FreeBSD$ */ - #include "oce_if.h" extern uint32_t sfp_vpd_dump_buffer[TRANSCEIVER_DATA_NUM_ELE]; @@ -281,8 +278,10 @@ oce_get_fw_version(POCE_SOFTC sc) if (!ret) ret = fwcmd->hdr.u0.rsp.status; if (ret) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, ret); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, ret, + fwcmd->hdr.u0.rsp.additional_status); goto error; } @@ -438,8 +437,10 @@ oce_read_mac_addr(POCE_SOFTC sc, uint32_ if (!ret) ret = fwcmd->hdr.u0.rsp.status; if (ret) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, ret); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, ret, + fwcmd->hdr.u0.rsp.additional_status); goto error; } @@ -481,25 +482,27 @@ oce_get_fw_config(POCE_SOFTC sc) if (!ret) ret = fwcmd->hdr.u0.rsp.status; if (ret) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, ret); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, ret, + fwcmd->hdr.u0.rsp.additional_status); goto error; } DW_SWAP(u32ptr(fwcmd), sizeof(struct mbx_common_query_fw_config)); - sc->config_number = fwcmd->params.rsp.config_number; - sc->asic_revision = fwcmd->params.rsp.asic_revision; - sc->port_id = fwcmd->params.rsp.port_id; - sc->function_mode = fwcmd->params.rsp.function_mode; - sc->function_caps = fwcmd->params.rsp.function_caps; + sc->config_number = HOST_32(fwcmd->params.rsp.config_number); + sc->asic_revision = HOST_32(fwcmd->params.rsp.asic_revision); + sc->port_id = HOST_32(fwcmd->params.rsp.port_id); + sc->function_mode = HOST_32(fwcmd->params.rsp.function_mode); + sc->function_caps = HOST_32(fwcmd->params.rsp.function_caps); if (fwcmd->params.rsp.ulp[0].ulp_mode & ULP_NIC_MODE) { - sc->max_tx_rings = fwcmd->params.rsp.ulp[0].nic_wq_tot; - sc->max_rx_rings = fwcmd->params.rsp.ulp[0].lro_rqid_tot; + sc->max_tx_rings = HOST_32(fwcmd->params.rsp.ulp[0].nic_wq_tot); + sc->max_rx_rings = HOST_32(fwcmd->params.rsp.ulp[0].lro_rqid_tot); } else { - sc->max_tx_rings = fwcmd->params.rsp.ulp[1].nic_wq_tot; - sc->max_rx_rings = fwcmd->params.rsp.ulp[1].lro_rqid_tot; + sc->max_tx_rings = HOST_32(fwcmd->params.rsp.ulp[1].nic_wq_tot); + sc->max_rx_rings = HOST_32(fwcmd->params.rsp.ulp[1].lro_rqid_tot); } error: @@ -561,15 +564,17 @@ oce_if_create(POCE_SOFTC sc, if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } - *if_id = LE_32(fwcmd->params.rsp.if_id); + *if_id = HOST_32(fwcmd->params.rsp.if_id); if (mac_addr != NULL) - sc->pmac_id = LE_32(fwcmd->params.rsp.pmac_id); + sc->pmac_id = HOST_32(fwcmd->params.rsp.pmac_id); error: return rc; } @@ -607,8 +612,10 @@ oce_if_del(POCE_SOFTC sc, uint32_t if_id if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); return rc; } @@ -630,7 +637,10 @@ oce_config_vlan(POCE_SOFTC sc, { struct oce_mbx mbx; struct mbx_common_config_vlan *fwcmd; - int rc; + int rc = 0; + + if (sc->vlans_added > sc->max_vlans) + goto vlan_promisc; bzero(&mbx, sizeof(struct oce_mbx)); fwcmd = (struct mbx_common_config_vlan *)&mbx.payload; @@ -659,9 +669,19 @@ oce_config_vlan(POCE_SOFTC sc, if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); - return 0; + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); + + goto done; + +vlan_promisc: + /* Enable Vlan Promis */ + oce_rxf_set_promiscuous(sc, (1 << 1)); + device_printf(sc->dev,"Enabling Vlan Promisc Mode\n"); +done: + return rc; } @@ -702,8 +722,10 @@ oce_set_flow_control(POCE_SOFTC sc, uint if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); return rc; } @@ -802,8 +824,10 @@ oce_config_nic_rss(POCE_SOFTC sc, uint32 if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); } return rc; } @@ -818,7 +842,7 @@ oce_config_nic_rss(POCE_SOFTC sc, uint32 * This function uses the COMMON_SET_IFACE_RX_FILTER command instead. */ int -oce_rxf_set_promiscuous(POCE_SOFTC sc, uint32_t enable) +oce_rxf_set_promiscuous(POCE_SOFTC sc, uint8_t enable) { struct mbx_set_common_iface_rx_filter *fwcmd; int sz = sizeof(struct mbx_set_common_iface_rx_filter); @@ -836,10 +860,13 @@ oce_rxf_set_promiscuous(POCE_SOFTC sc, u req = &fwcmd->params.req; req->iface_flags_mask = MBX_RX_IFACE_FLAGS_PROMISCUOUS | MBX_RX_IFACE_FLAGS_VLAN_PROMISCUOUS; - if (enable) { - req->iface_flags = MBX_RX_IFACE_FLAGS_PROMISCUOUS | - MBX_RX_IFACE_FLAGS_VLAN_PROMISCUOUS; - } + /* Bit 0 Mac promisc, Bit 1 Vlan promisc */ + if (enable & 0x01) + req->iface_flags = MBX_RX_IFACE_FLAGS_PROMISCUOUS; + + if (enable & 0x02) + req->iface_flags = MBX_RX_IFACE_FLAGS_VLAN_PROMISCUOUS; + req->if_id = sc->if_id; rc = oce_set_common_iface_rx_filter(sc, &sgl); @@ -886,9 +913,11 @@ oce_set_common_iface_rx_filter(POCE_SOFT if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); - return 0; + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); + return rc; } /** @@ -925,14 +954,16 @@ oce_get_link_status(POCE_SOFTC sc, struc if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } /* interpret response */ bcopy(&fwcmd->params.rsp, link, sizeof(struct link_status)); - link->logical_link_status = LE_32(link->logical_link_status); - link->qos_link_speed = LE_16(link->qos_link_speed); + link->logical_link_status = HOST_32(link->logical_link_status); + link->qos_link_speed = HOST_16(link->qos_link_speed); error: return rc; } @@ -978,8 +1009,10 @@ oce_mbox_get_nic_stats_v0(POCE_SOFTC sc, if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); return rc; } @@ -1028,8 +1061,10 @@ oce_mbox_get_nic_stats(POCE_SOFTC sc, PO if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); return rc; } @@ -1080,8 +1115,10 @@ oce_mbox_get_pport_stats(POCE_SOFTC sc, if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); return rc; } @@ -1133,8 +1170,10 @@ oce_mbox_get_vport_stats(POCE_SOFTC sc, if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); return rc; } @@ -1178,8 +1217,10 @@ oce_update_multicast(POCE_SOFTC sc, POCE if (!rc) rc = req->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + req->hdr.u0.rsp.additional_status); return rc; } @@ -1243,8 +1284,10 @@ oce_mbox_macaddr_add(POCE_SOFTC sc, uint if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } *pmac_id = fwcmd->params.rsp.pmac_id; @@ -1281,8 +1324,10 @@ oce_mbox_macaddr_del(POCE_SOFTC sc, uint if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); return rc; } @@ -1318,11 +1363,13 @@ oce_mbox_check_native_mode(POCE_SOFTC sc if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } - sc->be3_native = fwcmd->params.rsp.capability_flags + sc->be3_native = HOST_32(fwcmd->params.rsp.capability_flags) & CAP_BE3_NATIVE_ERX_API; error: @@ -1363,8 +1410,10 @@ oce_mbox_cmd_set_loopback(POCE_SOFTC sc, if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); return rc; @@ -1406,8 +1455,10 @@ oce_mbox_cmd_test_loopback(POCE_SOFTC sc if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); return rc; } @@ -1433,9 +1484,9 @@ oce_mbox_write_flashrom(POCE_SOFTC sc, u payload_len, OCE_MBX_VER_V0); - fwcmd->flash_op_type = optype; - fwcmd->flash_op_code = opcode; - fwcmd->data_buffer_size = num_bytes; + fwcmd->flash_op_type = LE_32(optype); + fwcmd->flash_op_code = LE_32(opcode); + fwcmd->data_buffer_size = LE_32(num_bytes); mbx.u0.s.embedded = 0; /*Non embeded*/ mbx.payload_length = payload_len; @@ -1451,8 +1502,10 @@ oce_mbox_write_flashrom(POCE_SOFTC sc, u if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); return rc; @@ -1497,8 +1550,10 @@ oce_mbox_get_flashrom_crc(POCE_SOFTC sc, if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } bcopy(fwcmd->data_buffer, flash_crc, 4); @@ -1532,18 +1587,20 @@ oce_mbox_get_phy_info(POCE_SOFTC sc, str if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } - phy_info->phy_type = fwcmd->params.rsp.phy_info.phy_type; + phy_info->phy_type = HOST_16(fwcmd->params.rsp.phy_info.phy_type); phy_info->interface_type = - fwcmd->params.rsp.phy_info.interface_type; + HOST_16(fwcmd->params.rsp.phy_info.interface_type); phy_info->auto_speeds_supported = - fwcmd->params.rsp.phy_info.auto_speeds_supported; + HOST_16(fwcmd->params.rsp.phy_info.auto_speeds_supported); phy_info->fixed_speeds_supported = - fwcmd->params.rsp.phy_info.fixed_speeds_supported; - phy_info->misc_params =fwcmd->params.rsp.phy_info.misc_params; + HOST_16(fwcmd->params.rsp.phy_info.fixed_speeds_supported); + phy_info->misc_params = HOST_32(fwcmd->params.rsp.phy_info.misc_params); error: return rc; @@ -1593,11 +1650,13 @@ oce_mbox_lancer_write_flashrom(POCE_SOFT if (!rc) rc = fwcmd->params.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->params.rsp.additional_status); goto error; } - *written_data = fwcmd->params.rsp.actual_write_length; + *written_data = HOST_32(fwcmd->params.rsp.actual_write_length); *additional_status = fwcmd->params.rsp.additional_status; error: return rc; @@ -1649,11 +1708,13 @@ oce_mbox_create_rq(struct oce_rq *rq) if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } - rq->rq_id = fwcmd->params.rsp.rq_id; + rq->rq_id = HOST_16(fwcmd->params.rsp.rq_id); rq->rss_cpuid = fwcmd->params.rsp.rss_cpuid; error: return rc; @@ -1673,15 +1734,17 @@ oce_mbox_create_wq(struct oce_wq *wq) bzero(&mbx, sizeof(struct oce_mbx)); fwcmd = (struct mbx_create_nic_wq *)&mbx.payload; - if (IS_XE201(sc)) { + if (IS_XE201(sc)) version = OCE_MBX_VER_V1; - fwcmd->params.req.if_id = sc->if_id; - } else if(IS_BE(sc)) + else if(IS_BE(sc)) IS_PROFILE_SUPER_NIC(sc) ? (version = OCE_MBX_VER_V2) : (version = OCE_MBX_VER_V0); else version = OCE_MBX_VER_V2; + if (version > OCE_MBX_VER_V0) + fwcmd->params.req.if_id = sc->if_id; + mbx_common_req_hdr_init(&fwcmd->hdr, 0, 0, MBX_SUBSYSTEM_NIC, NIC_CREATE_WQ, MBX_TIMEOUT_SEC, @@ -1703,13 +1766,15 @@ oce_mbox_create_wq(struct oce_wq *wq) if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } - wq->wq_id = LE_16(fwcmd->params.rsp.wq_id); + wq->wq_id = HOST_16(fwcmd->params.rsp.wq_id); if (version == OCE_MBX_VER_V2) - wq->db_offset = LE_32(fwcmd->params.rsp.db_offset); + wq->db_offset = HOST_32(fwcmd->params.rsp.db_offset); else wq->db_offset = PD_TXULP_DB; error: @@ -1754,11 +1819,13 @@ oce_mbox_create_eq(struct oce_eq *eq) if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } - eq->eq_id = LE_16(fwcmd->params.rsp.eq_id); + eq->eq_id = HOST_16(fwcmd->params.rsp.eq_id); error: return rc; } @@ -1832,11 +1899,13 @@ oce_mbox_cq_create(struct oce_cq *cq, ui if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } - cq->cq_id = LE_16(fwcmd->params.rsp.cq_id); + cq->cq_id = HOST_16(fwcmd->params.rsp.cq_id); error: return rc; @@ -1885,8 +1954,10 @@ oce_mbox_read_transrecv_data(POCE_SOFTC if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) { - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", + __FUNCTION__, rc, + fwcmd->hdr.u0.rsp.additional_status); goto error; } if(fwcmd->params.rsp.page_num == PAGE_NUM_A0) @@ -1947,8 +2018,10 @@ oce_mbox_eqd_modify_periodic(POCE_SOFTC if (!rc) rc = fwcmd->hdr.u0.rsp.status; if (rc) - device_printf(sc->dev,"%s failed - cmd status: %d\n", - __FUNCTION__, rc); + device_printf(sc->dev, + "%s failed - cmd status: %d addi status: %d\n", *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 19:09:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A01D763F; Sat, 26 Oct 2013 19:09:56 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8C8B32DD3; Sat, 26 Oct 2013 19:09:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QJ9uQ5094318; Sat, 26 Oct 2013 19:09:56 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QJ9uRx094317; Sat, 26 Oct 2013 19:09:56 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201310261909.r9QJ9uRx094317@svn.freebsd.org> From: Andrew Turner Date: Sat, 26 Oct 2013 19:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257189 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 19:09:56 -0000 Author: andrew Date: Sat Oct 26 19:09:56 2013 New Revision: 257189 URL: http://svnweb.freebsd.org/changeset/base/257189 Log: Fix an itt instruction. We need to execute both the mov and b instructions when building for Thumb. Modified: head/sys/arm/include/atomic.h Modified: head/sys/arm/include/atomic.h ============================================================================== --- head/sys/arm/include/atomic.h Sat Oct 26 19:04:43 2013 (r257188) +++ head/sys/arm/include/atomic.h Sat Oct 26 19:09:56 2013 (r257189) @@ -198,7 +198,7 @@ atomic_cmpset_32(volatile u_int32_t *p, __asm __volatile("1: ldrex %0, [%1]\n" "cmp %0, %2\n" - "it ne\n" + "itt ne\n" "movne %0, #0\n" "bne 2f\n" "strex %0, %3, [%1]\n" From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 19:28:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 488FA87B; Sat, 26 Oct 2013 19:28:32 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-wg0-x233.google.com (mail-wg0-x233.google.com [IPv6:2a00:1450:400c:c00::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6D2E72E86; Sat, 26 Oct 2013 19:28:31 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id l18so5152717wgh.30 for ; Sat, 26 Oct 2013 12:28:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=NxOrvTdyCNiVOiCCaYlHOOlztayNjFyjIg12bBmLL2A=; b=d7CcdrSLu0ynp8IYbcDFoNrHJXG8RMRVxv8EeKpmrGXswFyMvljO4o3KaGVf9b9+jP S+ZyZ1DOAVjn2bpfGna/+IqpDMwzT+CCx+s9J+dA2SG4y5ZsWZf63Kg+yyujYK3FzuuJ 6IFBNYsb9v+Ioa31rV4OZeukpv/JkJt2mOGsjFSPnKzQUkdVWPE+V2/oaXmI4Mr49snD u9aNrwEN6dmO5vBorlVq+t+OY4LWxFF3jFj5OBbn4Q6H9OX03QElOOFPgQHO9c1WL6OD q02GLwBsszDvygYD4AVhflZxvgO1JyyFqSTLJmpGKsJTCk5durv2cdPkKXbpcJVZa4tm LrnA== MIME-Version: 1.0 X-Received: by 10.180.23.98 with SMTP id l2mr3227202wif.56.1382815709864; Sat, 26 Oct 2013 12:28:29 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.216.203.195 with HTTP; Sat, 26 Oct 2013 12:28:29 -0700 (PDT) In-Reply-To: <201310261758.r9QHwbWX069118@svn.freebsd.org> References: <201310261758.r9QHwbWX069118@svn.freebsd.org> Date: Sat, 26 Oct 2013 23:28:29 +0400 X-Google-Sender-Auth: BkcCOq0lnPmt9MKheRQ38gLwwms Message-ID: Subject: Re: svn commit: r257176 - in head/sys: compat/linprocfs compat/linux compat/ndis dev/ae dev/age dev/alc dev/ale dev/an dev/ath dev/ath/ath_dfs/null dev/ath/ath_rate/sample dev/bfe dev/bge dev/bm dev/bw... From: Sergey Kandaurov 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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 19:28:32 -0000 On 26 October 2013 21:58, Gleb Smirnoff wrote: > Author: glebius > Date: Sat Oct 26 17:58:36 2013 > New Revision: 257176 > URL: http://svnweb.freebsd.org/changeset/base/257176 > > Log: > The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare > to this event, adding if_var.h to files that do need it. Also, include > all includes that now are included due to implicit pollution via if_var.h > > Sponsored by: Netflix > Sponsored by: Nginx, Inc. > Actually it was there since r21259 split if.h. r48589 is style bugfixes. -- wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 19:36:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DE792B50; Sat, 26 Oct 2013 19:36:05 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 63D312EF0; Sat, 26 Oct 2013 19:36:04 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id r9QJZmIO042951; Sat, 26 Oct 2013 23:35:48 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id r9QJZlXB042950; Sat, 26 Oct 2013 23:35:47 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 26 Oct 2013 23:35:47 +0400 From: Gleb Smirnoff To: Sergey Kandaurov Subject: Re: svn commit: r257176 - in head/sys: compat/linprocfs compat/linux compat/ndis dev/ae dev/age dev/alc dev/ale dev/an dev/ath dev/ath/ath_dfs/null dev/ath/ath_rate/sample dev/bfe dev/bge dev/bm dev/bw... Message-ID: <20131026193547.GF52889@FreeBSD.org> References: <201310261758.r9QHwbWX069118@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 19:36:06 -0000 On Sat, Oct 26, 2013 at 11:28:29PM +0400, Sergey Kandaurov wrote: S> On 26 October 2013 21:58, Gleb Smirnoff wrote: S> > Author: glebius S> > Date: Sat Oct 26 17:58:36 2013 S> > New Revision: 257176 S> > URL: http://svnweb.freebsd.org/changeset/base/257176 S> > S> > Log: S> > The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare S> > to this event, adding if_var.h to files that do need it. Also, include S> > all includes that now are included due to implicit pollution via if_var.h S> > S> > Sponsored by: Netflix S> > Sponsored by: Nginx, Inc. S> > S> S> Actually it was there since r21259 split if.h. r48589 is style bugfixes. Yeah, the prophecy comes from 1997 and soon to be cast! -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 19:49:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CBBCB268; Sat, 26 Oct 2013 19:49:09 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B3B0E2F89; Sat, 26 Oct 2013 19:49:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QJn98h007983; Sat, 26 Oct 2013 19:49:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QJn9Jq007982; Sat, 26 Oct 2013 19:49:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310261949.r9QJn9Jq007982@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 26 Oct 2013 19:49:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257190 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 19:49:09 -0000 Author: nwhitehorn Date: Sat Oct 26 19:49:09 2013 New Revision: 257190 URL: http://svnweb.freebsd.org/changeset/base/257190 Log: Bump initial TLB size. The kernel is not necessarily less than 16 MB any more. Modified: head/sys/powerpc/booke/locore.S Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Sat Oct 26 19:09:56 2013 (r257189) +++ head/sys/powerpc/booke/locore.S Sat Oct 26 19:49:09 2013 (r257190) @@ -158,7 +158,7 @@ __start: mtspr SPR_MAS0, %r3 isync - li %r3, (TLB_SIZE_16M << MAS1_TSIZE_SHIFT)@l + li %r3, (TLB_SIZE_64M << MAS1_TSIZE_SHIFT)@l oris %r3, %r3, (MAS1_VALID | MAS1_IPROT)@h mtspr SPR_MAS1, %r3 /* note TS was not filled, so it's TS=0 */ isync From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 19:50:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0E0BC425; Sat, 26 Oct 2013 19:50:41 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D5AE02FD1; Sat, 26 Oct 2013 19:50:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QJoePe008481; Sat, 26 Oct 2013 19:50:40 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QJoers008480; Sat, 26 Oct 2013 19:50:40 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310261950.r9QJoers008480@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 26 Oct 2013 19:50:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257191 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 19:50:41 -0000 Author: nwhitehorn Date: Sat Oct 26 19:50:40 2013 New Revision: 257191 URL: http://svnweb.freebsd.org/changeset/base/257191 Log: Handle (in a slightly ugly way) ePAPR-type loaders that just place a device tree into r3. Rather than worrying about mapping that tree, reserving its space in the global physical memory space, etc., just copy it to some memory after the kernel. Modified: head/sys/powerpc/booke/machdep.c Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Sat Oct 26 19:49:09 2013 (r257190) +++ head/sys/powerpc/booke/machdep.c Sat Oct 26 19:50:40 2013 (r257191) @@ -137,6 +137,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -276,6 +277,23 @@ print_kernel_section_addr(void) debugf(" _end = 0x%08x\n", (uint32_t)_end); } +static int +booke_check_for_fdt(uint32_t arg1, vm_offset_t *dtbp) +{ + void *ptr; + + if (arg1 % 8 != 0) + return (-1); + + ptr = (void *)pmap_early_io_map(arg1, PAGE_SIZE); + if (fdt_check_header(ptr) != 0) + return (-1); + + *dtbp = (vm_offset_t)ptr; + + return (0); +} + u_int booke_init(uint32_t arg1, uint32_t arg2) { @@ -288,6 +306,10 @@ booke_init(uint32_t arg1, uint32_t arg2) end = (uintptr_t)_end; dtbp = (vm_offset_t)NULL; + /* Set up TLB initially */ + bootinfo = NULL; + tlb1_init(); + /* * Handle the various ways we can get loaded and started: * - FreeBSD's loader passes the pointer to the metadata @@ -302,11 +324,21 @@ booke_init(uint32_t arg1, uint32_t arg2) * in arg1 and arg2 (resp). arg1 is between 1 and some * relatively small number, such as 64K. arg2 is the * physical address of the argv vector. + * - ePAPR loaders pass an FDT blob in r3 (arg1) and the magic hex + * string 0x45504150 ('ePAP') in r6 (which has been lost by now). + * r4 (arg2) is supposed to be set to zero, but is not always. */ - if (arg1 > (uintptr_t)kernel_text) /* FreeBSD loader */ - mdp = (void *)arg1; - else if (arg1 == 0) /* Juniper loader */ + + if (arg1 == 0) /* Juniper loader */ mdp = (void *)arg2; + else if (booke_check_for_fdt(arg1, &dtbp) == 0) { /* ePAPR */ + end = roundup(end, 8); + memmove((void *)end, (void *)dtbp, fdt_totalsize((void *)dtbp)); + dtbp = end; + end += fdt_totalsize((void *)dtbp); + mdp = NULL; + } else if (arg1 > (uintptr_t)kernel_text) /* FreeBSD loader */ + mdp = (void *)arg1; else /* U-Boot */ mdp = NULL; @@ -352,7 +384,7 @@ booke_init(uint32_t arg1, uint32_t arg2) OF_interpret("perform-fixup", 0); - /* Set up TLB initially */ + /* Reset TLB1 to get rid of temporary mappings */ tlb1_init(); /* Set up IMMR */ From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 19:54:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 15C2D5A5; Sat, 26 Oct 2013 19:54:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 01F542FE7; Sat, 26 Oct 2013 19:54:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QJsSJh010721; Sat, 26 Oct 2013 19:54:28 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QJsSWh010720; Sat, 26 Oct 2013 19:54:28 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310261954.r9QJsSWh010720@svn.freebsd.org> From: Xin LI Date: Sat, 26 Oct 2013 19:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r257192 - in stable: 8/usr.sbin/freebsd-update 9/usr.sbin/freebsd-update X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 19:54:29 -0000 Author: delphij Date: Sat Oct 26 19:54:28 2013 New Revision: 257192 URL: http://svnweb.freebsd.org/changeset/base/257192 Log: MFC r256646, r256767, r257038: When installing updates, install new directories first and remove old directories last. Allow ~ in file names so libtool droppings in contrib don't break updates. It has happened twice now, and is likely to happen again. Be more selective when filtering for lib*.so.N files. These are deleted at the end of the upgrade process, after warning users to upgrade any 3rd party software (e.g., from the ports tree) which might link to the libraries being removed. Errata Notice: FreeBSD-EN-13:04.freebsd-update Modified: stable/9/usr.sbin/freebsd-update/freebsd-update.sh Directory Properties: stable/9/usr.sbin/freebsd-update/ (props changed) Changes in other areas also in this revision: Modified: stable/8/usr.sbin/freebsd-update/freebsd-update.sh Directory Properties: stable/8/usr.sbin/freebsd-update/ (props changed) Modified: stable/9/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- stable/9/usr.sbin/freebsd-update/freebsd-update.sh Sat Oct 26 19:50:40 2013 (r257191) +++ stable/9/usr.sbin/freebsd-update/freebsd-update.sh Sat Oct 26 19:54:28 2013 (r257192) @@ -1200,7 +1200,7 @@ fetch_metadata_sanity () { # Some aliases to save space later: ${P} is a character which can # appear in a path; ${M} is the four numeric metadata fields; and # ${H} is a sha256 hash. - P="[-+./:=%@_[[:alnum:]]" + P="[-+./:=%@_[~[:alnum:]]" M="[0-9]+\|[0-9]+\|[0-9]+\|[0-9]+" H="[0-9a-f]{64}" @@ -2814,16 +2814,24 @@ Kernel updates have been installed. Ple # If we haven't already dealt with the world, deal with it. if ! [ -f $1/worlddone ]; then + # Create any necessary directories first + grep -vE '^/boot/' $1/INDEX-NEW | + grep -E '^[^|]+\|d\|' > INDEX-NEW + install_from_index INDEX-NEW || return 1 + # Install new shared libraries next grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 # Deal with everything else grep -vE '^/boot/' $1/INDEX-OLD | - grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD + grep -vE '^[^|]+\|d\|' | + grep -vE '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-OLD grep -vE '^/boot/' $1/INDEX-NEW | - grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -vE '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 install_delete INDEX-OLD INDEX-NEW || return 1 @@ -2844,11 +2852,11 @@ Kernel updates have been installed. Ple # Do we need to ask the user to portupgrade now? grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' | cut -f 1 -d '|' | sort > newfiles if grep -vE '^/boot/' $1/INDEX-OLD | - grep -E '/lib/.*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' | cut -f 1 -d '|' | sort | join -v 1 - newfiles | @@ -2868,9 +2876,18 @@ again to finish installing updates. # Remove old shared libraries grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW grep -vE '^/boot/' $1/INDEX-OLD | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-OLD + install_delete INDEX-OLD INDEX-NEW || return 1 + + # Remove old directories + grep -vE '^/boot/' $1/INDEX-OLD | + grep -E '^[^|]+\|d\|' > INDEX-OLD + grep -vE '^/boot/' $1/INDEX-OLD | + grep -E '^[^|]+\|d\|' > INDEX-OLD install_delete INDEX-OLD INDEX-NEW || return 1 # Remove temporary files From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 19:54:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6ABF15A6; Sat, 26 Oct 2013 19:54:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 574402FE8; Sat, 26 Oct 2013 19:54:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QJsTjN010730; Sat, 26 Oct 2013 19:54:29 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QJsTjk010729; Sat, 26 Oct 2013 19:54:29 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310261954.r9QJsTjk010729@svn.freebsd.org> From: Xin LI Date: Sat, 26 Oct 2013 19:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r257192 - in stable: 8/usr.sbin/freebsd-update 9/usr.sbin/freebsd-update X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 19:54:29 -0000 Author: delphij Date: Sat Oct 26 19:54:28 2013 New Revision: 257192 URL: http://svnweb.freebsd.org/changeset/base/257192 Log: MFC r256646, r256767, r257038: When installing updates, install new directories first and remove old directories last. Allow ~ in file names so libtool droppings in contrib don't break updates. It has happened twice now, and is likely to happen again. Be more selective when filtering for lib*.so.N files. These are deleted at the end of the upgrade process, after warning users to upgrade any 3rd party software (e.g., from the ports tree) which might link to the libraries being removed. Errata Notice: FreeBSD-EN-13:04.freebsd-update Modified: stable/8/usr.sbin/freebsd-update/freebsd-update.sh Directory Properties: stable/8/usr.sbin/freebsd-update/ (props changed) Changes in other areas also in this revision: Modified: stable/9/usr.sbin/freebsd-update/freebsd-update.sh Directory Properties: stable/9/usr.sbin/freebsd-update/ (props changed) Modified: stable/8/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- stable/8/usr.sbin/freebsd-update/freebsd-update.sh Sat Oct 26 19:50:40 2013 (r257191) +++ stable/8/usr.sbin/freebsd-update/freebsd-update.sh Sat Oct 26 19:54:28 2013 (r257192) @@ -1185,7 +1185,7 @@ fetch_metadata_sanity () { # Some aliases to save space later: ${P} is a character which can # appear in a path; ${M} is the four numeric metadata fields; and # ${H} is a sha256 hash. - P="[-+./:=%@_[[:alnum:]]" + P="[-+./:=%@_[~[:alnum:]]" M="[0-9]+\|[0-9]+\|[0-9]+\|[0-9]+" H="[0-9a-f]{64}" @@ -2765,16 +2765,24 @@ Kernel updates have been installed. Ple # If we haven't already dealt with the world, deal with it. if ! [ -f $1/worlddone ]; then + # Create any necessary directories first + grep -vE '^/boot/' $1/INDEX-NEW | + grep -E '^[^|]+\|d\|' > INDEX-NEW + install_from_index INDEX-NEW || return 1 + # Install new shared libraries next grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 # Deal with everything else grep -vE '^/boot/' $1/INDEX-OLD | - grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD + grep -vE '^[^|]+\|d\|' | + grep -vE '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-OLD grep -vE '^/boot/' $1/INDEX-NEW | - grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -vE '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 install_delete INDEX-OLD INDEX-NEW || return 1 @@ -2795,11 +2803,11 @@ Kernel updates have been installed. Ple # Do we need to ask the user to portupgrade now? grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' | cut -f 1 -d '|' | sort > newfiles if grep -vE '^/boot/' $1/INDEX-OLD | - grep -E '/lib/.*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' | cut -f 1 -d '|' | sort | join -v 1 - newfiles | @@ -2819,9 +2827,18 @@ again to finish installing updates. # Remove old shared libraries grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW grep -vE '^/boot/' $1/INDEX-OLD | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-OLD + install_delete INDEX-OLD INDEX-NEW || return 1 + + # Remove old directories + grep -vE '^/boot/' $1/INDEX-OLD | + grep -E '^[^|]+\|d\|' > INDEX-OLD + grep -vE '^/boot/' $1/INDEX-OLD | + grep -E '^[^|]+\|d\|' > INDEX-OLD install_delete INDEX-OLD INDEX-NEW || return 1 # Remove temporary files From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 19:59:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A872487D; Sat, 26 Oct 2013 19:59:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 93E28200B; Sat, 26 Oct 2013 19:59:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QJxgju011438; Sat, 26 Oct 2013 19:59:42 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QJxgRp011437; Sat, 26 Oct 2013 19:59:42 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310261959.r9QJxgRp011437@svn.freebsd.org> From: Bryan Drewery Date: Sat, 26 Oct 2013 19:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257193 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 19:59:42 -0000 Author: bdrewery (ports committer) Date: Sat Oct 26 19:59:42 2013 New Revision: 257193 URL: http://svnweb.freebsd.org/changeset/base/257193 Log: Fix build with GCC. BIO_new_mem_buf takes a void* buf, but internally it never modifies the buf. It assigns the buffer to another pointer and then marks it as read-only. So deconsting it should be safe here. Also fix warning about 'buf' possibly being unused in parse_cert() Approved by: bapt MFC after: 2 days X-MFC-With: r257147 Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Sat Oct 26 19:54:28 2013 (r257192) +++ head/usr.sbin/pkg/pkg.c Sat Oct 26 19:59:42 2013 (r257193) @@ -487,7 +487,7 @@ load_public_key_buf(const unsigned char BIO *bp; char errbuf[1024]; - bp = BIO_new_mem_buf((void *)cert, certlen); + bp = BIO_new_mem_buf(__DECONST(void *, cert), certlen); if ((pkey = PEM_read_bio_PUBKEY(bp, NULL, NULL, NULL)) == NULL) warnx("%s", ERR_error_string(ERR_get_error(), errbuf)); @@ -573,6 +573,7 @@ parse_cert(int fd) { size_t linecap; ssize_t linelen; + buf = NULL; my_fd = -1; sc = NULL; line = NULL; From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 20:01:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 380B39F7; Sat, 26 Oct 2013 20:01:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 152B42069; Sat, 26 Oct 2013 20:01:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QK13bs014004; Sat, 26 Oct 2013 20:01:03 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QK107A013905; Sat, 26 Oct 2013 20:01:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310262001.r9QK107A013905@svn.freebsd.org> From: Xin LI Date: Sat, 26 Oct 2013 20:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r257194 - in releng: 8.3 8.3/sys/conf 8.3/usr.sbin/freebsd-update 8.4 8.4/sys/conf 8.4/usr.sbin/freebsd-update 9.1 9.1/sys/conf 9.1/usr.sbin/freebsd-update 9.2 9.2/sys/conf 9.2/usr.sbin... X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 20:01:03 -0000 Author: delphij Date: Sat Oct 26 20:01:00 2013 New Revision: 257194 URL: http://svnweb.freebsd.org/changeset/base/257194 Log: MFC r256646, r256767, r257038: When installing updates, install new directories first and remove old directories last. Allow ~ in file names so libtool droppings in contrib don't break updates. It has happened twice now, and is likely to happen again. Be more selective when filtering for lib*.so.N files. These are deleted at the end of the upgrade process, after warning users to upgrade any 3rd party software (e.g., from the ports tree) which might link to the libraries being removed. Errata Notice: FreeBSD-EN-13:04.freebsd-update Approved by: so Modified: releng/8.3/UPDATING releng/8.3/sys/conf/newvers.sh releng/8.3/usr.sbin/freebsd-update/freebsd-update.sh releng/8.4/UPDATING releng/8.4/sys/conf/newvers.sh releng/8.4/usr.sbin/freebsd-update/freebsd-update.sh releng/9.1/UPDATING releng/9.1/sys/conf/newvers.sh releng/9.1/usr.sbin/freebsd-update/freebsd-update.sh releng/9.2/UPDATING releng/9.2/sys/conf/newvers.sh releng/9.2/usr.sbin/freebsd-update/freebsd-update.sh Modified: releng/8.3/UPDATING ============================================================================== --- releng/8.3/UPDATING Sat Oct 26 19:59:42 2013 (r257193) +++ releng/8.3/UPDATING Sat Oct 26 20:01:00 2013 (r257194) @@ -15,6 +15,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20131026: p12 FreeBSD-EN-13:04.freebsd-update + Fix multiple freebsd-update bugs that break upgrading to + FreeBSD 10.0. + 20130910: p11 FreeBSD-SA-13:12.ifioctl FreeBSD-SA-13:13.nullfs Modified: releng/8.3/sys/conf/newvers.sh ============================================================================== --- releng/8.3/sys/conf/newvers.sh Sat Oct 26 19:59:42 2013 (r257193) +++ releng/8.3/sys/conf/newvers.sh Sat Oct 26 20:01:00 2013 (r257194) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="8.3" -BRANCH="RELEASE-p11" +BRANCH="RELEASE-p12" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/8.3/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- releng/8.3/usr.sbin/freebsd-update/freebsd-update.sh Sat Oct 26 19:59:42 2013 (r257193) +++ releng/8.3/usr.sbin/freebsd-update/freebsd-update.sh Sat Oct 26 20:01:00 2013 (r257194) @@ -1185,7 +1185,7 @@ fetch_metadata_sanity () { # Some aliases to save space later: ${P} is a character which can # appear in a path; ${M} is the four numeric metadata fields; and # ${H} is a sha256 hash. - P="[-+./:=%@_[[:alnum:]]" + P="[-+./:=%@_[~[:alnum:]]" M="[0-9]+\|[0-9]+\|[0-9]+\|[0-9]+" H="[0-9a-f]{64}" @@ -2765,16 +2765,24 @@ Kernel updates have been installed. Ple # If we haven't already dealt with the world, deal with it. if ! [ -f $1/worlddone ]; then + # Create any necessary directories first + grep -vE '^/boot/' $1/INDEX-NEW | + grep -E '^[^|]+\|d\|' > INDEX-NEW + install_from_index INDEX-NEW || return 1 + # Install new shared libraries next grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 # Deal with everything else grep -vE '^/boot/' $1/INDEX-OLD | - grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD + grep -vE '^[^|]+\|d\|' | + grep -vE '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-OLD grep -vE '^/boot/' $1/INDEX-NEW | - grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -vE '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 install_delete INDEX-OLD INDEX-NEW || return 1 @@ -2795,11 +2803,11 @@ Kernel updates have been installed. Ple # Do we need to ask the user to portupgrade now? grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' | cut -f 1 -d '|' | sort > newfiles if grep -vE '^/boot/' $1/INDEX-OLD | - grep -E '/lib/.*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' | cut -f 1 -d '|' | sort | join -v 1 - newfiles | @@ -2819,9 +2827,18 @@ again to finish installing updates. # Remove old shared libraries grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW grep -vE '^/boot/' $1/INDEX-OLD | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-OLD + install_delete INDEX-OLD INDEX-NEW || return 1 + + # Remove old directories + grep -vE '^/boot/' $1/INDEX-OLD | + grep -E '^[^|]+\|d\|' > INDEX-OLD + grep -vE '^/boot/' $1/INDEX-OLD | + grep -E '^[^|]+\|d\|' > INDEX-OLD install_delete INDEX-OLD INDEX-NEW || return 1 # Remove temporary files Modified: releng/8.4/UPDATING ============================================================================== --- releng/8.4/UPDATING Sat Oct 26 19:59:42 2013 (r257193) +++ releng/8.4/UPDATING Sat Oct 26 20:01:00 2013 (r257194) @@ -15,6 +15,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20131026: p5 FreeBSD-EN-13:04.freebsd-update + Fix multiple freebsd-update bugs that break upgrading to + FreeBSD 10.0. + 20130910: p4 FreeBSD-SA-13:12.ifioctl FreeBSD-SA-13:13.nullfs Modified: releng/8.4/sys/conf/newvers.sh ============================================================================== --- releng/8.4/sys/conf/newvers.sh Sat Oct 26 19:59:42 2013 (r257193) +++ releng/8.4/sys/conf/newvers.sh Sat Oct 26 20:01:00 2013 (r257194) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="8.4" -BRANCH="RELEASE-p4" +BRANCH="RELEASE-p5" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/8.4/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- releng/8.4/usr.sbin/freebsd-update/freebsd-update.sh Sat Oct 26 19:59:42 2013 (r257193) +++ releng/8.4/usr.sbin/freebsd-update/freebsd-update.sh Sat Oct 26 20:01:00 2013 (r257194) @@ -1185,7 +1185,7 @@ fetch_metadata_sanity () { # Some aliases to save space later: ${P} is a character which can # appear in a path; ${M} is the four numeric metadata fields; and # ${H} is a sha256 hash. - P="[-+./:=%@_[[:alnum:]]" + P="[-+./:=%@_[~[:alnum:]]" M="[0-9]+\|[0-9]+\|[0-9]+\|[0-9]+" H="[0-9a-f]{64}" @@ -2765,16 +2765,24 @@ Kernel updates have been installed. Ple # If we haven't already dealt with the world, deal with it. if ! [ -f $1/worlddone ]; then + # Create any necessary directories first + grep -vE '^/boot/' $1/INDEX-NEW | + grep -E '^[^|]+\|d\|' > INDEX-NEW + install_from_index INDEX-NEW || return 1 + # Install new shared libraries next grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 # Deal with everything else grep -vE '^/boot/' $1/INDEX-OLD | - grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD + grep -vE '^[^|]+\|d\|' | + grep -vE '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-OLD grep -vE '^/boot/' $1/INDEX-NEW | - grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -vE '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 install_delete INDEX-OLD INDEX-NEW || return 1 @@ -2795,11 +2803,11 @@ Kernel updates have been installed. Ple # Do we need to ask the user to portupgrade now? grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' | cut -f 1 -d '|' | sort > newfiles if grep -vE '^/boot/' $1/INDEX-OLD | - grep -E '/lib/.*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' | cut -f 1 -d '|' | sort | join -v 1 - newfiles | @@ -2819,9 +2827,18 @@ again to finish installing updates. # Remove old shared libraries grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW grep -vE '^/boot/' $1/INDEX-OLD | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-OLD + install_delete INDEX-OLD INDEX-NEW || return 1 + + # Remove old directories + grep -vE '^/boot/' $1/INDEX-OLD | + grep -E '^[^|]+\|d\|' > INDEX-OLD + grep -vE '^/boot/' $1/INDEX-OLD | + grep -E '^[^|]+\|d\|' > INDEX-OLD install_delete INDEX-OLD INDEX-NEW || return 1 # Remove temporary files Modified: releng/9.1/UPDATING ============================================================================== --- releng/9.1/UPDATING Sat Oct 26 19:59:42 2013 (r257193) +++ releng/9.1/UPDATING Sat Oct 26 20:01:00 2013 (r257194) @@ -9,6 +9,10 @@ handbook. Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20131026: p8 FreeBSD-EN-13:04.freebsd-update + Fix multiple freebsd-update bugs that break upgrading to + FreeBSD 10.0. + 20130910: p7 FreeBSD-SA-13:12.ifioctl FreeBSD-SA-13:13.nullfs Modified: releng/9.1/sys/conf/newvers.sh ============================================================================== --- releng/9.1/sys/conf/newvers.sh Sat Oct 26 19:59:42 2013 (r257193) +++ releng/9.1/sys/conf/newvers.sh Sat Oct 26 20:01:00 2013 (r257194) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.1" -BRANCH="RELEASE-p7" +BRANCH="RELEASE-p8" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/9.1/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- releng/9.1/usr.sbin/freebsd-update/freebsd-update.sh Sat Oct 26 19:59:42 2013 (r257193) +++ releng/9.1/usr.sbin/freebsd-update/freebsd-update.sh Sat Oct 26 20:01:00 2013 (r257194) @@ -1200,7 +1200,7 @@ fetch_metadata_sanity () { # Some aliases to save space later: ${P} is a character which can # appear in a path; ${M} is the four numeric metadata fields; and # ${H} is a sha256 hash. - P="[-+./:=%@_[[:alnum:]]" + P="[-+./:=%@_[~[:alnum:]]" M="[0-9]+\|[0-9]+\|[0-9]+\|[0-9]+" H="[0-9a-f]{64}" @@ -2814,16 +2814,24 @@ Kernel updates have been installed. Ple # If we haven't already dealt with the world, deal with it. if ! [ -f $1/worlddone ]; then + # Create any necessary directories first + grep -vE '^/boot/' $1/INDEX-NEW | + grep -E '^[^|]+\|d\|' > INDEX-NEW + install_from_index INDEX-NEW || return 1 + # Install new shared libraries next grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 # Deal with everything else grep -vE '^/boot/' $1/INDEX-OLD | - grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD + grep -vE '^[^|]+\|d\|' | + grep -vE '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-OLD grep -vE '^/boot/' $1/INDEX-NEW | - grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -vE '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 install_delete INDEX-OLD INDEX-NEW || return 1 @@ -2844,11 +2852,11 @@ Kernel updates have been installed. Ple # Do we need to ask the user to portupgrade now? grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' | cut -f 1 -d '|' | sort > newfiles if grep -vE '^/boot/' $1/INDEX-OLD | - grep -E '/lib/.*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' | cut -f 1 -d '|' | sort | join -v 1 - newfiles | @@ -2868,9 +2876,18 @@ again to finish installing updates. # Remove old shared libraries grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW grep -vE '^/boot/' $1/INDEX-OLD | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-OLD + install_delete INDEX-OLD INDEX-NEW || return 1 + + # Remove old directories + grep -vE '^/boot/' $1/INDEX-OLD | + grep -E '^[^|]+\|d\|' > INDEX-OLD + grep -vE '^/boot/' $1/INDEX-OLD | + grep -E '^[^|]+\|d\|' > INDEX-OLD install_delete INDEX-OLD INDEX-NEW || return 1 # Remove temporary files Modified: releng/9.2/UPDATING ============================================================================== --- releng/9.2/UPDATING Sat Oct 26 19:59:42 2013 (r257193) +++ releng/9.2/UPDATING Sat Oct 26 20:01:00 2013 (r257194) @@ -11,6 +11,10 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20131026: p1 FreeBSD-EN-13:04.freebsd-update + Fix multiple freebsd-update bugs that break upgrading to + FreeBSD 10.0. + 20130705: hastctl(8)'s `status' command output changed to terse one-liner format. Scripts using this should switch to `list' command or be rewritten. Modified: releng/9.2/sys/conf/newvers.sh ============================================================================== --- releng/9.2/sys/conf/newvers.sh Sat Oct 26 19:59:42 2013 (r257193) +++ releng/9.2/sys/conf/newvers.sh Sat Oct 26 20:01:00 2013 (r257194) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.2" -BRANCH="RELEASE" +BRANCH="RELEASE-p1" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/9.2/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- releng/9.2/usr.sbin/freebsd-update/freebsd-update.sh Sat Oct 26 19:59:42 2013 (r257193) +++ releng/9.2/usr.sbin/freebsd-update/freebsd-update.sh Sat Oct 26 20:01:00 2013 (r257194) @@ -1200,7 +1200,7 @@ fetch_metadata_sanity () { # Some aliases to save space later: ${P} is a character which can # appear in a path; ${M} is the four numeric metadata fields; and # ${H} is a sha256 hash. - P="[-+./:=%@_[[:alnum:]]" + P="[-+./:=%@_[~[:alnum:]]" M="[0-9]+\|[0-9]+\|[0-9]+\|[0-9]+" H="[0-9a-f]{64}" @@ -2814,16 +2814,24 @@ Kernel updates have been installed. Ple # If we haven't already dealt with the world, deal with it. if ! [ -f $1/worlddone ]; then + # Create any necessary directories first + grep -vE '^/boot/' $1/INDEX-NEW | + grep -E '^[^|]+\|d\|' > INDEX-NEW + install_from_index INDEX-NEW || return 1 + # Install new shared libraries next grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 # Deal with everything else grep -vE '^/boot/' $1/INDEX-OLD | - grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD + grep -vE '^[^|]+\|d\|' | + grep -vE '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-OLD grep -vE '^/boot/' $1/INDEX-NEW | - grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -vE '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 install_delete INDEX-OLD INDEX-NEW || return 1 @@ -2844,11 +2852,11 @@ Kernel updates have been installed. Ple # Do we need to ask the user to portupgrade now? grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' | cut -f 1 -d '|' | sort > newfiles if grep -vE '^/boot/' $1/INDEX-OLD | - grep -E '/lib/.*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' | cut -f 1 -d '|' | sort | join -v 1 - newfiles | @@ -2868,9 +2876,18 @@ again to finish installing updates. # Remove old shared libraries grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW grep -vE '^/boot/' $1/INDEX-OLD | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-OLD + install_delete INDEX-OLD INDEX-NEW || return 1 + + # Remove old directories + grep -vE '^/boot/' $1/INDEX-OLD | + grep -E '^[^|]+\|d\|' > INDEX-OLD + grep -vE '^/boot/' $1/INDEX-OLD | + grep -E '^[^|]+\|d\|' > INDEX-OLD install_delete INDEX-OLD INDEX-NEW || return 1 # Remove temporary files From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 20:06:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4EB77C99; Sat, 26 Oct 2013 20:06:51 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3AD4C20A6; Sat, 26 Oct 2013 20:06:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QK6p2e017983; Sat, 26 Oct 2013 20:06:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QK6pgg017981; Sat, 26 Oct 2013 20:06:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310262006.r9QK6pgg017981@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 26 Oct 2013 20:06:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257195 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 20:06:51 -0000 Author: nwhitehorn Date: Sat Oct 26 20:06:50 2013 New Revision: 257195 URL: http://svnweb.freebsd.org/changeset/base/257195 Log: Try even harder to find a console before giving up. Modified: head/sys/dev/uart/uart_cpu_fdt.c Modified: head/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- head/sys/dev/uart/uart_cpu_fdt.c Sat Oct 26 20:01:00 2013 (r257194) +++ head/sys/dev/uart/uart_cpu_fdt.c Sat Oct 26 20:06:50 2013 (r257195) @@ -139,14 +139,19 @@ uart_cpu_getdev(int devtype, struct uart /* * Retrieve /chosen/std{in,out}. */ - if ((chosen = OF_finddevice("/chosen")) == -1) - return (ENXIO); - for (name = propnames; *name != NULL; name++) { - if (phandle_chosen_propdev(chosen, *name, &node) == 0) - break; + node = -1; + if ((chosen = OF_finddevice("/chosen")) != -1) { + for (name = propnames; *name != NULL; name++) { + if (phandle_chosen_propdev(chosen, *name, &node) == 0) + break; + } } - if (*name == NULL) + if (chosen == -1 || *name == NULL) + node = OF_finddevice("serial0"); /* Last ditch */ + + if (node == -1) /* Can't find anything */ return (ENXIO); + /* * Retrieve serial attributes. */ From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 20:57:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 77326E9B; Sat, 26 Oct 2013 20:57:27 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 48F882392; Sat, 26 Oct 2013 20:57:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QKvRna042155; Sat, 26 Oct 2013 20:57:27 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QKvRv3042154; Sat, 26 Oct 2013 20:57:27 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310262057.r9QKvRv3042154@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 26 Oct 2013 20:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257196 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 20:57:27 -0000 Author: nwhitehorn Date: Sat Oct 26 20:57:26 2013 New Revision: 257196 URL: http://svnweb.freebsd.org/changeset/base/257196 Log: Make devices with registers into the KVA region work reliably. Without this, previous KVA allocations (which the PMAP lazily invalidates) in TLB0 could shadow device maps in TLB1. Add a big block comment about some of the caveats with this approach. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sat Oct 26 20:06:50 2013 (r257195) +++ head/sys/powerpc/booke/pmap.c Sat Oct 26 20:57:26 2013 (r257196) @@ -189,6 +189,7 @@ static tlb_entry_t tlb1[TLB1_ENTRIES]; /* Next free entry in the TLB1 */ static unsigned int tlb1_idx; +static vm_offset_t tlb1_map_base = VM_MAX_KERNEL_ADDRESS; static tlbtid_t tid_alloc(struct pmap *); @@ -2681,11 +2682,23 @@ mmu_booke_mapdev_attr(mmu_t mmu, vm_padd size = roundup(size, PAGE_SIZE); + /* + * We leave a hole for device direct mapping between the maximum user + * address (0x8000000) and the minimum KVA address (0xc0000000). If + * devices are in there, just map them 1:1. If not, map them to the + * device mapping area about VM_MAX_KERNEL_ADDRESS. These mapped + * addresses should be pulled from an allocator, but since we do not + * ever free TLB1 entries, it is safe just to increment a counter. + * Note that there isn't a lot of address space here (128 MB) and it + * is not at all difficult to imagine running out, since that is a 4:1 + * compression from the 0xc0000000 - 0xf0000000 address space that gets + * mapped there. + */ if (pa >= (VM_MAXUSER_ADDRESS + PAGE_SIZE) && (pa + size - 1) < VM_MIN_KERNEL_ADDRESS) va = pa; else - va = kva_alloc(size); + va = atomic_fetchadd_int(&tlb1_map_base, size); res = (void *)va; do { @@ -3085,7 +3098,7 @@ tlb1_mapin_region(vm_offset_t va, vm_pad } mapped = (va - base); - debugf("mapped size 0x%08x (wasted space 0x%08x)\n", + printf("mapped size 0x%08x (wasted space 0x%08x)\n", mapped, mapped - size); return (mapped); } @@ -3148,7 +3161,6 @@ tlb1_init() vm_offset_t pmap_early_io_map(vm_paddr_t pa, vm_size_t size) { - static vm_offset_t early_io_map_base = VM_MAX_KERNEL_ADDRESS; vm_paddr_t pa_base; vm_offset_t va, sz; int i; @@ -3165,14 +3177,14 @@ pmap_early_io_map(vm_paddr_t pa, vm_size pa_base = trunc_page(pa); size = roundup(size + (pa - pa_base), PAGE_SIZE); - va = early_io_map_base + (pa - pa_base); + va = tlb1_map_base + (pa - pa_base); do { sz = 1 << (ilog2(size) & ~1); - tlb1_set_entry(early_io_map_base, pa_base, sz, _TLB_ENTRY_IO); + tlb1_set_entry(tlb1_map_base, pa_base, sz, _TLB_ENTRY_IO); size -= sz; pa_base += sz; - early_io_map_base += sz; + tlb1_map_base += sz; } while (size > 0); #ifdef SMP From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 21:47:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EEEFDD6E; Sat, 26 Oct 2013 21:47:25 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from csmtp11.one.com (csmtp11.one.com [195.47.247.117]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 524C425C3; Sat, 26 Oct 2013 21:47:25 +0000 (UTC) Received: from [192.168.1.82] (unknown [176.222.238.90]) by csmtp11.one.com (Postfix) with ESMTPA id 3D5F9C03B5C8B; Sat, 26 Oct 2013 21:47:16 +0000 (UTC) Received: from [192.168.1.82] ([UNAVAILABLE]. [176.222.238.90]) (using TLSv1 with cipher AES128-SHA) by 0.0.0.0:587 (trex/4.8.87); Sat, 26 Oct 2013 21:47:16 GMT Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1816\)) Subject: Re: svn commit: r257129 - head/contrib/subversion/subversion/libsvn_subr From: Erik Cederstrand In-Reply-To: Date: Sat, 26 Oct 2013 23:47:16 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <9E9A07EE-8612-4742-B4E0-2988EAD5312F@cederstrand.dk> References: <201310251843.r9PIhsGh083931@svn.freebsd.org> To: Eitan Adler X-Mailer: Apple Mail (2.1816) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Colin Percival X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 21:47:26 -0000 Den 26/10/2013 kl. 01.07 skrev Eitan Adler : > On Fri, Oct 25, 2013 at 2:43 PM, Colin Percival = wrote: >> Author: cperciva >> Date: Fri Oct 25 18:43:53 2013 >> New Revision: 257129 >> URL: http://svnweb.freebsd.org/changeset/base/257129 >>=20 >> Log: >> Remove time and date stamps from svn* binaries, in order to make the >> builds reproducible. >=20 > I wonder if we could work on a wiki paging listing all the other > non-reproducible portions of the FreeBSD build process. This depends greatly on under circumstances you want reproducibility. = Just timestamp of the build, or also username, hostname, SRCDIR/DESTDIR, = SVN revision and FreeBSD major/minor version? Some of this can be done = by placing dummy time, whoami and hostname binaries in = /usr/src/tools/build/ and using those during the build but should be = configurable, as some of that information could be usable for debugging. Have a look at sendmail config files. They are about as non-reproducible = as they come :-) Erik= From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 21:52:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 75D28F62 for ; Sat, 26 Oct 2013 21:52:16 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-qe0-x22c.google.com (mail-qe0-x22c.google.com [IPv6:2607:f8b0:400d:c02::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2EC5A260A for ; Sat, 26 Oct 2013 21:52:16 +0000 (UTC) Received: by mail-qe0-f44.google.com with SMTP id 6so3208649qeb.31 for ; Sat, 26 Oct 2013 14:52:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=tUCJYZmEuPlyozpTJkCjsV8aLUMHavaGaUWmhEGbTCA=; b=oxQL5Gq3pvP8gOHfvmpl6UV5pxZkD/qq92ChRZAfhY0F/ZcLfDqzO/iWWrokMYYQVg 3B9q8zBYt/asB0OoTmf8GitYF1wQwmhgpWM++hJ2Gtw6vghonBK1QBTxJ92850bgh7Mq oX7tPQjNWgroAgN2vGloP67pH4NJw1lAZsvh0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=tUCJYZmEuPlyozpTJkCjsV8aLUMHavaGaUWmhEGbTCA=; b=eC+KVlQk4GAQXx/RcmqjVN0ZTkAbcZC8uog9MOxXZeESrOdd7S4jW9vsyuDjgxovRC xNI0SpMF+FyfgEW+DNB5RuLizZ37l2uORwsN1XVS+25M2bVebaArkAB75Xj6tSvy8kLp BLsmFC/Pv4zEFICvBbpQVwal+d9YsX06hOC6V1Y5kSBE/A8Cu9ikcKneGZ2ifMDCYMMq K4rHxcgFWnw7HPnqV/rnYPLRmV3LDaxhvQw0YlvmAQWPYD7hl5igGX5l9zvRwFScFo3H r0IFUGkrUostJFwVpGBQB0MxUKAzQq7HZnZn9PIAQyCB60ogn3K+Vt5T9C+GEJR7HNys O7Ew== X-Gm-Message-State: ALoCoQlbLTpiZn5slvnPknW6FO7PlINdvA8q9JRuaS3PsygQGBoh4InDtSN/fiiKxcKxHRASFLKQ X-Received: by 10.224.160.83 with SMTP id m19mr4681812qax.108.1382824335116; Sat, 26 Oct 2013 14:52:15 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.63.101 with HTTP; Sat, 26 Oct 2013 14:51:45 -0700 (PDT) In-Reply-To: <9E9A07EE-8612-4742-B4E0-2988EAD5312F@cederstrand.dk> References: <201310251843.r9PIhsGh083931@svn.freebsd.org> <9E9A07EE-8612-4742-B4E0-2988EAD5312F@cederstrand.dk> From: Eitan Adler Date: Sat, 26 Oct 2013 17:51:45 -0400 X-Google-Sender-Auth: 47gdKxudnqARm9GIlORDZmaAfck Message-ID: Subject: Re: svn commit: r257129 - head/contrib/subversion/subversion/libsvn_subr To: Erik Cederstrand 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" , Colin Percival X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 21:52:16 -0000 On Sat, Oct 26, 2013 at 5:47 PM, Erik Cederstrand wro= te: > Den 26/10/2013 kl. 01.07 skrev Eitan Adler : > >> On Fri, Oct 25, 2013 at 2:43 PM, Colin Percival w= rote: >>> Author: cperciva >>> Date: Fri Oct 25 18:43:53 2013 >>> New Revision: 257129 >>> URL: http://svnweb.freebsd.org/changeset/base/257129 >>> >>> Log: >>> Remove time and date stamps from svn* binaries, in order to make the >>> builds reproducible. >> >> I wonder if we could work on a wiki paging listing all the other >> non-reproducible portions of the FreeBSD build process. > > This depends greatly on under circumstances you want reproducibility. Jus= t timestamp of the build, or also username, hostname, SRCDIR/DESTDIR, SVN r= evision and FreeBSD major/minor version? Some of this can be done by placin= g dummy time, whoami and hostname binaries in /usr/src/tools/build/ and usi= ng those during the build but should be configurable, as some of that infor= mation could be usable for debugging. I'd just want all of this to be documented somewhere. What values may change from build to build if you keep the sources and build options identical. Changing any of these things could be a second step and possibly even hidden under a flag. > Have a look at sendmail config files. They are about as non-reproducible = as they come :-) --=20 Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 23:13:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D4C0FA46; Sat, 26 Oct 2013 23:13:21 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C121F2905; Sat, 26 Oct 2013 23:13:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QNDL87089943; Sat, 26 Oct 2013 23:13:21 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QNDKm6089937; Sat, 26 Oct 2013 23:13:20 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310262313.r9QNDKm6089937@svn.freebsd.org> From: Ian Lepore Date: Sat, 26 Oct 2013 23:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257197 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 23:13:21 -0000 Author: ian Date: Sat Oct 26 23:13:20 2013 New Revision: 257197 URL: http://svnweb.freebsd.org/changeset/base/257197 Log: Maximize available kva space by doing static device mapping from the top of the address space downwards, and then returning the lowest mapped device address from initarm_lastaddr(). This adds over 500MB of kva space compared to the old way of hardcoding the end address as 0xE0000000. Also, pre-map most of the SoC's common memory-mapped devices using 1MB section mappings so that all device access uses just a few TLB entries. Graphics devices aren't mapped this way yet, but probably should be. To provide this new functionality without pasting identical code into multiple imxNN_machdep.c files, rework the imx machdep code so that things common to the whole family of SoCs are in a new imx_machdep.c file. The rewritten imxNN_machdep.c files contain just things specific to an individual SoC. Added: head/sys/arm/freescale/imx/imx_machdep.c (contents, props changed) head/sys/arm/freescale/imx/imx_machdep.h (contents, props changed) Modified: head/sys/arm/freescale/imx/files.imx51 head/sys/arm/freescale/imx/files.imx53 head/sys/arm/freescale/imx/imx51_machdep.c head/sys/arm/freescale/imx/imx53_machdep.c Modified: head/sys/arm/freescale/imx/files.imx51 ============================================================================== --- head/sys/arm/freescale/imx/files.imx51 Sat Oct 26 20:57:26 2013 (r257196) +++ head/sys/arm/freescale/imx/files.imx51 Sat Oct 26 23:13:20 2013 (r257197) @@ -8,6 +8,7 @@ arm/arm/irq_dispatch.S standard kern/kern_clocksource.c standard # Init +arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx51_machdep.c standard arm/freescale/imx/common.c standard arm/freescale/imx/bus_space.c standard Modified: head/sys/arm/freescale/imx/files.imx53 ============================================================================== --- head/sys/arm/freescale/imx/files.imx53 Sat Oct 26 20:57:26 2013 (r257196) +++ head/sys/arm/freescale/imx/files.imx53 Sat Oct 26 23:13:20 2013 (r257197) @@ -8,6 +8,7 @@ arm/arm/irq_dispatch.S standard kern/kern_clocksource.c standard # Init +arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx53_machdep.c standard arm/freescale/imx/common.c standard arm/freescale/imx/bus_space.c standard Modified: head/sys/arm/freescale/imx/imx51_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_machdep.c Sat Oct 26 20:57:26 2013 (r257196) +++ head/sys/arm/freescale/imx/imx51_machdep.c Sat Oct 26 23:13:20 2013 (r257197) @@ -1,14 +1,7 @@ /*- - * Copyright (c) 1994-1998 Mark Brinicombe. - * Copyright (c) 1994 Brini. - * Copyright (c) 2012, 2013 The FreeBSD Foundation + * Copyright (c) 2013 Ian Lepore * All rights reserved. * - * - * This code is derived from software written for Brini by Mark Brinicombe - * Portions of this software were developed by Oleksandr Rybalko - * under sponsorship from the FreeBSD Foundation. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -17,26 +10,18 @@ * 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 Brini. - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. * - * THIS SOFTWARE IS PROVIDED BY BRINI ``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 BRINI 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) + * 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. - * - * from: FreeBSD: //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c, rev 45 */ #include "opt_platform.h" @@ -44,99 +29,42 @@ #include __FBSDID("$FreeBSD$"); -#define _ARM32_BUS_DMA_PRIVATE #include #include #include #include -#include -#include - -#include -#include /* For trapframe_t, used in */ #include -#include - -#include - -#define IMX51_DEV_VIRT_BASE 0xe0000000 -vm_offset_t -initarm_lastaddr(void) -{ - - boothowto |= RB_VERBOSE|RB_MULTIPLE; - bootverbose = 1; - - if (fdt_immr_addr(IMX51_DEV_VIRT_BASE) != 0) - while (1); - - /* Platform-specific initialisation */ - return (fdt_immr_va - ARM_NOCACHE_KVA_SIZE); -} +#include /* - * Set initial values of GPIO output ports + * Set up static device mappings. This is hand-optimized platform-specific + * config data which covers most of the common on-chip devices with a few 1MB + * section mappings. + * + * Notably missing are entries for GPU, IPU, in general anything video related. + * + * Note that for imx this is called from initarm_lastaddr() so that the lowest + * kva address used for static device mapping can be known at that point. */ void -initarm_gpio_init(void) +imx_devmap_init(void) { + imx_devmap_addentry(0x70000000, 0x00100000); + imx_devmap_addentry(0x73f00000, 0x00100000); + imx_devmap_addentry(0x83f00000, 0x00100000); } void -initarm_late_init(void) -{ - -} - -#define FDT_DEVMAP_MAX 2 -static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { - { 0, 0, 0, 0, 0, }, - { 0, 0, 0, 0, 0, } -}; - -/* - * Construct pmap_devmap[] with DT-derived config data. - */ -int -platform_devmap_init(void) -{ - - /* - * Map segment where UART1 and UART2 located. - */ - fdt_devmap[0].pd_va = IMX51_DEV_VIRT_BASE + 0x03f00000; - fdt_devmap[0].pd_pa = 0x73f00000; - fdt_devmap[0].pd_size = 0x00100000; - fdt_devmap[0].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[0].pd_cache = PTE_NOCACHE; - - pmap_devmap_bootstrap_table = &fdt_devmap[0]; - return (0); -} - -struct arm32_dma_range * -bus_dma_get_range(void) +cpu_reset(void) { - return (NULL); + imx_wdog_cpu_reset(0x73F98000); } -int -bus_dma_get_range_nb(void) +u_int imx_soc_type() { - - return (0); + return (IMXSOC_51); } -void -cpu_reset(void) -{ - - printf("Reset ...\n"); - /* Clear n_reset flag */ - *((volatile u_int16_t *)(IMX51_DEV_VIRT_BASE + 0x03f98000)) = - (u_int16_t)0; - while (1); -} Modified: head/sys/arm/freescale/imx/imx53_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx53_machdep.c Sat Oct 26 20:57:26 2013 (r257196) +++ head/sys/arm/freescale/imx/imx53_machdep.c Sat Oct 26 23:13:20 2013 (r257197) @@ -1,13 +1,7 @@ /*- - * Copyright (c) 1994-1998 Mark Brinicombe. - * Copyright (c) 1994 Brini. - * Copyright (c) 2012, 2013 The FreeBSD Foundation + * Copyright (c) 2013 Ian Lepore * All rights reserved. * - * This code is derived from software written for Brini by Mark Brinicombe - * Portions of this software were developed by Oleksandr Rybalko - * under sponsorship from the FreeBSD Foundation. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -16,20 +10,14 @@ * 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 Brini. - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. * - * THIS SOFTWARE IS PROVIDED BY BRINI ``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 BRINI 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) + * 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 @@ -41,101 +29,43 @@ #include __FBSDID("$FreeBSD$"); -#define _ARM32_BUS_DMA_PRIVATE #include #include #include #include -#include -#include - -#include -#include /* For trapframe_t, used in */ #include -#include - -#include - -#define IMX53_DEV_VIRT_BASE 0xe0000000 - -vm_offset_t -initarm_lastaddr(void) -{ - - boothowto |= RB_VERBOSE|RB_MULTIPLE; - bootverbose = 1; - - if (fdt_immr_addr(IMX53_DEV_VIRT_BASE) != 0) - while (1); - - /* Platform-specific initialisation */ - return (fdt_immr_va - ARM_NOCACHE_KVA_SIZE); -} +#include /* - * Set initial values of GPIO output ports + * Set up static device mappings. This is hand-optimized platform-specific + * config data which covers most of the common on-chip devices with a few 1MB + * section mappings. + * + * Notably missing are entries for GPU, IPU, in general anything video related. + * + * Note that for imx this is called from initarm_lastaddr() so that the lowest + * kva address used for static device mapping can be known at that point. */ void -initarm_gpio_init(void) +imx_devmap_init(void) { + imx_devmap_addentry(0x50000000, 0x00100000); + imx_devmap_addentry(0x53f00000, 0x00100000); + imx_devmap_addentry(0x63f00000, 0x00100000); } void -initarm_late_init(void) -{ - -} - -#define FDT_DEVMAP_MAX 2 -static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { - { 0, 0, 0, 0, 0, }, - { 0, 0, 0, 0, 0, } -}; - -/* - * Construct pmap_devmap[] with DT-derived config data. - */ -int -platform_devmap_init(void) -{ - - /* - * Map segment where UART1 and UART2 located. - */ - fdt_devmap[0].pd_va = IMX53_DEV_VIRT_BASE + 0x03f00000; - fdt_devmap[0].pd_pa = 0x53f00000; - fdt_devmap[0].pd_size = 0x00100000; - fdt_devmap[0].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[0].pd_cache = PTE_NOCACHE; - - pmap_devmap_bootstrap_table = &fdt_devmap[0]; - - return (0); -} - -struct arm32_dma_range * -bus_dma_get_range(void) +cpu_reset(void) { - return (NULL); + imx_wdog_cpu_reset(0x53F98000); } -int -bus_dma_get_range_nb(void) +u_int imx_soc_type() { - - return (0); + return (IMXSOC_53); } -void -cpu_reset(void) -{ - printf("Reset ...\n"); - /* Clear n_reset flag */ - *((volatile u_int16_t *)(IMX53_DEV_VIRT_BASE + 0x03f98000)) = - (u_int16_t)0; - while (1); -} Added: head/sys/arm/freescale/imx/imx_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx_machdep.c Sat Oct 26 23:13:20 2013 (r257197) @@ -0,0 +1,200 @@ +/*- + * Copyright (c) 2013 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#define _ARM32_BUS_DMA_PRIVATE +#include +#include +#include + +#include +#include + +#include +#include +#include /* For trapframe_t, used in */ +#include +#include + +#include +#include + +#define IMX_MAX_DEVMAP_ENTRIES 8 + +static struct pmap_devmap devmap_entries[IMX_MAX_DEVMAP_ENTRIES]; +static u_int devmap_idx; +static vm_offset_t devmap_vaddr = ARM_VECTORS_HIGH; + +void +imx_devmap_addentry(vm_paddr_t pa, vm_size_t sz) +{ + struct pmap_devmap *m; + + /* + * The last table entry is the all-zeroes end-of-table marker. If we're + * about to overwrite it the world is coming to an end. This code runs + * too early for the panic to be printed unless a special early-debug + * console is in use, but there's nothing else we can do. + */ + if (devmap_idx == (IMX_MAX_DEVMAP_ENTRIES - 1)) + panic("IMX_MAX_DEVMAP_ENTRIES is too small!\n"); + + /* + * Allocate virtual address space from the top of kva downwards. If the + * range being mapped is aligned and sized to 1MB boundaries then also + * align the virtual address to the next-lower 1MB boundary so that we + * end up with a section mapping. + */ + if ((pa & 0x000fffff) == 0 && (sz & 0x000fffff) == 0) { + devmap_vaddr = (devmap_vaddr - sz) & ~0x000fffff; + } else { + devmap_vaddr = (devmap_vaddr - sz) & ~0x00000fff; + } + m = &devmap_entries[devmap_idx++]; + m->pd_va = devmap_vaddr; + m->pd_pa = pa; + m->pd_size = sz; + m->pd_prot = VM_PROT_READ | VM_PROT_WRITE; + m->pd_cache = PTE_DEVICE; +} + +vm_offset_t +initarm_lastaddr(void) +{ + + /* XXX - Get rid of this stuff soon. */ + boothowto |= RB_VERBOSE|RB_MULTIPLE; + bootverbose = 1; + + /* + * Normally initarm() calls platform_devmap_init() much later in the + * init process to set up static device mappings. To calculate the + * highest available kva address we have to do that setup first. It + * maps downwards from ARM_VECTORS_HIGH and the last usable kva address + * is the point right before the virtual address of the first static + * mapping. So go set up the static mapping table now, then we can + * return the lowest static devmap vaddr as the end of usable kva. + */ + imx_devmap_init(); + + pmap_devmap_bootstrap_table = devmap_entries; + + return (devmap_vaddr); +} + +int +platform_devmap_init(void) +{ + + /* On imx this work is done during initarm_lastaddr(). */ + return (0); +} + +/* + * Set initial values of GPIO output ports + */ +void +initarm_gpio_init(void) +{ + +} + +void +initarm_late_init(void) +{ + struct pmap_devmap *m; + + /* + * We did the static devmap setup earlier, during initarm_lastaddr(), + * but now the console should be working and we can be verbose about + * what we did. + */ + if (bootverbose) { + for (m = devmap_entries; m->pd_va != 0; ++m) { + printf("Devmap: phys 0x%08x virt 0x%08x size %uK\n", + m->pd_pa, m->pd_va, m->pd_size / 1024); + } + } + + +} + +struct arm32_dma_range * +bus_dma_get_range(void) +{ + + return (NULL); +} + +int +bus_dma_get_range_nb(void) +{ + + return (0); +} + +void +imx_wdog_cpu_reset(vm_offset_t wdcr_physaddr) +{ + + /* + * This code which manipulates the watchdog hardware is here to + * implement cpu_reset() because the watchdog is the only way for + * software to reset the chip. Why here and not in imx_wdog.c? Because + * there's no requirement that the watchdog driver be compiled in, but + * it's nice to be able to reboot even if it's not. + */ + volatile uint16_t * pcr; + const struct pmap_devmap *pd; + + if ((pd = pmap_devmap_find_pa(wdcr_physaddr, 2)) == NULL) { + printf("cpu_reset() can't find its control register... locking up now."); + } else { + pcr = (uint16_t *)(pd->pd_va + (wdcr_physaddr - pd->pd_pa)); + /* + * This deceptively simple write enables the watchdog, sets the timeout + * to its minimum value (half a second), and also clears the SRS bit + * which results in the SFTW (software-requested reset) bit being set in + * the watchdog status register after the reset. This is how software + * can distinguish a requested reset from a wdog timeout. + */ + *pcr = WDOG_CR_WDE; + } + while (1) + continue; +} + +u_int +imx_soc_family(void) +{ + return (imx_soc_type() >> IMXSOC_FAMSHIFT); +} + + Added: head/sys/arm/freescale/imx/imx_machdep.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx_machdep.h Sat Oct 26 23:13:20 2013 (r257197) @@ -0,0 +1,60 @@ +/*- + * Copyright (c) 2013 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef IMX_MACHDEP_H +#define IMX_MACHDEP_H + +#include + +/* Common functions, implemented in imx_machdep.c. */ + +void imx_devmap_addentry(vm_paddr_t _pa, vm_size_t _sz); +void imx_wdog_cpu_reset(vm_offset_t _wdcr_phys) __attribute__((__noreturn__)); + +/* + * SoC identity. + */ +#define IMXSOC_51 0x05000100 +#define IMXSOC_53 0x05000300 +#define IMXSOC_6S 0x06000010 +#define IMXSOC_6SL 0x06000011 +#define IMXSOC_6D 0x06000020 +#define IMXSOC_6DL 0x06000021 +#define IMXSOC_6Q 0x06000040 +#define IMXSOC_6QL 0x06000041 +#define IMXSOC_FAMSHIFT 24 + +u_int imx_soc_type(void); +u_int imx_soc_family(void); + +/* From here down, routines are implemented in imxNN_machdep.c. */ + +void imx_devmap_init(void); + +#endif + From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 23:37:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 26EFECF for ; Sat, 26 Oct 2013 23:37:50 +0000 (UTC) (envelope-from julio@meroh.net) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A81F229DC for ; Sat, 26 Oct 2013 23:37:49 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id w6so1846248lbh.27 for ; Sat, 26 Oct 2013 16:37:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=dgUKXFqohEKxn3kZrLiugPyMRz6abv0u6a6T2i0SQXI=; b=gWJu4pvVylPMb+b0A4EG+DHrnwH9CGzK/19meVfEarwxePzJrrEy6+MoX8tbBfvrMu RZmSrY5SxRi44lAod4oFsbR95DbP2HkcdKHjl0P9NHFWCnioXwP/VJtRDe934moy3FSy Q3jMsm3ooL/5X+1stEO298CuDn29cqTmmztjctWiHs6vqSuZ5oBbIk/D31XZpkR3nWyW v5Isd5ObY95neuUr+Ci2LbGAZiadzmDRyIb/L0FmYpDXWvQWn9xPRwdHvujY50NDJJLl C4zfEQWnN7pH4ySPvefa9XuXbf2LiXw4yvyQ//He6Y6gfKJxl7lpvefABtOt/95S6C7w h3IA== X-Gm-Message-State: ALoCoQkIA+vMvwtIKUvaC2fahvJPuRByRa1zzilzQF2EaIDqPG78shSq6rziW8r6FkyvyF9Yuw98 X-Received: by 10.152.180.139 with SMTP id do11mr9568786lac.23.1382830661978; Sat, 26 Oct 2013 16:37:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.132.135 with HTTP; Sat, 26 Oct 2013 16:37:21 -0700 (PDT) X-Originating-IP: [108.176.158.82] In-Reply-To: <201310261454.r9QEsiGJ006448@svn.freebsd.org> References: <201310261454.r9QEsiGJ006448@svn.freebsd.org> From: Julio Merino Date: Sat, 26 Oct 2013 19:37:21 -0400 Message-ID: Subject: Re: svn commit: r257162 - head/sys/powerpc/include To: Nathan Whitehorn Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 23:37:50 -0000 On Sat, Oct 26, 2013 at 10:54 AM, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sat Oct 26 14:54:43 2013 > New Revision: 257162 > URL: http://svnweb.freebsd.org/changeset/base/257162 > > Log: > The old trap.h (then trap_aim.h) actually had trap ID codes for Book-E CPUs. > Use it universally. Book-E traps may also need revisiting due to the > introduction of fixed-offset traps and the deprecation of IVORs in POWER > ISA 2.06, but that's very much an issue for another day. > > Deleted: > head/sys/powerpc/include/trap_aim.h > head/sys/powerpc/include/trap_booke.h > Modified: > head/sys/powerpc/include/trap.h This has broken sys/boot/powerpc/ps3/start.S . -- Julio Merino / @jmmv From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 23:41:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D7AC9226; Sat, 26 Oct 2013 23:41:11 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C3E732A12; Sat, 26 Oct 2013 23:41:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9QNfBe9099348; Sat, 26 Oct 2013 23:41:11 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9QNfBUs099347; Sat, 26 Oct 2013 23:41:11 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310262341.r9QNfBUs099347@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 26 Oct 2013 23:41:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257198 - head/sys/boot/powerpc/ps3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 23:41:11 -0000 Author: nwhitehorn Date: Sat Oct 26 23:41:11 2013 New Revision: 257198 URL: http://svnweb.freebsd.org/changeset/base/257198 Log: Fix build after r257162. Modified: head/sys/boot/powerpc/ps3/start.S Modified: head/sys/boot/powerpc/ps3/start.S ============================================================================== --- head/sys/boot/powerpc/ps3/start.S Sat Oct 26 23:13:20 2013 (r257197) +++ head/sys/boot/powerpc/ps3/start.S Sat Oct 26 23:41:11 2013 (r257198) @@ -27,7 +27,7 @@ #define LOCORE -#include +#include /* * KBoot and simulators will start this program from the _start symbol, with From owner-svn-src-all@FreeBSD.ORG Sat Oct 26 23:41:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 61679369; Sat, 26 Oct 2013 23:41:49 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from smtpauth2.wiscmail.wisc.edu (wmauth2.doit.wisc.edu [144.92.197.222]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 313BC2A21; Sat, 26 Oct 2013 23:41:47 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0MVA00100UKXOI00@smtpauth2.wiscmail.wisc.edu>; Sat, 26 Oct 2013 18:41:40 -0500 (CDT) X-Spam-PmxInfo: Server=avs-2, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.10.26.233314, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from wanderer.tachypleus.net (adsl-76-208-69-44.dsl.mdsnwi.sbcglobal.net [76.208.69.44]) by smtpauth2.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0MVA004T1V5F1V10@smtpauth2.wiscmail.wisc.edu>; Sat, 26 Oct 2013 18:41:40 -0500 (CDT) Message-id: <526C5333.3030002@freebsd.org> Date: Sat, 26 Oct 2013 18:41:39 -0500 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 To: Julio Merino Subject: Re: svn commit: r257162 - head/sys/powerpc/include References: <201310261454.r9QEsiGJ006448@svn.freebsd.org> In-reply-to: X-Enigmail-Version: 1.5.2 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 23:41:49 -0000 On 10/26/13 18:37, Julio Merino wrote: > On Sat, Oct 26, 2013 at 10:54 AM, Nathan Whitehorn > wrote: >> Author: nwhitehorn >> Date: Sat Oct 26 14:54:43 2013 >> New Revision: 257162 >> URL: http://svnweb.freebsd.org/changeset/base/257162 >> >> Log: >> The old trap.h (then trap_aim.h) actually had trap ID codes for Book-E CPUs. >> Use it universally. Book-E traps may also need revisiting due to the >> introduction of fixed-offset traps and the deprecation of IVORs in POWER >> ISA 2.06, but that's very much an issue for another day. >> >> Deleted: >> head/sys/powerpc/include/trap_aim.h >> head/sys/powerpc/include/trap_booke.h >> Modified: >> head/sys/powerpc/include/trap.h > This has broken sys/boot/powerpc/ps3/start.S . > Ack! Thanks, it's fixed now. -Nathan